You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/3178.0ffa785c.async.js

3279 lines
2.1 MiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

!(function(){var $s=Math.pow;var Za=(It,Ue,Q)=>new Promise((he,fe)=>{var i=p=>{try{E(Q.next(p))}catch(g){fe(g)}},M=p=>{try{E(Q.throw(p))}catch(g){fe(g)}},E=p=>p.done?he(p.value):Promise.resolve(p.value).then(i,M);E((Q=Q.apply(It,Ue)).next())});(self.webpackChunk=self.webpackChunk||[]).push([[3178],{55304:function(It,Ue,Q){"use strict";Q.d(Ue,{Z:function(){return g}});var he=Q(87462),fe=Q(67294),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},M=i,E=Q(74643),p=function(h,v){return fe.createElement(E.Z,(0,he.Z)({},h,{ref:v,icon:M}))},g=fe.forwardRef(p)},38308:function(It,Ue,Q){"use strict";Q.d(Ue,{Z:function(){return g}});var he=Q(87462),fe=Q(67294),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"},M=i,E=Q(74643),p=function(h,v){return fe.createElement(E.Z,(0,he.Z)({},h,{ref:v,icon:M}))},g=fe.forwardRef(p)},71749:function(){"use strict"},30483:function(){"use strict"},56448:function(It){(function(Ue){(function(Q){if(1)It.exports=Q();else var he})(function(){var Q,he,fe;return function(){function i(M,E,p){function g(v,d){if(!E[v]){if(!M[v]){var o=void 0;if(!d&&o)return require(v,!0);if(l)return l(v,!0);var s=new Error("Cannot find module '"+v+"'");throw s.code="MODULE_NOT_FOUND",s}var u=E[v]={exports:{}};M[v][0].call(u.exports,function(m){var y=M[v][1][m];return g(y||m)},u,u.exports,i,M,E,p)}return E[v].exports}for(var l=void 0,h=0;h<p.length;h++)g(p[h]);return g}return i}()({1:[function(i,M,E){"use strict";var p=i("./browser/client");p.Buffer=i("buffer").Buffer,p.urllib=i("../shims/xhr"),p.version=i("./browser/version").version,M.exports=p},{"../shims/xhr":475,"./browser/client":3,"./browser/version":6,buffer:90}],2:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator")),l=p(i("@babel/runtime/helpers/asyncToGenerator"));i("core-js/modules/es.object.to-string.js"),i("core-js/modules/web.dom-collections.for-each.js"),i("core-js/modules/es.object.keys.js"),i("core-js/modules/es.array.slice.js");var h=i("assert"),v=i("../common/utils/checkBucketName"),d=v.checkBucketName,o=E;function s(m){return Array.isArray?Array.isArray(m):Object.prototype.toString.call(m)==="[object Array]"}function u(m){return m?s(m)?m:[m]:[]}o.useBucket=function(y){return d(y),this.options.bucket=y,this},o.setBucket=function(y){return d(y),this.options.bucket=y,this},o.getBucket=function(){return this.options.bucket},o.deleteBucket=function(){var m=(0,l.default)(g.default.mark(function _(x,S){var w,A;return g.default.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return w=this._bucketRequestParams("DELETE",x,"",S),R.next=3,this.request(w);case 3:if(A=R.sent,!(A.status===200||A.status===204)){R.next=6;break}return R.abrupt("return",{res:A.res});case 6:return R.next=8,this.requestError(A);case 8:throw R.sent;case 9:case"end":return R.stop()}},_,this)}));function y(_,x){return m.apply(this,arguments)}return y}(),o.putBucketACL=function(){var m=(0,l.default)(g.default.mark(function _(x,S,w){var A,H;return g.default.wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return A=this._bucketRequestParams("PUT",x,"acl",w),A.headers={"x-oss-acl":S},A.successStatuses=[200],F.next=5,this.request(A);case 5:return H=F.sent,F.abrupt("return",{bucket:H.headers.location&&H.headers.location.substring(1)||null,res:H.res});case 7:case"end":return F.stop()}},_,this)}));function y(_,x,S){return m.apply(this,arguments)}return y}(),o.getBucketACL=function(){var m=(0,l.default)(g.default.mark(function _(x,S){var w,A;return g.default.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return w=this._bucketRequestParams("GET",x,"acl",S),w.successStatuses=[200],w.xmlResponse=!0,R.next=5,this.request(w);case 5:return A=R.sent,R.abrupt("return",{acl:A.data.AccessControlList.Grant,owner:{id:A.data.Owner.ID,displayName:A.data.Owner.DisplayName},res:A.res});case 7:case"end":return R.stop()}},_,this)}));function y(_,x){return m.apply(this,arguments)}return y}(),o.putBucketLogging=function(){var m=(0,l.default)(g.default.mark(function _(x,S,w){var A,H,R;return g.default.wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return A=this._bucketRequestParams("PUT",x,"logging",w),H=`<?xml version="1.0" encoding="UTF-8"?>
<BucketLoggingStatus>
<LoggingEnabled>
<TargetBucket>`.concat(x,`</TargetBucket>
`),S&&(H+="<TargetPrefix>".concat(S,`</TargetPrefix>
`)),H+=`</LoggingEnabled>
</BucketLoggingStatus>`,A.content=H,A.mime="xml",A.successStatuses=[200],D.next=9,this.request(A);case 9:return R=D.sent,D.abrupt("return",{res:R.res});case 11:case"end":return D.stop()}},_,this)}));function y(_,x,S){return m.apply(this,arguments)}return y}(),o.getBucketLogging=function(){var m=(0,l.default)(g.default.mark(function _(x,S){var w,A,H;return g.default.wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return w=this._bucketRequestParams("GET",x,"logging",S),w.successStatuses=[200],w.xmlResponse=!0,F.next=5,this.request(w);case 5:return A=F.sent,H=A.data.LoggingEnabled,F.abrupt("return",{enable:!!H,prefix:H&&H.TargetPrefix||null,res:A.res});case 8:case"end":return F.stop()}},_,this)}));function y(_,x){return m.apply(this,arguments)}return y}(),o.deleteBucketLogging=function(){var m=(0,l.default)(g.default.mark(function _(x,S){var w,A;return g.default.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return w=this._bucketRequestParams("DELETE",x,"logging",S),w.successStatuses=[204,200],R.next=4,this.request(w);case 4:return A=R.sent,R.abrupt("return",{res:A.res});case 6:case"end":return R.stop()}},_,this)}));function y(_,x){return m.apply(this,arguments)}return y}(),o.putBucketCORS=function(){var m=(0,l.default)(g.default.mark(function _(x,S,w){var A,H,R,F,D,B,P,U,G,ee;return g.default.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:for(S=S||[],h(S.length,"rules is required"),S.forEach(function($){h($.allowedOrigin,"allowedOrigin is required"),h($.allowedMethod,"allowedMethod is required")}),A=this._bucketRequestParams("PUT",x,"cors",w),H=`<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration>`,R=function(oe){H+="<AllowedOrigin>".concat(oe,"</AllowedOrigin>")},F=function(oe){H+="<AllowedMethod>".concat(oe,"</AllowedMethod>")},D=function(oe){H+="<AllowedHeader>".concat(oe,"</AllowedHeader>")},B=function(oe){H+="<ExposeHeader>".concat(oe,"</ExposeHeader>")},P=0,U=S.length;P<U;P++)G=S[P],H+="<CORSRule>",u(G.allowedOrigin).forEach(R),u(G.allowedMethod).forEach(F),u(G.allowedHeader).forEach(D),u(G.exposeHeader).forEach(B),G.maxAgeSeconds&&(H+="<MaxAgeSeconds>".concat(G.maxAgeSeconds,"</MaxAgeSeconds>")),H+="</CORSRule>";return H+="</CORSConfiguration>",A.content=H,A.mime="xml",A.successStatuses=[200],Z.next=16,this.request(A);case 16:return ee=Z.sent,Z.abrupt("return",{res:ee.res});case 18:case"end":return Z.stop()}},_,this)}));function y(_,x,S){return m.apply(this,arguments)}return y}(),o.getBucketCORS=function(){var m=(0,l.default)(g.default.mark(function _(x,S){var w,A,H,R;return g.default.wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return w=this._bucketRequestParams("GET",x,"cors",S),w.successStatuses=[200],w.xmlResponse=!0,D.next=5,this.request(w);case 5:return A=D.sent,H=[],A.data&&A.data.CORSRule&&(R=A.data.CORSRule,s(R)||(R=[R]),R.forEach(function(B){var P={};Object.keys(B).forEach(function(U){P[U.slice(0,1).toLowerCase()+U.slice(1,U.length)]=B[U]}),H.push(P)})),D.abrupt("return",{rules:H,res:A.res});case 9:case"end":return D.stop()}},_,this)}));function y(_,x){return m.apply(this,arguments)}return y}(),o.deleteBucketCORS=function(){var m=(0,l.default)(g.default.mark(function _(x,S){var w,A;return g.default.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return w=this._bucketRequestParams("DELETE",x,"cors",S),w.successStatuses=[204],R.next=4,this.request(w);case 4:return A=R.sent,R.abrupt("return",{res:A.res});case 6:case"end":return R.stop()}},_,this)}));function y(_,x){return m.apply(this,arguments)}return y}(),o.putBucketReferer=function(){var m=(0,l.default)(g.default.mark(function _(x,S,w,A){var H,R,F,D;return g.default.wrap(function(P){for(;;)switch(P.prev=P.next){case 0:if(H=this._bucketRequestParams("PUT",x,"referer",A),R=`<?xml version="1.0" encoding="UTF-8"?>
<RefererConfiguration>
`,R+=" <AllowEmptyReferer>".concat(S?"true":"false",`</AllowEmptyReferer>
`),w&&w.length>0){for(R+=` <RefererList>
`,F=0;F<w.length;F++)R+=" <Referer>".concat(w[F],`</Referer>
`);R+=` </RefererList>
`}else R+=` <RefererList />
`;return R+="</RefererConfiguration>",H.content=R,H.mime="xml",H.successStatuses=[200],P.next=10,this.request(H);case 10:return D=P.sent,P.abrupt("return",{res:D.res});case 12:case"end":return P.stop()}},_,this)}));function y(_,x,S,w){return m.apply(this,arguments)}return y}(),o.getBucketReferer=function(){var m=(0,l.default)(g.default.mark(function _(x,S){var w,A,H;return g.default.wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return w=this._bucketRequestParams("GET",x,"referer",S),w.successStatuses=[200],w.xmlResponse=!0,F.next=5,this.request(w);case 5:return A=F.sent,H=A.data.RefererList.Referer||null,H&&(s(H)||(H=[H])),F.abrupt("return",{allowEmpty:A.data.AllowEmptyReferer==="true",referers:H,res:A.res});case 9:case"end":return F.stop()}},_,this)}));function y(_,x){return m.apply(this,arguments)}return y}(),o.deleteBucketReferer=function(){var m=(0,l.default)(g.default.mark(function _(x,S){return g.default.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,this.putBucketReferer(x,!0,null,S);case 2:return A.abrupt("return",A.sent);case 3:case"end":return A.stop()}},_,this)}));function y(_,x){return m.apply(this,arguments)}return y}(),o._bucketRequestParams=function(y,_,x,S){return{method:y,bucket:_,subres:x,timeout:S&&S.timeout,ctx:S&&S.ctx}}},{"../common/utils/checkBucketName":51,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,assert:82,"core-js/modules/es.array.slice.js":281,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.object.to-string.js":291,"core-js/modules/web.dom-collections.for-each.js":339}],3:[function(i,M,E){(function(p,g){(function(){"use strict";var l=i("@babel/runtime/helpers/interopRequireDefault"),h=l(i("@babel/runtime/regenerator")),v=l(i("@babel/runtime/helpers/asyncToGenerator"));i("core-js/modules/es.function.name.js"),i("core-js/modules/es.regexp.exec.js"),i("core-js/modules/es.string.split.js"),i("core-js/modules/es.object.assign.js"),i("core-js/modules/es.array.includes.js"),i("core-js/modules/es.string.replace.js"),i("core-js/modules/es.array.concat.js"),i("core-js/modules/es.symbol.js"),i("core-js/modules/es.symbol.description.js"),i("core-js/modules/es.array.slice.js"),i("core-js/modules/es.object.to-string.js"),i("core-js/modules/es.promise.js"),i("core-js/modules/es.regexp.to-string.js");var d=i("debug")("ali-oss"),o=i("xml2js"),s=i("agentkeepalive"),u=i("merge-descriptors"),m=i("platform"),y=i("utility"),_=i("urllib"),x=i("./version"),S=i("bowser"),w=i("../common/signUtils"),A=i("../common/client/initOptions"),H=i("../common/utils/createRequest"),R=H.createRequest,F=i("../common/utils/encoder"),D=F.encoder,B=i("../common/client/getReqUrl"),P=B.getReqUrl,U=i("../common/utils/setSTSToken"),G=U.setSTSToken,ee=i("../common/utils/retry"),K=ee.retry,Z=i("../common/utils/isFunction"),$=Z.isFunction,oe=new s;function ae(){var we=m.name,Le=m.version;we&&we.toLowerCase&&we.toLowerCase()==="ie"&&Le.split(".")[0]<10&&console.warn("ali-oss does not support the current browser")}function ye(){return location&&location.protocol==="https:"}function Y(we,Le){if(ae(),!(this instanceof Y))return new Y(we,Le);we&&we.inited?this.options=we:this.options=Y.initOptions(we),this.options.cancelFlag=!1,this.options.urllib?this.urllib=this.options.urllib:(this.urllib=_,this.agent=this.options.agent||oe),this.ctx=Le,this.userAgent=this._getUserAgent(),this.stsTokenFreshTime=new Date,this.options.amendTimeSkewed=0}M.exports=Y,Y.initOptions=function(Le){Le.stsToken||console.warn("Please use STS Token for safety, see more details at https://help.aliyun.com/document_detail/32077.html");var de=Object.assign({secure:ye(),useFetch:!1},Le);return A(de)};var le=Y.prototype;le.debug=d,u(le,i("./object")),u(le,i("./bucket")),u(le,i("../common/bucket/getBucketWebsite")),u(le,i("../common/bucket/putBucketWebsite")),u(le,i("../common/bucket/deleteBucketWebsite")),u(le,i("../common/bucket/getBucketLifecycle")),u(le,i("../common/bucket/putBucketLifecycle")),u(le,i("../common/bucket/deleteBucketLifecycle")),u(le,i("../common/bucket/putBucketVersioning")),u(le,i("../common/bucket/getBucketVersioning")),u(le,i("../common/bucket/getBucketInventory")),u(le,i("../common/bucket/deleteBucketInventory")),u(le,i("../common/bucket/listBucketInventory")),u(le,i("../common/bucket/putBucketInventory")),u(le,i("../common/bucket/abortBucketWorm")),u(le,i("../common/bucket/completeBucketWorm")),u(le,i("../common/bucket/extendBucketWorm")),u(le,i("../common/bucket/getBucketWorm")),u(le,i("../common/bucket/initiateBucketWorm")),u(le,i("./managed-upload")),u(le,i("../common/multipart-copy")),u(le,i("../common/multipart")),u(le,i("../common/parallel")),le.signature=function(Le){return this.debug("authorization stringToSign: %s",Le,"info"),w.computeSignature(this.options.accessKeySecret,Le,this.options.headerEncoding)},le._getReqUrl=P,le.authorization=function(Le,de,be,Te){var Ae=w.buildCanonicalString(Le.toUpperCase(),de,{headers:Te,parameters:be});return w.authorization(this.options.accessKeyId,this.options.accessKeySecret,Ae,this.options.headerEncoding)},le.request=function(){var we=(0,v.default)(h.default.mark(function Le(de){var be=this;return h.default.wrap(function(Ae){for(;;)switch(Ae.prev=Ae.next){case 0:if(!this.options.retryMax){Ae.next=6;break}return Ae.next=3,K(xe.bind(this),this.options.retryMax,{errorHandler:function(Pe){var _e=function(te){if(de.stream)return!1;var T=[-1,-2].includes(te.status),I=be.options.requestErrorRetryHandle||function(){return!0};return T&&I(te)};return!!_e(Pe)}})(de);case 3:return Ae.abrupt("return",Ae.sent);case 6:return Ae.abrupt("return",xe.call(this,de));case 7:case"end":return Ae.stop()}},Le,this)}));return function(Le){return we.apply(this,arguments)}}();function xe(we){return Ce.apply(this,arguments)}function Ce(){return Ce=(0,v.default)(h.default.mark(function we(Le){var de,be,Te,Ae,Be,Pe;return h.default.wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:if(!(this.options.stsToken&&$(this.options.refreshSTSToken))){ne.next=3;break}return ne.next=3,G.call(this);case 3:return de=R.call(this,Le),this.options.useFetch||(de.params.mode="disable-fetch"),Ae=!!Le.stream,ne.prev=6,ne.next=9,this.urllib.request(de.url,de.params);case 9:be=ne.sent,this.debug("response %s %s, got %s, headers: %j",Le.method,de.url,be.status,be.headers,"info"),ne.next=16;break;case 13:ne.prev=13,ne.t0=ne.catch(6),Te=ne.t0;case 16:if(!(be&&Le.successStatuses&&Le.successStatuses.indexOf(be.status)===-1)){ne.next=28;break}return ne.next=19,this.requestError(be);case 19:if(Be=ne.sent,!(Be.code==="RequestTimeTooSkewed"&&!Ae)){ne.next=25;break}return this.options.amendTimeSkewed=+new Date(Be.serverTime)-new Date,ne.next=24,this.request(Le);case 24:return ne.abrupt("return",ne.sent);case 25:Be.params=Le,ne.next=32;break;case 28:if(!Te){ne.next=32;break}return ne.next=31,this.requestError(Te);case 31:Be=ne.sent;case 32:if(!Be){ne.next=34;break}throw Be;case 34:if(!Le.xmlResponse){ne.next=39;break}return ne.next=37,this.parseXML(be.data);case 37:Pe=ne.sent,be.data=Pe;case 39:return ne.abrupt("return",be);case 40:case"end":return ne.stop()}},we,this,[[6,13]])})),Ce.apply(this,arguments)}le._getResource=function(Le){var de="/";return Le.bucket&&(de+="".concat(Le.bucket,"/")),Le.object&&(de+=D(Le.object,this.options.headerEncoding)),de},le._escape=function(Le){return y.encodeURIComponent(Le).replace(/%2F/g,"/")},le._getUserAgent=function(){var Le=g&&g.browser?"js":"nodejs",de="aliyun-sdk-".concat(Le,"/").concat(x.version),be=m.description;return!be&&g&&(be="Node.js ".concat(g.version.slice(1)," on ").concat(g.platform," ").concat(g.arch)),this._checkUserAgent("".concat(de," ").concat(be))},le._checkUserAgent=function(Le){var de=Le.replace(/\u03b1/,"alpha").replace(/\u03b2/,"beta");return de},le.checkBrowserAndVersion=function(Le,de){return S.name===Le&&S.version.split(".")[0]===de},le.parseXML=function(Le){return new Promise(function(de,be){p.isBuffer(Le)&&(Le=Le.toString()),o.parseString(Le,{explicitRoot:!1,explicitArray:!1},function(Te,Ae){Te?be(Te):de(Ae)})})},le.requestError=function(){var we=(0,v.default)(h.default.mark(function de(be){var Te,Ae,Be,Pe;return h.default.wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:if(Te=null,!(!be.data||!be.data.length)){ne.next=5;break}be.status===-1||be.status===-2?(Te=new Error(be.message),Te.name=be.name,Te.status=be.status,Te.code=be.name):(be.status===404?(Te=new Error("Object not exists"),Te.name="NoSuchKeyError",Te.status=404,Te.code="NoSuchKey"):be.status===412?(Te=new Error("Pre condition failed"),Te.name="PreconditionFailedError",Te.status=412,Te.code="PreconditionFailed"):(Te=new Error("Unknow error, status: ".concat(be.status)),Te.name="UnknownError",Te.status=be.status),Te.requestId=be.headers["x-oss-request-id"],Te.host=""),ne.next=32;break;case 5:return Ae=String(be.data),this.debug("request response error data: %s",Ae,"error"),ne.prev=7,ne.next=10,this.parseXML(Ae);case 10:if(ne.t0=ne.sent,ne.t0){ne.next=13;break}ne.t0={};case 13:Be=ne.t0,ne.next=23;break;case 16:return ne.prev=16,ne.t1=ne.catch(7),this.debug(Ae,"error"),ne.t1.message+=`
raw xml: `.concat(Ae),ne.t1.status=be.status,ne.t1.requestId=be.headers["x-oss-request-id"],ne.abrupt("return",ne.t1);case 23:Pe=Be.Message||"unknow request error, status: ".concat(be.status),Be.Condition&&(Pe+=" (condition: ".concat(Be.Condition,")")),Te=new Error(Pe),Te.name=Be.Code?"".concat(Be.Code,"Error"):"UnknownError",Te.status=be.status,Te.code=Be.Code,Te.requestId=Be.RequestId,Te.hostId=Be.HostId,Te.serverTime=Be.ServerTime;case 32:return this.debug("generate error %j",Te,"error"),ne.abrupt("return",Te);case 34:case"end":return ne.stop()}},de,this,[[7,16]])}));function Le(de){return we.apply(this,arguments)}return Le}()}).call(this)}).call(this,{isBuffer:i("../../node_modules/is-buffer/index.js")},i("_process"))},{"../../node_modules/is-buffer/index.js":366,"../common/bucket/abortBucketWorm":7,"../common/bucket/completeBucketWorm":8,"../common/bucket/deleteBucketInventory":9,"../common/bucket/deleteBucketLifecycle":10,"../common/bucket/deleteBucketWebsite":11,"../common/bucket/extendBucketWorm":12,"../common/bucket/getBucketInventory":13,"../common/bucket/getBucketLifecycle":14,"../common/bucket/getBucketVersioning":15,"../common/bucket/getBucketWebsite":16,"../common/bucket/getBucketWorm":17,"../common/bucket/initiateBucketWorm":18,"../common/bucket/listBucketInventory":19,"../common/bucket/putBucketInventory":20,"../common/bucket/putBucketLifecycle":21,"../common/bucket/putBucketVersioning":22,"../common/bucket/putBucketWebsite":23,"../common/client/getReqUrl":25,"../common/client/initOptions":26,"../common/multipart":30,"../common/multipart-copy":29,"../common/parallel":49,"../common/signUtils":50,"../common/utils/createRequest":56,"../common/utils/encoder":59,"../common/utils/isFunction":68,"../common/utils/retry":74,"../common/utils/setSTSToken":76,"./bucket":2,"./managed-upload":4,"./object":5,"./version":6,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,_process:467,agentkeepalive:81,bowser:88,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.array.includes.js":277,"core-js/modules/es.array.slice.js":281,"core-js/modules/es.function.name.js":284,"core-js/modules/es.object.assign.js":287,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.promise.js":295,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.regexp.to-string.js":301,"core-js/modules/es.string.replace.js":305,"core-js/modules/es.string.split.js":307,"core-js/modules/es.symbol.description.js":310,"core-js/modules/es.symbol.js":313,debug:465,"merge-descriptors":372,platform:379,urllib:475,utility:474,xml2js:426}],4:[function(i,M,E){(function(p){(function(){"use strict";var g=i("@babel/runtime/helpers/interopRequireDefault"),l=g(i("@babel/runtime/regenerator"));i("core-js/modules/es.function.name.js"),i("core-js/modules/es.object.to-string.js"),i("core-js/modules/es.promise.js"),i("core-js/modules/es.array.from.js"),i("core-js/modules/es.string.iterator.js"),i("core-js/modules/es.array.map.js"),i("core-js/modules/es.array.filter.js"),i("core-js/modules/es.array.find.js"),i("core-js/modules/es.array.concat.js"),i("core-js/modules/es.regexp.to-string.js"),i("core-js/modules/es.array.slice.js"),i("core-js/modules/es.array.iterator.js"),i("core-js/modules/es.array-buffer.slice.js"),i("core-js/modules/es.typed-array.uint8-array.js"),i("core-js/modules/es.typed-array.copy-within.js"),i("core-js/modules/es.typed-array.every.js"),i("core-js/modules/es.typed-array.fill.js"),i("core-js/modules/es.typed-array.filter.js"),i("core-js/modules/es.typed-array.find.js"),i("core-js/modules/es.typed-array.find-index.js"),i("core-js/modules/es.typed-array.for-each.js"),i("core-js/modules/es.typed-array.includes.js"),i("core-js/modules/es.typed-array.index-of.js"),i("core-js/modules/es.typed-array.iterator.js"),i("core-js/modules/es.typed-array.join.js"),i("core-js/modules/es.typed-array.last-index-of.js"),i("core-js/modules/es.typed-array.map.js"),i("core-js/modules/es.typed-array.reduce.js"),i("core-js/modules/es.typed-array.reduce-right.js"),i("core-js/modules/es.typed-array.reverse.js"),i("core-js/modules/es.typed-array.set.js"),i("core-js/modules/es.typed-array.slice.js"),i("core-js/modules/es.typed-array.some.js"),i("core-js/modules/es.typed-array.sort.js"),i("core-js/modules/es.typed-array.subarray.js"),i("core-js/modules/es.typed-array.to-locale-string.js"),i("core-js/modules/es.typed-array.to-string.js");var h=g(i("@babel/runtime/helpers/asyncToGenerator")),v=i("util"),d=i("path"),o=i("mime"),s=i("copy-to"),u=i("../common/utils/isBlob"),m=u.isBlob,y=i("../common/utils/isFile"),_=y.isFile,x=i("../common/utils/isBuffer"),S=x.isBuffer,w=E;w.multipartUpload=function(){var D=(0,h.default)(l.default.mark(function P(U,G){var ee,K,Z,$,oe,ae,ye,Y,le,xe=arguments;return l.default.wrap(function(we){for(;;)switch(we.prev=we.next){case 0:if(ee=xe.length>2&&xe[2]!==void 0?xe[2]:{},this.resetCancelFlag(),ee.disabledMD5=ee.disabledMD5===void 0?!0:!!ee.disabledMD5,!(ee.checkpoint&&ee.checkpoint.uploadId)){we.next=8;break}return G&&_(G)&&(ee.checkpoint.file=G),we.next=7,this._resumeMultipart(ee.checkpoint,ee);case 7:return we.abrupt("return",we.sent);case 8:return K=102400,ee.mime||(_(G)?ee.mime=o.getType(d.extname(G.name)):m(G)?ee.mime=G.type:S(G)?ee.mime="":ee.mime=o.getType(d.extname(G))),ee.headers=ee.headers||{},this._convertMetaToHeaders(ee.meta,ee.headers),we.next=14,this._getFileSize(G);case 14:if(Z=we.sent,!(Z<K)){we.next=26;break}return ee.contentLength=Z,we.next=19,this.put(U,G,ee);case 19:if($=we.sent,!(ee&&ee.progress)){we.next=23;break}return we.next=23,ee.progress(1);case 23:return oe={res:$.res,bucket:this.options.bucket,name:U,etag:$.res.headers.etag},(ee.headers&&ee.headers["x-oss-callback"]||ee.callback)&&(oe.data=$.data),we.abrupt("return",oe);case 26:if(!(ee.partSize&&parseInt(ee.partSize,10)!==ee.partSize)){we.next=28;break}throw new Error("partSize must be int number");case 28:if(!(ee.partSize&&ee.partSize<K)){we.next=30;break}throw new Error("partSize must not be smaller than ".concat(K));case 30:return we.next=32,this.initMultipartUpload(U,ee);case 32:if(ae=we.sent,ye=ae.uploadId,Y=this._getPartSize(Z,ee.partSize),le={file:G,name:U,fileSize:Z,partSize:Y,uploadId:ye,doneParts:[]},!(ee&&ee.progress)){we.next=39;break}return we.next=39,ee.progress(0,le,ae.res);case 39:return we.next=41,this._resumeMultipart(le,ee);case 41:return we.abrupt("return",we.sent);case 42:case"end":return we.stop()}},P,this)}));function B(P,U){return D.apply(this,arguments)}return B}(),w._resumeMultipart=function(){var D=(0,h.default)(l.default.mark(function P(U,G){var ee,K,Z,$,oe,ae,ye,Y,le,xe,Ce,we,Le,de,be,Te,Ae,Be,Pe;return l.default.wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:if(ee=this,!this.isCancel()){ne.next=3;break}throw this._makeCancelEvent();case 3:return K=U.file,Z=U.fileSize,$=U.partSize,oe=U.uploadId,ae=U.doneParts,ye=U.name,Y=[],ae.length>0&&s(ae).to(Y),le=this._divideParts(Z,$),xe=le.length,Ce=!1,we=function(T,I){return new Promise(function(){var re=(0,h.default)(l.default.mark(function q(z,W){var V,se,ge,Me,Fe;return l.default.wrap(function($e){for(;;)switch($e.prev=$e.next){case 0:if($e.prev=0,T.isCancel()){$e.next=29;break}return V=le[I-1],$e.next=5,T._createBuffer(K,V.start,V.end);case 5:return se=$e.sent,ge={content:se,size:V.end-V.start},$e.prev=7,$e.next=10,T._uploadPart(ye,oe,I,ge,G);case 10:Me=$e.sent,$e.next=18;break;case 13:if($e.prev=13,$e.t0=$e.catch(7),$e.t0.status!==404){$e.next=17;break}throw T._makeAbortEvent();case 17:throw $e.t0;case 18:if(!(!T.isCancel()&&!Ce)){$e.next=26;break}if(U.doneParts.push({number:I,etag:Me.res.headers.etag}),!G.progress){$e.next=23;break}return $e.next=23,G.progress(ae.length/(xe+1),U,Me.res);case 23:z({number:I,etag:Me.res.headers.etag}),$e.next=27;break;case 26:z();case 27:$e.next=30;break;case 29:z();case 30:$e.next=41;break;case 32:$e.prev=32,$e.t1=$e.catch(0),Fe=new Error,Fe.name=$e.t1.name,Fe.message=$e.t1.message,Fe.stack=$e.t1.stack,Fe.partNum=I,s($e.t1).to(Fe),W(Fe);case 41:case"end":return $e.stop()}},q,null,[[0,32],[7,13]])}));return function(q,z){return re.apply(this,arguments)}}())},Le=Array.from(new Array(xe),function(te,T){return T+1}),de=Y.map(function(te){return te.number}),be=Le.filter(function(te){return de.indexOf(te)<0}),Te=5,Ae=G.parallel||Te,ne.next=17,this._parallel(be,Ae,function(te){return new Promise(function(T,I){we(ee,te).then(function(re){re&&Y.push(re),T()}).catch(function(re){I(re)})})});case 17:if(Be=ne.sent,Ce=!0,Pe=Be.find(function(te){return te.name==="abort"}),!Pe){ne.next=22;break}throw Pe;case 22:if(!this.isCancel()){ne.next=25;break}throw we=null,this._makeCancelEvent();case 25:if(!(Be&&Be.length>0)){ne.next=28;break}throw Be[0].message="Failed to upload some parts with error: ".concat(Be[0].toString()," part_num: ").concat(Be[0].partNum),Be[0];case 28:return ne.next=30,this.completeMultipartUpload(ye,oe,Y,G);case 30:return ne.abrupt("return",ne.sent);case 31:case"end":return ne.stop()}},P,this)}));function B(P,U){return D.apply(this,arguments)}return B}(),w._getFileSize=function(){var D=(0,h.default)(l.default.mark(function P(U){return l.default.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:if(!S(U)){ee.next=4;break}return ee.abrupt("return",U.length);case 4:if(!(m(U)||_(U))){ee.next=6;break}return ee.abrupt("return",U.size);case 6:throw new Error("_getFileSize requires Buffer/File/Blob.");case 7:case"end":return ee.stop()}},P)}));function B(P){return D.apply(this,arguments)}return B}();var A=i("stream"),H=A.Readable;function R(D,B){if(!(this instanceof R))return new R(D,B);H.call(this,B),this.file=D,this.reader=new FileReader,this.start=0,this.finish=!1,this.fileBuffer=null}v.inherits(R,H),R.prototype.readFileAndPush=function(B){if(this.fileBuffer)for(var P=!0;P&&this.fileBuffer&&this.start<this.fileBuffer.length;){var U=this.start,G=U+B;G=G>this.fileBuffer.length?this.fileBuffer.length:G,this.start=G,P=this.push(this.fileBuffer.slice(U,G))}},R.prototype._read=function(B){if(this.file&&this.start>=this.file.size||this.fileBuffer&&this.start>=this.fileBuffer.length||this.finish||this.start===0&&!this.file){this.finish||(this.fileBuffer=null,this.finish=!0),this.push(null);return}var P=16*1024;B=B||P;var U=this;this.reader.onload=function(ee){U.fileBuffer=p.from(new Uint8Array(ee.target.result)),U.file=null,U.readFileAndPush(B)},this.start===0?this.reader.readAsArrayBuffer(this.file):this.readFileAndPush(B)};function F(D){return D.arrayBuffer?D.arrayBuffer():new Promise(function(B,P){var U=new FileReader;U.onload=function(G){B(G.target.result)},U.onerror=function(G){P(G)},U.readAsArrayBuffer(D)})}w._createBuffer=function(){var D=(0,h.default)(l.default.mark(function P(U,G,ee){var K,Z;return l.default.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:if(!(m(U)||_(U))){oe.next=8;break}return K=U.slice(G,ee),oe.next=4,F(K);case 4:return Z=oe.sent,oe.abrupt("return",p.from(Z));case 8:if(!S(U)){oe.next=12;break}return oe.abrupt("return",U.subarray(G,ee));case 12:throw new Error("_createBuffer requires File/Blob/Buffer.");case 13:case"end":return oe.stop()}},P)}));function B(P,U,G){return D.apply(this,arguments)}return B}(),w._getPartSize=function(B,P){var U=1e4,G=1*1024*1024;P||(P=G);var ee=Math.ceil(B/U);return P<ee&&(P=ee,console.warn("partSize has been set to ".concat(P,", because the partSize you provided causes partNumber to be greater than 10,000"))),P},w._divideParts=function(B,P){for(var U=Math.ceil(B/P),G=[],ee=0;ee<U;ee++){var K=P*ee,Z=Math.min(K+P,B);G.push({start:K,end:Z})}return G}}).call(this)}).call(this,i("buffer").Buffer)},{"../common/utils/isBlob":64,"../common/utils/isBuffer":65,"../common/utils/isFile":67,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,buffer:90,"copy-to":94,"core-js/modules/es.array-buffer.slice.js":271,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.array.filter.js":274,"core-js/modules/es.array.find.js":275,"core-js/modules/es.array.from.js":276,"core-js/modules/es.array.iterator.js":278,"core-js/modules/es.array.map.js":280,"core-js/modules/es.array.slice.js":281,"core-js/modules/es.function.name.js":284,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.promise.js":295,"core-js/modules/es.regexp.to-string.js":301,"core-js/modules/es.string.iterator.js":303,"core-js/modules/es.typed-array.copy-within.js":315,"core-js/modules/es.typed-array.every.js":316,"core-js/modules/es.typed-array.fill.js":317,"core-js/modules/es.typed-array.filter.js":318,"core-js/modules/es.typed-array.find-index.js":319,"core-js/modules/es.typed-array.find.js":320,"core-js/modules/es.typed-array.for-each.js":321,"core-js/modules/es.typed-array.includes.js":322,"core-js/modules/es.typed-array.index-of.js":323,"core-js/modules/es.typed-array.iterator.js":324,"core-js/modules/es.typed-array.join.js":325,"core-js/modules/es.typed-array.last-index-of.js":326,"core-js/modules/es.typed-array.map.js":327,"core-js/modules/es.typed-array.reduce-right.js":328,"core-js/modules/es.typed-array.reduce.js":329,"core-js/modules/es.typed-array.reverse.js":330,"core-js/modules/es.typed-array.set.js":331,"core-js/modules/es.typed-array.slice.js":332,"core-js/modules/es.typed-array.some.js":333,"core-js/modules/es.typed-array.sort.js":334,"core-js/modules/es.typed-array.subarray.js":335,"core-js/modules/es.typed-array.to-locale-string.js":336,"core-js/modules/es.typed-array.to-string.js":337,"core-js/modules/es.typed-array.uint8-array.js":338,mime:374,path:378,stream:398,util:419}],5:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault");i("core-js/modules/es.function.name.js"),i("core-js/modules/es.object.to-string.js"),i("core-js/modules/es.regexp.to-string.js"),i("core-js/modules/es.array.map.js"),i("core-js/modules/es.number.constructor.js"),i("core-js/modules/es.object.assign.js"),i("core-js/modules/es.regexp.exec.js"),i("core-js/modules/es.string.replace.js"),i("core-js/modules/web.dom-collections.for-each.js"),i("core-js/modules/es.object.keys.js"),i("core-js/modules/es.promise.js");var g=p(i("@babel/runtime/regenerator")),l=p(i("@babel/runtime/helpers/asyncToGenerator")),h=i("fs"),v=i("copy-to"),d=i("path"),o=i("mime"),s=i("../common/callback"),u=i("merge-descriptors"),m=i("../common/utils/isBlob"),y=m.isBlob,_=i("../common/utils/isFile"),x=_.isFile,S=i("../common/utils/isBuffer"),w=S.isBuffer,A=i("../common/utils/obj2xml"),H=A.obj2xml,R=E;R.append=function(){var F=(0,l.default)(g.default.mark(function B(P,U,G){var ee;return g.default.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return G=G||{},G.position===void 0&&(G.position="0"),G.subres={append:"",position:G.position},G.method="POST",Z.next=6,this.put(P,U,G);case 6:return ee=Z.sent,ee.nextAppendPosition=ee.res.headers["x-oss-next-append-position"],Z.abrupt("return",ee);case 9:case"end":return Z.stop()}},B,this)}));function D(B,P,U){return F.apply(this,arguments)}return D}(),R.put=function(){var F=(0,l.default)(g.default.mark(function B(P,U,G){var ee,K,Z,$,oe;return g.default.wrap(function(ye){for(;;)switch(ye.prev=ye.next){case 0:if(G=G||{},G.disabledMD5=G.disabledMD5===void 0?!0:!!G.disabledMD5,G.headers=G.headers||{},P=this._objectName(P),!w(U)){ye.next=8;break}ee=U,ye.next=19;break;case 8:if(!(y(U)||x(U))){ye.next=18;break}return G.mime||(x(U)?G.mime=o.getType(d.extname(U.name)):G.mime=U.type),ye.next=12,this._createBuffer(U,0,U.size);case 12:return ee=ye.sent,ye.next=15,this._getFileSize(U);case 15:G.contentLength=ye.sent,ye.next=19;break;case 18:throw new TypeError("Must provide Buffer/Blob/File for put.");case 19:return this._convertMetaToHeaders(G.meta,G.headers),K=G.method||"PUT",Z=this._objectRequestParams(K,P,G),s.encodeCallback(Z,G),Z.mime=G.mime,Z.disabledMD5=G.disabledMD5,Z.content=ee,Z.successStatuses=[200],ye.next=29,this.request(Z);case 29:return $=ye.sent,oe={name:P,url:this._objectUrl(P),res:$.res},Z.headers&&Z.headers["x-oss-callback"]&&(oe.data=JSON.parse($.data.toString())),ye.abrupt("return",oe);case 33:case"end":return ye.stop()}},B,this)}));function D(B,P,U){return F.apply(this,arguments)}return D}(),R.putStream=function(){var F=(0,l.default)(g.default.mark(function B(P,U,G){var ee,K,Z,$;return g.default.wrap(function(ae){for(;;)switch(ae.prev=ae.next){case 0:return G=G||{},G.headers=G.headers||{},P=this._objectName(P),G.contentLength?G.headers["Content-Length"]=G.contentLength:G.headers["Transfer-Encoding"]="chunked",this._convertMetaToHeaders(G.meta,G.headers),ee=G.method||"PUT",K=this._objectRequestParams(ee,P,G),s.encodeCallback(K,G),K.mime=G.mime,K.stream=U,K.successStatuses=[200],ae.next=13,this.request(K);case 13:return Z=ae.sent,$={name:P,url:this._objectUrl(P),res:Z.res},K.headers&&K.headers["x-oss-callback"]&&($.data=JSON.parse(Z.data.toString())),ae.abrupt("return",$);case 17:case"end":return ae.stop()}},B,this)}));function D(B,P,U){return F.apply(this,arguments)}return D}(),u(R,i("../common/object/copyObject")),u(R,i("../common/object/getObjectTagging")),u(R,i("../common/object/putObjectTagging")),u(R,i("../common/object/deleteObjectTagging")),u(R,i("../common/image")),u(R,i("../common/object/getBucketVersions")),u(R,i("../common/object/getACL")),u(R,i("../common/object/putACL")),u(R,i("../common/object/head")),u(R,i("../common/object/delete")),u(R,i("../common/object/get")),u(R,i("../common/object/putSymlink")),u(R,i("../common/object/getSymlink")),u(R,i("../common/object/deleteMulti")),u(R,i("../common/object/getObjectMeta")),u(R,i("../common/object/getObjectUrl")),u(R,i("../common/object/generateObjectUrl")),u(R,i("../common/object/signatureUrl")),u(R,i("../common/object/asyncSignatureUrl")),R.putMeta=function(){var F=(0,l.default)(g.default.mark(function B(P,U,G){var ee;return g.default.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,this.copy(P,P,{meta:U||{},timeout:G&&G.timeout,ctx:G&&G.ctx});case 2:return ee=Z.sent,Z.abrupt("return",ee);case 4:case"end":return Z.stop()}},B,this)}));function D(B,P,U){return F.apply(this,arguments)}return D}(),R.list=function(){var F=(0,l.default)(g.default.mark(function B(P,U){var G,ee,K,Z,$;return g.default.wrap(function(ae){for(;;)switch(ae.prev=ae.next){case 0:return G=this._objectRequestParams("GET","",U),G.query=P,G.xmlResponse=!0,G.successStatuses=[200],ae.next=6,this.request(G);case 6:return ee=ae.sent,K=ee.data.Contents||[],Z=this,K&&(Array.isArray(K)||(K=[K]),K=K.map(function(ye){return{name:ye.Key,url:Z._objectUrl(ye.Key),lastModified:ye.LastModified,etag:ye.ETag,type:ye.Type,size:Number(ye.Size),storageClass:ye.StorageClass,owner:{id:ye.Owner.ID,displayName:ye.Owner.DisplayName}}})),$=ee.data.CommonPrefixes||null,$&&(Array.isArray($)||($=[$]),$=$.map(function(ye){return ye.Prefix})),ae.abrupt("return",{res:ee.res,objects:K,prefixes:$,nextMarker:ee.data.NextMarker||null,isTruncated:ee.data.IsTruncated==="true"});case 13:case"end":return ae.stop()}},B,this)}));function D(B,P){return F.apply(this,arguments)}return D}(),R.listV2=function(){var F=(0,l.default)(g.default.mark(function B(P){var U,G,ee,K,Z,$,oe,ae=arguments;return g.default.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return U=ae.length>1&&ae[1]!==void 0?ae[1]:{},G=P["continuation-token"]||P.continuationToken,G&&(U.subres=Object.assign({"continuation-token":G},U.subres)),ee=this._objectRequestParams("GET","",U),ee.query=Object.assign({"list-type":2},P),delete ee.query["continuation-token"],delete ee.query.continuationToken,ee.xmlResponse=!0,ee.successStatuses=[200],Y.next=11,this.request(ee);case 11:return K=Y.sent,Z=K.data.Contents||[],$=this,Z&&(Array.isArray(Z)||(Z=[Z]),Z=Z.map(function(le){var xe=null;return le.Owner&&(xe={id:le.Owner.ID,displayName:le.Owner.DisplayName}),{name:le.Key,url:$._objectUrl(le.Key),lastModified:le.LastModified,etag:le.ETag,type:le.Type,size:Number(le.Size),storageClass:le.StorageClass,owner:xe}})),oe=K.data.CommonPrefixes||null,oe&&(Array.isArray(oe)||(oe=[oe]),oe=oe.map(function(le){return le.Prefix})),Y.abrupt("return",{res:K.res,objects:Z,prefixes:oe,isTruncated:K.data.IsTruncated==="true",keyCount:+K.data.KeyCount,continuationToken:K.data.ContinuationToken||null,nextContinuationToken:K.data.NextContinuationToken||null});case 18:case"end":return Y.stop()}},B,this)}));function D(B){return F.apply(this,arguments)}return D}(),R.restore=function(){var F=(0,l.default)(g.default.mark(function B(P){var U,G,ee,K,Z=arguments;return g.default.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return U=Z.length>1&&Z[1]!==void 0?Z[1]:{type:"Archive"},U=U||{},U.subres=Object.assign({restore:""},U.subres),U.versionId&&(U.subres.versionId=U.versionId),G=this._objectRequestParams("POST",P,U),U.type==="ColdArchive"&&(ee={RestoreRequest:{Days:U.Days?U.Days:2,JobParameters:{Tier:U.JobParameters?U.JobParameters:"Standard"}}},G.content=H(ee,{headers:!0}),G.mime="xml"),G.successStatuses=[202],oe.next=9,this.request(G);case 9:return K=oe.sent,oe.abrupt("return",{res:K.res});case 11:case"end":return oe.stop()}},B,this)}));function D(B){return F.apply(this,arguments)}return D}(),R._objectUrl=function(D){return this._getReqUrl({bucket:this.options.bucket,object:D})},R._objectRequestParams=function(D,B,P){if(!this.options.bucket&&!this.options.cname)throw new Error("Please create a bucket first");P=P||{},B=this._objectName(B);var U={object:B,bucket:this.options.bucket,method:D,subres:P&&P.subres,timeout:P&&P.timeout,ctx:P&&P.ctx};return P.headers&&(U.headers={},v(P.headers).to(U.headers)),U},R._objectName=function(D){return D.replace(/^\/+/,"")},R._convertMetaToHeaders=function(D,B){D&&Object.keys(D).forEach(function(P){B["x-oss-meta-".concat(P)]=D[P]})},R._deleteFileSafe=function(D){var B=this;return new Promise(function(P){h.exists(D,function(U){U?h.unlink(D,function(G){G&&B.debug("unlink %j error: %s",D,G,"error"),P()}):P()})})}},{"../common/callback":24,"../common/image":27,"../common/object/asyncSignatureUrl":31,"../common/object/copyObject":32,"../common/object/delete":33,"../common/object/deleteMulti":34,"../common/object/deleteObjectTagging":35,"../common/object/generateObjectUrl":36,"../common/object/get":37,"../common/object/getACL":38,"../common/object/getBucketVersions":39,"../common/object/getObjectMeta":40,"../common/object/getObjectTagging":41,"../common/object/getObjectUrl":42,"../common/object/getSymlink":43,"../common/object/head":44,"../common/object/putACL":45,"../common/object/putObjectTagging":46,"../common/object/putSymlink":47,"../common/object/signatureUrl":48,"../common/utils/isBlob":64,"../common/utils/isBuffer":65,"../common/utils/isFile":67,"../common/utils/obj2xml":72,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"copy-to":94,"core-js/modules/es.array.map.js":280,"core-js/modules/es.function.name.js":284,"core-js/modules/es.number.constructor.js":286,"core-js/modules/es.object.assign.js":287,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.promise.js":295,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.regexp.to-string.js":301,"core-js/modules/es.string.replace.js":305,"core-js/modules/web.dom-collections.for-each.js":339,fs:89,"merge-descriptors":372,mime:374,path:378}],6:[function(i,M,E){"use strict";E.version="6.18.1"},{}],7:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator")),l=p(i("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(E,"__esModule",{value:!0}),E.abortBucketWorm=void 0;var h=i("../utils/checkBucketName");function v(o,s){return d.apply(this,arguments)}function d(){return d=(0,l.default)(g.default.mark(function o(s,u){var m,y;return g.default.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return h.checkBucketName(s),m=this._bucketRequestParams("DELETE",s,"worm",u),x.next=4,this.request(m);case 4:return y=x.sent,x.abrupt("return",{res:y.res,status:y.status});case 6:case"end":return x.stop()}},o,this)})),d.apply(this,arguments)}E.abortBucketWorm=v},{"../utils/checkBucketName":51,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80}],8:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator")),l=p(i("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(E,"__esModule",{value:!0}),E.completeBucketWorm=void 0;var h=i("../utils/checkBucketName");function v(o,s,u){return d.apply(this,arguments)}function d(){return d=(0,l.default)(g.default.mark(function o(s,u,m){var y,_;return g.default.wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return h.checkBucketName(s),y=this._bucketRequestParams("POST",s,{wormId:u},m),S.next=4,this.request(y);case 4:return _=S.sent,S.abrupt("return",{res:_.res,status:_.status});case 6:case"end":return S.stop()}},o,this)})),d.apply(this,arguments)}E.completeBucketWorm=v},{"../utils/checkBucketName":51,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80}],9:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator"));i("core-js/modules/es.object.assign.js");var l=p(i("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(E,"__esModule",{value:!0}),E.deleteBucketInventory=void 0;var h=i("../utils/checkBucketName");function v(o,s){return d.apply(this,arguments)}function d(){return d=(0,l.default)(g.default.mark(function o(s,u){var m,y,_,x,S=arguments;return g.default.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return m=S.length>2&&S[2]!==void 0?S[2]:{},y=Object.assign({inventory:"",inventoryId:u},m.subres),h.checkBucketName(s),_=this._bucketRequestParams("DELETE",s,y,m),_.successStatuses=[204],A.next=7,this.request(_);case 7:return x=A.sent,A.abrupt("return",{status:x.status,res:x.res});case 9:case"end":return A.stop()}},o,this)})),d.apply(this,arguments)}E.deleteBucketInventory=v},{"../utils/checkBucketName":51,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.object.assign.js":287}],10:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator")),l=p(i("@babel/runtime/helpers/asyncToGenerator")),h=i("../utils/checkBucketName"),v=h.checkBucketName,d=E;d.deleteBucketLifecycle=function(){var o=(0,l.default)(g.default.mark(function u(m,y){var _,x;return g.default.wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return v(m),_=this._bucketRequestParams("DELETE",m,"lifecycle",y),_.successStatuses=[204],w.next=5,this.request(_);case 5:return x=w.sent,w.abrupt("return",{res:x.res});case 7:case"end":return w.stop()}},u,this)}));function s(u,m){return o.apply(this,arguments)}return s}()},{"../utils/checkBucketName":51,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80}],11:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator")),l=p(i("@babel/runtime/helpers/asyncToGenerator")),h=i("../utils/checkBucketName"),v=h.checkBucketName,d=E;d.deleteBucketWebsite=function(){var o=(0,l.default)(g.default.mark(function u(m,y){var _,x;return g.default.wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return v(m),_=this._bucketRequestParams("DELETE",m,"website",y),_.successStatuses=[204],w.next=5,this.request(_);case 5:return x=w.sent,w.abrupt("return",{res:x.res});case 7:case"end":return w.stop()}},u,this)}));function s(u,m){return o.apply(this,arguments)}return s}()},{"../utils/checkBucketName":51,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80}],12:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator")),l=p(i("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(E,"__esModule",{value:!0}),E.extendBucketWorm=void 0;var h=i("../utils/checkBucketName"),v=i("../utils/obj2xml");function d(s,u,m,y){return o.apply(this,arguments)}function o(){return o=(0,l.default)(g.default.mark(function s(u,m,y,_){var x,S,w;return g.default.wrap(function(H){for(;;)switch(H.prev=H.next){case 0:return h.checkBucketName(u),x=this._bucketRequestParams("POST",u,{wormExtend:"",wormId:m},_),S={ExtendWormConfiguration:{RetentionPeriodInDays:y}},x.mime="xml",x.content=v.obj2xml(S,{headers:!0}),x.successStatuses=[200],H.next=8,this.request(x);case 8:return w=H.sent,H.abrupt("return",{res:w.res,status:w.status});case 10:case"end":return H.stop()}},s,this)})),o.apply(this,arguments)}E.extendBucketWorm=d},{"../utils/checkBucketName":51,"../utils/obj2xml":72,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80}],13:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator"));i("core-js/modules/es.object.assign.js");var l=p(i("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(E,"__esModule",{value:!0}),E.getBucketInventory=void 0;var h=i("../utils/checkBucketName"),v=i("../utils/formatInventoryConfig");function d(s,u){return o.apply(this,arguments)}function o(){return o=(0,l.default)(g.default.mark(function s(u,m){var y,_,x,S,w=arguments;return g.default.wrap(function(H){for(;;)switch(H.prev=H.next){case 0:return y=w.length>2&&w[2]!==void 0?w[2]:{},_=Object.assign({inventory:"",inventoryId:m},y.subres),h.checkBucketName(u),x=this._bucketRequestParams("GET",u,_,y),x.successStatuses=[200],x.xmlResponse=!0,H.next=8,this.request(x);case 8:return S=H.sent,H.abrupt("return",{status:S.status,res:S.res,inventory:v.formatInventoryConfig(S.data)});case 10:case"end":return H.stop()}},s,this)})),o.apply(this,arguments)}E.getBucketInventory=d},{"../utils/checkBucketName":51,"../utils/formatInventoryConfig":60,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.object.assign.js":287}],14:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator"));i("core-js/modules/es.array.map.js");var l=p(i("@babel/runtime/helpers/asyncToGenerator")),h=i("../utils/checkBucketName"),v=h.checkBucketName,d=i("../utils/isArray"),o=d.isArray,s=i("../utils/formatObjKey"),u=s.formatObjKey,m=E;m.getBucketLifecycle=function(){var y=(0,l.default)(g.default.mark(function x(S,w){var A,H,R;return g.default.wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return v(S),A=this._bucketRequestParams("GET",S,"lifecycle",w),A.successStatuses=[200],A.xmlResponse=!0,D.next=6,this.request(A);case 6:return H=D.sent,R=H.data.Rule||null,R&&(o(R)||(R=[R]),R=R.map(function(B){return B.ID&&(B.id=B.ID,delete B.ID),B.Tag&&!o(B.Tag)&&(B.Tag=[B.Tag]),u(B,"firstLowerCase")})),D.abrupt("return",{rules:R,res:H.res});case 10:case"end":return D.stop()}},x,this)}));function _(x,S){return y.apply(this,arguments)}return _}()},{"../utils/checkBucketName":51,"../utils/formatObjKey":61,"../utils/isArray":63,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.array.map.js":280}],15:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator")),l=p(i("@babel/runtime/helpers/asyncToGenerator")),h=i("../utils/checkBucketName"),v=h.checkBucketName,d=E;d.getBucketVersioning=function(){var o=(0,l.default)(g.default.mark(function u(m,y){var _,x,S;return g.default.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return v(m),_=this._bucketRequestParams("GET",m,"versioning",y),_.xmlResponse=!0,_.successStatuses=[200],A.next=6,this.request(_);case 6:return x=A.sent,S=x.data.Status,A.abrupt("return",{status:x.status,versionStatus:S,res:x.res});case 9:case"end":return A.stop()}},u,this)}));function s(u,m){return o.apply(this,arguments)}return s}()},{"../utils/checkBucketName":51,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80}],16:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator")),l=p(i("@babel/runtime/helpers/asyncToGenerator")),h=i("../utils/checkBucketName"),v=h.checkBucketName,d=i("../utils/isObject"),o=d.isObject,s=E;s.getBucketWebsite=function(){var u=(0,l.default)(g.default.mark(function y(_,x){var S,w,A;return g.default.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return v(_),S=this._bucketRequestParams("GET",_,"website",x),S.successStatuses=[200],S.xmlResponse=!0,R.next=6,this.request(S);case 6:return w=R.sent,A=[],w.data.RoutingRules&&w.data.RoutingRules.RoutingRule&&(o(w.data.RoutingRules.RoutingRule)?A=[w.data.RoutingRules.RoutingRule]:A=w.data.RoutingRules.RoutingRule),R.abrupt("return",{index:w.data.IndexDocument&&w.data.IndexDocument.Suffix||"",supportSubDir:w.data.IndexDocument&&w.data.IndexDocument.SupportSubDir||"false",type:w.data.IndexDocument&&w.data.IndexDocument.Type,routingRules:A,error:w.data.ErrorDocument&&w.data.ErrorDocument.Key||null,res:w.res});case 10:case"end":return R.stop()}},y,this)}));function m(y,_){return u.apply(this,arguments)}return m}()},{"../utils/checkBucketName":51,"../utils/isObject":70,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80}],17:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator"));i("core-js/modules/es.object.assign.js");var l=p(i("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(E,"__esModule",{value:!0}),E.getBucketWorm=void 0;var h=i("../utils/checkBucketName"),v=i("../utils/dataFix");function d(s,u){return o.apply(this,arguments)}function o(){return o=(0,l.default)(g.default.mark(function s(u,m){var y,_;return g.default.wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return h.checkBucketName(u),y=this._bucketRequestParams("GET",u,"worm",m),y.successStatuses=[200],y.xmlResponse=!0,S.next=6,this.request(y);case 6:return _=S.sent,v.dataFix(_.data,{lowerFirst:!0,rename:{RetentionPeriodInDays:"days"}}),S.abrupt("return",Object.assign(Object.assign({},_.data),{res:_.res,status:_.status}));case 9:case"end":return S.stop()}},s,this)})),o.apply(this,arguments)}E.getBucketWorm=d},{"../utils/checkBucketName":51,"../utils/dataFix":57,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.object.assign.js":287}],18:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator")),l=p(i("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(E,"__esModule",{value:!0}),E.initiateBucketWorm=void 0;var h=i("../utils/obj2xml"),v=i("../utils/checkBucketName");function d(s,u,m){return o.apply(this,arguments)}function o(){return o=(0,l.default)(g.default.mark(function s(u,m,y){var _,x,S;return g.default.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return v.checkBucketName(u),_=this._bucketRequestParams("POST",u,"worm",y),x={InitiateWormConfiguration:{RetentionPeriodInDays:m}},_.mime="xml",_.content=h.obj2xml(x,{headers:!0}),_.successStatuses=[200],A.next=8,this.request(_);case 8:return S=A.sent,A.abrupt("return",{res:S.res,wormId:S.res.headers["x-oss-worm-id"],status:S.status});case 10:case"end":return A.stop()}},s,this)})),o.apply(this,arguments)}E.initiateBucketWorm=d},{"../utils/checkBucketName":51,"../utils/obj2xml":72,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80}],19:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator"));i("core-js/modules/es.object.assign.js");var l=p(i("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(E,"__esModule",{value:!0}),E.listBucketInventory=void 0;var h=i("../utils/checkBucketName"),v=i("../utils/formatInventoryConfig");function d(s){return o.apply(this,arguments)}function o(){return o=(0,l.default)(g.default.mark(function s(u){var m,y,_,x,S,w,A,H,R=arguments;return g.default.wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return m=R.length>1&&R[1]!==void 0?R[1]:{},y=m.continuationToken,_=Object.assign({inventory:""},y&&{"continuation-token":y},m.subres),h.checkBucketName(u),x=this._bucketRequestParams("GET",u,_,m),x.successStatuses=[200],x.xmlResponse=!0,D.next=9,this.request(x);case 9:return S=D.sent,w=S.data,A=S.res,H=S.status,D.abrupt("return",{isTruncated:w.IsTruncated==="true",nextContinuationToken:w.NextContinuationToken,inventoryList:v.formatInventoryConfig(w.InventoryConfiguration,!0),status:H,res:A});case 12:case"end":return D.stop()}},s,this)})),o.apply(this,arguments)}E.listBucketInventory=d},{"../utils/checkBucketName":51,"../utils/formatInventoryConfig":60,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.object.assign.js":287}],20:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator"));i("core-js/modules/es.object.assign.js"),i("core-js/modules/es.array.concat.js");var l=p(i("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(E,"__esModule",{value:!0}),E.putBucketInventory=void 0;var h=i("../utils/checkBucketName"),v=i("../utils/obj2xml");function d(s,u){return o.apply(this,arguments)}function o(){return o=(0,l.default)(g.default.mark(function s(u,m){var y,_,x,S,w,A,H,R,F,D,B,P=arguments;return g.default.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return y=P.length>2&&P[2]!==void 0?P[2]:{},_=Object.assign({inventory:"",inventoryId:m.id},y.subres),h.checkBucketName(u),x=m.OSSBucketDestination,S=m.optionalFields,w=m.includedObjectVersions,A="acs:oss:::",H="acs:ram::".concat(x.accountId,":role/"),R={InventoryConfiguration:{Id:m.id,IsEnabled:m.isEnabled,Filter:{Prefix:m.prefix||""},Destination:{OSSBucketDestination:{Format:x.format,AccountId:x.accountId,RoleArn:"".concat(H).concat(x.rolename),Bucket:"".concat(A).concat(x.bucket),Prefix:x.prefix||"",Encryption:x.encryption||""}},Schedule:{Frequency:m.frequency},IncludedObjectVersions:w,OptionalFields:{Field:(S==null?void 0:S.field)||[]}}},F=v.obj2xml(R,{headers:!0,firstUpperCase:!0}),D=this._bucketRequestParams("PUT",u,_,y),D.successStatuses=[200],D.mime="xml",D.content=F,G.next=14,this.request(D);case 14:return B=G.sent,G.abrupt("return",{status:B.status,res:B.res});case 16:case"end":return G.stop()}},s,this)})),o.apply(this,arguments)}E.putBucketInventory=d},{"../utils/checkBucketName":51,"../utils/obj2xml":72,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.object.assign.js":287}],21:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator"));i("core-js/modules/es.object.to-string.js"),i("core-js/modules/web.dom-collections.for-each.js"),i("core-js/modules/es.regexp.exec.js"),i("core-js/modules/es.array.includes.js");var l=p(i("@babel/runtime/helpers/asyncToGenerator")),h=i("../utils/checkBucketName"),v=h.checkBucketName,d=i("../utils/isArray"),o=d.isArray,s=i("../utils/deepCopy"),u=s.deepCopy,m=i("../utils/isObject"),y=m.isObject,_=i("../utils/obj2xml"),x=_.obj2xml,S=i("../utils/checkObjectTag"),w=S.checkObjectTag,A=i("../utils/getStrBytesCount"),H=A.getStrBytesCount,R=E;R.putBucketLifecycle=function(){var U=(0,l.default)(g.default.mark(function ee(K,Z,$){var oe,ae,ye,Y,le;return g.default.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:if(v(K),o(Z)){Ce.next=3;break}throw new Error("rules must be Array");case 3:return oe=this._bucketRequestParams("PUT",K,"lifecycle",$),ae=[],ye={LifecycleConfiguration:{Rule:ae}},Z.forEach(function(we){F(we),P(we),we.id&&(we.ID=we.id,delete we.id),ae.push(we)}),Y=x(ye,{headers:!0,firstUpperCase:!0}),oe.content=Y,oe.mime="xml",oe.successStatuses=[200],Ce.next=13,this.request(oe);case 13:return le=Ce.sent,Ce.abrupt("return",{res:le.res});case 15:case"end":return Ce.stop()}},ee,this)}));function G(ee,K,Z){return U.apply(this,arguments)}return G}();function F(U){U.days&&(U.expiration={days:U.days}),U.date&&(U.expiration={createdBeforeDate:U.date})}function D(U,G){var ee=U.days,K=U.createdBeforeDate;if(!ee&&!K)throw new Error("".concat(G," must includes days or createdBeforeDate"));if(ee&&!/^[1-9][0-9]*$/.test(ee))throw new Error("days must be a positive integer");if(K&&!/\d{4}-\d{2}-\d{2}T00:00:00.000Z/.test(K))throw new Error("createdBeforeDate must be date and conform to iso8601 format")}function B(U){if(!o(U)&&!y(U))throw new Error("tag must be Object or Array");U=y(U)?[U]:U;var G={},ee=u(U);ee.forEach(function(K){G[K.key]=K.value}),w(G)}function P(U){if(U.id&&H(U.id)>255)throw new Error("ID is composed of 255 bytes at most");if(U.prefix===void 0)throw new Error("Rule must includes prefix");if(!["Enabled","Disabled"].includes(U.status))throw new Error("Status must be Enabled or Disabled");if(U.transition){if(!["IA","Archive"].includes(U.transition.storageClass))throw new Error("StorageClass must be IA or Archive");D(U.transition,"Transition")}if(U.expiration){if(!U.expiration.expiredObjectDeleteMarker)D(U.expiration,"Expiration");else if(U.expiration.days||U.expiration.createdBeforeDate)throw new Error("expiredObjectDeleteMarker cannot be used with days or createdBeforeDate")}if(U.abortMultipartUpload&&D(U.abortMultipartUpload,"AbortMultipartUpload"),!U.expiration&&!U.abortMultipartUpload&&!U.transition&&!U.noncurrentVersionTransition)throw new Error("Rule must includes expiration or abortMultipartUpload or transition or noncurrentVersionTransition");if(U.tag){if(U.abortMultipartUpload)throw new Error("Tag cannot be used with abortMultipartUpload");B(U.tag)}}},{"../utils/checkBucketName":51,"../utils/checkObjectTag":54,"../utils/deepCopy":58,"../utils/getStrBytesCount":62,"../utils/isArray":63,"../utils/isObject":70,"../utils/obj2xml":72,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.array.includes.js":277,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/web.dom-collections.for-each.js":339}],22:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator"));i("core-js/modules/es.array.includes.js");var l=p(i("@babel/runtime/helpers/asyncToGenerator")),h=i("../utils/checkBucketName"),v=h.checkBucketName,d=i("../utils/obj2xml"),o=d.obj2xml,s=E;s.putBucketVersioning=function(){var u=(0,l.default)(g.default.mark(function y(_,x){var S,w,A,H,R=arguments;return g.default.wrap(function(D){for(;;)switch(D.prev=D.next){case 0:if(S=R.length>2&&R[2]!==void 0?R[2]:{},v(_),["Enabled","Suspended"].includes(x)){D.next=4;break}throw new Error("status must be Enabled or Suspended");case 4:return w=this._bucketRequestParams("PUT",_,"versioning",S),A={VersioningConfiguration:{Status:x}},w.mime="xml",w.content=o(A,{headers:!0}),D.next=10,this.request(w);case 10:return H=D.sent,D.abrupt("return",{res:H.res,status:H.status});case 12:case"end":return D.stop()}},y,this)}));function m(y,_){return u.apply(this,arguments)}return m}()},{"../utils/checkBucketName":51,"../utils/obj2xml":72,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.array.includes.js":277}],23:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator")),l=p(i("@babel/runtime/helpers/asyncToGenerator")),h=i("../utils/checkBucketName"),v=h.checkBucketName,d=i("../utils/obj2xml"),o=d.obj2xml,s=i("../utils/isArray"),u=s.isArray,m=E;m.putBucketWebsite=function(){var y=(0,l.default)(g.default.mark(function x(S){var w,A,H,R,F,D,B,P=arguments;return g.default.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:if(w=P.length>1&&P[1]!==void 0?P[1]:{},A=P.length>2?P[2]:void 0,v(S),H=this._bucketRequestParams("PUT",S,"website",A),R={Suffix:w.index||"index.html"},F={IndexDocument:R},D={WebsiteConfiguration:F},w.supportSubDir&&(R.SupportSubDir=w.supportSubDir),w.type&&(R.Type=w.type),w.error&&(F.ErrorDocument={Key:w.error}),w.routingRules===void 0){G.next=14;break}if(u(w.routingRules)){G.next=13;break}throw new Error("RoutingRules must be Array");case 13:F.RoutingRules={RoutingRule:w.routingRules};case 14:return D=o(D),H.content=D,H.mime="xml",H.successStatuses=[200],G.next=20,this.request(H);case 20:return B=G.sent,G.abrupt("return",{res:B.res});case 22:case"end":return G.stop()}},x,this)}));function _(x){return y.apply(this,arguments)}return _}()},{"../utils/checkBucketName":51,"../utils/isArray":63,"../utils/obj2xml":72,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80}],24:[function(i,M,E){(function(p){(function(){"use strict";i("core-js/modules/es.object.to-string.js"),i("core-js/modules/es.regexp.to-string.js"),i("core-js/modules/web.dom-collections.for-each.js"),i("core-js/modules/es.object.keys.js"),E.encodeCallback=function(l,h){if(l.headers=l.headers||{},!Object.prototype.hasOwnProperty.call(l.headers,"x-oss-callback")&&h.callback){var v={callbackUrl:encodeURI(h.callback.url),callbackBody:h.callback.body};h.callback.host&&(v.callbackHost=h.callback.host),h.callback.contentType&&(v.callbackBodyType=h.callback.contentType);var d=p.from(JSON.stringify(v)).toString("base64");if(l.headers["x-oss-callback"]=d,h.callback.customValue){var o={};Object.keys(h.callback.customValue).forEach(function(s){o["x:".concat(s)]=h.callback.customValue[s].toString()}),l.headers["x-oss-callback-var"]=p.from(JSON.stringify(o)).toString("base64")}}}}).call(this)}).call(this,i("buffer").Buffer)},{buffer:90,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.regexp.to-string.js":301,"core-js/modules/web.dom-collections.for-each.js":339}],25:[function(i,M,E){"use strict";i("core-js/modules/es.array.concat.js"),i("core-js/modules/es.regexp.exec.js"),i("core-js/modules/es.string.replace.js"),i("core-js/modules/es.object.to-string.js"),i("core-js/modules/web.dom-collections.for-each.js");var p=function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(E,"__esModule",{value:!0}),E.getReqUrl=void 0;var g=p(i("copy-to")),l=p(i("url")),h=p(i("merge-descriptors")),v=p(i("is-type-of")),d=i("../utils/isIP"),o=i("../utils/checkConfigValid");function s(u){var m={},y=this.options.cname;o.checkConfigValid(this.options.endpoint,"endpoint"),g.default(this.options.endpoint,!1).to(m),u.bucket&&!y&&!d.isIP(m.hostname)&&!this.options.sldEnable&&(m.host="".concat(u.bucket,".").concat(m.host));var _="/";u.bucket&&this.options.sldEnable&&(_+="".concat(u.bucket,"/")),u.object&&(_+=this._escape(u.object).replace(/\+/g,"%2B")),m.pathname=_;var x={};if(u.query&&h.default(x,u.query),u.subres){var S={};v.default.string(u.subres)?S[u.subres]="":v.default.array(u.subres)?u.subres.forEach(function(w){S[w]=""}):S=u.subres,h.default(x,S)}return m.query=x,l.default.format(m)}E.getReqUrl=s},{"../utils/checkConfigValid":52,"../utils/isIP":69,"copy-to":94,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.string.replace.js":305,"core-js/modules/web.dom-collections.for-each.js":339,"is-type-of":466,"merge-descriptors":372,url:472}],26:[function(i,M,E){"use strict";i("core-js/modules/es.array.concat.js"),i("core-js/modules/es.object.assign.js"),i("core-js/modules/es.string.trim.js");var p=i("humanize-ms"),g=i("url"),l=i("../utils/checkBucketName"),h=l.checkBucketName,v=i("../utils/setRegion"),d=v.setRegion,o=i("../utils/checkConfigValid"),s=o.checkConfigValid;function u(m,y){s(m,"endpoint");var _=g.parse(m);if(_.protocol||(_=g.parse("http".concat(y?"s":"","://").concat(m))),_.protocol!=="http:"&&_.protocol!=="https:")throw new Error("Endpoint protocol must be http or https.");return _}M.exports=function(m){if(!m||!m.accessKeyId||!m.accessKeySecret)throw new Error("require accessKeyId, accessKeySecret");m.stsToken&&!m.refreshSTSToken&&!m.refreshSTSTokenInterval&&console.warn("It's recommended to set 'refreshSTSToken' and 'refreshSTSTokenInterval' to refresh stsToken\u3001accessKeyId\u3001accessKeySecret automatically when sts token has expired"),m.bucket&&h(m.bucket);var y=Object.assign({region:"oss-cn-hangzhou",internal:!1,secure:!1,timeout:6e4,bucket:null,endpoint:null,cname:!1,isRequestPay:!1,sldEnable:!1,headerEncoding:"utf-8",refreshSTSToken:null,refreshSTSTokenInterval:6e4*5,retryMax:0},m);if(y.accessKeyId=y.accessKeyId.trim(),y.accessKeySecret=y.accessKeySecret.trim(),y.timeout&&(y.timeout=p(y.timeout)),y.endpoint)y.endpoint=u(y.endpoint,y.secure);else if(y.region)y.endpoint=d(y.region,y.internal,y.secure);else throw new Error("require options.endpoint or options.region");return y.inited=!0,y}},{"../utils/checkBucketName":51,"../utils/checkConfigValid":52,"../utils/setRegion":75,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.object.assign.js":287,"core-js/modules/es.string.trim.js":308,"humanize-ms":356,url:472}],27:[function(i,M,E){"use strict";var p=i("merge-descriptors"),g=E;p(g,i("./processObjectSave"))},{"./processObjectSave":28,"merge-descriptors":372}],28:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator"));i("core-js/modules/es.array.concat.js");var l=p(i("@babel/runtime/helpers/asyncToGenerator")),h=i("../utils/checkBucketName"),v=h.checkBucketName,d=i("querystring"),o=i("js-base64"),s=o.Base64.encode,u=E;u.processObjectSave=function(){var y=(0,l.default)(g.default.mark(function x(S,w,A,H){var R,F,D,B;return g.default.wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return m(S,"sourceObject"),m(w,"targetObject"),m(A,"process"),w=this._objectName(w),H&&v(H),R=this._objectRequestParams("POST",S,{subres:"x-oss-process"}),F=H?",b_".concat(s(H)):"",w=s(w),D={"x-oss-process":"".concat(A,"|sys/saveas,o_").concat(w).concat(F)},R.content=d.stringify(D),U.next=12,this.request(R);case 12:return B=U.sent,U.abrupt("return",{res:B.res,status:B.res.status});case 14:case"end":return U.stop()}},x,this)}));function _(x,S,w,A){return y.apply(this,arguments)}return _}();function m(y,_){if(!y)throw new Error("".concat(_," is required"));if(typeof y!="string")throw new Error("".concat(_," must be String"))}},{"../utils/checkBucketName":51,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.array.concat.js":272,"js-base64":371,querystring:385}],29:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator"));i("core-js/modules/es.array.concat.js"),i("core-js/modules/es.function.name.js"),i("core-js/modules/es.object.to-string.js"),i("core-js/modules/es.promise.js"),i("core-js/modules/es.array.from.js"),i("core-js/modules/es.string.iterator.js"),i("core-js/modules/es.array.map.js"),i("core-js/modules/es.array.filter.js"),i("core-js/modules/es.array.find.js"),i("core-js/modules/es.regexp.to-string.js");var l=p(i("@babel/runtime/helpers/asyncToGenerator")),h=i("debug")("ali-oss:multipart-copy"),v=i("copy-to"),d=E;d.uploadPartCopy=function(){var o=(0,l.default)(g.default.mark(function u(m,y,_,x,S){var w,A,H,R,F,D=arguments;return g.default.wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return w=D.length>5&&D[5]!==void 0?D[5]:{},w.headers=w.headers||{},A=w.versionId||w.subres&&w.subres.versionId||null,A?H="/".concat(S.sourceBucketName,"/").concat(encodeURIComponent(S.sourceKey),"?versionId=").concat(A):H="/".concat(S.sourceBucketName,"/").concat(encodeURIComponent(S.sourceKey)),w.headers["x-oss-copy-source"]=H,x&&(w.headers["x-oss-copy-source-range"]="bytes=".concat(x)),w.subres={partNumber:_,uploadId:y},R=this._objectRequestParams("PUT",m,w),R.mime=w.mime,R.successStatuses=[200],P.next=12,this.request(R);case 12:return F=P.sent,P.abrupt("return",{name:m,etag:F.res.headers.etag,res:F.res});case 14:case"end":return P.stop()}},u,this)}));function s(u,m,y,_,x){return o.apply(this,arguments)}return s}(),d.multipartUploadCopy=function(){var o=(0,l.default)(g.default.mark(function u(m,y){var _,x,S,w,A,H,R,F,D,B,P,U,G=arguments;return g.default.wrap(function(K){for(;;)switch(K.prev=K.next){case 0:return _=G.length>2&&G[2]!==void 0?G[2]:{},this.resetCancelFlag(),x=_.versionId,S=x===void 0?null:x,w={versionId:S},K.next=6,this._getObjectMeta(y.sourceBucketName,y.sourceKey,w);case 6:if(A=K.sent,H=A.res.headers["content-length"],y.startOffset=y.startOffset||0,y.endOffset=y.endOffset||H,!(_.checkpoint&&_.checkpoint.uploadId)){K.next=14;break}return K.next=13,this._resumeMultipartCopy(_.checkpoint,y,_);case 13:return K.abrupt("return",K.sent);case 14:if(R=102400,F=y.endOffset-y.startOffset,!(F<R)){K.next=18;break}throw new Error("copySize must not be smaller than ".concat(R));case 18:if(!(_.partSize&&_.partSize<R)){K.next=20;break}throw new Error("partSize must not be smaller than ".concat(R));case 20:return K.next=22,this.initMultipartUpload(m,_);case 22:if(D=K.sent,B=D.uploadId,P=this._getPartSize(F,_.partSize),U={name:m,copySize:F,partSize:P,uploadId:B,doneParts:[]},!(_&&_.progress)){K.next=29;break}return K.next=29,_.progress(0,U,D.res);case 29:return K.next=31,this._resumeMultipartCopy(U,y,_);case 31:return K.abrupt("return",K.sent);case 32:case"end":return K.stop()}},u,this)}));function s(u,m){return o.apply(this,arguments)}return s}(),d._resumeMultipartCopy=function(){var o=(0,l.default)(g.default.mark(function u(m,y,_){var x,S,w,A,H,R,F,D,B,P,U,G,ee,K,Z,$,oe,ae,ye,Y,le;return g.default.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:if(!this.isCancel()){Ce.next=2;break}throw this._makeCancelEvent();case 2:if(x=_.versionId,S=x===void 0?null:x,w={versionId:S},A=m.copySize,H=m.partSize,R=m.uploadId,F=m.doneParts,D=m.name,B=this._divideMultipartCopyParts(A,H,y.startOffset),P=B.length,U={headers:{}},_.copyheaders&&v(_.copyheaders).to(U.headers),S&&v(w).to(U),G=function(Le,de,be){return new Promise(function(){var Te=(0,l.default)(g.default.mark(function Ae(Be,Pe){var _e,ne,te;return g.default.wrap(function(I){for(;;)switch(I.prev=I.next){case 0:if(I.prev=0,Le.isCancel()){I.next=22;break}return _e=B[de-1],ne="".concat(_e.start,"-").concat(_e.end-1),I.prev=4,I.next=7,Le.uploadPartCopy(D,R,de,ne,be,U);case 7:te=I.sent,I.next=15;break;case 10:if(I.prev=10,I.t0=I.catch(4),I.t0.status!==404){I.next=14;break}throw Le._makeAbortEvent();case 14:throw I.t0;case 15:if(Le.isCancel()){I.next=22;break}if(h("content-range ".concat(te.res.headers["content-range"])),F.push({number:de,etag:te.res.headers.etag}),m.doneParts=F,!(_&&_.progress)){I.next=22;break}return I.next=22,_.progress(F.length/P,m,te.res);case 22:Be(),I.next=29;break;case 25:I.prev=25,I.t1=I.catch(0),I.t1.partNum=de,Pe(I.t1);case 29:case"end":return I.stop()}},Ae,null,[[0,25],[4,10]])}));return function(Ae,Be){return Te.apply(this,arguments)}}())},ee=Array.from(new Array(P),function(we,Le){return Le+1}),K=F.map(function(we){return we.number}),Z=ee.filter(function(we){return K.indexOf(we)<0}),$=5,oe=_.parallel||$,!(this.checkBrowserAndVersion("Internet Explorer","10")||oe===1)){Ce.next=28;break}ae=0;case 18:if(!(ae<Z.length)){Ce.next=26;break}if(!this.isCancel()){Ce.next=21;break}throw this._makeCancelEvent();case 21:return Ce.next=23,G(this,Z[ae],y);case 23:ae++,Ce.next=18;break;case 26:Ce.next=40;break;case 28:return Ce.next=30,this._parallelNode(Z,oe,G,y);case 30:if(ye=Ce.sent,Y=ye.find(function(we){return we.name==="abort"}),!Y){Ce.next=34;break}throw Y;case 34:if(!this.isCancel()){Ce.next=36;break}throw this._makeCancelEvent();case 36:if(!(ye&&ye.length>0)){Ce.next=40;break}throw le=ye[0],le.message="Failed to copy some parts with error: ".concat(le.toString()," part_num: ").concat(le.partNum),le;case 40:return Ce.next=42,this.completeMultipartUpload(D,R,F,_);case 42:return Ce.abrupt("return",Ce.sent);case 43:case"end":return Ce.stop()}},u,this)}));function s(u,m,y){return o.apply(this,arguments)}return s}(),d._divideMultipartCopyParts=function(s,u,m){for(var y=Math.ceil(s/u),_=[],x=0;x<y;x++){var S=u*x+m,w=Math.min(S+u,s+m);_.push({start:S,end:w})}return _},d._getObjectMeta=function(){var o=(0,l.default)(g.default.mark(function u(m,y,_){var x,S;return g.default.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return x=this.getBucket(),this.setBucket(m),A.next=4,this.head(y,_);case 4:return S=A.sent,this.setBucket(x),A.abrupt("return",S);case 7:case"end":return A.stop()}},u,this)}));function s(u,m,y){return o.apply(this,arguments)}return s}()},{"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"copy-to":94,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.array.filter.js":274,"core-js/modules/es.array.find.js":275,"core-js/modules/es.array.from.js":276,"core-js/modules/es.array.map.js":280,"core-js/modules/es.function.name.js":284,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.promise.js":295,"core-js/modules/es.regexp.to-string.js":301,"core-js/modules/es.string.iterator.js":303,debug:465}],30:[function(i,M,E){(function(p){(function(){"use strict";var g=i("@babel/runtime/helpers/interopRequireDefault"),l=g(i("@babel/runtime/regenerator"));i("core-js/modules/es.array.map.js"),i("core-js/modules/es.array.filter.js"),i("core-js/modules/es.object.to-string.js"),i("core-js/modules/es.array.sort.js"),i("core-js/modules/es.array.concat.js"),i("core-js/modules/es.regexp.to-string.js");var h=g(i("@babel/runtime/helpers/asyncToGenerator")),v=i("copy-to"),d=i("./callback"),o=i("./utils/deepCopy"),s=o.deepCopyWith,u=i("./utils/isBuffer"),m=u.isBuffer,y=i("./utils/omit"),_=y.omit,x=E;x.listUploads=function(){var S=(0,h.default)(l.default.mark(function A(H,R){var F,D,B,P;return l.default.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return R=R||{},F={},v(R).to(F),F.subres="uploads",D=this._objectRequestParams("GET","",F),D.query=H,D.xmlResponse=!0,D.successStatuses=[200],G.next=10,this.request(D);case 10:return B=G.sent,P=B.data.Upload||[],Array.isArray(P)||(P=[P]),P=P.map(function(ee){return{name:ee.Key,uploadId:ee.UploadId,initiated:ee.Initiated}}),G.abrupt("return",{res:B.res,uploads:P,bucket:B.data.Bucket,nextKeyMarker:B.data.NextKeyMarker,nextUploadIdMarker:B.data.NextUploadIdMarker,isTruncated:B.data.IsTruncated==="true"});case 15:case"end":return G.stop()}},A,this)}));function w(A,H){return S.apply(this,arguments)}return w}(),x.listParts=function(){var S=(0,h.default)(l.default.mark(function A(H,R,F,D){var B,P,U;return l.default.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return D=D||{},B={},v(D).to(B),B.subres={uploadId:R},P=this._objectRequestParams("GET",H,B),P.query=F,P.xmlResponse=!0,P.successStatuses=[200],ee.next=10,this.request(P);case 10:return U=ee.sent,ee.abrupt("return",{res:U.res,uploadId:U.data.UploadId,bucket:U.data.Bucket,name:U.data.Key,partNumberMarker:U.data.PartNumberMarker,nextPartNumberMarker:U.data.NextPartNumberMarker,maxParts:U.data.MaxParts,isTruncated:U.data.IsTruncated,parts:U.data.Part||[]});case 12:case"end":return ee.stop()}},A,this)}));function w(A,H,R,F){return S.apply(this,arguments)}return w}(),x.abortMultipartUpload=function(){var S=(0,h.default)(l.default.mark(function A(H,R,F){var D,B,P;return l.default.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return this._stop(),F=F||{},D={},v(F).to(D),D.subres={uploadId:R},B=this._objectRequestParams("DELETE",H,D),B.successStatuses=[204],G.next=9,this.request(B);case 9:return P=G.sent,G.abrupt("return",{res:P.res});case 11:case"end":return G.stop()}},A,this)}));function w(A,H,R){return S.apply(this,arguments)}return w}(),x.initMultipartUpload=function(){var S=(0,h.default)(l.default.mark(function A(H,R){var F,D,B;return l.default.wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return R=R||{},F={},v(R).to(F),F.headers=F.headers||{},this._convertMetaToHeaders(R.meta,F.headers),F.subres="uploads",D=this._objectRequestParams("POST",H,F),D.mime=R.mime,D.xmlResponse=!0,D.successStatuses=[200],U.next=12,this.request(D);case 12:return B=U.sent,U.abrupt("return",{res:B.res,bucket:B.data.Bucket,name:B.data.Key,uploadId:B.data.UploadId});case 14:case"end":return U.stop()}},A,this)}));function w(A,H){return S.apply(this,arguments)}return w}(),x.uploadPart=function(){var S=(0,h.default)(l.default.mark(function A(H,R,F,D,B,P,U){var G,ee;return l.default.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:if(G={size:P-B},ee=p&&p.browser,!ee){Z.next=8;break}return Z.next=5,this._createBuffer(D,B,P);case 5:G.content=Z.sent,Z.next=11;break;case 8:return Z.next=10,this._createStream(D,B,P);case 10:G.stream=Z.sent;case 11:return Z.next=13,this._uploadPart(H,R,F,G,U);case 13:return Z.abrupt("return",Z.sent);case 14:case"end":return Z.stop()}},A,this)}));function w(A,H,R,F,D,B,P){return S.apply(this,arguments)}return w}(),x.completeMultipartUpload=function(){var S=(0,h.default)(l.default.mark(function A(H,R,F,D){var B,P,U,G,ee,K,Z,$;return l.default.wrap(function(ae){for(;;)switch(ae.prev=ae.next){case 0:for(B=F.concat().sort(function(ye,Y){return ye.number-Y.number}).filter(function(ye,Y,le){return!Y||ye.number!==le[Y-1].number}),P=`<?xml version="1.0" encoding="UTF-8"?>
<CompleteMultipartUpload>
`,U=0;U<B.length;U++)G=B[U],P+=`<Part>
`,P+="<PartNumber>".concat(G.number,`</PartNumber>
`),P+="<ETag>".concat(G.etag,`</ETag>
`),P+=`</Part>
`;return P+="</CompleteMultipartUpload>",D=D||{},ee={},ee=s(D,function(ye){if(m(ye))return null}),ee.subres={uploadId:R},ee.headers=_(ee.headers,["x-oss-server-side-encryption","x-oss-storage-class"]),K=this._objectRequestParams("POST",H,ee),d.encodeCallback(K,ee),K.mime="xml",K.content=P,K.headers&&K.headers["x-oss-callback"]||(K.xmlResponse=!0),K.successStatuses=[200],ae.next=17,this.request(K);case 17:if(Z=ae.sent,!D.progress){ae.next=21;break}return ae.next=21,D.progress(1,null,Z.res);case 21:return $={res:Z.res,bucket:K.bucket,name:H,etag:Z.res.headers.etag},K.headers&&K.headers["x-oss-callback"]&&($.data=JSON.parse(Z.data.toString())),ae.abrupt("return",$);case 24:case"end":return ae.stop()}},A,this)}));function w(A,H,R,F){return S.apply(this,arguments)}return w}(),x._uploadPart=function(){var S=(0,h.default)(l.default.mark(function A(H,R,F,D,B){var P,U,G,ee;return l.default.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return B=B||{},P={},v(B).to(P),P.headers=P.headers||{},P.headers["Content-Length"]=D.size,P.headers=_(P.headers,["x-oss-server-side-encryption"]),P.subres={partNumber:F,uploadId:R},U=this._objectRequestParams("PUT",H,P),U.mime=P.mime,G=p&&p.browser,G?U.content=D.content:U.stream=D.stream,U.successStatuses=[200],U.disabledMD5=B.disabledMD5,Z.next=15,this.request(U);case 15:if(ee=Z.sent,ee.res.headers.etag){Z.next=18;break}throw new Error(`Please set the etag of expose-headers in OSS
https://help.aliyun.com/document_detail/32069.html`);case 18:return D.stream&&(D.stream=null,U.stream=null),Z.abrupt("return",{name:H,etag:ee.res.headers.etag,res:ee.res});case 20:case"end":return Z.stop()}},A,this)}));function w(A,H,R,F,D){return S.apply(this,arguments)}return w}()}).call(this)}).call(this,i("_process"))},{"./callback":24,"./utils/deepCopy":58,"./utils/isBuffer":65,"./utils/omit":73,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,_process:467,"copy-to":94,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.array.filter.js":274,"core-js/modules/es.array.map.js":280,"core-js/modules/es.array.sort.js":282,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.regexp.to-string.js":301}],31:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator")),l=p(i("@babel/runtime/helpers/asyncToGenerator")),h=i("url"),v=i("utility"),d=i("copy-to"),o=i("../../common/signUtils"),s=i("../utils/isIP"),u=s.isIP,m=i("../utils/setSTSToken"),y=m.setSTSToken,_=i("../utils/isFunction"),x=_.isFunction,S=E;S.asyncSignatureUrl=function(){var w=(0,l.default)(g.default.mark(function H(R,F){var D,B,P,U,G;return g.default.wrap(function(K){for(;;)switch(K.prev=K.next){case 0:if(!u(this.options.endpoint.hostname)){K.next=2;break}throw new Error("can not get the object URL when endpoint is IP");case 2:if(F=F||{},R=this._objectName(R),F.method=F.method||"GET",D=v.timestamp()+(F.expires||1800),B={bucket:this.options.bucket,object:R},P=this._getResource(B),!(this.options.stsToken&&x(this.options.refreshSTSToken))){K.next=11;break}return K.next=11,y.call(this);case 11:return this.options.stsToken&&(F["security-token"]=this.options.stsToken),U=o._signatureForURL(this.options.accessKeySecret,F,P,D),G=h.parse(this._getReqUrl(B)),G.query={OSSAccessKeyId:this.options.accessKeyId,Expires:D,Signature:U.Signature},d(U.subResource).to(G.query),K.abrupt("return",G.format());case 17:case"end":return K.stop()}},H,this)}));function A(H,R){return w.apply(this,arguments)}return A}()},{"../../common/signUtils":50,"../utils/isFunction":68,"../utils/isIP":69,"../utils/setSTSToken":76,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"copy-to":94,url:472,utility:474}],32:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator"));i("core-js/modules/es.object.to-string.js"),i("core-js/modules/web.dom-collections.for-each.js"),i("core-js/modules/es.object.keys.js"),i("core-js/modules/es.array.find.js"),i("core-js/modules/es.array.includes.js"),i("core-js/modules/es.array.concat.js"),i("core-js/modules/es.regexp.exec.js"),i("core-js/modules/es.string.replace.js");var l=p(i("@babel/runtime/helpers/typeof")),h=p(i("@babel/runtime/helpers/asyncToGenerator")),v=i("../utils/checkBucketName"),d=v.checkBucketName,o=E,s=["content-type","content-encoding","content-language","content-disposition","cache-control","expires"];o.copy=function(){var u=(0,h.default)(g.default.mark(function y(_,x,S,w){var A,H,R;return g.default.wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return(0,l.default)(S)==="object"&&(w=S),w=w||{},w.headers=w.headers||{},Object.keys(w.headers).forEach(function(B){w.headers["x-oss-copy-source-".concat(B.toLowerCase())]=w.headers[B]}),(w.meta||Object.keys(w.headers).find(function(B){return s.includes(B.toLowerCase())}))&&(w.headers["x-oss-metadata-directive"]="REPLACE"),this._convertMetaToHeaders(w.meta,w.headers),x=this._getSourceName(x,S),w.versionId&&(x="".concat(x,"?versionId=").concat(w.versionId)),w.headers["x-oss-copy-source"]=x,A=this._objectRequestParams("PUT",_,w),A.xmlResponse=!0,A.successStatuses=[200,304],D.next=14,this.request(A);case 14:return H=D.sent,R=H.data,R&&(R={etag:R.ETag,lastModified:R.LastModified}),D.abrupt("return",{data:R,res:H.res});case 18:case"end":return D.stop()}},y,this)}));function m(y,_,x,S){return u.apply(this,arguments)}return m}(),o._getSourceName=function(m,y){return typeof y=="string"?m=this._objectName(m):m[0]!=="/"?y=this.options.bucket:(y=m.replace(/\/(.+?)(\/.*)/,"$1"),m=m.replace(/(\/.+?\/)(.*)/,"$2")),d(y),m=encodeURIComponent(m),m="/".concat(y,"/").concat(m),m}},{"../utils/checkBucketName":51,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/helpers/typeof":79,"@babel/runtime/regenerator":80,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.array.find.js":275,"core-js/modules/es.array.includes.js":277,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.string.replace.js":305,"core-js/modules/web.dom-collections.for-each.js":339}],33:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator"));i("core-js/modules/es.object.assign.js");var l=p(i("@babel/runtime/helpers/asyncToGenerator")),h=E;h.delete=function(){var v=(0,l.default)(g.default.mark(function o(s){var u,m,y,_=arguments;return g.default.wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return u=_.length>1&&_[1]!==void 0?_[1]:{},u.subres=Object.assign({},u.subres),u.versionId&&(u.subres.versionId=u.versionId),m=this._objectRequestParams("DELETE",s,u),m.successStatuses=[204],S.next=7,this.request(m);case 7:return y=S.sent,S.abrupt("return",{res:y.res});case 9:case"end":return S.stop()}},o,this)}));function d(o){return v.apply(this,arguments)}return d}()},{"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.object.assign.js":287}],34:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator"));i("core-js/modules/es.object.assign.js");var l=p(i("@babel/runtime/helpers/asyncToGenerator")),h=i("utility"),v=i("../utils/obj2xml"),d=v.obj2xml,o=E;o.deleteMulti=function(){var s=(0,l.default)(g.default.mark(function m(y){var _,x,S,w,A,H,R,F,D,B,P,U,G,ee=arguments;return g.default.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:if(_=ee.length>1&&ee[1]!==void 0?ee[1]:{},x=[],!(!y||!y.length)){Z.next=4;break}throw new Error("names is required");case 4:for(S=0;S<y.length;S++)w={},typeof y[S]=="string"?w.Key=h.escape(this._objectName(y[S])):(A=y[S],H=A.key,R=A.versionId,w.Key=h.escape(this._objectName(H)),w.VersionId=R),x.push(w);return F={Delete:{Quiet:!!_.quiet,Object:x}},D=d(F,{headers:!0}),_.subres=Object.assign({delete:""},_.subres),_.versionId&&(_.subres.versionId=_.versionId),B=this._objectRequestParams("POST","",_),B.mime="xml",B.content=D,B.xmlResponse=!0,B.successStatuses=[200],Z.next=16,this.request(B);case 16:return P=Z.sent,U=P.data,G=U&&U.Deleted||null,G&&(Array.isArray(G)||(G=[G])),Z.abrupt("return",{res:P.res,deleted:G||[]});case 21:case"end":return Z.stop()}},m,this)}));function u(m){return s.apply(this,arguments)}return u}()},{"../utils/obj2xml":72,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.object.assign.js":287,utility:474}],35:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator"));i("core-js/modules/es.object.assign.js");var l=p(i("@babel/runtime/helpers/asyncToGenerator")),h=E;h.deleteObjectTagging=function(){var v=(0,l.default)(g.default.mark(function o(s){var u,m,y,_=arguments;return g.default.wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return u=_.length>1&&_[1]!==void 0?_[1]:{},u.subres=Object.assign({tagging:""},u.subres),u.versionId&&(u.subres.versionId=u.versionId),s=this._objectName(s),m=this._objectRequestParams("DELETE",s,u),m.successStatuses=[204],S.next=8,this.request(m);case 8:return y=S.sent,S.abrupt("return",{status:y.status,res:y.res});case 10:case"end":return S.stop()}},o,this)}));function d(o){return v.apply(this,arguments)}return d}()},{"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.object.assign.js":287}],36:[function(i,M,E){"use strict";i("core-js/modules/es.array.concat.js");var p=i("url"),g=i("../utils/isIP"),l=g.isIP,h=E;h.generateObjectUrl=function(d,o){if(l(this.options.endpoint.hostname))throw new Error("can not get the object URL when endpoint is IP");if(o)o[o.length-1]!=="/"&&(o+="/");else{o=this.options.endpoint.format();var s=p.parse(o),u=this.options.bucket;s.hostname="".concat(u,".").concat(s.hostname),s.host="".concat(u,".").concat(s.host),o=s.format()}return o+this._escape(this._objectName(d))}},{"../utils/isIP":69,"core-js/modules/es.array.concat.js":272,url:472}],37:[function(i,M,E){(function(p){(function(){"use strict";var g=i("@babel/runtime/helpers/interopRequireDefault"),l=g(i("@babel/runtime/regenerator"));i("core-js/modules/es.object.assign.js");var h=g(i("@babel/runtime/helpers/asyncToGenerator")),v=i("fs"),d=i("is-type-of"),o=E;o.get=function(){var s=(0,h.default)(l.default.mark(function m(y,_){var x,S,w,A,H,R,F,D,B=arguments;return l.default.wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return x=B.length>2&&B[2]!==void 0?B[2]:{},S=null,w=!1,d.writableStream(_)?S=_:d.string(_)?(S=v.createWriteStream(_),w=!0):x=_,x=x||{},A=p&&p.browser,H=x.responseCacheControl===null?"":"no-cache",R=A&&H?{"response-cache-control":H}:{},x.subres=Object.assign(R,x.subres),x.versionId&&(x.subres.versionId=x.versionId),x.process&&(x.subres["x-oss-process"]=x.process),U.prev=11,D=this._objectRequestParams("GET",y,x),D.writeStream=S,D.successStatuses=[200,206,304],U.next=17,this.request(D);case 17:F=U.sent,w&&S.destroy(),U.next=28;break;case 21:if(U.prev=21,U.t0=U.catch(11),!w){U.next=27;break}return S.destroy(),U.next=27,this._deleteFileSafe(_);case 27:throw U.t0;case 28:return U.abrupt("return",{res:F.res,content:F.data});case 29:case"end":return U.stop()}},m,this,[[11,21]])}));function u(m,y){return s.apply(this,arguments)}return u}()}).call(this)}).call(this,i("_process"))},{"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,_process:467,"core-js/modules/es.object.assign.js":287,fs:89,"is-type-of":466}],38:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator"));i("core-js/modules/es.object.assign.js");var l=p(i("@babel/runtime/helpers/asyncToGenerator")),h=E;h.getACL=function(){var v=(0,l.default)(g.default.mark(function o(s){var u,m,y,_=arguments;return g.default.wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return u=_.length>1&&_[1]!==void 0?_[1]:{},u.subres=Object.assign({acl:""},u.subres),u.versionId&&(u.subres.versionId=u.versionId),s=this._objectName(s),m=this._objectRequestParams("GET",s,u),m.successStatuses=[200],m.xmlResponse=!0,S.next=9,this.request(m);case 9:return y=S.sent,S.abrupt("return",{acl:y.data.AccessControlList.Grant,owner:{id:y.data.Owner.ID,displayName:y.data.Owner.DisplayName},res:y.res});case 11:case"end":return S.stop()}},o,this)}));function d(o){return v.apply(this,arguments)}return d}()},{"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.object.assign.js":287}],39:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator"));i("core-js/modules/es.regexp.exec.js"),i("core-js/modules/es.string.replace.js"),i("core-js/modules/es.object.to-string.js"),i("core-js/modules/web.dom-collections.for-each.js"),i("core-js/modules/es.object.keys.js"),i("core-js/modules/es.object.assign.js"),i("core-js/modules/es.array.map.js"),i("core-js/modules/es.number.constructor.js");var l=p(i("@babel/runtime/helpers/asyncToGenerator")),h=E,v=i("../utils/isObject"),d=v.isObject,o=i("../utils/isArray"),s=o.isArray;h.getBucketVersions=u,h.listObjectVersions=u;function u(){return m.apply(this,arguments)}function m(){return m=(0,l.default)(g.default.mark(function x(){var S,w,A,H,R,F,D,B,P=arguments;return g.default.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:if(S=P.length>0&&P[0]!==void 0?P[0]:{},w=P.length>1&&P[1]!==void 0?P[1]:{},!(S.versionIdMarker&&S.keyMarker===void 0)){G.next=4;break}throw new Error("A version-id marker cannot be specified without a key marker");case 4:return w.subres=Object.assign({versions:""},w.subres),w.versionId&&(w.subres.versionId=w.versionId),A=this._objectRequestParams("GET","",w),A.xmlResponse=!0,A.successStatuses=[200],A.query=_(S),G.next=12,this.request(A);case 12:return H=G.sent,R=H.data.Version||[],F=H.data.DeleteMarker||[],D=this,R&&(Array.isArray(R)||(R=[R]),R=R.map(function(ee){return{name:ee.Key,url:D._objectUrl(ee.Key),lastModified:ee.LastModified,isLatest:ee.IsLatest==="true",versionId:ee.VersionId,etag:ee.ETag,type:ee.Type,size:Number(ee.Size),storageClass:ee.StorageClass,owner:{id:ee.Owner.ID,displayName:ee.Owner.DisplayName}}})),F&&(s(F)||(F=[F]),F=F.map(function(ee){return{name:ee.Key,lastModified:ee.LastModified,versionId:ee.VersionId,owner:{id:ee.Owner.ID,displayName:ee.Owner.DisplayName}}})),B=H.data.CommonPrefixes||null,B&&(s(B)||(B=[B]),B=B.map(function(ee){return ee.Prefix})),G.abrupt("return",{res:H.res,objects:R,deleteMarker:F,prefixes:B,nextMarker:H.data.NextKeyMarker||null,NextVersionIdMarker:H.data.NextVersionIdMarker||null,nextKeyMarker:H.data.NextKeyMarker||null,nextVersionIdMarker:H.data.NextVersionIdMarker||null,isTruncated:H.data.IsTruncated==="true"});case 21:case"end":return G.stop()}},x,this)})),m.apply(this,arguments)}function y(x){return x.replace(/([A-Z])/g,"-$1").toLowerCase()}function _(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},S={};return d(x)&&Object.keys(x).forEach(function(w){S[y(w)]=x[w]}),S}},{"../utils/isArray":63,"../utils/isObject":70,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.array.map.js":280,"core-js/modules/es.number.constructor.js":286,"core-js/modules/es.object.assign.js":287,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.string.replace.js":305,"core-js/modules/web.dom-collections.for-each.js":339}],40:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator"));i("core-js/modules/es.object.assign.js");var l=p(i("@babel/runtime/helpers/asyncToGenerator")),h=E;h.getObjectMeta=function(){var v=(0,l.default)(g.default.mark(function o(s,u){var m,y;return g.default.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return u=u||{},s=this._objectName(s),u.subres=Object.assign({objectMeta:""},u.subres),u.versionId&&(u.subres.versionId=u.versionId),m=this._objectRequestParams("HEAD",s,u),m.successStatuses=[200],x.next=8,this.request(m);case 8:return y=x.sent,x.abrupt("return",{status:y.status,res:y.res});case 10:case"end":return x.stop()}},o,this)}));function d(o,s){return v.apply(this,arguments)}return d}()},{"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.object.assign.js":287}],41:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator"));i("core-js/modules/es.object.assign.js"),i("core-js/modules/es.object.to-string.js"),i("core-js/modules/web.dom-collections.for-each.js");var l=p(i("@babel/runtime/helpers/asyncToGenerator")),h=E,v=i("../utils/isObject"),d=v.isObject;h.getObjectTagging=function(){var o=(0,l.default)(g.default.mark(function u(m){var y,_,x,S,w,A,H=arguments;return g.default.wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return y=H.length>1&&H[1]!==void 0?H[1]:{},y.subres=Object.assign({tagging:""},y.subres),y.versionId&&(y.subres.versionId=y.versionId),m=this._objectName(m),_=this._objectRequestParams("GET",m,y),_.successStatuses=[200],F.next=8,this.request(_);case 8:return x=F.sent,F.next=11,this.parseXML(x.data);case 11:return S=F.sent,w=S.TagSet.Tag,w=w&&d(w)?[w]:w||[],A={},w.forEach(function(D){A[D.Key]=D.Value}),F.abrupt("return",{status:x.status,res:x.res,tag:A});case 17:case"end":return F.stop()}},u,this)}));function s(u){return o.apply(this,arguments)}return s}()},{"../utils/isObject":70,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.object.assign.js":287,"core-js/modules/es.object.to-string.js":291,"core-js/modules/web.dom-collections.for-each.js":339}],42:[function(i,M,E){"use strict";var p=i("../utils/isIP"),g=p.isIP,l=E;l.getObjectUrl=function(v,d){if(g(this.options.endpoint.hostname))throw new Error("can not get the object URL when endpoint is IP");return d?d[d.length-1]!=="/"&&(d+="/"):d=this.options.endpoint.format(),d+this._escape(this._objectName(v))}},{"../utils/isIP":69}],43:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator"));i("core-js/modules/es.object.assign.js");var l=p(i("@babel/runtime/helpers/asyncToGenerator")),h=E;h.getSymlink=function(){var v=(0,l.default)(g.default.mark(function o(s){var u,m,y,_,x=arguments;return g.default.wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return u=x.length>1&&x[1]!==void 0?x[1]:{},u.subres=Object.assign({symlink:""},u.subres),u.versionId&&(u.subres.versionId=u.versionId),s=this._objectName(s),m=this._objectRequestParams("GET",s,u),m.successStatuses=[200],w.next=8,this.request(m);case 8:return y=w.sent,_=y.res.headers["x-oss-symlink-target"],w.abrupt("return",{targetName:decodeURIComponent(_),res:y.res});case 11:case"end":return w.stop()}},o,this)}));function d(o){return v.apply(this,arguments)}return d}()},{"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.object.assign.js":287}],44:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator"));i("core-js/modules/es.object.assign.js"),i("core-js/modules/es.object.to-string.js"),i("core-js/modules/web.dom-collections.for-each.js"),i("core-js/modules/es.object.keys.js");var l=p(i("@babel/runtime/helpers/asyncToGenerator")),h=i("../utils/checkEnv"),v=h.checkEnv,d=E;d.head=function(){var o=(0,l.default)(g.default.mark(function u(m){var y,_,x,S,w=arguments;return g.default.wrap(function(H){for(;;)switch(H.prev=H.next){case 0:return y=w.length>1&&w[1]!==void 0?w[1]:{},v("Because HeadObject has gzip enabled, head cannot get the file size correctly. If you need to get the file size, please use getObjectMeta"),y.subres=Object.assign({},y.subres),y.versionId&&(y.subres.versionId=y.versionId),_=this._objectRequestParams("HEAD",m,y),_.successStatuses=[200,304],H.next=8,this.request(_);case 8:return x=H.sent,S={meta:null,res:x.res,status:x.status},x.status===200&&Object.keys(x.headers).forEach(function(R){R.indexOf("x-oss-meta-")===0&&(S.meta||(S.meta={}),S.meta[R.substring(11)]=x.headers[R])}),H.abrupt("return",S);case 12:case"end":return H.stop()}},u,this)}));function s(u){return o.apply(this,arguments)}return s}()},{"../utils/checkEnv":53,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.object.assign.js":287,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.object.to-string.js":291,"core-js/modules/web.dom-collections.for-each.js":339}],45:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator"));i("core-js/modules/es.object.assign.js");var l=p(i("@babel/runtime/helpers/asyncToGenerator")),h=E;h.putACL=function(){var v=(0,l.default)(g.default.mark(function o(s,u,m){var y,_;return g.default.wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return m=m||{},m.subres=Object.assign({acl:""},m.subres),m.versionId&&(m.subres.versionId=m.versionId),m.headers=m.headers||{},m.headers["x-oss-object-acl"]=u,s=this._objectName(s),y=this._objectRequestParams("PUT",s,m),y.successStatuses=[200],S.next=10,this.request(y);case 10:return _=S.sent,S.abrupt("return",{res:_.res});case 12:case"end":return S.stop()}},o,this)}));function d(o,s,u){return v.apply(this,arguments)}return d}()},{"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.object.assign.js":287}],46:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator"));i("core-js/modules/es.object.assign.js"),i("core-js/modules/es.array.map.js"),i("core-js/modules/es.object.keys.js");var l=p(i("@babel/runtime/helpers/asyncToGenerator")),h=i("../utils/obj2xml"),v=h.obj2xml,d=i("../utils/checkObjectTag"),o=d.checkObjectTag,s=E;s.putObjectTagging=function(){var u=(0,l.default)(g.default.mark(function y(_,x){var S,w,A,H,R=arguments;return g.default.wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return S=R.length>2&&R[2]!==void 0?R[2]:{},o(x),S.subres=Object.assign({tagging:""},S.subres),S.versionId&&(S.subres.versionId=S.versionId),_=this._objectName(_),w=this._objectRequestParams("PUT",_,S),w.successStatuses=[200],x=Object.keys(x).map(function(B){return{Key:B,Value:x[B]}}),A={Tagging:{TagSet:{Tag:x}}},w.mime="xml",w.content=v(A),D.next=13,this.request(w);case 13:return H=D.sent,D.abrupt("return",{res:H.res,status:H.status});case 15:case"end":return D.stop()}},y,this)}));function m(y,_){return u.apply(this,arguments)}return m}()},{"../utils/checkObjectTag":54,"../utils/obj2xml":72,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.array.map.js":280,"core-js/modules/es.object.assign.js":287,"core-js/modules/es.object.keys.js":290}],47:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator"));i("core-js/modules/es.object.assign.js");var l=p(i("@babel/runtime/helpers/asyncToGenerator")),h=E;h.putSymlink=function(){var v=(0,l.default)(g.default.mark(function o(s,u,m){var y,_;return g.default.wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return m=m||{},m.headers=m.headers||{},u=this._escape(this._objectName(u)),this._convertMetaToHeaders(m.meta,m.headers),m.headers["x-oss-symlink-target"]=u,m.subres=Object.assign({symlink:""},m.subres),m.versionId&&(m.subres.versionId=m.versionId),m.storageClass&&(m.headers["x-oss-storage-class"]=m.storageClass),s=this._objectName(s),y=this._objectRequestParams("PUT",s,m),y.successStatuses=[200],S.next=13,this.request(y);case 13:return _=S.sent,S.abrupt("return",{res:_.res});case 15:case"end":return S.stop()}},o,this)}));function d(o,s,u){return v.apply(this,arguments)}return d}()},{"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.object.assign.js":287}],48:[function(i,M,E){"use strict";var p=i("url"),g=i("utility"),l=i("copy-to"),h=i("../../common/signUtils"),v=i("../utils/isIP"),d=v.isIP,o=E;o.signatureUrl=function(u,m){if(d(this.options.endpoint.hostname))throw new Error("can not get the object URL when endpoint is IP");m=m||{},u=this._objectName(u),m.method=m.method||"GET";var y=g.timestamp()+(m.expires||1800),_={bucket:this.options.bucket,object:u},x=this._getResource(_);this.options.stsToken&&(m["security-token"]=this.options.stsToken);var S=h._signatureForURL(this.options.accessKeySecret,m,x,y),w=p.parse(this._getReqUrl(_));return w.query={OSSAccessKeyId:this.options.accessKeyId,Expires:y,Signature:S.Signature},l(S.subResource).to(w.query),w.format()}},{"../../common/signUtils":50,"../utils/isIP":69,"copy-to":94,url:472,utility:474}],49:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator"));i("core-js/modules/es.array.iterator.js"),i("core-js/modules/es.object.to-string.js"),i("core-js/modules/es.promise.js"),i("core-js/modules/es.string.iterator.js"),i("core-js/modules/web.dom-collections.iterator.js"),i("core-js/modules/web.dom-collections.for-each.js"),i("core-js/modules/es.function.name.js");var l=p(i("@babel/runtime/helpers/asyncToGenerator")),h=i("./utils/isArray"),v=h.isArray,d=E;d._parallelNode=function(){var o=(0,l.default)(g.default.mark(function u(m,y,_,x){var S,w,A,H,R,F,D,B;return g.default.wrap(function(U){for(;;)switch(U.prev=U.next){case 0:S=this,w=[],A=[],H=m.length/y,R=m.length%y,F=R===0?H:(m.length-R)/y+1,D=1,B=0;case 8:if(!(B<m.length)){U.next=26;break}if(!S.isCancel()){U.next=11;break}return U.abrupt("break",26);case 11:if(x?A.push(_(S,m[B],x)):A.push(_(S,m[B])),!(A.length===y||D===F&&B===m.length-1)){U.next=23;break}return U.prev=13,D+=1,U.next=17,Promise.all(A);case 17:U.next=22;break;case 19:U.prev=19,U.t0=U.catch(13),w.push(U.t0);case 22:A=[];case 23:B++,U.next=8;break;case 26:return U.abrupt("return",w);case 27:case"end":return U.stop()}},u,this,[[13,19]])}));function s(u,m,y,_){return o.apply(this,arguments)}return s}(),d._parallel=function(s,u,m){var y=this;return new Promise(function(_){var x=[];if(u<=0||!s){_(x);return}function S(U){return function(){if(U===null)throw new Error("Callback was already called.");var G=U;U=null;for(var ee=arguments.length,K=new Array(ee),Z=0;Z<ee;Z++)K[Z]=arguments[Z];G.apply(this,K)}}function w(U){var G=-1,ee=U.length;return function(){return++G<ee&&!y.isCancel()?{value:U[G],key:G}:null}}var A=w(s),H=!1,R=0,F=!1;function D(U){R-=1,U?(H=!0,x.push(U),_(x)):H&&R<=0?(H=!0,_(x)):F||(y.isCancel()?_(x):P())}function B(U,G){m(U).then(function(ee){G(null,ee)}).catch(function(ee){G(ee)})}function P(){for(F=!0;R<u&&!H&&!y.isCancel();){var U=A();if(U===null||x.length>0){H=!0,R<=0&&_(x);return}R+=1,B(U.value,S(D))}F=!1}P()})},d.cancel=function(s){this.options.cancelFlag=!0,v(this.multipartUploadStreams)&&this.multipartUploadStreams.forEach(function(u){if(u.destroyed===!1){var m={name:"cancel",message:"cancel"};u.destroy(m)}}),this.multipartUploadStreams=[],s&&this.abortMultipartUpload(s.name,s.uploadId,s.options)},d.isCancel=function(){return this.options.cancelFlag},d.resetCancelFlag=function(){this.options.cancelFlag=!1},d._stop=function(){this.options.cancelFlag=!0},d._makeCancelEvent=function(){var s={status:0,name:"cancel"};return s},d._makeAbortEvent=function(){var s={status:0,name:"abort",message:"upload task has been abort"};return s}},{"./utils/isArray":63,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.array.iterator.js":278,"core-js/modules/es.function.name.js":284,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.promise.js":295,"core-js/modules/es.string.iterator.js":303,"core-js/modules/web.dom-collections.for-each.js":339,"core-js/modules/web.dom-collections.iterator.js":340}],50:[function(i,M,E){(function(p){(function(){"use strict";i("core-js/modules/es.string.trim.js"),i("core-js/modules/es.array.sort.js"),i("core-js/modules/es.array.join.js"),i("core-js/modules/es.object.to-string.js"),i("core-js/modules/web.dom-collections.for-each.js"),i("core-js/modules/es.object.keys.js"),i("core-js/modules/es.array.concat.js"),i("core-js/modules/es.regexp.to-string.js");var g=i("./../../shims/crypto/crypto.js"),l=i("is-type-of"),h=i("./utils/lowercaseKeyHeader"),v=h.lowercaseKeyHeader;E.buildCanonicalizedResource=function(o,s){var u="".concat(o),m="?";if(l.string(s)&&s.trim()!=="")u+=m+s;else if(l.array(s))s.sort(),u+=m+s.join("&");else if(s){var y=function(S,w){return S[0]>w[0]?1:S[0]<w[0]?-1:0},_=function(S){u+=m+S,(s[S]||s[S]===0)&&(u+="=".concat(s[S])),m="&"};Object.keys(s).sort(y).forEach(_)}return u},E.buildCanonicalString=function(o,s,u,m){u=u||{};var y=v(u.headers),_="x-oss-",x=[],S={},w=[o.toUpperCase(),y["content-md5"]||"",y["content-type"],m||y["x-oss-date"]];return Object.keys(y).forEach(function(A){var H=A.toLowerCase();H.indexOf(_)===0&&(S[H]=String(y[A]).trim())}),Object.keys(S).sort().forEach(function(A){x.push("".concat(A,":").concat(S[A]))}),w=w.concat(x),w.push(this.buildCanonicalizedResource(s,u.parameters)),w.join(`
`)},E.computeSignature=function(o,s){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"utf-8",m=g.createHmac("sha1",o);return m.update(p.from(s,u)).digest("base64")},E.authorization=function(o,s,u,m){return"OSS ".concat(o,":").concat(this.computeSignature(s,u,m))},E._signatureForURL=function(o){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=arguments.length>2?arguments[2]:void 0,m=arguments.length>3?arguments[3]:void 0,y=arguments.length>4?arguments[4]:void 0,_={},x=s.subResource,S=x===void 0?{}:x;if(s.process){var w="x-oss-process";S[w]=s.process}if(s.trafficLimit){var A="x-oss-traffic-limit";S[A]=s.trafficLimit}if(s.response&&Object.keys(s.response).forEach(function(D){var B="response-".concat(D.toLowerCase());S[B]=s.response[D]}),Object.keys(s).forEach(function(D){var B=D.toLowerCase(),P=s[D];B.indexOf("x-oss-")===0?_[B]=P:(B.indexOf("content-md5")===0||B.indexOf("content-type")===0)&&(_[D]=P)}),Object.prototype.hasOwnProperty.call(s,"security-token")&&(S["security-token"]=s["security-token"]),Object.prototype.hasOwnProperty.call(s,"callback")){var H={callbackUrl:encodeURI(s.callback.url),callbackBody:s.callback.body};if(s.callback.host&&(H.callbackHost=s.callback.host),s.callback.contentType&&(H.callbackBodyType=s.callback.contentType),S.callback=p.from(JSON.stringify(H)).toString("base64"),s.callback.customValue){var R={};Object.keys(s.callback.customValue).forEach(function(D){R["x:".concat(D)]=s.callback.customValue[D]}),S["callback-var"]=p.from(JSON.stringify(R)).toString("base64")}}var F=this.buildCanonicalString(s.method,u,{headers:_,parameters:S},m.toString());return{Signature:this.computeSignature(o,F,y),subResource:S}}}).call(this)}).call(this,i("buffer").Buffer)},{"./../../shims/crypto/crypto.js":461,"./utils/lowercaseKeyHeader":71,buffer:90,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.array.join.js":279,"core-js/modules/es.array.sort.js":282,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.regexp.to-string.js":301,"core-js/modules/es.string.trim.js":308,"core-js/modules/web.dom-collections.for-each.js":339,"is-type-of":466}],51:[function(i,M,E){"use strict";i("core-js/modules/es.regexp.exec.js"),Object.defineProperty(E,"__esModule",{value:!0}),E.checkBucketName=void 0,E.checkBucketName=function(p){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l=g?/^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/:/^[a-z0-9_][a-z0-9-_]{1,61}[a-z0-9_]$/;if(!l.test(p))throw new Error("The bucket must be conform to the specifications")}},{"core-js/modules/es.regexp.exec.js":300}],52:[function(i,M,E){"use strict";i("core-js/modules/es.regexp.exec.js"),Object.defineProperty(E,"__esModule",{value:!0}),E.checkConfigValid=void 0;var p={endpoint:g,region:/^[a-zA-Z0-9\-_]+$/};function g(l){return typeof l=="string"?/^[a-zA-Z0-9._:/-]+$/.test(l):l.host?/^[a-zA-Z0-9._:/-]+$/.test(l.host):!1}E.checkConfigValid=function(l,h){if(p[h]){var v=!0;if(p[h]instanceof Function?v=p[h](l):v=p[h].test(l),!v)throw new Error("The ".concat(h," must be conform to the specifications"))}}},{"core-js/modules/es.regexp.exec.js":300}],53:[function(i,M,E){(function(p){(function(){"use strict";Object.defineProperty(E,"__esModule",{value:!0}),E.checkEnv=void 0;function g(l){p.browser&&console.warn(l)}E.checkEnv=g}).call(this)}).call(this,i("_process"))},{_process:467}],54:[function(i,M,E){"use strict";i("core-js/modules/es.array.concat.js"),i("core-js/modules/es.object.entries.js"),i("core-js/modules/es.object.to-string.js"),i("core-js/modules/web.dom-collections.for-each.js"),Object.defineProperty(E,"__esModule",{value:!0}),E.checkObjectTag=void 0;var p=i("./checkValid"),g=p.checkValid,l=i("./isObject"),h=l.isObject,v=[{validator:function(u){if(typeof u!="string")throw new Error("the key and value of the tag must be String")}},{pattern:/^[a-zA-Z0-9 +-=._:/]+$/,msg:"tag can contain letters, numbers, spaces, and the following symbols: plus sign (+), hyphen (-), equal sign (=), period (.), underscore (_), colon (:), and forward slash (/)"}],d={key:[].concat(v,[{pattern:/^.{1,128}$/,msg:"tag key can be a maximum of 128 bytes in length"}]),value:[].concat(v,[{pattern:/^.{0,256}$/,msg:"tag value can be a maximum of 256 bytes in length"}])};function o(s){if(!h(s))throw new Error("tag must be Object");var u=Object.entries(s);if(u.length>10)throw new Error("maximum of 10 tags for a object");var m=["key","value"];u.forEach(function(y){y.forEach(function(_,x){g(_,d[m[x]])})})}E.checkObjectTag=o},{"./checkValid":55,"./isObject":70,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.object.entries.js":288,"core-js/modules/es.object.to-string.js":291,"core-js/modules/web.dom-collections.for-each.js":339}],55:[function(i,M,E){"use strict";i("core-js/modules/es.object.to-string.js"),i("core-js/modules/web.dom-collections.for-each.js"),i("core-js/modules/es.regexp.exec.js"),Object.defineProperty(E,"__esModule",{value:!0}),E.checkValid=void 0;function p(g,l){l.forEach(function(h){if(h.validator)h.validator(g);else if(h.pattern&&!h.pattern.test(g))throw new Error(h.msg)})}E.checkValid=p},{"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/web.dom-collections.for-each.js":339}],56:[function(i,M,E){(function(p){(function(){"use strict";i("core-js/modules/es.array.includes.js"),i("core-js/modules/es.string.includes.js"),i("core-js/modules/es.object.assign.js"),i("core-js/modules/es.array.concat.js"),Object.defineProperty(E,"__esModule",{value:!0}),E.createRequest=void 0;var g=i("./../../../shims/crypto/crypto.js"),l=i("debug")("ali-oss"),h=i("mime"),v=i("dateformat"),d=i("copy-to"),o=i("path"),s=i("./encoder"),u=s.encoder,m=i("./isIP"),y=m.isIP,_=i("./setRegion"),x=_.setRegion,S=i("../client/getReqUrl"),w=S.getReqUrl,A=i("./isDingTalk"),H=A.isDingTalk;function R(B,P){return B[P]||B[P.toLowerCase()]}function F(B,P){delete B[P],delete B[P.toLowerCase()]}function D(B){var P=new Date;this.options.amendTimeSkewed&&(P=+new Date+this.options.amendTimeSkewed);var U={"x-oss-date":v(P,"UTC:ddd, dd mmm yyyy HH:MM:ss 'GMT'")};typeof window!="undefined"&&(U["x-oss-user-agent"]=this.userAgent),this.userAgent.includes("nodejs")&&(U["User-Agent"]=this.userAgent),this.options.isRequestPay&&Object.assign(U,{"x-oss-request-payer":"requester"}),this.options.stsToken&&(U["x-oss-security-token"]=this.options.stsToken),d(B.headers).to(U),R(U,"Content-Type")||(B.mime&&B.mime.indexOf("/")>0?U["Content-Type"]=B.mime:H()?U["Content-Type"]="application/octet-stream":U["Content-Type"]=h.getType(B.mime||o.extname(B.object||""))),R(U,"Content-Type")||F(U,"Content-Type"),B.content&&(B.disabledMD5||(!B.headers||!B.headers["Content-MD5"]?U["Content-MD5"]=g.createHash("md5").update(p.from(B.content,"utf8")).digest("base64"):U["Content-MD5"]=B.headers["Content-MD5"]),U["Content-Length"]||(U["Content-Length"]=B.content.length));var G=Object.prototype.hasOwnProperty;for(var ee in U)U[ee]&&G.call(U,ee)&&(U[ee]=u(String(U[ee]),this.options.headerEncoding));var K=this._getResource(B);if(U.authorization=this.authorization(B.method,K,B.subres,U,this.options.headerEncoding),y(this.options.endpoint.hostname)){var Z=this.options,$=Z.region,oe=Z.internal,ae=Z.secure,ye=x($,oe,ae);U.host="".concat(B.bucket,".").concat(ye.host)}var Y=w.bind(this)(B);l("request %s %s, with headers %j, !!stream: %s",B.method,Y,U,!!B.stream);var le=B.timeout||this.options.timeout,xe={method:B.method,content:B.content,stream:B.stream,headers:U,timeout:le,writeStream:B.writeStream,customResponse:B.customResponse,ctx:B.ctx||this.ctx};return this.agent&&(xe.agent=this.agent),this.httpsAgent&&(xe.httpsAgent=this.httpsAgent),xe.enableProxy=!!this.options.enableProxy,xe.proxy=this.options.proxy?this.options.proxy:null,{url:Y,params:xe}}E.createRequest=D}).call(this)}).call(this,i("buffer").Buffer)},{"../client/getReqUrl":25,"./../../../shims/crypto/crypto.js":461,"./encoder":59,"./isDingTalk":66,"./isIP":69,"./setRegion":75,buffer:90,"copy-to":94,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.array.includes.js":277,"core-js/modules/es.object.assign.js":287,"core-js/modules/es.string.includes.js":302,dateformat:342,debug:465,mime:374,path:378}],57:[function(i,M,E){"use strict";i("core-js/modules/es.object.to-string.js"),i("core-js/modules/web.dom-collections.for-each.js"),i("core-js/modules/es.object.entries.js"),i("core-js/modules/es.regexp.exec.js"),i("core-js/modules/es.string.replace.js"),i("core-js/modules/es.array.includes.js"),i("core-js/modules/es.object.keys.js"),Object.defineProperty(E,"__esModule",{value:!0}),E.dataFix=void 0;var p=i("./isObject"),g=["true","TRUE","1",1],l=["false","FALSE","0",0];function h(o,s,u){if(p.isObject(o)){var m=s.remove,y=m===void 0?[]:m,_=s.rename,x=_===void 0?{}:_,S=s.camel,w=S===void 0?[]:S,A=s.bool,H=A===void 0?[]:A,R=s.lowerFirst,F=R===void 0?!1:R;return y.forEach(function(D){return delete o[D]}),Object.entries(x).forEach(function(D){o[D[0]]&&(o[D[1]]||(o[D[1]]=o[D[0]],delete o[D[0]]))}),w.forEach(function(D){if(o[D]){var B=D.replace(/^(.)/,function(P){return P.toLowerCase()}).replace(/-(\w)/g,function(P,U){return U.toUpperCase()});o[B]||(o[B]=o[D])}}),H.forEach(function(D){o[D]=v(o[D])}),typeof u=="function"&&u(o),d(o,F),h}}E.dataFix=h;function v(o){return o?g.includes(o)?!0:l.includes(o)?!1:o:!1}function d(o,s){s&&Object.keys(o).forEach(function(u){var m=u.replace(/^\w/,function(y){return y.toLowerCase()});typeof o[m]=="undefined"&&(o[m]=o[u],delete o[u])})}},{"./isObject":70,"core-js/modules/es.array.includes.js":277,"core-js/modules/es.object.entries.js":288,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.string.replace.js":305,"core-js/modules/web.dom-collections.for-each.js":339}],58:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault");i("core-js/modules/es.array.slice.js"),i("core-js/modules/es.object.to-string.js"),i("core-js/modules/web.dom-collections.for-each.js"),i("core-js/modules/es.object.keys.js");var g=p(i("@babel/runtime/helpers/typeof"));Object.defineProperty(E,"__esModule",{value:!0}),E.deepCopyWith=E.deepCopy=void 0;var l=i("./isBuffer");E.deepCopy=function(h){if(h===null||(0,g.default)(h)!=="object")return h;if(l.isBuffer(h))return h.slice();var v=Array.isArray(h)?[]:{};return Object.keys(h).forEach(function(d){v[d]=E.deepCopy(h[d])}),v},E.deepCopyWith=function(h,v){function d(o,s,u){var m=v(o,s,u);if(m!==void 0)return m;if(o===null||(0,g.default)(o)!=="object")return o;if(l.isBuffer(o))return o.slice();var y=Array.isArray(o)?[]:{};return Object.keys(o).forEach(function(_){y[_]=d(o[_],_,o)}),y}return v?d(h,"",null):E.deepCopy(h)}},{"./isBuffer":65,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/helpers/typeof":79,"core-js/modules/es.array.slice.js":281,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.object.to-string.js":291,"core-js/modules/web.dom-collections.for-each.js":339}],59:[function(i,M,E){(function(p){(function(){"use strict";i("core-js/modules/es.object.to-string.js"),i("core-js/modules/es.regexp.to-string.js"),Object.defineProperty(E,"__esModule",{value:!0}),E.encoder=void 0;function g(l){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"utf-8";return h==="utf-8"?l:p.from(l).toString("latin1")}E.encoder=g}).call(this)}).call(this,i("buffer").Buffer)},{buffer:90,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.regexp.to-string.js":301}],60:[function(i,M,E){"use strict";i("core-js/modules/es.array.map.js"),i("core-js/modules/es.regexp.exec.js"),i("core-js/modules/es.string.replace.js"),Object.defineProperty(E,"__esModule",{value:!0}),E.formatInventoryConfig=void 0;var p=i("../utils/dataFix"),g=i("../utils/isObject"),l=i("../utils/isArray"),h=i("../utils/formatObjKey");function v(o){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return s&&g.isObject(o)&&(o=[o]),l.isArray(o)?o=o.map(d):o=d(o),o}E.formatInventoryConfig=v;function d(o){return p.dataFix(o,{bool:["IsEnabled"]},function(s){var u,m;s.prefix=s.Filter.Prefix,delete s.Filter,s.OSSBucketDestination=s.Destination.OSSBucketDestination,s.OSSBucketDestination.rolename=s.OSSBucketDestination.RoleArn.replace(/.*\//,""),delete s.OSSBucketDestination.RoleArn,s.OSSBucketDestination.bucket=s.OSSBucketDestination.Bucket.replace(/.*:::/,""),delete s.OSSBucketDestination.Bucket,delete s.Destination,s.frequency=s.Schedule.Frequency,delete s.Schedule.Frequency,!((u=s==null?void 0:s.OptionalFields)===null||u===void 0)&&u.Field&&!l.isArray((m=s.OptionalFields)===null||m===void 0?void 0:m.Field)&&(s.OptionalFields.Field=[s.OptionalFields.Field])}),o=h.formatObjKey(o,"firstLowerCase",{exclude:["OSSBucketDestination","SSE-OSS","SSE-KMS"]}),o}},{"../utils/dataFix":57,"../utils/formatObjKey":61,"../utils/isArray":63,"../utils/isObject":70,"core-js/modules/es.array.map.js":280,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.string.replace.js":305}],61:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault");i("core-js/modules/es.object.to-string.js"),i("core-js/modules/web.dom-collections.for-each.js"),i("core-js/modules/es.object.keys.js"),i("core-js/modules/es.array.includes.js"),i("core-js/modules/es.string.includes.js"),i("core-js/modules/es.regexp.exec.js"),i("core-js/modules/es.string.replace.js");var g=p(i("@babel/runtime/helpers/typeof"));Object.defineProperty(E,"__esModule",{value:!0}),E.formatObjKey=void 0;function l(v,d,o){if(v===null||(0,g.default)(v)!=="object")return v;var s;if(Array.isArray(v)){s=[];for(var u=0;u<v.length;u++)s.push(l(v[u],d,o))}else s={},Object.keys(v).forEach(function(m){s[h(m,d,o)]=l(v[m],d,o)});return s}E.formatObjKey=l;function h(v,d,o){return o&&o.exclude&&o.exclude.includes(v)||(d==="firstUpperCase"?v=v.replace(/^./,function(s){return s.toUpperCase()}):d==="firstLowerCase"&&(v=v.replace(/^./,function(s){return s.toLowerCase()}))),v}},{"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/helpers/typeof":79,"core-js/modules/es.array.includes.js":277,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.string.includes.js":302,"core-js/modules/es.string.replace.js":305,"core-js/modules/web.dom-collections.for-each.js":339}],62:[function(i,M,E){"use strict";i("core-js/modules/es.regexp.exec.js"),Object.defineProperty(E,"__esModule",{value:!0}),E.getStrBytesCount=void 0;function p(g){for(var l=0,h=0;h<g.length;h++){var v=g.charAt(h);/^[\u00-\uff]$/.test(v)?l+=1:l+=2}return l}E.getStrBytesCount=p},{"core-js/modules/es.regexp.exec.js":300}],63:[function(i,M,E){"use strict";i("core-js/modules/es.object.to-string.js"),Object.defineProperty(E,"__esModule",{value:!0}),E.isArray=void 0,E.isArray=function(p){return Object.prototype.toString.call(p)==="[object Array]"}},{"core-js/modules/es.object.to-string.js":291}],64:[function(i,M,E){"use strict";Object.defineProperty(E,"__esModule",{value:!0}),E.isBlob=void 0;function p(g){return typeof Blob!="undefined"&&g instanceof Blob}E.isBlob=p},{}],65:[function(i,M,E){(function(p){(function(){"use strict";Object.defineProperty(E,"__esModule",{value:!0}),E.isBuffer=void 0;function g(l){return p.isBuffer(l)}E.isBuffer=g}).call(this)}).call(this,{isBuffer:i("../../../node_modules/is-buffer/index.js")})},{"../../../node_modules/is-buffer/index.js":366}],66:[function(i,M,E){(function(p){(function(){"use strict";i("core-js/modules/es.array.includes.js"),i("core-js/modules/es.string.includes.js"),Object.defineProperty(E,"__esModule",{value:!0}),E.isDingTalk=void 0;function g(){return!!(p.browser&&window.navigator.userAgent.toLowerCase().includes("aliapp(dingtalk"))}E.isDingTalk=g}).call(this)}).call(this,i("_process"))},{_process:467,"core-js/modules/es.array.includes.js":277,"core-js/modules/es.string.includes.js":302}],67:[function(i,M,E){"use strict";Object.defineProperty(E,"__esModule",{value:!0}),E.isFile=void 0,E.isFile=function(p){return typeof File!="undefined"&&p instanceof File}},{}],68:[function(i,M,E){"use strict";Object.defineProperty(E,"__esModule",{value:!0}),E.isFunction=void 0,E.isFunction=function(p){return typeof p=="function"}},{}],69:[function(i,M,E){"use strict";i("core-js/modules/es.regexp.exec.js"),Object.defineProperty(E,"__esModule",{value:!0}),E.isIP=void 0,E.isIP=function(p){var g=/^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$/,l=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-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-Fa-f]{1,4}:){5}(((:[0-9A-Fa-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-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-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-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-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-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-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-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-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-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-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}))|:)))(%.+)?\s*$/;return g.test(p)||l.test(p)}},{"core-js/modules/es.regexp.exec.js":300}],70:[function(i,M,E){"use strict";i("core-js/modules/es.object.to-string.js"),Object.defineProperty(E,"__esModule",{value:!0}),E.isObject=void 0,E.isObject=function(p){return Object.prototype.toString.call(p)==="[object Object]"}},{"core-js/modules/es.object.to-string.js":291}],71:[function(i,M,E){"use strict";i("core-js/modules/es.object.to-string.js"),i("core-js/modules/web.dom-collections.for-each.js"),i("core-js/modules/es.object.keys.js"),Object.defineProperty(E,"__esModule",{value:!0}),E.lowercaseKeyHeader=void 0;var p=i("./isObject");function g(l){var h={};return p.isObject(l)&&Object.keys(l).forEach(function(v){h[v.toLowerCase()]=l[v]}),h}E.lowercaseKeyHeader=g},{"./isObject":70,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.object.to-string.js":291,"core-js/modules/web.dom-collections.for-each.js":339}],72:[function(i,M,E){"use strict";i("core-js/modules/es.regexp.exec.js"),i("core-js/modules/es.string.replace.js"),i("core-js/modules/es.object.to-string.js"),i("core-js/modules/web.dom-collections.for-each.js"),i("core-js/modules/es.object.keys.js"),i("core-js/modules/es.array.concat.js"),i("core-js/modules/es.array.join.js"),i("core-js/modules/es.array.map.js"),i("core-js/modules/es.regexp.to-string.js"),Object.defineProperty(E,"__esModule",{value:!0}),E.obj2xml=void 0;var p=i("./formatObjKey");function g(h){return Object.prototype.toString.call(h).replace(/(.*? |])/g,"").toLowerCase()}function l(h,v){var d="";return v&&v.headers&&(d=`<?xml version="1.0" encoding="UTF-8"?>
`),v&&v.firstUpperCase&&(h=p.formatObjKey(h,"firstUpperCase")),g(h)==="object"?Object.keys(h).forEach(function(o){g(h[o])!=="undefined"&&g(h[o])!=="null"&&(g(h[o])==="string"||g(h[o])==="number"?d+="<".concat(o,">").concat(h[o],"</").concat(o,">"):g(h[o])==="object"?d+="<".concat(o,">").concat(l(h[o]),"</").concat(o,">"):g(h[o])==="array"?d+=h[o].map(function(s){return"<".concat(o,">").concat(l(s),"</").concat(o,">")}).join(""):d+="<".concat(o,">").concat(h[o].toString(),"</").concat(o,">"))}):d+=h.toString(),d}E.obj2xml=l},{"./formatObjKey":61,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.array.join.js":279,"core-js/modules/es.array.map.js":280,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.regexp.to-string.js":301,"core-js/modules/es.string.replace.js":305,"core-js/modules/web.dom-collections.for-each.js":339}],73:[function(i,M,E){"use strict";i("core-js/modules/es.array.slice.js"),i("core-js/modules/es.object.to-string.js"),i("core-js/modules/es.function.name.js"),i("core-js/modules/es.array.from.js"),i("core-js/modules/es.string.iterator.js"),i("core-js/modules/es.regexp.exec.js"),i("core-js/modules/es.symbol.js"),i("core-js/modules/es.symbol.description.js"),i("core-js/modules/es.symbol.iterator.js"),i("core-js/modules/es.array.iterator.js"),i("core-js/modules/web.dom-collections.iterator.js"),i("core-js/modules/es.object.assign.js");function p(v,d){var o=typeof Symbol!="undefined"&&v[Symbol.iterator]||v["@@iterator"];if(!o){if(Array.isArray(v)||(o=g(v))||d&&v&&typeof v.length=="number"){o&&(v=o);var s=0,u=function(){};return{s:u,n:function(){return s>=v.length?{done:!0}:{done:!1,value:v[s++]}},e:function(S){throw S},f:u}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var m=!0,y=!1,_;return{s:function(){o=o.call(v)},n:function(){var S=o.next();return m=S.done,S},e:function(S){y=!0,_=S},f:function(){try{!m&&o.return!=null&&o.return()}finally{if(y)throw _}}}}function g(v,d){if(v){if(typeof v=="string")return l(v,d);var o=Object.prototype.toString.call(v).slice(8,-1);if(o==="Object"&&v.constructor&&(o=v.constructor.name),o==="Map"||o==="Set")return Array.from(v);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return l(v,d)}}function l(v,d){(d==null||d>v.length)&&(d=v.length);for(var o=0,s=new Array(d);o<d;o++)s[o]=v[o];return s}Object.defineProperty(E,"__esModule",{value:!0}),E.omit=void 0;function h(v,d){var o=Object.assign({},v),s=p(d),u;try{for(s.s();!(u=s.n()).done;){var m=u.value;delete o[m]}}catch(y){s.e(y)}finally{s.f()}return o}E.omit=h},{"core-js/modules/es.array.from.js":276,"core-js/modules/es.array.iterator.js":278,"core-js/modules/es.array.slice.js":281,"core-js/modules/es.function.name.js":284,"core-js/modules/es.object.assign.js":287,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.string.iterator.js":303,"core-js/modules/es.symbol.description.js":310,"core-js/modules/es.symbol.iterator.js":312,"core-js/modules/es.symbol.js":313,"core-js/modules/web.dom-collections.iterator.js":340}],74:[function(i,M,E){"use strict";i("core-js/modules/es.object.to-string.js"),i("core-js/modules/es.promise.js"),Object.defineProperty(E,"__esModule",{value:!0}),E.retry=void 0;function p(g,l){var h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},v=0,d=h.retryDelay,o=d===void 0?500:d,s=h.errorHandler,u=s===void 0?function(){return!0}:s,m=function y(){for(var _=arguments.length,x=new Array(_),S=0;S<_;S++)x[S]=arguments[S];return new Promise(function(w,A){g.apply(void 0,x).then(function(H){v=0,w(H)}).catch(function(H){v<l&&u(H)?(v++,setTimeout(function(){w(y.apply(void 0,x))},o)):(v=0,A(H))})})};return m}E.retry=p},{"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.promise.js":295}],75:[function(i,M,E){"use strict";var p=function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(E,"__esModule",{value:!0}),E.setRegion=void 0;var g=p(i("url")),l=i("./checkConfigValid");function h(v){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;l.checkConfigValid(v,"region");var s=o?"https://":"http://",u=d?"-internal.aliyuncs.com":".aliyuncs.com",m="vpc100-oss-cn-";return v.substr(0,m.length)===m&&(u=".aliyuncs.com"),g.default.parse(s+v+u)}E.setRegion=h},{"./checkConfigValid":52,url:472}],76:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/regenerator"));i("core-js/modules/es.object.keys.js"),i("core-js/modules/es.object.to-string.js"),i("core-js/modules/es.array.find.js"),i("core-js/modules/es.object.assign.js");var l=p(i("@babel/runtime/helpers/asyncToGenerator"));Object.defineProperty(E,"__esModule",{value:!0}),E.checkCredentials=E.setSTSToken=void 0;var h=i("./formatObjKey");function v(){return d.apply(this,arguments)}function d(){return d=(0,l.default)(g.default.mark(function s(){var u,m;return g.default.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(this.options||(this.options={}),u=new Date,!this.stsTokenFreshTime){_.next=14;break}if(!(+u-this.stsTokenFreshTime>=this.options.refreshSTSTokenInterval)){_.next=12;break}return this.stsTokenFreshTime=u,_.next=7,this.options.refreshSTSToken();case 7:m=_.sent,m=h.formatObjKey(m,"firstLowerCase"),m.securityToken&&(m.stsToken=m.securityToken),o(m),Object.assign(this.options,m);case 12:_.next=15;break;case 14:this.stsTokenFreshTime=u;case 15:return _.abrupt("return",null);case 16:case"end":return _.stop()}},s,this)})),d.apply(this,arguments)}E.setSTSToken=v;function o(s){var u=["accessKeySecret","accessKeyId","stsToken"],m=Object.keys(s);u.forEach(function(y){if(!m.find(function(_){return _===y}))throw Error("refreshSTSToken must return contains ".concat(y))})}E.checkCredentials=o},{"./formatObjKey":61,"@babel/runtime/helpers/asyncToGenerator":77,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/regenerator":80,"core-js/modules/es.array.find.js":275,"core-js/modules/es.object.assign.js":287,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.object.to-string.js":291}],77:[function(i,M,E){function p(l,h,v,d,o,s,u){try{var m=l[s](u),y=m.value}catch(_){v(_);return}m.done?h(y):Promise.resolve(y).then(d,o)}function g(l){return function(){var h=this,v=arguments;return new Promise(function(d,o){var s=l.apply(h,v);function u(y){p(s,d,o,u,m,"next",y)}function m(y){p(s,d,o,u,m,"throw",y)}u(void 0)})}}M.exports=g,M.exports.__esModule=!0,M.exports.default=M.exports},{}],78:[function(i,M,E){function p(g){return g&&g.__esModule?g:{default:g}}M.exports=p,M.exports.__esModule=!0,M.exports.default=M.exports},{}],79:[function(i,M,E){function p(g){"@babel/helpers - typeof";return M.exports=p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},M.exports.__esModule=!0,M.exports.default=M.exports,p(g)}M.exports=p,M.exports.__esModule=!0,M.exports.default=M.exports},{}],80:[function(i,M,E){M.exports=i("regenerator-runtime")},{"regenerator-runtime":395}],81:[function(i,M,E){M.exports=p,M.exports.HttpsAgent=p;function p(){}},{}],82:[function(i,M,E){(function(p){(function(){"use strict";var g=i("object-assign");function l($,oe){if($===oe)return 0;for(var ae=$.length,ye=oe.length,Y=0,le=Math.min(ae,ye);Y<le;++Y)if($[Y]!==oe[Y]){ae=$[Y],ye=oe[Y];break}return ae<ye?-1:ye<ae?1:0}function h($){return p.Buffer&&typeof p.Buffer.isBuffer=="function"?p.Buffer.isBuffer($):!!($!=null&&$._isBuffer)}var v=i("util/"),d=Object.prototype.hasOwnProperty,o=Array.prototype.slice,s=function(){return function(){}.name==="foo"}();function u($){return Object.prototype.toString.call($)}function m($){return h($)||typeof p.ArrayBuffer!="function"?!1:typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView($):$?!!($ instanceof DataView||$.buffer&&$.buffer instanceof ArrayBuffer):!1}var y=M.exports=R,_=/\s*function\s+([^\(\s]*)\s*/;function x($){if(v.isFunction($)){if(s)return $.name;var oe=$.toString(),ae=oe.match(_);return ae&&ae[1]}}y.AssertionError=function(oe){this.name="AssertionError",this.actual=oe.actual,this.expected=oe.expected,this.operator=oe.operator,oe.message?(this.message=oe.message,this.generatedMessage=!1):(this.message=A(this),this.generatedMessage=!0);var ae=oe.stackStartFunction||H;if(Error.captureStackTrace)Error.captureStackTrace(this,ae);else{var ye=new Error;if(ye.stack){var Y=ye.stack,le=x(ae),xe=Y.indexOf(`
`+le);if(xe>=0){var Ce=Y.indexOf(`
`,xe+1);Y=Y.substring(Ce+1)}this.stack=Y}}},v.inherits(y.AssertionError,Error);function S($,oe){return typeof $=="string"?$.length<oe?$:$.slice(0,oe):$}function w($){if(s||!v.isFunction($))return v.inspect($);var oe=x($),ae=oe?": "+oe:"";return"[Function"+ae+"]"}function A($){return S(w($.actual),128)+" "+$.operator+" "+S(w($.expected),128)}function H($,oe,ae,ye,Y){throw new y.AssertionError({message:ae,actual:$,expected:oe,operator:ye,stackStartFunction:Y})}y.fail=H;function R($,oe){$||H($,!0,oe,"==",y.ok)}y.ok=R,y.equal=function(oe,ae,ye){oe!=ae&&H(oe,ae,ye,"==",y.equal)},y.notEqual=function(oe,ae,ye){oe==ae&&H(oe,ae,ye,"!=",y.notEqual)},y.deepEqual=function(oe,ae,ye){F(oe,ae,!1)||H(oe,ae,ye,"deepEqual",y.deepEqual)},y.deepStrictEqual=function(oe,ae,ye){F(oe,ae,!0)||H(oe,ae,ye,"deepStrictEqual",y.deepStrictEqual)};function F($,oe,ae,ye){if($===oe)return!0;if(h($)&&h(oe))return l($,oe)===0;if(v.isDate($)&&v.isDate(oe))return $.getTime()===oe.getTime();if(v.isRegExp($)&&v.isRegExp(oe))return $.source===oe.source&&$.global===oe.global&&$.multiline===oe.multiline&&$.lastIndex===oe.lastIndex&&$.ignoreCase===oe.ignoreCase;if(($===null||typeof $!="object")&&(oe===null||typeof oe!="object"))return ae?$===oe:$==oe;if(m($)&&m(oe)&&u($)===u(oe)&&!($ instanceof Float32Array||$ instanceof Float64Array))return l(new Uint8Array($.buffer),new Uint8Array(oe.buffer))===0;if(h($)!==h(oe))return!1;ye=ye||{actual:[],expected:[]};var Y=ye.actual.indexOf($);return Y!==-1&&Y===ye.expected.indexOf(oe)?!0:(ye.actual.push($),ye.expected.push(oe),B($,oe,ae,ye))}function D($){return Object.prototype.toString.call($)=="[object Arguments]"}function B($,oe,ae,ye){if($==null||oe===null||oe===void 0)return!1;if(v.isPrimitive($)||v.isPrimitive(oe))return $===oe;if(ae&&Object.getPrototypeOf($)!==Object.getPrototypeOf(oe))return!1;var Y=D($),le=D(oe);if(Y&&!le||!Y&&le)return!1;if(Y)return $=o.call($),oe=o.call(oe),F($,oe,ae);var xe=Z($),Ce=Z(oe),we,Le;if(xe.length!==Ce.length)return!1;for(xe.sort(),Ce.sort(),Le=xe.length-1;Le>=0;Le--)if(xe[Le]!==Ce[Le])return!1;for(Le=xe.length-1;Le>=0;Le--)if(we=xe[Le],!F($[we],oe[we],ae,ye))return!1;return!0}y.notDeepEqual=function(oe,ae,ye){F(oe,ae,!1)&&H(oe,ae,ye,"notDeepEqual",y.notDeepEqual)},y.notDeepStrictEqual=P;function P($,oe,ae){F($,oe,!0)&&H($,oe,ae,"notDeepStrictEqual",P)}y.strictEqual=function(oe,ae,ye){oe!==ae&&H(oe,ae,ye,"===",y.strictEqual)},y.notStrictEqual=function(oe,ae,ye){oe===ae&&H(oe,ae,ye,"!==",y.notStrictEqual)};function U($,oe){if(!$||!oe)return!1;if(Object.prototype.toString.call(oe)=="[object RegExp]")return oe.test($);try{if($ instanceof oe)return!0}catch(ae){}return Error.isPrototypeOf(oe)?!1:oe.call({},$)===!0}function G($){var oe;try{$()}catch(ae){oe=ae}return oe}function ee($,oe,ae,ye){var Y;if(typeof oe!="function")throw new TypeError('"block" argument must be a function');typeof ae=="string"&&(ye=ae,ae=null),Y=G(oe),ye=(ae&&ae.name?" ("+ae.name+").":".")+(ye?" "+ye:"."),$&&!Y&&H(Y,ae,"Missing expected exception"+ye);var le=typeof ye=="string",xe=!$&&v.isError(Y),Ce=!$&&Y&&!ae;if((xe&&le&&U(Y,ae)||Ce)&&H(Y,ae,"Got unwanted exception"+ye),$&&Y&&ae&&!U(Y,ae)||!$&&Y)throw Y}y.throws=function($,oe,ae){ee(!0,$,oe,ae)},y.doesNotThrow=function($,oe,ae){ee(!1,$,oe,ae)},y.ifError=function($){if($)throw $};function K($,oe){$||H($,!0,oe,"==",K)}y.strict=g(K,y,{equal:y.strictEqual,deepEqual:y.deepStrictEqual,notEqual:y.notStrictEqual,notDeepEqual:y.notDeepStrictEqual}),y.strict.strict=y.strict;var Z=Object.keys||function($){var oe=[];for(var ae in $)d.call($,ae)&&oe.push(ae);return oe}}).call(this)}).call(this,typeof Ue!="undefined"?Ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"object-assign":377,"util/":85}],83:[function(i,M,E){typeof Object.create=="function"?M.exports=function(g,l){g.super_=l,g.prototype=Object.create(l.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}})}:M.exports=function(g,l){g.super_=l;var h=function(){};h.prototype=l.prototype,g.prototype=new h,g.prototype.constructor=g}},{}],84:[function(i,M,E){M.exports=function(g){return g&&typeof g=="object"&&typeof g.copy=="function"&&typeof g.fill=="function"&&typeof g.readUInt8=="function"}},{}],85:[function(i,M,E){(function(p,g){(function(){var l=/%[sdj%]/g;E.format=function(Ce){if(!B(Ce)){for(var we=[],Le=0;Le<arguments.length;Le++)we.push(d(arguments[Le]));return we.join(" ")}for(var Le=1,de=arguments,be=de.length,Te=String(Ce).replace(l,function(Be){if(Be==="%%")return"%";if(Le>=be)return Be;switch(Be){case"%s":return String(de[Le++]);case"%d":return Number(de[Le++]);case"%j":try{return JSON.stringify(de[Le++])}catch(Pe){return"[Circular]"}default:return Be}}),Ae=de[Le];Le<be;Ae=de[++Le])R(Ae)||!ee(Ae)?Te+=" "+Ae:Te+=" "+d(Ae);return Te},E.deprecate=function(Ce,we){if(U(g.process))return function(){return E.deprecate(Ce,we).apply(this,arguments)};if(p.noDeprecation===!0)return Ce;var Le=!1;function de(){if(!Le){if(p.throwDeprecation)throw new Error(we);p.traceDeprecation?console.trace(we):console.error(we),Le=!0}return Ce.apply(this,arguments)}return de};var h={},v;E.debuglog=function(Ce){if(U(v)&&(v=p.env.NODE_DEBUG||""),Ce=Ce.toUpperCase(),!h[Ce])if(new RegExp("\\b"+Ce+"\\b","i").test(v)){var we=p.pid;h[Ce]=function(){var Le=E.format.apply(E,arguments);console.error("%s %d: %s",Ce,we,Le)}}else h[Ce]=function(){};return h[Ce]};function d(Ce,we){var Le={seen:[],stylize:s};return arguments.length>=3&&(Le.depth=arguments[2]),arguments.length>=4&&(Le.colors=arguments[3]),H(we)?Le.showHidden=we:we&&E._extend(Le,we),U(Le.showHidden)&&(Le.showHidden=!1),U(Le.depth)&&(Le.depth=2),U(Le.colors)&&(Le.colors=!1),U(Le.customInspect)&&(Le.customInspect=!0),Le.colors&&(Le.stylize=o),m(Le,Ce,Le.depth)}E.inspect=d,d.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},d.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function o(Ce,we){var Le=d.styles[we];return Le?"\x1B["+d.colors[Le][0]+"m"+Ce+"\x1B["+d.colors[Le][1]+"m":Ce}function s(Ce,we){return Ce}function u(Ce){var we={};return Ce.forEach(function(Le,de){we[Le]=!0}),we}function m(Ce,we,Le){if(Ce.customInspect&&we&&$(we.inspect)&&we.inspect!==E.inspect&&!(we.constructor&&we.constructor.prototype===we)){var de=we.inspect(Le,Ce);return B(de)||(de=m(Ce,de,Le)),de}var be=y(Ce,we);if(be)return be;var Te=Object.keys(we),Ae=u(Te);if(Ce.showHidden&&(Te=Object.getOwnPropertyNames(we)),Z(we)&&(Te.indexOf("message")>=0||Te.indexOf("description")>=0))return _(we);if(Te.length===0){if($(we)){var Be=we.name?": "+we.name:"";return Ce.stylize("[Function"+Be+"]","special")}if(G(we))return Ce.stylize(RegExp.prototype.toString.call(we),"regexp");if(K(we))return Ce.stylize(Date.prototype.toString.call(we),"date");if(Z(we))return _(we)}var Pe="",_e=!1,ne=["{","}"];if(A(we)&&(_e=!0,ne=["[","]"]),$(we)){var te=we.name?": "+we.name:"";Pe=" [Function"+te+"]"}if(G(we)&&(Pe=" "+RegExp.prototype.toString.call(we)),K(we)&&(Pe=" "+Date.prototype.toUTCString.call(we)),Z(we)&&(Pe=" "+_(we)),Te.length===0&&(!_e||we.length==0))return ne[0]+Pe+ne[1];if(Le<0)return G(we)?Ce.stylize(RegExp.prototype.toString.call(we),"regexp"):Ce.stylize("[Object]","special");Ce.seen.push(we);var T;return _e?T=x(Ce,we,Le,Ae,Te):T=Te.map(function(I){return S(Ce,we,Le,Ae,I,_e)}),Ce.seen.pop(),w(T,Pe,ne)}function y(Ce,we){if(U(we))return Ce.stylize("undefined","undefined");if(B(we)){var Le="'"+JSON.stringify(we).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return Ce.stylize(Le,"string")}if(D(we))return Ce.stylize(""+we,"number");if(H(we))return Ce.stylize(""+we,"boolean");if(R(we))return Ce.stylize("null","null")}function _(Ce){return"["+Error.prototype.toString.call(Ce)+"]"}function x(Ce,we,Le,de,be){for(var Te=[],Ae=0,Be=we.length;Ae<Be;++Ae)xe(we,String(Ae))?Te.push(S(Ce,we,Le,de,String(Ae),!0)):Te.push("");return be.forEach(function(Pe){Pe.match(/^\d+$/)||Te.push(S(Ce,we,Le,de,Pe,!0))}),Te}function S(Ce,we,Le,de,be,Te){var Ae,Be,Pe;if(Pe=Object.getOwnPropertyDescriptor(we,be)||{value:we[be]},Pe.get?Pe.set?Be=Ce.stylize("[Getter/Setter]","special"):Be=Ce.stylize("[Getter]","special"):Pe.set&&(Be=Ce.stylize("[Setter]","special")),xe(de,be)||(Ae="["+be+"]"),Be||(Ce.seen.indexOf(Pe.value)<0?(R(Le)?Be=m(Ce,Pe.value,null):Be=m(Ce,Pe.value,Le-1),Be.indexOf(`
`)>-1&&(Te?Be=Be.split(`
`).map(function(_e){return" "+_e}).join(`
`).substr(2):Be=`
`+Be.split(`
`).map(function(_e){return" "+_e}).join(`
`))):Be=Ce.stylize("[Circular]","special")),U(Ae)){if(Te&&be.match(/^\d+$/))return Be;Ae=JSON.stringify(""+be),Ae.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(Ae=Ae.substr(1,Ae.length-2),Ae=Ce.stylize(Ae,"name")):(Ae=Ae.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),Ae=Ce.stylize(Ae,"string"))}return Ae+": "+Be}function w(Ce,we,Le){var de=0,be=Ce.reduce(function(Te,Ae){return de++,Ae.indexOf(`
`)>=0&&de++,Te+Ae.replace(/\u001b\[\d\d?m/g,"").length+1},0);return be>60?Le[0]+(we===""?"":we+`
`)+" "+Ce.join(`,
`)+" "+Le[1]:Le[0]+we+" "+Ce.join(", ")+" "+Le[1]}function A(Ce){return Array.isArray(Ce)}E.isArray=A;function H(Ce){return typeof Ce=="boolean"}E.isBoolean=H;function R(Ce){return Ce===null}E.isNull=R;function F(Ce){return Ce==null}E.isNullOrUndefined=F;function D(Ce){return typeof Ce=="number"}E.isNumber=D;function B(Ce){return typeof Ce=="string"}E.isString=B;function P(Ce){return typeof Ce=="symbol"}E.isSymbol=P;function U(Ce){return Ce===void 0}E.isUndefined=U;function G(Ce){return ee(Ce)&&ae(Ce)==="[object RegExp]"}E.isRegExp=G;function ee(Ce){return typeof Ce=="object"&&Ce!==null}E.isObject=ee;function K(Ce){return ee(Ce)&&ae(Ce)==="[object Date]"}E.isDate=K;function Z(Ce){return ee(Ce)&&(ae(Ce)==="[object Error]"||Ce instanceof Error)}E.isError=Z;function $(Ce){return typeof Ce=="function"}E.isFunction=$;function oe(Ce){return Ce===null||typeof Ce=="boolean"||typeof Ce=="number"||typeof Ce=="string"||typeof Ce=="symbol"||typeof Ce=="undefined"}E.isPrimitive=oe,E.isBuffer=i("./support/isBuffer");function ae(Ce){return Object.prototype.toString.call(Ce)}function ye(Ce){return Ce<10?"0"+Ce.toString(10):Ce.toString(10)}var Y=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function le(){var Ce=new Date,we=[ye(Ce.getHours()),ye(Ce.getMinutes()),ye(Ce.getSeconds())].join(":");return[Ce.getDate(),Y[Ce.getMonth()],we].join(" ")}E.log=function(){console.log("%s - %s",le(),E.format.apply(E,arguments))},E.inherits=i("inherits"),E._extend=function(Ce,we){if(!we||!ee(we))return Ce;for(var Le=Object.keys(we),de=Le.length;de--;)Ce[Le[de]]=we[Le[de]];return Ce};function xe(Ce,we){return Object.prototype.hasOwnProperty.call(Ce,we)}}).call(this)}).call(this,i("_process"),typeof Ue!="undefined"?Ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./support/isBuffer":84,_process:467,inherits:83}],86:[function(i,M,E){(function(p){(function(){"use strict";var g=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],l=typeof globalThis=="undefined"?p:globalThis;M.exports=function(){for(var v=[],d=0;d<g.length;d++)typeof l[g[d]]=="function"&&(v[v.length]=g[d]);return v}}).call(this)}).call(this,typeof Ue!="undefined"?Ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],87:[function(i,M,E){"use strict";E.byteLength=s,E.toByteArray=m,E.fromByteArray=x;for(var p=[],g=[],l=typeof Uint8Array!="undefined"?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",v=0,d=h.length;v<d;++v)p[v]=h[v],g[h.charCodeAt(v)]=v;g[45]=62,g[95]=63;function o(S){var w=S.length;if(w%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var A=S.indexOf("=");A===-1&&(A=w);var H=A===w?0:4-A%4;return[A,H]}function s(S){var w=o(S),A=w[0],H=w[1];return(A+H)*3/4-H}function u(S,w,A){return(w+A)*3/4-A}function m(S){var w,A=o(S),H=A[0],R=A[1],F=new l(u(S,H,R)),D=0,B=R>0?H-4:H,P;for(P=0;P<B;P+=4)w=g[S.charCodeAt(P)]<<18|g[S.charCodeAt(P+1)]<<12|g[S.charCodeAt(P+2)]<<6|g[S.charCodeAt(P+3)],F[D++]=w>>16&255,F[D++]=w>>8&255,F[D++]=w&255;return R===2&&(w=g[S.charCodeAt(P)]<<2|g[S.charCodeAt(P+1)]>>4,F[D++]=w&255),R===1&&(w=g[S.charCodeAt(P)]<<10|g[S.charCodeAt(P+1)]<<4|g[S.charCodeAt(P+2)]>>2,F[D++]=w>>8&255,F[D++]=w&255),F}function y(S){return p[S>>18&63]+p[S>>12&63]+p[S>>6&63]+p[S&63]}function _(S,w,A){for(var H,R=[],F=w;F<A;F+=3)H=(S[F]<<16&16711680)+(S[F+1]<<8&65280)+(S[F+2]&255),R.push(y(H));return R.join("")}function x(S){for(var w,A=S.length,H=A%3,R=[],F=16383,D=0,B=A-H;D<B;D+=F)R.push(_(S,D,D+F>B?B:D+F));return H===1?(w=S[A-1],R.push(p[w>>2]+p[w<<4&63]+"==")):H===2&&(w=(S[A-2]<<8)+S[A-1],R.push(p[w>>10]+p[w>>4&63]+p[w<<2&63]+"=")),R.join("")}},{}],88:[function(i,M,E){(function(p,g,l){typeof M!="undefined"&&M.exports?M.exports=l():typeof Q=="function"&&Q.amd?Q(g,l):p[g]=l()})(this,"bowser",function(){var p=!0;function g(u){function m(we){var Le=u.match(we);return Le&&Le.length>1&&Le[1]||""}function y(we){var Le=u.match(we);return Le&&Le.length>1&&Le[2]||""}var _=m(/(ipod|iphone|ipad)/i).toLowerCase(),x=/like android/i.test(u),S=!x&&/android/i.test(u),w=/nexus\s*[0-6]\s*/i.test(u),A=!w&&/nexus\s*[0-9]+/i.test(u),H=/CrOS/.test(u),R=/silk/i.test(u),F=/sailfish/i.test(u),D=/tizen/i.test(u),B=/(web|hpw)(o|0)s/i.test(u),P=/windows phone/i.test(u),U=/SamsungBrowser/i.test(u),G=!P&&/windows/i.test(u),ee=!_&&!R&&/macintosh/i.test(u),K=!S&&!F&&!D&&!B&&/linux/i.test(u),Z=y(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),$=m(/version\/(\d+(\.\d+)?)/i),oe=/tablet/i.test(u)&&!/tablet pc/i.test(u),ae=!oe&&/[^-]mobi/i.test(u),ye=/xbox/i.test(u),Y;/opera/i.test(u)?Y={name:"Opera",opera:p,version:$||m(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(u)?Y={name:"Opera",opera:p,version:m(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||$}:/SamsungBrowser/i.test(u)?Y={name:"Samsung Internet for Android",samsungBrowser:p,version:$||m(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/Whale/i.test(u)?Y={name:"NAVER Whale browser",whale:p,version:m(/(?:whale)[\s\/](\d+(?:\.\d+)+)/i)}:/MZBrowser/i.test(u)?Y={name:"MZ Browser",mzbrowser:p,version:m(/(?:MZBrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/coast/i.test(u)?Y={name:"Opera Coast",coast:p,version:$||m(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/focus/i.test(u)?Y={name:"Focus",focus:p,version:m(/(?:focus)[\s\/](\d+(?:\.\d+)+)/i)}:/yabrowser/i.test(u)?Y={name:"Yandex Browser",yandexbrowser:p,version:$||m(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(u)?Y={name:"UC Browser",ucbrowser:p,version:m(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(u)?Y={name:"Maxthon",maxthon:p,version:m(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(u)?Y={name:"Epiphany",epiphany:p,version:m(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(u)?Y={name:"Puffin",puffin:p,version:m(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(u)?Y={name:"Sleipnir",sleipnir:p,version:m(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(u)?Y={name:"K-Meleon",kMeleon:p,version:m(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:P?(Y={name:"Windows Phone",osname:"Windows Phone",windowsphone:p},Z?(Y.msedge=p,Y.version=Z):(Y.msie=p,Y.version=m(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(u)?Y={name:"Internet Explorer",msie:p,version:m(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:H?Y={name:"Chrome",osname:"Chrome OS",chromeos:p,chromeBook:p,chrome:p,version:m(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(u)?Y={name:"Microsoft Edge",msedge:p,version:Z}:/vivaldi/i.test(u)?Y={name:"Vivaldi",vivaldi:p,version:m(/vivaldi\/(\d+(\.\d+)?)/i)||$}:F?Y={name:"Sailfish",osname:"Sailfish OS",sailfish:p,version:m(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(u)?Y={name:"SeaMonkey",seamonkey:p,version:m(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(u)?(Y={name:"Firefox",firefox:p,version:m(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(u)&&(Y.firefoxos=p,Y.osname="Firefox OS")):R?Y={name:"Amazon Silk",silk:p,version:m(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(u)?Y={name:"PhantomJS",phantom:p,version:m(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(u)?Y={name:"SlimerJS",slimer:p,version:m(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(u)||/rim\stablet/i.test(u)?Y={name:"BlackBerry",osname:"BlackBerry OS",blackberry:p,version:$||m(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:B?(Y={name:"WebOS",osname:"WebOS",webos:p,version:$||m(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(u)&&(Y.touchpad=p)):/bada/i.test(u)?Y={name:"Bada",osname:"Bada",bada:p,version:m(/dolfin\/(\d+(\.\d+)?)/i)}:D?Y={name:"Tizen",osname:"Tizen",tizen:p,version:m(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||$}:/qupzilla/i.test(u)?Y={name:"QupZilla",qupzilla:p,version:m(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||$}:/chromium/i.test(u)?Y={name:"Chromium",chromium:p,version:m(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||$}:/chrome|crios|crmo/i.test(u)?Y={name:"Chrome",chrome:p,version:m(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:S?Y={name:"Android",version:$}:/safari|applewebkit/i.test(u)?(Y={name:"Safari",safari:p},$&&(Y.version=$)):_?(Y={name:_=="iphone"?"iPhone":_=="ipad"?"iPad":"iPod"},$&&(Y.version=$)):/googlebot/i.test(u)?Y={name:"Googlebot",googlebot:p,version:m(/googlebot\/(\d+(\.\d+))/i)||$}:Y={name:m(/^(.*)\/(.*) /),version:y(/^(.*)\/(.*) /)},!Y.msedge&&/(apple)?webkit/i.test(u)?(/(apple)?webkit\/537\.36/i.test(u)?(Y.name=Y.name||"Blink",Y.blink=p):(Y.name=Y.name||"Webkit",Y.webkit=p),!Y.version&&$&&(Y.version=$)):!Y.opera&&/gecko\//i.test(u)&&(Y.name=Y.name||"Gecko",Y.gecko=p,Y.version=Y.version||m(/gecko\/(\d+(\.\d+)?)/i)),!Y.windowsphone&&(S||Y.silk)?(Y.android=p,Y.osname="Android"):!Y.windowsphone&&_?(Y[_]=p,Y.ios=p,Y.osname="iOS"):ee?(Y.mac=p,Y.osname="macOS"):ye?(Y.xbox=p,Y.osname="Xbox"):G?(Y.windows=p,Y.osname="Windows"):K&&(Y.linux=p,Y.osname="Linux");function le(we){switch(we){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}var xe="";Y.windows?xe=le(m(/Windows ((NT|XP)( \d\d?.\d)?)/i)):Y.windowsphone?xe=m(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):Y.mac?(xe=m(/Mac OS X (\d+([_\.\s]\d+)*)/i),xe=xe.replace(/[_\s]/g,".")):_?(xe=m(/os (\d+([_\s]\d+)*) like mac os x/i),xe=xe.replace(/[_\s]/g,".")):S?xe=m(/android[ \/-](\d+(\.\d+)*)/i):Y.webos?xe=m(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):Y.blackberry?xe=m(/rim\stablet\sos\s(\d+(\.\d+)*)/i):Y.bada?xe=m(/bada\/(\d+(\.\d+)*)/i):Y.tizen&&(xe=m(/tizen[\/\s](\d+(\.\d+)*)/i)),xe&&(Y.osversion=xe);var Ce=!Y.windows&&xe.split(".")[0];return oe||A||_=="ipad"||S&&(Ce==3||Ce>=4&&!ae)||Y.silk?Y.tablet=p:(ae||_=="iphone"||_=="ipod"||S||w||Y.blackberry||Y.webos||Y.bada)&&(Y.mobile=p),Y.msedge||Y.msie&&Y.version>=10||Y.yandexbrowser&&Y.version>=15||Y.vivaldi&&Y.version>=1||Y.chrome&&Y.version>=20||Y.samsungBrowser&&Y.version>=4||Y.whale&&d([Y.version,"1.0"])===1||Y.mzbrowser&&d([Y.version,"6.0"])===1||Y.focus&&d([Y.version,"1.0"])===1||Y.firefox&&Y.version>=20||Y.safari&&Y.version>=6||Y.opera&&Y.version>=10||Y.ios&&Y.osversion&&Y.osversion.split(".")[0]>=6||Y.blackberry&&Y.version>=10.1||Y.chromium&&Y.version>=20?Y.a=p:Y.msie&&Y.version<10||Y.chrome&&Y.version<20||Y.firefox&&Y.version<20||Y.safari&&Y.version<6||Y.opera&&Y.version<10||Y.ios&&Y.osversion&&Y.osversion.split(".")[0]<6||Y.chromium&&Y.version<20?Y.c=p:Y.x=p,Y}var l=g(typeof navigator!="undefined"&&navigator.userAgent||"");l.test=function(u){for(var m=0;m<u.length;++m){var y=u[m];if(typeof y=="string"&&y in l)return!0}return!1};function h(u){return u.split(".").length}function v(u,m){var y=[],_;if(Array.prototype.map)return Array.prototype.map.call(u,m);for(_=0;_<u.length;_++)y.push(m(u[_]));return y}function d(u){for(var m=Math.max(h(u[0]),h(u[1])),y=v(u,function(_){var x=m-h(_);return _=_+new Array(x+1).join(".0"),v(_.split("."),function(S){return new Array(20-S.length).join("0")+S}).reverse()});--m>=0;){if(y[0][m]>y[1][m])return 1;if(y[0][m]===y[1][m]){if(m===0)return 0}else return-1}}function o(u,m,y){var _=l;typeof m=="string"&&(y=m,m=void 0),m===void 0&&(m=!1),y&&(_=g(y));var x=""+_.version;for(var S in u)if(u.hasOwnProperty(S)&&_[S]){if(typeof u[S]!="string")throw new Error("Browser version in the minVersion map should be a string: "+S+": "+String(u));return d([x,u[S]])<0}return m}function s(u,m,y){return!o(u,m,y)}return l.isUnsupportedBrowser=o,l.compareVersions=d,l.check=s,l._detect=g,l.detect=g,l})},{}],89:[function(i,M,E){},{}],90:[function(i,M,E){(function(p){(function(){"use strict";var g=i("base64-js"),l=i("ieee754");E.Buffer=o,E.SlowBuffer=H,E.INSPECT_MAX_BYTES=50;var h=2147483647;E.kMaxLength=h,o.TYPED_ARRAY_SUPPORT=v(),!o.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function v(){try{var W=new Uint8Array(1);return W.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},W.foo()===42}catch(V){return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function d(W){if(W>h)throw new RangeError('The value "'+W+'" is invalid for option "size"');var V=new Uint8Array(W);return V.__proto__=o.prototype,V}function o(W,V,se){if(typeof W=="number"){if(typeof V=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return y(W)}return s(W,V,se)}typeof Symbol!="undefined"&&Symbol.species!=null&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),o.poolSize=8192;function s(W,V,se){if(typeof W=="string")return _(W,V);if(ArrayBuffer.isView(W))return x(W);if(W==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof W);if(q(W,ArrayBuffer)||W&&q(W.buffer,ArrayBuffer))return S(W,V,se);if(typeof W=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var ge=W.valueOf&&W.valueOf();if(ge!=null&&ge!==W)return o.from(ge,V,se);var Me=w(W);if(Me)return Me;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof W[Symbol.toPrimitive]=="function")return o.from(W[Symbol.toPrimitive]("string"),V,se);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof W)}o.from=function(W,V,se){return s(W,V,se)},o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array;function u(W){if(typeof W!="number")throw new TypeError('"size" argument must be of type number');if(W<0)throw new RangeError('The value "'+W+'" is invalid for option "size"')}function m(W,V,se){return u(W),W<=0?d(W):V!==void 0?typeof se=="string"?d(W).fill(V,se):d(W).fill(V):d(W)}o.alloc=function(W,V,se){return m(W,V,se)};function y(W){return u(W),d(W<0?0:A(W)|0)}o.allocUnsafe=function(W){return y(W)},o.allocUnsafeSlow=function(W){return y(W)};function _(W,V){if((typeof V!="string"||V==="")&&(V="utf8"),!o.isEncoding(V))throw new TypeError("Unknown encoding: "+V);var se=R(W,V)|0,ge=d(se),Me=ge.write(W,V);return Me!==se&&(ge=ge.slice(0,Me)),ge}function x(W){for(var V=W.length<0?0:A(W.length)|0,se=d(V),ge=0;ge<V;ge+=1)se[ge]=W[ge]&255;return se}function S(W,V,se){if(V<0||W.byteLength<V)throw new RangeError('"offset" is outside of buffer bounds');if(W.byteLength<V+(se||0))throw new RangeError('"length" is outside of buffer bounds');var ge;return V===void 0&&se===void 0?ge=new Uint8Array(W):se===void 0?ge=new Uint8Array(W,V):ge=new Uint8Array(W,V,se),ge.__proto__=o.prototype,ge}function w(W){if(o.isBuffer(W)){var V=A(W.length)|0,se=d(V);return se.length===0||W.copy(se,0,0,V),se}if(W.length!==void 0)return typeof W.length!="number"||z(W.length)?d(0):x(W);if(W.type==="Buffer"&&Array.isArray(W.data))return x(W.data)}function A(W){if(W>=h)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+h.toString(16)+" bytes");return W|0}function H(W){return+W!=W&&(W=0),o.alloc(+W)}o.isBuffer=function(V){return V!=null&&V._isBuffer===!0&&V!==o.prototype},o.compare=function(V,se){if(q(V,Uint8Array)&&(V=o.from(V,V.offset,V.byteLength)),q(se,Uint8Array)&&(se=o.from(se,se.offset,se.byteLength)),!o.isBuffer(V)||!o.isBuffer(se))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(V===se)return 0;for(var ge=V.length,Me=se.length,Fe=0,Re=Math.min(ge,Me);Fe<Re;++Fe)if(V[Fe]!==se[Fe]){ge=V[Fe],Me=se[Fe];break}return ge<Me?-1:Me<ge?1:0},o.isEncoding=function(V){switch(String(V).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(V,se){if(!Array.isArray(V))throw new TypeError('"list" argument must be an Array of Buffers');if(V.length===0)return o.alloc(0);var ge;if(se===void 0)for(se=0,ge=0;ge<V.length;++ge)se+=V[ge].length;var Me=o.allocUnsafe(se),Fe=0;for(ge=0;ge<V.length;++ge){var Re=V[ge];if(q(Re,Uint8Array)&&(Re=o.from(Re)),!o.isBuffer(Re))throw new TypeError('"list" argument must be an Array of Buffers');Re.copy(Me,Fe),Fe+=Re.length}return Me};function R(W,V){if(o.isBuffer(W))return W.length;if(ArrayBuffer.isView(W)||q(W,ArrayBuffer))return W.byteLength;if(typeof W!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof W);var se=W.length,ge=arguments.length>2&&arguments[2]===!0;if(!ge&&se===0)return 0;for(var Me=!1;;)switch(V){case"ascii":case"latin1":case"binary":return se;case"utf8":case"utf-8":return ne(W).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return se*2;case"hex":return se>>>1;case"base64":return I(W).length;default:if(Me)return ge?-1:ne(W).length;V=(""+V).toLowerCase(),Me=!0}}o.byteLength=R;function F(W,V,se){var ge=!1;if((V===void 0||V<0)&&(V=0),V>this.length||((se===void 0||se>this.length)&&(se=this.length),se<=0)||(se>>>=0,V>>>=0,se<=V))return"";for(W||(W="utf8");;)switch(W){case"hex":return Ce(this,V,se);case"utf8":case"utf-8":return ae(this,V,se);case"ascii":return le(this,V,se);case"latin1":case"binary":return xe(this,V,se);case"base64":return oe(this,V,se);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return we(this,V,se);default:if(ge)throw new TypeError("Unknown encoding: "+W);W=(W+"").toLowerCase(),ge=!0}}o.prototype._isBuffer=!0;function D(W,V,se){var ge=W[V];W[V]=W[se],W[se]=ge}o.prototype.swap16=function(){var V=this.length;if(V%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var se=0;se<V;se+=2)D(this,se,se+1);return this},o.prototype.swap32=function(){var V=this.length;if(V%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var se=0;se<V;se+=4)D(this,se,se+3),D(this,se+1,se+2);return this},o.prototype.swap64=function(){var V=this.length;if(V%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var se=0;se<V;se+=8)D(this,se,se+7),D(this,se+1,se+6),D(this,se+2,se+5),D(this,se+3,se+4);return this},o.prototype.toString=function(){var V=this.length;return V===0?"":arguments.length===0?ae(this,0,V):F.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(V){if(!o.isBuffer(V))throw new TypeError("Argument must be a Buffer");return this===V?!0:o.compare(this,V)===0},o.prototype.inspect=function(){var V="",se=E.INSPECT_MAX_BYTES;return V=this.toString("hex",0,se).replace(/(.{2})/g,"$1 ").trim(),this.length>se&&(V+=" ... "),"<Buffer "+V+">"},o.prototype.compare=function(V,se,ge,Me,Fe){if(q(V,Uint8Array)&&(V=o.from(V,V.offset,V.byteLength)),!o.isBuffer(V))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof V);if(se===void 0&&(se=0),ge===void 0&&(ge=V?V.length:0),Me===void 0&&(Me=0),Fe===void 0&&(Fe=this.length),se<0||ge>V.length||Me<0||Fe>this.length)throw new RangeError("out of range index");if(Me>=Fe&&se>=ge)return 0;if(Me>=Fe)return-1;if(se>=ge)return 1;if(se>>>=0,ge>>>=0,Me>>>=0,Fe>>>=0,this===V)return 0;for(var Re=Fe-Me,$e=ge-se,lt=Math.min(Re,$e),Ne=this.slice(Me,Fe),Ze=V.slice(se,ge),We=0;We<lt;++We)if(Ne[We]!==Ze[We]){Re=Ne[We],$e=Ze[We];break}return Re<$e?-1:$e<Re?1:0};function B(W,V,se,ge,Me){if(W.length===0)return-1;if(typeof se=="string"?(ge=se,se=0):se>2147483647?se=2147483647:se<-2147483648&&(se=-2147483648),se=+se,z(se)&&(se=Me?0:W.length-1),se<0&&(se=W.length+se),se>=W.length){if(Me)return-1;se=W.length-1}else if(se<0)if(Me)se=0;else return-1;if(typeof V=="string"&&(V=o.from(V,ge)),o.isBuffer(V))return V.length===0?-1:P(W,V,se,ge,Me);if(typeof V=="number")return V=V&255,typeof Uint8Array.prototype.indexOf=="function"?Me?Uint8Array.prototype.indexOf.call(W,V,se):Uint8Array.prototype.lastIndexOf.call(W,V,se):P(W,[V],se,ge,Me);throw new TypeError("val must be string, number or Buffer")}function P(W,V,se,ge,Me){var Fe=1,Re=W.length,$e=V.length;if(ge!==void 0&&(ge=String(ge).toLowerCase(),ge==="ucs2"||ge==="ucs-2"||ge==="utf16le"||ge==="utf-16le")){if(W.length<2||V.length<2)return-1;Fe=2,Re/=2,$e/=2,se/=2}function lt(qe,Qe){return Fe===1?qe[Qe]:qe.readUInt16BE(Qe*Fe)}var Ne;if(Me){var Ze=-1;for(Ne=se;Ne<Re;Ne++)if(lt(W,Ne)===lt(V,Ze===-1?0:Ne-Ze)){if(Ze===-1&&(Ze=Ne),Ne-Ze+1===$e)return Ze*Fe}else Ze!==-1&&(Ne-=Ne-Ze),Ze=-1}else for(se+$e>Re&&(se=Re-$e),Ne=se;Ne>=0;Ne--){for(var We=!0,nt=0;nt<$e;nt++)if(lt(W,Ne+nt)!==lt(V,nt)){We=!1;break}if(We)return Ne}return-1}o.prototype.includes=function(V,se,ge){return this.indexOf(V,se,ge)!==-1},o.prototype.indexOf=function(V,se,ge){return B(this,V,se,ge,!0)},o.prototype.lastIndexOf=function(V,se,ge){return B(this,V,se,ge,!1)};function U(W,V,se,ge){se=Number(se)||0;var Me=W.length-se;ge?(ge=Number(ge),ge>Me&&(ge=Me)):ge=Me;var Fe=V.length;ge>Fe/2&&(ge=Fe/2);for(var Re=0;Re<ge;++Re){var $e=parseInt(V.substr(Re*2,2),16);if(z($e))return Re;W[se+Re]=$e}return Re}function G(W,V,se,ge){return re(ne(V,W.length-se),W,se,ge)}function ee(W,V,se,ge){return re(te(V),W,se,ge)}function K(W,V,se,ge){return ee(W,V,se,ge)}function Z(W,V,se,ge){return re(I(V),W,se,ge)}function $(W,V,se,ge){return re(T(V,W.length-se),W,se,ge)}o.prototype.write=function(V,se,ge,Me){if(se===void 0)Me="utf8",ge=this.length,se=0;else if(ge===void 0&&typeof se=="string")Me=se,ge=this.length,se=0;else if(isFinite(se))se=se>>>0,isFinite(ge)?(ge=ge>>>0,Me===void 0&&(Me="utf8")):(Me=ge,ge=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var Fe=this.length-se;if((ge===void 0||ge>Fe)&&(ge=Fe),V.length>0&&(ge<0||se<0)||se>this.length)throw new RangeError("Attempt to write outside buffer bounds");Me||(Me="utf8");for(var Re=!1;;)switch(Me){case"hex":return U(this,V,se,ge);case"utf8":case"utf-8":return G(this,V,se,ge);case"ascii":return ee(this,V,se,ge);case"latin1":case"binary":return K(this,V,se,ge);case"base64":return Z(this,V,se,ge);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $(this,V,se,ge);default:if(Re)throw new TypeError("Unknown encoding: "+Me);Me=(""+Me).toLowerCase(),Re=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function oe(W,V,se){return V===0&&se===W.length?g.fromByteArray(W):g.fromByteArray(W.slice(V,se))}function ae(W,V,se){se=Math.min(W.length,se);for(var ge=[],Me=V;Me<se;){var Fe=W[Me],Re=null,$e=Fe>239?4:Fe>223?3:Fe>191?2:1;if(Me+$e<=se){var lt,Ne,Ze,We;switch($e){case 1:Fe<128&&(Re=Fe);break;case 2:lt=W[Me+1],(lt&192)===128&&(We=(Fe&31)<<6|lt&63,We>127&&(Re=We));break;case 3:lt=W[Me+1],Ne=W[Me+2],(lt&192)===128&&(Ne&192)===128&&(We=(Fe&15)<<12|(lt&63)<<6|Ne&63,We>2047&&(We<55296||We>57343)&&(Re=We));break;case 4:lt=W[Me+1],Ne=W[Me+2],Ze=W[Me+3],(lt&192)===128&&(Ne&192)===128&&(Ze&192)===128&&(We=(Fe&15)<<18|(lt&63)<<12|(Ne&63)<<6|Ze&63,We>65535&&We<1114112&&(Re=We))}}Re===null?(Re=65533,$e=1):Re>65535&&(Re-=65536,ge.push(Re>>>10&1023|55296),Re=56320|Re&1023),ge.push(Re),Me+=$e}return Y(ge)}var ye=4096;function Y(W){var V=W.length;if(V<=ye)return String.fromCharCode.apply(String,W);for(var se="",ge=0;ge<V;)se+=String.fromCharCode.apply(String,W.slice(ge,ge+=ye));return se}function le(W,V,se){var ge="";se=Math.min(W.length,se);for(var Me=V;Me<se;++Me)ge+=String.fromCharCode(W[Me]&127);return ge}function xe(W,V,se){var ge="";se=Math.min(W.length,se);for(var Me=V;Me<se;++Me)ge+=String.fromCharCode(W[Me]);return ge}function Ce(W,V,se){var ge=W.length;(!V||V<0)&&(V=0),(!se||se<0||se>ge)&&(se=ge);for(var Me="",Fe=V;Fe<se;++Fe)Me+=_e(W[Fe]);return Me}function we(W,V,se){for(var ge=W.slice(V,se),Me="",Fe=0;Fe<ge.length;Fe+=2)Me+=String.fromCharCode(ge[Fe]+ge[Fe+1]*256);return Me}o.prototype.slice=function(V,se){var ge=this.length;V=~~V,se=se===void 0?ge:~~se,V<0?(V+=ge,V<0&&(V=0)):V>ge&&(V=ge),se<0?(se+=ge,se<0&&(se=0)):se>ge&&(se=ge),se<V&&(se=V);var Me=this.subarray(V,se);return Me.__proto__=o.prototype,Me};function Le(W,V,se){if(W%1!==0||W<0)throw new RangeError("offset is not uint");if(W+V>se)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUIntLE=function(V,se,ge){V=V>>>0,se=se>>>0,ge||Le(V,se,this.length);for(var Me=this[V],Fe=1,Re=0;++Re<se&&(Fe*=256);)Me+=this[V+Re]*Fe;return Me},o.prototype.readUIntBE=function(V,se,ge){V=V>>>0,se=se>>>0,ge||Le(V,se,this.length);for(var Me=this[V+--se],Fe=1;se>0&&(Fe*=256);)Me+=this[V+--se]*Fe;return Me},o.prototype.readUInt8=function(V,se){return V=V>>>0,se||Le(V,1,this.length),this[V]},o.prototype.readUInt16LE=function(V,se){return V=V>>>0,se||Le(V,2,this.length),this[V]|this[V+1]<<8},o.prototype.readUInt16BE=function(V,se){return V=V>>>0,se||Le(V,2,this.length),this[V]<<8|this[V+1]},o.prototype.readUInt32LE=function(V,se){return V=V>>>0,se||Le(V,4,this.length),(this[V]|this[V+1]<<8|this[V+2]<<16)+this[V+3]*16777216},o.prototype.readUInt32BE=function(V,se){return V=V>>>0,se||Le(V,4,this.length),this[V]*16777216+(this[V+1]<<16|this[V+2]<<8|this[V+3])},o.prototype.readIntLE=function(V,se,ge){V=V>>>0,se=se>>>0,ge||Le(V,se,this.length);for(var Me=this[V],Fe=1,Re=0;++Re<se&&(Fe*=256);)Me+=this[V+Re]*Fe;return Fe*=128,Me>=Fe&&(Me-=Math.pow(2,8*se)),Me},o.prototype.readIntBE=function(V,se,ge){V=V>>>0,se=se>>>0,ge||Le(V,se,this.length);for(var Me=se,Fe=1,Re=this[V+--Me];Me>0&&(Fe*=256);)Re+=this[V+--Me]*Fe;return Fe*=128,Re>=Fe&&(Re-=Math.pow(2,8*se)),Re},o.prototype.readInt8=function(V,se){return V=V>>>0,se||Le(V,1,this.length),this[V]&128?(255-this[V]+1)*-1:this[V]},o.prototype.readInt16LE=function(V,se){V=V>>>0,se||Le(V,2,this.length);var ge=this[V]|this[V+1]<<8;return ge&32768?ge|4294901760:ge},o.prototype.readInt16BE=function(V,se){V=V>>>0,se||Le(V,2,this.length);var ge=this[V+1]|this[V]<<8;return ge&32768?ge|4294901760:ge},o.prototype.readInt32LE=function(V,se){return V=V>>>0,se||Le(V,4,this.length),this[V]|this[V+1]<<8|this[V+2]<<16|this[V+3]<<24},o.prototype.readInt32BE=function(V,se){return V=V>>>0,se||Le(V,4,this.length),this[V]<<24|this[V+1]<<16|this[V+2]<<8|this[V+3]},o.prototype.readFloatLE=function(V,se){return V=V>>>0,se||Le(V,4,this.length),l.read(this,V,!0,23,4)},o.prototype.readFloatBE=function(V,se){return V=V>>>0,se||Le(V,4,this.length),l.read(this,V,!1,23,4)},o.prototype.readDoubleLE=function(V,se){return V=V>>>0,se||Le(V,8,this.length),l.read(this,V,!0,52,8)},o.prototype.readDoubleBE=function(V,se){return V=V>>>0,se||Le(V,8,this.length),l.read(this,V,!1,52,8)};function de(W,V,se,ge,Me,Fe){if(!o.isBuffer(W))throw new TypeError('"buffer" argument must be a Buffer instance');if(V>Me||V<Fe)throw new RangeError('"value" argument is out of bounds');if(se+ge>W.length)throw new RangeError("Index out of range")}o.prototype.writeUIntLE=function(V,se,ge,Me){if(V=+V,se=se>>>0,ge=ge>>>0,!Me){var Fe=Math.pow(2,8*ge)-1;de(this,V,se,ge,Fe,0)}var Re=1,$e=0;for(this[se]=V&255;++$e<ge&&(Re*=256);)this[se+$e]=V/Re&255;return se+ge},o.prototype.writeUIntBE=function(V,se,ge,Me){if(V=+V,se=se>>>0,ge=ge>>>0,!Me){var Fe=Math.pow(2,8*ge)-1;de(this,V,se,ge,Fe,0)}var Re=ge-1,$e=1;for(this[se+Re]=V&255;--Re>=0&&($e*=256);)this[se+Re]=V/$e&255;return se+ge},o.prototype.writeUInt8=function(V,se,ge){return V=+V,se=se>>>0,ge||de(this,V,se,1,255,0),this[se]=V&255,se+1},o.prototype.writeUInt16LE=function(V,se,ge){return V=+V,se=se>>>0,ge||de(this,V,se,2,65535,0),this[se]=V&255,this[se+1]=V>>>8,se+2},o.prototype.writeUInt16BE=function(V,se,ge){return V=+V,se=se>>>0,ge||de(this,V,se,2,65535,0),this[se]=V>>>8,this[se+1]=V&255,se+2},o.prototype.writeUInt32LE=function(V,se,ge){return V=+V,se=se>>>0,ge||de(this,V,se,4,4294967295,0),this[se+3]=V>>>24,this[se+2]=V>>>16,this[se+1]=V>>>8,this[se]=V&255,se+4},o.prototype.writeUInt32BE=function(V,se,ge){return V=+V,se=se>>>0,ge||de(this,V,se,4,4294967295,0),this[se]=V>>>24,this[se+1]=V>>>16,this[se+2]=V>>>8,this[se+3]=V&255,se+4},o.prototype.writeIntLE=function(V,se,ge,Me){if(V=+V,se=se>>>0,!Me){var Fe=Math.pow(2,8*ge-1);de(this,V,se,ge,Fe-1,-Fe)}var Re=0,$e=1,lt=0;for(this[se]=V&255;++Re<ge&&($e*=256);)V<0&&lt===0&&this[se+Re-1]!==0&&(lt=1),this[se+Re]=(V/$e>>0)-lt&255;return se+ge},o.prototype.writeIntBE=function(V,se,ge,Me){if(V=+V,se=se>>>0,!Me){var Fe=Math.pow(2,8*ge-1);de(this,V,se,ge,Fe-1,-Fe)}var Re=ge-1,$e=1,lt=0;for(this[se+Re]=V&255;--Re>=0&&($e*=256);)V<0&&lt===0&&this[se+Re+1]!==0&&(lt=1),this[se+Re]=(V/$e>>0)-lt&255;return se+ge},o.prototype.writeInt8=function(V,se,ge){return V=+V,se=se>>>0,ge||de(this,V,se,1,127,-128),V<0&&(V=255+V+1),this[se]=V&255,se+1},o.prototype.writeInt16LE=function(V,se,ge){return V=+V,se=se>>>0,ge||de(this,V,se,2,32767,-32768),this[se]=V&255,this[se+1]=V>>>8,se+2},o.prototype.writeInt16BE=function(V,se,ge){return V=+V,se=se>>>0,ge||de(this,V,se,2,32767,-32768),this[se]=V>>>8,this[se+1]=V&255,se+2},o.prototype.writeInt32LE=function(V,se,ge){return V=+V,se=se>>>0,ge||de(this,V,se,4,2147483647,-2147483648),this[se]=V&255,this[se+1]=V>>>8,this[se+2]=V>>>16,this[se+3]=V>>>24,se+4},o.prototype.writeInt32BE=function(V,se,ge){return V=+V,se=se>>>0,ge||de(this,V,se,4,2147483647,-2147483648),V<0&&(V=4294967295+V+1),this[se]=V>>>24,this[se+1]=V>>>16,this[se+2]=V>>>8,this[se+3]=V&255,se+4};function be(W,V,se,ge,Me,Fe){if(se+ge>W.length)throw new RangeError("Index out of range");if(se<0)throw new RangeError("Index out of range")}function Te(W,V,se,ge,Me){return V=+V,se=se>>>0,Me||be(W,V,se,4,34028234663852886e22,-34028234663852886e22),l.write(W,V,se,ge,23,4),se+4}o.prototype.writeFloatLE=function(V,se,ge){return Te(this,V,se,!0,ge)},o.prototype.writeFloatBE=function(V,se,ge){return Te(this,V,se,!1,ge)};function Ae(W,V,se,ge,Me){return V=+V,se=se>>>0,Me||be(W,V,se,8,17976931348623157e292,-17976931348623157e292),l.write(W,V,se,ge,52,8),se+8}o.prototype.writeDoubleLE=function(V,se,ge){return Ae(this,V,se,!0,ge)},o.prototype.writeDoubleBE=function(V,se,ge){return Ae(this,V,se,!1,ge)},o.prototype.copy=function(V,se,ge,Me){if(!o.isBuffer(V))throw new TypeError("argument should be a Buffer");if(ge||(ge=0),!Me&&Me!==0&&(Me=this.length),se>=V.length&&(se=V.length),se||(se=0),Me>0&&Me<ge&&(Me=ge),Me===ge||V.length===0||this.length===0)return 0;if(se<0)throw new RangeError("targetStart out of bounds");if(ge<0||ge>=this.length)throw new RangeError("Index out of range");if(Me<0)throw new RangeError("sourceEnd out of bounds");Me>this.length&&(Me=this.length),V.length-se<Me-ge&&(Me=V.length-se+ge);var Fe=Me-ge;if(this===V&&typeof Uint8Array.prototype.copyWithin=="function")this.copyWithin(se,ge,Me);else if(this===V&&ge<se&&se<Me)for(var Re=Fe-1;Re>=0;--Re)V[Re+se]=this[Re+ge];else Uint8Array.prototype.set.call(V,this.subarray(ge,Me),se);return Fe},o.prototype.fill=function(V,se,ge,Me){if(typeof V=="string"){if(typeof se=="string"?(Me=se,se=0,ge=this.length):typeof ge=="string"&&(Me=ge,ge=this.length),Me!==void 0&&typeof Me!="string")throw new TypeError("encoding must be a string");if(typeof Me=="string"&&!o.isEncoding(Me))throw new TypeError("Unknown encoding: "+Me);if(V.length===1){var Fe=V.charCodeAt(0);(Me==="utf8"&&Fe<128||Me==="latin1")&&(V=Fe)}}else typeof V=="number"&&(V=V&255);if(se<0||this.length<se||this.length<ge)throw new RangeError("Out of range index");if(ge<=se)return this;se=se>>>0,ge=ge===void 0?this.length:ge>>>0,V||(V=0);var Re;if(typeof V=="number")for(Re=se;Re<ge;++Re)this[Re]=V;else{var $e=o.isBuffer(V)?V:o.from(V,Me),lt=$e.length;if(lt===0)throw new TypeError('The value "'+V+'" is invalid for argument "value"');for(Re=0;Re<ge-se;++Re)this[Re+se]=$e[Re%lt]}return this};var Be=/[^+/0-9A-Za-z-_]/g;function Pe(W){if(W=W.split("=")[0],W=W.trim().replace(Be,""),W.length<2)return"";for(;W.length%4!==0;)W=W+"=";return W}function _e(W){return W<16?"0"+W.toString(16):W.toString(16)}function ne(W,V){V=V||1/0;for(var se,ge=W.length,Me=null,Fe=[],Re=0;Re<ge;++Re){if(se=W.charCodeAt(Re),se>55295&&se<57344){if(!Me){if(se>56319){(V-=3)>-1&&Fe.push(239,191,189);continue}else if(Re+1===ge){(V-=3)>-1&&Fe.push(239,191,189);continue}Me=se;continue}if(se<56320){(V-=3)>-1&&Fe.push(239,191,189),Me=se;continue}se=(Me-55296<<10|se-56320)+65536}else Me&&(V-=3)>-1&&Fe.push(239,191,189);if(Me=null,se<128){if((V-=1)<0)break;Fe.push(se)}else if(se<2048){if((V-=2)<0)break;Fe.push(se>>6|192,se&63|128)}else if(se<65536){if((V-=3)<0)break;Fe.push(se>>12|224,se>>6&63|128,se&63|128)}else if(se<1114112){if((V-=4)<0)break;Fe.push(se>>18|240,se>>12&63|128,se>>6&63|128,se&63|128)}else throw new Error("Invalid code point")}return Fe}function te(W){for(var V=[],se=0;se<W.length;++se)V.push(W.charCodeAt(se)&255);return V}function T(W,V){for(var se,ge,Me,Fe=[],Re=0;Re<W.length&&!((V-=2)<0);++Re)se=W.charCodeAt(Re),ge=se>>8,Me=se%256,Fe.push(Me),Fe.push(ge);return Fe}function I(W){return g.toByteArray(Pe(W))}function re(W,V,se,ge){for(var Me=0;Me<ge&&!(Me+se>=V.length||Me>=W.length);++Me)V[Me+se]=W[Me];return Me}function q(W,V){return W instanceof V||W!=null&&W.constructor!=null&&W.constructor.name!=null&&W.constructor.name===V.name}function z(W){return W!==W}}).call(this)}).call(this,i("buffer").Buffer)},{"base64-js":87,buffer:90,ieee754:357}],91:[function(i,M,E){M.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],92:[function(i,M,E){"use strict";var p=i("get-intrinsic"),g=i("./"),l=g(p("String.prototype.indexOf"));M.exports=function(v,d){var o=p(v,!!d);return typeof o=="function"&&l(v,".prototype.")>-1?g(o):o}},{"./":93,"get-intrinsic":348}],93:[function(i,M,E){"use strict";var p=i("function-bind"),g=i("get-intrinsic"),l=g("%Function.prototype.apply%"),h=g("%Function.prototype.call%"),v=g("%Reflect.apply%",!0)||p.call(h,l),d=g("%Object.getOwnPropertyDescriptor%",!0),o=g("%Object.defineProperty%",!0),s=g("%Math.max%");if(o)try{o({},"a",{value:1})}catch(m){o=null}M.exports=function(y){var _=v(p,h,arguments);if(d&&o){var x=d(_,"length");x.configurable&&o(_,"length",{value:1+s(0,y.length-(arguments.length-1))})}return _};var u=function(){return v(p,l,arguments)};o?o(M.exports,"apply",{value:u}):M.exports.apply=u},{"function-bind":347,"get-intrinsic":348}],94:[function(i,M,E){"use strict";var p=Array.prototype.slice;M.exports=g;function g(h,v){if(!(this instanceof g))return new g(h,v);this.src=h,this._withAccess=v}g.prototype.withAccess=function(h){return this._withAccess=h!==!1,this},g.prototype.pick=function(h){return Array.isArray(h)||(h=p.call(arguments)),h.length&&(this.keys=h),this},g.prototype.to=function(h){if(h=h||{},!this.src)return h;var v=this.keys||Object.keys(this.src);if(!this._withAccess){for(var d=0;d<v.length;d++)o=v[d],h[o]===void 0&&(h[o]=this.src[o]);return h}for(var d=0;d<v.length;d++){var o=v[d];if(l(h,o)){var s=this.src.__lookupGetter__(o),u=this.src.__lookupSetter__(o);s&&h.__defineGetter__(o,s),u&&h.__defineSetter__(o,u),!s&&!u&&(h[o]=this.src[o])}}return h},g.prototype.toCover=function(h){for(var v=this.keys||Object.keys(this.src),d=0;d<v.length;d++){var o=v[d];delete h[o];var s=this.src.__lookupGetter__(o),u=this.src.__lookupSetter__(o);s&&h.__defineGetter__(o,s),u&&h.__defineSetter__(o,u),!s&&!u&&(h[o]=this.src[o])}},g.prototype.override=g.prototype.toCover,g.prototype.and=function(h){var v={};return this.to(v),this.src=h,this.to(v),this.src=v,this};function l(h,v){return h[v]===void 0&&h.__lookupGetter__(v)===void 0&&h.__lookupSetter__(v)===void 0}},{}],95:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/is-callable"),l=i("../internals/try-to-string"),h=p.TypeError;M.exports=function(v){if(g(v))return v;throw h(l(v)+" is not a function")}},{"../internals/global":163,"../internals/is-callable":176,"../internals/try-to-string":257}],96:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/is-constructor"),l=i("../internals/try-to-string"),h=p.TypeError;M.exports=function(v){if(g(v))return v;throw h(l(v)+" is not a constructor")}},{"../internals/global":163,"../internals/is-constructor":177,"../internals/try-to-string":257}],97:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/is-callable"),l=p.String,h=p.TypeError;M.exports=function(v){if(typeof v=="object"||g(v))return v;throw h("Can't set "+l(v)+" as a prototype")}},{"../internals/global":163,"../internals/is-callable":176}],98:[function(i,M,E){var p=i("../internals/well-known-symbol"),g=i("../internals/object-create"),l=i("../internals/object-define-property"),h=p("unscopables"),v=Array.prototype;v[h]==null&&l.f(v,h,{configurable:!0,value:g(null)}),M.exports=function(d){v[h][d]=!0}},{"../internals/object-create":196,"../internals/object-define-property":198,"../internals/well-known-symbol":268}],99:[function(i,M,E){"use strict";var p=i("../internals/string-multibyte").charAt;M.exports=function(g,l,h){return l+(h?p(g,l).length:1)}},{"../internals/string-multibyte":239}],100:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/object-is-prototype-of"),l=p.TypeError;M.exports=function(h,v){if(g(v,h))return h;throw l("Incorrect invocation")}},{"../internals/global":163,"../internals/object-is-prototype-of":204}],101:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/is-object"),l=p.String,h=p.TypeError;M.exports=function(v){if(g(v))return v;throw h(l(v)+" is not an object")}},{"../internals/global":163,"../internals/is-object":180}],102:[function(i,M,E){M.exports=typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined"},{}],103:[function(i,M,E){"use strict";var p=i("../internals/array-buffer-native"),g=i("../internals/descriptors"),l=i("../internals/global"),h=i("../internals/is-callable"),v=i("../internals/is-object"),d=i("../internals/has-own-property"),o=i("../internals/classof"),s=i("../internals/try-to-string"),u=i("../internals/create-non-enumerable-property"),m=i("../internals/redefine"),y=i("../internals/object-define-property").f,_=i("../internals/object-is-prototype-of"),x=i("../internals/object-get-prototype-of"),S=i("../internals/object-set-prototype-of"),w=i("../internals/well-known-symbol"),A=i("../internals/uid"),H=l.Int8Array,R=H&&H.prototype,F=l.Uint8ClampedArray,D=F&&F.prototype,B=H&&x(H),P=R&&x(R),U=Object.prototype,G=l.TypeError,ee=w("toStringTag"),K=A("TYPED_ARRAY_TAG"),Z=A("TYPED_ARRAY_CONSTRUCTOR"),$=p&&!!S&&o(l.opera)!=="Opera",oe=!1,ae,ye,Y,le={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},xe={BigInt64Array:8,BigUint64Array:8},Ce=function(Be){if(!v(Be))return!1;var Pe=o(Be);return Pe==="DataView"||d(le,Pe)||d(xe,Pe)},we=function(Ae){if(!v(Ae))return!1;var Be=o(Ae);return d(le,Be)||d(xe,Be)},Le=function(Ae){if(we(Ae))return Ae;throw G("Target is not a typed array")},de=function(Ae){if(h(Ae)&&(!S||_(B,Ae)))return Ae;throw G(s(Ae)+" is not a typed array constructor")},be=function(Ae,Be,Pe,_e){if(g){if(Pe)for(var ne in le){var te=l[ne];if(te&&d(te.prototype,Ae))try{delete te.prototype[Ae]}catch(T){try{te.prototype[Ae]=Be}catch(I){}}}(!P[Ae]||Pe)&&m(P,Ae,Pe?Be:$&&R[Ae]||Be,_e)}},Te=function(Ae,Be,Pe){var _e,ne;if(g){if(S){if(Pe){for(_e in le)if(ne=l[_e],ne&&d(ne,Ae))try{delete ne[Ae]}catch(te){}}if(!B[Ae]||Pe)try{return m(B,Ae,Pe?Be:$&&B[Ae]||Be)}catch(te){}else return}for(_e in le)ne=l[_e],ne&&(!ne[Ae]||Pe)&&m(ne,Ae,Be)}};for(ae in le)ye=l[ae],Y=ye&&ye.prototype,Y?u(Y,Z,ye):$=!1;for(ae in xe)ye=l[ae],Y=ye&&ye.prototype,Y&&u(Y,Z,ye);if((!$||!h(B)||B===Function.prototype)&&(B=function(){throw G("Incorrect invocation")},$))for(ae in le)l[ae]&&S(l[ae],B);if((!$||!P||P===U)&&(P=B.prototype,$))for(ae in le)l[ae]&&S(l[ae].prototype,P);if($&&x(D)!==P&&S(D,P),g&&!d(P,ee)){oe=!0,y(P,ee,{get:function(){return v(this)?this[K]:void 0}});for(ae in le)l[ae]&&u(l[ae],K,ae)}M.exports={NATIVE_ARRAY_BUFFER_VIEWS:$,TYPED_ARRAY_CONSTRUCTOR:Z,TYPED_ARRAY_TAG:oe&&K,aTypedArray:Le,aTypedArrayConstructor:de,exportTypedArrayMethod:be,exportTypedArrayStaticMethod:Te,isView:Ce,isTypedArray:we,TypedArray:B,TypedArrayPrototype:P}},{"../internals/array-buffer-native":102,"../internals/classof":124,"../internals/create-non-enumerable-property":129,"../internals/descriptors":134,"../internals/global":163,"../internals/has-own-property":164,"../internals/is-callable":176,"../internals/is-object":180,"../internals/object-define-property":198,"../internals/object-get-prototype-of":203,"../internals/object-is-prototype-of":204,"../internals/object-set-prototype-of":208,"../internals/redefine":222,"../internals/try-to-string":257,"../internals/uid":263,"../internals/well-known-symbol":268}],104:[function(i,M,E){"use strict";var p=i("../internals/global"),g=i("../internals/function-uncurry-this"),l=i("../internals/descriptors"),h=i("../internals/array-buffer-native"),v=i("../internals/function-name"),d=i("../internals/create-non-enumerable-property"),o=i("../internals/redefine-all"),s=i("../internals/fails"),u=i("../internals/an-instance"),m=i("../internals/to-integer-or-infinity"),y=i("../internals/to-length"),_=i("../internals/to-index"),x=i("../internals/ieee754"),S=i("../internals/object-get-prototype-of"),w=i("../internals/object-set-prototype-of"),A=i("../internals/object-get-own-property-names").f,H=i("../internals/object-define-property").f,R=i("../internals/array-fill"),F=i("../internals/array-slice-simple"),D=i("../internals/set-to-string-tag"),B=i("../internals/internal-state"),P=v.PROPER,U=v.CONFIGURABLE,G=B.get,ee=B.set,K="ArrayBuffer",Z="DataView",$="prototype",oe="Wrong length",ae="Wrong index",ye=p[K],Y=ye,le=Y&&Y[$],xe=p[Z],Ce=xe&&xe[$],we=Object.prototype,Le=p.Array,de=p.RangeError,be=g(R),Te=g([].reverse),Ae=x.pack,Be=x.unpack,Pe=function(Re){return[Re&255]},_e=function(Re){return[Re&255,Re>>8&255]},ne=function(Re){return[Re&255,Re>>8&255,Re>>16&255,Re>>24&255]},te=function(Re){return Re[3]<<24|Re[2]<<16|Re[1]<<8|Re[0]},T=function(Re){return Ae(Re,23,4)},I=function(Re){return Ae(Re,52,8)},re=function(Re,$e){H(Re[$],$e,{get:function(){return G(this)[$e]}})},q=function(Re,$e,lt,Ne){var Ze=_(lt),We=G(Re);if(Ze+$e>We.byteLength)throw de(ae);var nt=G(We.buffer).bytes,qe=Ze+We.byteOffset,Qe=F(nt,qe,qe+$e);return Ne?Qe:Te(Qe)},z=function(Re,$e,lt,Ne,Ze,We){var nt=_(lt),qe=G(Re);if(nt+$e>qe.byteLength)throw de(ae);for(var Qe=G(qe.buffer).bytes,ft=nt+qe.byteOffset,vt=Ne(+Ze),bt=0;bt<$e;bt++)Qe[ft+bt]=vt[We?bt:$e-bt-1]};if(!h)Y=function($e){u(this,le);var lt=_($e);ee(this,{bytes:be(Le(lt),0),byteLength:lt}),l||(this.byteLength=lt)},le=Y[$],xe=function($e,lt,Ne){u(this,Ce),u($e,le);var Ze=G($e).byteLength,We=m(lt);if(We<0||We>Ze)throw de("Wrong offset");if(Ne=Ne===void 0?Ze-We:y(Ne),We+Ne>Ze)throw de(oe);ee(this,{buffer:$e,byteLength:Ne,byteOffset:We}),l||(this.buffer=$e,this.byteLength=Ne,this.byteOffset=We)},Ce=xe[$],l&&(re(Y,"byteLength"),re(xe,"buffer"),re(xe,"byteLength"),re(xe,"byteOffset")),o(Ce,{getInt8:function($e){return q(this,1,$e)[0]<<24>>24},getUint8:function($e){return q(this,1,$e)[0]},getInt16:function($e){var lt=q(this,2,$e,arguments.length>1?arguments[1]:void 0);return(lt[1]<<8|lt[0])<<16>>16},getUint16:function($e){var lt=q(this,2,$e,arguments.length>1?arguments[1]:void 0);return lt[1]<<8|lt[0]},getInt32:function($e){return te(q(this,4,$e,arguments.length>1?arguments[1]:void 0))},getUint32:function($e){return te(q(this,4,$e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function($e){return Be(q(this,4,$e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function($e){return Be(q(this,8,$e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function($e,lt){z(this,1,$e,Pe,lt)},setUint8:function($e,lt){z(this,1,$e,Pe,lt)},setInt16:function($e,lt){z(this,2,$e,_e,lt,arguments.length>2?arguments[2]:void 0)},setUint16:function($e,lt){z(this,2,$e,_e,lt,arguments.length>2?arguments[2]:void 0)},setInt32:function($e,lt){z(this,4,$e,ne,lt,arguments.length>2?arguments[2]:void 0)},setUint32:function($e,lt){z(this,4,$e,ne,lt,arguments.length>2?arguments[2]:void 0)},setFloat32:function($e,lt){z(this,4,$e,T,lt,arguments.length>2?arguments[2]:void 0)},setFloat64:function($e,lt){z(this,8,$e,I,lt,arguments.length>2?arguments[2]:void 0)}});else{var W=P&&ye.name!==K;if(!s(function(){ye(1)})||!s(function(){new ye(-1)})||s(function(){return new ye,new ye(1.5),new ye(NaN),W&&!U})){Y=function($e){return u(this,le),new ye(_($e))},Y[$]=le;for(var V=A(ye),se=0,ge;V.length>se;)(ge=V[se++])in Y||d(Y,ge,ye[ge]);le.constructor=Y}else W&&U&&d(ye,"name",K);w&&S(Ce)!==we&&w(Ce,we);var Me=new xe(new Y(2)),Fe=g(Ce.setInt8);Me.setInt8(0,2147483648),Me.setInt8(1,2147483649),(Me.getInt8(0)||!Me.getInt8(1))&&o(Ce,{setInt8:function($e,lt){Fe(this,$e,lt<<24>>24)},setUint8:function($e,lt){Fe(this,$e,lt<<24>>24)}},{unsafe:!0})}D(Y,K),D(xe,Z),M.exports={ArrayBuffer:Y,DataView:xe}},{"../internals/an-instance":100,"../internals/array-buffer-native":102,"../internals/array-fill":106,"../internals/array-slice-simple":116,"../internals/create-non-enumerable-property":129,"../internals/descriptors":134,"../internals/fails":150,"../internals/function-name":156,"../internals/function-uncurry-this":157,"../internals/global":163,"../internals/ieee754":169,"../internals/internal-state":173,"../internals/object-define-property":198,"../internals/object-get-own-property-names":201,"../internals/object-get-prototype-of":203,"../internals/object-set-prototype-of":208,"../internals/redefine-all":221,"../internals/set-to-string-tag":234,"../internals/to-index":246,"../internals/to-integer-or-infinity":248,"../internals/to-length":249}],105:[function(i,M,E){"use strict";var p=i("../internals/to-object"),g=i("../internals/to-absolute-index"),l=i("../internals/length-of-array-like"),h=Math.min;M.exports=[].copyWithin||function(d,o){var s=p(this),u=l(s),m=g(d,u),y=g(o,u),_=arguments.length>2?arguments[2]:void 0,x=h((_===void 0?u:g(_,u))-y,u-m),S=1;for(y<m&&m<y+x&&(S=-1,y+=x-1,m+=x-1);x-- >0;)y in s?s[m]=s[y]:delete s[m],m+=S,y+=S;return s}},{"../internals/length-of-array-like":188,"../internals/to-absolute-index":245,"../internals/to-object":250}],106:[function(i,M,E){"use strict";var p=i("../internals/to-object"),g=i("../internals/to-absolute-index"),l=i("../internals/length-of-array-like");M.exports=function(v){for(var d=p(this),o=l(d),s=arguments.length,u=g(s>1?arguments[1]:void 0,o),m=s>2?arguments[2]:void 0,y=m===void 0?o:g(m,o);y>u;)d[u++]=v;return d}},{"../internals/length-of-array-like":188,"../internals/to-absolute-index":245,"../internals/to-object":250}],107:[function(i,M,E){"use strict";var p=i("../internals/array-iteration").forEach,g=i("../internals/array-method-is-strict"),l=g("forEach");M.exports=l?[].forEach:function(v){return p(this,v,arguments.length>1?arguments[1]:void 0)}},{"../internals/array-iteration":111,"../internals/array-method-is-strict":114}],108:[function(i,M,E){var p=i("../internals/length-of-array-like");M.exports=function(g,l){for(var h=0,v=p(l),d=new g(v);v>h;)d[h]=l[h++];return d}},{"../internals/length-of-array-like":188}],109:[function(i,M,E){"use strict";var p=i("../internals/global"),g=i("../internals/function-bind-context"),l=i("../internals/function-call"),h=i("../internals/to-object"),v=i("../internals/call-with-safe-iteration-closing"),d=i("../internals/is-array-iterator-method"),o=i("../internals/is-constructor"),s=i("../internals/length-of-array-like"),u=i("../internals/create-property"),m=i("../internals/get-iterator"),y=i("../internals/get-iterator-method"),_=p.Array;M.exports=function(S){var w=h(S),A=o(this),H=arguments.length,R=H>1?arguments[1]:void 0,F=R!==void 0;F&&(R=g(R,H>2?arguments[2]:void 0));var D=y(w),B=0,P,U,G,ee,K,Z;if(D&&!(this==_&&d(D)))for(ee=m(w,D),K=ee.next,U=A?new this:[];!(G=l(K,ee)).done;B++)Z=F?v(ee,R,[G.value,B],!0):G.value,u(U,B,Z);else for(P=s(w),U=A?new this(P):_(P);P>B;B++)Z=F?R(w[B],B):w[B],u(U,B,Z);return U.length=B,U}},{"../internals/call-with-safe-iteration-closing":121,"../internals/create-property":131,"../internals/function-bind-context":153,"../internals/function-call":155,"../internals/get-iterator":160,"../internals/get-iterator-method":159,"../internals/global":163,"../internals/is-array-iterator-method":174,"../internals/is-constructor":177,"../internals/length-of-array-like":188,"../internals/to-object":250}],110:[function(i,M,E){var p=i("../internals/to-indexed-object"),g=i("../internals/to-absolute-index"),l=i("../internals/length-of-array-like"),h=function(v){return function(d,o,s){var u=p(d),m=l(u),y=g(s,m),_;if(v&&o!=o){for(;m>y;)if(_=u[y++],_!=_)return!0}else for(;m>y;y++)if((v||y in u)&&u[y]===o)return v||y||0;return!v&&-1}};M.exports={includes:h(!0),indexOf:h(!1)}},{"../internals/length-of-array-like":188,"../internals/to-absolute-index":245,"../internals/to-indexed-object":247}],111:[function(i,M,E){var p=i("../internals/function-bind-context"),g=i("../internals/function-uncurry-this"),l=i("../internals/indexed-object"),h=i("../internals/to-object"),v=i("../internals/length-of-array-like"),d=i("../internals/array-species-create"),o=g([].push),s=function(u){var m=u==1,y=u==2,_=u==3,x=u==4,S=u==6,w=u==7,A=u==5||S;return function(H,R,F,D){for(var B=h(H),P=l(B),U=p(R,F),G=v(P),ee=0,K=D||d,Z=m?K(H,G):y||w?K(H,0):void 0,$,oe;G>ee;ee++)if((A||ee in P)&&($=P[ee],oe=U($,ee,B),u))if(m)Z[ee]=oe;else if(oe)switch(u){case 3:return!0;case 5:return $;case 6:return ee;case 2:o(Z,$)}else switch(u){case 4:return!1;case 7:o(Z,$)}return S?-1:_||x?x:Z}};M.exports={forEach:s(0),map:s(1),filter:s(2),some:s(3),every:s(4),find:s(5),findIndex:s(6),filterReject:s(7)}},{"../internals/array-species-create":120,"../internals/function-bind-context":153,"../internals/function-uncurry-this":157,"../internals/indexed-object":170,"../internals/length-of-array-like":188,"../internals/to-object":250}],112:[function(i,M,E){"use strict";var p=i("../internals/function-apply"),g=i("../internals/to-indexed-object"),l=i("../internals/to-integer-or-infinity"),h=i("../internals/length-of-array-like"),v=i("../internals/array-method-is-strict"),d=Math.min,o=[].lastIndexOf,s=!!o&&1/[1].lastIndexOf(1,-0)<0,u=v("lastIndexOf"),m=s||!u;M.exports=m?function(_){if(s)return p(o,this,arguments)||0;var x=g(this),S=h(x),w=S-1;for(arguments.length>1&&(w=d(w,l(arguments[1]))),w<0&&(w=S+w);w>=0;w--)if(w in x&&x[w]===_)return w||0;return-1}:o},{"../internals/array-method-is-strict":114,"../internals/function-apply":152,"../internals/length-of-array-like":188,"../internals/to-indexed-object":247,"../internals/to-integer-or-infinity":248}],113:[function(i,M,E){var p=i("../internals/fails"),g=i("../internals/well-known-symbol"),l=i("../internals/engine-v8-version"),h=g("species");M.exports=function(v){return l>=51||!p(function(){var d=[],o=d.constructor={};return o[h]=function(){return{foo:1}},d[v](Boolean).foo!==1})}},{"../internals/engine-v8-version":146,"../internals/fails":150,"../internals/well-known-symbol":268}],114:[function(i,M,E){"use strict";var p=i("../internals/fails");M.exports=function(g,l){var h=[][g];return!!h&&p(function(){h.call(null,l||function(){return 1},1)})}},{"../internals/fails":150}],115:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/a-callable"),l=i("../internals/to-object"),h=i("../internals/indexed-object"),v=i("../internals/length-of-array-like"),d=p.TypeError,o=function(s){return function(u,m,y,_){g(m);var x=l(u),S=h(x),w=v(x),A=s?w-1:0,H=s?-1:1;if(y<2)for(;;){if(A in S){_=S[A],A+=H;break}if(A+=H,s?A<0:w<=A)throw d("Reduce of empty array with no initial value")}for(;s?A>=0:w>A;A+=H)A in S&&(_=m(_,S[A],A,x));return _}};M.exports={left:o(!1),right:o(!0)}},{"../internals/a-callable":95,"../internals/global":163,"../internals/indexed-object":170,"../internals/length-of-array-like":188,"../internals/to-object":250}],116:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/to-absolute-index"),l=i("../internals/length-of-array-like"),h=i("../internals/create-property"),v=p.Array,d=Math.max;M.exports=function(o,s,u){for(var m=l(o),y=g(s,m),_=g(u===void 0?m:u,m),x=v(d(_-y,0)),S=0;y<_;y++,S++)h(x,S,o[y]);return x.length=S,x}},{"../internals/create-property":131,"../internals/global":163,"../internals/length-of-array-like":188,"../internals/to-absolute-index":245}],117:[function(i,M,E){var p=i("../internals/function-uncurry-this");M.exports=p([].slice)},{"../internals/function-uncurry-this":157}],118:[function(i,M,E){var p=i("../internals/array-slice-simple"),g=Math.floor,l=function(d,o){var s=d.length,u=g(s/2);return s<8?h(d,o):v(d,l(p(d,0,u),o),l(p(d,u),o),o)},h=function(d,o){for(var s=d.length,u=1,m,y;u<s;){for(y=u,m=d[u];y&&o(d[y-1],m)>0;)d[y]=d[--y];y!==u++&&(d[y]=m)}return d},v=function(d,o,s,u){for(var m=o.length,y=s.length,_=0,x=0;_<m||x<y;)d[_+x]=_<m&&x<y?u(o[_],s[x])<=0?o[_++]:s[x++]:_<m?o[_++]:s[x++];return d};M.exports=l},{"../internals/array-slice-simple":116}],119:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/is-array"),l=i("../internals/is-constructor"),h=i("../internals/is-object"),v=i("../internals/well-known-symbol"),d=v("species"),o=p.Array;M.exports=function(s){var u;return g(s)&&(u=s.constructor,l(u)&&(u===o||g(u.prototype))?u=void 0:h(u)&&(u=u[d],u===null&&(u=void 0))),u===void 0?o:u}},{"../internals/global":163,"../internals/is-array":175,"../internals/is-constructor":177,"../internals/is-object":180,"../internals/well-known-symbol":268}],120:[function(i,M,E){var p=i("../internals/array-species-constructor");M.exports=function(g,l){return new(p(g))(l===0?0:l)}},{"../internals/array-species-constructor":119}],121:[function(i,M,E){var p=i("../internals/an-object"),g=i("../internals/iterator-close");M.exports=function(l,h,v,d){try{return d?h(p(v)[0],v[1]):h(v)}catch(o){g(l,"throw",o)}}},{"../internals/an-object":101,"../internals/iterator-close":185}],122:[function(i,M,E){var p=i("../internals/well-known-symbol"),g=p("iterator"),l=!1;try{var h=0,v={next:function(){return{done:!!h++}},return:function(){l=!0}};v[g]=function(){return this},Array.from(v,function(){throw 2})}catch(d){}M.exports=function(d,o){if(!o&&!l)return!1;var s=!1;try{var u={};u[g]=function(){return{next:function(){return{done:s=!0}}}},d(u)}catch(m){}return s}},{"../internals/well-known-symbol":268}],123:[function(i,M,E){var p=i("../internals/function-uncurry-this"),g=p({}.toString),l=p("".slice);M.exports=function(h){return l(g(h),8,-1)}},{"../internals/function-uncurry-this":157}],124:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/to-string-tag-support"),l=i("../internals/is-callable"),h=i("../internals/classof-raw"),v=i("../internals/well-known-symbol"),d=v("toStringTag"),o=p.Object,s=h(function(){return arguments}())=="Arguments",u=function(m,y){try{return m[y]}catch(_){}};M.exports=g?h:function(m){var y,_,x;return m===void 0?"Undefined":m===null?"Null":typeof(_=u(y=o(m),d))=="string"?_:s?h(y):(x=h(y))=="Object"&&l(y.callee)?"Arguments":x}},{"../internals/classof-raw":123,"../internals/global":163,"../internals/is-callable":176,"../internals/to-string-tag-support":255,"../internals/well-known-symbol":268}],125:[function(i,M,E){var p=i("../internals/has-own-property"),g=i("../internals/own-keys"),l=i("../internals/object-get-own-property-descriptor"),h=i("../internals/object-define-property");M.exports=function(v,d,o){for(var s=g(d),u=h.f,m=l.f,y=0;y<s.length;y++){var _=s[y];!p(v,_)&&!(o&&p(o,_))&&u(v,_,m(d,_))}}},{"../internals/has-own-property":164,"../internals/object-define-property":198,"../internals/object-get-own-property-descriptor":199,"../internals/own-keys":212}],126:[function(i,M,E){var p=i("../internals/well-known-symbol"),g=p("match");M.exports=function(l){var h=/./;try{"/./"[l](h)}catch(v){try{return h[g]=!1,"/./"[l](h)}catch(d){}}return!1}},{"../internals/well-known-symbol":268}],127:[function(i,M,E){var p=i("../internals/fails");M.exports=!p(function(){function g(){}return g.prototype.constructor=null,Object.getPrototypeOf(new g)!==g.prototype})},{"../internals/fails":150}],128:[function(i,M,E){"use strict";var p=i("../internals/iterators-core").IteratorPrototype,g=i("../internals/object-create"),l=i("../internals/create-property-descriptor"),h=i("../internals/set-to-string-tag"),v=i("../internals/iterators"),d=function(){return this};M.exports=function(o,s,u,m){var y=s+" Iterator";return o.prototype=g(p,{next:l(+!m,u)}),h(o,y,!1,!0),v[y]=d,o}},{"../internals/create-property-descriptor":130,"../internals/iterators":187,"../internals/iterators-core":186,"../internals/object-create":196,"../internals/set-to-string-tag":234}],129:[function(i,M,E){var p=i("../internals/descriptors"),g=i("../internals/object-define-property"),l=i("../internals/create-property-descriptor");M.exports=p?function(h,v,d){return g.f(h,v,l(1,d))}:function(h,v,d){return h[v]=d,h}},{"../internals/create-property-descriptor":130,"../internals/descriptors":134,"../internals/object-define-property":198}],130:[function(i,M,E){M.exports=function(p,g){return{enumerable:!(p&1),configurable:!(p&2),writable:!(p&4),value:g}}},{}],131:[function(i,M,E){"use strict";var p=i("../internals/to-property-key"),g=i("../internals/object-define-property"),l=i("../internals/create-property-descriptor");M.exports=function(h,v,d){var o=p(v);o in h?g.f(h,o,l(0,d)):h[o]=d}},{"../internals/create-property-descriptor":130,"../internals/object-define-property":198,"../internals/to-property-key":254}],132:[function(i,M,E){"use strict";var p=i("../internals/export"),g=i("../internals/function-call"),l=i("../internals/is-pure"),h=i("../internals/function-name"),v=i("../internals/is-callable"),d=i("../internals/create-iterator-constructor"),o=i("../internals/object-get-prototype-of"),s=i("../internals/object-set-prototype-of"),u=i("../internals/set-to-string-tag"),m=i("../internals/create-non-enumerable-property"),y=i("../internals/redefine"),_=i("../internals/well-known-symbol"),x=i("../internals/iterators"),S=i("../internals/iterators-core"),w=h.PROPER,A=h.CONFIGURABLE,H=S.IteratorPrototype,R=S.BUGGY_SAFARI_ITERATORS,F=_("iterator"),D="keys",B="values",P="entries",U=function(){return this};M.exports=function(G,ee,K,Z,$,oe,ae){d(K,ee,Z);var ye=function(Ae){if(Ae===$&&we)return we;if(!R&&Ae in xe)return xe[Ae];switch(Ae){case D:return function(){return new K(this,Ae)};case B:return function(){return new K(this,Ae)};case P:return function(){return new K(this,Ae)}}return function(){return new K(this)}},Y=ee+" Iterator",le=!1,xe=G.prototype,Ce=xe[F]||xe["@@iterator"]||$&&xe[$],we=!R&&Ce||ye($),Le=ee=="Array"&&xe.entries||Ce,de,be,Te;if(Le&&(de=o(Le.call(new G)),de!==Object.prototype&&de.next&&(!l&&o(de)!==H&&(s?s(de,H):v(de[F])||y(de,F,U)),u(de,Y,!0,!0),l&&(x[Y]=U))),w&&$==B&&Ce&&Ce.name!==B&&(!l&&A?m(xe,"name",B):(le=!0,we=function(){return g(Ce,this)})),$)if(be={values:ye(B),keys:oe?we:ye(D),entries:ye(P)},ae)for(Te in be)(R||le||!(Te in xe))&&y(xe,Te,be[Te]);else p({target:ee,proto:!0,forced:R||le},be);return(!l||ae)&&xe[F]!==we&&y(xe,F,we,{name:$}),x[ee]=we,be}},{"../internals/create-iterator-constructor":128,"../internals/create-non-enumerable-property":129,"../internals/export":149,"../internals/function-call":155,"../internals/function-name":156,"../internals/is-callable":176,"../internals/is-pure":181,"../internals/iterators":187,"../internals/iterators-core":186,"../internals/object-get-prototype-of":203,"../internals/object-set-prototype-of":208,"../internals/redefine":222,"../internals/set-to-string-tag":234,"../internals/well-known-symbol":268}],133:[function(i,M,E){var p=i("../internals/path"),g=i("../internals/has-own-property"),l=i("../internals/well-known-symbol-wrapped"),h=i("../internals/object-define-property").f;M.exports=function(v){var d=p.Symbol||(p.Symbol={});g(d,v)||h(d,v,{value:l.f(v)})}},{"../internals/has-own-property":164,"../internals/object-define-property":198,"../internals/path":213,"../internals/well-known-symbol-wrapped":267}],134:[function(i,M,E){var p=i("../internals/fails");M.exports=!p(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})},{"../internals/fails":150}],135:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/is-object"),l=p.document,h=g(l)&&g(l.createElement);M.exports=function(v){return h?l.createElement(v):{}}},{"../internals/global":163,"../internals/is-object":180}],136:[function(i,M,E){M.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}},{}],137:[function(i,M,E){var p=i("../internals/document-create-element"),g=p("span").classList,l=g&&g.constructor&&g.constructor.prototype;M.exports=l===Object.prototype?void 0:l},{"../internals/document-create-element":135}],138:[function(i,M,E){var p=i("../internals/engine-user-agent"),g=p.match(/firefox\/(\d+)/i);M.exports=!!g&&+g[1]},{"../internals/engine-user-agent":145}],139:[function(i,M,E){M.exports=typeof window=="object"&&typeof Deno!="object"},{}],140:[function(i,M,E){var p=i("../internals/engine-user-agent");M.exports=/MSIE|Trident/.test(p)},{"../internals/engine-user-agent":145}],141:[function(i,M,E){var p=i("../internals/engine-user-agent"),g=i("../internals/global");M.exports=/ipad|iphone|ipod/i.test(p)&&g.Pebble!==void 0},{"../internals/engine-user-agent":145,"../internals/global":163}],142:[function(i,M,E){var p=i("../internals/engine-user-agent");M.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(p)},{"../internals/engine-user-agent":145}],143:[function(i,M,E){var p=i("../internals/classof-raw"),g=i("../internals/global");M.exports=p(g.process)=="process"},{"../internals/classof-raw":123,"../internals/global":163}],144:[function(i,M,E){var p=i("../internals/engine-user-agent");M.exports=/web0s(?!.*chrome)/i.test(p)},{"../internals/engine-user-agent":145}],145:[function(i,M,E){var p=i("../internals/get-built-in");M.exports=p("navigator","userAgent")||""},{"../internals/get-built-in":158}],146:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/engine-user-agent"),l=p.process,h=p.Deno,v=l&&l.versions||h&&h.version,d=v&&v.v8,o,s;d&&(o=d.split("."),s=o[0]>0&&o[0]<4?1:+(o[0]+o[1])),!s&&g&&(o=g.match(/Edge\/(\d+)/),(!o||o[1]>=74)&&(o=g.match(/Chrome\/(\d+)/),o&&(s=+o[1]))),M.exports=s},{"../internals/engine-user-agent":145,"../internals/global":163}],147:[function(i,M,E){var p=i("../internals/engine-user-agent"),g=p.match(/AppleWebKit\/(\d+)\./);M.exports=!!g&&+g[1]},{"../internals/engine-user-agent":145}],148:[function(i,M,E){M.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},{}],149:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/object-get-own-property-descriptor").f,l=i("../internals/create-non-enumerable-property"),h=i("../internals/redefine"),v=i("../internals/set-global"),d=i("../internals/copy-constructor-properties"),o=i("../internals/is-forced");M.exports=function(s,u){var m=s.target,y=s.global,_=s.stat,x,S,w,A,H,R;if(y?S=p:_?S=p[m]||v(m,{}):S=(p[m]||{}).prototype,S)for(w in u){if(H=u[w],s.noTargetGet?(R=g(S,w),A=R&&R.value):A=S[w],x=o(y?w:m+(_?".":"#")+w,s.forced),!x&&A!==void 0){if(typeof H==typeof A)continue;d(H,A)}(s.sham||A&&A.sham)&&l(H,"sham",!0),h(S,w,H,s)}}},{"../internals/copy-constructor-properties":125,"../internals/create-non-enumerable-property":129,"../internals/global":163,"../internals/is-forced":178,"../internals/object-get-own-property-descriptor":199,"../internals/redefine":222,"../internals/set-global":232}],150:[function(i,M,E){M.exports=function(p){try{return!!p()}catch(g){return!0}}},{}],151:[function(i,M,E){"use strict";i("../modules/es.regexp.exec");var p=i("../internals/function-uncurry-this"),g=i("../internals/redefine"),l=i("../internals/regexp-exec"),h=i("../internals/fails"),v=i("../internals/well-known-symbol"),d=i("../internals/create-non-enumerable-property"),o=v("species"),s=RegExp.prototype;M.exports=function(u,m,y,_){var x=v(u),S=!h(function(){var R={};return R[x]=function(){return 7},""[u](R)!=7}),w=S&&!h(function(){var R=!1,F=/a/;return u==="split"&&(F={},F.constructor={},F.constructor[o]=function(){return F},F.flags="",F[x]=/./[x]),F.exec=function(){return R=!0,null},F[x](""),!R});if(!S||!w||y){var A=p(/./[x]),H=m(x,""[u],function(R,F,D,B,P){var U=p(R),G=F.exec;return G===l||G===s.exec?S&&!P?{done:!0,value:A(F,D,B)}:{done:!0,value:U(D,F,B)}:{done:!1}});g(String.prototype,u,H[0]),g(s,x,H[1])}_&&d(s[x],"sham",!0)}},{"../internals/create-non-enumerable-property":129,"../internals/fails":150,"../internals/function-uncurry-this":157,"../internals/redefine":222,"../internals/regexp-exec":224,"../internals/well-known-symbol":268,"../modules/es.regexp.exec":300}],152:[function(i,M,E){var p=i("../internals/function-bind-native"),g=Function.prototype,l=g.apply,h=g.call;M.exports=typeof Reflect=="object"&&Reflect.apply||(p?h.bind(l):function(){return h.apply(l,arguments)})},{"../internals/function-bind-native":154}],153:[function(i,M,E){var p=i("../internals/function-uncurry-this"),g=i("../internals/a-callable"),l=i("../internals/function-bind-native"),h=p(p.bind);M.exports=function(v,d){return g(v),d===void 0?v:l?h(v,d):function(){return v.apply(d,arguments)}}},{"../internals/a-callable":95,"../internals/function-bind-native":154,"../internals/function-uncurry-this":157}],154:[function(i,M,E){var p=i("../internals/fails");M.exports=!p(function(){var g=function(){}.bind();return typeof g!="function"||g.hasOwnProperty("prototype")})},{"../internals/fails":150}],155:[function(i,M,E){var p=i("../internals/function-bind-native"),g=Function.prototype.call;M.exports=p?g.bind(g):function(){return g.apply(g,arguments)}},{"../internals/function-bind-native":154}],156:[function(i,M,E){var p=i("../internals/descriptors"),g=i("../internals/has-own-property"),l=Function.prototype,h=p&&Object.getOwnPropertyDescriptor,v=g(l,"name"),d=v&&function(){}.name==="something",o=v&&(!p||p&&h(l,"name").configurable);M.exports={EXISTS:v,PROPER:d,CONFIGURABLE:o}},{"../internals/descriptors":134,"../internals/has-own-property":164}],157:[function(i,M,E){var p=i("../internals/function-bind-native"),g=Function.prototype,l=g.bind,h=g.call,v=p&&l.bind(h,h);M.exports=p?function(d){return d&&v(d)}:function(d){return d&&function(){return h.apply(d,arguments)}}},{"../internals/function-bind-native":154}],158:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/is-callable"),l=function(h){return g(h)?h:void 0};M.exports=function(h,v){return arguments.length<2?l(p[h]):p[h]&&p[h][v]}},{"../internals/global":163,"../internals/is-callable":176}],159:[function(i,M,E){var p=i("../internals/classof"),g=i("../internals/get-method"),l=i("../internals/iterators"),h=i("../internals/well-known-symbol"),v=h("iterator");M.exports=function(d){if(d!=null)return g(d,v)||g(d,"@@iterator")||l[p(d)]}},{"../internals/classof":124,"../internals/get-method":161,"../internals/iterators":187,"../internals/well-known-symbol":268}],160:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/function-call"),l=i("../internals/a-callable"),h=i("../internals/an-object"),v=i("../internals/try-to-string"),d=i("../internals/get-iterator-method"),o=p.TypeError;M.exports=function(s,u){var m=arguments.length<2?d(s):u;if(l(m))return h(g(m,s));throw o(v(s)+" is not iterable")}},{"../internals/a-callable":95,"../internals/an-object":101,"../internals/function-call":155,"../internals/get-iterator-method":159,"../internals/global":163,"../internals/try-to-string":257}],161:[function(i,M,E){var p=i("../internals/a-callable");M.exports=function(g,l){var h=g[l];return h==null?void 0:p(h)}},{"../internals/a-callable":95}],162:[function(i,M,E){var p=i("../internals/function-uncurry-this"),g=i("../internals/to-object"),l=Math.floor,h=p("".charAt),v=p("".replace),d=p("".slice),o=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,s=/\$([$&'`]|\d{1,2})/g;M.exports=function(u,m,y,_,x,S){var w=y+u.length,A=_.length,H=s;return x!==void 0&&(x=g(x),H=o),v(S,H,function(R,F){var D;switch(h(F,0)){case"$":return"$";case"&":return u;case"`":return d(m,0,y);case"'":return d(m,w);case"<":D=x[d(F,1,-1)];break;default:var B=+F;if(B===0)return R;if(B>A){var P=l(B/10);return P===0?R:P<=A?_[P-1]===void 0?h(F,1):_[P-1]+h(F,1):R}D=_[B-1]}return D===void 0?"":D})}},{"../internals/function-uncurry-this":157,"../internals/to-object":250}],163:[function(i,M,E){(function(p){(function(){var g=function(l){return l&&l.Math==Math&&l};M.exports=g(typeof globalThis=="object"&&globalThis)||g(typeof window=="object"&&window)||g(typeof self=="object"&&self)||g(typeof p=="object"&&p)||function(){return this}()||Function("return this")()}).call(this)}).call(this,typeof Ue!="undefined"?Ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],164:[function(i,M,E){var p=i("../internals/function-uncurry-this"),g=i("../internals/to-object"),l=p({}.hasOwnProperty);M.exports=Object.hasOwn||function(v,d){return l(g(v),d)}},{"../internals/function-uncurry-this":157,"../internals/to-object":250}],165:[function(i,M,E){M.exports={}},{}],166:[function(i,M,E){var p=i("../internals/global");M.exports=function(g,l){var h=p.console;h&&h.error&&(arguments.length==1?h.error(g):h.error(g,l))}},{"../internals/global":163}],167:[function(i,M,E){var p=i("../internals/get-built-in");M.exports=p("document","documentElement")},{"../internals/get-built-in":158}],168:[function(i,M,E){var p=i("../internals/descriptors"),g=i("../internals/fails"),l=i("../internals/document-create-element");M.exports=!p&&!g(function(){return Object.defineProperty(l("div"),"a",{get:function(){return 7}}).a!=7})},{"../internals/descriptors":134,"../internals/document-create-element":135,"../internals/fails":150}],169:[function(i,M,E){var p=i("../internals/global"),g=p.Array,l=Math.abs,h=Math.pow,v=Math.floor,d=Math.log,o=Math.LN2,s=function(m,y,_){var x=g(_),S=_*8-y-1,w=(1<<S)-1,A=w>>1,H=y===23?h(2,-24)-h(2,-77):0,R=m<0||m===0&&1/m<0?1:0,F=0,D,B,P;for(m=l(m),m!=m||m===1/0?(B=m!=m?1:0,D=w):(D=v(d(m)/o),P=h(2,-D),m*P<1&&(D--,P*=2),D+A>=1?m+=H/P:m+=H*h(2,1-A),m*P>=2&&(D++,P/=2),D+A>=w?(B=0,D=w):D+A>=1?(B=(m*P-1)*h(2,y),D=D+A):(B=m*h(2,A-1)*h(2,y),D=0));y>=8;)x[F++]=B&255,B/=256,y-=8;for(D=D<<y|B,S+=y;S>0;)x[F++]=D&255,D/=256,S-=8;return x[--F]|=R*128,x},u=function(m,y){var _=m.length,x=_*8-y-1,S=(1<<x)-1,w=S>>1,A=x-7,H=_-1,R=m[H--],F=R&127,D;for(R>>=7;A>0;)F=F*256+m[H--],A-=8;for(D=F&(1<<-A)-1,F>>=-A,A+=y;A>0;)D=D*256+m[H--],A-=8;if(F===0)F=1-w;else{if(F===S)return D?NaN:R?-1/0:1/0;D=D+h(2,y),F=F-w}return(R?-1:1)*D*h(2,F-y)};M.exports={pack:s,unpack:u}},{"../internals/global":163}],170:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/function-uncurry-this"),l=i("../internals/fails"),h=i("../internals/classof-raw"),v=p.Object,d=g("".split);M.exports=l(function(){return!v("z").propertyIsEnumerable(0)})?function(o){return h(o)=="String"?d(o,""):v(o)}:v},{"../internals/classof-raw":123,"../internals/fails":150,"../internals/function-uncurry-this":157,"../internals/global":163}],171:[function(i,M,E){var p=i("../internals/is-callable"),g=i("../internals/is-object"),l=i("../internals/object-set-prototype-of");M.exports=function(h,v,d){var o,s;return l&&p(o=v.constructor)&&o!==d&&g(s=o.prototype)&&s!==d.prototype&&l(h,s),h}},{"../internals/is-callable":176,"../internals/is-object":180,"../internals/object-set-prototype-of":208}],172:[function(i,M,E){var p=i("../internals/function-uncurry-this"),g=i("../internals/is-callable"),l=i("../internals/shared-store"),h=p(Function.toString);g(l.inspectSource)||(l.inspectSource=function(v){return h(v)}),M.exports=l.inspectSource},{"../internals/function-uncurry-this":157,"../internals/is-callable":176,"../internals/shared-store":236}],173:[function(i,M,E){var p=i("../internals/native-weak-map"),g=i("../internals/global"),l=i("../internals/function-uncurry-this"),h=i("../internals/is-object"),v=i("../internals/create-non-enumerable-property"),d=i("../internals/has-own-property"),o=i("../internals/shared-store"),s=i("../internals/shared-key"),u=i("../internals/hidden-keys"),m="Object already initialized",y=g.TypeError,_=g.WeakMap,x,S,w,A=function(U){return w(U)?S(U):x(U,{})},H=function(U){return function(G){var ee;if(!h(G)||(ee=S(G)).type!==U)throw y("Incompatible receiver, "+U+" required");return ee}};if(p||o.state){var R=o.state||(o.state=new _),F=l(R.get),D=l(R.has),B=l(R.set);x=function(U,G){if(D(R,U))throw new y(m);return G.facade=U,B(R,U,G),G},S=function(U){return F(R,U)||{}},w=function(U){return D(R,U)}}else{var P=s("state");u[P]=!0,x=function(U,G){if(d(U,P))throw new y(m);return G.facade=U,v(U,P,G),G},S=function(U){return d(U,P)?U[P]:{}},w=function(U){return d(U,P)}}M.exports={set:x,get:S,has:w,enforce:A,getterFor:H}},{"../internals/create-non-enumerable-property":129,"../internals/function-uncurry-this":157,"../internals/global":163,"../internals/has-own-property":164,"../internals/hidden-keys":165,"../internals/is-object":180,"../internals/native-weak-map":192,"../internals/shared-key":235,"../internals/shared-store":236}],174:[function(i,M,E){var p=i("../internals/well-known-symbol"),g=i("../internals/iterators"),l=p("iterator"),h=Array.prototype;M.exports=function(v){return v!==void 0&&(g.Array===v||h[l]===v)}},{"../internals/iterators":187,"../internals/well-known-symbol":268}],175:[function(i,M,E){var p=i("../internals/classof-raw");M.exports=Array.isArray||function(l){return p(l)=="Array"}},{"../internals/classof-raw":123}],176:[function(i,M,E){M.exports=function(p){return typeof p=="function"}},{}],177:[function(i,M,E){var p=i("../internals/function-uncurry-this"),g=i("../internals/fails"),l=i("../internals/is-callable"),h=i("../internals/classof"),v=i("../internals/get-built-in"),d=i("../internals/inspect-source"),o=function(){},s=[],u=v("Reflect","construct"),m=/^\s*(?:class|function)\b/,y=p(m.exec),_=!m.exec(o),x=function(A){if(!l(A))return!1;try{return u(o,s,A),!0}catch(H){return!1}},S=function(A){if(!l(A))return!1;switch(h(A)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return _||!!y(m,d(A))}catch(H){return!0}};S.sham=!0,M.exports=!u||g(function(){var w;return x(x.call)||!x(Object)||!x(function(){w=!0})||w})?S:x},{"../internals/classof":124,"../internals/fails":150,"../internals/function-uncurry-this":157,"../internals/get-built-in":158,"../internals/inspect-source":172,"../internals/is-callable":176}],178:[function(i,M,E){var p=i("../internals/fails"),g=i("../internals/is-callable"),l=/#|\.prototype\./,h=function(u,m){var y=d[v(u)];return y==s?!0:y==o?!1:g(m)?p(m):!!m},v=h.normalize=function(u){return String(u).replace(l,".").toLowerCase()},d=h.data={},o=h.NATIVE="N",s=h.POLYFILL="P";M.exports=h},{"../internals/fails":150,"../internals/is-callable":176}],179:[function(i,M,E){var p=i("../internals/is-object"),g=Math.floor;M.exports=Number.isInteger||function(h){return!p(h)&&isFinite(h)&&g(h)===h}},{"../internals/is-object":180}],180:[function(i,M,E){var p=i("../internals/is-callable");M.exports=function(g){return typeof g=="object"?g!==null:p(g)}},{"../internals/is-callable":176}],181:[function(i,M,E){M.exports=!1},{}],182:[function(i,M,E){var p=i("../internals/is-object"),g=i("../internals/classof-raw"),l=i("../internals/well-known-symbol"),h=l("match");M.exports=function(v){var d;return p(v)&&((d=v[h])!==void 0?!!d:g(v)=="RegExp")}},{"../internals/classof-raw":123,"../internals/is-object":180,"../internals/well-known-symbol":268}],183:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/get-built-in"),l=i("../internals/is-callable"),h=i("../internals/object-is-prototype-of"),v=i("../internals/use-symbol-as-uid"),d=p.Object;M.exports=v?function(o){return typeof o=="symbol"}:function(o){var s=g("Symbol");return l(s)&&h(s.prototype,d(o))}},{"../internals/get-built-in":158,"../internals/global":163,"../internals/is-callable":176,"../internals/object-is-prototype-of":204,"../internals/use-symbol-as-uid":264}],184:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/function-bind-context"),l=i("../internals/function-call"),h=i("../internals/an-object"),v=i("../internals/try-to-string"),d=i("../internals/is-array-iterator-method"),o=i("../internals/length-of-array-like"),s=i("../internals/object-is-prototype-of"),u=i("../internals/get-iterator"),m=i("../internals/get-iterator-method"),y=i("../internals/iterator-close"),_=p.TypeError,x=function(w,A){this.stopped=w,this.result=A},S=x.prototype;M.exports=function(w,A,H){var R=H&&H.that,F=!!(H&&H.AS_ENTRIES),D=!!(H&&H.IS_ITERATOR),B=!!(H&&H.INTERRUPTED),P=g(A,R),U,G,ee,K,Z,$,oe,ae=function(Y){return U&&y(U,"normal",Y),new x(!0,Y)},ye=function(Y){return F?(h(Y),B?P(Y[0],Y[1],ae):P(Y[0],Y[1])):B?P(Y,ae):P(Y)};if(D)U=w;else{if(G=m(w),!G)throw _(v(w)+" is not iterable");if(d(G)){for(ee=0,K=o(w);K>ee;ee++)if(Z=ye(w[ee]),Z&&s(S,Z))return Z;return new x(!1)}U=u(w,G)}for($=U.next;!(oe=l($,U)).done;){try{Z=ye(oe.value)}catch(Y){y(U,"throw",Y)}if(typeof Z=="object"&&Z&&s(S,Z))return Z}return new x(!1)}},{"../internals/an-object":101,"../internals/function-bind-context":153,"../internals/function-call":155,"../internals/get-iterator":160,"../internals/get-iterator-method":159,"../internals/global":163,"../internals/is-array-iterator-method":174,"../internals/iterator-close":185,"../internals/length-of-array-like":188,"../internals/object-is-prototype-of":204,"../internals/try-to-string":257}],185:[function(i,M,E){var p=i("../internals/function-call"),g=i("../internals/an-object"),l=i("../internals/get-method");M.exports=function(h,v,d){var o,s;g(h);try{if(o=l(h,"return"),!o){if(v==="throw")throw d;return d}o=p(o,h)}catch(u){s=!0,o=u}if(v==="throw")throw d;if(s)throw o;return g(o),d}},{"../internals/an-object":101,"../internals/function-call":155,"../internals/get-method":161}],186:[function(i,M,E){"use strict";var p=i("../internals/fails"),g=i("../internals/is-callable"),l=i("../internals/object-create"),h=i("../internals/object-get-prototype-of"),v=i("../internals/redefine"),d=i("../internals/well-known-symbol"),o=i("../internals/is-pure"),s=d("iterator"),u=!1,m,y,_;[].keys&&(_=[].keys(),"next"in _?(y=h(h(_)),y!==Object.prototype&&(m=y)):u=!0);var x=m==null||p(function(){var S={};return m[s].call(S)!==S});x?m={}:o&&(m=l(m)),g(m[s])||v(m,s,function(){return this}),M.exports={IteratorPrototype:m,BUGGY_SAFARI_ITERATORS:u}},{"../internals/fails":150,"../internals/is-callable":176,"../internals/is-pure":181,"../internals/object-create":196,"../internals/object-get-prototype-of":203,"../internals/redefine":222,"../internals/well-known-symbol":268}],187:[function(i,M,E){arguments[4][165][0].apply(E,arguments)},{dup:165}],188:[function(i,M,E){var p=i("../internals/to-length");M.exports=function(g){return p(g.length)}},{"../internals/to-length":249}],189:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/function-bind-context"),l=i("../internals/object-get-own-property-descriptor").f,h=i("../internals/task").set,v=i("../internals/engine-is-ios"),d=i("../internals/engine-is-ios-pebble"),o=i("../internals/engine-is-webos-webkit"),s=i("../internals/engine-is-node"),u=p.MutationObserver||p.WebKitMutationObserver,m=p.document,y=p.process,_=p.Promise,x=l(p,"queueMicrotask"),S=x&&x.value,w,A,H,R,F,D,B,P;S||(w=function(){var U,G;for(s&&(U=y.domain)&&U.exit();A;){G=A.fn,A=A.next;try{G()}catch(ee){throw A?R():H=void 0,ee}}H=void 0,U&&U.enter()},!v&&!s&&!o&&u&&m?(F=!0,D=m.createTextNode(""),new u(w).observe(D,{characterData:!0}),R=function(){D.data=F=!F}):!d&&_&&_.resolve?(B=_.resolve(void 0),B.constructor=_,P=g(B.then,B),R=function(){P(w)}):s?R=function(){y.nextTick(w)}:(h=g(h,p),R=function(){h(w)})),M.exports=S||function(U){var G={fn:U,next:void 0};H&&(H.next=G),A||(A=G,R()),H=G}},{"../internals/engine-is-ios":142,"../internals/engine-is-ios-pebble":141,"../internals/engine-is-node":143,"../internals/engine-is-webos-webkit":144,"../internals/function-bind-context":153,"../internals/global":163,"../internals/object-get-own-property-descriptor":199,"../internals/task":243}],190:[function(i,M,E){var p=i("../internals/native-symbol");M.exports=p&&!!Symbol.for&&!!Symbol.keyFor},{"../internals/native-symbol":191}],191:[function(i,M,E){var p=i("../internals/engine-v8-version"),g=i("../internals/fails");M.exports=!!Object.getOwnPropertySymbols&&!g(function(){var l=Symbol();return!String(l)||!(Object(l)instanceof Symbol)||!Symbol.sham&&p&&p<41})},{"../internals/engine-v8-version":146,"../internals/fails":150}],192:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/is-callable"),l=i("../internals/inspect-source"),h=p.WeakMap;M.exports=g(h)&&/native code/.test(l(h))},{"../internals/global":163,"../internals/inspect-source":172,"../internals/is-callable":176}],193:[function(i,M,E){"use strict";var p=i("../internals/a-callable"),g=function(l){var h,v;this.promise=new l(function(d,o){if(h!==void 0||v!==void 0)throw TypeError("Bad Promise constructor");h=d,v=o}),this.resolve=p(h),this.reject=p(v)};M.exports.f=function(l){return new g(l)}},{"../internals/a-callable":95}],194:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/is-regexp"),l=p.TypeError;M.exports=function(h){if(g(h))throw l("The method doesn't accept regular expressions");return h}},{"../internals/global":163,"../internals/is-regexp":182}],195:[function(i,M,E){"use strict";var p=i("../internals/descriptors"),g=i("../internals/function-uncurry-this"),l=i("../internals/function-call"),h=i("../internals/fails"),v=i("../internals/object-keys"),d=i("../internals/object-get-own-property-symbols"),o=i("../internals/object-property-is-enumerable"),s=i("../internals/to-object"),u=i("../internals/indexed-object"),m=Object.assign,y=Object.defineProperty,_=g([].concat);M.exports=!m||h(function(){if(p&&m({b:1},m(y({},"a",{enumerable:!0,get:function(){y(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var x={},S={},w=Symbol(),A="abcdefghijklmnopqrst";return x[w]=7,A.split("").forEach(function(H){S[H]=H}),m({},x)[w]!=7||v(m({},S)).join("")!=A})?function(S,w){for(var A=s(S),H=arguments.length,R=1,F=d.f,D=o.f;H>R;)for(var B=u(arguments[R++]),P=F?_(v(B),F(B)):v(B),U=P.length,G=0,ee;U>G;)ee=P[G++],(!p||l(D,B,ee))&&(A[ee]=B[ee]);return A}:m},{"../internals/descriptors":134,"../internals/fails":150,"../internals/function-call":155,"../internals/function-uncurry-this":157,"../internals/indexed-object":170,"../internals/object-get-own-property-symbols":202,"../internals/object-keys":206,"../internals/object-property-is-enumerable":207,"../internals/to-object":250}],196:[function(i,M,E){var p=i("../internals/an-object"),g=i("../internals/object-define-properties"),l=i("../internals/enum-bug-keys"),h=i("../internals/hidden-keys"),v=i("../internals/html"),d=i("../internals/document-create-element"),o=i("../internals/shared-key"),s=">",u="<",m="prototype",y="script",_=o("IE_PROTO"),x=function(){},S=function(F){return u+y+s+F+u+"/"+y+s},w=function(F){F.write(S("")),F.close();var D=F.parentWindow.Object;return F=null,D},A=function(){var F=d("iframe"),D="java"+y+":",B;return F.style.display="none",v.appendChild(F),F.src=String(D),B=F.contentWindow.document,B.open(),B.write(S("document.F=Object")),B.close(),B.F},H,R=function(){try{H=new ActiveXObject("htmlfile")}catch(D){}R=typeof document!="undefined"?document.domain&&H?w(H):A():w(H);for(var F=l.length;F--;)delete R[m][l[F]];return R()};h[_]=!0,M.exports=Object.create||function(D,B){var P;return D!==null?(x[m]=p(D),P=new x,x[m]=null,P[_]=D):P=R(),B===void 0?P:g.f(P,B)}},{"../internals/an-object":101,"../internals/document-create-element":135,"../internals/enum-bug-keys":148,"../internals/hidden-keys":165,"../internals/html":167,"../internals/object-define-properties":197,"../internals/shared-key":235}],197:[function(i,M,E){var p=i("../internals/descriptors"),g=i("../internals/v8-prototype-define-bug"),l=i("../internals/object-define-property"),h=i("../internals/an-object"),v=i("../internals/to-indexed-object"),d=i("../internals/object-keys");E.f=p&&!g?Object.defineProperties:function(s,u){h(s);for(var m=v(u),y=d(u),_=y.length,x=0,S;_>x;)l.f(s,S=y[x++],m[S]);return s}},{"../internals/an-object":101,"../internals/descriptors":134,"../internals/object-define-property":198,"../internals/object-keys":206,"../internals/to-indexed-object":247,"../internals/v8-prototype-define-bug":265}],198:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/descriptors"),l=i("../internals/ie8-dom-define"),h=i("../internals/v8-prototype-define-bug"),v=i("../internals/an-object"),d=i("../internals/to-property-key"),o=p.TypeError,s=Object.defineProperty,u=Object.getOwnPropertyDescriptor,m="enumerable",y="configurable",_="writable";E.f=g?h?function(S,w,A){if(v(S),w=d(w),v(A),typeof S=="function"&&w==="prototype"&&"value"in A&&_ in A&&!A[_]){var H=u(S,w);H&&H[_]&&(S[w]=A.value,A={configurable:y in A?A[y]:H[y],enumerable:m in A?A[m]:H[m],writable:!1})}return s(S,w,A)}:s:function(S,w,A){if(v(S),w=d(w),v(A),l)try{return s(S,w,A)}catch(H){}if("get"in A||"set"in A)throw o("Accessors not supported");return"value"in A&&(S[w]=A.value),S}},{"../internals/an-object":101,"../internals/descriptors":134,"../internals/global":163,"../internals/ie8-dom-define":168,"../internals/to-property-key":254,"../internals/v8-prototype-define-bug":265}],199:[function(i,M,E){var p=i("../internals/descriptors"),g=i("../internals/function-call"),l=i("../internals/object-property-is-enumerable"),h=i("../internals/create-property-descriptor"),v=i("../internals/to-indexed-object"),d=i("../internals/to-property-key"),o=i("../internals/has-own-property"),s=i("../internals/ie8-dom-define"),u=Object.getOwnPropertyDescriptor;E.f=p?u:function(y,_){if(y=v(y),_=d(_),s)try{return u(y,_)}catch(x){}if(o(y,_))return h(!g(l.f,y,_),y[_])}},{"../internals/create-property-descriptor":130,"../internals/descriptors":134,"../internals/function-call":155,"../internals/has-own-property":164,"../internals/ie8-dom-define":168,"../internals/object-property-is-enumerable":207,"../internals/to-indexed-object":247,"../internals/to-property-key":254}],200:[function(i,M,E){var p=i("../internals/classof-raw"),g=i("../internals/to-indexed-object"),l=i("../internals/object-get-own-property-names").f,h=i("../internals/array-slice-simple"),v=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],d=function(o){try{return l(o)}catch(s){return h(v)}};M.exports.f=function(s){return v&&p(s)=="Window"?d(s):l(g(s))}},{"../internals/array-slice-simple":116,"../internals/classof-raw":123,"../internals/object-get-own-property-names":201,"../internals/to-indexed-object":247}],201:[function(i,M,E){var p=i("../internals/object-keys-internal"),g=i("../internals/enum-bug-keys"),l=g.concat("length","prototype");E.f=Object.getOwnPropertyNames||function(v){return p(v,l)}},{"../internals/enum-bug-keys":148,"../internals/object-keys-internal":205}],202:[function(i,M,E){E.f=Object.getOwnPropertySymbols},{}],203:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/has-own-property"),l=i("../internals/is-callable"),h=i("../internals/to-object"),v=i("../internals/shared-key"),d=i("../internals/correct-prototype-getter"),o=v("IE_PROTO"),s=p.Object,u=s.prototype;M.exports=d?s.getPrototypeOf:function(m){var y=h(m);if(g(y,o))return y[o];var _=y.constructor;return l(_)&&y instanceof _?_.prototype:y instanceof s?u:null}},{"../internals/correct-prototype-getter":127,"../internals/global":163,"../internals/has-own-property":164,"../internals/is-callable":176,"../internals/shared-key":235,"../internals/to-object":250}],204:[function(i,M,E){var p=i("../internals/function-uncurry-this");M.exports=p({}.isPrototypeOf)},{"../internals/function-uncurry-this":157}],205:[function(i,M,E){var p=i("../internals/function-uncurry-this"),g=i("../internals/has-own-property"),l=i("../internals/to-indexed-object"),h=i("../internals/array-includes").indexOf,v=i("../internals/hidden-keys"),d=p([].push);M.exports=function(o,s){var u=l(o),m=0,y=[],_;for(_ in u)!g(v,_)&&g(u,_)&&d(y,_);for(;s.length>m;)g(u,_=s[m++])&&(~h(y,_)||d(y,_));return y}},{"../internals/array-includes":110,"../internals/function-uncurry-this":157,"../internals/has-own-property":164,"../internals/hidden-keys":165,"../internals/to-indexed-object":247}],206:[function(i,M,E){var p=i("../internals/object-keys-internal"),g=i("../internals/enum-bug-keys");M.exports=Object.keys||function(h){return p(h,g)}},{"../internals/enum-bug-keys":148,"../internals/object-keys-internal":205}],207:[function(i,M,E){"use strict";var p={}.propertyIsEnumerable,g=Object.getOwnPropertyDescriptor,l=g&&!p.call({1:2},1);E.f=l?function(v){var d=g(this,v);return!!d&&d.enumerable}:p},{}],208:[function(i,M,E){var p=i("../internals/function-uncurry-this"),g=i("../internals/an-object"),l=i("../internals/a-possible-prototype");M.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var h=!1,v={},d;try{d=p(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set),d(v,[]),h=v instanceof Array}catch(o){}return function(s,u){return g(s),l(u),h?d(s,u):s.__proto__=u,s}}():void 0)},{"../internals/a-possible-prototype":97,"../internals/an-object":101,"../internals/function-uncurry-this":157}],209:[function(i,M,E){var p=i("../internals/descriptors"),g=i("../internals/function-uncurry-this"),l=i("../internals/object-keys"),h=i("../internals/to-indexed-object"),v=i("../internals/object-property-is-enumerable").f,d=g(v),o=g([].push),s=function(u){return function(m){for(var y=h(m),_=l(y),x=_.length,S=0,w=[],A;x>S;)A=_[S++],(!p||d(y,A))&&o(w,u?[A,y[A]]:y[A]);return w}};M.exports={entries:s(!0),values:s(!1)}},{"../internals/descriptors":134,"../internals/function-uncurry-this":157,"../internals/object-keys":206,"../internals/object-property-is-enumerable":207,"../internals/to-indexed-object":247}],210:[function(i,M,E){"use strict";var p=i("../internals/to-string-tag-support"),g=i("../internals/classof");M.exports=p?{}.toString:function(){return"[object "+g(this)+"]"}},{"../internals/classof":124,"../internals/to-string-tag-support":255}],211:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/function-call"),l=i("../internals/is-callable"),h=i("../internals/is-object"),v=p.TypeError;M.exports=function(d,o){var s,u;if(o==="string"&&l(s=d.toString)&&!h(u=g(s,d))||l(s=d.valueOf)&&!h(u=g(s,d))||o!=="string"&&l(s=d.toString)&&!h(u=g(s,d)))return u;throw v("Can't convert object to primitive value")}},{"../internals/function-call":155,"../internals/global":163,"../internals/is-callable":176,"../internals/is-object":180}],212:[function(i,M,E){var p=i("../internals/get-built-in"),g=i("../internals/function-uncurry-this"),l=i("../internals/object-get-own-property-names"),h=i("../internals/object-get-own-property-symbols"),v=i("../internals/an-object"),d=g([].concat);M.exports=p("Reflect","ownKeys")||function(s){var u=l.f(v(s)),m=h.f;return m?d(u,m(s)):u}},{"../internals/an-object":101,"../internals/function-uncurry-this":157,"../internals/get-built-in":158,"../internals/object-get-own-property-names":201,"../internals/object-get-own-property-symbols":202}],213:[function(i,M,E){var p=i("../internals/global");M.exports=p},{"../internals/global":163}],214:[function(i,M,E){M.exports=function(p){try{return{error:!1,value:p()}}catch(g){return{error:!0,value:g}}}},{}],215:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/promise-native-constructor"),l=i("../internals/is-callable"),h=i("../internals/is-forced"),v=i("../internals/inspect-source"),d=i("../internals/well-known-symbol"),o=i("../internals/engine-is-browser"),s=i("../internals/is-pure"),u=i("../internals/engine-v8-version"),m=g&&g.prototype,y=d("species"),_=!1,x=l(p.PromiseRejectionEvent),S=h("Promise",function(){var w=v(g),A=w!==String(g);if(!A&&u===66||s&&!(m.catch&&m.finally))return!0;if(u>=51&&/native code/.test(w))return!1;var H=new g(function(D){D(1)}),R=function(D){D(function(){},function(){})},F=H.constructor={};return F[y]=R,_=H.then(function(){})instanceof R,_?!A&&o&&!x:!0});M.exports={CONSTRUCTOR:S,REJECTION_EVENT:x,SUBCLASSING:_}},{"../internals/engine-is-browser":139,"../internals/engine-v8-version":146,"../internals/global":163,"../internals/inspect-source":172,"../internals/is-callable":176,"../internals/is-forced":178,"../internals/is-pure":181,"../internals/promise-native-constructor":216,"../internals/well-known-symbol":268}],216:[function(i,M,E){var p=i("../internals/global");M.exports=p.Promise},{"../internals/global":163}],217:[function(i,M,E){var p=i("../internals/an-object"),g=i("../internals/is-object"),l=i("../internals/new-promise-capability");M.exports=function(h,v){if(p(h),g(v)&&v.constructor===h)return v;var d=l.f(h),o=d.resolve;return o(v),d.promise}},{"../internals/an-object":101,"../internals/is-object":180,"../internals/new-promise-capability":193}],218:[function(i,M,E){var p=i("../internals/promise-native-constructor"),g=i("../internals/check-correctness-of-iteration"),l=i("../internals/promise-constructor-detection").CONSTRUCTOR;M.exports=l||!g(function(h){p.all(h).then(void 0,function(){})})},{"../internals/check-correctness-of-iteration":122,"../internals/promise-constructor-detection":215,"../internals/promise-native-constructor":216}],219:[function(i,M,E){var p=i("../internals/object-define-property").f;M.exports=function(g,l,h){h in g||p(g,h,{configurable:!0,get:function(){return l[h]},set:function(v){l[h]=v}})}},{"../internals/object-define-property":198}],220:[function(i,M,E){var p=function(){this.head=null,this.tail=null};p.prototype={add:function(g){var l={item:g,next:null};this.head?this.tail.next=l:this.head=l,this.tail=l},get:function(){var g=this.head;if(g)return this.head=g.next,this.tail===g&&(this.tail=null),g.item}},M.exports=p},{}],221:[function(i,M,E){var p=i("../internals/redefine");M.exports=function(g,l,h){for(var v in l)p(g,v,l[v],h);return g}},{"../internals/redefine":222}],222:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/is-callable"),l=i("../internals/has-own-property"),h=i("../internals/create-non-enumerable-property"),v=i("../internals/set-global"),d=i("../internals/inspect-source"),o=i("../internals/internal-state"),s=i("../internals/function-name").CONFIGURABLE,u=o.get,m=o.enforce,y=String(String).split("String");(M.exports=function(_,x,S,w){var A=w?!!w.unsafe:!1,H=w?!!w.enumerable:!1,R=w?!!w.noTargetGet:!1,F=w&&w.name!==void 0?w.name:x,D;if(g(S)&&(String(F).slice(0,7)==="Symbol("&&(F="["+String(F).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!l(S,"name")||s&&S.name!==F)&&h(S,"name",F),D=m(S),D.source||(D.source=y.join(typeof F=="string"?F:""))),_===p){H?_[x]=S:v(x,S);return}else A?!R&&_[x]&&(H=!0):delete _[x];H?_[x]=S:h(_,x,S)})(Function.prototype,"toString",function(){return g(this)&&u(this).source||d(this)})},{"../internals/create-non-enumerable-property":129,"../internals/function-name":156,"../internals/global":163,"../internals/has-own-property":164,"../internals/inspect-source":172,"../internals/internal-state":173,"../internals/is-callable":176,"../internals/set-global":232}],223:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/function-call"),l=i("../internals/an-object"),h=i("../internals/is-callable"),v=i("../internals/classof-raw"),d=i("../internals/regexp-exec"),o=p.TypeError;M.exports=function(s,u){var m=s.exec;if(h(m)){var y=g(m,s,u);return y!==null&&l(y),y}if(v(s)==="RegExp")return g(d,s,u);throw o("RegExp#exec called on incompatible receiver")}},{"../internals/an-object":101,"../internals/classof-raw":123,"../internals/function-call":155,"../internals/global":163,"../internals/is-callable":176,"../internals/regexp-exec":224}],224:[function(i,M,E){"use strict";var p=i("../internals/function-call"),g=i("../internals/function-uncurry-this"),l=i("../internals/to-string"),h=i("../internals/regexp-flags"),v=i("../internals/regexp-sticky-helpers"),d=i("../internals/shared"),o=i("../internals/object-create"),s=i("../internals/internal-state").get,u=i("../internals/regexp-unsupported-dot-all"),m=i("../internals/regexp-unsupported-ncg"),y=d("native-string-replace",String.prototype.replace),_=RegExp.prototype.exec,x=_,S=g("".charAt),w=g("".indexOf),A=g("".replace),H=g("".slice),R=function(){var P=/a/,U=/b*/g;return p(_,P,"a"),p(_,U,"a"),P.lastIndex!==0||U.lastIndex!==0}(),F=v.BROKEN_CARET,D=/()??/.exec("")[1]!==void 0,B=R||D||F||u||m;B&&(x=function(U){var G=this,ee=s(G),K=l(U),Z=ee.raw,$,oe,ae,ye,Y,le,xe;if(Z)return Z.lastIndex=G.lastIndex,$=p(x,Z,K),G.lastIndex=Z.lastIndex,$;var Ce=ee.groups,we=F&&G.sticky,Le=p(h,G),de=G.source,be=0,Te=K;if(we&&(Le=A(Le,"y",""),w(Le,"g")===-1&&(Le+="g"),Te=H(K,G.lastIndex),G.lastIndex>0&&(!G.multiline||G.multiline&&S(K,G.lastIndex-1)!==`
`)&&(de="(?: "+de+")",Te=" "+Te,be++),oe=new RegExp("^(?:"+de+")",Le)),D&&(oe=new RegExp("^"+de+"$(?!\\s)",Le)),R&&(ae=G.lastIndex),ye=p(_,we?oe:G,Te),we?ye?(ye.input=H(ye.input,be),ye[0]=H(ye[0],be),ye.index=G.lastIndex,G.lastIndex+=ye[0].length):G.lastIndex=0:R&&ye&&(G.lastIndex=G.global?ye.index+ye[0].length:ae),D&&ye&&ye.length>1&&p(y,ye[0],oe,function(){for(Y=1;Y<arguments.length-2;Y++)arguments[Y]===void 0&&(ye[Y]=void 0)}),ye&&Ce)for(ye.groups=le=o(null),Y=0;Y<Ce.length;Y++)xe=Ce[Y],le[xe[0]]=ye[xe[1]];return ye}),M.exports=x},{"../internals/function-call":155,"../internals/function-uncurry-this":157,"../internals/internal-state":173,"../internals/object-create":196,"../internals/regexp-flags":225,"../internals/regexp-sticky-helpers":227,"../internals/regexp-unsupported-dot-all":228,"../internals/regexp-unsupported-ncg":229,"../internals/shared":237,"../internals/to-string":256}],225:[function(i,M,E){"use strict";var p=i("../internals/an-object");M.exports=function(){var g=p(this),l="";return g.hasIndices&&(l+="d"),g.global&&(l+="g"),g.ignoreCase&&(l+="i"),g.multiline&&(l+="m"),g.dotAll&&(l+="s"),g.unicode&&(l+="u"),g.sticky&&(l+="y"),l}},{"../internals/an-object":101}],226:[function(i,M,E){var p=i("../internals/function-call"),g=i("../internals/has-own-property"),l=i("../internals/object-is-prototype-of"),h=i("../internals/regexp-flags"),v=RegExp.prototype;M.exports=function(d){var o=d.flags;return o===void 0&&!("flags"in v)&&!g(d,"flags")&&l(v,d)?p(h,d):o}},{"../internals/function-call":155,"../internals/has-own-property":164,"../internals/object-is-prototype-of":204,"../internals/regexp-flags":225}],227:[function(i,M,E){var p=i("../internals/fails"),g=i("../internals/global"),l=g.RegExp,h=p(function(){var o=l("a","y");return o.lastIndex=2,o.exec("abcd")!=null}),v=h||p(function(){return!l("a","y").sticky}),d=h||p(function(){var o=l("^r","gy");return o.lastIndex=2,o.exec("str")!=null});M.exports={BROKEN_CARET:d,MISSED_STICKY:v,UNSUPPORTED_Y:h}},{"../internals/fails":150,"../internals/global":163}],228:[function(i,M,E){var p=i("../internals/fails"),g=i("../internals/global"),l=g.RegExp;M.exports=p(function(){var h=l(".","s");return!(h.dotAll&&h.exec(`
`)&&h.flags==="s")})},{"../internals/fails":150,"../internals/global":163}],229:[function(i,M,E){var p=i("../internals/fails"),g=i("../internals/global"),l=g.RegExp;M.exports=p(function(){var h=l("(?<a>b)","g");return h.exec("b").groups.a!=="b"||"b".replace(h,"$<a>c")!=="bc"})},{"../internals/fails":150,"../internals/global":163}],230:[function(i,M,E){var p=i("../internals/global"),g=p.TypeError;M.exports=function(l){if(l==null)throw g("Can't call method on "+l);return l}},{"../internals/global":163}],231:[function(i,M,E){M.exports=Object.is||function(g,l){return g===l?g!==0||1/g===1/l:g!=g&&l!=l}},{}],232:[function(i,M,E){var p=i("../internals/global"),g=Object.defineProperty;M.exports=function(l,h){try{g(p,l,{value:h,configurable:!0,writable:!0})}catch(v){p[l]=h}return h}},{"../internals/global":163}],233:[function(i,M,E){"use strict";var p=i("../internals/get-built-in"),g=i("../internals/object-define-property"),l=i("../internals/well-known-symbol"),h=i("../internals/descriptors"),v=l("species");M.exports=function(d){var o=p(d),s=g.f;h&&o&&!o[v]&&s(o,v,{configurable:!0,get:function(){return this}})}},{"../internals/descriptors":134,"../internals/get-built-in":158,"../internals/object-define-property":198,"../internals/well-known-symbol":268}],234:[function(i,M,E){var p=i("../internals/object-define-property").f,g=i("../internals/has-own-property"),l=i("../internals/well-known-symbol"),h=l("toStringTag");M.exports=function(v,d,o){v&&!o&&(v=v.prototype),v&&!g(v,h)&&p(v,h,{configurable:!0,value:d})}},{"../internals/has-own-property":164,"../internals/object-define-property":198,"../internals/well-known-symbol":268}],235:[function(i,M,E){var p=i("../internals/shared"),g=i("../internals/uid"),l=p("keys");M.exports=function(h){return l[h]||(l[h]=g(h))}},{"../internals/shared":237,"../internals/uid":263}],236:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/set-global"),l="__core-js_shared__",h=p[l]||g(l,{});M.exports=h},{"../internals/global":163,"../internals/set-global":232}],237:[function(i,M,E){var p=i("../internals/is-pure"),g=i("../internals/shared-store");(M.exports=function(l,h){return g[l]||(g[l]=h!==void 0?h:{})})("versions",[]).push({version:"3.22.1",mode:p?"pure":"global",copyright:"\xA9 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.22.1/LICENSE",source:"https://github.com/zloirock/core-js"})},{"../internals/is-pure":181,"../internals/shared-store":236}],238:[function(i,M,E){var p=i("../internals/an-object"),g=i("../internals/a-constructor"),l=i("../internals/well-known-symbol"),h=l("species");M.exports=function(v,d){var o=p(v).constructor,s;return o===void 0||(s=p(o)[h])==null?d:g(s)}},{"../internals/a-constructor":96,"../internals/an-object":101,"../internals/well-known-symbol":268}],239:[function(i,M,E){var p=i("../internals/function-uncurry-this"),g=i("../internals/to-integer-or-infinity"),l=i("../internals/to-string"),h=i("../internals/require-object-coercible"),v=p("".charAt),d=p("".charCodeAt),o=p("".slice),s=function(u){return function(m,y){var _=l(h(m)),x=g(y),S=_.length,w,A;return x<0||x>=S?u?"":void 0:(w=d(_,x),w<55296||w>56319||x+1===S||(A=d(_,x+1))<56320||A>57343?u?v(_,x):w:u?o(_,x,x+2):(w-55296<<10)+(A-56320)+65536)}};M.exports={codeAt:s(!1),charAt:s(!0)}},{"../internals/function-uncurry-this":157,"../internals/require-object-coercible":230,"../internals/to-integer-or-infinity":248,"../internals/to-string":256}],240:[function(i,M,E){var p=i("../internals/function-name").PROPER,g=i("../internals/fails"),l=i("../internals/whitespaces"),h="\u200B\x85\u180E";M.exports=function(v){return g(function(){return!!l[v]()||h[v]()!==h||p&&l[v].name!==v})}},{"../internals/fails":150,"../internals/function-name":156,"../internals/whitespaces":269}],241:[function(i,M,E){var p=i("../internals/function-uncurry-this"),g=i("../internals/require-object-coercible"),l=i("../internals/to-string"),h=i("../internals/whitespaces"),v=p("".replace),d="["+h+"]",o=RegExp("^"+d+d+"*"),s=RegExp(d+d+"*$"),u=function(m){return function(y){var _=l(g(y));return m&1&&(_=v(_,o,"")),m&2&&(_=v(_,s,"")),_}};M.exports={start:u(1),end:u(2),trim:u(3)}},{"../internals/function-uncurry-this":157,"../internals/require-object-coercible":230,"../internals/to-string":256,"../internals/whitespaces":269}],242:[function(i,M,E){var p=i("../internals/function-call"),g=i("../internals/get-built-in"),l=i("../internals/well-known-symbol"),h=i("../internals/redefine");M.exports=function(){var v=g("Symbol"),d=v&&v.prototype,o=d&&d.valueOf,s=l("toPrimitive");d&&!d[s]&&h(d,s,function(u){return p(o,this)})}},{"../internals/function-call":155,"../internals/get-built-in":158,"../internals/redefine":222,"../internals/well-known-symbol":268}],243:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/function-apply"),l=i("../internals/function-bind-context"),h=i("../internals/is-callable"),v=i("../internals/has-own-property"),d=i("../internals/fails"),o=i("../internals/html"),s=i("../internals/array-slice"),u=i("../internals/document-create-element"),m=i("../internals/validate-arguments-length"),y=i("../internals/engine-is-ios"),_=i("../internals/engine-is-node"),x=p.setImmediate,S=p.clearImmediate,w=p.process,A=p.Dispatch,H=p.Function,R=p.MessageChannel,F=p.String,D=0,B={},P="onreadystatechange",U,G,ee,K;try{U=p.location}catch(ye){}var Z=function(ye){if(v(B,ye)){var Y=B[ye];delete B[ye],Y()}},$=function(ye){return function(){Z(ye)}},oe=function(ye){Z(ye.data)},ae=function(ye){p.postMessage(F(ye),U.protocol+"//"+U.host)};(!x||!S)&&(x=function(Y){m(arguments.length,1);var le=h(Y)?Y:H(Y),xe=s(arguments,1);return B[++D]=function(){g(le,void 0,xe)},G(D),D},S=function(Y){delete B[Y]},_?G=function(ye){w.nextTick($(ye))}:A&&A.now?G=function(ye){A.now($(ye))}:R&&!y?(ee=new R,K=ee.port2,ee.port1.onmessage=oe,G=l(K.postMessage,K)):p.addEventListener&&h(p.postMessage)&&!p.importScripts&&U&&U.protocol!=="file:"&&!d(ae)?(G=ae,p.addEventListener("message",oe,!1)):P in u("script")?G=function(ye){o.appendChild(u("script"))[P]=function(){o.removeChild(this),Z(ye)}}:G=function(ye){setTimeout($(ye),0)}),M.exports={set:x,clear:S}},{"../internals/array-slice":117,"../internals/document-create-element":135,"../internals/engine-is-ios":142,"../internals/engine-is-node":143,"../internals/fails":150,"../internals/function-apply":152,"../internals/function-bind-context":153,"../internals/global":163,"../internals/has-own-property":164,"../internals/html":167,"../internals/is-callable":176,"../internals/validate-arguments-length":266}],244:[function(i,M,E){var p=i("../internals/function-uncurry-this");M.exports=p(1 .valueOf)},{"../internals/function-uncurry-this":157}],245:[function(i,M,E){var p=i("../internals/to-integer-or-infinity"),g=Math.max,l=Math.min;M.exports=function(h,v){var d=p(h);return d<0?g(d+v,0):l(d,v)}},{"../internals/to-integer-or-infinity":248}],246:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/to-integer-or-infinity"),l=i("../internals/to-length"),h=p.RangeError;M.exports=function(v){if(v===void 0)return 0;var d=g(v),o=l(d);if(d!==o)throw h("Wrong length or index");return o}},{"../internals/global":163,"../internals/to-integer-or-infinity":248,"../internals/to-length":249}],247:[function(i,M,E){var p=i("../internals/indexed-object"),g=i("../internals/require-object-coercible");M.exports=function(l){return p(g(l))}},{"../internals/indexed-object":170,"../internals/require-object-coercible":230}],248:[function(i,M,E){var p=Math.ceil,g=Math.floor;M.exports=function(l){var h=+l;return h!==h||h===0?0:(h>0?g:p)(h)}},{}],249:[function(i,M,E){var p=i("../internals/to-integer-or-infinity"),g=Math.min;M.exports=function(l){return l>0?g(p(l),9007199254740991):0}},{"../internals/to-integer-or-infinity":248}],250:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/require-object-coercible"),l=p.Object;M.exports=function(h){return l(g(h))}},{"../internals/global":163,"../internals/require-object-coercible":230}],251:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/to-positive-integer"),l=p.RangeError;M.exports=function(h,v){var d=g(h);if(d%v)throw l("Wrong offset");return d}},{"../internals/global":163,"../internals/to-positive-integer":252}],252:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/to-integer-or-infinity"),l=p.RangeError;M.exports=function(h){var v=g(h);if(v<0)throw l("The argument can't be less than 0");return v}},{"../internals/global":163,"../internals/to-integer-or-infinity":248}],253:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/function-call"),l=i("../internals/is-object"),h=i("../internals/is-symbol"),v=i("../internals/get-method"),d=i("../internals/ordinary-to-primitive"),o=i("../internals/well-known-symbol"),s=p.TypeError,u=o("toPrimitive");M.exports=function(m,y){if(!l(m)||h(m))return m;var _=v(m,u),x;if(_){if(y===void 0&&(y="default"),x=g(_,m,y),!l(x)||h(x))return x;throw s("Can't convert object to primitive value")}return y===void 0&&(y="number"),d(m,y)}},{"../internals/function-call":155,"../internals/get-method":161,"../internals/global":163,"../internals/is-object":180,"../internals/is-symbol":183,"../internals/ordinary-to-primitive":211,"../internals/well-known-symbol":268}],254:[function(i,M,E){var p=i("../internals/to-primitive"),g=i("../internals/is-symbol");M.exports=function(l){var h=p(l,"string");return g(h)?h:h+""}},{"../internals/is-symbol":183,"../internals/to-primitive":253}],255:[function(i,M,E){var p=i("../internals/well-known-symbol"),g=p("toStringTag"),l={};l[g]="z",M.exports=String(l)==="[object z]"},{"../internals/well-known-symbol":268}],256:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/classof"),l=p.String;M.exports=function(h){if(g(h)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return l(h)}},{"../internals/classof":124,"../internals/global":163}],257:[function(i,M,E){var p=i("../internals/global"),g=p.String;M.exports=function(l){try{return g(l)}catch(h){return"Object"}}},{"../internals/global":163}],258:[function(i,M,E){"use strict";var p=i("../internals/export"),g=i("../internals/global"),l=i("../internals/function-call"),h=i("../internals/descriptors"),v=i("../internals/typed-array-constructors-require-wrappers"),d=i("../internals/array-buffer-view-core"),o=i("../internals/array-buffer"),s=i("../internals/an-instance"),u=i("../internals/create-property-descriptor"),m=i("../internals/create-non-enumerable-property"),y=i("../internals/is-integral-number"),_=i("../internals/to-length"),x=i("../internals/to-index"),S=i("../internals/to-offset"),w=i("../internals/to-property-key"),A=i("../internals/has-own-property"),H=i("../internals/classof"),R=i("../internals/is-object"),F=i("../internals/is-symbol"),D=i("../internals/object-create"),B=i("../internals/object-is-prototype-of"),P=i("../internals/object-set-prototype-of"),U=i("../internals/object-get-own-property-names").f,G=i("../internals/typed-array-from"),ee=i("../internals/array-iteration").forEach,K=i("../internals/set-species"),Z=i("../internals/object-define-property"),$=i("../internals/object-get-own-property-descriptor"),oe=i("../internals/internal-state"),ae=i("../internals/inherit-if-required"),ye=oe.get,Y=oe.set,le=Z.f,xe=$.f,Ce=Math.round,we=g.RangeError,Le=o.ArrayBuffer,de=Le.prototype,be=o.DataView,Te=d.NATIVE_ARRAY_BUFFER_VIEWS,Ae=d.TYPED_ARRAY_CONSTRUCTOR,Be=d.TYPED_ARRAY_TAG,Pe=d.TypedArray,_e=d.TypedArrayPrototype,ne=d.aTypedArrayConstructor,te=d.isTypedArray,T="BYTES_PER_ELEMENT",I="Wrong length",re=function(ge,Me){ne(ge);for(var Fe=0,Re=Me.length,$e=new ge(Re);Re>Fe;)$e[Fe]=Me[Fe++];return $e},q=function(ge,Me){le(ge,Me,{get:function(){return ye(this)[Me]}})},z=function(ge){var Me;return B(de,ge)||(Me=H(ge))=="ArrayBuffer"||Me=="SharedArrayBuffer"},W=function(ge,Me){return te(ge)&&!F(Me)&&Me in ge&&y(+Me)&&Me>=0},V=function(Me,Fe){return Fe=w(Fe),W(Me,Fe)?u(2,Me[Fe]):xe(Me,Fe)},se=function(Me,Fe,Re){return Fe=w(Fe),W(Me,Fe)&&R(Re)&&A(Re,"value")&&!A(Re,"get")&&!A(Re,"set")&&!Re.configurable&&(!A(Re,"writable")||Re.writable)&&(!A(Re,"enumerable")||Re.enumerable)?(Me[Fe]=Re.value,Me):le(Me,Fe,Re)};h?(Te||($.f=V,Z.f=se,q(_e,"buffer"),q(_e,"byteOffset"),q(_e,"byteLength"),q(_e,"length")),p({target:"Object",stat:!0,forced:!Te},{getOwnPropertyDescriptor:V,defineProperty:se}),M.exports=function(ge,Me,Fe){var Re=ge.match(/\d+$/)[0]/8,$e=ge+(Fe?"Clamped":"")+"Array",lt="get"+ge,Ne="set"+ge,Ze=g[$e],We=Ze,nt=We&&We.prototype,qe={},Qe=function(bt,Tt){var kr=ye(bt);return kr.view[lt](Tt*Re+kr.byteOffset,!0)},ft=function(bt,Tt,kr){var jr=ye(bt);Fe&&(kr=(kr=Ce(kr))<0?0:kr>255?255:kr&255),jr.view[Ne](Tt*Re+jr.byteOffset,kr,!0)},vt=function(bt,Tt){le(bt,Tt,{get:function(){return Qe(this,Tt)},set:function(kr){return ft(this,Tt,kr)},enumerable:!0})};Te?v&&(We=Me(function(bt,Tt,kr,jr){return s(bt,nt),ae(function(){return R(Tt)?z(Tt)?jr!==void 0?new Ze(Tt,S(kr,Re),jr):kr!==void 0?new Ze(Tt,S(kr,Re)):new Ze(Tt):te(Tt)?re(We,Tt):l(G,We,Tt):new Ze(x(Tt))}(),bt,We)}),P&&P(We,Pe),ee(U(Ze),function(bt){bt in We||m(We,bt,Ze[bt])}),We.prototype=nt):(We=Me(function(bt,Tt,kr,jr){s(bt,nt);var xn=0,on=0,er,In,ji;if(!R(Tt))ji=x(Tt),In=ji*Re,er=new Le(In);else if(z(Tt)){er=Tt,on=S(kr,Re);var Gi=Tt.byteLength;if(jr===void 0){if(Gi%Re||(In=Gi-on,In<0))throw we(I)}else if(In=_(jr)*Re,In+on>Gi)throw we(I);ji=In/Re}else return te(Tt)?re(We,Tt):l(G,We,Tt);for(Y(bt,{buffer:er,byteOffset:on,byteLength:In,length:ji,view:new be(er)});xn<ji;)vt(bt,xn++)}),P&&P(We,Pe),nt=We.prototype=D(_e)),nt.constructor!==We&&m(nt,"constructor",We),m(nt,Ae,We),Be&&m(nt,Be,$e),qe[$e]=We,p({global:!0,forced:We!=Ze,sham:!Te},qe),T in We||m(We,T,Re),T in nt||m(nt,T,Re),K($e)}):M.exports=function(){}},{"../internals/an-instance":100,"../internals/array-buffer":104,"../internals/array-buffer-view-core":103,"../internals/array-iteration":111,"../internals/classof":124,"../internals/create-non-enumerable-property":129,"../internals/create-property-descriptor":130,"../internals/descriptors":134,"../internals/export":149,"../internals/function-call":155,"../internals/global":163,"../internals/has-own-property":164,"../internals/inherit-if-required":171,"../internals/internal-state":173,"../internals/is-integral-number":179,"../internals/is-object":180,"../internals/is-symbol":183,"../internals/object-create":196,"../internals/object-define-property":198,"../internals/object-get-own-property-descriptor":199,"../internals/object-get-own-property-names":201,"../internals/object-is-prototype-of":204,"../internals/object-set-prototype-of":208,"../internals/set-species":233,"../internals/to-index":246,"../internals/to-length":249,"../internals/to-offset":251,"../internals/to-property-key":254,"../internals/typed-array-constructors-require-wrappers":259,"../internals/typed-array-from":261}],259:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/fails"),l=i("../internals/check-correctness-of-iteration"),h=i("../internals/array-buffer-view-core").NATIVE_ARRAY_BUFFER_VIEWS,v=p.ArrayBuffer,d=p.Int8Array;M.exports=!h||!g(function(){d(1)})||!g(function(){new d(-1)})||!l(function(o){new d,new d(null),new d(1.5),new d(o)},!0)||g(function(){return new d(new v(2),1,void 0).length!==1})},{"../internals/array-buffer-view-core":103,"../internals/check-correctness-of-iteration":122,"../internals/fails":150,"../internals/global":163}],260:[function(i,M,E){var p=i("../internals/array-from-constructor-and-list"),g=i("../internals/typed-array-species-constructor");M.exports=function(l,h){return p(g(l),h)}},{"../internals/array-from-constructor-and-list":108,"../internals/typed-array-species-constructor":262}],261:[function(i,M,E){var p=i("../internals/function-bind-context"),g=i("../internals/function-call"),l=i("../internals/a-constructor"),h=i("../internals/to-object"),v=i("../internals/length-of-array-like"),d=i("../internals/get-iterator"),o=i("../internals/get-iterator-method"),s=i("../internals/is-array-iterator-method"),u=i("../internals/array-buffer-view-core").aTypedArrayConstructor;M.exports=function(y){var _=l(this),x=h(y),S=arguments.length,w=S>1?arguments[1]:void 0,A=w!==void 0,H=o(x),R,F,D,B,P,U;if(H&&!s(H))for(P=d(x,H),U=P.next,x=[];!(B=g(U,P)).done;)x.push(B.value);for(A&&S>2&&(w=p(w,arguments[2])),F=v(x),D=new(u(_))(F),R=0;F>R;R++)D[R]=A?w(x[R],R):x[R];return D}},{"../internals/a-constructor":96,"../internals/array-buffer-view-core":103,"../internals/function-bind-context":153,"../internals/function-call":155,"../internals/get-iterator":160,"../internals/get-iterator-method":159,"../internals/is-array-iterator-method":174,"../internals/length-of-array-like":188,"../internals/to-object":250}],262:[function(i,M,E){var p=i("../internals/array-buffer-view-core"),g=i("../internals/species-constructor"),l=p.TYPED_ARRAY_CONSTRUCTOR,h=p.aTypedArrayConstructor;M.exports=function(v){return h(g(v,v[l]))}},{"../internals/array-buffer-view-core":103,"../internals/species-constructor":238}],263:[function(i,M,E){var p=i("../internals/function-uncurry-this"),g=0,l=Math.random(),h=p(1 .toString);M.exports=function(v){return"Symbol("+(v===void 0?"":v)+")_"+h(++g+l,36)}},{"../internals/function-uncurry-this":157}],264:[function(i,M,E){var p=i("../internals/native-symbol");M.exports=p&&!Symbol.sham&&typeof Symbol.iterator=="symbol"},{"../internals/native-symbol":191}],265:[function(i,M,E){var p=i("../internals/descriptors"),g=i("../internals/fails");M.exports=p&&g(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42})},{"../internals/descriptors":134,"../internals/fails":150}],266:[function(i,M,E){var p=i("../internals/global"),g=p.TypeError;M.exports=function(l,h){if(l<h)throw g("Not enough arguments");return l}},{"../internals/global":163}],267:[function(i,M,E){var p=i("../internals/well-known-symbol");E.f=p},{"../internals/well-known-symbol":268}],268:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/shared"),l=i("../internals/has-own-property"),h=i("../internals/uid"),v=i("../internals/native-symbol"),d=i("../internals/use-symbol-as-uid"),o=g("wks"),s=p.Symbol,u=s&&s.for,m=d?s:s&&s.withoutSetter||h;M.exports=function(y){if(!l(o,y)||!(v||typeof o[y]=="string")){var _="Symbol."+y;v&&l(s,y)?o[y]=s[y]:d&&u?o[y]=u(_):o[y]=m(_)}return o[y]}},{"../internals/global":163,"../internals/has-own-property":164,"../internals/native-symbol":191,"../internals/shared":237,"../internals/uid":263,"../internals/use-symbol-as-uid":264}],269:[function(i,M,E){M.exports=`
\v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF`},{}],270:[function(i,M,E){"use strict";var p=i("../internals/export"),g=i("../internals/global"),l=i("../internals/array-buffer"),h=i("../internals/set-species"),v="ArrayBuffer",d=l[v],o=g[v];p({global:!0,forced:o!==d},{ArrayBuffer:d}),h(v)},{"../internals/array-buffer":104,"../internals/export":149,"../internals/global":163,"../internals/set-species":233}],271:[function(i,M,E){"use strict";var p=i("../internals/export"),g=i("../internals/function-uncurry-this"),l=i("../internals/fails"),h=i("../internals/array-buffer"),v=i("../internals/an-object"),d=i("../internals/to-absolute-index"),o=i("../internals/to-length"),s=i("../internals/species-constructor"),u=h.ArrayBuffer,m=h.DataView,y=m.prototype,_=g(u.prototype.slice),x=g(y.getUint8),S=g(y.setUint8),w=l(function(){return!new u(2).slice(1,void 0).byteLength});p({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:w},{slice:function(H,R){if(_&&R===void 0)return _(v(this),H);for(var F=v(this).byteLength,D=d(H,F),B=d(R===void 0?F:R,F),P=new(s(this,u))(o(B-D)),U=new m(this),G=new m(P),ee=0;D<B;)S(G,ee++,x(U,D++));return P}})},{"../internals/an-object":101,"../internals/array-buffer":104,"../internals/export":149,"../internals/fails":150,"../internals/function-uncurry-this":157,"../internals/species-constructor":238,"../internals/to-absolute-index":245,"../internals/to-length":249}],272:[function(i,M,E){"use strict";var p=i("../internals/export"),g=i("../internals/global"),l=i("../internals/fails"),h=i("../internals/is-array"),v=i("../internals/is-object"),d=i("../internals/to-object"),o=i("../internals/length-of-array-like"),s=i("../internals/create-property"),u=i("../internals/array-species-create"),m=i("../internals/array-method-has-species-support"),y=i("../internals/well-known-symbol"),_=i("../internals/engine-v8-version"),x=y("isConcatSpreadable"),S=9007199254740991,w="Maximum allowed index exceeded",A=g.TypeError,H=_>=51||!l(function(){var B=[];return B[x]=!1,B.concat()[0]!==B}),R=m("concat"),F=function(B){if(!v(B))return!1;var P=B[x];return P!==void 0?!!P:h(B)},D=!H||!R;p({target:"Array",proto:!0,forced:D},{concat:function(P){var U=d(this),G=u(U,0),ee=0,K,Z,$,oe,ae;for(K=-1,$=arguments.length;K<$;K++)if(ae=K===-1?U:arguments[K],F(ae)){if(oe=o(ae),ee+oe>S)throw A(w);for(Z=0;Z<oe;Z++,ee++)Z in ae&&s(G,ee,ae[Z])}else{if(ee>=S)throw A(w);s(G,ee++,ae)}return G.length=ee,G}})},{"../internals/array-method-has-species-support":113,"../internals/array-species-create":120,"../internals/create-property":131,"../internals/engine-v8-version":146,"../internals/export":149,"../internals/fails":150,"../internals/global":163,"../internals/is-array":175,"../internals/is-object":180,"../internals/length-of-array-like":188,"../internals/to-object":250,"../internals/well-known-symbol":268}],273:[function(i,M,E){var p=i("../internals/export"),g=i("../internals/array-fill"),l=i("../internals/add-to-unscopables");p({target:"Array",proto:!0},{fill:g}),l("fill")},{"../internals/add-to-unscopables":98,"../internals/array-fill":106,"../internals/export":149}],274:[function(i,M,E){"use strict";var p=i("../internals/export"),g=i("../internals/array-iteration").filter,l=i("../internals/array-method-has-species-support"),h=l("filter");p({target:"Array",proto:!0,forced:!h},{filter:function(d){return g(this,d,arguments.length>1?arguments[1]:void 0)}})},{"../internals/array-iteration":111,"../internals/array-method-has-species-support":113,"../internals/export":149}],275:[function(i,M,E){"use strict";var p=i("../internals/export"),g=i("../internals/array-iteration").find,l=i("../internals/add-to-unscopables"),h="find",v=!0;h in[]&&Array(1)[h](function(){v=!1}),p({target:"Array",proto:!0,forced:v},{find:function(o){return g(this,o,arguments.length>1?arguments[1]:void 0)}}),l(h)},{"../internals/add-to-unscopables":98,"../internals/array-iteration":111,"../internals/export":149}],276:[function(i,M,E){var p=i("../internals/export"),g=i("../internals/array-from"),l=i("../internals/check-correctness-of-iteration"),h=!l(function(v){Array.from(v)});p({target:"Array",stat:!0,forced:h},{from:g})},{"../internals/array-from":109,"../internals/check-correctness-of-iteration":122,"../internals/export":149}],277:[function(i,M,E){"use strict";var p=i("../internals/export"),g=i("../internals/array-includes").includes,l=i("../internals/add-to-unscopables");p({target:"Array",proto:!0},{includes:function(v){return g(this,v,arguments.length>1?arguments[1]:void 0)}}),l("includes")},{"../internals/add-to-unscopables":98,"../internals/array-includes":110,"../internals/export":149}],278:[function(i,M,E){"use strict";var p=i("../internals/to-indexed-object"),g=i("../internals/add-to-unscopables"),l=i("../internals/iterators"),h=i("../internals/internal-state"),v=i("../internals/object-define-property").f,d=i("../internals/define-iterator"),o=i("../internals/is-pure"),s=i("../internals/descriptors"),u="Array Iterator",m=h.set,y=h.getterFor(u);M.exports=d(Array,"Array",function(x,S){m(this,{type:u,target:p(x),index:0,kind:S})},function(){var x=y(this),S=x.target,w=x.kind,A=x.index++;return!S||A>=S.length?(x.target=void 0,{value:void 0,done:!0}):w=="keys"?{value:A,done:!1}:w=="values"?{value:S[A],done:!1}:{value:[A,S[A]],done:!1}},"values");var _=l.Arguments=l.Array;if(g("keys"),g("values"),g("entries"),!o&&s&&_.name!=="values")try{v(_,"name",{value:"values"})}catch(x){}},{"../internals/add-to-unscopables":98,"../internals/define-iterator":132,"../internals/descriptors":134,"../internals/internal-state":173,"../internals/is-pure":181,"../internals/iterators":187,"../internals/object-define-property":198,"../internals/to-indexed-object":247}],279:[function(i,M,E){"use strict";var p=i("../internals/export"),g=i("../internals/function-uncurry-this"),l=i("../internals/indexed-object"),h=i("../internals/to-indexed-object"),v=i("../internals/array-method-is-strict"),d=g([].join),o=l!=Object,s=v("join",",");p({target:"Array",proto:!0,forced:o||!s},{join:function(m){return d(h(this),m===void 0?",":m)}})},{"../internals/array-method-is-strict":114,"../internals/export":149,"../internals/function-uncurry-this":157,"../internals/indexed-object":170,"../internals/to-indexed-object":247}],280:[function(i,M,E){"use strict";var p=i("../internals/export"),g=i("../internals/array-iteration").map,l=i("../internals/array-method-has-species-support"),h=l("map");p({target:"Array",proto:!0,forced:!h},{map:function(d){return g(this,d,arguments.length>1?arguments[1]:void 0)}})},{"../internals/array-iteration":111,"../internals/array-method-has-species-support":113,"../internals/export":149}],281:[function(i,M,E){"use strict";var p=i("../internals/export"),g=i("../internals/global"),l=i("../internals/is-array"),h=i("../internals/is-constructor"),v=i("../internals/is-object"),d=i("../internals/to-absolute-index"),o=i("../internals/length-of-array-like"),s=i("../internals/to-indexed-object"),u=i("../internals/create-property"),m=i("../internals/well-known-symbol"),y=i("../internals/array-method-has-species-support"),_=i("../internals/array-slice"),x=y("slice"),S=m("species"),w=g.Array,A=Math.max;p({target:"Array",proto:!0,forced:!x},{slice:function(R,F){var D=s(this),B=o(D),P=d(R,B),U=d(F===void 0?B:F,B),G,ee,K;if(l(D)&&(G=D.constructor,h(G)&&(G===w||l(G.prototype))?G=void 0:v(G)&&(G=G[S],G===null&&(G=void 0)),G===w||G===void 0))return _(D,P,U);for(ee=new(G===void 0?w:G)(A(U-P,0)),K=0;P<U;P++,K++)P in D&&u(ee,K,D[P]);return ee.length=K,ee}})},{"../internals/array-method-has-species-support":113,"../internals/array-slice":117,"../internals/create-property":131,"../internals/export":149,"../internals/global":163,"../internals/is-array":175,"../internals/is-constructor":177,"../internals/is-object":180,"../internals/length-of-array-like":188,"../internals/to-absolute-index":245,"../internals/to-indexed-object":247,"../internals/well-known-symbol":268}],282:[function(i,M,E){"use strict";var p=i("../internals/export"),g=i("../internals/function-uncurry-this"),l=i("../internals/a-callable"),h=i("../internals/to-object"),v=i("../internals/length-of-array-like"),d=i("../internals/to-string"),o=i("../internals/fails"),s=i("../internals/array-sort"),u=i("../internals/array-method-is-strict"),m=i("../internals/engine-ff-version"),y=i("../internals/engine-is-ie-or-edge"),_=i("../internals/engine-v8-version"),x=i("../internals/engine-webkit-version"),S=[],w=g(S.sort),A=g(S.push),H=o(function(){S.sort(void 0)}),R=o(function(){S.sort(null)}),F=u("sort"),D=!o(function(){if(_)return _<70;if(!(m&&m>3)){if(y)return!0;if(x)return x<603;var U="",G,ee,K,Z;for(G=65;G<76;G++){switch(ee=String.fromCharCode(G),G){case 66:case 69:case 70:case 72:K=3;break;case 68:case 71:K=4;break;default:K=2}for(Z=0;Z<47;Z++)S.push({k:ee+Z,v:K})}for(S.sort(function($,oe){return oe.v-$.v}),Z=0;Z<S.length;Z++)ee=S[Z].k.charAt(0),U.charAt(U.length-1)!==ee&&(U+=ee);return U!=="DGBEFHACIJK"}}),B=H||!R||!F||!D,P=function(U){return function(G,ee){return ee===void 0?-1:G===void 0?1:U!==void 0?+U(G,ee)||0:d(G)>d(ee)?1:-1}};p({target:"Array",proto:!0,forced:B},{sort:function(G){G!==void 0&&l(G);var ee=h(this);if(D)return G===void 0?w(ee):w(ee,G);var K=[],Z=v(ee),$,oe;for(oe=0;oe<Z;oe++)oe in ee&&A(K,ee[oe]);for(s(K,P(G)),$=K.length,oe=0;oe<$;)ee[oe]=K[oe++];for(;oe<Z;)delete ee[oe++];return ee}})},{"../internals/a-callable":95,"../internals/array-method-is-strict":114,"../internals/array-sort":118,"../internals/engine-ff-version":138,"../internals/engine-is-ie-or-edge":140,"../internals/engine-v8-version":146,"../internals/engine-webkit-version":147,"../internals/export":149,"../internals/fails":150,"../internals/function-uncurry-this":157,"../internals/length-of-array-like":188,"../internals/to-object":250,"../internals/to-string":256}],283:[function(i,M,E){"use strict";var p=i("../internals/export"),g=i("../internals/global"),l=i("../internals/to-absolute-index"),h=i("../internals/to-integer-or-infinity"),v=i("../internals/length-of-array-like"),d=i("../internals/to-object"),o=i("../internals/array-species-create"),s=i("../internals/create-property"),u=i("../internals/array-method-has-species-support"),m=u("splice"),y=g.TypeError,_=Math.max,x=Math.min,S=9007199254740991,w="Maximum allowed length exceeded";p({target:"Array",proto:!0,forced:!m},{splice:function(H,R){var F=d(this),D=v(F),B=l(H,D),P=arguments.length,U,G,ee,K,Z,$;if(P===0?U=G=0:P===1?(U=0,G=D-B):(U=P-2,G=x(_(h(R),0),D-B)),D+U-G>S)throw y(w);for(ee=o(F,G),K=0;K<G;K++)Z=B+K,Z in F&&s(ee,K,F[Z]);if(ee.length=G,U<G){for(K=B;K<D-G;K++)Z=K+G,$=K+U,Z in F?F[$]=F[Z]:delete F[$];for(K=D;K>D-G+U;K--)delete F[K-1]}else if(U>G)for(K=D-G;K>B;K--)Z=K+G-1,$=K+U-1,Z in F?F[$]=F[Z]:delete F[$];for(K=0;K<U;K++)F[K+B]=arguments[K+2];return F.length=D-G+U,ee}})},{"../internals/array-method-has-species-support":113,"../internals/array-species-create":120,"../internals/create-property":131,"../internals/export":149,"../internals/global":163,"../internals/length-of-array-like":188,"../internals/to-absolute-index":245,"../internals/to-integer-or-infinity":248,"../internals/to-object":250}],284:[function(i,M,E){var p=i("../internals/descriptors"),g=i("../internals/function-name").EXISTS,l=i("../internals/function-uncurry-this"),h=i("../internals/object-define-property").f,v=Function.prototype,d=l(v.toString),o=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,s=l(o.exec),u="name";p&&!g&&h(v,u,{configurable:!0,get:function(){try{return s(o,d(this))[1]}catch(m){return""}}})},{"../internals/descriptors":134,"../internals/function-name":156,"../internals/function-uncurry-this":157,"../internals/object-define-property":198}],285:[function(i,M,E){var p=i("../internals/export"),g=i("../internals/get-built-in"),l=i("../internals/function-apply"),h=i("../internals/function-call"),v=i("../internals/function-uncurry-this"),d=i("../internals/fails"),o=i("../internals/is-array"),s=i("../internals/is-callable"),u=i("../internals/is-object"),m=i("../internals/is-symbol"),y=i("../internals/array-slice"),_=i("../internals/native-symbol"),x=g("JSON","stringify"),S=v(/./.exec),w=v("".charAt),A=v("".charCodeAt),H=v("".replace),R=v(1 .toString),F=/[\uD800-\uDFFF]/g,D=/^[\uD800-\uDBFF]$/,B=/^[\uDC00-\uDFFF]$/,P=!_||d(function(){var K=g("Symbol")();return x([K])!="[null]"||x({a:K})!="{}"||x(Object(K))!="{}"}),U=d(function(){return x("\uDF06\uD834")!=='"\\udf06\\ud834"'||x("\uDEAD")!=='"\\udead"'}),G=function(K,Z){var $=y(arguments),oe=Z;if(!(!u(Z)&&K===void 0||m(K)))return o(Z)||(Z=function(ae,ye){if(s(oe)&&(ye=h(oe,this,ae,ye)),!m(ye))return ye}),$[1]=Z,l(x,null,$)},ee=function(K,Z,$){var oe=w($,Z-1),ae=w($,Z+1);return S(D,K)&&!S(B,ae)||S(B,K)&&!S(D,oe)?"\\u"+R(A(K,0),16):K};x&&p({target:"JSON",stat:!0,forced:P||U},{stringify:function(Z,$,oe){var ae=y(arguments),ye=l(P?G:x,null,ae);return U&&typeof ye=="string"?H(ye,F,ee):ye}})},{"../internals/array-slice":117,"../internals/export":149,"../internals/fails":150,"../internals/function-apply":152,"../internals/function-call":155,"../internals/function-uncurry-this":157,"../internals/get-built-in":158,"../internals/is-array":175,"../internals/is-callable":176,"../internals/is-object":180,"../internals/is-symbol":183,"../internals/native-symbol":191}],286:[function(i,M,E){"use strict";var p=i("../internals/descriptors"),g=i("../internals/global"),l=i("../internals/function-uncurry-this"),h=i("../internals/is-forced"),v=i("../internals/redefine"),d=i("../internals/has-own-property"),o=i("../internals/inherit-if-required"),s=i("../internals/object-is-prototype-of"),u=i("../internals/is-symbol"),m=i("../internals/to-primitive"),y=i("../internals/fails"),_=i("../internals/object-get-own-property-names").f,x=i("../internals/object-get-own-property-descriptor").f,S=i("../internals/object-define-property").f,w=i("../internals/this-number-value"),A=i("../internals/string-trim").trim,H="Number",R=g[H],F=R.prototype,D=g.TypeError,B=l("".slice),P=l("".charCodeAt),U=function(oe){var ae=m(oe,"number");return typeof ae=="bigint"?ae:G(ae)},G=function(oe){var ae=m(oe,"number"),ye,Y,le,xe,Ce,we,Le,de;if(u(ae))throw D("Cannot convert a Symbol value to a number");if(typeof ae=="string"&&ae.length>2){if(ae=A(ae),ye=P(ae,0),ye===43||ye===45){if(Y=P(ae,2),Y===88||Y===120)return NaN}else if(ye===48){switch(P(ae,1)){case 66:case 98:le=2,xe=49;break;case 79:case 111:le=8,xe=55;break;default:return+ae}for(Ce=B(ae,2),we=Ce.length,Le=0;Le<we;Le++)if(de=P(Ce,Le),de<48||de>xe)return NaN;return parseInt(Ce,le)}}return+ae};if(h(H,!R(" 0o1")||!R("0b1")||R("+0x1"))){for(var ee=function(ae){var ye=arguments.length<1?0:R(U(ae)),Y=this;return s(F,Y)&&y(function(){w(Y)})?o(Object(ye),Y,ee):ye},K=p?_(R):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),Z=0,$;K.length>Z;Z++)d(R,$=K[Z])&&!d(ee,$)&&S(ee,$,x(R,$));ee.prototype=F,F.constructor=ee,v(g,H,ee)}},{"../internals/descriptors":134,"../internals/fails":150,"../internals/function-uncurry-this":157,"../internals/global":163,"../internals/has-own-property":164,"../internals/inherit-if-required":171,"../internals/is-forced":178,"../internals/is-symbol":183,"../internals/object-define-property":198,"../internals/object-get-own-property-descriptor":199,"../internals/object-get-own-property-names":201,"../internals/object-is-prototype-of":204,"../internals/redefine":222,"../internals/string-trim":241,"../internals/this-number-value":244,"../internals/to-primitive":253}],287:[function(i,M,E){var p=i("../internals/export"),g=i("../internals/object-assign");p({target:"Object",stat:!0,forced:Object.assign!==g},{assign:g})},{"../internals/export":149,"../internals/object-assign":195}],288:[function(i,M,E){var p=i("../internals/export"),g=i("../internals/object-to-array").entries;p({target:"Object",stat:!0},{entries:function(h){return g(h)}})},{"../internals/export":149,"../internals/object-to-array":209}],289:[function(i,M,E){var p=i("../internals/export"),g=i("../internals/native-symbol"),l=i("../internals/fails"),h=i("../internals/object-get-own-property-symbols"),v=i("../internals/to-object"),d=!g||l(function(){h.f(1)});p({target:"Object",stat:!0,forced:d},{getOwnPropertySymbols:function(s){var u=h.f;return u?u(v(s)):[]}})},{"../internals/export":149,"../internals/fails":150,"../internals/native-symbol":191,"../internals/object-get-own-property-symbols":202,"../internals/to-object":250}],290:[function(i,M,E){var p=i("../internals/export"),g=i("../internals/to-object"),l=i("../internals/object-keys"),h=i("../internals/fails"),v=h(function(){l(1)});p({target:"Object",stat:!0,forced:v},{keys:function(o){return l(g(o))}})},{"../internals/export":149,"../internals/fails":150,"../internals/object-keys":206,"../internals/to-object":250}],291:[function(i,M,E){var p=i("../internals/to-string-tag-support"),g=i("../internals/redefine"),l=i("../internals/object-to-string");p||g(Object.prototype,"toString",l,{unsafe:!0})},{"../internals/object-to-string":210,"../internals/redefine":222,"../internals/to-string-tag-support":255}],292:[function(i,M,E){"use strict";var p=i("../internals/export"),g=i("../internals/function-call"),l=i("../internals/a-callable"),h=i("../internals/new-promise-capability"),v=i("../internals/perform"),d=i("../internals/iterate"),o=i("../internals/promise-statics-incorrect-iteration");p({target:"Promise",stat:!0,forced:o},{all:function(u){var m=this,y=h.f(m),_=y.resolve,x=y.reject,S=v(function(){var w=l(m.resolve),A=[],H=0,R=1;d(u,function(F){var D=H++,B=!1;R++,g(w,m,F).then(function(P){B||(B=!0,A[D]=P,--R||_(A))},x)}),--R||_(A)});return S.error&&x(S.value),y.promise}})},{"../internals/a-callable":95,"../internals/export":149,"../internals/function-call":155,"../internals/iterate":184,"../internals/new-promise-capability":193,"../internals/perform":214,"../internals/promise-statics-incorrect-iteration":218}],293:[function(i,M,E){"use strict";var p=i("../internals/export"),g=i("../internals/is-pure"),l=i("../internals/promise-constructor-detection").CONSTRUCTOR,h=i("../internals/promise-native-constructor"),v=i("../internals/get-built-in"),d=i("../internals/is-callable"),o=i("../internals/redefine"),s=h&&h.prototype;if(p({target:"Promise",proto:!0,forced:l,real:!0},{catch:function(m){return this.then(void 0,m)}}),!g&&d(h)){var u=v("Promise").prototype.catch;s.catch!==u&&o(s,"catch",u,{unsafe:!0})}},{"../internals/export":149,"../internals/get-built-in":158,"../internals/is-callable":176,"../internals/is-pure":181,"../internals/promise-constructor-detection":215,"../internals/promise-native-constructor":216,"../internals/redefine":222}],294:[function(i,M,E){"use strict";var p=i("../internals/export"),g=i("../internals/is-pure"),l=i("../internals/engine-is-node"),h=i("../internals/global"),v=i("../internals/function-call"),d=i("../internals/redefine"),o=i("../internals/redefine-all"),s=i("../internals/object-set-prototype-of"),u=i("../internals/set-to-string-tag"),m=i("../internals/set-species"),y=i("../internals/a-callable"),_=i("../internals/is-callable"),x=i("../internals/is-object"),S=i("../internals/an-instance"),w=i("../internals/species-constructor"),A=i("../internals/task").set,H=i("../internals/microtask"),R=i("../internals/host-report-errors"),F=i("../internals/perform"),D=i("../internals/queue"),B=i("../internals/internal-state"),P=i("../internals/promise-native-constructor"),U=i("../internals/promise-constructor-detection"),G=i("../internals/new-promise-capability"),ee="Promise",K=U.CONSTRUCTOR,Z=U.REJECTION_EVENT,$=U.SUBCLASSING,oe=B.getterFor(ee),ae=B.set,ye=P&&P.prototype,Y=P,le=ye,xe=h.TypeError,Ce=h.document,we=h.process,Le=G.f,de=Le,be=!!(Ce&&Ce.createEvent&&h.dispatchEvent),Te="unhandledrejection",Ae="rejectionhandled",Be=0,Pe=1,_e=2,ne=1,te=2,T,I,re,q,z=function(Ne){var Ze;return x(Ne)&&_(Ze=Ne.then)?Ze:!1},W=function(Ne,Ze){var We=Ze.value,nt=Ze.state==Pe,qe=nt?Ne.ok:Ne.fail,Qe=Ne.resolve,ft=Ne.reject,vt=Ne.domain,bt,Tt,kr;try{qe?(nt||(Ze.rejection===te&&Fe(Ze),Ze.rejection=ne),qe===!0?bt=We:(vt&&vt.enter(),bt=qe(We),vt&&(vt.exit(),kr=!0)),bt===Ne.promise?ft(xe("Promise-chain cycle")):(Tt=z(bt))?v(Tt,bt,Qe,ft):Qe(bt)):ft(We)}catch(jr){vt&&!kr&&vt.exit(),ft(jr)}},V=function(Ne,Ze){Ne.notified||(Ne.notified=!0,H(function(){for(var We=Ne.reactions,nt;nt=We.get();)W(nt,Ne);Ne.notified=!1,Ze&&!Ne.rejection&&ge(Ne)}))},se=function(Ne,Ze,We){var nt,qe;be?(nt=Ce.createEvent("Event"),nt.promise=Ze,nt.reason=We,nt.initEvent(Ne,!1,!0),h.dispatchEvent(nt)):nt={promise:Ze,reason:We},!Z&&(qe=h["on"+Ne])?qe(nt):Ne===Te&&R("Unhandled promise rejection",We)},ge=function(Ne){v(A,h,function(){var Ze=Ne.facade,We=Ne.value,nt=Me(Ne),qe;if(nt&&(qe=F(function(){l?we.emit("unhandledRejection",We,Ze):se(Te,Ze,We)}),Ne.rejection=l||Me(Ne)?te:ne,qe.error))throw qe.value})},Me=function(Ne){return Ne.rejection!==ne&&!Ne.parent},Fe=function(Ne){v(A,h,function(){var Ze=Ne.facade;l?we.emit("rejectionHandled",Ze):se(Ae,Ze,Ne.value)})},Re=function(Ne,Ze,We){return function(nt){Ne(Ze,nt,We)}},$e=function(Ne,Ze,We){Ne.done||(Ne.done=!0,We&&(Ne=We),Ne.value=Ze,Ne.state=_e,V(Ne,!0))},lt=function(Ne,Ze,We){if(!Ne.done){Ne.done=!0,We&&(Ne=We);try{if(Ne.facade===Ze)throw xe("Promise can't be resolved itself");var nt=z(Ze);nt?H(function(){var qe={done:!1};try{v(nt,Ze,Re(lt,qe,Ne),Re($e,qe,Ne))}catch(Qe){$e(qe,Qe,Ne)}}):(Ne.value=Ze,Ne.state=Pe,V(Ne,!1))}catch(qe){$e({done:!1},qe,Ne)}}};if(K&&(Y=function(Ze){S(this,le),y(Ze),v(T,this);var We=oe(this);try{Ze(Re(lt,We),Re($e,We))}catch(nt){$e(We,nt)}},le=Y.prototype,T=function(Ze){ae(this,{type:ee,done:!1,notified:!1,parent:!1,reactions:new D,rejection:!1,state:Be,value:void 0})},T.prototype=o(le,{then:function(Ze,We){var nt=oe(this),qe=Le(w(this,Y));return nt.parent=!0,qe.ok=_(Ze)?Ze:!0,qe.fail=_(We)&&We,qe.domain=l?we.domain:void 0,nt.state==Be?nt.reactions.add(qe):H(function(){W(qe,nt)}),qe.promise}}),I=function(){var Ne=new T,Ze=oe(Ne);this.promise=Ne,this.resolve=Re(lt,Ze),this.reject=Re($e,Ze)},G.f=Le=function(Ne){return Ne===Y||Ne===re?new I(Ne):de(Ne)},!g&&_(P)&&ye!==Object.prototype)){q=ye.then,$||d(ye,"then",function(Ze,We){var nt=this;return new Y(function(qe,Qe){v(q,nt,qe,Qe)}).then(Ze,We)},{unsafe:!0});try{delete ye.constructor}catch(Ne){}s&&s(ye,le)}p({global:!0,wrap:!0,forced:K},{Promise:Y}),u(Y,ee,!1,!0),m(ee)},{"../internals/a-callable":95,"../internals/an-instance":100,"../internals/engine-is-node":143,"../internals/export":149,"../internals/function-call":155,"../internals/global":163,"../internals/host-report-errors":166,"../internals/internal-state":173,"../internals/is-callable":176,"../internals/is-object":180,"../internals/is-pure":181,"../internals/microtask":189,"../internals/new-promise-capability":193,"../internals/object-set-prototype-of":208,"../internals/perform":214,"../internals/promise-constructor-detection":215,"../internals/promise-native-constructor":216,"../internals/queue":220,"../internals/redefine":222,"../internals/redefine-all":221,"../internals/set-species":233,"../internals/set-to-string-tag":234,"../internals/species-constructor":238,"../internals/task":243}],295:[function(i,M,E){i("../modules/es.promise.constructor"),i("../modules/es.promise.all"),i("../modules/es.promise.catch"),i("../modules/es.promise.race"),i("../modules/es.promise.reject"),i("../modules/es.promise.resolve")},{"../modules/es.promise.all":292,"../modules/es.promise.catch":293,"../modules/es.promise.constructor":294,"../modules/es.promise.race":296,"../modules/es.promise.reject":297,"../modules/es.promise.resolve":298}],296:[function(i,M,E){"use strict";var p=i("../internals/export"),g=i("../internals/function-call"),l=i("../internals/a-callable"),h=i("../internals/new-promise-capability"),v=i("../internals/perform"),d=i("../internals/iterate"),o=i("../internals/promise-statics-incorrect-iteration");p({target:"Promise",stat:!0,forced:o},{race:function(u){var m=this,y=h.f(m),_=y.reject,x=v(function(){var S=l(m.resolve);d(u,function(w){g(S,m,w).then(y.resolve,_)})});return x.error&&_(x.value),y.promise}})},{"../internals/a-callable":95,"../internals/export":149,"../internals/function-call":155,"../internals/iterate":184,"../internals/new-promise-capability":193,"../internals/perform":214,"../internals/promise-statics-incorrect-iteration":218}],297:[function(i,M,E){"use strict";var p=i("../internals/export"),g=i("../internals/function-call"),l=i("../internals/new-promise-capability"),h=i("../internals/promise-constructor-detection").CONSTRUCTOR;p({target:"Promise",stat:!0,forced:h},{reject:function(d){var o=l.f(this);return g(o.reject,void 0,d),o.promise}})},{"../internals/export":149,"../internals/function-call":155,"../internals/new-promise-capability":193,"../internals/promise-constructor-detection":215}],298:[function(i,M,E){"use strict";var p=i("../internals/export"),g=i("../internals/get-built-in"),l=i("../internals/is-pure"),h=i("../internals/promise-native-constructor"),v=i("../internals/promise-constructor-detection").CONSTRUCTOR,d=i("../internals/promise-resolve"),o=g("Promise"),s=l&&!v;p({target:"Promise",stat:!0,forced:l||v},{resolve:function(m){return d(s&&this===o?h:this,m)}})},{"../internals/export":149,"../internals/get-built-in":158,"../internals/is-pure":181,"../internals/promise-constructor-detection":215,"../internals/promise-native-constructor":216,"../internals/promise-resolve":217}],299:[function(i,M,E){var p=i("../internals/descriptors"),g=i("../internals/global"),l=i("../internals/function-uncurry-this"),h=i("../internals/is-forced"),v=i("../internals/inherit-if-required"),d=i("../internals/create-non-enumerable-property"),o=i("../internals/object-get-own-property-names").f,s=i("../internals/object-is-prototype-of"),u=i("../internals/is-regexp"),m=i("../internals/to-string"),y=i("../internals/regexp-get-flags"),_=i("../internals/regexp-sticky-helpers"),x=i("../internals/proxy-accessor"),S=i("../internals/redefine"),w=i("../internals/fails"),A=i("../internals/has-own-property"),H=i("../internals/internal-state").enforce,R=i("../internals/set-species"),F=i("../internals/well-known-symbol"),D=i("../internals/regexp-unsupported-dot-all"),B=i("../internals/regexp-unsupported-ncg"),P=F("match"),U=g.RegExp,G=U.prototype,ee=g.SyntaxError,K=l(G.exec),Z=l("".charAt),$=l("".replace),oe=l("".indexOf),ae=l("".slice),ye=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,Y=/a/g,le=/a/g,xe=new U(Y)!==Y,Ce=_.MISSED_STICKY,we=_.UNSUPPORTED_Y,Le=p&&(!xe||Ce||D||B||w(function(){return le[P]=!1,U(Y)!=Y||U(le)==le||U(Y,"i")!="/a/i"})),de=function(Pe){for(var _e=Pe.length,ne=0,te="",T=!1,I;ne<=_e;ne++){if(I=Z(Pe,ne),I==="\\"){te+=I+Z(Pe,++ne);continue}!T&&I==="."?te+="[\\s\\S]":(I==="["?T=!0:I==="]"&&(T=!1),te+=I)}return te},be=function(Pe){for(var _e=Pe.length,ne=0,te="",T=[],I={},re=!1,q=!1,z=0,W="",V;ne<=_e;ne++){if(V=Z(Pe,ne),V==="\\")V=V+Z(Pe,++ne);else if(V==="]")re=!1;else if(!re)switch(!0){case V==="[":re=!0;break;case V==="(":K(ye,ae(Pe,ne+1))&&(ne+=2,q=!0),te+=V,z++;continue;case(V===">"&&q):if(W===""||A(I,W))throw new ee("Invalid capture group name");I[W]=!0,T[T.length]=[W,z],q=!1,W="";continue}q?W+=V:te+=V}return[te,T]};if(h("RegExp",Le)){for(var Te=function(_e,ne){var te=s(G,this),T=u(_e),I=ne===void 0,re=[],q=_e,z,W,V,se,ge,Me;if(!te&&T&&I&&_e.constructor===Te)return _e;if((T||s(G,_e))&&(_e=_e.source,I&&(ne=y(q))),_e=_e===void 0?"":m(_e),ne=ne===void 0?"":m(ne),q=_e,D&&"dotAll"in Y&&(W=!!ne&&oe(ne,"s")>-1,W&&(ne=$(ne,/s/g,""))),z=ne,Ce&&"sticky"in Y&&(V=!!ne&&oe(ne,"y")>-1,V&&we&&(ne=$(ne,/y/g,""))),B&&(se=be(_e),_e=se[0],re=se[1]),ge=v(U(_e,ne),te?this:G,Te),(W||V||re.length)&&(Me=H(ge),W&&(Me.dotAll=!0,Me.raw=Te(de(_e),z)),V&&(Me.sticky=!0),re.length&&(Me.groups=re)),_e!==q)try{d(ge,"source",q===""?"(?:)":q)}catch(Fe){}return ge},Ae=o(U),Be=0;Ae.length>Be;)x(Te,U,Ae[Be++]);G.constructor=Te,Te.prototype=G,S(g,"RegExp",Te)}R("RegExp")},{"../internals/create-non-enumerable-property":129,"../internals/descriptors":134,"../internals/fails":150,"../internals/function-uncurry-this":157,"../internals/global":163,"../internals/has-own-property":164,"../internals/inherit-if-required":171,"../internals/internal-state":173,"../internals/is-forced":178,"../internals/is-regexp":182,"../internals/object-get-own-property-names":201,"../internals/object-is-prototype-of":204,"../internals/proxy-accessor":219,"../internals/redefine":222,"../internals/regexp-get-flags":226,"../internals/regexp-sticky-helpers":227,"../internals/regexp-unsupported-dot-all":228,"../internals/regexp-unsupported-ncg":229,"../internals/set-species":233,"../internals/to-string":256,"../internals/well-known-symbol":268}],300:[function(i,M,E){"use strict";var p=i("../internals/export"),g=i("../internals/regexp-exec");p({target:"RegExp",proto:!0,forced:/./.exec!==g},{exec:g})},{"../internals/export":149,"../internals/regexp-exec":224}],301:[function(i,M,E){"use strict";var p=i("../internals/function-name").PROPER,g=i("../internals/redefine"),l=i("../internals/an-object"),h=i("../internals/to-string"),v=i("../internals/fails"),d=i("../internals/regexp-get-flags"),o="toString",s=RegExp.prototype,u=s[o],m=v(function(){return u.call({source:"a",flags:"b"})!="/a/b"}),y=p&&u.name!=o;(m||y)&&g(RegExp.prototype,o,function(){var x=l(this),S=h(x.source),w=h(d(x));return"/"+S+"/"+w},{unsafe:!0})},{"../internals/an-object":101,"../internals/fails":150,"../internals/function-name":156,"../internals/redefine":222,"../internals/regexp-get-flags":226,"../internals/to-string":256}],302:[function(i,M,E){"use strict";var p=i("../internals/export"),g=i("../internals/function-uncurry-this"),l=i("../internals/not-a-regexp"),h=i("../internals/require-object-coercible"),v=i("../internals/to-string"),d=i("../internals/correct-is-regexp-logic"),o=g("".indexOf);p({target:"String",proto:!0,forced:!d("includes")},{includes:function(u){return!!~o(v(h(this)),v(l(u)),arguments.length>1?arguments[1]:void 0)}})},{"../internals/correct-is-regexp-logic":126,"../internals/export":149,"../internals/function-uncurry-this":157,"../internals/not-a-regexp":194,"../internals/require-object-coercible":230,"../internals/to-string":256}],303:[function(i,M,E){"use strict";var p=i("../internals/string-multibyte").charAt,g=i("../internals/to-string"),l=i("../internals/internal-state"),h=i("../internals/define-iterator"),v="String Iterator",d=l.set,o=l.getterFor(v);h(String,"String",function(s){d(this,{type:v,string:g(s),index:0})},function(){var u=o(this),m=u.string,y=u.index,_;return y>=m.length?{value:void 0,done:!0}:(_=p(m,y),u.index+=_.length,{value:_,done:!1})})},{"../internals/define-iterator":132,"../internals/internal-state":173,"../internals/string-multibyte":239,"../internals/to-string":256}],304:[function(i,M,E){"use strict";var p=i("../internals/function-call"),g=i("../internals/fix-regexp-well-known-symbol-logic"),l=i("../internals/an-object"),h=i("../internals/to-length"),v=i("../internals/to-string"),d=i("../internals/require-object-coercible"),o=i("../internals/get-method"),s=i("../internals/advance-string-index"),u=i("../internals/regexp-exec-abstract");g("match",function(m,y,_){return[function(S){var w=d(this),A=S==null?void 0:o(S,m);return A?p(A,S,w):new RegExp(S)[m](v(w))},function(x){var S=l(this),w=v(x),A=_(y,S,w);if(A.done)return A.value;if(!S.global)return u(S,w);var H=S.unicode;S.lastIndex=0;for(var R=[],F=0,D;(D=u(S,w))!==null;){var B=v(D[0]);R[F]=B,B===""&&(S.lastIndex=s(w,h(S.lastIndex),H)),F++}return F===0?null:R}]})},{"../internals/advance-string-index":99,"../internals/an-object":101,"../internals/fix-regexp-well-known-symbol-logic":151,"../internals/function-call":155,"../internals/get-method":161,"../internals/regexp-exec-abstract":223,"../internals/require-object-coercible":230,"../internals/to-length":249,"../internals/to-string":256}],305:[function(i,M,E){"use strict";var p=i("../internals/function-apply"),g=i("../internals/function-call"),l=i("../internals/function-uncurry-this"),h=i("../internals/fix-regexp-well-known-symbol-logic"),v=i("../internals/fails"),d=i("../internals/an-object"),o=i("../internals/is-callable"),s=i("../internals/to-integer-or-infinity"),u=i("../internals/to-length"),m=i("../internals/to-string"),y=i("../internals/require-object-coercible"),_=i("../internals/advance-string-index"),x=i("../internals/get-method"),S=i("../internals/get-substitution"),w=i("../internals/regexp-exec-abstract"),A=i("../internals/well-known-symbol"),H=A("replace"),R=Math.max,F=Math.min,D=l([].concat),B=l([].push),P=l("".indexOf),U=l("".slice),G=function($){return $===void 0?$:String($)},ee=function(){return"a".replace(/./,"$0")==="$0"}(),K=function(){return/./[H]?/./[H]("a","$0")==="":!1}(),Z=!v(function(){var $=/./;return $.exec=function(){var oe=[];return oe.groups={a:"7"},oe},"".replace($,"$<a>")!=="7"});h("replace",function($,oe,ae){var ye=K?"$":"$0";return[function(le,xe){var Ce=y(this),we=le==null?void 0:x(le,H);return we?g(we,le,Ce,xe):g(oe,m(Ce),le,xe)},function(Y,le){var xe=d(this),Ce=m(Y);if(typeof le=="string"&&P(le,ye)===-1&&P(le,"$<")===-1){var we=ae(oe,xe,Ce,le);if(we.done)return we.value}var Le=o(le);Le||(le=m(le));var de=xe.global;if(de){var be=xe.unicode;xe.lastIndex=0}for(var Te=[];;){var Ae=w(xe,Ce);if(Ae===null||(B(Te,Ae),!de))break;var Be=m(Ae[0]);Be===""&&(xe.lastIndex=_(Ce,u(xe.lastIndex),be))}for(var Pe="",_e=0,ne=0;ne<Te.length;ne++){Ae=Te[ne];for(var te=m(Ae[0]),T=R(F(s(Ae.index),Ce.length),0),I=[],re=1;re<Ae.length;re++)B(I,G(Ae[re]));var q=Ae.groups;if(Le){var z=D([te],I,T,Ce);q!==void 0&&B(z,q);var W=m(p(le,void 0,z))}else W=S(te,Ce,T,I,q,le);T>=_e&&(Pe+=U(Ce,_e,T)+W,_e=T+te.length)}return Pe+U(Ce,_e)}]},!Z||!ee||K)},{"../internals/advance-string-index":99,"../internals/an-object":101,"../internals/fails":150,"../internals/fix-regexp-well-known-symbol-logic":151,"../internals/function-apply":152,"../internals/function-call":155,"../internals/function-uncurry-this":157,"../internals/get-method":161,"../internals/get-substitution":162,"../internals/is-callable":176,"../internals/regexp-exec-abstract":223,"../internals/require-object-coercible":230,"../internals/to-integer-or-infinity":248,"../internals/to-length":249,"../internals/to-string":256,"../internals/well-known-symbol":268}],306:[function(i,M,E){"use strict";var p=i("../internals/function-call"),g=i("../internals/fix-regexp-well-known-symbol-logic"),l=i("../internals/an-object"),h=i("../internals/require-object-coercible"),v=i("../internals/same-value"),d=i("../internals/to-string"),o=i("../internals/get-method"),s=i("../internals/regexp-exec-abstract");g("search",function(u,m,y){return[function(x){var S=h(this),w=x==null?void 0:o(x,u);return w?p(w,x,S):new RegExp(x)[u](d(S))},function(_){var x=l(this),S=d(_),w=y(m,x,S);if(w.done)return w.value;var A=x.lastIndex;v(A,0)||(x.lastIndex=0);var H=s(x,S);return v(x.lastIndex,A)||(x.lastIndex=A),H===null?-1:H.index}]})},{"../internals/an-object":101,"../internals/fix-regexp-well-known-symbol-logic":151,"../internals/function-call":155,"../internals/get-method":161,"../internals/regexp-exec-abstract":223,"../internals/require-object-coercible":230,"../internals/same-value":231,"../internals/to-string":256}],307:[function(i,M,E){"use strict";var p=i("../internals/function-apply"),g=i("../internals/function-call"),l=i("../internals/function-uncurry-this"),h=i("../internals/fix-regexp-well-known-symbol-logic"),v=i("../internals/is-regexp"),d=i("../internals/an-object"),o=i("../internals/require-object-coercible"),s=i("../internals/species-constructor"),u=i("../internals/advance-string-index"),m=i("../internals/to-length"),y=i("../internals/to-string"),_=i("../internals/get-method"),x=i("../internals/array-slice-simple"),S=i("../internals/regexp-exec-abstract"),w=i("../internals/regexp-exec"),A=i("../internals/regexp-sticky-helpers"),H=i("../internals/fails"),R=A.UNSUPPORTED_Y,F=4294967295,D=Math.min,B=[].push,P=l(/./.exec),U=l(B),G=l("".slice),ee=!H(function(){var K=/(?:)/,Z=K.exec;K.exec=function(){return Z.apply(this,arguments)};var $="ab".split(K);return $.length!==2||$[0]!=="a"||$[1]!=="b"});h("split",function(K,Z,$){var oe;return"abbc".split(/(b)*/)[1]=="c"||"test".split(/(?:)/,-1).length!=4||"ab".split(/(?:ab)*/).length!=2||".".split(/(.?)(.?)/).length!=4||".".split(/()()/).length>1||"".split(/.?/).length?oe=function(ae,ye){var Y=y(o(this)),le=ye===void 0?F:ye>>>0;if(le===0)return[];if(ae===void 0)return[Y];if(!v(ae))return g(Z,Y,ae,le);for(var xe=[],Ce=(ae.ignoreCase?"i":"")+(ae.multiline?"m":"")+(ae.unicode?"u":"")+(ae.sticky?"y":""),we=0,Le=new RegExp(ae.source,Ce+"g"),de,be,Te;(de=g(w,Le,Y))&&(be=Le.lastIndex,!(be>we&&(U(xe,G(Y,we,de.index)),de.length>1&&de.index<Y.length&&p(B,xe,x(de,1)),Te=de[0].length,we=be,xe.length>=le)));)Le.lastIndex===de.index&&Le.lastIndex++;return we===Y.length?(Te||!P(Le,""))&&U(xe,""):U(xe,G(Y,we)),xe.length>le?x(xe,0,le):xe}:"0".split(void 0,0).length?oe=function(ae,ye){return ae===void 0&&ye===0?[]:g(Z,this,ae,ye)}:oe=Z,[function(ye,Y){var le=o(this),xe=ye==null?void 0:_(ye,K);return xe?g(xe,ye,le,Y):g(oe,y(le),ye,Y)},function(ae,ye){var Y=d(this),le=y(ae),xe=$(oe,Y,le,ye,oe!==Z);if(xe.done)return xe.value;var Ce=s(Y,RegExp),we=Y.unicode,Le=(Y.ignoreCase?"i":"")+(Y.multiline?"m":"")+(Y.unicode?"u":"")+(R?"g":"y"),de=new Ce(R?"^(?:"+Y.source+")":Y,Le),be=ye===void 0?F:ye>>>0;if(be===0)return[];if(le.length===0)return S(de,le)===null?[le]:[];for(var Te=0,Ae=0,Be=[];Ae<le.length;){de.lastIndex=R?0:Ae;var Pe=S(de,R?G(le,Ae):le),_e;if(Pe===null||(_e=D(m(de.lastIndex+(R?Ae:0)),le.length))===Te)Ae=u(le,Ae,we);else{if(U(Be,G(le,Te,Ae)),Be.length===be)return Be;for(var ne=1;ne<=Pe.length-1;ne++)if(U(Be,Pe[ne]),Be.length===be)return Be;Ae=Te=_e}}return U(Be,G(le,Te)),Be}]},!ee,R)},{"../internals/advance-string-index":99,"../internals/an-object":101,"../internals/array-slice-simple":116,"../internals/fails":150,"../internals/fix-regexp-well-known-symbol-logic":151,"../internals/function-apply":152,"../internals/function-call":155,"../internals/function-uncurry-this":157,"../internals/get-method":161,"../internals/is-regexp":182,"../internals/regexp-exec":224,"../internals/regexp-exec-abstract":223,"../internals/regexp-sticky-helpers":227,"../internals/require-object-coercible":230,"../internals/species-constructor":238,"../internals/to-length":249,"../internals/to-string":256}],308:[function(i,M,E){"use strict";var p=i("../internals/export"),g=i("../internals/string-trim").trim,l=i("../internals/string-trim-forced");p({target:"String",proto:!0,forced:l("trim")},{trim:function(){return g(this)}})},{"../internals/export":149,"../internals/string-trim":241,"../internals/string-trim-forced":240}],309:[function(i,M,E){"use strict";var p=i("../internals/export"),g=i("../internals/global"),l=i("../internals/function-call"),h=i("../internals/function-uncurry-this"),v=i("../internals/is-pure"),d=i("../internals/descriptors"),o=i("../internals/native-symbol"),s=i("../internals/fails"),u=i("../internals/has-own-property"),m=i("../internals/object-is-prototype-of"),y=i("../internals/an-object"),_=i("../internals/to-indexed-object"),x=i("../internals/to-property-key"),S=i("../internals/to-string"),w=i("../internals/create-property-descriptor"),A=i("../internals/object-create"),H=i("../internals/object-keys"),R=i("../internals/object-get-own-property-names"),F=i("../internals/object-get-own-property-names-external"),D=i("../internals/object-get-own-property-symbols"),B=i("../internals/object-get-own-property-descriptor"),P=i("../internals/object-define-property"),U=i("../internals/object-define-properties"),G=i("../internals/object-property-is-enumerable"),ee=i("../internals/redefine"),K=i("../internals/shared"),Z=i("../internals/shared-key"),$=i("../internals/hidden-keys"),oe=i("../internals/uid"),ae=i("../internals/well-known-symbol"),ye=i("../internals/well-known-symbol-wrapped"),Y=i("../internals/define-well-known-symbol"),le=i("../internals/symbol-define-to-primitive"),xe=i("../internals/set-to-string-tag"),Ce=i("../internals/internal-state"),we=i("../internals/array-iteration").forEach,Le=Z("hidden"),de="Symbol",be="prototype",Te=Ce.set,Ae=Ce.getterFor(de),Be=Object[be],Pe=g.Symbol,_e=Pe&&Pe[be],ne=g.TypeError,te=g.QObject,T=B.f,I=P.f,re=F.f,q=G.f,z=h([].push),W=K("symbols"),V=K("op-symbols"),se=K("wks"),ge=!te||!te[be]||!te[be].findChild,Me=d&&s(function(){return A(I({},"a",{get:function(){return I(this,"a",{value:7}).a}})).a!=7})?function(qe,Qe,ft){var vt=T(Be,Qe);vt&&delete Be[Qe],I(qe,Qe,ft),vt&&qe!==Be&&I(Be,Qe,vt)}:I,Fe=function(qe,Qe){var ft=W[qe]=A(_e);return Te(ft,{type:de,tag:qe,description:Qe}),d||(ft.description=Qe),ft},Re=function(Qe,ft,vt){Qe===Be&&Re(V,ft,vt),y(Qe);var bt=x(ft);return y(vt),u(W,bt)?(vt.enumerable?(u(Qe,Le)&&Qe[Le][bt]&&(Qe[Le][bt]=!1),vt=A(vt,{enumerable:w(0,!1)})):(u(Qe,Le)||I(Qe,Le,w(1,{})),Qe[Le][bt]=!0),Me(Qe,bt,vt)):I(Qe,bt,vt)},$e=function(Qe,ft){y(Qe);var vt=_(ft),bt=H(vt).concat(nt(vt));return we(bt,function(Tt){(!d||l(Ne,vt,Tt))&&Re(Qe,Tt,vt[Tt])}),Qe},lt=function(Qe,ft){return ft===void 0?A(Qe):$e(A(Qe),ft)},Ne=function(Qe){var ft=x(Qe),vt=l(q,this,ft);return this===Be&&u(W,ft)&&!u(V,ft)?!1:vt||!u(this,ft)||!u(W,ft)||u(this,Le)&&this[Le][ft]?vt:!0},Ze=function(Qe,ft){var vt=_(Qe),bt=x(ft);if(!(vt===Be&&u(W,bt)&&!u(V,bt))){var Tt=T(vt,bt);return Tt&&u(W,bt)&&!(u(vt,Le)&&vt[Le][bt])&&(Tt.enumerable=!0),Tt}},We=function(Qe){var ft=re(_(Qe)),vt=[];return we(ft,function(bt){!u(W,bt)&&!u($,bt)&&z(vt,bt)}),vt},nt=function(qe){var Qe=qe===Be,ft=re(Qe?V:_(qe)),vt=[];return we(ft,function(bt){u(W,bt)&&(!Qe||u(Be,bt))&&z(vt,W[bt])}),vt};o||(Pe=function(){if(m(_e,this))throw ne("Symbol is not a constructor");var Qe=!arguments.length||arguments[0]===void 0?void 0:S(arguments[0]),ft=oe(Qe),vt=function(bt){this===Be&&l(vt,V,bt),u(this,Le)&&u(this[Le],ft)&&(this[Le][ft]=!1),Me(this,ft,w(1,bt))};return d&&ge&&Me(Be,ft,{configurable:!0,set:vt}),Fe(ft,Qe)},_e=Pe[be],ee(_e,"toString",function(){return Ae(this).tag}),ee(Pe,"withoutSetter",function(qe){return Fe(oe(qe),qe)}),G.f=Ne,P.f=Re,U.f=$e,B.f=Ze,R.f=F.f=We,D.f=nt,ye.f=function(qe){return Fe(ae(qe),qe)},d&&(I(_e,"description",{configurable:!0,get:function(){return Ae(this).description}}),v||ee(Be,"propertyIsEnumerable",Ne,{unsafe:!0}))),p({global:!0,wrap:!0,forced:!o,sham:!o},{Symbol:Pe}),we(H(se),function(qe){Y(qe)}),p({target:de,stat:!0,forced:!o},{useSetter:function(){ge=!0},useSimple:function(){ge=!1}}),p({target:"Object",stat:!0,forced:!o,sham:!d},{create:lt,defineProperty:Re,defineProperties:$e,getOwnPropertyDescriptor:Ze}),p({target:"Object",stat:!0,forced:!o},{getOwnPropertyNames:We}),le(),xe(Pe,de),$[Le]=!0},{"../internals/an-object":101,"../internals/array-iteration":111,"../internals/create-property-descriptor":130,"../internals/define-well-known-symbol":133,"../internals/descriptors":134,"../internals/export":149,"../internals/fails":150,"../internals/function-call":155,"../internals/function-uncurry-this":157,"../internals/global":163,"../internals/has-own-property":164,"../internals/hidden-keys":165,"../internals/internal-state":173,"../internals/is-pure":181,"../internals/native-symbol":191,"../internals/object-create":196,"../internals/object-define-properties":197,"../internals/object-define-property":198,"../internals/object-get-own-property-descriptor":199,"../internals/object-get-own-property-names":201,"../internals/object-get-own-property-names-external":200,"../internals/object-get-own-property-symbols":202,"../internals/object-is-prototype-of":204,"../internals/object-keys":206,"../internals/object-property-is-enumerable":207,"../internals/redefine":222,"../internals/set-to-string-tag":234,"../internals/shared":237,"../internals/shared-key":235,"../internals/symbol-define-to-primitive":242,"../internals/to-indexed-object":247,"../internals/to-property-key":254,"../internals/to-string":256,"../internals/uid":263,"../internals/well-known-symbol":268,"../internals/well-known-symbol-wrapped":267}],310:[function(i,M,E){"use strict";var p=i("../internals/export"),g=i("../internals/descriptors"),l=i("../internals/global"),h=i("../internals/function-uncurry-this"),v=i("../internals/has-own-property"),d=i("../internals/is-callable"),o=i("../internals/object-is-prototype-of"),s=i("../internals/to-string"),u=i("../internals/object-define-property").f,m=i("../internals/copy-constructor-properties"),y=l.Symbol,_=y&&y.prototype;if(g&&d(y)&&(!("description"in _)||y().description!==void 0)){var x={},S=function(){var P=arguments.length<1||arguments[0]===void 0?void 0:s(arguments[0]),U=o(_,this)?new y(P):P===void 0?y():y(P);return P===""&&(x[U]=!0),U};m(S,y),S.prototype=_,_.constructor=S;var w=String(y("test"))=="Symbol(test)",A=h(_.toString),H=h(_.valueOf),R=/^Symbol\((.*)\)[^)]+$/,F=h("".replace),D=h("".slice);u(_,"description",{configurable:!0,get:function(){var P=H(this),U=A(P);if(v(x,P))return"";var G=w?D(U,7,-1):F(U,R,"$1");return G===""?void 0:G}}),p({global:!0,forced:!0},{Symbol:S})}},{"../internals/copy-constructor-properties":125,"../internals/descriptors":134,"../internals/export":149,"../internals/function-uncurry-this":157,"../internals/global":163,"../internals/has-own-property":164,"../internals/is-callable":176,"../internals/object-define-property":198,"../internals/object-is-prototype-of":204,"../internals/to-string":256}],311:[function(i,M,E){var p=i("../internals/export"),g=i("../internals/get-built-in"),l=i("../internals/has-own-property"),h=i("../internals/to-string"),v=i("../internals/shared"),d=i("../internals/native-symbol-registry"),o=v("string-to-symbol-registry"),s=v("symbol-to-string-registry");p({target:"Symbol",stat:!0,forced:!d},{for:function(u){var m=h(u);if(l(o,m))return o[m];var y=g("Symbol")(m);return o[m]=y,s[y]=m,y}})},{"../internals/export":149,"../internals/get-built-in":158,"../internals/has-own-property":164,"../internals/native-symbol-registry":190,"../internals/shared":237,"../internals/to-string":256}],312:[function(i,M,E){var p=i("../internals/define-well-known-symbol");p("iterator")},{"../internals/define-well-known-symbol":133}],313:[function(i,M,E){i("../modules/es.symbol.constructor"),i("../modules/es.symbol.for"),i("../modules/es.symbol.key-for"),i("../modules/es.json.stringify"),i("../modules/es.object.get-own-property-symbols")},{"../modules/es.json.stringify":285,"../modules/es.object.get-own-property-symbols":289,"../modules/es.symbol.constructor":309,"../modules/es.symbol.for":311,"../modules/es.symbol.key-for":314}],314:[function(i,M,E){var p=i("../internals/export"),g=i("../internals/has-own-property"),l=i("../internals/is-symbol"),h=i("../internals/try-to-string"),v=i("../internals/shared"),d=i("../internals/native-symbol-registry"),o=v("symbol-to-string-registry");p({target:"Symbol",stat:!0,forced:!d},{keyFor:function(u){if(!l(u))throw TypeError(h(u)+" is not a symbol");if(g(o,u))return o[u]}})},{"../internals/export":149,"../internals/has-own-property":164,"../internals/is-symbol":183,"../internals/native-symbol-registry":190,"../internals/shared":237,"../internals/try-to-string":257}],315:[function(i,M,E){"use strict";var p=i("../internals/function-uncurry-this"),g=i("../internals/array-buffer-view-core"),l=i("../internals/array-copy-within"),h=p(l),v=g.aTypedArray,d=g.exportTypedArrayMethod;d("copyWithin",function(s,u){return h(v(this),s,u,arguments.length>2?arguments[2]:void 0)})},{"../internals/array-buffer-view-core":103,"../internals/array-copy-within":105,"../internals/function-uncurry-this":157}],316:[function(i,M,E){"use strict";var p=i("../internals/array-buffer-view-core"),g=i("../internals/array-iteration").every,l=p.aTypedArray,h=p.exportTypedArrayMethod;h("every",function(d){return g(l(this),d,arguments.length>1?arguments[1]:void 0)})},{"../internals/array-buffer-view-core":103,"../internals/array-iteration":111}],317:[function(i,M,E){"use strict";var p=i("../internals/array-buffer-view-core"),g=i("../internals/function-call"),l=i("../internals/array-fill"),h=p.aTypedArray,v=p.exportTypedArrayMethod;v("fill",function(o){var s=arguments.length;return g(l,h(this),o,s>1?arguments[1]:void 0,s>2?arguments[2]:void 0)})},{"../internals/array-buffer-view-core":103,"../internals/array-fill":106,"../internals/function-call":155}],318:[function(i,M,E){"use strict";var p=i("../internals/array-buffer-view-core"),g=i("../internals/array-iteration").filter,l=i("../internals/typed-array-from-species-and-list"),h=p.aTypedArray,v=p.exportTypedArrayMethod;v("filter",function(o){var s=g(h(this),o,arguments.length>1?arguments[1]:void 0);return l(this,s)})},{"../internals/array-buffer-view-core":103,"../internals/array-iteration":111,"../internals/typed-array-from-species-and-list":260}],319:[function(i,M,E){"use strict";var p=i("../internals/array-buffer-view-core"),g=i("../internals/array-iteration").findIndex,l=p.aTypedArray,h=p.exportTypedArrayMethod;h("findIndex",function(d){return g(l(this),d,arguments.length>1?arguments[1]:void 0)})},{"../internals/array-buffer-view-core":103,"../internals/array-iteration":111}],320:[function(i,M,E){"use strict";var p=i("../internals/array-buffer-view-core"),g=i("../internals/array-iteration").find,l=p.aTypedArray,h=p.exportTypedArrayMethod;h("find",function(d){return g(l(this),d,arguments.length>1?arguments[1]:void 0)})},{"../internals/array-buffer-view-core":103,"../internals/array-iteration":111}],321:[function(i,M,E){"use strict";var p=i("../internals/array-buffer-view-core"),g=i("../internals/array-iteration").forEach,l=p.aTypedArray,h=p.exportTypedArrayMethod;h("forEach",function(d){g(l(this),d,arguments.length>1?arguments[1]:void 0)})},{"../internals/array-buffer-view-core":103,"../internals/array-iteration":111}],322:[function(i,M,E){"use strict";var p=i("../internals/array-buffer-view-core"),g=i("../internals/array-includes").includes,l=p.aTypedArray,h=p.exportTypedArrayMethod;h("includes",function(d){return g(l(this),d,arguments.length>1?arguments[1]:void 0)})},{"../internals/array-buffer-view-core":103,"../internals/array-includes":110}],323:[function(i,M,E){"use strict";var p=i("../internals/array-buffer-view-core"),g=i("../internals/array-includes").indexOf,l=p.aTypedArray,h=p.exportTypedArrayMethod;h("indexOf",function(d){return g(l(this),d,arguments.length>1?arguments[1]:void 0)})},{"../internals/array-buffer-view-core":103,"../internals/array-includes":110}],324:[function(i,M,E){"use strict";var p=i("../internals/global"),g=i("../internals/fails"),l=i("../internals/function-uncurry-this"),h=i("../internals/array-buffer-view-core"),v=i("../modules/es.array.iterator"),d=i("../internals/well-known-symbol"),o=d("iterator"),s=p.Uint8Array,u=l(v.values),m=l(v.keys),y=l(v.entries),_=h.aTypedArray,x=h.exportTypedArrayMethod,S=s&&s.prototype,w=!g(function(){S[o].call([1])}),A=!!S&&S.values&&S[o]===S.values&&S.values.name==="values",H=function(){return u(_(this))};x("entries",function(){return y(_(this))},w),x("keys",function(){return m(_(this))},w),x("values",H,w||!A,{name:"values"}),x(o,H,w||!A,{name:"values"})},{"../internals/array-buffer-view-core":103,"../internals/fails":150,"../internals/function-uncurry-this":157,"../internals/global":163,"../internals/well-known-symbol":268,"../modules/es.array.iterator":278}],325:[function(i,M,E){"use strict";var p=i("../internals/array-buffer-view-core"),g=i("../internals/function-uncurry-this"),l=p.aTypedArray,h=p.exportTypedArrayMethod,v=g([].join);h("join",function(o){return v(l(this),o)})},{"../internals/array-buffer-view-core":103,"../internals/function-uncurry-this":157}],326:[function(i,M,E){"use strict";var p=i("../internals/array-buffer-view-core"),g=i("../internals/function-apply"),l=i("../internals/array-last-index-of"),h=p.aTypedArray,v=p.exportTypedArrayMethod;v("lastIndexOf",function(o){var s=arguments.length;return g(l,h(this),s>1?[o,arguments[1]]:[o])})},{"../internals/array-buffer-view-core":103,"../internals/array-last-index-of":112,"../internals/function-apply":152}],327:[function(i,M,E){"use strict";var p=i("../internals/array-buffer-view-core"),g=i("../internals/array-iteration").map,l=i("../internals/typed-array-species-constructor"),h=p.aTypedArray,v=p.exportTypedArrayMethod;v("map",function(o){return g(h(this),o,arguments.length>1?arguments[1]:void 0,function(s,u){return new(l(s))(u)})})},{"../internals/array-buffer-view-core":103,"../internals/array-iteration":111,"../internals/typed-array-species-constructor":262}],328:[function(i,M,E){"use strict";var p=i("../internals/array-buffer-view-core"),g=i("../internals/array-reduce").right,l=p.aTypedArray,h=p.exportTypedArrayMethod;h("reduceRight",function(d){var o=arguments.length;return g(l(this),d,o,o>1?arguments[1]:void 0)})},{"../internals/array-buffer-view-core":103,"../internals/array-reduce":115}],329:[function(i,M,E){"use strict";var p=i("../internals/array-buffer-view-core"),g=i("../internals/array-reduce").left,l=p.aTypedArray,h=p.exportTypedArrayMethod;h("reduce",function(d){var o=arguments.length;return g(l(this),d,o,o>1?arguments[1]:void 0)})},{"../internals/array-buffer-view-core":103,"../internals/array-reduce":115}],330:[function(i,M,E){"use strict";var p=i("../internals/array-buffer-view-core"),g=p.aTypedArray,l=p.exportTypedArrayMethod,h=Math.floor;l("reverse",function(){for(var d=this,o=g(d).length,s=h(o/2),u=0,m;u<s;)m=d[u],d[u++]=d[--o],d[o]=m;return d})},{"../internals/array-buffer-view-core":103}],331:[function(i,M,E){"use strict";var p=i("../internals/global"),g=i("../internals/function-call"),l=i("../internals/array-buffer-view-core"),h=i("../internals/length-of-array-like"),v=i("../internals/to-offset"),d=i("../internals/to-object"),o=i("../internals/fails"),s=p.RangeError,u=p.Int8Array,m=u&&u.prototype,y=m&&m.set,_=l.aTypedArray,x=l.exportTypedArrayMethod,S=!o(function(){var A=new Uint8ClampedArray(2);return g(y,A,{length:1,0:3},1),A[1]!==3}),w=S&&l.NATIVE_ARRAY_BUFFER_VIEWS&&o(function(){var A=new u(2);return A.set(1),A.set("2",1),A[0]!==0||A[1]!==2});x("set",function(H){_(this);var R=v(arguments.length>1?arguments[1]:void 0,1),F=d(H);if(S)return g(y,this,F,R);var D=this.length,B=h(F),P=0;if(B+R>D)throw s("Wrong length");for(;P<B;)this[R+P]=F[P++]},!S||w)},{"../internals/array-buffer-view-core":103,"../internals/fails":150,"../internals/function-call":155,"../internals/global":163,"../internals/length-of-array-like":188,"../internals/to-object":250,"../internals/to-offset":251}],332:[function(i,M,E){"use strict";var p=i("../internals/array-buffer-view-core"),g=i("../internals/typed-array-species-constructor"),l=i("../internals/fails"),h=i("../internals/array-slice"),v=p.aTypedArray,d=p.exportTypedArrayMethod,o=l(function(){new Int8Array(1).slice()});d("slice",function(u,m){for(var y=h(v(this),u,m),_=g(this),x=0,S=y.length,w=new _(S);S>x;)w[x]=y[x++];return w},o)},{"../internals/array-buffer-view-core":103,"../internals/array-slice":117,"../internals/fails":150,"../internals/typed-array-species-constructor":262}],333:[function(i,M,E){"use strict";var p=i("../internals/array-buffer-view-core"),g=i("../internals/array-iteration").some,l=p.aTypedArray,h=p.exportTypedArrayMethod;h("some",function(d){return g(l(this),d,arguments.length>1?arguments[1]:void 0)})},{"../internals/array-buffer-view-core":103,"../internals/array-iteration":111}],334:[function(i,M,E){"use strict";var p=i("../internals/global"),g=i("../internals/function-uncurry-this"),l=i("../internals/fails"),h=i("../internals/a-callable"),v=i("../internals/array-sort"),d=i("../internals/array-buffer-view-core"),o=i("../internals/engine-ff-version"),s=i("../internals/engine-is-ie-or-edge"),u=i("../internals/engine-v8-version"),m=i("../internals/engine-webkit-version"),y=d.aTypedArray,_=d.exportTypedArrayMethod,x=p.Uint16Array,S=x&&g(x.prototype.sort),w=!!S&&!(l(function(){S(new x(2),null)})&&l(function(){S(new x(2),{})})),A=!!S&&!l(function(){if(u)return u<74;if(o)return o<67;if(s)return!0;if(m)return m<602;var R=new x(516),F=Array(516),D,B;for(D=0;D<516;D++)B=D%4,R[D]=515-D,F[D]=D-2*B+3;for(S(R,function(P,U){return(P/4|0)-(U/4|0)}),D=0;D<516;D++)if(R[D]!==F[D])return!0}),H=function(R){return function(F,D){return R!==void 0?+R(F,D)||0:D!==D?-1:F!==F?1:F===0&&D===0?1/F>0&&1/D<0?1:-1:F>D}};_("sort",function(F){return F!==void 0&&h(F),A?S(this,F):v(y(this),H(F))},!A||w)},{"../internals/a-callable":95,"../internals/array-buffer-view-core":103,"../internals/array-sort":118,"../internals/engine-ff-version":138,"../internals/engine-is-ie-or-edge":140,"../internals/engine-v8-version":146,"../internals/engine-webkit-version":147,"../internals/fails":150,"../internals/function-uncurry-this":157,"../internals/global":163}],335:[function(i,M,E){"use strict";var p=i("../internals/array-buffer-view-core"),g=i("../internals/to-length"),l=i("../internals/to-absolute-index"),h=i("../internals/typed-array-species-constructor"),v=p.aTypedArray,d=p.exportTypedArrayMethod;d("subarray",function(s,u){var m=v(this),y=m.length,_=l(s,y),x=h(m);return new x(m.buffer,m.byteOffset+_*m.BYTES_PER_ELEMENT,g((u===void 0?y:l(u,y))-_))})},{"../internals/array-buffer-view-core":103,"../internals/to-absolute-index":245,"../internals/to-length":249,"../internals/typed-array-species-constructor":262}],336:[function(i,M,E){"use strict";var p=i("../internals/global"),g=i("../internals/function-apply"),l=i("../internals/array-buffer-view-core"),h=i("../internals/fails"),v=i("../internals/array-slice"),d=p.Int8Array,o=l.aTypedArray,s=l.exportTypedArrayMethod,u=[].toLocaleString,m=!!d&&h(function(){u.call(new d(1))}),y=h(function(){return[1,2].toLocaleString()!=new d([1,2]).toLocaleString()})||!h(function(){d.prototype.toLocaleString.call([1,2])});s("toLocaleString",function(){return g(u,m?v(o(this)):o(this),v(arguments))},y)},{"../internals/array-buffer-view-core":103,"../internals/array-slice":117,"../internals/fails":150,"../internals/function-apply":152,"../internals/global":163}],337:[function(i,M,E){"use strict";var p=i("../internals/array-buffer-view-core").exportTypedArrayMethod,g=i("../internals/fails"),l=i("../internals/global"),h=i("../internals/function-uncurry-this"),v=l.Uint8Array,d=v&&v.prototype||{},o=[].toString,s=h([].join);g(function(){o.call({})})&&(o=function(){return s(this)});var u=d.toString!=o;p("toString",o,u)},{"../internals/array-buffer-view-core":103,"../internals/fails":150,"../internals/function-uncurry-this":157,"../internals/global":163}],338:[function(i,M,E){var p=i("../internals/typed-array-constructor");p("Uint8",function(g){return function(h,v,d){return g(this,h,v,d)}})},{"../internals/typed-array-constructor":258}],339:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/dom-iterables"),l=i("../internals/dom-token-list-prototype"),h=i("../internals/array-for-each"),v=i("../internals/create-non-enumerable-property"),d=function(s){if(s&&s.forEach!==h)try{v(s,"forEach",h)}catch(u){s.forEach=h}};for(var o in g)g[o]&&d(p[o]&&p[o].prototype);d(l)},{"../internals/array-for-each":107,"../internals/create-non-enumerable-property":129,"../internals/dom-iterables":136,"../internals/dom-token-list-prototype":137,"../internals/global":163}],340:[function(i,M,E){var p=i("../internals/global"),g=i("../internals/dom-iterables"),l=i("../internals/dom-token-list-prototype"),h=i("../modules/es.array.iterator"),v=i("../internals/create-non-enumerable-property"),d=i("../internals/well-known-symbol"),o=d("iterator"),s=d("toStringTag"),u=h.values,m=function(_,x){if(_){if(_[o]!==u)try{v(_,o,u)}catch(w){_[o]=u}if(_[s]||v(_,s,x),g[x]){for(var S in h)if(_[S]!==h[S])try{v(_,S,h[S])}catch(w){_[S]=h[S]}}}};for(var y in g)m(p[y]&&p[y].prototype,y);m(l,"DOMTokenList")},{"../internals/create-non-enumerable-property":129,"../internals/dom-iterables":136,"../internals/dom-token-list-prototype":137,"../internals/global":163,"../internals/well-known-symbol":268,"../modules/es.array.iterator":278}],341:[function(i,M,E){function p(A){return Array.isArray?Array.isArray(A):w(A)==="[object Array]"}E.isArray=p;function g(A){return typeof A=="boolean"}E.isBoolean=g;function l(A){return A===null}E.isNull=l;function h(A){return A==null}E.isNullOrUndefined=h;function v(A){return typeof A=="number"}E.isNumber=v;function d(A){return typeof A=="string"}E.isString=d;function o(A){return typeof A=="symbol"}E.isSymbol=o;function s(A){return A===void 0}E.isUndefined=s;function u(A){return w(A)==="[object RegExp]"}E.isRegExp=u;function m(A){return typeof A=="object"&&A!==null}E.isObject=m;function y(A){return w(A)==="[object Date]"}E.isDate=y;function _(A){return w(A)==="[object Error]"||A instanceof Error}E.isError=_;function x(A){return typeof A=="function"}E.isFunction=x;function S(A){return A===null||typeof A=="boolean"||typeof A=="number"||typeof A=="string"||typeof A=="symbol"||typeof A=="undefined"}E.isPrimitive=S,E.isBuffer=i("buffer").Buffer.isBuffer;function w(A){return Object.prototype.toString.call(A)}},{buffer:90}],342:[function(i,M,E){(function(p){"use strict";var g=function(){var o=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|'[^']*'|'[^']*'/g,s=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,u=/[^-+\dA-Z]/g;return function(m,y,_,x){if(arguments.length===1&&d(m)==="string"&&!/\d/.test(m)&&(y=m,m=void 0),m=m||new Date,m instanceof Date||(m=new Date(m)),isNaN(m))throw TypeError("Invalid date");y=String(g.masks[y]||y||g.masks.default);var S=y.slice(0,4);(S==="UTC:"||S==="GMT:")&&(y=y.slice(4),_=!0,S==="GMT:"&&(x=!0));var w=_?"getUTC":"get",A=m[w+"Date"](),H=m[w+"Day"](),R=m[w+"Month"](),F=m[w+"FullYear"](),D=m[w+"Hours"](),B=m[w+"Minutes"](),P=m[w+"Seconds"](),U=m[w+"Milliseconds"](),G=_?0:m.getTimezoneOffset(),ee=h(m),K=v(m),Z={d:A,dd:l(A),ddd:g.i18n.dayNames[H],dddd:g.i18n.dayNames[H+7],m:R+1,mm:l(R+1),mmm:g.i18n.monthNames[R],mmmm:g.i18n.monthNames[R+12],yy:String(F).slice(2),yyyy:F,h:D%12||12,hh:l(D%12||12),H:D,HH:l(D),M:B,MM:l(B),s:P,ss:l(P),l:l(U,3),L:l(Math.round(U/10)),t:D<12?"a":"p",tt:D<12?"am":"pm",T:D<12?"A":"P",TT:D<12?"AM":"PM",Z:x?"GMT":_?"UTC":(String(m).match(s)||[""]).pop().replace(u,""),o:(G>0?"-":"+")+l(Math.floor(Math.abs(G)/60)*100+Math.abs(G)%60,4),S:["th","st","nd","rd"][A%10>3?0:(A%100-A%10!=10)*A%10],W:ee,N:K};return y.replace(o,function($){return $ in Z?Z[$]:$.slice(1,$.length-1)})}}();g.masks={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},g.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]};function l(o,s){for(o=String(o),s=s||2;o.length<s;)o="0"+o;return o}function h(o){var s=new Date(o.getFullYear(),o.getMonth(),o.getDate());s.setDate(s.getDate()-(s.getDay()+6)%7+3);var u=new Date(s.getFullYear(),0,4);u.setDate(u.getDate()-(u.getDay()+6)%7+3);var m=s.getTimezoneOffset()-u.getTimezoneOffset();s.setHours(s.getHours()-m);var y=(s-u)/(864e5*7);return 1+Math.floor(y)}function v(o){var s=o.getDay();return s===0&&(s=7),s}function d(o){return o===null?"null":o===void 0?"undefined":typeof o!="object"?typeof o:Array.isArray(o)?"array":{}.toString.call(o).slice(8,-1).toLowerCase()}typeof Q=="function"&&Q.amd?Q(function(){return g}):typeof E=="object"?M.exports=g:p.dateFormat=g})(this)},{}],343:[function(i,M,E){"use strict";var p=/["'&<>]/;M.exports=g;function g(l){var h=""+l,v=p.exec(h);if(!v)return h;var d,o="",s=0,u=0;for(s=v.index;s<h.length;s++){switch(h.charCodeAt(s)){case 34:d="&quot;";break;case 38:d="&amp;";break;case 39:d="&#39;";break;case 60:d="&lt;";break;case 62:d="&gt;";break;default:continue}u!==s&&(o+=h.substring(u,s)),u=s+1,o+=d}return u!==s?o+h.substring(u,s):o}},{}],344:[function(i,M,E){"use strict";var p=typeof Reflect=="object"?Reflect:null,g=p&&typeof p.apply=="function"?p.apply:function(P,U,G){return Function.prototype.apply.call(P,U,G)},l;p&&typeof p.ownKeys=="function"?l=p.ownKeys:Object.getOwnPropertySymbols?l=function(P){return Object.getOwnPropertyNames(P).concat(Object.getOwnPropertySymbols(P))}:l=function(P){return Object.getOwnPropertyNames(P)};function h(B){console&&console.warn&&console.warn(B)}var v=Number.isNaN||function(P){return P!==P};function d(){d.init.call(this)}M.exports=d,M.exports.once=R,d.EventEmitter=d,d.prototype._events=void 0,d.prototype._eventsCount=0,d.prototype._maxListeners=void 0;var o=10;function s(B){if(typeof B!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof B)}Object.defineProperty(d,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(B){if(typeof B!="number"||B<0||v(B))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+B+".");o=B}}),d.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},d.prototype.setMaxListeners=function(P){if(typeof P!="number"||P<0||v(P))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+P+".");return this._maxListeners=P,this};function u(B){return B._maxListeners===void 0?d.defaultMaxListeners:B._maxListeners}d.prototype.getMaxListeners=function(){return u(this)},d.prototype.emit=function(P){for(var U=[],G=1;G<arguments.length;G++)U.push(arguments[G]);var ee=P==="error",K=this._events;if(K!==void 0)ee=ee&&K.error===void 0;else if(!ee)return!1;if(ee){var Z;if(U.length>0&&(Z=U[0]),Z instanceof Error)throw Z;var $=new Error("Unhandled error."+(Z?" ("+Z.message+")":""));throw $.context=Z,$}var oe=K[P];if(oe===void 0)return!1;if(typeof oe=="function")g(oe,this,U);else for(var ae=oe.length,ye=w(oe,ae),G=0;G<ae;++G)g(ye[G],this,U);return!0};function m(B,P,U,G){var ee,K,Z;if(s(U),K=B._events,K===void 0?(K=B._events=Object.create(null),B._eventsCount=0):(K.newListener!==void 0&&(B.emit("newListener",P,U.listener?U.listener:U),K=B._events),Z=K[P]),Z===void 0)Z=K[P]=U,++B._eventsCount;else if(typeof Z=="function"?Z=K[P]=G?[U,Z]:[Z,U]:G?Z.unshift(U):Z.push(U),ee=u(B),ee>0&&Z.length>ee&&!Z.warned){Z.warned=!0;var $=new Error("Possible EventEmitter memory leak detected. "+Z.length+" "+String(P)+" listeners added. Use emitter.setMaxListeners() to increase limit");$.name="MaxListenersExceededWarning",$.emitter=B,$.type=P,$.count=Z.length,h($)}return B}d.prototype.addListener=function(P,U){return m(this,P,U,!1)},d.prototype.on=d.prototype.addListener,d.prototype.prependListener=function(P,U){return m(this,P,U,!0)};function y(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _(B,P,U){var G={fired:!1,wrapFn:void 0,target:B,type:P,listener:U},ee=y.bind(G);return ee.listener=U,G.wrapFn=ee,ee}d.prototype.once=function(P,U){return s(U),this.on(P,_(this,P,U)),this},d.prototype.prependOnceListener=function(P,U){return s(U),this.prependListener(P,_(this,P,U)),this},d.prototype.removeListener=function(P,U){var G,ee,K,Z,$;if(s(U),ee=this._events,ee===void 0)return this;if(G=ee[P],G===void 0)return this;if(G===U||G.listener===U)--this._eventsCount===0?this._events=Object.create(null):(delete ee[P],ee.removeListener&&this.emit("removeListener",P,G.listener||U));else if(typeof G!="function"){for(K=-1,Z=G.length-1;Z>=0;Z--)if(G[Z]===U||G[Z].listener===U){$=G[Z].listener,K=Z;break}if(K<0)return this;K===0?G.shift():A(G,K),G.length===1&&(ee[P]=G[0]),ee.removeListener!==void 0&&this.emit("removeListener",P,$||U)}return this},d.prototype.off=d.prototype.removeListener,d.prototype.removeAllListeners=function(P){var U,G,ee;if(G=this._events,G===void 0)return this;if(G.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):G[P]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete G[P]),this;if(arguments.length===0){var K=Object.keys(G),Z;for(ee=0;ee<K.length;++ee)Z=K[ee],Z!=="removeListener"&&this.removeAllListeners(Z);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(U=G[P],typeof U=="function")this.removeListener(P,U);else if(U!==void 0)for(ee=U.length-1;ee>=0;ee--)this.removeListener(P,U[ee]);return this};function x(B,P,U){var G=B._events;if(G===void 0)return[];var ee=G[P];return ee===void 0?[]:typeof ee=="function"?U?[ee.listener||ee]:[ee]:U?H(ee):w(ee,ee.length)}d.prototype.listeners=function(P){return x(this,P,!0)},d.prototype.rawListeners=function(P){return x(this,P,!1)},d.listenerCount=function(B,P){return typeof B.listenerCount=="function"?B.listenerCount(P):S.call(B,P)},d.prototype.listenerCount=S;function S(B){var P=this._events;if(P!==void 0){var U=P[B];if(typeof U=="function")return 1;if(U!==void 0)return U.length}return 0}d.prototype.eventNames=function(){return this._eventsCount>0?l(this._events):[]};function w(B,P){for(var U=new Array(P),G=0;G<P;++G)U[G]=B[G];return U}function A(B,P){for(;P+1<B.length;P++)B[P]=B[P+1];B.pop()}function H(B){for(var P=new Array(B.length),U=0;U<P.length;++U)P[U]=B[U].listener||B[U];return P}function R(B,P){return new Promise(function(U,G){function ee(Z){B.removeListener(P,K),G(Z)}function K(){typeof B.removeListener=="function"&&B.removeListener("error",ee),U([].slice.call(arguments))}D(B,P,K,{once:!0}),P!=="error"&&F(B,ee,{once:!0})})}function F(B,P,U){typeof B.on=="function"&&D(B,"error",P,U)}function D(B,P,U,G){if(typeof B.on=="function")G.once?B.once(P,U):B.on(P,U);else if(typeof B.addEventListener=="function")B.addEventListener(P,function ee(K){G.once&&B.removeEventListener(P,ee),U(K)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof B)}},{}],345:[function(i,M,E){"use strict";var p=i("is-callable"),g=Object.prototype.toString,l=Object.prototype.hasOwnProperty,h=function(u,m,y){for(var _=0,x=u.length;_<x;_++)l.call(u,_)&&(y==null?m(u[_],_,u):m.call(y,u[_],_,u))},v=function(u,m,y){for(var _=0,x=u.length;_<x;_++)y==null?m(u.charAt(_),_,u):m.call(y,u.charAt(_),_,u)},d=function(u,m,y){for(var _ in u)l.call(u,_)&&(y==null?m(u[_],_,u):m.call(y,u[_],_,u))},o=function(u,m,y){if(!p(m))throw new TypeError("iterator must be a function");var _;arguments.length>=3&&(_=y),g.call(u)==="[object Array]"?h(u,m,_):typeof u=="string"?v(u,m,_):d(u,m,_)};M.exports=o},{"is-callable":367}],346:[function(i,M,E){"use strict";var p="Function.prototype.bind called on incompatible ",g=Array.prototype.slice,l=Object.prototype.toString,h="[object Function]";M.exports=function(d){var o=this;if(typeof o!="function"||l.call(o)!==h)throw new TypeError(p+o);for(var s=g.call(arguments,1),u,m=function(){if(this instanceof u){var w=o.apply(this,s.concat(g.call(arguments)));return Object(w)===w?w:this}else return o.apply(d,s.concat(g.call(arguments)))},y=Math.max(0,o.length-s.length),_=[],x=0;x<y;x++)_.push("$"+x);if(u=Function("binder","return function ("+_.join(",")+"){ return binder.apply(this,arguments); }")(m),o.prototype){var S=function(){};S.prototype=o.prototype,u.prototype=new S,S.prototype=null}return u}},{}],347:[function(i,M,E){"use strict";var p=i("./implementation");M.exports=Function.prototype.bind||p},{"./implementation":346}],348:[function(i,M,E){"use strict";var p,g=SyntaxError,l=Function,h=TypeError,v=function(oe){try{return l('"use strict"; return ('+oe+").constructor;")()}catch(ae){}},d=Object.getOwnPropertyDescriptor;if(d)try{d({},"")}catch(oe){d=null}var o=function(){throw new h},s=d?function(){try{return arguments.callee,o}catch(oe){try{return d(arguments,"callee").get}catch(ae){return o}}}():o,u=i("has-symbols")(),m=i("has-proto")(),y=Object.getPrototypeOf||(m?function(oe){return oe.__proto__}:null),_={},x=typeof Uint8Array=="undefined"||!y?p:y(Uint8Array),S={"%AggregateError%":typeof AggregateError=="undefined"?p:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?p:ArrayBuffer,"%ArrayIteratorPrototype%":u&&y?y([][Symbol.iterator]()):p,"%AsyncFromSyncIteratorPrototype%":p,"%AsyncFunction%":_,"%AsyncGenerator%":_,"%AsyncGeneratorFunction%":_,"%AsyncIteratorPrototype%":_,"%Atomics%":typeof Atomics=="undefined"?p:Atomics,"%BigInt%":typeof BigInt=="undefined"?p:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?p:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?p:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?p:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array=="undefined"?p:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?p:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?p:FinalizationRegistry,"%Function%":l,"%GeneratorFunction%":_,"%Int8Array%":typeof Int8Array=="undefined"?p:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?p:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?p:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":u&&y?y(y([][Symbol.iterator]())):p,"%JSON%":typeof JSON=="object"?JSON:p,"%Map%":typeof Map=="undefined"?p:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!u||!y?p:y(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?p:Promise,"%Proxy%":typeof Proxy=="undefined"?p:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect=="undefined"?p:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?p:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!u||!y?p:y(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?p:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":u&&y?y(""[Symbol.iterator]()):p,"%Symbol%":u?Symbol:p,"%SyntaxError%":g,"%ThrowTypeError%":s,"%TypedArray%":x,"%TypeError%":h,"%Uint8Array%":typeof Uint8Array=="undefined"?p:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?p:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?p:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?p:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap=="undefined"?p:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?p:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?p:WeakSet};if(y)try{null.error}catch(oe){var w=y(y(oe));S["%Error.prototype%"]=w}var A=function oe(ae){var ye;if(ae==="%AsyncFunction%")ye=v("async function () {}");else if(ae==="%GeneratorFunction%")ye=v("function* () {}");else if(ae==="%AsyncGeneratorFunction%")ye=v("async function* () {}");else if(ae==="%AsyncGenerator%"){var Y=oe("%AsyncGeneratorFunction%");Y&&(ye=Y.prototype)}else if(ae==="%AsyncIteratorPrototype%"){var le=oe("%AsyncGenerator%");le&&y&&(ye=y(le.prototype))}return S[ae]=ye,ye},H={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},R=i("function-bind"),F=i("has"),D=R.call(Function.call,Array.prototype.concat),B=R.call(Function.apply,Array.prototype.splice),P=R.call(Function.call,String.prototype.replace),U=R.call(Function.call,String.prototype.slice),G=R.call(Function.call,RegExp.prototype.exec),ee=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,K=/\\(\\)?/g,Z=function(ae){var ye=U(ae,0,1),Y=U(ae,-1);if(ye==="%"&&Y!=="%")throw new g("invalid intrinsic syntax, expected closing `%`");if(Y==="%"&&ye!=="%")throw new g("invalid intrinsic syntax, expected opening `%`");var le=[];return P(ae,ee,function(xe,Ce,we,Le){le[le.length]=we?P(Le,K,"$1"):Ce||xe}),le},$=function(ae,ye){var Y=ae,le;if(F(H,Y)&&(le=H[Y],Y="%"+le[0]+"%"),F(S,Y)){var xe=S[Y];if(xe===_&&(xe=A(Y)),typeof xe=="undefined"&&!ye)throw new h("intrinsic "+ae+" exists, but is not available. Please file an issue!");return{alias:le,name:Y,value:xe}}throw new g("intrinsic "+ae+" does not exist!")};M.exports=function(ae,ye){if(typeof ae!="string"||ae.length===0)throw new h("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ye!="boolean")throw new h('"allowMissing" argument must be a boolean');if(G(/^%?[^%]*%?$/,ae)===null)throw new g("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Y=Z(ae),le=Y.length>0?Y[0]:"",xe=$("%"+le+"%",ye),Ce=xe.name,we=xe.value,Le=!1,de=xe.alias;de&&(le=de[0],B(Y,D([0,1],de)));for(var be=1,Te=!0;be<Y.length;be+=1){var Ae=Y[be],Be=U(Ae,0,1),Pe=U(Ae,-1);if((Be==='"'||Be==="'"||Be==="`"||Pe==='"'||Pe==="'"||Pe==="`")&&Be!==Pe)throw new g("property names with quotes must have matching quotes");if((Ae==="constructor"||!Te)&&(Le=!0),le+="."+Ae,Ce="%"+le+"%",F(S,Ce))we=S[Ce];else if(we!=null){if(!(Ae in we)){if(!ye)throw new h("base intrinsic for "+ae+" exists, but the property is not available.");return}if(d&&be+1>=Y.length){var _e=d(we,Ae);Te=!!_e,Te&&"get"in _e&&!("originalValue"in _e.get)?we=_e.get:we=we[Ae]}else Te=F(we,Ae),we=we[Ae];Te&&!Le&&(S[Ce]=we)}}return we}},{"function-bind":347,has:354,"has-proto":350,"has-symbols":351}],349:[function(i,M,E){"use strict";var p=i("get-intrinsic"),g=p("%Object.getOwnPropertyDescriptor%",!0);if(g)try{g([],"length")}catch(l){g=null}M.exports=g},{"get-intrinsic":348}],350:[function(i,M,E){"use strict";var p={foo:{}},g=Object;M.exports=function(){return{__proto__:p}.foo===p.foo&&!({__proto__:null}instanceof g)}},{}],351:[function(i,M,E){"use strict";var p=typeof Symbol!="undefined"&&Symbol,g=i("./shams");M.exports=function(){return typeof p!="function"||typeof Symbol!="function"||typeof p("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:g()}},{"./shams":352}],352:[function(i,M,E){"use strict";M.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var g={},l=Symbol("test"),h=Object(l);if(typeof l=="string"||Object.prototype.toString.call(l)!=="[object Symbol]"||Object.prototype.toString.call(h)!=="[object Symbol]")return!1;var v=42;g[l]=v;for(l in g)return!1;if(typeof Object.keys=="function"&&Object.keys(g).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(g).length!==0)return!1;var d=Object.getOwnPropertySymbols(g);if(d.length!==1||d[0]!==l||!Object.prototype.propertyIsEnumerable.call(g,l))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(g,l);if(o.value!==v||o.enumerable!==!0)return!1}return!0}},{}],353:[function(i,M,E){"use strict";var p=i("has-symbols/shams");M.exports=function(){return p()&&!!Symbol.toStringTag}},{"has-symbols/shams":352}],354:[function(i,M,E){"use strict";var p=i("function-bind");M.exports=p.call(Function.call,Object.prototype.hasOwnProperty)},{"function-bind":347}],355:[function(i,M,E){var p=i("http"),g=i("url"),l=M.exports;for(var h in p)p.hasOwnProperty(h)&&(l[h]=p[h]);l.request=function(d,o){return d=v(d),p.request.call(this,d,o)},l.get=function(d,o){return d=v(d),p.get.call(this,d,o)};function v(d){if(typeof d=="string"&&(d=g.parse(d)),d.protocol||(d.protocol="https:"),d.protocol!=="https:")throw new Error('Protocol "'+d.protocol+'" not supported. Expected "https:"');return d}},{http:468,url:472}],356:[function(i,M,E){"use strict";var p=i("util"),g=i("ms");M.exports=function(l){if(typeof l=="number")return l;var h=g(l);if(h===void 0){var v=new Error(p.format("humanize-ms(%j) result undefined",l));console.warn(v.stack)}return h}},{ms:376,util:419}],357:[function(i,M,E){E.read=function(p,g,l,h,v){var d,o,s=v*8-h-1,u=(1<<s)-1,m=u>>1,y=-7,_=l?v-1:0,x=l?-1:1,S=p[g+_];for(_+=x,d=S&(1<<-y)-1,S>>=-y,y+=s;y>0;d=d*256+p[g+_],_+=x,y-=8);for(o=d&(1<<-y)-1,d>>=-y,y+=h;y>0;o=o*256+p[g+_],_+=x,y-=8);if(d===0)d=1-m;else{if(d===u)return o?NaN:(S?-1:1)*(1/0);o=o+Math.pow(2,h),d=d-m}return(S?-1:1)*o*Math.pow(2,d-h)},E.write=function(p,g,l,h,v,d){var o,s,u,m=d*8-v-1,y=(1<<m)-1,_=y>>1,x=v===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=h?0:d-1,w=h?1:-1,A=g<0||g===0&&1/g<0?1:0;for(g=Math.abs(g),isNaN(g)||g===1/0?(s=isNaN(g)?1:0,o=y):(o=Math.floor(Math.log(g)/Math.LN2),g*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+_>=1?g+=x/u:g+=x*Math.pow(2,1-_),g*u>=2&&(o++,u/=2),o+_>=y?(s=0,o=y):o+_>=1?(s=(g*u-1)*Math.pow(2,v),o=o+_):(s=g*Math.pow(2,_-1)*Math.pow(2,v),o=0));v>=8;p[l+S]=s&255,S+=w,s/=256,v-=8);for(o=o<<v|s,m+=v;m>0;p[l+S]=o&255,S+=w,o/=256,m-=8);p[l+S-w]|=A*128}},{}],358:[function(i,M,E){"use strict";var p=[i("./nextTick"),i("./queueMicrotask"),i("./mutation.js"),i("./messageChannel"),i("./stateChange"),i("./timeout")],g,l,h=-1,v=[],d=!1;function o(){!g||!l||(g=!1,l.length?v=l.concat(v):h=-1,v.length&&s())}function s(){if(!g){d=!1,g=!0;for(var S=v.length,w=setTimeout(o);S;){for(l=v,v=[];l&&++h<S;)l[h].run();h=-1,S=v.length}l=null,h=-1,g=!1,clearTimeout(w)}}for(var u,m=-1,y=p.length;++m<y;)if(p[m]&&p[m].test&&p[m].test()){u=p[m].install(s);break}function _(S,w){this.fun=S,this.array=w}_.prototype.run=function(){var S=this.fun,w=this.array;switch(w.length){case 0:return S();case 1:return S(w[0]);case 2:return S(w[0],w[1]);case 3:return S(w[0],w[1],w[2]);default:return S.apply(null,w)}},M.exports=x;function x(S){var w=new Array(arguments.length-1);if(arguments.length>1)for(var A=1;A<arguments.length;A++)w[A-1]=arguments[A];v.push(new _(S,w)),!d&&!g&&(d=!0,u())}},{"./messageChannel":359,"./mutation.js":360,"./nextTick":89,"./queueMicrotask":361,"./stateChange":362,"./timeout":363}],359:[function(i,M,E){(function(p){(function(){"use strict";E.test=function(){return p.setImmediate?!1:typeof p.MessageChannel!="undefined"},E.install=function(g){var l=new p.MessageChannel;return l.port1.onmessage=g,function(){l.port2.postMessage(0)}}}).call(this)}).call(this,typeof Ue!="undefined"?Ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],360:[function(i,M,E){(function(p){(function(){"use strict";var g=p.MutationObserver||p.WebKitMutationObserver;E.test=function(){return g},E.install=function(l){var h=0,v=new g(l),d=p.document.createTextNode("");return v.observe(d,{characterData:!0}),function(){d.data=h=++h%2}}}).call(this)}).call(this,typeof Ue!="undefined"?Ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],361:[function(i,M,E){(function(p){(function(){"use strict";E.test=function(){return typeof p.queueMicrotask=="function"},E.install=function(g){return function(){p.queueMicrotask(g)}}}).call(this)}).call(this,typeof Ue!="undefined"?Ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],362:[function(i,M,E){(function(p){(function(){"use strict";E.test=function(){return"document"in p&&"onreadystatechange"in p.document.createElement("script")},E.install=function(g){return function(){var l=p.document.createElement("script");return l.onreadystatechange=function(){g(),l.onreadystatechange=null,l.parentNode.removeChild(l),l=null},p.document.documentElement.appendChild(l),g}}}).call(this)}).call(this,typeof Ue!="undefined"?Ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],363:[function(i,M,E){"use strict";E.test=function(){return!0},E.install=function(p){return function(){setTimeout(p,0)}}},{}],364:[function(i,M,E){typeof Object.create=="function"?M.exports=function(g,l){l&&(g.super_=l,g.prototype=Object.create(l.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}))}:M.exports=function(g,l){if(l){g.super_=l;var h=function(){};h.prototype=l.prototype,g.prototype=new h,g.prototype.constructor=g}}},{}],365:[function(i,M,E){"use strict";var p=i("has-tostringtag/shams")(),g=i("call-bind/callBound"),l=g("Object.prototype.toString"),h=function(s){return p&&s&&typeof s=="object"&&Symbol.toStringTag in s?!1:l(s)==="[object Arguments]"},v=function(s){return h(s)?!0:s!==null&&typeof s=="object"&&typeof s.length=="number"&&s.length>=0&&l(s)!=="[object Array]"&&l(s.callee)==="[object Function]"},d=function(){return h(arguments)}();h.isLegacyArguments=v,M.exports=d?h:v},{"call-bind/callBound":92,"has-tostringtag/shams":353}],366:[function(i,M,E){M.exports=function(l){return l!=null&&(p(l)||g(l)||!!l._isBuffer)};function p(l){return!!l.constructor&&typeof l.constructor.isBuffer=="function"&&l.constructor.isBuffer(l)}function g(l){return typeof l.readFloatLE=="function"&&typeof l.slice=="function"&&p(l.slice(0,0))}},{}],367:[function(i,M,E){"use strict";var p=Function.prototype.toString,g=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,l,h;if(typeof g=="function"&&typeof Object.defineProperty=="function")try{l=Object.defineProperty({},"length",{get:function(){throw h}}),h={},g(function(){throw 42},null,l)}catch(F){F!==h&&(g=null)}else g=null;var v=/^\s*class\b/,d=function(D){try{var B=p.call(D);return v.test(B)}catch(P){return!1}},o=function(D){try{return d(D)?!1:(p.call(D),!0)}catch(B){return!1}},s=Object.prototype.toString,u="[object Object]",m="[object Function]",y="[object GeneratorFunction]",_="[object HTMLAllCollection]",x="[object HTML document.all class]",S="[object HTMLCollection]",w=typeof Symbol=="function"&&!!Symbol.toStringTag,A=!(0 in[,]),H=function(){return!1};if(typeof document=="object"){var R=document.all;s.call(R)===s.call(document.all)&&(H=function(D){if((A||!D)&&(typeof D=="undefined"||typeof D=="object"))try{var B=s.call(D);return(B===_||B===x||B===S||B===u)&&D("")==null}catch(P){}return!1})}M.exports=g?function(D){if(H(D))return!0;if(!D||typeof D!="function"&&typeof D!="object")return!1;try{g(D,null,l)}catch(B){if(B!==h)return!1}return!d(D)&&o(D)}:function(D){if(H(D))return!0;if(!D||typeof D!="function"&&typeof D!="object")return!1;if(w)return o(D);if(d(D))return!1;var B=s.call(D);return B!==m&&B!==y&&!/^\[object HTML/.test(B)?!1:o(D)}},{}],368:[function(i,M,E){"use strict";var p=Object.prototype.toString,g=Function.prototype.toString,l=/^\s*(?:function)?\*/,h=i("has-tostringtag/shams")(),v=Object.getPrototypeOf,d=function(){if(!h)return!1;try{return Function("return function*() {}")()}catch(s){}},o;M.exports=function(u){if(typeof u!="function")return!1;if(l.test(g.call(u)))return!0;if(!h){var m=p.call(u);return m==="[object GeneratorFunction]"}if(!v)return!1;if(typeof o=="undefined"){var y=d();o=y?v(y):!1}return v(u)===o}},{"has-tostringtag/shams":353}],369:[function(i,M,E){"use strict";var p=i("which-typed-array");M.exports=function(l){return!!p(l)}},{"which-typed-array":420}],370:[function(i,M,E){var p={}.toString;M.exports=Array.isArray||function(g){return p.call(g)=="[object Array]"}},{}],371:[function(i,M,E){(function(p){(function(){(function(g,l){typeof E=="object"&&typeof M!="undefined"?M.exports=l(g):typeof Q=="function"&&Q.amd?Q(l):l(g)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof p!="undefined"?p:this,function(g){"use strict";g=g||{};var l=g.Base64,h="2.6.4",v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=function(ae){for(var ye={},Y=0,le=ae.length;Y<le;Y++)ye[ae.charAt(Y)]=Y;return ye}(v),o=String.fromCharCode,s=function(ae){if(ae.length<2){var ye=ae.charCodeAt(0);return ye<128?ae:ye<2048?o(192|ye>>>6)+o(128|ye&63):o(224|ye>>>12&15)+o(128|ye>>>6&63)+o(128|ye&63)}else{var ye=65536+(ae.charCodeAt(0)-55296)*1024+(ae.charCodeAt(1)-56320);return o(240|ye>>>18&7)+o(128|ye>>>12&63)+o(128|ye>>>6&63)+o(128|ye&63)}},u=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,m=function(ae){return ae.replace(u,s)},y=function(ae){var ye=[0,2,1][ae.length%3],Y=ae.charCodeAt(0)<<16|(ae.length>1?ae.charCodeAt(1):0)<<8|(ae.length>2?ae.charCodeAt(2):0),le=[v.charAt(Y>>>18),v.charAt(Y>>>12&63),ye>=2?"=":v.charAt(Y>>>6&63),ye>=1?"=":v.charAt(Y&63)];return le.join("")},_=g.btoa&&typeof g.btoa=="function"?function(ae){return g.btoa(ae)}:function(ae){if(ae.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return ae.replace(/[\s\S]{1,3}/g,y)},x=function(ae){return _(m(String(ae)))},S=function(ae){return ae.replace(/[+\/]/g,function(ye){return ye=="+"?"-":"_"}).replace(/=/g,"")},w=function(ae,ye){return ye?S(x(ae)):x(ae)},A=function(ae){return w(ae,!0)},H;g.Uint8Array&&(H=function(ae,ye){for(var Y="",le=0,xe=ae.length;le<xe;le+=3){var Ce=ae[le],we=ae[le+1],Le=ae[le+2],de=Ce<<16|we<<8|Le;Y+=v.charAt(de>>>18)+v.charAt(de>>>12&63)+(typeof we!="undefined"?v.charAt(de>>>6&63):"=")+(typeof Le!="undefined"?v.charAt(de&63):"=")}return ye?S(Y):Y});var R=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,F=function(ae){switch(ae.length){case 4:var ye=(7&ae.charCodeAt(0))<<18|(63&ae.charCodeAt(1))<<12|(63&ae.charCodeAt(2))<<6|63&ae.charCodeAt(3),Y=ye-65536;return o((Y>>>10)+55296)+o((Y&1023)+56320);case 3:return o((15&ae.charCodeAt(0))<<12|(63&ae.charCodeAt(1))<<6|63&ae.charCodeAt(2));default:return o((31&ae.charCodeAt(0))<<6|63&ae.charCodeAt(1))}},D=function(ae){return ae.replace(R,F)},B=function(ae){var ye=ae.length,Y=ye%4,le=(ye>0?d[ae.charAt(0)]<<18:0)|(ye>1?d[ae.charAt(1)]<<12:0)|(ye>2?d[ae.charAt(2)]<<6:0)|(ye>3?d[ae.charAt(3)]:0),xe=[o(le>>>16),o(le>>>8&255),o(le&255)];return xe.length-=[0,0,2,1][Y],xe.join("")},P=g.atob&&typeof g.atob=="function"?function(ae){return g.atob(ae)}:function(ae){return ae.replace(/\S{1,4}/g,B)},U=function(ae){return P(String(ae).replace(/[^A-Za-z0-9\+\/]/g,""))},G=function(ae){return D(P(ae))},ee=function(ae){return String(ae).replace(/[-_]/g,function(ye){return ye=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},K=function(ae){return G(ee(ae))},Z;g.Uint8Array&&(Z=function(ae){return Uint8Array.from(U(ee(ae)),function(ye){return ye.charCodeAt(0)})});var $=function(){var ae=g.Base64;return g.Base64=l,ae};if(g.Base64={VERSION:h,atob:U,btoa:_,fromBase64:K,toBase64:w,utob:m,encode:w,encodeURI:A,btou:D,decode:K,noConflict:$,fromUint8Array:H,toUint8Array:Z},typeof Object.defineProperty=="function"){var oe=function(ae){return{value:ae,enumerable:!1,writable:!0,configurable:!0}};g.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",oe(function(){return K(this)})),Object.defineProperty(String.prototype,"toBase64",oe(function(ae){return w(this,ae)})),Object.defineProperty(String.prototype,"toBase64URI",oe(function(){return w(this,!0)}))}}return g.Meteor&&(Base64=g.Base64),typeof M!="undefined"&&M.exports?M.exports.Base64=g.Base64:typeof Q=="function"&&Q.amd&&Q([],function(){return g.Base64}),{Base64:g.Base64}})}).call(this)}).call(this,typeof Ue!="undefined"?Ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],372:[function(i,M,E){"use strict";M.exports=g;var p=Object.prototype.hasOwnProperty;function g(l,h,v){if(!l)throw new TypeError("argument dest is required");if(!h)throw new TypeError("argument src is required");return v===void 0&&(v=!0),Object.getOwnPropertyNames(h).forEach(function(o){if(!(!v&&p.call(l,o))){var s=Object.getOwnPropertyDescriptor(h,o);Object.defineProperty(l,o,s)}}),l}},{}],373:[function(i,M,E){"use strict";i("core-js/modules/es.array.map.js"),i("core-js/modules/es.regexp.exec.js"),i("core-js/modules/es.string.replace.js"),i("core-js/modules/es.regexp.constructor.js"),i("core-js/modules/es.regexp.to-string.js");function p(){this._types=Object.create(null),this._extensions=Object.create(null);for(var g=0;g<arguments.length;g++)this.define(arguments[g]);this.define=this.define.bind(this),this.getType=this.getType.bind(this),this.getExtension=this.getExtension.bind(this)}p.prototype.define=function(g,l){for(var h in g){var v=g[h].map(function(u){return u.toLowerCase()});h=h.toLowerCase();for(var d=0;d<v.length;d++){var o=v[d];if(o[0]!=="*"){if(!l&&o in this._types)throw new Error('Attempt to change mapping for "'+o+'" extension from "'+this._types[o]+'" to "'+h+'". Pass `force=true` to allow this, otherwise remove "'+o+'" from the list of extensions for "'+h+'".');this._types[o]=h}}if(l||!this._extensions[h]){var s=v[0];this._extensions[h]=s[0]!=="*"?s:s.substr(1)}}},p.prototype.getType=function(g){g=String(g);var l=g.replace(/^.*[/\\]/,"").toLowerCase(),h=l.replace(/^.*\./,"").toLowerCase(),v=l.length<g.length,d=h.length<l.length-1;return(d||!v)&&this._types[h]||null},p.prototype.getExtension=function(g){return g=/^\s*([^;\s]*)/.test(g)&&RegExp.$1,g&&this._extensions[g.toLowerCase()]||null},M.exports=p},{"core-js/modules/es.array.map.js":280,"core-js/modules/es.regexp.constructor.js":299,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.regexp.to-string.js":301,"core-js/modules/es.string.replace.js":305}],374:[function(i,M,E){"use strict";var p=i("./Mime");M.exports=new p(i("./types/standard"))},{"./Mime":373,"./types/standard":375}],375:[function(i,M,E){"use strict";M.exports={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["es","ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avif":["avif"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]}},{}],376:[function(i,M,E){var p=1e3,g=p*60,l=g*60,h=l*24,v=h*7,d=h*365.25;M.exports=function(y,_){_=_||{};var x=typeof y;if(x==="string"&&y.length>0)return o(y);if(x==="number"&&isFinite(y))return _.long?u(y):s(y);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(y))};function o(y){if(y=String(y),!(y.length>100)){var _=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(y);if(_){var x=parseFloat(_[1]),S=(_[2]||"ms").toLowerCase();switch(S){case"years":case"year":case"yrs":case"yr":case"y":return x*d;case"weeks":case"week":case"w":return x*v;case"days":case"day":case"d":return x*h;case"hours":case"hour":case"hrs":case"hr":case"h":return x*l;case"minutes":case"minute":case"mins":case"min":case"m":return x*g;case"seconds":case"second":case"secs":case"sec":case"s":return x*p;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return x;default:return}}}}function s(y){var _=Math.abs(y);return _>=h?Math.round(y/h)+"d":_>=l?Math.round(y/l)+"h":_>=g?Math.round(y/g)+"m":_>=p?Math.round(y/p)+"s":y+"ms"}function u(y){var _=Math.abs(y);return _>=h?m(y,_,h,"day"):_>=l?m(y,_,l,"hour"):_>=g?m(y,_,g,"minute"):_>=p?m(y,_,p,"second"):y+" ms"}function m(y,_,x,S){var w=_>=x*1.5;return Math.round(y/x)+" "+S+(w?"s":"")}},{}],377:[function(i,M,E){"use strict";var p=Object.getOwnPropertySymbols,g=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable;function h(d){if(d==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(d)}function v(){try{if(!Object.assign)return!1;var d=new String("abc");if(d[5]="de",Object.getOwnPropertyNames(d)[0]==="5")return!1;for(var o={},s=0;s<10;s++)o["_"+String.fromCharCode(s)]=s;var u=Object.getOwnPropertyNames(o).map(function(y){return o[y]});if(u.join("")!=="0123456789")return!1;var m={};return"abcdefghijklmnopqrst".split("").forEach(function(y){m[y]=y}),Object.keys(Object.assign({},m)).join("")==="abcdefghijklmnopqrst"}catch(y){return!1}}M.exports=v()?Object.assign:function(d,o){for(var s,u=h(d),m,y=1;y<arguments.length;y++){s=Object(arguments[y]);for(var _ in s)g.call(s,_)&&(u[_]=s[_]);if(p){m=p(s);for(var x=0;x<m.length;x++)l.call(s,m[x])&&(u[m[x]]=s[m[x]])}}return u}},{}],378:[function(i,M,E){(function(p){(function(){"use strict";function g(d){if(typeof d!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(d))}function l(d,o){for(var s="",u=0,m=-1,y=0,_,x=0;x<=d.length;++x){if(x<d.length)_=d.charCodeAt(x);else{if(_===47)break;_=47}if(_===47){if(!(m===x-1||y===1))if(m!==x-1&&y===2){if(s.length<2||u!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){var S=s.lastIndexOf("/");if(S!==s.length-1){S===-1?(s="",u=0):(s=s.slice(0,S),u=s.length-1-s.lastIndexOf("/")),m=x,y=0;continue}}else if(s.length===2||s.length===1){s="",u=0,m=x,y=0;continue}}o&&(s.length>0?s+="/..":s="..",u=2)}else s.length>0?s+="/"+d.slice(m+1,x):s=d.slice(m+1,x),u=x-m-1;m=x,y=0}else _===46&&y!==-1?++y:y=-1}return s}function h(d,o){var s=o.dir||o.root,u=o.base||(o.name||"")+(o.ext||"");return s?s===o.root?s+u:s+d+u:u}var v={resolve:function(){for(var o="",s=!1,u,m=arguments.length-1;m>=-1&&!s;m--){var y;m>=0?y=arguments[m]:(u===void 0&&(u=p.cwd()),y=u),g(y),y.length!==0&&(o=y+"/"+o,s=y.charCodeAt(0)===47)}return o=l(o,!s),s?o.length>0?"/"+o:"/":o.length>0?o:"."},normalize:function(o){if(g(o),o.length===0)return".";var s=o.charCodeAt(0)===47,u=o.charCodeAt(o.length-1)===47;return o=l(o,!s),o.length===0&&!s&&(o="."),o.length>0&&u&&(o+="/"),s?"/"+o:o},isAbsolute:function(o){return g(o),o.length>0&&o.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var o,s=0;s<arguments.length;++s){var u=arguments[s];g(u),u.length>0&&(o===void 0?o=u:o+="/"+u)}return o===void 0?".":v.normalize(o)},relative:function(o,s){if(g(o),g(s),o===s||(o=v.resolve(o),s=v.resolve(s),o===s))return"";for(var u=1;u<o.length&&o.charCodeAt(u)===47;++u);for(var m=o.length,y=m-u,_=1;_<s.length&&s.charCodeAt(_)===47;++_);for(var x=s.length,S=x-_,w=y<S?y:S,A=-1,H=0;H<=w;++H){if(H===w){if(S>w){if(s.charCodeAt(_+H)===47)return s.slice(_+H+1);if(H===0)return s.slice(_+H)}else y>w&&(o.charCodeAt(u+H)===47?A=H:H===0&&(A=0));break}var R=o.charCodeAt(u+H),F=s.charCodeAt(_+H);if(R!==F)break;R===47&&(A=H)}var D="";for(H=u+A+1;H<=m;++H)(H===m||o.charCodeAt(H)===47)&&(D.length===0?D+="..":D+="/..");return D.length>0?D+s.slice(_+A):(_+=A,s.charCodeAt(_)===47&&++_,s.slice(_))},_makeLong:function(o){return o},dirname:function(o){if(g(o),o.length===0)return".";for(var s=o.charCodeAt(0),u=s===47,m=-1,y=!0,_=o.length-1;_>=1;--_)if(s=o.charCodeAt(_),s===47){if(!y){m=_;break}}else y=!1;return m===-1?u?"/":".":u&&m===1?"//":o.slice(0,m)},basename:function(o,s){if(s!==void 0&&typeof s!="string")throw new TypeError('"ext" argument must be a string');g(o);var u=0,m=-1,y=!0,_;if(s!==void 0&&s.length>0&&s.length<=o.length){if(s.length===o.length&&s===o)return"";var x=s.length-1,S=-1;for(_=o.length-1;_>=0;--_){var w=o.charCodeAt(_);if(w===47){if(!y){u=_+1;break}}else S===-1&&(y=!1,S=_+1),x>=0&&(w===s.charCodeAt(x)?--x===-1&&(m=_):(x=-1,m=S))}return u===m?m=S:m===-1&&(m=o.length),o.slice(u,m)}else{for(_=o.length-1;_>=0;--_)if(o.charCodeAt(_)===47){if(!y){u=_+1;break}}else m===-1&&(y=!1,m=_+1);return m===-1?"":o.slice(u,m)}},extname:function(o){g(o);for(var s=-1,u=0,m=-1,y=!0,_=0,x=o.length-1;x>=0;--x){var S=o.charCodeAt(x);if(S===47){if(!y){u=x+1;break}continue}m===-1&&(y=!1,m=x+1),S===46?s===-1?s=x:_!==1&&(_=1):s!==-1&&(_=-1)}return s===-1||m===-1||_===0||_===1&&s===m-1&&s===u+1?"":o.slice(s,m)},format:function(o){if(o===null||typeof o!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof o);return h("/",o)},parse:function(o){g(o);var s={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return s;var u=o.charCodeAt(0),m=u===47,y;m?(s.root="/",y=1):y=0;for(var _=-1,x=0,S=-1,w=!0,A=o.length-1,H=0;A>=y;--A){if(u=o.charCodeAt(A),u===47){if(!w){x=A+1;break}continue}S===-1&&(w=!1,S=A+1),u===46?_===-1?_=A:H!==1&&(H=1):_!==-1&&(H=-1)}return _===-1||S===-1||H===0||H===1&&_===S-1&&_===x+1?S!==-1&&(x===0&&m?s.base=s.name=o.slice(1,S):s.base=s.name=o.slice(x,S)):(x===0&&m?(s.name=o.slice(1,_),s.base=o.slice(1,S)):(s.name=o.slice(x,_),s.base=o.slice(x,S)),s.ext=o.slice(_,S)),x>0?s.dir=o.slice(0,x-1):m&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};v.posix=v,M.exports=v}).call(this)}).call(this,i("_process"))},{_process:467}],379:[function(i,M,E){(function(p){(function(){(function(){"use strict";var g={function:!0,object:!0},l=g[typeof window]&&window||this,h=l,v=g[typeof E]&&E,d=g[typeof M]&&M&&!M.nodeType&&M,o=v&&d&&typeof p=="object"&&p;o&&(o.global===o||o.window===o||o.self===o)&&(l=o);var s=Math.pow(2,53)-1,u=/\bOpera/,m=this,y=Object.prototype,_=y.hasOwnProperty,x=y.toString;function S(K){return K=String(K),K.charAt(0).toUpperCase()+K.slice(1)}function w(K,Z,$){var oe={"10.0":"10","6.4":"10 Technical Preview","6.3":"8.1","6.2":"8","6.1":"Server 2008 R2 / 7","6.0":"Server 2008 / Vista","5.2":"Server 2003 / XP 64-bit","5.1":"XP","5.01":"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return Z&&$&&/^Win/i.test(K)&&!/^Windows Phone /i.test(K)&&(oe=oe[/[\d.]+$/.exec(K)])&&(K="Windows "+oe),K=String(K),Z&&$&&(K=K.replace(RegExp(Z,"i"),$)),K=H(K.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0]),K}function A(K,Z){var $=-1,oe=K?K.length:0;if(typeof oe=="number"&&oe>-1&&oe<=s)for(;++$<oe;)Z(K[$],$,K);else R(K,Z)}function H(K){return K=U(K),/^(?:webOS|i(?:OS|P))/.test(K)?K:S(K)}function R(K,Z){for(var $ in K)_.call(K,$)&&Z(K[$],$,K)}function F(K){return K==null?S(K):x.call(K).slice(8,-1)}function D(K,Z){var $=K!=null?typeof K[Z]:"number";return!/^(?:boolean|number|string|undefined)$/.test($)&&($=="object"?!!K[Z]:!0)}function B(K){return String(K).replace(/([ -])(?!$)/g,"$1?")}function P(K,Z){var $=null;return A(K,function(oe,ae){$=Z($,oe,ae,K)}),$}function U(K){return String(K).replace(/^ +| +$/g,"")}function G(K){var Z=l,$=K&&typeof K=="object"&&F(K)!="String";$&&(Z=K,K=null);var oe=Z.navigator||{},ae=oe.userAgent||"";K||(K=ae);var ye=$||m==h,Y=$?!!oe.likeChrome:/\bChrome\b/.test(K)&&!/internal|\n/i.test(x.toString()),le="Object",xe=$?le:"ScriptBridgingProxyObject",Ce=$?le:"Environment",we=$&&Z.java?"JavaPackage":F(Z.java),Le=$?le:"RuntimeObject",de=/\bJava/.test(we)&&Z.java,be=de&&F(Z.environment)==Ce,Te=de?"a":"\u03B1",Ae=de?"b":"\u03B2",Be=Z.document||{},Pe=Z.operamini||Z.opera,_e=u.test(_e=$&&Pe?Pe["[[Class]]"]:F(Pe))?_e:Pe=null,ne,te=K,T=[],I=null,re=K==ae,q=re&&Pe&&typeof Pe.version=="function"&&Pe.version(),z,W=Fe([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"]),V=$e(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"(?:Edge|Edg|EdgA|EdgiOS)"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Vivaldi","Waterfox","WebPositive",{label:"Yandex Browser",pattern:"YaBrowser"},{label:"UC Browser",pattern:"UCBrowser"},"Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chromium","Chrome",{label:"Chrome",pattern:"(?:HeadlessChrome)"},{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"]),se=Ne([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),ge=Re({Apple:{iPad:1,iPhone:1,iPod:1},Alcatel:{},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},Huawei:{},Lenovo:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Oppo:{},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1},Xiaomi:{Mi:1,Redmi:1}}),Me=lt(["Windows Phone","KaiOS","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian",{label:"DragonFly BSD",pattern:"DragonFly"},"Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "]);function Fe(qe){return P(qe,function(Qe,ft){return Qe||RegExp("\\b"+(ft.pattern||B(ft))+"\\b","i").exec(K)&&(ft.label||ft)})}function Re(qe){return P(qe,function(Qe,ft,vt){return Qe||(ft[se]||ft[/^[a-z]+(?: +[a-z]+\b)*/i.exec(se)]||RegExp("\\b"+B(vt)+"(?:\\b|\\w*\\d)","i").exec(K))&&vt})}function $e(qe){return P(qe,function(Qe,ft){return Qe||RegExp("\\b"+(ft.pattern||B(ft))+"\\b","i").exec(K)&&(ft.label||ft)})}function lt(qe){return P(qe,function(Qe,ft){var vt=ft.pattern||B(ft);return!Qe&&(Qe=RegExp("\\b"+vt+"(?:/[\\d.]+|[ \\w.]*)","i").exec(K))&&(Qe=w(Qe,vt,ft.label||ft)),Qe})}function Ne(qe){return P(qe,function(Qe,ft){var vt=ft.pattern||B(ft);return!Qe&&(Qe=RegExp("\\b"+vt+" *\\d+[.\\w_]*","i").exec(K)||RegExp("\\b"+vt+" *\\w+-[\\w]*","i").exec(K)||RegExp("\\b"+vt+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(K))&&((Qe=String(ft.label&&!RegExp(vt,"i").test(ft.label)?ft.label:Qe).split("/"))[1]&&!/[\d.]+/.test(Qe[0])&&(Qe[0]+=" "+Qe[1]),ft=ft.label||ft,Qe=H(Qe[0].replace(RegExp(vt,"i"),ft).replace(RegExp("; *(?:"+ft+"[_-])?","i")," ").replace(RegExp("("+ft+")[-_.]?(\\w)","i"),"$1 $2"))),Qe})}function Ze(qe){return P(qe,function(Qe,ft){return Qe||(RegExp(ft+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(K)||0)[1]||null})}function We(){return this.description||""}if(W&&(W=[W]),/\bAndroid\b/.test(Me)&&!se&&(ne=/\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(K))&&(se=U(ne[1]).replace(/^[a-z]{2}-[a-z]{2};\s*/i,"")||null),ge&&!se?se=Ne([ge]):ge&&se&&(se=se.replace(RegExp("^("+B(ge)+")[-_.\\s]","i"),ge+" ").replace(RegExp("^("+B(ge)+")[-_.]?(\\w)","i"),ge+" $2")),(ne=/\bGoogle TV\b/.exec(se))&&(se=ne[0]),/\bSimulator\b/i.test(K)&&(se=(se?se+" ":"")+"Simulator"),V=="Opera Mini"&&/\bOPiOS\b/.test(K)&&T.push("running in Turbo/Uncompressed mode"),V=="IE"&&/\blike iPhone OS\b/.test(K)?(ne=G(K.replace(/like iPhone OS/,"")),ge=ne.manufacturer,se=ne.product):/^iP/.test(se)?(V||(V="Safari"),Me="iOS"+((ne=/ OS ([\d_]+)/i.exec(K))?" "+ne[1].replace(/_/g,"."):"")):V=="Konqueror"&&/^Linux\b/i.test(Me)?Me="Kubuntu":ge&&ge!="Google"&&(/Chrome/.test(V)&&!/\bMobile Safari\b/i.test(K)||/\bVita\b/.test(se))||/\bAndroid\b/.test(Me)&&/^Chrome/.test(V)&&/\bVersion\//i.test(K)?(V="Android Browser",Me=/\bAndroid\b/.test(Me)?Me:"Android"):V=="Silk"?(/\bMobi/i.test(K)||(Me="Android",T.unshift("desktop mode")),/Accelerated *= *true/i.test(K)&&T.unshift("accelerated")):V=="UC Browser"&&/\bUCWEB\b/.test(K)?T.push("speed mode"):V=="PaleMoon"&&(ne=/\bFirefox\/([\d.]+)\b/.exec(K))?T.push("identifying as Firefox "+ne[1]):V=="Firefox"&&(ne=/\b(Mobile|Tablet|TV)\b/i.exec(K))?(Me||(Me="Firefox OS"),se||(se=ne[1])):!V||(ne=!/\bMinefield\b/i.test(K)&&/\b(?:Firefox|Safari)\b/.exec(V))?(V&&!se&&/[\/,]|^[^(]+?\)/.test(K.slice(K.indexOf(ne+"/")+8))&&(V=null),(ne=se||ge||Me)&&(se||ge||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(Me))&&(V=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(Me)?Me:ne)+" Browser")):V=="Electron"&&(ne=(/\bChrome\/([\d.]+)\b/.exec(K)||0)[1])&&T.push("Chromium "+ne),q||(q=Ze(["(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)","Version",B(V),"(?:Firefox|Minefield|NetFront)"])),(ne=W=="iCab"&&parseFloat(q)>3&&"WebKit"||/\bOpera\b/.test(V)&&(/\bOPR\b/.test(K)?"Blink":"Presto")||/\b(?:Midori|Nook|Safari)\b/i.test(K)&&!/^(?:Trident|EdgeHTML)$/.test(W)&&"WebKit"||!W&&/\bMSIE\b/i.test(K)&&(Me=="Mac OS"?"Tasman":"Trident")||W=="WebKit"&&/\bPlayStation\b(?! Vita\b)/i.test(V)&&"NetFront")&&(W=[ne]),V=="IE"&&(ne=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(K)||0)[1])?(V+=" Mobile",Me="Windows Phone "+(/\+$/.test(ne)?ne:ne+".x"),T.unshift("desktop mode")):/\bWPDesktop\b/i.test(K)?(V="IE Mobile",Me="Windows Phone 8.x",T.unshift("desktop mode"),q||(q=(/\brv:([\d.]+)/.exec(K)||0)[1])):V!="IE"&&W=="Trident"&&(ne=/\brv:([\d.]+)/.exec(K))&&(V&&T.push("identifying as "+V+(q?" "+q:"")),V="IE",q=ne[1]),re){if(D(Z,"global"))if(de&&(ne=de.lang.System,te=ne.getProperty("os.arch"),Me=Me||ne.getProperty("os.name")+" "+ne.getProperty("os.version")),be){try{q=Z.require("ringo/engine").version.join("."),V="RingoJS"}catch(qe){(ne=Z.system)&&ne.global.system==Z.system&&(V="Narwhal",Me||(Me=ne[0].os||null))}V||(V="Rhino")}else typeof Z.process=="object"&&!Z.process.browser&&(ne=Z.process)&&(typeof ne.versions=="object"&&(typeof ne.versions.electron=="string"?(T.push("Node "+ne.versions.node),V="Electron",q=ne.versions.electron):typeof ne.versions.nw=="string"&&(T.push("Chromium "+q,"Node "+ne.versions.node),V="NW.js",q=ne.versions.nw)),V||(V="Node.js",te=ne.arch,Me=ne.platform,q=/[\d.]+/.exec(ne.version),q=q?q[0]:null));else F(ne=Z.runtime)==xe?(V="Adobe AIR",Me=ne.flash.system.Capabilities.os):F(ne=Z.phantom)==Le?(V="PhantomJS",q=(ne=ne.version||null)&&ne.major+"."+ne.minor+"."+ne.patch):typeof Be.documentMode=="number"&&(ne=/\bTrident\/(\d+)/i.exec(K))?(q=[q,Be.documentMode],(ne=+ne[1]+4)!=q[1]&&(T.push("IE "+q[1]+" mode"),W&&(W[1]=""),q[1]=ne),q=V=="IE"?String(q[1].toFixed(1)):q[0]):typeof Be.documentMode=="number"&&/^(?:Chrome|Firefox)\b/.test(V)&&(T.push("masking as "+V+" "+q),V="IE",q="11.0",W=["Trident"],Me="Windows");Me=Me&&H(Me)}if(q&&(ne=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(q)||/(?:alpha|beta)(?: ?\d)?/i.exec(K+";"+(re&&oe.appMinorVersion))||/\bMinefield\b/i.test(K)&&"a")&&(I=/b/i.test(ne)?"beta":"alpha",q=q.replace(RegExp(ne+"\\+?$"),"")+(I=="beta"?Ae:Te)+(/\d+\+?/.exec(ne)||"")),V=="Fennec"||V=="Firefox"&&/\b(?:Android|Firefox OS|KaiOS)\b/.test(Me))V="Firefox Mobile";else if(V=="Maxthon"&&q)q=q.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(se))se=="Xbox 360"&&(Me=null),se=="Xbox 360"&&/\bIEMobile\b/.test(K)&&T.unshift("mobile mode");else if((/^(?:Chrome|IE|Opera)$/.test(V)||V&&!se&&!/Browser|Mobi/.test(V))&&(Me=="Windows CE"||/Mobi/i.test(K)))V+=" Mobile";else if(V=="IE"&&re)try{Z.external===null&&T.unshift("platform preview")}catch(qe){T.unshift("embedded")}else(/\bBlackBerry\b/.test(se)||/\bBB10\b/.test(K))&&(ne=(RegExp(se.replace(/ +/g," *")+"/([.\\d]+)","i").exec(K)||0)[1]||q)?(ne=[ne,/BB10/.test(K)],Me=(ne[1]?(se=null,ge="BlackBerry"):"Device Software")+" "+ne[0],q=null):this!=R&&se!="Wii"&&(re&&Pe||/Opera/.test(V)&&/\b(?:MSIE|Firefox)\b/i.test(K)||V=="Firefox"&&/\bOS X (?:\d+\.){2,}/.test(Me)||V=="IE"&&(Me&&!/^Win/.test(Me)&&q>5.5||/\bWindows XP\b/.test(Me)&&q>8||q==8&&!/\bTrident\b/.test(K)))&&!u.test(ne=G.call(R,K.replace(u,"")+";"))&&ne.name&&(ne="ing as "+ne.name+((ne=ne.version)?" "+ne:""),u.test(V)?(/\bIE\b/.test(ne)&&Me=="Mac OS"&&(Me=null),ne="identify"+ne):(ne="mask"+ne,_e?V=H(_e.replace(/([a-z])([A-Z])/g,"$1 $2")):V="Opera",/\bIE\b/.test(ne)&&(Me=null),re||(q=null)),W=["Presto"],T.push(ne));(ne=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(K)||0)[1])&&(ne=[parseFloat(ne.replace(/\.(\d)$/,".0$1")),ne],V=="Safari"&&ne[1].slice(-1)=="+"?(V="WebKit Nightly",I="alpha",q=ne[1].slice(0,-1)):(q==ne[1]||q==(ne[2]=(/\bSafari\/([\d.]+\+?)/i.exec(K)||0)[1]))&&(q=null),ne[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(K)||0)[1],ne[0]==537.36&&ne[2]==537.36&&parseFloat(ne[1])>=28&&W=="WebKit"&&(W=["Blink"]),!re||!Y&&!ne[1]?(W&&(W[1]="like Safari"),ne=(ne=ne[0],ne<400?1:ne<500?2:ne<526?3:ne<533?4:ne<534?"4+":ne<535?5:ne<537?6:ne<538?7:ne<601?8:ne<602?9:ne<604?10:ne<606?11:ne<608?12:"12")):(W&&(W[1]="like Chrome"),ne=ne[1]||(ne=ne[0],ne<530?1:ne<532?2:ne<532.05?3:ne<533?4:ne<534.03?5:ne<534.07?6:ne<534.1?7:ne<534.13?8:ne<534.16?9:ne<534.24?10:ne<534.3?11:ne<535.01?12:ne<535.02?"13+":ne<535.07?15:ne<535.11?16:ne<535.19?17:ne<536.05?18:ne<536.1?19:ne<537.01?20:ne<537.11?"21+":ne<537.13?23:ne<537.18?24:ne<537.24?25:ne<537.36?26:W!="Blink"?"27":"28")),W&&(W[1]+=" "+(ne+=typeof ne=="number"?".x":/[.+]/.test(ne)?"":"+")),V=="Safari"&&(!q||parseInt(q)>45)?q=ne:V=="Chrome"&&/\bHeadlessChrome/i.test(K)&&T.unshift("headless")),V=="Opera"&&(ne=/\bzbov|zvav$/.exec(Me))?(V+=" ",T.unshift("desktop mode"),ne=="zvav"?(V+="Mini",q=null):V+="Mobile",Me=Me.replace(RegExp(" *"+ne+"$"),"")):V=="Safari"&&/\bChrome\b/.exec(W&&W[1])?(T.unshift("desktop mode"),V="Chrome Mobile",q=null,/\bOS X\b/.test(Me)?(ge="Apple",Me="iOS 4.3+"):Me=null):/\bSRWare Iron\b/.test(V)&&!q&&(q=Ze("Chrome")),q&&q.indexOf(ne=/[\d.]+$/.exec(Me))==0&&K.indexOf("/"+ne+"-")>-1&&(Me=U(Me.replace(ne,""))),Me&&Me.indexOf(V)!=-1&&!RegExp(V+" OS").test(Me)&&(Me=Me.replace(RegExp(" *"+B(V)+" *"),"")),W&&!/\b(?:Avant|Nook)\b/.test(V)&&(/Browser|Lunascape|Maxthon/.test(V)||V!="Safari"&&/^iOS/.test(Me)&&/\bSafari\b/.test(W[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(V)&&W[1])&&(ne=W[W.length-1])&&T.push(ne),T.length&&(T=["("+T.join("; ")+")"]),ge&&se&&se.indexOf(ge)<0&&T.push("on "+ge),se&&T.push((/^on /.test(T[T.length-1])?"":"on ")+se),Me&&(ne=/ ([\d.+]+)$/.exec(Me),z=ne&&Me.charAt(Me.length-ne[0].length-1)=="/",Me={architecture:32,family:ne&&!z?Me.replace(ne[0],""):Me,version:ne?ne[1]:null,toString:function(){var qe=this.version;return this.family+(qe&&!z?" "+qe:"")+(this.architecture==64?" 64-bit":"")}}),(ne=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(te))&&!/\bi686\b/i.test(te)?(Me&&(Me.architecture=64,Me.family=Me.family.replace(RegExp(" *"+ne),"")),V&&(/\bWOW64\b/i.test(K)||re&&/\w(?:86|32)$/.test(oe.cpuClass||oe.platform)&&!/\bWin64; x64\b/i.test(K))&&T.unshift("32-bit")):Me&&/^OS X/.test(Me.family)&&V=="Chrome"&&parseFloat(q)>=39&&(Me.architecture=64),K||(K=null);var nt={};return nt.description=K,nt.layout=W&&W[0],nt.manufacturer=ge,nt.name=V,nt.prerelease=I,nt.product=se,nt.ua=K,nt.version=V&&q,nt.os=Me||{architecture:null,family:null,version:null,toString:function(){return"null"}},nt.parse=G,nt.toString=We,nt.version&&T.unshift(q),nt.name&&T.unshift(V),Me&&V&&!(Me==String(Me).split(" ")[0]&&(Me==V.split(" ")[0]||se))&&T.push(se?"("+Me+")":"on "+Me),T.length&&(nt.description=T.join(" ")),nt}var ee=G();typeof Q=="function"&&typeof Q.amd=="object"&&Q.amd?(l.platform=ee,Q(function(){return ee})):v&&d?R(ee,function(K,Z){v[Z]=K}):l.platform=ee}).call(this)}).call(this)}).call(this,typeof Ue!="undefined"?Ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],380:[function(i,M,E){(function(p){(function(){"use strict";typeof p=="undefined"||!p.version||p.version.indexOf("v0.")===0||p.version.indexOf("v1.")===0&&p.version.indexOf("v1.8.")!==0?M.exports={nextTick:g}:M.exports=p;function g(l,h,v,d){if(typeof l!="function")throw new TypeError('"callback" argument must be a function');var o=arguments.length,s,u;switch(o){case 0:case 1:return p.nextTick(l);case 2:return p.nextTick(function(){l.call(null,h)});case 3:return p.nextTick(function(){l.call(null,h,v)});case 4:return p.nextTick(function(){l.call(null,h,v,d)});default:for(s=new Array(o-1),u=0;u<s.length;)s[u++]=arguments[u];return p.nextTick(function(){l.apply(null,s)})}}}).call(this)}).call(this,i("_process"))},{_process:467}],381:[function(i,M,E){var p=M.exports={},g,l;function h(){throw new Error("setTimeout has not been defined")}function v(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?g=setTimeout:g=h}catch(A){g=h}try{typeof clearTimeout=="function"?l=clearTimeout:l=v}catch(A){l=v}})();function d(A){if(g===setTimeout)return setTimeout(A,0);if((g===h||!g)&&setTimeout)return g=setTimeout,setTimeout(A,0);try{return g(A,0)}catch(H){try{return g.call(null,A,0)}catch(R){return g.call(this,A,0)}}}function o(A){if(l===clearTimeout)return clearTimeout(A);if((l===v||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(A);try{return l(A)}catch(H){try{return l.call(null,A)}catch(R){return l.call(this,A)}}}var s=[],u=!1,m,y=-1;function _(){!u||!m||(u=!1,m.length?s=m.concat(s):y=-1,s.length&&x())}function x(){if(!u){var A=d(_);u=!0;for(var H=s.length;H;){for(m=s,s=[];++y<H;)m&&m[y].run();y=-1,H=s.length}m=null,u=!1,o(A)}}p.nextTick=function(A){var H=new Array(arguments.length-1);if(arguments.length>1)for(var R=1;R<arguments.length;R++)H[R-1]=arguments[R];s.push(new S(A,H)),s.length===1&&!u&&d(x)};function S(A,H){this.fun=A,this.array=H}S.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={};function w(){}p.on=w,p.addListener=w,p.once=w,p.off=w,p.removeListener=w,p.removeAllListeners=w,p.emit=w,p.prependListener=w,p.prependOnceListener=w,p.listeners=function(A){return[]},p.binding=function(A){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(A){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},{}],382:[function(i,M,E){(function(p){(function(){(function(g){var l=typeof E=="object"&&E&&!E.nodeType&&E,h=typeof M=="object"&&M&&!M.nodeType&&M,v=typeof p=="object"&&p;(v.global===v||v.window===v||v.self===v)&&(g=v);var d,o=2147483647,s=36,u=1,m=26,y=38,_=700,x=72,S=128,w="-",A=/^xn--/,H=/[^\x20-\x7E]/,R=/[\x2E\u3002\uFF0E\uFF61]/g,F={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},D=s-u,B=Math.floor,P=String.fromCharCode,U;function G(we){throw new RangeError(F[we])}function ee(we,Le){for(var de=we.length,be=[];de--;)be[de]=Le(we[de]);return be}function K(we,Le){var de=we.split("@"),be="";de.length>1&&(be=de[0]+"@",we=de[1]),we=we.replace(R,".");var Te=we.split("."),Ae=ee(Te,Le).join(".");return be+Ae}function Z(we){for(var Le=[],de=0,be=we.length,Te,Ae;de<be;)Te=we.charCodeAt(de++),Te>=55296&&Te<=56319&&de<be?(Ae=we.charCodeAt(de++),(Ae&64512)==56320?Le.push(((Te&1023)<<10)+(Ae&1023)+65536):(Le.push(Te),de--)):Le.push(Te);return Le}function $(we){return ee(we,function(Le){var de="";return Le>65535&&(Le-=65536,de+=P(Le>>>10&1023|55296),Le=56320|Le&1023),de+=P(Le),de}).join("")}function oe(we){return we-48<10?we-22:we-65<26?we-65:we-97<26?we-97:s}function ae(we,Le){return we+22+75*(we<26)-((Le!=0)<<5)}function ye(we,Le,de){var be=0;for(we=de?B(we/_):we>>1,we+=B(we/Le);we>D*m>>1;be+=s)we=B(we/D);return B(be+(D+1)*we/(we+y))}function Y(we){var Le=[],de=we.length,be,Te=0,Ae=S,Be=x,Pe,_e,ne,te,T,I,re,q,z;for(Pe=we.lastIndexOf(w),Pe<0&&(Pe=0),_e=0;_e<Pe;++_e)we.charCodeAt(_e)>=128&&G("not-basic"),Le.push(we.charCodeAt(_e));for(ne=Pe>0?Pe+1:0;ne<de;){for(te=Te,T=1,I=s;ne>=de&&G("invalid-input"),re=oe(we.charCodeAt(ne++)),(re>=s||re>B((o-Te)/T))&&G("overflow"),Te+=re*T,q=I<=Be?u:I>=Be+m?m:I-Be,!(re<q);I+=s)z=s-q,T>B(o/z)&&G("overflow"),T*=z;be=Le.length+1,Be=ye(Te-te,be,te==0),B(Te/be)>o-Ae&&G("overflow"),Ae+=B(Te/be),Te%=be,Le.splice(Te++,0,Ae)}return $(Le)}function le(we){var Le,de,be,Te,Ae,Be,Pe,_e,ne,te,T,I=[],re,q,z,W;for(we=Z(we),re=we.length,Le=S,de=0,Ae=x,Be=0;Be<re;++Be)T=we[Be],T<128&&I.push(P(T));for(be=Te=I.length,Te&&I.push(w);be<re;){for(Pe=o,Be=0;Be<re;++Be)T=we[Be],T>=Le&&T<Pe&&(Pe=T);for(q=be+1,Pe-Le>B((o-de)/q)&&G("overflow"),de+=(Pe-Le)*q,Le=Pe,Be=0;Be<re;++Be)if(T=we[Be],T<Le&&++de>o&&G("overflow"),T==Le){for(_e=de,ne=s;te=ne<=Ae?u:ne>=Ae+m?m:ne-Ae,!(_e<te);ne+=s)W=_e-te,z=s-te,I.push(P(ae(te+W%z,0))),_e=B(W/z);I.push(P(ae(_e,0))),Ae=ye(de,q,be==Te),de=0,++be}++de,++Le}return I.join("")}function xe(we){return K(we,function(Le){return A.test(Le)?Y(Le.slice(4).toLowerCase()):Le})}function Ce(we){return K(we,function(Le){return H.test(Le)?"xn--"+le(Le):Le})}if(d={version:"1.4.1",ucs2:{decode:Z,encode:$},decode:Y,encode:le,toASCII:Ce,toUnicode:xe},typeof Q=="function"&&typeof Q.amd=="object"&&Q.amd)Q("punycode",function(){return d});else if(l&&h)if(M.exports==l)h.exports=d;else for(U in d)d.hasOwnProperty(U)&&(l[U]=d[U]);else g.punycode=d})(this)}).call(this)}).call(this,typeof Ue!="undefined"?Ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],383:[function(i,M,E){"use strict";function p(l,h){return Object.prototype.hasOwnProperty.call(l,h)}M.exports=function(l,h,v,d){h=h||"&",v=v||"=";var o={};if(typeof l!="string"||l.length===0)return o;var s=/\+/g;l=l.split(h);var u=1e3;d&&typeof d.maxKeys=="number"&&(u=d.maxKeys);var m=l.length;u>0&&m>u&&(m=u);for(var y=0;y<m;++y){var _=l[y].replace(s,"%20"),x=_.indexOf(v),S,w,A,H;x>=0?(S=_.substr(0,x),w=_.substr(x+1)):(S=_,w=""),A=decodeURIComponent(S),H=decodeURIComponent(w),p(o,A)?g(o[A])?o[A].push(H):o[A]=[o[A],H]:o[A]=H}return o};var g=Array.isArray||function(l){return Object.prototype.toString.call(l)==="[object Array]"}},{}],384:[function(i,M,E){"use strict";var p=function(v){switch(typeof v){case"string":return v;case"boolean":return v?"true":"false";case"number":return isFinite(v)?v:"";default:return""}};M.exports=function(v,d,o,s){return d=d||"&",o=o||"=",v===null&&(v=void 0),typeof v=="object"?l(h(v),function(u){var m=encodeURIComponent(p(u))+o;return g(v[u])?l(v[u],function(y){return m+encodeURIComponent(p(y))}).join(d):m+encodeURIComponent(p(v[u]))}).join(d):s?encodeURIComponent(p(s))+o+encodeURIComponent(p(v)):""};var g=Array.isArray||function(v){return Object.prototype.toString.call(v)==="[object Array]"};function l(v,d){if(v.map)return v.map(d);for(var o=[],s=0;s<v.length;s++)o.push(d(v[s],s));return o}var h=Object.keys||function(v){var d=[];for(var o in v)Object.prototype.hasOwnProperty.call(v,o)&&d.push(o);return d}},{}],385:[function(i,M,E){"use strict";E.decode=E.parse=i("./decode"),E.encode=E.stringify=i("./encode")},{"./decode":383,"./encode":384}],386:[function(i,M,E){"use strict";var p=i("process-nextick-args"),g=Object.keys||function(_){var x=[];for(var S in _)x.push(S);return x};M.exports=u;var l=Object.create(i("core-util-is"));l.inherits=i("inherits");var h=i("./_stream_readable"),v=i("./_stream_writable");l.inherits(u,h);for(var d=g(v.prototype),o=0;o<d.length;o++){var s=d[o];u.prototype[s]||(u.prototype[s]=v.prototype[s])}function u(_){if(!(this instanceof u))return new u(_);h.call(this,_),v.call(this,_),_&&_.readable===!1&&(this.readable=!1),_&&_.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,_&&_.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",m)}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function m(){this.allowHalfOpen||this._writableState.ended||p.nextTick(y,this)}function y(_){_.end()}Object.defineProperty(u.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(_){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=_,this._writableState.destroyed=_)}}),u.prototype._destroy=function(_,x){this.push(null),this.end(),p.nextTick(x,_)}},{"./_stream_readable":388,"./_stream_writable":390,"core-util-is":341,inherits:364,"process-nextick-args":380}],387:[function(i,M,E){"use strict";M.exports=l;var p=i("./_stream_transform"),g=Object.create(i("core-util-is"));g.inherits=i("inherits"),g.inherits(l,p);function l(h){if(!(this instanceof l))return new l(h);p.call(this,h)}l.prototype._transform=function(h,v,d){d(null,h)}},{"./_stream_transform":389,"core-util-is":341,inherits:364}],388:[function(i,M,E){(function(p,g){(function(){"use strict";var l=i("process-nextick-args");M.exports=P;var h=i("isarray"),v;P.ReadableState=B;var d=i("events").EventEmitter,o=function(T,I){return T.listeners(I).length},s=i("./internal/streams/stream"),u=i("safe-buffer").Buffer,m=g.Uint8Array||function(){};function y(T){return u.from(T)}function _(T){return u.isBuffer(T)||T instanceof m}var x=Object.create(i("core-util-is"));x.inherits=i("inherits");var S=i("util"),w=void 0;S&&S.debuglog?w=S.debuglog("stream"):w=function(){};var A=i("./internal/streams/BufferList"),H=i("./internal/streams/destroy"),R;x.inherits(P,s);var F=["error","close","destroy","pause","resume"];function D(T,I,re){if(typeof T.prependListener=="function")return T.prependListener(I,re);!T._events||!T._events[I]?T.on(I,re):h(T._events[I])?T._events[I].unshift(re):T._events[I]=[re,T._events[I]]}function B(T,I){v=v||i("./_stream_duplex"),T=T||{};var re=I instanceof v;this.objectMode=!!T.objectMode,re&&(this.objectMode=this.objectMode||!!T.readableObjectMode);var q=T.highWaterMark,z=T.readableHighWaterMark,W=this.objectMode?16:16*1024;q||q===0?this.highWaterMark=q:re&&(z||z===0)?this.highWaterMark=z:this.highWaterMark=W,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new A,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=T.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,T.encoding&&(R||(R=i("string_decoder/").StringDecoder),this.decoder=new R(T.encoding),this.encoding=T.encoding)}function P(T){if(v=v||i("./_stream_duplex"),!(this instanceof P))return new P(T);this._readableState=new B(T,this),this.readable=!0,T&&(typeof T.read=="function"&&(this._read=T.read),typeof T.destroy=="function"&&(this._destroy=T.destroy)),s.call(this)}Object.defineProperty(P.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(T){this._readableState&&(this._readableState.destroyed=T)}}),P.prototype.destroy=H.destroy,P.prototype._undestroy=H.undestroy,P.prototype._destroy=function(T,I){this.push(null),I(T)},P.prototype.push=function(T,I){var re=this._readableState,q;return re.objectMode?q=!0:typeof T=="string"&&(I=I||re.defaultEncoding,I!==re.encoding&&(T=u.from(T,I),I=""),q=!0),U(this,T,I,!1,q)},P.prototype.unshift=function(T){return U(this,T,null,!0,!1)};function U(T,I,re,q,z){var W=T._readableState;if(I===null)W.reading=!1,ae(T,W);else{var V;z||(V=ee(W,I)),V?T.emit("error",V):W.objectMode||I&&I.length>0?(typeof I!="string"&&!W.objectMode&&Object.getPrototypeOf(I)!==u.prototype&&(I=y(I)),q?W.endEmitted?T.emit("error",new Error("stream.unshift() after end event")):G(T,W,I,!0):W.ended?T.emit("error",new Error("stream.push() after EOF")):(W.reading=!1,W.decoder&&!re?(I=W.decoder.write(I),W.objectMode||I.length!==0?G(T,W,I,!1):le(T,W)):G(T,W,I,!1))):q||(W.reading=!1)}return K(W)}function G(T,I,re,q){I.flowing&&I.length===0&&!I.sync?(T.emit("data",re),T.read(0)):(I.length+=I.objectMode?1:re.length,q?I.buffer.unshift(re):I.buffer.push(re),I.needReadable&&ye(T)),le(T,I)}function ee(T,I){var re;return!_(I)&&typeof I!="string"&&I!==void 0&&!T.objectMode&&(re=new TypeError("Invalid non-string/buffer chunk")),re}function K(T){return!T.ended&&(T.needReadable||T.length<T.highWaterMark||T.length===0)}P.prototype.isPaused=function(){return this._readableState.flowing===!1},P.prototype.setEncoding=function(T){return R||(R=i("string_decoder/").StringDecoder),this._readableState.decoder=new R(T),this._readableState.encoding=T,this};var Z=8388608;function $(T){return T>=Z?T=Z:(T--,T|=T>>>1,T|=T>>>2,T|=T>>>4,T|=T>>>8,T|=T>>>16,T++),T}function oe(T,I){return T<=0||I.length===0&&I.ended?0:I.objectMode?1:T!==T?I.flowing&&I.length?I.buffer.head.data.length:I.length:(T>I.highWaterMark&&(I.highWaterMark=$(T)),T<=I.length?T:I.ended?I.length:(I.needReadable=!0,0))}P.prototype.read=function(T){w("read",T),T=parseInt(T,10);var I=this._readableState,re=T;if(T!==0&&(I.emittedReadable=!1),T===0&&I.needReadable&&(I.length>=I.highWaterMark||I.ended))return w("read: emitReadable",I.length,I.ended),I.length===0&&I.ended?_e(this):ye(this),null;if(T=oe(T,I),T===0&&I.ended)return I.length===0&&_e(this),null;var q=I.needReadable;w("need readable",q),(I.length===0||I.length-T<I.highWaterMark)&&(q=!0,w("length less than watermark",q)),I.ended||I.reading?(q=!1,w("reading or ended",q)):q&&(w("do read"),I.reading=!0,I.sync=!0,I.length===0&&(I.needReadable=!0),this._read(I.highWaterMark),I.sync=!1,I.reading||(T=oe(re,I)));var z;return T>0?z=Te(T,I):z=null,z===null?(I.needReadable=!0,T=0):I.length-=T,I.length===0&&(I.ended||(I.needReadable=!0),re!==T&&I.ended&&_e(this)),z!==null&&this.emit("data",z),z};function ae(T,I){if(!I.ended){if(I.decoder){var re=I.decoder.end();re&&re.length&&(I.buffer.push(re),I.length+=I.objectMode?1:re.length)}I.ended=!0,ye(T)}}function ye(T){var I=T._readableState;I.needReadable=!1,I.emittedReadable||(w("emitReadable",I.flowing),I.emittedReadable=!0,I.sync?l.nextTick(Y,T):Y(T))}function Y(T){w("emit readable"),T.emit("readable"),be(T)}function le(T,I){I.readingMore||(I.readingMore=!0,l.nextTick(xe,T,I))}function xe(T,I){for(var re=I.length;!I.reading&&!I.flowing&&!I.ended&&I.length<I.highWaterMark&&(w("maybeReadMore read 0"),T.read(0),re!==I.length);)re=I.length;I.readingMore=!1}P.prototype._read=function(T){this.emit("error",new Error("_read() is not implemented"))},P.prototype.pipe=function(T,I){var re=this,q=this._readableState;switch(q.pipesCount){case 0:q.pipes=T;break;case 1:q.pipes=[q.pipes,T];break;default:q.pipes.push(T);break}q.pipesCount+=1,w("pipe count=%d opts=%j",q.pipesCount,I);var z=(!I||I.end!==!1)&&T!==p.stdout&&T!==p.stderr,W=z?se:We;q.endEmitted?l.nextTick(W):re.once("end",W),T.on("unpipe",V);function V(nt,qe){w("onunpipe"),nt===re&&qe&&qe.hasUnpiped===!1&&(qe.hasUnpiped=!0,Fe())}function se(){w("onend"),T.end()}var ge=Ce(re);T.on("drain",ge);var Me=!1;function Fe(){w("cleanup"),T.removeListener("close",Ne),T.removeListener("finish",Ze),T.removeListener("drain",ge),T.removeListener("error",lt),T.removeListener("unpipe",V),re.removeListener("end",se),re.removeListener("end",We),re.removeListener("data",$e),Me=!0,q.awaitDrain&&(!T._writableState||T._writableState.needDrain)&&ge()}var Re=!1;re.on("data",$e);function $e(nt){w("ondata"),Re=!1;var qe=T.write(nt);qe===!1&&!Re&&((q.pipesCount===1&&q.pipes===T||q.pipesCount>1&&te(q.pipes,T)!==-1)&&!Me&&(w("false write response, pause",re._readableState.awaitDrain),re._readableState.awaitDrain++,Re=!0),re.pause())}function lt(nt){w("onerror",nt),We(),T.removeListener("error",lt),o(T,"error")===0&&T.emit("error",nt)}D(T,"error",lt);function Ne(){T.removeListener("finish",Ze),We()}T.once("close",Ne);function Ze(){w("onfinish"),T.removeListener("close",Ne),We()}T.once("finish",Ze);function We(){w("unpipe"),re.unpipe(T)}return T.emit("pipe",re),q.flowing||(w("pipe resume"),re.resume()),T};function Ce(T){return function(){var I=T._readableState;w("pipeOnDrain",I.awaitDrain),I.awaitDrain&&I.awaitDrain--,I.awaitDrain===0&&o(T,"data")&&(I.flowing=!0,be(T))}}P.prototype.unpipe=function(T){var I=this._readableState,re={hasUnpiped:!1};if(I.pipesCount===0)return this;if(I.pipesCount===1)return T&&T!==I.pipes?this:(T||(T=I.pipes),I.pipes=null,I.pipesCount=0,I.flowing=!1,T&&T.emit("unpipe",this,re),this);if(!T){var q=I.pipes,z=I.pipesCount;I.pipes=null,I.pipesCount=0,I.flowing=!1;for(var W=0;W<z;W++)q[W].emit("unpipe",this,re);return this}var V=te(I.pipes,T);return V===-1?this:(I.pipes.splice(V,1),I.pipesCount-=1,I.pipesCount===1&&(I.pipes=I.pipes[0]),T.emit("unpipe",this,re),this)},P.prototype.on=function(T,I){var re=s.prototype.on.call(this,T,I);if(T==="data")this._readableState.flowing!==!1&&this.resume();else if(T==="readable"){var q=this._readableState;!q.endEmitted&&!q.readableListening&&(q.readableListening=q.needReadable=!0,q.emittedReadable=!1,q.reading?q.length&&ye(this):l.nextTick(we,this))}return re},P.prototype.addListener=P.prototype.on;function we(T){w("readable nexttick read 0"),T.read(0)}P.prototype.resume=function(){var T=this._readableState;return T.flowing||(w("resume"),T.flowing=!0,Le(this,T)),this};function Le(T,I){I.resumeScheduled||(I.resumeScheduled=!0,l.nextTick(de,T,I))}function de(T,I){I.reading||(w("resume read 0"),T.read(0)),I.resumeScheduled=!1,I.awaitDrain=0,T.emit("resume"),be(T),I.flowing&&!I.reading&&T.read(0)}P.prototype.pause=function(){return w("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(w("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function be(T){var I=T._readableState;for(w("flow",I.flowing);I.flowing&&T.read()!==null;);}P.prototype.wrap=function(T){var I=this,re=this._readableState,q=!1;T.on("end",function(){if(w("wrapped end"),re.decoder&&!re.ended){var V=re.decoder.end();V&&V.length&&I.push(V)}I.push(null)}),T.on("data",function(V){if(w("wrapped data"),re.decoder&&(V=re.decoder.write(V)),!(re.objectMode&&V==null)&&!(!re.objectMode&&(!V||!V.length))){var se=I.push(V);se||(q=!0,T.pause())}});for(var z in T)this[z]===void 0&&typeof T[z]=="function"&&(this[z]=function(V){return function(){return T[V].apply(T,arguments)}}(z));for(var W=0;W<F.length;W++)T.on(F[W],this.emit.bind(this,F[W]));return this._read=function(V){w("wrapped _read",V),q&&(q=!1,T.resume())},this},Object.defineProperty(P.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),P._fromList=Te;function Te(T,I){if(I.length===0)return null;var re;return I.objectMode?re=I.buffer.shift():!T||T>=I.length?(I.decoder?re=I.buffer.join(""):I.buffer.length===1?re=I.buffer.head.data:re=I.buffer.concat(I.length),I.buffer.clear()):re=Ae(T,I.buffer,I.decoder),re}function Ae(T,I,re){var q;return T<I.head.data.length?(q=I.head.data.slice(0,T),I.head.data=I.head.data.slice(T)):T===I.head.data.length?q=I.shift():q=re?Be(T,I):Pe(T,I),q}function Be(T,I){var re=I.head,q=1,z=re.data;for(T-=z.length;re=re.next;){var W=re.data,V=T>W.length?W.length:T;if(V===W.length?z+=W:z+=W.slice(0,T),T-=V,T===0){V===W.length?(++q,re.next?I.head=re.next:I.head=I.tail=null):(I.head=re,re.data=W.slice(V));break}++q}return I.length-=q,z}function Pe(T,I){var re=u.allocUnsafe(T),q=I.head,z=1;for(q.data.copy(re),T-=q.data.length;q=q.next;){var W=q.data,V=T>W.length?W.length:T;if(W.copy(re,re.length-T,0,V),T-=V,T===0){V===W.length?(++z,q.next?I.head=q.next:I.head=I.tail=null):(I.head=q,q.data=W.slice(V));break}++z}return I.length-=z,re}function _e(T){var I=T._readableState;if(I.length>0)throw new Error('"endReadable()" called on non-empty stream');I.endEmitted||(I.ended=!0,l.nextTick(ne,I,T))}function ne(T,I){!T.endEmitted&&T.length===0&&(T.endEmitted=!0,I.readable=!1,I.emit("end"))}function te(T,I){for(var re=0,q=T.length;re<q;re++)if(T[re]===I)return re;return-1}}).call(this)}).call(this,i("_process"),typeof Ue!="undefined"?Ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./_stream_duplex":386,"./internal/streams/BufferList":391,"./internal/streams/destroy":392,"./internal/streams/stream":393,_process:467,"core-util-is":341,events:344,inherits:364,isarray:370,"process-nextick-args":380,"safe-buffer":396,"string_decoder/":413,util:89}],389:[function(i,M,E){"use strict";M.exports=h;var p=i("./_stream_duplex"),g=Object.create(i("core-util-is"));g.inherits=i("inherits"),g.inherits(h,p);function l(o,s){var u=this._transformState;u.transforming=!1;var m=u.writecb;if(!m)return this.emit("error",new Error("write callback called multiple times"));u.writechunk=null,u.writecb=null,s!=null&&this.push(s),m(o);var y=this._readableState;y.reading=!1,(y.needReadable||y.length<y.highWaterMark)&&this._read(y.highWaterMark)}function h(o){if(!(this instanceof h))return new h(o);p.call(this,o),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,o&&(typeof o.transform=="function"&&(this._transform=o.transform),typeof o.flush=="function"&&(this._flush=o.flush)),this.on("prefinish",v)}function v(){var o=this;typeof this._flush=="function"?this._flush(function(s,u){d(o,s,u)}):d(this,null,null)}h.prototype.push=function(o,s){return this._transformState.needTransform=!1,p.prototype.push.call(this,o,s)},h.prototype._transform=function(o,s,u){throw new Error("_transform() is not implemented")},h.prototype._write=function(o,s,u){var m=this._transformState;if(m.writecb=u,m.writechunk=o,m.writeencoding=s,!m.transforming){var y=this._readableState;(m.needTransform||y.needReadable||y.length<y.highWaterMark)&&this._read(y.highWaterMark)}},h.prototype._read=function(o){var s=this._transformState;s.writechunk!==null&&s.writecb&&!s.transforming?(s.transforming=!0,this._transform(s.writechunk,s.writeencoding,s.afterTransform)):s.needTransform=!0},h.prototype._destroy=function(o,s){var u=this;p.prototype._destroy.call(this,o,function(m){s(m),u.emit("close")})};function d(o,s,u){if(s)return o.emit("error",s);if(u!=null&&o.push(u),o._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(o._transformState.transforming)throw new Error("Calling transform done when still transforming");return o.push(null)}},{"./_stream_duplex":386,"core-util-is":341,inherits:364}],390:[function(i,M,E){(function(p,g,l){(function(){"use strict";var h=i("process-nextick-args");M.exports=D;function v(de,be,Te){this.chunk=de,this.encoding=be,this.callback=Te,this.next=null}function d(de){var be=this;this.next=null,this.entry=null,this.finish=function(){Le(be,de)}}var o=!p.browser&&["v0.10","v0.9."].indexOf(p.version.slice(0,5))>-1?l:h.nextTick,s;D.WritableState=R;var u=Object.create(i("core-util-is"));u.inherits=i("inherits");var m={deprecate:i("util-deprecate")},y=i("./internal/streams/stream"),_=i("safe-buffer").Buffer,x=g.Uint8Array||function(){};function S(de){return _.from(de)}function w(de){return _.isBuffer(de)||de instanceof x}var A=i("./internal/streams/destroy");u.inherits(D,y);function H(){}function R(de,be){s=s||i("./_stream_duplex"),de=de||{};var Te=be instanceof s;this.objectMode=!!de.objectMode,Te&&(this.objectMode=this.objectMode||!!de.writableObjectMode);var Ae=de.highWaterMark,Be=de.writableHighWaterMark,Pe=this.objectMode?16:16*1024;Ae||Ae===0?this.highWaterMark=Ae:Te&&(Be||Be===0)?this.highWaterMark=Be:this.highWaterMark=Pe,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var _e=de.decodeStrings===!1;this.decodeStrings=!_e,this.defaultEncoding=de.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ne){$(be,ne)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new d(this)}R.prototype.getBuffer=function(){for(var be=this.bufferedRequest,Te=[];be;)Te.push(be),be=be.next;return Te},function(){try{Object.defineProperty(R.prototype,"buffer",{get:m.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(de){}}();var F;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(F=Function.prototype[Symbol.hasInstance],Object.defineProperty(D,Symbol.hasInstance,{value:function(de){return F.call(this,de)?!0:this!==D?!1:de&&de._writableState instanceof R}})):F=function(de){return de instanceof this};function D(de){if(s=s||i("./_stream_duplex"),!F.call(D,this)&&!(this instanceof s))return new D(de);this._writableState=new R(de,this),this.writable=!0,de&&(typeof de.write=="function"&&(this._write=de.write),typeof de.writev=="function"&&(this._writev=de.writev),typeof de.destroy=="function"&&(this._destroy=de.destroy),typeof de.final=="function"&&(this._final=de.final)),y.call(this)}D.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function B(de,be){var Te=new Error("write after end");de.emit("error",Te),h.nextTick(be,Te)}function P(de,be,Te,Ae){var Be=!0,Pe=!1;return Te===null?Pe=new TypeError("May not write null values to stream"):typeof Te!="string"&&Te!==void 0&&!be.objectMode&&(Pe=new TypeError("Invalid non-string/buffer chunk")),Pe&&(de.emit("error",Pe),h.nextTick(Ae,Pe),Be=!1),Be}D.prototype.write=function(de,be,Te){var Ae=this._writableState,Be=!1,Pe=!Ae.objectMode&&w(de);return Pe&&!_.isBuffer(de)&&(de=S(de)),typeof be=="function"&&(Te=be,be=null),Pe?be="buffer":be||(be=Ae.defaultEncoding),typeof Te!="function"&&(Te=H),Ae.ended?B(this,Te):(Pe||P(this,Ae,de,Te))&&(Ae.pendingcb++,Be=G(this,Ae,Pe,de,be,Te)),Be},D.prototype.cork=function(){var de=this._writableState;de.corked++},D.prototype.uncork=function(){var de=this._writableState;de.corked&&(de.corked--,!de.writing&&!de.corked&&!de.finished&&!de.bufferProcessing&&de.bufferedRequest&&ye(this,de))},D.prototype.setDefaultEncoding=function(be){if(typeof be=="string"&&(be=be.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((be+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+be);return this._writableState.defaultEncoding=be,this};function U(de,be,Te){return!de.objectMode&&de.decodeStrings!==!1&&typeof be=="string"&&(be=_.from(be,Te)),be}Object.defineProperty(D.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function G(de,be,Te,Ae,Be,Pe){if(!Te){var _e=U(be,Ae,Be);Ae!==_e&&(Te=!0,Be="buffer",Ae=_e)}var ne=be.objectMode?1:Ae.length;be.length+=ne;var te=be.length<be.highWaterMark;if(te||(be.needDrain=!0),be.writing||be.corked){var T=be.lastBufferedRequest;be.lastBufferedRequest={chunk:Ae,encoding:Be,isBuf:Te,callback:Pe,next:null},T?T.next=be.lastBufferedRequest:be.bufferedRequest=be.lastBufferedRequest,be.bufferedRequestCount+=1}else ee(de,be,!1,ne,Ae,Be,Pe);return te}function ee(de,be,Te,Ae,Be,Pe,_e){be.writelen=Ae,be.writecb=_e,be.writing=!0,be.sync=!0,Te?de._writev(Be,be.onwrite):de._write(Be,Pe,be.onwrite),be.sync=!1}function K(de,be,Te,Ae,Be){--be.pendingcb,Te?(h.nextTick(Be,Ae),h.nextTick(Ce,de,be),de._writableState.errorEmitted=!0,de.emit("error",Ae)):(Be(Ae),de._writableState.errorEmitted=!0,de.emit("error",Ae),Ce(de,be))}function Z(de){de.writing=!1,de.writecb=null,de.length-=de.writelen,de.writelen=0}function $(de,be){var Te=de._writableState,Ae=Te.sync,Be=Te.writecb;if(Z(Te),be)K(de,Te,Ae,be,Be);else{var Pe=Y(Te);!Pe&&!Te.corked&&!Te.bufferProcessing&&Te.bufferedRequest&&ye(de,Te),Ae?o(oe,de,Te,Pe,Be):oe(de,Te,Pe,Be)}}function oe(de,be,Te,Ae){Te||ae(de,be),be.pendingcb--,Ae(),Ce(de,be)}function ae(de,be){be.length===0&&be.needDrain&&(be.needDrain=!1,de.emit("drain"))}function ye(de,be){be.bufferProcessing=!0;var Te=be.bufferedRequest;if(de._writev&&Te&&Te.next){var Ae=be.bufferedRequestCount,Be=new Array(Ae),Pe=be.corkedRequestsFree;Pe.entry=Te;for(var _e=0,ne=!0;Te;)Be[_e]=Te,Te.isBuf||(ne=!1),Te=Te.next,_e+=1;Be.allBuffers=ne,ee(de,be,!0,be.length,Be,"",Pe.finish),be.pendingcb++,be.lastBufferedRequest=null,Pe.next?(be.corkedRequestsFree=Pe.next,Pe.next=null):be.corkedRequestsFree=new d(be),be.bufferedRequestCount=0}else{for(;Te;){var te=Te.chunk,T=Te.encoding,I=Te.callback,re=be.objectMode?1:te.length;if(ee(de,be,!1,re,te,T,I),Te=Te.next,be.bufferedRequestCount--,be.writing)break}Te===null&&(be.lastBufferedRequest=null)}be.bufferedRequest=Te,be.bufferProcessing=!1}D.prototype._write=function(de,be,Te){Te(new Error("_write() is not implemented"))},D.prototype._writev=null,D.prototype.end=function(de,be,Te){var Ae=this._writableState;typeof de=="function"?(Te=de,de=null,be=null):typeof be=="function"&&(Te=be,be=null),de!=null&&this.write(de,be),Ae.corked&&(Ae.corked=1,this.uncork()),!Ae.ending&&!Ae.finished&&we(this,Ae,Te)};function Y(de){return de.ending&&de.length===0&&de.bufferedRequest===null&&!de.finished&&!de.writing}function le(de,be){de._final(function(Te){be.pendingcb--,Te&&de.emit("error",Te),be.prefinished=!0,de.emit("prefinish"),Ce(de,be)})}function xe(de,be){!be.prefinished&&!be.finalCalled&&(typeof de._final=="function"?(be.pendingcb++,be.finalCalled=!0,h.nextTick(le,de,be)):(be.prefinished=!0,de.emit("prefinish")))}function Ce(de,be){var Te=Y(be);return Te&&(xe(de,be),be.pendingcb===0&&(be.finished=!0,de.emit("finish"))),Te}function we(de,be,Te){be.ending=!0,Ce(de,be),Te&&(be.finished?h.nextTick(Te):de.once("finish",Te)),be.ended=!0,de.writable=!1}function Le(de,be,Te){var Ae=de.entry;for(de.entry=null;Ae;){var Be=Ae.callback;be.pendingcb--,Be(Te),Ae=Ae.next}be.corkedRequestsFree?be.corkedRequestsFree.next=de:be.corkedRequestsFree=de}Object.defineProperty(D.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(de){this._writableState&&(this._writableState.destroyed=de)}}),D.prototype.destroy=A.destroy,D.prototype._undestroy=A.undestroy,D.prototype._destroy=function(de,be){this.end(),be(de)}}).call(this)}).call(this,i("_process"),typeof Ue!="undefined"?Ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{},i("timers").setImmediate)},{"./_stream_duplex":386,"./internal/streams/destroy":392,"./internal/streams/stream":393,_process:467,"core-util-is":341,inherits:364,"process-nextick-args":380,"safe-buffer":396,timers:414,"util-deprecate":416}],391:[function(i,M,E){"use strict";function p(v,d){if(!(v instanceof d))throw new TypeError("Cannot call a class as a function")}var g=i("safe-buffer").Buffer,l=i("util");function h(v,d,o){v.copy(d,o)}M.exports=function(){function v(){p(this,v),this.head=null,this.tail=null,this.length=0}return v.prototype.push=function(o){var s={data:o,next:null};this.length>0?this.tail.next=s:this.head=s,this.tail=s,++this.length},v.prototype.unshift=function(o){var s={data:o,next:this.head};this.length===0&&(this.tail=s),this.head=s,++this.length},v.prototype.shift=function(){if(this.length!==0){var o=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,o}},v.prototype.clear=function(){this.head=this.tail=null,this.length=0},v.prototype.join=function(o){if(this.length===0)return"";for(var s=this.head,u=""+s.data;s=s.next;)u+=o+s.data;return u},v.prototype.concat=function(o){if(this.length===0)return g.alloc(0);if(this.length===1)return this.head.data;for(var s=g.allocUnsafe(o>>>0),u=this.head,m=0;u;)h(u.data,s,m),m+=u.data.length,u=u.next;return s},v}(),l&&l.inspect&&l.inspect.custom&&(M.exports.prototype[l.inspect.custom]=function(){var v=l.inspect({length:this.length});return this.constructor.name+" "+v})},{"safe-buffer":396,util:89}],392:[function(i,M,E){"use strict";var p=i("process-nextick-args");function g(v,d){var o=this,s=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return s||u?(d?d(v):v&&(!this._writableState||!this._writableState.errorEmitted)&&p.nextTick(h,this,v),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(v||null,function(m){!d&&m?(p.nextTick(h,o,m),o._writableState&&(o._writableState.errorEmitted=!0)):d&&d(m)}),this)}function l(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function h(v,d){v.emit("error",d)}M.exports={destroy:g,undestroy:l}},{"process-nextick-args":380}],393:[function(i,M,E){M.exports=i("events").EventEmitter},{events:344}],394:[function(i,M,E){E=M.exports=i("./lib/_stream_readable.js"),E.Stream=E,E.Readable=E,E.Writable=i("./lib/_stream_writable.js"),E.Duplex=i("./lib/_stream_duplex.js"),E.Transform=i("./lib/_stream_transform.js"),E.PassThrough=i("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":386,"./lib/_stream_passthrough.js":387,"./lib/_stream_readable.js":388,"./lib/_stream_transform.js":389,"./lib/_stream_writable.js":390}],395:[function(i,M,E){var p=function(g){"use strict";var l=Object.prototype,h=l.hasOwnProperty,v,d=typeof Symbol=="function"?Symbol:{},o=d.iterator||"@@iterator",s=d.asyncIterator||"@@asyncIterator",u=d.toStringTag||"@@toStringTag";function m(xe,Ce,we){return Object.defineProperty(xe,Ce,{value:we,enumerable:!0,configurable:!0,writable:!0}),xe[Ce]}try{m({},"")}catch(xe){m=function(Ce,we,Le){return Ce[we]=Le}}function y(xe,Ce,we,Le){var de=Ce&&Ce.prototype instanceof R?Ce:R,be=Object.create(de.prototype),Te=new ye(Le||[]);return be._invoke=Z(xe,we,Te),be}g.wrap=y;function _(xe,Ce,we){try{return{type:"normal",arg:xe.call(Ce,we)}}catch(Le){return{type:"throw",arg:Le}}}var x="suspendedStart",S="suspendedYield",w="executing",A="completed",H={};function R(){}function F(){}function D(){}var B={};m(B,o,function(){return this});var P=Object.getPrototypeOf,U=P&&P(P(Y([])));U&&U!==l&&h.call(U,o)&&(B=U);var G=D.prototype=R.prototype=Object.create(B);F.prototype=D,m(G,"constructor",D),m(D,"constructor",F),F.displayName=m(D,u,"GeneratorFunction");function ee(xe){["next","throw","return"].forEach(function(Ce){m(xe,Ce,function(we){return this._invoke(Ce,we)})})}g.isGeneratorFunction=function(xe){var Ce=typeof xe=="function"&&xe.constructor;return Ce?Ce===F||(Ce.displayName||Ce.name)==="GeneratorFunction":!1},g.mark=function(xe){return Object.setPrototypeOf?Object.setPrototypeOf(xe,D):(xe.__proto__=D,m(xe,u,"GeneratorFunction")),xe.prototype=Object.create(G),xe},g.awrap=function(xe){return{__await:xe}};function K(xe,Ce){function we(be,Te,Ae,Be){var Pe=_(xe[be],xe,Te);if(Pe.type==="throw")Be(Pe.arg);else{var _e=Pe.arg,ne=_e.value;return ne&&typeof ne=="object"&&h.call(ne,"__await")?Ce.resolve(ne.__await).then(function(te){we("next",te,Ae,Be)},function(te){we("throw",te,Ae,Be)}):Ce.resolve(ne).then(function(te){_e.value=te,Ae(_e)},function(te){return we("throw",te,Ae,Be)})}}var Le;function de(be,Te){function Ae(){return new Ce(function(Be,Pe){we(be,Te,Be,Pe)})}return Le=Le?Le.then(Ae,Ae):Ae()}this._invoke=de}ee(K.prototype),m(K.prototype,s,function(){return this}),g.AsyncIterator=K,g.async=function(xe,Ce,we,Le,de){de===void 0&&(de=Promise);var be=new K(y(xe,Ce,we,Le),de);return g.isGeneratorFunction(Ce)?be:be.next().then(function(Te){return Te.done?Te.value:be.next()})};function Z(xe,Ce,we){var Le=x;return function(be,Te){if(Le===w)throw new Error("Generator is already running");if(Le===A){if(be==="throw")throw Te;return le()}for(we.method=be,we.arg=Te;;){var Ae=we.delegate;if(Ae){var Be=$(Ae,we);if(Be){if(Be===H)continue;return Be}}if(we.method==="next")we.sent=we._sent=we.arg;else if(we.method==="throw"){if(Le===x)throw Le=A,we.arg;we.dispatchException(we.arg)}else we.method==="return"&&we.abrupt("return",we.arg);Le=w;var Pe=_(xe,Ce,we);if(Pe.type==="normal"){if(Le=we.done?A:S,Pe.arg===H)continue;return{value:Pe.arg,done:we.done}}else Pe.type==="throw"&&(Le=A,we.method="throw",we.arg=Pe.arg)}}}function $(xe,Ce){var we=xe.iterator[Ce.method];if(we===v){if(Ce.delegate=null,Ce.method==="throw"){if(xe.iterator.return&&(Ce.method="return",Ce.arg=v,$(xe,Ce),Ce.method==="throw"))return H;Ce.method="throw",Ce.arg=new TypeError("The iterator does not provide a 'throw' method")}return H}var Le=_(we,xe.iterator,Ce.arg);if(Le.type==="throw")return Ce.method="throw",Ce.arg=Le.arg,Ce.delegate=null,H;var de=Le.arg;if(!de)return Ce.method="throw",Ce.arg=new TypeError("iterator result is not an object"),Ce.delegate=null,H;if(de.done)Ce[xe.resultName]=de.value,Ce.next=xe.nextLoc,Ce.method!=="return"&&(Ce.method="next",Ce.arg=v);else return de;return Ce.delegate=null,H}ee(G),m(G,u,"Generator"),m(G,o,function(){return this}),m(G,"toString",function(){return"[object Generator]"});function oe(xe){var Ce={tryLoc:xe[0]};1 in xe&&(Ce.catchLoc=xe[1]),2 in xe&&(Ce.finallyLoc=xe[2],Ce.afterLoc=xe[3]),this.tryEntries.push(Ce)}function ae(xe){var Ce=xe.completion||{};Ce.type="normal",delete Ce.arg,xe.completion=Ce}function ye(xe){this.tryEntries=[{tryLoc:"root"}],xe.forEach(oe,this),this.reset(!0)}g.keys=function(xe){var Ce=[];for(var we in xe)Ce.push(we);return Ce.reverse(),function Le(){for(;Ce.length;){var de=Ce.pop();if(de in xe)return Le.value=de,Le.done=!1,Le}return Le.done=!0,Le}};function Y(xe){if(xe){var Ce=xe[o];if(Ce)return Ce.call(xe);if(typeof xe.next=="function")return xe;if(!isNaN(xe.length)){var we=-1,Le=function de(){for(;++we<xe.length;)if(h.call(xe,we))return de.value=xe[we],de.done=!1,de;return de.value=v,de.done=!0,de};return Le.next=Le}}return{next:le}}g.values=Y;function le(){return{value:v,done:!0}}return ye.prototype={constructor:ye,reset:function(xe){if(this.prev=0,this.next=0,this.sent=this._sent=v,this.done=!1,this.delegate=null,this.method="next",this.arg=v,this.tryEntries.forEach(ae),!xe)for(var Ce in this)Ce.charAt(0)==="t"&&h.call(this,Ce)&&!isNaN(+Ce.slice(1))&&(this[Ce]=v)},stop:function(){this.done=!0;var xe=this.tryEntries[0],Ce=xe.completion;if(Ce.type==="throw")throw Ce.arg;return this.rval},dispatchException:function(xe){if(this.done)throw xe;var Ce=this;function we(Be,Pe){return be.type="throw",be.arg=xe,Ce.next=Be,Pe&&(Ce.method="next",Ce.arg=v),!!Pe}for(var Le=this.tryEntries.length-1;Le>=0;--Le){var de=this.tryEntries[Le],be=de.completion;if(de.tryLoc==="root")return we("end");if(de.tryLoc<=this.prev){var Te=h.call(de,"catchLoc"),Ae=h.call(de,"finallyLoc");if(Te&&Ae){if(this.prev<de.catchLoc)return we(de.catchLoc,!0);if(this.prev<de.finallyLoc)return we(de.finallyLoc)}else if(Te){if(this.prev<de.catchLoc)return we(de.catchLoc,!0)}else if(Ae){if(this.prev<de.finallyLoc)return we(de.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(xe,Ce){for(var we=this.tryEntries.length-1;we>=0;--we){var Le=this.tryEntries[we];if(Le.tryLoc<=this.prev&&h.call(Le,"finallyLoc")&&this.prev<Le.finallyLoc){var de=Le;break}}de&&(xe==="break"||xe==="continue")&&de.tryLoc<=Ce&&Ce<=de.finallyLoc&&(de=null);var be=de?de.completion:{};return be.type=xe,be.arg=Ce,de?(this.method="next",this.next=de.finallyLoc,H):this.complete(be)},complete:function(xe,Ce){if(xe.type==="throw")throw xe.arg;return xe.type==="break"||xe.type==="continue"?this.next=xe.arg:xe.type==="return"?(this.rval=this.arg=xe.arg,this.method="return",this.next="end"):xe.type==="normal"&&Ce&&(this.next=Ce),H},finish:function(xe){for(var Ce=this.tryEntries.length-1;Ce>=0;--Ce){var we=this.tryEntries[Ce];if(we.finallyLoc===xe)return this.complete(we.completion,we.afterLoc),ae(we),H}},catch:function(xe){for(var Ce=this.tryEntries.length-1;Ce>=0;--Ce){var we=this.tryEntries[Ce];if(we.tryLoc===xe){var Le=we.completion;if(Le.type==="throw"){var de=Le.arg;ae(we)}return de}}throw new Error("illegal catch attempt")},delegateYield:function(xe,Ce,we){return this.delegate={iterator:Y(xe),resultName:Ce,nextLoc:we},this.method==="next"&&(this.arg=v),H}},g}(typeof M=="object"?M.exports:{});try{regeneratorRuntime=p}catch(g){typeof globalThis=="object"?globalThis.regeneratorRuntime=p:Function("r","regeneratorRuntime = r")(p)}},{}],396:[function(i,M,E){var p=i("buffer"),g=p.Buffer;function l(v,d){for(var o in v)d[o]=v[o]}g.from&&g.alloc&&g.allocUnsafe&&g.allocUnsafeSlow?M.exports=p:(l(p,E),E.Buffer=h);function h(v,d,o){return g(v,d,o)}l(g,h),h.from=function(v,d,o){if(typeof v=="number")throw new TypeError("Argument must not be a number");return g(v,d,o)},h.alloc=function(v,d,o){if(typeof v!="number")throw new TypeError("Argument must be a number");var s=g(v);return d!==void 0?typeof o=="string"?s.fill(d,o):s.fill(d):s.fill(0),s},h.allocUnsafe=function(v){if(typeof v!="number")throw new TypeError("Argument must be a number");return g(v)},h.allocUnsafeSlow=function(v){if(typeof v!="number")throw new TypeError("Argument must be a number");return p.SlowBuffer(v)}},{buffer:90}],397:[function(i,M,E){(function(p){(function(){(function(g){g.parser=function(_e,ne){return new h(_e,ne)},g.SAXParser=h,g.SAXStream=y,g.createStream=m,g.MAX_BUFFER_LENGTH=64*1024;var l=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];g.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function h(_e,ne){if(!(this instanceof h))return new h(_e,ne);var te=this;d(te),te.q=te.c="",te.bufferCheckPosition=g.MAX_BUFFER_LENGTH,te.opt=ne||{},te.opt.lowercase=te.opt.lowercase||te.opt.lowercasetags,te.looseCase=te.opt.lowercase?"toLowerCase":"toUpperCase",te.tags=[],te.closed=te.closedRoot=te.sawRoot=!1,te.tag=te.error=null,te.strict=!!_e,te.noscript=!!(_e||te.opt.noscript),te.state=K.BEGIN,te.strictEntities=te.opt.strictEntities,te.ENTITIES=te.strictEntities?Object.create(g.XML_ENTITIES):Object.create(g.ENTITIES),te.attribList=[],te.opt.xmlns&&(te.ns=Object.create(A)),te.trackPosition=te.opt.position!==!1,te.trackPosition&&(te.position=te.line=te.column=0),$(te,"onready")}Object.create||(Object.create=function(_e){function ne(){}ne.prototype=_e;var te=new ne;return te}),Object.keys||(Object.keys=function(_e){var ne=[];for(var te in _e)_e.hasOwnProperty(te)&&ne.push(te);return ne});function v(_e){for(var ne=Math.max(g.MAX_BUFFER_LENGTH,10),te=0,T=0,I=l.length;T<I;T++){var re=_e[l[T]].length;if(re>ne)switch(l[T]){case"textNode":ae(_e);break;case"cdata":oe(_e,"oncdata",_e.cdata),_e.cdata="";break;case"script":oe(_e,"onscript",_e.script),_e.script="";break;default:Y(_e,"Max buffer length exceeded: "+l[T])}te=Math.max(te,re)}var q=g.MAX_BUFFER_LENGTH-te;_e.bufferCheckPosition=q+_e.position}function d(_e){for(var ne=0,te=l.length;ne<te;ne++)_e[l[ne]]=""}function o(_e){ae(_e),_e.cdata!==""&&(oe(_e,"oncdata",_e.cdata),_e.cdata=""),_e.script!==""&&(oe(_e,"onscript",_e.script),_e.script="")}h.prototype={end:function(){le(this)},write:Pe,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){o(this)}};var s;try{s=i("stream").Stream}catch(_e){s=function(){}}var u=g.EVENTS.filter(function(_e){return _e!=="error"&&_e!=="end"});function m(_e,ne){return new y(_e,ne)}function y(_e,ne){if(!(this instanceof y))return new y(_e,ne);s.apply(this),this._parser=new h(_e,ne),this.writable=!0,this.readable=!0;var te=this;this._parser.onend=function(){te.emit("end")},this._parser.onerror=function(T){te.emit("error",T),te._parser.error=null},this._decoder=null,u.forEach(function(T){Object.defineProperty(te,"on"+T,{get:function(){return te._parser["on"+T]},set:function(I){if(!I)return te.removeAllListeners(T),te._parser["on"+T]=I,I;te.on(T,I)},enumerable:!0,configurable:!1})})}y.prototype=Object.create(s.prototype,{constructor:{value:y}}),y.prototype.write=function(_e){if(typeof p=="function"&&typeof p.isBuffer=="function"&&p.isBuffer(_e)){if(!this._decoder){var ne=i("string_decoder").StringDecoder;this._decoder=new ne("utf8")}_e=this._decoder.write(_e)}return this._parser.write(_e.toString()),this.emit("data",_e),!0},y.prototype.end=function(_e){return _e&&_e.length&&this.write(_e),this._parser.end(),!0},y.prototype.on=function(_e,ne){var te=this;return!te._parser["on"+_e]&&u.indexOf(_e)!==-1&&(te._parser["on"+_e]=function(){var T=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);T.splice(0,0,_e),te.emit.apply(te,T)}),s.prototype.on.call(te,_e,ne)};var _="[CDATA[",x="DOCTYPE",S="http://www.w3.org/XML/1998/namespace",w="http://www.w3.org/2000/xmlns/",A={xml:S,xmlns:w},H=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,R=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,F=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,D=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function B(_e){return _e===" "||_e===`
`||_e==="\r"||_e===" "}function P(_e){return _e==='"'||_e==="'"}function U(_e){return _e===">"||B(_e)}function G(_e,ne){return _e.test(ne)}function ee(_e,ne){return!G(_e,ne)}var K=0;g.STATE={BEGIN:K++,BEGIN_WHITESPACE:K++,TEXT:K++,TEXT_ENTITY:K++,OPEN_WAKA:K++,SGML_DECL:K++,SGML_DECL_QUOTED:K++,DOCTYPE:K++,DOCTYPE_QUOTED:K++,DOCTYPE_DTD:K++,DOCTYPE_DTD_QUOTED:K++,COMMENT_STARTING:K++,COMMENT:K++,COMMENT_ENDING:K++,COMMENT_ENDED:K++,CDATA:K++,CDATA_ENDING:K++,CDATA_ENDING_2:K++,PROC_INST:K++,PROC_INST_BODY:K++,PROC_INST_ENDING:K++,OPEN_TAG:K++,OPEN_TAG_SLASH:K++,ATTRIB:K++,ATTRIB_NAME:K++,ATTRIB_NAME_SAW_WHITE:K++,ATTRIB_VALUE:K++,ATTRIB_VALUE_QUOTED:K++,ATTRIB_VALUE_CLOSED:K++,ATTRIB_VALUE_UNQUOTED:K++,ATTRIB_VALUE_ENTITY_Q:K++,ATTRIB_VALUE_ENTITY_U:K++,CLOSE_TAG:K++,CLOSE_TAG_SAW_WHITE:K++,SCRIPT:K++,SCRIPT_ENDING:K++},g.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},g.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(g.ENTITIES).forEach(function(_e){var ne=g.ENTITIES[_e],te=typeof ne=="number"?String.fromCharCode(ne):ne;g.ENTITIES[_e]=te});for(var Z in g.STATE)g.STATE[g.STATE[Z]]=Z;K=g.STATE;function $(_e,ne,te){_e[ne]&&_e[ne](te)}function oe(_e,ne,te){_e.textNode&&ae(_e),$(_e,ne,te)}function ae(_e){_e.textNode=ye(_e.opt,_e.textNode),_e.textNode&&$(_e,"ontext",_e.textNode),_e.textNode=""}function ye(_e,ne){return _e.trim&&(ne=ne.trim()),_e.normalize&&(ne=ne.replace(/\s+/g," ")),ne}function Y(_e,ne){return ae(_e),_e.trackPosition&&(ne+=`
Line: `+_e.line+`
Column: `+_e.column+`
Char: `+_e.c),ne=new Error(ne),_e.error=ne,$(_e,"onerror",ne),_e}function le(_e){return _e.sawRoot&&!_e.closedRoot&&xe(_e,"Unclosed root tag"),_e.state!==K.BEGIN&&_e.state!==K.BEGIN_WHITESPACE&&_e.state!==K.TEXT&&Y(_e,"Unexpected end"),ae(_e),_e.c="",_e.closed=!0,$(_e,"onend"),h.call(_e,_e.strict,_e.opt),_e}function xe(_e,ne){if(typeof _e!="object"||!(_e instanceof h))throw new Error("bad call to strictFail");_e.strict&&Y(_e,ne)}function Ce(_e){_e.strict||(_e.tagName=_e.tagName[_e.looseCase]());var ne=_e.tags[_e.tags.length-1]||_e,te=_e.tag={name:_e.tagName,attributes:{}};_e.opt.xmlns&&(te.ns=ne.ns),_e.attribList.length=0,oe(_e,"onopentagstart",te)}function we(_e,ne){var te=_e.indexOf(":"),T=te<0?["",_e]:_e.split(":"),I=T[0],re=T[1];return ne&&_e==="xmlns"&&(I="xmlns",re=""),{prefix:I,local:re}}function Le(_e){if(_e.strict||(_e.attribName=_e.attribName[_e.looseCase]()),_e.attribList.indexOf(_e.attribName)!==-1||_e.tag.attributes.hasOwnProperty(_e.attribName)){_e.attribName=_e.attribValue="";return}if(_e.opt.xmlns){var ne=we(_e.attribName,!0),te=ne.prefix,T=ne.local;if(te==="xmlns")if(T==="xml"&&_e.attribValue!==S)xe(_e,"xml: prefix must be bound to "+S+`
Actual: `+_e.attribValue);else if(T==="xmlns"&&_e.attribValue!==w)xe(_e,"xmlns: prefix must be bound to "+w+`
Actual: `+_e.attribValue);else{var I=_e.tag,re=_e.tags[_e.tags.length-1]||_e;I.ns===re.ns&&(I.ns=Object.create(re.ns)),I.ns[T]=_e.attribValue}_e.attribList.push([_e.attribName,_e.attribValue])}else _e.tag.attributes[_e.attribName]=_e.attribValue,oe(_e,"onattribute",{name:_e.attribName,value:_e.attribValue});_e.attribName=_e.attribValue=""}function de(_e,ne){if(_e.opt.xmlns){var te=_e.tag,T=we(_e.tagName);te.prefix=T.prefix,te.local=T.local,te.uri=te.ns[T.prefix]||"",te.prefix&&!te.uri&&(xe(_e,"Unbound namespace prefix: "+JSON.stringify(_e.tagName)),te.uri=T.prefix);var I=_e.tags[_e.tags.length-1]||_e;te.ns&&I.ns!==te.ns&&Object.keys(te.ns).forEach(function($e){oe(_e,"onopennamespace",{prefix:$e,uri:te.ns[$e]})});for(var re=0,q=_e.attribList.length;re<q;re++){var z=_e.attribList[re],W=z[0],V=z[1],se=we(W,!0),ge=se.prefix,Me=se.local,Fe=ge===""?"":te.ns[ge]||"",Re={name:W,value:V,prefix:ge,local:Me,uri:Fe};ge&&ge!=="xmlns"&&!Fe&&(xe(_e,"Unbound namespace prefix: "+JSON.stringify(ge)),Re.uri=ge),_e.tag.attributes[W]=Re,oe(_e,"onattribute",Re)}_e.attribList.length=0}_e.tag.isSelfClosing=!!ne,_e.sawRoot=!0,_e.tags.push(_e.tag),oe(_e,"onopentag",_e.tag),ne||(!_e.noscript&&_e.tagName.toLowerCase()==="script"?_e.state=K.SCRIPT:_e.state=K.TEXT,_e.tag=null,_e.tagName=""),_e.attribName=_e.attribValue="",_e.attribList.length=0}function be(_e){if(!_e.tagName){xe(_e,"Weird empty close tag."),_e.textNode+="</>",_e.state=K.TEXT;return}if(_e.script){if(_e.tagName!=="script"){_e.script+="</"+_e.tagName+">",_e.tagName="",_e.state=K.SCRIPT;return}oe(_e,"onscript",_e.script),_e.script=""}var ne=_e.tags.length,te=_e.tagName;_e.strict||(te=te[_e.looseCase]());for(var T=te;ne--;){var I=_e.tags[ne];if(I.name!==T)xe(_e,"Unexpected close tag");else break}if(ne<0){xe(_e,"Unmatched closing tag: "+_e.tagName),_e.textNode+="</"+_e.tagName+">",_e.state=K.TEXT;return}_e.tagName=te;for(var re=_e.tags.length;re-- >ne;){var q=_e.tag=_e.tags.pop();_e.tagName=_e.tag.name,oe(_e,"onclosetag",_e.tagName);var z={};for(var W in q.ns)z[W]=q.ns[W];var V=_e.tags[_e.tags.length-1]||_e;_e.opt.xmlns&&q.ns!==V.ns&&Object.keys(q.ns).forEach(function(se){var ge=q.ns[se];oe(_e,"onclosenamespace",{prefix:se,uri:ge})})}ne===0&&(_e.closedRoot=!0),_e.tagName=_e.attribValue=_e.attribName="",_e.attribList.length=0,_e.state=K.TEXT}function Te(_e){var ne=_e.entity,te=ne.toLowerCase(),T,I="";return _e.ENTITIES[ne]?_e.ENTITIES[ne]:_e.ENTITIES[te]?_e.ENTITIES[te]:(ne=te,ne.charAt(0)==="#"&&(ne.charAt(1)==="x"?(ne=ne.slice(2),T=parseInt(ne,16),I=T.toString(16)):(ne=ne.slice(1),T=parseInt(ne,10),I=T.toString(10))),ne=ne.replace(/^0+/,""),isNaN(T)||I.toLowerCase()!==ne?(xe(_e,"Invalid character entity"),"&"+_e.entity+";"):String.fromCodePoint(T))}function Ae(_e,ne){ne==="<"?(_e.state=K.OPEN_WAKA,_e.startTagPosition=_e.position):B(ne)||(xe(_e,"Non-whitespace before first tag."),_e.textNode=ne,_e.state=K.TEXT)}function Be(_e,ne){var te="";return ne<_e.length&&(te=_e.charAt(ne)),te}function Pe(_e){var ne=this;if(this.error)throw this.error;if(ne.closed)return Y(ne,"Cannot write after close. Assign an onready handler.");if(_e===null)return le(ne);typeof _e=="object"&&(_e=_e.toString());for(var te=0,T="";T=Be(_e,te++),ne.c=T,!!T;)switch(ne.trackPosition&&(ne.position++,T===`
`?(ne.line++,ne.column=0):ne.column++),ne.state){case K.BEGIN:if(ne.state=K.BEGIN_WHITESPACE,T==="\uFEFF")continue;Ae(ne,T);continue;case K.BEGIN_WHITESPACE:Ae(ne,T);continue;case K.TEXT:if(ne.sawRoot&&!ne.closedRoot){for(var I=te-1;T&&T!=="<"&&T!=="&";)T=Be(_e,te++),T&&ne.trackPosition&&(ne.position++,T===`
`?(ne.line++,ne.column=0):ne.column++);ne.textNode+=_e.substring(I,te-1)}T==="<"&&!(ne.sawRoot&&ne.closedRoot&&!ne.strict)?(ne.state=K.OPEN_WAKA,ne.startTagPosition=ne.position):(!B(T)&&(!ne.sawRoot||ne.closedRoot)&&xe(ne,"Text data outside of root node."),T==="&"?ne.state=K.TEXT_ENTITY:ne.textNode+=T);continue;case K.SCRIPT:T==="<"?ne.state=K.SCRIPT_ENDING:ne.script+=T;continue;case K.SCRIPT_ENDING:T==="/"?ne.state=K.CLOSE_TAG:(ne.script+="<"+T,ne.state=K.SCRIPT);continue;case K.OPEN_WAKA:if(T==="!")ne.state=K.SGML_DECL,ne.sgmlDecl="";else if(!B(T))if(G(H,T))ne.state=K.OPEN_TAG,ne.tagName=T;else if(T==="/")ne.state=K.CLOSE_TAG,ne.tagName="";else if(T==="?")ne.state=K.PROC_INST,ne.procInstName=ne.procInstBody="";else{if(xe(ne,"Unencoded <"),ne.startTagPosition+1<ne.position){var re=ne.position-ne.startTagPosition;T=new Array(re).join(" ")+T}ne.textNode+="<"+T,ne.state=K.TEXT}continue;case K.SGML_DECL:(ne.sgmlDecl+T).toUpperCase()===_?(oe(ne,"onopencdata"),ne.state=K.CDATA,ne.sgmlDecl="",ne.cdata=""):ne.sgmlDecl+T==="--"?(ne.state=K.COMMENT,ne.comment="",ne.sgmlDecl=""):(ne.sgmlDecl+T).toUpperCase()===x?(ne.state=K.DOCTYPE,(ne.doctype||ne.sawRoot)&&xe(ne,"Inappropriately located doctype declaration"),ne.doctype="",ne.sgmlDecl=""):T===">"?(oe(ne,"onsgmldeclaration",ne.sgmlDecl),ne.sgmlDecl="",ne.state=K.TEXT):(P(T)&&(ne.state=K.SGML_DECL_QUOTED),ne.sgmlDecl+=T);continue;case K.SGML_DECL_QUOTED:T===ne.q&&(ne.state=K.SGML_DECL,ne.q=""),ne.sgmlDecl+=T;continue;case K.DOCTYPE:T===">"?(ne.state=K.TEXT,oe(ne,"ondoctype",ne.doctype),ne.doctype=!0):(ne.doctype+=T,T==="["?ne.state=K.DOCTYPE_DTD:P(T)&&(ne.state=K.DOCTYPE_QUOTED,ne.q=T));continue;case K.DOCTYPE_QUOTED:ne.doctype+=T,T===ne.q&&(ne.q="",ne.state=K.DOCTYPE);continue;case K.DOCTYPE_DTD:ne.doctype+=T,T==="]"?ne.state=K.DOCTYPE:P(T)&&(ne.state=K.DOCTYPE_DTD_QUOTED,ne.q=T);continue;case K.DOCTYPE_DTD_QUOTED:ne.doctype+=T,T===ne.q&&(ne.state=K.DOCTYPE_DTD,ne.q="");continue;case K.COMMENT:T==="-"?ne.state=K.COMMENT_ENDING:ne.comment+=T;continue;case K.COMMENT_ENDING:T==="-"?(ne.state=K.COMMENT_ENDED,ne.comment=ye(ne.opt,ne.comment),ne.comment&&oe(ne,"oncomment",ne.comment),ne.comment=""):(ne.comment+="-"+T,ne.state=K.COMMENT);continue;case K.COMMENT_ENDED:T!==">"?(xe(ne,"Malformed comment"),ne.comment+="--"+T,ne.state=K.COMMENT):ne.state=K.TEXT;continue;case K.CDATA:T==="]"?ne.state=K.CDATA_ENDING:ne.cdata+=T;continue;case K.CDATA_ENDING:T==="]"?ne.state=K.CDATA_ENDING_2:(ne.cdata+="]"+T,ne.state=K.CDATA);continue;case K.CDATA_ENDING_2:T===">"?(ne.cdata&&oe(ne,"oncdata",ne.cdata),oe(ne,"onclosecdata"),ne.cdata="",ne.state=K.TEXT):T==="]"?ne.cdata+="]":(ne.cdata+="]]"+T,ne.state=K.CDATA);continue;case K.PROC_INST:T==="?"?ne.state=K.PROC_INST_ENDING:B(T)?ne.state=K.PROC_INST_BODY:ne.procInstName+=T;continue;case K.PROC_INST_BODY:if(!ne.procInstBody&&B(T))continue;T==="?"?ne.state=K.PROC_INST_ENDING:ne.procInstBody+=T;continue;case K.PROC_INST_ENDING:T===">"?(oe(ne,"onprocessinginstruction",{name:ne.procInstName,body:ne.procInstBody}),ne.procInstName=ne.procInstBody="",ne.state=K.TEXT):(ne.procInstBody+="?"+T,ne.state=K.PROC_INST_BODY);continue;case K.OPEN_TAG:G(R,T)?ne.tagName+=T:(Ce(ne),T===">"?de(ne):T==="/"?ne.state=K.OPEN_TAG_SLASH:(B(T)||xe(ne,"Invalid character in tag name"),ne.state=K.ATTRIB));continue;case K.OPEN_TAG_SLASH:T===">"?(de(ne,!0),be(ne)):(xe(ne,"Forward-slash in opening tag not followed by >"),ne.state=K.ATTRIB);continue;case K.ATTRIB:if(B(T))continue;T===">"?de(ne):T==="/"?ne.state=K.OPEN_TAG_SLASH:G(H,T)?(ne.attribName=T,ne.attribValue="",ne.state=K.ATTRIB_NAME):xe(ne,"Invalid attribute name");continue;case K.ATTRIB_NAME:T==="="?ne.state=K.ATTRIB_VALUE:T===">"?(xe(ne,"Attribute without value"),ne.attribValue=ne.attribName,Le(ne),de(ne)):B(T)?ne.state=K.ATTRIB_NAME_SAW_WHITE:G(R,T)?ne.attribName+=T:xe(ne,"Invalid attribute name");continue;case K.ATTRIB_NAME_SAW_WHITE:if(T==="=")ne.state=K.ATTRIB_VALUE;else{if(B(T))continue;xe(ne,"Attribute without value"),ne.tag.attributes[ne.attribName]="",ne.attribValue="",oe(ne,"onattribute",{name:ne.attribName,value:""}),ne.attribName="",T===">"?de(ne):G(H,T)?(ne.attribName=T,ne.state=K.ATTRIB_NAME):(xe(ne,"Invalid attribute name"),ne.state=K.ATTRIB)}continue;case K.ATTRIB_VALUE:if(B(T))continue;P(T)?(ne.q=T,ne.state=K.ATTRIB_VALUE_QUOTED):(xe(ne,"Unquoted attribute value"),ne.state=K.ATTRIB_VALUE_UNQUOTED,ne.attribValue=T);continue;case K.ATTRIB_VALUE_QUOTED:if(T!==ne.q){T==="&"?ne.state=K.ATTRIB_VALUE_ENTITY_Q:ne.attribValue+=T;continue}Le(ne),ne.q="",ne.state=K.ATTRIB_VALUE_CLOSED;continue;case K.ATTRIB_VALUE_CLOSED:B(T)?ne.state=K.ATTRIB:T===">"?de(ne):T==="/"?ne.state=K.OPEN_TAG_SLASH:G(H,T)?(xe(ne,"No whitespace between attributes"),ne.attribName=T,ne.attribValue="",ne.state=K.ATTRIB_NAME):xe(ne,"Invalid attribute name");continue;case K.ATTRIB_VALUE_UNQUOTED:if(!U(T)){T==="&"?ne.state=K.ATTRIB_VALUE_ENTITY_U:ne.attribValue+=T;continue}Le(ne),T===">"?de(ne):ne.state=K.ATTRIB;continue;case K.CLOSE_TAG:if(ne.tagName)T===">"?be(ne):G(R,T)?ne.tagName+=T:ne.script?(ne.script+="</"+ne.tagName,ne.tagName="",ne.state=K.SCRIPT):(B(T)||xe(ne,"Invalid tagname in closing tag"),ne.state=K.CLOSE_TAG_SAW_WHITE);else{if(B(T))continue;ee(H,T)?ne.script?(ne.script+="</"+T,ne.state=K.SCRIPT):xe(ne,"Invalid tagname in closing tag."):ne.tagName=T}continue;case K.CLOSE_TAG_SAW_WHITE:if(B(T))continue;T===">"?be(ne):xe(ne,"Invalid characters in closing tag");continue;case K.TEXT_ENTITY:case K.ATTRIB_VALUE_ENTITY_Q:case K.ATTRIB_VALUE_ENTITY_U:var q,z;switch(ne.state){case K.TEXT_ENTITY:q=K.TEXT,z="textNode";break;case K.ATTRIB_VALUE_ENTITY_Q:q=K.ATTRIB_VALUE_QUOTED,z="attribValue";break;case K.ATTRIB_VALUE_ENTITY_U:q=K.ATTRIB_VALUE_UNQUOTED,z="attribValue";break}T===";"?(ne[z]+=Te(ne),ne.entity="",ne.state=q):G(ne.entity.length?D:F,T)?ne.entity+=T:(xe(ne,"Invalid character in entity name"),ne[z]+="&"+ne.entity+T,ne.entity="",ne.state=q);continue;default:throw new Error(ne,"Unknown state: "+ne.state)}return ne.position>=ne.bufferCheckPosition&&v(ne),ne}String.fromCodePoint||function(){var _e=String.fromCharCode,ne=Math.floor,te=function(){var T=16384,I=[],re,q,z=-1,W=arguments.length;if(!W)return"";for(var V="";++z<W;){var se=Number(arguments[z]);if(!isFinite(se)||se<0||se>1114111||ne(se)!==se)throw RangeError("Invalid code point: "+se);se<=65535?I.push(se):(se-=65536,re=(se>>10)+55296,q=se%1024+56320,I.push(re,q)),(z+1===W||I.length>T)&&(V+=_e.apply(null,I),I.length=0)}return V};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:te,configurable:!0,writable:!0}):String.fromCodePoint=te}()})(typeof E=="undefined"?this.sax={}:E)}).call(this)}).call(this,i("buffer").Buffer)},{buffer:90,stream:398,string_decoder:413}],398:[function(i,M,E){M.exports=l;var p=i("events").EventEmitter,g=i("inherits");g(l,p),l.Readable=i("readable-stream/lib/_stream_readable.js"),l.Writable=i("readable-stream/lib/_stream_writable.js"),l.Duplex=i("readable-stream/lib/_stream_duplex.js"),l.Transform=i("readable-stream/lib/_stream_transform.js"),l.PassThrough=i("readable-stream/lib/_stream_passthrough.js"),l.finished=i("readable-stream/lib/internal/streams/end-of-stream.js"),l.pipeline=i("readable-stream/lib/internal/streams/pipeline.js"),l.Stream=l;function l(){p.call(this)}l.prototype.pipe=function(h,v){var d=this;function o(S){h.writable&&h.write(S)===!1&&d.pause&&d.pause()}d.on("data",o);function s(){d.readable&&d.resume&&d.resume()}h.on("drain",s),!h._isStdio&&(!v||v.end!==!1)&&(d.on("end",m),d.on("close",y));var u=!1;function m(){u||(u=!0,h.end())}function y(){u||(u=!0,typeof h.destroy=="function"&&h.destroy())}function _(S){if(x(),p.listenerCount(this,"error")===0)throw S}d.on("error",_),h.on("error",_);function x(){d.removeListener("data",o),h.removeListener("drain",s),d.removeListener("end",m),d.removeListener("close",y),d.removeListener("error",_),h.removeListener("error",_),d.removeListener("end",x),d.removeListener("close",x),h.removeListener("close",x)}return d.on("end",x),d.on("close",x),h.on("close",x),h.emit("pipe",d),h}},{events:344,inherits:364,"readable-stream/lib/_stream_duplex.js":400,"readable-stream/lib/_stream_passthrough.js":401,"readable-stream/lib/_stream_readable.js":402,"readable-stream/lib/_stream_transform.js":403,"readable-stream/lib/_stream_writable.js":404,"readable-stream/lib/internal/streams/end-of-stream.js":408,"readable-stream/lib/internal/streams/pipeline.js":410}],399:[function(i,M,E){"use strict";function p(s,u){s.prototype=Object.create(u.prototype),s.prototype.constructor=s,s.__proto__=u}var g={};function l(s,u,m){m||(m=Error);function y(x,S,w){return typeof u=="string"?u:u(x,S,w)}var _=function(x){p(S,x);function S(w,A,H){return x.call(this,y(w,A,H))||this}return S}(m);_.prototype.name=m.name,_.prototype.code=s,g[s]=_}function h(s,u){if(Array.isArray(s)){var m=s.length;return s=s.map(function(y){return String(y)}),m>2?"one of ".concat(u," ").concat(s.slice(0,m-1).join(", "),", or ")+s[m-1]:m===2?"one of ".concat(u," ").concat(s[0]," or ").concat(s[1]):"of ".concat(u," ").concat(s[0])}else return"of ".concat(u," ").concat(String(s))}function v(s,u,m){return s.substr(!m||m<0?0:+m,u.length)===u}function d(s,u,m){return(m===void 0||m>s.length)&&(m=s.length),s.substring(m-u.length,m)===u}function o(s,u,m){return typeof m!="number"&&(m=0),m+u.length>s.length?!1:s.indexOf(u,m)!==-1}l("ERR_INVALID_OPT_VALUE",function(s,u){return'The value "'+u+'" is invalid for option "'+s+'"'},TypeError),l("ERR_INVALID_ARG_TYPE",function(s,u,m){var y;typeof u=="string"&&v(u,"not ")?(y="must not be",u=u.replace(/^not /,"")):y="must be";var _;if(d(s," argument"))_="The ".concat(s," ").concat(y," ").concat(h(u,"type"));else{var x=o(s,".")?"property":"argument";_='The "'.concat(s,'" ').concat(x," ").concat(y," ").concat(h(u,"type"))}return _+=". Received type ".concat(typeof m),_},TypeError),l("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),l("ERR_METHOD_NOT_IMPLEMENTED",function(s){return"The "+s+" method is not implemented"}),l("ERR_STREAM_PREMATURE_CLOSE","Premature close"),l("ERR_STREAM_DESTROYED",function(s){return"Cannot call "+s+" after a stream was destroyed"}),l("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),l("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),l("ERR_STREAM_WRITE_AFTER_END","write after end"),l("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),l("ERR_UNKNOWN_ENCODING",function(s){return"Unknown encoding: "+s},TypeError),l("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),M.exports.codes=g},{}],400:[function(i,M,E){(function(p){(function(){"use strict";var g=Object.keys||function(y){var _=[];for(var x in y)_.push(x);return _};M.exports=s;var l=i("./_stream_readable"),h=i("./_stream_writable");i("inherits")(s,l);for(var v=g(h.prototype),d=0;d<v.length;d++){var o=v[d];s.prototype[o]||(s.prototype[o]=h.prototype[o])}function s(y){if(!(this instanceof s))return new s(y);l.call(this,y),h.call(this,y),this.allowHalfOpen=!0,y&&(y.readable===!1&&(this.readable=!1),y.writable===!1&&(this.writable=!1),y.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",u)))}Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(s.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(s.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function u(){this._writableState.ended||p.nextTick(m,this)}function m(y){y.end()}Object.defineProperty(s.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(_){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=_,this._writableState.destroyed=_)}})}).call(this)}).call(this,i("_process"))},{"./_stream_readable":402,"./_stream_writable":404,_process:467,inherits:364}],401:[function(i,M,E){"use strict";M.exports=g;var p=i("./_stream_transform");i("inherits")(g,p);function g(l){if(!(this instanceof g))return new g(l);p.call(this,l)}g.prototype._transform=function(l,h,v){v(null,l)}},{"./_stream_transform":403,inherits:364}],402:[function(i,M,E){(function(p,g){(function(){"use strict";M.exports=oe;var l;oe.ReadableState=$;var h=i("events").EventEmitter,v=function(W,V){return W.listeners(V).length},d=i("./internal/streams/stream"),o=i("buffer").Buffer,s=(typeof g!="undefined"?g:typeof window!="undefined"?window:typeof self!="undefined"?self:{}).Uint8Array||function(){};function u(z){return o.from(z)}function m(z){return o.isBuffer(z)||z instanceof s}var y=i("util"),_;y&&y.debuglog?_=y.debuglog("stream"):_=function(){};var x=i("./internal/streams/buffer_list"),S=i("./internal/streams/destroy"),w=i("./internal/streams/state"),A=w.getHighWaterMark,H=i("../errors").codes,R=H.ERR_INVALID_ARG_TYPE,F=H.ERR_STREAM_PUSH_AFTER_EOF,D=H.ERR_METHOD_NOT_IMPLEMENTED,B=H.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,P,U,G;i("inherits")(oe,d);var ee=S.errorOrDestroy,K=["error","close","destroy","pause","resume"];function Z(z,W,V){if(typeof z.prependListener=="function")return z.prependListener(W,V);!z._events||!z._events[W]?z.on(W,V):Array.isArray(z._events[W])?z._events[W].unshift(V):z._events[W]=[V,z._events[W]]}function $(z,W,V){l=l||i("./_stream_duplex"),z=z||{},typeof V!="boolean"&&(V=W instanceof l),this.objectMode=!!z.objectMode,V&&(this.objectMode=this.objectMode||!!z.readableObjectMode),this.highWaterMark=A(this,z,"readableHighWaterMark",V),this.buffer=new x,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=z.emitClose!==!1,this.autoDestroy=!!z.autoDestroy,this.destroyed=!1,this.defaultEncoding=z.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,z.encoding&&(P||(P=i("string_decoder/").StringDecoder),this.decoder=new P(z.encoding),this.encoding=z.encoding)}function oe(z){if(l=l||i("./_stream_duplex"),!(this instanceof oe))return new oe(z);var W=this instanceof l;this._readableState=new $(z,this,W),this.readable=!0,z&&(typeof z.read=="function"&&(this._read=z.read),typeof z.destroy=="function"&&(this._destroy=z.destroy)),d.call(this)}Object.defineProperty(oe.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(W){this._readableState&&(this._readableState.destroyed=W)}}),oe.prototype.destroy=S.destroy,oe.prototype._undestroy=S.undestroy,oe.prototype._destroy=function(z,W){W(z)},oe.prototype.push=function(z,W){var V=this._readableState,se;return V.objectMode?se=!0:typeof z=="string"&&(W=W||V.defaultEncoding,W!==V.encoding&&(z=o.from(z,W),W=""),se=!0),ae(this,z,W,!1,se)},oe.prototype.unshift=function(z){return ae(this,z,null,!0,!1)};function ae(z,W,V,se,ge){_("readableAddChunk",W);var Me=z._readableState;if(W===null)Me.reading=!1,we(z,Me);else{var Fe;if(ge||(Fe=Y(Me,W)),Fe)ee(z,Fe);else if(Me.objectMode||W&&W.length>0)if(typeof W!="string"&&!Me.objectMode&&Object.getPrototypeOf(W)!==o.prototype&&(W=u(W)),se)Me.endEmitted?ee(z,new B):ye(z,Me,W,!0);else if(Me.ended)ee(z,new F);else{if(Me.destroyed)return!1;Me.reading=!1,Me.decoder&&!V?(W=Me.decoder.write(W),Me.objectMode||W.length!==0?ye(z,Me,W,!1):be(z,Me)):ye(z,Me,W,!1)}else se||(Me.reading=!1,be(z,Me))}return!Me.ended&&(Me.length<Me.highWaterMark||Me.length===0)}function ye(z,W,V,se){W.flowing&&W.length===0&&!W.sync?(W.awaitDrain=0,z.emit("data",V)):(W.length+=W.objectMode?1:V.length,se?W.buffer.unshift(V):W.buffer.push(V),W.needReadable&&Le(z)),be(z,W)}function Y(z,W){var V;return!m(W)&&typeof W!="string"&&W!==void 0&&!z.objectMode&&(V=new R("chunk",["string","Buffer","Uint8Array"],W)),V}oe.prototype.isPaused=function(){return this._readableState.flowing===!1},oe.prototype.setEncoding=function(z){P||(P=i("string_decoder/").StringDecoder);var W=new P(z);this._readableState.decoder=W,this._readableState.encoding=this._readableState.decoder.encoding;for(var V=this._readableState.buffer.head,se="";V!==null;)se+=W.write(V.data),V=V.next;return this._readableState.buffer.clear(),se!==""&&this._readableState.buffer.push(se),this._readableState.length=se.length,this};var le=1073741824;function xe(z){return z>=le?z=le:(z--,z|=z>>>1,z|=z>>>2,z|=z>>>4,z|=z>>>8,z|=z>>>16,z++),z}function Ce(z,W){return z<=0||W.length===0&&W.ended?0:W.objectMode?1:z!==z?W.flowing&&W.length?W.buffer.head.data.length:W.length:(z>W.highWaterMark&&(W.highWaterMark=xe(z)),z<=W.length?z:W.ended?W.length:(W.needReadable=!0,0))}oe.prototype.read=function(z){_("read",z),z=parseInt(z,10);var W=this._readableState,V=z;if(z!==0&&(W.emittedReadable=!1),z===0&&W.needReadable&&((W.highWaterMark!==0?W.length>=W.highWaterMark:W.length>0)||W.ended))return _("read: emitReadable",W.length,W.ended),W.length===0&&W.ended?I(this):Le(this),null;if(z=Ce(z,W),z===0&&W.ended)return W.length===0&&I(this),null;var se=W.needReadable;_("need readable",se),(W.length===0||W.length-z<W.highWaterMark)&&(se=!0,_("length less than watermark",se)),W.ended||W.reading?(se=!1,_("reading or ended",se)):se&&(_("do read"),W.reading=!0,W.sync=!0,W.length===0&&(W.needReadable=!0),this._read(W.highWaterMark),W.sync=!1,W.reading||(z=Ce(V,W)));var ge;return z>0?ge=T(z,W):ge=null,ge===null?(W.needReadable=W.length<=W.highWaterMark,z=0):(W.length-=z,W.awaitDrain=0),W.length===0&&(W.ended||(W.needReadable=!0),V!==z&&W.ended&&I(this)),ge!==null&&this.emit("data",ge),ge};function we(z,W){if(_("onEofChunk"),!W.ended){if(W.decoder){var V=W.decoder.end();V&&V.length&&(W.buffer.push(V),W.length+=W.objectMode?1:V.length)}W.ended=!0,W.sync?Le(z):(W.needReadable=!1,W.emittedReadable||(W.emittedReadable=!0,de(z)))}}function Le(z){var W=z._readableState;_("emitReadable",W.needReadable,W.emittedReadable),W.needReadable=!1,W.emittedReadable||(_("emitReadable",W.flowing),W.emittedReadable=!0,p.nextTick(de,z))}function de(z){var W=z._readableState;_("emitReadable_",W.destroyed,W.length,W.ended),!W.destroyed&&(W.length||W.ended)&&(z.emit("readable"),W.emittedReadable=!1),W.needReadable=!W.flowing&&!W.ended&&W.length<=W.highWaterMark,te(z)}function be(z,W){W.readingMore||(W.readingMore=!0,p.nextTick(Te,z,W))}function Te(z,W){for(;!W.reading&&!W.ended&&(W.length<W.highWaterMark||W.flowing&&W.length===0);){var V=W.length;if(_("maybeReadMore read 0"),z.read(0),V===W.length)break}W.readingMore=!1}oe.prototype._read=function(z){ee(this,new D("_read()"))},oe.prototype.pipe=function(z,W){var V=this,se=this._readableState;switch(se.pipesCount){case 0:se.pipes=z;break;case 1:se.pipes=[se.pipes,z];break;default:se.pipes.push(z);break}se.pipesCount+=1,_("pipe count=%d opts=%j",se.pipesCount,W);var ge=(!W||W.end!==!1)&&z!==p.stdout&&z!==p.stderr,Me=ge?Re:Qe;se.endEmitted?p.nextTick(Me):V.once("end",Me),z.on("unpipe",Fe);function Fe(ft,vt){_("onunpipe"),ft===V&&vt&&vt.hasUnpiped===!1&&(vt.hasUnpiped=!0,Ne())}function Re(){_("onend"),z.end()}var $e=Ae(V);z.on("drain",$e);var lt=!1;function Ne(){_("cleanup"),z.removeListener("close",nt),z.removeListener("finish",qe),z.removeListener("drain",$e),z.removeListener("error",We),z.removeListener("unpipe",Fe),V.removeListener("end",Re),V.removeListener("end",Qe),V.removeListener("data",Ze),lt=!0,se.awaitDrain&&(!z._writableState||z._writableState.needDrain)&&$e()}V.on("data",Ze);function Ze(ft){_("ondata");var vt=z.write(ft);_("dest.write",vt),vt===!1&&((se.pipesCount===1&&se.pipes===z||se.pipesCount>1&&q(se.pipes,z)!==-1)&&!lt&&(_("false write response, pause",se.awaitDrain),se.awaitDrain++),V.pause())}function We(ft){_("onerror",ft),Qe(),z.removeListener("error",We),v(z,"error")===0&&ee(z,ft)}Z(z,"error",We);function nt(){z.removeListener("finish",qe),Qe()}z.once("close",nt);function qe(){_("onfinish"),z.removeListener("close",nt),Qe()}z.once("finish",qe);function Qe(){_("unpipe"),V.unpipe(z)}return z.emit("pipe",V),se.flowing||(_("pipe resume"),V.resume()),z};function Ae(z){return function(){var V=z._readableState;_("pipeOnDrain",V.awaitDrain),V.awaitDrain&&V.awaitDrain--,V.awaitDrain===0&&v(z,"data")&&(V.flowing=!0,te(z))}}oe.prototype.unpipe=function(z){var W=this._readableState,V={hasUnpiped:!1};if(W.pipesCount===0)return this;if(W.pipesCount===1)return z&&z!==W.pipes?this:(z||(z=W.pipes),W.pipes=null,W.pipesCount=0,W.flowing=!1,z&&z.emit("unpipe",this,V),this);if(!z){var se=W.pipes,ge=W.pipesCount;W.pipes=null,W.pipesCount=0,W.flowing=!1;for(var Me=0;Me<ge;Me++)se[Me].emit("unpipe",this,{hasUnpiped:!1});return this}var Fe=q(W.pipes,z);return Fe===-1?this:(W.pipes.splice(Fe,1),W.pipesCount-=1,W.pipesCount===1&&(W.pipes=W.pipes[0]),z.emit("unpipe",this,V),this)},oe.prototype.on=function(z,W){var V=d.prototype.on.call(this,z,W),se=this._readableState;return z==="data"?(se.readableListening=this.listenerCount("readable")>0,se.flowing!==!1&&this.resume()):z==="readable"&&!se.endEmitted&&!se.readableListening&&(se.readableListening=se.needReadable=!0,se.flowing=!1,se.emittedReadable=!1,_("on readable",se.length,se.reading),se.length?Le(this):se.reading||p.nextTick(Pe,this)),V},oe.prototype.addListener=oe.prototype.on,oe.prototype.removeListener=function(z,W){var V=d.prototype.removeListener.call(this,z,W);return z==="readable"&&p.nextTick(Be,this),V},oe.prototype.removeAllListeners=function(z){var W=d.prototype.removeAllListeners.apply(this,arguments);return(z==="readable"||z===void 0)&&p.nextTick(Be,this),W};function Be(z){var W=z._readableState;W.readableListening=z.listenerCount("readable")>0,W.resumeScheduled&&!W.paused?W.flowing=!0:z.listenerCount("data")>0&&z.resume()}function Pe(z){_("readable nexttick read 0"),z.read(0)}oe.prototype.resume=function(){var z=this._readableState;return z.flowing||(_("resume"),z.flowing=!z.readableListening,_e(this,z)),z.paused=!1,this};function _e(z,W){W.resumeScheduled||(W.resumeScheduled=!0,p.nextTick(ne,z,W))}function ne(z,W){_("resume",W.reading),W.reading||z.read(0),W.resumeScheduled=!1,z.emit("resume"),te(z),W.flowing&&!W.reading&&z.read(0)}oe.prototype.pause=function(){return _("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(_("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function te(z){var W=z._readableState;for(_("flow",W.flowing);W.flowing&&z.read()!==null;);}oe.prototype.wrap=function(z){var W=this,V=this._readableState,se=!1;z.on("end",function(){if(_("wrapped end"),V.decoder&&!V.ended){var Fe=V.decoder.end();Fe&&Fe.length&&W.push(Fe)}W.push(null)}),z.on("data",function(Fe){if(_("wrapped data"),V.decoder&&(Fe=V.decoder.write(Fe)),!(V.objectMode&&Fe==null)&&!(!V.objectMode&&(!Fe||!Fe.length))){var Re=W.push(Fe);Re||(se=!0,z.pause())}});for(var ge in z)this[ge]===void 0&&typeof z[ge]=="function"&&(this[ge]=function(Re){return function(){return z[Re].apply(z,arguments)}}(ge));for(var Me=0;Me<K.length;Me++)z.on(K[Me],this.emit.bind(this,K[Me]));return this._read=function(Fe){_("wrapped _read",Fe),se&&(se=!1,z.resume())},this},typeof Symbol=="function"&&(oe.prototype[Symbol.asyncIterator]=function(){return U===void 0&&(U=i("./internal/streams/async_iterator")),U(this)}),Object.defineProperty(oe.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(oe.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(oe.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(W){this._readableState&&(this._readableState.flowing=W)}}),oe._fromList=T,Object.defineProperty(oe.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function T(z,W){if(W.length===0)return null;var V;return W.objectMode?V=W.buffer.shift():!z||z>=W.length?(W.decoder?V=W.buffer.join(""):W.buffer.length===1?V=W.buffer.first():V=W.buffer.concat(W.length),W.buffer.clear()):V=W.buffer.consume(z,W.decoder),V}function I(z){var W=z._readableState;_("endReadable",W.endEmitted),W.endEmitted||(W.ended=!0,p.nextTick(re,W,z))}function re(z,W){if(_("endReadableNT",z.endEmitted,z.length),!z.endEmitted&&z.length===0&&(z.endEmitted=!0,W.readable=!1,W.emit("end"),z.autoDestroy)){var V=W._writableState;(!V||V.autoDestroy&&V.finished)&&W.destroy()}}typeof Symbol=="function"&&(oe.from=function(z,W){return G===void 0&&(G=i("./internal/streams/from")),G(oe,z,W)});function q(z,W){for(var V=0,se=z.length;V<se;V++)if(z[V]===W)return V;return-1}}).call(this)}).call(this,i("_process"),typeof Ue!="undefined"?Ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"../errors":399,"./_stream_duplex":400,"./internal/streams/async_iterator":405,"./internal/streams/buffer_list":406,"./internal/streams/destroy":407,"./internal/streams/from":409,"./internal/streams/state":411,"./internal/streams/stream":412,_process:467,buffer:90,events:344,inherits:364,"string_decoder/":413,util:89}],403:[function(i,M,E){"use strict";M.exports=s;var p=i("../errors").codes,g=p.ERR_METHOD_NOT_IMPLEMENTED,l=p.ERR_MULTIPLE_CALLBACK,h=p.ERR_TRANSFORM_ALREADY_TRANSFORMING,v=p.ERR_TRANSFORM_WITH_LENGTH_0,d=i("./_stream_duplex");i("inherits")(s,d);function o(y,_){var x=this._transformState;x.transforming=!1;var S=x.writecb;if(S===null)return this.emit("error",new l);x.writechunk=null,x.writecb=null,_!=null&&this.push(_),S(y);var w=this._readableState;w.reading=!1,(w.needReadable||w.length<w.highWaterMark)&&this._read(w.highWaterMark)}function s(y){if(!(this instanceof s))return new s(y);d.call(this,y),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,y&&(typeof y.transform=="function"&&(this._transform=y.transform),typeof y.flush=="function"&&(this._flush=y.flush)),this.on("prefinish",u)}function u(){var y=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(_,x){m(y,_,x)}):m(this,null,null)}s.prototype.push=function(y,_){return this._transformState.needTransform=!1,d.prototype.push.call(this,y,_)},s.prototype._transform=function(y,_,x){x(new g("_transform()"))},s.prototype._write=function(y,_,x){var S=this._transformState;if(S.writecb=x,S.writechunk=y,S.writeencoding=_,!S.transforming){var w=this._readableState;(S.needTransform||w.needReadable||w.length<w.highWaterMark)&&this._read(w.highWaterMark)}},s.prototype._read=function(y){var _=this._transformState;_.writechunk!==null&&!_.transforming?(_.transforming=!0,this._transform(_.writechunk,_.writeencoding,_.afterTransform)):_.needTransform=!0},s.prototype._destroy=function(y,_){d.prototype._destroy.call(this,y,function(x){_(x)})};function m(y,_,x){if(_)return y.emit("error",_);if(x!=null&&y.push(x),y._writableState.length)throw new v;if(y._transformState.transforming)throw new h;return y.push(null)}},{"../errors":399,"./_stream_duplex":400,inherits:364}],404:[function(i,M,E){(function(p,g){(function(){"use strict";M.exports=$;function l(te,T,I){this.chunk=te,this.encoding=T,this.callback=I,this.next=null}function h(te){var T=this;this.next=null,this.entry=null,this.finish=function(){ne(T,te)}}var v;$.WritableState=K;var d={deprecate:i("util-deprecate")},o=i("./internal/streams/stream"),s=i("buffer").Buffer,u=(typeof g!="undefined"?g:typeof window!="undefined"?window:typeof self!="undefined"?self:{}).Uint8Array||function(){};function m(te){return s.from(te)}function y(te){return s.isBuffer(te)||te instanceof u}var _=i("./internal/streams/destroy"),x=i("./internal/streams/state"),S=x.getHighWaterMark,w=i("../errors").codes,A=w.ERR_INVALID_ARG_TYPE,H=w.ERR_METHOD_NOT_IMPLEMENTED,R=w.ERR_MULTIPLE_CALLBACK,F=w.ERR_STREAM_CANNOT_PIPE,D=w.ERR_STREAM_DESTROYED,B=w.ERR_STREAM_NULL_VALUES,P=w.ERR_STREAM_WRITE_AFTER_END,U=w.ERR_UNKNOWN_ENCODING,G=_.errorOrDestroy;i("inherits")($,o);function ee(){}function K(te,T,I){v=v||i("./_stream_duplex"),te=te||{},typeof I!="boolean"&&(I=T instanceof v),this.objectMode=!!te.objectMode,I&&(this.objectMode=this.objectMode||!!te.writableObjectMode),this.highWaterMark=S(this,te,"writableHighWaterMark",I),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var re=te.decodeStrings===!1;this.decodeStrings=!re,this.defaultEncoding=te.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(q){we(T,q)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=te.emitClose!==!1,this.autoDestroy=!!te.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new h(this)}K.prototype.getBuffer=function(){for(var T=this.bufferedRequest,I=[];T;)I.push(T),T=T.next;return I},function(){try{Object.defineProperty(K.prototype,"buffer",{get:d.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(te){}}();var Z;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Z=Function.prototype[Symbol.hasInstance],Object.defineProperty($,Symbol.hasInstance,{value:function(T){return Z.call(this,T)?!0:this!==$?!1:T&&T._writableState instanceof K}})):Z=function(T){return T instanceof this};function $(te){v=v||i("./_stream_duplex");var T=this instanceof v;if(!T&&!Z.call($,this))return new $(te);this._writableState=new K(te,this,T),this.writable=!0,te&&(typeof te.write=="function"&&(this._write=te.write),typeof te.writev=="function"&&(this._writev=te.writev),typeof te.destroy=="function"&&(this._destroy=te.destroy),typeof te.final=="function"&&(this._final=te.final)),o.call(this)}$.prototype.pipe=function(){G(this,new F)};function oe(te,T){var I=new P;G(te,I),p.nextTick(T,I)}function ae(te,T,I,re){var q;return I===null?q=new B:typeof I!="string"&&!T.objectMode&&(q=new A("chunk",["string","Buffer"],I)),q?(G(te,q),p.nextTick(re,q),!1):!0}$.prototype.write=function(te,T,I){var re=this._writableState,q=!1,z=!re.objectMode&&y(te);return z&&!s.isBuffer(te)&&(te=m(te)),typeof T=="function"&&(I=T,T=null),z?T="buffer":T||(T=re.defaultEncoding),typeof I!="function"&&(I=ee),re.ending?oe(this,I):(z||ae(this,re,te,I))&&(re.pendingcb++,q=Y(this,re,z,te,T,I)),q},$.prototype.cork=function(){this._writableState.corked++},$.prototype.uncork=function(){var te=this._writableState;te.corked&&(te.corked--,!te.writing&&!te.corked&&!te.bufferProcessing&&te.bufferedRequest&&be(this,te))},$.prototype.setDefaultEncoding=function(T){if(typeof T=="string"&&(T=T.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((T+"").toLowerCase())>-1))throw new U(T);return this._writableState.defaultEncoding=T,this},Object.defineProperty($.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function ye(te,T,I){return!te.objectMode&&te.decodeStrings!==!1&&typeof T=="string"&&(T=s.from(T,I)),T}Object.defineProperty($.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Y(te,T,I,re,q,z){if(!I){var W=ye(T,re,q);re!==W&&(I=!0,q="buffer",re=W)}var V=T.objectMode?1:re.length;T.length+=V;var se=T.length<T.highWaterMark;if(se||(T.needDrain=!0),T.writing||T.corked){var ge=T.lastBufferedRequest;T.lastBufferedRequest={chunk:re,encoding:q,isBuf:I,callback:z,next:null},ge?ge.next=T.lastBufferedRequest:T.bufferedRequest=T.lastBufferedRequest,T.bufferedRequestCount+=1}else le(te,T,!1,V,re,q,z);return se}function le(te,T,I,re,q,z,W){T.writelen=re,T.writecb=W,T.writing=!0,T.sync=!0,T.destroyed?T.onwrite(new D("write")):I?te._writev(q,T.onwrite):te._write(q,z,T.onwrite),T.sync=!1}function xe(te,T,I,re,q){--T.pendingcb,I?(p.nextTick(q,re),p.nextTick(Pe,te,T),te._writableState.errorEmitted=!0,G(te,re)):(q(re),te._writableState.errorEmitted=!0,G(te,re),Pe(te,T))}function Ce(te){te.writing=!1,te.writecb=null,te.length-=te.writelen,te.writelen=0}function we(te,T){var I=te._writableState,re=I.sync,q=I.writecb;if(typeof q!="function")throw new R;if(Ce(I),T)xe(te,I,re,T,q);else{var z=Te(I)||te.destroyed;!z&&!I.corked&&!I.bufferProcessing&&I.bufferedRequest&&be(te,I),re?p.nextTick(Le,te,I,z,q):Le(te,I,z,q)}}function Le(te,T,I,re){I||de(te,T),T.pendingcb--,re(),Pe(te,T)}function de(te,T){T.length===0&&T.needDrain&&(T.needDrain=!1,te.emit("drain"))}function be(te,T){T.bufferProcessing=!0;var I=T.bufferedRequest;if(te._writev&&I&&I.next){var re=T.bufferedRequestCount,q=new Array(re),z=T.corkedRequestsFree;z.entry=I;for(var W=0,V=!0;I;)q[W]=I,I.isBuf||(V=!1),I=I.next,W+=1;q.allBuffers=V,le(te,T,!0,T.length,q,"",z.finish),T.pendingcb++,T.lastBufferedRequest=null,z.next?(T.corkedRequestsFree=z.next,z.next=null):T.corkedRequestsFree=new h(T),T.bufferedRequestCount=0}else{for(;I;){var se=I.chunk,ge=I.encoding,Me=I.callback,Fe=T.objectMode?1:se.length;if(le(te,T,!1,Fe,se,ge,Me),I=I.next,T.bufferedRequestCount--,T.writing)break}I===null&&(T.lastBufferedRequest=null)}T.bufferedRequest=I,T.bufferProcessing=!1}$.prototype._write=function(te,T,I){I(new H("_write()"))},$.prototype._writev=null,$.prototype.end=function(te,T,I){var re=this._writableState;return typeof te=="function"?(I=te,te=null,T=null):typeof T=="function"&&(I=T,T=null),te!=null&&this.write(te,T),re.corked&&(re.corked=1,this.uncork()),re.ending||_e(this,re,I),this},Object.defineProperty($.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Te(te){return te.ending&&te.length===0&&te.bufferedRequest===null&&!te.finished&&!te.writing}function Ae(te,T){te._final(function(I){T.pendingcb--,I&&G(te,I),T.prefinished=!0,te.emit("prefinish"),Pe(te,T)})}function Be(te,T){!T.prefinished&&!T.finalCalled&&(typeof te._final=="function"&&!T.destroyed?(T.pendingcb++,T.finalCalled=!0,p.nextTick(Ae,te,T)):(T.prefinished=!0,te.emit("prefinish")))}function Pe(te,T){var I=Te(T);if(I&&(Be(te,T),T.pendingcb===0&&(T.finished=!0,te.emit("finish"),T.autoDestroy))){var re=te._readableState;(!re||re.autoDestroy&&re.endEmitted)&&te.destroy()}return I}function _e(te,T,I){T.ending=!0,Pe(te,T),I&&(T.finished?p.nextTick(I):te.once("finish",I)),T.ended=!0,te.writable=!1}function ne(te,T,I){var re=te.entry;for(te.entry=null;re;){var q=re.callback;T.pendingcb--,q(I),re=re.next}T.corkedRequestsFree.next=te}Object.defineProperty($.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(T){this._writableState&&(this._writableState.destroyed=T)}}),$.prototype.destroy=_.destroy,$.prototype._undestroy=_.undestroy,$.prototype._destroy=function(te,T){T(te)}}).call(this)}).call(this,i("_process"),typeof Ue!="undefined"?Ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"../errors":399,"./_stream_duplex":400,"./internal/streams/destroy":407,"./internal/streams/state":411,"./internal/streams/stream":412,_process:467,buffer:90,inherits:364,"util-deprecate":416}],405:[function(i,M,E){(function(p){(function(){"use strict";var g;function l(B,P,U){return P=h(P),P in B?Object.defineProperty(B,P,{value:U,enumerable:!0,configurable:!0,writable:!0}):B[P]=U,B}function h(B){var P=v(B,"string");return typeof P=="symbol"?P:String(P)}function v(B,P){if(typeof B!="object"||B===null)return B;var U=B[Symbol.toPrimitive];if(U!==void 0){var G=U.call(B,P||"default");if(typeof G!="object")return G;throw new TypeError("@@toPrimitive must return a primitive value.")}return(P==="string"?String:Number)(B)}var d=i("./end-of-stream"),o=Symbol("lastResolve"),s=Symbol("lastReject"),u=Symbol("error"),m=Symbol("ended"),y=Symbol("lastPromise"),_=Symbol("handlePromise"),x=Symbol("stream");function S(B,P){return{value:B,done:P}}function w(B){var P=B[o];if(P!==null){var U=B[x].read();U!==null&&(B[y]=null,B[o]=null,B[s]=null,P(S(U,!1)))}}function A(B){p.nextTick(w,B)}function H(B,P){return function(U,G){B.then(function(){if(P[m]){U(S(void 0,!0));return}P[_](U,G)},G)}}var R=Object.getPrototypeOf(function(){}),F=Object.setPrototypeOf((g={get stream(){return this[x]},next:function(){var P=this,U=this[u];if(U!==null)return Promise.reject(U);if(this[m])return Promise.resolve(S(void 0,!0));if(this[x].destroyed)return new Promise(function(Z,$){p.nextTick(function(){P[u]?$(P[u]):Z(S(void 0,!0))})});var G=this[y],ee;if(G)ee=new Promise(H(G,this));else{var K=this[x].read();if(K!==null)return Promise.resolve(S(K,!1));ee=new Promise(this[_])}return this[y]=ee,ee}},l(g,Symbol.asyncIterator,function(){return this}),l(g,"return",function(){var P=this;return new Promise(function(U,G){P[x].destroy(null,function(ee){if(ee){G(ee);return}U(S(void 0,!0))})})}),g),R),D=function(P){var U,G=Object.create(F,(U={},l(U,x,{value:P,writable:!0}),l(U,o,{value:null,writable:!0}),l(U,s,{value:null,writable:!0}),l(U,u,{value:null,writable:!0}),l(U,m,{value:P._readableState.endEmitted,writable:!0}),l(U,_,{value:function(K,Z){var $=G[x].read();$?(G[y]=null,G[o]=null,G[s]=null,K(S($,!1))):(G[o]=K,G[s]=Z)},writable:!0}),U));return G[y]=null,d(P,function(ee){if(ee&&ee.code!=="ERR_STREAM_PREMATURE_CLOSE"){var K=G[s];K!==null&&(G[y]=null,G[o]=null,G[s]=null,K(ee)),G[u]=ee;return}var Z=G[o];Z!==null&&(G[y]=null,G[o]=null,G[s]=null,Z(S(void 0,!0))),G[m]=!0}),P.on("readable",A.bind(null,G)),G};M.exports=D}).call(this)}).call(this,i("_process"))},{"./end-of-stream":408,_process:467}],406:[function(i,M,E){"use strict";function p(w,A){var H=Object.keys(w);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(w);A&&(R=R.filter(function(F){return Object.getOwnPropertyDescriptor(w,F).enumerable})),H.push.apply(H,R)}return H}function g(w){for(var A=1;A<arguments.length;A++){var H=arguments[A]!=null?arguments[A]:{};A%2?p(Object(H),!0).forEach(function(R){l(w,R,H[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(H)):p(Object(H)).forEach(function(R){Object.defineProperty(w,R,Object.getOwnPropertyDescriptor(H,R))})}return w}function l(w,A,H){return A=o(A),A in w?Object.defineProperty(w,A,{value:H,enumerable:!0,configurable:!0,writable:!0}):w[A]=H,w}function h(w,A){if(!(w instanceof A))throw new TypeError("Cannot call a class as a function")}function v(w,A){for(var H=0;H<A.length;H++){var R=A[H];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(w,o(R.key),R)}}function d(w,A,H){return A&&v(w.prototype,A),H&&v(w,H),Object.defineProperty(w,"prototype",{writable:!1}),w}function o(w){var A=s(w,"string");return typeof A=="symbol"?A:String(A)}function s(w,A){if(typeof w!="object"||w===null)return w;var H=w[Symbol.toPrimitive];if(H!==void 0){var R=H.call(w,A||"default");if(typeof R!="object")return R;throw new TypeError("@@toPrimitive must return a primitive value.")}return(A==="string"?String:Number)(w)}var u=i("buffer"),m=u.Buffer,y=i("util"),_=y.inspect,x=_&&_.custom||"inspect";function S(w,A,H){m.prototype.copy.call(w,A,H)}M.exports=function(){function w(){h(this,w),this.head=null,this.tail=null,this.length=0}return d(w,[{key:"push",value:function(H){var R={data:H,next:null};this.length>0?this.tail.next=R:this.head=R,this.tail=R,++this.length}},{key:"unshift",value:function(H){var R={data:H,next:this.head};this.length===0&&(this.tail=R),this.head=R,++this.length}},{key:"shift",value:function(){if(this.length!==0){var H=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,H}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(H){if(this.length===0)return"";for(var R=this.head,F=""+R.data;R=R.next;)F+=H+R.data;return F}},{key:"concat",value:function(H){if(this.length===0)return m.alloc(0);for(var R=m.allocUnsafe(H>>>0),F=this.head,D=0;F;)S(F.data,R,D),D+=F.data.length,F=F.next;return R}},{key:"consume",value:function(H,R){var F;return H<this.head.data.length?(F=this.head.data.slice(0,H),this.head.data=this.head.data.slice(H)):H===this.head.data.length?F=this.shift():F=R?this._getString(H):this._getBuffer(H),F}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(H){var R=this.head,F=1,D=R.data;for(H-=D.length;R=R.next;){var B=R.data,P=H>B.length?B.length:H;if(P===B.length?D+=B:D+=B.slice(0,H),H-=P,H===0){P===B.length?(++F,R.next?this.head=R.next:this.head=this.tail=null):(this.head=R,R.data=B.slice(P));break}++F}return this.length-=F,D}},{key:"_getBuffer",value:function(H){var R=m.allocUnsafe(H),F=this.head,D=1;for(F.data.copy(R),H-=F.data.length;F=F.next;){var B=F.data,P=H>B.length?B.length:H;if(B.copy(R,R.length-H,0,P),H-=P,H===0){P===B.length?(++D,F.next?this.head=F.next:this.head=this.tail=null):(this.head=F,F.data=B.slice(P));break}++D}return this.length-=D,R}},{key:x,value:function(H,R){return _(this,g(g({},R),{},{depth:0,customInspect:!1}))}}]),w}()},{buffer:90,util:89}],407:[function(i,M,E){(function(p){(function(){"use strict";function g(s,u){var m=this,y=this._readableState&&this._readableState.destroyed,_=this._writableState&&this._writableState.destroyed;return y||_?(u?u(s):s&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,p.nextTick(d,this,s)):p.nextTick(d,this,s)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(s||null,function(x){!u&&x?m._writableState?m._writableState.errorEmitted?p.nextTick(h,m):(m._writableState.errorEmitted=!0,p.nextTick(l,m,x)):p.nextTick(l,m,x):u?(p.nextTick(h,m),u(x)):p.nextTick(h,m)}),this)}function l(s,u){d(s,u),h(s)}function h(s){s._writableState&&!s._writableState.emitClose||s._readableState&&!s._readableState.emitClose||s.emit("close")}function v(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function d(s,u){s.emit("error",u)}function o(s,u){var m=s._readableState,y=s._writableState;m&&m.autoDestroy||y&&y.autoDestroy?s.destroy(u):s.emit("error",u)}M.exports={destroy:g,undestroy:v,errorOrDestroy:o}}).call(this)}).call(this,i("_process"))},{_process:467}],408:[function(i,M,E){"use strict";var p=i("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function g(d){var o=!1;return function(){if(!o){o=!0;for(var s=arguments.length,u=new Array(s),m=0;m<s;m++)u[m]=arguments[m];d.apply(this,u)}}}function l(){}function h(d){return d.setHeader&&typeof d.abort=="function"}function v(d,o,s){if(typeof o=="function")return v(d,null,o);o||(o={}),s=g(s||l);var u=o.readable||o.readable!==!1&&d.readable,m=o.writable||o.writable!==!1&&d.writable,y=function(){d.writable||x()},_=d._writableState&&d._writableState.finished,x=function(){m=!1,_=!0,u||s.call(d)},S=d._readableState&&d._readableState.endEmitted,w=function(){u=!1,S=!0,m||s.call(d)},A=function(D){s.call(d,D)},H=function(){var D;if(u&&!S)return(!d._readableState||!d._readableState.ended)&&(D=new p),s.call(d,D);if(m&&!_)return(!d._writableState||!d._writableState.ended)&&(D=new p),s.call(d,D)},R=function(){d.req.on("finish",x)};return h(d)?(d.on("complete",x),d.on("abort",H),d.req?R():d.on("request",R)):m&&!d._writableState&&(d.on("end",y),d.on("close",y)),d.on("end",w),d.on("finish",x),o.error!==!1&&d.on("error",A),d.on("close",H),function(){d.removeListener("complete",x),d.removeListener("abort",H),d.removeListener("request",R),d.req&&d.req.removeListener("finish",x),d.removeListener("end",y),d.removeListener("close",y),d.removeListener("finish",x),d.removeListener("end",w),d.removeListener("error",A),d.removeListener("close",H)}}M.exports=v},{"../../../errors":399}],409:[function(i,M,E){M.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],410:[function(i,M,E){"use strict";var p;function g(x){var S=!1;return function(){S||(S=!0,x.apply(void 0,arguments))}}var l=i("../../../errors").codes,h=l.ERR_MISSING_ARGS,v=l.ERR_STREAM_DESTROYED;function d(x){if(x)throw x}function o(x){return x.setHeader&&typeof x.abort=="function"}function s(x,S,w,A){A=g(A);var H=!1;x.on("close",function(){H=!0}),p===void 0&&(p=i("./end-of-stream")),p(x,{readable:S,writable:w},function(F){if(F)return A(F);H=!0,A()});var R=!1;return function(F){if(!H&&!R){if(R=!0,o(x))return x.abort();if(typeof x.destroy=="function")return x.destroy();A(F||new v("pipe"))}}}function u(x){x()}function m(x,S){return x.pipe(S)}function y(x){return!x.length||typeof x[x.length-1]!="function"?d:x.pop()}function _(){for(var x=arguments.length,S=new Array(x),w=0;w<x;w++)S[w]=arguments[w];var A=y(S);if(Array.isArray(S[0])&&(S=S[0]),S.length<2)throw new h("streams");var H,R=S.map(function(F,D){var B=D<S.length-1,P=D>0;return s(F,B,P,function(U){H||(H=U),U&&R.forEach(u),!B&&(R.forEach(u),A(H))})});return S.reduce(m)}M.exports=_},{"../../../errors":399,"./end-of-stream":408}],411:[function(i,M,E){"use strict";var p=i("../../../errors").codes.ERR_INVALID_OPT_VALUE;function g(h,v,d){return h.highWaterMark!=null?h.highWaterMark:v?h[d]:null}function l(h,v,d,o){var s=g(v,o,d);if(s!=null){if(!(isFinite(s)&&Math.floor(s)===s)||s<0){var u=o?d:"highWaterMark";throw new p(u,s)}return Math.floor(s)}return h.objectMode?16:16*1024}M.exports={getHighWaterMark:l}},{"../../../errors":399}],412:[function(i,M,E){arguments[4][393][0].apply(E,arguments)},{dup:393,events:344}],413:[function(i,M,E){"use strict";var p=i("safe-buffer").Buffer,g=p.isEncoding||function(R){switch(R=""+R,R&&R.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function l(R){if(!R)return"utf8";for(var F;;)switch(R){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return R;default:if(F)return;R=(""+R).toLowerCase(),F=!0}}function h(R){var F=l(R);if(typeof F!="string"&&(p.isEncoding===g||!g(R)))throw new Error("Unknown encoding: "+R);return F||R}E.StringDecoder=v;function v(R){this.encoding=h(R);var F;switch(this.encoding){case"utf16le":this.text=_,this.end=x,F=4;break;case"utf8":this.fillLast=u,F=4;break;case"base64":this.text=S,this.end=w,F=3;break;default:this.write=A,this.end=H;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=p.allocUnsafe(F)}v.prototype.write=function(R){if(R.length===0)return"";var F,D;if(this.lastNeed){if(F=this.fillLast(R),F===void 0)return"";D=this.lastNeed,this.lastNeed=0}else D=0;return D<R.length?F?F+this.text(R,D):this.text(R,D):F||""},v.prototype.end=y,v.prototype.text=m,v.prototype.fillLast=function(R){if(this.lastNeed<=R.length)return R.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);R.copy(this.lastChar,this.lastTotal-this.lastNeed,0,R.length),this.lastNeed-=R.length};function d(R){return R<=127?0:R>>5===6?2:R>>4===14?3:R>>3===30?4:R>>6===2?-1:-2}function o(R,F,D){var B=F.length-1;if(B<D)return 0;var P=d(F[B]);return P>=0?(P>0&&(R.lastNeed=P-1),P):--B<D||P===-2?0:(P=d(F[B]),P>=0?(P>0&&(R.lastNeed=P-2),P):--B<D||P===-2?0:(P=d(F[B]),P>=0?(P>0&&(P===2?P=0:R.lastNeed=P-3),P):0))}function s(R,F,D){if((F[0]&192)!==128)return R.lastNeed=0,"\uFFFD";if(R.lastNeed>1&&F.length>1){if((F[1]&192)!==128)return R.lastNeed=1,"\uFFFD";if(R.lastNeed>2&&F.length>2&&(F[2]&192)!==128)return R.lastNeed=2,"\uFFFD"}}function u(R){var F=this.lastTotal-this.lastNeed,D=s(this,R,F);if(D!==void 0)return D;if(this.lastNeed<=R.length)return R.copy(this.lastChar,F,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);R.copy(this.lastChar,F,0,R.length),this.lastNeed-=R.length}function m(R,F){var D=o(this,R,F);if(!this.lastNeed)return R.toString("utf8",F);this.lastTotal=D;var B=R.length-(D-this.lastNeed);return R.copy(this.lastChar,0,B),R.toString("utf8",F,B)}function y(R){var F=R&&R.length?this.write(R):"";return this.lastNeed?F+"\uFFFD":F}function _(R,F){if((R.length-F)%2===0){var D=R.toString("utf16le",F);if(D){var B=D.charCodeAt(D.length-1);if(B>=55296&&B<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=R[R.length-2],this.lastChar[1]=R[R.length-1],D.slice(0,-1)}return D}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=R[R.length-1],R.toString("utf16le",F,R.length-1)}function x(R){var F=R&&R.length?this.write(R):"";if(this.lastNeed){var D=this.lastTotal-this.lastNeed;return F+this.lastChar.toString("utf16le",0,D)}return F}function S(R,F){var D=(R.length-F)%3;return D===0?R.toString("base64",F):(this.lastNeed=3-D,this.lastTotal=3,D===1?this.lastChar[0]=R[R.length-1]:(this.lastChar[0]=R[R.length-2],this.lastChar[1]=R[R.length-1]),R.toString("base64",F,R.length-D))}function w(R){var F=R&&R.length?this.write(R):"";return this.lastNeed?F+this.lastChar.toString("base64",0,3-this.lastNeed):F}function A(R){return R.toString(this.encoding)}function H(R){return R&&R.length?this.write(R):""}},{"safe-buffer":396}],414:[function(i,M,E){(function(p,g){(function(){var l=i("process/browser.js").nextTick,h=Function.prototype.apply,v=Array.prototype.slice,d={},o=0;E.setTimeout=function(){return new s(h.call(setTimeout,window,arguments),clearTimeout)},E.setInterval=function(){return new s(h.call(setInterval,window,arguments),clearInterval)},E.clearTimeout=E.clearInterval=function(u){u.close()};function s(u,m){this._id=u,this._clearFn=m}s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(window,this._id)},E.enroll=function(u,m){clearTimeout(u._idleTimeoutId),u._idleTimeout=m},E.unenroll=function(u){clearTimeout(u._idleTimeoutId),u._idleTimeout=-1},E._unrefActive=E.active=function(u){clearTimeout(u._idleTimeoutId);var m=u._idleTimeout;m>=0&&(u._idleTimeoutId=setTimeout(function(){u._onTimeout&&u._onTimeout()},m))},E.setImmediate=typeof p=="function"?p:function(u){var m=o++,y=arguments.length<2?!1:v.call(arguments,1);return d[m]=!0,l(function(){d[m]&&(y?u.apply(null,y):u.call(null),E.clearImmediate(m))}),m},E.clearImmediate=typeof g=="function"?g:function(u){delete d[u]}}).call(this)}).call(this,i("timers").setImmediate,i("timers").clearImmediate)},{"process/browser.js":381,timers:414}],415:[function(i,M,E){var p=i("buffer").Buffer;M.exports=function(g){if(g instanceof Uint8Array){if(g.byteOffset===0&&g.byteLength===g.buffer.byteLength)return g.buffer;if(typeof g.buffer.slice=="function")return g.buffer.slice(g.byteOffset,g.byteOffset+g.byteLength)}if(p.isBuffer(g)){for(var l=new Uint8Array(g.length),h=g.length,v=0;v<h;v++)l[v]=g[v];return l.buffer}else throw new Error("Argument must be a Buffer")}},{buffer:90}],416:[function(i,M,E){(function(p){(function(){M.exports=g;function g(h,v){if(l("noDeprecation"))return h;var d=!1;function o(){if(!d){if(l("throwDeprecation"))throw new Error(v);l("traceDeprecation")?console.trace(v):console.warn(v),d=!0}return h.apply(this,arguments)}return o}function l(h){try{if(!p.localStorage)return!1}catch(d){return!1}var v=p.localStorage[h];return v==null?!1:String(v).toLowerCase()==="true"}}).call(this)}).call(this,typeof Ue!="undefined"?Ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],417:[function(i,M,E){arguments[4][84][0].apply(E,arguments)},{dup:84}],418:[function(i,M,E){"use strict";var p=i("is-arguments"),g=i("is-generator-function"),l=i("which-typed-array"),h=i("is-typed-array");function v(ge){return ge.call.bind(ge)}var d=typeof BigInt!="undefined",o=typeof Symbol!="undefined",s=v(Object.prototype.toString),u=v(Number.prototype.valueOf),m=v(String.prototype.valueOf),y=v(Boolean.prototype.valueOf);if(d)var _=v(BigInt.prototype.valueOf);if(o)var x=v(Symbol.prototype.valueOf);function S(ge,Me){if(typeof ge!="object")return!1;try{return Me(ge),!0}catch(Fe){return!1}}E.isArgumentsObject=p,E.isGeneratorFunction=g,E.isTypedArray=h;function w(ge){return typeof Promise!="undefined"&&ge instanceof Promise||ge!==null&&typeof ge=="object"&&typeof ge.then=="function"&&typeof ge.catch=="function"}E.isPromise=w;function A(ge){return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?ArrayBuffer.isView(ge):h(ge)||be(ge)}E.isArrayBufferView=A;function H(ge){return l(ge)==="Uint8Array"}E.isUint8Array=H;function R(ge){return l(ge)==="Uint8ClampedArray"}E.isUint8ClampedArray=R;function F(ge){return l(ge)==="Uint16Array"}E.isUint16Array=F;function D(ge){return l(ge)==="Uint32Array"}E.isUint32Array=D;function B(ge){return l(ge)==="Int8Array"}E.isInt8Array=B;function P(ge){return l(ge)==="Int16Array"}E.isInt16Array=P;function U(ge){return l(ge)==="Int32Array"}E.isInt32Array=U;function G(ge){return l(ge)==="Float32Array"}E.isFloat32Array=G;function ee(ge){return l(ge)==="Float64Array"}E.isFloat64Array=ee;function K(ge){return l(ge)==="BigInt64Array"}E.isBigInt64Array=K;function Z(ge){return l(ge)==="BigUint64Array"}E.isBigUint64Array=Z;function $(ge){return s(ge)==="[object Map]"}$.working=typeof Map!="undefined"&&$(new Map);function oe(ge){return typeof Map=="undefined"?!1:$.working?$(ge):ge instanceof Map}E.isMap=oe;function ae(ge){return s(ge)==="[object Set]"}ae.working=typeof Set!="undefined"&&ae(new Set);function ye(ge){return typeof Set=="undefined"?!1:ae.working?ae(ge):ge instanceof Set}E.isSet=ye;function Y(ge){return s(ge)==="[object WeakMap]"}Y.working=typeof WeakMap!="undefined"&&Y(new WeakMap);function le(ge){return typeof WeakMap=="undefined"?!1:Y.working?Y(ge):ge instanceof WeakMap}E.isWeakMap=le;function xe(ge){return s(ge)==="[object WeakSet]"}xe.working=typeof WeakSet!="undefined"&&xe(new WeakSet);function Ce(ge){return xe(ge)}E.isWeakSet=Ce;function we(ge){return s(ge)==="[object ArrayBuffer]"}we.working=typeof ArrayBuffer!="undefined"&&we(new ArrayBuffer);function Le(ge){return typeof ArrayBuffer=="undefined"?!1:we.working?we(ge):ge instanceof ArrayBuffer}E.isArrayBuffer=Le;function de(ge){return s(ge)==="[object DataView]"}de.working=typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined"&&de(new DataView(new ArrayBuffer(1),0,1));function be(ge){return typeof DataView=="undefined"?!1:de.working?de(ge):ge instanceof DataView}E.isDataView=be;var Te=typeof SharedArrayBuffer!="undefined"?SharedArrayBuffer:void 0;function Ae(ge){return s(ge)==="[object SharedArrayBuffer]"}function Be(ge){return typeof Te=="undefined"?!1:(typeof Ae.working=="undefined"&&(Ae.working=Ae(new Te)),Ae.working?Ae(ge):ge instanceof Te)}E.isSharedArrayBuffer=Be;function Pe(ge){return s(ge)==="[object AsyncFunction]"}E.isAsyncFunction=Pe;function _e(ge){return s(ge)==="[object Map Iterator]"}E.isMapIterator=_e;function ne(ge){return s(ge)==="[object Set Iterator]"}E.isSetIterator=ne;function te(ge){return s(ge)==="[object Generator]"}E.isGeneratorObject=te;function T(ge){return s(ge)==="[object WebAssembly.Module]"}E.isWebAssemblyCompiledModule=T;function I(ge){return S(ge,u)}E.isNumberObject=I;function re(ge){return S(ge,m)}E.isStringObject=re;function q(ge){return S(ge,y)}E.isBooleanObject=q;function z(ge){return d&&S(ge,_)}E.isBigIntObject=z;function W(ge){return o&&S(ge,x)}E.isSymbolObject=W;function V(ge){return I(ge)||re(ge)||q(ge)||z(ge)||W(ge)}E.isBoxedPrimitive=V;function se(ge){return typeof Uint8Array!="undefined"&&(Le(ge)||Be(ge))}E.isAnyArrayBuffer=se,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(ge){Object.defineProperty(E,ge,{enumerable:!1,value:function(){throw new Error(ge+" is not supported in userland")}})})},{"is-arguments":365,"is-generator-function":368,"is-typed-array":369,"which-typed-array":420}],419:[function(i,M,E){(function(p){(function(){var g=Object.getOwnPropertyDescriptors||function(Te){for(var Ae=Object.keys(Te),Be={},Pe=0;Pe<Ae.length;Pe++)Be[Ae[Pe]]=Object.getOwnPropertyDescriptor(Te,Ae[Pe]);return Be},l=/%[sdj%]/g;E.format=function(be){if(!P(be)){for(var Te=[],Ae=0;Ae<arguments.length;Ae++)Te.push(o(arguments[Ae]));return Te.join(" ")}for(var Ae=1,Be=arguments,Pe=Be.length,_e=String(be).replace(l,function(te){if(te==="%%")return"%";if(Ae>=Pe)return te;switch(te){case"%s":return String(Be[Ae++]);case"%d":return Number(Be[Ae++]);case"%j":try{return JSON.stringify(Be[Ae++])}catch(T){return"[Circular]"}default:return te}}),ne=Be[Ae];Ae<Pe;ne=Be[++Ae])F(ne)||!K(ne)?_e+=" "+ne:_e+=" "+o(ne);return _e},E.deprecate=function(be,Te){if(typeof p!="undefined"&&p.noDeprecation===!0)return be;if(typeof p=="undefined")return function(){return E.deprecate(be,Te).apply(this,arguments)};var Ae=!1;function Be(){if(!Ae){if(p.throwDeprecation)throw new Error(Te);p.traceDeprecation?console.trace(Te):console.error(Te),Ae=!0}return be.apply(this,arguments)}return Be};var h={},v=/^$/;if(p.env.NODE_DEBUG){var d=p.env.NODE_DEBUG;d=d.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),v=new RegExp("^"+d+"$","i")}E.debuglog=function(be){if(be=be.toUpperCase(),!h[be])if(v.test(be)){var Te=p.pid;h[be]=function(){var Ae=E.format.apply(E,arguments);console.error("%s %d: %s",be,Te,Ae)}}else h[be]=function(){};return h[be]};function o(be,Te){var Ae={seen:[],stylize:u};return arguments.length>=3&&(Ae.depth=arguments[2]),arguments.length>=4&&(Ae.colors=arguments[3]),R(Te)?Ae.showHidden=Te:Te&&E._extend(Ae,Te),G(Ae.showHidden)&&(Ae.showHidden=!1),G(Ae.depth)&&(Ae.depth=2),G(Ae.colors)&&(Ae.colors=!1),G(Ae.customInspect)&&(Ae.customInspect=!0),Ae.colors&&(Ae.stylize=s),y(Ae,be,Ae.depth)}E.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function s(be,Te){var Ae=o.styles[Te];return Ae?"\x1B["+o.colors[Ae][0]+"m"+be+"\x1B["+o.colors[Ae][1]+"m":be}function u(be,Te){return be}function m(be){var Te={};return be.forEach(function(Ae,Be){Te[Ae]=!0}),Te}function y(be,Te,Ae){if(be.customInspect&&Te&&oe(Te.inspect)&&Te.inspect!==E.inspect&&!(Te.constructor&&Te.constructor.prototype===Te)){var Be=Te.inspect(Ae,be);return P(Be)||(Be=y(be,Be,Ae)),Be}var Pe=_(be,Te);if(Pe)return Pe;var _e=Object.keys(Te),ne=m(_e);if(be.showHidden&&(_e=Object.getOwnPropertyNames(Te)),$(Te)&&(_e.indexOf("message")>=0||_e.indexOf("description")>=0))return x(Te);if(_e.length===0){if(oe(Te)){var te=Te.name?": "+Te.name:"";return be.stylize("[Function"+te+"]","special")}if(ee(Te))return be.stylize(RegExp.prototype.toString.call(Te),"regexp");if(Z(Te))return be.stylize(Date.prototype.toString.call(Te),"date");if($(Te))return x(Te)}var T="",I=!1,re=["{","}"];if(H(Te)&&(I=!0,re=["[","]"]),oe(Te)){var q=Te.name?": "+Te.name:"";T=" [Function"+q+"]"}if(ee(Te)&&(T=" "+RegExp.prototype.toString.call(Te)),Z(Te)&&(T=" "+Date.prototype.toUTCString.call(Te)),$(Te)&&(T=" "+x(Te)),_e.length===0&&(!I||Te.length==0))return re[0]+T+re[1];if(Ae<0)return ee(Te)?be.stylize(RegExp.prototype.toString.call(Te),"regexp"):be.stylize("[Object]","special");be.seen.push(Te);var z;return I?z=S(be,Te,Ae,ne,_e):z=_e.map(function(W){return w(be,Te,Ae,ne,W,I)}),be.seen.pop(),A(z,T,re)}function _(be,Te){if(G(Te))return be.stylize("undefined","undefined");if(P(Te)){var Ae="'"+JSON.stringify(Te).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return be.stylize(Ae,"string")}if(B(Te))return be.stylize(""+Te,"number");if(R(Te))return be.stylize(""+Te,"boolean");if(F(Te))return be.stylize("null","null")}function x(be){return"["+Error.prototype.toString.call(be)+"]"}function S(be,Te,Ae,Be,Pe){for(var _e=[],ne=0,te=Te.length;ne<te;++ne)Ce(Te,String(ne))?_e.push(w(be,Te,Ae,Be,String(ne),!0)):_e.push("");return Pe.forEach(function(T){T.match(/^\d+$/)||_e.push(w(be,Te,Ae,Be,T,!0))}),_e}function w(be,Te,Ae,Be,Pe,_e){var ne,te,T;if(T=Object.getOwnPropertyDescriptor(Te,Pe)||{value:Te[Pe]},T.get?T.set?te=be.stylize("[Getter/Setter]","special"):te=be.stylize("[Getter]","special"):T.set&&(te=be.stylize("[Setter]","special")),Ce(Be,Pe)||(ne="["+Pe+"]"),te||(be.seen.indexOf(T.value)<0?(F(Ae)?te=y(be,T.value,null):te=y(be,T.value,Ae-1),te.indexOf(`
`)>-1&&(_e?te=te.split(`
`).map(function(I){return" "+I}).join(`
`).slice(2):te=`
`+te.split(`
`).map(function(I){return" "+I}).join(`
`))):te=be.stylize("[Circular]","special")),G(ne)){if(_e&&Pe.match(/^\d+$/))return te;ne=JSON.stringify(""+Pe),ne.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(ne=ne.slice(1,-1),ne=be.stylize(ne,"name")):(ne=ne.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),ne=be.stylize(ne,"string"))}return ne+": "+te}function A(be,Te,Ae){var Be=0,Pe=be.reduce(function(_e,ne){return Be++,ne.indexOf(`
`)>=0&&Be++,_e+ne.replace(/\u001b\[\d\d?m/g,"").length+1},0);return Pe>60?Ae[0]+(Te===""?"":Te+`
`)+" "+be.join(`,
`)+" "+Ae[1]:Ae[0]+Te+" "+be.join(", ")+" "+Ae[1]}E.types=i("./support/types");function H(be){return Array.isArray(be)}E.isArray=H;function R(be){return typeof be=="boolean"}E.isBoolean=R;function F(be){return be===null}E.isNull=F;function D(be){return be==null}E.isNullOrUndefined=D;function B(be){return typeof be=="number"}E.isNumber=B;function P(be){return typeof be=="string"}E.isString=P;function U(be){return typeof be=="symbol"}E.isSymbol=U;function G(be){return be===void 0}E.isUndefined=G;function ee(be){return K(be)&&ye(be)==="[object RegExp]"}E.isRegExp=ee,E.types.isRegExp=ee;function K(be){return typeof be=="object"&&be!==null}E.isObject=K;function Z(be){return K(be)&&ye(be)==="[object Date]"}E.isDate=Z,E.types.isDate=Z;function $(be){return K(be)&&(ye(be)==="[object Error]"||be instanceof Error)}E.isError=$,E.types.isNativeError=$;function oe(be){return typeof be=="function"}E.isFunction=oe;function ae(be){return be===null||typeof be=="boolean"||typeof be=="number"||typeof be=="string"||typeof be=="symbol"||typeof be=="undefined"}E.isPrimitive=ae,E.isBuffer=i("./support/isBuffer");function ye(be){return Object.prototype.toString.call(be)}function Y(be){return be<10?"0"+be.toString(10):be.toString(10)}var le=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function xe(){var be=new Date,Te=[Y(be.getHours()),Y(be.getMinutes()),Y(be.getSeconds())].join(":");return[be.getDate(),le[be.getMonth()],Te].join(" ")}E.log=function(){console.log("%s - %s",xe(),E.format.apply(E,arguments))},E.inherits=i("inherits"),E._extend=function(be,Te){if(!Te||!K(Te))return be;for(var Ae=Object.keys(Te),Be=Ae.length;Be--;)be[Ae[Be]]=Te[Ae[Be]];return be};function Ce(be,Te){return Object.prototype.hasOwnProperty.call(be,Te)}var we=typeof Symbol!="undefined"?Symbol("util.promisify.custom"):void 0;E.promisify=function(Te){if(typeof Te!="function")throw new TypeError('The "original" argument must be of type Function');if(we&&Te[we]){var Ae=Te[we];if(typeof Ae!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(Ae,we,{value:Ae,enumerable:!1,writable:!1,configurable:!0}),Ae}function Ae(){for(var Be,Pe,_e=new Promise(function(T,I){Be=T,Pe=I}),ne=[],te=0;te<arguments.length;te++)ne.push(arguments[te]);ne.push(function(T,I){T?Pe(T):Be(I)});try{Te.apply(this,ne)}catch(T){Pe(T)}return _e}return Object.setPrototypeOf(Ae,Object.getPrototypeOf(Te)),we&&Object.defineProperty(Ae,we,{value:Ae,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(Ae,g(Te))},E.promisify.custom=we;function Le(be,Te){if(!be){var Ae=new Error("Promise was rejected with a falsy value");Ae.reason=be,be=Ae}return Te(be)}function de(be){if(typeof be!="function")throw new TypeError('The "original" argument must be of type Function');function Te(){for(var Ae=[],Be=0;Be<arguments.length;Be++)Ae.push(arguments[Be]);var Pe=Ae.pop();if(typeof Pe!="function")throw new TypeError("The last argument must be of type Function");var _e=this,ne=function(){return Pe.apply(_e,arguments)};be.apply(this,Ae).then(function(te){p.nextTick(ne.bind(null,null,te))},function(te){p.nextTick(Le.bind(null,te,ne))})}return Object.setPrototypeOf(Te,Object.getPrototypeOf(be)),Object.defineProperties(Te,g(be)),Te}E.callbackify=de}).call(this)}).call(this,i("_process"))},{"./support/isBuffer":417,"./support/types":418,_process:467,inherits:364}],420:[function(i,M,E){(function(p){(function(){"use strict";var g=i("for-each"),l=i("available-typed-arrays"),h=i("call-bind"),v=i("call-bind/callBound"),d=i("gopd"),o=v("Object.prototype.toString"),s=i("has-tostringtag/shams")(),u=typeof globalThis=="undefined"?p:globalThis,m=l(),y=v("String.prototype.slice"),_=Object.getPrototypeOf,x=v("Array.prototype.indexOf",!0)||function(R,F){for(var D=0;D<R.length;D+=1)if(R[D]===F)return D;return-1},S={__proto__:null};s&&d&&_?g(m,function(H){var R=new u[H];if(Symbol.toStringTag in R){var F=_(R),D=d(F,Symbol.toStringTag);if(!D){var B=_(F);D=d(B,Symbol.toStringTag)}S["$"+H]=h(D.get)}}):g(m,function(H){var R=new u[H];S["$"+H]=h(R.slice)});var w=function(R){var F=!1;return g(S,function(D,B){if(!F)try{"$"+D(R)===B&&(F=y(B,1))}catch(P){}}),F},A=function(R){var F=!1;return g(S,function(D,B){if(!F)try{D(R),F=y(B,1)}catch(P){}}),F};M.exports=function(R){if(!R||typeof R!="object")return!1;if(!s){var F=y(o(R),8,-1);return x(m,F)>-1?F:F!=="Object"?!1:A(R)}return d?w(R):null}}).call(this)}).call(this,typeof Ue!="undefined"?Ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"available-typed-arrays":86,"call-bind":93,"call-bind/callBound":92,"for-each":345,gopd:349,"has-tostringtag/shams":353}],421:[function(i,M,E){(function(){"use strict";E.stripBOM=function(p){return p[0]==="\uFEFF"?p.substring(1):p}}).call(this)},{}],422:[function(i,M,E){(function(){"use strict";var p,g,l,h,v,d={}.hasOwnProperty;p=i("xmlbuilder"),g=i("./defaults").defaults,h=function(o){return typeof o=="string"&&(o.indexOf("&")>=0||o.indexOf(">")>=0||o.indexOf("<")>=0)},v=function(o){return"<![CDATA["+l(o)+"]]>"},l=function(o){return o.replace("]]>","]]]]><![CDATA[>")},E.Builder=function(){function o(s){var u,m,y;this.options={},m=g["0.2"];for(u in m)d.call(m,u)&&(y=m[u],this.options[u]=y);for(u in s)d.call(s,u)&&(y=s[u],this.options[u]=y)}return o.prototype.buildObject=function(s){var u,m,y,_,x;return u=this.options.attrkey,m=this.options.charkey,Object.keys(s).length===1&&this.options.rootName===g["0.2"].rootName?(x=Object.keys(s)[0],s=s[x]):x=this.options.rootName,y=function(S){return function(w,A){var H,R,F,D,B,P;if(typeof A!="object")S.options.cdata&&h(A)?w.raw(v(A)):w.txt(A);else if(Array.isArray(A)){for(D in A)if(d.call(A,D)){R=A[D];for(B in R)F=R[B],w=y(w.ele(B),F).up()}}else for(B in A)if(d.call(A,B))if(R=A[B],B===u){if(typeof R=="object")for(H in R)P=R[H],w=w.att(H,P)}else if(B===m)S.options.cdata&&h(R)?w=w.raw(v(R)):w=w.txt(R);else if(Array.isArray(R))for(D in R)d.call(R,D)&&(F=R[D],typeof F=="string"?S.options.cdata&&h(F)?w=w.ele(B).raw(v(F)).up():w=w.ele(B,F).up():w=y(w.ele(B),F).up());else typeof R=="object"?w=y(w.ele(B),R).up():typeof R=="string"&&S.options.cdata&&h(R)?w=w.ele(B).raw(v(R)).up():(R==null&&(R=""),w=w.ele(B,R.toString()).up());return w}}(this),_=p.create(x,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),y(_,s).end(this.options.renderOpts)},o}()}).call(this)},{"./defaults":423,xmlbuilder:459}],423:[function(i,M,E){(function(){E.defaults={"0.1":{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},"0.2":{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:`
`},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(this)},{}],424:[function(i,M,E){(function(){"use strict";var p,g,l,h,v,d,o,s,u,m=function(x,S){return function(){return x.apply(S,arguments)}},y=function(x,S){for(var w in S)_.call(S,w)&&(x[w]=S[w]);function A(){this.constructor=x}return A.prototype=S.prototype,x.prototype=new A,x.__super__=S.prototype,x},_={}.hasOwnProperty;s=i("sax"),h=i("events"),p=i("./bom"),o=i("./processors"),u=i("timers").setImmediate,g=i("./defaults").defaults,v=function(x){return typeof x=="object"&&x!=null&&Object.keys(x).length===0},d=function(x,S,w){var A,H,R;for(A=0,H=x.length;A<H;A++)R=x[A],S=R(S,w);return S},l=function(x,S,w){var A;return A=Object.create(null),A.value=w,A.writable=!0,A.enumerable=!0,A.configurable=!0,Object.defineProperty(x,S,A)},E.Parser=function(x){y(S,x);function S(w){this.parseStringPromise=m(this.parseStringPromise,this),this.parseString=m(this.parseString,this),this.reset=m(this.reset,this),this.assignOrPush=m(this.assignOrPush,this),this.processAsync=m(this.processAsync,this);var A,H,R;if(!(this instanceof E.Parser))return new E.Parser(w);this.options={},H=g["0.2"];for(A in H)_.call(H,A)&&(R=H[A],this.options[A]=R);for(A in w)_.call(w,A)&&(R=w[A],this.options[A]=R);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(o.normalize)),this.reset()}return S.prototype.processAsync=function(){var w,A;try{return this.remaining.length<=this.options.chunkSize?(w=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(w),this.saxParser.close()):(w=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(w),u(this.processAsync))}catch(H){if(A=H,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(A)}},S.prototype.assignOrPush=function(w,A,H){return A in w?(w[A]instanceof Array||l(w,A,[w[A]]),w[A].push(H)):this.options.explicitArray?l(w,A,[H]):l(w,A,H)},S.prototype.reset=function(){var w,A,H,R;return this.removeAllListeners(),this.saxParser=s.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=function(F){return function(D){if(F.saxParser.resume(),!F.saxParser.errThrown)return F.saxParser.errThrown=!0,F.emit("error",D)}}(this),this.saxParser.onend=function(F){return function(){if(!F.saxParser.ended)return F.saxParser.ended=!0,F.emit("end",F.resultObject)}}(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,R=[],w=this.options.attrkey,A=this.options.charkey,this.saxParser.onopentag=function(F){return function(D){var B,P,U,G,ee;if(U={},U[A]="",!F.options.ignoreAttrs){ee=D.attributes;for(B in ee)_.call(ee,B)&&(!(w in U)&&!F.options.mergeAttrs&&(U[w]={}),P=F.options.attrValueProcessors?d(F.options.attrValueProcessors,D.attributes[B],B):D.attributes[B],G=F.options.attrNameProcessors?d(F.options.attrNameProcessors,B):B,F.options.mergeAttrs?F.assignOrPush(U,G,P):l(U[w],G,P))}return U["#name"]=F.options.tagNameProcessors?d(F.options.tagNameProcessors,D.name):D.name,F.options.xmlns&&(U[F.options.xmlnskey]={uri:D.uri,local:D.local}),R.push(U)}}(this),this.saxParser.onclosetag=function(F){return function(){var D,B,P,U,G,ee,K,Z,$,oe;if(ee=R.pop(),G=ee["#name"],(!F.options.explicitChildren||!F.options.preserveChildrenOrder)&&delete ee["#name"],ee.cdata===!0&&(D=ee.cdata,delete ee.cdata),$=R[R.length-1],ee[A].match(/^\s*$/)&&!D?(B=ee[A],delete ee[A]):(F.options.trim&&(ee[A]=ee[A].trim()),F.options.normalize&&(ee[A]=ee[A].replace(/\s{2,}/g," ").trim()),ee[A]=F.options.valueProcessors?d(F.options.valueProcessors,ee[A],G):ee[A],Object.keys(ee).length===1&&A in ee&&!F.EXPLICIT_CHARKEY&&(ee=ee[A])),v(ee)&&(typeof F.options.emptyTag=="function"?ee=F.options.emptyTag():ee=F.options.emptyTag!==""?F.options.emptyTag:B),F.options.validator!=null&&(oe="/"+function(){var ae,ye,Y;for(Y=[],ae=0,ye=R.length;ae<ye;ae++)U=R[ae],Y.push(U["#name"]);return Y}().concat(G).join("/"),function(){var ae;try{return ee=F.options.validator(oe,$&&$[G],ee)}catch(ye){return ae=ye,F.emit("error",ae)}}()),F.options.explicitChildren&&!F.options.mergeAttrs&&typeof ee=="object"){if(!F.options.preserveChildrenOrder)U={},F.options.attrkey in ee&&(U[F.options.attrkey]=ee[F.options.attrkey],delete ee[F.options.attrkey]),!F.options.charsAsChildren&&F.options.charkey in ee&&(U[F.options.charkey]=ee[F.options.charkey],delete ee[F.options.charkey]),Object.getOwnPropertyNames(ee).length>0&&(U[F.options.childkey]=ee),ee=U;else if($){$[F.options.childkey]=$[F.options.childkey]||[],K={};for(P in ee)_.call(ee,P)&&l(K,P,ee[P]);$[F.options.childkey].push(K),delete ee["#name"],Object.keys(ee).length===1&&A in ee&&!F.EXPLICIT_CHARKEY&&(ee=ee[A])}}return R.length>0?F.assignOrPush($,G,ee):(F.options.explicitRoot&&(Z=ee,ee={},l(ee,G,Z)),F.resultObject=ee,F.saxParser.ended=!0,F.emit("end",F.resultObject))}}(this),H=function(F){return function(D){var B,P;if(P=R[R.length-1],P)return P[A]+=D,F.options.explicitChildren&&F.options.preserveChildrenOrder&&F.options.charsAsChildren&&(F.options.includeWhiteChars||D.replace(/\\n/g,"").trim()!=="")&&(P[F.options.childkey]=P[F.options.childkey]||[],B={"#name":"__text__"},B[A]=D,F.options.normalize&&(B[A]=B[A].replace(/\s{2,}/g," ").trim()),P[F.options.childkey].push(B)),P}}(this),this.saxParser.ontext=H,this.saxParser.oncdata=function(F){return function(D){var B;if(B=H(D),B)return B.cdata=!0}}(this)},S.prototype.parseString=function(w,A){var H;A!=null&&typeof A=="function"&&(this.on("end",function(R){return this.reset(),A(null,R)}),this.on("error",function(R){return this.reset(),A(R)}));try{return w=w.toString(),w.trim()===""?(this.emit("end",null),!0):(w=p.stripBOM(w),this.options.async?(this.remaining=w,u(this.processAsync),this.saxParser):this.saxParser.write(w).close())}catch(R){if(H=R,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw H}else return this.emit("error",H),this.saxParser.errThrown=!0}},S.prototype.parseStringPromise=function(w){return new Promise(function(A){return function(H,R){return A.parseString(w,function(F,D){return F?R(F):H(D)})}}(this))},S}(h),E.parseString=function(x,S,w){var A,H,R;return w!=null?(typeof w=="function"&&(A=w),typeof S=="object"&&(H=S)):(typeof S=="function"&&(A=S),H={}),R=new E.Parser(H),R.parseString(x,A)},E.parseStringPromise=function(x,S){var w,A;return typeof S=="object"&&(w=S),A=new E.Parser(w),A.parseStringPromise(x)}}).call(this)},{"./bom":421,"./defaults":423,"./processors":425,events:344,sax:397,timers:414}],425:[function(i,M,E){(function(){"use strict";var p;p=new RegExp(/(?!xmlns)^.*:/),E.normalize=function(g){return g.toLowerCase()},E.firstCharLowerCase=function(g){return g.charAt(0).toLowerCase()+g.slice(1)},E.stripPrefix=function(g){return g.replace(p,"")},E.parseNumbers=function(g){return isNaN(g)||(g=g%1===0?parseInt(g,10):parseFloat(g)),g},E.parseBooleans=function(g){return/^(?:true|false)$/i.test(g)&&(g=g.toLowerCase()==="true"),g}}).call(this)},{}],426:[function(i,M,E){(function(){"use strict";var p,g,l,h,v=function(o,s){for(var u in s)d.call(s,u)&&(o[u]=s[u]);function m(){this.constructor=o}return m.prototype=s.prototype,o.prototype=new m,o.__super__=s.prototype,o},d={}.hasOwnProperty;g=i("./defaults"),p=i("./builder"),l=i("./parser"),h=i("./processors"),E.defaults=g.defaults,E.processors=h,E.ValidationError=function(o){v(s,o);function s(u){this.message=u}return s}(Error),E.Builder=p.Builder,E.Parser=l.Parser,E.parseString=l.parseString,E.parseStringPromise=l.parseStringPromise}).call(this)},{"./builder":422,"./defaults":423,"./parser":424,"./processors":425}],427:[function(i,M,E){(function(){M.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(this)},{}],428:[function(i,M,E){(function(){M.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(this)},{}],429:[function(i,M,E){(function(){var p,g,l,h,v,d,o,s=[].slice,u={}.hasOwnProperty;p=function(){var m,y,_,x,S,w;if(w=arguments[0],S=2<=arguments.length?s.call(arguments,1):[],v(Object.assign))Object.assign.apply(null,arguments);else for(m=0,_=S.length;m<_;m++)if(x=S[m],x!=null)for(y in x)u.call(x,y)&&(w[y]=x[y]);return w},v=function(m){return!!m&&Object.prototype.toString.call(m)==="[object Function]"},d=function(m){var y;return!!m&&((y=typeof m)=="function"||y==="object")},l=function(m){return v(Array.isArray)?Array.isArray(m):Object.prototype.toString.call(m)==="[object Array]"},h=function(m){var y;if(l(m))return!m.length;for(y in m)if(u.call(m,y))return!1;return!0},o=function(m){var y,_;return d(m)&&(_=Object.getPrototypeOf(m))&&(y=_.constructor)&&typeof y=="function"&&y instanceof y&&Function.prototype.toString.call(y)===Function.prototype.toString.call(Object)},g=function(m){return v(m.valueOf)?m.valueOf():m},M.exports.assign=p,M.exports.isFunction=v,M.exports.isObject=d,M.exports.isArray=l,M.exports.isEmpty=h,M.exports.isPlainObject=o,M.exports.getValue=g}).call(this)},{}],430:[function(i,M,E){(function(){M.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(this)},{}],431:[function(i,M,E){(function(){var p,g,l;p=i("./NodeType"),l=i("./XMLNode"),M.exports=g=function(){function h(v,d,o){if(this.parent=v,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),d==null)throw new Error("Missing attribute name. "+this.debugInfo(d));this.name=this.stringify.name(d),this.value=this.stringify.attValue(o),this.type=p.Attribute,this.isId=!1,this.schemaTypeInfo=null}return Object.defineProperty(h.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(h.prototype,"ownerElement",{get:function(){return this.parent}}),Object.defineProperty(h.prototype,"textContent",{get:function(){return this.value},set:function(v){return this.value=v||""}}),Object.defineProperty(h.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(h.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(h.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(h.prototype,"specified",{get:function(){return!0}}),h.prototype.clone=function(){return Object.create(this)},h.prototype.toString=function(v){return this.options.writer.attribute(this,this.options.writer.filterOptions(v))},h.prototype.debugInfo=function(v){return v=v||this.name,v==null?"parent: <"+this.parent.name+">":"attribute: {"+v+"}, parent: <"+this.parent.name+">"},h.prototype.isEqualNode=function(v){return!(v.namespaceURI!==this.namespaceURI||v.prefix!==this.prefix||v.localName!==this.localName||v.value!==this.value)},h}()}).call(this)},{"./NodeType":428,"./XMLNode":450}],432:[function(i,M,E){(function(){var p,g,l,h=function(d,o){for(var s in o)v.call(o,s)&&(d[s]=o[s]);function u(){this.constructor=d}return u.prototype=o.prototype,d.prototype=new u,d.__super__=o.prototype,d},v={}.hasOwnProperty;p=i("./NodeType"),l=i("./XMLCharacterData"),M.exports=g=function(d){h(o,d);function o(s,u){if(o.__super__.constructor.call(this,s),u==null)throw new Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=p.CData,this.value=this.stringify.cdata(u)}return o.prototype.clone=function(){return Object.create(this)},o.prototype.toString=function(s){return this.options.writer.cdata(this,this.options.writer.filterOptions(s))},o}(l)}).call(this)},{"./NodeType":428,"./XMLCharacterData":433}],433:[function(i,M,E){(function(){var p,g,l=function(v,d){for(var o in d)h.call(d,o)&&(v[o]=d[o]);function s(){this.constructor=v}return s.prototype=d.prototype,v.prototype=new s,v.__super__=d.prototype,v},h={}.hasOwnProperty;g=i("./XMLNode"),M.exports=p=function(v){l(d,v);function d(o){d.__super__.constructor.call(this,o),this.value=""}return Object.defineProperty(d.prototype,"data",{get:function(){return this.value},set:function(o){return this.value=o||""}}),Object.defineProperty(d.prototype,"length",{get:function(){return this.value.length}}),Object.defineProperty(d.prototype,"textContent",{get:function(){return this.value},set:function(o){return this.value=o||""}}),d.prototype.clone=function(){return Object.create(this)},d.prototype.substringData=function(o,s){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.appendData=function(o){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.insertData=function(o,s){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.deleteData=function(o,s){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.replaceData=function(o,s,u){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.isEqualNode=function(o){return!(!d.__super__.isEqualNode.apply(this,arguments).isEqualNode(o)||o.data!==this.data)},d}(g)}).call(this)},{"./XMLNode":450}],434:[function(i,M,E){(function(){var p,g,l,h=function(d,o){for(var s in o)v.call(o,s)&&(d[s]=o[s]);function u(){this.constructor=d}return u.prototype=o.prototype,d.prototype=new u,d.__super__=o.prototype,d},v={}.hasOwnProperty;p=i("./NodeType"),g=i("./XMLCharacterData"),M.exports=l=function(d){h(o,d);function o(s,u){if(o.__super__.constructor.call(this,s),u==null)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=p.Comment,this.value=this.stringify.comment(u)}return o.prototype.clone=function(){return Object.create(this)},o.prototype.toString=function(s){return this.options.writer.comment(this,this.options.writer.filterOptions(s))},o}(g)}).call(this)},{"./NodeType":428,"./XMLCharacterData":433}],435:[function(i,M,E){(function(){var p,g,l;g=i("./XMLDOMErrorHandler"),l=i("./XMLDOMStringList"),M.exports=p=function(){function h(){var v;this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new g,infoset:!0,"validate-if-schema":!1,namespaces:!0,"namespace-declarations":!0,"normalize-characters":!1,"schema-location":"","schema-type":"","split-cdata-sections":!0,validate:!1,"well-formed":!0},this.params=v=Object.create(this.defaultParams)}return Object.defineProperty(h.prototype,"parameterNames",{get:function(){return new l(Object.keys(this.defaultParams))}}),h.prototype.getParameter=function(v){return this.params.hasOwnProperty(v)?this.params[v]:null},h.prototype.canSetParameter=function(v,d){return!0},h.prototype.setParameter=function(v,d){return d!=null?this.params[v]=d:delete this.params[v]},h}()}).call(this)},{"./XMLDOMErrorHandler":436,"./XMLDOMStringList":438}],436:[function(i,M,E){(function(){var p;M.exports=p=function(){function g(){}return g.prototype.handleError=function(l){throw new Error(l)},g}()}).call(this)},{}],437:[function(i,M,E){(function(){var p;M.exports=p=function(){function g(){}return g.prototype.hasFeature=function(l,h){return!0},g.prototype.createDocumentType=function(l,h,v){throw new Error("This DOM method is not implemented.")},g.prototype.createDocument=function(l,h,v){throw new Error("This DOM method is not implemented.")},g.prototype.createHTMLDocument=function(l){throw new Error("This DOM method is not implemented.")},g.prototype.getFeature=function(l,h){throw new Error("This DOM method is not implemented.")},g}()}).call(this)},{}],438:[function(i,M,E){(function(){var p;M.exports=p=function(){function g(l){this.arr=l||[]}return Object.defineProperty(g.prototype,"length",{get:function(){return this.arr.length}}),g.prototype.item=function(l){return this.arr[l]||null},g.prototype.contains=function(l){return this.arr.indexOf(l)!==-1},g}()}).call(this)},{}],439:[function(i,M,E){(function(){var p,g,l,h=function(d,o){for(var s in o)v.call(o,s)&&(d[s]=o[s]);function u(){this.constructor=d}return u.prototype=o.prototype,d.prototype=new u,d.__super__=o.prototype,d},v={}.hasOwnProperty;l=i("./XMLNode"),p=i("./NodeType"),M.exports=g=function(d){h(o,d);function o(s,u,m,y,_,x){if(o.__super__.constructor.call(this,s),u==null)throw new Error("Missing DTD element name. "+this.debugInfo());if(m==null)throw new Error("Missing DTD attribute name. "+this.debugInfo(u));if(!y)throw new Error("Missing DTD attribute type. "+this.debugInfo(u));if(!_)throw new Error("Missing DTD attribute default. "+this.debugInfo(u));if(_.indexOf("#")!==0&&(_="#"+_),!_.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(u));if(x&&!_.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(u));this.elementName=this.stringify.name(u),this.type=p.AttributeDeclaration,this.attributeName=this.stringify.name(m),this.attributeType=this.stringify.dtdAttType(y),x&&(this.defaultValue=this.stringify.dtdAttDefault(x)),this.defaultValueType=_}return o.prototype.toString=function(s){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(s))},o}(l)}).call(this)},{"./NodeType":428,"./XMLNode":450}],440:[function(i,M,E){(function(){var p,g,l,h=function(d,o){for(var s in o)v.call(o,s)&&(d[s]=o[s]);function u(){this.constructor=d}return u.prototype=o.prototype,d.prototype=new u,d.__super__=o.prototype,d},v={}.hasOwnProperty;l=i("./XMLNode"),p=i("./NodeType"),M.exports=g=function(d){h(o,d);function o(s,u,m){if(o.__super__.constructor.call(this,s),u==null)throw new Error("Missing DTD element name. "+this.debugInfo());m||(m="(#PCDATA)"),Array.isArray(m)&&(m="("+m.join(",")+")"),this.name=this.stringify.name(u),this.type=p.ElementDeclaration,this.value=this.stringify.dtdElementValue(m)}return o.prototype.toString=function(s){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(s))},o}(l)}).call(this)},{"./NodeType":428,"./XMLNode":450}],441:[function(i,M,E){(function(){var p,g,l,h,v=function(o,s){for(var u in s)d.call(s,u)&&(o[u]=s[u]);function m(){this.constructor=o}return m.prototype=s.prototype,o.prototype=new m,o.__super__=s.prototype,o},d={}.hasOwnProperty;h=i("./Utility").isObject,l=i("./XMLNode"),p=i("./NodeType"),M.exports=g=function(o){v(s,o);function s(u,m,y,_){if(s.__super__.constructor.call(this,u),y==null)throw new Error("Missing DTD entity name. "+this.debugInfo(y));if(_==null)throw new Error("Missing DTD entity value. "+this.debugInfo(y));if(this.pe=!!m,this.name=this.stringify.name(y),this.type=p.EntityDeclaration,!h(_))this.value=this.stringify.dtdEntityValue(_),this.internal=!0;else{if(!_.pubID&&!_.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(y));if(_.pubID&&!_.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(y));if(this.internal=!1,_.pubID!=null&&(this.pubID=this.stringify.dtdPubID(_.pubID)),_.sysID!=null&&(this.sysID=this.stringify.dtdSysID(_.sysID)),_.nData!=null&&(this.nData=this.stringify.dtdNData(_.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(y))}}return Object.defineProperty(s.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(s.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(s.prototype,"notationName",{get:function(){return this.nData||null}}),Object.defineProperty(s.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(s.prototype,"xmlEncoding",{get:function(){return null}}),Object.defineProperty(s.prototype,"xmlVersion",{get:function(){return null}}),s.prototype.toString=function(u){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(u))},s}(l)}).call(this)},{"./NodeType":428,"./Utility":429,"./XMLNode":450}],442:[function(i,M,E){(function(){var p,g,l,h=function(d,o){for(var s in o)v.call(o,s)&&(d[s]=o[s]);function u(){this.constructor=d}return u.prototype=o.prototype,d.prototype=new u,d.__super__=o.prototype,d},v={}.hasOwnProperty;l=i("./XMLNode"),p=i("./NodeType"),M.exports=g=function(d){h(o,d);function o(s,u,m){if(o.__super__.constructor.call(this,s),u==null)throw new Error("Missing DTD notation name. "+this.debugInfo(u));if(!m.pubID&&!m.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(u));this.name=this.stringify.name(u),this.type=p.NotationDeclaration,m.pubID!=null&&(this.pubID=this.stringify.dtdPubID(m.pubID)),m.sysID!=null&&(this.sysID=this.stringify.dtdSysID(m.sysID))}return Object.defineProperty(o.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(o.prototype,"systemId",{get:function(){return this.sysID}}),o.prototype.toString=function(s){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(s))},o}(l)}).call(this)},{"./NodeType":428,"./XMLNode":450}],443:[function(i,M,E){(function(){var p,g,l,h,v=function(o,s){for(var u in s)d.call(s,u)&&(o[u]=s[u]);function m(){this.constructor=o}return m.prototype=s.prototype,o.prototype=new m,o.__super__=s.prototype,o},d={}.hasOwnProperty;h=i("./Utility").isObject,l=i("./XMLNode"),p=i("./NodeType"),M.exports=g=function(o){v(s,o);function s(u,m,y,_){var x;s.__super__.constructor.call(this,u),h(m)&&(x=m,m=x.version,y=x.encoding,_=x.standalone),m||(m="1.0"),this.type=p.Declaration,this.version=this.stringify.xmlVersion(m),y!=null&&(this.encoding=this.stringify.xmlEncoding(y)),_!=null&&(this.standalone=this.stringify.xmlStandalone(_))}return s.prototype.toString=function(u){return this.options.writer.declaration(this,this.options.writer.filterOptions(u))},s}(l)}).call(this)},{"./NodeType":428,"./Utility":429,"./XMLNode":450}],444:[function(i,M,E){(function(){var p,g,l,h,v,d,o,s,u,m=function(_,x){for(var S in x)y.call(x,S)&&(_[S]=x[S]);function w(){this.constructor=_}return w.prototype=x.prototype,_.prototype=new w,_.__super__=x.prototype,_},y={}.hasOwnProperty;u=i("./Utility").isObject,s=i("./XMLNode"),p=i("./NodeType"),g=i("./XMLDTDAttList"),h=i("./XMLDTDEntity"),l=i("./XMLDTDElement"),v=i("./XMLDTDNotation"),o=i("./XMLNamedNodeMap"),M.exports=d=function(_){m(x,_);function x(S,w,A){var H,R,F,D,B,P;if(x.__super__.constructor.call(this,S),this.type=p.DocType,S.children){for(D=S.children,R=0,F=D.length;R<F;R++)if(H=D[R],H.type===p.Element){this.name=H.name;break}}this.documentObject=S,u(w)&&(B=w,w=B.pubID,A=B.sysID),A==null&&(P=[w,A],A=P[0],w=P[1]),w!=null&&(this.pubID=this.stringify.dtdPubID(w)),A!=null&&(this.sysID=this.stringify.dtdSysID(A))}return Object.defineProperty(x.prototype,"entities",{get:function(){var S,w,A,H,R;for(H={},R=this.children,w=0,A=R.length;w<A;w++)S=R[w],S.type===p.EntityDeclaration&&!S.pe&&(H[S.name]=S);return new o(H)}}),Object.defineProperty(x.prototype,"notations",{get:function(){var S,w,A,H,R;for(H={},R=this.children,w=0,A=R.length;w<A;w++)S=R[w],S.type===p.NotationDeclaration&&(H[S.name]=S);return new o(H)}}),Object.defineProperty(x.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(x.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(x.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),x.prototype.element=function(S,w){var A;return A=new l(this,S,w),this.children.push(A),this},x.prototype.attList=function(S,w,A,H,R){var F;return F=new g(this,S,w,A,H,R),this.children.push(F),this},x.prototype.entity=function(S,w){var A;return A=new h(this,!1,S,w),this.children.push(A),this},x.prototype.pEntity=function(S,w){var A;return A=new h(this,!0,S,w),this.children.push(A),this},x.prototype.notation=function(S,w){var A;return A=new v(this,S,w),this.children.push(A),this},x.prototype.toString=function(S){return this.options.writer.docType(this,this.options.writer.filterOptions(S))},x.prototype.ele=function(S,w){return this.element(S,w)},x.prototype.att=function(S,w,A,H,R){return this.attList(S,w,A,H,R)},x.prototype.ent=function(S,w){return this.entity(S,w)},x.prototype.pent=function(S,w){return this.pEntity(S,w)},x.prototype.not=function(S,w){return this.notation(S,w)},x.prototype.up=function(){return this.root()||this.documentObject},x.prototype.isEqualNode=function(S){return!(!x.__super__.isEqualNode.apply(this,arguments).isEqualNode(S)||S.name!==this.name||S.publicId!==this.publicId||S.systemId!==this.systemId)},x}(s)}).call(this)},{"./NodeType":428,"./Utility":429,"./XMLDTDAttList":439,"./XMLDTDElement":440,"./XMLDTDEntity":441,"./XMLDTDNotation":442,"./XMLNamedNodeMap":449,"./XMLNode":450}],445:[function(i,M,E){(function(){var p,g,l,h,v,d,o,s,u=function(y,_){for(var x in _)m.call(_,x)&&(y[x]=_[x]);function S(){this.constructor=y}return S.prototype=_.prototype,y.prototype=new S,y.__super__=_.prototype,y},m={}.hasOwnProperty;s=i("./Utility").isPlainObject,l=i("./XMLDOMImplementation"),g=i("./XMLDOMConfiguration"),v=i("./XMLNode"),p=i("./NodeType"),o=i("./XMLStringifier"),d=i("./XMLStringWriter"),M.exports=h=function(y){u(_,y);function _(x){_.__super__.constructor.call(this,null),this.name="#document",this.type=p.Document,this.documentURI=null,this.domConfig=new g,x||(x={}),x.writer||(x.writer=new d),this.options=x,this.stringify=new o(x)}return Object.defineProperty(_.prototype,"implementation",{value:new l}),Object.defineProperty(_.prototype,"doctype",{get:function(){var x,S,w,A;for(A=this.children,S=0,w=A.length;S<w;S++)if(x=A[S],x.type===p.DocType)return x;return null}}),Object.defineProperty(_.prototype,"documentElement",{get:function(){return this.rootObject||null}}),Object.defineProperty(_.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(_.prototype,"strictErrorChecking",{get:function(){return!1}}),Object.defineProperty(_.prototype,"xmlEncoding",{get:function(){return this.children.length!==0&&this.children[0].type===p.Declaration?this.children[0].encoding:null}}),Object.defineProperty(_.prototype,"xmlStandalone",{get:function(){return this.children.length!==0&&this.children[0].type===p.Declaration?this.children[0].standalone==="yes":!1}}),Object.defineProperty(_.prototype,"xmlVersion",{get:function(){return this.children.length!==0&&this.children[0].type===p.Declaration?this.children[0].version:"1.0"}}),Object.defineProperty(_.prototype,"URL",{get:function(){return this.documentURI}}),Object.defineProperty(_.prototype,"origin",{get:function(){return null}}),Object.defineProperty(_.prototype,"compatMode",{get:function(){return null}}),Object.defineProperty(_.prototype,"characterSet",{get:function(){return null}}),Object.defineProperty(_.prototype,"contentType",{get:function(){return null}}),_.prototype.end=function(x){var S;return S={},x?s(x)&&(S=x,x=this.options.writer):x=this.options.writer,x.document(this,x.filterOptions(S))},_.prototype.toString=function(x){return this.options.writer.document(this,this.options.writer.filterOptions(x))},_.prototype.createElement=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},_.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},_.prototype.createTextNode=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},_.prototype.createComment=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},_.prototype.createCDATASection=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},_.prototype.createProcessingInstruction=function(x,S){throw new Error("This DOM method is not implemented."+this.debugInfo())},_.prototype.createAttribute=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},_.prototype.createEntityReference=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},_.prototype.getElementsByTagName=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},_.prototype.importNode=function(x,S){throw new Error("This DOM method is not implemented."+this.debugInfo())},_.prototype.createElementNS=function(x,S){throw new Error("This DOM method is not implemented."+this.debugInfo())},_.prototype.createAttributeNS=function(x,S){throw new Error("This DOM method is not implemented."+this.debugInfo())},_.prototype.getElementsByTagNameNS=function(x,S){throw new Error("This DOM method is not implemented."+this.debugInfo())},_.prototype.getElementById=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},_.prototype.adoptNode=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},_.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},_.prototype.renameNode=function(x,S,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},_.prototype.getElementsByClassName=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},_.prototype.createEvent=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},_.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},_.prototype.createNodeIterator=function(x,S,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},_.prototype.createTreeWalker=function(x,S,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},_}(v)}).call(this)},{"./NodeType":428,"./Utility":429,"./XMLDOMConfiguration":435,"./XMLDOMImplementation":437,"./XMLNode":450,"./XMLStringWriter":455,"./XMLStringifier":456}],446:[function(i,M,E){(function(){var p,g,l,h,v,d,o,s,u,m,y,_,x,S,w,A,H,R,F,D,B,P,U,G,ee={}.hasOwnProperty;G=i("./Utility"),P=G.isObject,B=G.isFunction,U=G.isPlainObject,D=G.getValue,p=i("./NodeType"),_=i("./XMLDocument"),S=i("./XMLElement"),h=i("./XMLCData"),v=i("./XMLComment"),A=i("./XMLRaw"),F=i("./XMLText"),w=i("./XMLProcessingInstruction"),m=i("./XMLDeclaration"),y=i("./XMLDocType"),d=i("./XMLDTDAttList"),s=i("./XMLDTDEntity"),o=i("./XMLDTDElement"),u=i("./XMLDTDNotation"),l=i("./XMLAttribute"),R=i("./XMLStringifier"),H=i("./XMLStringWriter"),g=i("./WriterState"),M.exports=x=function(){function K(Z,$,oe){var ae;this.name="?xml",this.type=p.Document,Z||(Z={}),ae={},Z.writer?U(Z.writer)&&(ae=Z.writer,Z.writer=new H):Z.writer=new H,this.options=Z,this.writer=Z.writer,this.writerOptions=this.writer.filterOptions(ae),this.stringify=new R(Z),this.onDataCallback=$||function(){},this.onEndCallback=oe||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return K.prototype.createChildNode=function(Z){var $,oe,ae,ye,Y,le,xe,Ce;switch(Z.type){case p.CData:this.cdata(Z.value);break;case p.Comment:this.comment(Z.value);break;case p.Element:ae={},xe=Z.attribs;for(oe in xe)ee.call(xe,oe)&&($=xe[oe],ae[oe]=$.value);this.node(Z.name,ae);break;case p.Dummy:this.dummy();break;case p.Raw:this.raw(Z.value);break;case p.Text:this.text(Z.value);break;case p.ProcessingInstruction:this.instruction(Z.target,Z.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+Z.constructor.name)}for(Ce=Z.children,Y=0,le=Ce.length;Y<le;Y++)ye=Ce[Y],this.createChildNode(ye),ye.type===p.Element&&this.up();return this},K.prototype.dummy=function(){return this},K.prototype.node=function(Z,$,oe){var ae;if(Z==null)throw new Error("Missing node name.");if(this.root&&this.currentLevel===-1)throw new Error("Document can only have one root node. "+this.debugInfo(Z));return this.openCurrent(),Z=D(Z),$==null&&($={}),$=D($),P($)||(ae=[$,oe],oe=ae[0],$=ae[1]),this.currentNode=new S(this,Z,$),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,oe!=null&&this.text(oe),this},K.prototype.element=function(Z,$,oe){var ae,ye,Y,le,xe,Ce;if(this.currentNode&&this.currentNode.type===p.DocType)this.dtdElement.apply(this,arguments);else if(Array.isArray(Z)||P(Z)||B(Z))for(le=this.options.noValidation,this.options.noValidation=!0,Ce=new _(this.options).element("TEMP_ROOT"),Ce.element(Z),this.options.noValidation=le,xe=Ce.children,ye=0,Y=xe.length;ye<Y;ye++)ae=xe[ye],this.createChildNode(ae),ae.type===p.Element&&this.up();else this.node(Z,$,oe);return this},K.prototype.attribute=function(Z,$){var oe,ae;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(Z));if(Z!=null&&(Z=D(Z)),P(Z))for(oe in Z)ee.call(Z,oe)&&(ae=Z[oe],this.attribute(oe,ae));else B($)&&($=$.apply()),this.options.keepNullAttributes&&$==null?this.currentNode.attribs[Z]=new l(this,Z,""):$!=null&&(this.currentNode.attribs[Z]=new l(this,Z,$));return this},K.prototype.text=function(Z){var $;return this.openCurrent(),$=new F(this,Z),this.onData(this.writer.text($,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},K.prototype.cdata=function(Z){var $;return this.openCurrent(),$=new h(this,Z),this.onData(this.writer.cdata($,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},K.prototype.comment=function(Z){var $;return this.openCurrent(),$=new v(this,Z),this.onData(this.writer.comment($,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},K.prototype.raw=function(Z){var $;return this.openCurrent(),$=new A(this,Z),this.onData(this.writer.raw($,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},K.prototype.instruction=function(Z,$){var oe,ae,ye,Y,le;if(this.openCurrent(),Z!=null&&(Z=D(Z)),$!=null&&($=D($)),Array.isArray(Z))for(oe=0,Y=Z.length;oe<Y;oe++)ae=Z[oe],this.instruction(ae);else if(P(Z))for(ae in Z)ee.call(Z,ae)&&(ye=Z[ae],this.instruction(ae,ye));else B($)&&($=$.apply()),le=new w(this,Z,$),this.onData(this.writer.processingInstruction(le,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this},K.prototype.declaration=function(Z,$,oe){var ae;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node.");return ae=new m(this,Z,$,oe),this.onData(this.writer.declaration(ae,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},K.prototype.doctype=function(Z,$,oe){if(this.openCurrent(),Z==null)throw new Error("Missing root node name.");if(this.root)throw new Error("dtd() must come before the root node.");return this.currentNode=new y(this,$,oe),this.currentNode.rootNodeName=Z,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},K.prototype.dtdElement=function(Z,$){var oe;return this.openCurrent(),oe=new o(this,Z,$),this.onData(this.writer.dtdElement(oe,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},K.prototype.attList=function(Z,$,oe,ae,ye){var Y;return this.openCurrent(),Y=new d(this,Z,$,oe,ae,ye),this.onData(this.writer.dtdAttList(Y,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},K.prototype.entity=function(Z,$){var oe;return this.openCurrent(),oe=new s(this,!1,Z,$),this.onData(this.writer.dtdEntity(oe,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},K.prototype.pEntity=function(Z,$){var oe;return this.openCurrent(),oe=new s(this,!0,Z,$),this.onData(this.writer.dtdEntity(oe,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},K.prototype.notation=function(Z,$){var oe;return this.openCurrent(),oe=new u(this,Z,$),this.onData(this.writer.dtdNotation(oe,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},K.prototype.up=function(){if(this.currentLevel<0)throw new Error("The document node has no parent.");return this.currentNode?(this.currentNode.children?this.closeNode(this.currentNode):this.openNode(this.currentNode),this.currentNode=null):this.closeNode(this.openTags[this.currentLevel]),delete this.openTags[this.currentLevel],this.currentLevel--,this},K.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},K.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},K.prototype.openNode=function(Z){var $,oe,ae,ye;if(!Z.isOpen){if(!this.root&&this.currentLevel===0&&Z.type===p.Element&&(this.root=Z),oe="",Z.type===p.Element){this.writerOptions.state=g.OpenTag,oe=this.writer.indent(Z,this.writerOptions,this.currentLevel)+"<"+Z.name,ye=Z.attribs;for(ae in ye)ee.call(ye,ae)&&($=ye[ae],oe+=this.writer.attribute($,this.writerOptions,this.currentLevel));oe+=(Z.children?">":"/>")+this.writer.endline(Z,this.writerOptions,this.currentLevel),this.writerOptions.state=g.InsideTag}else this.writerOptions.state=g.OpenTag,oe=this.writer.indent(Z,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+Z.rootNodeName,Z.pubID&&Z.sysID?oe+=' PUBLIC "'+Z.pubID+'" "'+Z.sysID+'"':Z.sysID&&(oe+=' SYSTEM "'+Z.sysID+'"'),Z.children?(oe+=" [",this.writerOptions.state=g.InsideTag):(this.writerOptions.state=g.CloseTag,oe+=">"),oe+=this.writer.endline(Z,this.writerOptions,this.currentLevel);return this.onData(oe,this.currentLevel),Z.isOpen=!0}},K.prototype.closeNode=function(Z){var $;if(!Z.isClosed)return $="",this.writerOptions.state=g.CloseTag,Z.type===p.Element?$=this.writer.indent(Z,this.writerOptions,this.currentLevel)+"</"+Z.name+">"+this.writer.endline(Z,this.writerOptions,this.currentLevel):$=this.writer.indent(Z,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(Z,this.writerOptions,this.currentLevel),this.writerOptions.state=g.None,this.onData($,this.currentLevel),Z.isClosed=!0},K.prototype.onData=function(Z,$){return this.documentStarted=!0,this.onDataCallback(Z,$+1)},K.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},K.prototype.debugInfo=function(Z){return Z==null?"":"node: <"+Z+">"},K.prototype.ele=function(){return this.element.apply(this,arguments)},K.prototype.nod=function(Z,$,oe){return this.node(Z,$,oe)},K.prototype.txt=function(Z){return this.text(Z)},K.prototype.dat=function(Z){return this.cdata(Z)},K.prototype.com=function(Z){return this.comment(Z)},K.prototype.ins=function(Z,$){return this.instruction(Z,$)},K.prototype.dec=function(Z,$,oe){return this.declaration(Z,$,oe)},K.prototype.dtd=function(Z,$,oe){return this.doctype(Z,$,oe)},K.prototype.e=function(Z,$,oe){return this.element(Z,$,oe)},K.prototype.n=function(Z,$,oe){return this.node(Z,$,oe)},K.prototype.t=function(Z){return this.text(Z)},K.prototype.d=function(Z){return this.cdata(Z)},K.prototype.c=function(Z){return this.comment(Z)},K.prototype.r=function(Z){return this.raw(Z)},K.prototype.i=function(Z,$){return this.instruction(Z,$)},K.prototype.att=function(){return this.currentNode&&this.currentNode.type===p.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},K.prototype.a=function(){return this.currentNode&&this.currentNode.type===p.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},K.prototype.ent=function(Z,$){return this.entity(Z,$)},K.prototype.pent=function(Z,$){return this.pEntity(Z,$)},K.prototype.not=function(Z,$){return this.notation(Z,$)},K}()}).call(this)},{"./NodeType":428,"./Utility":429,"./WriterState":430,"./XMLAttribute":431,"./XMLCData":432,"./XMLComment":434,"./XMLDTDAttList":439,"./XMLDTDElement":440,"./XMLDTDEntity":441,"./XMLDTDNotation":442,"./XMLDeclaration":443,"./XMLDocType":444,"./XMLDocument":445,"./XMLElement":448,"./XMLProcessingInstruction":452,"./XMLRaw":453,"./XMLStringWriter":455,"./XMLStringifier":456,"./XMLText":457}],447:[function(i,M,E){(function(){var p,g,l,h=function(d,o){for(var s in o)v.call(o,s)&&(d[s]=o[s]);function u(){this.constructor=d}return u.prototype=o.prototype,d.prototype=new u,d.__super__=o.prototype,d},v={}.hasOwnProperty;l=i("./XMLNode"),p=i("./NodeType"),M.exports=g=function(d){h(o,d);function o(s){o.__super__.constructor.call(this,s),this.type=p.Dummy}return o.prototype.clone=function(){return Object.create(this)},o.prototype.toString=function(s){return""},o}(l)}).call(this)},{"./NodeType":428,"./XMLNode":450}],448:[function(i,M,E){(function(){var p,g,l,h,v,d,o,s,u,m=function(_,x){for(var S in x)y.call(x,S)&&(_[S]=x[S]);function w(){this.constructor=_}return w.prototype=x.prototype,_.prototype=new w,_.__super__=x.prototype,_},y={}.hasOwnProperty;u=i("./Utility"),s=u.isObject,o=u.isFunction,d=u.getValue,v=i("./XMLNode"),p=i("./NodeType"),g=i("./XMLAttribute"),h=i("./XMLNamedNodeMap"),M.exports=l=function(_){m(x,_);function x(S,w,A){var H,R,F,D;if(x.__super__.constructor.call(this,S),w==null)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(w),this.type=p.Element,this.attribs={},this.schemaTypeInfo=null,A!=null&&this.attribute(A),S.type===p.Document&&(this.isRoot=!0,this.documentObject=S,S.rootObject=this,S.children)){for(D=S.children,R=0,F=D.length;R<F;R++)if(H=D[R],H.type===p.DocType){H.name=this.name;break}}}return Object.defineProperty(x.prototype,"tagName",{get:function(){return this.name}}),Object.defineProperty(x.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(x.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(x.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(x.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(x.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(x.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(x.prototype,"attributes",{get:function(){return(!this.attributeMap||!this.attributeMap.nodes)&&(this.attributeMap=new h(this.attribs)),this.attributeMap}}),x.prototype.clone=function(){var S,w,A,H;A=Object.create(this),A.isRoot&&(A.documentObject=null),A.attribs={},H=this.attribs;for(w in H)y.call(H,w)&&(S=H[w],A.attribs[w]=S.clone());return A.children=[],this.children.forEach(function(R){var F;return F=R.clone(),F.parent=A,A.children.push(F)}),A},x.prototype.attribute=function(S,w){var A,H;if(S!=null&&(S=d(S)),s(S))for(A in S)y.call(S,A)&&(H=S[A],this.attribute(A,H));else o(w)&&(w=w.apply()),this.options.keepNullAttributes&&w==null?this.attribs[S]=new g(this,S,""):w!=null&&(this.attribs[S]=new g(this,S,w));return this},x.prototype.removeAttribute=function(S){var w,A,H;if(S==null)throw new Error("Missing attribute name. "+this.debugInfo());if(S=d(S),Array.isArray(S))for(A=0,H=S.length;A<H;A++)w=S[A],delete this.attribs[w];else delete this.attribs[S];return this},x.prototype.toString=function(S){return this.options.writer.element(this,this.options.writer.filterOptions(S))},x.prototype.att=function(S,w){return this.attribute(S,w)},x.prototype.a=function(S,w){return this.attribute(S,w)},x.prototype.getAttribute=function(S){return this.attribs.hasOwnProperty(S)?this.attribs[S].value:null},x.prototype.setAttribute=function(S,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},x.prototype.getAttributeNode=function(S){return this.attribs.hasOwnProperty(S)?this.attribs[S]:null},x.prototype.setAttributeNode=function(S){throw new Error("This DOM method is not implemented."+this.debugInfo())},x.prototype.removeAttributeNode=function(S){throw new Error("This DOM method is not implemented."+this.debugInfo())},x.prototype.getElementsByTagName=function(S){throw new Error("This DOM method is not implemented."+this.debugInfo())},x.prototype.getAttributeNS=function(S,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},x.prototype.setAttributeNS=function(S,w,A){throw new Error("This DOM method is not implemented."+this.debugInfo())},x.prototype.removeAttributeNS=function(S,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},x.prototype.getAttributeNodeNS=function(S,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},x.prototype.setAttributeNodeNS=function(S){throw new Error("This DOM method is not implemented."+this.debugInfo())},x.prototype.getElementsByTagNameNS=function(S,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},x.prototype.hasAttribute=function(S){return this.attribs.hasOwnProperty(S)},x.prototype.hasAttributeNS=function(S,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},x.prototype.setIdAttribute=function(S,w){return this.attribs.hasOwnProperty(S)?this.attribs[S].isId:w},x.prototype.setIdAttributeNS=function(S,w,A){throw new Error("This DOM method is not implemented."+this.debugInfo())},x.prototype.setIdAttributeNode=function(S,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},x.prototype.getElementsByTagName=function(S){throw new Error("This DOM method is not implemented."+this.debugInfo())},x.prototype.getElementsByTagNameNS=function(S,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},x.prototype.getElementsByClassName=function(S){throw new Error("This DOM method is not implemented."+this.debugInfo())},x.prototype.isEqualNode=function(S){var w,A,H;if(!x.__super__.isEqualNode.apply(this,arguments).isEqualNode(S)||S.namespaceURI!==this.namespaceURI||S.prefix!==this.prefix||S.localName!==this.localName||S.attribs.length!==this.attribs.length)return!1;for(w=A=0,H=this.attribs.length-1;0<=H?A<=H:A>=H;w=0<=H?++A:--A)if(!this.attribs[w].isEqualNode(S.attribs[w]))return!1;return!0},x}(v)}).call(this)},{"./NodeType":428,"./Utility":429,"./XMLAttribute":431,"./XMLNamedNodeMap":449,"./XMLNode":450}],449:[function(i,M,E){(function(){var p;M.exports=p=function(){function g(l){this.nodes=l}return Object.defineProperty(g.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}}),g.prototype.clone=function(){return this.nodes=null},g.prototype.getNamedItem=function(l){return this.nodes[l]},g.prototype.setNamedItem=function(l){var h;return h=this.nodes[l.nodeName],this.nodes[l.nodeName]=l,h||null},g.prototype.removeNamedItem=function(l){var h;return h=this.nodes[l],delete this.nodes[l],h||null},g.prototype.item=function(l){return this.nodes[Object.keys(this.nodes)[l]]||null},g.prototype.getNamedItemNS=function(l,h){throw new Error("This DOM method is not implemented.")},g.prototype.setNamedItemNS=function(l){throw new Error("This DOM method is not implemented.")},g.prototype.removeNamedItemNS=function(l,h){throw new Error("This DOM method is not implemented.")},g}()}).call(this)},{}],450:[function(i,M,E){(function(){var p,g,l,h,v,d,o,s,u,m,y,_,x,S,w,A,H,R,F,D={}.hasOwnProperty;F=i("./Utility"),R=F.isObject,H=F.isFunction,A=F.isEmpty,w=F.getValue,s=null,l=null,h=null,v=null,d=null,x=null,S=null,_=null,o=null,g=null,y=null,u=null,p=null,M.exports=m=function(){function B(P){this.parent=P,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,s||(s=i("./XMLElement"),l=i("./XMLCData"),h=i("./XMLComment"),v=i("./XMLDeclaration"),d=i("./XMLDocType"),x=i("./XMLRaw"),S=i("./XMLText"),_=i("./XMLProcessingInstruction"),o=i("./XMLDummy"),g=i("./NodeType"),y=i("./XMLNodeList"),u=i("./XMLNamedNodeMap"),p=i("./DocumentPosition"))}return Object.defineProperty(B.prototype,"nodeName",{get:function(){return this.name}}),Object.defineProperty(B.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(B.prototype,"nodeValue",{get:function(){return this.value}}),Object.defineProperty(B.prototype,"parentNode",{get:function(){return this.parent}}),Object.defineProperty(B.prototype,"childNodes",{get:function(){return(!this.childNodeList||!this.childNodeList.nodes)&&(this.childNodeList=new y(this.children)),this.childNodeList}}),Object.defineProperty(B.prototype,"firstChild",{get:function(){return this.children[0]||null}}),Object.defineProperty(B.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}}),Object.defineProperty(B.prototype,"previousSibling",{get:function(){var P;return P=this.parent.children.indexOf(this),this.parent.children[P-1]||null}}),Object.defineProperty(B.prototype,"nextSibling",{get:function(){var P;return P=this.parent.children.indexOf(this),this.parent.children[P+1]||null}}),Object.defineProperty(B.prototype,"ownerDocument",{get:function(){return this.document()||null}}),Object.defineProperty(B.prototype,"textContent",{get:function(){var P,U,G,ee,K;if(this.nodeType===g.Element||this.nodeType===g.DocumentFragment){for(K="",ee=this.children,U=0,G=ee.length;U<G;U++)P=ee[U],P.textContent&&(K+=P.textContent);return K}else return null},set:function(P){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),B.prototype.setParent=function(P){var U,G,ee,K,Z;for(this.parent=P,P&&(this.options=P.options,this.stringify=P.stringify),K=this.children,Z=[],G=0,ee=K.length;G<ee;G++)U=K[G],Z.push(U.setParent(this));return Z},B.prototype.element=function(P,U,G){var ee,K,Z,$,oe,ae,ye,Y,le,xe,Ce;if(ae=null,U===null&&G==null&&(le=[{},null],U=le[0],G=le[1]),U==null&&(U={}),U=w(U),R(U)||(xe=[U,G],G=xe[0],U=xe[1]),P!=null&&(P=w(P)),Array.isArray(P))for(Z=0,ye=P.length;Z<ye;Z++)K=P[Z],ae=this.element(K);else if(H(P))ae=this.element(P.apply());else if(R(P)){for(oe in P)if(D.call(P,oe))if(Ce=P[oe],H(Ce)&&(Ce=Ce.apply()),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&oe.indexOf(this.stringify.convertAttKey)===0)ae=this.attribute(oe.substr(this.stringify.convertAttKey.length),Ce);else if(!this.options.separateArrayItems&&Array.isArray(Ce)&&A(Ce))ae=this.dummy();else if(R(Ce)&&A(Ce))ae=this.element(oe);else if(!this.options.keepNullNodes&&Ce==null)ae=this.dummy();else if(!this.options.separateArrayItems&&Array.isArray(Ce))for($=0,Y=Ce.length;$<Y;$++)K=Ce[$],ee={},ee[oe]=K,ae=this.element(ee);else R(Ce)?!this.options.ignoreDecorators&&this.stringify.convertTextKey&&oe.indexOf(this.stringify.convertTextKey)===0?ae=this.element(Ce):(ae=this.element(oe),ae.element(Ce)):ae=this.element(oe,Ce)}else!this.options.keepNullNodes&&G===null?ae=this.dummy():!this.options.ignoreDecorators&&this.stringify.convertTextKey&&P.indexOf(this.stringify.convertTextKey)===0?ae=this.text(G):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&P.indexOf(this.stringify.convertCDataKey)===0?ae=this.cdata(G):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&P.indexOf(this.stringify.convertCommentKey)===0?ae=this.comment(G):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&P.indexOf(this.stringify.convertRawKey)===0?ae=this.raw(G):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&P.indexOf(this.stringify.convertPIKey)===0?ae=this.instruction(P.substr(this.stringify.convertPIKey.length),G):ae=this.node(P,U,G);if(ae==null)throw new Error("Could not create any elements with: "+P+". "+this.debugInfo());return ae},B.prototype.insertBefore=function(P,U,G){var ee,K,Z,$,oe;if(P!=null&&P.type)return Z=P,$=U,Z.setParent(this),$?(K=children.indexOf($),oe=children.splice(K),children.push(Z),Array.prototype.push.apply(children,oe)):children.push(Z),Z;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(P));return K=this.parent.children.indexOf(this),oe=this.parent.children.splice(K),ee=this.parent.element(P,U,G),Array.prototype.push.apply(this.parent.children,oe),ee},B.prototype.insertAfter=function(P,U,G){var ee,K,Z;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(P));return K=this.parent.children.indexOf(this),Z=this.parent.children.splice(K+1),ee=this.parent.element(P,U,G),Array.prototype.push.apply(this.parent.children,Z),ee},B.prototype.remove=function(){var P,U;if(this.isRoot)throw new Error("Cannot remove the root element. "+this.debugInfo());return P=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[P,P-P+1].concat(U=[])),this.parent},B.prototype.node=function(P,U,G){var ee,K;return P!=null&&(P=w(P)),U||(U={}),U=w(U),R(U)||(K=[U,G],G=K[0],U=K[1]),ee=new s(this,P,U),G!=null&&ee.text(G),this.children.push(ee),ee},B.prototype.text=function(P){var U;return R(P)&&this.element(P),U=new S(this,P),this.children.push(U),this},B.prototype.cdata=function(P){var U;return U=new l(this,P),this.children.push(U),this},B.prototype.comment=function(P){var U;return U=new h(this,P),this.children.push(U),this},B.prototype.commentBefore=function(P){var U,G,ee;return G=this.parent.children.indexOf(this),ee=this.parent.children.splice(G),U=this.parent.comment(P),Array.prototype.push.apply(this.parent.children,ee),this},B.prototype.commentAfter=function(P){var U,G,ee;return G=this.parent.children.indexOf(this),ee=this.parent.children.splice(G+1),U=this.parent.comment(P),Array.prototype.push.apply(this.parent.children,ee),this},B.prototype.raw=function(P){var U;return U=new x(this,P),this.children.push(U),this},B.prototype.dummy=function(){var P;return P=new o(this),P},B.prototype.instruction=function(P,U){var G,ee,K,Z,$;if(P!=null&&(P=w(P)),U!=null&&(U=w(U)),Array.isArray(P))for(Z=0,$=P.length;Z<$;Z++)G=P[Z],this.instruction(G);else if(R(P))for(G in P)D.call(P,G)&&(ee=P[G],this.instruction(G,ee));else H(U)&&(U=U.apply()),K=new _(this,P,U),this.children.push(K);return this},B.prototype.instructionBefore=function(P,U){var G,ee,K;return ee=this.parent.children.indexOf(this),K=this.parent.children.splice(ee),G=this.parent.instruction(P,U),Array.prototype.push.apply(this.parent.children,K),this},B.prototype.instructionAfter=function(P,U){var G,ee,K;return ee=this.parent.children.indexOf(this),K=this.parent.children.splice(ee+1),G=this.parent.instruction(P,U),Array.prototype.push.apply(this.parent.children,K),this},B.prototype.declaration=function(P,U,G){var ee,K;return ee=this.document(),K=new v(ee,P,U,G),ee.children.length===0?ee.children.unshift(K):ee.children[0].type===g.Declaration?ee.children[0]=K:ee.children.unshift(K),ee.root()||ee},B.prototype.dtd=function(P,U){var G,ee,K,Z,$,oe,ae,ye,Y,le;for(ee=this.document(),K=new d(ee,P,U),Y=ee.children,Z=$=0,ae=Y.length;$<ae;Z=++$)if(G=Y[Z],G.type===g.DocType)return ee.children[Z]=K,K;for(le=ee.children,Z=oe=0,ye=le.length;oe<ye;Z=++oe)if(G=le[Z],G.isRoot)return ee.children.splice(Z,0,K),K;return ee.children.push(K),K},B.prototype.up=function(){if(this.isRoot)throw new Error("The root node has no parent. Use doc() if you need to get the document object.");return this.parent},B.prototype.root=function(){var P;for(P=this;P;){if(P.type===g.Document)return P.rootObject;if(P.isRoot)return P;P=P.parent}},B.prototype.document=function(){var P;for(P=this;P;){if(P.type===g.Document)return P;P=P.parent}},B.prototype.end=function(P){return this.document().end(P)},B.prototype.prev=function(){var P;if(P=this.parent.children.indexOf(this),P<1)throw new Error("Already at the first node. "+this.debugInfo());return this.parent.children[P-1]},B.prototype.next=function(){var P;if(P=this.parent.children.indexOf(this),P===-1||P===this.parent.children.length-1)throw new Error("Already at the last node. "+this.debugInfo());return this.parent.children[P+1]},B.prototype.importDocument=function(P){var U;return U=P.root().clone(),U.parent=this,U.isRoot=!1,this.children.push(U),this},B.prototype.debugInfo=function(P){var U,G;return P=P||this.name,P==null&&!((U=this.parent)!=null&&U.name)?"":P==null?"parent: <"+this.parent.name+">":(G=this.parent)!=null&&G.name?"node: <"+P+">, parent: <"+this.parent.name+">":"node: <"+P+">"},B.prototype.ele=function(P,U,G){return this.element(P,U,G)},B.prototype.nod=function(P,U,G){return this.node(P,U,G)},B.prototype.txt=function(P){return this.text(P)},B.prototype.dat=function(P){return this.cdata(P)},B.prototype.com=function(P){return this.comment(P)},B.prototype.ins=function(P,U){return this.instruction(P,U)},B.prototype.doc=function(){return this.document()},B.prototype.dec=function(P,U,G){return this.declaration(P,U,G)},B.prototype.e=function(P,U,G){return this.element(P,U,G)},B.prototype.n=function(P,U,G){return this.node(P,U,G)},B.prototype.t=function(P){return this.text(P)},B.prototype.d=function(P){return this.cdata(P)},B.prototype.c=function(P){return this.comment(P)},B.prototype.r=function(P){return this.raw(P)},B.prototype.i=function(P,U){return this.instruction(P,U)},B.prototype.u=function(){return this.up()},B.prototype.importXMLBuilder=function(P){return this.importDocument(P)},B.prototype.replaceChild=function(P,U){throw new Error("This DOM method is not implemented."+this.debugInfo())},B.prototype.removeChild=function(P){throw new Error("This DOM method is not implemented."+this.debugInfo())},B.prototype.appendChild=function(P){throw new Error("This DOM method is not implemented."+this.debugInfo())},B.prototype.hasChildNodes=function(){return this.children.length!==0},B.prototype.cloneNode=function(P){throw new Error("This DOM method is not implemented."+this.debugInfo())},B.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},B.prototype.isSupported=function(P,U){return!0},B.prototype.hasAttributes=function(){return this.attribs.length!==0},B.prototype.compareDocumentPosition=function(P){var U,G;return U=this,U===P?0:this.document()!==P.document()?(G=p.Disconnected|p.ImplementationSpecific,Math.random()<.5?G|=p.Preceding:G|=p.Following,G):U.isAncestor(P)?p.Contains|p.Preceding:U.isDescendant(P)?p.Contains|p.Following:U.isPreceding(P)?p.Preceding:p.Following},B.prototype.isSameNode=function(P){throw new Error("This DOM method is not implemented."+this.debugInfo())},B.prototype.lookupPrefix=function(P){throw new Error("This DOM method is not implemented."+this.debugInfo())},B.prototype.isDefaultNamespace=function(P){throw new Error("This DOM method is not implemented."+this.debugInfo())},B.prototype.lookupNamespaceURI=function(P){throw new Error("This DOM method is not implemented."+this.debugInfo())},B.prototype.isEqualNode=function(P){var U,G,ee;if(P.nodeType!==this.nodeType||P.children.length!==this.children.length)return!1;for(U=G=0,ee=this.children.length-1;0<=ee?G<=ee:G>=ee;U=0<=ee?++G:--G)if(!this.children[U].isEqualNode(P.children[U]))return!1;return!0},B.prototype.getFeature=function(P,U){throw new Error("This DOM method is not implemented."+this.debugInfo())},B.prototype.setUserData=function(P,U,G){throw new Error("This DOM method is not implemented."+this.debugInfo())},B.prototype.getUserData=function(P){throw new Error("This DOM method is not implemented."+this.debugInfo())},B.prototype.contains=function(P){return P?P===this||this.isDescendant(P):!1},B.prototype.isDescendant=function(P){var U,G,ee,K,Z;for(Z=this.children,ee=0,K=Z.length;ee<K;ee++)if(U=Z[ee],P===U||(G=U.isDescendant(P),G))return!0;return!1},B.prototype.isAncestor=function(P){return P.isDescendant(this)},B.prototype.isPreceding=function(P){var U,G;return U=this.treePosition(P),G=this.treePosition(this),U===-1||G===-1?!1:U<G},B.prototype.isFollowing=function(P){var U,G;return U=this.treePosition(P),G=this.treePosition(this),U===-1||G===-1?!1:U>G},B.prototype.treePosition=function(P){var U,G;return G=0,U=!1,this.foreachTreeNode(this.document(),function(ee){if(G++,!U&&ee===P)return U=!0}),U?G:-1},B.prototype.foreachTreeNode=function(P,U){var G,ee,K,Z,$;for(P||(P=this.document()),Z=P.children,ee=0,K=Z.length;ee<K;ee++){if(G=Z[ee],$=U(G))return $;if($=this.foreachTreeNode(G,U),$)return $}},B}()}).call(this)},{"./DocumentPosition":427,"./NodeType":428,"./Utility":429,"./XMLCData":432,"./XMLComment":434,"./XMLDeclaration":443,"./XMLDocType":444,"./XMLDummy":447,"./XMLElement":448,"./XMLNamedNodeMap":449,"./XMLNodeList":451,"./XMLProcessingInstruction":452,"./XMLRaw":453,"./XMLText":457}],451:[function(i,M,E){(function(){var p;M.exports=p=function(){function g(l){this.nodes=l}return Object.defineProperty(g.prototype,"length",{get:function(){return this.nodes.length||0}}),g.prototype.clone=function(){return this.nodes=null},g.prototype.item=function(l){return this.nodes[l]||null},g}()}).call(this)},{}],452:[function(i,M,E){(function(){var p,g,l,h=function(d,o){for(var s in o)v.call(o,s)&&(d[s]=o[s]);function u(){this.constructor=d}return u.prototype=o.prototype,d.prototype=new u,d.__super__=o.prototype,d},v={}.hasOwnProperty;p=i("./NodeType"),g=i("./XMLCharacterData"),M.exports=l=function(d){h(o,d);function o(s,u,m){if(o.__super__.constructor.call(this,s),u==null)throw new Error("Missing instruction target. "+this.debugInfo());this.type=p.ProcessingInstruction,this.target=this.stringify.insTarget(u),this.name=this.target,m&&(this.value=this.stringify.insValue(m))}return o.prototype.clone=function(){return Object.create(this)},o.prototype.toString=function(s){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(s))},o.prototype.isEqualNode=function(s){return!(!o.__super__.isEqualNode.apply(this,arguments).isEqualNode(s)||s.target!==this.target)},o}(g)}).call(this)},{"./NodeType":428,"./XMLCharacterData":433}],453:[function(i,M,E){(function(){var p,g,l,h=function(d,o){for(var s in o)v.call(o,s)&&(d[s]=o[s]);function u(){this.constructor=d}return u.prototype=o.prototype,d.prototype=new u,d.__super__=o.prototype,d},v={}.hasOwnProperty;p=i("./NodeType"),g=i("./XMLNode"),M.exports=l=function(d){h(o,d);function o(s,u){if(o.__super__.constructor.call(this,s),u==null)throw new Error("Missing raw text. "+this.debugInfo());this.type=p.Raw,this.value=this.stringify.raw(u)}return o.prototype.clone=function(){return Object.create(this)},o.prototype.toString=function(s){return this.options.writer.raw(this,this.options.writer.filterOptions(s))},o}(g)}).call(this)},{"./NodeType":428,"./XMLNode":450}],454:[function(i,M,E){(function(){var p,g,l,h,v=function(o,s){for(var u in s)d.call(s,u)&&(o[u]=s[u]);function m(){this.constructor=o}return m.prototype=s.prototype,o.prototype=new m,o.__super__=s.prototype,o},d={}.hasOwnProperty;p=i("./NodeType"),h=i("./XMLWriterBase"),g=i("./WriterState"),M.exports=l=function(o){v(s,o);function s(u,m){this.stream=u,s.__super__.constructor.call(this,m)}return s.prototype.endline=function(u,m,y){return u.isLastRootNode&&m.state===g.CloseTag?"":s.__super__.endline.call(this,u,m,y)},s.prototype.document=function(u,m){var y,_,x,S,w,A,H,R,F;for(H=u.children,_=x=0,w=H.length;x<w;_=++x)y=H[_],y.isLastRootNode=_===u.children.length-1;for(m=this.filterOptions(m),R=u.children,F=[],S=0,A=R.length;S<A;S++)y=R[S],F.push(this.writeChildNode(y,m,0));return F},s.prototype.attribute=function(u,m,y){return this.stream.write(s.__super__.attribute.call(this,u,m,y))},s.prototype.cdata=function(u,m,y){return this.stream.write(s.__super__.cdata.call(this,u,m,y))},s.prototype.comment=function(u,m,y){return this.stream.write(s.__super__.comment.call(this,u,m,y))},s.prototype.declaration=function(u,m,y){return this.stream.write(s.__super__.declaration.call(this,u,m,y))},s.prototype.docType=function(u,m,y){var _,x,S,w;if(y||(y=0),this.openNode(u,m,y),m.state=g.OpenTag,this.stream.write(this.indent(u,m,y)),this.stream.write("<!DOCTYPE "+u.root().name),u.pubID&&u.sysID?this.stream.write(' PUBLIC "'+u.pubID+'" "'+u.sysID+'"'):u.sysID&&this.stream.write(' SYSTEM "'+u.sysID+'"'),u.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(u,m,y)),m.state=g.InsideTag,w=u.children,x=0,S=w.length;x<S;x++)_=w[x],this.writeChildNode(_,m,y+1);m.state=g.CloseTag,this.stream.write("]")}return m.state=g.CloseTag,this.stream.write(m.spaceBeforeSlash+">"),this.stream.write(this.endline(u,m,y)),m.state=g.None,this.closeNode(u,m,y)},s.prototype.element=function(u,m,y){var _,x,S,w,A,H,R,F,D,B;y||(y=0),this.openNode(u,m,y),m.state=g.OpenTag,this.stream.write(this.indent(u,m,y)+"<"+u.name),D=u.attribs;for(R in D)d.call(D,R)&&(_=D[R],this.attribute(_,m,y));if(S=u.children.length,w=S===0?null:u.children[0],S===0||u.children.every(function(P){return(P.type===p.Text||P.type===p.Raw)&&P.value===""}))m.allowEmpty?(this.stream.write(">"),m.state=g.CloseTag,this.stream.write("</"+u.name+">")):(m.state=g.CloseTag,this.stream.write(m.spaceBeforeSlash+"/>"));else if(m.pretty&&S===1&&(w.type===p.Text||w.type===p.Raw)&&w.value!=null)this.stream.write(">"),m.state=g.InsideTag,m.suppressPrettyCount++,F=!0,this.writeChildNode(w,m,y+1),m.suppressPrettyCount--,F=!1,m.state=g.CloseTag,this.stream.write("</"+u.name+">");else{for(this.stream.write(">"+this.endline(u,m,y)),m.state=g.InsideTag,B=u.children,A=0,H=B.length;A<H;A++)x=B[A],this.writeChildNode(x,m,y+1);m.state=g.CloseTag,this.stream.write(this.indent(u,m,y)+"</"+u.name+">")}return this.stream.write(this.endline(u,m,y)),m.state=g.None,this.closeNode(u,m,y)},s.prototype.processingInstruction=function(u,m,y){return this.stream.write(s.__super__.processingInstruction.call(this,u,m,y))},s.prototype.raw=function(u,m,y){return this.stream.write(s.__super__.raw.call(this,u,m,y))},s.prototype.text=function(u,m,y){return this.stream.write(s.__super__.text.call(this,u,m,y))},s.prototype.dtdAttList=function(u,m,y){return this.stream.write(s.__super__.dtdAttList.call(this,u,m,y))},s.prototype.dtdElement=function(u,m,y){return this.stream.write(s.__super__.dtdElement.call(this,u,m,y))},s.prototype.dtdEntity=function(u,m,y){return this.stream.write(s.__super__.dtdEntity.call(this,u,m,y))},s.prototype.dtdNotation=function(u,m,y){return this.stream.write(s.__super__.dtdNotation.call(this,u,m,y))},s}(h)}).call(this)},{"./NodeType":428,"./WriterState":430,"./XMLWriterBase":458}],455:[function(i,M,E){(function(){var p,g,l=function(v,d){for(var o in d)h.call(d,o)&&(v[o]=d[o]);function s(){this.constructor=v}return s.prototype=d.prototype,v.prototype=new s,v.__super__=d.prototype,v},h={}.hasOwnProperty;g=i("./XMLWriterBase"),M.exports=p=function(v){l(d,v);function d(o){d.__super__.constructor.call(this,o)}return d.prototype.document=function(o,s){var u,m,y,_,x;for(s=this.filterOptions(s),_="",x=o.children,m=0,y=x.length;m<y;m++)u=x[m],_+=this.writeChildNode(u,s,0);return s.pretty&&_.slice(-s.newline.length)===s.newline&&(_=_.slice(0,-s.newline.length)),_},d}(g)}).call(this)},{"./XMLWriterBase":458}],456:[function(i,M,E){(function(){var p,g=function(h,v){return function(){return h.apply(v,arguments)}},l={}.hasOwnProperty;M.exports=p=function(){function h(v){this.assertLegalName=g(this.assertLegalName,this),this.assertLegalChar=g(this.assertLegalChar,this);var d,o,s;v||(v={}),this.options=v,this.options.version||(this.options.version="1.0"),o=v.stringify||{};for(d in o)l.call(o,d)&&(s=o[d],this[d]=s)}return h.prototype.name=function(v){return this.options.noValidation?v:this.assertLegalName(""+v||"")},h.prototype.text=function(v){return this.options.noValidation?v:this.assertLegalChar(this.textEscape(""+v||""))},h.prototype.cdata=function(v){return this.options.noValidation?v:(v=""+v||"",v=v.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(v))},h.prototype.comment=function(v){if(this.options.noValidation)return v;if(v=""+v||"",v.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+v);return this.assertLegalChar(v)},h.prototype.raw=function(v){return this.options.noValidation?v:""+v||""},h.prototype.attValue=function(v){return this.options.noValidation?v:this.assertLegalChar(this.attEscape(v=""+v||""))},h.prototype.insTarget=function(v){return this.options.noValidation?v:this.assertLegalChar(""+v||"")},h.prototype.insValue=function(v){if(this.options.noValidation)return v;if(v=""+v||"",v.match(/\?>/))throw new Error("Invalid processing instruction value: "+v);return this.assertLegalChar(v)},h.prototype.xmlVersion=function(v){if(this.options.noValidation)return v;if(v=""+v||"",!v.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+v);return v},h.prototype.xmlEncoding=function(v){if(this.options.noValidation)return v;if(v=""+v||"",!v.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+v);return this.assertLegalChar(v)},h.prototype.xmlStandalone=function(v){return this.options.noValidation?v:v?"yes":"no"},h.prototype.dtdPubID=function(v){return this.options.noValidation?v:this.assertLegalChar(""+v||"")},h.prototype.dtdSysID=function(v){return this.options.noValidation?v:this.assertLegalChar(""+v||"")},h.prototype.dtdElementValue=function(v){return this.options.noValidation?v:this.assertLegalChar(""+v||"")},h.prototype.dtdAttType=function(v){return this.options.noValidation?v:this.assertLegalChar(""+v||"")},h.prototype.dtdAttDefault=function(v){return this.options.noValidation?v:this.assertLegalChar(""+v||"")},h.prototype.dtdEntityValue=function(v){return this.options.noValidation?v:this.assertLegalChar(""+v||"")},h.prototype.dtdNData=function(v){return this.options.noValidation?v:this.assertLegalChar(""+v||"")},h.prototype.convertAttKey="@",h.prototype.convertPIKey="?",h.prototype.convertTextKey="#text",h.prototype.convertCDataKey="#cdata",h.prototype.convertCommentKey="#comment",h.prototype.convertRawKey="#raw",h.prototype.assertLegalChar=function(v){var d,o;if(this.options.noValidation)return v;if(d="",this.options.version==="1.0"){if(d=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,o=v.match(d))throw new Error("Invalid character in string: "+v+" at index "+o.index)}else if(this.options.version==="1.1"&&(d=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,o=v.match(d)))throw new Error("Invalid character in string: "+v+" at index "+o.index);return v},h.prototype.assertLegalName=function(v){var d;if(this.options.noValidation)return v;if(this.assertLegalChar(v),d=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/,!v.match(d))throw new Error("Invalid character in name");return v},h.prototype.textEscape=function(v){var d;return this.options.noValidation?v:(d=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,v.replace(d,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#xD;"))},h.prototype.attEscape=function(v){var d;return this.options.noValidation?v:(d=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,v.replace(d,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;"))},h}()}).call(this)},{}],457:[function(i,M,E){(function(){var p,g,l,h=function(d,o){for(var s in o)v.call(o,s)&&(d[s]=o[s]);function u(){this.constructor=d}return u.prototype=o.prototype,d.prototype=new u,d.__super__=o.prototype,d},v={}.hasOwnProperty;p=i("./NodeType"),g=i("./XMLCharacterData"),M.exports=l=function(d){h(o,d);function o(s,u){if(o.__super__.constructor.call(this,s),u==null)throw new Error("Missing element text. "+this.debugInfo());this.name="#text",this.type=p.Text,this.value=this.stringify.text(u)}return Object.defineProperty(o.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(o.prototype,"wholeText",{get:function(){var s,u,m;for(m="",u=this.previousSibling;u;)m=u.data+m,u=u.previousSibling;for(m+=this.data,s=this.nextSibling;s;)m=m+s.data,s=s.nextSibling;return m}}),o.prototype.clone=function(){return Object.create(this)},o.prototype.toString=function(s){return this.options.writer.text(this,this.options.writer.filterOptions(s))},o.prototype.splitText=function(s){throw new Error("This DOM method is not implemented."+this.debugInfo())},o.prototype.replaceWholeText=function(s){throw new Error("This DOM method is not implemented."+this.debugInfo())},o}(g)}).call(this)},{"./NodeType":428,"./XMLCharacterData":433}],458:[function(i,M,E){(function(){var p,g,l,h,v,d,o,s,u,m,y,_,x,S,w,A,H,R={}.hasOwnProperty;H=i("./Utility").assign,p=i("./NodeType"),u=i("./XMLDeclaration"),m=i("./XMLDocType"),l=i("./XMLCData"),h=i("./XMLComment"),_=i("./XMLElement"),S=i("./XMLRaw"),w=i("./XMLText"),x=i("./XMLProcessingInstruction"),y=i("./XMLDummy"),v=i("./XMLDTDAttList"),d=i("./XMLDTDElement"),o=i("./XMLDTDEntity"),s=i("./XMLDTDNotation"),g=i("./WriterState"),M.exports=A=function(){function F(D){var B,P,U;D||(D={}),this.options=D,P=D.writer||{};for(B in P)R.call(P,B)&&(U=P[B],this["_"+B]=this[B],this[B]=U)}return F.prototype.filterOptions=function(D){var B,P,U,G,ee,K,Z,$;return D||(D={}),D=H({},this.options,D),B={writer:this},B.pretty=D.pretty||!1,B.allowEmpty=D.allowEmpty||!1,B.indent=(P=D.indent)!=null?P:" ",B.newline=(U=D.newline)!=null?U:`
`,B.offset=(G=D.offset)!=null?G:0,B.dontPrettyTextNodes=(ee=(K=D.dontPrettyTextNodes)!=null?K:D.dontprettytextnodes)!=null?ee:0,B.spaceBeforeSlash=(Z=($=D.spaceBeforeSlash)!=null?$:D.spacebeforeslash)!=null?Z:"",B.spaceBeforeSlash===!0&&(B.spaceBeforeSlash=" "),B.suppressPrettyCount=0,B.user={},B.state=g.None,B},F.prototype.indent=function(D,B,P){var U;return!B.pretty||B.suppressPrettyCount?"":B.pretty&&(U=(P||0)+B.offset+1,U>0)?new Array(U).join(B.indent):""},F.prototype.endline=function(D,B,P){return!B.pretty||B.suppressPrettyCount?"":B.newline},F.prototype.attribute=function(D,B,P){var U;return this.openAttribute(D,B,P),U=" "+D.name+'="'+D.value+'"',this.closeAttribute(D,B,P),U},F.prototype.cdata=function(D,B,P){var U;return this.openNode(D,B,P),B.state=g.OpenTag,U=this.indent(D,B,P)+"<![CDATA[",B.state=g.InsideTag,U+=D.value,B.state=g.CloseTag,U+="]]>"+this.endline(D,B,P),B.state=g.None,this.closeNode(D,B,P),U},F.prototype.comment=function(D,B,P){var U;return this.openNode(D,B,P),B.state=g.OpenTag,U=this.indent(D,B,P)+"<!-- ",B.state=g.InsideTag,U+=D.value,B.state=g.CloseTag,U+=" -->"+this.endline(D,B,P),B.state=g.None,this.closeNode(D,B,P),U},F.prototype.declaration=function(D,B,P){var U;return this.openNode(D,B,P),B.state=g.OpenTag,U=this.indent(D,B,P)+"<?xml",B.state=g.InsideTag,U+=' version="'+D.version+'"',D.encoding!=null&&(U+=' encoding="'+D.encoding+'"'),D.standalone!=null&&(U+=' standalone="'+D.standalone+'"'),B.state=g.CloseTag,U+=B.spaceBeforeSlash+"?>",U+=this.endline(D,B,P),B.state=g.None,this.closeNode(D,B,P),U},F.prototype.docType=function(D,B,P){var U,G,ee,K,Z;if(P||(P=0),this.openNode(D,B,P),B.state=g.OpenTag,K=this.indent(D,B,P),K+="<!DOCTYPE "+D.root().name,D.pubID&&D.sysID?K+=' PUBLIC "'+D.pubID+'" "'+D.sysID+'"':D.sysID&&(K+=' SYSTEM "'+D.sysID+'"'),D.children.length>0){for(K+=" [",K+=this.endline(D,B,P),B.state=g.InsideTag,Z=D.children,G=0,ee=Z.length;G<ee;G++)U=Z[G],K+=this.writeChildNode(U,B,P+1);B.state=g.CloseTag,K+="]"}return B.state=g.CloseTag,K+=B.spaceBeforeSlash+">",K+=this.endline(D,B,P),B.state=g.None,this.closeNode(D,B,P),K},F.prototype.element=function(D,B,P){var U,G,ee,K,Z,$,oe,ae,ye,Y,le,xe,Ce,we;P||(P=0),Y=!1,le="",this.openNode(D,B,P),B.state=g.OpenTag,le+=this.indent(D,B,P)+"<"+D.name,xe=D.attribs;for(ye in xe)R.call(xe,ye)&&(U=xe[ye],le+=this.attribute(U,B,P));if(ee=D.children.length,K=ee===0?null:D.children[0],ee===0||D.children.every(function(Le){return(Le.type===p.Text||Le.type===p.Raw)&&Le.value===""}))B.allowEmpty?(le+=">",B.state=g.CloseTag,le+="</"+D.name+">"+this.endline(D,B,P)):(B.state=g.CloseTag,le+=B.spaceBeforeSlash+"/>"+this.endline(D,B,P));else if(B.pretty&&ee===1&&(K.type===p.Text||K.type===p.Raw)&&K.value!=null)le+=">",B.state=g.InsideTag,B.suppressPrettyCount++,Y=!0,le+=this.writeChildNode(K,B,P+1),B.suppressPrettyCount--,Y=!1,B.state=g.CloseTag,le+="</"+D.name+">"+this.endline(D,B,P);else{if(B.dontPrettyTextNodes){for(Ce=D.children,Z=0,oe=Ce.length;Z<oe;Z++)if(G=Ce[Z],(G.type===p.Text||G.type===p.Raw)&&G.value!=null){B.suppressPrettyCount++,Y=!0;break}}for(le+=">"+this.endline(D,B,P),B.state=g.InsideTag,we=D.children,$=0,ae=we.length;$<ae;$++)G=we[$],le+=this.writeChildNode(G,B,P+1);B.state=g.CloseTag,le+=this.indent(D,B,P)+"</"+D.name+">",Y&&B.suppressPrettyCount--,le+=this.endline(D,B,P),B.state=g.None}return this.closeNode(D,B,P),le},F.prototype.writeChildNode=function(D,B,P){switch(D.type){case p.CData:return this.cdata(D,B,P);case p.Comment:return this.comment(D,B,P);case p.Element:return this.element(D,B,P);case p.Raw:return this.raw(D,B,P);case p.Text:return this.text(D,B,P);case p.ProcessingInstruction:return this.processingInstruction(D,B,P);case p.Dummy:return"";case p.Declaration:return this.declaration(D,B,P);case p.DocType:return this.docType(D,B,P);case p.AttributeDeclaration:return this.dtdAttList(D,B,P);case p.ElementDeclaration:return this.dtdElement(D,B,P);case p.EntityDeclaration:return this.dtdEntity(D,B,P);case p.NotationDeclaration:return this.dtdNotation(D,B,P);default:throw new Error("Unknown XML node type: "+D.constructor.name)}},F.prototype.processingInstruction=function(D,B,P){var U;return this.openNode(D,B,P),B.state=g.OpenTag,U=this.indent(D,B,P)+"<?",B.state=g.InsideTag,U+=D.target,D.value&&(U+=" "+D.value),B.state=g.CloseTag,U+=B.spaceBeforeSlash+"?>",U+=this.endline(D,B,P),B.state=g.None,this.closeNode(D,B,P),U},F.prototype.raw=function(D,B,P){var U;return this.openNode(D,B,P),B.state=g.OpenTag,U=this.indent(D,B,P),B.state=g.InsideTag,U+=D.value,B.state=g.CloseTag,U+=this.endline(D,B,P),B.state=g.None,this.closeNode(D,B,P),U},F.prototype.text=function(D,B,P){var U;return this.openNode(D,B,P),B.state=g.OpenTag,U=this.indent(D,B,P),B.state=g.InsideTag,U+=D.value,B.state=g.CloseTag,U+=this.endline(D,B,P),B.state=g.None,this.closeNode(D,B,P),U},F.prototype.dtdAttList=function(D,B,P){var U;return this.openNode(D,B,P),B.state=g.OpenTag,U=this.indent(D,B,P)+"<!ATTLIST",B.state=g.InsideTag,U+=" "+D.elementName+" "+D.attributeName+" "+D.attributeType,D.defaultValueType!=="#DEFAULT"&&(U+=" "+D.defaultValueType),D.defaultValue&&(U+=' "'+D.defaultValue+'"'),B.state=g.CloseTag,U+=B.spaceBeforeSlash+">"+this.endline(D,B,P),B.state=g.None,this.closeNode(D,B,P),U},F.prototype.dtdElement=function(D,B,P){var U;return this.openNode(D,B,P),B.state=g.OpenTag,U=this.indent(D,B,P)+"<!ELEMENT",B.state=g.InsideTag,U+=" "+D.name+" "+D.value,B.state=g.CloseTag,U+=B.spaceBeforeSlash+">"+this.endline(D,B,P),B.state=g.None,this.closeNode(D,B,P),U},F.prototype.dtdEntity=function(D,B,P){var U;return this.openNode(D,B,P),B.state=g.OpenTag,U=this.indent(D,B,P)+"<!ENTITY",B.state=g.InsideTag,D.pe&&(U+=" %"),U+=" "+D.name,D.value?U+=' "'+D.value+'"':(D.pubID&&D.sysID?U+=' PUBLIC "'+D.pubID+'" "'+D.sysID+'"':D.sysID&&(U+=' SYSTEM "'+D.sysID+'"'),D.nData&&(U+=" NDATA "+D.nData)),B.state=g.CloseTag,U+=B.spaceBeforeSlash+">"+this.endline(D,B,P),B.state=g.None,this.closeNode(D,B,P),U},F.prototype.dtdNotation=function(D,B,P){var U;return this.openNode(D,B,P),B.state=g.OpenTag,U=this.indent(D,B,P)+"<!NOTATION",B.state=g.InsideTag,U+=" "+D.name,D.pubID&&D.sysID?U+=' PUBLIC "'+D.pubID+'" "'+D.sysID+'"':D.pubID?U+=' PUBLIC "'+D.pubID+'"':D.sysID&&(U+=' SYSTEM "'+D.sysID+'"'),B.state=g.CloseTag,U+=B.spaceBeforeSlash+">"+this.endline(D,B,P),B.state=g.None,this.closeNode(D,B,P),U},F.prototype.openNode=function(D,B,P){},F.prototype.closeNode=function(D,B,P){},F.prototype.openAttribute=function(D,B,P){},F.prototype.closeAttribute=function(D,B,P){},F}()}).call(this)},{"./NodeType":428,"./Utility":429,"./WriterState":430,"./XMLCData":432,"./XMLComment":434,"./XMLDTDAttList":439,"./XMLDTDElement":440,"./XMLDTDEntity":441,"./XMLDTDNotation":442,"./XMLDeclaration":443,"./XMLDocType":444,"./XMLDummy":447,"./XMLElement":448,"./XMLProcessingInstruction":452,"./XMLRaw":453,"./XMLText":457}],459:[function(i,M,E){(function(){var p,g,l,h,v,d,o,s,u,m;m=i("./Utility"),s=m.assign,u=m.isFunction,l=i("./XMLDOMImplementation"),h=i("./XMLDocument"),v=i("./XMLDocumentCB"),o=i("./XMLStringWriter"),d=i("./XMLStreamWriter"),p=i("./NodeType"),g=i("./WriterState"),M.exports.create=function(y,_,x,S){var w,A;if(y==null)throw new Error("Root element needs a name.");return S=s({},_,x,S),w=new h(S),A=w.element(y),S.headless||(w.declaration(S),(S.pubID!=null||S.sysID!=null)&&w.dtd(S)),A},M.exports.begin=function(y,_,x){var S;return u(y)&&(S=[y,_],_=S[0],x=S[1],y={}),_?new v(y,_,x):new h(y)},M.exports.stringWriter=function(y){return new o(y)},M.exports.streamWriter=function(y,_){return new d(y,_)},M.exports.implementation=new l,M.exports.nodeType=p,M.exports.writerState=g}).call(this)},{"./NodeType":428,"./Utility":429,"./WriterState":430,"./XMLDOMImplementation":437,"./XMLDocument":445,"./XMLDocumentCB":446,"./XMLStreamWriter":454,"./XMLStringWriter":455}],460:[function(i,M,E){M.exports=g;var p=Object.prototype.hasOwnProperty;function g(){for(var l={},h=0;h<arguments.length;h++){var v=arguments[h];for(var d in v)p.call(v,d)&&(l[d]=v[d])}return l}},{}],461:[function(i,M,E){"use strict";i("core-js/modules/es.array.fill.js"),i("core-js/modules/es.array.concat.js"),i("core-js/modules/es.object.to-string.js"),i("core-js/modules/es.regexp.to-string.js"),i("core-js/modules/es.array.join.js"),i("core-js/modules/es.array.slice.js");var p=i("buffer").Buffer,g=i("./sha"),l=i("./md5"),h={sha1:g,md5:l},v=64,d=p.alloc(v);d.fill(0);function o(m,y,_){p.isBuffer(y)||(y=p.from(y)),p.isBuffer(_)||(_=p.from(_)),y.length>v?y=m(y):y.length<v&&(y=p.concat([y,d],v));for(var x=p.alloc(v),S=p.alloc(v),w=0;w<v;w++)x[w]=y[w]^54,S[w]=y[w]^92;var A=m(p.concat([x,_]));return m(p.concat([S,A]))}function s(m,y){m=m||"sha1";var _=h[m],x=[],S=0;return _||u("algorithm:",m,"is not yet supported"),{update:function(A){return p.isBuffer(A)||(A=p.from(A)),x.push(A),S+=A.length,this},digest:function(A){var H=p.concat(x),R=y?o(_,y,H):_(H);return x=null,A?R.toString(A):R}}}function u(){var m=[].slice.call(arguments).join(" ");throw new Error([m,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join(`
`))}E.createHash=function(m){return s(m)},E.createHmac=function(m,y){return s(m,y)},E.createCredentials=function(){u("sorry,createCredentials is not implemented yet")},E.createCipher=function(){u("sorry,createCipher is not implemented yet")},E.createCipheriv=function(){u("sorry,createCipheriv is not implemented yet")},E.createDecipher=function(){u("sorry,createDecipher is not implemented yet")},E.createDecipheriv=function(){u("sorry,createDecipheriv is not implemented yet")},E.createSign=function(){u("sorry,createSign is not implemented yet")},E.createVerify=function(){u("sorry,createVerify is not implemented yet")},E.createDiffieHellman=function(){u("sorry,createDiffieHellman is not implemented yet")},E.pbkdf2=function(){u("sorry,pbkdf2 is not implemented yet")}},{"./md5":463,"./sha":464,buffer:90,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.array.fill.js":273,"core-js/modules/es.array.join.js":279,"core-js/modules/es.array.slice.js":281,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.regexp.to-string.js":301}],462:[function(i,M,E){"use strict";i("core-js/modules/es.array.fill.js"),i("core-js/modules/es.array.concat.js");var p=i("buffer").Buffer,g=4,l=p.alloc(g);l.fill(0);var h=8;function v(s,u){if(s.length%g!==0){var m=s.length+(g-s.length%g);s=p.concat([s,l],m)}for(var y=[],_=u?s.readInt32BE:s.readInt32LE,x=0;x<s.length;x+=g)y.push(_.call(s,x));return y}function d(s,u,m){for(var y=p.alloc(u),_=m?y.writeInt32BE:y.writeInt32LE,x=0;x<s.length;x++)_.call(y,s[x],x*4,!0);return y}function o(s,u,m,y){p.isBuffer(s)||(s=p.from(s));var _=u(v(s,y),s.length*h);return d(_,m,y)}M.exports={hash:o}},{buffer:90,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.array.fill.js":273}],463:[function(i,M,E){"use strict";var p=i("./helpers");function g(){return hex_md5("abc")=="900150983cd24fb0d6963f7d28e17f72"}function l(y,_){y[_>>5]|=128<<_%32,y[(_+64>>>9<<4)+14]=_;for(var x=1732584193,S=-271733879,w=-1732584194,A=271733878,H=0;H<y.length;H+=16){var R=x,F=S,D=w,B=A;x=v(x,S,w,A,y[H+0],7,-680876936),A=v(A,x,S,w,y[H+1],12,-389564586),w=v(w,A,x,S,y[H+2],17,606105819),S=v(S,w,A,x,y[H+3],22,-1044525330),x=v(x,S,w,A,y[H+4],7,-176418897),A=v(A,x,S,w,y[H+5],12,1200080426),w=v(w,A,x,S,y[H+6],17,-1473231341),S=v(S,w,A,x,y[H+7],22,-45705983),x=v(x,S,w,A,y[H+8],7,1770035416),A=v(A,x,S,w,y[H+9],12,-1958414417),w=v(w,A,x,S,y[H+10],17,-42063),S=v(S,w,A,x,y[H+11],22,-1990404162),x=v(x,S,w,A,y[H+12],7,1804603682),A=v(A,x,S,w,y[H+13],12,-40341101),w=v(w,A,x,S,y[H+14],17,-1502002290),S=v(S,w,A,x,y[H+15],22,1236535329),x=d(x,S,w,A,y[H+1],5,-165796510),A=d(A,x,S,w,y[H+6],9,-1069501632),w=d(w,A,x,S,y[H+11],14,643717713),S=d(S,w,A,x,y[H+0],20,-373897302),x=d(x,S,w,A,y[H+5],5,-701558691),A=d(A,x,S,w,y[H+10],9,38016083),w=d(w,A,x,S,y[H+15],14,-660478335),S=d(S,w,A,x,y[H+4],20,-405537848),x=d(x,S,w,A,y[H+9],5,568446438),A=d(A,x,S,w,y[H+14],9,-1019803690),w=d(w,A,x,S,y[H+3],14,-187363961),S=d(S,w,A,x,y[H+8],20,1163531501),x=d(x,S,w,A,y[H+13],5,-1444681467),A=d(A,x,S,w,y[H+2],9,-51403784),w=d(w,A,x,S,y[H+7],14,1735328473),S=d(S,w,A,x,y[H+12],20,-1926607734),x=o(x,S,w,A,y[H+5],4,-378558),A=o(A,x,S,w,y[H+8],11,-2022574463),w=o(w,A,x,S,y[H+11],16,1839030562),S=o(S,w,A,x,y[H+14],23,-35309556),x=o(x,S,w,A,y[H+1],4,-1530992060),A=o(A,x,S,w,y[H+4],11,1272893353),w=o(w,A,x,S,y[H+7],16,-155497632),S=o(S,w,A,x,y[H+10],23,-1094730640),x=o(x,S,w,A,y[H+13],4,681279174),A=o(A,x,S,w,y[H+0],11,-358537222),w=o(w,A,x,S,y[H+3],16,-722521979),S=o(S,w,A,x,y[H+6],23,76029189),x=o(x,S,w,A,y[H+9],4,-640364487),A=o(A,x,S,w,y[H+12],11,-421815835),w=o(w,A,x,S,y[H+15],16,530742520),S=o(S,w,A,x,y[H+2],23,-995338651),x=s(x,S,w,A,y[H+0],6,-198630844),A=s(A,x,S,w,y[H+7],10,1126891415),w=s(w,A,x,S,y[H+14],15,-1416354905),S=s(S,w,A,x,y[H+5],21,-57434055),x=s(x,S,w,A,y[H+12],6,1700485571),A=s(A,x,S,w,y[H+3],10,-1894986606),w=s(w,A,x,S,y[H+10],15,-1051523),S=s(S,w,A,x,y[H+1],21,-2054922799),x=s(x,S,w,A,y[H+8],6,1873313359),A=s(A,x,S,w,y[H+15],10,-30611744),w=s(w,A,x,S,y[H+6],15,-1560198380),S=s(S,w,A,x,y[H+13],21,1309151649),x=s(x,S,w,A,y[H+4],6,-145523070),A=s(A,x,S,w,y[H+11],10,-1120210379),w=s(w,A,x,S,y[H+2],15,718787259),S=s(S,w,A,x,y[H+9],21,-343485551),x=u(x,R),S=u(S,F),w=u(w,D),A=u(A,B)}return Array(x,S,w,A)}function h(y,_,x,S,w,A){return u(m(u(u(_,y),u(S,A)),w),x)}function v(y,_,x,S,w,A,H){return h(_&x|~_&S,y,_,w,A,H)}function d(y,_,x,S,w,A,H){return h(_&S|x&~S,y,_,w,A,H)}function o(y,_,x,S,w,A,H){return h(_^x^S,y,_,w,A,H)}function s(y,_,x,S,w,A,H){return h(x^(_|~S),y,_,w,A,H)}function u(y,_){var x=(y&65535)+(_&65535),S=(y>>16)+(_>>16)+(x>>16);return S<<16|x&65535}function m(y,_){return y<<_|y>>>32-_}M.exports=function(_){return p.hash(_,l,16)}},{"./helpers":462}],464:[function(i,M,E){"use strict";var p=i("./helpers");function g(o,s){o[s>>5]|=128<<24-s%32,o[(s+64>>9<<4)+15]=s;for(var u=Array(80),m=1732584193,y=-271733879,_=-1732584194,x=271733878,S=-1009589776,w=0;w<o.length;w+=16){for(var A=m,H=y,R=_,F=x,D=S,B=0;B<80;B++){B<16?u[B]=o[w+B]:u[B]=d(u[B-3]^u[B-8]^u[B-14]^u[B-16],1);var P=v(v(d(m,5),l(B,y,_,x)),v(v(S,u[B]),h(B)));S=x,x=_,_=d(y,30),y=m,m=P}m=v(m,A),y=v(y,H),_=v(_,R),x=v(x,F),S=v(S,D)}return Array(m,y,_,x,S)}function l(o,s,u,m){return o<20?s&u|~s&m:o<40?s^u^m:o<60?s&u|s&m|u&m:s^u^m}function h(o){return o<20?1518500249:o<40?1859775393:o<60?-1894007588:-899497514}function v(o,s){var u=(o&65535)+(s&65535),m=(o>>16)+(s>>16)+(u>>16);return m<<16|u&65535}function d(o,s){return o<<s|o>>>32-s}M.exports=function(s){return p.hash(s,g,20,!0)}},{"./helpers":462}],465:[function(i,M,E){"use strict";M.exports=function(){return function(){}}},{}],466:[function(i,M,E){(function(p){(function(){"use strict";var g=i("@babel/runtime/helpers/interopRequireDefault"),l=g(i("@babel/runtime/helpers/typeof")),h=i("stream"),v=h.Stream,d=i("../lib/common/utils/isArray"),o=d.isArray;M.exports.string=function(m){return typeof m=="string"},M.exports.array=o,M.exports.buffer=p.isBuffer;function s(u){return u instanceof v}M.exports.writableStream=function(m){return s(m)&&typeof m._write=="function"&&(0,l.default)(m._writableState)==="object"}}).call(this)}).call(this,{isBuffer:i("../node_modules/is-buffer/index.js")})},{"../lib/common/utils/isArray":63,"../node_modules/is-buffer/index.js":366,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/helpers/typeof":79,stream:398}],467:[function(i,M,E){"use strict";var p=i("immediate"),g=M.exports={};g.nextTick=p,g.title="browser",g.browser=!0,g.env={},g.argv=[],g.version="",g.versions={};function l(){}g.on=l,g.addListener=l,g.once=l,g.off=l,g.removeListener=l,g.removeAllListeners=l,g.emit=l,g.prependListener=l,g.prependOnceListener=l,g.listeners=function(h){return[]},g.binding=function(h){throw new Error("process.binding is not supported")},g.cwd=function(){return"/"},g.chdir=function(h){throw new Error("process.chdir is not supported")},g.umask=function(){return 0}},{immediate:358}],468:[function(i,M,E){(function(p){(function(){"use strict";i("core-js/modules/es.regexp.exec.js"),i("core-js/modules/es.string.search.js");var g=i("./lib/request"),l=i("./lib/response"),h=i("xtend"),v=i("builtin-status-codes"),d=i("url"),o=E;o.request=function(s,u){typeof s=="string"?s=d.parse(s):s=h(s);var m=p.location.protocol.search(/^https?:$/)===-1?"http:":"",y=s.protocol||m,_=s.hostname||s.host,x=s.port,S=s.path||"/";_&&_.indexOf(":")!==-1&&(_="["+_+"]"),s.url=(_?y+"//"+_:"")+(x?":"+x:"")+S,s.method=(s.method||"GET").toUpperCase(),s.headers=s.headers||{};var w=new g(s);return u&&w.on("response",u),w},o.get=function(u,m){var y=o.request(u,m);return y.end(),y},o.ClientRequest=g,o.IncomingMessage=l.IncomingMessage,o.Agent=function(){},o.Agent.defaultMaxSockets=4,o.globalAgent=new o.Agent,o.STATUS_CODES=v,o.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this)}).call(this,typeof Ue!="undefined"?Ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./lib/request":470,"./lib/response":471,"builtin-status-codes":91,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.string.search.js":306,url:472,xtend:460}],469:[function(i,M,E){(function(p){(function(){"use strict";i("core-js/modules/es.object.to-string.js"),i("core-js/modules/es.promise.js"),i("core-js/modules/es.array-buffer.constructor.js"),i("core-js/modules/es.array-buffer.slice.js"),i("core-js/modules/es.array.slice.js"),E.fetch=o(p.fetch)&&o(p.ReadableStream),E.writableStream=o(p.WritableStream),E.abortController=o(p.AbortController),E.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),E.blobConstructor=!0}catch(s){}var g;function l(){if(g!==void 0)return g;if(p.XMLHttpRequest){g=new p.XMLHttpRequest;try{g.open("GET",p.XDomainRequest?"/":"https://example.com")}catch(s){g=null}}else g=null;return g}function h(s){var u=l();if(!u)return!1;try{return u.responseType=s,u.responseType===s}catch(m){}return!1}var v=typeof p.ArrayBuffer!="undefined",d=v&&o(p.ArrayBuffer.prototype.slice);E.arraybuffer=E.fetch||v&&h("arraybuffer"),E.msstream=!E.fetch&&d&&h("ms-stream"),E.mozchunkedarraybuffer=!E.fetch&&v&&h("moz-chunked-arraybuffer"),E.overrideMimeType=E.fetch||(l()?o(l().overrideMimeType):!1),E.vbArray=o(p.VBArray);function o(s){return typeof s=="function"}g=null}).call(this)}).call(this,typeof Ue!="undefined"?Ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"core-js/modules/es.array-buffer.constructor.js":270,"core-js/modules/es.array-buffer.slice.js":271,"core-js/modules/es.array.slice.js":281,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.promise.js":295}],470:[function(i,M,E){(function(p,g,l){(function(){"use strict";i("core-js/modules/es.object.to-string.js"),i("core-js/modules/es.regexp.to-string.js"),i("core-js/modules/web.dom-collections.for-each.js"),i("core-js/modules/es.object.keys.js"),i("core-js/modules/es.array.concat.js"),i("core-js/modules/es.array.map.js"),i("core-js/modules/es.function.name.js"),i("core-js/modules/es.promise.js"),i("core-js/modules/es.regexp.exec.js"),i("core-js/modules/es.string.split.js");var h=i("./capability"),v=i("inherits"),d=i("./response"),o=i("readable-stream"),s=i("to-arraybuffer"),u=d.IncomingMessage,m=d.readyStates;function y(w,A){return h.fetch&&A?"fetch":h.mozchunkedarraybuffer?"moz-chunked-arraybuffer":h.msstream?"ms-stream":h.arraybuffer&&w?"arraybuffer":h.vbArray&&w?"text:vbarray":"text"}var _=M.exports=function(w){var A=this;o.Writable.call(A),A._opts=w,A._body=[],A._headers={},w.auth&&A.setHeader("Authorization","Basic "+new l(w.auth).toString("base64")),Object.keys(w.headers).forEach(function(F){A.setHeader(F,w.headers[F])});var H,R=!0;if(w.mode==="disable-fetch"||"requestTimeout"in w&&!h.abortController)R=!1,H=!0;else if(w.mode==="prefer-streaming")H=!1;else if(w.mode==="allow-wrong-content-type")H=!h.overrideMimeType;else if(!w.mode||w.mode==="default"||w.mode==="prefer-fast")H=!0;else throw new Error("Invalid value for opts.mode");A._mode=y(H,R),A._fetchTimer=null,A.on("finish",function(){A._onFinish()})};v(_,o.Writable),_.prototype.setHeader=function(w,A){var H=this,R=w.toLowerCase();S.indexOf(R)===-1&&(H._headers[R]={name:w,value:A})},_.prototype.getHeader=function(w){var A=this._headers[w.toLowerCase()];return A?A.value:null},_.prototype.removeHeader=function(w){var A=this;delete A._headers[w.toLowerCase()]},_.prototype._onFinish=function(){var w=this;if(!w._destroyed){var A=w._opts,H=w._headers,R=null;A.method!=="GET"&&A.method!=="HEAD"&&(h.arraybuffer?R=s(l.concat(w._body)):h.blobConstructor?R=new g.Blob(w._body.map(function(G){return s(G)}),{type:(H["content-type"]||{}).value||""}):R=l.concat(w._body).toString());var F=[];if(Object.keys(H).forEach(function(G){var ee=H[G].name,K=H[G].value;Array.isArray(K)?K.forEach(function(Z){F.push([ee,Z])}):F.push([ee,K])}),w._mode==="fetch"){var D=null,B=null;if(h.abortController){var P=new AbortController;D=P.signal,w._fetchAbortController=P,"requestTimeout"in A&&A.requestTimeout!==0&&(w._fetchTimer=g.setTimeout(function(){w.emit("requestTimeout"),w._fetchAbortController&&w._fetchAbortController.abort()},A.requestTimeout))}g.fetch(w._opts.url,{method:w._opts.method,headers:F,body:R||void 0,mode:"cors",credentials:A.withCredentials?"include":"same-origin",signal:D}).then(function(G){w._fetchResponse=G,w._connect()},function(G){g.clearTimeout(w._fetchTimer),w._destroyed||w.emit("error",G)})}else{var U=w._xhr=new g.XMLHttpRequest;try{U.open(w._opts.method,w._opts.url,!0)}catch(G){p.nextTick(function(){w.emit("error",G)});return}"responseType"in U&&(U.responseType=w._mode.split(":")[0]),"withCredentials"in U&&(U.withCredentials=!!A.withCredentials),w._mode==="text"&&"overrideMimeType"in U&&U.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in A&&(U.timeout=A.requestTimeout,U.ontimeout=function(){w.emit("requestTimeout")}),F.forEach(function(G){U.setRequestHeader(G[0],G[1])}),w._response=null,U.onreadystatechange=function(){switch(U.readyState){case m.LOADING:case m.DONE:w._onXHRProgress();break}},w._mode==="moz-chunked-arraybuffer"&&(U.onprogress=function(){w._onXHRProgress()}),U.onerror=function(){w._destroyed||w.emit("error",new Error("XHR error"))};try{U.send(R)}catch(G){p.nextTick(function(){w.emit("error",G)});return}}}};function x(w){try{var A=w.status;return A!==null&&A!==0}catch(H){return!1}}_.prototype._onXHRProgress=function(){var w=this;!x(w._xhr)||w._destroyed||(w._response||w._connect(),w._response._onXHRProgress())},_.prototype._connect=function(){var w=this;w._destroyed||(w._response=new u(w._xhr,w._fetchResponse,w._mode,w._fetchTimer),w._response.on("error",function(A){w.emit("error",A)}),w.emit("response",w._response))},_.prototype._write=function(w,A,H){var R=this;R._body.push(w),H()},_.prototype.abort=_.prototype.destroy=function(){var w=this;w._destroyed=!0,g.clearTimeout(w._fetchTimer),w._response&&(w._response._destroyed=!0),w._xhr?w._xhr.abort():w._fetchAbortController&&w._fetchAbortController.abort()},_.prototype.end=function(w,A,H){var R=this;typeof w=="function"&&(H=w,w=void 0),o.Writable.prototype.end.call(R,w,A,H)},_.prototype.flushHeaders=function(){},_.prototype.setTimeout=function(){},_.prototype.setNoDelay=function(){},_.prototype.setSocketKeepAlive=function(){};var S=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"]}).call(this)}).call(this,i("_process"),typeof Ue!="undefined"?Ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{},i("buffer").Buffer)},{"./capability":469,"./response":471,_process:467,buffer:90,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.array.map.js":280,"core-js/modules/es.function.name.js":284,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.promise.js":295,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.regexp.to-string.js":301,"core-js/modules/es.string.split.js":307,"core-js/modules/web.dom-collections.for-each.js":339,inherits:364,"readable-stream":394,"to-arraybuffer":415}],471:[function(i,M,E){(function(p,g,l){(function(){"use strict";i("core-js/modules/es.object.to-string.js"),i("core-js/modules/web.dom-collections.for-each.js"),i("core-js/modules/es.promise.js"),i("core-js/modules/es.regexp.exec.js"),i("core-js/modules/es.string.split.js"),i("core-js/modules/es.string.match.js"),i("core-js/modules/es.array.iterator.js"),i("core-js/modules/es.array-buffer.slice.js"),i("core-js/modules/es.typed-array.uint8-array.js"),i("core-js/modules/es.typed-array.copy-within.js"),i("core-js/modules/es.typed-array.every.js"),i("core-js/modules/es.typed-array.fill.js"),i("core-js/modules/es.typed-array.filter.js"),i("core-js/modules/es.typed-array.find.js"),i("core-js/modules/es.typed-array.find-index.js"),i("core-js/modules/es.typed-array.for-each.js"),i("core-js/modules/es.typed-array.includes.js"),i("core-js/modules/es.typed-array.index-of.js"),i("core-js/modules/es.typed-array.iterator.js"),i("core-js/modules/es.typed-array.join.js"),i("core-js/modules/es.typed-array.last-index-of.js"),i("core-js/modules/es.typed-array.map.js"),i("core-js/modules/es.typed-array.reduce.js"),i("core-js/modules/es.typed-array.reduce-right.js"),i("core-js/modules/es.typed-array.reverse.js"),i("core-js/modules/es.typed-array.set.js"),i("core-js/modules/es.typed-array.slice.js"),i("core-js/modules/es.typed-array.some.js"),i("core-js/modules/es.typed-array.sort.js"),i("core-js/modules/es.typed-array.subarray.js"),i("core-js/modules/es.typed-array.to-locale-string.js"),i("core-js/modules/es.typed-array.to-string.js"),i("core-js/modules/es.array.slice.js");var h=i("./capability"),v=i("inherits"),d=i("readable-stream"),o=E.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},s=E.IncomingMessage=function(u,m,y,_){var x=this;if(d.Readable.call(x),x._mode=y,x.headers={},x.rawHeaders=[],x.trailers={},x.rawTrailers=[],x.on("end",function(){p.nextTick(function(){x.emit("close")})}),y==="fetch"){var S=function D(){A.read().then(function(B){if(!x._destroyed){if(B.done){g.clearTimeout(_),x.push(null);return}x.push(new l(B.value)),D()}}).catch(function(B){g.clearTimeout(_),x._destroyed||x.emit("error",B)})};if(x._fetchResponse=m,x.url=m.url,x.statusCode=m.status,x.statusMessage=m.statusText,m.headers.forEach(function(D,B){x.headers[B.toLowerCase()]=D,x.rawHeaders.push(B,D)}),h.writableStream){var w=new WritableStream({write:function(B){return new Promise(function(P,U){x._destroyed?U():x.push(new l(B))?P():x._resumeFetch=P})},close:function(){g.clearTimeout(_),x._destroyed||x.push(null)},abort:function(B){x._destroyed||x.emit("error",B)}});try{m.body.pipeTo(w).catch(function(D){g.clearTimeout(_),x._destroyed||x.emit("error",D)});return}catch(D){}}var A=m.body.getReader();S()}else{x._xhr=u,x._pos=0,x.url=u.responseURL,x.statusCode=u.status,x.statusMessage=u.statusText;var H=u.getAllResponseHeaders().split(/\r?\n/);if(H.forEach(function(D){var B=D.match(/^([^:]+):\s*(.*)/);if(B){var P=B[1].toLowerCase();P==="set-cookie"?(x.headers[P]===void 0&&(x.headers[P]=[]),x.headers[P].push(B[2])):x.headers[P]!==void 0?x.headers[P]+=", "+B[2]:x.headers[P]=B[2],x.rawHeaders.push(B[1],B[2])}}),x._charset="x-user-defined",!h.overrideMimeType){var R=x.rawHeaders["mime-type"];if(R){var F=R.match(/;\s*charset=([^;])(;|$)/);F&&(x._charset=F[1].toLowerCase())}x._charset||(x._charset="utf-8")}}};v(s,d.Readable),s.prototype._read=function(){var u=this,m=u._resumeFetch;m&&(u._resumeFetch=null,m())},s.prototype._onXHRProgress=function(){var u=this,m=u._xhr,y=null;switch(u._mode){case"text:vbarray":if(m.readyState!==o.DONE)break;try{y=new g.VBArray(m.responseBody).toArray()}catch(A){}if(y!==null){u.push(new l(y));break}case"text":try{y=m.responseText}catch(A){u._mode="text:vbarray";break}if(y.length>u._pos){var _=y.substr(u._pos);if(u._charset==="x-user-defined"){for(var x=new l(_.length),S=0;S<_.length;S++)x[S]=_.charCodeAt(S)&255;u.push(x)}else u.push(_,u._charset);u._pos=y.length}break;case"arraybuffer":if(m.readyState!==o.DONE||!m.response)break;y=m.response,u.push(new l(new Uint8Array(y)));break;case"moz-chunked-arraybuffer":if(y=m.response,m.readyState!==o.LOADING||!y)break;u.push(new l(new Uint8Array(y)));break;case"ms-stream":if(y=m.response,m.readyState!==o.LOADING)break;var w=new g.MSStreamReader;w.onprogress=function(){w.result.byteLength>u._pos&&(u.push(new l(new Uint8Array(w.result.slice(u._pos)))),u._pos=w.result.byteLength)},w.onload=function(){u.push(null)},w.readAsArrayBuffer(y);break}u._xhr.readyState===o.DONE&&u._mode!=="ms-stream"&&u.push(null)}}).call(this)}).call(this,i("_process"),typeof Ue!="undefined"?Ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{},i("buffer").Buffer)},{"./capability":469,_process:467,buffer:90,"core-js/modules/es.array-buffer.slice.js":271,"core-js/modules/es.array.iterator.js":278,"core-js/modules/es.array.slice.js":281,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.promise.js":295,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.string.match.js":304,"core-js/modules/es.string.split.js":307,"core-js/modules/es.typed-array.copy-within.js":315,"core-js/modules/es.typed-array.every.js":316,"core-js/modules/es.typed-array.fill.js":317,"core-js/modules/es.typed-array.filter.js":318,"core-js/modules/es.typed-array.find-index.js":319,"core-js/modules/es.typed-array.find.js":320,"core-js/modules/es.typed-array.for-each.js":321,"core-js/modules/es.typed-array.includes.js":322,"core-js/modules/es.typed-array.index-of.js":323,"core-js/modules/es.typed-array.iterator.js":324,"core-js/modules/es.typed-array.join.js":325,"core-js/modules/es.typed-array.last-index-of.js":326,"core-js/modules/es.typed-array.map.js":327,"core-js/modules/es.typed-array.reduce-right.js":328,"core-js/modules/es.typed-array.reduce.js":329,"core-js/modules/es.typed-array.reverse.js":330,"core-js/modules/es.typed-array.set.js":331,"core-js/modules/es.typed-array.slice.js":332,"core-js/modules/es.typed-array.some.js":333,"core-js/modules/es.typed-array.sort.js":334,"core-js/modules/es.typed-array.subarray.js":335,"core-js/modules/es.typed-array.to-locale-string.js":336,"core-js/modules/es.typed-array.to-string.js":337,"core-js/modules/es.typed-array.uint8-array.js":338,"core-js/modules/web.dom-collections.for-each.js":339,inherits:364,"readable-stream":394}],472:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/helpers/typeof"));i("core-js/modules/es.regexp.exec.js"),i("core-js/modules/es.string.search.js"),i("core-js/modules/es.array.concat.js"),i("core-js/modules/es.string.split.js"),i("core-js/modules/es.string.replace.js"),i("core-js/modules/es.array.join.js"),i("core-js/modules/es.string.trim.js"),i("core-js/modules/es.string.match.js"),i("core-js/modules/es.array.slice.js"),i("core-js/modules/es.object.keys.js"),i("core-js/modules/es.array.splice.js");var l=i("punycode"),h=i("./util");E.parse=B,E.resolve=U,E.resolveObject=G,E.format=P,E.Url=v;function v(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var d=/^([a-z0-9.+-]+:)/i,o=/:[0-9]*$/,s=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["<",">",'"',"`"," ","\r",`
`," "],m=["{","}","|","\\","^","`"].concat(u),y=["'"].concat(m),_=["%","/","?",";","#"].concat(y),x=["/","?","#"],S=255,w=/^[+a-z0-9A-Z_-]{0,63}$/,A=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,H={javascript:!0,"javascript:":!0},R={javascript:!0,"javascript:":!0},F={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},D=i("querystring");function B(ee,K,Z){if(ee&&h.isObject(ee)&&ee instanceof v)return ee;var $=new v;return $.parse(ee,K,Z),$}v.prototype.parse=function(ee,K,Z){if(!h.isString(ee))throw new TypeError("Parameter 'url' must be a string, not "+(0,g.default)(ee));var $=ee.indexOf("?"),oe=$!==-1&&$<ee.indexOf("#")?"?":"#",ae=ee.split(oe),ye=/\\/g;ae[0]=ae[0].replace(ye,"/"),ee=ae.join(oe);var Y=ee;if(Y=Y.trim(),!Z&&ee.split("#").length===1){var le=s.exec(Y);if(le)return this.path=Y,this.href=Y,this.pathname=le[1],le[2]?(this.search=le[2],K?this.query=D.parse(this.search.substr(1)):this.query=this.search.substr(1)):K&&(this.search="",this.query={}),this}var xe=d.exec(Y);if(xe){xe=xe[0];var Ce=xe.toLowerCase();this.protocol=Ce,Y=Y.substr(xe.length)}if(Z||xe||Y.match(/^\/\/[^@\/]+@[^@\/]+/)){var we=Y.substr(0,2)==="//";we&&!(xe&&R[xe])&&(Y=Y.substr(2),this.slashes=!0)}if(!R[xe]&&(we||xe&&!F[xe])){for(var Le=-1,de=0;de<x.length;de++){var be=Y.indexOf(x[de]);be!==-1&&(Le===-1||be<Le)&&(Le=be)}var Te,Ae;Le===-1?Ae=Y.lastIndexOf("@"):Ae=Y.lastIndexOf("@",Le),Ae!==-1&&(Te=Y.slice(0,Ae),Y=Y.slice(Ae+1),this.auth=decodeURIComponent(Te)),Le=-1;for(var de=0;de<_.length;de++){var be=Y.indexOf(_[de]);be!==-1&&(Le===-1||be<Le)&&(Le=be)}Le===-1&&(Le=Y.length),this.host=Y.slice(0,Le),Y=Y.slice(Le),this.parseHost(),this.hostname=this.hostname||"";var Be=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!Be)for(var Pe=this.hostname.split("."),de=0,_e=Pe.length;de<_e;de++){var ne=Pe[de];if(ne&&!ne.match(w)){for(var te="",T=0,I=ne.length;T<I;T++)ne.charCodeAt(T)>127?te+="x":te+=ne[T];if(!te.match(w)){var re=Pe.slice(0,de),q=Pe.slice(de+1),z=ne.match(A);z&&(re.push(z[1]),q.unshift(z[2])),q.length&&(Y="/"+q.join(".")+Y),this.hostname=re.join(".");break}}}this.hostname.length>S?this.hostname="":this.hostname=this.hostname.toLowerCase(),Be||(this.hostname=l.toASCII(this.hostname));var W=this.port?":"+this.port:"",V=this.hostname||"";this.host=V+W,this.href+=this.host,Be&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),Y[0]!=="/"&&(Y="/"+Y))}if(!H[Ce])for(var de=0,_e=y.length;de<_e;de++){var se=y[de];if(Y.indexOf(se)!==-1){var ge=encodeURIComponent(se);ge===se&&(ge=escape(se)),Y=Y.split(se).join(ge)}}var Me=Y.indexOf("#");Me!==-1&&(this.hash=Y.substr(Me),Y=Y.slice(0,Me));var Fe=Y.indexOf("?");if(Fe!==-1?(this.search=Y.substr(Fe),this.query=Y.substr(Fe+1),K&&(this.query=D.parse(this.query)),Y=Y.slice(0,Fe)):K&&(this.search="",this.query={}),Y&&(this.pathname=Y),F[Ce]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var W=this.pathname||"",Re=this.search||"";this.path=W+Re}return this.href=this.format(),this};function P(ee){return h.isString(ee)&&(ee=B(ee)),ee instanceof v?ee.format():v.prototype.format.call(ee)}v.prototype.format=function(){var ee=this.auth||"";ee&&(ee=encodeURIComponent(ee),ee=ee.replace(/%3A/i,":"),ee+="@");var K=this.protocol||"",Z=this.pathname||"",$=this.hash||"",oe=!1,ae="";this.host?oe=ee+this.host:this.hostname&&(oe=ee+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(oe+=":"+this.port)),this.query&&h.isObject(this.query)&&Object.keys(this.query).length&&(ae=D.stringify(this.query));var ye=this.search||ae&&"?"+ae||"";return K&&K.substr(-1)!==":"&&(K+=":"),this.slashes||(!K||F[K])&&oe!==!1?(oe="//"+(oe||""),Z&&Z.charAt(0)!=="/"&&(Z="/"+Z)):oe||(oe=""),$&&$.charAt(0)!=="#"&&($="#"+$),ye&&ye.charAt(0)!=="?"&&(ye="?"+ye),Z=Z.replace(/[?#]/g,function(Y){return encodeURIComponent(Y)}),ye=ye.replace("#","%23"),K+oe+Z+ye+$};function U(ee,K){return B(ee,!1,!0).resolve(K)}v.prototype.resolve=function(ee){return this.resolveObject(B(ee,!1,!0)).format()};function G(ee,K){return ee?B(ee,!1,!0).resolveObject(K):K}v.prototype.resolveObject=function(ee){if(h.isString(ee)){var K=new v;K.parse(ee,!1,!0),ee=K}for(var Z=new v,$=Object.keys(this),oe=0;oe<$.length;oe++){var ae=$[oe];Z[ae]=this[ae]}if(Z.hash=ee.hash,ee.href==="")return Z.href=Z.format(),Z;if(ee.slashes&&!ee.protocol){for(var ye=Object.keys(ee),Y=0;Y<ye.length;Y++){var le=ye[Y];le!=="protocol"&&(Z[le]=ee[le])}return F[Z.protocol]&&Z.hostname&&!Z.pathname&&(Z.path=Z.pathname="/"),Z.href=Z.format(),Z}if(ee.protocol&&ee.protocol!==Z.protocol){if(!F[ee.protocol]){for(var xe=Object.keys(ee),Ce=0;Ce<xe.length;Ce++){var we=xe[Ce];Z[we]=ee[we]}return Z.href=Z.format(),Z}if(Z.protocol=ee.protocol,!ee.host&&!R[ee.protocol]){for(var _e=(ee.pathname||"").split("/");_e.length&&!(ee.host=_e.shift()););ee.host||(ee.host=""),ee.hostname||(ee.hostname=""),_e[0]!==""&&_e.unshift(""),_e.length<2&&_e.unshift(""),Z.pathname=_e.join("/")}else Z.pathname=ee.pathname;if(Z.search=ee.search,Z.query=ee.query,Z.host=ee.host||"",Z.auth=ee.auth,Z.hostname=ee.hostname||ee.host,Z.port=ee.port,Z.pathname||Z.search){var Le=Z.pathname||"",de=Z.search||"";Z.path=Le+de}return Z.slashes=Z.slashes||ee.slashes,Z.href=Z.format(),Z}var be=Z.pathname&&Z.pathname.charAt(0)==="/",Te=ee.host||ee.pathname&&ee.pathname.charAt(0)==="/",Ae=Te||be||Z.host&&ee.pathname,Be=Ae,Pe=Z.pathname&&Z.pathname.split("/")||[],_e=ee.pathname&&ee.pathname.split("/")||[],ne=Z.protocol&&!F[Z.protocol];if(ne&&(Z.hostname="",Z.port=null,Z.host&&(Pe[0]===""?Pe[0]=Z.host:Pe.unshift(Z.host)),Z.host="",ee.protocol&&(ee.hostname=null,ee.port=null,ee.host&&(_e[0]===""?_e[0]=ee.host:_e.unshift(ee.host)),ee.host=null),Ae=Ae&&(_e[0]===""||Pe[0]==="")),Te)Z.host=ee.host||ee.host===""?ee.host:Z.host,Z.hostname=ee.hostname||ee.hostname===""?ee.hostname:Z.hostname,Z.search=ee.search,Z.query=ee.query,Pe=_e;else if(_e.length)Pe||(Pe=[]),Pe.pop(),Pe=Pe.concat(_e),Z.search=ee.search,Z.query=ee.query;else if(!h.isNullOrUndefined(ee.search)){if(ne){Z.hostname=Z.host=Pe.shift();var te=Z.host&&Z.host.indexOf("@")>0?Z.host.split("@"):!1;te&&(Z.auth=te.shift(),Z.host=Z.hostname=te.shift())}return Z.search=ee.search,Z.query=ee.query,(!h.isNull(Z.pathname)||!h.isNull(Z.search))&&(Z.path=(Z.pathname?Z.pathname:"")+(Z.search?Z.search:"")),Z.href=Z.format(),Z}if(!Pe.length)return Z.pathname=null,Z.search?Z.path="/"+Z.search:Z.path=null,Z.href=Z.format(),Z;for(var T=Pe.slice(-1)[0],I=(Z.host||ee.host||Pe.length>1)&&(T==="."||T==="..")||T==="",re=0,q=Pe.length;q>=0;q--)T=Pe[q],T==="."?Pe.splice(q,1):T===".."?(Pe.splice(q,1),re++):re&&(Pe.splice(q,1),re--);if(!Ae&&!Be)for(;re--;re)Pe.unshift("..");Ae&&Pe[0]!==""&&(!Pe[0]||Pe[0].charAt(0)!=="/")&&Pe.unshift(""),I&&Pe.join("/").substr(-1)!=="/"&&Pe.push("");var z=Pe[0]===""||Pe[0]&&Pe[0].charAt(0)==="/";if(ne){Z.hostname=Z.host=z?"":Pe.length?Pe.shift():"";var te=Z.host&&Z.host.indexOf("@")>0?Z.host.split("@"):!1;te&&(Z.auth=te.shift(),Z.host=Z.hostname=te.shift())}return Ae=Ae||Z.host&&Pe.length,Ae&&!z&&Pe.unshift(""),Pe.length?Z.pathname=Pe.join("/"):(Z.pathname=null,Z.path=null),(!h.isNull(Z.pathname)||!h.isNull(Z.search))&&(Z.path=(Z.pathname?Z.pathname:"")+(Z.search?Z.search:"")),Z.auth=ee.auth||Z.auth,Z.slashes=Z.slashes||ee.slashes,Z.href=Z.format(),Z},v.prototype.parseHost=function(){var ee=this.host,K=o.exec(ee);K&&(K=K[0],K!==":"&&(this.port=K.substr(1)),ee=ee.substr(0,ee.length-K.length)),ee&&(this.hostname=ee)}},{"./util":473,"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/helpers/typeof":79,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.array.join.js":279,"core-js/modules/es.array.slice.js":281,"core-js/modules/es.array.splice.js":283,"core-js/modules/es.object.keys.js":290,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.string.match.js":304,"core-js/modules/es.string.replace.js":305,"core-js/modules/es.string.search.js":306,"core-js/modules/es.string.split.js":307,"core-js/modules/es.string.trim.js":308,punycode:382,querystring:385}],473:[function(i,M,E){"use strict";var p=i("@babel/runtime/helpers/interopRequireDefault"),g=p(i("@babel/runtime/helpers/typeof"));M.exports={isString:function(h){return typeof h=="string"},isObject:function(h){return(0,g.default)(h)==="object"&&h!==null},isNull:function(h){return h===null},isNullOrUndefined:function(h){return h==null}}},{"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/helpers/typeof":79}],474:[function(i,M,E){"use strict";i("core-js/modules/es.number.constructor.js"),E.encodeURIComponent=function(p){try{return encodeURIComponent(p)}catch(g){return p}},E.escape=i("escape-html"),E.timestamp=function(g){if(g){var l=g;return typeof l=="string"&&(l=Number(l)),String(g).length===10&&(l*=1e3),new Date(l)}return Math.round(Date.now()/1e3)}},{"core-js/modules/es.number.constructor.js":286,"escape-html":343}],475:[function(i,M,E){(function(p,g){(function(){"use strict";var l=i("@babel/runtime/helpers/interopRequireDefault"),h=l(i("@babel/runtime/helpers/typeof"));i("core-js/modules/es.string.trim.js"),i("core-js/modules/es.regexp.exec.js"),i("core-js/modules/es.string.split.js"),i("core-js/modules/es.object.to-string.js"),i("core-js/modules/es.promise.js"),i("core-js/modules/es.function.name.js"),i("core-js/modules/es.array.concat.js");var v=i("util"),d=i("url"),o=i("http"),s=i("https"),u=i("debug")("urllib"),m=i("humanize-ms"),y=0,_=Math.pow(2,31)-10,x=/^https?:\/\//i;function S(R,F){return R===void 0?F:R}function w(R){return R?R.split(";")[0].trim().toLowerCase():""}function A(R,F){return function(D,B,P){if(D)return F(D);R({data:B,status:P.statusCode,headers:P.headers,res:P})}}E.TIMEOUTS=[m("300s"),m("300s")];var H=["json","text"];E.request=function(F,D,B){return arguments.length===2&&typeof D=="function"&&(B=D,D=null),typeof B=="function"?E.requestWithCallback(F,D,B):new Promise(function(P,U){E.requestWithCallback(F,D,A(P,U))})},E.requestWithCallback=function(F,D,B){if(!F||typeof F!="string"&&(0,h.default)(F)!=="object"){var P=v.format("expect request url to be a string or a http request options, but got %j",F);throw new Error(P)}arguments.length===2&&typeof D=="function"&&(B=D,D=null),D=D||{},y>=_&&(y=0);var U=++y;D.requestUrls=D.requestUrls||[];var G={requestId:U,url:F,args:D,ctx:D.ctx};D.emitter&&D.emitter.emit("request",G),D.timeout=D.timeout||E.TIMEOUTS,D.maxRedirects=D.maxRedirects||10,D.streaming=D.streaming||D.customResponse;var ee=Date.now(),K;typeof F=="string"?(x.test(F)||(F="https://"+F),K=d.parse(F)):K=F;var Z=(D.type||D.method||K.method||"GET").toUpperCase(),$=K.port||80,oe=o,ae=S(D.agent,E.agent),ye=D.fixJSONCtlChars;K.protocol==="https:"&&(oe=s,ae=S(D.httpsAgent,E.httpsAgent),K.port||($=443));var Y={host:K.hostname||K.host||"localhost",path:K.path||"/",method:Z,port:$,agent:ae,headers:D.headers||{},lookup:D.lookup};Array.isArray(D.timeout)?Y.requestTimeout=D.timeout[D.timeout.length-1]:typeof D.timeout!="undefined"&&(Y.requestTimeout=D.timeout);var le=D.auth||K.auth;le&&(Y.auth=le);var xe=D.content||D.data,Ce=Z==="GET"||Z==="HEAD"||D.dataAsQueryString;if(!D.content&&xe&&!(typeof xe=="string"||g.isBuffer(xe)))if(Ce)xe=D.nestedQuerystring?qs.stringify(xe):querystring.stringify(xe);else{var we=Y.headers["Content-Type"]||Y.headers["content-type"];we||(D.contentType==="json"?we="application/json":we="application/x-www-form-urlencoded",Y.headers["Content-Type"]=we),w(we)==="application/json"?xe=JSON.stringify(xe):xe=D.nestedQuerystring?qs.stringify(xe):querystring.stringify(xe)}Ce&&xe&&(Y.path+=(K.query?"&":"?")+xe,xe=null);var Le=0;if(xe){var de=xe.length;g.isBuffer(xe)||(de=g.byteLength(xe)),Le=Y.headers["Content-Length"]=de}D.dataType==="json"&&(Y.headers.Accept="application/json"),typeof D.beforeRequest=="function"&&D.beforeRequest(Y);var be=null,Te=null,Ae=null,Be=!1,Pe=!1,_e=0,ne=-1,te=!1,T="",I="",re=null;D.timing&&(re={queuing:0,dnslookup:0,connected:0,requestSent:0,waiting:0,contentDownload:0});function q(){be&&(clearTimeout(be),be=null)}function z(){Te&&(clearTimeout(Te),Te=null)}function W(We,nt,qe){if(z(),!B){console.warn("[urllib:warn] [%s] [%s] [worker:%s] %s %s callback twice!!!",Date(),U,p.pid,Y.method,F),We&&console.warn(`[urllib:warn] [%s] [%s] [worker:%s] %s: %s
stack: %s`,Date(),U,p.pid,We.name,We.message,We.stack);return}var Qe=B;B=null;var ft={};qe&&(ne=qe.statusCode,ft=qe.headers);var vt=Date.now()-ee;re&&(re.contentDownload=vt),u("[%sms] done, %s bytes HTTP %s %s %s %s, keepAliveSocket: %s, timing: %j",vt,_e,ne,Y.method,Y.host,Y.path,Pe,re);var bt={status:ne,statusCode:ne,headers:ft,size:_e,aborted:te,rt:vt,keepAliveSocket:Pe,data:nt,requestUrls:D.requestUrls,timing:re,remoteAddress:T,remotePort:I};if(We){var Tt="";ae&&typeof ae.getCurrentStatus=="function"&&(Tt=", agent status: "+JSON.stringify(ae.getCurrentStatus())),We.message+=", "+Y.method+" "+F+" "+ne+" (connected: "+Be+", keepalive socket: "+Pe+Tt+`)
headers: `+JSON.stringify(ft),We.data=nt,We.path=Y.path,We.status=ne,We.headers=ft,We.res=bt}Qe(We,nt,D.streaming?qe:bt),D.emitter&&(G.url=F,G.socket=Ne&&Ne.connection,G.options=Y,G.size=Le,D.emitter.emit("response",{requestId:U,error:We,ctx:D.ctx,req:G,res:bt}))}function V(We){var nt=null;if(D.followRedirect&&statuses.redirect[We.statusCode]){D._followRedirectCount=(D._followRedirectCount||0)+1;var qe=We.headers.location;if(!qe)nt=new Error("Got statusCode "+We.statusCode+" but cannot resolve next location from headers"),nt.name="FollowRedirectError";else if(D._followRedirectCount>D.maxRedirects)nt=new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+F),nt.name="MaxRedirectError";else{var Qe=D.formatRedirectUrl?D.formatRedirectUrl(F,qe):d.resolve(F,qe);u("Request#%d %s: `redirected` from %s to %s",U,Y.path,F,Qe),z(),D.headers&&D.headers.Host&&x.test(qe)&&(D.headers.Host=null);var ft=B;return B=null,E.requestWithCallback(Qe,D,ft),{redirect:!0,error:null}}}return{redirect:!1,error:nt}}D.gzip&&!Y.headers["Accept-Encoding"]&&!Y.headers["accept-encoding"]&&(Y.headers["Accept-Encoding"]="gzip");function se(We,nt,qe){var Qe=We.headers["content-encoding"];return qe(null,nt,Qe)}var ge=D.writeStream;u("Request#%d %s %s with headers %j, options.path: %s",U,Z,F,Y.headers,Y.path),D.requestUrls.push(F);function Me(We){if(re&&(re.waiting=Date.now()-ee),u("Request#%d %s `req response` event emit: status %d, headers: %j",U,F,We.statusCode,We.headers),D.streaming){var nt=V(We);if(nt.redirect){We.resume();return}return nt.error?(We.resume(),W(nt.error,null,We)):W(null,null,We)}if(We.on("close",function(){u("Request#%d %s: `res close` event emit, total size %d",U,F,_e)}),We.on("error",function(){u("Request#%d %s: `res error` event emit, total size %d",U,F,_e)}),We.on("aborted",function(){te=!0,u("Request#%d %s: `res aborted` event emit, total size %d",U,F,_e)}),ge){var qe=V(We);if(qe.redirect){We.resume();return}return qe.error?(We.resume(),ge.end(),W(qe.error,null,We)):(D.consumeWriteStream===!1?We.on("end",W.bind(null,null,null,We)):ge.on("close",function(){u("Request#%d %s: writeStream close event emitted",U,F),W(Ae||null,null,We)}),We.pipe(ge))}var Qe=[];We.on("data",function(ft){u("Request#%d %s: `res data` event emit, size %d",U,F,ft.length),_e+=ft.length,Qe.push(ft)}),We.on("end",function(){var ft=g.concat(Qe,_e);if(u("Request#%d %s: `res end` event emit, total size %d, _dumped: %s",U,F,_e,We._dumped),Ae)return W(Ae,ft,We);var vt=V(We);if(vt.error)return W(vt.error,ft,We);vt.redirect||se(We,ft,function(bt,Tt,kr){if(bt)return W(bt,ft,We);if(!kr&&H.indexOf(D.dataType)>=0){try{Tt=decodeBodyByCharset(Tt,We)}catch(xn){return u("decodeBodyByCharset error: %s",xn),W(null,Tt,We)}if(D.dataType==="json")if(_e===0)Tt=null;else{var jr=parseJSON(Tt,ye);jr.error?bt=jr.error:Tt=jr.data}}te&&u("Request#%d %s: Remote socket was terminated before `response.end()` was called",U,F),W(bt,Tt,We)})})}var Fe,Re;Array.isArray(D.timeout)?(Fe=m(D.timeout[0]),Re=m(D.timeout[1])):Fe=Re=m(D.timeout),u("ConnectTimeout: %d, ResponseTimeout: %d",Fe,Re);function $e(){u("Connect timer ticking, timeout: %d",Fe),be=setTimeout(function(){be=null,ne===-1&&(ne=-2);var We="Connect timeout for "+Fe+"ms",nt="ConnectionTimeoutError";Ne.socket||(nt="SocketAssignTimeoutError",We+=", working sockets is full"),Ae=new Error(We),Ae.name=nt,Ae.requestId=U,u("ConnectTimeout: Request#%d %s %s: %s, connected: %s",U,F,Ae.name,We,Be),Ze()},Fe)}function lt(){u("Response timer ticking, timeout: %d",Re),Te=setTimeout(function(){Te=null;var We="Response timeout for "+Re+"ms",nt="ResponseTimeoutError";Ae=new Error(We),Ae.name=nt,Ae.requestId=U,u("ResponseTimeout: Request#%d %s %s: %s, connected: %s",U,F,Ae.name,We,Be),Ze()},Re)}var Ne;Y.mode=D.mode?D.mode:"";try{Ne=oe.request(Y,Me)}catch(We){return W(We)}typeof window=="undefined"?$e():Ne.on("requestTimeout",function(){ne===-1&&(ne=-2);var We="Connect timeout for "+Fe+"ms",nt="ConnectionTimeoutError";Ae=new Error(We),Ae.name=nt,Ae.requestId=U,Ze()});function Ze(){u("Request#%d %s abort, connected: %s",U,F,Be),Ne.socket||(Ae.noSocket=!0,W(Ae)),Ne.abort()}return re&&Ne.on("finish",function(){re.requestSent=Date.now()-ee}),Ne.once("socket",function(We){re&&(re.queuing=Date.now()-ee);var nt=We.readyState;if(nt==="opening"){We.once("lookup",function(qe,Qe,ft){u("Request#%d %s lookup: %s, %s, %s",U,F,qe,Qe,ft),re&&(re.dnslookup=Date.now()-ee),Qe&&(T=Qe)}),We.once("connect",function(){re&&(re.connected=Date.now()-ee),q(),lt(),u("Request#%d %s new socket connected",U,F),Be=!0,T||(T=We.remoteAddress),I=We.remotePort});return}u("Request#%d %s reuse socket connected, readyState: %s",U,F,nt),Be=!0,Pe=!0,T||(T=We.remoteAddress),I=We.remotePort,q(),lt()}),Ne.on("error",function(We){(We.name==="Error"||We.name==="TypeError")&&(We.name=Be?"ResponseError":"RequestError"),We.message+=' (req "error")',u("Request#%d %s `req error` event emit, %s: %s",U,F,We.name,We.message),W(Ae||We)}),ge&&ge.once("error",function(We){We.message+=' (writeStream "error")',Ae=We,u("Request#%d %s `writeStream error` event emit, %s: %s",U,F,We.name,We.message),Ze()}),D.stream?(D.stream.pipe(Ne),D.stream.once("error",function(We){We.message+=' (stream "error")',Ae=We,u("Request#%d %s `readStream error` event emit, %s: %s",U,F,We.name,We.message),Ze()})):Ne.end(xe),Ne.requestId=U,Ne}}).call(this)}).call(this,i("_process"),i("buffer").Buffer)},{"@babel/runtime/helpers/interopRequireDefault":78,"@babel/runtime/helpers/typeof":79,_process:467,buffer:90,"core-js/modules/es.array.concat.js":272,"core-js/modules/es.function.name.js":284,"core-js/modules/es.object.to-string.js":291,"core-js/modules/es.promise.js":295,"core-js/modules/es.regexp.exec.js":300,"core-js/modules/es.string.split.js":307,"core-js/modules/es.string.trim.js":308,debug:465,http:468,https:355,"humanize-ms":356,url:472,util:419}]},{},[1])(1)})})(window)},81643:function(It,Ue,Q){"use strict";Q.d(Ue,{Z:function(){return he}});const he=fe=>fe?typeof fe=="function"?fe():fe:null},66330:function(It,Ue,Q){"use strict";Q.d(Ue,{t5:function(){return v}});var he=Q(94184),fe=Q.n(he),i=Q(92419),M=Q(67294),E=Q(53124),p=Q(81643),g=Q(20136),l=function(o,s){var u={};for(var m in o)Object.prototype.hasOwnProperty.call(o,m)&&s.indexOf(m)<0&&(u[m]=o[m]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var y=0,m=Object.getOwnPropertySymbols(o);y<m.length;y++)s.indexOf(m[y])<0&&Object.prototype.propertyIsEnumerable.call(o,m[y])&&(u[m[y]]=o[m[y]]);return u};const h=(o,s,u)=>{if(!(!s&&!u))return M.createElement(M.Fragment,null,s&&M.createElement("div",{className:`${o}-title`},(0,p.Z)(s)),M.createElement("div",{className:`${o}-inner-content`},(0,p.Z)(u)))},v=o=>{const{hashId:s,prefixCls:u,className:m,style:y,placement:_="top",title:x,content:S,children:w}=o;return M.createElement("div",{className:fe()(s,u,`${u}-pure`,`${u}-placement-${_}`,m),style:y},M.createElement("div",{className:`${u}-arrow`}),M.createElement(i.G,Object.assign({},o,{className:s,prefixCls:u}),w||h(u,x,S)))},d=o=>{const{prefixCls:s}=o,u=l(o,["prefixCls"]),{getPrefixCls:m}=M.useContext(E.E_),y=m("popover",s),[_,x]=(0,g.Z)(y);return _(M.createElement(v,Object.assign({},u,{prefixCls:y,hashId:x})))};Ue.ZP=d},20136:function(It,Ue,Q){"use strict";var he=Q(14747),fe=Q(50438),i=Q(97414),M=Q(8796),E=Q(67968),p=Q(45503);const g=v=>{const{componentCls:d,popoverColor:o,minWidth:s,fontWeightStrong:u,popoverPadding:m,boxShadowSecondary:y,colorTextHeading:_,borderRadiusLG:x,zIndexPopup:S,marginXS:w,colorBgElevated:A,popoverBg:H}=v;return[{[d]:Object.assign(Object.assign({},(0,he.Wf)(v)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:S,fontWeight:"normal",whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text",transformOrigin:"var(--arrow-x, 50%) var(--arrow-y, 50%)","--antd-arrow-background-color":A,"&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},[`${d}-content`]:{position:"relative"},[`${d}-inner`]:{backgroundColor:H,backgroundClip:"padding-box",borderRadius:x,boxShadow:y,padding:m},[`${d}-title`]:{minWidth:s,marginBottom:w,color:_,fontWeight:u},[`${d}-inner-content`]:{color:o}})},(0,i.ZP)(v,{colorBg:"var(--antd-arrow-background-color)"}),{[`${d}-pure`]:{position:"relative",maxWidth:"none",margin:v.sizePopupArrow,display:"inline-block",[`${d}-content`]:{display:"inline-block"}}}]},l=v=>{const{componentCls:d}=v;return{[d]:M.i.map(o=>{const s=v[`${o}6`];return{[`&${d}-${o}`]:{"--antd-arrow-background-color":s,[`${d}-inner`]:{backgroundColor:s},[`${d}-arrow`]:{background:"transparent"}}}})}},h=v=>{const{componentCls:d,lineWidth:o,lineType:s,colorSplit:u,paddingSM:m,controlHeight:y,fontSize:_,lineHeight:x,padding:S}=v,w=y-Math.round(_*x),A=w/2,H=w/2-o,R=S;return{[d]:{[`${d}-inner`]:{padding:0},[`${d}-title`]:{margin:0,padding:`${A}px ${R}px ${H}px`,borderBottom:`${o}px ${s} ${u}`},[`${d}-inner-content`]:{padding:`${m}px ${R}px`}}}};Ue.Z=(0,E.Z)("Popover",v=>{const{colorBgElevated:d,colorText:o,wireframe:s}=v,u=(0,p.TS)(v,{popoverPadding:12,popoverBg:d,popoverColor:o});return[g(u),l(u),s&&h(u),(0,fe._y)(u,"zoom-big")]},v=>({width:177,minWidth:177,zIndexPopup:v.zIndexPopupBase+30}),{resetStyle:!1,deprecatedTokens:[["width","minWidth"]]})},47897:function(It,Ue,Q){"use strict";Q.d(Ue,{Z:function(){return re}});var he=Q(3407),fe=Q(94184),i=Q.n(fe);function M(){return M=Object.assign?Object.assign.bind():function(q){for(var z=1;z<arguments.length;z++){var W=arguments[z];for(var V in W)Object.prototype.hasOwnProperty.call(W,V)&&(q[V]=W[V])}return q},M.apply(this,arguments)}function E(q){"@babel/helpers - typeof";return E=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(z){return typeof z}:function(z){return z&&typeof Symbol=="function"&&z.constructor===Symbol&&z!==Symbol.prototype?"symbol":typeof z},E(q)}function p(q,z){if(E(q)!=="object"||q===null)return q;var W=q[Symbol.toPrimitive];if(W!==void 0){var V=W.call(q,z||"default");if(E(V)!=="object")return V;throw new TypeError("@@toPrimitive must return a primitive value.")}return(z==="string"?String:Number)(q)}function g(q){var z=p(q,"string");return E(z)==="symbol"?z:String(z)}function l(q,z,W){return z=g(z),z in q?Object.defineProperty(q,z,{value:W,enumerable:!0,configurable:!0,writable:!0}):q[z]=W,q}function h(q){if(Array.isArray(q))return q}function v(q,z){var W=q==null?null:typeof Symbol!="undefined"&&q[Symbol.iterator]||q["@@iterator"];if(W!=null){var V,se,ge,Me,Fe=[],Re=!0,$e=!1;try{if(ge=(W=W.call(q)).next,z===0){if(Object(W)!==W)return;Re=!1}else for(;!(Re=(V=ge.call(W)).done)&&(Fe.push(V.value),Fe.length!==z);Re=!0);}catch(lt){$e=!0,se=lt}finally{try{if(!Re&&W.return!=null&&(Me=W.return(),Object(Me)!==Me))return}finally{if($e)throw se}}return Fe}}function d(q,z){(z==null||z>q.length)&&(z=q.length);for(var W=0,V=new Array(z);W<z;W++)V[W]=q[W];return V}function o(q,z){if(q){if(typeof q=="string")return d(q,z);var W=Object.prototype.toString.call(q).slice(8,-1);if(W==="Object"&&q.constructor&&(W=q.constructor.name),W==="Map"||W==="Set")return Array.from(q);if(W==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(W))return d(q,z)}}function s(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function u(q,z){return h(q)||v(q,z)||o(q,z)||s()}function m(q,z){if(q==null)return{};var W={},V=Object.keys(q),se,ge;for(ge=0;ge<V.length;ge++)se=V[ge],!(z.indexOf(se)>=0)&&(W[se]=q[se]);return W}function y(q,z){if(q==null)return{};var W=m(q,z),V,se;if(Object.getOwnPropertySymbols){var ge=Object.getOwnPropertySymbols(q);for(se=0;se<ge.length;se++)V=ge[se],!(z.indexOf(V)>=0)&&Object.prototype.propertyIsEnumerable.call(q,V)&&(W[V]=q[V])}return W}var _=Q(67294);function x(q){if(Array.isArray(q))return q}function S(q,z){var W=q==null?null:typeof Symbol!="undefined"&&q[Symbol.iterator]||q["@@iterator"];if(W!=null){var V,se,ge,Me,Fe=[],Re=!0,$e=!1;try{if(ge=(W=W.call(q)).next,z===0){if(Object(W)!==W)return;Re=!1}else for(;!(Re=(V=ge.call(W)).done)&&(Fe.push(V.value),Fe.length!==z);Re=!0);}catch(lt){$e=!0,se=lt}finally{try{if(!Re&&W.return!=null&&(Me=W.return(),Object(Me)!==Me))return}finally{if($e)throw se}}return Fe}}function w(q,z){(z==null||z>q.length)&&(z=q.length);for(var W=0,V=new Array(z);W<z;W++)V[W]=q[W];return V}function A(q,z){if(q){if(typeof q=="string")return w(q,z);var W=Object.prototype.toString.call(q).slice(8,-1);if(W==="Object"&&q.constructor&&(W=q.constructor.name),W==="Map"||W==="Set")return Array.from(q);if(W==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(W))return w(q,z)}}function H(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function R(q,z){return x(q)||S(q,z)||A(q,z)||H()}function F(q){var z=_.useRef();z.current=q;var W=_.useCallback(function(){for(var V,se=arguments.length,ge=new Array(se),Me=0;Me<se;Me++)ge[Me]=arguments[Me];return(V=z.current)===null||V===void 0?void 0:V.call.apply(V,[z].concat(ge))},[]);return W}function D(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var B=D()?_.useLayoutEffect:_.useEffect,P=function(z,W){var V=_.useRef(!0);B(function(){return z(V.current)},W),B(function(){return V.current=!1,function(){V.current=!0}},[])},U=function(z,W){P(function(V){if(!V)return z()},W)},G=null;function ee(q){var z=_.useRef(!1),W=_.useState(q),V=R(W,2),se=V[0],ge=V[1];_.useEffect(function(){return z.current=!1,function(){z.current=!0}},[]);function Me(Fe,Re){Re&&z.current||ge(Fe)}return[se,Me]}function K(q){return q!==void 0}function Z(q,z){var W=z||{},V=W.defaultValue,se=W.value,ge=W.onChange,Me=W.postState,Fe=ee(function(){return K(se)?se:K(V)?typeof V=="function"?V():V:typeof q=="function"?q():q}),Re=R(Fe,2),$e=Re[0],lt=Re[1],Ne=se!==void 0?se:$e,Ze=Me?Me(Ne):Ne,We=F(ge),nt=ee([Ne]),qe=R(nt,2),Qe=qe[0],ft=qe[1];U(function(){var bt=Qe[0];$e!==bt&&We($e,bt)},[Qe]),U(function(){K(se)||lt(se)},[se]);var vt=F(function(bt,Tt){lt(bt,Tt),ft([Ne],Tt)});return[Ze,vt]}var $={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(z){var W=z.keyCode;if(z.altKey&&!z.ctrlKey||z.metaKey||W>=$.F1&&W<=$.F12)return!1;switch(W){case $.ALT:case $.CAPS_LOCK:case $.CONTEXT_MENU:case $.CTRL:case $.DOWN:case $.END:case $.ESC:case $.HOME:case $.INSERT:case $.LEFT:case $.MAC_FF_META:case $.META:case $.NUMLOCK:case $.NUM_CENTER:case $.PAGE_DOWN:case $.PAGE_UP:case $.PAUSE:case $.PRINT_SCREEN:case $.RIGHT:case $.SHIFT:case $.UP:case $.WIN_KEY:case $.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(z){if(z>=$.ZERO&&z<=$.NINE||z>=$.NUM_ZERO&&z<=$.NUM_MULTIPLY||z>=$.A&&z<=$.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&z===0)return!0;switch(z){case $.SPACE:case $.QUESTION_MARK:case $.NUM_PLUS:case $.NUM_MINUS:case $.NUM_PERIOD:case $.NUM_DIVISION:case $.SEMICOLON:case $.DASH:case $.EQUALS:case $.COMMA:case $.PERIOD:case $.SLASH:case $.APOSTROPHE:case $.SINGLE_QUOTE:case $.OPEN_SQUARE_BRACKET:case $.BACKSLASH:case $.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},oe=$,ae=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],ye=_.forwardRef(function(q,z){var W,V=q.prefixCls,se=V===void 0?"rc-switch":V,ge=q.className,Me=q.checked,Fe=q.defaultChecked,Re=q.disabled,$e=q.loadingIcon,lt=q.checkedChildren,Ne=q.unCheckedChildren,Ze=q.onClick,We=q.onChange,nt=q.onKeyDown,qe=y(q,ae),Qe=Z(!1,{value:Me,defaultValue:Fe}),ft=u(Qe,2),vt=ft[0],bt=ft[1];function Tt(on,er){var In=vt;return Re||(In=on,bt(In),We==null||We(In,er)),In}function kr(on){on.which===oe.LEFT?Tt(!1,on):on.which===oe.RIGHT&&Tt(!0,on),nt==null||nt(on)}function jr(on){var er=Tt(!vt,on);Ze==null||Ze(er,on)}var xn=i()(se,ge,(W={},l(W,"".concat(se,"-checked"),vt),l(W,"".concat(se,"-disabled"),Re),W));return _.createElement("button",M({},qe,{type:"button",role:"switch","aria-checked":vt,disabled:Re,className:xn,ref:z,onKeyDown:kr,onClick:jr}),$e,_.createElement("span",{className:"".concat(se,"-inner")},_.createElement("span",{className:"".concat(se,"-inner-checked")},lt),_.createElement("span",{className:"".concat(se,"-inner-unchecked")},Ne)))});ye.displayName="Switch";var Y=ye,le=Q(45353),xe=Q(53124),Ce=Q(98866),we=Q(98675),Le=Q(84780),de=Q(14747),be=Q(67968),Te=Q(45503);const Ae=q=>{const{componentCls:z,trackHeightSM:W,trackPadding:V,trackMinWidthSM:se,innerMinMarginSM:ge,innerMaxMarginSM:Me,handleSizeSM:Fe}=q,Re=`${z}-inner`;return{[z]:{[`&${z}-small`]:{minWidth:se,height:W,lineHeight:`${W}px`,[`${z}-inner`]:{paddingInlineStart:Me,paddingInlineEnd:ge,[`${Re}-checked`]:{marginInlineStart:`calc(-100% + ${Fe+V*2}px - ${Me*2}px)`,marginInlineEnd:`calc(100% - ${Fe+V*2}px + ${Me*2}px)`},[`${Re}-unchecked`]:{marginTop:-W,marginInlineStart:0,marginInlineEnd:0}},[`${z}-handle`]:{width:Fe,height:Fe},[`${z}-loading-icon`]:{top:(Fe-q.switchLoadingIconSize)/2,fontSize:q.switchLoadingIconSize},[`&${z}-checked`]:{[`${z}-inner`]:{paddingInlineStart:ge,paddingInlineEnd:Me,[`${Re}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${Re}-unchecked`]:{marginInlineStart:`calc(100% - ${Fe+V*2}px + ${Me*2}px)`,marginInlineEnd:`calc(-100% + ${Fe+V*2}px - ${Me*2}px)`}},[`${z}-handle`]:{insetInlineStart:`calc(100% - ${Fe+V}px)`}},[`&:not(${z}-disabled):active`]:{[`&:not(${z}-checked) ${Re}`]:{[`${Re}-unchecked`]:{marginInlineStart:q.marginXXS/2,marginInlineEnd:-q.marginXXS/2}},[`&${z}-checked ${Re}`]:{[`${Re}-checked`]:{marginInlineStart:-q.marginXXS/2,marginInlineEnd:q.marginXXS/2}}}}}}},Be=q=>{const{componentCls:z,handleSize:W}=q;return{[z]:{[`${z}-loading-icon${q.iconCls}`]:{position:"relative",top:(W-q.fontSize)/2,color:q.switchLoadingIconColor,verticalAlign:"top"},[`&${z}-checked ${z}-loading-icon`]:{color:q.switchColor}}}},Pe=q=>{const{componentCls:z,motion:W,trackPadding:V,handleBg:se,handleShadow:ge,handleSize:Me}=q,Fe=`${z}-handle`;return{[z]:{[Fe]:{position:"absolute",top:V,insetInlineStart:V,width:Me,height:Me,transition:`all ${q.switchDuration} ease-in-out`,"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:se,borderRadius:Me/2,boxShadow:ge,transition:`all ${q.switchDuration} ease-in-out`,content:'""'}},[`&${z}-checked ${Fe}`]:{insetInlineStart:`calc(100% - ${Me+V}px)`},[`&:not(${z}-disabled):active`]:W?{[`${Fe}::before`]:{insetInlineEnd:q.switchHandleActiveInset,insetInlineStart:0},[`&${z}-checked ${Fe}::before`]:{insetInlineEnd:0,insetInlineStart:q.switchHandleActiveInset}}:{}}}},_e=q=>{const{componentCls:z,trackHeight:W,trackPadding:V,innerMinMargin:se,innerMaxMargin:ge,handleSize:Me}=q,Fe=`${z}-inner`;return{[z]:{[Fe]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:ge,paddingInlineEnd:se,transition:`padding-inline-start ${q.switchDuration} ease-in-out, padding-inline-end ${q.switchDuration} ease-in-out`,[`${Fe}-checked, ${Fe}-unchecked`]:{display:"block",color:q.colorTextLightSolid,fontSize:q.fontSizeSM,transition:`margin-inline-start ${q.switchDuration} ease-in-out, margin-inline-end ${q.switchDuration} ease-in-out`,pointerEvents:"none"},[`${Fe}-checked`]:{marginInlineStart:`calc(-100% + ${Me+V*2}px - ${ge*2}px)`,marginInlineEnd:`calc(100% - ${Me+V*2}px + ${ge*2}px)`},[`${Fe}-unchecked`]:{marginTop:-W,marginInlineStart:0,marginInlineEnd:0}},[`&${z}-checked ${Fe}`]:{paddingInlineStart:se,paddingInlineEnd:ge,[`${Fe}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${Fe}-unchecked`]:{marginInlineStart:`calc(100% - ${Me+V*2}px + ${ge*2}px)`,marginInlineEnd:`calc(-100% + ${Me+V*2}px - ${ge*2}px)`}},[`&:not(${z}-disabled):active`]:{[`&:not(${z}-checked) ${Fe}`]:{[`${Fe}-unchecked`]:{marginInlineStart:V*2,marginInlineEnd:-V*2}},[`&${z}-checked ${Fe}`]:{[`${Fe}-checked`]:{marginInlineStart:-V*2,marginInlineEnd:V*2}}}}}},ne=q=>{const{componentCls:z,trackHeight:W,trackMinWidth:V}=q;return{[z]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,de.Wf)(q)),{position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:V,height:W,lineHeight:`${W}px`,verticalAlign:"middle",background:q.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:`all ${q.motionDurationMid}`,userSelect:"none",[`&:hover:not(${z}-disabled)`]:{background:q.colorTextTertiary}}),(0,de.Qy)(q)),{[`&${z}-checked`]:{background:q.switchColor,[`&:hover:not(${z}-disabled)`]:{background:q.colorPrimaryHover}},[`&${z}-loading, &${z}-disabled`]:{cursor:"not-allowed",opacity:q.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},[`&${z}-rtl`]:{direction:"rtl"}})}};var te=(0,be.Z)("Switch",q=>{const z=(0,Te.TS)(q,{switchDuration:q.motionDurationMid,switchColor:q.colorPrimary,switchDisabledOpacity:q.opacityLoading,switchLoadingIconSize:q.fontSizeIcon*.75,switchLoadingIconColor:`rgba(0, 0, 0, ${q.opacityLoading})`,switchHandleActiveInset:"-30%"});return[ne(z),_e(z),Pe(z),Be(z),Ae(z)]},q=>{const{fontSize:z,lineHeight:W,controlHeight:V,colorWhite:se}=q,ge=z*W,Me=V/2,Fe=2,Re=ge-Fe*2,$e=Me-Fe*2;return{trackHeight:ge,trackHeightSM:Me,trackMinWidth:Re*2+Fe*4,trackMinWidthSM:$e*2+Fe*2,trackPadding:Fe,handleBg:se,handleSize:Re,handleSizeSM:$e,handleShadow:`0 2px 4px 0 ${new Le.C("#00230b").setAlpha(.2).toRgbString()}`,innerMinMargin:Re/2,innerMaxMargin:Re+Fe+Fe*2,innerMinMarginSM:$e/2,innerMaxMarginSM:$e+Fe+Fe*2}}),T=function(q,z){var W={};for(var V in q)Object.prototype.hasOwnProperty.call(q,V)&&z.indexOf(V)<0&&(W[V]=q[V]);if(q!=null&&typeof Object.getOwnPropertySymbols=="function")for(var se=0,V=Object.getOwnPropertySymbols(q);se<V.length;se++)z.indexOf(V[se])<0&&Object.prototype.propertyIsEnumerable.call(q,V[se])&&(W[V[se]]=q[V[se]]);return W};const I=_.forwardRef((q,z)=>{const{prefixCls:W,size:V,disabled:se,loading:ge,className:Me,rootClassName:Fe,style:Re}=q,$e=T(q,["prefixCls","size","disabled","loading","className","rootClassName","style"]),{getPrefixCls:lt,direction:Ne,switch:Ze}=_.useContext(xe.E_),We=_.useContext(Ce.Z),nt=(se!=null?se:We)||ge,qe=lt("switch",W),Qe=_.createElement("div",{className:`${qe}-handle`},ge&&_.createElement(he.Z,{className:`${qe}-loading-icon`})),[ft,vt]=te(qe),bt=(0,we.Z)(V),Tt=i()(Ze==null?void 0:Ze.className,{[`${qe}-small`]:bt==="small",[`${qe}-loading`]:ge,[`${qe}-rtl`]:Ne==="rtl"},Me,Fe,vt),kr=Object.assign(Object.assign({},Ze==null?void 0:Ze.style),Re);return ft(_.createElement(le.Z,{component:"Switch"},_.createElement(Y,Object.assign({},$e,{prefixCls:qe,className:Tt,style:kr,disabled:nt,ref:z,loadingIcon:Qe}))))});I.__ANT_SWITCH=!0;var re=I},66368:function(It,Ue,Q){"use strict";Q.d(Ue,{default:function(){return Yi}});var he=Q(73475),fe=Q(25877),i=Q(38308),M=Q(94184),E=Q.n(M),p=Q(87462),g=Q(4942),l=Q(1413),h=Q(97685),v=Q(71002),d=Q(45987),o=Q(67294),s=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Se=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Se)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Se==null?void 0:Se.substr(0,4))};function u(Se){var Oe=o.useRef();Oe.current=Se;var Ge=o.useCallback(function(){for(var Ye,tt=arguments.length,it=new Array(tt),_t=0;_t<tt;_t++)it[_t]=arguments[_t];return(Ye=Oe.current)===null||Ye===void 0?void 0:Ye.call.apply(Ye,[Oe].concat(it))},[]);return Ge}function m(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var y=m()?o.useLayoutEffect:o.useEffect,_=function(Oe,Ge){var Ye=o.useRef(!0);y(function(){return Oe(Ye.current)},Ge),y(function(){return Ye.current=!1,function(){Ye.current=!0}},[])},x=function(Oe,Ge){_(function(Ye){if(!Ye)return Oe()},Ge)},S=null;function w(Se){var Oe=o.useRef(!1),Ge=o.useState(Se),Ye=(0,h.Z)(Ge,2),tt=Ye[0],it=Ye[1];o.useEffect(function(){return Oe.current=!1,function(){Oe.current=!0}},[]);function _t(Pt,Ut){Ut&&Oe.current||it(Pt)}return[tt,_t]}function A(Se){return Se!==void 0}function H(Se,Oe){var Ge=Oe||{},Ye=Ge.defaultValue,tt=Ge.value,it=Ge.onChange,_t=Ge.postState,Pt=w(function(){return A(tt)?tt:A(Ye)?typeof Ye=="function"?Ye():Ye:typeof Se=="function"?Se():Se}),Ut=(0,h.Z)(Pt,2),Ft=Ut[0],nr=Ut[1],jt=tt!==void 0?tt:Ft,Vt=_t?_t(jt):jt,or=u(it),pr=w([jt]),Mr=(0,h.Z)(pr,2),Vr=Mr[0],zr=Mr[1];x(function(){var wr=Vr[0];Ft!==wr&&or(Ft,wr)},[Vr]),x(function(){A(tt)||nr(tt)},[tt]);var Or=u(function(wr,cn){nr(wr,cn),zr([jt],cn)});return[Vt,Or]}var R=Q(62874),F=(0,o.createContext)(null),D=o.forwardRef(function(Se,Oe){var Ge=Se.prefixCls,Ye=Se.className,tt=Se.style,it=Se.id,_t=Se.active,Pt=Se.tabKey,Ut=Se.children;return o.createElement("div",{id:it&&"".concat(it,"-panel-").concat(Pt),role:"tabpanel",tabIndex:_t?0:-1,"aria-labelledby":it&&"".concat(it,"-tab-").concat(Pt),"aria-hidden":!_t,style:tt,className:E()(Ge,_t&&"".concat(Ge,"-active"),Ye),ref:Oe},Ut)}),B=D,P=["key","forceRender","style","className"];function U(Se){var Oe=Se.id,Ge=Se.activeKey,Ye=Se.animated,tt=Se.tabPosition,it=Se.destroyInactiveTabPane,_t=o.useContext(F),Pt=_t.prefixCls,Ut=_t.tabs,Ft=Ye.tabPane,nr="".concat(Pt,"-tabpane");return o.createElement("div",{className:E()("".concat(Pt,"-content-holder"))},o.createElement("div",{className:E()("".concat(Pt,"-content"),"".concat(Pt,"-content-").concat(tt),(0,g.Z)({},"".concat(Pt,"-content-animated"),Ft))},Ut.map(function(jt){var Vt=jt.key,or=jt.forceRender,pr=jt.style,Mr=jt.className,Vr=(0,d.Z)(jt,P),zr=Vt===Ge;return o.createElement(R.Z,(0,p.Z)({key:Vt,visible:zr,forceRender:or,removeOnLeave:!!it,leavedClassName:"".concat(nr,"-hidden")},Ye.tabPaneMotion),function(Or,wr){var cn=Or.style,Br=Or.className;return o.createElement(B,(0,p.Z)({},Vr,{prefixCls:nr,id:Oe,tabKey:Vt,animated:Ft,active:zr,style:(0,l.Z)((0,l.Z)({},pr),cn),className:E()(Mr,Br),ref:wr}))})})))}var G=Q(74902),ee=Q(48555),K=Q(59864);function Z(Se,Oe,Ge){var Ye=o.useRef({});return(!("value"in Ye.current)||Ge(Ye.current.condition,Oe))&&(Ye.current.value=Se(),Ye.current.condition=Oe),Ye.current.value}function $(Se,Oe){typeof Se=="function"?Se(Oe):(0,v.Z)(Se)==="object"&&Se&&"current"in Se&&(Se.current=Oe)}function oe(){for(var Se=arguments.length,Oe=new Array(Se),Ge=0;Ge<Se;Ge++)Oe[Ge]=arguments[Ge];var Ye=Oe.filter(function(tt){return tt});return Ye.length<=1?Ye[0]:function(tt){Oe.forEach(function(it){$(it,tt)})}}function ae(){for(var Se=arguments.length,Oe=new Array(Se),Ge=0;Ge<Se;Ge++)Oe[Ge]=arguments[Ge];return Z(function(){return oe.apply(void 0,Oe)},Oe,function(Ye,tt){return Ye.length===tt.length&&Ye.every(function(it,_t){return it===tt[_t]})})}function ye(Se){var Oe,Ge,Ye=isMemo(Se)?Se.type.type:Se.type;return!(typeof Ye=="function"&&!((Oe=Ye.prototype)!==null&&Oe!==void 0&&Oe.render)||typeof Se=="function"&&!((Ge=Se.prototype)!==null&&Ge!==void 0&&Ge.render))}var Y={width:0,height:0,left:0,top:0};function le(Se,Oe,Ge){return(0,o.useMemo)(function(){for(var Ye,tt=new Map,it=Oe.get((Ye=Se[0])===null||Ye===void 0?void 0:Ye.key)||Y,_t=it.left+it.width,Pt=0;Pt<Se.length;Pt+=1){var Ut=Se[Pt].key,Ft=Oe.get(Ut);if(!Ft){var nr;Ft=Oe.get((nr=Se[Pt-1])===null||nr===void 0?void 0:nr.key)||Y}var jt=tt.get(Ut)||(0,l.Z)({},Ft);jt.right=_t-jt.left-jt.width,tt.set(Ut,jt)}return tt},[Se.map(function(Ye){return Ye.key}).join("_"),Oe,Ge])}function xe(Se,Oe){var Ge=o.useRef(Se),Ye=o.useState({}),tt=(0,h.Z)(Ye,2),it=tt[1];function _t(Pt){var Ut=typeof Pt=="function"?Pt(Ge.current):Pt;Ut!==Ge.current&&Oe(Ut,Ge.current),Ge.current=Ut,it({})}return[Ge.current,_t]}var Ce=.1,we=.01,Le=20,de=Math.pow(.995,Le);function be(Se,Oe){var Ge=(0,o.useState)(),Ye=(0,h.Z)(Ge,2),tt=Ye[0],it=Ye[1],_t=(0,o.useState)(0),Pt=(0,h.Z)(_t,2),Ut=Pt[0],Ft=Pt[1],nr=(0,o.useState)(0),jt=(0,h.Z)(nr,2),Vt=jt[0],or=jt[1],pr=(0,o.useState)(),Mr=(0,h.Z)(pr,2),Vr=Mr[0],zr=Mr[1],Or=(0,o.useRef)();function wr(yr){var Ur=yr.touches[0],Kr=Ur.screenX,ir=Ur.screenY;it({x:Kr,y:ir}),window.clearInterval(Or.current)}function cn(yr){if(tt){yr.preventDefault();var Ur=yr.touches[0],Kr=Ur.screenX,ir=Ur.screenY;it({x:Kr,y:ir});var Lr=Kr-tt.x,cr=ir-tt.y;Oe(Lr,cr);var Yr=Date.now();Ft(Yr),or(Yr-Ut),zr({x:Lr,y:cr})}}function Br(){if(tt&&(it(null),zr(null),Vr)){var yr=Vr.x/Vt,Ur=Vr.y/Vt,Kr=Math.abs(yr),ir=Math.abs(Ur);if(Math.max(Kr,ir)<Ce)return;var Lr=yr,cr=Ur;Or.current=window.setInterval(function(){if(Math.abs(Lr)<we&&Math.abs(cr)<we){window.clearInterval(Or.current);return}Lr*=de,cr*=de,Oe(Lr*Le,cr*Le)},Le)}}var Ar=(0,o.useRef)();function Xr(yr){var Ur=yr.deltaX,Kr=yr.deltaY,ir=0,Lr=Math.abs(Ur),cr=Math.abs(Kr);Lr===cr?ir=Ar.current==="x"?Ur:Kr:Lr>cr?(ir=Ur,Ar.current="x"):(ir=Kr,Ar.current="y"),Oe(-ir,-ir)&&yr.preventDefault()}var Hr=(0,o.useRef)(null);Hr.current={onTouchStart:wr,onTouchMove:cn,onTouchEnd:Br,onWheel:Xr},o.useEffect(function(){function yr(Lr){Hr.current.onTouchStart(Lr)}function Ur(Lr){Hr.current.onTouchMove(Lr)}function Kr(Lr){Hr.current.onTouchEnd(Lr)}function ir(Lr){Hr.current.onWheel(Lr)}return document.addEventListener("touchmove",Ur,{passive:!1}),document.addEventListener("touchend",Kr,{passive:!1}),Se.current.addEventListener("touchstart",yr,{passive:!1}),Se.current.addEventListener("wheel",ir),function(){document.removeEventListener("touchmove",Ur),document.removeEventListener("touchend",Kr)}},[])}function Te(Se){var Oe=(0,o.useState)(0),Ge=(0,h.Z)(Oe,2),Ye=Ge[0],tt=Ge[1],it=(0,o.useRef)(0),_t=(0,o.useRef)();return _t.current=Se,x(function(){var Pt;(Pt=_t.current)===null||Pt===void 0||Pt.call(_t)},[Ye]),function(){it.current===Ye&&(it.current+=1,tt(it.current))}}function Ae(Se){var Oe=(0,o.useRef)([]),Ge=(0,o.useState)({}),Ye=(0,h.Z)(Ge,2),tt=Ye[1],it=(0,o.useRef)(typeof Se=="function"?Se():Se),_t=Te(function(){var Ut=it.current;Oe.current.forEach(function(Ft){Ut=Ft(Ut)}),Oe.current=[],it.current=Ut,tt({})});function Pt(Ut){Oe.current.push(Ut),_t()}return[it.current,Pt]}var Be={width:0,height:0,left:0,top:0,right:0};function Pe(Se,Oe,Ge,Ye,tt,it,_t){var Pt=_t.tabs,Ut=_t.tabPosition,Ft=_t.rtl,nr,jt,Vt;return["top","bottom"].includes(Ut)?(nr="width",jt=Ft?"right":"left",Vt=Math.abs(Ge)):(nr="height",jt="top",Vt=-Ge),(0,o.useMemo)(function(){if(!Pt.length)return[0,0];for(var or=Pt.length,pr=or,Mr=0;Mr<or;Mr+=1){var Vr=Se.get(Pt[Mr].key)||Be;if(Vr[jt]+Vr[nr]>Vt+Oe){pr=Mr-1;break}}for(var zr=0,Or=or-1;Or>=0;Or-=1){var wr=Se.get(Pt[Or].key)||Be;if(wr[jt]<Vt){zr=Or+1;break}}return zr>=pr?[0,0]:[zr,pr]},[Se,Oe,Ye,tt,it,Vt,Ut,Pt.map(function(or){return or.key}).join("_"),Ft])}function _e(Se){var Oe;return Se instanceof Map?(Oe={},Se.forEach(function(Ge,Ye){Oe[Ye]=Ge})):Oe=Se,JSON.stringify(Oe)}var ne="TABS_DQ";function te(Se){return String(Se).replace(/"/g,ne)}function T(Se,Oe,Ge,Ye){return!(!Ge||Ye||Se===!1||Se===void 0&&(Oe===!1||Oe===null))}function I(Se,Oe){var Ge=Se.prefixCls,Ye=Se.editable,tt=Se.locale,it=Se.style;return!Ye||Ye.showAdd===!1?null:o.createElement("button",{ref:Oe,type:"button",className:"".concat(Ge,"-nav-add"),style:it,"aria-label":(tt==null?void 0:tt.addAriaLabel)||"Add tab",onClick:function(Pt){Ye.onEdit("add",{event:Pt})}},Ye.addIcon||"+")}var re=o.forwardRef(I),q=o.forwardRef(function(Se,Oe){var Ge=Se.position,Ye=Se.prefixCls,tt=Se.extra;if(!tt)return null;var it,_t={};return(0,v.Z)(tt)==="object"&&!o.isValidElement(tt)?_t=tt:_t.right=tt,Ge==="right"&&(it=_t.right),Ge==="left"&&(it=_t.left),it?o.createElement("div",{className:"".concat(Ye,"-extra-content"),ref:Oe},it):null}),z=q,W=Q(62709);function V(Se,Oe,Ge){var Ye=React.useRef({});return(!("value"in Ye.current)||Ge(Ye.current.condition,Oe))&&(Ye.current.value=Se(),Ye.current.condition=Oe),Ye.current.value}function se(Se,Oe){typeof Se=="function"?Se(Oe):(0,v.Z)(Se)==="object"&&Se&&"current"in Se&&(Se.current=Oe)}function ge(){for(var Se=arguments.length,Oe=new Array(Se),Ge=0;Ge<Se;Ge++)Oe[Ge]=arguments[Ge];var Ye=Oe.filter(function(tt){return tt});return Ye.length<=1?Ye[0]:function(tt){Oe.forEach(function(it){se(it,tt)})}}function Me(){for(var Se=arguments.length,Oe=new Array(Se),Ge=0;Ge<Se;Ge++)Oe[Ge]=arguments[Ge];return useMemo(function(){return ge.apply(void 0,Oe)},Oe,function(Ye,tt){return Ye.length===tt.length&&Ye.every(function(it,_t){return it===tt[_t]})})}function Fe(Se){var Oe,Ge,Ye=(0,K.isMemo)(Se)?Se.type.type:Se.type;return!(typeof Ye=="function"&&!((Oe=Ye.prototype)!==null&&Oe!==void 0&&Oe.render)||typeof Se=="function"&&!((Ge=Se.prototype)!==null&&Ge!==void 0&&Ge.render))}var Re={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(Oe){var Ge=Oe.keyCode;if(Oe.altKey&&!Oe.ctrlKey||Oe.metaKey||Ge>=Re.F1&&Ge<=Re.F12)return!1;switch(Ge){case Re.ALT:case Re.CAPS_LOCK:case Re.CONTEXT_MENU:case Re.CTRL:case Re.DOWN:case Re.END:case Re.ESC:case Re.HOME:case Re.INSERT:case Re.LEFT:case Re.MAC_FF_META:case Re.META:case Re.NUMLOCK:case Re.NUM_CENTER:case Re.PAGE_DOWN:case Re.PAGE_UP:case Re.PAUSE:case Re.PRINT_SCREEN:case Re.RIGHT:case Re.SHIFT:case Re.UP:case Re.WIN_KEY:case Re.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(Oe){if(Oe>=Re.ZERO&&Oe<=Re.NINE||Oe>=Re.NUM_ZERO&&Oe<=Re.NUM_MULTIPLY||Oe>=Re.A&&Oe<=Re.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&Oe===0)return!0;switch(Oe){case Re.SPACE:case Re.QUESTION_MARK:case Re.NUM_PLUS:case Re.NUM_MINUS:case Re.NUM_PERIOD:case Re.NUM_DIVISION:case Re.SEMICOLON:case Re.DASH:case Re.EQUALS:case Re.COMMA:case Re.PERIOD:case Re.SLASH:case Re.APOSTROPHE:case Re.SINGLE_QUOTE:case Re.OPEN_SQUARE_BRACKET:case Re.BACKSLASH:case Re.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},$e=Re,lt=function(Oe){return+setTimeout(Oe,16)},Ne=function(Oe){return clearTimeout(Oe)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(lt=function(Oe){return window.requestAnimationFrame(Oe)},Ne=function(Oe){return window.cancelAnimationFrame(Oe)});var Ze=0,We=new Map;function nt(Se){We.delete(Se)}var qe=function(Oe){var Ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Ze+=1;var Ye=Ze;function tt(it){if(it===0)nt(Ye),Oe();else{var _t=lt(function(){tt(it-1)});We.set(Ye,_t)}}return tt(Ge),Ye};qe.cancel=function(Se){var Oe=We.get(Se);return nt(Oe),Ne(Oe)};var Qe=qe,ft=$e.ESC,vt=$e.TAB;function bt(Se){var Oe=Se.visible,Ge=Se.triggerRef,Ye=Se.onVisibleChange,tt=Se.autoFocus,it=Se.overlayRef,_t=o.useRef(!1),Pt=function(){if(Oe){var jt,Vt;(jt=Ge.current)===null||jt===void 0||(Vt=jt.focus)===null||Vt===void 0||Vt.call(jt),Ye==null||Ye(!1)}},Ut=function(){var jt;return(jt=it.current)!==null&&jt!==void 0&&jt.focus?(it.current.focus(),_t.current=!0,!0):!1},Ft=function(jt){switch(jt.keyCode){case ft:Pt();break;case vt:{var Vt=!1;_t.current||(Vt=Ut()),Vt?jt.preventDefault():Pt();break}}};o.useEffect(function(){return Oe?(window.addEventListener("keydown",Ft),tt&&Qe(Ut,3),function(){window.removeEventListener("keydown",Ft),_t.current=!1}):function(){_t.current=!1}},[Oe])}var Tt=(0,o.forwardRef)(function(Se,Oe){var Ge=Se.overlay,Ye=Se.arrow,tt=Se.prefixCls,it=(0,o.useMemo)(function(){var Pt;return typeof Ge=="function"?Pt=Ge():Pt=Ge,Pt},[Ge]),_t=ge(Oe,it==null?void 0:it.ref);return o.createElement(o.Fragment,null,Ye&&o.createElement("div",{className:"".concat(tt,"-arrow")}),o.cloneElement(it,{ref:Fe(it)?_t:void 0}))}),kr=Tt,jr={adjustX:1,adjustY:1},xn=[0,0],on={topLeft:{points:["bl","tl"],overflow:jr,offset:[0,-4],targetOffset:xn},top:{points:["bc","tc"],overflow:jr,offset:[0,-4],targetOffset:xn},topRight:{points:["br","tr"],overflow:jr,offset:[0,-4],targetOffset:xn},bottomLeft:{points:["tl","bl"],overflow:jr,offset:[0,4],targetOffset:xn},bottom:{points:["tc","bc"],overflow:jr,offset:[0,4],targetOffset:xn},bottomRight:{points:["tr","br"],overflow:jr,offset:[0,4],targetOffset:xn}},er=on,In=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function ji(Se,Oe){var Ge,Ye=Se.arrow,tt=Ye===void 0?!1:Ye,it=Se.prefixCls,_t=it===void 0?"rc-dropdown":it,Pt=Se.transitionName,Ut=Se.animation,Ft=Se.align,nr=Se.placement,jt=nr===void 0?"bottomLeft":nr,Vt=Se.placements,or=Vt===void 0?er:Vt,pr=Se.getPopupContainer,Mr=Se.showAction,Vr=Se.hideAction,zr=Se.overlayClassName,Or=Se.overlayStyle,wr=Se.visible,cn=Se.trigger,Br=cn===void 0?["hover"]:cn,Ar=Se.autoFocus,Xr=Se.overlay,Hr=Se.children,yr=Se.onVisibleChange,Ur=(0,d.Z)(Se,In),Kr=o.useState(),ir=(0,h.Z)(Kr,2),Lr=ir[0],cr=ir[1],Yr="visible"in Se?wr:Lr,ui=o.useRef(null),Ai=o.useRef(null),$n=o.useRef(null);o.useImperativeHandle(Oe,function(){return ui.current});var Cr=function(pn){cr(pn),yr==null||yr(pn)};bt({visible:Yr,triggerRef:$n,onVisibleChange:Cr,autoFocus:Ar,overlayRef:Ai});var Li=function(pn){var Ji=Se.onOverlayClick;cr(!1),Ji&&Ji(pn)},Zi=function(){return o.createElement(kr,{ref:Ai,overlay:Xr,prefixCls:_t,arrow:tt})},xr=function(){return typeof Xr=="function"?Zi:Zi()},un=function(){var pn=Se.minOverlayWidthMatchTrigger,Ji=Se.alignPoint;return"minOverlayWidthMatchTrigger"in Se?pn:!Ji},Gn=function(){var pn=Se.openClassName;return pn!==void 0?pn:"".concat(_t,"-open")},Vn=o.cloneElement(Hr,{className:E()((Ge=Hr.props)===null||Ge===void 0?void 0:Ge.className,Yr&&Gn()),ref:Fe(Hr)?ge($n,Hr.ref):void 0}),tn=Vr;return!tn&&Br.indexOf("contextMenu")!==-1&&(tn=["click"]),o.createElement(W.Z,(0,p.Z)({builtinPlacements:or},Ur,{prefixCls:_t,ref:ui,popupClassName:E()(zr,(0,g.Z)({},"".concat(_t,"-show-arrow"),tt)),popupStyle:Or,action:Br,showAction:Mr,hideAction:tn,popupPlacement:jt,popupAlign:Ft,popupTransitionName:Pt,popupAnimation:Ut,popupVisible:Yr,stretch:un()?"minWidth":"",popup:xr(),onPopupVisibleChange:Cr,onPopupClick:Li,getPopupContainer:pr}),Vn)}var Gi=o.forwardRef(ji),Bo=Gi,Sn=Q(78595),Kt={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(Oe){var Ge=Oe.keyCode;if(Oe.altKey&&!Oe.ctrlKey||Oe.metaKey||Ge>=Kt.F1&&Ge<=Kt.F12)return!1;switch(Ge){case Kt.ALT:case Kt.CAPS_LOCK:case Kt.CONTEXT_MENU:case Kt.CTRL:case Kt.DOWN:case Kt.END:case Kt.ESC:case Kt.HOME:case Kt.INSERT:case Kt.LEFT:case Kt.MAC_FF_META:case Kt.META:case Kt.NUMLOCK:case Kt.NUM_CENTER:case Kt.PAGE_DOWN:case Kt.PAGE_UP:case Kt.PAUSE:case Kt.PRINT_SCREEN:case Kt.RIGHT:case Kt.SHIFT:case Kt.UP:case Kt.WIN_KEY:case Kt.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(Oe){if(Oe>=Kt.ZERO&&Oe<=Kt.NINE||Oe>=Kt.NUM_ZERO&&Oe<=Kt.NUM_MULTIPLY||Oe>=Kt.A&&Oe<=Kt.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&Oe===0)return!0;switch(Oe){case Kt.SPACE:case Kt.QUESTION_MARK:case Kt.NUM_PLUS:case Kt.NUM_MINUS:case Kt.NUM_PERIOD:case Kt.NUM_DIVISION:case Kt.SEMICOLON:case Kt.DASH:case Kt.EQUALS:case Kt.COMMA:case Kt.PERIOD:case Kt.SLASH:case Kt.APOSTROPHE:case Kt.SINGLE_QUOTE:case Kt.OPEN_SQUARE_BRACKET:case Kt.BACKSLASH:case Kt.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},dt=Kt;function st(Se,Oe){var Ge=Se.prefixCls,Ye=Se.id,tt=Se.tabs,it=Se.locale,_t=Se.mobile,Pt=Se.moreIcon,Ut=Pt===void 0?"More":Pt,Ft=Se.moreTransitionName,nr=Se.style,jt=Se.className,Vt=Se.editable,or=Se.tabBarGutter,pr=Se.rtl,Mr=Se.removeAriaLabel,Vr=Se.onTabClick,zr=Se.getPopupContainer,Or=Se.popupClassName,wr=(0,o.useState)(!1),cn=(0,h.Z)(wr,2),Br=cn[0],Ar=cn[1],Xr=(0,o.useState)(null),Hr=(0,h.Z)(Xr,2),yr=Hr[0],Ur=Hr[1],Kr="".concat(Ye,"-more-popup"),ir="".concat(Ge,"-dropdown"),Lr=yr!==null?"".concat(Kr,"-").concat(yr):null,cr=it==null?void 0:it.dropdownAriaLabel;function Yr(xr,un){xr.preventDefault(),xr.stopPropagation(),Vt.onEdit("remove",{key:un,event:xr})}var ui=o.createElement(Sn.ZP,{onClick:function(un){var Gn=un.key,Vn=un.domEvent;Vr(Gn,Vn),Ar(!1)},prefixCls:"".concat(ir,"-menu"),id:Kr,tabIndex:-1,role:"listbox","aria-activedescendant":Lr,selectedKeys:[yr],"aria-label":cr!==void 0?cr:"expanded dropdown"},tt.map(function(xr){var un=xr.closable,Gn=xr.disabled,Vn=xr.closeIcon,tn=xr.key,jn=xr.label,pn=T(un,Vn,Vt,Gn);return o.createElement(Sn.sN,{key:tn,id:"".concat(Kr,"-").concat(tn),role:"option","aria-controls":Ye&&"".concat(Ye,"-panel-").concat(tn),disabled:Gn},o.createElement("span",null,jn),pn&&o.createElement("button",{type:"button","aria-label":Mr||"remove",tabIndex:0,className:"".concat(ir,"-menu-item-remove"),onClick:function(qi){qi.stopPropagation(),Yr(qi,tn)}},Vn||Vt.removeIcon||"\xD7"))}));function Ai(xr){for(var un=tt.filter(function(pn){return!pn.disabled}),Gn=un.findIndex(function(pn){return pn.key===yr})||0,Vn=un.length,tn=0;tn<Vn;tn+=1){Gn=(Gn+xr+Vn)%Vn;var jn=un[Gn];if(!jn.disabled){Ur(jn.key);return}}}function $n(xr){var un=xr.which;if(!Br){[dt.DOWN,dt.SPACE,dt.ENTER].includes(un)&&(Ar(!0),xr.preventDefault());return}switch(un){case dt.UP:Ai(-1),xr.preventDefault();break;case dt.DOWN:Ai(1),xr.preventDefault();break;case dt.ESC:Ar(!1);break;case dt.SPACE:case dt.ENTER:yr!==null&&Vr(yr,xr);break}}(0,o.useEffect)(function(){var xr=document.getElementById(Lr);xr&&xr.scrollIntoView&&xr.scrollIntoView(!1)},[yr]),(0,o.useEffect)(function(){Br||Ur(null)},[Br]);var Cr=(0,g.Z)({},pr?"marginRight":"marginLeft",or);tt.length||(Cr.visibility="hidden",Cr.order=1);var Li=E()((0,g.Z)({},"".concat(ir,"-rtl"),pr)),Zi=_t?null:o.createElement(Bo,{prefixCls:ir,overlay:ui,trigger:["hover"],visible:tt.length?Br:!1,transitionName:Ft,onVisibleChange:Ar,overlayClassName:E()(Li,Or),mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:zr},o.createElement("button",{type:"button",className:"".concat(Ge,"-nav-more"),style:Cr,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":Kr,id:"".concat(Ye,"-more"),"aria-expanded":Br,onKeyDown:$n},Ut));return o.createElement("div",{className:E()("".concat(Ge,"-nav-operations"),jt),style:nr,ref:Oe},Zi,o.createElement(re,{prefixCls:Ge,locale:it,editable:Vt}))}var Et=o.memo(o.forwardRef(st),function(Se,Oe){return Oe.tabMoving});function Mt(Se){var Oe,Ge=Se.prefixCls,Ye=Se.id,tt=Se.active,it=Se.tab,_t=it.key,Pt=it.label,Ut=it.disabled,Ft=it.closeIcon,nr=Se.closable,jt=Se.renderWrapper,Vt=Se.removeAriaLabel,or=Se.editable,pr=Se.onClick,Mr=Se.onFocus,Vr=Se.style,zr="".concat(Ge,"-tab"),Or=T(nr,Ft,or,Ut);function wr(Ar){Ut||pr(Ar)}function cn(Ar){Ar.preventDefault(),Ar.stopPropagation(),or.onEdit("remove",{key:_t,event:Ar})}var Br=o.createElement("div",{key:_t,"data-node-key":te(_t),className:E()(zr,(Oe={},(0,g.Z)(Oe,"".concat(zr,"-with-remove"),Or),(0,g.Z)(Oe,"".concat(zr,"-active"),tt),(0,g.Z)(Oe,"".concat(zr,"-disabled"),Ut),Oe)),style:Vr,onClick:wr},o.createElement("div",{role:"tab","aria-selected":tt,id:Ye&&"".concat(Ye,"-tab-").concat(_t),className:"".concat(zr,"-btn"),"aria-controls":Ye&&"".concat(Ye,"-panel-").concat(_t),"aria-disabled":Ut,tabIndex:Ut?null:0,onClick:function(Xr){Xr.stopPropagation(),wr(Xr)},onKeyDown:function(Xr){[dt.SPACE,dt.ENTER].includes(Xr.which)&&(Xr.preventDefault(),wr(Xr))},onFocus:Mr},Pt),Or&&o.createElement("button",{type:"button","aria-label":Vt||"remove",tabIndex:0,className:"".concat(zr,"-remove"),onClick:function(Xr){Xr.stopPropagation(),cn(Xr)}},Ft||or.removeIcon||"\xD7"));return jt?jt(Br):Br}var kt=Mt,Yt=function(Oe){return+setTimeout(Oe,16)},Jt=function(Oe){return clearTimeout(Oe)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(Yt=function(Oe){return window.requestAnimationFrame(Oe)},Jt=function(Oe){return window.cancelAnimationFrame(Oe)});var hr=0,$t=new Map;function dr(Se){$t.delete(Se)}var tr=function(Oe){var Ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;hr+=1;var Ye=hr;function tt(it){if(it===0)dr(Ye),Oe();else{var _t=Yt(function(){tt(it-1)});$t.set(Ye,_t)}}return tt(Ge),Ye};tr.cancel=function(Se){var Oe=$t.get(Se);return dr(Oe),Jt(Oe)};var ur=tr,Sr=function(Oe){var Ge=Oe.activeTabOffset,Ye=Oe.horizontal,tt=Oe.rtl,it=Oe.indicatorSize,_t=(0,o.useState)(),Pt=(0,h.Z)(_t,2),Ut=Pt[0],Ft=Pt[1],nr=(0,o.useRef)(),jt=function(pr){return typeof it=="function"?it(pr):typeof it=="number"?it:pr};function Vt(){ur.cancel(nr.current)}return(0,o.useEffect)(function(){var or={};return Ge&&(Ye?(tt?(or.right=Ge.right+Ge.width/2,or.transform="translateX(50%)"):(or.left=Ge.left+Ge.width/2,or.transform="translateX(-50%)"),or.width=jt(Ge.width)):(or.top=Ge.top+Ge.height/2,or.transform="translateY(-50%)",or.height=jt(Ge.height))),Vt(),nr.current=ur(function(){Ft(or)}),Vt},[Ge,Ye,tt,it]),{style:Ut}},Nr=Sr,sr=function(Oe){var Ge=Oe.current||{},Ye=Ge.offsetWidth,tt=Ye===void 0?0:Ye,it=Ge.offsetHeight,_t=it===void 0?0:it;return[tt,_t]},Wt=function(Oe,Ge){return Oe[Ge?0:1]};function xt(Se,Oe){var Ge,Ye=o.useContext(F),tt=Ye.prefixCls,it=Ye.tabs,_t=Se.className,Pt=Se.style,Ut=Se.id,Ft=Se.animated,nr=Se.activeKey,jt=Se.rtl,Vt=Se.extra,or=Se.editable,pr=Se.locale,Mr=Se.tabPosition,Vr=Se.tabBarGutter,zr=Se.children,Or=Se.onTabClick,wr=Se.onTabScroll,cn=Se.indicatorSize,Br=(0,o.useRef)(),Ar=(0,o.useRef)(),Xr=(0,o.useRef)(),Hr=(0,o.useRef)(),yr=(0,o.useRef)(),Ur=(0,o.useRef)(),Kr=(0,o.useRef)(),ir=Mr==="top"||Mr==="bottom",Lr=xe(0,function(Rr,Qt){ir&&wr&&wr({direction:Rr>Qt?"left":"right"})}),cr=(0,h.Z)(Lr,2),Yr=cr[0],ui=cr[1],Ai=xe(0,function(Rr,Qt){!ir&&wr&&wr({direction:Rr>Qt?"top":"bottom"})}),$n=(0,h.Z)(Ai,2),Cr=$n[0],Li=$n[1],Zi=(0,o.useState)([0,0]),xr=(0,h.Z)(Zi,2),un=xr[0],Gn=xr[1],Vn=(0,o.useState)([0,0]),tn=(0,h.Z)(Vn,2),jn=tn[0],pn=tn[1],Ji=(0,o.useState)([0,0]),qi=(0,h.Z)(Ji,2),Ys=qi[0],Ca=qi[1],xo=(0,o.useState)([0,0]),vi=(0,h.Z)(xo,2),$o=vi[0],rn=vi[1],Qn=Ae(new Map),Cn=(0,h.Z)(Qn,2),Bn=Cn[0],lo=Cn[1],Qi=le(it,Bn,jn[0]),So=Wt(un,ir),ps=Wt(jn,ir),Co=Wt(Ys,ir),Oi=Wt($o,ir),eo=So<ps+Co,mr=eo?So-Oi:So-Co,Go="".concat(tt,"-nav-operations-hidden"),zi=0,Hi=0;ir&&jt?(zi=0,Hi=Math.max(0,ps-mr)):(zi=Math.min(0,mr-ps),Hi=0);function ka(Rr){return Rr<zi?zi:Rr>Hi?Hi:Rr}var Ja=(0,o.useRef)(),Ci=(0,o.useState)(),Ea=(0,h.Z)(Ci,2),co=Ea[0],Ma=Ea[1];function Zs(){Ma(Date.now())}function ms(){window.clearTimeout(Ja.current)}be(Hr,function(Rr,Qt){function nn(hn,bi){hn(function(_i){var qa=ka(_i+bi);return qa})}return eo?(ir?nn(ui,Rr):nn(Li,Qt),ms(),Zs(),!0):!1}),(0,o.useEffect)(function(){return ms(),co&&(Ja.current=window.setTimeout(function(){Ma(0)},100)),ms},[co]);var gs=Pe(Qi,mr,ir?Yr:Cr,ps,Co,Oi,(0,l.Z)((0,l.Z)({},Se),{},{tabs:it})),Vo=(0,h.Z)(gs,2),Ta=Vo[0],fi=Vo[1],Aa=u(function(){var Rr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:nr,Qt=Qi.get(Rr)||{width:0,height:0,left:0,right:0,top:0};if(ir){var nn=Yr;jt?Qt.right<Yr?nn=Qt.right:Qt.right+Qt.width>Yr+mr&&(nn=Qt.right+Qt.width-mr):Qt.left<-Yr?nn=-Qt.left:Qt.left+Qt.width>-Yr+mr&&(nn=-(Qt.left+Qt.width-mr)),Li(0),ui(ka(nn))}else{var hn=Cr;Qt.top<-Cr?hn=-Qt.top:Qt.top+Qt.height>-Cr+mr&&(hn=-(Qt.top+Qt.height-mr)),ui(0),Li(ka(hn))}}),ko={};Mr==="top"||Mr==="bottom"?ko[jt?"marginRight":"marginLeft"]=Vr:ko.marginTop=Vr;var vs=it.map(function(Rr,Qt){var nn=Rr.key;return o.createElement(kt,{id:Ut,prefixCls:tt,key:nn,tab:Rr,style:Qt===0?void 0:ko,closable:Rr.closable,editable:or,active:nn===nr,renderWrapper:zr,removeAriaLabel:pr==null?void 0:pr.removeAriaLabel,onClick:function(bi){Or(nn,bi)},onFocus:function(){Aa(nn),Zs(),Hr.current&&(jt||(Hr.current.scrollLeft=0),Hr.current.scrollTop=0)}})}),La=function(){return lo(function(){var Qt=new Map;return it.forEach(function(nn){var hn,bi=nn.key,_i=(hn=yr.current)===null||hn===void 0?void 0:hn.querySelector('[data-node-key="'.concat(te(bi),'"]'));_i&&Qt.set(bi,{width:_i.offsetWidth,height:_i.offsetHeight,left:_i.offsetLeft,top:_i.offsetTop})}),Qt})};(0,o.useEffect)(function(){La()},[it.map(function(Rr){return Rr.key}).join("_")]);var ys=Te(function(){var Rr=sr(Br),Qt=sr(Ar),nn=sr(Xr);Gn([Rr[0]-Qt[0]-nn[0],Rr[1]-Qt[1]-nn[1]]);var hn=sr(Kr);Ca(hn);var bi=sr(Ur);rn(bi);var _i=sr(yr);pn([_i[0]-hn[0],_i[1]-hn[1]]),La()}),Js=it.slice(0,Ta),Rl=it.slice(fi+1),Eo=[].concat((0,G.Z)(Js),(0,G.Z)(Rl)),Qs=Qi.get(nr),Mo=Nr({activeTabOffset:Qs,horizontal:ir,rtl:jt,indicatorSize:cn}),Xo=Mo.style;(0,o.useEffect)(function(){Aa()},[nr,zi,Hi,_e(Qs),_e(Qi),ir]),(0,o.useEffect)(function(){ys()},[jt]);var yi=!!Eo.length,to="".concat(tt,"-nav-wrap"),To,ea,Yo,uo;return ir?jt?(ea=Yr>0,To=Yr!==Hi):(To=Yr<0,ea=Yr!==zi):(Yo=Cr<0,uo=Cr!==zi),o.createElement(ee.Z,{onResize:ys},o.createElement("div",{ref:ae(Oe,Br),role:"tablist",className:E()("".concat(tt,"-nav"),_t),style:Pt,onKeyDown:function(){Zs()}},o.createElement(z,{ref:Ar,position:"left",extra:Vt,prefixCls:tt}),o.createElement(ee.Z,{onResize:ys},o.createElement("div",{className:E()(to,(Ge={},(0,g.Z)(Ge,"".concat(to,"-ping-left"),To),(0,g.Z)(Ge,"".concat(to,"-ping-right"),ea),(0,g.Z)(Ge,"".concat(to,"-ping-top"),Yo),(0,g.Z)(Ge,"".concat(to,"-ping-bottom"),uo),Ge)),ref:Hr},o.createElement(ee.Z,{onResize:ys},o.createElement("div",{ref:yr,className:"".concat(tt,"-nav-list"),style:{transform:"translate(".concat(Yr,"px, ").concat(Cr,"px)"),transition:co?"none":void 0}},vs,o.createElement(re,{ref:Kr,prefixCls:tt,locale:pr,editable:or,style:(0,l.Z)((0,l.Z)({},vs.length===0?void 0:ko),{},{visibility:yi?"hidden":null})}),o.createElement("div",{className:E()("".concat(tt,"-ink-bar"),(0,g.Z)({},"".concat(tt,"-ink-bar-animated"),Ft.inkBar)),style:Xo}))))),o.createElement(Et,(0,p.Z)({},Se,{removeAriaLabel:pr==null?void 0:pr.removeAriaLabel,ref:Ur,prefixCls:tt,tabs:Eo,className:!yi&&Go,tabMoving:!!co})),o.createElement(z,{ref:Xr,position:"right",extra:Vt,prefixCls:tt})))}var rr=o.forwardRef(xt),_r=["renderTabBar"],vr=["label","key"];function Zt(Se){var Oe=Se.renderTabBar,Ge=(0,d.Z)(Se,_r),Ye=o.useContext(F),tt=Ye.tabs;if(Oe){var it=(0,l.Z)((0,l.Z)({},Ge),{},{panes:tt.map(function(_t){var Pt=_t.label,Ut=_t.key,Ft=(0,d.Z)(_t,vr);return o.createElement(B,(0,p.Z)({tab:Pt,key:Ut,tabKey:Ut},Ft))})});return Oe(it,rr)}return o.createElement(rr,Ge)}var Fr={},Er=[],Wr=function(Oe){Er.push(Oe)};function at(Se,Oe){if(0)var Ge}function Ht(Se,Oe){if(0)var Ge}function Vi(){Fr={}}function li(Se,Oe,Ge){!Oe&&!Fr[Ge]&&(Se(!1,Ge),Fr[Ge]=!0)}function ci(Se,Oe){li(at,Se,Oe)}function Yn(Se,Oe){li(Ht,Se,Oe)}ci.preMessage=Wr,ci.resetWarned=Vi,ci.noteOnce=Yn;var mi=null;function Gt(){var Se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},Oe;return Se===!1?Oe={inkBar:!1,tabPane:!1}:Se===!0?Oe={inkBar:!0,tabPane:!1}:Oe=(0,l.Z)({inkBar:!0},(0,v.Z)(Se)==="object"?Se:{}),Oe.tabPaneMotion&&Oe.tabPane===void 0&&(Oe.tabPane=!0),!Oe.tabPaneMotion&&Oe.tabPane&&(Oe.tabPane=!1),Oe}var _o=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicatorSize"],Bi=0;function Zn(Se,Oe){var Ge,Ye=Se.id,tt=Se.prefixCls,it=tt===void 0?"rc-tabs":tt,_t=Se.className,Pt=Se.items,Ut=Se.direction,Ft=Se.activeKey,nr=Se.defaultActiveKey,jt=Se.editable,Vt=Se.animated,or=Se.tabPosition,pr=or===void 0?"top":or,Mr=Se.tabBarGutter,Vr=Se.tabBarStyle,zr=Se.tabBarExtraContent,Or=Se.locale,wr=Se.moreIcon,cn=Se.moreTransitionName,Br=Se.destroyInactiveTabPane,Ar=Se.renderTabBar,Xr=Se.onChange,Hr=Se.onTabClick,yr=Se.onTabScroll,Ur=Se.getPopupContainer,Kr=Se.popupClassName,ir=Se.indicatorSize,Lr=(0,d.Z)(Se,_o),cr=o.useMemo(function(){return(Pt||[]).filter(function(rn){return rn&&(0,v.Z)(rn)==="object"&&"key"in rn})},[Pt]),Yr=Ut==="rtl",ui=Gt(Vt),Ai=(0,o.useState)(!1),$n=(0,h.Z)(Ai,2),Cr=$n[0],Li=$n[1];(0,o.useEffect)(function(){Li(s())},[]);var Zi=H(function(){var rn;return(rn=cr[0])===null||rn===void 0?void 0:rn.key},{value:Ft,defaultValue:nr}),xr=(0,h.Z)(Zi,2),un=xr[0],Gn=xr[1],Vn=(0,o.useState)(function(){return cr.findIndex(function(rn){return rn.key===un})}),tn=(0,h.Z)(Vn,2),jn=tn[0],pn=tn[1];(0,o.useEffect)(function(){var rn=cr.findIndex(function(Cn){return Cn.key===un});if(rn===-1){var Qn;rn=Math.max(0,Math.min(jn,cr.length-1)),Gn((Qn=cr[rn])===null||Qn===void 0?void 0:Qn.key)}pn(rn)},[cr.map(function(rn){return rn.key}).join("_"),un,jn]);var Ji=H(null,{value:Ye}),qi=(0,h.Z)(Ji,2),Ys=qi[0],Ca=qi[1];(0,o.useEffect)(function(){Ye||(Ca("rc-tabs-".concat(Bi)),Bi+=1)},[]);function xo(rn,Qn){Hr==null||Hr(rn,Qn);var Cn=rn!==un;Gn(rn),Cn&&(Xr==null||Xr(rn))}var vi={id:Ys,activeKey:un,animated:ui,tabPosition:pr,rtl:Yr,mobile:Cr},$o=(0,l.Z)((0,l.Z)({},vi),{},{editable:jt,locale:Or,moreIcon:wr,moreTransitionName:cn,tabBarGutter:Mr,onTabClick:xo,onTabScroll:yr,extra:zr,style:Vr,panes:null,getPopupContainer:Ur,popupClassName:Kr,indicatorSize:ir});return o.createElement(F.Provider,{value:{tabs:cr,prefixCls:it}},o.createElement("div",(0,p.Z)({ref:Oe,id:Ye,className:E()(it,"".concat(it,"-").concat(pr),(Ge={},(0,g.Z)(Ge,"".concat(it,"-mobile"),Cr),(0,g.Z)(Ge,"".concat(it,"-editable"),jt),(0,g.Z)(Ge,"".concat(it,"-rtl"),Yr),Ge),_t)},Lr),o.createElement(Zt,(0,p.Z)({},$o,{renderTabBar:Ar})),o.createElement(U,(0,p.Z)({destroyInactiveTabPane:Br},vi,{animated:ui}))))}var Un=o.forwardRef(Zn),Jn=Un,ln=Jn,gi=Q(53124),fs=Q(98675),No=()=>null,Gs=Q(33603);const Fo={motionAppear:!1,motionEnter:!0,motionLeave:!0};function zo(Se){let Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inkBar:!0,tabPane:!1},Ge;return Oe===!1?Ge={inkBar:!1,tabPane:!1}:Oe===!0?Ge={inkBar:!0,tabPane:!0}:Ge=Object.assign({inkBar:!0},typeof Oe=="object"?Oe:{}),Ge.tabPane&&(Ge.tabPaneMotion=Object.assign(Object.assign({},Fo),{motionName:(0,Gs.m)(Se,"switch")})),Ge}var Ho=Q(37419),wo=function(Se,Oe){var Ge={};for(var Ye in Se)Object.prototype.hasOwnProperty.call(Se,Ye)&&Oe.indexOf(Ye)<0&&(Ge[Ye]=Se[Ye]);if(Se!=null&&typeof Object.getOwnPropertySymbols=="function")for(var tt=0,Ye=Object.getOwnPropertySymbols(Se);tt<Ye.length;tt++)Oe.indexOf(Ye[tt])<0&&Object.prototype.propertyIsEnumerable.call(Se,Ye[tt])&&(Ge[Ye[tt]]=Se[Ye[tt]]);return Ge};function Sa(Se){return Se.filter(Oe=>Oe)}function hs(Se,Oe){if(Se)return Se;const Ge=(0,Ho.Z)(Oe).map(Ye=>{if(o.isValidElement(Ye)){const{key:tt,props:it}=Ye,_t=it||{},{tab:Pt}=_t,Ut=wo(_t,["tab"]);return Object.assign(Object.assign({key:String(tt)},Ut),{label:Pt})}return null});return Sa(Ge)}var An=Q(14747),Vs=Q(67968),Xs=Q(45503),Ti=Q(67771),Wn=Se=>{const{componentCls:Oe,motionDurationSlow:Ge}=Se;return[{[Oe]:{[`${Oe}-switch`]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${Ge}`}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${Ge}`}}}}},[(0,Ti.oN)(Se,"slide-up"),(0,Ti.oN)(Se,"slide-down")]]};const ao=Se=>{const{componentCls:Oe,tabsCardPadding:Ge,cardBg:Ye,cardGutter:tt,colorBorderSecondary:it,itemSelectedColor:_t}=Se;return{[`${Oe}-card`]:{[`> ${Oe}-nav, > div > ${Oe}-nav`]:{[`${Oe}-tab`]:{margin:0,padding:Ge,background:Ye,border:`${Se.lineWidth}px ${Se.lineType} ${it}`,transition:`all ${Se.motionDurationSlow} ${Se.motionEaseInOut}`},[`${Oe}-tab-active`]:{color:_t,background:Se.colorBgContainer},[`${Oe}-ink-bar`]:{visibility:"hidden"}},[`&${Oe}-top, &${Oe}-bottom`]:{[`> ${Oe}-nav, > div > ${Oe}-nav`]:{[`${Oe}-tab + ${Oe}-tab`]:{marginLeft:{_skip_check_:!0,value:`${tt}px`}}}},[`&${Oe}-top`]:{[`> ${Oe}-nav, > div > ${Oe}-nav`]:{[`${Oe}-tab`]:{borderRadius:`${Se.borderRadiusLG}px ${Se.borderRadiusLG}px 0 0`},[`${Oe}-tab-active`]:{borderBottomColor:Se.colorBgContainer}}},[`&${Oe}-bottom`]:{[`> ${Oe}-nav, > div > ${Oe}-nav`]:{[`${Oe}-tab`]:{borderRadius:`0 0 ${Se.borderRadiusLG}px ${Se.borderRadiusLG}px`},[`${Oe}-tab-active`]:{borderTopColor:Se.colorBgContainer}}},[`&${Oe}-left, &${Oe}-right`]:{[`> ${Oe}-nav, > div > ${Oe}-nav`]:{[`${Oe}-tab + ${Oe}-tab`]:{marginTop:`${tt}px`}}},[`&${Oe}-left`]:{[`> ${Oe}-nav, > div > ${Oe}-nav`]:{[`${Oe}-tab`]:{borderRadius:{_skip_check_:!0,value:`${Se.borderRadiusLG}px 0 0 ${Se.borderRadiusLG}px`}},[`${Oe}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:Se.colorBgContainer}}}},[`&${Oe}-right`]:{[`> ${Oe}-nav, > div > ${Oe}-nav`]:{[`${Oe}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${Se.borderRadiusLG}px ${Se.borderRadiusLG}px 0`}},[`${Oe}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:Se.colorBgContainer}}}}}}},Uo=Se=>{const{componentCls:Oe,itemHoverColor:Ge,dropdownEdgeChildVerticalPadding:Ye}=Se;return{[`${Oe}-dropdown`]:Object.assign(Object.assign({},(0,An.Wf)(Se)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:Se.zIndexPopup,display:"block","&-hidden":{display:"none"},[`${Oe}-dropdown-menu`]:{maxHeight:Se.tabsDropdownHeight,margin:0,padding:`${Ye}px 0`,overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:Se.colorBgContainer,backgroundClip:"padding-box",borderRadius:Se.borderRadiusLG,outline:"none",boxShadow:Se.boxShadowSecondary,"&-item":Object.assign(Object.assign({},An.vS),{display:"flex",alignItems:"center",minWidth:Se.tabsDropdownWidth,margin:0,padding:`${Se.paddingXXS}px ${Se.paddingSM}px`,color:Se.colorText,fontWeight:"normal",fontSize:Se.fontSize,lineHeight:Se.lineHeight,cursor:"pointer",transition:`all ${Se.motionDurationSlow}`,"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:Se.marginSM},color:Se.colorTextDescription,fontSize:Se.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:Ge}},"&:hover":{background:Se.controlItemBgHover},"&-disabled":{"&, &:hover":{color:Se.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},Wo=Se=>{const{componentCls:Oe,margin:Ge,colorBorderSecondary:Ye,horizontalMargin:tt,verticalItemPadding:it,verticalItemMargin:_t}=Se;return{[`${Oe}-top, ${Oe}-bottom`]:{flexDirection:"column",[`> ${Oe}-nav, > div > ${Oe}-nav`]:{margin:tt,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${Se.lineWidth}px ${Se.lineType} ${Ye}`,content:"''"},[`${Oe}-ink-bar`]:{height:Se.lineWidthBold,"&-animated":{transition:`width ${Se.motionDurationSlow}, left ${Se.motionDurationSlow},
right ${Se.motionDurationSlow}`}},[`${Oe}-nav-wrap`]:{"&::before, &::after":{top:0,bottom:0,width:Se.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:Se.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:Se.boxShadowTabsOverflowRight},[`&${Oe}-nav-wrap-ping-left::before`]:{opacity:1},[`&${Oe}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${Oe}-top`]:{[`> ${Oe}-nav,
> div > ${Oe}-nav`]:{"&::before":{bottom:0},[`${Oe}-ink-bar`]:{bottom:0}}},[`${Oe}-bottom`]:{[`> ${Oe}-nav, > div > ${Oe}-nav`]:{order:1,marginTop:`${Ge}px`,marginBottom:0,"&::before":{top:0},[`${Oe}-ink-bar`]:{top:0}},[`> ${Oe}-content-holder, > div > ${Oe}-content-holder`]:{order:0}},[`${Oe}-left, ${Oe}-right`]:{[`> ${Oe}-nav, > div > ${Oe}-nav`]:{flexDirection:"column",minWidth:Se.controlHeight*1.25,[`${Oe}-tab`]:{padding:it,textAlign:"center"},[`${Oe}-tab + ${Oe}-tab`]:{margin:_t},[`${Oe}-nav-wrap`]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:Se.controlHeight},"&::before":{top:0,boxShadow:Se.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:Se.boxShadowTabsOverflowBottom},[`&${Oe}-nav-wrap-ping-top::before`]:{opacity:1},[`&${Oe}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${Oe}-ink-bar`]:{width:Se.lineWidthBold,"&-animated":{transition:`height ${Se.motionDurationSlow}, top ${Se.motionDurationSlow}`}},[`${Oe}-nav-list, ${Oe}-nav-operations`]:{flex:"1 0 auto",flexDirection:"column"}}},[`${Oe}-left`]:{[`> ${Oe}-nav, > div > ${Oe}-nav`]:{[`${Oe}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${Oe}-content-holder, > div > ${Oe}-content-holder`]:{marginLeft:{_skip_check_:!0,value:`-${Se.lineWidth}px`},borderLeft:{_skip_check_:!0,value:`${Se.lineWidth}px ${Se.lineType} ${Se.colorBorder}`},[`> ${Oe}-content > ${Oe}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:Se.paddingLG}}}},[`${Oe}-right`]:{[`> ${Oe}-nav, > div > ${Oe}-nav`]:{order:1,[`${Oe}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${Oe}-content-holder, > div > ${Oe}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:-Se.lineWidth},borderRight:{_skip_check_:!0,value:`${Se.lineWidth}px ${Se.lineType} ${Se.colorBorder}`},[`> ${Oe}-content > ${Oe}-tabpane`]:{paddingRight:{_skip_check_:!0,value:Se.paddingLG}}}}}},Ko=Se=>{const{componentCls:Oe,cardPaddingSM:Ge,cardPaddingLG:Ye,horizontalItemPaddingSM:tt,horizontalItemPaddingLG:it}=Se;return{[Oe]:{"&-small":{[`> ${Oe}-nav`]:{[`${Oe}-tab`]:{padding:tt,fontSize:Se.titleFontSizeSM}}},"&-large":{[`> ${Oe}-nav`]:{[`${Oe}-tab`]:{padding:it,fontSize:Se.titleFontSizeLG}}}},[`${Oe}-card`]:{[`&${Oe}-small`]:{[`> ${Oe}-nav`]:{[`${Oe}-tab`]:{padding:Ge}},[`&${Oe}-bottom`]:{[`> ${Oe}-nav ${Oe}-tab`]:{borderRadius:`0 0 ${Se.borderRadius}px ${Se.borderRadius}px`}},[`&${Oe}-top`]:{[`> ${Oe}-nav ${Oe}-tab`]:{borderRadius:`${Se.borderRadius}px ${Se.borderRadius}px 0 0`}},[`&${Oe}-right`]:{[`> ${Oe}-nav ${Oe}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${Se.borderRadius}px ${Se.borderRadius}px 0`}}},[`&${Oe}-left`]:{[`> ${Oe}-nav ${Oe}-tab`]:{borderRadius:{_skip_check_:!0,value:`${Se.borderRadius}px 0 0 ${Se.borderRadius}px`}}}},[`&${Oe}-large`]:{[`> ${Oe}-nav`]:{[`${Oe}-tab`]:{padding:Ye}}}}}},Ni=Se=>{const{componentCls:Oe,itemActiveColor:Ge,itemHoverColor:Ye,iconCls:tt,tabsHorizontalItemMargin:it,horizontalItemPadding:_t,itemSelectedColor:Pt,itemColor:Ut}=Se,Ft=`${Oe}-tab`;return{[Ft]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:_t,fontSize:Se.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:Ut,"&-btn, &-remove":Object.assign({"&:focus:not(:focus-visible), &:active":{color:Ge}},(0,An.Qy)(Se)),"&-btn":{outline:"none",transition:"all 0.3s"},"&-remove":{flex:"none",marginRight:{_skip_check_:!0,value:-Se.marginXXS},marginLeft:{_skip_check_:!0,value:Se.marginXS},color:Se.colorTextDescription,fontSize:Se.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:`all ${Se.motionDurationSlow}`,"&:hover":{color:Se.colorTextHeading}},"&:hover":{color:Ye},[`&${Ft}-active ${Ft}-btn`]:{color:Pt,textShadow:Se.tabsActiveTextShadow},[`&${Ft}-disabled`]:{color:Se.colorTextDisabled,cursor:"not-allowed"},[`&${Ft}-disabled ${Ft}-btn, &${Ft}-disabled ${Oe}-remove`]:{"&:focus, &:active":{color:Se.colorTextDisabled}},[`& ${Ft}-remove ${tt}`]:{margin:0},[tt]:{marginRight:{_skip_check_:!0,value:Se.marginSM}}},[`${Ft} + ${Ft}`]:{margin:{_skip_check_:!0,value:it}}}},Fi=Se=>{const{componentCls:Oe,tabsHorizontalItemMarginRTL:Ge,iconCls:Ye,cardGutter:tt}=Se;return{[`${Oe}-rtl`]:{direction:"rtl",[`${Oe}-nav`]:{[`${Oe}-tab`]:{margin:{_skip_check_:!0,value:Ge},[`${Oe}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[Ye]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:`${Se.marginSM}px`}},[`${Oe}-tab-remove`]:{marginRight:{_skip_check_:!0,value:`${Se.marginXS}px`},marginLeft:{_skip_check_:!0,value:`-${Se.marginXXS}px`},[Ye]:{margin:0}}}},[`&${Oe}-left`]:{[`> ${Oe}-nav`]:{order:1},[`> ${Oe}-content-holder`]:{order:0}},[`&${Oe}-right`]:{[`> ${Oe}-nav`]:{order:0},[`> ${Oe}-content-holder`]:{order:1}},[`&${Oe}-card${Oe}-top, &${Oe}-card${Oe}-bottom`]:{[`> ${Oe}-nav, > div > ${Oe}-nav`]:{[`${Oe}-tab + ${Oe}-tab`]:{marginRight:{_skip_check_:!0,value:tt},marginLeft:{_skip_check_:!0,value:0}}}}},[`${Oe}-dropdown-rtl`]:{direction:"rtl"},[`${Oe}-menu-item`]:{[`${Oe}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:"right"}}}}},Xi=Se=>{const{componentCls:Oe,tabsCardPadding:Ge,cardHeight:Ye,cardGutter:tt,itemHoverColor:it,itemActiveColor:_t,colorBorderSecondary:Pt}=Se;return{[Oe]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,An.Wf)(Se)),{display:"flex",[`> ${Oe}-nav, > div > ${Oe}-nav`]:{position:"relative",display:"flex",flex:"none",alignItems:"center",[`${Oe}-nav-wrap`]:{position:"relative",display:"flex",flex:"auto",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",transform:"translate(0)","&::before, &::after":{position:"absolute",zIndex:1,opacity:0,transition:`opacity ${Se.motionDurationSlow}`,content:"''",pointerEvents:"none"}},[`${Oe}-nav-list`]:{position:"relative",display:"flex",transition:`opacity ${Se.motionDurationSlow}`},[`${Oe}-nav-operations`]:{display:"flex",alignSelf:"stretch"},[`${Oe}-nav-operations-hidden`]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},[`${Oe}-nav-more`]:{position:"relative",padding:Ge,background:"transparent",border:0,color:Se.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:Se.controlHeightLG/8,transform:"translateY(100%)",content:"''"}},[`${Oe}-nav-add`]:Object.assign({minWidth:Ye,marginLeft:{_skip_check_:!0,value:tt},padding:`0 ${Se.paddingXS}px`,background:"transparent",border:`${Se.lineWidth}px ${Se.lineType} ${Pt}`,borderRadius:`${Se.borderRadiusLG}px ${Se.borderRadiusLG}px 0 0`,outline:"none",cursor:"pointer",color:Se.colorText,transition:`all ${Se.motionDurationSlow} ${Se.motionEaseInOut}`,"&:hover":{color:it},"&:active, &:focus:not(:focus-visible)":{color:_t}},(0,An.Qy)(Se))},[`${Oe}-extra-content`]:{flex:"none"},[`${Oe}-ink-bar`]:{position:"absolute",background:Se.inkBarColor,pointerEvents:"none"}}),Ni(Se)),{[`${Oe}-content`]:{position:"relative",width:"100%"},[`${Oe}-content-holder`]:{flex:"auto",minWidth:0,minHeight:0},[`${Oe}-tabpane`]:{outline:"none","&-hidden":{display:"none"}}}),[`${Oe}-centered`]:{[`> ${Oe}-nav, > div > ${Oe}-nav`]:{[`${Oe}-nav-wrap`]:{[`&:not([class*='${Oe}-nav-wrap-ping'])`]:{justifyContent:"center"}}}}}};var qn=(0,Vs.Z)("Tabs",Se=>{const Oe=(0,Xs.TS)(Se,{tabsCardPadding:Se.cardPadding||`${(Se.cardHeight-Math.round(Se.fontSize*Se.lineHeight))/2-Se.lineWidth}px ${Se.padding}px`,dropdownEdgeChildVerticalPadding:Se.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:`0 0 0 ${Se.horizontalItemGutter}px`,tabsHorizontalItemMarginRTL:`0 0 0 ${Se.horizontalItemGutter}px`});return[Ko(Oe),Fi(Oe),Wo(Oe),Uo(Oe),ao(Oe),Xi(Oe),Wn(Oe)]},Se=>{const Oe=Se.controlHeightLG;return{zIndexPopup:Se.zIndexPopupBase+50,cardBg:Se.colorFillAlter,cardHeight:Oe,cardPadding:"",cardPaddingSM:`${Se.paddingXXS*1.5}px ${Se.padding}px`,cardPaddingLG:`${Se.paddingXS}px ${Se.padding}px ${Se.paddingXXS*1.5}px`,titleFontSize:Se.fontSize,titleFontSizeLG:Se.fontSizeLG,titleFontSizeSM:Se.fontSize,inkBarColor:Se.colorPrimary,horizontalMargin:`0 0 ${Se.margin}px 0`,horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:`${Se.paddingSM}px 0`,horizontalItemPaddingSM:`${Se.paddingXS}px 0`,horizontalItemPaddingLG:`${Se.padding}px 0`,verticalItemPadding:`${Se.paddingXS}px ${Se.paddingLG}px`,verticalItemMargin:`${Se.margin}px 0 0 0`,itemColor:Se.colorText,itemSelectedColor:Se.colorPrimary,itemHoverColor:Se.colorPrimaryHover,itemActiveColor:Se.colorPrimaryActive,cardGutter:Se.marginXXS/2}}),Kn=function(Se,Oe){var Ge={};for(var Ye in Se)Object.prototype.hasOwnProperty.call(Se,Ye)&&Oe.indexOf(Ye)<0&&(Ge[Ye]=Se[Ye]);if(Se!=null&&typeof Object.getOwnPropertySymbols=="function")for(var tt=0,Ye=Object.getOwnPropertySymbols(Se);tt<Ye.length;tt++)Oe.indexOf(Ye[tt])<0&&Object.prototype.propertyIsEnumerable.call(Se,Ye[tt])&&(Ge[Ye[tt]]=Se[Ye[tt]]);return Ge};const ds=Se=>{const{type:Oe,className:Ge,rootClassName:Ye,size:tt,onEdit:it,hideAdd:_t,centered:Pt,addIcon:Ut,popupClassName:Ft,children:nr,items:jt,animated:Vt,style:or,indicatorSize:pr}=Se,Mr=Kn(Se,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","popupClassName","children","items","animated","style","indicatorSize"]),{prefixCls:Vr,moreIcon:zr=o.createElement(fe.Z,null)}=Mr,{direction:Or,tabs:wr,getPrefixCls:cn,getPopupContainer:Br}=o.useContext(gi.E_),Ar=cn("tabs",Vr),[Xr,Hr]=qn(Ar);let yr;Oe==="editable-card"&&(yr={onEdit:(Yr,ui)=>{let{key:Ai,event:$n}=ui;it==null||it(Yr==="add"?$n:Ai,Yr)},removeIcon:o.createElement(he.Z,null),addIcon:Ut||o.createElement(i.Z,null),showAdd:_t!==!0});const Ur=cn(),Kr=hs(jt,nr),ir=zo(Ar,Vt),Lr=(0,fs.Z)(tt),cr=Object.assign(Object.assign({},wr==null?void 0:wr.style),or);return Xr(o.createElement(ln,Object.assign({direction:Or,getPopupContainer:Br,moreTransitionName:`${Ur}-slide-up`},Mr,{items:Kr,className:E()({[`${Ar}-${Lr}`]:Lr,[`${Ar}-card`]:["card","editable-card"].includes(Oe),[`${Ar}-editable-card`]:Oe==="editable-card",[`${Ar}-centered`]:Pt},wr==null?void 0:wr.className,Ge,Ye,Hr),popupClassName:E()(Ft,Hr),style:cr,editable:yr,moreIcon:zr,prefixCls:Ar,animated:ir,indicatorSize:pr!=null?pr:wr==null?void 0:wr.indicatorSize})))};ds.TabPane=No;var Yi=ds},79753:function(It,Ue,Q){"use strict";Q.d(Ue,{Z:function(){return Kt}});var he=Q(67294),fe=Q.t(he,2),i=Q(1413),M=Q(87462),E=Q(71002),p=Q(97685),g=Q(45987),l=Q(73935),h=Q(98924),v=Q(80334),d=Q(42550),o=he.createContext(null),s=o,u=Q(74902),m=Q(8410),y=[];function _(dt,st){var Et=he.useState(function(){if(!(0,h.Z)())return null;var sr=document.createElement("div");return sr}),Mt=(0,p.Z)(Et,1),kt=Mt[0],Yt=he.useRef(!1),Jt=he.useContext(s),hr=he.useState(y),$t=(0,p.Z)(hr,2),dr=$t[0],tr=$t[1],ur=Jt||(Yt.current?void 0:function(sr){tr(function(Wt){var xt=[sr].concat((0,u.Z)(Wt));return xt})});function Sr(){kt.parentElement||document.body.appendChild(kt),Yt.current=!0}function Nr(){var sr;(sr=kt.parentElement)===null||sr===void 0||sr.removeChild(kt),Yt.current=!1}return(0,m.Z)(function(){return dt?Jt?Jt(Sr):Sr():Nr(),Nr},[dt]),(0,m.Z)(function(){dr.length&&(dr.forEach(function(sr){return sr()}),tr(y))},[dr]),[kt,ur]}var x=Q(48981),S=Q(74204);function w(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var A="rc-util-locker-".concat(Date.now()),H=0;function R(dt){var st=!!dt,Et=he.useState(function(){return H+=1,"".concat(A,"_").concat(H)}),Mt=(0,p.Z)(Et,1),kt=Mt[0];(0,m.Z)(function(){if(st){var Yt=(0,S.o)(document.body).width,Jt=w();(0,x.hq)(`
html body {
overflow-y: hidden;
`.concat(Jt?"width: calc(100% - ".concat(Yt,"px);"):"",`
}`),kt)}else(0,x.jL)(kt);return function(){(0,x.jL)(kt)}},[st,kt])}var F=!1;function D(dt){return typeof dt=="boolean"&&(F=dt),F}var B=function(st){return st===!1?!1:!(0,h.Z)()||!st?null:typeof st=="string"?document.querySelector(st):typeof st=="function"?st():st},P=he.forwardRef(function(dt,st){var Et=dt.open,Mt=dt.autoLock,kt=dt.getContainer,Yt=dt.debug,Jt=dt.autoDestroy,hr=Jt===void 0?!0:Jt,$t=dt.children,dr=he.useState(Et),tr=(0,p.Z)(dr,2),ur=tr[0],Sr=tr[1],Nr=ur||Et;he.useEffect(function(){(hr||Et)&&Sr(Et)},[Et,hr]);var sr=he.useState(function(){return B(kt)}),Wt=(0,p.Z)(sr,2),xt=Wt[0],rr=Wt[1];he.useEffect(function(){var ci=B(kt);rr(ci!=null?ci:null)});var _r=_(Nr&&!xt,Yt),vr=(0,p.Z)(_r,2),Zt=vr[0],Fr=vr[1],Er=xt!=null?xt:Zt;R(Mt&&Et&&(0,h.Z)()&&(Er===Zt||Er===document.body));var Wr=null;if($t&&(0,d.Yr)($t)&&st){var at=$t;Wr=at.ref}var Ht=(0,d.x1)(Wr,st);if(!Nr||!(0,h.Z)()||xt===void 0)return null;var Vi=Er===!1||D(),li=$t;return st&&(li=he.cloneElement($t,{ref:Ht})),he.createElement(s.Provider,{value:Fr},Vi?li:(0,l.createPortal)(li,Er))}),U=P,G=U,ee=Q(62709),K=Q(94184),Z=Q.n(K),$=Q(21770),oe=Q(66680);function ae(dt){var st=window.innerWidth||document.documentElement.clientWidth,Et=window.innerHeight||document.documentElement.clientHeight,Mt=dt.getBoundingClientRect(),kt=Mt.top,Yt=Mt.right,Jt=Mt.bottom,hr=Mt.left;return kt>=0&&hr>=0&&Yt<=st&&Jt<=Et}function ye(dt,st,Et){var Mt;return(Mt=Et!=null?Et:st)!==null&&Mt!==void 0?Mt:dt===null?"center":"bottom"}function Y(dt,st,Et,Mt){var kt=(0,he.useState)(void 0),Yt=(0,p.Z)(kt,2),Jt=Yt[0],hr=Yt[1];(0,m.Z)(function(){var Wt=typeof dt=="function"?dt():dt;hr(Wt||null)});var $t=(0,he.useState)(null),dr=(0,p.Z)($t,2),tr=dr[0],ur=dr[1],Sr=(0,oe.Z)(function(){if(Jt){!ae(Jt)&&st&&Jt.scrollIntoView(Mt);var Wt=Jt.getBoundingClientRect(),xt=Wt.left,rr=Wt.top,_r=Wt.width,vr=Wt.height,Zt={left:xt,top:rr,width:_r,height:vr,radius:0};ur(function(Fr){return JSON.stringify(Fr)!==JSON.stringify(Zt)?Zt:Fr})}else ur(null)}),Nr=function(xt){var rr;return(rr=Array.isArray(Et==null?void 0:Et.offset)?Et==null?void 0:Et.offset[xt]:Et==null?void 0:Et.offset)!==null&&rr!==void 0?rr:6};(0,m.Z)(function(){return Sr(),window.addEventListener("resize",Sr),function(){window.removeEventListener("resize",Sr)}},[Jt,st,Sr]);var sr=(0,he.useMemo)(function(){if(!tr)return tr;var Wt=Nr(0),xt=Nr(1),rr=(Et==null?void 0:Et.radius)||2;return{left:tr.left-Wt,top:tr.top-xt,width:tr.width+Wt*2,height:tr.height+xt*2,radius:rr}},[tr,Et]);return[sr,Jt]}function le(){var dt=(0,i.Z)({},fe);return dt.useId}var xe=0;function Ce(){}function we(dt){var st=he.useState("ssr-id"),Et=(0,p.Z)(st,2),Mt=Et[0],kt=Et[1],Yt=le(),Jt=Yt==null?void 0:Yt();return he.useEffect(function(){if(!Yt){var hr=xe;xe+=1,kt("rc_unique_".concat(hr))}},[]),dt||Jt||Mt}var Le={fill:"transparent",pointerEvents:"auto"},de=function(st){var Et=st.prefixCls,Mt=st.rootClassName,kt=st.pos,Yt=st.showMask,Jt=st.style,hr=Jt===void 0?{}:Jt,$t=st.fill,dr=$t===void 0?"rgba(0,0,0,0.5)":$t,tr=st.open,ur=st.animated,Sr=st.zIndex,Nr=we(),sr="".concat(Et,"-mask-").concat(Nr),Wt=(0,E.Z)(ur)==="object"?ur==null?void 0:ur.placeholder:ur;return he.createElement(G,{open:tr,autoLock:!0},he.createElement("div",{className:Z()("".concat(Et,"-mask"),Mt),style:(0,i.Z)({position:"fixed",left:0,right:0,top:0,bottom:0,zIndex:Sr,pointerEvents:"none"},hr)},Yt?he.createElement("svg",{style:{width:"100%",height:"100%"}},he.createElement("defs",null,he.createElement("mask",{id:sr},he.createElement("rect",{x:"0",y:"0",width:"100vw",height:"100vh",fill:"white"}),kt&&he.createElement("rect",{x:kt.left,y:kt.top,rx:kt.radius,width:kt.width,height:kt.height,fill:"black",className:Wt?"".concat(Et,"-placeholder-animated"):""}))),he.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:dr,mask:"url(#".concat(sr,")")}),kt&&he.createElement(he.Fragment,null,he.createElement("rect",(0,M.Z)({},Le,{x:"0",y:"0",width:"100%",height:kt.top})),he.createElement("rect",(0,M.Z)({},Le,{x:"0",y:"0",width:kt.left,height:"100%"})),he.createElement("rect",(0,M.Z)({},Le,{x:"0",y:kt.top+kt.height,width:"100%",height:"calc(100vh - ".concat(kt.top+kt.height,"px)")})),he.createElement("rect",(0,M.Z)({},Le,{x:kt.left+kt.width,y:"0",width:"calc(100vw - ".concat(kt.left+kt.width,"px)"),height:"100%"})))):null))},be=de,Te={adjustX:1,adjustY:1},Ae=[0,0],Be={left:{points:["cr","cl"],offset:[-8,0]},right:{points:["cl","cr"],offset:[8,0]},top:{points:["bc","tc"],offset:[0,-8]},bottom:{points:["tc","bc"],offset:[0,8]},topLeft:{points:["bl","tl"],offset:[0,-8]},leftTop:{points:["tr","tl"],offset:[-8,0]},topRight:{points:["br","tr"],offset:[0,-8]},rightTop:{points:["tl","tr"],offset:[8,0]},bottomRight:{points:["tr","br"],offset:[0,8]},rightBottom:{points:["bl","br"],offset:[8,0]},bottomLeft:{points:["tl","bl"],offset:[0,8]},leftBottom:{points:["br","bl"],offset:[-8,0]}};function Pe(){var dt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,st={};return Object.keys(Be).forEach(function(Et){st[Et]=(0,i.Z)((0,i.Z)({},Be[Et]),{},{autoArrow:dt,targetOffset:Ae})}),st}var _e=Pe();function ne(dt){var st=dt.prefixCls,Et=dt.current,Mt=dt.total,kt=dt.title,Yt=dt.description,Jt=dt.onClose,hr=dt.onPrev,$t=dt.onNext,dr=dt.onFinish,tr=dt.className,ur=dt.closeIcon,Sr=ur!==!1&&ur!==null,Nr=ur!==void 0&&ur!==!0?ur:he.createElement("span",{className:"".concat(st,"-close-x")},"\xD7");return he.createElement("div",{className:Z()("".concat(st,"-content"),tr)},he.createElement("div",{className:"".concat(st,"-inner")},Sr&&he.createElement("button",{type:"button",onClick:Jt,"aria-label":"Close",className:"".concat(st,"-close")},Nr),he.createElement("div",{className:"".concat(st,"-header")},he.createElement("div",{className:"".concat(st,"-title")},kt)),he.createElement("div",{className:"".concat(st,"-description")},Yt),he.createElement("div",{className:"".concat(st,"-footer")},he.createElement("div",{className:"".concat(st,"-sliders")},Mt>1?(0,u.Z)(Array.from({length:Mt}).keys()).map(function(sr,Wt){return he.createElement("span",{key:sr,className:Wt===Et?"active":""})}):null),he.createElement("div",{className:"".concat(st,"-buttons")},Et!==0?he.createElement("button",{className:"".concat(st,"-prev-btn"),onClick:hr},"Prev"):null,Et===Mt-1?he.createElement("button",{className:"".concat(st,"-finish-btn"),onClick:dr},"Finish"):he.createElement("button",{className:"".concat(st,"-next-btn"),onClick:$t},"Next")))))}var te=function(st){var Et=st.current,Mt=st.renderPanel;return he.createElement(he.Fragment,null,typeof Mt=="function"?Mt(st,Et):he.createElement(ne,st))},T=te,I=["prefixCls","steps","defaultCurrent","current","onChange","onClose","onFinish","open","mask","arrow","rootClassName","placement","renderPanel","gap","animated","scrollIntoViewOptions","zIndex","closeIcon"],re={left:"50%",top:"50%",width:1,height:1},q=function(st){var Et=st.prefixCls,Mt=Et===void 0?"rc-tour":Et,kt=st.steps,Yt=kt===void 0?[]:kt,Jt=st.defaultCurrent,hr=st.current,$t=st.onChange,dr=st.onClose,tr=st.onFinish,ur=st.open,Sr=st.mask,Nr=Sr===void 0?!0:Sr,sr=st.arrow,Wt=sr===void 0?!0:sr,xt=st.rootClassName,rr=st.placement,_r=st.renderPanel,vr=st.gap,Zt=st.animated,Fr=st.scrollIntoViewOptions,Er=Fr===void 0?!0:Fr,Wr=st.zIndex,at=Wr===void 0?1001:Wr,Ht=st.closeIcon,Vi=(0,g.Z)(st,I),li=he.useRef(),ci=(0,$.Z)(0,{value:hr,defaultValue:Jt}),Yn=(0,p.Z)(ci,2),mi=Yn[0],Gt=Yn[1],_o=(0,$.Z)(void 0,{value:ur,postState:function(Kn){return mi<0||mi>=Yt.length?!1:Kn!=null?Kn:!0}}),Bi=(0,p.Z)(_o,2),Zn=Bi[0],Un=Bi[1],Jn=he.useRef(Zn);(0,m.Z)(function(){Zn&&!Jn.current&&Gt(0),Jn.current=Zn},[Zn]);var ln=Yt[mi]||{},gi=ln.target,fs=ln.placement,xa=ln.style,No=ln.arrow,Gs=ln.className,Fo=ln.mask,zo=ln.scrollIntoViewOptions,Ho=ln.closeIcon,wo=Zn&&(Fo!=null?Fo:Nr),Sa=Ho!=null?Ho:Ht,hs=zo!=null?zo:Er,An=Y(gi,ur,vr,hs),Vs=(0,p.Z)(An,2),Xs=Vs[0],Ti=Vs[1],so=ye(Ti,rr,fs),Wn=Ti?typeof No=="undefined"?Wt:No:!1,ao=(0,E.Z)(Wn)==="object"?Wn.pointAtCenter:!1;(0,m.Z)(function(){var qn;(qn=li.current)===null||qn===void 0||qn.forceAlign()},[ao,mi]);var Uo=function(Kn){Gt(Kn),$t==null||$t(Kn)};if(Ti===void 0)return null;var Wo=function(){Un(!1),dr==null||dr(mi)},Ko=function(){return he.createElement(T,(0,M.Z)({arrow:Wn,key:"content",prefixCls:Mt,total:Yt.length,renderPanel:_r,onPrev:function(){Uo(mi-1)},onNext:function(){Uo(mi+1)},onClose:Wo,current:mi,onFinish:function(){Wo(),tr==null||tr()},closeIcon:Sa},Yt[mi]))},Ni=typeof wo=="boolean"?wo:!!wo,Fi=typeof wo=="boolean"?void 0:wo,Xi=function(Kn){return Kn||Ti||document.body};return he.createElement(he.Fragment,null,he.createElement(be,{zIndex:at,prefixCls:Mt,pos:Xs,showMask:Ni,style:Fi==null?void 0:Fi.style,fill:Fi==null?void 0:Fi.color,open:Zn,animated:Zt,rootClassName:xt}),he.createElement(ee.Z,(0,M.Z)({builtinPlacements:Pe(ao)},Vi,{ref:li,popupStyle:xa,popupPlacement:so,popupVisible:Zn,popupClassName:Z()(xt,Gs),prefixCls:Mt,popup:Ko,forceRender:!1,destroyPopupOnHide:!0,zIndex:at,getTriggerDOMNode:Xi,arrow:!!Wn}),he.createElement(G,{open:Zn,autoLock:!0},he.createElement("div",{className:Z()(xt,"".concat(Mt,"-target-placeholder")),style:(0,i.Z)((0,i.Z)({},Xs||re),{},{position:"fixed",pointerEvents:"none"})}))))},z=q,W=z,V=Q(80636),se=Q(53124),ge=Q(46605),Me=Q(73475),Fe=Q(71577),Re=Q(10110),$e=Q(24457),lt=Q(69760);function Ne(dt){return dt!=null}var We=dt=>{let{stepProps:st,current:Et,type:Mt,indicatorsRender:kt,closeIcon:Yt}=dt;var Jt,hr;const{prefixCls:$t,total:dr=1,title:tr,onClose:ur,onPrev:Sr,onNext:Nr,onFinish:sr,cover:Wt,description:xt,nextButtonProps:rr,prevButtonProps:_r,type:vr,className:Zt,closeIcon:Fr}=st,Er=vr!=null?vr:Mt,Wr=Fr!=null?Fr:Yt,at=Wr!==!1&&Wr!==null,[Ht,Vi]=(0,lt.Z)(at,Wr,ln=>he.createElement("span",{onClick:ur,"aria-label":"Close",className:`${$t}-close`},ln),he.createElement(Me.Z,{className:`${$t}-close-icon`}),!0),li=Et===dr-1,ci=()=>{var ln;Sr==null||Sr(),(ln=_r==null?void 0:_r.onClick)===null||ln===void 0||ln.call(_r)},Yn=()=>{var ln;li?sr==null||sr():Nr==null||Nr(),(ln=rr==null?void 0:rr.onClick)===null||ln===void 0||ln.call(rr)},mi=Ne(tr)?he.createElement("div",{className:`${$t}-header`},he.createElement("div",{className:`${$t}-title`},tr)):null,Gt=Ne(xt)?he.createElement("div",{className:`${$t}-description`},xt):null,_o=Ne(Wt)?he.createElement("div",{className:`${$t}-cover`},Wt):null;let Bi;kt?Bi=kt(Et,dr):Bi=(0,u.Z)(Array.from({length:dr}).keys()).map((ln,gi)=>he.createElement("span",{key:ln,className:Z()(gi===Et&&`${$t}-indicator-active`,`${$t}-indicator`)}));const Zn=Er==="primary"?"default":"primary",Un={type:"default",ghost:Er==="primary"},[Jn]=(0,Re.Z)("Tour",$e.Z.Tour);return he.createElement("div",{className:Z()(Zt,`${$t}-content`)},he.createElement("div",{className:`${$t}-inner`},Ht&&Vi,_o,mi,Gt,he.createElement("div",{className:`${$t}-footer`},dr>1&&he.createElement("div",{className:`${$t}-indicators`},Bi),he.createElement("div",{className:`${$t}-buttons`},Et!==0?he.createElement(Fe.ZP,Object.assign({},Un,_r,{onClick:ci,size:"small",className:Z()(`${$t}-prev-btn`,_r==null?void 0:_r.className)}),(Jt=_r==null?void 0:_r.children)!==null&&Jt!==void 0?Jt:Jn==null?void 0:Jn.Previous):null,he.createElement(Fe.ZP,Object.assign({type:Zn},rr,{onClick:Yn,size:"small",className:Z()(`${$t}-next-btn`,rr==null?void 0:rr.className)}),(hr=rr==null?void 0:rr.children)!==null&&hr!==void 0?hr:li?Jn==null?void 0:Jn.Finish:Jn==null?void 0:Jn.Next)))))},nt=Q(66330),qe=Q(84780),Qe=Q(14747),ft=Q(97414),vt=Q(67968),bt=Q(45503);const Tt=dt=>{const{componentCls:st,lineHeight:Et,padding:Mt,paddingXS:kt,borderRadius:Yt,borderRadiusXS:Jt,colorPrimary:hr,colorText:$t,colorFill:dr,indicatorHeight:tr,indicatorWidth:ur,boxShadowTertiary:Sr,tourZIndexPopup:Nr,fontSize:sr,colorBgElevated:Wt,fontWeightStrong:xt,marginXS:rr,colorTextLightSolid:_r,tourBorderRadius:vr,colorWhite:Zt,colorBgTextHover:Fr,tourCloseSize:Er,motionDurationSlow:Wr,antCls:at}=dt;return[{[st]:Object.assign(Object.assign({},(0,Qe.Wf)(dt)),{color:$t,position:"absolute",zIndex:Nr,display:"block",visibility:"visible",fontSize:sr,lineHeight:Et,width:520,"--antd-arrow-background-color":Wt,"&-pure":{maxWidth:"100%",position:"relative"},[`&${st}-hidden`]:{display:"none"},[`${st}-content`]:{position:"relative"},[`${st}-inner`]:{textAlign:"start",textDecoration:"none",borderRadius:vr,boxShadow:Sr,position:"relative",backgroundColor:Wt,border:"none",backgroundClip:"padding-box",[`${st}-close`]:{position:"absolute",top:Mt,insetInlineEnd:Mt,color:dt.colorIcon,outline:"none",width:Er,height:Er,borderRadius:dt.borderRadiusSM,transition:`background-color ${dt.motionDurationMid}, color ${dt.motionDurationMid}`,display:"flex",alignItems:"center",justifyContent:"center","&:hover":{color:dt.colorIconHover,backgroundColor:dt.wireframe?"transparent":dt.colorFillContent}},[`${st}-cover`]:{textAlign:"center",padding:`${Mt+Er+kt}px ${Mt}px 0`,img:{width:"100%"}},[`${st}-header`]:{padding:`${Mt}px ${Mt}px ${kt}px`,[`${st}-title`]:{lineHeight:Et,fontSize:sr,fontWeight:xt}},[`${st}-description`]:{padding:`0 ${Mt}px`,lineHeight:Et,wordWrap:"break-word"},[`${st}-footer`]:{padding:`${kt}px ${Mt}px ${Mt}px`,textAlign:"end",borderRadius:`0 0 ${Jt}px ${Jt}px`,display:"flex",[`${st}-indicators`]:{display:"inline-block",[`${st}-indicator`]:{width:ur,height:tr,display:"inline-block",borderRadius:"50%",background:dr,"&:not(:last-child)":{marginInlineEnd:tr},"&-active":{background:hr}}},[`${st}-buttons`]:{marginInlineStart:"auto",[`${at}-btn`]:{marginInlineStart:rr}}}},[`${st}-primary, &${st}-primary`]:{"--antd-arrow-background-color":hr,[`${st}-inner`]:{color:_r,textAlign:"start",textDecoration:"none",backgroundColor:hr,borderRadius:Yt,boxShadow:Sr,[`${st}-close`]:{color:_r},[`${st}-indicators`]:{[`${st}-indicator`]:{background:new qe.C(_r).setAlpha(.15).toRgbString(),"&-active":{background:_r}}},[`${st}-prev-btn`]:{color:_r,borderColor:new qe.C(_r).setAlpha(.15).toRgbString(),backgroundColor:hr,"&:hover":{backgroundColor:new qe.C(_r).setAlpha(.15).toRgbString(),borderColor:"transparent"}},[`${st}-next-btn`]:{color:hr,borderColor:"transparent",background:Zt,"&:hover":{background:new qe.C(Fr).onBackground(Zt).toRgbString()}}}}}),[`${st}-mask`]:{[`${st}-placeholder-animated`]:{transition:`all ${Wr}`}},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${st}-inner`]:{borderRadius:Math.min(vr,ft.qN)}}},(0,ft.ZP)(dt,{colorBg:"var(--antd-arrow-background-color)",contentRadius:vr,limitVerticalRadius:!0})]};var kr=(0,vt.Z)("Tour",dt=>{const{borderRadiusLG:st,fontSize:Et,lineHeight:Mt}=dt,kt=(0,bt.TS)(dt,{tourZIndexPopup:dt.zIndexPopupBase+70,indicatorWidth:6,indicatorHeight:6,tourBorderRadius:st,tourCloseSize:Et*Mt});return[Tt(kt)]}),jr=Q(8745),xn=function(dt,st){var Et={};for(var Mt in dt)Object.prototype.hasOwnProperty.call(dt,Mt)&&st.indexOf(Mt)<0&&(Et[Mt]=dt[Mt]);if(dt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var kt=0,Mt=Object.getOwnPropertySymbols(dt);kt<Mt.length;kt++)st.indexOf(Mt[kt])<0&&Object.prototype.propertyIsEnumerable.call(dt,Mt[kt])&&(Et[Mt[kt]]=dt[Mt[kt]]);return Et};const on=dt=>{const{prefixCls:st,current:Et=0,total:Mt=6,className:kt,style:Yt,type:Jt}=dt,hr=xn(dt,["prefixCls","current","total","className","style","type"]),{getPrefixCls:$t}=he.useContext(se.E_),dr=$t("tour",st),[tr,ur]=kr(dr);return tr(he.createElement(nt.t5,{prefixCls:dr,hashId:ur,className:Z()(kt,`${dr}-pure`,Jt&&`${dr}-${Jt}`),style:Yt},he.createElement(We,{stepProps:Object.assign(Object.assign({},hr),{prefixCls:dr,total:Mt}),current:Et,type:Jt})))};var er=(0,jr.i)(on),In=Q(5663),Gi=dt=>{let{defaultType:st,steps:Et=[],current:Mt,defaultCurrent:kt}=dt;var Yt;const[Jt,hr]=(0,In.Z)(kt,{value:Mt});(0,he.useLayoutEffect)(()=>{Mt!==void 0&&hr(Mt)},[Mt]);const $t=typeof Jt=="number"?(Yt=Et[Jt])===null||Yt===void 0?void 0:Yt.type:st;return{currentMergedType:$t!=null?$t:st,updateInnerCurrent:hr}},Bo=function(dt,st){var Et={};for(var Mt in dt)Object.prototype.hasOwnProperty.call(dt,Mt)&&st.indexOf(Mt)<0&&(Et[Mt]=dt[Mt]);if(dt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var kt=0,Mt=Object.getOwnPropertySymbols(dt);kt<Mt.length;kt++)st.indexOf(Mt[kt])<0&&Object.prototype.propertyIsEnumerable.call(dt,Mt[kt])&&(Et[Mt[kt]]=dt[Mt[kt]]);return Et};const Sn=dt=>{const{prefixCls:st,current:Et,defaultCurrent:Mt,type:kt,rootClassName:Yt,indicatorsRender:Jt,steps:hr}=dt,$t=Bo(dt,["prefixCls","current","defaultCurrent","type","rootClassName","indicatorsRender","steps"]),{getPrefixCls:dr,direction:tr}=(0,he.useContext)(se.E_),ur=dr("tour",st),[Sr,Nr]=kr(ur),[,sr]=(0,ge.Z)(),{currentMergedType:Wt,updateInnerCurrent:xt}=Gi({defaultType:kt,steps:hr,current:Et,defaultCurrent:Mt}),rr=(0,V.Z)({arrowPointAtCenter:!0,autoAdjustOverflow:!0,offset:sr.marginXXS,arrowWidth:sr.sizePopupArrow,borderRadius:sr.borderRadius}),_r=Z()({[`${ur}-primary`]:Wt==="primary",[`${ur}-rtl`]:tr==="rtl"},Nr,Yt),vr=(Fr,Er)=>he.createElement(We,{type:kt,stepProps:Fr,current:Er,indicatorsRender:Jt}),Zt=Fr=>{var Er;xt(Fr),(Er=dt.onChange)===null||Er===void 0||Er.call(dt,Fr)};return Sr(he.createElement(W,Object.assign({},$t,{rootClassName:_r,prefixCls:ur,current:Et,defaultCurrent:Mt,animated:!0,renderPanel:vr,builtinPlacements:rr,onChange:Zt,steps:hr})))};Sn._InternalPanelDoNotUseOrYouWillBeFired=er;var Kt=Sn},88386:function(It,Ue,Q){(function(he){he(Q(4631))})(function(he){he.defineOption("placeholder","",function(l,h,v){var d=v&&v!=he.Init;if(h&&!d)l.on("blur",E),l.on("change",p),l.on("swapDoc",p),he.on(l.getInputField(),"compositionupdate",l.state.placeholderCompose=function(){M(l)}),p(l);else if(!h&&d){l.off("blur",E),l.off("change",p),l.off("swapDoc",p),he.off(l.getInputField(),"compositionupdate",l.state.placeholderCompose),fe(l);var o=l.getWrapperElement();o.className=o.className.replace(" CodeMirror-empty","")}h&&!l.hasFocus()&&E(l)});function fe(l){l.state.placeholder&&(l.state.placeholder.parentNode.removeChild(l.state.placeholder),l.state.placeholder=null)}function i(l){fe(l);var h=l.state.placeholder=document.createElement("pre");h.style.cssText="height: 0; overflow: visible",h.style.direction=l.getOption("direction"),h.className="CodeMirror-placeholder CodeMirror-line-like";var v=l.getOption("placeholder");typeof v=="string"&&(v=document.createTextNode(v)),h.appendChild(v),l.display.lineSpace.insertBefore(h,l.display.lineSpace.firstChild)}function M(l){setTimeout(function(){var h=!1,v=l.getInputField();v.nodeName=="TEXTAREA"?h=!v.value:l.lineCount()==1&&(h=!/[^\u200b]/.test(v.querySelector(".CodeMirror-line").textContent)),h?i(l):fe(l)},20)}function E(l){g(l)&&i(l)}function p(l){var h=l.getWrapperElement(),v=g(l);h.className=h.className.replace(" CodeMirror-empty","")+(v?" CodeMirror-empty":""),v?i(l):fe(l)}function g(l){return l.lineCount()===1&&l.getLine(0)===""}})},82801:function(It,Ue,Q){(function(he){he(Q(4631))})(function(he){var fe={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},i=he.Pos;he.defineOption("autoCloseBrackets",!1,function(m,y,_){_&&_!=he.Init&&(m.removeKeyMap(E),m.state.closeBrackets=null),y&&(p(M(y,"pairs")),m.state.closeBrackets=y,m.addKeyMap(E))});function M(m,y){return y=="pairs"&&typeof m=="string"?m:typeof m=="object"&&m[y]!=null?m[y]:fe[y]}var E={Backspace:h,Enter:v};function p(m){for(var y=0;y<m.length;y++){var _=m.charAt(y),x="'"+_+"'";E[x]||(E[x]=g(_))}}p(fe.pairs+"`");function g(m){return function(y){return o(y,m)}}function l(m){var y=m.state.closeBrackets;if(!y||y.override)return y;var _=m.getModeAt(m.getCursor());return _.closeBrackets||y}function h(m){var y=l(m);if(!y||m.getOption("disableInput"))return he.Pass;for(var _=M(y,"pairs"),x=m.listSelections(),S=0;S<x.length;S++){if(!x[S].empty())return he.Pass;var w=s(m,x[S].head);if(!w||_.indexOf(w)%2!=0)return he.Pass}for(var S=x.length-1;S>=0;S--){var A=x[S].head;m.replaceRange("",i(A.line,A.ch-1),i(A.line,A.ch+1),"+delete")}}function v(m){var y=l(m),_=y&&M(y,"explode");if(!_||m.getOption("disableInput"))return he.Pass;for(var x=m.listSelections(),S=0;S<x.length;S++){if(!x[S].empty())return he.Pass;var w=s(m,x[S].head);if(!w||_.indexOf(w)%2!=0)return he.Pass}m.operation(function(){var A=m.lineSeparator()||`
`;m.replaceSelection(A+A,null),m.execCommand("goCharLeft"),x=m.listSelections();for(var H=0;H<x.length;H++){var R=x[H].head.line;m.indentLine(R,null,!0),m.indentLine(R+1,null,!0)}})}function d(m){var y=he.cmpPos(m.anchor,m.head)>0;return{anchor:new i(m.anchor.line,m.anchor.ch+(y?-1:1)),head:new i(m.head.line,m.head.ch+(y?1:-1))}}function o(m,y){var _=l(m);if(!_||m.getOption("disableInput"))return he.Pass;var x=M(_,"pairs"),S=x.indexOf(y);if(S==-1)return he.Pass;for(var w=M(_,"closeBefore"),A=M(_,"triples"),H=x.charAt(S+1)==y,R=m.listSelections(),F=S%2==0,D,B=0;B<R.length;B++){var P=R[B],U=P.head,G,ee=m.getRange(U,i(U.line,U.ch+1));if(F&&!P.empty())G="surround";else if((H||!F)&&ee==y)H&&u(m,U)?G="both":A.indexOf(y)>=0&&m.getRange(U,i(U.line,U.ch+3))==y+y+y?G="skipThree":G="skip";else if(H&&U.ch>1&&A.indexOf(y)>=0&&m.getRange(i(U.line,U.ch-2),U)==y+y){if(U.ch>2&&/\bstring/.test(m.getTokenTypeAt(i(U.line,U.ch-2))))return he.Pass;G="addFour"}else if(H){var K=U.ch==0?" ":m.getRange(i(U.line,U.ch-1),U);if(!he.isWordChar(ee)&&K!=y&&!he.isWordChar(K))G="both";else return he.Pass}else if(F&&(ee.length===0||/\s/.test(ee)||w.indexOf(ee)>-1))G="both";else return he.Pass;if(!D)D=G;else if(D!=G)return he.Pass}var Z=S%2?x.charAt(S-1):y,$=S%2?y:x.charAt(S+1);m.operation(function(){if(D=="skip")m.execCommand("goCharRight");else if(D=="skipThree")for(var oe=0;oe<3;oe++)m.execCommand("goCharRight");else if(D=="surround"){for(var ae=m.getSelections(),oe=0;oe<ae.length;oe++)ae[oe]=Z+ae[oe]+$;m.replaceSelections(ae,"around"),ae=m.listSelections().slice();for(var oe=0;oe<ae.length;oe++)ae[oe]=d(ae[oe]);m.setSelections(ae)}else D=="both"?(m.replaceSelection(Z+$,null),m.triggerElectric(Z+$),m.execCommand("goCharLeft")):D=="addFour"&&(m.replaceSelection(Z+Z+Z+Z,"before"),m.execCommand("goCharRight"))})}function s(m,y){var _=m.getRange(i(y.line,y.ch-1),i(y.line,y.ch+1));return _.length==2?_:null}function u(m,y){var _=m.getTokenAt(i(y.line,y.ch+1));return/\bstring/.test(_.type)&&_.start==y.ch&&(y.ch==0||!/\bstring/.test(m.getTokenTypeAt(y)))}})},57341:function(It,Ue,Q){(function(he){he(Q(4631),Q(4786))})(function(he){he.defineOption("autoCloseTags",!1,function(h,v,d){if(d!=he.Init&&d&&h.removeKeyMap("autoCloseTags"),!!v){var o={name:"autoCloseTags"};(typeof v!="object"||v.whenClosing!==!1)&&(o["'/'"]=function(s){return p(s)}),(typeof v!="object"||v.whenOpening!==!1)&&(o["'>'"]=function(s){return M(s)}),h.addKeyMap(o)}});var fe=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],i=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function M(h){if(h.getOption("disableInput"))return he.Pass;for(var v=h.listSelections(),d=[],o=h.getOption("autoCloseTags"),s=0;s<v.length;s++){if(!v[s].empty())return he.Pass;var u=v[s].head,m=h.getTokenAt(u),y=he.innerMode(h.getMode(),m.state),_=y.state,x=y.mode.xmlCurrentTag&&y.mode.xmlCurrentTag(_),S=x&&x.name;if(!S)return he.Pass;var w=y.mode.configuration=="html",A=typeof o=="object"&&o.dontCloseTags||w&&fe,H=typeof o=="object"&&o.indentTags||w&&i;m.end>u.ch&&(S=S.slice(0,S.length-m.end+u.ch));var R=S.toLowerCase();if(!S||m.type=="string"&&(m.end!=u.ch||!/[\"\']/.test(m.string.charAt(m.string.length-1))||m.string.length==1)||m.type=="tag"&&x.close||m.string.indexOf("/")==u.ch-m.start-1||A&&g(A,R)>-1||l(h,y.mode.xmlCurrentContext&&y.mode.xmlCurrentContext(_)||[],S,u,!0))return he.Pass;var F=typeof o=="object"&&o.emptyTags;if(F&&g(F,S)>-1){d[s]={text:"/>",newPos:he.Pos(u.line,u.ch+2)};continue}var D=H&&g(H,R)>-1;d[s]={indent:D,text:">"+(D?`
`:"")+"</"+S+">",newPos:D?he.Pos(u.line+1,0):he.Pos(u.line,u.ch+1)}}for(var B=typeof o=="object"&&o.dontIndentOnAutoClose,s=v.length-1;s>=0;s--){var P=d[s];h.replaceRange(P.text,v[s].head,v[s].anchor,"+insert");var U=h.listSelections().slice(0);U[s]={head:P.newPos,anchor:P.newPos},h.setSelections(U),!B&&P.indent&&(h.indentLine(P.newPos.line,null,!0),h.indentLine(P.newPos.line+1,null,!0))}}function E(h,v){for(var d=h.listSelections(),o=[],s=v?"/":"</",u=h.getOption("autoCloseTags"),m=typeof u=="object"&&u.dontIndentOnSlash,y=0;y<d.length;y++){if(!d[y].empty())return he.Pass;var _=d[y].head,x=h.getTokenAt(_),S=he.innerMode(h.getMode(),x.state),w=S.state;if(v&&(x.type=="string"||x.string.charAt(0)!="<"||x.start!=_.ch-1))return he.Pass;var A,H=S.mode.name!="xml"&&h.getMode().name=="htmlmixed";if(H&&S.mode.name=="javascript")A=s+"script";else if(H&&S.mode.name=="css")A=s+"style";else{var R=S.mode.xmlCurrentContext&&S.mode.xmlCurrentContext(w);if(!R||R.length&&l(h,R,R[R.length-1],_))return he.Pass;A=s+R[R.length-1]}h.getLine(_.line).charAt(x.end)!=">"&&(A+=">"),o[y]=A}if(h.replaceSelections(o),d=h.listSelections(),!m)for(var y=0;y<d.length;y++)(y==d.length-1||d[y].head.line<d[y+1].head.line)&&h.indentLine(d[y].head.line)}function p(h){return h.getOption("disableInput")?he.Pass:E(h,!0)}he.commands.closeTag=function(h){return E(h)};function g(h,v){if(h.indexOf)return h.indexOf(v);for(var d=0,o=h.length;d<o;++d)if(h[d]==v)return d;return-1}function l(h,v,d,o,s){if(!he.scanForClosingTag)return!1;var u=Math.min(h.lastLine()+1,o.line+500),m=he.scanForClosingTag(h,o,null,u);if(!m||m.tag!=d)return!1;for(var y=s?1:0,_=v.length-1;_>=0&&v[_]==d;_--)++y;o=m.to;for(var _=1;_<y;_++){var x=he.scanForClosingTag(h,o,null,u);if(!x||x.tag!=d)return!1;o=x.to}return!0}})},4786:function(It,Ue,Q){(function(he){he(Q(4631))})(function(he){"use strict";var fe=he.Pos;function i(_,x){return _.line-x.line||_.ch-x.ch}var M="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",E=M+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",p=new RegExp("<(/?)(["+M+"]["+E+"]*)","g");function g(_,x,S,w){this.line=x,this.ch=S,this.cm=_,this.text=_.getLine(x),this.min=w?Math.max(w.from,_.firstLine()):_.firstLine(),this.max=w?Math.min(w.to-1,_.lastLine()):_.lastLine()}function l(_,x){var S=_.cm.getTokenTypeAt(fe(_.line,x));return S&&/\btag\b/.test(S)}function h(_){if(!(_.line>=_.max))return _.ch=0,_.text=_.cm.getLine(++_.line),!0}function v(_){if(!(_.line<=_.min))return _.text=_.cm.getLine(--_.line),_.ch=_.text.length,!0}function d(_){for(;;){var x=_.text.indexOf(">",_.ch);if(x==-1){if(h(_))continue;return}if(!l(_,x+1)){_.ch=x+1;continue}var S=_.text.lastIndexOf("/",x),w=S>-1&&!/\S/.test(_.text.slice(S+1,x));return _.ch=x+1,w?"selfClose":"regular"}}function o(_){for(;;){var x=_.ch?_.text.lastIndexOf("<",_.ch-1):-1;if(x==-1){if(v(_))continue;return}if(!l(_,x+1)){_.ch=x;continue}p.lastIndex=x,_.ch=x;var S=p.exec(_.text);if(S&&S.index==x)return S}}function s(_){for(;;){p.lastIndex=_.ch;var x=p.exec(_.text);if(!x){if(h(_))continue;return}if(!l(_,x.index+1)){_.ch=x.index+1;continue}return _.ch=x.index+x[0].length,x}}function u(_){for(;;){var x=_.ch?_.text.lastIndexOf(">",_.ch-1):-1;if(x==-1){if(v(_))continue;return}if(!l(_,x+1)){_.ch=x;continue}var S=_.text.lastIndexOf("/",x),w=S>-1&&!/\S/.test(_.text.slice(S+1,x));return _.ch=x+1,w?"selfClose":"regular"}}function m(_,x){for(var S=[];;){var w=s(_),A,H=_.line,R=_.ch-(w?w[0].length:0);if(!w||!(A=d(_)))return;if(A!="selfClose")if(w[1]){for(var F=S.length-1;F>=0;--F)if(S[F]==w[2]){S.length=F;break}if(F<0&&(!x||x==w[2]))return{tag:w[2],from:fe(H,R),to:fe(_.line,_.ch)}}else S.push(w[2])}}function y(_,x){for(var S=[];;){var w=u(_);if(!w)return;if(w=="selfClose"){o(_);continue}var A=_.line,H=_.ch,R=o(_);if(!R)return;if(R[1])S.push(R[2]);else{for(var F=S.length-1;F>=0;--F)if(S[F]==R[2]){S.length=F;break}if(F<0&&(!x||x==R[2]))return{tag:R[2],from:fe(_.line,_.ch),to:fe(A,H)}}}}he.registerHelper("fold","xml",function(_,x){for(var S=new g(_,x.line,0);;){var w=s(S);if(!w||S.line!=x.line)return;var A=d(S);if(!A)return;if(!w[1]&&A!="selfClose"){var H=fe(S.line,S.ch),R=m(S,w[2]);return R&&i(R.from,H)>0?{from:H,to:R.from}:null}}}),he.findMatchingTag=function(_,x,S){var w=new g(_,x.line,x.ch,S);if(!(w.text.indexOf(">")==-1&&w.text.indexOf("<")==-1)){var A=d(w),H=A&&fe(w.line,w.ch),R=A&&o(w);if(!(!A||!R||i(w,x)>0)){var F={from:fe(w.line,w.ch),to:H,tag:R[2]};return A=="selfClose"?{open:F,close:null,at:"open"}:R[1]?{open:y(w,R[2]),close:F,at:"close"}:(w=new g(_,H.line,H.ch,S),{open:F,close:m(w,R[2]),at:"open"})}}},he.findEnclosingTag=function(_,x,S,w){for(var A=new g(_,x.line,x.ch,S);;){var H=y(A,w);if(!H)break;var R=new g(_,x.line,x.ch,S),F=m(R,H.tag);if(F)return{open:H,close:F}}},he.scanForClosingTag=function(_,x,S,w){var A=new g(_,x.line,x.ch,w?{from:0,to:w}:null);return m(A,S)}})},4631:function(It){(function(Ue,Q){It.exports=Q()})(this,function(){"use strict";var Ue=navigator.userAgent,Q=navigator.platform,he=/gecko\/\d/i.test(Ue),fe=/MSIE \d/.test(Ue),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ue),M=/Edge\/(\d+)/.exec(Ue),E=fe||i||M,p=E&&(fe?document.documentMode||6:+(M||i)[1]),g=!M&&/WebKit\//.test(Ue),l=g&&/Qt\/\d+\.\d+/.test(Ue),h=!M&&/Chrome\//.test(Ue),v=/Opera\//.test(Ue),d=/Apple Computer/.test(navigator.vendor),o=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Ue),s=/PhantomJS/.test(Ue),u=!M&&/AppleWebKit/.test(Ue)&&/Mobile\/\w+/.test(Ue),m=/Android/.test(Ue),y=u||m||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Ue),_=u||/Mac/.test(Q),x=/\bCrOS\b/.test(Ue),S=/win/i.test(Q),w=v&&Ue.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(v=!1,g=!0);var A=_&&(l||v&&(w==null||w<12.11)),H=he||E&&p>=9;function R(n){return new RegExp("(^|\\s)"+n+"(?:$|\\s)\\s*")}var F=function(n,c){var k=n.className,C=R(c).exec(k);if(C){var O=k.slice(C.index+C[0].length);n.className=k.slice(0,C.index)+(O?C[1]+O:"")}};function D(n){for(var c=n.childNodes.length;c>0;--c)n.removeChild(n.firstChild);return n}function B(n,c){return D(n).appendChild(c)}function P(n,c,k,C){var O=document.createElement(n);if(k&&(O.className=k),C&&(O.style.cssText=C),typeof c=="string")O.appendChild(document.createTextNode(c));else if(c)for(var X=0;X<c.length;++X)O.appendChild(c[X]);return O}function U(n,c,k,C){var O=P(n,c,k,C);return O.setAttribute("role","presentation"),O}var G;document.createRange?G=function(n,c,k,C){var O=document.createRange();return O.setEnd(C||n,k),O.setStart(n,c),O}:G=function(n,c,k){var C=document.body.createTextRange();try{C.moveToElementText(n.parentNode)}catch(O){return C}return C.collapse(!0),C.moveEnd("character",k),C.moveStart("character",c),C};function ee(n,c){if(c.nodeType==3&&(c=c.parentNode),n.contains)return n.contains(c);do if(c.nodeType==11&&(c=c.host),c==n)return!0;while(c=c.parentNode)}function K(){var n;try{n=document.activeElement}catch(c){n=document.body||null}for(;n&&n.shadowRoot&&n.shadowRoot.activeElement;)n=n.shadowRoot.activeElement;return n}function Z(n,c){var k=n.className;R(c).test(k)||(n.className+=(k?" ":"")+c)}function $(n,c){for(var k=n.split(" "),C=0;C<k.length;C++)k[C]&&!R(k[C]).test(c)&&(c+=" "+k[C]);return c}var oe=function(n){n.select()};u?oe=function(n){n.selectionStart=0,n.selectionEnd=n.value.length}:E&&(oe=function(n){try{n.select()}catch(c){}});function ae(n){var c=Array.prototype.slice.call(arguments,1);return function(){return n.apply(null,c)}}function ye(n,c,k){c||(c={});for(var C in n)n.hasOwnProperty(C)&&(k!==!1||!c.hasOwnProperty(C))&&(c[C]=n[C]);return c}function Y(n,c,k,C,O){c==null&&(c=n.search(/[^\s\u00a0]/),c==-1&&(c=n.length));for(var X=C||0,ce=O||0;;){var me=n.indexOf(" ",X);if(me<0||me>=c)return ce+(c-X);ce+=me-X,ce+=k-ce%k,X=me+1}}var le=function(){this.id=null,this.f=null,this.time=0,this.handler=ae(this.onTimeout,this)};le.prototype.onTimeout=function(n){n.id=0,n.time<=+new Date?n.f():setTimeout(n.handler,n.time-+new Date)},le.prototype.set=function(n,c){this.f=c;var k=+new Date+n;(!this.id||k<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,n),this.time=k)};function xe(n,c){for(var k=0;k<n.length;++k)if(n[k]==c)return k;return-1}var Ce=50,we={toString:function(){return"CodeMirror.Pass"}},Le={scroll:!1},de={origin:"*mouse"},be={origin:"+move"};function Te(n,c,k){for(var C=0,O=0;;){var X=n.indexOf(" ",C);X==-1&&(X=n.length);var ce=X-C;if(X==n.length||O+ce>=c)return C+Math.min(ce,c-O);if(O+=X-C,O+=k-O%k,C=X+1,O>=c)return C}}var Ae=[""];function Be(n){for(;Ae.length<=n;)Ae.push(Pe(Ae)+" ");return Ae[n]}function Pe(n){return n[n.length-1]}function _e(n,c){for(var k=[],C=0;C<n.length;C++)k[C]=c(n[C],C);return k}function ne(n,c,k){for(var C=0,O=k(c);C<n.length&&k(n[C])<=O;)C++;n.splice(C,0,c)}function te(){}function T(n,c){var k;return Object.create?k=Object.create(n):(te.prototype=n,k=new te),c&&ye(c,k),k}var I=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function re(n){return/\w/.test(n)||n>"\x80"&&(n.toUpperCase()!=n.toLowerCase()||I.test(n))}function q(n,c){return c?c.source.indexOf("\\w")>-1&&re(n)?!0:c.test(n):re(n)}function z(n){for(var c in n)if(n.hasOwnProperty(c)&&n[c])return!1;return!0}var W=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function V(n){return n.charCodeAt(0)>=768&&W.test(n)}function se(n,c,k){for(;(k<0?c>0:c<n.length)&&V(n.charAt(c));)c+=k;return c}function ge(n,c,k){for(var C=c>k?-1:1;;){if(c==k)return c;var O=(c+k)/2,X=C<0?Math.ceil(O):Math.floor(O);if(X==c)return n(X)?c:k;n(X)?k=X:c=X+C}}function Me(n,c,k,C){if(!n)return C(c,k,"ltr",0);for(var O=!1,X=0;X<n.length;++X){var ce=n[X];(ce.from<k&&ce.to>c||c==k&&ce.to==c)&&(C(Math.max(ce.from,c),Math.min(ce.to,k),ce.level==1?"rtl":"ltr",X),O=!0)}O||C(c,k,"ltr")}var Fe=null;function Re(n,c,k){var C;Fe=null;for(var O=0;O<n.length;++O){var X=n[O];if(X.from<c&&X.to>c)return O;X.to==c&&(X.from!=X.to&&k=="before"?C=O:Fe=O),X.from==c&&(X.from!=X.to&&k!="before"?C=O:Fe=O)}return C!=null?C:Fe}var $e=function(){var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",c="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function k(ke){return ke<=247?n.charAt(ke):1424<=ke&&ke<=1524?"R":1536<=ke&&ke<=1785?c.charAt(ke-1536):1774<=ke&&ke<=2220?"r":8192<=ke&&ke<=8203?"w":ke==8204?"b":"L"}var C=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,O=/[stwN]/,X=/[LRr]/,ce=/[Lb1n]/,me=/[1n]/;function ve(ke,Ie,He){this.level=ke,this.from=Ie,this.to=He}return function(ke,Ie){var He=Ie=="ltr"?"L":"R";if(ke.length==0||Ie=="ltr"&&!C.test(ke))return!1;for(var Ve=ke.length,Ke=[],rt=0;rt<Ve;++rt)Ke.push(k(ke.charCodeAt(rt)));for(var ut=0,yt=He;ut<Ve;++ut){var Ct=Ke[ut];Ct=="m"?Ke[ut]=yt:yt=Ct}for(var At=0,St=He;At<Ve;++At){var Lt=Ke[At];Lt=="1"&&St=="r"?Ke[At]="n":X.test(Lt)&&(St=Lt,Lt=="r"&&(Ke[At]="R"))}for(var Nt=1,zt=Ke[0];Nt<Ve-1;++Nt){var lr=Ke[Nt];lr=="+"&&zt=="1"&&Ke[Nt+1]=="1"?Ke[Nt]="1":lr==","&&zt==Ke[Nt+1]&&(zt=="1"||zt=="n")&&(Ke[Nt]=zt),zt=lr}for(var qr=0;qr<Ve;++qr){var Xn=Ke[qr];if(Xn==",")Ke[qr]="N";else if(Xn=="%"){var gn=void 0;for(gn=qr+1;gn<Ve&&Ke[gn]=="%";++gn);for(var ki=qr&&Ke[qr-1]=="!"||gn<Ve&&Ke[gn]=="1"?"1":"N",Ei=qr;Ei<gn;++Ei)Ke[Ei]=ki;qr=gn-1}}for(var Pn=0,Mi=He;Pn<Ve;++Pn){var qt=Ke[Pn];Mi=="L"&&qt=="1"?Ke[Pn]="L":X.test(qt)&&(Mi=qt)}for(var bn=0;bn<Ve;++bn)if(O.test(Ke[bn])){var vn=void 0;for(vn=bn+1;vn<Ve&&O.test(Ke[vn]);++vn);for(var _n=(bn?Ke[bn-1]:He)=="L",En=(vn<Ve?Ke[vn]:He)=="L",ga=_n==En?_n?"L":"R":He,Ri=bn;Ri<vn;++Ri)Ke[Ri]=ga;bn=vn-1}for(var ni=[],Dr,zn=0;zn<Ve;)if(ce.test(Ke[zn])){var pc=zn;for(++zn;zn<Ve&&ce.test(Ke[zn]);++zn);ni.push(new ve(0,pc,zn))}else{var ls=zn,Ps=ni.length,Do=Ie=="rtl"?1:0;for(++zn;zn<Ve&&Ke[zn]!="L";++zn);for(var Rn=ls;Rn<zn;)if(me.test(Ke[Rn])){ls<Rn&&(ni.splice(Ps,0,new ve(1,ls,Rn)),Ps+=Do);var va=Rn;for(++Rn;Rn<zn&&me.test(Ke[Rn]);++Rn);ni.splice(Ps,0,new ve(2,va,Rn)),Ps+=Do,ls=Rn}else++Rn;ls<zn&&ni.splice(Ps,0,new ve(1,ls,zn))}return Ie=="ltr"&&(ni[0].level==1&&(Dr=ke.match(/^\s+/))&&(ni[0].from=Dr[0].length,ni.unshift(new ve(0,0,Dr[0].length))),Pe(ni).level==1&&(Dr=ke.match(/\s+$/))&&(Pe(ni).to-=Dr[0].length,ni.push(new ve(0,Ve-Dr[0].length,Ve)))),Ie=="rtl"?ni.reverse():ni}}();function lt(n,c){var k=n.order;return k==null&&(k=n.order=$e(n.text,c)),k}var Ne=[],Ze=function(n,c,k){if(n.addEventListener)n.addEventListener(c,k,!1);else if(n.attachEvent)n.attachEvent("on"+c,k);else{var C=n._handlers||(n._handlers={});C[c]=(C[c]||Ne).concat(k)}};function We(n,c){return n._handlers&&n._handlers[c]||Ne}function nt(n,c,k){if(n.removeEventListener)n.removeEventListener(c,k,!1);else if(n.detachEvent)n.detachEvent("on"+c,k);else{var C=n._handlers,O=C&&C[c];if(O){var X=xe(O,k);X>-1&&(C[c]=O.slice(0,X).concat(O.slice(X+1)))}}}function qe(n,c){var k=We(n,c);if(k.length)for(var C=Array.prototype.slice.call(arguments,2),O=0;O<k.length;++O)k[O].apply(null,C)}function Qe(n,c,k){return typeof c=="string"&&(c={type:c,preventDefault:function(){this.defaultPrevented=!0}}),qe(n,k||c.type,n,c),jr(c)||c.codemirrorIgnore}function ft(n){var c=n._handlers&&n._handlers.cursorActivity;if(c)for(var k=n.curOp.cursorActivityHandlers||(n.curOp.cursorActivityHandlers=[]),C=0;C<c.length;++C)xe(k,c[C])==-1&&k.push(c[C])}function vt(n,c){return We(n,c).length>0}function bt(n){n.prototype.on=function(c,k){Ze(this,c,k)},n.prototype.off=function(c,k){nt(this,c,k)}}function Tt(n){n.preventDefault?n.preventDefault():n.returnValue=!1}function kr(n){n.stopPropagation?n.stopPropagation():n.cancelBubble=!0}function jr(n){return n.defaultPrevented!=null?n.defaultPrevented:n.returnValue==!1}function xn(n){Tt(n),kr(n)}function on(n){return n.target||n.srcElement}function er(n){var c=n.which;return c==null&&(n.button&1?c=1:n.button&2?c=3:n.button&4&&(c=2)),_&&n.ctrlKey&&c==1&&(c=3),c}var In=function(){if(E&&p<9)return!1;var n=P("div");return"draggable"in n||"dragDrop"in n}(),ji;function Gi(n){if(ji==null){var c=P("span","\u200B");B(n,P("span",[c,document.createTextNode("x")])),n.firstChild.offsetHeight!=0&&(ji=c.offsetWidth<=1&&c.offsetHeight>2&&!(E&&p<8))}var k=ji?P("span","\u200B"):P("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return k.setAttribute("cm-text",""),k}var Bo;function Sn(n){if(Bo!=null)return Bo;var c=B(n,document.createTextNode("A\u062EA")),k=G(c,0,1).getBoundingClientRect(),C=G(c,1,2).getBoundingClientRect();return D(n),!k||k.left==k.right?!1:Bo=C.right-k.right<3}var Kt=`
b`.split(/\n/).length!=3?function(n){for(var c=0,k=[],C=n.length;c<=C;){var O=n.indexOf(`
`,c);O==-1&&(O=n.length);var X=n.slice(c,n.charAt(O-1)=="\r"?O-1:O),ce=X.indexOf("\r");ce!=-1?(k.push(X.slice(0,ce)),c+=ce+1):(k.push(X),c=O+1)}return k}:function(n){return n.split(/\r\n?|\n/)},dt=window.getSelection?function(n){try{return n.selectionStart!=n.selectionEnd}catch(c){return!1}}:function(n){var c;try{c=n.ownerDocument.selection.createRange()}catch(k){}return!c||c.parentElement()!=n?!1:c.compareEndPoints("StartToEnd",c)!=0},st=function(){var n=P("div");return"oncopy"in n?!0:(n.setAttribute("oncopy","return;"),typeof n.oncopy=="function")}(),Et=null;function Mt(n){if(Et!=null)return Et;var c=B(n,P("span","x")),k=c.getBoundingClientRect(),C=G(c,0,1).getBoundingClientRect();return Et=Math.abs(k.left-C.left)>1}var kt={},Yt={};function Jt(n,c){arguments.length>2&&(c.dependencies=Array.prototype.slice.call(arguments,2)),kt[n]=c}function hr(n,c){Yt[n]=c}function $t(n){if(typeof n=="string"&&Yt.hasOwnProperty(n))n=Yt[n];else if(n&&typeof n.name=="string"&&Yt.hasOwnProperty(n.name)){var c=Yt[n.name];typeof c=="string"&&(c={name:c}),n=T(c,n),n.name=c.name}else{if(typeof n=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(n))return $t("application/xml");if(typeof n=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(n))return $t("application/json")}return typeof n=="string"?{name:n}:n||{name:"null"}}function dr(n,c){c=$t(c);var k=kt[c.name];if(!k)return dr(n,"text/plain");var C=k(n,c);if(tr.hasOwnProperty(c.name)){var O=tr[c.name];for(var X in O)O.hasOwnProperty(X)&&(C.hasOwnProperty(X)&&(C["_"+X]=C[X]),C[X]=O[X])}if(C.name=c.name,c.helperType&&(C.helperType=c.helperType),c.modeProps)for(var ce in c.modeProps)C[ce]=c.modeProps[ce];return C}var tr={};function ur(n,c){var k=tr.hasOwnProperty(n)?tr[n]:tr[n]={};ye(c,k)}function Sr(n,c){if(c===!0)return c;if(n.copyState)return n.copyState(c);var k={};for(var C in c){var O=c[C];O instanceof Array&&(O=O.concat([])),k[C]=O}return k}function Nr(n,c){for(var k;n.innerMode&&(k=n.innerMode(c),!(!k||k.mode==n));)c=k.state,n=k.mode;return k||{mode:n,state:c}}function sr(n,c,k){return n.startState?n.startState(c,k):!0}var Wt=function(n,c,k){this.pos=this.start=0,this.string=n,this.tabSize=c||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=k};Wt.prototype.eol=function(){return this.pos>=this.string.length},Wt.prototype.sol=function(){return this.pos==this.lineStart},Wt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Wt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Wt.prototype.eat=function(n){var c=this.string.charAt(this.pos),k;if(typeof n=="string"?k=c==n:k=c&&(n.test?n.test(c):n(c)),k)return++this.pos,c},Wt.prototype.eatWhile=function(n){for(var c=this.pos;this.eat(n););return this.pos>c},Wt.prototype.eatSpace=function(){for(var n=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>n},Wt.prototype.skipToEnd=function(){this.pos=this.string.length},Wt.prototype.skipTo=function(n){var c=this.string.indexOf(n,this.pos);if(c>-1)return this.pos=c,!0},Wt.prototype.backUp=function(n){this.pos-=n},Wt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Y(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Y(this.string,this.lineStart,this.tabSize):0)},Wt.prototype.indentation=function(){return Y(this.string,null,this.tabSize)-(this.lineStart?Y(this.string,this.lineStart,this.tabSize):0)},Wt.prototype.match=function(n,c,k){if(typeof n=="string"){var C=function(ce){return k?ce.toLowerCase():ce},O=this.string.substr(this.pos,n.length);if(C(O)==C(n))return c!==!1&&(this.pos+=n.length),!0}else{var X=this.string.slice(this.pos).match(n);return X&&X.index>0?null:(X&&c!==!1&&(this.pos+=X[0].length),X)}},Wt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Wt.prototype.hideFirstChars=function(n,c){this.lineStart+=n;try{return c()}finally{this.lineStart-=n}},Wt.prototype.lookAhead=function(n){var c=this.lineOracle;return c&&c.lookAhead(n)},Wt.prototype.baseToken=function(){var n=this.lineOracle;return n&&n.baseToken(this.pos)};function xt(n,c){if(c-=n.first,c<0||c>=n.size)throw new Error("There is no line "+(c+n.first)+" in the document.");for(var k=n;!k.lines;)for(var C=0;;++C){var O=k.children[C],X=O.chunkSize();if(c<X){k=O;break}c-=X}return k.lines[c]}function rr(n,c,k){var C=[],O=c.line;return n.iter(c.line,k.line+1,function(X){var ce=X.text;O==k.line&&(ce=ce.slice(0,k.ch)),O==c.line&&(ce=ce.slice(c.ch)),C.push(ce),++O}),C}function _r(n,c,k){var C=[];return n.iter(c,k,function(O){C.push(O.text)}),C}function vr(n,c){var k=c-n.height;if(k)for(var C=n;C;C=C.parent)C.height+=k}function Zt(n){if(n.parent==null)return null;for(var c=n.parent,k=xe(c.lines,n),C=c.parent;C;c=C,C=C.parent)for(var O=0;C.children[O]!=c;++O)k+=C.children[O].chunkSize();return k+c.first}function Fr(n,c){var k=n.first;e:do{for(var C=0;C<n.children.length;++C){var O=n.children[C],X=O.height;if(c<X){n=O;continue e}c-=X,k+=O.chunkSize()}return k}while(!n.lines);for(var ce=0;ce<n.lines.length;++ce){var me=n.lines[ce],ve=me.height;if(c<ve)break;c-=ve}return k+ce}function Er(n,c){return c>=n.first&&c<n.first+n.size}function Wr(n,c){return String(n.lineNumberFormatter(c+n.firstLineNumber))}function at(n,c,k){if(k===void 0&&(k=null),!(this instanceof at))return new at(n,c,k);this.line=n,this.ch=c,this.sticky=k}function Ht(n,c){return n.line-c.line||n.ch-c.ch}function Vi(n,c){return n.sticky==c.sticky&&Ht(n,c)==0}function li(n){return at(n.line,n.ch)}function ci(n,c){return Ht(n,c)<0?c:n}function Yn(n,c){return Ht(n,c)<0?n:c}function mi(n,c){return Math.max(n.first,Math.min(c,n.first+n.size-1))}function Gt(n,c){if(c.line<n.first)return at(n.first,0);var k=n.first+n.size-1;return c.line>k?at(k,xt(n,k).text.length):_o(c,xt(n,c.line).text.length)}function _o(n,c){var k=n.ch;return k==null||k>c?at(n.line,c):k<0?at(n.line,0):n}function Bi(n,c){for(var k=[],C=0;C<c.length;C++)k[C]=Gt(n,c[C]);return k}var Zn=function(n,c){this.state=n,this.lookAhead=c},Un=function(n,c,k,C){this.state=c,this.doc=n,this.line=k,this.maxLookAhead=C||0,this.baseTokens=null,this.baseTokenPos=1};Un.prototype.lookAhead=function(n){var c=this.doc.getLine(this.line+n);return c!=null&&n>this.maxLookAhead&&(this.maxLookAhead=n),c},Un.prototype.baseToken=function(n){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=n;)this.baseTokenPos+=2;var c=this.baseTokens[this.baseTokenPos+1];return{type:c&&c.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-n}},Un.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Un.fromSaved=function(n,c,k){return c instanceof Zn?new Un(n,Sr(n.mode,c.state),k,c.lookAhead):new Un(n,Sr(n.mode,c),k)},Un.prototype.save=function(n){var c=n!==!1?Sr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Zn(c,this.maxLookAhead):c};function Jn(n,c,k,C){var O=[n.state.modeGen],X={};Ho(n,c.text,n.doc.mode,k,function(ke,Ie){return O.push(ke,Ie)},X,C);for(var ce=k.state,me=function(ke){k.baseTokens=O;var Ie=n.state.overlays[ke],He=1,Ve=0;k.state=!0,Ho(n,c.text,Ie.mode,k,function(Ke,rt){for(var ut=He;Ve<Ke;){var yt=O[He];yt>Ke&&O.splice(He,1,Ke,O[He+1],yt),He+=2,Ve=Math.min(Ke,yt)}if(rt)if(Ie.opaque)O.splice(ut,He-ut,Ke,"overlay "+rt),He=ut+2;else for(;ut<He;ut+=2){var Ct=O[ut+1];O[ut+1]=(Ct?Ct+" ":"")+"overlay "+rt}},X),k.state=ce,k.baseTokens=null,k.baseTokenPos=1},ve=0;ve<n.state.overlays.length;++ve)me(ve);return{styles:O,classes:X.bgClass||X.textClass?X:null}}function ln(n,c,k){if(!c.styles||c.styles[0]!=n.state.modeGen){var C=gi(n,Zt(c)),O=c.text.length>n.options.maxHighlightLength&&Sr(n.doc.mode,C.state),X=Jn(n,c,C);O&&(C.state=O),c.stateAfter=C.save(!O),c.styles=X.styles,X.classes?c.styleClasses=X.classes:c.styleClasses&&(c.styleClasses=null),k===n.doc.highlightFrontier&&(n.doc.modeFrontier=Math.max(n.doc.modeFrontier,++n.doc.highlightFrontier))}return c.styles}function gi(n,c,k){var C=n.doc,O=n.display;if(!C.mode.startState)return new Un(C,!0,c);var X=wo(n,c,k),ce=X>C.first&&xt(C,X-1).stateAfter,me=ce?Un.fromSaved(C,ce,X):new Un(C,sr(C.mode),X);return C.iter(X,c,function(ve){fs(n,ve.text,me);var ke=me.line;ve.stateAfter=ke==c-1||ke%5==0||ke>=O.viewFrom&&ke<O.viewTo?me.save():null,me.nextLine()}),k&&(C.modeFrontier=me.line),me}function fs(n,c,k,C){var O=n.doc.mode,X=new Wt(c,n.options.tabSize,k);for(X.start=X.pos=C||0,c==""&&xa(O,k.state);!X.eol();)No(O,X,k.state),X.start=X.pos}function xa(n,c){if(n.blankLine)return n.blankLine(c);if(n.innerMode){var k=Nr(n,c);if(k.mode.blankLine)return k.mode.blankLine(k.state)}}function No(n,c,k,C){for(var O=0;O<10;O++){C&&(C[0]=Nr(n,k).mode);var X=n.token(c,k);if(c.pos>c.start)return X}throw new Error("Mode "+n.name+" failed to advance stream.")}var Gs=function(n,c,k){this.start=n.start,this.end=n.pos,this.string=n.current(),this.type=c||null,this.state=k};function Fo(n,c,k,C){var O=n.doc,X=O.mode,ce;c=Gt(O,c);var me=xt(O,c.line),ve=gi(n,c.line,k),ke=new Wt(me.text,n.options.tabSize,ve),Ie;for(C&&(Ie=[]);(C||ke.pos<c.ch)&&!ke.eol();)ke.start=ke.pos,ce=No(X,ke,ve.state),C&&Ie.push(new Gs(ke,ce,Sr(O.mode,ve.state)));return C?Ie:new Gs(ke,ce,ve.state)}function zo(n,c){if(n)for(;;){var k=n.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!k)break;n=n.slice(0,k.index)+n.slice(k.index+k[0].length);var C=k[1]?"bgClass":"textClass";c[C]==null?c[C]=k[2]:new RegExp("(?:^|\\s)"+k[2]+"(?:$|\\s)").test(c[C])||(c[C]+=" "+k[2])}return n}function Ho(n,c,k,C,O,X,ce){var me=k.flattenSpans;me==null&&(me=n.options.flattenSpans);var ve=0,ke=null,Ie=new Wt(c,n.options.tabSize,C),He,Ve=n.options.addModeClass&&[null];for(c==""&&zo(xa(k,C.state),X);!Ie.eol();){if(Ie.pos>n.options.maxHighlightLength?(me=!1,ce&&fs(n,c,C,Ie.pos),Ie.pos=c.length,He=null):He=zo(No(k,Ie,C.state,Ve),X),Ve){var Ke=Ve[0].name;Ke&&(He="m-"+(He?Ke+" "+He:Ke))}if(!me||ke!=He){for(;ve<Ie.start;)ve=Math.min(Ie.start,ve+5e3),O(ve,ke);ke=He}Ie.start=Ie.pos}for(;ve<Ie.pos;){var rt=Math.min(Ie.pos,ve+5e3);O(rt,ke),ve=rt}}function wo(n,c,k){for(var C,O,X=n.doc,ce=k?-1:c-(n.doc.mode.innerMode?1e3:100),me=c;me>ce;--me){if(me<=X.first)return X.first;var ve=xt(X,me-1),ke=ve.stateAfter;if(ke&&(!k||me+(ke instanceof Zn?ke.lookAhead:0)<=X.modeFrontier))return me;var Ie=Y(ve.text,null,n.options.tabSize);(O==null||C>Ie)&&(O=me-1,C=Ie)}return O}function Sa(n,c){if(n.modeFrontier=Math.min(n.modeFrontier,c),!(n.highlightFrontier<c-10)){for(var k=n.first,C=c-1;C>k;C--){var O=xt(n,C).stateAfter;if(O&&(!(O instanceof Zn)||C+O.lookAhead<c)){k=C+1;break}}n.highlightFrontier=Math.min(n.highlightFrontier,k)}}var hs=!1,An=!1;function Vs(){hs=!0}function Xs(){An=!0}function Ti(n,c,k){this.marker=n,this.from=c,this.to=k}function so(n,c){if(n)for(var k=0;k<n.length;++k){var C=n[k];if(C.marker==c)return C}}function Wn(n,c){for(var k,C=0;C<n.length;++C)n[C]!=c&&(k||(k=[])).push(n[C]);return k}function ao(n,c){n.markedSpans=n.markedSpans?n.markedSpans.concat([c]):[c],c.marker.attachLine(n)}function Uo(n,c,k){var C;if(n)for(var O=0;O<n.length;++O){var X=n[O],ce=X.marker,me=X.from==null||(ce.inclusiveLeft?X.from<=c:X.from<c);if(me||X.from==c&&ce.type=="bookmark"&&(!k||!X.marker.insertLeft)){var ve=X.to==null||(ce.inclusiveRight?X.to>=c:X.to>c);(C||(C=[])).push(new Ti(ce,X.from,ve?null:X.to))}}return C}function Wo(n,c,k){var C;if(n)for(var O=0;O<n.length;++O){var X=n[O],ce=X.marker,me=X.to==null||(ce.inclusiveRight?X.to>=c:X.to>c);if(me||X.from==c&&ce.type=="bookmark"&&(!k||X.marker.insertLeft)){var ve=X.from==null||(ce.inclusiveLeft?X.from<=c:X.from<c);(C||(C=[])).push(new Ti(ce,ve?null:X.from-c,X.to==null?null:X.to-c))}}return C}function Ko(n,c){if(c.full)return null;var k=Er(n,c.from.line)&&xt(n,c.from.line).markedSpans,C=Er(n,c.to.line)&&xt(n,c.to.line).markedSpans;if(!k&&!C)return null;var O=c.from.ch,X=c.to.ch,ce=Ht(c.from,c.to)==0,me=Uo(k,O,ce),ve=Wo(C,X,ce),ke=c.text.length==1,Ie=Pe(c.text).length+(ke?O:0);if(me)for(var He=0;He<me.length;++He){var Ve=me[He];if(Ve.to==null){var Ke=so(ve,Ve.marker);Ke?ke&&(Ve.to=Ke.to==null?null:Ke.to+Ie):Ve.to=O}}if(ve)for(var rt=0;rt<ve.length;++rt){var ut=ve[rt];if(ut.to!=null&&(ut.to+=Ie),ut.from==null){var yt=so(me,ut.marker);yt||(ut.from=Ie,ke&&(me||(me=[])).push(ut))}else ut.from+=Ie,ke&&(me||(me=[])).push(ut)}me&&(me=Ni(me)),ve&&ve!=me&&(ve=Ni(ve));var Ct=[me];if(!ke){var At=c.text.length-2,St;if(At>0&&me)for(var Lt=0;Lt<me.length;++Lt)me[Lt].to==null&&(St||(St=[])).push(new Ti(me[Lt].marker,null,null));for(var Nt=0;Nt<At;++Nt)Ct.push(St);Ct.push(ve)}return Ct}function Ni(n){for(var c=0;c<n.length;++c){var k=n[c];k.from!=null&&k.from==k.to&&k.marker.clearWhenEmpty!==!1&&n.splice(c--,1)}return n.length?n:null}function Fi(n,c,k){var C=null;if(n.iter(c.line,k.line+1,function(Ke){if(Ke.markedSpans)for(var rt=0;rt<Ke.markedSpans.length;++rt){var ut=Ke.markedSpans[rt].marker;ut.readOnly&&(!C||xe(C,ut)==-1)&&(C||(C=[])).push(ut)}}),!C)return null;for(var O=[{from:c,to:k}],X=0;X<C.length;++X)for(var ce=C[X],me=ce.find(0),ve=0;ve<O.length;++ve){var ke=O[ve];if(!(Ht(ke.to,me.from)<0||Ht(ke.from,me.to)>0)){var Ie=[ve,1],He=Ht(ke.from,me.from),Ve=Ht(ke.to,me.to);(He<0||!ce.inclusiveLeft&&!He)&&Ie.push({from:ke.from,to:me.from}),(Ve>0||!ce.inclusiveRight&&!Ve)&&Ie.push({from:me.to,to:ke.to}),O.splice.apply(O,Ie),ve+=Ie.length-3}}return O}function Xi(n){var c=n.markedSpans;if(c){for(var k=0;k<c.length;++k)c[k].marker.detachLine(n);n.markedSpans=null}}function qn(n,c){if(c){for(var k=0;k<c.length;++k)c[k].marker.attachLine(n);n.markedSpans=c}}function Kn(n){return n.inclusiveLeft?-1:0}function ds(n){return n.inclusiveRight?1:0}function Yi(n,c){var k=n.lines.length-c.lines.length;if(k!=0)return k;var C=n.find(),O=c.find(),X=Ht(C.from,O.from)||Kn(n)-Kn(c);if(X)return-X;var ce=Ht(C.to,O.to)||ds(n)-ds(c);return ce||c.id-n.id}function Se(n,c){var k=An&&n.markedSpans,C;if(k)for(var O=void 0,X=0;X<k.length;++X)O=k[X],O.marker.collapsed&&(c?O.from:O.to)==null&&(!C||Yi(C,O.marker)<0)&&(C=O.marker);return C}function Oe(n){return Se(n,!0)}function Ge(n){return Se(n,!1)}function Ye(n,c){var k=An&&n.markedSpans,C;if(k)for(var O=0;O<k.length;++O){var X=k[O];X.marker.collapsed&&(X.from==null||X.from<c)&&(X.to==null||X.to>c)&&(!C||Yi(C,X.marker)<0)&&(C=X.marker)}return C}function tt(n,c,k,C,O){var X=xt(n,c),ce=An&&X.markedSpans;if(ce)for(var me=0;me<ce.length;++me){var ve=ce[me];if(ve.marker.collapsed){var ke=ve.marker.find(0),Ie=Ht(ke.from,k)||Kn(ve.marker)-Kn(O),He=Ht(ke.to,C)||ds(ve.marker)-ds(O);if(!(Ie>=0&&He<=0||Ie<=0&&He>=0)&&(Ie<=0&&(ve.marker.inclusiveRight&&O.inclusiveLeft?Ht(ke.to,k)>=0:Ht(ke.to,k)>0)||Ie>=0&&(ve.marker.inclusiveRight&&O.inclusiveLeft?Ht(ke.from,C)<=0:Ht(ke.from,C)<0)))return!0}}}function it(n){for(var c;c=Oe(n);)n=c.find(-1,!0).line;return n}function _t(n){for(var c;c=Ge(n);)n=c.find(1,!0).line;return n}function Pt(n){for(var c,k;c=Ge(n);)n=c.find(1,!0).line,(k||(k=[])).push(n);return k}function Ut(n,c){var k=xt(n,c),C=it(k);return k==C?c:Zt(C)}function Ft(n,c){if(c>n.lastLine())return c;var k=xt(n,c),C;if(!nr(n,k))return c;for(;C=Ge(k);)k=C.find(1,!0).line;return Zt(k)+1}function nr(n,c){var k=An&&c.markedSpans;if(k){for(var C=void 0,O=0;O<k.length;++O)if(C=k[O],!!C.marker.collapsed){if(C.from==null)return!0;if(!C.marker.widgetNode&&C.from==0&&C.marker.inclusiveLeft&&jt(n,c,C))return!0}}}function jt(n,c,k){if(k.to==null){var C=k.marker.find(1,!0);return jt(n,C.line,so(C.line.markedSpans,k.marker))}if(k.marker.inclusiveRight&&k.to==c.text.length)return!0;for(var O=void 0,X=0;X<c.markedSpans.length;++X)if(O=c.markedSpans[X],O.marker.collapsed&&!O.marker.widgetNode&&O.from==k.to&&(O.to==null||O.to!=k.from)&&(O.marker.inclusiveLeft||k.marker.inclusiveRight)&&jt(n,c,O))return!0}function Vt(n){n=it(n);for(var c=0,k=n.parent,C=0;C<k.lines.length;++C){var O=k.lines[C];if(O==n)break;c+=O.height}for(var X=k.parent;X;k=X,X=k.parent)for(var ce=0;ce<X.children.length;++ce){var me=X.children[ce];if(me==k)break;c+=me.height}return c}function or(n){if(n.height==0)return 0;for(var c=n.text.length,k,C=n;k=Oe(C);){var O=k.find(0,!0);C=O.from.line,c+=O.from.ch-O.to.ch}for(C=n;k=Ge(C);){var X=k.find(0,!0);c-=C.text.length-X.from.ch,C=X.to.line,c+=C.text.length-X.to.ch}return c}function pr(n){var c=n.display,k=n.doc;c.maxLine=xt(k,k.first),c.maxLineLength=or(c.maxLine),c.maxLineChanged=!0,k.iter(function(C){var O=or(C);O>c.maxLineLength&&(c.maxLineLength=O,c.maxLine=C)})}var Mr=function(n,c,k){this.text=n,qn(this,c),this.height=k?k(this):1};Mr.prototype.lineNo=function(){return Zt(this)},bt(Mr);function Vr(n,c,k,C){n.text=c,n.stateAfter&&(n.stateAfter=null),n.styles&&(n.styles=null),n.order!=null&&(n.order=null),Xi(n),qn(n,k);var O=C?C(n):1;O!=n.height&&vr(n,O)}function zr(n){n.parent=null,Xi(n)}var Or={},wr={};function cn(n,c){if(!n||/^\s*$/.test(n))return null;var k=c.addModeClass?wr:Or;return k[n]||(k[n]=n.replace(/\S+/g,"cm-$&"))}function Br(n,c){var k=U("span",null,null,g?"padding-right: .1px":null),C={pre:U("pre",[k],"CodeMirror-line"),content:k,col:0,pos:0,cm:n,trailingSpace:!1,splitSpaces:n.getOption("lineWrapping")};c.measure={};for(var O=0;O<=(c.rest?c.rest.length:0);O++){var X=O?c.rest[O-1]:c.line,ce=void 0;C.pos=0,C.addToken=Xr,Sn(n.display.measure)&&(ce=lt(X,n.doc.direction))&&(C.addToken=yr(C.addToken,ce)),C.map=[];var me=c!=n.display.externalMeasured&&Zt(X);Kr(X,C,ln(n,X,me)),X.styleClasses&&(X.styleClasses.bgClass&&(C.bgClass=$(X.styleClasses.bgClass,C.bgClass||"")),X.styleClasses.textClass&&(C.textClass=$(X.styleClasses.textClass,C.textClass||""))),C.map.length==0&&C.map.push(0,0,C.content.appendChild(Gi(n.display.measure))),O==0?(c.measure.map=C.map,c.measure.cache={}):((c.measure.maps||(c.measure.maps=[])).push(C.map),(c.measure.caches||(c.measure.caches=[])).push({}))}if(g){var ve=C.content.lastChild;(/\bcm-tab\b/.test(ve.className)||ve.querySelector&&ve.querySelector(".cm-tab"))&&(C.content.className="cm-tab-wrap-hack")}return qe(n,"renderLine",n,c.line,C.pre),C.pre.className&&(C.textClass=$(C.pre.className,C.textClass||"")),C}function Ar(n){var c=P("span","\u2022","cm-invalidchar");return c.title="\\u"+n.charCodeAt(0).toString(16),c.setAttribute("aria-label",c.title),c}function Xr(n,c,k,C,O,X,ce){if(c){var me=n.splitSpaces?Hr(c,n.trailingSpace):c,ve=n.cm.state.specialChars,ke=!1,Ie;if(!ve.test(c))n.col+=c.length,Ie=document.createTextNode(me),n.map.push(n.pos,n.pos+c.length,Ie),E&&p<9&&(ke=!0),n.pos+=c.length;else{Ie=document.createDocumentFragment();for(var He=0;;){ve.lastIndex=He;var Ve=ve.exec(c),Ke=Ve?Ve.index-He:c.length-He;if(Ke){var rt=document.createTextNode(me.slice(He,He+Ke));E&&p<9?Ie.appendChild(P("span",[rt])):Ie.appendChild(rt),n.map.push(n.pos,n.pos+Ke,rt),n.col+=Ke,n.pos+=Ke}if(!Ve)break;He+=Ke+1;var ut=void 0;if(Ve[0]==" "){var yt=n.cm.options.tabSize,Ct=yt-n.col%yt;ut=Ie.appendChild(P("span",Be(Ct),"cm-tab")),ut.setAttribute("role","presentation"),ut.setAttribute("cm-text"," "),n.col+=Ct}else Ve[0]=="\r"||Ve[0]==`
`?(ut=Ie.appendChild(P("span",Ve[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),ut.setAttribute("cm-text",Ve[0]),n.col+=1):(ut=n.cm.options.specialCharPlaceholder(Ve[0]),ut.setAttribute("cm-text",Ve[0]),E&&p<9?Ie.appendChild(P("span",[ut])):Ie.appendChild(ut),n.col+=1);n.map.push(n.pos,n.pos+1,ut),n.pos++}}if(n.trailingSpace=me.charCodeAt(c.length-1)==32,k||C||O||ke||X||ce){var At=k||"";C&&(At+=C),O&&(At+=O);var St=P("span",[Ie],At,X);if(ce)for(var Lt in ce)ce.hasOwnProperty(Lt)&&Lt!="style"&&Lt!="class"&&St.setAttribute(Lt,ce[Lt]);return n.content.appendChild(St)}n.content.appendChild(Ie)}}function Hr(n,c){if(n.length>1&&!/ /.test(n))return n;for(var k=c,C="",O=0;O<n.length;O++){var X=n.charAt(O);X==" "&&k&&(O==n.length-1||n.charCodeAt(O+1)==32)&&(X="\xA0"),C+=X,k=X==" "}return C}function yr(n,c){return function(k,C,O,X,ce,me,ve){O=O?O+" cm-force-border":"cm-force-border";for(var ke=k.pos,Ie=ke+C.length;;){for(var He=void 0,Ve=0;Ve<c.length&&(He=c[Ve],!(He.to>ke&&He.from<=ke));Ve++);if(He.to>=Ie)return n(k,C,O,X,ce,me,ve);n(k,C.slice(0,He.to-ke),O,X,null,me,ve),X=null,C=C.slice(He.to-ke),ke=He.to}}}function Ur(n,c,k,C){var O=!C&&k.widgetNode;O&&n.map.push(n.pos,n.pos+c,O),!C&&n.cm.display.input.needsContentAttribute&&(O||(O=n.content.appendChild(document.createElement("span"))),O.setAttribute("cm-marker",k.id)),O&&(n.cm.display.input.setUneditable(O),n.content.appendChild(O)),n.pos+=c,n.trailingSpace=!1}function Kr(n,c,k){var C=n.markedSpans,O=n.text,X=0;if(!C){for(var ce=1;ce<k.length;ce+=2)c.addToken(c,O.slice(X,X=k[ce]),cn(k[ce+1],c.cm.options));return}for(var me=O.length,ve=0,ke=1,Ie="",He,Ve,Ke=0,rt,ut,yt,Ct,At;;){if(Ke==ve){rt=ut=yt=Ve="",At=null,Ct=null,Ke=1/0;for(var St=[],Lt=void 0,Nt=0;Nt<C.length;++Nt){var zt=C[Nt],lr=zt.marker;if(lr.type=="bookmark"&&zt.from==ve&&lr.widgetNode)St.push(lr);else if(zt.from<=ve&&(zt.to==null||zt.to>ve||lr.collapsed&&zt.to==ve&&zt.from==ve)){if(zt.to!=null&&zt.to!=ve&&Ke>zt.to&&(Ke=zt.to,ut=""),lr.className&&(rt+=" "+lr.className),lr.css&&(Ve=(Ve?Ve+";":"")+lr.css),lr.startStyle&&zt.from==ve&&(yt+=" "+lr.startStyle),lr.endStyle&&zt.to==Ke&&(Lt||(Lt=[])).push(lr.endStyle,zt.to),lr.title&&((At||(At={})).title=lr.title),lr.attributes)for(var qr in lr.attributes)(At||(At={}))[qr]=lr.attributes[qr];lr.collapsed&&(!Ct||Yi(Ct.marker,lr)<0)&&(Ct=zt)}else zt.from>ve&&Ke>zt.from&&(Ke=zt.from)}if(Lt)for(var Xn=0;Xn<Lt.length;Xn+=2)Lt[Xn+1]==Ke&&(ut+=" "+Lt[Xn]);if(!Ct||Ct.from==ve)for(var gn=0;gn<St.length;++gn)Ur(c,0,St[gn]);if(Ct&&(Ct.from||0)==ve){if(Ur(c,(Ct.to==null?me+1:Ct.to)-ve,Ct.marker,Ct.from==null),Ct.to==null)return;Ct.to==ve&&(Ct=!1)}}if(ve>=me)break;for(var ki=Math.min(me,Ke);;){if(Ie){var Ei=ve+Ie.length;if(!Ct){var Pn=Ei>ki?Ie.slice(0,ki-ve):Ie;c.addToken(c,Pn,He?He+rt:rt,yt,ve+Pn.length==Ke?ut:"",Ve,At)}if(Ei>=ki){Ie=Ie.slice(ki-ve),ve=ki;break}ve=Ei,yt=""}Ie=O.slice(X,X=k[ke++]),He=cn(k[ke++],c.cm.options)}}}function ir(n,c,k){this.line=c,this.rest=Pt(c),this.size=this.rest?Zt(Pe(this.rest))-k+1:1,this.node=this.text=null,this.hidden=nr(n,c)}function Lr(n,c,k){for(var C=[],O,X=c;X<k;X=O){var ce=new ir(n.doc,xt(n.doc,X),X);O=X+ce.size,C.push(ce)}return C}var cr=null;function Yr(n){cr?cr.ops.push(n):n.ownsGroup=cr={ops:[n],delayedCallbacks:[]}}function ui(n){var c=n.delayedCallbacks,k=0;do{for(;k<c.length;k++)c[k].call(null);for(var C=0;C<n.ops.length;C++){var O=n.ops[C];if(O.cursorActivityHandlers)for(;O.cursorActivityCalled<O.cursorActivityHandlers.length;)O.cursorActivityHandlers[O.cursorActivityCalled++].call(null,O.cm)}}while(k<c.length)}function Ai(n,c){var k=n.ownsGroup;if(k)try{ui(k)}finally{cr=null,c(k)}}var $n=null;function Cr(n,c){var k=We(n,c);if(k.length){var C=Array.prototype.slice.call(arguments,2),O;cr?O=cr.delayedCallbacks:$n?O=$n:(O=$n=[],setTimeout(Li,0));for(var X=function(me){O.push(function(){return k[me].apply(null,C)})},ce=0;ce<k.length;++ce)X(ce)}}function Li(){var n=$n;$n=null;for(var c=0;c<n.length;++c)n[c]()}function Zi(n,c,k,C){for(var O=0;O<c.changes.length;O++){var X=c.changes[O];X=="text"?Vn(n,c):X=="gutter"?jn(n,c,k,C):X=="class"?tn(n,c):X=="widget"&&pn(n,c,C)}c.changes=null}function xr(n){return n.node==n.text&&(n.node=P("div",null,null,"position: relative"),n.text.parentNode&&n.text.parentNode.replaceChild(n.node,n.text),n.node.appendChild(n.text),E&&p<8&&(n.node.style.zIndex=2)),n.node}function un(n,c){var k=c.bgClass?c.bgClass+" "+(c.line.bgClass||""):c.line.bgClass;if(k&&(k+=" CodeMirror-linebackground"),c.background)k?c.background.className=k:(c.background.parentNode.removeChild(c.background),c.background=null);else if(k){var C=xr(c);c.background=C.insertBefore(P("div",null,k),C.firstChild),n.display.input.setUneditable(c.background)}}function Gn(n,c){var k=n.display.externalMeasured;return k&&k.line==c.line?(n.display.externalMeasured=null,c.measure=k.measure,k.built):Br(n,c)}function Vn(n,c){var k=c.text.className,C=Gn(n,c);c.text==c.node&&(c.node=C.pre),c.text.parentNode.replaceChild(C.pre,c.text),c.text=C.pre,C.bgClass!=c.bgClass||C.textClass!=c.textClass?(c.bgClass=C.bgClass,c.textClass=C.textClass,tn(n,c)):k&&(c.text.className=k)}function tn(n,c){un(n,c),c.line.wrapClass?xr(c).className=c.line.wrapClass:c.node!=c.text&&(c.node.className="");var k=c.textClass?c.textClass+" "+(c.line.textClass||""):c.line.textClass;c.text.className=k||""}function jn(n,c,k,C){if(c.gutter&&(c.node.removeChild(c.gutter),c.gutter=null),c.gutterBackground&&(c.node.removeChild(c.gutterBackground),c.gutterBackground=null),c.line.gutterClass){var O=xr(c);c.gutterBackground=P("div",null,"CodeMirror-gutter-background "+c.line.gutterClass,"left: "+(n.options.fixedGutter?C.fixedPos:-C.gutterTotalWidth)+"px; width: "+C.gutterTotalWidth+"px"),n.display.input.setUneditable(c.gutterBackground),O.insertBefore(c.gutterBackground,c.text)}var X=c.line.gutterMarkers;if(n.options.lineNumbers||X){var ce=xr(c),me=c.gutter=P("div",null,"CodeMirror-gutter-wrapper","left: "+(n.options.fixedGutter?C.fixedPos:-C.gutterTotalWidth)+"px");if(n.display.input.setUneditable(me),ce.insertBefore(me,c.text),c.line.gutterClass&&(me.className+=" "+c.line.gutterClass),n.options.lineNumbers&&(!X||!X["CodeMirror-linenumbers"])&&(c.lineNumber=me.appendChild(P("div",Wr(n.options,k),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+C.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+n.display.lineNumInnerWidth+"px"))),X)for(var ve=0;ve<n.display.gutterSpecs.length;++ve){var ke=n.display.gutterSpecs[ve].className,Ie=X.hasOwnProperty(ke)&&X[ke];Ie&&me.appendChild(P("div",[Ie],"CodeMirror-gutter-elt","left: "+C.gutterLeft[ke]+"px; width: "+C.gutterWidth[ke]+"px"))}}}function pn(n,c,k){c.alignable&&(c.alignable=null);for(var C=R("CodeMirror-linewidget"),O=c.node.firstChild,X=void 0;O;O=X)X=O.nextSibling,C.test(O.className)&&c.node.removeChild(O);qi(n,c,k)}function Ji(n,c,k,C){var O=Gn(n,c);return c.text=c.node=O.pre,O.bgClass&&(c.bgClass=O.bgClass),O.textClass&&(c.textClass=O.textClass),tn(n,c),jn(n,c,k,C),qi(n,c,C),c.node}function qi(n,c,k){if(Ys(n,c.line,c,k,!0),c.rest)for(var C=0;C<c.rest.length;C++)Ys(n,c.rest[C],c,k,!1)}function Ys(n,c,k,C,O){if(c.widgets)for(var X=xr(k),ce=0,me=c.widgets;ce<me.length;++ce){var ve=me[ce],ke=P("div",[ve.node],"CodeMirror-linewidget"+(ve.className?" "+ve.className:""));ve.handleMouseEvents||ke.setAttribute("cm-ignore-events","true"),Ca(ve,ke,k,C),n.display.input.setUneditable(ke),O&&ve.above?X.insertBefore(ke,k.gutter||k.text):X.appendChild(ke),Cr(ve,"redraw")}}function Ca(n,c,k,C){if(n.noHScroll){(k.alignable||(k.alignable=[])).push(c);var O=C.wrapperWidth;c.style.left=C.fixedPos+"px",n.coverGutter||(O-=C.gutterTotalWidth,c.style.paddingLeft=C.gutterTotalWidth+"px"),c.style.width=O+"px"}n.coverGutter&&(c.style.zIndex=5,c.style.position="relative",n.noHScroll||(c.style.marginLeft=-C.gutterTotalWidth+"px"))}function xo(n){if(n.height!=null)return n.height;var c=n.doc.cm;if(!c)return 0;if(!ee(document.body,n.node)){var k="position: relative;";n.coverGutter&&(k+="margin-left: -"+c.display.gutters.offsetWidth+"px;"),n.noHScroll&&(k+="width: "+c.display.wrapper.clientWidth+"px;"),B(c.display.measure,P("div",[n.node],null,k))}return n.height=n.node.parentNode.offsetHeight}function vi(n,c){for(var k=on(c);k!=n.wrapper;k=k.parentNode)if(!k||k.nodeType==1&&k.getAttribute("cm-ignore-events")=="true"||k.parentNode==n.sizer&&k!=n.mover)return!0}function $o(n){return n.lineSpace.offsetTop}function rn(n){return n.mover.offsetHeight-n.lineSpace.offsetHeight}function Qn(n){if(n.cachedPaddingH)return n.cachedPaddingH;var c=B(n.measure,P("pre","x","CodeMirror-line-like")),k=window.getComputedStyle?window.getComputedStyle(c):c.currentStyle,C={left:parseInt(k.paddingLeft),right:parseInt(k.paddingRight)};return!isNaN(C.left)&&!isNaN(C.right)&&(n.cachedPaddingH=C),C}function Cn(n){return Ce-n.display.nativeBarWidth}function Bn(n){return n.display.scroller.clientWidth-Cn(n)-n.display.barWidth}function lo(n){return n.display.scroller.clientHeight-Cn(n)-n.display.barHeight}function Qi(n,c,k){var C=n.options.lineWrapping,O=C&&Bn(n);if(!c.measure.heights||C&&c.measure.width!=O){var X=c.measure.heights=[];if(C){c.measure.width=O;for(var ce=c.text.firstChild.getClientRects(),me=0;me<ce.length-1;me++){var ve=ce[me],ke=ce[me+1];Math.abs(ve.bottom-ke.bottom)>2&&X.push((ve.bottom+ke.top)/2-k.top)}}X.push(k.bottom-k.top)}}function So(n,c,k){if(n.line==c)return{map:n.measure.map,cache:n.measure.cache};for(var C=0;C<n.rest.length;C++)if(n.rest[C]==c)return{map:n.measure.maps[C],cache:n.measure.caches[C]};for(var O=0;O<n.rest.length;O++)if(Zt(n.rest[O])>k)return{map:n.measure.maps[O],cache:n.measure.caches[O],before:!0}}function ps(n,c){c=it(c);var k=Zt(c),C=n.display.externalMeasured=new ir(n.doc,c,k);C.lineN=k;var O=C.built=Br(n,C);return C.text=O.pre,B(n.display.lineMeasure,O.pre),C}function Co(n,c,k,C){return mr(n,eo(n,c),k,C)}function Oi(n,c){if(c>=n.display.viewFrom&&c<n.display.viewTo)return n.display.view[Rr(n,c)];var k=n.display.externalMeasured;if(k&&c>=k.lineN&&c<k.lineN+k.size)return k}function eo(n,c){var k=Zt(c),C=Oi(n,k);C&&!C.text?C=null:C&&C.changes&&(Zi(n,C,k,to(n)),n.curOp.forceUpdate=!0),C||(C=ps(n,c));var O=So(C,c,k);return{line:c,view:C,rect:null,map:O.map,cache:O.cache,before:O.before,hasHeights:!1}}function mr(n,c,k,C,O){c.before&&(k=-1);var X=k+(C||""),ce;return c.cache.hasOwnProperty(X)?ce=c.cache[X]:(c.rect||(c.rect=c.view.text.getBoundingClientRect()),c.hasHeights||(Qi(n,c.view,c.rect),c.hasHeights=!0),ce=ka(n,c,k,C),ce.bogus||(c.cache[X]=ce)),{left:ce.left,right:ce.right,top:O?ce.rtop:ce.top,bottom:O?ce.rbottom:ce.bottom}}var Go={left:0,right:0,top:0,bottom:0};function zi(n,c,k){for(var C,O,X,ce,me,ve,ke=0;ke<n.length;ke+=3)if(me=n[ke],ve=n[ke+1],c<me?(O=0,X=1,ce="left"):c<ve?(O=c-me,X=O+1):(ke==n.length-3||c==ve&&n[ke+3]>c)&&(X=ve-me,O=X-1,c>=ve&&(ce="right")),O!=null){if(C=n[ke+2],me==ve&&k==(C.insertLeft?"left":"right")&&(ce=k),k=="left"&&O==0)for(;ke&&n[ke-2]==n[ke-3]&&n[ke-1].insertLeft;)C=n[(ke-=3)+2],ce="left";if(k=="right"&&O==ve-me)for(;ke<n.length-3&&n[ke+3]==n[ke+4]&&!n[ke+5].insertLeft;)C=n[(ke+=3)+2],ce="right";break}return{node:C,start:O,end:X,collapse:ce,coverStart:me,coverEnd:ve}}function Hi(n,c){var k=Go;if(c=="left")for(var C=0;C<n.length&&(k=n[C]).left==k.right;C++);else for(var O=n.length-1;O>=0&&(k=n[O]).left==k.right;O--);return k}function ka(n,c,k,C){var O=zi(c.map,k,C),X=O.node,ce=O.start,me=O.end,ve=O.collapse,ke;if(X.nodeType==3){for(var Ie=0;Ie<4;Ie++){for(;ce&&V(c.line.text.charAt(O.coverStart+ce));)--ce;for(;O.coverStart+me<O.coverEnd&&V(c.line.text.charAt(O.coverStart+me));)++me;if(E&&p<9&&ce==0&&me==O.coverEnd-O.coverStart?ke=X.parentNode.getBoundingClientRect():ke=Hi(G(X,ce,me).getClientRects(),C),ke.left||ke.right||ce==0)break;me=ce,ce=ce-1,ve="right"}E&&p<11&&(ke=Ja(n.display.measure,ke))}else{ce>0&&(ve=C="right");var He;n.options.lineWrapping&&(He=X.getClientRects()).length>1?ke=He[C=="right"?He.length-1:0]:ke=X.getBoundingClientRect()}if(E&&p<9&&!ce&&(!ke||!ke.left&&!ke.right)){var Ve=X.parentNode.getClientRects()[0];Ve?ke={left:Ve.left,right:Ve.left+yi(n.display),top:Ve.top,bottom:Ve.bottom}:ke=Go}for(var Ke=ke.top-c.rect.top,rt=ke.bottom-c.rect.top,ut=(Ke+rt)/2,yt=c.view.measure.heights,Ct=0;Ct<yt.length-1&&!(ut<yt[Ct]);Ct++);var At=Ct?yt[Ct-1]:0,St=yt[Ct],Lt={left:(ve=="right"?ke.right:ke.left)-c.rect.left,right:(ve=="left"?ke.left:ke.right)-c.rect.left,top:At,bottom:St};return!ke.left&&!ke.right&&(Lt.bogus=!0),n.options.singleCursorHeightPerLine||(Lt.rtop=Ke,Lt.rbottom=rt),Lt}function Ja(n,c){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Mt(n))return c;var k=screen.logicalXDPI/screen.deviceXDPI,C=screen.logicalYDPI/screen.deviceYDPI;return{left:c.left*k,right:c.right*k,top:c.top*C,bottom:c.bottom*C}}function Ci(n){if(n.measure&&(n.measure.cache={},n.measure.heights=null,n.rest))for(var c=0;c<n.rest.length;c++)n.measure.caches[c]={}}function Ea(n){n.display.externalMeasure=null,D(n.display.lineMeasure);for(var c=0;c<n.display.view.length;c++)Ci(n.display.view[c])}function co(n){Ea(n),n.display.cachedCharWidth=n.display.cachedTextHeight=n.display.cachedPaddingH=null,n.options.lineWrapping||(n.display.maxLineChanged=!0),n.display.lineNumChars=null}function Ma(){return h&&m?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Zs(){return h&&m?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function ms(n){var c=0;if(n.widgets)for(var k=0;k<n.widgets.length;++k)n.widgets[k].above&&(c+=xo(n.widgets[k]));return c}function gs(n,c,k,C,O){if(!O){var X=ms(c);k.top+=X,k.bottom+=X}if(C=="line")return k;C||(C="local");var ce=Vt(c);if(C=="local"?ce+=$o(n.display):ce-=n.display.viewOffset,C=="page"||C=="window"){var me=n.display.lineSpace.getBoundingClientRect();ce+=me.top+(C=="window"?0:Zs());var ve=me.left+(C=="window"?0:Ma());k.left+=ve,k.right+=ve}return k.top+=ce,k.bottom+=ce,k}function Vo(n,c,k){if(k=="div")return c;var C=c.left,O=c.top;if(k=="page")C-=Ma(),O-=Zs();else if(k=="local"||!k){var X=n.display.sizer.getBoundingClientRect();C+=X.left,O+=X.top}var ce=n.display.lineSpace.getBoundingClientRect();return{left:C-ce.left,top:O-ce.top}}function Ta(n,c,k,C,O){return C||(C=xt(n.doc,c.line)),gs(n,C,Co(n,C,c.ch,O),k)}function fi(n,c,k,C,O,X){C=C||xt(n.doc,c.line),O||(O=eo(n,C));function ce(rt,ut){var yt=mr(n,O,rt,ut?"right":"left",X);return ut?yt.left=yt.right:yt.right=yt.left,gs(n,C,yt,k)}var me=lt(C,n.doc.direction),ve=c.ch,ke=c.sticky;if(ve>=C.text.length?(ve=C.text.length,ke="before"):ve<=0&&(ve=0,ke="after"),!me)return ce(ke=="before"?ve-1:ve,ke=="before");function Ie(rt,ut,yt){var Ct=me[ut],At=Ct.level==1;return ce(yt?rt-1:rt,At!=yt)}var He=Re(me,ve,ke),Ve=Fe,Ke=Ie(ve,He,ke=="before");return Ve!=null&&(Ke.other=Ie(ve,Ve,ke!="before")),Ke}function Aa(n,c){var k=0;c=Gt(n.doc,c),n.options.lineWrapping||(k=yi(n.display)*c.ch);var C=xt(n.doc,c.line),O=Vt(C)+$o(n.display);return{left:k,right:k,top:O,bottom:O+C.height}}function ko(n,c,k,C,O){var X=at(n,c,k);return X.xRel=O,C&&(X.outside=C),X}function vs(n,c,k){var C=n.doc;if(k+=n.display.viewOffset,k<0)return ko(C.first,0,null,-1,-1);var O=Fr(C,k),X=C.first+C.size-1;if(O>X)return ko(C.first+C.size-1,xt(C,X).text.length,null,1,1);c<0&&(c=0);for(var ce=xt(C,O);;){var me=Rl(n,ce,O,c,k),ve=Ye(ce,me.ch+(me.xRel>0||me.outside>0?1:0));if(!ve)return me;var ke=ve.find(1);if(ke.line==O)return ke;ce=xt(C,O=ke.line)}}function La(n,c,k,C){C-=ms(c);var O=c.text.length,X=ge(function(ce){return mr(n,k,ce-1).bottom<=C},O,0);return O=ge(function(ce){return mr(n,k,ce).top>C},X,O),{begin:X,end:O}}function ys(n,c,k,C){k||(k=eo(n,c));var O=gs(n,c,mr(n,k,C),"line").top;return La(n,c,k,O)}function Js(n,c,k,C){return n.bottom<=k?!1:n.top>k?!0:(C?n.left:n.right)>c}function Rl(n,c,k,C,O){O-=Vt(c);var X=eo(n,c),ce=ms(c),me=0,ve=c.text.length,ke=!0,Ie=lt(c,n.doc.direction);if(Ie){var He=(n.options.lineWrapping?Qs:Eo)(n,c,k,X,Ie,C,O);ke=He.level!=1,me=ke?He.from:He.to-1,ve=ke?He.to:He.from-1}var Ve=null,Ke=null,rt=ge(function(Nt){var zt=mr(n,X,Nt);return zt.top+=ce,zt.bottom+=ce,Js(zt,C,O,!1)?(zt.top<=O&&zt.left<=C&&(Ve=Nt,Ke=zt),!0):!1},me,ve),ut,yt,Ct=!1;if(Ke){var At=C-Ke.left<Ke.right-C,St=At==ke;rt=Ve+(St?0:1),yt=St?"after":"before",ut=At?Ke.left:Ke.right}else{!ke&&(rt==ve||rt==me)&&rt++,yt=rt==0?"after":rt==c.text.length?"before":mr(n,X,rt-(ke?1:0)).bottom+ce<=O==ke?"after":"before";var Lt=fi(n,at(k,rt,yt),"line",c,X);ut=Lt.left,Ct=O<Lt.top?-1:O>=Lt.bottom?1:0}return rt=se(c.text,rt,1),ko(k,rt,yt,Ct,C-ut)}function Eo(n,c,k,C,O,X,ce){var me=ge(function(He){var Ve=O[He],Ke=Ve.level!=1;return Js(fi(n,at(k,Ke?Ve.to:Ve.from,Ke?"before":"after"),"line",c,C),X,ce,!0)},0,O.length-1),ve=O[me];if(me>0){var ke=ve.level!=1,Ie=fi(n,at(k,ke?ve.from:ve.to,ke?"after":"before"),"line",c,C);Js(Ie,X,ce,!0)&&Ie.top>ce&&(ve=O[me-1])}return ve}function Qs(n,c,k,C,O,X,ce){var me=La(n,c,C,ce),ve=me.begin,ke=me.end;/\s/.test(c.text.charAt(ke-1))&&ke--;for(var Ie=null,He=null,Ve=0;Ve<O.length;Ve++){var Ke=O[Ve];if(!(Ke.from>=ke||Ke.to<=ve)){var rt=Ke.level!=1,ut=mr(n,C,rt?Math.min(ke,Ke.to)-1:Math.max(ve,Ke.from)).right,yt=ut<X?X-ut+1e9:ut-X;(!Ie||He>yt)&&(Ie=Ke,He=yt)}}return Ie||(Ie=O[O.length-1]),Ie.from<ve&&(Ie={from:ve,to:Ie.to,level:Ie.level}),Ie.to>ke&&(Ie={from:Ie.from,to:ke,level:Ie.level}),Ie}var Mo;function Xo(n){if(n.cachedTextHeight!=null)return n.cachedTextHeight;if(Mo==null){Mo=P("pre",null,"CodeMirror-line-like");for(var c=0;c<49;++c)Mo.appendChild(document.createTextNode("x")),Mo.appendChild(P("br"));Mo.appendChild(document.createTextNode("x"))}B(n.measure,Mo);var k=Mo.offsetHeight/50;return k>3&&(n.cachedTextHeight=k),D(n.measure),k||1}function yi(n){if(n.cachedCharWidth!=null)return n.cachedCharWidth;var c=P("span","xxxxxxxxxx"),k=P("pre",[c],"CodeMirror-line-like");B(n.measure,k);var C=c.getBoundingClientRect(),O=(C.right-C.left)/10;return O>2&&(n.cachedCharWidth=O),O||10}function to(n){for(var c=n.display,k={},C={},O=c.gutters.clientLeft,X=c.gutters.firstChild,ce=0;X;X=X.nextSibling,++ce){var me=n.display.gutterSpecs[ce].className;k[me]=X.offsetLeft+X.clientLeft+O,C[me]=X.clientWidth}return{fixedPos:To(c),gutterTotalWidth:c.gutters.offsetWidth,gutterLeft:k,gutterWidth:C,wrapperWidth:c.wrapper.clientWidth}}function To(n){return n.scroller.getBoundingClientRect().left-n.sizer.getBoundingClientRect().left}function ea(n){var c=Xo(n.display),k=n.options.lineWrapping,C=k&&Math.max(5,n.display.scroller.clientWidth/yi(n.display)-3);return function(O){if(nr(n.doc,O))return 0;var X=0;if(O.widgets)for(var ce=0;ce<O.widgets.length;ce++)O.widgets[ce].height&&(X+=O.widgets[ce].height);return k?X+(Math.ceil(O.text.length/C)||1)*c:X+c}}function Yo(n){var c=n.doc,k=ea(n);c.iter(function(C){var O=k(C);O!=C.height&&vr(C,O)})}function uo(n,c,k,C){var O=n.display;if(!k&&on(c).getAttribute("cm-not-content")=="true")return null;var X,ce,me=O.lineSpace.getBoundingClientRect();try{X=c.clientX-me.left,ce=c.clientY-me.top}catch(He){return null}var ve=vs(n,X,ce),ke;if(C&&ve.xRel>0&&(ke=xt(n.doc,ve.line).text).length==ve.ch){var Ie=Y(ke,ke.length,n.options.tabSize)-ke.length;ve=at(ve.line,Math.max(0,Math.round((X-Qn(n.display).left)/yi(n.display))-Ie))}return ve}function Rr(n,c){if(c>=n.display.viewTo||(c-=n.display.viewFrom,c<0))return null;for(var k=n.display.view,C=0;C<k.length;C++)if(c-=k[C].size,c<0)return C}function Qt(n,c,k,C){c==null&&(c=n.doc.first),k==null&&(k=n.doc.first+n.doc.size),C||(C=0);var O=n.display;if(C&&k<O.viewTo&&(O.updateLineNumbers==null||O.updateLineNumbers>c)&&(O.updateLineNumbers=c),n.curOp.viewChanged=!0,c>=O.viewTo)An&&Ut(n.doc,c)<O.viewTo&&hn(n);else if(k<=O.viewFrom)An&&Ft(n.doc,k+C)>O.viewFrom?hn(n):(O.viewFrom+=C,O.viewTo+=C);else if(c<=O.viewFrom&&k>=O.viewTo)hn(n);else if(c<=O.viewFrom){var X=bi(n,k,k+C,1);X?(O.view=O.view.slice(X.index),O.viewFrom=X.lineN,O.viewTo+=C):hn(n)}else if(k>=O.viewTo){var ce=bi(n,c,c,-1);ce?(O.view=O.view.slice(0,ce.index),O.viewTo=ce.lineN):hn(n)}else{var me=bi(n,c,c,-1),ve=bi(n,k,k+C,1);me&&ve?(O.view=O.view.slice(0,me.index).concat(Lr(n,me.lineN,ve.lineN)).concat(O.view.slice(ve.index)),O.viewTo+=C):hn(n)}var ke=O.externalMeasured;ke&&(k<ke.lineN?ke.lineN+=C:c<ke.lineN+ke.size&&(O.externalMeasured=null))}function nn(n,c,k){n.curOp.viewChanged=!0;var C=n.display,O=n.display.externalMeasured;if(O&&c>=O.lineN&&c<O.lineN+O.size&&(C.externalMeasured=null),!(c<C.viewFrom||c>=C.viewTo)){var X=C.view[Rr(n,c)];if(X.node!=null){var ce=X.changes||(X.changes=[]);xe(ce,k)==-1&&ce.push(k)}}}function hn(n){n.display.viewFrom=n.display.viewTo=n.doc.first,n.display.view=[],n.display.viewOffset=0}function bi(n,c,k,C){var O=Rr(n,c),X,ce=n.display.view;if(!An||k==n.doc.first+n.doc.size)return{index:O,lineN:k};for(var me=n.display.viewFrom,ve=0;ve<O;ve++)me+=ce[ve].size;if(me!=c){if(C>0){if(O==ce.length-1)return null;X=me+ce[O].size-c,O++}else X=me-c;c+=X,k+=X}for(;Ut(n.doc,k)!=k;){if(O==(C<0?0:ce.length-1))return null;k+=C*ce[O-(C<0?1:0)].size,O+=C}return{index:O,lineN:k}}function _i(n,c,k){var C=n.display,O=C.view;O.length==0||c>=C.viewTo||k<=C.viewFrom?(C.view=Lr(n,c,k),C.viewFrom=c):(C.viewFrom>c?C.view=Lr(n,c,C.viewFrom).concat(C.view):C.viewFrom<c&&(C.view=C.view.slice(Rr(n,c))),C.viewFrom=c,C.viewTo<k?C.view=C.view.concat(Lr(n,C.viewTo,k)):C.viewTo>k&&(C.view=C.view.slice(0,Rr(n,k)))),C.viewTo=k}function qa(n){for(var c=n.display.view,k=0,C=0;C<c.length;C++){var O=c[C];!O.hidden&&(!O.node||O.changes)&&++k}return k}function Oa(n){n.display.input.showSelection(n.display.input.prepareSelection())}function Rc(n,c){c===void 0&&(c=!0);for(var k=n.doc,C={},O=C.cursors=document.createDocumentFragment(),X=C.selection=document.createDocumentFragment(),ce=0;ce<k.sel.ranges.length;ce++)if(!(!c&&ce==k.sel.primIndex)){var me=k.sel.ranges[ce];if(!(me.from().line>=n.display.viewTo||me.to().line<n.display.viewFrom)){var ve=me.empty();(ve||n.options.showCursorWhenSelecting)&&Ic(n,me.head,O),ve||Ku(n,me,X)}}return C}function Ic(n,c,k){var C=fi(n,c,"div",null,null,!n.options.singleCursorHeightPerLine),O=k.appendChild(P("div","\xA0","CodeMirror-cursor"));if(O.style.left=C.left+"px",O.style.top=C.top+"px",O.style.height=Math.max(0,C.bottom-C.top)*n.options.cursorHeight+"px",C.other){var X=k.appendChild(P("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));X.style.display="",X.style.left=C.other.left+"px",X.style.top=C.other.top+"px",X.style.height=(C.other.bottom-C.other.top)*.85+"px"}}function Qa(n,c){return n.top-c.top||n.left-c.left}function Ku(n,c,k){var C=n.display,O=n.doc,X=document.createDocumentFragment(),ce=Qn(n.display),me=ce.left,ve=Math.max(C.sizerWidth,Bn(n)-C.sizer.offsetLeft)-ce.right,ke=O.direction=="ltr";function Ie(St,Lt,Nt,zt){Lt<0&&(Lt=0),Lt=Math.round(Lt),zt=Math.round(zt),X.appendChild(P("div",null,"CodeMirror-selected","position: absolute; left: "+St+`px;
top: `+Lt+"px; width: "+(Nt==null?ve-St:Nt)+`px;
height: `+(zt-Lt)+"px"))}function He(St,Lt,Nt){var zt=xt(O,St),lr=zt.text.length,qr,Xn;function gn(Pn,Mi){return Ta(n,at(St,Pn),"div",zt,Mi)}function ki(Pn,Mi,qt){var bn=ys(n,zt,null,Pn),vn=Mi=="ltr"==(qt=="after")?"left":"right",_n=qt=="after"?bn.begin:bn.end-(/\s/.test(zt.text.charAt(bn.end-1))?2:1);return gn(_n,vn)[vn]}var Ei=lt(zt,O.direction);return Me(Ei,Lt||0,Nt==null?lr:Nt,function(Pn,Mi,qt,bn){var vn=qt=="ltr",_n=gn(Pn,vn?"left":"right"),En=gn(Mi-1,vn?"right":"left"),ga=Lt==null&&Pn==0,Ri=Nt==null&&Mi==lr,ni=bn==0,Dr=!Ei||bn==Ei.length-1;if(En.top-_n.top<=3){var zn=(ke?ga:Ri)&&ni,pc=(ke?Ri:ga)&&Dr,ls=zn?me:(vn?_n:En).left,Ps=pc?ve:(vn?En:_n).right;Ie(ls,_n.top,Ps-ls,_n.bottom)}else{var Do,Rn,va,ii;vn?(Do=ke&&ga&&ni?me:_n.left,Rn=ke?ve:ki(Pn,qt,"before"),va=ke?me:ki(Mi,qt,"after"),ii=ke&&Ri&&Dr?ve:En.right):(Do=ke?ki(Pn,qt,"before"):me,Rn=!ke&&ga&&ni?ve:_n.right,va=!ke&&Ri&&Dr?me:En.left,ii=ke?ki(Mi,qt,"after"):ve),Ie(Do,_n.top,Rn-Do,_n.bottom),_n.bottom<En.top&&Ie(me,_n.bottom,null,En.top),Ie(va,En.top,ii-va,En.bottom)}(!qr||Qa(_n,qr)<0)&&(qr=_n),Qa(En,qr)<0&&(qr=En),(!Xn||Qa(_n,Xn)<0)&&(Xn=_n),Qa(En,Xn)<0&&(Xn=En)}),{start:qr,end:Xn}}var Ve=c.from(),Ke=c.to();if(Ve.line==Ke.line)He(Ve.line,Ve.ch,Ke.ch);else{var rt=xt(O,Ve.line),ut=xt(O,Ke.line),yt=it(rt)==it(ut),Ct=He(Ve.line,Ve.ch,yt?rt.text.length+1:null).end,At=He(Ke.line,yt?0:null,Ke.ch).start;yt&&(Ct.top<At.top-2?(Ie(Ct.right,Ct.top,null,Ct.bottom),Ie(me,At.top,At.left,At.bottom)):Ie(Ct.right,Ct.top,At.left-Ct.right,Ct.bottom)),Ct.bottom<At.top&&Ie(me,Ct.bottom,null,At.top)}k.appendChild(X)}function Il(n){if(n.state.focused){var c=n.display;clearInterval(c.blinker);var k=!0;c.cursorDiv.style.visibility="",n.options.cursorBlinkRate>0?c.blinker=setInterval(function(){n.hasFocus()||ta(n),c.cursorDiv.style.visibility=(k=!k)?"":"hidden"},n.options.cursorBlinkRate):n.options.cursorBlinkRate<0&&(c.cursorDiv.style.visibility="hidden")}}function Da(n){n.state.focused||(n.display.input.focus(),jl(n))}function jc(n){n.state.delayingBlurEvent=!0,setTimeout(function(){n.state.delayingBlurEvent&&(n.state.delayingBlurEvent=!1,ta(n))},100)}function jl(n,c){n.state.delayingBlurEvent&&(n.state.delayingBlurEvent=!1),n.options.readOnly!="nocursor"&&(n.state.focused||(qe(n,"focus",n,c),n.state.focused=!0,Z(n.display.wrapper,"CodeMirror-focused"),!n.curOp&&n.display.selForContextMenu!=n.doc.sel&&(n.display.input.reset(),g&&setTimeout(function(){return n.display.input.reset(!0)},20)),n.display.input.receivedFocus()),Il(n))}function ta(n,c){n.state.delayingBlurEvent||(n.state.focused&&(qe(n,"blur",n,c),n.state.focused=!1,F(n.display.wrapper,"CodeMirror-focused")),clearInterval(n.display.blinker),setTimeout(function(){n.state.focused||(n.display.shift=!1)},150))}function el(n){for(var c=n.display,k=c.lineDiv.offsetTop,C=0;C<c.view.length;C++){var O=c.view[C],X=n.options.lineWrapping,ce=void 0,me=0;if(!O.hidden){if(E&&p<8){var ve=O.node.offsetTop+O.node.offsetHeight;ce=ve-k,k=ve}else{var ke=O.node.getBoundingClientRect();ce=ke.bottom-ke.top,!X&&O.text.firstChild&&(me=O.text.firstChild.getBoundingClientRect().right-ke.left-1)}var Ie=O.line.height-ce;if((Ie>.005||Ie<-.005)&&(vr(O.line,ce),Bc(O.line),O.rest))for(var He=0;He<O.rest.length;He++)Bc(O.rest[He]);if(me>n.display.sizerWidth){var Ve=Math.ceil(me/yi(n.display));Ve>n.display.maxLineLength&&(n.display.maxLineLength=Ve,n.display.maxLine=O.line,n.display.maxLineChanged=!0)}}}}function Bc(n){if(n.widgets)for(var c=0;c<n.widgets.length;++c){var k=n.widgets[c],C=k.node.parentNode;C&&(k.height=C.offsetHeight)}}function Nn(n,c,k){var C=k&&k.top!=null?Math.max(0,k.top):n.scroller.scrollTop;C=Math.floor(C-$o(n));var O=k&&k.bottom!=null?k.bottom:C+n.wrapper.clientHeight,X=Fr(c,C),ce=Fr(c,O);if(k&&k.ensure){var me=k.ensure.from.line,ve=k.ensure.to.line;me<X?(X=me,ce=Fr(c,Vt(xt(c,me))+n.wrapper.clientHeight)):Math.min(ve,c.lastLine())>=ce&&(X=Fr(c,Vt(xt(c,ve))-n.wrapper.clientHeight),ce=ve)}return{from:X,to:Math.max(ce,X+1)}}function Zo(n,c){if(!Qe(n,"scrollCursorIntoView")){var k=n.display,C=k.sizer.getBoundingClientRect(),O=null;if(c.top+C.top<0?O=!0:c.bottom+C.top>(window.innerHeight||document.documentElement.clientHeight)&&(O=!1),O!=null&&!s){var X=P("div","\u200B",null,`position: absolute;
top: `+(c.top-k.viewOffset-$o(n.display))+`px;
height: `+(c.bottom-c.top+Cn(n)+k.barHeight)+`px;
left: `+c.left+"px; width: "+Math.max(2,c.right-c.left)+"px;");n.display.lineSpace.appendChild(X),X.scrollIntoView(O),n.display.lineSpace.removeChild(X)}}}function bs(n,c,k,C){C==null&&(C=0);var O;!n.options.lineWrapping&&c==k&&(c=c.ch?at(c.line,c.sticky=="before"?c.ch-1:c.ch,"after"):c,k=c.sticky=="before"?at(c.line,c.ch+1,"before"):c);for(var X=0;X<5;X++){var ce=!1,me=fi(n,c),ve=!k||k==c?me:fi(n,k);O={left:Math.min(me.left,ve.left),top:Math.min(me.top,ve.top)-C,right:Math.max(me.left,ve.left),bottom:Math.max(me.bottom,ve.bottom)+C};var ke=tl(n,O),Ie=n.doc.scrollTop,He=n.doc.scrollLeft;if(ke.scrollTop!=null&&(_s(n,ke.scrollTop),Math.abs(n.doc.scrollTop-Ie)>1&&(ce=!0)),ke.scrollLeft!=null&&(ws(n,ke.scrollLeft),Math.abs(n.doc.scrollLeft-He)>1&&(ce=!0)),!ce)break}return O}function $u(n,c){var k=tl(n,c);k.scrollTop!=null&&_s(n,k.scrollTop),k.scrollLeft!=null&&ws(n,k.scrollLeft)}function tl(n,c){var k=n.display,C=Xo(n.display);c.top<0&&(c.top=0);var O=n.curOp&&n.curOp.scrollTop!=null?n.curOp.scrollTop:k.scroller.scrollTop,X=lo(n),ce={};c.bottom-c.top>X&&(c.bottom=c.top+X);var me=n.doc.height+rn(k),ve=c.top<C,ke=c.bottom>me-C;if(c.top<O)ce.scrollTop=ve?0:c.top;else if(c.bottom>O+X){var Ie=Math.min(c.top,(ke?me:c.bottom)-X);Ie!=O&&(ce.scrollTop=Ie)}var He=n.options.fixedGutter?0:k.gutters.offsetWidth,Ve=n.curOp&&n.curOp.scrollLeft!=null?n.curOp.scrollLeft:k.scroller.scrollLeft-He,Ke=Bn(n)-k.gutters.offsetWidth,rt=c.right-c.left>Ke;return rt&&(c.right=c.left+Ke),c.left<10?ce.scrollLeft=0:c.left<Ve?ce.scrollLeft=Math.max(0,c.left+He-(rt?0:10)):c.right>Ke+Ve-3&&(ce.scrollLeft=c.right+(rt?0:10)-Ke),ce}function Bl(n,c){c!=null&&(rl(n),n.curOp.scrollTop=(n.curOp.scrollTop==null?n.doc.scrollTop:n.curOp.scrollTop)+c)}function ra(n){rl(n);var c=n.getCursor();n.curOp.scrollToPos={from:c,to:c,margin:n.options.cursorScrollMargin}}function na(n,c,k){(c!=null||k!=null)&&rl(n),c!=null&&(n.curOp.scrollLeft=c),k!=null&&(n.curOp.scrollTop=k)}function Gu(n,c){rl(n),n.curOp.scrollToPos=c}function rl(n){var c=n.curOp.scrollToPos;if(c){n.curOp.scrollToPos=null;var k=Aa(n,c.from),C=Aa(n,c.to);Nc(n,k,C,c.margin)}}function Nc(n,c,k,C){var O=tl(n,{left:Math.min(c.left,k.left),top:Math.min(c.top,k.top)-C,right:Math.max(c.right,k.right),bottom:Math.max(c.bottom,k.bottom)+C});na(n,O.scrollLeft,O.scrollTop)}function _s(n,c){Math.abs(n.doc.scrollTop-c)<2||(he||zl(n,{top:c}),Fc(n,c,!0),he&&zl(n),oa(n,100))}function Fc(n,c,k){c=Math.max(0,Math.min(n.display.scroller.scrollHeight-n.display.scroller.clientHeight,c)),!(n.display.scroller.scrollTop==c&&!k)&&(n.doc.scrollTop=c,n.display.scrollbars.setScrollTop(c),n.display.scroller.scrollTop!=c&&(n.display.scroller.scrollTop=c))}function ws(n,c,k,C){c=Math.max(0,Math.min(c,n.display.scroller.scrollWidth-n.display.scroller.clientWidth)),!((k?c==n.doc.scrollLeft:Math.abs(n.doc.scrollLeft-c)<2)&&!C)&&(n.doc.scrollLeft=c,$c(n),n.display.scroller.scrollLeft!=c&&(n.display.scroller.scrollLeft=c),n.display.scrollbars.setScrollLeft(c))}function ia(n){var c=n.display,k=c.gutters.offsetWidth,C=Math.round(n.doc.height+rn(n.display));return{clientHeight:c.scroller.clientHeight,viewHeight:c.wrapper.clientHeight,scrollWidth:c.scroller.scrollWidth,clientWidth:c.scroller.clientWidth,viewWidth:c.wrapper.clientWidth,barLeft:n.options.fixedGutter?k:0,docHeight:C,scrollHeight:C+Cn(n)+c.barHeight,nativeBarWidth:c.nativeBarWidth,gutterWidth:k}}var Jo=function(n,c,k){this.cm=k;var C=this.vert=P("div",[P("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),O=this.horiz=P("div",[P("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");C.tabIndex=O.tabIndex=-1,n(C),n(O),Ze(C,"scroll",function(){C.clientHeight&&c(C.scrollTop,"vertical")}),Ze(O,"scroll",function(){O.clientWidth&&c(O.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,E&&p<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Jo.prototype.update=function(n){var c=n.scrollWidth>n.clientWidth+1,k=n.scrollHeight>n.clientHeight+1,C=n.nativeBarWidth;if(k){this.vert.style.display="block",this.vert.style.bottom=c?C+"px":"0";var O=n.viewHeight-(c?C:0);this.vert.firstChild.style.height=Math.max(0,n.scrollHeight-n.clientHeight+O)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(c){this.horiz.style.display="block",this.horiz.style.right=k?C+"px":"0",this.horiz.style.left=n.barLeft+"px";var X=n.viewWidth-n.barLeft-(k?C:0);this.horiz.firstChild.style.width=Math.max(0,n.scrollWidth-n.clientWidth+X)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&n.clientHeight>0&&(C==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:k?C:0,bottom:c?C:0}},Jo.prototype.setScrollLeft=function(n){this.horiz.scrollLeft!=n&&(this.horiz.scrollLeft=n),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Jo.prototype.setScrollTop=function(n){this.vert.scrollTop!=n&&(this.vert.scrollTop=n),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Jo.prototype.zeroWidthHack=function(){var n=_&&!o?"12px":"18px";this.horiz.style.height=this.vert.style.width=n,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new le,this.disableVert=new le},Jo.prototype.enableZeroWidthBar=function(n,c,k){n.style.pointerEvents="auto";function C(){var O=n.getBoundingClientRect(),X=k=="vert"?document.elementFromPoint(O.right-1,(O.top+O.bottom)/2):document.elementFromPoint((O.right+O.left)/2,O.bottom-1);X!=n?n.style.pointerEvents="none":c.set(1e3,C)}c.set(1e3,C)},Jo.prototype.clear=function(){var n=this.horiz.parentNode;n.removeChild(this.horiz),n.removeChild(this.vert)};var Di=function(){};Di.prototype.update=function(){return{bottom:0,right:0}},Di.prototype.setScrollLeft=function(){},Di.prototype.setScrollTop=function(){},Di.prototype.clear=function(){};function xs(n,c){c||(c=ia(n));var k=n.display.barWidth,C=n.display.barHeight;Nl(n,c);for(var O=0;O<4&&k!=n.display.barWidth||C!=n.display.barHeight;O++)k!=n.display.barWidth&&n.options.lineWrapping&&el(n),Nl(n,ia(n)),k=n.display.barWidth,C=n.display.barHeight}function Nl(n,c){var k=n.display,C=k.scrollbars.update(c);k.sizer.style.paddingRight=(k.barWidth=C.right)+"px",k.sizer.style.paddingBottom=(k.barHeight=C.bottom)+"px",k.heightForcer.style.borderBottom=C.bottom+"px solid transparent",C.right&&C.bottom?(k.scrollbarFiller.style.display="block",k.scrollbarFiller.style.height=C.bottom+"px",k.scrollbarFiller.style.width=C.right+"px"):k.scrollbarFiller.style.display="",C.bottom&&n.options.coverGutterNextToScrollbar&&n.options.fixedGutter?(k.gutterFiller.style.display="block",k.gutterFiller.style.height=C.bottom+"px",k.gutterFiller.style.width=c.gutterWidth+"px"):k.gutterFiller.style.display=""}var zc={native:Jo,null:Di};function Hc(n){n.display.scrollbars&&(n.display.scrollbars.clear(),n.display.scrollbars.addClass&&F(n.display.wrapper,n.display.scrollbars.addClass)),n.display.scrollbars=new zc[n.options.scrollbarStyle](function(c){n.display.wrapper.insertBefore(c,n.display.scrollbarFiller),Ze(c,"mousedown",function(){n.state.focused&&setTimeout(function(){return n.display.input.focus()},0)}),c.setAttribute("cm-not-content","true")},function(c,k){k=="horizontal"?ws(n,c):_s(n,c)},n),n.display.scrollbars.addClass&&Z(n.display.wrapper,n.display.scrollbars.addClass)}var Vu=0;function Ss(n){n.curOp={cm:n,viewChanged:!1,startHeight:n.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Vu},Yr(n.curOp)}function qo(n){var c=n.curOp;c&&Ai(c,function(k){for(var C=0;C<k.ops.length;C++)k.ops[C].cm.curOp=null;Xu(k)})}function Xu(n){for(var c=n.ops,k=0;k<c.length;k++)Yu(c[k]);for(var C=0;C<c.length;C++)Zu(c[C]);for(var O=0;O<c.length;O++)Ju(c[O]);for(var X=0;X<c.length;X++)qu(c[X]);for(var ce=0;ce<c.length;ce++)Qu(c[ce])}function Yu(n){var c=n.cm,k=c.display;Wc(c),n.updateMaxLine&&pr(c),n.mustUpdate=n.viewChanged||n.forceUpdate||n.scrollTop!=null||n.scrollToPos&&(n.scrollToPos.from.line<k.viewFrom||n.scrollToPos.to.line>=k.viewTo)||k.maxLineChanged&&c.options.lineWrapping,n.update=n.mustUpdate&&new nl(c,n.mustUpdate&&{top:n.scrollTop,ensure:n.scrollToPos},n.forceUpdate)}function Zu(n){n.updatedDisplay=n.mustUpdate&&Fl(n.cm,n.update)}function Ju(n){var c=n.cm,k=c.display;n.updatedDisplay&&el(c),n.barMeasure=ia(c),k.maxLineChanged&&!c.options.lineWrapping&&(n.adjustWidthTo=Co(c,k.maxLine,k.maxLine.text.length).left+3,c.display.sizerWidth=n.adjustWidthTo,n.barMeasure.scrollWidth=Math.max(k.scroller.clientWidth,k.sizer.offsetLeft+n.adjustWidthTo+Cn(c)+c.display.barWidth),n.maxScrollLeft=Math.max(0,k.sizer.offsetLeft+n.adjustWidthTo-Bn(c))),(n.updatedDisplay||n.selectionChanged)&&(n.preparedSelection=k.input.prepareSelection())}function qu(n){var c=n.cm;n.adjustWidthTo!=null&&(c.display.sizer.style.minWidth=n.adjustWidthTo+"px",n.maxScrollLeft<c.doc.scrollLeft&&ws(c,Math.min(c.display.scroller.scrollLeft,n.maxScrollLeft),!0),c.display.maxLineChanged=!1);var k=n.focus&&n.focus==K();n.preparedSelection&&c.display.input.showSelection(n.preparedSelection,k),(n.updatedDisplay||n.startHeight!=c.doc.height)&&xs(c,n.barMeasure),n.updatedDisplay&&Ul(c,n.barMeasure),n.selectionChanged&&Il(c),c.state.focused&&n.updateInput&&c.display.input.reset(n.typing),k&&Da(n.cm)}function Qu(n){var c=n.cm,k=c.display,C=c.doc;if(n.updatedDisplay&&Kc(c,n.update),k.wheelStartX!=null&&(n.scrollTop!=null||n.scrollLeft!=null||n.scrollToPos)&&(k.wheelStartX=k.wheelStartY=null),n.scrollTop!=null&&Fc(c,n.scrollTop,n.forceScroll),n.scrollLeft!=null&&ws(c,n.scrollLeft,!0,!0),n.scrollToPos){var O=bs(c,Gt(C,n.scrollToPos.from),Gt(C,n.scrollToPos.to),n.scrollToPos.margin);Zo(c,O)}var X=n.maybeHiddenMarkers,ce=n.maybeUnhiddenMarkers;if(X)for(var me=0;me<X.length;++me)X[me].lines.length||qe(X[me],"hide");if(ce)for(var ve=0;ve<ce.length;++ve)ce[ve].lines.length&&qe(ce[ve],"unhide");k.wrapper.offsetHeight&&(C.scrollTop=c.display.scroller.scrollTop),n.changeObjs&&qe(c,"changes",c,n.changeObjs),n.update&&n.update.finish()}function yn(n,c){if(n.curOp)return c();Ss(n);try{return c()}finally{qo(n)}}function Ln(n,c){return function(){if(n.curOp)return c.apply(n,arguments);Ss(n);try{return c.apply(n,arguments)}finally{qo(n)}}}function mn(n){return function(){if(this.curOp)return n.apply(this,arguments);Ss(this);try{return n.apply(this,arguments)}finally{qo(this)}}}function Fn(n){return function(){var c=this.cm;if(!c||c.curOp)return n.apply(this,arguments);Ss(c);try{return n.apply(this,arguments)}finally{qo(c)}}}function oa(n,c){n.doc.highlightFrontier<n.display.viewTo&&n.state.highlight.set(c,ae(Uc,n))}function Uc(n){var c=n.doc;if(!(c.highlightFrontier>=n.display.viewTo)){var k=+new Date+n.options.workTime,C=gi(n,c.highlightFrontier),O=[];c.iter(C.line,Math.min(c.first+c.size,n.display.viewTo+500),function(X){if(C.line>=n.display.viewFrom){var ce=X.styles,me=X.text.length>n.options.maxHighlightLength?Sr(c.mode,C.state):null,ve=Jn(n,X,C,!0);me&&(C.state=me),X.styles=ve.styles;var ke=X.styleClasses,Ie=ve.classes;Ie?X.styleClasses=Ie:ke&&(X.styleClasses=null);for(var He=!ce||ce.length!=X.styles.length||ke!=Ie&&(!ke||!Ie||ke.bgClass!=Ie.bgClass||ke.textClass!=Ie.textClass),Ve=0;!He&&Ve<ce.length;++Ve)He=ce[Ve]!=X.styles[Ve];He&&O.push(C.line),X.stateAfter=C.save(),C.nextLine()}else X.text.length<=n.options.maxHighlightLength&&fs(n,X.text,C),X.stateAfter=C.line%5==0?C.save():null,C.nextLine();if(+new Date>k)return oa(n,n.options.workDelay),!0}),c.highlightFrontier=C.line,c.modeFrontier=Math.max(c.modeFrontier,C.line),O.length&&yn(n,function(){for(var X=0;X<O.length;X++)nn(n,O[X],"text")})}}var nl=function(n,c,k){var C=n.display;this.viewport=c,this.visible=Nn(C,n.doc,c),this.editorIsHidden=!C.wrapper.offsetWidth,this.wrapperHeight=C.wrapper.clientHeight,this.wrapperWidth=C.wrapper.clientWidth,this.oldDisplayWidth=Bn(n),this.force=k,this.dims=to(n),this.events=[]};nl.prototype.signal=function(n,c){vt(n,c)&&this.events.push(arguments)},nl.prototype.finish=function(){for(var n=0;n<this.events.length;n++)qe.apply(null,this.events[n])};function Wc(n){var c=n.display;!c.scrollbarsClipped&&c.scroller.offsetWidth&&(c.nativeBarWidth=c.scroller.offsetWidth-c.scroller.clientWidth,c.heightForcer.style.height=Cn(n)+"px",c.sizer.style.marginBottom=-c.nativeBarWidth+"px",c.sizer.style.borderRightWidth=Cn(n)+"px",c.scrollbarsClipped=!0)}function ef(n){if(n.hasFocus())return null;var c=K();if(!c||!ee(n.display.lineDiv,c))return null;var k={activeElt:c};if(window.getSelection){var C=window.getSelection();C.anchorNode&&C.extend&&ee(n.display.lineDiv,C.anchorNode)&&(k.anchorNode=C.anchorNode,k.anchorOffset=C.anchorOffset,k.focusNode=C.focusNode,k.focusOffset=C.focusOffset)}return k}function tf(n){if(!(!n||!n.activeElt||n.activeElt==K())&&(n.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(n.activeElt.nodeName)&&n.anchorNode&&ee(document.body,n.anchorNode)&&ee(document.body,n.focusNode))){var c=window.getSelection(),k=document.createRange();k.setEnd(n.anchorNode,n.anchorOffset),k.collapse(!1),c.removeAllRanges(),c.addRange(k),c.extend(n.focusNode,n.focusOffset)}}function Fl(n,c){var k=n.display,C=n.doc;if(c.editorIsHidden)return hn(n),!1;if(!c.force&&c.visible.from>=k.viewFrom&&c.visible.to<=k.viewTo&&(k.updateLineNumbers==null||k.updateLineNumbers>=k.viewTo)&&k.renderedView==k.view&&qa(n)==0)return!1;il(n)&&(hn(n),c.dims=to(n));var O=C.first+C.size,X=Math.max(c.visible.from-n.options.viewportMargin,C.first),ce=Math.min(O,c.visible.to+n.options.viewportMargin);k.viewFrom<X&&X-k.viewFrom<20&&(X=Math.max(C.first,k.viewFrom)),k.viewTo>ce&&k.viewTo-ce<20&&(ce=Math.min(O,k.viewTo)),An&&(X=Ut(n.doc,X),ce=Ft(n.doc,ce));var me=X!=k.viewFrom||ce!=k.viewTo||k.lastWrapHeight!=c.wrapperHeight||k.lastWrapWidth!=c.wrapperWidth;_i(n,X,ce),k.viewOffset=Vt(xt(n.doc,k.viewFrom)),n.display.mover.style.top=k.viewOffset+"px";var ve=qa(n);if(!me&&ve==0&&!c.force&&k.renderedView==k.view&&(k.updateLineNumbers==null||k.updateLineNumbers>=k.viewTo))return!1;var ke=ef(n);return ve>4&&(k.lineDiv.style.display="none"),rf(n,k.updateLineNumbers,c.dims),ve>4&&(k.lineDiv.style.display=""),k.renderedView=k.view,tf(ke),D(k.cursorDiv),D(k.selectionDiv),k.gutters.style.height=k.sizer.style.minHeight=0,me&&(k.lastWrapHeight=c.wrapperHeight,k.lastWrapWidth=c.wrapperWidth,oa(n,400)),k.updateLineNumbers=null,!0}function Kc(n,c){for(var k=c.viewport,C=!0;;C=!1){if(!C||!n.options.lineWrapping||c.oldDisplayWidth==Bn(n)){if(k&&k.top!=null&&(k={top:Math.min(n.doc.height+rn(n.display)-lo(n),k.top)}),c.visible=Nn(n.display,n.doc,k),c.visible.from>=n.display.viewFrom&&c.visible.to<=n.display.viewTo)break}else C&&(c.visible=Nn(n.display,n.doc,k));if(!Fl(n,c))break;el(n);var O=ia(n);Oa(n),xs(n,O),Ul(n,O),c.force=!1}c.signal(n,"update",n),(n.display.viewFrom!=n.display.reportedViewFrom||n.display.viewTo!=n.display.reportedViewTo)&&(c.signal(n,"viewportChange",n,n.display.viewFrom,n.display.viewTo),n.display.reportedViewFrom=n.display.viewFrom,n.display.reportedViewTo=n.display.viewTo)}function zl(n,c){var k=new nl(n,c);if(Fl(n,k)){el(n),Kc(n,k);var C=ia(n);Oa(n),xs(n,C),Ul(n,C),k.finish()}}function rf(n,c,k){var C=n.display,O=n.options.lineNumbers,X=C.lineDiv,ce=X.firstChild;function me(rt){var ut=rt.nextSibling;return g&&_&&n.display.currentWheelTarget==rt?rt.style.display="none":rt.parentNode.removeChild(rt),ut}for(var ve=C.view,ke=C.viewFrom,Ie=0;Ie<ve.length;Ie++){var He=ve[Ie];if(!He.hidden)if(!He.node||He.node.parentNode!=X){var Ve=Ji(n,He,ke,k);X.insertBefore(Ve,ce)}else{for(;ce!=He.node;)ce=me(ce);var Ke=O&&c!=null&&c<=ke&&He.lineNumber;He.changes&&(xe(He.changes,"gutter")>-1&&(Ke=!1),Zi(n,He,ke,k)),Ke&&(D(He.lineNumber),He.lineNumber.appendChild(document.createTextNode(Wr(n.options,ke)))),ce=He.node.nextSibling}ke+=He.size}for(;ce;)ce=me(ce)}function Hl(n){var c=n.gutters.offsetWidth;n.sizer.style.marginLeft=c+"px"}function Ul(n,c){n.display.sizer.style.minHeight=c.docHeight+"px",n.display.heightForcer.style.top=c.docHeight+"px",n.display.gutters.style.height=c.docHeight+n.display.barHeight+Cn(n)+"px"}function $c(n){var c=n.display,k=c.view;if(!(!c.alignWidgets&&(!c.gutters.firstChild||!n.options.fixedGutter))){for(var C=To(c)-c.scroller.scrollLeft+n.doc.scrollLeft,O=c.gutters.offsetWidth,X=C+"px",ce=0;ce<k.length;ce++)if(!k[ce].hidden){n.options.fixedGutter&&(k[ce].gutter&&(k[ce].gutter.style.left=X),k[ce].gutterBackground&&(k[ce].gutterBackground.style.left=X));var me=k[ce].alignable;if(me)for(var ve=0;ve<me.length;ve++)me[ve].style.left=X}n.options.fixedGutter&&(c.gutters.style.left=C+O+"px")}}function il(n){if(!n.options.lineNumbers)return!1;var c=n.doc,k=Wr(n.options,c.first+c.size-1),C=n.display;if(k.length!=C.lineNumChars){var O=C.measure.appendChild(P("div",[P("div",k)],"CodeMirror-linenumber CodeMirror-gutter-elt")),X=O.firstChild.offsetWidth,ce=O.offsetWidth-X;return C.lineGutter.style.width="",C.lineNumInnerWidth=Math.max(X,C.lineGutter.offsetWidth-ce)+1,C.lineNumWidth=C.lineNumInnerWidth+ce,C.lineNumChars=C.lineNumInnerWidth?k.length:-1,C.lineGutter.style.width=C.lineNumWidth+"px",Hl(n.display),!0}return!1}function Wl(n,c){for(var k=[],C=!1,O=0;O<n.length;O++){var X=n[O],ce=null;if(typeof X!="string"&&(ce=X.style,X=X.className),X=="CodeMirror-linenumbers")if(c)C=!0;else continue;k.push({className:X,style:ce})}return c&&!C&&k.push({className:"CodeMirror-linenumbers",style:null}),k}function Gc(n){var c=n.gutters,k=n.gutterSpecs;D(c),n.lineGutter=null;for(var C=0;C<k.length;++C){var O=k[C],X=O.className,ce=O.style,me=c.appendChild(P("div",null,"CodeMirror-gutter "+X));ce&&(me.style.cssText=ce),X=="CodeMirror-linenumbers"&&(n.lineGutter=me,me.style.width=(n.lineNumWidth||1)+"px")}c.style.display=k.length?"":"none",Hl(n)}function Pa(n){Gc(n.display),Qt(n),$c(n)}function nf(n,c,k,C){var O=this;this.input=k,O.scrollbarFiller=P("div",null,"CodeMirror-scrollbar-filler"),O.scrollbarFiller.setAttribute("cm-not-content","true"),O.gutterFiller=P("div",null,"CodeMirror-gutter-filler"),O.gutterFiller.setAttribute("cm-not-content","true"),O.lineDiv=U("div",null,"CodeMirror-code"),O.selectionDiv=P("div",null,null,"position: relative; z-index: 1"),O.cursorDiv=P("div",null,"CodeMirror-cursors"),O.measure=P("div",null,"CodeMirror-measure"),O.lineMeasure=P("div",null,"CodeMirror-measure"),O.lineSpace=U("div",[O.measure,O.lineMeasure,O.selectionDiv,O.cursorDiv,O.lineDiv],null,"position: relative; outline: none");var X=U("div",[O.lineSpace],"CodeMirror-lines");O.mover=P("div",[X],null,"position: relative"),O.sizer=P("div",[O.mover],"CodeMirror-sizer"),O.sizerWidth=null,O.heightForcer=P("div",null,null,"position: absolute; height: "+Ce+"px; width: 1px;"),O.gutters=P("div",null,"CodeMirror-gutters"),O.lineGutter=null,O.scroller=P("div",[O.sizer,O.heightForcer,O.gutters],"CodeMirror-scroll"),O.scroller.setAttribute("tabIndex","-1"),O.wrapper=P("div",[O.scrollbarFiller,O.gutterFiller,O.scroller],"CodeMirror"),E&&p<8&&(O.gutters.style.zIndex=-1,O.scroller.style.paddingRight=0),!g&&!(he&&y)&&(O.scroller.draggable=!0),n&&(n.appendChild?n.appendChild(O.wrapper):n(O.wrapper)),O.viewFrom=O.viewTo=c.first,O.reportedViewFrom=O.reportedViewTo=c.first,O.view=[],O.renderedView=null,O.externalMeasured=null,O.viewOffset=0,O.lastWrapHeight=O.lastWrapWidth=0,O.updateLineNumbers=null,O.nativeBarWidth=O.barHeight=O.barWidth=0,O.scrollbarsClipped=!1,O.lineNumWidth=O.lineNumInnerWidth=O.lineNumChars=null,O.alignWidgets=!1,O.cachedCharWidth=O.cachedTextHeight=O.cachedPaddingH=null,O.maxLine=null,O.maxLineLength=0,O.maxLineChanged=!1,O.wheelDX=O.wheelDY=O.wheelStartX=O.wheelStartY=null,O.shift=!1,O.selForContextMenu=null,O.activeTouch=null,O.gutterSpecs=Wl(C.gutters,C.lineNumbers),Gc(O),k.init(O)}var ol=0,ei=null;E?ei=-.53:he?ei=15:h?ei=-.7:d&&(ei=-1/3);function sa(n){var c=n.wheelDeltaX,k=n.wheelDeltaY;return c==null&&n.detail&&n.axis==n.HORIZONTAL_AXIS&&(c=n.detail),k==null&&n.detail&&n.axis==n.VERTICAL_AXIS?k=n.detail:k==null&&(k=n.wheelDelta),{x:c,y:k}}function Vc(n){var c=sa(n);return c.x*=ei,c.y*=ei,c}function Xc(n,c){var k=sa(c),C=k.x,O=k.y,X=n.display,ce=X.scroller,me=ce.scrollWidth>ce.clientWidth,ve=ce.scrollHeight>ce.clientHeight;if(C&&me||O&&ve){if(O&&_&&g){e:for(var ke=c.target,Ie=X.view;ke!=ce;ke=ke.parentNode)for(var He=0;He<Ie.length;He++)if(Ie[He].node==ke){n.display.currentWheelTarget=ke;break e}}if(C&&!he&&!v&&ei!=null){O&&ve&&_s(n,Math.max(0,ce.scrollTop+O*ei)),ws(n,Math.max(0,ce.scrollLeft+C*ei)),(!O||O&&ve)&&Tt(c),X.wheelStartX=null;return}if(O&&ei!=null){var Ve=O*ei,Ke=n.doc.scrollTop,rt=Ke+X.wrapper.clientHeight;Ve<0?Ke=Math.max(0,Ke+Ve-50):rt=Math.min(n.doc.height,rt+Ve+50),zl(n,{top:Ke,bottom:rt})}ol<20&&(X.wheelStartX==null?(X.wheelStartX=ce.scrollLeft,X.wheelStartY=ce.scrollTop,X.wheelDX=C,X.wheelDY=O,setTimeout(function(){if(X.wheelStartX!=null){var ut=ce.scrollLeft-X.wheelStartX,yt=ce.scrollTop-X.wheelStartY,Ct=yt&&X.wheelDY&&yt/X.wheelDY||ut&&X.wheelDX&&ut/X.wheelDX;X.wheelStartX=X.wheelStartY=null,Ct&&(ei=(ei*ol+Ct)/(ol+1),++ol)}},200)):(X.wheelDX+=C,X.wheelDY+=O))}}var Pi=function(n,c){this.ranges=n,this.primIndex=c};Pi.prototype.primary=function(){return this.ranges[this.primIndex]},Pi.prototype.equals=function(n){if(n==this)return!0;if(n.primIndex!=this.primIndex||n.ranges.length!=this.ranges.length)return!1;for(var c=0;c<this.ranges.length;c++){var k=this.ranges[c],C=n.ranges[c];if(!Vi(k.anchor,C.anchor)||!Vi(k.head,C.head))return!1}return!0},Pi.prototype.deepCopy=function(){for(var n=[],c=0;c<this.ranges.length;c++)n[c]=new Ir(li(this.ranges[c].anchor),li(this.ranges[c].head));return new Pi(n,this.primIndex)},Pi.prototype.somethingSelected=function(){for(var n=0;n<this.ranges.length;n++)if(!this.ranges[n].empty())return!0;return!1},Pi.prototype.contains=function(n,c){c||(c=n);for(var k=0;k<this.ranges.length;k++){var C=this.ranges[k];if(Ht(c,C.from())>=0&&Ht(n,C.to())<=0)return k}return-1};var Ir=function(n,c){this.anchor=n,this.head=c};Ir.prototype.from=function(){return Yn(this.anchor,this.head)},Ir.prototype.to=function(){return ci(this.anchor,this.head)},Ir.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function ro(n,c,k){var C=n&&n.options.selectionsMayTouch,O=c[k];c.sort(function(Ve,Ke){return Ht(Ve.from(),Ke.from())}),k=xe(c,O);for(var X=1;X<c.length;X++){var ce=c[X],me=c[X-1],ve=Ht(me.to(),ce.from());if(C&&!ce.empty()?ve>0:ve>=0){var ke=Yn(me.from(),ce.from()),Ie=ci(me.to(),ce.to()),He=me.empty()?ce.from()==ce.head:me.from()==me.head;X<=k&&--k,c.splice(--X,2,new Ir(He?Ie:ke,He?ke:Ie))}}return new Pi(c,k)}function fo(n,c){return new Pi([new Ir(n,c||n)],0)}function Qo(n){return n.text?at(n.from.line+n.text.length-1,Pe(n.text).length+(n.text.length==1?n.from.ch:0)):n.to}function Yc(n,c){if(Ht(n,c.from)<0)return n;if(Ht(n,c.to)<=0)return Qo(c);var k=n.line+c.text.length-(c.to.line-c.from.line)-1,C=n.ch;return n.line==c.to.line&&(C+=Qo(c).ch-c.to.ch),at(k,C)}function Kl(n,c){for(var k=[],C=0;C<n.sel.ranges.length;C++){var O=n.sel.ranges[C];k.push(new Ir(Yc(O.anchor,c),Yc(O.head,c)))}return ro(n.cm,k,n.sel.primIndex)}function aa(n,c,k){return n.line==c.line?at(k.line,n.ch-c.ch+k.ch):at(k.line+(n.line-c.line),n.ch)}function $l(n,c,k){for(var C=[],O=at(n.first,0),X=O,ce=0;ce<c.length;ce++){var me=c[ce],ve=aa(me.from,O,X),ke=aa(Qo(me),O,X);if(O=me.to,X=ke,k=="around"){var Ie=n.sel.ranges[ce],He=Ht(Ie.head,Ie.anchor)<0;C[ce]=new Ir(He?ke:ve,He?ve:ke)}else C[ce]=new Ir(ve,ve)}return new Pi(C,n.sel.primIndex)}function Gl(n){n.doc.mode=dr(n.options,n.doc.modeOption),la(n)}function la(n){n.doc.iter(function(c){c.stateAfter&&(c.stateAfter=null),c.styles&&(c.styles=null)}),n.doc.modeFrontier=n.doc.highlightFrontier=n.doc.first,oa(n,100),n.state.modeGen++,n.curOp&&Qt(n)}function Zc(n,c){return c.from.ch==0&&c.to.ch==0&&Pe(c.text)==""&&(!n.cm||n.cm.options.wholeLineUpdateBefore)}function Vl(n,c,k,C){function O(At){return k?k[At]:null}function X(At,St,Lt){Vr(At,St,Lt,C),Cr(At,"change",At,c)}function ce(At,St){for(var Lt=[],Nt=At;Nt<St;++Nt)Lt.push(new Mr(ke[Nt],O(Nt),C));return Lt}var me=c.from,ve=c.to,ke=c.text,Ie=xt(n,me.line),He=xt(n,ve.line),Ve=Pe(ke),Ke=O(ke.length-1),rt=ve.line-me.line;if(c.full)n.insert(0,ce(0,ke.length)),n.remove(ke.length,n.size-ke.length);else if(Zc(n,c)){var ut=ce(0,ke.length-1);X(He,He.text,Ke),rt&&n.remove(me.line,rt),ut.length&&n.insert(me.line,ut)}else if(Ie==He)if(ke.length==1)X(Ie,Ie.text.slice(0,me.ch)+Ve+Ie.text.slice(ve.ch),Ke);else{var yt=ce(1,ke.length-1);yt.push(new Mr(Ve+Ie.text.slice(ve.ch),Ke,C)),X(Ie,Ie.text.slice(0,me.ch)+ke[0],O(0)),n.insert(me.line+1,yt)}else if(ke.length==1)X(Ie,Ie.text.slice(0,me.ch)+ke[0]+He.text.slice(ve.ch),O(0)),n.remove(me.line+1,rt);else{X(Ie,Ie.text.slice(0,me.ch)+ke[0],O(0)),X(He,Ve+He.text.slice(ve.ch),Ke);var Ct=ce(1,ke.length-1);rt>1&&n.remove(me.line+1,rt-1),n.insert(me.line+1,Ct)}Cr(n,"change",n,c)}function es(n,c,k){function C(O,X,ce){if(O.linked)for(var me=0;me<O.linked.length;++me){var ve=O.linked[me];if(ve.doc!=X){var ke=ce&&ve.sharedHist;k&&!ke||(c(ve.doc,ke),C(ve.doc,O,ke))}}}C(n,null,!0)}function sl(n,c){if(c.cm)throw new Error("This document is already in use.");n.doc=c,c.cm=n,Yo(n),Gl(n),al(n),n.options.lineWrapping||pr(n),n.options.mode=c.modeOption,Qt(n)}function al(n){(n.doc.direction=="rtl"?Z:F)(n.display.lineDiv,"CodeMirror-rtl")}function Xl(n){yn(n,function(){al(n),Qt(n)})}function ll(n){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=n||1}function Yl(n,c){var k={from:li(c.from),to:Qo(c),text:rr(n,c.from,c.to)};return Ql(n,k,c.from.line,c.to.line+1),es(n,function(C){return Ql(C,k,c.from.line,c.to.line+1)},!0),k}function Jc(n){for(;n.length;){var c=Pe(n);if(c.ranges)n.pop();else break}}function Zl(n,c){if(c)return Jc(n.done),Pe(n.done);if(n.done.length&&!Pe(n.done).ranges)return Pe(n.done);if(n.done.length>1&&!n.done[n.done.length-2].ranges)return n.done.pop(),Pe(n.done)}function cl(n,c,k,C){var O=n.history;O.undone.length=0;var X=+new Date,ce,me;if((O.lastOp==C||O.lastOrigin==c.origin&&c.origin&&(c.origin.charAt(0)=="+"&&O.lastModTime>X-(n.cm?n.cm.options.historyEventDelay:500)||c.origin.charAt(0)=="*"))&&(ce=Zl(O,O.lastOp==C)))me=Pe(ce.changes),Ht(c.from,c.to)==0&&Ht(c.from,me.to)==0?me.to=Qo(c):ce.changes.push(Yl(n,c));else{var ve=Pe(O.done);for((!ve||!ve.ranges)&&ul(n.sel,O.done),ce={changes:[Yl(n,c)],generation:O.generation},O.done.push(ce);O.done.length>O.undoDepth;)O.done.shift(),O.done[0].ranges||O.done.shift()}O.done.push(k),O.generation=++O.maxGeneration,O.lastModTime=O.lastSelTime=X,O.lastOp=O.lastSelOp=C,O.lastOrigin=O.lastSelOrigin=c.origin,me||qe(n,"historyAdded")}function Jl(n,c,k,C){var O=c.charAt(0);return O=="*"||O=="+"&&k.ranges.length==C.ranges.length&&k.somethingSelected()==C.somethingSelected()&&new Date-n.history.lastSelTime<=(n.cm?n.cm.options.historyEventDelay:500)}function ql(n,c,k,C){var O=n.history,X=C&&C.origin;k==O.lastSelOp||X&&O.lastSelOrigin==X&&(O.lastModTime==O.lastSelTime&&O.lastOrigin==X||Jl(n,X,Pe(O.done),c))?O.done[O.done.length-1]=c:ul(c,O.done),O.lastSelTime=+new Date,O.lastSelOrigin=X,O.lastSelOp=k,C&&C.clearRedo!==!1&&Jc(O.undone)}function ul(n,c){var k=Pe(c);k&&k.ranges&&k.equals(n)||c.push(n)}function Ql(n,c,k,C){var O=c["spans_"+n.id],X=0;n.iter(Math.max(n.first,k),Math.min(n.first+n.size,C),function(ce){ce.markedSpans&&((O||(O=c["spans_"+n.id]={}))[X]=ce.markedSpans),++X})}function ec(n){if(!n)return null;for(var c,k=0;k<n.length;++k)n[k].marker.explicitlyCleared?c||(c=n.slice(0,k)):c&&c.push(n[k]);return c?c.length?c:null:n}function of(n,c){var k=c["spans_"+n.id];if(!k)return null;for(var C=[],O=0;O<c.text.length;++O)C.push(ec(k[O]));return C}function qc(n,c){var k=of(n,c),C=Ko(n,c);if(!k)return C;if(!C)return k;for(var O=0;O<k.length;++O){var X=k[O],ce=C[O];if(X&&ce)e:for(var me=0;me<ce.length;++me){for(var ve=ce[me],ke=0;ke<X.length;++ke)if(X[ke].marker==ve.marker)continue e;X.push(ve)}else ce&&(k[O]=ce)}return k}function ca(n,c,k){for(var C=[],O=0;O<n.length;++O){var X=n[O];if(X.ranges){C.push(k?Pi.prototype.deepCopy.call(X):X);continue}var ce=X.changes,me=[];C.push({changes:me});for(var ve=0;ve<ce.length;++ve){var ke=ce[ve],Ie=void 0;if(me.push({from:ke.from,to:ke.to,text:ke.text}),c)for(var He in ke)(Ie=He.match(/^spans_(\d+)$/))&&xe(c,Number(Ie[1]))>-1&&(Pe(me)[He]=ke[He],delete ke[He])}}return C}function tc(n,c,k,C){if(C){var O=n.anchor;if(k){var X=Ht(c,O)<0;X!=Ht(k,O)<0?(O=c,c=k):X!=Ht(c,k)<0&&(c=k)}return new Ir(O,c)}else return new Ir(k||c,c)}function ua(n,c,k,C,O){O==null&&(O=n.cm&&(n.cm.display.shift||n.extend)),On(n,new Pi([tc(n.sel.primary(),c,k,O)],0),C)}function Ot(n,c,k){for(var C=[],O=n.cm&&(n.cm.display.shift||n.extend),X=0;X<n.sel.ranges.length;X++)C[X]=tc(n.sel.ranges[X],c[X],null,O);var ce=ro(n.cm,C,n.sel.primIndex);On(n,ce,k)}function Ui(n,c,k,C){var O=n.sel.ranges.slice(0);O[c]=k,On(n,ro(n.cm,O,n.sel.primIndex),C)}function Qc(n,c,k,C){On(n,fo(c,k),C)}function sf(n,c,k){var C={ranges:c.ranges,update:function(O){this.ranges=[];for(var X=0;X<O.length;X++)this.ranges[X]=new Ir(Gt(n,O[X].anchor),Gt(n,O[X].head))},origin:k&&k.origin};return qe(n,"beforeSelectionChange",n,C),n.cm&&qe(n.cm,"beforeSelectionChange",n.cm,C),C.ranges!=c.ranges?ro(n.cm,C.ranges,C.ranges.length-1):c}function wi(n,c,k){var C=n.history.done,O=Pe(C);O&&O.ranges?(C[C.length-1]=c,fl(n,c,k)):On(n,c,k)}function On(n,c,k){fl(n,c,k),ql(n,n.sel,n.cm?n.cm.curOp.id:NaN,k)}function fl(n,c,k){(vt(n,"beforeSelectionChange")||n.cm&&vt(n.cm,"beforeSelectionChange"))&&(c=sf(n,c,k));var C=k&&k.bias||(Ht(c.primary().head,n.sel.primary().head)<0?-1:1);af(n,fa(n,c,C,!0)),!(k&&k.scroll===!1)&&n.cm&&ra(n.cm)}function af(n,c){c.equals(n.sel)||(n.sel=c,n.cm&&(n.cm.curOp.updateInput=1,n.cm.curOp.selectionChanged=!0,ft(n.cm)),Cr(n,"cursorActivity",n))}function lf(n){af(n,fa(n,n.sel,null,!1))}function fa(n,c,k,C){for(var O,X=0;X<c.ranges.length;X++){var ce=c.ranges[X],me=c.ranges.length==n.sel.ranges.length&&n.sel.ranges[X],ve=rc(n,ce.anchor,me&&me.anchor,k,C),ke=rc(n,ce.head,me&&me.head,k,C);(O||ve!=ce.anchor||ke!=ce.head)&&(O||(O=c.ranges.slice(0,X)),O[X]=new Ir(ve,ke))}return O?ro(n.cm,O,c.primIndex):c}function xi(n,c,k,C,O){var X=xt(n,c.line);if(X.markedSpans)for(var ce=0;ce<X.markedSpans.length;++ce){var me=X.markedSpans[ce],ve=me.marker,ke="selectLeft"in ve?!ve.selectLeft:ve.inclusiveLeft,Ie="selectRight"in ve?!ve.selectRight:ve.inclusiveRight;if((me.from==null||(ke?me.from<=c.ch:me.from<c.ch))&&(me.to==null||(Ie?me.to>=c.ch:me.to>c.ch))){if(O&&(qe(ve,"beforeCursorEnter"),ve.explicitlyCleared))if(X.markedSpans){--ce;continue}else break;if(!ve.atomic)continue;if(k){var He=ve.find(C<0?1:-1),Ve=void 0;if((C<0?Ie:ke)&&(He=ts(n,He,-C,He&&He.line==c.line?X:null)),He&&He.line==c.line&&(Ve=Ht(He,k))&&(C<0?Ve<0:Ve>0))return xi(n,He,c,C,O)}var Ke=ve.find(C<0?-1:1);return(C<0?ke:Ie)&&(Ke=ts(n,Ke,C,Ke.line==c.line?X:null)),Ke?xi(n,Ke,c,C,O):null}}return c}function rc(n,c,k,C,O){var X=C||1,ce=xi(n,c,k,X,O)||!O&&xi(n,c,k,X,!0)||xi(n,c,k,-X,O)||!O&&xi(n,c,k,-X,!0);return ce||(n.cantEdit=!0,at(n.first,0))}function ts(n,c,k,C){return k<0&&c.ch==0?c.line>n.first?Gt(n,at(c.line-1)):null:k>0&&c.ch==(C||xt(n,c.line)).text.length?c.line<n.first+n.size-1?at(c.line+1,0):null:new at(c.line,c.ch+k)}function eu(n){n.setSelection(at(n.firstLine(),0),at(n.lastLine()),Le)}function nc(n,c,k){var C={canceled:!1,from:c.from,to:c.to,text:c.text,origin:c.origin,cancel:function(){return C.canceled=!0}};return k&&(C.update=function(O,X,ce,me){O&&(C.from=Gt(n,O)),X&&(C.to=Gt(n,X)),ce&&(C.text=ce),me!==void 0&&(C.origin=me)}),qe(n,"beforeChange",n,C),n.cm&&qe(n.cm,"beforeChange",n.cm,C),C.canceled?(n.cm&&(n.cm.curOp.updateInput=2),null):{from:C.from,to:C.to,text:C.text,origin:C.origin}}function Cs(n,c,k){if(n.cm){if(!n.cm.curOp)return Ln(n.cm,Cs)(n,c,k);if(n.cm.state.suppressEdits)return}if(!((vt(n,"beforeChange")||n.cm&&vt(n.cm,"beforeChange"))&&(c=nc(n,c,!0),!c))){var C=hs&&!k&&Fi(n,c.from,c.to);if(C)for(var O=C.length-1;O>=0;--O)tu(n,{from:C[O].from,to:C[O].to,text:O?[""]:c.text,origin:c.origin});else tu(n,c)}}function tu(n,c){if(!(c.text.length==1&&c.text[0]==""&&Ht(c.from,c.to)==0)){var k=Kl(n,c);cl(n,c,k,n.cm?n.cm.curOp.id:NaN),ha(n,c,k,Ko(n,c));var C=[];es(n,function(O,X){!X&&xe(C,O.history)==-1&&(hl(O.history,c),C.push(O.history)),ha(O,c,null,Ko(O,c))})}}function rs(n,c,k){var C=n.cm&&n.cm.state.suppressEdits;if(!(C&&!k)){for(var O=n.history,X,ce=n.sel,me=c=="undo"?O.done:O.undone,ve=c=="undo"?O.undone:O.done,ke=0;ke<me.length&&(X=me[ke],!(k?X.ranges&&!X.equals(n.sel):!X.ranges));ke++);if(ke!=me.length){for(O.lastOrigin=O.lastSelOrigin=null;;)if(X=me.pop(),X.ranges){if(ul(X,ve),k&&!X.equals(n.sel)){On(n,X,{clearRedo:!1});return}ce=X}else if(C){me.push(X);return}else break;var Ie=[];ul(ce,ve),ve.push({changes:Ie,generation:O.generation}),O.generation=X.generation||++O.maxGeneration;for(var He=vt(n,"beforeChange")||n.cm&&vt(n.cm,"beforeChange"),Ve=function(ut){var yt=X.changes[ut];if(yt.origin=c,He&&!nc(n,yt,!1))return me.length=0,{};Ie.push(Yl(n,yt));var Ct=ut?Kl(n,yt):Pe(me);ha(n,yt,Ct,qc(n,yt)),!ut&&n.cm&&n.cm.scrollIntoView({from:yt.from,to:Qo(yt)});var At=[];es(n,function(St,Lt){!Lt&&xe(At,St.history)==-1&&(hl(St.history,yt),At.push(St.history)),ha(St,yt,null,qc(St,yt))})},Ke=X.changes.length-1;Ke>=0;--Ke){var rt=Ve(Ke);if(rt)return rt.v}}}}function ic(n,c){if(c!=0&&(n.first+=c,n.sel=new Pi(_e(n.sel.ranges,function(O){return new Ir(at(O.anchor.line+c,O.anchor.ch),at(O.head.line+c,O.head.ch))}),n.sel.primIndex),n.cm)){Qt(n.cm,n.first,n.first-c,c);for(var k=n.cm.display,C=k.viewFrom;C<k.viewTo;C++)nn(n.cm,C,"gutter")}}function ha(n,c,k,C){if(n.cm&&!n.cm.curOp)return Ln(n.cm,ha)(n,c,k,C);if(c.to.line<n.first){ic(n,c.text.length-1-(c.to.line-c.from.line));return}if(!(c.from.line>n.lastLine())){if(c.from.line<n.first){var O=c.text.length-1-(n.first-c.from.line);ic(n,O),c={from:at(n.first,0),to:at(c.to.line+O,c.to.ch),text:[Pe(c.text)],origin:c.origin}}var X=n.lastLine();c.to.line>X&&(c={from:c.from,to:at(X,xt(n,X).text.length),text:[c.text[0]],origin:c.origin}),c.removed=rr(n,c.from,c.to),k||(k=Kl(n,c)),n.cm?cf(n.cm,c,C):Vl(n,c,C),fl(n,k,Le),n.cantEdit&&rc(n,at(n.firstLine(),0))&&(n.cantEdit=!1)}}function cf(n,c,k){var C=n.doc,O=n.display,X=c.from,ce=c.to,me=!1,ve=X.line;n.options.lineWrapping||(ve=Zt(it(xt(C,X.line))),C.iter(ve,ce.line+1,function(Ke){if(Ke==O.maxLine)return me=!0,!0})),C.sel.contains(c.from,c.to)>-1&&ft(n),Vl(C,c,k,ea(n)),n.options.lineWrapping||(C.iter(ve,X.line+c.text.length,function(Ke){var rt=or(Ke);rt>O.maxLineLength&&(O.maxLine=Ke,O.maxLineLength=rt,O.maxLineChanged=!0,me=!1)}),me&&(n.curOp.updateMaxLine=!0)),Sa(C,X.line),oa(n,400);var ke=c.text.length-(ce.line-X.line)-1;c.full?Qt(n):X.line==ce.line&&c.text.length==1&&!Zc(n.doc,c)?nn(n,X.line,"text"):Qt(n,X.line,ce.line+1,ke);var Ie=vt(n,"changes"),He=vt(n,"change");if(He||Ie){var Ve={from:X,to:ce,text:c.text,removed:c.removed,origin:c.origin};He&&Cr(n,"change",n,Ve),Ie&&(n.curOp.changeObjs||(n.curOp.changeObjs=[])).push(Ve)}n.display.selForContextMenu=null}function Ra(n,c,k,C,O){var X;C||(C=k),Ht(C,k)<0&&(X=[C,k],k=X[0],C=X[1]),typeof c=="string"&&(c=n.splitLines(c)),Cs(n,{from:k,to:C,text:c,origin:O})}function uf(n,c,k,C){k<n.line?n.line+=C:c<n.line&&(n.line=c,n.ch=0)}function ff(n,c,k,C){for(var O=0;O<n.length;++O){var X=n[O],ce=!0;if(X.ranges){X.copied||(X=n[O]=X.deepCopy(),X.copied=!0);for(var me=0;me<X.ranges.length;me++)uf(X.ranges[me].anchor,c,k,C),uf(X.ranges[me].head,c,k,C);continue}for(var ve=0;ve<X.changes.length;++ve){var ke=X.changes[ve];if(k<ke.from.line)ke.from=at(ke.from.line+C,ke.from.ch),ke.to=at(ke.to.line+C,ke.to.ch);else if(c<=ke.to.line){ce=!1;break}}ce||(n.splice(0,O+1),O=0)}}function hl(n,c){var k=c.from.line,C=c.to.line,O=c.text.length-(C-k)-1;ff(n.done,k,C,O),ff(n.undone,k,C,O)}function dl(n,c,k,C){var O=c,X=c;return typeof c=="number"?X=xt(n,mi(n,c)):O=Zt(c),O==null?null:(C(X,O)&&n.cm&&nn(n.cm,O,k),X)}function ks(n){this.lines=n,this.parent=null;for(var c=0,k=0;k<n.length;++k)n[k].parent=this,c+=n[k].height;this.height=c}ks.prototype={chunkSize:function(){return this.lines.length},removeInner:function(n,c){for(var k=n,C=n+c;k<C;++k){var O=this.lines[k];this.height-=O.height,zr(O),Cr(O,"delete")}this.lines.splice(n,c)},collapse:function(n){n.push.apply(n,this.lines)},insertInner:function(n,c,k){this.height+=k,this.lines=this.lines.slice(0,n).concat(c).concat(this.lines.slice(n));for(var C=0;C<c.length;++C)c[C].parent=this},iterN:function(n,c,k){for(var C=n+c;n<C;++n)if(k(this.lines[n]))return!0}};function Ia(n){this.children=n;for(var c=0,k=0,C=0;C<n.length;++C){var O=n[C];c+=O.chunkSize(),k+=O.height,O.parent=this}this.size=c,this.height=k,this.parent=null}Ia.prototype={chunkSize:function(){return this.size},removeInner:function(n,c){this.size-=c;for(var k=0;k<this.children.length;++k){var C=this.children[k],O=C.chunkSize();if(n<O){var X=Math.min(c,O-n),ce=C.height;if(C.removeInner(n,X),this.height-=ce-C.height,O==X&&(this.children.splice(k--,1),C.parent=null),(c-=X)==0)break;n=0}else n-=O}if(this.size-c<25&&(this.children.length>1||!(this.children[0]instanceof ks))){var me=[];this.collapse(me),this.children=[new ks(me)],this.children[0].parent=this}},collapse:function(n){for(var c=0;c<this.children.length;++c)this.children[c].collapse(n)},insertInner:function(n,c,k){this.size+=c.length,this.height+=k;for(var C=0;C<this.children.length;++C){var O=this.children[C],X=O.chunkSize();if(n<=X){if(O.insertInner(n,c,k),O.lines&&O.lines.length>50){for(var ce=O.lines.length%25+25,me=ce;me<O.lines.length;){var ve=new ks(O.lines.slice(me,me+=25));O.height-=ve.height,this.children.splice(++C,0,ve),ve.parent=this}O.lines=O.lines.slice(0,ce),this.maybeSpill()}break}n-=X}},maybeSpill:function(){if(!(this.children.length<=10)){var n=this;do{var c=n.children.splice(n.children.length-5,5),k=new Ia(c);if(n.parent){n.size-=k.size,n.height-=k.height;var O=xe(n.parent.children,n);n.parent.children.splice(O+1,0,k)}else{var C=new Ia(n.children);C.parent=n,n.children=[C,k],n=C}k.parent=n.parent}while(n.children.length>10);n.parent.maybeSpill()}},iterN:function(n,c,k){for(var C=0;C<this.children.length;++C){var O=this.children[C],X=O.chunkSize();if(n<X){var ce=Math.min(c,X-n);if(O.iterN(n,ce,k))return!0;if((c-=ce)==0)break;n=0}else n-=X}}};var ja=function(n,c,k){if(k)for(var C in k)k.hasOwnProperty(C)&&(this[C]=k[C]);this.doc=n,this.node=c};ja.prototype.clear=function(){var n=this.doc.cm,c=this.line.widgets,k=this.line,C=Zt(k);if(!(C==null||!c)){for(var O=0;O<c.length;++O)c[O]==this&&c.splice(O--,1);c.length||(k.widgets=null);var X=xo(this);vr(k,Math.max(0,k.height-X)),n&&(yn(n,function(){hf(n,k,-X),nn(n,C,"widget")}),Cr(n,"lineWidgetCleared",n,this,C))}},ja.prototype.changed=function(){var n=this,c=this.height,k=this.doc.cm,C=this.line;this.height=null;var O=xo(this)-c;O&&(nr(this.doc,C)||vr(C,C.height+O),k&&yn(k,function(){k.curOp.forceUpdate=!0,hf(k,C,O),Cr(k,"lineWidgetChanged",k,n,Zt(C))}))},bt(ja);function hf(n,c,k){Vt(c)<(n.curOp&&n.curOp.scrollTop||n.doc.scrollTop)&&Bl(n,k)}function df(n,c,k,C){var O=new ja(n,k,C),X=n.cm;return X&&O.noHScroll&&(X.display.alignWidgets=!0),dl(n,c,"widget",function(ce){var me=ce.widgets||(ce.widgets=[]);if(O.insertAt==null?me.push(O):me.splice(Math.min(me.length-1,Math.max(0,O.insertAt)),0,O),O.line=ce,X&&!nr(n,ce)){var ve=Vt(ce)<n.scrollTop;vr(ce,ce.height+xo(O)),ve&&Bl(X,O.height),X.curOp.forceUpdate=!0}return!0}),X&&Cr(X,"lineWidgetAdded",X,O,typeof c=="number"?c:Zt(c)),O}var pf=0,Es=function(n,c){this.lines=[],this.type=c,this.doc=n,this.id=++pf};Es.prototype.clear=function(){if(!this.explicitlyCleared){var n=this.doc.cm,c=n&&!n.curOp;if(c&&Ss(n),vt(this,"clear")){var k=this.find();k&&Cr(this,"clear",k.from,k.to)}for(var C=null,O=null,X=0;X<this.lines.length;++X){var ce=this.lines[X],me=so(ce.markedSpans,this);n&&!this.collapsed?nn(n,Zt(ce),"text"):n&&(me.to!=null&&(O=Zt(ce)),me.from!=null&&(C=Zt(ce))),ce.markedSpans=Wn(ce.markedSpans,me),me.from==null&&this.collapsed&&!nr(this.doc,ce)&&n&&vr(ce,Xo(n.display))}if(n&&this.collapsed&&!n.options.lineWrapping)for(var ve=0;ve<this.lines.length;++ve){var ke=it(this.lines[ve]),Ie=or(ke);Ie>n.display.maxLineLength&&(n.display.maxLine=ke,n.display.maxLineLength=Ie,n.display.maxLineChanged=!0)}C!=null&&n&&this.collapsed&&Qt(n,C,O+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,n&&lf(n.doc)),n&&Cr(n,"markerCleared",n,this,C,O),c&&qo(n),this.parent&&this.parent.clear()}},Es.prototype.find=function(n,c){n==null&&this.type=="bookmark"&&(n=1);for(var k,C,O=0;O<this.lines.length;++O){var X=this.lines[O],ce=so(X.markedSpans,this);if(ce.from!=null&&(k=at(c?X:Zt(X),ce.from),n==-1))return k;if(ce.to!=null&&(C=at(c?X:Zt(X),ce.to),n==1))return C}return k&&{from:k,to:C}},Es.prototype.changed=function(){var n=this,c=this.find(-1,!0),k=this,C=this.doc.cm;!c||!C||yn(C,function(){var O=c.line,X=Zt(c.line),ce=Oi(C,X);if(ce&&(Ci(ce),C.curOp.selectionChanged=C.curOp.forceUpdate=!0),C.curOp.updateMaxLine=!0,!nr(k.doc,O)&&k.height!=null){var me=k.height;k.height=null;var ve=xo(k)-me;ve&&vr(O,O.height+ve)}Cr(C,"markerChanged",C,n)})},Es.prototype.attachLine=function(n){if(!this.lines.length&&this.doc.cm){var c=this.doc.cm.curOp;(!c.maybeHiddenMarkers||xe(c.maybeHiddenMarkers,this)==-1)&&(c.maybeUnhiddenMarkers||(c.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(n)},Es.prototype.detachLine=function(n){if(this.lines.splice(xe(this.lines,n),1),!this.lines.length&&this.doc.cm){var c=this.doc.cm.curOp;(c.maybeHiddenMarkers||(c.maybeHiddenMarkers=[])).push(this)}},bt(Es);function ns(n,c,k,C,O){if(C&&C.shared)return sn(n,c,k,C,O);if(n.cm&&!n.cm.curOp)return Ln(n.cm,ns)(n,c,k,C,O);var X=new Es(n,O),ce=Ht(c,k);if(C&&ye(C,X,!1),ce>0||ce==0&&X.clearWhenEmpty!==!1)return X;if(X.replacedWith&&(X.collapsed=!0,X.widgetNode=U("span",[X.replacedWith],"CodeMirror-widget"),C.handleMouseEvents||X.widgetNode.setAttribute("cm-ignore-events","true"),C.insertLeft&&(X.widgetNode.insertLeft=!0)),X.collapsed){if(tt(n,c.line,c,k,X)||c.line!=k.line&&tt(n,k.line,c,k,X))throw new Error("Inserting collapsed marker partially overlapping an existing one");Xs()}X.addToHistory&&cl(n,{from:c,to:k,origin:"markText"},n.sel,NaN);var me=c.line,ve=n.cm,ke;if(n.iter(me,k.line+1,function(He){ve&&X.collapsed&&!ve.options.lineWrapping&&it(He)==ve.display.maxLine&&(ke=!0),X.collapsed&&me!=c.line&&vr(He,0),ao(He,new Ti(X,me==c.line?c.ch:null,me==k.line?k.ch:null)),++me}),X.collapsed&&n.iter(c.line,k.line+1,function(He){nr(n,He)&&vr(He,0)}),X.clearOnEnter&&Ze(X,"beforeCursorEnter",function(){return X.clear()}),X.readOnly&&(Vs(),(n.history.done.length||n.history.undone.length)&&n.clearHistory()),X.collapsed&&(X.id=++pf,X.atomic=!0),ve){if(ke&&(ve.curOp.updateMaxLine=!0),X.collapsed)Qt(ve,c.line,k.line+1);else if(X.className||X.startStyle||X.endStyle||X.css||X.attributes||X.title)for(var Ie=c.line;Ie<=k.line;Ie++)nn(ve,Ie,"text");X.atomic&&lf(ve.doc),Cr(ve,"markerAdded",ve,X)}return X}var ar=function(n,c){this.markers=n,this.primary=c;for(var k=0;k<n.length;++k)n[k].parent=this};ar.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var n=0;n<this.markers.length;++n)this.markers[n].clear();Cr(this,"clear")}},ar.prototype.find=function(n,c){return this.primary.find(n,c)},bt(ar);function sn(n,c,k,C,O){C=ye(C),C.shared=!1;var X=[ns(n,c,k,C,O)],ce=X[0],me=C.widgetNode;return es(n,function(ve){me&&(C.widgetNode=me.cloneNode(!0)),X.push(ns(ve,Gt(ve,c),Gt(ve,k),C,O));for(var ke=0;ke<ve.linked.length;++ke)if(ve.linked[ke].isParent)return;ce=Pe(X)}),new ar(X,ce)}function Ms(n){return n.findMarks(at(n.first,0),n.clipPos(at(n.lastLine())),function(c){return c.parent})}function mf(n,c){for(var k=0;k<c.length;k++){var C=c[k],O=C.find(),X=n.clipPos(O.from),ce=n.clipPos(O.to);if(Ht(X,ce)){var me=ns(n,X,ce,C.primary,C.primary.type);C.markers.push(me),me.parent=C}}}function Wi(n){for(var c=function(C){var O=n[C],X=[O.primary.doc];es(O.primary.doc,function(ve){return X.push(ve)});for(var ce=0;ce<O.markers.length;ce++){var me=O.markers[ce];xe(X,me.doc)==-1&&(me.parent=null,O.markers.splice(ce--,1))}},k=0;k<n.length;k++)c(k)}var gf=0,kn=function(n,c,k,C,O){if(!(this instanceof kn))return new kn(n,c,k,C,O);k==null&&(k=0),Ia.call(this,[new ks([new Mr("",null)])]),this.first=k,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=k;var X=at(k,0);this.sel=fo(X),this.history=new ll(null),this.id=++gf,this.modeOption=c,this.lineSep=C,this.direction=O=="rtl"?"rtl":"ltr",this.extend=!1,typeof n=="string"&&(n=this.splitLines(n)),Vl(this,{from:X,to:X,text:n}),On(this,fo(X),Le)};kn.prototype=T(Ia.prototype,{constructor:kn,iter:function(n,c,k){k?this.iterN(n-this.first,c-n,k):this.iterN(this.first,this.first+this.size,n)},insert:function(n,c){for(var k=0,C=0;C<c.length;++C)k+=c[C].height;this.insertInner(n-this.first,c,k)},remove:function(n,c){this.removeInner(n-this.first,c)},getValue:function(n){var c=_r(this,this.first,this.first+this.size);return n===!1?c:c.join(n||this.lineSeparator())},setValue:Fn(function(n){var c=at(this.first,0),k=this.first+this.size-1;Cs(this,{from:c,to:at(k,xt(this,k).text.length),text:this.splitLines(n),origin:"setValue",full:!0},!0),this.cm&&na(this.cm,0,0),On(this,fo(c),Le)}),replaceRange:function(n,c,k,C){c=Gt(this,c),k=k?Gt(this,k):c,Ra(this,n,c,k,C)},getRange:function(n,c,k){var C=rr(this,Gt(this,n),Gt(this,c));return k===!1?C:C.join(k||this.lineSeparator())},getLine:function(n){var c=this.getLineHandle(n);return c&&c.text},getLineHandle:function(n){if(Er(this,n))return xt(this,n)},getLineNumber:function(n){return Zt(n)},getLineHandleVisualStart:function(n){return typeof n=="number"&&(n=xt(this,n)),it(n)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(n){return Gt(this,n)},getCursor:function(n){var c=this.sel.primary(),k;return n==null||n=="head"?k=c.head:n=="anchor"?k=c.anchor:n=="end"||n=="to"||n===!1?k=c.to():k=c.from(),k},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Fn(function(n,c,k){Qc(this,Gt(this,typeof n=="number"?at(n,c||0):n),null,k)}),setSelection:Fn(function(n,c,k){Qc(this,Gt(this,n),Gt(this,c||n),k)}),extendSelection:Fn(function(n,c,k){ua(this,Gt(this,n),c&&Gt(this,c),k)}),extendSelections:Fn(function(n,c){Ot(this,Bi(this,n),c)}),extendSelectionsBy:Fn(function(n,c){var k=_e(this.sel.ranges,n);Ot(this,Bi(this,k),c)}),setSelections:Fn(function(n,c,k){if(n.length){for(var C=[],O=0;O<n.length;O++)C[O]=new Ir(Gt(this,n[O].anchor),Gt(this,n[O].head));c==null&&(c=Math.min(n.length-1,this.sel.primIndex)),On(this,ro(this.cm,C,c),k)}}),addSelection:Fn(function(n,c,k){var C=this.sel.ranges.slice(0);C.push(new Ir(Gt(this,n),Gt(this,c||n))),On(this,ro(this.cm,C,C.length-1),k)}),getSelection:function(n){for(var c=this.sel.ranges,k,C=0;C<c.length;C++){var O=rr(this,c[C].from(),c[C].to());k=k?k.concat(O):O}return n===!1?k:k.join(n||this.lineSeparator())},getSelections:function(n){for(var c=[],k=this.sel.ranges,C=0;C<k.length;C++){var O=rr(this,k[C].from(),k[C].to());n!==!1&&(O=O.join(n||this.lineSeparator())),c[C]=O}return c},replaceSelection:function(n,c,k){for(var C=[],O=0;O<this.sel.ranges.length;O++)C[O]=n;this.replaceSelections(C,c,k||"+input")},replaceSelections:Fn(function(n,c,k){for(var C=[],O=this.sel,X=0;X<O.ranges.length;X++){var ce=O.ranges[X];C[X]={from:ce.from(),to:ce.to(),text:this.splitLines(n[X]),origin:k}}for(var me=c&&c!="end"&&$l(this,C,c),ve=C.length-1;ve>=0;ve--)Cs(this,C[ve]);me?wi(this,me):this.cm&&ra(this.cm)}),undo:Fn(function(){rs(this,"undo")}),redo:Fn(function(){rs(this,"redo")}),undoSelection:Fn(function(){rs(this,"undo",!0)}),redoSelection:Fn(function(){rs(this,"redo",!0)}),setExtending:function(n){this.extend=n},getExtending:function(){return this.extend},historySize:function(){for(var n=this.history,c=0,k=0,C=0;C<n.done.length;C++)n.done[C].ranges||++c;for(var O=0;O<n.undone.length;O++)n.undone[O].ranges||++k;return{undo:c,redo:k}},clearHistory:function(){var n=this;this.history=new ll(this.history.maxGeneration),es(this,function(c){return c.history=n.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(n){return n&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(n){return this.history.generation==(n||this.cleanGeneration)},getHistory:function(){return{done:ca(this.history.done),undone:ca(this.history.undone)}},setHistory:function(n){var c=this.history=new ll(this.history.maxGeneration);c.done=ca(n.done.slice(0),null,!0),c.undone=ca(n.undone.slice(0),null,!0)},setGutterMarker:Fn(function(n,c,k){return dl(this,n,"gutter",function(C){var O=C.gutterMarkers||(C.gutterMarkers={});return O[c]=k,!k&&z(O)&&(C.gutterMarkers=null),!0})}),clearGutter:Fn(function(n){var c=this;this.iter(function(k){k.gutterMarkers&&k.gutterMarkers[n]&&dl(c,k,"gutter",function(){return k.gutterMarkers[n]=null,z(k.gutterMarkers)&&(k.gutterMarkers=null),!0})})}),lineInfo:function(n){var c;if(typeof n=="number"){if(!Er(this,n)||(c=n,n=xt(this,n),!n))return null}else if(c=Zt(n),c==null)return null;return{line:c,handle:n,text:n.text,gutterMarkers:n.gutterMarkers,textClass:n.textClass,bgClass:n.bgClass,wrapClass:n.wrapClass,widgets:n.widgets}},addLineClass:Fn(function(n,c,k){return dl(this,n,c=="gutter"?"gutter":"class",function(C){var O=c=="text"?"textClass":c=="background"?"bgClass":c=="gutter"?"gutterClass":"wrapClass";if(!C[O])C[O]=k;else{if(R(k).test(C[O]))return!1;C[O]+=" "+k}return!0})}),removeLineClass:Fn(function(n,c,k){return dl(this,n,c=="gutter"?"gutter":"class",function(C){var O=c=="text"?"textClass":c=="background"?"bgClass":c=="gutter"?"gutterClass":"wrapClass",X=C[O];if(X)if(k==null)C[O]=null;else{var ce=X.match(R(k));if(!ce)return!1;var me=ce.index+ce[0].length;C[O]=X.slice(0,ce.index)+(!ce.index||me==X.length?"":" ")+X.slice(me)||null}else return!1;return!0})}),addLineWidget:Fn(function(n,c,k){return df(this,n,c,k)}),removeLineWidget:function(n){n.clear()},markText:function(n,c,k){return ns(this,Gt(this,n),Gt(this,c),k,k&&k.type||"range")},setBookmark:function(n,c){var k={replacedWith:c&&(c.nodeType==null?c.widget:c),insertLeft:c&&c.insertLeft,clearWhenEmpty:!1,shared:c&&c.shared,handleMouseEvents:c&&c.handleMouseEvents};return n=Gt(this,n),ns(this,n,n,k,"bookmark")},findMarksAt:function(n){n=Gt(this,n);var c=[],k=xt(this,n.line).markedSpans;if(k)for(var C=0;C<k.length;++C){var O=k[C];(O.from==null||O.from<=n.ch)&&(O.to==null||O.to>=n.ch)&&c.push(O.marker.parent||O.marker)}return c},findMarks:function(n,c,k){n=Gt(this,n),c=Gt(this,c);var C=[],O=n.line;return this.iter(n.line,c.line+1,function(X){var ce=X.markedSpans;if(ce)for(var me=0;me<ce.length;me++){var ve=ce[me];!(ve.to!=null&&O==n.line&&n.ch>=ve.to||ve.from==null&&O!=n.line||ve.from!=null&&O==c.line&&ve.from>=c.ch)&&(!k||k(ve.marker))&&C.push(ve.marker.parent||ve.marker)}++O}),C},getAllMarks:function(){var n=[];return this.iter(function(c){var k=c.markedSpans;if(k)for(var C=0;C<k.length;++C)k[C].from!=null&&n.push(k[C].marker)}),n},posFromIndex:function(n){var c,k=this.first,C=this.lineSeparator().length;return this.iter(function(O){var X=O.text.length+C;if(X>n)return c=n,!0;n-=X,++k}),Gt(this,at(k,c))},indexFromPos:function(n){n=Gt(this,n);var c=n.ch;if(n.line<this.first||n.ch<0)return 0;var k=this.lineSeparator().length;return this.iter(this.first,n.line,function(C){c+=C.text.length+k}),c},copy:function(n){var c=new kn(_r(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return c.scrollTop=this.scrollTop,c.scrollLeft=this.scrollLeft,c.sel=this.sel,c.extend=!1,n&&(c.history.undoDepth=this.history.undoDepth,c.setHistory(this.getHistory())),c},linkedDoc:function(n){n||(n={});var c=this.first,k=this.first+this.size;n.from!=null&&n.from>c&&(c=n.from),n.to!=null&&n.to<k&&(k=n.to);var C=new kn(_r(this,c,k),n.mode||this.modeOption,c,this.lineSep,this.direction);return n.sharedHist&&(C.history=this.history),(this.linked||(this.linked=[])).push({doc:C,sharedHist:n.sharedHist}),C.linked=[{doc:this,isParent:!0,sharedHist:n.sharedHist}],mf(C,Ms(this)),C},unlinkDoc:function(n){if(n instanceof Xt&&(n=n.doc),this.linked)for(var c=0;c<this.linked.length;++c){var k=this.linked[c];if(k.doc==n){this.linked.splice(c,1),n.unlinkDoc(this),Wi(Ms(this));break}}if(n.history==this.history){var C=[n.id];es(n,function(O){return C.push(O.id)},!0),n.history=new ll(null),n.history.done=ca(this.history.done,C),n.history.undone=ca(this.history.undone,C)}},iterLinkedDocs:function(n){es(this,n)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(n){return this.lineSep?n.split(this.lineSep):Kt(n)},lineSeparator:function(){return this.lineSep||`
`},setDirection:Fn(function(n){n!="rtl"&&(n="ltr"),n!=this.direction&&(this.direction=n,this.iter(function(c){return c.order=null}),this.cm&&Xl(this.cm))})}),kn.prototype.eachLine=kn.prototype.iter;var ru=0;function ch(n){var c=this;if(Ba(c),!(Qe(c,n)||vi(c.display,n))){Tt(n),E&&(ru=+new Date);var k=uo(c,n,!0),C=n.dataTransfer.files;if(!(!k||c.isReadOnly()))if(C&&C.length&&window.FileReader&&window.File)for(var O=C.length,X=Array(O),ce=0,me=function(){++ce==O&&Ln(c,function(){k=Gt(c.doc,k);var Ke={from:k,to:k,text:c.doc.splitLines(X.filter(function(rt){return rt!=null}).join(c.doc.lineSeparator())),origin:"paste"};Cs(c.doc,Ke),wi(c.doc,fo(Gt(c.doc,k),Gt(c.doc,Qo(Ke))))})()},ve=function(Ke,rt){if(c.options.allowDropFileTypes&&xe(c.options.allowDropFileTypes,Ke.type)==-1){me();return}var ut=new FileReader;ut.onerror=function(){return me()},ut.onload=function(){var yt=ut.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(yt)){me();return}X[rt]=yt,me()},ut.readAsText(Ke)},ke=0;ke<C.length;ke++)ve(C[ke],ke);else{if(c.state.draggingText&&c.doc.sel.contains(k)>-1){c.state.draggingText(n),setTimeout(function(){return c.display.input.focus()},20);return}try{var Ie=n.dataTransfer.getData("Text");if(Ie){var He;if(c.state.draggingText&&!c.state.draggingText.copy&&(He=c.listSelections()),fl(c.doc,fo(k,k)),He)for(var Ve=0;Ve<He.length;++Ve)Ra(c.doc,"",He[Ve].anchor,He[Ve].head,"drag");c.replaceSelection(Ie,"around","paste"),c.display.input.focus()}}catch(Ke){}}}}function uh(n,c){if(E&&(!n.state.draggingText||+new Date-ru<100)){xn(c);return}if(!(Qe(n,c)||vi(n.display,c))&&(c.dataTransfer.setData("Text",n.getSelection()),c.dataTransfer.effectAllowed="copyMove",c.dataTransfer.setDragImage&&!d)){var k=P("img",null,null,"position: fixed; left: 0; top: 0;");k.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",v&&(k.width=k.height=1,n.display.wrapper.appendChild(k),k._top=k.offsetTop),c.dataTransfer.setDragImage(k,0,0),v&&k.parentNode.removeChild(k)}}function nu(n,c){var k=uo(n,c);if(k){var C=document.createDocumentFragment();Ic(n,k,C),n.display.dragCursor||(n.display.dragCursor=P("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),n.display.lineSpace.insertBefore(n.display.dragCursor,n.display.cursorDiv)),B(n.display.dragCursor,C)}}function Ba(n){n.display.dragCursor&&(n.display.lineSpace.removeChild(n.display.dragCursor),n.display.dragCursor=null)}function Na(n){if(document.getElementsByClassName){for(var c=document.getElementsByClassName("CodeMirror"),k=[],C=0;C<c.length;C++){var O=c[C].CodeMirror;O&&k.push(O)}k.length&&k[0].operation(function(){for(var X=0;X<k.length;X++)n(k[X])})}}var mt=!1;function iu(){mt||(oc(),mt=!0)}function oc(){var n;Ze(window,"resize",function(){n==null&&(n=setTimeout(function(){n=null,Na(sc)},100))}),Ze(window,"blur",function(){return Na(ta)})}function sc(n){var c=n.display;c.cachedCharWidth=c.cachedTextHeight=c.cachedPaddingH=null,c.scrollbarsClipped=!1,n.setSize()}for(var ho={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},pl=0;pl<10;pl++)ho[pl+48]=ho[pl+96]=String(pl);for(var ac=65;ac<=90;ac++)ho[ac]=String.fromCharCode(ac);for(var ml=1;ml<=12;ml++)ho[ml+111]=ho[ml+63235]="F"+ml;var Zr={};Zr.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Zr.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Zr.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Zr.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Zr.default=_?Zr.macDefault:Zr.pcDefault;function fh(n){var c=n.split(/-(?!$)/);n=c[c.length-1];for(var k,C,O,X,ce=0;ce<c.length-1;ce++){var me=c[ce];if(/^(cmd|meta|m)$/i.test(me))X=!0;else if(/^a(lt)?$/i.test(me))k=!0;else if(/^(c|ctrl|control)$/i.test(me))C=!0;else if(/^s(hift)?$/i.test(me))O=!0;else throw new Error("Unrecognized modifier name: "+me)}return k&&(n="Alt-"+n),C&&(n="Ctrl-"+n),X&&(n="Cmd-"+n),O&&(n="Shift-"+n),n}function ou(n){var c={};for(var k in n)if(n.hasOwnProperty(k)){var C=n[k];if(/^(name|fallthrough|(de|at)tach)$/.test(k))continue;if(C=="..."){delete n[k];continue}for(var O=_e(k.split(" "),fh),X=0;X<O.length;X++){var ce=void 0,me=void 0;X==O.length-1?(me=O.join(" "),ce=C):(me=O.slice(0,X+1).join(" "),ce="...");var ve=c[me];if(!ve)c[me]=ce;else if(ve!=ce)throw new Error("Inconsistent bindings for "+me)}delete n[k]}for(var ke in c)n[ke]=c[ke];return n}function is(n,c,k,C){c=Si(c);var O=c.call?c.call(n,C):c[n];if(O===!1)return"nothing";if(O==="...")return"multi";if(O!=null&&k(O))return"handled";if(c.fallthrough){if(Object.prototype.toString.call(c.fallthrough)!="[object Array]")return is(n,c.fallthrough,k,C);for(var X=0;X<c.fallthrough.length;X++){var ce=is(n,c.fallthrough[X],k,C);if(ce)return ce}}}function gl(n){var c=typeof n=="string"?n:ho[n.keyCode];return c=="Ctrl"||c=="Alt"||c=="Shift"||c=="Mod"}function Ts(n,c,k){var C=n;return c.altKey&&C!="Alt"&&(n="Alt-"+n),(A?c.metaKey:c.ctrlKey)&&C!="Ctrl"&&(n="Ctrl-"+n),(A?c.ctrlKey:c.metaKey)&&C!="Mod"&&(n="Cmd-"+n),!k&&c.shiftKey&&C!="Shift"&&(n="Shift-"+n),n}function da(n,c){if(v&&n.keyCode==34&&n.char)return!1;var k=ho[n.keyCode];return k==null||n.altGraphKey?!1:(n.keyCode==3&&n.code&&(k=n.code),Ts(k,n,c))}function Si(n){return typeof n=="string"?Zr[n]:n}function no(n,c){for(var k=n.doc.sel.ranges,C=[],O=0;O<k.length;O++){for(var X=c(k[O]);C.length&&Ht(X.from,Pe(C).to)<=0;){var ce=C.pop();if(Ht(ce.from,X.from)<0){X.from=ce.from;break}}C.push(X)}yn(n,function(){for(var me=C.length-1;me>=0;me--)Ra(n.doc,"",C[me].from,C[me].to,"+delete");ra(n)})}function ti(n,c,k){var C=se(n.text,c+k,k);return C<0||C>n.text.length?null:C}function Ao(n,c,k){var C=ti(n,c.ch,k);return C==null?null:new at(c.line,C,k<0?"after":"before")}function pa(n,c,k,C,O){if(n){c.doc.direction=="rtl"&&(O=-O);var X=lt(k,c.doc.direction);if(X){var ce=O<0?Pe(X):X[0],me=O<0==(ce.level==1),ve=me?"after":"before",ke;if(ce.level>0||c.doc.direction=="rtl"){var Ie=eo(c,k);ke=O<0?k.text.length-1:0;var He=mr(c,Ie,ke).top;ke=ge(function(Ve){return mr(c,Ie,Ve).top==He},O<0==(ce.level==1)?ce.from:ce.to-1,ke),ve=="before"&&(ke=ti(k,ke,1))}else ke=O<0?ce.to:ce.from;return new at(C,ke,ve)}}return new at(C,O<0?k.text.length:0,O<0?"before":"after")}function Lo(n,c,k,C){var O=lt(c,n.doc.direction);if(!O)return Ao(c,k,C);k.ch>=c.text.length?(k.ch=c.text.length,k.sticky="before"):k.ch<=0&&(k.ch=0,k.sticky="after");var X=Re(O,k.ch,k.sticky),ce=O[X];if(n.doc.direction=="ltr"&&ce.level%2==0&&(C>0?ce.to>k.ch:ce.from<k.ch))return Ao(c,k,C);var me=function(Ct,At){return ti(c,Ct instanceof at?Ct.ch:Ct,At)},ve,ke=function(Ct){return n.options.lineWrapping?(ve=ve||eo(n,c),ys(n,c,ve,Ct)):{begin:0,end:c.text.length}},Ie=ke(k.sticky=="before"?me(k,-1):k.ch);if(n.doc.direction=="rtl"||ce.level==1){var He=ce.level==1==C<0,Ve=me(k,He?1:-1);if(Ve!=null&&(He?Ve<=ce.to&&Ve<=Ie.end:Ve>=ce.from&&Ve>=Ie.begin)){var Ke=He?"before":"after";return new at(k.line,Ve,Ke)}}var rt=function(Ct,At,St){for(var Lt=function(qr,Xn){return Xn?new at(k.line,me(qr,1),"before"):new at(k.line,qr,"after")};Ct>=0&&Ct<O.length;Ct+=At){var Nt=O[Ct],zt=At>0==(Nt.level!=1),lr=zt?St.begin:me(St.end,-1);if(Nt.from<=lr&&lr<Nt.to||(lr=zt?Nt.from:me(Nt.to,-1),St.begin<=lr&&lr<St.end))return Lt(lr,zt)}},ut=rt(X+C,C,Ie);if(ut)return ut;var yt=C>0?Ie.end:me(Ie.begin,-1);return yt!=null&&!(C>0&&yt==c.text.length)&&(ut=rt(C>0?0:O.length-1,C,ke(yt)),ut)?ut:null}var Fa={selectAll:eu,singleSelection:function(n){return n.setSelection(n.getCursor("anchor"),n.getCursor("head"),Le)},killLine:function(n){return no(n,function(c){if(c.empty()){var k=xt(n.doc,c.head.line).text.length;return c.head.ch==k&&c.head.line<n.lastLine()?{from:c.head,to:at(c.head.line+1,0)}:{from:c.head,to:at(c.head.line,k)}}else return{from:c.from(),to:c.to()}})},deleteLine:function(n){return no(n,function(c){return{from:at(c.from().line,0),to:Gt(n.doc,at(c.to().line+1,0))}})},delLineLeft:function(n){return no(n,function(c){return{from:at(c.from().line,0),to:c.from()}})},delWrappedLineLeft:function(n){return no(n,function(c){var k=n.charCoords(c.head,"div").top+5,C=n.coordsChar({left:0,top:k},"div");return{from:C,to:c.from()}})},delWrappedLineRight:function(n){return no(n,function(c){var k=n.charCoords(c.head,"div").top+5,C=n.coordsChar({left:n.display.lineDiv.offsetWidth+100,top:k},"div");return{from:c.from(),to:C}})},undo:function(n){return n.undo()},redo:function(n){return n.redo()},undoSelection:function(n){return n.undoSelection()},redoSelection:function(n){return n.redoSelection()},goDocStart:function(n){return n.extendSelection(at(n.firstLine(),0))},goDocEnd:function(n){return n.extendSelection(at(n.lastLine()))},goLineStart:function(n){return n.extendSelectionsBy(function(c){return su(n,c.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(n){return n.extendSelectionsBy(function(c){return vf(n,c.head)},{origin:"+move",bias:1})},goLineEnd:function(n){return n.extendSelectionsBy(function(c){return au(n,c.head.line)},{origin:"+move",bias:-1})},goLineRight:function(n){return n.extendSelectionsBy(function(c){var k=n.cursorCoords(c.head,"div").top+5;return n.coordsChar({left:n.display.lineDiv.offsetWidth+100,top:k},"div")},be)},goLineLeft:function(n){return n.extendSelectionsBy(function(c){var k=n.cursorCoords(c.head,"div").top+5;return n.coordsChar({left:0,top:k},"div")},be)},goLineLeftSmart:function(n){return n.extendSelectionsBy(function(c){var k=n.cursorCoords(c.head,"div").top+5,C=n.coordsChar({left:0,top:k},"div");return C.ch<n.getLine(C.line).search(/\S/)?vf(n,c.head):C},be)},goLineUp:function(n){return n.moveV(-1,"line")},goLineDown:function(n){return n.moveV(1,"line")},goPageUp:function(n){return n.moveV(-1,"page")},goPageDown:function(n){return n.moveV(1,"page")},goCharLeft:function(n){return n.moveH(-1,"char")},goCharRight:function(n){return n.moveH(1,"char")},goColumnLeft:function(n){return n.moveH(-1,"column")},goColumnRight:function(n){return n.moveH(1,"column")},goWordLeft:function(n){return n.moveH(-1,"word")},goGroupRight:function(n){return n.moveH(1,"group")},goGroupLeft:function(n){return n.moveH(-1,"group")},goWordRight:function(n){return n.moveH(1,"word")},delCharBefore:function(n){return n.deleteH(-1,"codepoint")},delCharAfter:function(n){return n.deleteH(1,"char")},delWordBefore:function(n){return n.deleteH(-1,"word")},delWordAfter:function(n){return n.deleteH(1,"word")},delGroupBefore:function(n){return n.deleteH(-1,"group")},delGroupAfter:function(n){return n.deleteH(1,"group")},indentAuto:function(n){return n.indentSelection("smart")},indentMore:function(n){return n.indentSelection("add")},indentLess:function(n){return n.indentSelection("subtract")},insertTab:function(n){return n.replaceSelection(" ")},insertSoftTab:function(n){for(var c=[],k=n.listSelections(),C=n.options.tabSize,O=0;O<k.length;O++){var X=k[O].from(),ce=Y(n.getLine(X.line),X.ch,C);c.push(Be(C-ce%C))}n.replaceSelections(c)},defaultTab:function(n){n.somethingSelected()?n.indentSelection("add"):n.execCommand("insertTab")},transposeChars:function(n){return yn(n,function(){for(var c=n.listSelections(),k=[],C=0;C<c.length;C++)if(c[C].empty()){var O=c[C].head,X=xt(n.doc,O.line).text;if(X){if(O.ch==X.length&&(O=new at(O.line,O.ch-1)),O.ch>0)O=new at(O.line,O.ch+1),n.replaceRange(X.charAt(O.ch-1)+X.charAt(O.ch-2),at(O.line,O.ch-2),O,"+transpose");else if(O.line>n.doc.first){var ce=xt(n.doc,O.line-1).text;ce&&(O=new at(O.line,1),n.replaceRange(X.charAt(0)+n.doc.lineSeparator()+ce.charAt(ce.length-1),at(O.line-1,ce.length-1),O,"+transpose"))}}k.push(new Ir(O,O))}n.setSelections(k)})},newlineAndIndent:function(n){return yn(n,function(){for(var c=n.listSelections(),k=c.length-1;k>=0;k--)n.replaceRange(n.doc.lineSeparator(),c[k].anchor,c[k].head,"+input");c=n.listSelections();for(var C=0;C<c.length;C++)n.indentLine(c[C].from().line,null,!0);ra(n)})},openLine:function(n){return n.replaceSelection(`
`,"start")},toggleOverwrite:function(n){return n.toggleOverwrite()}};function su(n,c){var k=xt(n.doc,c),C=it(k);return C!=k&&(c=Zt(C)),pa(!0,n,C,c,1)}function au(n,c){var k=xt(n.doc,c),C=_t(k);return C!=k&&(c=Zt(C)),pa(!0,n,k,c,-1)}function vf(n,c){var k=su(n,c.line),C=xt(n.doc,k.line),O=lt(C,n.doc.direction);if(!O||O[0].level==0){var X=Math.max(k.ch,C.text.search(/\S/)),ce=c.line==k.line&&c.ch<=X&&c.ch;return at(k.line,ce?0:X,k.sticky)}return k}function Dn(n,c,k){if(typeof c=="string"&&(c=Fa[c],!c))return!1;n.display.input.ensurePolled();var C=n.display.shift,O=!1;try{n.isReadOnly()&&(n.state.suppressEdits=!0),k&&(n.display.shift=!1),O=c(n)!=we}finally{n.display.shift=C,n.state.suppressEdits=!1}return O}function Oo(n,c,k){for(var C=0;C<n.state.keyMaps.length;C++){var O=is(c,n.state.keyMaps[C],k,n);if(O)return O}return n.options.extraKeys&&is(c,n.options.extraKeys,k,n)||is(c,n.options.keyMap,k,n)}var hh=new le;function za(n,c,k,C){var O=n.state.keySeq;if(O){if(gl(c))return"handled";if(/\'$/.test(c)?n.state.keySeq=null:hh.set(50,function(){n.state.keySeq==O&&(n.state.keySeq=null,n.display.input.reset())}),lc(n,O+" "+c,k,C))return!0}return lc(n,c,k,C)}function lc(n,c,k,C){var O=Oo(n,c,C);return O=="multi"&&(n.state.keySeq=c),O=="handled"&&Cr(n,"keyHandled",n,c,k),(O=="handled"||O=="multi")&&(Tt(k),Il(n)),!!O}function gr(n,c){var k=da(c,!0);return k?c.shiftKey&&!n.state.keySeq?za(n,"Shift-"+k,c,function(C){return Dn(n,C,!0)})||za(n,k,c,function(C){if(typeof C=="string"?/^go[A-Z]/.test(C):C.motion)return Dn(n,C)}):za(n,k,c,function(C){return Dn(n,C)}):!1}function Ha(n,c,k){return za(n,"'"+k+"'",c,function(C){return Dn(n,C,!0)})}var os=null;function vl(n){var c=this;if(!(n.target&&n.target!=c.display.input.getField())&&(c.curOp.focus=K(),!Qe(c,n))){E&&p<11&&n.keyCode==27&&(n.returnValue=!1);var k=n.keyCode;c.display.shift=k==16||n.shiftKey;var C=gr(c,n);v&&(os=C?k:null,!C&&k==88&&!st&&(_?n.metaKey:n.ctrlKey)&&c.replaceSelection("",null,"cut")),he&&!_&&!C&&k==46&&n.shiftKey&&!n.ctrlKey&&document.execCommand&&document.execCommand("cut"),k==18&&!/\bCodeMirror-crosshair\b/.test(c.display.lineDiv.className)&&et(c)}}function et(n){var c=n.display.lineDiv;Z(c,"CodeMirror-crosshair");function k(C){(C.keyCode==18||!C.altKey)&&(F(c,"CodeMirror-crosshair"),nt(document,"keyup",k),nt(document,"mouseover",k))}Ze(document,"keyup",k),Ze(document,"mouseover",k)}function yf(n){n.keyCode==16&&(this.doc.sel.shift=!1),Qe(this,n)}function bf(n){var c=this;if(!(n.target&&n.target!=c.display.input.getField())&&!(vi(c.display,n)||Qe(c,n)||n.ctrlKey&&!n.altKey||_&&n.metaKey)){var k=n.keyCode,C=n.charCode;if(v&&k==os){os=null,Tt(n);return}if(!(v&&(!n.which||n.which<10)&&gr(c,n))){var O=String.fromCharCode(C==null?k:C);O!="\b"&&(Ha(c,n,O)||c.display.input.onKeyPress(n))}}}var lu=400,cu=function(n,c,k){this.time=n,this.pos=c,this.button=k};cu.prototype.compare=function(n,c,k){return this.time+lu>n&&Ht(c,this.pos)==0&&k==this.button};var ss,yl;function dh(n,c){var k=+new Date;return yl&&yl.compare(k,n,c)?(ss=yl=null,"triple"):ss&&ss.compare(k,n,c)?(yl=new cu(k,n,c),ss=null,"double"):(ss=new cu(k,n,c),yl=null,"single")}function ri(n){var c=this,k=c.display;if(!(Qe(c,n)||k.activeTouch&&k.input.supportsTouch())){if(k.input.ensurePolled(),k.shift=n.shiftKey,vi(k,n)){g||(k.scroller.draggable=!1,setTimeout(function(){return k.scroller.draggable=!0},100));return}if(!hi(c,n)){var C=uo(c,n),O=er(n),X=C?dh(C,O):"single";window.focus(),O==1&&c.state.selectingText&&c.state.selectingText(n),!(C&&As(c,O,C,X,n))&&(O==1?C?uc(c,C,X,n):on(n)==k.scroller&&Tt(n):O==2?(C&&ua(c.doc,C),setTimeout(function(){return k.input.focus()},20)):O==3&&(H?c.display.input.onContextMenu(n):jc(c)))}}}function As(n,c,k,C,O){var X="Click";return C=="double"?X="Double"+X:C=="triple"&&(X="Triple"+X),X=(c==1?"Left":c==2?"Middle":"Right")+X,za(n,Ts(X,O),O,function(ce){if(typeof ce=="string"&&(ce=Fa[ce]),!ce)return!1;var me=!1;try{n.isReadOnly()&&(n.state.suppressEdits=!0),me=ce(n,k)!=we}finally{n.state.suppressEdits=!1}return me})}function cc(n,c,k){var C=n.getOption("configureMouse"),O=C?C(n,c,k):{};if(O.unit==null){var X=x?k.shiftKey&&k.metaKey:k.altKey;O.unit=X?"rectangle":c=="single"?"char":c=="double"?"word":"line"}return(O.extend==null||n.doc.extend)&&(O.extend=n.doc.extend||k.shiftKey),O.addNew==null&&(O.addNew=_?k.metaKey:k.ctrlKey),O.moveOnDrag==null&&(O.moveOnDrag=!(_?k.altKey:k.ctrlKey)),O}function uc(n,c,k,C){E?setTimeout(ae(Da,n),0):n.curOp.focus=K();var O=cc(n,k,C),X=n.doc.sel,ce;n.options.dragDrop&&In&&!n.isReadOnly()&&k=="single"&&(ce=X.contains(c))>-1&&(Ht((ce=X.ranges[ce]).from(),c)<0||c.xRel>0)&&(Ht(ce.to(),c)>0||c.xRel<0)?ph(n,C,c,O):uu(n,C,c,O)}function ph(n,c,k,C){var O=n.display,X=!1,ce=Ln(n,function(ke){g&&(O.scroller.draggable=!1),n.state.draggingText=!1,nt(O.wrapper.ownerDocument,"mouseup",ce),nt(O.wrapper.ownerDocument,"mousemove",me),nt(O.scroller,"dragstart",ve),nt(O.scroller,"drop",ce),X||(Tt(ke),C.addNew||ua(n.doc,k,null,null,C.extend),g&&!d||E&&p==9?setTimeout(function(){O.wrapper.ownerDocument.body.focus({preventScroll:!0}),O.input.focus()},20):O.input.focus())}),me=function(ke){X=X||Math.abs(c.clientX-ke.clientX)+Math.abs(c.clientY-ke.clientY)>=10},ve=function(){return X=!0};g&&(O.scroller.draggable=!0),n.state.draggingText=ce,ce.copy=!C.moveOnDrag,O.scroller.dragDrop&&O.scroller.dragDrop(),Ze(O.wrapper.ownerDocument,"mouseup",ce),Ze(O.wrapper.ownerDocument,"mousemove",me),Ze(O.scroller,"dragstart",ve),Ze(O.scroller,"drop",ce),jc(n),setTimeout(function(){return O.input.focus()},20)}function _f(n,c,k){if(k=="char")return new Ir(c,c);if(k=="word")return n.findWordAt(c);if(k=="line")return new Ir(at(c.line,0),Gt(n.doc,at(c.line+1,0)));var C=k(n,c);return new Ir(C.from,C.to)}function uu(n,c,k,C){var O=n.display,X=n.doc;Tt(c);var ce,me,ve=X.sel,ke=ve.ranges;if(C.addNew&&!C.extend?(me=X.sel.contains(k),me>-1?ce=ke[me]:ce=new Ir(k,k)):(ce=X.sel.primary(),me=X.sel.primIndex),C.unit=="rectangle")C.addNew||(ce=new Ir(k,k)),k=uo(n,c,!0,!0),me=-1;else{var Ie=_f(n,k,C.unit);C.extend?ce=tc(ce,Ie.anchor,Ie.head,C.extend):ce=Ie}C.addNew?me==-1?(me=ke.length,On(X,ro(n,ke.concat([ce]),me),{scroll:!1,origin:"*mouse"})):ke.length>1&&ke[me].empty()&&C.unit=="char"&&!C.extend?(On(X,ro(n,ke.slice(0,me).concat(ke.slice(me+1)),0),{scroll:!1,origin:"*mouse"}),ve=X.sel):Ui(X,me,ce,de):(me=0,On(X,new Pi([ce],0),de),ve=X.sel);var He=k;function Ve(St){if(Ht(He,St)!=0)if(He=St,C.unit=="rectangle"){for(var Lt=[],Nt=n.options.tabSize,zt=Y(xt(X,k.line).text,k.ch,Nt),lr=Y(xt(X,St.line).text,St.ch,Nt),qr=Math.min(zt,lr),Xn=Math.max(zt,lr),gn=Math.min(k.line,St.line),ki=Math.min(n.lastLine(),Math.max(k.line,St.line));gn<=ki;gn++){var Ei=xt(X,gn).text,Pn=Te(Ei,qr,Nt);qr==Xn?Lt.push(new Ir(at(gn,Pn),at(gn,Pn))):Ei.length>Pn&&Lt.push(new Ir(at(gn,Pn),at(gn,Te(Ei,Xn,Nt))))}Lt.length||Lt.push(new Ir(k,k)),On(X,ro(n,ve.ranges.slice(0,me).concat(Lt),me),{origin:"*mouse",scroll:!1}),n.scrollIntoView(St)}else{var Mi=ce,qt=_f(n,St,C.unit),bn=Mi.anchor,vn;Ht(qt.anchor,bn)>0?(vn=qt.head,bn=Yn(Mi.from(),qt.anchor)):(vn=qt.anchor,bn=ci(Mi.to(),qt.head));var _n=ve.ranges.slice(0);_n[me]=wf(n,new Ir(Gt(X,bn),vn)),On(X,ro(n,_n,me),de)}}var Ke=O.wrapper.getBoundingClientRect(),rt=0;function ut(St){var Lt=++rt,Nt=uo(n,St,!0,C.unit=="rectangle");if(Nt)if(Ht(Nt,He)!=0){n.curOp.focus=K(),Ve(Nt);var zt=Nn(O,X);(Nt.line>=zt.to||Nt.line<zt.from)&&setTimeout(Ln(n,function(){rt==Lt&&ut(St)}),150)}else{var lr=St.clientY<Ke.top?-20:St.clientY>Ke.bottom?20:0;lr&&setTimeout(Ln(n,function(){rt==Lt&&(O.scroller.scrollTop+=lr,ut(St))}),50)}}function yt(St){n.state.selectingText=!1,rt=1/0,St&&(Tt(St),O.input.focus()),nt(O.wrapper.ownerDocument,"mousemove",Ct),nt(O.wrapper.ownerDocument,"mouseup",At),X.history.lastSelOrigin=null}var Ct=Ln(n,function(St){St.buttons===0||!er(St)?yt(St):ut(St)}),At=Ln(n,yt);n.state.selectingText=At,Ze(O.wrapper.ownerDocument,"mousemove",Ct),Ze(O.wrapper.ownerDocument,"mouseup",At)}function wf(n,c){var k=c.anchor,C=c.head,O=xt(n.doc,k.line);if(Ht(k,C)==0&&k.sticky==C.sticky)return c;var X=lt(O);if(!X)return c;var ce=Re(X,k.ch,k.sticky),me=X[ce];if(me.from!=k.ch&&me.to!=k.ch)return c;var ve=ce+(me.from==k.ch==(me.level!=1)?0:1);if(ve==0||ve==X.length)return c;var ke;if(C.line!=k.line)ke=(C.line-k.line)*(n.doc.direction=="ltr"?1:-1)>0;else{var Ie=Re(X,C.ch,C.sticky),He=Ie-ce||(C.ch-k.ch)*(me.level==1?-1:1);Ie==ve-1||Ie==ve?ke=He<0:ke=He>0}var Ve=X[ve+(ke?-1:0)],Ke=ke==(Ve.level==1),rt=Ke?Ve.from:Ve.to,ut=Ke?"after":"before";return k.ch==rt&&k.sticky==ut?c:new Ir(new at(k.line,rt,ut),C)}function bl(n,c,k,C){var O,X;if(c.touches)O=c.touches[0].clientX,X=c.touches[0].clientY;else try{O=c.clientX,X=c.clientY}catch(Ve){return!1}if(O>=Math.floor(n.display.gutters.getBoundingClientRect().right))return!1;C&&Tt(c);var ce=n.display,me=ce.lineDiv.getBoundingClientRect();if(X>me.bottom||!vt(n,k))return jr(c);X-=me.top-ce.viewOffset;for(var ve=0;ve<n.display.gutterSpecs.length;++ve){var ke=ce.gutters.childNodes[ve];if(ke&&ke.getBoundingClientRect().right>=O){var Ie=Fr(n.doc,X),He=n.display.gutterSpecs[ve];return qe(n,k,n,Ie,He.className,c),jr(c)}}}function hi(n,c){return bl(n,c,"gutterClick",!0)}function Ls(n,c){vi(n.display,c)||xf(n,c)||Qe(n,c,"contextmenu")||H||n.display.input.onContextMenu(c)}function xf(n,c){return vt(n,"gutterContextMenu")?bl(n,c,"gutterContextMenu",!1):!1}function fu(n){n.display.wrapper.className=n.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+n.options.theme.replace(/(^|\s)\s*/g," cm-s-"),co(n)}var Os={toString:function(){return"CodeMirror.Init"}},Sf={},fc={};function mh(n){var c=n.optionHandlers;function k(C,O,X,ce){n.defaults[C]=O,X&&(c[C]=ce?function(me,ve,ke){ke!=Os&&X(me,ve,ke)}:X)}n.defineOption=k,n.Init=Os,k("value","",function(C,O){return C.setValue(O)},!0),k("mode",null,function(C,O){C.doc.modeOption=O,Gl(C)},!0),k("indentUnit",2,Gl,!0),k("indentWithTabs",!1),k("smartIndent",!0),k("tabSize",4,function(C){la(C),co(C),Qt(C)},!0),k("lineSeparator",null,function(C,O){if(C.doc.lineSep=O,!!O){var X=[],ce=C.doc.first;C.doc.iter(function(ve){for(var ke=0;;){var Ie=ve.text.indexOf(O,ke);if(Ie==-1)break;ke=Ie+O.length,X.push(at(ce,Ie))}ce++});for(var me=X.length-1;me>=0;me--)Ra(C.doc,O,X[me],at(X[me].line,X[me].ch+O.length))}}),k("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(C,O,X){C.state.specialChars=new RegExp(O.source+(O.test(" ")?"":"| "),"g"),X!=Os&&C.refresh()}),k("specialCharPlaceholder",Ar,function(C){return C.refresh()},!0),k("electricChars",!0),k("inputStyle",y?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),k("spellcheck",!1,function(C,O){return C.getInputField().spellcheck=O},!0),k("autocorrect",!1,function(C,O){return C.getInputField().autocorrect=O},!0),k("autocapitalize",!1,function(C,O){return C.getInputField().autocapitalize=O},!0),k("rtlMoveVisually",!S),k("wholeLineUpdateBefore",!0),k("theme","default",function(C){fu(C),Pa(C)},!0),k("keyMap","default",function(C,O,X){var ce=Si(O),me=X!=Os&&Si(X);me&&me.detach&&me.detach(C,ce),ce.attach&&ce.attach(C,me||null)}),k("extraKeys",null),k("configureMouse",null),k("lineWrapping",!1,Cf,!0),k("gutters",[],function(C,O){C.display.gutterSpecs=Wl(O,C.options.lineNumbers),Pa(C)},!0),k("fixedGutter",!0,function(C,O){C.display.gutters.style.left=O?To(C.display)+"px":"0",C.refresh()},!0),k("coverGutterNextToScrollbar",!1,function(C){return xs(C)},!0),k("scrollbarStyle","native",function(C){Hc(C),xs(C),C.display.scrollbars.setScrollTop(C.doc.scrollTop),C.display.scrollbars.setScrollLeft(C.doc.scrollLeft)},!0),k("lineNumbers",!1,function(C,O){C.display.gutterSpecs=Wl(C.options.gutters,O),Pa(C)},!0),k("firstLineNumber",1,Pa,!0),k("lineNumberFormatter",function(C){return C},Pa,!0),k("showCursorWhenSelecting",!1,Oa,!0),k("resetSelectionOnContextMenu",!0),k("lineWiseCopyCut",!0),k("pasteLinesPerSelection",!0),k("selectionsMayTouch",!1),k("readOnly",!1,function(C,O){O=="nocursor"&&(ta(C),C.display.input.blur()),C.display.input.readOnlyChanged(O)}),k("screenReaderLabel",null,function(C,O){O=O===""?null:O,C.display.input.screenReaderLabelChanged(O)}),k("disableInput",!1,function(C,O){O||C.display.input.reset()},!0),k("dragDrop",!0,gh),k("allowDropFileTypes",null),k("cursorBlinkRate",530),k("cursorScrollMargin",0),k("cursorHeight",1,Oa,!0),k("singleCursorHeightPerLine",!0,Oa,!0),k("workTime",100),k("workDelay",100),k("flattenSpans",!0,la,!0),k("addModeClass",!1,la,!0),k("pollInterval",100),k("undoDepth",200,function(C,O){return C.doc.history.undoDepth=O}),k("historyEventDelay",1250),k("viewportMargin",10,function(C){return C.refresh()},!0),k("maxHighlightLength",1e4,la,!0),k("moveInputWithCursor",!0,function(C,O){O||C.display.input.resetPosition()}),k("tabindex",null,function(C,O){return C.display.input.getField().tabIndex=O||""}),k("autofocus",null),k("direction","ltr",function(C,O){return C.doc.setDirection(O)},!0),k("phrases",null)}function gh(n,c,k){var C=k&&k!=Os;if(!c!=!C){var O=n.display.dragFunctions,X=c?Ze:nt;X(n.display.scroller,"dragstart",O.start),X(n.display.scroller,"dragenter",O.enter),X(n.display.scroller,"dragover",O.over),X(n.display.scroller,"dragleave",O.leave),X(n.display.scroller,"drop",O.drop)}}function Cf(n){n.options.lineWrapping?(Z(n.display.wrapper,"CodeMirror-wrap"),n.display.sizer.style.minWidth="",n.display.sizerWidth=null):(F(n.display.wrapper,"CodeMirror-wrap"),pr(n)),Yo(n),Qt(n),co(n),setTimeout(function(){return xs(n)},100)}function Xt(n,c){var k=this;if(!(this instanceof Xt))return new Xt(n,c);this.options=c=c?ye(c):{},ye(Sf,c,!1);var C=c.value;typeof C=="string"?C=new kn(C,c.mode,null,c.lineSeparator,c.direction):c.mode&&(C.modeOption=c.mode),this.doc=C;var O=new Xt.inputStyles[c.inputStyle](this),X=this.display=new nf(n,C,O,c);X.wrapper.CodeMirror=this,fu(this),c.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Hc(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new le,keySeq:null,specialChars:null},c.autofocus&&!y&&X.input.focus(),E&&p<11&&setTimeout(function(){return k.display.input.reset(!0)},20),vh(this),iu(),Ss(this),this.curOp.forceUpdate=!0,sl(this,C),c.autofocus&&!y||this.hasFocus()?setTimeout(function(){k.hasFocus()&&!k.state.focused&&jl(k)},20):ta(this);for(var ce in fc)fc.hasOwnProperty(ce)&&fc[ce](this,c[ce],Os);il(this),c.finishInit&&c.finishInit(this);for(var me=0;me<hu.length;++me)hu[me](this);qo(this),g&&c.lineWrapping&&getComputedStyle(X.lineDiv).textRendering=="optimizelegibility"&&(X.lineDiv.style.textRendering="auto")}Xt.defaults=Sf,Xt.optionHandlers=fc;function vh(n){var c=n.display;Ze(c.scroller,"mousedown",Ln(n,ri)),E&&p<11?Ze(c.scroller,"dblclick",Ln(n,function(ve){if(!Qe(n,ve)){var ke=uo(n,ve);if(!(!ke||hi(n,ve)||vi(n.display,ve))){Tt(ve);var Ie=n.findWordAt(ke);ua(n.doc,Ie.anchor,Ie.head)}}})):Ze(c.scroller,"dblclick",function(ve){return Qe(n,ve)||Tt(ve)}),Ze(c.scroller,"contextmenu",function(ve){return Ls(n,ve)}),Ze(c.input.getField(),"contextmenu",function(ve){c.scroller.contains(ve.target)||Ls(n,ve)});var k,C={end:0};function O(){c.activeTouch&&(k=setTimeout(function(){return c.activeTouch=null},1e3),C=c.activeTouch,C.end=+new Date)}function X(ve){if(ve.touches.length!=1)return!1;var ke=ve.touches[0];return ke.radiusX<=1&&ke.radiusY<=1}function ce(ve,ke){if(ke.left==null)return!0;var Ie=ke.left-ve.left,He=ke.top-ve.top;return Ie*Ie+He*He>20*20}Ze(c.scroller,"touchstart",function(ve){if(!Qe(n,ve)&&!X(ve)&&!hi(n,ve)){c.input.ensurePolled(),clearTimeout(k);var ke=+new Date;c.activeTouch={start:ke,moved:!1,prev:ke-C.end<=300?C:null},ve.touches.length==1&&(c.activeTouch.left=ve.touches[0].pageX,c.activeTouch.top=ve.touches[0].pageY)}}),Ze(c.scroller,"touchmove",function(){c.activeTouch&&(c.activeTouch.moved=!0)}),Ze(c.scroller,"touchend",function(ve){var ke=c.activeTouch;if(ke&&!vi(c,ve)&&ke.left!=null&&!ke.moved&&new Date-ke.start<300){var Ie=n.coordsChar(c.activeTouch,"page"),He;!ke.prev||ce(ke,ke.prev)?He=new Ir(Ie,Ie):!ke.prev.prev||ce(ke,ke.prev.prev)?He=n.findWordAt(Ie):He=new Ir(at(Ie.line,0),Gt(n.doc,at(Ie.line+1,0))),n.setSelection(He.anchor,He.head),n.focus(),Tt(ve)}O()}),Ze(c.scroller,"touchcancel",O),Ze(c.scroller,"scroll",function(){c.scroller.clientHeight&&(_s(n,c.scroller.scrollTop),ws(n,c.scroller.scrollLeft,!0),qe(n,"scroll",n))}),Ze(c.scroller,"mousewheel",function(ve){return Xc(n,ve)}),Ze(c.scroller,"DOMMouseScroll",function(ve){return Xc(n,ve)}),Ze(c.wrapper,"scroll",function(){return c.wrapper.scrollTop=c.wrapper.scrollLeft=0}),c.dragFunctions={enter:function(ve){Qe(n,ve)||xn(ve)},over:function(ve){Qe(n,ve)||(nu(n,ve),xn(ve))},start:function(ve){return uh(n,ve)},drop:Ln(n,ch),leave:function(ve){Qe(n,ve)||Ba(n)}};var me=c.input.getField();Ze(me,"keyup",function(ve){return yf.call(n,ve)}),Ze(me,"keydown",Ln(n,vl)),Ze(me,"keypress",Ln(n,bf)),Ze(me,"focus",function(ve){return jl(n,ve)}),Ze(me,"blur",function(ve){return ta(n,ve)})}var hu=[];Xt.defineInitHook=function(n){return hu.push(n)};function po(n,c,k,C){var O=n.doc,X;k==null&&(k="add"),k=="smart"&&(O.mode.indent?X=gi(n,c).state:k="prev");var ce=n.options.tabSize,me=xt(O,c),ve=Y(me.text,null,ce);me.stateAfter&&(me.stateAfter=null);var ke=me.text.match(/^\s*/)[0],Ie;if(!C&&!/\S/.test(me.text))Ie=0,k="not";else if(k=="smart"&&(Ie=O.mode.indent(X,me.text.slice(ke.length),me.text),Ie==we||Ie>150)){if(!C)return;k="prev"}k=="prev"?c>O.first?Ie=Y(xt(O,c-1).text,null,ce):Ie=0:k=="add"?Ie=ve+n.options.indentUnit:k=="subtract"?Ie=ve-n.options.indentUnit:typeof k=="number"&&(Ie=ve+k),Ie=Math.max(0,Ie);var He="",Ve=0;if(n.options.indentWithTabs)for(var Ke=Math.floor(Ie/ce);Ke;--Ke)Ve+=ce,He+=" ";if(Ve<Ie&&(He+=Be(Ie-Ve)),He!=ke)return Ra(O,He,at(c,0),at(c,ke.length),"+input"),me.stateAfter=null,!0;for(var rt=0;rt<O.sel.ranges.length;rt++){var ut=O.sel.ranges[rt];if(ut.head.line==c&&ut.head.ch<ke.length){var yt=at(c,ke.length);Ui(O,rt,new Ir(yt,yt));break}}}var mo=null;function Ds(n){mo=n}function du(n,c,k,C,O){var X=n.doc;n.display.shift=!1,C||(C=X.sel);var ce=+new Date-200,me=O=="paste"||n.state.pasteIncoming>ce,ve=Kt(c),ke=null;if(me&&C.ranges.length>1)if(mo&&mo.text.join(`
`)==c){if(C.ranges.length%mo.text.length==0){ke=[];for(var Ie=0;Ie<mo.text.length;Ie++)ke.push(X.splitLines(mo.text[Ie]))}}else ve.length==C.ranges.length&&n.options.pasteLinesPerSelection&&(ke=_e(ve,function(Ct){return[Ct]}));for(var He=n.curOp.updateInput,Ve=C.ranges.length-1;Ve>=0;Ve--){var Ke=C.ranges[Ve],rt=Ke.from(),ut=Ke.to();Ke.empty()&&(k&&k>0?rt=at(rt.line,rt.ch-k):n.state.overwrite&&!me?ut=at(ut.line,Math.min(xt(X,ut.line).text.length,ut.ch+Pe(ve).length)):me&&mo&&mo.lineWise&&mo.text.join(`
`)==ve.join(`
`)&&(rt=ut=at(rt.line,0)));var yt={from:rt,to:ut,text:ke?ke[Ve%ke.length]:ve,origin:O||(me?"paste":n.state.cutIncoming>ce?"cut":"+input")};Cs(n.doc,yt),Cr(n,"inputRead",n,yt)}c&&!me&&mu(n,c),ra(n),n.curOp.updateInput<2&&(n.curOp.updateInput=He),n.curOp.typing=!0,n.state.pasteIncoming=n.state.cutIncoming=-1}function pu(n,c){var k=n.clipboardData&&n.clipboardData.getData("Text");if(k)return n.preventDefault(),!c.isReadOnly()&&!c.options.disableInput&&yn(c,function(){return du(c,k,0,null,"paste")}),!0}function mu(n,c){if(!(!n.options.electricChars||!n.options.smartIndent))for(var k=n.doc.sel,C=k.ranges.length-1;C>=0;C--){var O=k.ranges[C];if(!(O.head.ch>100||C&&k.ranges[C-1].head.line==O.head.line)){var X=n.getModeAt(O.head),ce=!1;if(X.electricChars){for(var me=0;me<X.electricChars.length;me++)if(c.indexOf(X.electricChars.charAt(me))>-1){ce=po(n,O.head.line,"smart");break}}else X.electricInput&&X.electricInput.test(xt(n.doc,O.head.line).text.slice(0,O.head.ch))&&(ce=po(n,O.head.line,"smart"));ce&&Cr(n,"electricInput",n,O.head.line)}}}function Ua(n){for(var c=[],k=[],C=0;C<n.doc.sel.ranges.length;C++){var O=n.doc.sel.ranges[C].head.line,X={anchor:at(O,0),head:at(O+1,0)};k.push(X),c.push(n.getRange(X.anchor,X.head))}return{text:c,ranges:k}}function kf(n,c,k,C){n.setAttribute("autocorrect",k?"":"off"),n.setAttribute("autocapitalize",C?"":"off"),n.setAttribute("spellcheck",!!c)}function gu(){var n=P("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),c=P("div",[n],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return g?n.style.width="1000px":n.setAttribute("wrap","off"),u&&(n.style.border="1px solid black"),kf(n),c}function vu(n){var c=n.optionHandlers,k=n.helpers={};n.prototype={constructor:n,focus:function(){window.focus(),this.display.input.focus()},setOption:function(C,O){var X=this.options,ce=X[C];X[C]==O&&C!="mode"||(X[C]=O,c.hasOwnProperty(C)&&Ln(this,c[C])(this,O,ce),qe(this,"optionChange",this,C))},getOption:function(C){return this.options[C]},getDoc:function(){return this.doc},addKeyMap:function(C,O){this.state.keyMaps[O?"push":"unshift"](Si(C))},removeKeyMap:function(C){for(var O=this.state.keyMaps,X=0;X<O.length;++X)if(O[X]==C||O[X].name==C)return O.splice(X,1),!0},addOverlay:mn(function(C,O){var X=C.token?C:n.getMode(this.options,C);if(X.startState)throw new Error("Overlays may not be stateful.");ne(this.state.overlays,{mode:X,modeSpec:C,opaque:O&&O.opaque,priority:O&&O.priority||0},function(ce){return ce.priority}),this.state.modeGen++,Qt(this)}),removeOverlay:mn(function(C){for(var O=this.state.overlays,X=0;X<O.length;++X){var ce=O[X].modeSpec;if(ce==C||typeof C=="string"&&ce.name==C){O.splice(X,1),this.state.modeGen++,Qt(this);return}}}),indentLine:mn(function(C,O,X){typeof O!="string"&&typeof O!="number"&&(O==null?O=this.options.smartIndent?"smart":"prev":O=O?"add":"subtract"),Er(this.doc,C)&&po(this,C,O,X)}),indentSelection:mn(function(C){for(var O=this.doc.sel.ranges,X=-1,ce=0;ce<O.length;ce++){var me=O[ce];if(me.empty())me.head.line>X&&(po(this,me.head.line,C,!0),X=me.head.line,ce==this.doc.sel.primIndex&&ra(this));else{var ve=me.from(),ke=me.to(),Ie=Math.max(X,ve.line);X=Math.min(this.lastLine(),ke.line-(ke.ch?0:1))+1;for(var He=Ie;He<X;++He)po(this,He,C);var Ve=this.doc.sel.ranges;ve.ch==0&&O.length==Ve.length&&Ve[ce].from().ch>0&&Ui(this.doc,ce,new Ir(ve,Ve[ce].to()),Le)}}}),getTokenAt:function(C,O){return Fo(this,C,O)},getLineTokens:function(C,O){return Fo(this,at(C),O,!0)},getTokenTypeAt:function(C){C=Gt(this.doc,C);var O=ln(this,xt(this.doc,C.line)),X=0,ce=(O.length-1)/2,me=C.ch,ve;if(me==0)ve=O[2];else for(;;){var ke=X+ce>>1;if((ke?O[ke*2-1]:0)>=me)ce=ke;else if(O[ke*2+1]<me)X=ke+1;else{ve=O[ke*2+2];break}}var Ie=ve?ve.indexOf("overlay "):-1;return Ie<0?ve:Ie==0?null:ve.slice(0,Ie-1)},getModeAt:function(C){var O=this.doc.mode;return O.innerMode?n.innerMode(O,this.getTokenAt(C).state).mode:O},getHelper:function(C,O){return this.getHelpers(C,O)[0]},getHelpers:function(C,O){var X=[];if(!k.hasOwnProperty(O))return X;var ce=k[O],me=this.getModeAt(C);if(typeof me[O]=="string")ce[me[O]]&&X.push(ce[me[O]]);else if(me[O])for(var ve=0;ve<me[O].length;ve++){var ke=ce[me[O][ve]];ke&&X.push(ke)}else me.helperType&&ce[me.helperType]?X.push(ce[me.helperType]):ce[me.name]&&X.push(ce[me.name]);for(var Ie=0;Ie<ce._global.length;Ie++){var He=ce._global[Ie];He.pred(me,this)&&xe(X,He.val)==-1&&X.push(He.val)}return X},getStateAfter:function(C,O){var X=this.doc;return C=mi(X,C==null?X.first+X.size-1:C),gi(this,C+1,O).state},cursorCoords:function(C,O){var X,ce=this.doc.sel.primary();return C==null?X=ce.head:typeof C=="object"?X=Gt(this.doc,C):X=C?ce.from():ce.to(),fi(this,X,O||"page")},charCoords:function(C,O){return Ta(this,Gt(this.doc,C),O||"page")},coordsChar:function(C,O){return C=Vo(this,C,O||"page"),vs(this,C.left,C.top)},lineAtHeight:function(C,O){return C=Vo(this,{top:C,left:0},O||"page").top,Fr(this.doc,C+this.display.viewOffset)},heightAtLine:function(C,O,X){var ce=!1,me;if(typeof C=="number"){var ve=this.doc.first+this.doc.size-1;C<this.doc.first?C=this.doc.first:C>ve&&(C=ve,ce=!0),me=xt(this.doc,C)}else me=C;return gs(this,me,{top:0,left:0},O||"page",X||ce).top+(ce?this.doc.height-Vt(me):0)},defaultTextHeight:function(){return Xo(this.display)},defaultCharWidth:function(){return yi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(C,O,X,ce,me){var ve=this.display;C=fi(this,Gt(this.doc,C));var ke=C.bottom,Ie=C.left;if(O.style.position="absolute",O.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(O),ve.sizer.appendChild(O),ce=="over")ke=C.top;else if(ce=="above"||ce=="near"){var He=Math.max(ve.wrapper.clientHeight,this.doc.height),Ve=Math.max(ve.sizer.clientWidth,ve.lineSpace.clientWidth);(ce=="above"||C.bottom+O.offsetHeight>He)&&C.top>O.offsetHeight?ke=C.top-O.offsetHeight:C.bottom+O.offsetHeight<=He&&(ke=C.bottom),Ie+O.offsetWidth>Ve&&(Ie=Ve-O.offsetWidth)}O.style.top=ke+"px",O.style.left=O.style.right="",me=="right"?(Ie=ve.sizer.clientWidth-O.offsetWidth,O.style.right="0px"):(me=="left"?Ie=0:me=="middle"&&(Ie=(ve.sizer.clientWidth-O.offsetWidth)/2),O.style.left=Ie+"px"),X&&$u(this,{left:Ie,top:ke,right:Ie+O.offsetWidth,bottom:ke+O.offsetHeight})},triggerOnKeyDown:mn(vl),triggerOnKeyPress:mn(bf),triggerOnKeyUp:yf,triggerOnMouseDown:mn(ri),execCommand:function(C){if(Fa.hasOwnProperty(C))return Fa[C].call(null,this)},triggerElectric:mn(function(C){mu(this,C)}),findPosH:function(C,O,X,ce){var me=1;O<0&&(me=-1,O=-O);for(var ve=Gt(this.doc,C),ke=0;ke<O&&(ve=hc(this.doc,ve,me,X,ce),!ve.hitSide);++ke);return ve},moveH:mn(function(C,O){var X=this;this.extendSelectionsBy(function(ce){return X.display.shift||X.doc.extend||ce.empty()?hc(X.doc,ce.head,C,O,X.options.rtlMoveVisually):C<0?ce.from():ce.to()},be)}),deleteH:mn(function(C,O){var X=this.doc.sel,ce=this.doc;X.somethingSelected()?ce.replaceSelection("",null,"+delete"):no(this,function(me){var ve=hc(ce,me.head,C,O,!1);return C<0?{from:ve,to:me.head}:{from:me.head,to:ve}})}),findPosV:function(C,O,X,ce){var me=1,ve=ce;O<0&&(me=-1,O=-O);for(var ke=Gt(this.doc,C),Ie=0;Ie<O;++Ie){var He=fi(this,ke,"div");if(ve==null?ve=He.left:He.left=ve,ke=Ef(this,He,me,X),ke.hitSide)break}return ke},moveV:mn(function(C,O){var X=this,ce=this.doc,me=[],ve=!this.display.shift&&!ce.extend&&ce.sel.somethingSelected();if(ce.extendSelectionsBy(function(Ie){if(ve)return C<0?Ie.from():Ie.to();var He=fi(X,Ie.head,"div");Ie.goalColumn!=null&&(He.left=Ie.goalColumn),me.push(He.left);var Ve=Ef(X,He,C,O);return O=="page"&&Ie==ce.sel.primary()&&Bl(X,Ta(X,Ve,"div").top-He.top),Ve},be),me.length)for(var ke=0;ke<ce.sel.ranges.length;ke++)ce.sel.ranges[ke].goalColumn=me[ke]}),findWordAt:function(C){var O=this.doc,X=xt(O,C.line).text,ce=C.ch,me=C.ch;if(X){var ve=this.getHelper(C,"wordChars");(C.sticky=="before"||me==X.length)&&ce?--ce:++me;for(var ke=X.charAt(ce),Ie=q(ke,ve)?function(He){return q(He,ve)}:/\s/.test(ke)?function(He){return/\s/.test(He)}:function(He){return!/\s/.test(He)&&!q(He)};ce>0&&Ie(X.charAt(ce-1));)--ce;for(;me<X.length&&Ie(X.charAt(me));)++me}return new Ir(at(C.line,ce),at(C.line,me))},toggleOverwrite:function(C){C!=null&&C==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Z(this.display.cursorDiv,"CodeMirror-overwrite"):F(this.display.cursorDiv,"CodeMirror-overwrite"),qe(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==K()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:mn(function(C,O){na(this,C,O)}),getScrollInfo:function(){var C=this.display.scroller;return{left:C.scrollLeft,top:C.scrollTop,height:C.scrollHeight-Cn(this)-this.display.barHeight,width:C.scrollWidth-Cn(this)-this.display.barWidth,clientHeight:lo(this),clientWidth:Bn(this)}},scrollIntoView:mn(function(C,O){C==null?(C={from:this.doc.sel.primary().head,to:null},O==null&&(O=this.options.cursorScrollMargin)):typeof C=="number"?C={from:at(C,0),to:null}:C.from==null&&(C={from:C,to:null}),C.to||(C.to=C.from),C.margin=O||0,C.from.line!=null?Gu(this,C):Nc(this,C.from,C.to,C.margin)}),setSize:mn(function(C,O){var X=this,ce=function(ve){return typeof ve=="number"||/^\d+$/.test(String(ve))?ve+"px":ve};C!=null&&(this.display.wrapper.style.width=ce(C)),O!=null&&(this.display.wrapper.style.height=ce(O)),this.options.lineWrapping&&Ea(this);var me=this.display.viewFrom;this.doc.iter(me,this.display.viewTo,function(ve){if(ve.widgets){for(var ke=0;ke<ve.widgets.length;ke++)if(ve.widgets[ke].noHScroll){nn(X,me,"widget");break}}++me}),this.curOp.forceUpdate=!0,qe(this,"refresh",this)}),operation:function(C){return yn(this,C)},startOperation:function(){return Ss(this)},endOperation:function(){return qo(this)},refresh:mn(function(){var C=this.display.cachedTextHeight;Qt(this),this.curOp.forceUpdate=!0,co(this),na(this,this.doc.scrollLeft,this.doc.scrollTop),Hl(this.display),(C==null||Math.abs(C-Xo(this.display))>.5||this.options.lineWrapping)&&Yo(this),qe(this,"refresh",this)}),swapDoc:mn(function(C){var O=this.doc;return O.cm=null,this.state.selectingText&&this.state.selectingText(),sl(this,C),co(this),this.display.input.reset(),na(this,C.scrollLeft,C.scrollTop),this.curOp.forceScroll=!0,Cr(this,"swapDoc",this,O),O}),phrase:function(C){var O=this.options.phrases;return O&&Object.prototype.hasOwnProperty.call(O,C)?O[C]:C},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},bt(n),n.registerHelper=function(C,O,X){k.hasOwnProperty(C)||(k[C]=n[C]={_global:[]}),k[C][O]=X},n.registerGlobalHelper=function(C,O,X,ce){n.registerHelper(C,O,ce),k[C]._global.push({pred:X,val:ce})}}function hc(n,c,k,C,O){var X=c,ce=k,me=xt(n,c.line),ve=O&&n.direction=="rtl"?-k:k;function ke(){var At=c.line+ve;return At<n.first||At>=n.first+n.size?!1:(c=new at(At,c.ch,c.sticky),me=xt(n,At))}function Ie(At){var St;if(C=="codepoint"){var Lt=me.text.charCodeAt(c.ch+(C>0?0:-1));isNaN(Lt)?St=null:St=new at(c.line,Math.max(0,Math.min(me.text.length,c.ch+k*(Lt>=55296&&Lt<56320?2:1))),-k)}else O?St=Lo(n.cm,me,c,k):St=Ao(me,c,k);if(St==null)if(!At&&ke())c=pa(O,n.cm,me,c.line,ve);else return!1;else c=St;return!0}if(C=="char"||C=="codepoint")Ie();else if(C=="column")Ie(!0);else if(C=="word"||C=="group")for(var He=null,Ve=C=="group",Ke=n.cm&&n.cm.getHelper(c,"wordChars"),rt=!0;!(k<0&&!Ie(!rt));rt=!1){var ut=me.text.charAt(c.ch)||`
`,yt=q(ut,Ke)?"w":Ve&&ut==`
`?"n":!Ve||/\s/.test(ut)?null:"p";if(Ve&&!rt&&!yt&&(yt="s"),He&&He!=yt){k<0&&(k=1,Ie(),c.sticky="after");break}if(yt&&(He=yt),k>0&&!Ie(!rt))break}var Ct=rc(n,c,X,ce,!0);return Vi(X,Ct)&&(Ct.hitSide=!0),Ct}function Ef(n,c,k,C){var O=n.doc,X=c.left,ce;if(C=="page"){var me=Math.min(n.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ve=Math.max(me-.5*Xo(n.display),3);ce=(k>0?c.bottom:c.top)+k*ve}else C=="line"&&(ce=k>0?c.bottom+3:c.top-3);for(var ke;ke=vs(n,X,ce),!!ke.outside;){if(k<0?ce<=0:ce>=O.height){ke.hitSide=!0;break}ce+=k*5}return ke}var $r=function(n){this.cm=n,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new le,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};$r.prototype.init=function(n){var c=this,k=this,C=k.cm,O=k.div=n.lineDiv;kf(O,C.options.spellcheck,C.options.autocorrect,C.options.autocapitalize);function X(me){for(var ve=me.target;ve;ve=ve.parentNode){if(ve==O)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ve.className))break}return!1}Ze(O,"paste",function(me){!X(me)||Qe(C,me)||pu(me,C)||p<=11&&setTimeout(Ln(C,function(){return c.updateFromDOM()}),20)}),Ze(O,"compositionstart",function(me){c.composing={data:me.data,done:!1}}),Ze(O,"compositionupdate",function(me){c.composing||(c.composing={data:me.data,done:!1})}),Ze(O,"compositionend",function(me){c.composing&&(me.data!=c.composing.data&&c.readFromDOMSoon(),c.composing.done=!0)}),Ze(O,"touchstart",function(){return k.forceCompositionEnd()}),Ze(O,"input",function(){c.composing||c.readFromDOMSoon()});function ce(me){if(!(!X(me)||Qe(C,me))){if(C.somethingSelected())Ds({lineWise:!1,text:C.getSelections()}),me.type=="cut"&&C.replaceSelection("",null,"cut");else if(C.options.lineWiseCopyCut){var ve=Ua(C);Ds({lineWise:!0,text:ve.text}),me.type=="cut"&&C.operation(function(){C.setSelections(ve.ranges,0,Le),C.replaceSelection("",null,"cut")})}else return;if(me.clipboardData){me.clipboardData.clearData();var ke=mo.text.join(`
`);if(me.clipboardData.setData("Text",ke),me.clipboardData.getData("Text")==ke){me.preventDefault();return}}var Ie=gu(),He=Ie.firstChild;C.display.lineSpace.insertBefore(Ie,C.display.lineSpace.firstChild),He.value=mo.text.join(`
`);var Ve=document.activeElement;oe(He),setTimeout(function(){C.display.lineSpace.removeChild(Ie),Ve.focus(),Ve==O&&k.showPrimarySelection()},50)}}Ze(O,"copy",ce),Ze(O,"cut",ce)},$r.prototype.screenReaderLabelChanged=function(n){n?this.div.setAttribute("aria-label",n):this.div.removeAttribute("aria-label")},$r.prototype.prepareSelection=function(){var n=Rc(this.cm,!1);return n.focus=document.activeElement==this.div,n},$r.prototype.showSelection=function(n,c){!n||!this.cm.display.view.length||((n.focus||c)&&this.showPrimarySelection(),this.showMultipleSelections(n))},$r.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},$r.prototype.showPrimarySelection=function(){var n=this.getSelection(),c=this.cm,k=c.doc.sel.primary(),C=k.from(),O=k.to();if(c.display.viewTo==c.display.viewFrom||C.line>=c.display.viewTo||O.line<c.display.viewFrom){n.removeAllRanges();return}var X=dc(c,n.anchorNode,n.anchorOffset),ce=dc(c,n.focusNode,n.focusOffset);if(!(X&&!X.bad&&ce&&!ce.bad&&Ht(Yn(X,ce),C)==0&&Ht(ci(X,ce),O)==0)){var me=c.display.view,ve=C.line>=c.display.viewFrom&&Mf(c,C)||{node:me[0].measure.map[2],offset:0},ke=O.line<c.display.viewTo&&Mf(c,O);if(!ke){var Ie=me[me.length-1].measure,He=Ie.maps?Ie.maps[Ie.maps.length-1]:Ie.map;ke={node:He[He.length-1],offset:He[He.length-2]-He[He.length-3]}}if(!ve||!ke){n.removeAllRanges();return}var Ve=n.rangeCount&&n.getRangeAt(0),Ke;try{Ke=G(ve.node,ve.offset,ke.offset,ke.node)}catch(rt){}Ke&&(!he&&c.state.focused?(n.collapse(ve.node,ve.offset),Ke.collapsed||(n.removeAllRanges(),n.addRange(Ke))):(n.removeAllRanges(),n.addRange(Ke)),Ve&&n.anchorNode==null?n.addRange(Ve):he&&this.startGracePeriod()),this.rememberSelection()}},$r.prototype.startGracePeriod=function(){var n=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){n.gracePeriod=!1,n.selectionChanged()&&n.cm.operation(function(){return n.cm.curOp.selectionChanged=!0})},20)},$r.prototype.showMultipleSelections=function(n){B(this.cm.display.cursorDiv,n.cursors),B(this.cm.display.selectionDiv,n.selection)},$r.prototype.rememberSelection=function(){var n=this.getSelection();this.lastAnchorNode=n.anchorNode,this.lastAnchorOffset=n.anchorOffset,this.lastFocusNode=n.focusNode,this.lastFocusOffset=n.focusOffset},$r.prototype.selectionInEditor=function(){var n=this.getSelection();if(!n.rangeCount)return!1;var c=n.getRangeAt(0).commonAncestorContainer;return ee(this.div,c)},$r.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},$r.prototype.blur=function(){this.div.blur()},$r.prototype.getField=function(){return this.div},$r.prototype.supportsTouch=function(){return!0},$r.prototype.receivedFocus=function(){var n=this;this.selectionInEditor()?this.pollSelection():yn(this.cm,function(){return n.cm.curOp.selectionChanged=!0});function c(){n.cm.state.focused&&(n.pollSelection(),n.polling.set(n.cm.options.pollInterval,c))}this.polling.set(this.cm.options.pollInterval,c)},$r.prototype.selectionChanged=function(){var n=this.getSelection();return n.anchorNode!=this.lastAnchorNode||n.anchorOffset!=this.lastAnchorOffset||n.focusNode!=this.lastFocusNode||n.focusOffset!=this.lastFocusOffset},$r.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var n=this.getSelection(),c=this.cm;if(m&&h&&this.cm.display.gutterSpecs.length&&yh(n.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var k=dc(c,n.anchorNode,n.anchorOffset),C=dc(c,n.focusNode,n.focusOffset);k&&C&&yn(c,function(){On(c.doc,fo(k,C),Le),(k.bad||C.bad)&&(c.curOp.selectionChanged=!0)})}}},$r.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var n=this.cm,c=n.display,k=n.doc.sel.primary(),C=k.from(),O=k.to();if(C.ch==0&&C.line>n.firstLine()&&(C=at(C.line-1,xt(n.doc,C.line-1).length)),O.ch==xt(n.doc,O.line).text.length&&O.line<n.lastLine()&&(O=at(O.line+1,0)),C.line<c.viewFrom||O.line>c.viewTo-1)return!1;var X,ce,me;C.line==c.viewFrom||(X=Rr(n,C.line))==0?(ce=Zt(c.view[0].line),me=c.view[0].node):(ce=Zt(c.view[X].line),me=c.view[X-1].node.nextSibling);var ve=Rr(n,O.line),ke,Ie;if(ve==c.view.length-1?(ke=c.viewTo-1,Ie=c.lineDiv.lastChild):(ke=Zt(c.view[ve+1].line)-1,Ie=c.view[ve+1].node.previousSibling),!me)return!1;for(var He=n.doc.splitLines(bh(n,me,Ie,ce,ke)),Ve=rr(n.doc,at(ce,0),at(ke,xt(n.doc,ke).text.length));He.length>1&&Ve.length>1;)if(Pe(He)==Pe(Ve))He.pop(),Ve.pop(),ke--;else if(He[0]==Ve[0])He.shift(),Ve.shift(),ce++;else break;for(var Ke=0,rt=0,ut=He[0],yt=Ve[0],Ct=Math.min(ut.length,yt.length);Ke<Ct&&ut.charCodeAt(Ke)==yt.charCodeAt(Ke);)++Ke;for(var At=Pe(He),St=Pe(Ve),Lt=Math.min(At.length-(He.length==1?Ke:0),St.length-(Ve.length==1?Ke:0));rt<Lt&&At.charCodeAt(At.length-rt-1)==St.charCodeAt(St.length-rt-1);)++rt;if(He.length==1&&Ve.length==1&&ce==C.line)for(;Ke&&Ke>C.ch&&At.charCodeAt(At.length-rt-1)==St.charCodeAt(St.length-rt-1);)Ke--,rt++;He[He.length-1]=At.slice(0,At.length-rt).replace(/^\u200b+/,""),He[0]=He[0].slice(Ke).replace(/\u200b+$/,"");var Nt=at(ce,Ke),zt=at(ke,Ve.length?Pe(Ve).length-rt:0);if(He.length>1||He[0]||Ht(Nt,zt))return Ra(n.doc,He,Nt,zt,"+input"),!0},$r.prototype.ensurePolled=function(){this.forceCompositionEnd()},$r.prototype.reset=function(){this.forceCompositionEnd()},$r.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},$r.prototype.readFromDOMSoon=function(){var n=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(n.readDOMTimeout=null,n.composing)if(n.composing.done)n.composing=null;else return;n.updateFromDOM()},80))},$r.prototype.updateFromDOM=function(){var n=this;(this.cm.isReadOnly()||!this.pollContent())&&yn(this.cm,function(){return Qt(n.cm)})},$r.prototype.setUneditable=function(n){n.contentEditable="false"},$r.prototype.onKeyPress=function(n){n.charCode==0||this.composing||(n.preventDefault(),this.cm.isReadOnly()||Ln(this.cm,du)(this.cm,String.fromCharCode(n.charCode==null?n.keyCode:n.charCode),0))},$r.prototype.readOnlyChanged=function(n){this.div.contentEditable=String(n!="nocursor")},$r.prototype.onContextMenu=function(){},$r.prototype.resetPosition=function(){},$r.prototype.needsContentAttribute=!0;function Mf(n,c){var k=Oi(n,c.line);if(!k||k.hidden)return null;var C=xt(n.doc,c.line),O=So(k,C,c.line),X=lt(C,n.doc.direction),ce="left";if(X){var me=Re(X,c.ch);ce=me%2?"right":"left"}var ve=zi(O.map,c.ch,ce);return ve.offset=ve.collapse=="right"?ve.end:ve.start,ve}function yh(n){for(var c=n;c;c=c.parentNode)if(/CodeMirror-gutter-wrapper/.test(c.className))return!0;return!1}function Wa(n,c){return c&&(n.bad=!0),n}function bh(n,c,k,C,O){var X="",ce=!1,me=n.doc.lineSeparator(),ve=!1;function ke(Ke){return function(rt){return rt.id==Ke}}function Ie(){ce&&(X+=me,ve&&(X+=me),ce=ve=!1)}function He(Ke){Ke&&(Ie(),X+=Ke)}function Ve(Ke){if(Ke.nodeType==1){var rt=Ke.getAttribute("cm-text");if(rt){He(rt);return}var ut=Ke.getAttribute("cm-marker"),yt;if(ut){var Ct=n.findMarks(at(C,0),at(O+1,0),ke(+ut));Ct.length&&(yt=Ct[0].find(0))&&He(rr(n.doc,yt.from,yt.to).join(me));return}if(Ke.getAttribute("contenteditable")=="false")return;var At=/^(pre|div|p|li|table|br)$/i.test(Ke.nodeName);if(!/^br$/i.test(Ke.nodeName)&&Ke.textContent.length==0)return;At&&Ie();for(var St=0;St<Ke.childNodes.length;St++)Ve(Ke.childNodes[St]);/^(pre|p)$/i.test(Ke.nodeName)&&(ve=!0),At&&(ce=!0)}else Ke.nodeType==3&&He(Ke.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;Ve(c),c!=k;)c=c.nextSibling,ve=!1;return X}function dc(n,c,k){var C;if(c==n.display.lineDiv){if(C=n.display.lineDiv.childNodes[k],!C)return Wa(n.clipPos(at(n.display.viewTo-1)),!0);c=null,k=0}else for(C=c;;C=C.parentNode){if(!C||C==n.display.lineDiv)return null;if(C.parentNode&&C.parentNode==n.display.lineDiv)break}for(var O=0;O<n.display.view.length;O++){var X=n.display.view[O];if(X.node==C)return _h(X,c,k)}}function _h(n,c,k){var C=n.text.firstChild,O=!1;if(!c||!ee(C,c))return Wa(at(Zt(n.line),0),!0);if(c==C&&(O=!0,c=C.childNodes[k],k=0,!c)){var X=n.rest?Pe(n.rest):n.line;return Wa(at(Zt(X),X.text.length),O)}var ce=c.nodeType==3?c:null,me=c;for(!ce&&c.childNodes.length==1&&c.firstChild.nodeType==3&&(ce=c.firstChild,k&&(k=ce.nodeValue.length));me.parentNode!=C;)me=me.parentNode;var ve=n.measure,ke=ve.maps;function Ie(yt,Ct,At){for(var St=-1;St<(ke?ke.length:0);St++)for(var Lt=St<0?ve.map:ke[St],Nt=0;Nt<Lt.length;Nt+=3){var zt=Lt[Nt+2];if(zt==yt||zt==Ct){var lr=Zt(St<0?n.line:n.rest[St]),qr=Lt[Nt]+At;return(At<0||zt!=yt)&&(qr=Lt[Nt+(At?1:0)]),at(lr,qr)}}}var He=Ie(ce,me,k);if(He)return Wa(He,O);for(var Ve=me.nextSibling,Ke=ce?ce.nodeValue.length-k:0;Ve;Ve=Ve.nextSibling){if(He=Ie(Ve,Ve.firstChild,0),He)return Wa(at(He.line,He.ch-Ke),O);Ke+=Ve.textContent.length}for(var rt=me.previousSibling,ut=k;rt;rt=rt.previousSibling){if(He=Ie(rt,rt.firstChild,-1),He)return Wa(at(He.line,He.ch+ut),O);ut+=rt.textContent.length}}var Jr=function(n){this.cm=n,this.prevInput="",this.pollingFast=!1,this.polling=new le,this.hasSelection=!1,this.composing=null};Jr.prototype.init=function(n){var c=this,k=this,C=this.cm;this.createField(n);var O=this.textarea;n.wrapper.insertBefore(this.wrapper,n.wrapper.firstChild),u&&(O.style.width="0px"),Ze(O,"input",function(){E&&p>=9&&c.hasSelection&&(c.hasSelection=null),k.poll()}),Ze(O,"paste",function(ce){Qe(C,ce)||pu(ce,C)||(C.state.pasteIncoming=+new Date,k.fastPoll())});function X(ce){if(!Qe(C,ce)){if(C.somethingSelected())Ds({lineWise:!1,text:C.getSelections()});else if(C.options.lineWiseCopyCut){var me=Ua(C);Ds({lineWise:!0,text:me.text}),ce.type=="cut"?C.setSelections(me.ranges,null,Le):(k.prevInput="",O.value=me.text.join(`
`),oe(O))}else return;ce.type=="cut"&&(C.state.cutIncoming=+new Date)}}Ze(O,"cut",X),Ze(O,"copy",X),Ze(n.scroller,"paste",function(ce){if(!(vi(n,ce)||Qe(C,ce))){if(!O.dispatchEvent){C.state.pasteIncoming=+new Date,k.focus();return}var me=new Event("paste");me.clipboardData=ce.clipboardData,O.dispatchEvent(me)}}),Ze(n.lineSpace,"selectstart",function(ce){vi(n,ce)||Tt(ce)}),Ze(O,"compositionstart",function(){var ce=C.getCursor("from");k.composing&&k.composing.range.clear(),k.composing={start:ce,range:C.markText(ce,C.getCursor("to"),{className:"CodeMirror-composing"})}}),Ze(O,"compositionend",function(){k.composing&&(k.poll(),k.composing.range.clear(),k.composing=null)})},Jr.prototype.createField=function(n){this.wrapper=gu(),this.textarea=this.wrapper.firstChild},Jr.prototype.screenReaderLabelChanged=function(n){n?this.textarea.setAttribute("aria-label",n):this.textarea.removeAttribute("aria-label")},Jr.prototype.prepareSelection=function(){var n=this.cm,c=n.display,k=n.doc,C=Rc(n);if(n.options.moveInputWithCursor){var O=fi(n,k.sel.primary().head,"div"),X=c.wrapper.getBoundingClientRect(),ce=c.lineDiv.getBoundingClientRect();C.teTop=Math.max(0,Math.min(c.wrapper.clientHeight-10,O.top+ce.top-X.top)),C.teLeft=Math.max(0,Math.min(c.wrapper.clientWidth-10,O.left+ce.left-X.left))}return C},Jr.prototype.showSelection=function(n){var c=this.cm,k=c.display;B(k.cursorDiv,n.cursors),B(k.selectionDiv,n.selection),n.teTop!=null&&(this.wrapper.style.top=n.teTop+"px",this.wrapper.style.left=n.teLeft+"px")},Jr.prototype.reset=function(n){if(!(this.contextMenuPending||this.composing)){var c=this.cm;if(c.somethingSelected()){this.prevInput="";var k=c.getSelection();this.textarea.value=k,c.state.focused&&oe(this.textarea),E&&p>=9&&(this.hasSelection=k)}else n||(this.prevInput=this.textarea.value="",E&&p>=9&&(this.hasSelection=null))}},Jr.prototype.getField=function(){return this.textarea},Jr.prototype.supportsTouch=function(){return!1},Jr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!y||K()!=this.textarea))try{this.textarea.focus()}catch(n){}},Jr.prototype.blur=function(){this.textarea.blur()},Jr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Jr.prototype.receivedFocus=function(){this.slowPoll()},Jr.prototype.slowPoll=function(){var n=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){n.poll(),n.cm.state.focused&&n.slowPoll()})},Jr.prototype.fastPoll=function(){var n=!1,c=this;c.pollingFast=!0;function k(){var C=c.poll();!C&&!n?(n=!0,c.polling.set(60,k)):(c.pollingFast=!1,c.slowPoll())}c.polling.set(20,k)},Jr.prototype.poll=function(){var n=this,c=this.cm,k=this.textarea,C=this.prevInput;if(this.contextMenuPending||!c.state.focused||dt(k)&&!C&&!this.composing||c.isReadOnly()||c.options.disableInput||c.state.keySeq)return!1;var O=k.value;if(O==C&&!c.somethingSelected())return!1;if(E&&p>=9&&this.hasSelection===O||_&&/[\uf700-\uf7ff]/.test(O))return c.display.input.reset(),!1;if(c.doc.sel==c.display.selForContextMenu){var X=O.charCodeAt(0);if(X==8203&&!C&&(C="\u200B"),X==8666)return this.reset(),this.cm.execCommand("undo")}for(var ce=0,me=Math.min(C.length,O.length);ce<me&&C.charCodeAt(ce)==O.charCodeAt(ce);)++ce;return yn(c,function(){du(c,O.slice(ce),C.length-ce,null,n.composing?"*compose":null),O.length>1e3||O.indexOf(`
`)>-1?k.value=n.prevInput="":n.prevInput=O,n.composing&&(n.composing.range.clear(),n.composing.range=c.markText(n.composing.start,c.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Jr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Jr.prototype.onKeyPress=function(){E&&p>=9&&(this.hasSelection=null),this.fastPoll()},Jr.prototype.onContextMenu=function(n){var c=this,k=c.cm,C=k.display,O=c.textarea;c.contextMenuPending&&c.contextMenuPending();var X=uo(k,n),ce=C.scroller.scrollTop;if(!X||v)return;var me=k.options.resetSelectionOnContextMenu;me&&k.doc.sel.contains(X)==-1&&Ln(k,On)(k.doc,fo(X),Le);var ve=O.style.cssText,ke=c.wrapper.style.cssText,Ie=c.wrapper.offsetParent.getBoundingClientRect();c.wrapper.style.cssText="position: static",O.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(n.clientY-Ie.top-5)+"px; left: "+(n.clientX-Ie.left-5)+`px;
z-index: 1000; background: `+(E?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var He;g&&(He=window.scrollY),C.input.focus(),g&&window.scrollTo(null,He),C.input.reset(),k.somethingSelected()||(O.value=c.prevInput=" "),c.contextMenuPending=Ke,C.selForContextMenu=k.doc.sel,clearTimeout(C.detectingSelectAll);function Ve(){if(O.selectionStart!=null){var ut=k.somethingSelected(),yt="\u200B"+(ut?O.value:"");O.value="\u21DA",O.value=yt,c.prevInput=ut?"":"\u200B",O.selectionStart=1,O.selectionEnd=yt.length,C.selForContextMenu=k.doc.sel}}function Ke(){if(c.contextMenuPending==Ke&&(c.contextMenuPending=!1,c.wrapper.style.cssText=ke,O.style.cssText=ve,E&&p<9&&C.scrollbars.setScrollTop(C.scroller.scrollTop=ce),O.selectionStart!=null)){(!E||E&&p<9)&&Ve();var ut=0,yt=function(){C.selForContextMenu==k.doc.sel&&O.selectionStart==0&&O.selectionEnd>0&&c.prevInput=="\u200B"?Ln(k,eu)(k):ut++<10?C.detectingSelectAll=setTimeout(yt,500):(C.selForContextMenu=null,C.input.reset())};C.detectingSelectAll=setTimeout(yt,200)}}if(E&&p>=9&&Ve(),H){xn(n);var rt=function(){nt(window,"mouseup",rt),setTimeout(Ke,20)};Ze(window,"mouseup",rt)}else setTimeout(Ke,50)},Jr.prototype.readOnlyChanged=function(n){n||this.reset(),this.textarea.disabled=n=="nocursor",this.textarea.readOnly=!!n},Jr.prototype.setUneditable=function(){},Jr.prototype.needsContentAttribute=!1;function ma(n,c){if(c=c?ye(c):{},c.value=n.value,!c.tabindex&&n.tabIndex&&(c.tabindex=n.tabIndex),!c.placeholder&&n.placeholder&&(c.placeholder=n.placeholder),c.autofocus==null){var k=K();c.autofocus=k==n||n.getAttribute("autofocus")!=null&&k==document.body}function C(){n.value=me.getValue()}var O;if(n.form&&(Ze(n.form,"submit",C),!c.leaveSubmitMethodAlone)){var X=n.form;O=X.submit;try{var ce=X.submit=function(){C(),X.submit=O,X.submit(),X.submit=ce}}catch(ve){}}c.finishInit=function(ve){ve.save=C,ve.getTextArea=function(){return n},ve.toTextArea=function(){ve.toTextArea=isNaN,C(),n.parentNode.removeChild(ve.getWrapperElement()),n.style.display="",n.form&&(nt(n.form,"submit",C),!c.leaveSubmitMethodAlone&&typeof n.form.submit=="function"&&(n.form.submit=O))}},n.style.display="none";var me=Xt(function(ve){return n.parentNode.insertBefore(ve,n.nextSibling)},c);return me}function Ka(n){n.off=nt,n.on=Ze,n.wheelEventPixels=Vc,n.Doc=kn,n.splitLines=Kt,n.countColumn=Y,n.findColumn=Te,n.isWordChar=re,n.Pass=we,n.signal=qe,n.Line=Mr,n.changeEnd=Qo,n.scrollbarModel=zc,n.Pos=at,n.cmpPos=Ht,n.modes=kt,n.mimeModes=Yt,n.resolveMode=$t,n.getMode=dr,n.modeExtensions=tr,n.extendMode=ur,n.copyState=Sr,n.startState=sr,n.innerMode=Nr,n.commands=Fa,n.keyMap=Zr,n.keyName=da,n.isModifierKey=gl,n.lookupKey=is,n.normalizeKeyMap=ou,n.StringStream=Wt,n.SharedTextMarker=ar,n.TextMarker=Es,n.LineWidget=ja,n.e_preventDefault=Tt,n.e_stopPropagation=kr,n.e_stop=xn,n.addClass=Z,n.contains=ee,n.rmClass=F,n.keyNames=ho}mh(Xt),vu(Xt);var as="iter insert remove copy getEditor constructor".split(" ");for(var io in kn.prototype)kn.prototype.hasOwnProperty(io)&&xe(as,io)<0&&(Xt.prototype[io]=function(n){return function(){return n.apply(this.doc,arguments)}}(kn.prototype[io]));return bt(kn),Xt.inputStyles={textarea:Jr,contenteditable:$r},Xt.defineMode=function(n){!Xt.defaults.mode&&n!="null"&&(Xt.defaults.mode=n),Jt.apply(this,arguments)},Xt.defineMIME=hr,Xt.defineMode("null",function(){return{token:function(n){return n.skipToEnd()}}}),Xt.defineMIME("text/plain","null"),Xt.defineExtension=function(n,c){Xt.prototype[n]=c},Xt.defineDocExtension=function(n,c){kn.prototype[n]=c},Xt.fromTextArea=ma,Ka(Xt),Xt.version="5.58.2",Xt})},49047:function(It,Ue,Q){(function(he){he(Q(4631),Q(29589),Q(52539))})(function(he){"use strict";he.defineMode("markdown",function(fe,i){var M=he.getMode(fe,"text/html"),E=M.name=="null";function p(Y){if(he.findModeByName){var le=he.findModeByName(Y);le&&(Y=le.mime||le.mimes[0])}var xe=he.getMode(fe,Y);return xe.name=="null"?null:xe}i.highlightFormatting===void 0&&(i.highlightFormatting=!1),i.maxBlockquoteDepth===void 0&&(i.maxBlockquoteDepth=0),i.taskLists===void 0&&(i.taskLists=!1),i.strikethrough===void 0&&(i.strikethrough=!1),i.emoji===void 0&&(i.emoji=!1),i.fencedCodeBlockHighlighting===void 0&&(i.fencedCodeBlockHighlighting=!0),i.fencedCodeBlockDefaultMode===void 0&&(i.fencedCodeBlockDefaultMode="text/plain"),i.xml===void 0&&(i.xml=!0),i.tokenTypeOverrides===void 0&&(i.tokenTypeOverrides={});var g={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var l in g)g.hasOwnProperty(l)&&i.tokenTypeOverrides[l]&&(g[l]=i.tokenTypeOverrides[l]);var h=/^([*\-_])(?:\s*\1){2,}\s*$/,v=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,d=/^\[(x| )\](?=\s)/i,o=i.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,s=/^ {0,3}(?:\={1,}|-{2,})\s*$/,u=/^[^#!\[\]*_\\<>` "'(~:]+/,m=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,y=/^\s*\[[^\]]+?\]:.*$/,_=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,x=" ";function S(Y,le,xe){return le.f=le.inline=xe,xe(Y,le)}function w(Y,le,xe){return le.f=le.block=xe,xe(Y,le)}function A(Y){return!Y||!/\S/.test(Y.string)}function H(Y){if(Y.linkTitle=!1,Y.linkHref=!1,Y.linkText=!1,Y.em=!1,Y.strong=!1,Y.strikethrough=!1,Y.quote=0,Y.indentedCode=!1,Y.f==F){var le=E;if(!le){var xe=he.innerMode(M,Y.htmlState);le=xe.mode.name=="xml"&&xe.state.tagStart===null&&!xe.state.context&&xe.state.tokenize.isInText}le&&(Y.f=U,Y.block=R,Y.htmlState=null)}return Y.trailingSpace=0,Y.trailingSpaceNewLine=!1,Y.prevLine=Y.thisLine,Y.thisLine={stream:null},null}function R(Y,le){var xe=Y.column()===le.indentation,Ce=A(le.prevLine.stream),we=le.indentedCode,Le=le.prevLine.hr,de=le.list!==!1,be=(le.listStack[le.listStack.length-1]||0)+3;le.indentedCode=!1;var Te=le.indentation;if(le.indentationDiff===null&&(le.indentationDiff=le.indentation,de)){for(le.list=null;Te<le.listStack[le.listStack.length-1];)le.listStack.pop(),le.listStack.length?le.indentation=le.listStack[le.listStack.length-1]:le.list=!1;le.list!==!1&&(le.indentationDiff=Te-le.listStack[le.listStack.length-1])}var Ae=!Ce&&!Le&&!le.prevLine.header&&(!de||!we)&&!le.prevLine.fencedCodeEnd,Be=(le.list===!1||Le||Ce)&&le.indentation<=be&&Y.match(h),Pe=null;if(le.indentationDiff>=4&&(we||le.prevLine.fencedCodeEnd||le.prevLine.header||Ce))return Y.skipToEnd(),le.indentedCode=!0,g.code;if(Y.eatSpace())return null;if(xe&&le.indentation<=be&&(Pe=Y.match(o))&&Pe[1].length<=6)return le.quote=0,le.header=Pe[1].length,le.thisLine.header=!0,i.highlightFormatting&&(le.formatting="header"),le.f=le.inline,B(le);if(le.indentation<=be&&Y.eat(">"))return le.quote=xe?1:le.quote+1,i.highlightFormatting&&(le.formatting="quote"),Y.eatSpace(),B(le);if(!Be&&!le.setext&&xe&&le.indentation<=be&&(Pe=Y.match(v))){var _e=Pe[1]?"ol":"ul";return le.indentation=Te+Y.current().length,le.list=!0,le.quote=0,le.listStack.push(le.indentation),le.em=!1,le.strong=!1,le.code=!1,le.strikethrough=!1,i.taskLists&&Y.match(d,!1)&&(le.taskList=!0),le.f=le.inline,i.highlightFormatting&&(le.formatting=["list","list-"+_e]),B(le)}else{if(xe&&le.indentation<=be&&(Pe=Y.match(m,!0)))return le.quote=0,le.fencedEndRE=new RegExp(Pe[1]+"+ *$"),le.localMode=i.fencedCodeBlockHighlighting&&p(Pe[2]||i.fencedCodeBlockDefaultMode),le.localMode&&(le.localState=he.startState(le.localMode)),le.f=le.block=D,i.highlightFormatting&&(le.formatting="code-block"),le.code=-1,B(le);if(le.setext||(!Ae||!de)&&!le.quote&&le.list===!1&&!le.code&&!Be&&!y.test(Y.string)&&(Pe=Y.lookAhead(1))&&(Pe=Pe.match(s)))return le.setext?(le.header=le.setext,le.setext=0,Y.skipToEnd(),i.highlightFormatting&&(le.formatting="header")):(le.header=Pe[0].charAt(0)=="="?1:2,le.setext=le.header),le.thisLine.header=!0,le.f=le.inline,B(le);if(Be)return Y.skipToEnd(),le.hr=!0,le.thisLine.hr=!0,g.hr;if(Y.peek()==="[")return S(Y,le,$)}return S(Y,le,le.inline)}function F(Y,le){var xe=M.token(Y,le.htmlState);if(!E){var Ce=he.innerMode(M,le.htmlState);(Ce.mode.name=="xml"&&Ce.state.tagStart===null&&!Ce.state.context&&Ce.state.tokenize.isInText||le.md_inside&&Y.current().indexOf(">")>-1)&&(le.f=U,le.block=R,le.htmlState=null)}return xe}function D(Y,le){var xe=le.listStack[le.listStack.length-1]||0,Ce=le.indentation<xe,we=xe+3;if(le.fencedEndRE&&le.indentation<=we&&(Ce||Y.match(le.fencedEndRE))){i.highlightFormatting&&(le.formatting="code-block");var Le;return Ce||(Le=B(le)),le.localMode=le.localState=null,le.block=R,le.f=U,le.fencedEndRE=null,le.code=0,le.thisLine.fencedCodeEnd=!0,Ce?w(Y,le,le.block):Le}else return le.localMode?le.localMode.token(Y,le.localState):(Y.skipToEnd(),g.code)}function B(Y){var le=[];if(Y.formatting){le.push(g.formatting),typeof Y.formatting=="string"&&(Y.formatting=[Y.formatting]);for(var xe=0;xe<Y.formatting.length;xe++)le.push(g.formatting+"-"+Y.formatting[xe]),Y.formatting[xe]==="header"&&le.push(g.formatting+"-"+Y.formatting[xe]+"-"+Y.header),Y.formatting[xe]==="quote"&&(!i.maxBlockquoteDepth||i.maxBlockquoteDepth>=Y.quote?le.push(g.formatting+"-"+Y.formatting[xe]+"-"+Y.quote):le.push("error"))}if(Y.taskOpen)return le.push("meta"),le.length?le.join(" "):null;if(Y.taskClosed)return le.push("property"),le.length?le.join(" "):null;if(Y.linkHref?le.push(g.linkHref,"url"):(Y.strong&&le.push(g.strong),Y.em&&le.push(g.em),Y.strikethrough&&le.push(g.strikethrough),Y.emoji&&le.push(g.emoji),Y.linkText&&le.push(g.linkText),Y.code&&le.push(g.code),Y.image&&le.push(g.image),Y.imageAltText&&le.push(g.imageAltText,"link"),Y.imageMarker&&le.push(g.imageMarker)),Y.header&&le.push(g.header,g.header+"-"+Y.header),Y.quote&&(le.push(g.quote),!i.maxBlockquoteDepth||i.maxBlockquoteDepth>=Y.quote?le.push(g.quote+"-"+Y.quote):le.push(g.quote+"-"+i.maxBlockquoteDepth)),Y.list!==!1){var Ce=(Y.listStack.length-1)%3;Ce?Ce===1?le.push(g.list2):le.push(g.list3):le.push(g.list1)}return Y.trailingSpaceNewLine?le.push("trailing-space-new-line"):Y.trailingSpace&&le.push("trailing-space-"+(Y.trailingSpace%2?"a":"b")),le.length?le.join(" "):null}function P(Y,le){if(Y.match(u,!0))return B(le)}function U(Y,le){var xe=le.text(Y,le);if(typeof xe!="undefined")return xe;if(le.list)return le.list=null,B(le);if(le.taskList){var Ce=Y.match(d,!0)[1]===" ";return Ce?le.taskOpen=!0:le.taskClosed=!0,i.highlightFormatting&&(le.formatting="task"),le.taskList=!1,B(le)}if(le.taskOpen=!1,le.taskClosed=!1,le.header&&Y.match(/^#+$/,!0))return i.highlightFormatting&&(le.formatting="header"),B(le);var we=Y.next();if(le.linkTitle){le.linkTitle=!1;var Le=we;we==="("&&(Le=")"),Le=(Le+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var de="^\\s*(?:[^"+Le+"\\\\]+|\\\\\\\\|\\\\.)"+Le;if(Y.match(new RegExp(de),!0))return g.linkHref}if(we==="`"){var be=le.formatting;i.highlightFormatting&&(le.formatting="code"),Y.eatWhile("`");var Te=Y.current().length;if(le.code==0&&(!le.quote||Te==1))return le.code=Te,B(le);if(Te==le.code){var Ae=B(le);return le.code=0,Ae}else return le.formatting=be,B(le)}else if(le.code)return B(le);if(we==="\\"&&(Y.next(),i.highlightFormatting)){var Be=B(le),Pe=g.formatting+"-escape";return Be?Be+" "+Pe:Pe}if(we==="!"&&Y.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return le.imageMarker=!0,le.image=!0,i.highlightFormatting&&(le.formatting="image"),B(le);if(we==="["&&le.imageMarker&&Y.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return le.imageMarker=!1,le.imageAltText=!0,i.highlightFormatting&&(le.formatting="image"),B(le);if(we==="]"&&le.imageAltText){i.highlightFormatting&&(le.formatting="image");var Be=B(le);return le.imageAltText=!1,le.image=!1,le.inline=le.f=ee,Be}if(we==="["&&!le.image)return le.linkText&&Y.match(/^.*?\]/)||(le.linkText=!0,i.highlightFormatting&&(le.formatting="link")),B(le);if(we==="]"&&le.linkText){i.highlightFormatting&&(le.formatting="link");var Be=B(le);return le.linkText=!1,le.inline=le.f=Y.match(/\(.*?\)| ?\[.*?\]/,!1)?ee:U,Be}if(we==="<"&&Y.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){le.f=le.inline=G,i.highlightFormatting&&(le.formatting="link");var Be=B(le);return Be?Be+=" ":Be="",Be+g.linkInline}if(we==="<"&&Y.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){le.f=le.inline=G,i.highlightFormatting&&(le.formatting="link");var Be=B(le);return Be?Be+=" ":Be="",Be+g.linkEmail}if(i.xml&&we==="<"&&Y.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var _e=Y.string.indexOf(">",Y.pos);if(_e!=-1){var ne=Y.string.substring(Y.start,_e);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(ne)&&(le.md_inside=!0)}return Y.backUp(1),le.htmlState=he.startState(M),w(Y,le,F)}if(i.xml&&we==="<"&&Y.match(/^\/\w*?>/))return le.md_inside=!1,"tag";if(we==="*"||we==="_"){for(var te=1,T=Y.pos==1?" ":Y.string.charAt(Y.pos-2);te<3&&Y.eat(we);)te++;var I=Y.peek()||" ",re=!/\s/.test(I)&&(!_.test(I)||/\s/.test(T)||_.test(T)),q=!/\s/.test(T)&&(!_.test(T)||/\s/.test(I)||_.test(I)),z=null,W=null;if(te%2&&(!le.em&&re&&(we==="*"||!q||_.test(T))?z=!0:le.em==we&&q&&(we==="*"||!re||_.test(I))&&(z=!1)),te>1&&(!le.strong&&re&&(we==="*"||!q||_.test(T))?W=!0:le.strong==we&&q&&(we==="*"||!re||_.test(I))&&(W=!1)),W!=null||z!=null){i.highlightFormatting&&(le.formatting=z==null?"strong":W==null?"em":"strong em"),z===!0&&(le.em=we),W===!0&&(le.strong=we);var Ae=B(le);return z===!1&&(le.em=!1),W===!1&&(le.strong=!1),Ae}}else if(we===" "&&(Y.eat("*")||Y.eat("_"))){if(Y.peek()===" ")return B(le);Y.backUp(1)}if(i.strikethrough){if(we==="~"&&Y.eatWhile(we)){if(le.strikethrough){i.highlightFormatting&&(le.formatting="strikethrough");var Ae=B(le);return le.strikethrough=!1,Ae}else if(Y.match(/^[^\s]/,!1))return le.strikethrough=!0,i.highlightFormatting&&(le.formatting="strikethrough"),B(le)}else if(we===" "&&Y.match(/^~~/,!0)){if(Y.peek()===" ")return B(le);Y.backUp(2)}}if(i.emoji&&we===":"&&Y.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){le.emoji=!0,i.highlightFormatting&&(le.formatting="emoji");var V=B(le);return le.emoji=!1,V}return we===" "&&(Y.match(/^ +$/,!1)?le.trailingSpace++:le.trailingSpace&&(le.trailingSpaceNewLine=!0)),B(le)}function G(Y,le){var xe=Y.next();if(xe===">"){le.f=le.inline=U,i.highlightFormatting&&(le.formatting="link");var Ce=B(le);return Ce?Ce+=" ":Ce="",Ce+g.linkInline}return Y.match(/^[^>]+/,!0),g.linkInline}function ee(Y,le){if(Y.eatSpace())return null;var xe=Y.next();return xe==="("||xe==="["?(le.f=le.inline=Z(xe==="("?")":"]"),i.highlightFormatting&&(le.formatting="link-string"),le.linkHref=!0,B(le)):"error"}var K={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function Z(Y){return function(le,xe){var Ce=le.next();if(Ce===Y){xe.f=xe.inline=U,i.highlightFormatting&&(xe.formatting="link-string");var we=B(xe);return xe.linkHref=!1,we}return le.match(K[Y]),xe.linkHref=!0,B(xe)}}function $(Y,le){return Y.match(/^([^\]\\]|\\.)*\]:/,!1)?(le.f=oe,Y.next(),i.highlightFormatting&&(le.formatting="link"),le.linkText=!0,B(le)):S(Y,le,U)}function oe(Y,le){if(Y.match(/^\]:/,!0)){le.f=le.inline=ae,i.highlightFormatting&&(le.formatting="link");var xe=B(le);return le.linkText=!1,xe}return Y.match(/^([^\]\\]|\\.)+/,!0),g.linkText}function ae(Y,le){return Y.eatSpace()?null:(Y.match(/^[^\s]+/,!0),Y.peek()===void 0?le.linkTitle=!0:Y.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),le.f=le.inline=U,g.linkHref+" url")}var ye={startState:function(){return{f:R,prevLine:{stream:null},thisLine:{stream:null},block:R,htmlState:null,indentation:0,inline:U,text:P,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(Y){return{f:Y.f,prevLine:Y.prevLine,thisLine:Y.thisLine,block:Y.block,htmlState:Y.htmlState&&he.copyState(M,Y.htmlState),indentation:Y.indentation,localMode:Y.localMode,localState:Y.localMode?he.copyState(Y.localMode,Y.localState):null,inline:Y.inline,text:Y.text,formatting:!1,linkText:Y.linkText,linkTitle:Y.linkTitle,linkHref:Y.linkHref,code:Y.code,em:Y.em,strong:Y.strong,strikethrough:Y.strikethrough,emoji:Y.emoji,header:Y.header,setext:Y.setext,hr:Y.hr,taskList:Y.taskList,list:Y.list,listStack:Y.listStack.slice(0),quote:Y.quote,indentedCode:Y.indentedCode,trailingSpace:Y.trailingSpace,trailingSpaceNewLine:Y.trailingSpaceNewLine,md_inside:Y.md_inside,fencedEndRE:Y.fencedEndRE}},token:function(Y,le){if(le.formatting=!1,Y!=le.thisLine.stream){if(le.header=0,le.hr=!1,Y.match(/^\s*$/,!0))return H(le),null;if(le.prevLine=le.thisLine,le.thisLine={stream:Y},le.taskList=!1,le.trailingSpace=0,le.trailingSpaceNewLine=!1,!le.localState&&(le.f=le.block,le.f!=F)){var xe=Y.match(/^\s*/,!0)[0].replace(/\t/g,x).length;if(le.indentation=xe,le.indentationDiff=null,xe>0)return null}}return le.f(Y,le)},innerMode:function(Y){return Y.block==F?{state:Y.htmlState,mode:M}:Y.localState?{state:Y.localState,mode:Y.localMode}:{state:Y,mode:ye}},indent:function(Y,le,xe){return Y.block==F&&M.indent?M.indent(Y.htmlState,le,xe):Y.localState&&Y.localMode.indent?Y.localMode.indent(Y.localState,le,xe):he.Pass},blankLine:H,getType:B,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return ye},"xml"),he.defineMIME("text/markdown","markdown"),he.defineMIME("text/x-markdown","markdown")})},52539:function(It,Ue,Q){(function(he){he(Q(4631))})(function(he){"use strict";he.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var fe=0;fe<he.modeInfo.length;fe++){var i=he.modeInfo[fe];i.mimes&&(i.mime=i.mimes[0])}he.findModeByMIME=function(M){M=M.toLowerCase();for(var E=0;E<he.modeInfo.length;E++){var p=he.modeInfo[E];if(p.mime==M)return p;if(p.mimes){for(var g=0;g<p.mimes.length;g++)if(p.mimes[g]==M)return p}}if(/\+xml$/.test(M))return he.findModeByMIME("application/xml");if(/\+json$/.test(M))return he.findModeByMIME("application/json")},he.findModeByExtension=function(M){M=M.toLowerCase();for(var E=0;E<he.modeInfo.length;E++){var p=he.modeInfo[E];if(p.ext){for(var g=0;g<p.ext.length;g++)if(p.ext[g]==M)return p}}},he.findModeByFileName=function(M){for(var E=0;E<he.modeInfo.length;E++){var p=he.modeInfo[E];if(p.file&&p.file.test(M))return p}var g=M.lastIndexOf("."),l=g>-1&&M.substring(g+1,M.length);if(l)return he.findModeByExtension(l)},he.findModeByName=function(M){M=M.toLowerCase();for(var E=0;E<he.modeInfo.length;E++){var p=he.modeInfo[E];if(p.name.toLowerCase()==M)return p;if(p.alias){for(var g=0;g<p.alias.length;g++)if(p.alias[g].toLowerCase()==M)return p}}}})},80785:function(It,Ue,Q){(function(he){he(Q(4631))})(function(he){"use strict";he.defineMode("stex",function(fe,i){"use strict";function M(u,m){u.cmdState.push(m)}function E(u){return u.cmdState.length>0?u.cmdState[u.cmdState.length-1]:null}function p(u){var m=u.cmdState.pop();m&&m.closeBracket()}function g(u){for(var m=u.cmdState,y=m.length-1;y>=0;y--){var _=m[y];if(_.name!="DEFAULT")return _}return{styleIdentifier:function(){return null}}}function l(u,m,y){return function(){this.name=u,this.bracketNo=0,this.style=m,this.styles=y,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var h={};h.importmodule=l("importmodule","tag",["string","builtin"]),h.documentclass=l("documentclass","tag",["","atom"]),h.usepackage=l("usepackage","tag",["atom"]),h.begin=l("begin","tag",["atom"]),h.end=l("end","tag",["atom"]),h.label=l("label","tag",["atom"]),h.ref=l("ref","tag",["atom"]),h.eqref=l("eqref","tag",["atom"]),h.cite=l("cite","tag",["atom"]),h.bibitem=l("bibitem","tag",["atom"]),h.Bibitem=l("Bibitem","tag",["atom"]),h.RBibitem=l("RBibitem","tag",["atom"]),h.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function v(u,m){u.f=m}function d(u,m){var y;if(u.match(/^\\[a-zA-Z@]+/)){var _=u.current().slice(1);return y=h.hasOwnProperty(_)?h[_]:h.DEFAULT,y=new y,M(m,y),v(m,s),y.style}if(u.match(/^\\[$&%#{}_]/)||u.match(/^\\[,;!\/\\]/))return"tag";if(u.match("\\["))return v(m,function(S,w){return o(S,w,"\\]")}),"keyword";if(u.match("\\("))return v(m,function(S,w){return o(S,w,"\\)")}),"keyword";if(u.match("$$"))return v(m,function(S,w){return o(S,w,"$$")}),"keyword";if(u.match("$"))return v(m,function(S,w){return o(S,w,"$")}),"keyword";var x=u.next();if(x=="%")return u.skipToEnd(),"comment";if(x=="}"||x=="]"){if(y=E(m),y)y.closeBracket(x),v(m,s);else return"error";return"bracket"}else return x=="{"||x=="["?(y=h.DEFAULT,y=new y,M(m,y),"bracket"):/\d/.test(x)?(u.eatWhile(/[\w.%]/),"atom"):(u.eatWhile(/[\w\-_]/),y=g(m),y.name=="begin"&&(y.argument=u.current()),y.styleIdentifier())}function o(u,m,y){if(u.eatSpace())return null;if(y&&u.match(y))return v(m,d),"keyword";if(u.match(/^\\[a-zA-Z@]+/))return"tag";if(u.match(/^[a-zA-Z]+/))return"variable-2";if(u.match(/^\\[$&%#{}_]/)||u.match(/^\\[,;!\/]/)||u.match(/^[\^_&]/))return"tag";if(u.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(u.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var _=u.next();return _=="{"||_=="}"||_=="["||_=="]"||_=="("||_==")"?"bracket":_=="%"?(u.skipToEnd(),"comment"):"error"}function s(u,m){var y=u.peek(),_;return y=="{"||y=="["?(_=E(m),_.openBracket(y),u.eat(y),v(m,d),"bracket"):/[ \t\r]/.test(y)?(u.eat(y),null):(v(m,d),p(m),d(u,m))}return{startState:function(){var u=i.inMathMode?function(m,y){return o(m,y)}:d;return{cmdState:[],f:u}},copyState:function(u){return{cmdState:u.cmdState.slice(),f:u.f}},token:function(u,m){return m.f(u,m)},blankLine:function(u){u.f=d,u.cmdState.length=0},lineComment:"%"}}),he.defineMIME("text/x-stex","stex"),he.defineMIME("text/x-latex","stex")})},29589:function(It,Ue,Q){(function(he){he(Q(4631))})(function(he){"use strict";var fe={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},i={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};he.defineMode("xml",function(M,E){var p=M.indentUnit,g={},l=E.htmlMode?fe:i;for(var h in l)g[h]=l[h];for(var h in E)g[h]=E[h];var v,d;function o(G,ee){function K(oe){return ee.tokenize=oe,oe(G,ee)}var Z=G.next();if(Z=="<")return G.eat("!")?G.eat("[")?G.match("CDATA[")?K(m("atom","]]>")):null:G.match("--")?K(m("comment","-->")):G.match("DOCTYPE",!0,!0)?(G.eatWhile(/[\w\._\-]/),K(y(1))):null:G.eat("?")?(G.eatWhile(/[\w\._\-]/),ee.tokenize=m("meta","?>"),"meta"):(v=G.eat("/")?"closeTag":"openTag",ee.tokenize=s,"tag bracket");if(Z=="&"){var $;return G.eat("#")?G.eat("x")?$=G.eatWhile(/[a-fA-F\d]/)&&G.eat(";"):$=G.eatWhile(/[\d]/)&&G.eat(";"):$=G.eatWhile(/[\w\.\-:]/)&&G.eat(";"),$?"atom":"error"}else return G.eatWhile(/[^&<]/),null}o.isInText=!0;function s(G,ee){var K=G.next();if(K==">"||K=="/"&&G.eat(">"))return ee.tokenize=o,v=K==">"?"endTag":"selfcloseTag","tag bracket";if(K=="=")return v="equals",null;if(K=="<"){ee.tokenize=o,ee.state=w,ee.tagName=ee.tagStart=null;var Z=ee.tokenize(G,ee);return Z?Z+" tag error":"tag error"}else return/[\'\"]/.test(K)?(ee.tokenize=u(K),ee.stringStartCol=G.column(),ee.tokenize(G,ee)):(G.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function u(G){var ee=function(K,Z){for(;!K.eol();)if(K.next()==G){Z.tokenize=s;break}return"string"};return ee.isInAttribute=!0,ee}function m(G,ee){return function(K,Z){for(;!K.eol();){if(K.match(ee)){Z.tokenize=o;break}K.next()}return G}}function y(G){return function(ee,K){for(var Z;(Z=ee.next())!=null;){if(Z=="<")return K.tokenize=y(G+1),K.tokenize(ee,K);if(Z==">")if(G==1){K.tokenize=o;break}else return K.tokenize=y(G-1),K.tokenize(ee,K)}return"meta"}}function _(G,ee,K){this.prev=G.context,this.tagName=ee,this.indent=G.indented,this.startOfLine=K,(g.doNotIndent.hasOwnProperty(ee)||G.context&&G.context.noIndent)&&(this.noIndent=!0)}function x(G){G.context&&(G.context=G.context.prev)}function S(G,ee){for(var K;;){if(!G.context||(K=G.context.tagName,!g.contextGrabbers.hasOwnProperty(K)||!g.contextGrabbers[K].hasOwnProperty(ee)))return;x(G)}}function w(G,ee,K){return G=="openTag"?(K.tagStart=ee.column(),A):G=="closeTag"?H:w}function A(G,ee,K){return G=="word"?(K.tagName=ee.current(),d="tag",D):g.allowMissingTagName&&G=="endTag"?(d="tag bracket",D(G,ee,K)):(d="error",A)}function H(G,ee,K){if(G=="word"){var Z=ee.current();return K.context&&K.context.tagName!=Z&&g.implicitlyClosed.hasOwnProperty(K.context.tagName)&&x(K),K.context&&K.context.tagName==Z||g.matchClosing===!1?(d="tag",R):(d="tag error",F)}else return g.allowMissingTagName&&G=="endTag"?(d="tag bracket",R(G,ee,K)):(d="error",F)}function R(G,ee,K){return G!="endTag"?(d="error",R):(x(K),w)}function F(G,ee,K){return d="error",R(G,ee,K)}function D(G,ee,K){if(G=="word")return d="attribute",B;if(G=="endTag"||G=="selfcloseTag"){var Z=K.tagName,$=K.tagStart;return K.tagName=K.tagStart=null,G=="selfcloseTag"||g.autoSelfClosers.hasOwnProperty(Z)?S(K,Z):(S(K,Z),K.context=new _(K,Z,$==K.indented)),w}return d="error",D}function B(G,ee,K){return G=="equals"?P:(g.allowMissing||(d="error"),D(G,ee,K))}function P(G,ee,K){return G=="string"?U:G=="word"&&g.allowUnquoted?(d="string",D):(d="error",D(G,ee,K))}function U(G,ee,K){return G=="string"?U:D(G,ee,K)}return{startState:function(G){var ee={tokenize:o,state:w,indented:G||0,tagName:null,tagStart:null,context:null};return G!=null&&(ee.baseIndent=G),ee},token:function(G,ee){if(!ee.tagName&&G.sol()&&(ee.indented=G.indentation()),G.eatSpace())return null;v=null;var K=ee.tokenize(G,ee);return(K||v)&&K!="comment"&&(d=null,ee.state=ee.state(v||K,G,ee),d&&(K=d=="error"?K+" error":d)),K},indent:function(G,ee,K){var Z=G.context;if(G.tokenize.isInAttribute)return G.tagStart==G.indented?G.stringStartCol+1:G.indented+p;if(Z&&Z.noIndent)return he.Pass;if(G.tokenize!=s&&G.tokenize!=o)return K?K.match(/^(\s*)/)[0].length:0;if(G.tagName)return g.multilineTagIndentPastTag!==!1?G.tagStart+G.tagName.length+2:G.tagStart+p*(g.multilineTagIndentFactor||1);if(g.alignCDATA&&/<!\[CDATA\[/.test(ee))return 0;var $=ee&&/^<(\/)?([\w_:\.-]*)/.exec(ee);if($&&$[1])for(;Z;)if(Z.tagName==$[2]){Z=Z.prev;break}else if(g.implicitlyClosed.hasOwnProperty(Z.tagName))Z=Z.prev;else break;else if($)for(;Z;){var oe=g.contextGrabbers[Z.tagName];if(oe&&oe.hasOwnProperty($[2]))Z=Z.prev;else break}for(;Z&&Z.prev&&!Z.startOfLine;)Z=Z.prev;return Z?Z.indent+p:G.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:g.htmlMode?"html":"xml",helperType:g.htmlMode?"html":"xml",skipAttribute:function(G){G.state==P&&(G.state=D)},xmlCurrentTag:function(G){return G.tagName?{name:G.tagName,close:G.type=="closeTag"}:null},xmlCurrentContext:function(G){for(var ee=[],K=G.context;K;K=K.prev)K.tagName&&ee.push(K.tagName);return ee.reverse()}}}),he.defineMIME("text/xml","xml"),he.defineMIME("application/xml","xml"),he.mimeModes.hasOwnProperty("text/html")||he.defineMIME("text/html",{name:"xml",htmlMode:!0})})},19575:function(It,Ue,Q){var he,fe;(function(i,M){It.exports=M(i)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof Q.g!="undefined"?Q.g:this,function(i){"use strict";i=i||{};var M=i.Base64,E="2.6.4",p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",g=function(K){for(var Z={},$=0,oe=K.length;$<oe;$++)Z[K.charAt($)]=$;return Z}(p),l=String.fromCharCode,h=function(K){if(K.length<2){var Z=K.charCodeAt(0);return Z<128?K:Z<2048?l(192|Z>>>6)+l(128|Z&63):l(224|Z>>>12&15)+l(128|Z>>>6&63)+l(128|Z&63)}else{var Z=65536+(K.charCodeAt(0)-55296)*1024+(K.charCodeAt(1)-56320);return l(240|Z>>>18&7)+l(128|Z>>>12&63)+l(128|Z>>>6&63)+l(128|Z&63)}},v=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,d=function(K){return K.replace(v,h)},o=function(K){var Z=[0,2,1][K.length%3],$=K.charCodeAt(0)<<16|(K.length>1?K.charCodeAt(1):0)<<8|(K.length>2?K.charCodeAt(2):0),oe=[p.charAt($>>>18),p.charAt($>>>12&63),Z>=2?"=":p.charAt($>>>6&63),Z>=1?"=":p.charAt($&63)];return oe.join("")},s=i.btoa&&typeof i.btoa=="function"?function(K){return i.btoa(K)}:function(K){if(K.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return K.replace(/[\s\S]{1,3}/g,o)},u=function(K){return s(d(String(K)))},m=function(K){return K.replace(/[+\/]/g,function(Z){return Z=="+"?"-":"_"}).replace(/=/g,"")},y=function(K,Z){return Z?m(u(K)):u(K)},_=function(K){return y(K,!0)},x;i.Uint8Array&&(x=function(K,Z){for(var $="",oe=0,ae=K.length;oe<ae;oe+=3){var ye=K[oe],Y=K[oe+1],le=K[oe+2],xe=ye<<16|Y<<8|le;$+=p.charAt(xe>>>18)+p.charAt(xe>>>12&63)+(typeof Y!="undefined"?p.charAt(xe>>>6&63):"=")+(typeof le!="undefined"?p.charAt(xe&63):"=")}return Z?m($):$});var S=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,w=function(K){switch(K.length){case 4:var Z=(7&K.charCodeAt(0))<<18|(63&K.charCodeAt(1))<<12|(63&K.charCodeAt(2))<<6|63&K.charCodeAt(3),$=Z-65536;return l(($>>>10)+55296)+l(($&1023)+56320);case 3:return l((15&K.charCodeAt(0))<<12|(63&K.charCodeAt(1))<<6|63&K.charCodeAt(2));default:return l((31&K.charCodeAt(0))<<6|63&K.charCodeAt(1))}},A=function(K){return K.replace(S,w)},H=function(K){var Z=K.length,$=Z%4,oe=(Z>0?g[K.charAt(0)]<<18:0)|(Z>1?g[K.charAt(1)]<<12:0)|(Z>2?g[K.charAt(2)]<<6:0)|(Z>3?g[K.charAt(3)]:0),ae=[l(oe>>>16),l(oe>>>8&255),l(oe&255)];return ae.length-=[0,0,2,1][$],ae.join("")},R=i.atob&&typeof i.atob=="function"?function(K){return i.atob(K)}:function(K){return K.replace(/\S{1,4}/g,H)},F=function(K){return R(String(K).replace(/[^A-Za-z0-9\+\/]/g,""))},D=function(K){return A(R(K))},B=function(K){return String(K).replace(/[-_]/g,function(Z){return Z=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},P=function(K){return D(B(K))},U;i.Uint8Array&&(U=function(K){return Uint8Array.from(F(B(K)),function(Z){return Z.charCodeAt(0)})});var G=function(){var K=i.Base64;return i.Base64=M,K};if(i.Base64={VERSION:E,atob:F,btoa:s,fromBase64:P,toBase64:y,utob:d,encode:y,encodeURI:_,btou:A,decode:P,noConflict:G,fromUint8Array:x,toUint8Array:U},typeof Object.defineProperty=="function"){var ee=function(K){return{value:K,enumerable:!1,writable:!0,configurable:!0}};i.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",ee(function(){return P(this)})),Object.defineProperty(String.prototype,"toBase64",ee(function(K){return y(this,K)})),Object.defineProperty(String.prototype,"toBase64URI",ee(function(){return y(this,!0)}))}}return i.Meteor&&(Base64=i.Base64),It.exports?It.exports.Base64=i.Base64:(he=[],fe=function(){return i.Base64}.apply(Ue,he),fe!==void 0&&(It.exports=fe)),{Base64:i.Base64}})},15979:function(It,Ue,Q){"use strict";Q.d(Ue,{hP:function(){return ne}});var he=function(te,T){return(he=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(I,re){I.__proto__=re}||function(I,re){for(var q in re)Object.prototype.hasOwnProperty.call(re,q)&&(I[q]=re[q])})(te,T)};function fe(te,T){function I(){this.constructor=te}he(te,T),te.prototype=T===null?Object.create(T):(I.prototype=T.prototype,new I)}function i(te,T,I,re){return new(I||(I=Promise))(function(q,z){function W(ge){try{se(re.next(ge))}catch(Me){z(Me)}}function V(ge){try{se(re.throw(ge))}catch(Me){z(Me)}}function se(ge){var Me;ge.done?q(ge.value):(Me=ge.value,Me instanceof I?Me:new I(function(Fe){Fe(Me)})).then(W,V)}se((re=re.apply(te,T||[])).next())})}function M(te,T){var I,re,q,z,W={label:0,sent:function(){if(1&q[0])throw q[1];return q[1]},trys:[],ops:[]};return z={next:V(0),throw:V(1),return:V(2)},typeof Symbol=="function"&&(z[Symbol.iterator]=function(){return this}),z;function V(se){return function(ge){return function(Me){if(I)throw new TypeError("Generator is already executing.");for(;W;)try{if(I=1,re&&(q=2&Me[0]?re.return:Me[0]?re.throw||((q=re.return)&&q.call(re),0):re.next)&&!(q=q.call(re,Me[1])).done)return q;switch(re=0,q&&(Me=[2&Me[0],q.value]),Me[0]){case 0:case 1:q=Me;break;case 4:return W.label++,{value:Me[1],done:!1};case 5:W.label++,re=Me[1],Me=[0];continue;case 7:Me=W.ops.pop(),W.trys.pop();continue;default:if(q=W.trys,!((q=q.length>0&&q[q.length-1])||Me[0]!==6&&Me[0]!==2)){W=0;continue}if(Me[0]===3&&(!q||Me[1]>q[0]&&Me[1]<q[3])){W.label=Me[1];break}if(Me[0]===6&&W.label<q[1]){W.label=q[1],q=Me;break}if(q&&W.label<q[2]){W.label=q[2],W.ops.push(Me);break}q[2]&&W.ops.pop(),W.trys.pop();continue}Me=T.call(te,W)}catch(Fe){Me=[6,Fe],re=0}finally{I=q=0}if(5&Me[0])throw Me[1];return{value:Me[0]?Me[1]:void 0,done:!0}}([se,ge])}}}function E(){for(var te=0,T=0,I=arguments.length;T<I;T++)te+=arguments[T].length;var re=Array(te),q=0;for(T=0;T<I;T++)for(var z=arguments[T],W=0,V=z.length;W<V;W++,q++)re[q]=z[W];return re}var p=function(){function te(){}return te.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},te.setAttributes=function(T,I){for(var re=0,q=I;re<q.length;re++){var z=q[re],W=z[0],V=z[1];T.setAttribute(W,V)}},te.createRect=function(T,I,re){var q=document.createElementNS("http://www.w3.org/2000/svg","rect");return q.setAttribute("width",T.toString()),q.setAttribute("height",I.toString()),re&&te.setAttributes(q,re),q},te.createLine=function(T,I,re,q,z){var W=document.createElementNS("http://www.w3.org/2000/svg","line");return W.setAttribute("x1",T.toString()),W.setAttribute("y1",I.toString()),W.setAttribute("x2",re.toString()),W.setAttribute("y2",q.toString()),z&&te.setAttributes(W,z),W},te.createPolygon=function(T,I){var re=document.createElementNS("http://www.w3.org/2000/svg","polygon");return re.setAttribute("points",T),I&&te.setAttributes(re,I),re},te.createCircle=function(T,I){var re=document.createElementNS("http://www.w3.org/2000/svg","circle");return re.setAttribute("cx",(T/2).toString()),re.setAttribute("cy",(T/2).toString()),re.setAttribute("r",T.toString()),I&&te.setAttributes(re,I),re},te.createEllipse=function(T,I,re){var q=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return q.setAttribute("cx",(T/2).toString()),q.setAttribute("cy",(I/2).toString()),q.setAttribute("rx",(T/2).toString()),q.setAttribute("ry",(I/2).toString()),re&&te.setAttributes(q,re),q},te.createGroup=function(T){var I=document.createElementNS("http://www.w3.org/2000/svg","g");return T&&te.setAttributes(I,T),I},te.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},te.createMarker=function(T,I,re,q,z,W,V){var se=document.createElementNS("http://www.w3.org/2000/svg","marker");return te.setAttributes(se,[["id",T],["orient",I],["markerWidth",re.toString()],["markerHeight",q.toString()],["refX",z.toString()],["refY",W.toString()]]),se.appendChild(V),se},te.createText=function(T){var I=document.createElementNS("http://www.w3.org/2000/svg","text");return I.setAttribute("x","0"),I.setAttribute("y","0"),T&&te.setAttributes(I,T),I},te.createTSpan=function(T,I){var re=document.createElementNS("http://www.w3.org/2000/svg","tspan");return re.textContent=T,I&&te.setAttributes(re,I),re},te.createImage=function(T){var I=document.createElementNS("http://www.w3.org/2000/svg","image");return T&&te.setAttributes(I,T),I},te.createPoint=function(T,I){var re=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return re.x=T,re.y=I,re},te.createPath=function(T,I){var re=document.createElementNS("http://www.w3.org/2000/svg","path");return re.setAttribute("d",T),I&&te.setAttributes(re,I),re},te}(),g=function(){function te(){}return te.addKey=function(T){te.key=T},Object.defineProperty(te,"isLicensed",{get:function(){return!!te.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(te.key)},enumerable:!1,configurable:!0}),te}(),l=function(){function te(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return te.prototype.rasterize=function(T,I,re){var q=this;return new Promise(function(z){var W=re!==void 0?re:document.createElement("canvas");T===null&&(q.markersOnly=!0,q.naturalSize=!1);var V=document.createElementNS("http://www.w3.org/2000/svg","svg");V.setAttribute("xmlns","http://www.w3.org/2000/svg"),V.setAttribute("width",I.width.baseVal.valueAsString),V.setAttribute("height",I.height.baseVal.valueAsString),V.setAttribute("viewBox","0 0 "+I.viewBox.baseVal.width.toString()+" "+I.viewBox.baseVal.height.toString()),V.innerHTML=I.innerHTML,q.naturalSize===!0?(V.width.baseVal.value=T.naturalWidth,V.height.baseVal.value=T.naturalHeight):q.width!==void 0&&q.height!==void 0&&(V.width.baseVal.value=q.width,V.height.baseVal.value=q.height),W.width=V.width.baseVal.value,W.height=V.height.baseVal.value;var se=V.outerHTML,ge=W.getContext("2d");q.markersOnly!==!0&&ge.drawImage(T,0,0,W.width,W.height);var Me=window.URL,Fe=new Image(W.width,W.height);Fe.setAttribute("crossOrigin","anonymous");var Re=new Blob([se],{type:"image/svg+xml"}),$e=Me.createObjectURL(Re);Fe.onload=function(){ge.drawImage(Fe,0,0),Me.revokeObjectURL($e);var lt=W.toDataURL(q.imageType,q.imageQuality);z(lt)},Fe.src=$e})},te}(),h=function(){},v=function(){function te(T){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+T+"_"}return Object.defineProperty(te.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),te.prototype.addClass=function(T){return this.styleSheet===void 0&&this.addStyleSheet(),T.name=""+this.classNamePrefix+T.localName,this.classes.push(T),this.styleSheet.sheet.insertRule("."+T.name+" {"+T.style+"}",this.styleSheet.sheet.cssRules.length),T},te.prototype.addRule=function(T){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(T),this.styleSheet.sheet.insertRule(T.selector+" {"+T.style+"}",this.styleSheet.sheet.cssRules.length)},te.prototype.addStyleSheet=function(){var T;this.styleSheet=document.createElement("style"),((T=this.styleSheetRoot)!==null&&T!==void 0?T:document.head).appendChild(this.styleSheet),this.addRule(new d("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new d("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new d("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new o("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new o("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},te.prototype.removeStyleSheet=function(){var T;this.styleSheet&&(((T=this.styleSheetRoot)!==null&&T!==void 0?T:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},te}(),d=function(te,T){this.selector=te,this.style=T},o=function(te,T){this.localName=te,this.style=T},s=function(){function te(T,I,re,q,z){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=T,this.displayMode=I,this.markerItems=re,this.uiStyleSettings=q,this.styles=z,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return te.prototype.show=function(T){var I=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=T,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var re=document.createElement("div");re.className=this.toolbarBlockStyleClass.name,re.style.whiteSpace="nowrap",this.uiContainer.appendChild(re),this.addActionButton(re,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(re,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(re,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(re,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(re,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(re,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(re,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(re,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(z){var W=document.createElement("div");W.className=""+I.toolbarButtonStyleClass.name,W.setAttribute("data-type-name",z.typeName),W.innerHTML=z.icon,W.addEventListener("click",function(){I.markerToolbarButtonClicked(W,z)}),I.buttons.push(W),I.markerButtons.push(W)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var q=document.createElement("div");q.className=this.toolbarBlockStyleClass.name,q.style.whiteSpace="nowrap",q.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(q),this.addActionButton(q,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(q,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},te.prototype.addButtonClickListener=function(T){this.buttonClickListeners.push(T)},te.prototype.removeButtonClickListener=function(T){this.buttonClickListeners.indexOf(T)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(T),1)},te.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},te.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var T=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var I=0;I<this.markerButtons.length;I++)I<T||I===T&&this.markerButtons.length-1===T?this.markerButtonBlock.appendChild(this.markerButtons[I]):(I===T&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[I]))}},te.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},te.prototype.resetButtonStyles=function(){var T=this;this.buttons.forEach(function(I){I.className=I.className.replace(T.uiStyleSettings.toolbarButtonStyleColorsClassName?T.uiStyleSettings.toolbarButtonStyleColorsClassName:T.toolbarButtonStyleColorsClass.name,"").trim(),I.className=I.className.replace(T.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?T.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:T.toolbarActiveButtonStyleColorsClass.name,"").trim(),I.className+=" "+(T.uiStyleSettings.toolbarButtonStyleColorsClassName?T.uiStyleSettings.toolbarButtonStyleColorsClassName:T.toolbarButtonStyleColorsClass.name)})},te.prototype.addActionButton=function(T,I,re){var q=this,z=document.createElement("div");switch(z.className=""+this.toolbarButtonStyleClass.name,z.innerHTML=I,z.setAttribute("data-action",re),z.addEventListener("click",function(){q.actionToolbarButtonClicked(z,re)}),re){case"select":z.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":z.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":z.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":z.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":z.style.fill=this.uiStyleSettings.closeButtonColor}T.appendChild(z),this.buttons.push(z)},te.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new o("toolbar",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.uiStyleSettings.toolbarHeight+`px;
box-sizing: content-box;
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new o("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new o("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new o("toolbar-overflow-block",`
position: absolute;
top: `+this.uiStyleSettings.toolbarHeight+`px;
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
z-index: 10;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new o("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var T=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new o("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*T)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*T)+`px;
padding: `+T+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new o("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new o("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new d("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new d("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},te.prototype.markerToolbarButtonClicked=function(T,I){this.setActiveButton(T),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(re){return re("marker",I)}),this.markerButtonOverflowBlock.style.display="none"},te.prototype.actionToolbarButtonClicked=function(T,I){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(re){return re("action",I)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},te.prototype.setActiveButton=function(T){this.resetButtonStyles(),T.className=T.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),T.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},te.prototype.setActiveMarkerButton=function(T){var I=this.markerButtons.find(function(re){return re.getAttribute("data-type-name")===T});I&&this.setActiveButton(I)},te.prototype.setCurrentMarker=function(T){var I=this;this.currentMarker=T,this.buttons.filter(function(re){return/delete|notes/.test(re.getAttribute("data-action"))}).forEach(function(re){I.currentMarker===void 0?(re.style.fillOpacity="0.4",re.style.pointerEvents="none"):(re.style.fillOpacity="1",re.style.pointerEvents="all")})},te}(),u=function(){function te(T,I,re,q){this.panels=[],this.panelButtons=[],this.markerjsContainer=T,this.displayMode=I,this.uiStyleSettings=re,this.styles=q,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return te.prototype.addStyles=function(){var T;this.toolboxStyleClass=this.styles.addClass(new o("toolbox",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
font-family: sans-serif;
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
box-sizing: content-box;
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolboxStyleColorsClass=this.styles.addClass(new o("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var I=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new o("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new o("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new o("toolbox-panel-row",`
display: flex;
`+(this.displayMode==="inline"?"position: absolute;":"")+`
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
cursor: default;
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
`+(this.displayMode==="inline"?"width: 100%;":"")+`
box-sizing: content-box;
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new o("toolbox-panel-row_colors",`
background-color: `+((T=this.uiStyleSettings.toolboxBackgroundColor)!==null&&T!==void 0?T:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new o("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*I)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*I)+`px;
padding: `+I+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new o("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new o("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new d("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new d("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},te.prototype.show=function(T){var I;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=T,this.uiContainer.className=this.toolboxStyleClass.name+" "+((I=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&I!==void 0?I:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},te.prototype.setPanelButtons=function(T){var I,re,q=this;this.panels=T,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((I=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&I!==void 0?I:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((re=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&re!==void 0?re:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(z){var W;z.uiStyleSettings=q.uiStyleSettings;var V=document.createElement("div");V.className=q.toolboxButtonStyleClass.name+" "+((W=q.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&W!==void 0?W:q.toolboxButtonStyleColorsClass.name),V.innerHTML=z.icon,V.title=z.title,V.addEventListener("click",function(){q.panelButtonClick(z)}),q.panelButtons.push(V),q.buttonRow.appendChild(V)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},te.prototype.panelButtonClick=function(T){var I=this,re=-1;if(T!==this.activePanel){re=this.panels.indexOf(T),this.panelRow.innerHTML="";var q=T.getUi();q.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(q),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=T}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){I.displayMode==="inline"?I.panelRow.style.display="none":I.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(z,W){var V,se;z.className=I.toolboxButtonStyleClass.name+" "+(W===re?""+((V=I.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&V!==void 0?V:I.toolboxActiveButtonStyleColorsClass.name):""+((se=I.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&se!==void 0?se:I.toolboxButtonStyleColorsClass.name))})},te}(),m=function(te,T){this.title=te,this.icon=T},y=function(te){function T(I,re,q,z){var W=te.call(this,I,z||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return W.colors=[],W.addTransparent=!1,W.colorBoxes=[],W.colors=re,W.currentColor=q,W.setCurrentColor=W.setCurrentColor.bind(W),W.getColorBox=W.getColorBox.bind(W),W}return fe(T,te),T.prototype.getUi=function(){var I=this,re=document.createElement("div");return re.style.overflow="hidden",re.style.whiteSpace="nowrap",this.colors.forEach(function(q){var z=I.getColorBox(q);re.appendChild(z),I.colorBoxes.push(z)}),re},T.prototype.getColorBox=function(I){var re=this,q=this.uiStyleSettings.toolbarHeight/4,z=this.uiStyleSettings.toolbarHeight-q,W=document.createElement("div");W.style.display="inline-block",W.style.boxSizing="content-box",W.style.width=z-2+"px",W.style.height=z-2+"px",W.style.padding="1px",W.style.marginRight="2px",W.style.marginBottom="2px",W.style.borderWidth="2px",W.style.borderStyle="solid",W.style.borderRadius=(z+2)/2+"px",W.style.borderColor=I===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",W.addEventListener("click",function(){re.setCurrentColor(I,W)});var V=document.createElement("div");return V.style.display="inline-block",V.style.width=z-2+"px",V.style.height=z-2+"px",V.style.backgroundColor=I,V.style.borderRadius=z/2+"px",I==="transparent"&&(V.style.fill=this.uiStyleSettings.toolboxAccentColor,V.innerHTML=`<svg viewBox="0 0 24 24">
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
</svg>`),W.appendChild(V),W},T.prototype.setCurrentColor=function(I,re){var q=this;this.currentColor=I,this.colorBoxes.forEach(function(z){z.style.borderColor=z===re?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(I)},T}(m),_=function(){function te(T,I,re){this._state="new",this._isSelected=!1,this._container=T,this._overlayContainer=I,this.globalSettings=re,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(te.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),te.prototype.ownsTarget=function(T){return!1},Object.defineProperty(te.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),te.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},te.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},te.prototype.pointerDown=function(T,I){},te.prototype.dblClick=function(T,I){},te.prototype.manipulate=function(T){},te.prototype.pointerUp=function(T){this.stateChanged()},te.prototype.dispose=function(){},te.prototype.addMarkerVisualToContainer=function(T){this.container.childNodes.length>0?this.container.insertBefore(T,this.container.childNodes[0]):this.container.appendChild(T)},te.prototype.getState=function(){return{typeName:te.typeName,state:this.state,notes:this.notes}},te.prototype.restoreState=function(T){this._state=T.state,this.notes=T.notes},te.prototype.scale=function(T,I){},te.prototype.colorChanged=function(T){this.onColorChanged&&this.onColorChanged(T),this.stateChanged()},te.prototype.fillColorChanged=function(T){this.onFillColorChanged&&this.onFillColorChanged(T),this.stateChanged()},te.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var T=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),T.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(T)&&this.onStateChanged(this)}},te.typeName="MarkerBase",te}(),x=function(){function te(){this.findGripByVisual=this.findGripByVisual.bind(this)}return te.prototype.findGripByVisual=function(T){return this.topLeft.ownsTarget(T)?this.topLeft:this.topCenter.ownsTarget(T)?this.topCenter:this.topRight.ownsTarget(T)?this.topRight:this.centerLeft.ownsTarget(T)?this.centerLeft:this.centerRight.ownsTarget(T)?this.centerRight:this.bottomLeft.ownsTarget(T)?this.bottomLeft:this.bottomCenter.ownsTarget(T)?this.bottomCenter:this.bottomRight.ownsTarget(T)?this.bottomRight:void 0},te}(),S=function(){function te(){this.GRIP_SIZE=10,this.visual=p.createGroup(),this.visual.appendChild(p.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(p.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return te.prototype.ownsTarget=function(T){return T===this.visual||T===this.visual.childNodes[0]||T===this.visual.childNodes[1]},te}(),w=function(){function te(){}return te.toITransformMatrix=function(T){return{a:T.a,b:T.b,c:T.c,d:T.d,e:T.e,f:T.f}},te.toSVGMatrix=function(T,I){return T.a=I.a,T.b=I.b,T.c=I.c,T.d=I.d,T.e=I.e,T.f=I.f,T},te}(),A=function(te){function T(I,re,q){var z=te.call(this,I,re,q)||this;return z.left=0,z.top=0,z.width=0,z.height=0,z.defaultSize={x:50,y:20},z.offsetX=0,z.offsetY=0,z.rotationAngle=0,z.CB_DISTANCE=10,z._suppressMarkerCreateEvent=!1,z.container.transform.baseVal.appendItem(p.createTransform()),z.setupControlBox(),z}return fe(T,te),Object.defineProperty(T.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"visual",{get:function(){return this._visual},set:function(I){this._visual=I;var re=p.createTransform();this._visual.transform.baseVal.appendItem(re)},enumerable:!1,configurable:!0}),T.prototype.ownsTarget=function(I){return!!te.prototype.ownsTarget.call(this,I)||!!(this.controlGrips.findGripByVisual(I)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(I))},T.prototype.pointerDown=function(I,re){te.prototype.pointerDown.call(this,I,re),this.state==="new"&&(this.left=I.x,this.top=I.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var q=this.unrotatePoint(I);if(this.manipulationStartX=q.x,this.manipulationStartY=q.y,this.offsetX=q.x-this.left,this.offsetY=q.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(re),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(re)){this.activeGrip=this.rotatorGrip;var z=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=z.x-this.width/2,this.top=z.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var W=this.container.transform.baseVal.getItem(0);W.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(W,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},T.prototype.pointerUp=function(I){var re=this.state;te.prototype.pointerUp.call(this,I),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(I),this._state="select",re==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},T.prototype.moveVisual=function(I){this.visual.style.transform="translate("+I.x+"px, "+I.y+"px)"},T.prototype.manipulate=function(I){var re=this.unrotatePoint(I);this.state==="creating"?this.resize(I):this.state==="move"?(this.left=this.manipulationStartLeft+(re.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(re.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(re):this.state==="rotate"&&this.rotate(I)},T.prototype.resize=function(I){var re=this.manipulationStartLeft,q=this.manipulationStartWidth,z=this.manipulationStartTop,W=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:re=this.manipulationStartLeft+I.x-this.manipulationStartX,q=this.manipulationStartWidth+this.manipulationStartLeft-re;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:q=this.manipulationStartWidth+I.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:z=this.manipulationStartTop+I.y-this.manipulationStartY,W=this.manipulationStartHeight+this.manipulationStartTop-z;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:W=this.manipulationStartHeight+I.y-this.manipulationStartY}q>=0?(this.left=re,this.width=q):(this.left=re+q,this.width=-q),W>=0?(this.top=z,this.height=W):(this.top=z+W,this.height=-W),this.setSize()},T.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},T.prototype.rotate=function(I){if(Math.abs(I.x-this.centerX)>.1){var re=Math.sign(I.x-this.centerX);this.rotationAngle=180*Math.atan((I.y-this.centerY)/(I.x-this.centerX))/Math.PI+90*re,this.applyRotation()}},T.prototype.applyRotation=function(){var I=this.container.transform.baseVal.getItem(0);I.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(I,0)},T.prototype.rotatePoint=function(I){if(this.rotationAngle===0)return I;var re=this.container.getCTM(),q=p.createPoint(I.x,I.y);return{x:(q=q.matrixTransform(re)).x,y:q.y}},T.prototype.unrotatePoint=function(I){if(this.rotationAngle===0)return I;var re=this.container.getCTM();re=re.inverse();var q=p.createPoint(I.x,I.y);return{x:(q=q.matrixTransform(re)).x,y:q.y}},T.prototype.select=function(){te.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},T.prototype.deselect=function(){te.prototype.deselect.call(this),this.controlBox.style.display="none"},T.prototype.setupControlBox=function(){this.controlBox=p.createGroup();var I=p.createTransform();I.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(I),this.container.appendChild(this.controlBox),this.controlRect=p.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=p.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new x,this.addControlGrips(),this.controlBox.style.display="none"},T.prototype.adjustControlBox=function(){var I=this.controlBox.transform.baseVal.getItem(0);I.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(I,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},T.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},T.prototype.createGrip=function(){var I=new S;return I.visual.transform.baseVal.appendItem(p.createTransform()),this.controlBox.appendChild(I.visual),I},T.prototype.positionGrips=function(){var I=this.controlGrips.topLeft.GRIP_SIZE,re=-I/2,q=re,z=(this.width+this.CB_DISTANCE)/2-I/2,W=(this.height+this.CB_DISTANCE)/2-I/2,V=this.height+this.CB_DISTANCE-I/2,se=this.width+this.CB_DISTANCE-I/2;this.positionGrip(this.controlGrips.topLeft.visual,re,q),this.positionGrip(this.controlGrips.topCenter.visual,z,q),this.positionGrip(this.controlGrips.topRight.visual,se,q),this.positionGrip(this.controlGrips.centerLeft.visual,re,W),this.positionGrip(this.controlGrips.centerRight.visual,se,W),this.positionGrip(this.controlGrips.bottomLeft.visual,re,V),this.positionGrip(this.controlGrips.bottomCenter.visual,z,V),this.positionGrip(this.controlGrips.bottomRight.visual,se,V),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,z,q-3*this.CB_DISTANCE)},T.prototype.positionGrip=function(I,re,q){var z=I.transform.baseVal.getItem(0);z.setTranslate(re,q),I.transform.baseVal.replaceItem(z,0)},T.prototype.hideControlBox=function(){this.controlBox.style.display="none"},T.prototype.showControlBox=function(){this.controlBox.style.display=""},T.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:w.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:w.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},te.prototype.getState.call(this))},T.prototype.restoreState=function(I){te.prototype.restoreState.call(this,I);var re=I;this.left=re.left,this.top=re.top,this.width=re.width,this.height=re.height,this.rotationAngle=re.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(w.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,re.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(w.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,re.containerTransformMatrix))},T.prototype.scale=function(I,re){te.prototype.scale.call(this,I,re);var q=this.rotatePoint({x:this.left,y:this.top}),z=this.unrotatePoint({x:q.x*I,y:q.y*re});this.left=z.x,this.top=z.y,this.width=this.width*I,this.height=this.height*re,this.adjustControlBox()},T}(_),H=function(te){function T(I,re,q){var z=te.call(this,I,re,q)||this;return z.fillColor="transparent",z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.opacity=1,z.setStrokeColor=z.setStrokeColor.bind(z),z.setFillColor=z.setFillColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.createVisual=z.createVisual.bind(z),z}return fe(T,te),T.prototype.ownsTarget=function(I){return!(!te.prototype.ownsTarget.call(this,I)&&I!==this.visual)},T.prototype.createVisual=function(){this.visual=p.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},T.prototype.pointerDown=function(I,re){te.prototype.pointerDown.call(this,I,re),this.state==="new"&&(this.createVisual(),this.moveVisual(I),this._state="creating")},T.prototype.manipulate=function(I){te.prototype.manipulate.call(this,I)},T.prototype.resize=function(I){te.prototype.resize.call(this,I),this.setSize()},T.prototype.setSize=function(){te.prototype.setSize.call(this),p.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},T.prototype.pointerUp=function(I){te.prototype.pointerUp.call(this,I),this.setSize()},T.prototype.setStrokeColor=function(I){this.strokeColor=I,this.visual&&p.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(I),this.stateChanged()},T.prototype.setFillColor=function(I){this.fillColor=I,this.visual&&p.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},T.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.visual&&p.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},T.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.visual&&p.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},T.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},te.prototype.getState.call(this))},T.prototype.restoreState=function(I){var re=I;this.fillColor=re.fillColor,this.strokeColor=re.strokeColor,this.strokeWidth=re.strokeWidth,this.strokeDasharray=re.strokeDasharray,this.opacity=re.opacity,this.createVisual(),te.prototype.restoreState.call(this,I),this.setSize()},T.prototype.scale=function(I,re){te.prototype.scale.call(this,I,re),this.setSize()},T.title="Rectangle marker",T}(A),R=function(te){function T(I,re,q,z){var W=te.call(this,I,z||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return W.widths=[],W.widthBoxes=[],W.widths=re,W.currentWidth=q,W.setCurrentWidth=W.setCurrentWidth.bind(W),W}return fe(T,te),T.prototype.getUi=function(){var I=this,re=document.createElement("div");return re.style.display="flex",re.style.overflow="hidden",re.style.flexGrow="2",this.widths.forEach(function(q){var z=document.createElement("div");z.style.display="flex",z.style.flexGrow="2",z.style.alignItems="center",z.style.justifyContent="space-between",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.borderColor=q===I.currentWidth?I.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){I.setCurrentWidth(q,z)}),re.appendChild(z);var W=document.createElement("div");W.innerText=q.toString(),W.style.marginRight="5px",z.appendChild(W);var V=document.createElement("div");V.style.minHeight="20px",V.style.flexGrow="2",V.style.display="flex",V.style.alignItems="center";var se=document.createElement("hr");se.style.minWidth="20px",se.style.border="0px",se.style.borderTop=q+"px solid "+I.uiStyleSettings.toolboxColor,se.style.flexGrow="2",V.appendChild(se),z.appendChild(V),I.widthBoxes.push(z)}),re},T.prototype.setCurrentWidth=function(I,re){var q=this;this.currentWidth=I,this.widthBoxes.forEach(function(z){z.style.borderColor=z===re?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},T}(m),F=function(te){function T(I,re,q,z){var W=te.call(this,I,z||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return W.styles=[],W.styleBoxes=[],W.styles=re,W.currentStyle=q,W.setCurrentStyle=W.setCurrentStyle.bind(W),W}return fe(T,te),T.prototype.getUi=function(){var I=this,re=document.createElement("div");return re.style.display="flex",re.style.overflow="hidden",re.style.flexGrow="2",this.styles.forEach(function(q){var z=document.createElement("div");z.style.display="flex",z.style.alignItems="center",z.style.justifyContent="space-between",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.overflow="hidden",z.style.maxWidth=100/I.styles.length-5+"%",z.style.borderColor=q===I.currentStyle?I.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){I.setCurrentStyle(q,z)}),re.appendChild(z);var W=document.createElement("div");W.style.minHeight="20px",W.style.flexGrow="2",W.style.overflow="hidden";var V=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+I.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(q!==""?'stroke-dasharray="'+q+'"':"")+` />
</svg>`;W.innerHTML=V,z.appendChild(W),I.styleBoxes.push(z)}),re},T.prototype.setCurrentStyle=function(I,re){var q=this;this.currentStyle=I,this.styleBoxes.forEach(function(z){z.style.borderColor=z===re?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},T}(m),D=function(te){function T(I,re,q){var z=te.call(this,I,re,q)||this;return z.strokeColor=q.defaultColor,z.strokeWidth=q.defaultStrokeWidth,z.strokeDasharray=q.defaultStrokeDasharray,z.strokePanel=new y("Line color",q.defaultColorSet,q.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new R("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new F("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return fe(T,te),Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var I=te.prototype.getState.call(this);return I.typeName=T.typeName,I},T.typeName="FrameMarker",T.title="Frame marker",T.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',T}(H),B=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1,this.defaultCaptionFontSize="1rem",this.defaultCaptionText="Text"},P=function(te){function T(I,re,q){var z=te.call(this,I,re,q)||this;return z.x1=0,z.y1=0,z.x2=0,z.y2=0,z.defaultLength=50,z.manipulationStartX=0,z.manipulationStartY=0,z.manipulationStartX1=0,z.manipulationStartY1=0,z.manipulationStartX2=0,z.manipulationStartY2=0,z.setupControlBox(),z}return fe(T,te),T.prototype.ownsTarget=function(I){return!!te.prototype.ownsTarget.call(this,I)||!(!this.grip1.ownsTarget(I)&&!this.grip2.ownsTarget(I))},T.prototype.pointerDown=function(I,re){te.prototype.pointerDown.call(this,I,re),this.manipulationStartX=I.x,this.manipulationStartY=I.y,this.state==="new"&&(this.x1=I.x,this.y1=I.y,this.x2=I.x,this.y2=I.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(re)?this.activeGrip=this.grip1:this.grip2.ownsTarget(re)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},T.prototype.pointerUp=function(I){var re=this.state;te.prototype.pointerUp.call(this,I),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(I),this._state="select",re==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},T.prototype.adjustVisual=function(){},T.prototype.manipulate=function(I){this.state==="creating"?this.resize(I):this.state==="move"?(this.x1=this.manipulationStartX1+I.x-this.manipulationStartX,this.y1=this.manipulationStartY1+I.y-this.manipulationStartY,this.x2=this.manipulationStartX2+I.x-this.manipulationStartX,this.y2=this.manipulationStartY2+I.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(I)},T.prototype.resize=function(I){switch(this.activeGrip){case this.grip1:this.x1=I.x,this.y1=I.y;break;case this.grip2:case void 0:this.x2=I.x,this.y2=I.y}this.adjustVisual(),this.adjustControlBox()},T.prototype.select=function(){te.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},T.prototype.deselect=function(){te.prototype.deselect.call(this),this.controlBox.style.display="none"},T.prototype.setupControlBox=function(){this.controlBox=p.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},T.prototype.adjustControlBox=function(){this.positionGrips()},T.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},T.prototype.createGrip=function(){var I=new S;return I.visual.transform.baseVal.appendItem(p.createTransform()),this.controlBox.appendChild(I.visual),I},T.prototype.positionGrips=function(){var I=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-I/2,this.y1-I/2),this.positionGrip(this.grip2.visual,this.x2-I/2,this.y2-I/2)},T.prototype.positionGrip=function(I,re,q){var z=I.transform.baseVal.getItem(0);z.setTranslate(re,q),I.transform.baseVal.replaceItem(z,0)},T.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},te.prototype.getState.call(this))},T.prototype.restoreState=function(I){te.prototype.restoreState.call(this,I);var re=I;this.x1=re.x1,this.y1=re.y1,this.x2=re.x2,this.y2=re.y2},T.prototype.scale=function(I,re){te.prototype.scale.call(this,I,re),this.x1=this.x1*I,this.y1=this.y1*re,this.x2=this.x2*I,this.y2=this.y2*re,this.adjustVisual(),this.adjustControlBox()},T}(_),U=function(te){function T(I,re,q){var z=te.call(this,I,re,q)||this;return z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.setStrokeColor=z.setStrokeColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.strokeColor=q.defaultColor,z.strokeWidth=q.defaultStrokeWidth,z.strokeDasharray=q.defaultStrokeDasharray,z.strokePanel=new y("Line color",q.defaultColorSet,q.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new R("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new F("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return fe(T,te),T.prototype.ownsTarget=function(I){return!(!te.prototype.ownsTarget.call(this,I)&&I!==this.visual&&I!==this.selectorLine&&I!==this.visibleLine)},T.prototype.createVisual=function(){this.visual=p.createGroup(),this.selectorLine=p.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=p.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},T.prototype.pointerDown=function(I,re){te.prototype.pointerDown.call(this,I,re),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},T.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),p.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),p.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),p.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},T.prototype.setStrokeColor=function(I){this.strokeColor=I,this.adjustVisual(),this.colorChanged(I)},T.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.adjustVisual()},T.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.adjustVisual(),this.stateChanged()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var I=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},te.prototype.getState.call(this));return I.typeName=T.typeName,I},T.prototype.restoreState=function(I){te.prototype.restoreState.call(this,I);var re=I;this.strokeColor=re.strokeColor,this.strokeWidth=re.strokeWidth,this.strokeDasharray=re.strokeDasharray,this.createVisual(),this.adjustVisual()},T.typeName="LineMarker",T.title="Line marker",T.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',T}(P),G=function(te){function T(I,re,q,z){var W=te.call(this,I,z||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return W.fonts=[],W.fontBoxes=[],W.fonts=re,W.currentFont=q,W.setCurrentFont=W.setCurrentFont.bind(W),W}return fe(T,te),T.prototype.getUi=function(){var I=this,re=document.createElement("div");return re.style.overflow="hidden",re.style.flexGrow="2",this.fonts.forEach(function(q){var z=document.createElement("div");z.style.display="inline-block",z.style.alignItems="center",z.style.justifyContent="space-between",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.overflow="hidden",z.style.maxWidth=100/I.fonts.length-5+"%",z.style.borderColor=q===I.currentFont?I.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){I.setCurrentFont(q,z)}),re.appendChild(z);var W=document.createElement("div");W.style.display="flex",W.style.minHeight="20px",W.style.flexGrow="2",W.style.fontFamily=q,W.style.overflow="hidden";var V=document.createElement("div");V.style.whiteSpace="nowrap",V.style.overflow="hidden",V.style.textOverflow="ellipsis",V.innerHTML="The quick brown fox jumps over the lazy dog",W.appendChild(V),z.appendChild(W),I.fontBoxes.push(z)}),re},T.prototype.setCurrentFont=function(I,re){var q=this;this.currentFont=I,this.fontBoxes.forEach(function(z){z.style.borderColor=z===re?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},T}(m),ee=function(te){function T(I,re,q){var z=te.call(this,I,re,q)||this;return z.color="transparent",z.padding=5,z.DEFAULT_TEXT="\u8BF7\u8F93\u5165\u6587\u672C",z.text=z.DEFAULT_TEXT,z.isMoved=!1,z.color=q.defaultColor,z.fontFamily=q.defaultFontFamily,z.defaultSize={x:100,y:30},z.setColor=z.setColor.bind(z),z.setFont=z.setFont.bind(z),z.renderText=z.renderText.bind(z),z.sizeText=z.sizeText.bind(z),z.textEditDivClicked=z.textEditDivClicked.bind(z),z.showTextEditor=z.showTextEditor.bind(z),z.setSize=z.setSize.bind(z),z.positionTextEditor=z.positionTextEditor.bind(z),z.colorPanel=new y("Color",q.defaultColorSet,q.defaultColor),z.colorPanel.onColorChanged=z.setColor,z.fontFamilyPanel=new G("Font",q.defaultFontFamilies,q.defaultFontFamily),z.fontFamilyPanel.onFontChanged=z.setFont,z}return fe(T,te),T.prototype.ownsTarget=function(I){if(te.prototype.ownsTarget.call(this,I)||I===this.visual||I===this.textElement||I===this.bgRectangle)return!0;var re=!1;return this.textElement.childNodes.forEach(function(q){q===I&&(re=!0)}),re},T.prototype.createVisual=function(){this.visual=p.createGroup(),this.bgRectangle=p.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=p.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(p.createTransform()),this.textElement.transform.baseVal.appendItem(p.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},T.prototype.pointerDown=function(I,re){te.prototype.pointerDown.call(this,I,re),this.isMoved=!1,this.pointerDownPoint=I,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(I),this._state="creating")},T.prototype.renderText=function(){var I=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(re){I.textElement.appendChild(p.createTSpan(re.trim()===""?" ":re.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},T.prototype.getTextScale=function(){var I=this.textElement.getBBox(),re=1;if(I.width>0&&I.height>0){var q=(1*this.width-this.width*this.padding*2/100)/I.width,z=(1*this.height-this.height*this.padding*2/100)/I.height;re=Math.min(q,z)}return re},T.prototype.getTextPosition=function(I){var re=this.textElement.getBBox(),q=0,z=0;return re.width>0&&re.height>0&&(q=(this.width-re.width*I)/2,z=this.height/2-re.height*I/2),{x:q,y:z}},T.prototype.sizeText=function(){var I=this.textElement.getBBox(),re=this.getTextScale(),q=this.getTextPosition(re);q.y-=I.y*re,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+q.x+"px, "+q.y+"px) scale("+re+", "+re+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(q.x,q.y),this.textElement.transform.baseVal.getItem(1).setScale(re,re))},T.prototype.manipulate=function(I){te.prototype.manipulate.call(this,I),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(I.x-this.pointerDownPoint.x)>5||Math.abs(I.y-this.pointerDownPoint.y)>5)},T.prototype.resize=function(I){te.prototype.resize.call(this,I),this.isMoved=!0,this.setSize(),this.sizeText()},T.prototype.setSize=function(){te.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(p.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),p.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},T.prototype.pointerUp=function(I){var re=this.state;re==="creating"&&(this._suppressMarkerCreateEvent=!0),te.prototype.pointerUp.call(this,I),this.setSize(),(re==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},T.prototype.showTextEditor=function(){var I=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(re){re.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var re=Number.parseFloat(I.textEditor.style.fontSize);I.textEditor.clientWidth>=Number.parseInt(I.textEditor.style.maxWidth)&&re>.9;)re-=.1,I.textEditor.style.fontSize=Math.max(re,.9)+"em"}),this.textEditor.addEventListener("keyup",function(re){re.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(re){if(re.clipboardData){var q=re.clipboardData.getData("text"),z=window.getSelection();if(!z.rangeCount)return!1;z.deleteFromDocument(),z.getRangeAt(0).insertNode(document.createTextNode(q)),re.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){I.textEditDivClicked(I.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},T.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var I=this.getTextScale(),re=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),q=this.textElement.getBBox(),z={x:q.width*I,y:q.height*I};re.x-=z.x/2,re.y-=z.y/2,this.textEditor.style.top=re.y+"px",this.textEditor.style.left=re.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-re.x+"px",this.textEditor.style.fontSize=Math.max(16*I,12)+"px",this.textElement.style.display="none"}},T.prototype.textEditDivClicked=function(I){this.text=I.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},T.prototype.select=function(){te.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},T.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),te.prototype.deselect.call(this)},T.prototype.dblClick=function(I,re){te.prototype.dblClick.call(this,I,re),this.showTextEditor()},T.prototype.setColor=function(I){this.textElement&&p.setAttributes(this.textElement,[["fill",I]]),this.color=I,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(I)},T.prototype.setFont=function(I){this.textElement&&p.setAttributes(this.textElement,[["font-family",I]]),this.fontFamily=I,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},T.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},T.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var I=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},te.prototype.getState.call(this));return I.typeName=T.typeName,I},T.prototype.restoreState=function(I){var re=I;this.color=re.color,this.fontFamily=re.fontFamily,this.padding=re.padding,this.text=re.text,this.createVisual(),te.prototype.restoreState.call(this,I),this.setSize()},T.prototype.scale=function(I,re){te.prototype.scale.call(this,I,re),this.setSize(),this.sizeText(),this.positionTextEditor()},T.typeName="TextMarker",T.title="Text marker",T.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',T}(A),K=function(te){function T(I,re,q){var z=te.call(this,I,re,q)||this;return z.color="transparent",z.lineWidth=3,z.drawing=!1,z.pixelRatio=1,z.color=q.defaultColor,z.lineWidth=q.defaultStrokeWidth,z.pixelRatio=q.freehandPixelRatio,z.setColor=z.setColor.bind(z),z.addCanvas=z.addCanvas.bind(z),z.finishCreation=z.finishCreation.bind(z),z.setLineWidth=z.setLineWidth.bind(z),z.colorPanel=new y("Color",q.defaultColorSet,q.defaultColor),z.colorPanel.onColorChanged=z.setColor,z.lineWidthPanel=new R("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.lineWidthPanel.onWidthChanged=z.setLineWidth,z}return fe(T,te),T.prototype.ownsTarget=function(I){return!(!te.prototype.ownsTarget.call(this,I)&&I!==this.visual&&I!==this.drawingImage)},T.prototype.createVisual=function(){this.visual=p.createGroup(),this.drawingImage=p.createImage(),this.visual.appendChild(this.drawingImage);var I=p.createTransform();this.visual.transform.baseVal.appendItem(I),this.addMarkerVisualToContainer(this.visual)},T.prototype.pointerDown=function(I,re){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(I.x,I.y),this.drawing=!0):te.prototype.pointerDown.call(this,I,re)},T.prototype.manipulate=function(I){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(I.x,I.y),this.canvasContext.stroke()):te.prototype.manipulate.call(this,I)},T.prototype.resize=function(I){te.prototype.resize.call(this,I),p.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),p.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},T.prototype.pointerUp=function(I){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):te.prototype.pointerUp.call(this,I)},T.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},T.prototype.select=function(){this.state==="creating"&&this.finishCreation(),te.prototype.select.call(this)},T.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),te.prototype.deselect.call(this)},T.prototype.finishCreation=function(){for(var I=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),re=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],q=re[0],z=re[1],W=re[2],V=re[3],se=!1,ge=0;ge<this.canvasElement.height;ge++)for(var Me=0;Me<this.canvasElement.width;Me++)I.data[ge*this.canvasElement.width*4+4*Me+3]>0&&(se=!0,ge<z&&(z=ge),Me<q&&(q=Me),ge>V&&(V=ge),Me>W&&(W=Me));if(se){this.left=q/this.pixelRatio,this.top=z/this.pixelRatio,this.width=(W-q)/this.pixelRatio,this.height=(V-z)/this.pixelRatio;var Fe=document.createElement("canvas");Fe.width=W-q,Fe.height=V-z,Fe.getContext("2d").putImageData(this.canvasContext.getImageData(q,z,W-q,V-z),0,0),this.drawingImgUrl=Fe.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},T.prototype.setDrawingImage=function(){p.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),p.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},T.prototype.setColor=function(I){this.color=I,this.colorChanged(I)},T.prototype.setLineWidth=function(I){this.lineWidth=I},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var I=Object.assign({drawingImgUrl:this.drawingImgUrl},te.prototype.getState.call(this));return I.typeName=T.typeName,I},T.prototype.restoreState=function(I){this.createVisual(),te.prototype.restoreState.call(this,I),this.drawingImgUrl=I.drawingImgUrl,this.setDrawingImage()},T.prototype.scale=function(I,re){te.prototype.scale.call(this,I,re),this.setDrawingImage()},T.typeName="FreehandMarker",T.title="Freehand marker",T.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',T}(A),Z=function(te){function T(I,re,q){var z=te.call(this,I,q||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return z.typeBoxes=[],z.currentType=re,z.setCurrentType=z.setCurrentType.bind(z),z}return fe(T,te),T.prototype.getUi=function(){var I=this,re=document.createElement("div");re.style.display="flex",re.style.overflow="hidden",re.style.flexGrow="2";for(var q=function(V){var se="both";switch(V){case 0:se="both";break;case 1:se="start";break;case 2:se="end";break;case 3:se="none"}var ge=document.createElement("div");if(ge.style.display="flex",ge.style.flexGrow="2",ge.style.alignItems="center",ge.style.justifyContent="space-between",ge.style.padding="5px",ge.style.borderWidth="2px",ge.style.borderStyle="solid",ge.style.borderColor=se===z.currentType?z.uiStyleSettings.toolboxAccentColor:"transparent",ge.addEventListener("click",function(){I.setCurrentType(se,ge)}),re.appendChild(ge),se==="both"||se==="start"){var Me=document.createElement("div");Me.style.display="flex",Me.style.alignItems="center",Me.style.minHeight="20px",Me.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+(z.uiStyleSettings!==void 0?z.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Me.style.marginLeft="5px",ge.appendChild(Me)}var Fe=document.createElement("div");Fe.style.display="flex",Fe.style.alignItems="center",Fe.style.minHeight="20px",Fe.style.flexGrow="2";var Re=document.createElement("hr");if(Re.style.minWidth="20px",Re.style.border="0px",Re.style.borderTop="3px solid "+(z.uiStyleSettings!==void 0?z.uiStyleSettings.toolboxColor:"#eeeeee"),Re.style.flexGrow="2",Fe.appendChild(Re),ge.appendChild(Fe),se==="both"||se==="end"){var $e=document.createElement("div");$e.style.display="flex",$e.style.alignItems="center",$e.style.minHeight="20px",$e.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(z.uiStyleSettings!==void 0?z.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,$e.style.marginRight="5px",ge.appendChild($e)}z.typeBoxes.push(ge)},z=this,W=0;W<4;W++)q(W);return re},T.prototype.setCurrentType=function(I,re){var q=this;this.currentType=I,this.typeBoxes.forEach(function(z){z.style.borderColor=z===re?q.uiStyleSettings!==void 0?q.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},T}(m),$=function(te){function T(I,re,q){var z=te.call(this,I,re,q)||this;return z.arrowType="end",z.arrowBaseHeight=10,z.arrowBaseWidth=10,z.getArrowPoints=z.getArrowPoints.bind(z),z.setArrowType=z.setArrowType.bind(z),z.arrowTypePanel=new Z("Arrow type","end"),z.arrowTypePanel.onArrowTypeChanged=z.setArrowType,z}return fe(T,te),T.prototype.ownsTarget=function(I){return!(!te.prototype.ownsTarget.call(this,I)&&I!==this.arrow1&&I!==this.arrow2)},T.prototype.getArrowPoints=function(I,re){var q=this.arrowBaseWidth+2*this.strokeWidth,z=this.arrowBaseHeight+2*this.strokeWidth;return I-q/2+","+(re+z/2)+" "+I+","+(re-z/2)+" "+(I+q/2)+","+(re+z/2)},T.prototype.createTips=function(){this.arrow1=p.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(p.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=p.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(p.createTransform()),this.visual.appendChild(this.arrow2)},T.prototype.pointerDown=function(I,re){te.prototype.pointerDown.call(this,I,re),this.state==="creating"&&this.createTips()},T.prototype.adjustVisual=function(){if(te.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2){this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",p.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),p.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]);var I=0;Math.abs(this.x1-this.x2)>.1&&(I=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2));var re=this.arrow1.transform.baseVal.getItem(0);re.setRotate(I,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(re,0);var q=this.arrow2.transform.baseVal.getItem(0);q.setRotate(I+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(q,0)}},T.prototype.setArrowType=function(I){this.arrowType=I,this.adjustVisual(),this.stateChanged()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var I=Object.assign({arrowType:this.arrowType},te.prototype.getState.call(this));return I.typeName=T.typeName,I},T.prototype.restoreState=function(I){te.prototype.restoreState.call(this,I);var re=I;this.arrowType=re.arrowType,this.createTips(),this.adjustVisual()},T.typeName="ArrowMarker",T.title="Arrow marker",T.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',T}(U),oe=function(te){function T(I,re,q){var z=te.call(this,I,re,q)||this;return z.fillColor=q.defaultFillColor,z.strokeWidth=0,z.fillPanel=new y("Color",q.defaultColorSet,q.defaultFillColor),z.fillPanel.onColorChanged=z.setFillColor,z}return fe(T,te),Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var I=te.prototype.getState.call(this);return I.typeName=T.typeName,I},T.typeName="CoverMarker",T.title="Cover marker",T.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',T}(H),ae=function(te){function T(I,re,q,z){var W=te.call(this,I,z||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return W.opacities=[],W.opacityBoxes=[],W.opacities=re,W.currentOpacity=q,W.setCurrentOpacity=W.setCurrentOpacity.bind(W),W}return fe(T,te),T.prototype.getUi=function(){var I=this,re=document.createElement("div");return re.style.display="flex",re.style.overflow="hidden",re.style.flexGrow="2",re.style.justifyContent="space-between",this.opacities.forEach(function(q){var z=document.createElement("div");z.style.display="flex",z.style.alignItems="center",z.style.justifyContent="center",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.borderColor=q===I.currentOpacity?I.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){I.setCurrentOpacity(q,z)}),re.appendChild(z);var W=document.createElement("div");W.innerText=100*q+"%",z.appendChild(W),I.opacityBoxes.push(z)}),re},T.prototype.setCurrentOpacity=function(I,re){var q=this;this.currentOpacity=I,this.opacityBoxes.forEach(function(z){z.style.borderColor=z===re?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},T}(m),ye=function(te){function T(I,re,q){var z=te.call(this,I,re,q)||this;return z.setOpacity=z.setOpacity.bind(z),z.fillColor=q.defaultHighlightColor,z.strokeWidth=0,z.opacity=q.defaultHighlightOpacity,z.fillPanel=new y("Color",q.defaultColorSet,z.fillColor),z.fillPanel.onColorChanged=z.setFillColor,z.opacityPanel=new ae("Opacity",q.defaultOpacitySteps,z.opacity),z.opacityPanel.onOpacityChanged=z.setOpacity,z}return fe(T,te),T.prototype.setOpacity=function(I){this.opacity=I,this.visual&&p.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var I=te.prototype.getState.call(this);return I.typeName=T.typeName,I},T.typeName="HighlightMarker",T.title="Highlight marker",T.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',T}(oe),Y='<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>',le='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',xe=function(te){function T(I,re,q){var z=te.call(this,I,re,q)||this;return z.bgColor="transparent",z.tipPosition={x:0,y:0},z.tipBase1Position={x:0,y:0},z.tipBase2Position={x:0,y:0},z.tipMoving=!1,z.color=q.defaultStrokeColor,z.bgColor=q.defaultFillColor,z.fontFamily=q.defaultFontFamily,z.defaultSize={x:100,y:30},z.setBgColor=z.setBgColor.bind(z),z.getTipPoints=z.getTipPoints.bind(z),z.positionTip=z.positionTip.bind(z),z.setTipPoints=z.setTipPoints.bind(z),z.colorPanel=new y("Text color",q.defaultColorSet,z.color,Y),z.colorPanel.onColorChanged=z.setColor,z.bgColorPanel=new y("Fill color",q.defaultColorSet,z.bgColor,le),z.bgColorPanel.onColorChanged=z.setBgColor,z.fontFamilyPanel=new G("Font",q.defaultFontFamilies,q.defaultFontFamily),z.fontFamilyPanel.onFontChanged=z.setFont,z.tipGrip=new S,z.tipGrip.visual.transform.baseVal.appendItem(p.createTransform()),z.controlBox.appendChild(z.tipGrip.visual),z}return fe(T,te),T.prototype.ownsTarget=function(I){return te.prototype.ownsTarget.call(this,I)||this.tipGrip.ownsTarget(I)||this.tip===I},T.prototype.createTip=function(){p.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=p.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},T.prototype.pointerDown=function(I,re){this.state==="new"&&te.prototype.pointerDown.call(this,I,re),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(re)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):te.prototype.pointerDown.call(this,I,re)},T.prototype.pointerUp=function(I){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,te.prototype.pointerUp.call(this,I);else{var re=this.state==="creating";te.prototype.pointerUp.call(this,I),this.setTipPoints(re),this.positionTip()}},T.prototype.manipulate=function(I){if(this.tipMoving){var re=this.unrotatePoint(I);this.tipPosition={x:re.x-this.manipulationStartLeft,y:re.y-this.manipulationStartTop},this.positionTip()}else te.prototype.manipulate.call(this,I)},T.prototype.setBgColor=function(I){this.bgRectangle&&this.tip&&(p.setAttributes(this.bgRectangle,[["fill",I]]),p.setAttributes(this.tip,[["fill",I]])),this.bgColor=I,this.fillColorChanged(I)},T.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},T.prototype.setTipPoints=function(I){I===void 0&&(I=!1);var re=Math.min(this.height/2,15),q=this.height/5;I&&(this.tipPosition={x:re+q/2,y:this.height+20});var z=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?z<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(q=this.width/5,re=Math.min(this.width/2,15),this.tipBase1Position={x:re,y:0},this.tipBase2Position={x:re+q,y:0}):(this.tipBase1Position={x:0,y:re},this.tipBase2Position={x:0,y:re+q}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?z<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(q=this.width/5,re=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-re-q,y:0},this.tipBase2Position={x:this.width-re,y:0}):(this.tipBase1Position={x:this.width,y:re},this.tipBase2Position={x:this.width,y:re+q}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?z<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(q=this.width/5,re=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-re-q,y:this.height},this.tipBase2Position={x:this.width-re,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-re-q},this.tipBase2Position={x:this.width,y:this.height-re}):z<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(q=this.width/5,re=Math.min(this.width/2,15),this.tipBase1Position={x:re,y:this.height},this.tipBase2Position={x:re+q,y:this.height}):(this.tipBase1Position={x:0,y:this.height-re},this.tipBase2Position={x:0,y:this.height-re-q})},T.prototype.resize=function(I){te.prototype.resize.call(this,I),this.positionTip()},T.prototype.positionTip=function(){p.setAttributes(this.tip,[["points",this.getTipPoints()]]);var I=this.tipGrip.visual.transform.baseVal.getItem(0);I.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(I,0)},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),T.prototype.select=function(){this.positionTip(),te.prototype.select.call(this)},T.prototype.getState=function(){var I=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},te.prototype.getState.call(this));return I.typeName=T.typeName,I},T.prototype.restoreState=function(I){var re=I;this.bgColor=re.bgColor,this.tipPosition=re.tipPosition,te.prototype.restoreState.call(this,I),this.createTip(),this.setTipPoints()},T.prototype.scale=function(I,re){te.prototype.scale.call(this,I,re),this.tipPosition={x:this.tipPosition.x*I,y:this.tipPosition.y*re},this.positionTip()},T.typeName="CalloutMarker",T.title="Callout marker",T.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',T}(ee),Ce=function(te){function T(I,re,q){var z=te.call(this,I,re,q)||this;return z.fillColor="transparent",z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.opacity=1,z.strokeColor=q.defaultColor,z.strokeWidth=q.defaultStrokeWidth,z.strokeDasharray=q.defaultStrokeDasharray,z.fillColor=q.defaultFillColor,z.setStrokeColor=z.setStrokeColor.bind(z),z.setFillColor=z.setFillColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.setOpacity=z.setOpacity.bind(z),z.createVisual=z.createVisual.bind(z),z.strokePanel=new y("Line color",E(q.defaultColorSet,["transparent"]),q.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.fillPanel=new y("Fill color",E(q.defaultColorSet,["transparent"]),z.fillColor,le),z.fillPanel.onColorChanged=z.setFillColor,z.strokeWidthPanel=new R("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new F("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z.opacityPanel=new ae("Opacity",q.defaultOpacitySteps,z.opacity),z.opacityPanel.onOpacityChanged=z.setOpacity,z}return fe(T,te),T.prototype.ownsTarget=function(I){return!(!te.prototype.ownsTarget.call(this,I)&&I!==this.visual)},T.prototype.createVisual=function(){this.visual=p.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},T.prototype.pointerDown=function(I,re){te.prototype.pointerDown.call(this,I,re),this.state==="new"&&(this.createVisual(),this.moveVisual(I),this._state="creating")},T.prototype.manipulate=function(I){te.prototype.manipulate.call(this,I)},T.prototype.resize=function(I){te.prototype.resize.call(this,I),this.setSize()},T.prototype.setSize=function(){te.prototype.setSize.call(this),p.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},T.prototype.pointerUp=function(I){te.prototype.pointerUp.call(this,I),this.setSize()},T.prototype.setStrokeColor=function(I){this.strokeColor=I,this.visual&&p.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(I),this.stateChanged()},T.prototype.setFillColor=function(I){this.fillColor=I,this.visual&&p.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(I),this.stateChanged()},T.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.visual&&p.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},T.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.visual&&p.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},T.prototype.setOpacity=function(I){this.opacity=I,this.visual&&p.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var I=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},te.prototype.getState.call(this));return I.typeName=T.typeName,I},T.prototype.restoreState=function(I){var re=I;this.fillColor=re.fillColor,this.strokeColor=re.strokeColor,this.strokeWidth=re.strokeWidth,this.strokeDasharray=re.strokeDasharray,this.opacity=re.opacity,this.createVisual(),te.prototype.restoreState.call(this,I),this.setSize()},T.prototype.scale=function(I,re){te.prototype.scale.call(this,I,re),this.setSize()},T.typeName="EllipseMarker",T.title="Ellipse marker",T.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',T}(A),we=function(te){function T(I,re,q){return te.call(this,I,re,q)||this}return fe(T,te),Object.defineProperty(T.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),T.prototype.ownsTarget=function(I){return!(!te.prototype.ownsTarget.call(this,I)&&I!==this.tip1&&I!==this.tip2)},T.prototype.createTips=function(){this.tip1=p.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(p.createTransform()),this.visual.appendChild(this.tip1),this.tip2=p.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(p.createTransform()),this.visual.appendChild(this.tip2)},T.prototype.pointerDown=function(I,re){te.prototype.pointerDown.call(this,I,re),this.state==="creating"&&this.createTips()},T.prototype.adjustVisual=function(){if(te.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(p.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),p.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var I=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),re=this.tip1.transform.baseVal.getItem(0);re.setRotate(I,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(re,0);var q=this.tip2.transform.baseVal.getItem(0);q.setRotate(I+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(q,0)}},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var I=te.prototype.getState.call(this);return I.typeName=T.typeName,I},T.prototype.restoreState=function(I){te.prototype.restoreState.call(this,I),this.createTips(),this.adjustVisual()},T.typeName="MeasurementMarker",T.title="Measurement marker",T.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',T}(U),Le=function(te){function T(I,re,q){var z=te.call(this,I,re,q)||this;return z.strokePanel.colors=q.defaultColorSet,z.fillColor="transparent",z}return fe(T,te),Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var I=te.prototype.getState.call(this);return I.typeName=T.typeName,I},T.typeName="EllipseFrameMarker",T.title="Ellipse frame marker",T.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',T}(Ce),de=function(){function te(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(te.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),te.prototype.addUndoStep=function(T){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(T)||(this.undoStack.push(T),JSON.stringify(this.lastRedoStep)!==JSON.stringify(T)&&this.redoStack.splice(0,this.redoStack.length))},te.prototype.replaceLastUndoStep=function(T){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=T)},te.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},te.prototype.undo=function(){if(this.undoStack.length>1){var T=this.undoStack.pop();return T!==void 0&&this.redoStack.push(T),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},te.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},te}(),be=function(te){function T(I,re,q){var z=te.call(this,I,re,q)||this;return z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.curveX=0,z.curveY=0,z.manipulationStartCurveX=0,z.manipulationStartCurveY=0,z.setStrokeColor=z.setStrokeColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.positionGrips=z.positionGrips.bind(z),z.addControlGrips=z.addControlGrips.bind(z),z.adjustVisual=z.adjustVisual.bind(z),z.setupControlBox=z.setupControlBox.bind(z),z.resize=z.resize.bind(z),z.strokeColor=q.defaultColor,z.strokeWidth=q.defaultStrokeWidth,z.strokeDasharray=q.defaultStrokeDasharray,z.strokePanel=new y("Line color",q.defaultColorSet,q.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new R("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new F("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return fe(T,te),T.prototype.ownsTarget=function(I){return!(!te.prototype.ownsTarget.call(this,I)&&I!==this.visual&&I!==this.selectorCurve&&I!==this.visibleCurve&&!this.curveGrip.ownsTarget(I))},T.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},T.prototype.createVisual=function(){this.visual=p.createGroup(),this.selectorCurve=p.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=p.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},T.prototype.pointerDown=function(I,re){te.prototype.pointerDown.call(this,I,re),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=I.x,this.curveY=I.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(re)&&(this.activeGrip=this.curveGrip,this._state="resize")},T.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),p.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),p.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),p.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},T.prototype.setupControlBox=function(){te.prototype.setupControlBox.call(this),this.curveControlLine1=p.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=p.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},T.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,te.prototype.addControlGrips.call(this)},T.prototype.positionGrips=function(){te.prototype.positionGrips.call(this);var I=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-I/2,this.curveY-I/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},T.prototype.manipulate=function(I){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+I.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+I.y-this.manipulationStartY),te.prototype.manipulate.call(this,I)},T.prototype.resize=function(I){this.activeGrip===this.curveGrip&&(this.curveX=I.x,this.curveY=I.y),te.prototype.resize.call(this,I),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},T.prototype.setStrokeColor=function(I){this.strokeColor=I,this.adjustVisual(),this.colorChanged(I)},T.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.adjustVisual()},T.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.adjustVisual()},T.prototype.scale=function(I,re){this.curveX=this.curveX*I,this.curveY=this.curveY*re,te.prototype.scale.call(this,I,re)},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var I=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},te.prototype.getState.call(this));return I.typeName=T.typeName,I},T.prototype.restoreState=function(I){te.prototype.restoreState.call(this,I);var re=I;this.strokeColor=re.strokeColor,this.strokeWidth=re.strokeWidth,this.strokeDasharray=re.strokeDasharray,this.curveX=re.curveX,this.curveY=re.curveY,this.createVisual(),this.adjustVisual()},T.typeName="CurveMarker",T.title="Curve marker",T.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',T}(P),Te=function(te){function T(I,re,q){var z=te.call(this,I,re,q)||this;return z.fillColor="transparent",z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.textColor="transparent",z.fontSize="1rem",z.isMoved=!1,z.captionText="Caption",z.PADDING=5,z.captionBoxWidth=0,z.captionBoxHeight=0,z.strokeColor=q.defaultColor,z.strokeWidth=q.defaultStrokeWidth,z.strokeDasharray=q.defaultStrokeDasharray,z.fillColor=q.defaultFillColor,z.textColor=q.defaultStrokeColor,z.fontFamily=q.defaultFontFamily,z.fontSize=q.defaultCaptionFontSize,z.captionText=q.defaultCaptionText,z.setStrokeColor=z.setStrokeColor.bind(z),z.setFillColor=z.setFillColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.createVisual=z.createVisual.bind(z),z.sizeCaption=z.sizeCaption.bind(z),z.setCaptionText=z.setCaptionText.bind(z),z.showTextEditor=z.showTextEditor.bind(z),z.positionTextEditor=z.positionTextEditor.bind(z),z.finishTextEditing=z.finishTextEditing.bind(z),z.setFont=z.setFont.bind(z),z.setTextColor=z.setTextColor.bind(z),z.strokePanel=new y("Line color",E(q.defaultColorSet,["transparent"]),z.strokeColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.fillPanel=new y("Fill color",E(q.defaultColorSet,["transparent"]),z.fillColor,le),z.fillPanel.onColorChanged=z.setFillColor,z.strokeWidthPanel=new R("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new F("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z.fontFamilyPanel=new G("Font",q.defaultFontFamilies,q.defaultFontFamily),z.fontFamilyPanel.onFontChanged=z.setFont,z.textColorPanel=new y("Text color",q.defaultColorSet,z.textColor,Y),z.textColorPanel.onColorChanged=z.setTextColor,z}return fe(T,te),T.prototype.ownsTarget=function(I){return!(!te.prototype.ownsTarget.call(this,I)&&I!==this.visual&&I!==this.frame&&I!==this.captionBg&&I!==this.captionElement)},T.prototype.createVisual=function(){this.visual=p.createGroup(),this.addMarkerVisualToContainer(this.visual),this.captionBg=p.createRect(1,1,[["fill",this.fillColor]]),this.visual.appendChild(this.captionBg),this.captionElement=p.createText([["fill",this.textColor],["font-family",this.fontFamily]]),this.captionElement.style.fontSize=this.fontSize,this.captionElement.style.textAnchor="start",this.captionElement.style.dominantBaseline="text-before-edge",this.captionElement.textContent=this.captionText,this.visual.appendChild(this.captionElement),this.frame=p.createRect(this.width,this.height,[["fill","transparent"],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray]]),this.visual.appendChild(this.frame),this.sizeCaption()},T.prototype.setCaptionText=function(I){this.captionText=I,this.captionElement.textContent=this.captionText,this.sizeCaption()},T.prototype.pointerDown=function(I,re){te.prototype.pointerDown.call(this,I,re),this.isMoved=!1,this.pointerDownPoint=I,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(I),this._state="creating")},T.prototype.manipulate=function(I){te.prototype.manipulate.call(this,I),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(I.x-this.pointerDownPoint.x)>5||Math.abs(I.y-this.pointerDownPoint.y)>5)},T.prototype.resize=function(I){te.prototype.resize.call(this,I),this.setSize()},T.prototype.sizeCaption=function(){var I=this.captionElement.getBBox();this.captionText.trim()!==""?(this.captionBoxWidth=I.width+2*this.PADDING,this.captionBoxHeight=I.height+2*this.PADDING):(this.captionBoxWidth=0,this.captionBoxHeight=0),p.setAttributes(this.captionBg,[["width",this.captionBoxWidth.toString()],["height",this.captionBoxHeight.toString()],["clip-path","path('M0,0 H"+this.width+" V"+this.height+" H"+-this.width+" Z')"]]),p.setAttributes(this.captionElement,[["x",this.PADDING.toString()],["y",this.PADDING.toString()],["clip-path","path('M0,0 H"+(this.width-this.PADDING)+" V"+this.height+" H"+(-this.width-this.PADDING)+" Z')"]])},T.prototype.showTextEditor=function(){var I=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditBox=document.createElement("input"),this.textEditBox.style.position="absolute",this.textEditBox.style.width=this.width+"px",this.captionBoxHeight>0&&(this.textEditBox.style.height=this.captionBoxHeight+"px"),this.textEditBox.style.fontSize=this.fontSize,this.textEditBox.style.fontFamily=this.fontFamily,this.textEditBox.style.backgroundColor=this.fillColor,this.textEditBox.style.color=this.textColor,this.textEditBox.style.borderWidth="0",this.textEditBox.setAttribute("value",this.captionText),this.textEditBox.select(),this.textEditDiv.appendChild(this.textEditBox),this.overlayContainer.appendChild(this.textEditDiv),this.textEditBox.addEventListener("pointerup",function(re){re.stopPropagation()}),this.textEditBox.addEventListener("keypress",function(re){re.key==="Enter"&&I.finishTextEditing(I.textEditBox.value)}),this.textEditBox.addEventListener("keyup",function(re){re.cancelBubble=!0}),this.textEditBox.addEventListener("blur",function(){I.finishTextEditing(I.textEditBox.value)}),this.textEditDiv.addEventListener("pointerup",function(){I.finishTextEditing(I.textEditBox.value)}),this.positionTextEditor(),this.textEditBox.focus()},T.prototype.positionTextEditor=function(){this.state==="edit"&&(this.textEditBox===void 0?this.showTextEditor():(this.textEditBox.style.left=this.left+"px",this.textEditBox.style.top=this.top+"px",this.textEditBox.style.transform="rotate("+this.rotationAngle+"deg)",this.textEditBox.style.transformOrigin=this.width/2+"px "+this.height/2+"px"))},T.prototype.finishTextEditing=function(I){this.setCaptionText(I.trim()),this.overlayContainer.innerHTML="",this.stateChanged()},T.prototype.setFont=function(I){this.captionElement&&p.setAttributes(this.captionElement,[["font-family",I]]),this.fontFamily=I,this.textEditBox&&(this.textEditBox.style.fontFamily=this.fontFamily),this.sizeCaption(),this.stateChanged()},T.prototype.setTextColor=function(I){this.captionElement&&p.setAttributes(this.captionElement,[["fill",I]]),this.textColor=I,this.textEditBox&&(this.textEditBox.style.color=this.textColor),this.stateChanged()},T.prototype.setSize=function(){te.prototype.setSize.call(this),p.setAttributes(this.frame,[["width",this.width.toString()],["height",this.height.toString()]]),this.sizeCaption()},T.prototype.pointerUp=function(I){te.prototype.pointerUp.call(this,I),this.setSize(),!this.isMoved&&Date.now()-this.pointerDownTimestamp>500&&this.showTextEditor(),this.pointerDownPoint=void 0},T.prototype.dblClick=function(I,re){te.prototype.dblClick.call(this,I,re),this.showTextEditor()},T.prototype.setStrokeColor=function(I){this.strokeColor=I,this.frame&&p.setAttributes(this.frame,[["stroke",this.strokeColor]]),this.colorChanged(I),this.stateChanged()},T.prototype.setFillColor=function(I){this.fillColor=I,this.captionBg&&p.setAttributes(this.captionBg,[["fill",this.fillColor]]),this.fillColorChanged(I),this.stateChanged()},T.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.frame&&p.setAttributes(this.frame,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},T.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.frame&&p.setAttributes(this.frame,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.fontFamilyPanel,this.textColorPanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var I=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:1,textColor:this.textColor,fontFamily:this.fontFamily,fontSize:this.fontSize,captionText:this.captionText},te.prototype.getState.call(this));return I.typeName=this.typeName,I},T.prototype.restoreState=function(I){var re=I;this.fillColor=re.fillColor,this.strokeColor=re.strokeColor,this.strokeWidth=re.strokeWidth,this.strokeDasharray=re.strokeDasharray,this.textColor=re.textColor,this.fontFamily=re.fontFamily,this.captionText=re.captionText,this.fontSize=re.fontSize,this.createVisual(),te.prototype.restoreState.call(this,I),this.setSize()},T.prototype.scale=function(I,re){te.prototype.scale.call(this,I,re),this.setSize()},T.typeName="CaptionFrameMarker",T.title="Caption frame marker",T.icon='<svg viewBox="0 0 24 24"><path d="M5 3c-1.11 0-2 .89-2 2v14c0 1.11.89 2 2 2h14c1.11 0 2-.89 2-2V5c0-1.11-.89-2-2-2H5m0 2h14v14H5V5m2 2v2h10V7H7z"/></svg>',T}(A),Ae=function(){function te(T,I){I===void 0&&(I=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=T,this.cancelable=I}return Object.defineProperty(te.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),te.prototype.preventDefault=function(){this._defaultPrevented=!0},te}(),Be=function(te){function T(I,re,q){var z=te.call(this,I,!1)||this;return z.dataUrl=re,z.state=q,z}return fe(T,te),T}(Ae),Pe=function(te){function T(I,re,q){q===void 0&&(q=!1);var z=te.call(this,I,q)||this;return z.marker=re,z}return fe(T,te),T}(Ae),_e=function(){function te(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return te.prototype.addEventListener=function(T,I){this[T].push(I)},te.prototype.removeEventListener=function(T,I){var re=this[T].indexOf(I);re>-1&&this[T].splice(re,1)},te}(),ne=function(){function te(T){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new B,this._isOpen=!1,this.undoRedoManager=new de,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new _e,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=te.instanceCounter++,this.styles=new v(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=T,this.targetRoot=document.body,this.width=T.clientWidth,this.height=T.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(te.prototype,"ALL_MARKER_TYPES",{get:function(){return[D,K,$,ee,Le,Ce,ye,xe,we,oe,U,be,Te]},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[D,K,$,ee,Ce,ye,xe]},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"BASIC_MARKER_TYPES",{get:function(){return[D,K,$,ee,ye]},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(T){var I=this;this._availableMarkerTypes.splice(0),T.forEach(function(re){if(typeof re=="string"){var q=I.ALL_MARKER_TYPES.find(function(z){return z.typeName===re});q!==void 0&&I._availableMarkerTypes.push(q)}else I._availableMarkerTypes.push(re)})},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(T){this._zoomLevel=T,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),te.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),g.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},te.prototype.show=function(){var T=this;this.styles.styleSheetRoot===void 0&&h.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=h.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(I){return I(new Ae(T))})},te.prototype.render=function(){return i(this,void 0,void 0,function(){var T;return M(this,function(I){switch(I.label){case 0:return this.setCurrentMarker(),(T=new l).naturalSize=this.renderAtNaturalSize,T.imageType=this.renderImageType,T.imageQuality=this.renderImageQuality,T.markersOnly=this.renderMarkersOnly,T.width=this.renderWidth,T.height=this.renderHeight,[4,T.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return I.sent(),[4,T.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,I.sent()]}})})},te.prototype.close=function(T){var I=this;if(T===void 0&&(T=!1),this.isOpen){var re=!1;T||this.eventListeners.beforeclose.forEach(function(q){var z=new Ae(I,!0);q(z),z.defaultPrevented&&(re=!0)}),re||(this.coverDiv&&this.closeUI(),this.targetObserver&&(this.targetObserver.unobserve(this.target),this.targetObserver.unobserve(this.editorCanvas)),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(q){return q(new Ae(I))}),this.detachEvents(),this._isOpen=!1)}},te.prototype.addMarkersToToolbar=function(){for(var T,I=[],re=0;re<arguments.length;re++)I[re]=arguments[re];(T=this._availableMarkerTypes).push.apply(T,I)},te.prototype.addRenderEventListener=function(T){this.addEventListener("render",function(I){T(I.dataUrl,I.state)})},te.prototype.removeRenderEventListener=function(T){},te.prototype.addCloseEventListener=function(T){this.addEventListener("close",function(){T()})},te.prototype.removeCloseEventListener=function(T){},te.prototype.setupResizeObserver=function(){var T=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){T.resize(T.target.clientWidth,T.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return T.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},te.prototype.onPopupTargetResize=function(){var T=1*this.target.clientWidth/this.target.clientHeight,I=this.editorCanvas.clientWidth/T>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*T:this.editorCanvas.clientWidth,re=I<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/T;this.resize(I,re)},te.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},te.prototype.resize=function(T,I){this._isResizing=!0;var re=T/this.imageWidth,q=I/this.imageHeight;this.imageWidth=Math.round(T),this.imageHeight=Math.round(I),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(re,q),this._isResizing=!1},te.prototype.scaleMarkers=function(T,I){var re,q=this;this._currentMarker&&this._currentMarker instanceof ee?this._currentMarker.scale(T,I):(re=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(z){z!==q._currentMarker&&z.scale(T,I)}),re!==void 0&&this.setCurrentMarker(re)},te.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},te.prototype.setTopLeft=function(){var T=this.editingTarget.getBoundingClientRect(),I=this.editorCanvas.getBoundingClientRect();this.left=T.left-I.left,this.top=T.top-I.top},te.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},te.prototype.addDefs=function(){for(var T,I=[],re=0;re<arguments.length;re++)I[re]=arguments[re];this.defs=p.createDefs(),this.addDefsToImage(),(T=this.defs).append.apply(T,I)},te.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},te.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},te.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},te.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},te.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},te.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},te.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},te.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var T=document.createElement("a");T.href="https://markerjs.com/",T.target="_blank",T.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',T.title="Powered by marker.js",T.style.display="grid",T.style.alignItems="center",T.style.justifyItems="center",T.style.padding="3px",T.style.width="20px",T.style.height="20px",this.logoUI.appendChild(T),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},te.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},te.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},te.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},te.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var T=this.settings.uiOffsetTop!==void 0?this.target.offsetTop+this.settings.uiOffsetTop:this.target.offsetTop>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=T+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new s(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.settings.uiOffsetTop===void 0&&this.target.offsetTop<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new u(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},te.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},te.prototype.removeMarker=function(T){this.markerImage.removeChild(T.container),this.markers.indexOf(T)>-1&&this.markers.splice(this.markers.indexOf(T),1),T.dispose()},te.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},te.prototype.toolbarButtonClicked=function(T,I){if(T==="marker"&&I!==void 0)this.createNewMarker(I);else if(T==="action")switch(I){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},te.prototype.deleteSelectedMarker=function(){var T=this;if(this._currentMarker!==void 0){var I=!1;if(this.eventListeners.markerbeforedelete.forEach(function(q){var z=new Pe(T,T._currentMarker,!0);q(z),z.defaultPrevented&&(I=!0)}),!I){var re=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(q){return q(new Pe(T,re))})}}},te.prototype.clear=function(){var T=this,I=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(W){var V=new Pe(T,void 0,!0);W(V),V.defaultPrevented&&(I=!0)}),!I)){this.setCurrentMarker();for(var re=function(W){var V=q.markers[W];q.setCurrentMarker(q.markers[W]),q._currentMarker.dispose(),q.markerImage.removeChild(q._currentMarker.container),q.markers.splice(q.markers.indexOf(q._currentMarker),1),q.eventListeners.markerdelete.forEach(function(se){return se(new Pe(T,V))})},q=this,z=this.markers.length-1;z>=0;z--)re(z);this.addUndoStep()}},Object.defineProperty(te.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),te.prototype.showNotesEditor=function(){var T;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(T=this._currentMarker.notes)!==null&&T!==void 0?T:"",this.overlayContainer.appendChild(this.notesArea))},te.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},te.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},te.prototype.addUndoStep=function(){var T=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var I=this.getState(),re=this.undoRedoManager.getLastUndoStep();if(!re||re.width===I.width&&re.height===I.height){var q=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(I),q<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(z){return z(new Ae(T))})}else this.undoRedoManager.replaceLastUndoStep(I),this.eventListeners.statechange.forEach(function(z){return z(new Ae(T))})}},te.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},te.prototype.undoStep=function(){var T=this,I=this.undoRedoManager.undo();I!==void 0&&(this.restoreState(I),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(re){return re(new Ae(T))}))},te.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},te.prototype.redoStep=function(){var T=this,I=this.undoRedoManager.redo();I!==void 0&&(this.restoreState(I),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(re){return re(new Ae(T))}))},te.prototype.stepZoom=function(){var T=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=T<this.zoomSteps.length-1?this.zoomSteps[T+1]:this.zoomSteps[0]},te.prototype.panTo=function(T){this.contentDiv.scrollBy({left:this.prevPanPoint.x-T.x,top:this.prevPanPoint.y-T.y}),this.prevPanPoint=T},te.prototype.startRenderAndClose=function(){return i(this,void 0,void 0,function(){var T,I,re=this;return M(this,function(q){switch(q.label){case 0:return[4,this.render()];case 1:return T=q.sent(),I=this.getState(),this.eventListeners.render.forEach(function(z){return z(new Be(re,T,I))}),this.close(!0),[2]}})})},te.prototype.getState=function(T){T===!0&&this.setCurrentMarker();var I={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(re){return I.markers.push(re.getState())}),I},te.prototype.restoreState=function(T){var I=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);T.markers.forEach(function(re){var q=I._availableMarkerTypes.find(function(W){return W.typeName===re.typeName});if(q!==void 0){var z=I.addNewMarker(q);z.restoreState(re),I.markers.push(z)}}),T.width&&T.height&&(T.width!==this.imageWidth||T.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/T.width,this.imageHeight/T.height),this.eventListeners.restorestate.forEach(function(re){return re(new Ae(I))})},te.prototype.addNewMarker=function(T){var I=p.createGroup();return this.markerImage.appendChild(I),new T(I,this.overlayContainer,this.settings)},te.prototype.createNewMarker=function(T){var I,re=this;(I=typeof T=="string"?this._availableMarkerTypes.find(function(q){return q.typeName===T}):T)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(I),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(I.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(q){return q(new Pe(re,re._currentMarker))}))},te.prototype.markerCreated=function(T){var I=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(T),this.setCurrentMarker(T),T instanceof K&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(K):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(re){return re(new Pe(I,I._currentMarker))})},te.prototype.colorChanged=function(T){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=T,this.settings.defaultStrokeColor=T)},te.prototype.fillColorChanged=function(T){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=T)},te.prototype.markerStateChanged=function(T){var I=this;this.eventListeners.markerchange.forEach(function(re){return re(new Pe(I,T))})},te.prototype.setCurrentMarker=function(T){var I=this;this._currentMarker!==T&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(re){return re(new Pe(I,I._currentMarker))})),this._currentMarker=T,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(re){return re(new Pe(I,I._currentMarker))}))},te.prototype.onPointerDown=function(T){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||T.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var I=this.markers.find(function(re){return re.ownsTarget(T.target)});I!==void 0?(this.setCurrentMarker(I),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(T.clientX,T.clientY),T.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:T.clientX,y:T.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(T.clientX,T.clientY))},te.prototype.onDblClick=function(T){if(this._isFocused||this.focus(),this.mode==="select"){var I=this.markers.find(function(re){return re.ownsTarget(T.target)});I!==void 0&&I!==this._currentMarker&&this.setCurrentMarker(I),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(T.clientX,T.clientY),T.target):this.setCurrentMarker()}},te.prototype.onPointerMove=function(T){this.touchPoints!==1&&T.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||T.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(T.clientX,T.clientY)):this.zoomLevel>1&&this.panTo({x:T.clientX,y:T.clientY}))},te.prototype.onPointerUp=function(T){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(T.clientX,T.clientY)),this.isDragging=!1,this.addUndoStep()},te.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},te.prototype.onKeyUp=function(T){this._currentMarker===void 0||this.notesArea!==void 0||T.key!=="Delete"&&T.key!=="Backspace"||this.deleteSelectedMarker()},te.prototype.clientToLocalCoordinates=function(T,I){var re=this.markerImage.getBoundingClientRect();return{x:(T-re.left)/this.zoomLevel,y:(I-re.top)/this.zoomLevel}},te.prototype.onWindowResize=function(){this.positionUI()},te.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var T=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=T+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},te.prototype.addLicenseKey=function(T){g.addKey(T)},te.prototype.addEventListener=function(T,I){this.eventListeners.addEventListener(T,I)},te.prototype.removeEventListener=function(T,I){this.eventListeners.removeEventListener(T,I)},te.prototype.renderState=function(T){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(T),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(te.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),te.prototype.focus=function(){var T=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(I){return I(new Ae(T))}))},te.prototype.blur=function(){var T=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(I){return I(new Ae(T))}))},te.instanceCounter=0,te}()},58971:function(It,Ue,Q){var he=Q(62195),fe=Q(39015),i=[Q(19257)];It.exports=he.createStore(fe,i)},19257:function(It,Ue,Q){It.exports=he;function he(){return Q(55703),{}}},55703:function(){typeof JSON!="object"&&(JSON={}),function(){"use strict";var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;function f(It){return It<10?"0"+It:It}function this_value(){return this.valueOf()}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value);var gap,indent,meta,rep;function quote(It){return rx_escapable.lastIndex=0,rx_escapable.test(It)?'"'+It.replace(rx_escapable,function(Ue){var Q=meta[Ue];return typeof Q=="string"?Q:"\\u"+("0000"+Ue.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+It+'"'}function str(It,Ue){var Q,he,fe,i,M=gap,E,p=Ue[It];switch(p&&typeof p=="object"&&typeof p.toJSON=="function"&&(p=p.toJSON(It)),typeof rep=="function"&&(p=rep.call(Ue,It,p)),typeof p){case"string":return quote(p);case"number":return isFinite(p)?String(p):"null";case"boolean":case"null":return String(p);case"object":if(!p)return"null";if(gap+=indent,E=[],Object.prototype.toString.apply(p)==="[object Array]"){for(i=p.length,Q=0;Q<i;Q+=1)E[Q]=str(Q,p)||"null";return fe=E.length===0?"[]":gap?`[
`+gap+E.join(`,
`+gap)+`
`+M+"]":"["+E.join(",")+"]",gap=M,fe}if(rep&&typeof rep=="object")for(i=rep.length,Q=0;Q<i;Q+=1)typeof rep[Q]=="string"&&(he=rep[Q],fe=str(he,p),fe&&E.push(quote(he)+(gap?": ":":")+fe));else for(he in p)Object.prototype.hasOwnProperty.call(p,he)&&(fe=str(he,p),fe&&E.push(quote(he)+(gap?": ":":")+fe));return fe=E.length===0?"{}":gap?`{
`+gap+E.join(`,
`+gap)+`
`+M+"}":"{"+E.join(",")+"}",gap=M,fe}}typeof JSON.stringify!="function"&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(It,Ue,Q){var he;if(gap="",indent="",typeof Q=="number")for(he=0;he<Q;he+=1)indent+=" ";else typeof Q=="string"&&(indent=Q);if(rep=Ue,Ue&&typeof Ue!="function"&&(typeof Ue!="object"||typeof Ue.length!="number"))throw new Error("JSON.stringify");return str("",{"":It})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){var j;function walk(It,Ue){var Q,he,fe=It[Ue];if(fe&&typeof fe=="object")for(Q in fe)Object.prototype.hasOwnProperty.call(fe,Q)&&(he=walk(fe,Q),he!==void 0?fe[Q]=he:delete fe[Q]);return reviver.call(It,Ue,fe)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(It){return"\\u"+("0000"+It.charCodeAt(0).toString(16)).slice(-4)})),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()},62195:function(It,Ue,Q){var he=Q(69078),fe=he.slice,i=he.pluck,M=he.each,E=he.bind,p=he.create,g=he.isList,l=he.isFunction,h=he.isObject;It.exports={createStore:o};var v={version:"2.0.12",enabled:!1,get:function(s,u){var m=this.storage.read(this._namespacePrefix+s);return this._deserialize(m,u)},set:function(s,u){return u===void 0?this.remove(s):(this.storage.write(this._namespacePrefix+s,this._serialize(u)),u)},remove:function(s){this.storage.remove(this._namespacePrefix+s)},each:function(s){var u=this;this.storage.each(function(m,y){s.call(u,u._deserialize(m),(y||"").replace(u._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(s){return this._namespacePrefix=="__storejs_"+s+"_"},createStore:function(){return o.apply(this,arguments)},addPlugin:function(s){this._addPlugin(s)},namespace:function(s){return o(this.storage,this.plugins,s)}};function d(){var s=typeof console=="undefined"?null:console;if(s){var u=s.warn?s.warn:s.log;u.apply(s,arguments)}}function o(s,u,m){m||(m=""),s&&!g(s)&&(s=[s]),u&&!g(u)&&(u=[u]);var y=m?"__storejs_"+m+"_":"",_=m?new RegExp("^"+y):null,x=/^[a-zA-Z0-9_\-]*$/;if(!x.test(m))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var S={_namespacePrefix:y,_namespaceRegexp:_,_testStorage:function(A){try{var H="__storejs__test__";A.write(H,H);var R=A.read(H)===H;return A.remove(H),R}catch(F){return!1}},_assignPluginFnProp:function(A,H){var R=this[H];this[H]=function(){var D=fe(arguments,0),B=this;function P(){if(R)return M(arguments,function(G,ee){D[ee]=G}),R.apply(B,D)}var U=[P].concat(D);return A.apply(B,U)}},_serialize:function(A){return JSON.stringify(A)},_deserialize:function(A,H){if(!A)return H;var R="";try{R=JSON.parse(A)}catch(F){R=A}return R!==void 0?R:H},_addStorage:function(A){this.enabled||this._testStorage(A)&&(this.storage=A,this.enabled=!0)},_addPlugin:function(A){var H=this;if(g(A)){M(A,function(D){H._addPlugin(D)});return}var R=i(this.plugins,function(D){return A===D});if(!R){if(this.plugins.push(A),!l(A))throw new Error("Plugins must be function values that return objects");var F=A.call(this);if(!h(F))throw new Error("Plugins must return an object of function properties");M(F,function(D,B){if(!l(D))throw new Error("Bad plugin property: "+B+" from plugin "+A.name+". Plugins should only return functions.");H._assignPluginFnProp(D,B)})}},addStorage:function(A){d("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(A)}},w=p(S,v,{plugins:[]});return w.raw={},M(w,function(A,H){l(A)&&(w.raw[H]=E(w,A))}),M(s,function(A){w._addStorage(A)}),M(u,function(A){w._addPlugin(A)}),w}},69078:function(It,Ue,Q){var he=E(),fe=p(),i=g(),M=typeof window!="undefined"?window:Q.g;It.exports={assign:he,create:fe,trim:i,bind:l,slice:h,each:v,map:d,pluck:o,isList:s,isFunction:u,isObject:m,Global:M};function E(){return Object.assign?Object.assign:function(_,x,S,w){for(var A=1;A<arguments.length;A++)v(Object(arguments[A]),function(H,R){_[R]=H});return _}}function p(){if(Object.create)return function(x,S,w,A){var H=h(arguments,1);return he.apply(this,[Object.create(x)].concat(H))};{let _=function(){};var y=_;return function(S,w,A,H){var R=h(arguments,1);return _.prototype=S,he.apply(this,[new _].concat(R))}}}function g(){return String.prototype.trim?function(_){return String.prototype.trim.call(_)}:function(_){return _.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}}function l(y,_){return function(){return _.apply(y,Array.prototype.slice.call(arguments,0))}}function h(y,_){return Array.prototype.slice.call(y,_||0)}function v(y,_){o(y,function(x,S){return _(x,S),!1})}function d(y,_){var x=s(y)?[]:{};return o(y,function(S,w){return x[w]=_(S,w),!1}),x}function o(y,_){if(s(y)){for(var x=0;x<y.length;x++)if(_(y[x],x))return y[x]}else for(var S in y)if(y.hasOwnProperty(S)&&_(y[S],S))return y[S]}function s(y){return y!=null&&typeof y!="function"&&typeof y.length=="number"}function u(y){return y&&{}.toString.call(y)==="[object Function]"}function m(y){return y&&{}.toString.call(y)==="[object Object]"}},39015:function(It,Ue,Q){It.exports=[Q(39627),Q(95347),Q(34524),Q(45580),Q(58855),Q(8728)]},45580:function(It,Ue,Q){var he=Q(69078),fe=he.Global,i=he.trim;It.exports={name:"cookieStorage",read:E,write:g,each:p,remove:l,clearAll:h};var M=fe.document;function E(d){if(!d||!v(d))return null;var o="(?:^|.*;\\s*)"+escape(d).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(M.cookie.replace(new RegExp(o),"$1"))}function p(d){for(var o=M.cookie.split(/; ?/g),s=o.length-1;s>=0;s--)if(i(o[s])){var u=o[s].split("="),m=unescape(u[0]),y=unescape(u[1]);d(y,m)}}function g(d,o){d&&(M.cookie=escape(d)+"="+escape(o)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/")}function l(d){!d||!v(d)||(M.cookie=escape(d)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}function h(){p(function(d,o){l(o)})}function v(d){return new RegExp("(?:^|;\\s*)"+escape(d).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(M.cookie)}},39627:function(It,Ue,Q){var he=Q(69078),fe=he.Global;It.exports={name:"localStorage",read:M,write:E,each:p,remove:g,clearAll:l};function i(){return fe.localStorage}function M(h){return i().getItem(h)}function E(h,v){return i().setItem(h,v)}function p(h){for(var v=i().length-1;v>=0;v--){var d=i().key(v);h(M(d),d)}}function g(h){return i().removeItem(h)}function l(){return i().clear()}},8728:function(It){It.exports={name:"memoryStorage",read:Q,write:he,each:fe,remove:i,clearAll:M};var Ue={};function Q(E){return Ue[E]}function he(E,p){Ue[E]=p}function fe(E){for(var p in Ue)Ue.hasOwnProperty(p)&&E(Ue[p],p)}function i(E){delete Ue[E]}function M(E){Ue={}}},95347:function(It,Ue,Q){var he=Q(69078),fe=he.Global;It.exports={name:"oldFF-globalStorage",read:M,write:E,each:p,remove:g,clearAll:l};var i=fe.globalStorage;function M(h){return i[h]}function E(h,v){i[h]=v}function p(h){for(var v=i.length-1;v>=0;v--){var d=i.key(v);h(i[d],d)}}function g(h){return i.removeItem(h)}function l(){p(function(h,v){delete i[h]})}},34524:function(It,Ue,Q){var he=Q(69078),fe=he.Global;It.exports={name:"oldIE-userDataStorage",write:g,read:l,each:h,remove:v,clearAll:d};var i="storejs",M=fe.document,E=u(),p=(fe.navigator?fe.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function g(m,y){if(!p){var _=s(m);E(function(x){x.setAttribute(_,y),x.save(i)})}}function l(m){if(!p){var y=s(m),_=null;return E(function(x){_=x.getAttribute(y)}),_}}function h(m){E(function(y){for(var _=y.XMLDocument.documentElement.attributes,x=_.length-1;x>=0;x--){var S=_[x];m(y.getAttribute(S.name),S.name)}})}function v(m){var y=s(m);E(function(_){_.removeAttribute(y),_.save(i)})}function d(){E(function(m){var y=m.XMLDocument.documentElement.attributes;m.load(i);for(var _=y.length-1;_>=0;_--)m.removeAttribute(y[_].name);m.save(i)})}var o=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function s(m){return m.replace(/^\d/,"___$&").replace(o,"___")}function u(){if(!M||!M.documentElement||!M.documentElement.addBehavior)return null;var m="script",y,_,x;try{_=new ActiveXObject("htmlfile"),_.open(),_.write("<"+m+">document.w=window</"+m+'><iframe src="/favicon.ico"></iframe>'),_.close(),y=_.w.frames[0].document,x=y.createElement("div")}catch(S){x=M.createElement("div"),y=M.body}return function(S){var w=[].slice.call(arguments,0);w.unshift(x),y.appendChild(x),x.addBehavior("#default#userData"),x.load(i),S.apply(this,w),y.removeChild(x)}}},58855:function(It,Ue,Q){var he=Q(69078),fe=he.Global;It.exports={name:"sessionStorage",read:M,write:E,each:p,remove:g,clearAll:l};function i(){return fe.sessionStorage}function M(h){return i().getItem(h)}function E(h,v){return i().setItem(h,v)}function p(h){for(var v=i().length-1;v>=0;v--){var d=i().key(v);h(M(d),d)}}function g(h){return i().removeItem(h)}function l(){return i().clear()}},12320:function(It){(function(Ue,Q){if(1)It.exports=Q();else var he,fe})(window,function(){return function(Ue){var Q={};function he(fe){if(Q[fe])return Q[fe].exports;var i=Q[fe]={i:fe,l:!1,exports:{}};return Ue[fe].call(i.exports,i,i.exports,he),i.l=!0,i.exports}return he.m=Ue,he.c=Q,he.d=function(fe,i,M){he.o(fe,i)||Object.defineProperty(fe,i,{enumerable:!0,get:M})},he.r=function(fe){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(fe,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(fe,"__esModule",{value:!0})},he.t=function(fe,i){if(1&i&&(fe=he(fe)),8&i||4&i&&typeof fe=="object"&&fe&&fe.__esModule)return fe;var M=Object.create(null);if(he.r(M),Object.defineProperty(M,"default",{enumerable:!0,value:fe}),2&i&&typeof fe!="string")for(var E in fe)he.d(M,E,function(p){return fe[p]}.bind(null,E));return M},he.n=function(fe){var i=fe&&fe.__esModule?function(){return fe.default}:function(){return fe};return he.d(i,"a",i),i},he.o=function(fe,i){return Object.prototype.hasOwnProperty.call(fe,i)},he.p="",he(he.s=34)}([function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.forwardEvent=Q.EventEmitter=void 0;var fe=function(){function i(){this._listeners=[],this._disposed=!1}return Object.defineProperty(i.prototype,"event",{get:function(){var M=this;return this._event||(this._event=function(E){return M._listeners.push(E),{dispose:function(){if(!M._disposed){for(var p=0;p<M._listeners.length;p++)if(M._listeners[p]===E)return void M._listeners.splice(p,1)}}}}),this._event},enumerable:!1,configurable:!0}),i.prototype.fire=function(M,E){for(var p=[],g=0;g<this._listeners.length;g++)p.push(this._listeners[g]);for(g=0;g<p.length;g++)p[g].call(void 0,M,E)},i.prototype.dispose=function(){this._listeners&&(this._listeners.length=0),this._disposed=!0},i}();Q.EventEmitter=fe,Q.forwardEvent=function(i,M){return i(function(E){return M.fire(E)})}},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.IUnicodeService=Q.IOptionsService=Q.ILogService=Q.IInstantiationService=Q.IDirtyRowService=Q.ICharsetService=Q.ICoreService=Q.ICoreMouseService=Q.IBufferService=void 0;var fe=he(14);Q.IBufferService=fe.createDecorator("BufferService"),Q.ICoreMouseService=fe.createDecorator("CoreMouseService"),Q.ICoreService=fe.createDecorator("CoreService"),Q.ICharsetService=fe.createDecorator("CharsetService"),Q.IDirtyRowService=fe.createDecorator("DirtyRowService"),Q.IInstantiationService=fe.createDecorator("InstantiationService"),Q.ILogService=fe.createDecorator("LogService"),Q.IOptionsService=fe.createDecorator("OptionsService"),Q.IUnicodeService=fe.createDecorator("UnicodeService")},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.getDisposeArrayDisposable=Q.disposeArray=Q.Disposable=void 0;var fe=function(){function M(){this._disposables=[],this._isDisposed=!1}return M.prototype.dispose=function(){this._isDisposed=!0;for(var E=0,p=this._disposables;E<p.length;E++)p[E].dispose();this._disposables.length=0},M.prototype.register=function(E){return this._disposables.push(E),E},M.prototype.unregister=function(E){var p=this._disposables.indexOf(E);p!==-1&&this._disposables.splice(p,1)},M}();function i(M){for(var E=0,p=M;E<p.length;E++)p[E].dispose();M.length=0}Q.Disposable=fe,Q.disposeArray=i,Q.getDisposeArrayDisposable=function(M){return{dispose:function(){return i(M)}}}},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.WHITESPACE_CELL_CODE=Q.WHITESPACE_CELL_WIDTH=Q.WHITESPACE_CELL_CHAR=Q.NULL_CELL_CODE=Q.NULL_CELL_WIDTH=Q.NULL_CELL_CHAR=Q.CHAR_DATA_CODE_INDEX=Q.CHAR_DATA_WIDTH_INDEX=Q.CHAR_DATA_CHAR_INDEX=Q.CHAR_DATA_ATTR_INDEX=Q.DEFAULT_ATTR=Q.DEFAULT_COLOR=void 0,Q.DEFAULT_COLOR=256,Q.DEFAULT_ATTR=256|Q.DEFAULT_COLOR<<9,Q.CHAR_DATA_ATTR_INDEX=0,Q.CHAR_DATA_CHAR_INDEX=1,Q.CHAR_DATA_WIDTH_INDEX=2,Q.CHAR_DATA_CODE_INDEX=3,Q.NULL_CELL_CHAR="",Q.NULL_CELL_WIDTH=1,Q.NULL_CELL_CODE=0,Q.WHITESPACE_CELL_CHAR=" ",Q.WHITESPACE_CELL_WIDTH=1,Q.WHITESPACE_CELL_CODE=32},function(Ue,Q,he){"use strict";var fe,i=this&&this.__extends||(fe=function(l,h){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,d){v.__proto__=d}||function(v,d){for(var o in d)d.hasOwnProperty(o)&&(v[o]=d[o])})(l,h)},function(l,h){function v(){this.constructor=l}fe(l,h),l.prototype=h===null?Object.create(h):(v.prototype=h.prototype,new v)});Object.defineProperty(Q,"__esModule",{value:!0}),Q.CellData=void 0;var M=he(8),E=he(3),p=he(6),g=function(l){function h(){var v=l!==null&&l.apply(this,arguments)||this;return v.content=0,v.fg=0,v.bg=0,v.extended=new p.ExtendedAttrs,v.combinedData="",v}return i(h,l),h.fromCharData=function(v){var d=new h;return d.setFromCharData(v),d},h.prototype.isCombined=function(){return 2097152&this.content},h.prototype.getWidth=function(){return this.content>>22},h.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?M.stringFromCodePoint(2097151&this.content):""},h.prototype.getCode=function(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content},h.prototype.setFromCharData=function(v){this.fg=v[E.CHAR_DATA_ATTR_INDEX],this.bg=0;var d=!1;if(v[E.CHAR_DATA_CHAR_INDEX].length>2)d=!0;else if(v[E.CHAR_DATA_CHAR_INDEX].length===2){var o=v[E.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=o&&o<=56319){var s=v[E.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=s&&s<=57343?this.content=1024*(o-55296)+s-56320+65536|v[E.CHAR_DATA_WIDTH_INDEX]<<22:d=!0}else d=!0}else this.content=v[E.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|v[E.CHAR_DATA_WIDTH_INDEX]<<22;d&&(this.combinedData=v[E.CHAR_DATA_CHAR_INDEX],this.content=2097152|v[E.CHAR_DATA_WIDTH_INDEX]<<22)},h.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},h}(p.AttributeData);Q.CellData=g},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.ISoundService=Q.ISelectionService=Q.IRenderService=Q.IMouseService=Q.ICoreBrowserService=Q.ICharSizeService=void 0;var fe=he(14);Q.ICharSizeService=fe.createDecorator("CharSizeService"),Q.ICoreBrowserService=fe.createDecorator("CoreBrowserService"),Q.IMouseService=fe.createDecorator("MouseService"),Q.IRenderService=fe.createDecorator("RenderService"),Q.ISelectionService=fe.createDecorator("SelectionService"),Q.ISoundService=fe.createDecorator("SoundService")},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.ExtendedAttrs=Q.AttributeData=void 0;var fe=function(){function M(){this.fg=0,this.bg=0,this.extended=new i}return M.toColorRGB=function(E){return[E>>>16&255,E>>>8&255,255&E]},M.fromColorRGB=function(E){return(255&E[0])<<16|(255&E[1])<<8|255&E[2]},M.prototype.clone=function(){var E=new M;return E.fg=this.fg,E.bg=this.bg,E.extended=this.extended.clone(),E},M.prototype.isInverse=function(){return 67108864&this.fg},M.prototype.isBold=function(){return 134217728&this.fg},M.prototype.isUnderline=function(){return 268435456&this.fg},M.prototype.isBlink=function(){return 536870912&this.fg},M.prototype.isInvisible=function(){return 1073741824&this.fg},M.prototype.isItalic=function(){return 67108864&this.bg},M.prototype.isDim=function(){return 134217728&this.bg},M.prototype.getFgColorMode=function(){return 50331648&this.fg},M.prototype.getBgColorMode=function(){return 50331648&this.bg},M.prototype.isFgRGB=function(){return(50331648&this.fg)==50331648},M.prototype.isBgRGB=function(){return(50331648&this.bg)==50331648},M.prototype.isFgPalette=function(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432},M.prototype.isBgPalette=function(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432},M.prototype.isFgDefault=function(){return(50331648&this.fg)==0},M.prototype.isBgDefault=function(){return(50331648&this.bg)==0},M.prototype.isAttributeDefault=function(){return this.fg===0&&this.bg===0},M.prototype.getFgColor=function(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}},M.prototype.getBgColor=function(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}},M.prototype.hasExtendedAttrs=function(){return 268435456&this.bg},M.prototype.updateExtended=function(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456},M.prototype.getUnderlineColor=function(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()},M.prototype.getUnderlineColorMode=function(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()},M.prototype.isUnderlineColorRGB=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()},M.prototype.isUnderlineColorPalette=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()},M.prototype.isUnderlineColorDefault=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()},M.prototype.getUnderlineStyle=function(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0},M}();Q.AttributeData=fe;var i=function(){function M(E,p){E===void 0&&(E=0),p===void 0&&(p=-1),this.underlineStyle=E,this.underlineColor=p}return M.prototype.clone=function(){return new M(this.underlineStyle,this.underlineColor)},M.prototype.isEmpty=function(){return this.underlineStyle===0},M}();Q.ExtendedAttrs=i},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.addDisposableDomListener=void 0,Q.addDisposableDomListener=function(fe,i,M,E){fe.addEventListener(i,M,E);var p=!1;return{dispose:function(){p||(p=!0,fe.removeEventListener(i,M,E))}}}},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.Utf8ToUtf32=Q.StringToUtf32=Q.utf32ToString=Q.stringFromCodePoint=void 0,Q.stringFromCodePoint=function(M){return M>65535?(M-=65536,String.fromCharCode(55296+(M>>10))+String.fromCharCode(M%1024+56320)):String.fromCharCode(M)},Q.utf32ToString=function(M,E,p){E===void 0&&(E=0),p===void 0&&(p=M.length);for(var g="",l=E;l<p;++l){var h=M[l];h>65535?(h-=65536,g+=String.fromCharCode(55296+(h>>10))+String.fromCharCode(h%1024+56320)):g+=String.fromCharCode(h)}return g};var fe=function(){function M(){this._interim=0}return M.prototype.clear=function(){this._interim=0},M.prototype.decode=function(E,p){var g=E.length;if(!g)return 0;var l=0,h=0;this._interim&&(56320<=(o=E.charCodeAt(h++))&&o<=57343?p[l++]=1024*(this._interim-55296)+o-56320+65536:(p[l++]=this._interim,p[l++]=o),this._interim=0);for(var v=h;v<g;++v){var d=E.charCodeAt(v);if(55296<=d&&d<=56319){if(++v>=g)return this._interim=d,l;var o;56320<=(o=E.charCodeAt(v))&&o<=57343?p[l++]=1024*(d-55296)+o-56320+65536:(p[l++]=d,p[l++]=o)}else p[l++]=d}return l},M}();Q.StringToUtf32=fe;var i=function(){function M(){this.interim=new Uint8Array(3)}return M.prototype.clear=function(){this.interim.fill(0)},M.prototype.decode=function(E,p){var g=E.length;if(!g)return 0;var l,h,v,d,o=0,s=0,u=0;if(this.interim[0]){var m=!1,y=this.interim[0];y&=(224&y)==192?31:(240&y)==224?15:7;for(var _=0,x=void 0;(x=63&this.interim[++_])&&_<4;)y<<=6,y|=x;for(var S=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,w=S-_;u<w;){if(u>=g)return 0;if((192&(x=E[u++]))!=128){u--,m=!0;break}this.interim[_++]=x,y<<=6,y|=63&x}m||(S===2?y<128?u--:p[o++]=y:S===3?y<2048||y>=55296&&y<=57343||(p[o++]=y):y<65536||y>1114111||(p[o++]=y)),this.interim.fill(0)}for(var A=g-4,H=u;H<g;){for(;!(!(H<A)||128&(l=E[H])||128&(h=E[H+1])||128&(v=E[H+2])||128&(d=E[H+3]));)p[o++]=l,p[o++]=h,p[o++]=v,p[o++]=d,H+=4;if((l=E[H++])<128)p[o++]=l;else if((224&l)==192){if(H>=g)return this.interim[0]=l,o;if((192&(h=E[H++]))!=128){H--;continue}if((s=(31&l)<<6|63&h)<128){H--;continue}p[o++]=s}else if((240&l)==224){if(H>=g)return this.interim[0]=l,o;if((192&(h=E[H++]))!=128){H--;continue}if(H>=g)return this.interim[0]=l,this.interim[1]=h,o;if((192&(v=E[H++]))!=128){H--;continue}if((s=(15&l)<<12|(63&h)<<6|63&v)<2048||s>=55296&&s<=57343)continue;p[o++]=s}else if((248&l)==240){if(H>=g)return this.interim[0]=l,o;if((192&(h=E[H++]))!=128){H--;continue}if(H>=g)return this.interim[0]=l,this.interim[1]=h,o;if((192&(v=E[H++]))!=128){H--;continue}if(H>=g)return this.interim[0]=l,this.interim[1]=h,this.interim[2]=v,o;if((192&(d=E[H++]))!=128){H--;continue}if((s=(7&l)<<18|(63&h)<<12|(63&v)<<6|63&d)<65536||s>1114111)continue;p[o++]=s}}return o},M}();Q.Utf8ToUtf32=i},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.CHAR_ATLAS_CELL_SPACING=Q.DIM_OPACITY=Q.INVERTED_DEFAULT_COLOR=void 0,Q.INVERTED_DEFAULT_COLOR=257,Q.DIM_OPACITY=.5,Q.CHAR_ATLAS_CELL_SPACING=1},function(Ue,Q,he){"use strict";var fe,i,M,E;function p(l){var h=l.toString(16);return h.length<2?"0"+h:h}function g(l,h){return l<h?(h+.05)/(l+.05):(l+.05)/(h+.05)}Object.defineProperty(Q,"__esModule",{value:!0}),Q.contrastRatio=Q.toPaddedHex=Q.rgba=Q.rgb=Q.css=Q.color=Q.channels=void 0,function(l){l.toCss=function(h,v,d,o){return o!==void 0?"#"+p(h)+p(v)+p(d)+p(o):"#"+p(h)+p(v)+p(d)},l.toRgba=function(h,v,d,o){return o===void 0&&(o=255),(h<<24|v<<16|d<<8|o)>>>0}}(fe=Q.channels||(Q.channels={})),(i=Q.color||(Q.color={})).blend=function(l,h){var v=(255&h.rgba)/255;if(v===1)return{css:h.css,rgba:h.rgba};var d=h.rgba>>24&255,o=h.rgba>>16&255,s=h.rgba>>8&255,u=l.rgba>>24&255,m=l.rgba>>16&255,y=l.rgba>>8&255,_=u+Math.round((d-u)*v),x=m+Math.round((o-m)*v),S=y+Math.round((s-y)*v);return{css:fe.toCss(_,x,S),rgba:fe.toRgba(_,x,S)}},i.isOpaque=function(l){return(255&l.rgba)==255},i.ensureContrastRatio=function(l,h,v){var d=E.ensureContrastRatio(l.rgba,h.rgba,v);if(d)return E.toColor(d>>24&255,d>>16&255,d>>8&255)},i.opaque=function(l){var h=(255|l.rgba)>>>0,v=E.toChannels(h),d=v[0],o=v[1],s=v[2];return{css:fe.toCss(d,o,s),rgba:h}},i.opacity=function(l,h){var v=Math.round(255*h),d=E.toChannels(l.rgba),o=d[0],s=d[1],u=d[2];return{css:fe.toCss(o,s,u,v),rgba:fe.toRgba(o,s,u,v)}},(Q.css||(Q.css={})).toColor=function(l){switch(l.length){case 7:return{css:l,rgba:(parseInt(l.slice(1),16)<<8|255)>>>0};case 9:return{css:l,rgba:parseInt(l.slice(1),16)>>>0}}throw new Error("css.toColor: Unsupported css format")},function(l){function h(v,d,o){var s=v/255,u=d/255,m=o/255;return .2126*(s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4))+.7152*(u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4))+.0722*(m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4))}l.relativeLuminance=function(v){return h(v>>16&255,v>>8&255,255&v)},l.relativeLuminance2=h}(M=Q.rgb||(Q.rgb={})),function(l){function h(d,o,s){for(var u=d>>24&255,m=d>>16&255,y=d>>8&255,_=o>>24&255,x=o>>16&255,S=o>>8&255,w=g(M.relativeLuminance2(_,S,x),M.relativeLuminance2(u,m,y));w<s&&(_>0||x>0||S>0);)_-=Math.max(0,Math.ceil(.1*_)),x-=Math.max(0,Math.ceil(.1*x)),S-=Math.max(0,Math.ceil(.1*S)),w=g(M.relativeLuminance2(_,S,x),M.relativeLuminance2(u,m,y));return(_<<24|x<<16|S<<8|255)>>>0}function v(d,o,s){for(var u=d>>24&255,m=d>>16&255,y=d>>8&255,_=o>>24&255,x=o>>16&255,S=o>>8&255,w=g(M.relativeLuminance2(_,S,x),M.relativeLuminance2(u,m,y));w<s&&(_<255||x<255||S<255);)_=Math.min(255,_+Math.ceil(.1*(255-_))),x=Math.min(255,x+Math.ceil(.1*(255-x))),S=Math.min(255,S+Math.ceil(.1*(255-S))),w=g(M.relativeLuminance2(_,S,x),M.relativeLuminance2(u,m,y));return(_<<24|x<<16|S<<8|255)>>>0}l.ensureContrastRatio=function(d,o,s){var u=M.relativeLuminance(d>>8),m=M.relativeLuminance(o>>8);if(g(u,m)<s)return m<u?h(d,o,s):v(d,o,s)},l.reduceLuminance=h,l.increaseLuminance=v,l.toChannels=function(d){return[d>>24&255,d>>16&255,d>>8&255,255&d]},l.toColor=function(d,o,s){return{css:fe.toCss(d,o,s),rgba:fe.toRgba(d,o,s)}}}(E=Q.rgba||(Q.rgba={})),Q.toPaddedHex=p,Q.contrastRatio=g},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.isLinux=Q.isWindows=Q.isIphone=Q.isIpad=Q.isMac=Q.isSafari=Q.isFirefox=void 0;var fe=typeof navigator=="undefined",i=fe?"node":navigator.userAgent,M=fe?"node":navigator.platform;function E(p,g){return p.indexOf(g)>=0}Q.isFirefox=!!~i.indexOf("Firefox"),Q.isSafari=/^((?!chrome|android).)*safari/i.test(i),Q.isMac=E(["Macintosh","MacIntel","MacPPC","Mac68K"],M),Q.isIpad=M==="iPad",Q.isIphone=M==="iPhone",Q.isWindows=E(["Windows","Win16","Win32","WinCE"],M),Q.isLinux=M.indexOf("Linux")>=0},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.C1=Q.C0=void 0,function(fe){fe.NUL="\0",fe.SOH="",fe.STX="",fe.ETX="",fe.EOT="",fe.ENQ="",fe.ACK="",fe.BEL="\x07",fe.BS="\b",fe.HT=" ",fe.LF=`
`,fe.VT="\v",fe.FF="\f",fe.CR="\r",fe.SO="",fe.SI="",fe.DLE="",fe.DC1="",fe.DC2="",fe.DC3="",fe.DC4="",fe.NAK="",fe.SYN="",fe.ETB="",fe.CAN="",fe.EM="",fe.SUB="",fe.ESC="\x1B",fe.FS="",fe.GS="",fe.RS="",fe.US="",fe.SP=" ",fe.DEL="\x7F"}(Q.C0||(Q.C0={})),function(fe){fe.PAD="\x80",fe.HOP="\x81",fe.BPH="\x82",fe.NBH="\x83",fe.IND="\x84",fe.NEL="\x85",fe.SSA="\x86",fe.ESA="\x87",fe.HTS="\x88",fe.HTJ="\x89",fe.VTS="\x8A",fe.PLD="\x8B",fe.PLU="\x8C",fe.RI="\x8D",fe.SS2="\x8E",fe.SS3="\x8F",fe.DCS="\x90",fe.PU1="\x91",fe.PU2="\x92",fe.STS="\x93",fe.CCH="\x94",fe.MW="\x95",fe.SPA="\x96",fe.EPA="\x97",fe.SOS="\x98",fe.SGCI="\x99",fe.SCI="\x9A",fe.CSI="\x9B",fe.ST="\x9C",fe.OSC="\x9D",fe.PM="\x9E",fe.APC="\x9F"}(Q.C1||(Q.C1={}))},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.BaseRenderLayer=void 0;var fe=he(3),i=he(9),M=he(25),E=he(6),p=he(28),g=he(10),l=he(17),h=function(){function v(d,o,s,u,m,y,_,x){this._container=d,this._alpha=u,this._colors=m,this._rendererId=y,this._bufferService=_,this._optionsService=x,this._scaledCharWidth=0,this._scaledCharHeight=0,this._scaledCellWidth=0,this._scaledCellHeight=0,this._scaledCharLeft=0,this._scaledCharTop=0,this._currentGlyphIdentifier={chars:"",code:0,bg:0,fg:0,bold:!1,dim:!1,italic:!1},this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-"+o+"-layer"),this._canvas.style.zIndex=s.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}return v.prototype.dispose=function(){var d;l.removeElementFromParent(this._canvas),(d=this._charAtlas)===null||d===void 0||d.dispose()},v.prototype._initCanvas=function(){this._ctx=p.throwIfFalsy(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()},v.prototype.onOptionsChanged=function(){},v.prototype.onBlur=function(){},v.prototype.onFocus=function(){},v.prototype.onCursorMove=function(){},v.prototype.onGridChanged=function(d,o){},v.prototype.onSelectionChanged=function(d,o,s){s===void 0&&(s=!1)},v.prototype.setColors=function(d){this._refreshCharAtlas(d)},v.prototype._setTransparency=function(d){if(d!==this._alpha){var o=this._canvas;this._alpha=d,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,o),this._refreshCharAtlas(this._colors),this.onGridChanged(0,this._bufferService.rows-1)}},v.prototype._refreshCharAtlas=function(d){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=M.acquireCharAtlas(this._optionsService.options,this._rendererId,d,this._scaledCharWidth,this._scaledCharHeight),this._charAtlas.warmUp())},v.prototype.resize=function(d){this._scaledCellWidth=d.scaledCellWidth,this._scaledCellHeight=d.scaledCellHeight,this._scaledCharWidth=d.scaledCharWidth,this._scaledCharHeight=d.scaledCharHeight,this._scaledCharLeft=d.scaledCharLeft,this._scaledCharTop=d.scaledCharTop,this._canvas.width=d.scaledCanvasWidth,this._canvas.height=d.scaledCanvasHeight,this._canvas.style.width=d.canvasWidth+"px",this._canvas.style.height=d.canvasHeight+"px",this._alpha||this._clearAll(),this._refreshCharAtlas(this._colors)},v.prototype._fillCells=function(d,o,s,u){this._ctx.fillRect(d*this._scaledCellWidth,o*this._scaledCellHeight,s*this._scaledCellWidth,u*this._scaledCellHeight)},v.prototype._fillBottomLineAtCells=function(d,o,s){s===void 0&&(s=1),this._ctx.fillRect(d*this._scaledCellWidth,(o+1)*this._scaledCellHeight-window.devicePixelRatio-1,s*this._scaledCellWidth,window.devicePixelRatio)},v.prototype._fillLeftLineAtCell=function(d,o,s){this._ctx.fillRect(d*this._scaledCellWidth,o*this._scaledCellHeight,window.devicePixelRatio*s,this._scaledCellHeight)},v.prototype._strokeRectAtCell=function(d,o,s,u){this._ctx.lineWidth=window.devicePixelRatio,this._ctx.strokeRect(d*this._scaledCellWidth+window.devicePixelRatio/2,o*this._scaledCellHeight+window.devicePixelRatio/2,s*this._scaledCellWidth-window.devicePixelRatio,u*this._scaledCellHeight-window.devicePixelRatio)},v.prototype._clearAll=function(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))},v.prototype._clearCells=function(d,o,s,u){this._alpha?this._ctx.clearRect(d*this._scaledCellWidth,o*this._scaledCellHeight,s*this._scaledCellWidth,u*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(d*this._scaledCellWidth,o*this._scaledCellHeight,s*this._scaledCellWidth,u*this._scaledCellHeight))},v.prototype._fillCharTrueColor=function(d,o,s){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline="middle",this._clipRow(s),this._ctx.fillText(d.getChars(),o*this._scaledCellWidth+this._scaledCharLeft,s*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2)},v.prototype._drawChars=function(d,o,s){var u,m,y=this._getContrastColor(d);y||d.isFgRGB()||d.isBgRGB()?this._drawUncachedChars(d,o,s,y):(d.isInverse()?(u=d.isBgDefault()?i.INVERTED_DEFAULT_COLOR:d.getBgColor(),m=d.isFgDefault()?i.INVERTED_DEFAULT_COLOR:d.getFgColor()):(m=d.isBgDefault()?fe.DEFAULT_COLOR:d.getBgColor(),u=d.isFgDefault()?fe.DEFAULT_COLOR:d.getFgColor()),u+=this._optionsService.options.drawBoldTextInBrightColors&&d.isBold()&&u<8?8:0,this._currentGlyphIdentifier.chars=d.getChars()||fe.WHITESPACE_CELL_CHAR,this._currentGlyphIdentifier.code=d.getCode()||fe.WHITESPACE_CELL_CODE,this._currentGlyphIdentifier.bg=m,this._currentGlyphIdentifier.fg=u,this._currentGlyphIdentifier.bold=!!d.isBold(),this._currentGlyphIdentifier.dim=!!d.isDim(),this._currentGlyphIdentifier.italic=!!d.isItalic(),this._charAtlas&&this._charAtlas.draw(this._ctx,this._currentGlyphIdentifier,o*this._scaledCellWidth+this._scaledCharLeft,s*this._scaledCellHeight+this._scaledCharTop)||this._drawUncachedChars(d,o,s))},v.prototype._drawUncachedChars=function(d,o,s,u){if(this._ctx.save(),this._ctx.font=this._getFont(!!d.isBold(),!!d.isItalic()),this._ctx.textBaseline="middle",d.isInverse())if(u)this._ctx.fillStyle=u.css;else if(d.isBgDefault())this._ctx.fillStyle=g.color.opaque(this._colors.background).css;else if(d.isBgRGB())this._ctx.fillStyle="rgb("+E.AttributeData.toColorRGB(d.getBgColor()).join(",")+")";else{var m=d.getBgColor();this._optionsService.options.drawBoldTextInBrightColors&&d.isBold()&&m<8&&(m+=8),this._ctx.fillStyle=this._colors.ansi[m].css}else if(u)this._ctx.fillStyle=u.css;else if(d.isFgDefault())this._ctx.fillStyle=this._colors.foreground.css;else if(d.isFgRGB())this._ctx.fillStyle="rgb("+E.AttributeData.toColorRGB(d.getFgColor()).join(",")+")";else{var y=d.getFgColor();this._optionsService.options.drawBoldTextInBrightColors&&d.isBold()&&y<8&&(y+=8),this._ctx.fillStyle=this._colors.ansi[y].css}this._clipRow(s),d.isDim()&&(this._ctx.globalAlpha=i.DIM_OPACITY),this._ctx.fillText(d.getChars(),o*this._scaledCellWidth+this._scaledCharLeft,s*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2),this._ctx.restore()},v.prototype._clipRow=function(d){this._ctx.beginPath(),this._ctx.rect(0,d*this._scaledCellHeight,this._bufferService.cols*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()},v.prototype._getFont=function(d,o){return(o?"italic":"")+" "+(d?this._optionsService.options.fontWeightBold:this._optionsService.options.fontWeight)+" "+this._optionsService.options.fontSize*window.devicePixelRatio+"px "+this._optionsService.options.fontFamily},v.prototype._getContrastColor=function(d){if(this._optionsService.options.minimumContrastRatio!==1){var o=this._colors.contrastCache.getColor(d.bg,d.fg);if(o!==void 0)return o||void 0;var s=d.getFgColor(),u=d.getFgColorMode(),m=d.getBgColor(),y=d.getBgColorMode(),_=!!d.isInverse(),x=!!d.isInverse();if(_){var S=s;s=m,m=S;var w=u;u=y,y=w}var A=this._resolveBackgroundRgba(y,m,_),H=this._resolveForegroundRgba(u,s,_,x),R=g.rgba.ensureContrastRatio(A,H,this._optionsService.options.minimumContrastRatio);if(R){var F={css:g.channels.toCss(R>>24&255,R>>16&255,R>>8&255),rgba:R};return this._colors.contrastCache.setColor(d.bg,d.fg,F),F}this._colors.contrastCache.setColor(d.bg,d.fg,null)}},v.prototype._resolveBackgroundRgba=function(d,o,s){switch(d){case 16777216:case 33554432:return this._colors.ansi[o].rgba;case 50331648:return o<<8;case 0:default:return s?this._colors.foreground.rgba:this._colors.background.rgba}},v.prototype._resolveForegroundRgba=function(d,o,s,u){switch(d){case 16777216:case 33554432:return this._optionsService.options.drawBoldTextInBrightColors&&u&&o<8&&(o+=8),this._colors.ansi[o].rgba;case 50331648:return o<<8;case 0:default:return s?this._colors.background.rgba:this._colors.foreground.rgba}},v}();Q.BaseRenderLayer=h},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.createDecorator=Q.getServiceDependencies=Q.serviceRegistry=void 0;function fe(i,M,E){M.di$target===M?M.di$dependencies.push({id:i,index:E}):(M.di$dependencies=[{id:i,index:E}],M.di$target=M)}Q.serviceRegistry=new Map,Q.getServiceDependencies=function(i){return i.di$dependencies||[]},Q.createDecorator=function(i){if(Q.serviceRegistry.has(i))return Q.serviceRegistry.get(i);var M=function(E,p,g){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");fe(M,E,g)};return M.toString=function(){return i},Q.serviceRegistry.set(i,M),M}},function(Ue,Q,he){"use strict";function fe(i,M,E,p){if(E===void 0&&(E=0),p===void 0&&(p=i.length),E>=i.length)return i;E=(i.length+E)%i.length,p=p>=i.length?i.length:(i.length+p)%i.length;for(var g=E;g<p;++g)i[g]=M;return i}Object.defineProperty(Q,"__esModule",{value:!0}),Q.concat=Q.fillFallback=Q.fill=void 0,Q.fill=function(i,M,E,p){return i.fill?i.fill(M,E,p):fe(i,M,E,p)},Q.fillFallback=fe,Q.concat=function(i,M){var E=new i.constructor(i.length+M.length);return E.set(i),E.set(M,i.length),E}},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.BufferLine=Q.DEFAULT_ATTR_DATA=void 0;var fe=he(8),i=he(3),M=he(4),E=he(6);Q.DEFAULT_ATTR_DATA=Object.freeze(new E.AttributeData);var p=function(){function g(l,h,v){v===void 0&&(v=!1),this.isWrapped=v,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*l);for(var d=h||M.CellData.fromCharData([0,i.NULL_CELL_CHAR,i.NULL_CELL_WIDTH,i.NULL_CELL_CODE]),o=0;o<l;++o)this.setCell(o,d);this.length=l}return g.prototype.get=function(l){var h=this._data[3*l+0],v=2097151&h;return[this._data[3*l+1],2097152&h?this._combined[l]:v?fe.stringFromCodePoint(v):"",h>>22,2097152&h?this._combined[l].charCodeAt(this._combined[l].length-1):v]},g.prototype.set=function(l,h){this._data[3*l+1]=h[i.CHAR_DATA_ATTR_INDEX],h[i.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[l]=h[1],this._data[3*l+0]=2097152|l|h[i.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*l+0]=h[i.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|h[i.CHAR_DATA_WIDTH_INDEX]<<22},g.prototype.getWidth=function(l){return this._data[3*l+0]>>22},g.prototype.hasWidth=function(l){return 12582912&this._data[3*l+0]},g.prototype.getFg=function(l){return this._data[3*l+1]},g.prototype.getBg=function(l){return this._data[3*l+2]},g.prototype.hasContent=function(l){return 4194303&this._data[3*l+0]},g.prototype.getCodePoint=function(l){var h=this._data[3*l+0];return 2097152&h?this._combined[l].charCodeAt(this._combined[l].length-1):2097151&h},g.prototype.isCombined=function(l){return 2097152&this._data[3*l+0]},g.prototype.getString=function(l){var h=this._data[3*l+0];return 2097152&h?this._combined[l]:2097151&h?fe.stringFromCodePoint(2097151&h):""},g.prototype.loadCell=function(l,h){var v=3*l;return h.content=this._data[v+0],h.fg=this._data[v+1],h.bg=this._data[v+2],2097152&h.content&&(h.combinedData=this._combined[l]),268435456&h.bg&&(h.extended=this._extendedAttrs[l]),h},g.prototype.setCell=function(l,h){2097152&h.content&&(this._combined[l]=h.combinedData),268435456&h.bg&&(this._extendedAttrs[l]=h.extended),this._data[3*l+0]=h.content,this._data[3*l+1]=h.fg,this._data[3*l+2]=h.bg},g.prototype.setCellFromCodePoint=function(l,h,v,d,o,s){268435456&o&&(this._extendedAttrs[l]=s),this._data[3*l+0]=h|v<<22,this._data[3*l+1]=d,this._data[3*l+2]=o},g.prototype.addCodepointToCell=function(l,h){var v=this._data[3*l+0];2097152&v?this._combined[l]+=fe.stringFromCodePoint(h):(2097151&v?(this._combined[l]=fe.stringFromCodePoint(2097151&v)+fe.stringFromCodePoint(h),v&=-2097152,v|=2097152):v=h|1<<22,this._data[3*l+0]=v)},g.prototype.insertCells=function(l,h,v,d){if((l%=this.length)&&this.getWidth(l-1)===2&&this.setCellFromCodePoint(l-1,0,1,(d==null?void 0:d.fg)||0,(d==null?void 0:d.bg)||0,(d==null?void 0:d.extended)||new E.ExtendedAttrs),h<this.length-l){for(var o=new M.CellData,s=this.length-l-h-1;s>=0;--s)this.setCell(l+h+s,this.loadCell(l+s,o));for(s=0;s<h;++s)this.setCell(l+s,v)}else for(s=l;s<this.length;++s)this.setCell(s,v);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(d==null?void 0:d.fg)||0,(d==null?void 0:d.bg)||0,(d==null?void 0:d.extended)||new E.ExtendedAttrs)},g.prototype.deleteCells=function(l,h,v,d){if(l%=this.length,h<this.length-l){for(var o=new M.CellData,s=0;s<this.length-l-h;++s)this.setCell(l+s,this.loadCell(l+h+s,o));for(s=this.length-h;s<this.length;++s)this.setCell(s,v)}else for(s=l;s<this.length;++s)this.setCell(s,v);l&&this.getWidth(l-1)===2&&this.setCellFromCodePoint(l-1,0,1,(d==null?void 0:d.fg)||0,(d==null?void 0:d.bg)||0,(d==null?void 0:d.extended)||new E.ExtendedAttrs),this.getWidth(l)!==0||this.hasContent(l)||this.setCellFromCodePoint(l,0,1,(d==null?void 0:d.fg)||0,(d==null?void 0:d.bg)||0,(d==null?void 0:d.extended)||new E.ExtendedAttrs)},g.prototype.replaceCells=function(l,h,v,d){for(l&&this.getWidth(l-1)===2&&this.setCellFromCodePoint(l-1,0,1,(d==null?void 0:d.fg)||0,(d==null?void 0:d.bg)||0,(d==null?void 0:d.extended)||new E.ExtendedAttrs),h<this.length&&this.getWidth(h-1)===2&&this.setCellFromCodePoint(h,0,1,(d==null?void 0:d.fg)||0,(d==null?void 0:d.bg)||0,(d==null?void 0:d.extended)||new E.ExtendedAttrs);l<h&&l<this.length;)this.setCell(l++,v)},g.prototype.resize=function(l,h){if(l!==this.length){if(l>this.length){var v=new Uint32Array(3*l);this.length&&(3*l<this._data.length?v.set(this._data.subarray(0,3*l)):v.set(this._data)),this._data=v;for(var d=this.length;d<l;++d)this.setCell(d,h)}else if(l){(v=new Uint32Array(3*l)).set(this._data.subarray(0,3*l)),this._data=v;var o=Object.keys(this._combined);for(d=0;d<o.length;d++){var s=parseInt(o[d],10);s>=l&&delete this._combined[s]}}else this._data=new Uint32Array(0),this._combined={};this.length=l}},g.prototype.fill=function(l){this._combined={},this._extendedAttrs={};for(var h=0;h<this.length;++h)this.setCell(h,l)},g.prototype.copyFrom=function(l){for(var h in this.length!==l.length?this._data=new Uint32Array(l._data):this._data.set(l._data),this.length=l.length,this._combined={},l._combined)this._combined[h]=l._combined[h];for(var h in this._extendedAttrs={},l._extendedAttrs)this._extendedAttrs[h]=l._extendedAttrs[h];this.isWrapped=l.isWrapped},g.prototype.clone=function(){var l=new g(0);for(var h in l._data=new Uint32Array(this._data),l.length=this.length,this._combined)l._combined[h]=this._combined[h];for(var h in this._extendedAttrs)l._extendedAttrs[h]=this._extendedAttrs[h];return l.isWrapped=this.isWrapped,l},g.prototype.getTrimmedLength=function(){for(var l=this.length-1;l>=0;--l)if(4194303&this._data[3*l+0])return l+(this._data[3*l+0]>>22);return 0},g.prototype.copyCellsFrom=function(l,h,v,d,o){var s=l._data;if(o)for(var u=d-1;u>=0;u--)for(var m=0;m<3;m++)this._data[3*(v+u)+m]=s[3*(h+u)+m];else for(u=0;u<d;u++)for(m=0;m<3;m++)this._data[3*(v+u)+m]=s[3*(h+u)+m];var y=Object.keys(l._combined);for(m=0;m<y.length;m++){var _=parseInt(y[m],10);_>=h&&(this._combined[_-h+v]=l._combined[_])}},g.prototype.translateToString=function(l,h,v){l===void 0&&(l=!1),h===void 0&&(h=0),v===void 0&&(v=this.length),l&&(v=Math.min(v,this.getTrimmedLength()));for(var d="";h<v;){var o=this._data[3*h+0],s=2097151&o;d+=2097152&o?this._combined[h]:s?fe.stringFromCodePoint(s):i.WHITESPACE_CELL_CHAR,h+=o>>22||1}return d},g}();Q.BufferLine=p},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.removeElementFromParent=void 0,Q.removeElementFromParent=function(){for(var fe,i=[],M=0;M<arguments.length;M++)i[M]=arguments[M];for(var E=0,p=i;E<p.length;E++){var g=p[E];(fe=g==null?void 0:g.parentElement)===null||fe===void 0||fe.removeChild(g)}}},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.tooMuchOutput=Q.promptLabel=void 0,Q.promptLabel="Terminal input",Q.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},function(Ue,Q,he){"use strict";var fe,i=this&&this.__extends||(fe=function(H,R){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,D){F.__proto__=D}||function(F,D){for(var B in D)D.hasOwnProperty(B)&&(F[B]=D[B])})(H,R)},function(H,R){function F(){this.constructor=H}fe(H,R),H.prototype=R===null?Object.create(R):(F.prototype=R.prototype,new F)});Object.defineProperty(Q,"__esModule",{value:!0}),Q.InputHandler=Q.WindowsOptionsReportType=void 0;var M,E=he(12),p=he(20),g=he(39),l=he(2),h=he(15),v=he(8),d=he(16),o=he(0),s=he(3),u=he(4),m=he(6),y=he(22),_=he(24),x={"(":0,")":1,"*":2,"+":3,"-":1,".":2};function S(H,R){if(H>24)return R.setWinLines||!1;switch(H){case 1:return!!R.restoreWin;case 2:return!!R.minimizeWin;case 3:return!!R.setWinPosition;case 4:return!!R.setWinSizePixels;case 5:return!!R.raiseWin;case 6:return!!R.lowerWin;case 7:return!!R.refreshWin;case 8:return!!R.setWinSizeChars;case 9:return!!R.maximizeWin;case 10:return!!R.fullscreenWin;case 11:return!!R.getWinState;case 13:return!!R.getWinPosition;case 14:return!!R.getWinSizePixels;case 15:return!!R.getScreenSizePixels;case 16:return!!R.getCellSizePixels;case 18:return!!R.getWinSizeChars;case 19:return!!R.getScreenSizeChars;case 20:return!!R.getIconTitle;case 21:return!!R.getWinTitle;case 22:return!!R.pushTitle;case 23:return!!R.popTitle;case 24:return!!R.setWinLines}return!1}(function(H){H[H.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",H[H.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(M=Q.WindowsOptionsReportType||(Q.WindowsOptionsReportType={}));var w=function(){function H(R,F,D,B){this._bufferService=R,this._coreService=F,this._logService=D,this._optionsService=B,this._data=new Uint32Array(0)}return H.prototype.hook=function(R){this._data=new Uint32Array(0)},H.prototype.put=function(R,F,D){this._data=h.concat(this._data,R.subarray(F,D))},H.prototype.unhook=function(R){if(R){var F=v.utf32ToString(this._data);switch(this._data=new Uint32Array(0),F){case'"q':return this._coreService.triggerDataEvent(E.C0.ESC+'P1$r0"q'+E.C0.ESC+"\\");case'"p':return this._coreService.triggerDataEvent(E.C0.ESC+'P1$r61;1"p'+E.C0.ESC+"\\");case"r":var D=this._bufferService.buffer.scrollTop+1+";"+(this._bufferService.buffer.scrollBottom+1)+"r";return this._coreService.triggerDataEvent(E.C0.ESC+"P1$r"+D+E.C0.ESC+"\\");case"m":return this._coreService.triggerDataEvent(E.C0.ESC+"P1$r0m"+E.C0.ESC+"\\");case" q":var B={block:2,underline:4,bar:6}[this._optionsService.options.cursorStyle];return B-=this._optionsService.options.cursorBlink?1:0,this._coreService.triggerDataEvent(E.C0.ESC+"P1$r"+B+" q"+E.C0.ESC+"\\");default:this._logService.debug("Unknown DCS $q %s",F),this._coreService.triggerDataEvent(E.C0.ESC+"P0$r"+E.C0.ESC+"\\")}}else this._data=new Uint32Array(0)},H}(),A=function(H){function R(F,D,B,P,U,G,ee,K,Z){Z===void 0&&(Z=new g.EscapeSequenceParser);var $=H.call(this)||this;$._bufferService=F,$._charsetService=D,$._coreService=B,$._dirtyRowService=P,$._logService=U,$._optionsService=G,$._coreMouseService=ee,$._unicodeService=K,$._parser=Z,$._parseBuffer=new Uint32Array(4096),$._stringDecoder=new v.StringToUtf32,$._utf8Decoder=new v.Utf8ToUtf32,$._workCell=new u.CellData,$._windowTitle="",$._iconName="",$._windowTitleStack=[],$._iconNameStack=[],$._curAttrData=d.DEFAULT_ATTR_DATA.clone(),$._eraseAttrDataInternal=d.DEFAULT_ATTR_DATA.clone(),$._onRequestBell=new o.EventEmitter,$._onRequestRefreshRows=new o.EventEmitter,$._onRequestReset=new o.EventEmitter,$._onRequestScroll=new o.EventEmitter,$._onRequestSyncScrollBar=new o.EventEmitter,$._onRequestWindowsOptionsReport=new o.EventEmitter,$._onA11yChar=new o.EventEmitter,$._onA11yTab=new o.EventEmitter,$._onCursorMove=new o.EventEmitter,$._onLineFeed=new o.EventEmitter,$._onScroll=new o.EventEmitter,$._onTitleChange=new o.EventEmitter,$.register($._parser),$._parser.setCsiHandlerFallback(function(Y,le){$._logService.debug("Unknown CSI code: ",{identifier:$._parser.identToString(Y),params:le.toArray()})}),$._parser.setEscHandlerFallback(function(Y){$._logService.debug("Unknown ESC code: ",{identifier:$._parser.identToString(Y)})}),$._parser.setExecuteHandlerFallback(function(Y){$._logService.debug("Unknown EXECUTE code: ",{code:Y})}),$._parser.setOscHandlerFallback(function(Y,le,xe){$._logService.debug("Unknown OSC code: ",{identifier:Y,action:le,data:xe})}),$._parser.setDcsHandlerFallback(function(Y,le,xe){le==="HOOK"&&(xe=xe.toArray()),$._logService.debug("Unknown DCS code: ",{identifier:$._parser.identToString(Y),action:le,payload:xe})}),$._parser.setPrintHandler(function(Y,le,xe){return $.print(Y,le,xe)}),$._parser.setCsiHandler({final:"@"},function(Y){return $.insertChars(Y)}),$._parser.setCsiHandler({intermediates:" ",final:"@"},function(Y){return $.scrollLeft(Y)}),$._parser.setCsiHandler({final:"A"},function(Y){return $.cursorUp(Y)}),$._parser.setCsiHandler({intermediates:" ",final:"A"},function(Y){return $.scrollRight(Y)}),$._parser.setCsiHandler({final:"B"},function(Y){return $.cursorDown(Y)}),$._parser.setCsiHandler({final:"C"},function(Y){return $.cursorForward(Y)}),$._parser.setCsiHandler({final:"D"},function(Y){return $.cursorBackward(Y)}),$._parser.setCsiHandler({final:"E"},function(Y){return $.cursorNextLine(Y)}),$._parser.setCsiHandler({final:"F"},function(Y){return $.cursorPrecedingLine(Y)}),$._parser.setCsiHandler({final:"G"},function(Y){return $.cursorCharAbsolute(Y)}),$._parser.setCsiHandler({final:"H"},function(Y){return $.cursorPosition(Y)}),$._parser.setCsiHandler({final:"I"},function(Y){return $.cursorForwardTab(Y)}),$._parser.setCsiHandler({final:"J"},function(Y){return $.eraseInDisplay(Y)}),$._parser.setCsiHandler({prefix:"?",final:"J"},function(Y){return $.eraseInDisplay(Y)}),$._parser.setCsiHandler({final:"K"},function(Y){return $.eraseInLine(Y)}),$._parser.setCsiHandler({prefix:"?",final:"K"},function(Y){return $.eraseInLine(Y)}),$._parser.setCsiHandler({final:"L"},function(Y){return $.insertLines(Y)}),$._parser.setCsiHandler({final:"M"},function(Y){return $.deleteLines(Y)}),$._parser.setCsiHandler({final:"P"},function(Y){return $.deleteChars(Y)}),$._parser.setCsiHandler({final:"S"},function(Y){return $.scrollUp(Y)}),$._parser.setCsiHandler({final:"T"},function(Y){return $.scrollDown(Y)}),$._parser.setCsiHandler({final:"X"},function(Y){return $.eraseChars(Y)}),$._parser.setCsiHandler({final:"Z"},function(Y){return $.cursorBackwardTab(Y)}),$._parser.setCsiHandler({final:"`"},function(Y){return $.charPosAbsolute(Y)}),$._parser.setCsiHandler({final:"a"},function(Y){return $.hPositionRelative(Y)}),$._parser.setCsiHandler({final:"b"},function(Y){return $.repeatPrecedingCharacter(Y)}),$._parser.setCsiHandler({final:"c"},function(Y){return $.sendDeviceAttributesPrimary(Y)}),$._parser.setCsiHandler({prefix:">",final:"c"},function(Y){return $.sendDeviceAttributesSecondary(Y)}),$._parser.setCsiHandler({final:"d"},function(Y){return $.linePosAbsolute(Y)}),$._parser.setCsiHandler({final:"e"},function(Y){return $.vPositionRelative(Y)}),$._parser.setCsiHandler({final:"f"},function(Y){return $.hVPosition(Y)}),$._parser.setCsiHandler({final:"g"},function(Y){return $.tabClear(Y)}),$._parser.setCsiHandler({final:"h"},function(Y){return $.setMode(Y)}),$._parser.setCsiHandler({prefix:"?",final:"h"},function(Y){return $.setModePrivate(Y)}),$._parser.setCsiHandler({final:"l"},function(Y){return $.resetMode(Y)}),$._parser.setCsiHandler({prefix:"?",final:"l"},function(Y){return $.resetModePrivate(Y)}),$._parser.setCsiHandler({final:"m"},function(Y){return $.charAttributes(Y)}),$._parser.setCsiHandler({final:"n"},function(Y){return $.deviceStatus(Y)}),$._parser.setCsiHandler({prefix:"?",final:"n"},function(Y){return $.deviceStatusPrivate(Y)}),$._parser.setCsiHandler({intermediates:"!",final:"p"},function(Y){return $.softReset(Y)}),$._parser.setCsiHandler({intermediates:" ",final:"q"},function(Y){return $.setCursorStyle(Y)}),$._parser.setCsiHandler({final:"r"},function(Y){return $.setScrollRegion(Y)}),$._parser.setCsiHandler({final:"s"},function(Y){return $.saveCursor(Y)}),$._parser.setCsiHandler({final:"t"},function(Y){return $.windowOptions(Y)}),$._parser.setCsiHandler({final:"u"},function(Y){return $.restoreCursor(Y)}),$._parser.setCsiHandler({intermediates:"'",final:"}"},function(Y){return $.insertColumns(Y)}),$._parser.setCsiHandler({intermediates:"'",final:"~"},function(Y){return $.deleteColumns(Y)}),$._parser.setExecuteHandler(E.C0.BEL,function(){return $.bell()}),$._parser.setExecuteHandler(E.C0.LF,function(){return $.lineFeed()}),$._parser.setExecuteHandler(E.C0.VT,function(){return $.lineFeed()}),$._parser.setExecuteHandler(E.C0.FF,function(){return $.lineFeed()}),$._parser.setExecuteHandler(E.C0.CR,function(){return $.carriageReturn()}),$._parser.setExecuteHandler(E.C0.BS,function(){return $.backspace()}),$._parser.setExecuteHandler(E.C0.HT,function(){return $.tab()}),$._parser.setExecuteHandler(E.C0.SO,function(){return $.shiftOut()}),$._parser.setExecuteHandler(E.C0.SI,function(){return $.shiftIn()}),$._parser.setExecuteHandler(E.C1.IND,function(){return $.index()}),$._parser.setExecuteHandler(E.C1.NEL,function(){return $.nextLine()}),$._parser.setExecuteHandler(E.C1.HTS,function(){return $.tabSet()}),$._parser.setOscHandler(0,new y.OscHandler(function(Y){$.setTitle(Y),$.setIconName(Y)})),$._parser.setOscHandler(1,new y.OscHandler(function(Y){return $.setIconName(Y)})),$._parser.setOscHandler(2,new y.OscHandler(function(Y){return $.setTitle(Y)})),$._parser.setEscHandler({final:"7"},function(){return $.saveCursor()}),$._parser.setEscHandler({final:"8"},function(){return $.restoreCursor()}),$._parser.setEscHandler({final:"D"},function(){return $.index()}),$._parser.setEscHandler({final:"E"},function(){return $.nextLine()}),$._parser.setEscHandler({final:"H"},function(){return $.tabSet()}),$._parser.setEscHandler({final:"M"},function(){return $.reverseIndex()}),$._parser.setEscHandler({final:"="},function(){return $.keypadApplicationMode()}),$._parser.setEscHandler({final:">"},function(){return $.keypadNumericMode()}),$._parser.setEscHandler({final:"c"},function(){return $.fullReset()}),$._parser.setEscHandler({final:"n"},function(){return $.setgLevel(2)}),$._parser.setEscHandler({final:"o"},function(){return $.setgLevel(3)}),$._parser.setEscHandler({final:"|"},function(){return $.setgLevel(3)}),$._parser.setEscHandler({final:"}"},function(){return $.setgLevel(2)}),$._parser.setEscHandler({final:"~"},function(){return $.setgLevel(1)}),$._parser.setEscHandler({intermediates:"%",final:"@"},function(){return $.selectDefaultCharset()}),$._parser.setEscHandler({intermediates:"%",final:"G"},function(){return $.selectDefaultCharset()});var oe=function(Y){ae._parser.setEscHandler({intermediates:"(",final:Y},function(){return $.selectCharset("("+Y)}),ae._parser.setEscHandler({intermediates:")",final:Y},function(){return $.selectCharset(")"+Y)}),ae._parser.setEscHandler({intermediates:"*",final:Y},function(){return $.selectCharset("*"+Y)}),ae._parser.setEscHandler({intermediates:"+",final:Y},function(){return $.selectCharset("+"+Y)}),ae._parser.setEscHandler({intermediates:"-",final:Y},function(){return $.selectCharset("-"+Y)}),ae._parser.setEscHandler({intermediates:".",final:Y},function(){return $.selectCharset("."+Y)}),ae._parser.setEscHandler({intermediates:"/",final:Y},function(){return $.selectCharset("/"+Y)})},ae=this;for(var ye in p.CHARSETS)oe(ye);return $._parser.setEscHandler({intermediates:"#",final:"8"},function(){return $.screenAlignmentPattern()}),$._parser.setErrorHandler(function(Y){return $._logService.error("Parsing error: ",Y),Y}),$._parser.setDcsHandler({intermediates:"$",final:"q"},new w($._bufferService,$._coreService,$._logService,$._optionsService)),$}return i(R,H),Object.defineProperty(R.prototype,"onRequestBell",{get:function(){return this._onRequestBell.event},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"onRequestRefreshRows",{get:function(){return this._onRequestRefreshRows.event},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"onRequestReset",{get:function(){return this._onRequestReset.event},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"onRequestScroll",{get:function(){return this._onRequestScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"onRequestSyncScrollBar",{get:function(){return this._onRequestSyncScrollBar.event},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"onRequestWindowsOptionsReport",{get:function(){return this._onRequestWindowsOptionsReport.event},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"onA11yChar",{get:function(){return this._onA11yChar.event},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"onA11yTab",{get:function(){return this._onA11yTab.event},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),R.prototype.dispose=function(){H.prototype.dispose.call(this)},R.prototype.parse=function(F){var D=this._bufferService.buffer,B=D.x,P=D.y;if(this._logService.debug("parsing data",F),this._parseBuffer.length<F.length&&this._parseBuffer.length<131072&&(this._parseBuffer=new Uint32Array(Math.min(F.length,131072))),this._dirtyRowService.clearRange(),F.length>131072)for(var U=0;U<F.length;U+=131072){var G=U+131072<F.length?U+131072:F.length,ee=typeof F=="string"?this._stringDecoder.decode(F.substring(U,G),this._parseBuffer):this._utf8Decoder.decode(F.subarray(U,G),this._parseBuffer);this._parser.parse(this._parseBuffer,ee)}else ee=typeof F=="string"?this._stringDecoder.decode(F,this._parseBuffer):this._utf8Decoder.decode(F,this._parseBuffer),this._parser.parse(this._parseBuffer,ee);(D=this._bufferService.buffer).x===B&&D.y===P||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowService.start,this._dirtyRowService.end)},R.prototype.print=function(F,D,B){var P,U,G=this._bufferService.buffer,ee=this._charsetService.charset,K=this._optionsService.options.screenReaderMode,Z=this._bufferService.cols,$=this._coreService.decPrivateModes.wraparound,oe=this._coreService.modes.insertMode,ae=this._curAttrData,ye=G.lines.get(G.ybase+G.y);this._dirtyRowService.markDirty(G.y),G.x&&B-D>0&&ye.getWidth(G.x-1)===2&&ye.setCellFromCodePoint(G.x-1,0,1,ae.fg,ae.bg,ae.extended);for(var Y=D;Y<B;++Y){if(P=F[Y],U=this._unicodeService.wcwidth(P),P<127&&ee){var le=ee[String.fromCharCode(P)];le&&(P=le.charCodeAt(0))}if(K&&this._onA11yChar.fire(v.stringFromCodePoint(P)),U||!G.x){if(G.x+U-1>=Z){if($){for(;G.x<Z;)ye.setCellFromCodePoint(G.x++,0,1,ae.fg,ae.bg,ae.extended);G.x=0,G.y++,G.y===G.scrollBottom+1?(G.y--,this._onRequestScroll.fire(this._eraseAttrData(),!0)):(G.y>=this._bufferService.rows&&(G.y=this._bufferService.rows-1),G.lines.get(G.ybase+G.y).isWrapped=!0),ye=G.lines.get(G.ybase+G.y)}else if(G.x=Z-1,U===2)continue}if(oe&&(ye.insertCells(G.x,U,G.getNullCell(ae),ae),ye.getWidth(Z-1)===2&&ye.setCellFromCodePoint(Z-1,s.NULL_CELL_CODE,s.NULL_CELL_WIDTH,ae.fg,ae.bg,ae.extended)),ye.setCellFromCodePoint(G.x++,P,U,ae.fg,ae.bg,ae.extended),U>0)for(;--U;)ye.setCellFromCodePoint(G.x++,0,0,ae.fg,ae.bg,ae.extended)}else ye.getWidth(G.x-1)?ye.addCodepointToCell(G.x-1,P):ye.addCodepointToCell(G.x-2,P)}B-D>0&&(ye.loadCell(G.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),G.x<Z&&B-D>0&&ye.getWidth(G.x)===0&&!ye.hasContent(G.x)&&ye.setCellFromCodePoint(G.x,0,1,ae.fg,ae.bg,ae.extended),this._dirtyRowService.markDirty(G.y)},R.prototype.addCsiHandler=function(F,D){var B=this;return F.final!=="t"||F.prefix||F.intermediates?this._parser.addCsiHandler(F,D):this._parser.addCsiHandler(F,function(P){return!S(P.params[0],B._optionsService.options.windowOptions)||D(P)})},R.prototype.addDcsHandler=function(F,D){return this._parser.addDcsHandler(F,new _.DcsHandler(D))},R.prototype.addEscHandler=function(F,D){return this._parser.addEscHandler(F,D)},R.prototype.addOscHandler=function(F,D){return this._parser.addOscHandler(F,new y.OscHandler(D))},R.prototype.bell=function(){this._onRequestBell.fire()},R.prototype.lineFeed=function(){var F=this._bufferService.buffer;this._dirtyRowService.markDirty(F.y),this._optionsService.options.convertEol&&(F.x=0),F.y++,F.y===F.scrollBottom+1?(F.y--,this._onRequestScroll.fire(this._eraseAttrData())):F.y>=this._bufferService.rows&&(F.y=this._bufferService.rows-1),F.x>=this._bufferService.cols&&F.x--,this._dirtyRowService.markDirty(F.y),this._onLineFeed.fire()},R.prototype.carriageReturn=function(){this._bufferService.buffer.x=0},R.prototype.backspace=function(){var F,D=this._bufferService.buffer;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),void(D.x>0&&D.x--);if(this._restrictCursor(this._bufferService.cols),D.x>0)D.x--;else if(D.x===0&&D.y>D.scrollTop&&D.y<=D.scrollBottom&&(!((F=D.lines.get(D.ybase+D.y))===null||F===void 0)&&F.isWrapped)){D.lines.get(D.ybase+D.y).isWrapped=!1,D.y--,D.x=this._bufferService.cols-1;var B=D.lines.get(D.ybase+D.y);B.hasWidth(D.x)&&!B.hasContent(D.x)&&D.x--}this._restrictCursor()},R.prototype.tab=function(){if(!(this._bufferService.buffer.x>=this._bufferService.cols)){var F=this._bufferService.buffer.x;this._bufferService.buffer.x=this._bufferService.buffer.nextStop(),this._optionsService.options.screenReaderMode&&this._onA11yTab.fire(this._bufferService.buffer.x-F)}},R.prototype.shiftOut=function(){this._charsetService.setgLevel(1)},R.prototype.shiftIn=function(){this._charsetService.setgLevel(0)},R.prototype._restrictCursor=function(F){F===void 0&&(F=this._bufferService.cols-1),this._bufferService.buffer.x=Math.min(F,Math.max(0,this._bufferService.buffer.x)),this._bufferService.buffer.y=this._coreService.decPrivateModes.origin?Math.min(this._bufferService.buffer.scrollBottom,Math.max(this._bufferService.buffer.scrollTop,this._bufferService.buffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._bufferService.buffer.y)),this._dirtyRowService.markDirty(this._bufferService.buffer.y)},R.prototype._setCursor=function(F,D){this._dirtyRowService.markDirty(this._bufferService.buffer.y),this._coreService.decPrivateModes.origin?(this._bufferService.buffer.x=F,this._bufferService.buffer.y=this._bufferService.buffer.scrollTop+D):(this._bufferService.buffer.x=F,this._bufferService.buffer.y=D),this._restrictCursor(),this._dirtyRowService.markDirty(this._bufferService.buffer.y)},R.prototype._moveCursor=function(F,D){this._restrictCursor(),this._setCursor(this._bufferService.buffer.x+F,this._bufferService.buffer.y+D)},R.prototype.cursorUp=function(F){var D=this._bufferService.buffer.y-this._bufferService.buffer.scrollTop;D>=0?this._moveCursor(0,-Math.min(D,F.params[0]||1)):this._moveCursor(0,-(F.params[0]||1))},R.prototype.cursorDown=function(F){var D=this._bufferService.buffer.scrollBottom-this._bufferService.buffer.y;D>=0?this._moveCursor(0,Math.min(D,F.params[0]||1)):this._moveCursor(0,F.params[0]||1)},R.prototype.cursorForward=function(F){this._moveCursor(F.params[0]||1,0)},R.prototype.cursorBackward=function(F){this._moveCursor(-(F.params[0]||1),0)},R.prototype.cursorNextLine=function(F){this.cursorDown(F),this._bufferService.buffer.x=0},R.prototype.cursorPrecedingLine=function(F){this.cursorUp(F),this._bufferService.buffer.x=0},R.prototype.cursorCharAbsolute=function(F){this._setCursor((F.params[0]||1)-1,this._bufferService.buffer.y)},R.prototype.cursorPosition=function(F){this._setCursor(F.length>=2?(F.params[1]||1)-1:0,(F.params[0]||1)-1)},R.prototype.charPosAbsolute=function(F){this._setCursor((F.params[0]||1)-1,this._bufferService.buffer.y)},R.prototype.hPositionRelative=function(F){this._moveCursor(F.params[0]||1,0)},R.prototype.linePosAbsolute=function(F){this._setCursor(this._bufferService.buffer.x,(F.params[0]||1)-1)},R.prototype.vPositionRelative=function(F){this._moveCursor(0,F.params[0]||1)},R.prototype.hVPosition=function(F){this.cursorPosition(F)},R.prototype.tabClear=function(F){var D=F.params[0];D===0?delete this._bufferService.buffer.tabs[this._bufferService.buffer.x]:D===3&&(this._bufferService.buffer.tabs={})},R.prototype.cursorForwardTab=function(F){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var D=F.params[0]||1;D--;)this._bufferService.buffer.x=this._bufferService.buffer.nextStop()},R.prototype.cursorBackwardTab=function(F){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var D=F.params[0]||1,B=this._bufferService.buffer;D--;)B.x=B.prevStop()},R.prototype._eraseInBufferLine=function(F,D,B,P){P===void 0&&(P=!1);var U=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+F);U.replaceCells(D,B,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),P&&(U.isWrapped=!1)},R.prototype._resetBufferLine=function(F){var D=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+F);D.fill(this._bufferService.buffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1},R.prototype.eraseInDisplay=function(F){var D;switch(this._restrictCursor(),F.params[0]){case 0:for(D=this._bufferService.buffer.y,this._dirtyRowService.markDirty(D),this._eraseInBufferLine(D++,this._bufferService.buffer.x,this._bufferService.cols,this._bufferService.buffer.x===0);D<this._bufferService.rows;D++)this._resetBufferLine(D);this._dirtyRowService.markDirty(D);break;case 1:for(D=this._bufferService.buffer.y,this._dirtyRowService.markDirty(D),this._eraseInBufferLine(D,0,this._bufferService.buffer.x+1,!0),this._bufferService.buffer.x+1>=this._bufferService.cols&&(this._bufferService.buffer.lines.get(D+1).isWrapped=!1);D--;)this._resetBufferLine(D);this._dirtyRowService.markDirty(0);break;case 2:for(D=this._bufferService.rows,this._dirtyRowService.markDirty(D-1);D--;)this._resetBufferLine(D);this._dirtyRowService.markDirty(0);break;case 3:var B=this._bufferService.buffer.lines.length-this._bufferService.rows;B>0&&(this._bufferService.buffer.lines.trimStart(B),this._bufferService.buffer.ybase=Math.max(this._bufferService.buffer.ybase-B,0),this._bufferService.buffer.ydisp=Math.max(this._bufferService.buffer.ydisp-B,0),this._onScroll.fire(0))}},R.prototype.eraseInLine=function(F){switch(this._restrictCursor(),F.params[0]){case 0:this._eraseInBufferLine(this._bufferService.buffer.y,this._bufferService.buffer.x,this._bufferService.cols);break;case 1:this._eraseInBufferLine(this._bufferService.buffer.y,0,this._bufferService.buffer.x+1);break;case 2:this._eraseInBufferLine(this._bufferService.buffer.y,0,this._bufferService.cols)}this._dirtyRowService.markDirty(this._bufferService.buffer.y)},R.prototype.insertLines=function(F){this._restrictCursor();var D=F.params[0]||1,B=this._bufferService.buffer;if(!(B.y>B.scrollBottom||B.y<B.scrollTop)){for(var P=B.ybase+B.y,U=this._bufferService.rows-1-B.scrollBottom,G=this._bufferService.rows-1+B.ybase-U+1;D--;)B.lines.splice(G-1,1),B.lines.splice(P,0,B.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(B.y,B.scrollBottom),B.x=0}},R.prototype.deleteLines=function(F){this._restrictCursor();var D=F.params[0]||1,B=this._bufferService.buffer;if(!(B.y>B.scrollBottom||B.y<B.scrollTop)){var P,U=B.ybase+B.y;for(P=this._bufferService.rows-1-B.scrollBottom,P=this._bufferService.rows-1+B.ybase-P;D--;)B.lines.splice(U,1),B.lines.splice(P,0,B.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(B.y,B.scrollBottom),B.x=0}},R.prototype.insertChars=function(F){this._restrictCursor();var D=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);D&&(D.insertCells(this._bufferService.buffer.x,F.params[0]||1,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},R.prototype.deleteChars=function(F){this._restrictCursor();var D=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);D&&(D.deleteCells(this._bufferService.buffer.x,F.params[0]||1,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},R.prototype.scrollUp=function(F){for(var D=F.params[0]||1,B=this._bufferService.buffer;D--;)B.lines.splice(B.ybase+B.scrollTop,1),B.lines.splice(B.ybase+B.scrollBottom,0,B.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(B.scrollTop,B.scrollBottom)},R.prototype.scrollDown=function(F){for(var D=F.params[0]||1,B=this._bufferService.buffer;D--;)B.lines.splice(B.ybase+B.scrollBottom,1),B.lines.splice(B.ybase+B.scrollTop,0,B.getBlankLine(d.DEFAULT_ATTR_DATA));this._dirtyRowService.markRangeDirty(B.scrollTop,B.scrollBottom)},R.prototype.scrollLeft=function(F){var D=this._bufferService.buffer;if(!(D.y>D.scrollBottom||D.y<D.scrollTop)){for(var B=F.params[0]||1,P=D.scrollTop;P<=D.scrollBottom;++P){var U=D.lines.get(D.ybase+P);U.deleteCells(0,B,D.getNullCell(this._eraseAttrData()),this._eraseAttrData()),U.isWrapped=!1}this._dirtyRowService.markRangeDirty(D.scrollTop,D.scrollBottom)}},R.prototype.scrollRight=function(F){var D=this._bufferService.buffer;if(!(D.y>D.scrollBottom||D.y<D.scrollTop)){for(var B=F.params[0]||1,P=D.scrollTop;P<=D.scrollBottom;++P){var U=D.lines.get(D.ybase+P);U.insertCells(0,B,D.getNullCell(this._eraseAttrData()),this._eraseAttrData()),U.isWrapped=!1}this._dirtyRowService.markRangeDirty(D.scrollTop,D.scrollBottom)}},R.prototype.insertColumns=function(F){var D=this._bufferService.buffer;if(!(D.y>D.scrollBottom||D.y<D.scrollTop)){for(var B=F.params[0]||1,P=D.scrollTop;P<=D.scrollBottom;++P){var U=this._bufferService.buffer.lines.get(D.ybase+P);U.insertCells(D.x,B,D.getNullCell(this._eraseAttrData()),this._eraseAttrData()),U.isWrapped=!1}this._dirtyRowService.markRangeDirty(D.scrollTop,D.scrollBottom)}},R.prototype.deleteColumns=function(F){var D=this._bufferService.buffer;if(!(D.y>D.scrollBottom||D.y<D.scrollTop)){for(var B=F.params[0]||1,P=D.scrollTop;P<=D.scrollBottom;++P){var U=D.lines.get(D.ybase+P);U.deleteCells(D.x,B,D.getNullCell(this._eraseAttrData()),this._eraseAttrData()),U.isWrapped=!1}this._dirtyRowService.markRangeDirty(D.scrollTop,D.scrollBottom)}},R.prototype.eraseChars=function(F){this._restrictCursor();var D=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);D&&(D.replaceCells(this._bufferService.buffer.x,this._bufferService.buffer.x+(F.params[0]||1),this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},R.prototype.repeatPrecedingCharacter=function(F){if(this._parser.precedingCodepoint){for(var D=F.params[0]||1,B=new Uint32Array(D),P=0;P<D;++P)B[P]=this._parser.precedingCodepoint;this.print(B,0,B.length)}},R.prototype.sendDeviceAttributesPrimary=function(F){F.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(E.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(E.C0.ESC+"[?6c"))},R.prototype.sendDeviceAttributesSecondary=function(F){F.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(E.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(E.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(F.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(E.C0.ESC+"[>83;40003;0c"))},R.prototype._is=function(F){return(this._optionsService.options.termName+"").indexOf(F)===0},R.prototype.setMode=function(F){for(var D=0;D<F.length;D++)switch(F.params[D]){case 4:this._coreService.modes.insertMode=!0}},R.prototype.setModePrivate=function(F){for(var D=0;D<F.length;D++)switch(F.params[D]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,p.DEFAULT_CHARSET),this._charsetService.setgCharset(1,p.DEFAULT_CHARSET),this._charsetService.setgCharset(2,p.DEFAULT_CHARSET),this._charsetService.setgCharset(3,p.DEFAULT_CHARSET);break;case 3:this._optionsService.options.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0;break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}},R.prototype.resetMode=function(F){for(var D=0;D<F.length;D++)switch(F.params[D]){case 4:this._coreService.modes.insertMode=!1}},R.prototype.resetModePrivate=function(F){for(var D=0;D<F.length;D++)switch(F.params[D]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.options.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),F.params[D]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}},R.prototype._updateAttrColor=function(F,D,B,P,U){return D===2?(F|=50331648,F&=-16777216,F|=m.AttributeData.fromColorRGB([B,P,U])):D===5&&(F&=-50331904,F|=33554432|255&B),F},R.prototype._extractColor=function(F,D,B){var P=[0,0,-1,0,0,0],U=0,G=0;do{if(P[G+U]=F.params[D+G],F.hasSubParams(D+G)){var ee=F.getSubParams(D+G),K=0;do P[1]===5&&(U=1),P[G+K+1+U]=ee[K];while(++K<ee.length&&K+G+1+U<P.length);break}if(P[1]===5&&G+U>=2||P[1]===2&&G+U>=5)break;P[1]&&(U=1)}while(++G+D<F.length&&G+U<P.length);for(K=2;K<P.length;++K)P[K]===-1&&(P[K]=0);switch(P[0]){case 38:B.fg=this._updateAttrColor(B.fg,P[1],P[3],P[4],P[5]);break;case 48:B.bg=this._updateAttrColor(B.bg,P[1],P[3],P[4],P[5]);break;case 58:B.extended=B.extended.clone(),B.extended.underlineColor=this._updateAttrColor(B.extended.underlineColor,P[1],P[3],P[4],P[5])}return G},R.prototype._processUnderline=function(F,D){D.extended=D.extended.clone(),(!~F||F>5)&&(F=1),D.extended.underlineStyle=F,D.fg|=268435456,F===0&&(D.fg&=-268435457),D.updateExtended()},R.prototype.charAttributes=function(F){if(F.length===1&&F.params[0]===0)return this._curAttrData.fg=d.DEFAULT_ATTR_DATA.fg,void(this._curAttrData.bg=d.DEFAULT_ATTR_DATA.bg);for(var D,B=F.length,P=this._curAttrData,U=0;U<B;U++)(D=F.params[U])>=30&&D<=37?(P.fg&=-50331904,P.fg|=16777216|D-30):D>=40&&D<=47?(P.bg&=-50331904,P.bg|=16777216|D-40):D>=90&&D<=97?(P.fg&=-50331904,P.fg|=16777224|D-90):D>=100&&D<=107?(P.bg&=-50331904,P.bg|=16777224|D-100):D===0?(P.fg=d.DEFAULT_ATTR_DATA.fg,P.bg=d.DEFAULT_ATTR_DATA.bg):D===1?P.fg|=134217728:D===3?P.bg|=67108864:D===4?(P.fg|=268435456,this._processUnderline(F.hasSubParams(U)?F.getSubParams(U)[0]:1,P)):D===5?P.fg|=536870912:D===7?P.fg|=67108864:D===8?P.fg|=1073741824:D===2?P.bg|=134217728:D===21?this._processUnderline(2,P):D===22?(P.fg&=-134217729,P.bg&=-134217729):D===23?P.bg&=-67108865:D===24?P.fg&=-268435457:D===25?P.fg&=-536870913:D===27?P.fg&=-67108865:D===28?P.fg&=-1073741825:D===39?(P.fg&=-67108864,P.fg|=16777215&d.DEFAULT_ATTR_DATA.fg):D===49?(P.bg&=-67108864,P.bg|=16777215&d.DEFAULT_ATTR_DATA.bg):D===38||D===48||D===58?U+=this._extractColor(F,U,P):D===59?(P.extended=P.extended.clone(),P.extended.underlineColor=-1,P.updateExtended()):D===100?(P.fg&=-67108864,P.fg|=16777215&d.DEFAULT_ATTR_DATA.fg,P.bg&=-67108864,P.bg|=16777215&d.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",D)},R.prototype.deviceStatus=function(F){switch(F.params[0]){case 5:this._coreService.triggerDataEvent(E.C0.ESC+"[0n");break;case 6:var D=this._bufferService.buffer.y+1,B=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(E.C0.ESC+"["+D+";"+B+"R")}},R.prototype.deviceStatusPrivate=function(F){switch(F.params[0]){case 6:var D=this._bufferService.buffer.y+1,B=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(E.C0.ESC+"[?"+D+";"+B+"R")}},R.prototype.softReset=function(F){this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._bufferService.buffer.scrollTop=0,this._bufferService.buffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=d.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._bufferService.buffer.savedX=0,this._bufferService.buffer.savedY=this._bufferService.buffer.ybase,this._bufferService.buffer.savedCurAttrData.fg=this._curAttrData.fg,this._bufferService.buffer.savedCurAttrData.bg=this._curAttrData.bg,this._bufferService.buffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1},R.prototype.setCursorStyle=function(F){var D=F.params[0]||1;switch(D){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}var B=D%2==1;this._optionsService.options.cursorBlink=B},R.prototype.setScrollRegion=function(F){var D,B=F.params[0]||1;(F.length<2||(D=F.params[1])>this._bufferService.rows||D===0)&&(D=this._bufferService.rows),D>B&&(this._bufferService.buffer.scrollTop=B-1,this._bufferService.buffer.scrollBottom=D-1,this._setCursor(0,0))},R.prototype.windowOptions=function(F){if(S(F.params[0],this._optionsService.options.windowOptions)){var D=F.length>1?F.params[1]:0;switch(F.params[0]){case 14:D!==2&&this._onRequestWindowsOptionsReport.fire(M.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(M.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(E.C0.ESC+"[8;"+this._bufferService.rows+";"+this._bufferService.cols+"t");break;case 22:D!==0&&D!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),D!==0&&D!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:D!==0&&D!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),D!==0&&D!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}}},R.prototype.saveCursor=function(F){this._bufferService.buffer.savedX=this._bufferService.buffer.x,this._bufferService.buffer.savedY=this._bufferService.buffer.ybase+this._bufferService.buffer.y,this._bufferService.buffer.savedCurAttrData.fg=this._curAttrData.fg,this._bufferService.buffer.savedCurAttrData.bg=this._curAttrData.bg,this._bufferService.buffer.savedCharset=this._charsetService.charset},R.prototype.restoreCursor=function(F){this._bufferService.buffer.x=this._bufferService.buffer.savedX||0,this._bufferService.buffer.y=Math.max(this._bufferService.buffer.savedY-this._bufferService.buffer.ybase,0),this._curAttrData.fg=this._bufferService.buffer.savedCurAttrData.fg,this._curAttrData.bg=this._bufferService.buffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._bufferService.buffer.savedCharset&&(this._charsetService.charset=this._bufferService.buffer.savedCharset),this._restrictCursor()},R.prototype.setTitle=function(F){this._windowTitle=F,this._onTitleChange.fire(F)},R.prototype.setIconName=function(F){this._iconName=F},R.prototype.nextLine=function(){this._bufferService.buffer.x=0,this.index()},R.prototype.keypadApplicationMode=function(){this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire()},R.prototype.keypadNumericMode=function(){this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire()},R.prototype.selectDefaultCharset=function(){this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,p.DEFAULT_CHARSET)},R.prototype.selectCharset=function(F){F.length===2?F[0]!=="/"&&this._charsetService.setgCharset(x[F[0]],p.CHARSETS[F[1]]||p.DEFAULT_CHARSET):this.selectDefaultCharset()},R.prototype.index=function(){this._restrictCursor();var F=this._bufferService.buffer;this._bufferService.buffer.y++,F.y===F.scrollBottom+1?(F.y--,this._onRequestScroll.fire(this._eraseAttrData())):F.y>=this._bufferService.rows&&(F.y=this._bufferService.rows-1),this._restrictCursor()},R.prototype.tabSet=function(){this._bufferService.buffer.tabs[this._bufferService.buffer.x]=!0},R.prototype.reverseIndex=function(){this._restrictCursor();var F=this._bufferService.buffer;if(F.y===F.scrollTop){var D=F.scrollBottom-F.scrollTop;F.lines.shiftElements(F.ybase+F.y,D,1),F.lines.set(F.ybase+F.y,F.getBlankLine(this._eraseAttrData())),this._dirtyRowService.markRangeDirty(F.scrollTop,F.scrollBottom)}else F.y--,this._restrictCursor()},R.prototype.fullReset=function(){this._parser.reset(),this._onRequestReset.fire()},R.prototype.reset=function(){this._curAttrData=d.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=d.DEFAULT_ATTR_DATA.clone()},R.prototype._eraseAttrData=function(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal},R.prototype.setgLevel=function(F){this._charsetService.setgLevel(F)},R.prototype.screenAlignmentPattern=function(){var F=new u.CellData;F.content=1<<22|69,F.fg=this._curAttrData.fg,F.bg=this._curAttrData.bg;var D=this._bufferService.buffer;this._setCursor(0,0);for(var B=0;B<this._bufferService.rows;++B){var P=D.ybase+D.y+B,U=D.lines.get(P);U&&(U.fill(F),U.isWrapped=!1)}this._dirtyRowService.markAllDirty(),this._setCursor(0,0)},R}(l.Disposable);Q.InputHandler=A},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.DEFAULT_CHARSET=Q.CHARSETS=void 0,Q.CHARSETS={},Q.DEFAULT_CHARSET=Q.CHARSETS.B,Q.CHARSETS[0]={"`":"\u25C6",a:"\u2592",b:"\u2409",c:"\u240C",d:"\u240D",e:"\u240A",f:"\xB0",g:"\xB1",h:"\u2424",i:"\u240B",j:"\u2518",k:"\u2510",l:"\u250C",m:"\u2514",n:"\u253C",o:"\u23BA",p:"\u23BB",q:"\u2500",r:"\u23BC",s:"\u23BD",t:"\u251C",u:"\u2524",v:"\u2534",w:"\u252C",x:"\u2502",y:"\u2264",z:"\u2265","{":"\u03C0","|":"\u2260","}":"\xA3","~":"\xB7"},Q.CHARSETS.A={"#":"\xA3"},Q.CHARSETS.B=void 0,Q.CHARSETS[4]={"#":"\xA3","@":"\xBE","[":"ij","\\":"\xBD","]":"|","{":"\xA8","|":"f","}":"\xBC","~":"\xB4"},Q.CHARSETS.C=Q.CHARSETS[5]={"[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},Q.CHARSETS.R={"#":"\xA3","@":"\xE0","[":"\xB0","\\":"\xE7","]":"\xA7","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xA8"},Q.CHARSETS.Q={"@":"\xE0","[":"\xE2","\\":"\xE7","]":"\xEA","^":"\xEE","`":"\xF4","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xFB"},Q.CHARSETS.K={"@":"\xA7","[":"\xC4","\\":"\xD6","]":"\xDC","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xDF"},Q.CHARSETS.Y={"#":"\xA3","@":"\xA7","[":"\xB0","\\":"\xE7","]":"\xE9","`":"\xF9","{":"\xE0","|":"\xF2","}":"\xE8","~":"\xEC"},Q.CHARSETS.E=Q.CHARSETS[6]={"@":"\xC4","[":"\xC6","\\":"\xD8","]":"\xC5","^":"\xDC","`":"\xE4","{":"\xE6","|":"\xF8","}":"\xE5","~":"\xFC"},Q.CHARSETS.Z={"#":"\xA3","@":"\xA7","[":"\xA1","\\":"\xD1","]":"\xBF","{":"\xB0","|":"\xF1","}":"\xE7"},Q.CHARSETS.H=Q.CHARSETS[7]={"@":"\xC9","[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},Q.CHARSETS["="]={"#":"\xF9","@":"\xE0","[":"\xE9","\\":"\xE7","]":"\xEA","^":"\xEE",_:"\xE8","`":"\xF4","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xFB"}},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.Params=void 0;var fe=function(){function i(M,E){if(M===void 0&&(M=32),E===void 0&&(E=32),this.maxLength=M,this.maxSubParamsLength=E,E>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(M),this.length=0,this._subParams=new Int32Array(E),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(M),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}return i.fromArray=function(M){var E=new i;if(!M.length)return E;for(var p=M[0]instanceof Array?1:0;p<M.length;++p){var g=M[p];if(g instanceof Array)for(var l=0;l<g.length;++l)E.addSubParam(g[l]);else E.addParam(g)}return E},i.prototype.clone=function(){var M=new i(this.maxLength,this.maxSubParamsLength);return M.params.set(this.params),M.length=this.length,M._subParams.set(this._subParams),M._subParamsLength=this._subParamsLength,M._subParamsIdx.set(this._subParamsIdx),M._rejectDigits=this._rejectDigits,M._rejectSubDigits=this._rejectSubDigits,M._digitIsSub=this._digitIsSub,M},i.prototype.toArray=function(){for(var M=[],E=0;E<this.length;++E){M.push(this.params[E]);var p=this._subParamsIdx[E]>>8,g=255&this._subParamsIdx[E];g-p>0&&M.push(Array.prototype.slice.call(this._subParams,p,g))}return M},i.prototype.reset=function(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1},i.prototype.addParam=function(M){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(M<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=M>2147483647?2147483647:M}},i.prototype.addSubParam=function(M){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(M<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=M>2147483647?2147483647:M,this._subParamsIdx[this.length-1]++}},i.prototype.hasSubParams=function(M){return(255&this._subParamsIdx[M])-(this._subParamsIdx[M]>>8)>0},i.prototype.getSubParams=function(M){var E=this._subParamsIdx[M]>>8,p=255&this._subParamsIdx[M];return p-E>0?this._subParams.subarray(E,p):null},i.prototype.getSubParamsAll=function(){for(var M={},E=0;E<this.length;++E){var p=this._subParamsIdx[E]>>8,g=255&this._subParamsIdx[E];g-p>0&&(M[E]=this._subParams.slice(p,g))}return M},i.prototype.addDigit=function(M){var E;if(!(this._rejectDigits||!(E=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)){var p=this._digitIsSub?this._subParams:this.params,g=p[E-1];p[E-1]=~g?Math.min(10*g+M,2147483647):M}},i}();Q.Params=fe},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.OscHandler=Q.OscParser=void 0;var fe=he(23),i=he(8),M=function(){function p(){this._state=0,this._id=-1,this._handlers=Object.create(null),this._handlerFb=function(){}}return p.prototype.addHandler=function(g,l){this._handlers[g]===void 0&&(this._handlers[g]=[]);var h=this._handlers[g];return h.push(l),{dispose:function(){var v=h.indexOf(l);v!==-1&&h.splice(v,1)}}},p.prototype.setHandler=function(g,l){this._handlers[g]=[l]},p.prototype.clearHandler=function(g){this._handlers[g]&&delete this._handlers[g]},p.prototype.setHandlerFallback=function(g){this._handlerFb=g},p.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},p.prototype.reset=function(){this._state===2&&this.end(!1),this._id=-1,this._state=0},p.prototype._start=function(){var g=this._handlers[this._id];if(g)for(var l=g.length-1;l>=0;l--)g[l].start();else this._handlerFb(this._id,"START")},p.prototype._put=function(g,l,h){var v=this._handlers[this._id];if(v)for(var d=v.length-1;d>=0;d--)v[d].put(g,l,h);else this._handlerFb(this._id,"PUT",i.utf32ToString(g,l,h))},p.prototype._end=function(g){var l=this._handlers[this._id];if(l){for(var h=l.length-1;h>=0&&l[h].end(g)===!1;h--);for(h--;h>=0;h--)l[h].end(!1)}else this._handlerFb(this._id,"END",g)},p.prototype.start=function(){this.reset(),this._id=-1,this._state=1},p.prototype.put=function(g,l,h){if(this._state!==3){if(this._state===1)for(;l<h;){var v=g[l++];if(v===59){this._state=2,this._start();break}if(v<48||57<v)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+v-48}this._state===2&&h-l>0&&this._put(g,l,h)}},p.prototype.end=function(g){this._state!==0&&(this._state!==3&&(this._state===1&&this._start(),this._end(g)),this._id=-1,this._state=0)},p}();Q.OscParser=M;var E=function(){function p(g){this._handler=g,this._data="",this._hitLimit=!1}return p.prototype.start=function(){this._data="",this._hitLimit=!1},p.prototype.put=function(g,l,h){this._hitLimit||(this._data+=i.utf32ToString(g,l,h),this._data.length>fe.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},p.prototype.end=function(g){var l;return this._hitLimit?l=!1:g&&(l=this._handler(this._data)),this._data="",this._hitLimit=!1,l},p}();Q.OscHandler=E},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.PAYLOAD_LIMIT=void 0,Q.PAYLOAD_LIMIT=1e7},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.DcsHandler=Q.DcsParser=void 0;var fe=he(8),i=he(21),M=he(23),E=[],p=function(){function l(){this._handlers=Object.create(null),this._active=E,this._ident=0,this._handlerFb=function(){}}return l.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},l.prototype.addHandler=function(h,v){this._handlers[h]===void 0&&(this._handlers[h]=[]);var d=this._handlers[h];return d.push(v),{dispose:function(){var o=d.indexOf(v);o!==-1&&d.splice(o,1)}}},l.prototype.setHandler=function(h,v){this._handlers[h]=[v]},l.prototype.clearHandler=function(h){this._handlers[h]&&delete this._handlers[h]},l.prototype.setHandlerFallback=function(h){this._handlerFb=h},l.prototype.reset=function(){this._active.length&&this.unhook(!1),this._active=E,this._ident=0},l.prototype.hook=function(h,v){if(this.reset(),this._ident=h,this._active=this._handlers[h]||E,this._active.length)for(var d=this._active.length-1;d>=0;d--)this._active[d].hook(v);else this._handlerFb(this._ident,"HOOK",v)},l.prototype.put=function(h,v,d){if(this._active.length)for(var o=this._active.length-1;o>=0;o--)this._active[o].put(h,v,d);else this._handlerFb(this._ident,"PUT",fe.utf32ToString(h,v,d))},l.prototype.unhook=function(h){if(this._active.length){for(var v=this._active.length-1;v>=0&&this._active[v].unhook(h)===!1;v--);for(v--;v>=0;v--)this._active[v].unhook(!1)}else this._handlerFb(this._ident,"UNHOOK",h);this._active=E,this._ident=0},l}();Q.DcsParser=p;var g=function(){function l(h){this._handler=h,this._data="",this._hitLimit=!1}return l.prototype.hook=function(h){this._params=h.clone(),this._data="",this._hitLimit=!1},l.prototype.put=function(h,v,d){this._hitLimit||(this._data+=fe.utf32ToString(h,v,d),this._data.length>M.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},l.prototype.unhook=function(h){var v;return this._hitLimit?v=!1:h&&(v=this._handler(this._data,this._params||new i.Params)),this._params=void 0,this._data="",this._hitLimit=!1,v},l}();Q.DcsHandler=g},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.removeTerminalFromCache=Q.acquireCharAtlas=void 0;var fe=he(26),i=he(43),M=[];Q.acquireCharAtlas=function(E,p,g,l,h){for(var v=fe.generateConfig(l,h,E,g),d=0;d<M.length;d++){var o=(s=M[d]).ownedBy.indexOf(p);if(o>=0){if(fe.configEquals(s.config,v))return s.atlas;s.ownedBy.length===1?(s.atlas.dispose(),M.splice(d,1)):s.ownedBy.splice(o,1);break}}for(d=0;d<M.length;d++){var s=M[d];if(fe.configEquals(s.config,v))return s.ownedBy.push(p),s.atlas}var u={atlas:new i.DynamicCharAtlas(document,v),config:v,ownedBy:[p]};return M.push(u),u.atlas},Q.removeTerminalFromCache=function(E){for(var p=0;p<M.length;p++){var g=M[p].ownedBy.indexOf(E);if(g!==-1){M[p].ownedBy.length===1?(M[p].atlas.dispose(),M.splice(p,1)):M[p].ownedBy.splice(g,1);break}}}},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.is256Color=Q.configEquals=Q.generateConfig=void 0;var fe=he(3);Q.generateConfig=function(i,M,E,p){var g={foreground:p.foreground,background:p.background,cursor:void 0,cursorAccent:void 0,selection:void 0,ansi:p.ansi.slice(0,16)};return{devicePixelRatio:window.devicePixelRatio,scaledCharWidth:i,scaledCharHeight:M,fontFamily:E.fontFamily,fontSize:E.fontSize,fontWeight:E.fontWeight,fontWeightBold:E.fontWeightBold,allowTransparency:E.allowTransparency,colors:g}},Q.configEquals=function(i,M){for(var E=0;E<i.colors.ansi.length;E++)if(i.colors.ansi[E].rgba!==M.colors.ansi[E].rgba)return!1;return i.devicePixelRatio===M.devicePixelRatio&&i.fontFamily===M.fontFamily&&i.fontSize===M.fontSize&&i.fontWeight===M.fontWeight&&i.fontWeightBold===M.fontWeightBold&&i.allowTransparency===M.allowTransparency&&i.scaledCharWidth===M.scaledCharWidth&&i.scaledCharHeight===M.scaledCharHeight&&i.colors.foreground===M.colors.foreground&&i.colors.background===M.colors.background},Q.is256Color=function(i){return i<fe.DEFAULT_COLOR}},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.ColorManager=Q.DEFAULT_ANSI_COLORS=void 0;var fe=he(10),i=he(45),M=fe.css.toColor("#ffffff"),E=fe.css.toColor("#000000"),p=fe.css.toColor("#ffffff"),g=fe.css.toColor("#000000"),l={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};Q.DEFAULT_ANSI_COLORS=function(){for(var v=[fe.css.toColor("#2e3436"),fe.css.toColor("#cc0000"),fe.css.toColor("#4e9a06"),fe.css.toColor("#c4a000"),fe.css.toColor("#3465a4"),fe.css.toColor("#75507b"),fe.css.toColor("#06989a"),fe.css.toColor("#d3d7cf"),fe.css.toColor("#555753"),fe.css.toColor("#ef2929"),fe.css.toColor("#8ae234"),fe.css.toColor("#fce94f"),fe.css.toColor("#729fcf"),fe.css.toColor("#ad7fa8"),fe.css.toColor("#34e2e2"),fe.css.toColor("#eeeeec")],d=[0,95,135,175,215,255],o=0;o<216;o++){var s=d[o/36%6|0],u=d[o/6%6|0],m=d[o%6];v.push({css:fe.channels.toCss(s,u,m),rgba:fe.channels.toRgba(s,u,m)})}for(o=0;o<24;o++){var y=8+10*o;v.push({css:fe.channels.toCss(y,y,y),rgba:fe.channels.toRgba(y,y,y)})}return v}();var h=function(){function v(d,o){this.allowTransparency=o;var s=d.createElement("canvas");s.width=1,s.height=1;var u=s.getContext("2d");if(!u)throw new Error("Could not get rendering context");this._ctx=u,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this._contrastCache=new i.ColorContrastCache,this.colors={foreground:M,background:E,cursor:p,cursorAccent:g,selectionTransparent:l,selectionOpaque:fe.color.blend(E,l),ansi:Q.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache}}return v.prototype.onOptionsChange=function(d){d==="minimumContrastRatio"&&this._contrastCache.clear()},v.prototype.setTheme=function(d){d===void 0&&(d={}),this.colors.foreground=this._parseColor(d.foreground,M),this.colors.background=this._parseColor(d.background,E),this.colors.cursor=this._parseColor(d.cursor,p,!0),this.colors.cursorAccent=this._parseColor(d.cursorAccent,g,!0),this.colors.selectionTransparent=this._parseColor(d.selection,l,!0),this.colors.selectionOpaque=fe.color.blend(this.colors.background,this.colors.selectionTransparent),fe.color.isOpaque(this.colors.selectionTransparent)&&(this.colors.selectionTransparent=fe.color.opacity(this.colors.selectionTransparent,.3)),this.colors.ansi[0]=this._parseColor(d.black,Q.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(d.red,Q.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(d.green,Q.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(d.yellow,Q.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(d.blue,Q.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(d.magenta,Q.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(d.cyan,Q.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(d.white,Q.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(d.brightBlack,Q.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(d.brightRed,Q.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(d.brightGreen,Q.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(d.brightYellow,Q.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(d.brightBlue,Q.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(d.brightMagenta,Q.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(d.brightCyan,Q.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(d.brightWhite,Q.DEFAULT_ANSI_COLORS[15]),this._contrastCache.clear()},v.prototype._parseColor=function(d,o,s){if(s===void 0&&(s=this.allowTransparency),d===void 0)return o;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=d,typeof this._ctx.fillStyle!="string")return console.warn("Color: "+d+" is invalid using fallback "+o.css),o;this._ctx.fillRect(0,0,1,1);var u=this._ctx.getImageData(0,0,1,1).data;if(u[3]!==255){if(!s)return console.warn("Color: "+d+" is using transparency, but allowTransparency is false. Using fallback "+o.css+"."),o;var m=this._ctx.fillStyle.substring(5,this._ctx.fillStyle.length-1).split(",").map(function(A){return Number(A)}),y=m[0],_=m[1],x=m[2],S=m[3],w=Math.round(255*S);return{rgba:fe.channels.toRgba(y,_,x,w),css:d}}return{css:this._ctx.fillStyle,rgba:fe.channels.toRgba(u[0],u[1],u[2],u[3])}},v}();Q.ColorManager=h},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.throwIfFalsy=void 0,Q.throwIfFalsy=function(fe){if(!fe)throw new Error("value must not be falsy");return fe}},function(Ue,Q,he){"use strict";var fe,i=this&&this.__extends||(fe=function(h,v){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,o){d.__proto__=o}||function(d,o){for(var s in o)o.hasOwnProperty(s)&&(d[s]=o[s])})(h,v)},function(h,v){function d(){this.constructor=h}fe(h,v),h.prototype=v===null?Object.create(v):(d.prototype=v.prototype,new d)});Object.defineProperty(Q,"__esModule",{value:!0}),Q.CharacterJoinerRegistry=Q.JoinedCellData=void 0;var M=he(6),E=he(3),p=he(4),g=function(h){function v(d,o,s){var u=h.call(this)||this;return u.content=0,u.combinedData="",u.fg=d.fg,u.bg=d.bg,u.combinedData=o,u._width=s,u}return i(v,h),v.prototype.isCombined=function(){return 2097152},v.prototype.getWidth=function(){return this._width},v.prototype.getChars=function(){return this.combinedData},v.prototype.getCode=function(){return 2097151},v.prototype.setFromCharData=function(d){throw new Error("not implemented")},v.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},v}(M.AttributeData);Q.JoinedCellData=g;var l=function(){function h(v){this._bufferService=v,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new p.CellData}return h.prototype.registerCharacterJoiner=function(v){var d={id:this._nextCharacterJoinerId++,handler:v};return this._characterJoiners.push(d),d.id},h.prototype.deregisterCharacterJoiner=function(v){for(var d=0;d<this._characterJoiners.length;d++)if(this._characterJoiners[d].id===v)return this._characterJoiners.splice(d,1),!0;return!1},h.prototype.getJoinedCharacters=function(v){if(this._characterJoiners.length===0)return[];var d=this._bufferService.buffer.lines.get(v);if(!d||d.length===0)return[];for(var o=[],s=d.translateToString(!0),u=0,m=0,y=0,_=d.getFg(0),x=d.getBg(0),S=0;S<d.getTrimmedLength();S++)if(d.loadCell(S,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==_||this._workCell.bg!==x){if(S-u>1)for(var w=this._getJoinedRanges(s,y,m,d,u),A=0;A<w.length;A++)o.push(w[A]);u=S,y=m,_=this._workCell.fg,x=this._workCell.bg}m+=this._workCell.getChars().length||E.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-u>1)for(w=this._getJoinedRanges(s,y,m,d,u),A=0;A<w.length;A++)o.push(w[A]);return o},h.prototype._getJoinedRanges=function(v,d,o,s,u){for(var m=v.substring(d,o),y=this._characterJoiners[0].handler(m),_=1;_<this._characterJoiners.length;_++)for(var x=this._characterJoiners[_].handler(m),S=0;S<x.length;S++)h._mergeRanges(y,x[S]);return this._stringRangesToCellRanges(y,s,u),y},h.prototype._stringRangesToCellRanges=function(v,d,o){var s=0,u=!1,m=0,y=v[s];if(y){for(var _=o;_<this._bufferService.cols;_++){var x=d.getWidth(_),S=d.getString(_).length||E.WHITESPACE_CELL_CHAR.length;if(x!==0){if(!u&&y[0]<=m&&(y[0]=_,u=!0),y[1]<=m){if(y[1]=_,!(y=v[++s]))break;y[0]<=m?(y[0]=_,u=!0):u=!1}m+=S}}y&&(y[1]=this._bufferService.cols)}},h._mergeRanges=function(v,d){for(var o=!1,s=0;s<v.length;s++){var u=v[s];if(o){if(d[1]<=u[0])return v[s-1][1]=d[1],v;if(d[1]<=u[1])return v[s-1][1]=Math.max(d[1],u[1]),v.splice(s,1),v;v.splice(s,1),s--}else{if(d[1]<=u[0])return v.splice(s,0,d),v;if(d[1]<=u[1])return u[0]=Math.min(d[0],u[0]),v;d[0]<u[1]&&(u[0]=Math.min(d[0],u[0]),o=!0)}}return o?v[v.length-1][1]=d[1]:v.push(d),v},h}();Q.CharacterJoinerRegistry=l},function(Ue,Q,he){"use strict";function fe(i,M){var E=M.getBoundingClientRect();return[i.clientX-E.left,i.clientY-E.top]}Object.defineProperty(Q,"__esModule",{value:!0}),Q.getRawByteCoords=Q.getCoords=Q.getCoordsRelativeToElement=void 0,Q.getCoordsRelativeToElement=fe,Q.getCoords=function(i,M,E,p,g,l,h,v){if(g){var d=fe(i,M);if(d)return d[0]=Math.ceil((d[0]+(v?l/2:0))/l),d[1]=Math.ceil(d[1]/h),d[0]=Math.min(Math.max(d[0],1),E+(v?1:0)),d[1]=Math.min(Math.max(d[1],1),p),d}},Q.getRawByteCoords=function(i){if(i)return{x:i[0]+32,y:i[1]+32}}},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.RenderDebouncer=void 0;var fe=function(){function i(M){this._renderCallback=M}return i.prototype.dispose=function(){this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},i.prototype.refresh=function(M,E,p){var g=this;this._rowCount=p,M=M!==void 0?M:0,E=E!==void 0?E:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,M):M,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,E):E,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){return g._innerRefresh()}))},i.prototype._innerRefresh=function(){if(this._rowStart!==void 0&&this._rowEnd!==void 0&&this._rowCount!==void 0){var M=Math.max(this._rowStart,0),E=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._animationFrame=void 0,this._renderCallback(M,E)}},i}();Q.RenderDebouncer=fe},function(Ue,Q,he){"use strict";var fe,i=this&&this.__extends||(fe=function(E,p){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,l){g.__proto__=l}||function(g,l){for(var h in l)l.hasOwnProperty(h)&&(g[h]=l[h])})(E,p)},function(E,p){function g(){this.constructor=E}fe(E,p),E.prototype=p===null?Object.create(p):(g.prototype=p.prototype,new g)});Object.defineProperty(Q,"__esModule",{value:!0}),Q.ScreenDprMonitor=void 0;var M=function(E){function p(){var g=E!==null&&E.apply(this,arguments)||this;return g._currentDevicePixelRatio=window.devicePixelRatio,g}return i(p,E),p.prototype.setListener=function(g){var l=this;this._listener&&this.clearListener(),this._listener=g,this._outerListener=function(){l._listener&&(l._listener(window.devicePixelRatio,l._currentDevicePixelRatio),l._updateDpr())},this._updateDpr()},p.prototype.dispose=function(){E.prototype.dispose.call(this),this.clearListener()},p.prototype._updateDpr=function(){var g;this._outerListener&&((g=this._resolutionMediaMatchList)===null||g===void 0||g.removeListener(this._outerListener),this._currentDevicePixelRatio=window.devicePixelRatio,this._resolutionMediaMatchList=window.matchMedia("screen and (resolution: "+window.devicePixelRatio+"dppx)"),this._resolutionMediaMatchList.addListener(this._outerListener))},p.prototype.clearListener=function(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)},p}(he(2).Disposable);Q.ScreenDprMonitor=M},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.clone=void 0,Q.clone=function fe(i,M){if(M===void 0&&(M=5),typeof i!="object")return i;var E=Array.isArray(i)?[]:{};for(var p in i)E[p]=M<=1?i[p]:i[p]?fe(i[p],M-1):i[p];return E}},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.Terminal=void 0;var fe=he(4),i=he(35),M=he(18),E=he(0),p=he(83),g=function(){function s(u){this._core=new i.Terminal(u),this._addonManager=new p.AddonManager}return s.prototype._checkProposedApi=function(){if(!this._core.optionsService.options.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")},Object.defineProperty(s.prototype,"onCursorMove",{get:function(){return this._core.onCursorMove},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"onLineFeed",{get:function(){return this._core.onLineFeed},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"onSelectionChange",{get:function(){return this._core.onSelectionChange},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"onData",{get:function(){return this._core.onData},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"onBinary",{get:function(){return this._core.onBinary},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"onTitleChange",{get:function(){return this._core.onTitleChange},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"onScroll",{get:function(){return this._core.onScroll},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"onKey",{get:function(){return this._core.onKey},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"onRender",{get:function(){return this._core.onRender},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"onResize",{get:function(){return this._core.onResize},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"element",{get:function(){return this._core.element},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"parser",{get:function(){return this._checkProposedApi(),this._parser||(this._parser=new d(this._core)),this._parser},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"unicode",{get:function(){return this._checkProposedApi(),new o(this._core)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"textarea",{get:function(){return this._core.textarea},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"rows",{get:function(){return this._core.rows},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"cols",{get:function(){return this._core.cols},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"buffer",{get:function(){return this._checkProposedApi(),new h(this._core.buffers)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"markers",{get:function(){return this._checkProposedApi(),this._core.markers},enumerable:!1,configurable:!0}),s.prototype.blur=function(){this._core.blur()},s.prototype.focus=function(){this._core.focus()},s.prototype.resize=function(u,m){this._verifyIntegers(u,m),this._core.resize(u,m)},s.prototype.open=function(u){this._core.open(u)},s.prototype.attachCustomKeyEventHandler=function(u){this._core.attachCustomKeyEventHandler(u)},s.prototype.registerLinkMatcher=function(u,m,y){return this._checkProposedApi(),this._core.registerLinkMatcher(u,m,y)},s.prototype.deregisterLinkMatcher=function(u){this._checkProposedApi(),this._core.deregisterLinkMatcher(u)},s.prototype.registerLinkProvider=function(u){return this._checkProposedApi(),this._core.registerLinkProvider(u)},s.prototype.registerCharacterJoiner=function(u){return this._checkProposedApi(),this._core.registerCharacterJoiner(u)},s.prototype.deregisterCharacterJoiner=function(u){this._checkProposedApi(),this._core.deregisterCharacterJoiner(u)},s.prototype.registerMarker=function(u){return this._checkProposedApi(),this._verifyIntegers(u),this._core.addMarker(u)},s.prototype.addMarker=function(u){return this.registerMarker(u)},s.prototype.hasSelection=function(){return this._core.hasSelection()},s.prototype.select=function(u,m,y){this._verifyIntegers(u,m,y),this._core.select(u,m,y)},s.prototype.getSelection=function(){return this._core.getSelection()},s.prototype.getSelectionPosition=function(){return this._core.getSelectionPosition()},s.prototype.clearSelection=function(){this._core.clearSelection()},s.prototype.selectAll=function(){this._core.selectAll()},s.prototype.selectLines=function(u,m){this._verifyIntegers(u,m),this._core.selectLines(u,m)},s.prototype.dispose=function(){this._addonManager.dispose(),this._core.dispose()},s.prototype.scrollLines=function(u){this._verifyIntegers(u),this._core.scrollLines(u)},s.prototype.scrollPages=function(u){this._verifyIntegers(u),this._core.scrollPages(u)},s.prototype.scrollToTop=function(){this._core.scrollToTop()},s.prototype.scrollToBottom=function(){this._core.scrollToBottom()},s.prototype.scrollToLine=function(u){this._verifyIntegers(u),this._core.scrollToLine(u)},s.prototype.clear=function(){this._core.clear()},s.prototype.write=function(u,m){this._core.write(u,m)},s.prototype.writeUtf8=function(u,m){this._core.write(u,m)},s.prototype.writeln=function(u,m){this._core.write(u),this._core.write(`\r
`,m)},s.prototype.paste=function(u){this._core.paste(u)},s.prototype.getOption=function(u){return this._core.optionsService.getOption(u)},s.prototype.setOption=function(u,m){this._core.optionsService.setOption(u,m)},s.prototype.refresh=function(u,m){this._verifyIntegers(u,m),this._core.refresh(u,m)},s.prototype.reset=function(){this._core.reset()},s.prototype.loadAddon=function(u){return this._addonManager.loadAddon(this,u)},Object.defineProperty(s,"strings",{get:function(){return M},enumerable:!1,configurable:!0}),s.prototype._verifyIntegers=function(){for(var u=[],m=0;m<arguments.length;m++)u[m]=arguments[m];for(var y=0,_=u;y<_.length;y++){var x=_[y];if(x===1/0||isNaN(x)||x%1!=0)throw new Error("This API only accepts integers")}},s}();Q.Terminal=g;var l=function(){function s(u,m){this._buffer=u,this.type=m}return s.prototype.init=function(u){return this._buffer=u,this},Object.defineProperty(s.prototype,"cursorY",{get:function(){return this._buffer.y},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"cursorX",{get:function(){return this._buffer.x},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"viewportY",{get:function(){return this._buffer.ydisp},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"baseY",{get:function(){return this._buffer.ybase},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"length",{get:function(){return this._buffer.lines.length},enumerable:!1,configurable:!0}),s.prototype.getLine=function(u){var m=this._buffer.lines.get(u);if(m)return new v(m)},s.prototype.getNullCell=function(){return new fe.CellData},s}(),h=function(){function s(u){var m=this;this._buffers=u,this._onBufferChange=new E.EventEmitter,this._normal=new l(this._buffers.normal,"normal"),this._alternate=new l(this._buffers.alt,"alternate"),this._buffers.onBufferActivate(function(){return m._onBufferChange.fire(m.active)})}return Object.defineProperty(s.prototype,"onBufferChange",{get:function(){return this._onBufferChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"active",{get:function(){if(this._buffers.active===this._buffers.normal)return this.normal;if(this._buffers.active===this._buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"normal",{get:function(){return this._normal.init(this._buffers.normal)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"alternate",{get:function(){return this._alternate.init(this._buffers.alt)},enumerable:!1,configurable:!0}),s}(),v=function(){function s(u){this._line=u}return Object.defineProperty(s.prototype,"isWrapped",{get:function(){return this._line.isWrapped},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"length",{get:function(){return this._line.length},enumerable:!1,configurable:!0}),s.prototype.getCell=function(u,m){if(!(u<0||u>=this._line.length))return m?(this._line.loadCell(u,m),m):this._line.loadCell(u,new fe.CellData)},s.prototype.translateToString=function(u,m,y){return this._line.translateToString(u,m,y)},s}(),d=function(){function s(u){this._core=u}return s.prototype.registerCsiHandler=function(u,m){return this._core.addCsiHandler(u,function(y){return m(y.toArray())})},s.prototype.addCsiHandler=function(u,m){return this.registerCsiHandler(u,m)},s.prototype.registerDcsHandler=function(u,m){return this._core.addDcsHandler(u,function(y,_){return m(y,_.toArray())})},s.prototype.addDcsHandler=function(u,m){return this.registerDcsHandler(u,m)},s.prototype.registerEscHandler=function(u,m){return this._core.addEscHandler(u,m)},s.prototype.addEscHandler=function(u,m){return this.registerEscHandler(u,m)},s.prototype.registerOscHandler=function(u,m){return this._core.addOscHandler(u,m)},s.prototype.addOscHandler=function(u,m){return this.registerOscHandler(u,m)},s}(),o=function(){function s(u){this._core=u}return s.prototype.register=function(u){this._core.unicodeService.register(u)},Object.defineProperty(s.prototype,"versions",{get:function(){return this._core.unicodeService.versions},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"activeVersion",{get:function(){return this._core.unicodeService.activeVersion},set:function(u){this._core.unicodeService.activeVersion=u},enumerable:!1,configurable:!0}),s}()},function(Ue,Q,he){"use strict";var fe,i=this&&this.__extends||(fe=function(Z,$){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(oe,ae){oe.__proto__=ae}||function(oe,ae){for(var ye in ae)ae.hasOwnProperty(ye)&&(oe[ye]=ae[ye])})(Z,$)},function(Z,$){function oe(){this.constructor=Z}fe(Z,$),Z.prototype=$===null?Object.create($):(oe.prototype=$.prototype,new oe)});Object.defineProperty(Q,"__esModule",{value:!0}),Q.Terminal=void 0;var M=he(36),E=he(37),p=he(38),g=he(12),l=he(19),h=he(40),v=he(50),d=he(51),o=he(11),s=he(7),u=he(18),m=he(54),y=he(55),_=he(56),x=he(57),S=he(59),w=he(0),A=he(16),H=he(27),R=he(60),F=he(5),D=he(61),B=he(62),P=he(63),U=he(64),G=he(65),ee=typeof window!="undefined"?window.document:null,K=function(Z){function $(oe){oe===void 0&&(oe={});var ae=Z.call(this,oe)||this;return ae.browser=o,ae._keyDownHandled=!1,ae._onCursorMove=new w.EventEmitter,ae._onKey=new w.EventEmitter,ae._onRender=new w.EventEmitter,ae._onSelectionChange=new w.EventEmitter,ae._onTitleChange=new w.EventEmitter,ae._onFocus=new w.EventEmitter,ae._onBlur=new w.EventEmitter,ae._onA11yCharEmitter=new w.EventEmitter,ae._onA11yTabEmitter=new w.EventEmitter,ae._setup(),ae.linkifier=ae._instantiationService.createInstance(v.Linkifier),ae.linkifier2=ae.register(ae._instantiationService.createInstance(P.Linkifier2)),ae.register(ae._inputHandler.onRequestBell(function(){return ae.bell()})),ae.register(ae._inputHandler.onRequestRefreshRows(function(ye,Y){return ae.refresh(ye,Y)})),ae.register(ae._inputHandler.onRequestReset(function(){return ae.reset()})),ae.register(ae._inputHandler.onRequestScroll(function(ye,Y){return ae.scroll(ye,Y||void 0)})),ae.register(ae._inputHandler.onRequestWindowsOptionsReport(function(ye){return ae._reportWindowsOptions(ye)})),ae.register(w.forwardEvent(ae._inputHandler.onCursorMove,ae._onCursorMove)),ae.register(w.forwardEvent(ae._inputHandler.onTitleChange,ae._onTitleChange)),ae.register(w.forwardEvent(ae._inputHandler.onA11yChar,ae._onA11yCharEmitter)),ae.register(w.forwardEvent(ae._inputHandler.onA11yTab,ae._onA11yTabEmitter)),ae.register(ae._bufferService.onResize(function(ye){return ae._afterResize(ye.cols,ye.rows)})),ae}return i($,Z),Object.defineProperty($.prototype,"options",{get:function(){return this.optionsService.options},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"onKey",{get:function(){return this._onKey.event},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"onFocus",{get:function(){return this._onFocus.event},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"onBlur",{get:function(){return this._onBlur.event},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"onA11yChar",{get:function(){return this._onA11yCharEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"onA11yTab",{get:function(){return this._onA11yTabEmitter.event},enumerable:!1,configurable:!0}),$.prototype.dispose=function(){var oe,ae,ye;this._isDisposed||(Z.prototype.dispose.call(this),(oe=this._renderService)===null||oe===void 0||oe.dispose(),this._customKeyEventHandler=void 0,this.write=function(){},(ye=(ae=this.element)===null||ae===void 0?void 0:ae.parentNode)===null||ye===void 0||ye.removeChild(this.element))},$.prototype._setup=function(){Z.prototype._setup.call(this),this._customKeyEventHandler=void 0},Object.defineProperty($.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),$.prototype.focus=function(){this.textarea&&this.textarea.focus({preventScroll:!0})},$.prototype._updateOptions=function(oe){var ae,ye,Y,le;switch(Z.prototype._updateOptions.call(this,oe),oe){case"fontFamily":case"fontSize":(ae=this._renderService)===null||ae===void 0||ae.clear(),(ye=this._charSizeService)===null||ye===void 0||ye.measure();break;case"cursorBlink":case"cursorStyle":this.refresh(this.buffer.y,this.buffer.y);break;case"drawBoldTextInBrightColors":case"letterSpacing":case"lineHeight":case"fontWeight":case"fontWeightBold":case"minimumContrastRatio":this._renderService&&(this._renderService.clear(),this._renderService.onResize(this.cols,this.rows),this.refresh(0,this.rows-1));break;case"rendererType":this._renderService&&(this._renderService.setRenderer(this._createRenderer()),this._renderService.onResize(this.cols,this.rows));break;case"scrollback":(Y=this.viewport)===null||Y===void 0||Y.syncScrollArea();break;case"screenReaderMode":this.optionsService.options.screenReaderMode?!this._accessibilityManager&&this._renderService&&(this._accessibilityManager=new _.AccessibilityManager(this,this._renderService)):((le=this._accessibilityManager)===null||le===void 0||le.dispose(),this._accessibilityManager=void 0);break;case"tabStopWidth":this.buffers.setupTabStops();break;case"theme":this._setTheme(this.optionsService.options.theme)}},$.prototype._onTextAreaFocus=function(oe){this._coreService.decPrivateModes.sendFocus&&this._coreService.triggerDataEvent(g.C0.ESC+"[I"),this.updateCursorStyle(oe),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()},$.prototype.blur=function(){var oe;return(oe=this.textarea)===null||oe===void 0?void 0:oe.blur()},$.prototype._onTextAreaBlur=function(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this._coreService.decPrivateModes.sendFocus&&this._coreService.triggerDataEvent(g.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()},$.prototype._syncTextArea=function(){if(this.textarea&&this.buffer.isCursorInViewport&&!this._compositionHelper.isComposing){var oe=Math.ceil(this._charSizeService.height*this.optionsService.options.lineHeight),ae=this._bufferService.buffer.y*oe,ye=this._bufferService.buffer.x*this._charSizeService.width;this.textarea.style.left=ye+"px",this.textarea.style.top=ae+"px",this.textarea.style.width=this._charSizeService.width+"px",this.textarea.style.height=oe+"px",this.textarea.style.lineHeight=oe+"px",this.textarea.style.zIndex="-5"}},$.prototype._initGlobal=function(){var oe=this;this._bindKeys(),this.register(s.addDisposableDomListener(this.element,"copy",function(ye){oe.hasSelection()&&p.copyHandler(ye,oe._selectionService)}));var ae=function(ye){return p.handlePasteEvent(ye,oe.textarea,oe._coreService)};this.register(s.addDisposableDomListener(this.textarea,"paste",ae)),this.register(s.addDisposableDomListener(this.element,"paste",ae)),o.isFirefox?this.register(s.addDisposableDomListener(this.element,"mousedown",function(ye){ye.button===2&&p.rightClickHandler(ye,oe.textarea,oe.screenElement,oe._selectionService,oe.options.rightClickSelectsWord)})):this.register(s.addDisposableDomListener(this.element,"contextmenu",function(ye){p.rightClickHandler(ye,oe.textarea,oe.screenElement,oe._selectionService,oe.options.rightClickSelectsWord)})),o.isLinux&&this.register(s.addDisposableDomListener(this.element,"auxclick",function(ye){ye.button===1&&p.moveTextAreaUnderMouseCursor(ye,oe.textarea,oe.screenElement)}))},$.prototype._bindKeys=function(){var oe=this;this.register(s.addDisposableDomListener(this.textarea,"keyup",function(ae){return oe._keyUp(ae)},!0)),this.register(s.addDisposableDomListener(this.textarea,"keydown",function(ae){return oe._keyDown(ae)},!0)),this.register(s.addDisposableDomListener(this.textarea,"keypress",function(ae){return oe._keyPress(ae)},!0)),this.register(s.addDisposableDomListener(this.textarea,"compositionstart",function(){return oe._compositionHelper.compositionstart()})),this.register(s.addDisposableDomListener(this.textarea,"compositionupdate",function(ae){return oe._compositionHelper.compositionupdate(ae)})),this.register(s.addDisposableDomListener(this.textarea,"compositionend",function(){return oe._compositionHelper.compositionend()})),this.register(this.onRender(function(){return oe._compositionHelper.updateCompositionElements()})),this.register(this.onRender(function(ae){return oe._queueLinkification(ae.start,ae.end)}))},$.prototype.open=function(oe){var ae=this;if(!oe)throw new Error("Terminal requires a parent element.");ee.body.contains(oe)||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=oe.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),this.element.setAttribute("tabindex","0"),oe.appendChild(this.element);var ye=ee.createDocumentFragment();this._viewportElement=ee.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),ye.appendChild(this._viewportElement),this._viewportScrollArea=ee.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=ee.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=ee.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),ye.appendChild(this.screenElement),this.textarea=ee.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",u.promptLabel),this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this.register(s.addDisposableDomListener(this.textarea,"focus",function(xe){return ae._onTextAreaFocus(xe)})),this.register(s.addDisposableDomListener(this.textarea,"blur",function(){return ae._onTextAreaBlur()})),this._helperContainer.appendChild(this.textarea);var Y=this._instantiationService.createInstance(U.CoreBrowserService,this.textarea);this._instantiationService.setService(F.ICoreBrowserService,Y),this._charSizeService=this._instantiationService.createInstance(D.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(F.ICharSizeService,this._charSizeService),this._compositionView=ee.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(M.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(ye),this._theme=this.options.theme||this._theme,this._colorManager=new H.ColorManager(ee,this.options.allowTransparency),this.register(this.optionsService.onOptionChange(function(xe){return ae._colorManager.onOptionsChange(xe)})),this._colorManager.setTheme(this._theme);var le=this._createRenderer();this._renderService=this.register(this._instantiationService.createInstance(R.RenderService,le,this.rows,this.screenElement)),this._instantiationService.setService(F.IRenderService,this._renderService),this.register(this._renderService.onRenderedBufferChange(function(xe){return ae._onRender.fire(xe)})),this.onResize(function(xe){return ae._renderService.resize(xe.cols,xe.rows)}),this._soundService=this._instantiationService.createInstance(m.SoundService),this._instantiationService.setService(F.ISoundService,this._soundService),this._mouseService=this._instantiationService.createInstance(B.MouseService),this._instantiationService.setService(F.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(E.Viewport,function(xe,Ce){return ae.scrollLines(xe,Ce)},this._viewportElement,this._viewportScrollArea),this.viewport.onThemeChange(this._colorManager.colors),this.register(this._inputHandler.onRequestSyncScrollBar(function(){return ae.viewport.syncScrollArea()})),this.register(this.viewport),this.register(this.onCursorMove(function(){ae._renderService.onCursorMove(),ae._syncTextArea()})),this.register(this.onResize(function(){return ae._renderService.onResize(ae.cols,ae.rows)})),this.register(this.onBlur(function(){return ae._renderService.onBlur()})),this.register(this.onFocus(function(){return ae._renderService.onFocus()})),this.register(this._renderService.onDimensionsChange(function(){return ae.viewport.syncScrollArea()})),this._selectionService=this.register(this._instantiationService.createInstance(d.SelectionService,this.element,this.screenElement)),this._instantiationService.setService(F.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(function(xe){return ae.scrollLines(xe.amount,xe.suppressScrollEvent)})),this.register(this._selectionService.onSelectionChange(function(){return ae._onSelectionChange.fire()})),this.register(this._selectionService.onRequestRedraw(function(xe){return ae._renderService.onSelectionChanged(xe.start,xe.end,xe.columnSelectMode)})),this.register(this._selectionService.onLinuxMouseSelection(function(xe){ae.textarea.value=xe,ae.textarea.focus(),ae.textarea.select()})),this.register(this.onScroll(function(){ae.viewport.syncScrollArea(),ae._selectionService.refresh()})),this.register(s.addDisposableDomListener(this._viewportElement,"scroll",function(){return ae._selectionService.refresh()})),this._mouseZoneManager=this._instantiationService.createInstance(y.MouseZoneManager,this.element,this.screenElement),this.register(this._mouseZoneManager),this.register(this.onScroll(function(){return ae._mouseZoneManager.clearAll()})),this.linkifier.attachToDom(this.element,this._mouseZoneManager),this.linkifier2.attachToDom(this.element,this._mouseService,this._renderService),this.register(s.addDisposableDomListener(this.element,"mousedown",function(xe){return ae._selectionService.onMouseDown(xe)})),this._coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new _.AccessibilityManager(this,this._renderService)),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()},$.prototype._createRenderer=function(){switch(this.options.rendererType){case"canvas":return this._instantiationService.createInstance(h.Renderer,this._colorManager.colors,this.screenElement,this.linkifier,this.linkifier2);case"dom":return this._instantiationService.createInstance(x.DomRenderer,this._colorManager.colors,this.element,this.screenElement,this._viewportElement,this.linkifier,this.linkifier2);default:throw new Error('Unrecognized rendererType "'+this.options.rendererType+'"')}},$.prototype._setTheme=function(oe){var ae,ye,Y;this._theme=oe,(ae=this._colorManager)===null||ae===void 0||ae.setTheme(oe),(ye=this._renderService)===null||ye===void 0||ye.setColors(this._colorManager.colors),(Y=this.viewport)===null||Y===void 0||Y.onThemeChange(this._colorManager.colors)},$.prototype.bindMouse=function(){var oe=this,ae=this,ye=this.element;function Y(de){var be,Te,Ae=ae._mouseService.getRawByteCoords(de,ae.screenElement,ae.cols,ae.rows);if(!Ae)return!1;switch(de.overrideType||de.type){case"mousemove":Te=32,de.buttons===void 0?(be=3,de.button!==void 0&&(be=de.button<3?de.button:3)):be=1&de.buttons?0:4&de.buttons?1:2&de.buttons?2:3;break;case"mouseup":Te=0,be=de.button<3?de.button:3;break;case"mousedown":Te=1,be=de.button<3?de.button:3;break;case"wheel":de.deltaY!==0&&(Te=de.deltaY<0?0:1),be=4;break;default:return!1}return!(Te===void 0||be===void 0||be>4)&&ae._coreMouseService.triggerMouseEvent({col:Ae.x-33,row:Ae.y-33,button:be,action:Te,ctrl:de.ctrlKey,alt:de.altKey,shift:de.shiftKey})}var le={mouseup:null,wheel:null,mousedrag:null,mousemove:null},xe=function(de){return Y(de),de.buttons||(oe._document.removeEventListener("mouseup",le.mouseup),le.mousedrag&&oe._document.removeEventListener("mousemove",le.mousedrag)),oe.cancel(de)},Ce=function(de){return Y(de),de.preventDefault(),oe.cancel(de)},we=function(de){de.buttons&&Y(de)},Le=function(de){de.buttons||Y(de)};this.register(this._coreMouseService.onProtocolChange(function(de){de?(oe.optionsService.options.logLevel==="debug"&&oe._logService.debug("Binding to mouse events:",oe._coreMouseService.explainEvents(de)),oe.element.classList.add("enable-mouse-events"),oe._selectionService.disable()):(oe._logService.debug("Unbinding from mouse events."),oe.element.classList.remove("enable-mouse-events"),oe._selectionService.enable()),8&de?le.mousemove||(ye.addEventListener("mousemove",Le),le.mousemove=Le):(ye.removeEventListener("mousemove",le.mousemove),le.mousemove=null),16&de?le.wheel||(ye.addEventListener("wheel",Ce,{passive:!1}),le.wheel=Ce):(ye.removeEventListener("wheel",le.wheel),le.wheel=null),2&de?le.mouseup||(le.mouseup=xe):(oe._document.removeEventListener("mouseup",le.mouseup),le.mouseup=null),4&de?le.mousedrag||(le.mousedrag=we):(oe._document.removeEventListener("mousemove",le.mousedrag),le.mousedrag=null)})),this._coreMouseService.activeProtocol=this._coreMouseService.activeProtocol,this.register(s.addDisposableDomListener(ye,"mousedown",function(de){if(de.preventDefault(),oe.focus(),oe._coreMouseService.areMouseEventsActive&&!oe._selectionService.shouldForceSelection(de))return Y(de),le.mouseup&&oe._document.addEventListener("mouseup",le.mouseup),le.mousedrag&&oe._document.addEventListener("mousemove",le.mousedrag),oe.cancel(de)})),this.register(s.addDisposableDomListener(ye,"wheel",function(de){if(!le.wheel){if(!oe.buffer.hasScrollback){var be=oe.viewport.getLinesScrolled(de);if(be===0)return;for(var Te=g.C0.ESC+(oe._coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(de.deltaY<0?"A":"B"),Ae="",Be=0;Be<Math.abs(be);Be++)Ae+=Te;oe._coreService.triggerDataEvent(Ae,!0)}}},{passive:!0})),this.register(s.addDisposableDomListener(ye,"wheel",function(de){if(!le.wheel)return oe.viewport.onWheel(de)?void 0:oe.cancel(de)},{passive:!1})),this.register(s.addDisposableDomListener(ye,"touchstart",function(de){if(!oe._coreMouseService.areMouseEventsActive)return oe.viewport.onTouchStart(de),oe.cancel(de)},{passive:!0})),this.register(s.addDisposableDomListener(ye,"touchmove",function(de){if(!oe._coreMouseService.areMouseEventsActive)return oe.viewport.onTouchMove(de)?void 0:oe.cancel(de)},{passive:!1}))},$.prototype.refresh=function(oe,ae){var ye;(ye=this._renderService)===null||ye===void 0||ye.refreshRows(oe,ae)},$.prototype._queueLinkification=function(oe,ae){var ye;(ye=this.linkifier)===null||ye===void 0||ye.linkifyRows(oe,ae)},$.prototype.updateCursorStyle=function(oe){this._selectionService&&this._selectionService.shouldColumnSelect(oe)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")},$.prototype._showCursor=function(){this._coreService.isCursorInitialized||(this._coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))},$.prototype.scrollLines=function(oe,ae){Z.prototype.scrollLines.call(this,oe,ae),this.refresh(0,this.rows-1)},$.prototype.paste=function(oe){p.paste(oe,this.textarea,this._coreService)},$.prototype.attachCustomKeyEventHandler=function(oe){this._customKeyEventHandler=oe},$.prototype.registerLinkMatcher=function(oe,ae,ye){var Y=this.linkifier.registerLinkMatcher(oe,ae,ye);return this.refresh(0,this.rows-1),Y},$.prototype.deregisterLinkMatcher=function(oe){this.linkifier.deregisterLinkMatcher(oe)&&this.refresh(0,this.rows-1)},$.prototype.registerLinkProvider=function(oe){return this.linkifier2.registerLinkProvider(oe)},$.prototype.registerCharacterJoiner=function(oe){var ae=this._renderService.registerCharacterJoiner(oe);return this.refresh(0,this.rows-1),ae},$.prototype.deregisterCharacterJoiner=function(oe){this._renderService.deregisterCharacterJoiner(oe)&&this.refresh(0,this.rows-1)},Object.defineProperty($.prototype,"markers",{get:function(){return this.buffer.markers},enumerable:!1,configurable:!0}),$.prototype.addMarker=function(oe){if(this.buffer===this.buffers.normal)return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+oe)},$.prototype.hasSelection=function(){return!!this._selectionService&&this._selectionService.hasSelection},$.prototype.select=function(oe,ae,ye){this._selectionService.setSelection(oe,ae,ye)},$.prototype.getSelection=function(){return this._selectionService?this._selectionService.selectionText:""},$.prototype.getSelectionPosition=function(){if(this._selectionService&&this._selectionService.hasSelection)return{startColumn:this._selectionService.selectionStart[0],startRow:this._selectionService.selectionStart[1],endColumn:this._selectionService.selectionEnd[0],endRow:this._selectionService.selectionEnd[1]}},$.prototype.clearSelection=function(){var oe;(oe=this._selectionService)===null||oe===void 0||oe.clearSelection()},$.prototype.selectAll=function(){var oe;(oe=this._selectionService)===null||oe===void 0||oe.selectAll()},$.prototype.selectLines=function(oe,ae){var ye;(ye=this._selectionService)===null||ye===void 0||ye.selectLines(oe,ae)},$.prototype._keyDown=function(oe){if(this._keyDownHandled=!1,this._customKeyEventHandler&&this._customKeyEventHandler(oe)===!1)return!1;if(!this._compositionHelper.keydown(oe))return this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;var ae=S.evaluateKeyboardEvent(oe,this._coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(oe),ae.type===3||ae.type===2){var ye=this.rows-1;return this.scrollLines(ae.type===2?-ye:ye),this.cancel(oe,!0)}return ae.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,oe)||(ae.cancel&&this.cancel(oe,!0),!ae.key||(ae.key!==g.C0.ETX&&ae.key!==g.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ae.key,domEvent:oe}),this._showCursor(),this._coreService.triggerDataEvent(ae.key,!0),this.optionsService.options.screenReaderMode?void(this._keyDownHandled=!0):this.cancel(oe,!0)))},$.prototype._isThirdLevelShift=function(oe,ae){var ye=oe.isMac&&!this.options.macOptionIsMeta&&ae.altKey&&!ae.ctrlKey&&!ae.metaKey||oe.isWindows&&ae.altKey&&ae.ctrlKey&&!ae.metaKey;return ae.type==="keypress"?ye:ye&&(!ae.keyCode||ae.keyCode>47)},$.prototype._keyUp=function(oe){this._customKeyEventHandler&&this._customKeyEventHandler(oe)===!1||(function(ae){return ae.keyCode===16||ae.keyCode===17||ae.keyCode===18}(oe)||this.focus(),this.updateCursorStyle(oe))},$.prototype._keyPress=function(oe){var ae;if(this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(oe)===!1)return!1;if(this.cancel(oe),oe.charCode)ae=oe.charCode;else if(oe.which===null||oe.which===void 0)ae=oe.keyCode;else{if(oe.which===0||oe.charCode===0)return!1;ae=oe.which}return!(!ae||(oe.altKey||oe.ctrlKey||oe.metaKey)&&!this._isThirdLevelShift(this.browser,oe))&&(ae=String.fromCharCode(ae),this._onKey.fire({key:ae,domEvent:oe}),this._showCursor(),this._coreService.triggerDataEvent(ae,!0),!0)},$.prototype.bell=function(){this._soundBell()&&this._soundService.playBellSound()},$.prototype.resize=function(oe,ae){oe!==this.cols||ae!==this.rows?Z.prototype.resize.call(this,oe,ae):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()},$.prototype._afterResize=function(oe,ae){var ye,Y;(ye=this._charSizeService)===null||ye===void 0||ye.measure(),(Y=this.viewport)===null||Y===void 0||Y.syncScrollArea(!0)},$.prototype.clear=function(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(var oe=1;oe<this.rows;oe++)this.buffer.lines.push(this.buffer.getBlankLine(A.DEFAULT_ATTR_DATA));this.refresh(0,this.rows-1),this._onScroll.fire(this.buffer.ydisp)}},$.prototype.reset=function(){var oe,ae;this.options.rows=this.rows,this.options.cols=this.cols;var ye=this._customKeyEventHandler;this._setup(),Z.prototype.reset.call(this),(oe=this._selectionService)===null||oe===void 0||oe.reset(),this._customKeyEventHandler=ye,this.refresh(0,this.rows-1),(ae=this.viewport)===null||ae===void 0||ae.syncScrollArea()},$.prototype._reportWindowsOptions=function(oe){if(this._renderService)switch(oe){case l.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:var ae=this._renderService.dimensions.scaledCanvasWidth.toFixed(0),ye=this._renderService.dimensions.scaledCanvasHeight.toFixed(0);this._coreService.triggerDataEvent(g.C0.ESC+"[4;"+ye+";"+ae+"t");break;case l.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:var Y=this._renderService.dimensions.scaledCellWidth.toFixed(0),le=this._renderService.dimensions.scaledCellHeight.toFixed(0);this._coreService.triggerDataEvent(g.C0.ESC+"[6;"+le+";"+Y+"t")}},$.prototype.cancel=function(oe,ae){if(this.options.cancelEvents||ae)return oe.preventDefault(),oe.stopPropagation(),!1},$.prototype._visualBell=function(){return!1},$.prototype._soundBell=function(){return this.options.bellStyle==="sound"},$}(G.CoreTerminal);Q.Terminal=K},function(Ue,Q,he){"use strict";var fe=this&&this.__decorate||function(g,l,h,v){var d,o=arguments.length,s=o<3?l:v===null?v=Object.getOwnPropertyDescriptor(l,h):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(g,l,h,v);else for(var u=g.length-1;u>=0;u--)(d=g[u])&&(s=(o<3?d(s):o>3?d(l,h,s):d(l,h))||s);return o>3&&s&&Object.defineProperty(l,h,s),s},i=this&&this.__param||function(g,l){return function(h,v){l(h,v,g)}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.CompositionHelper=void 0;var M=he(5),E=he(1),p=function(){function g(l,h,v,d,o,s){this._textarea=l,this._compositionView=h,this._bufferService=v,this._optionsService=d,this._charSizeService=o,this._coreService=s,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0}}return Object.defineProperty(g.prototype,"isComposing",{get:function(){return this._isComposing},enumerable:!1,configurable:!0}),g.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._compositionView.classList.add("active")},g.prototype.compositionupdate=function(l){var h=this;this._compositionView.textContent=l.data,this.updateCompositionElements(),setTimeout(function(){h._compositionPosition.end=h._textarea.value.length},0)},g.prototype.compositionend=function(){this._finalizeComposition(!0)},g.prototype.keydown=function(l){if(this._isComposing||this._isSendingComposition){if(l.keyCode===229||l.keyCode===16||l.keyCode===17||l.keyCode===18)return!1;this._finalizeComposition(!1)}return l.keyCode!==229||(this._handleAnyTextareaChanges(),!1)},g.prototype._finalizeComposition=function(l){var h=this;if(this._compositionView.classList.remove("active"),this._isComposing=!1,l){var v={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(function(){if(h._isSendingComposition){h._isSendingComposition=!1;var o=void 0;o=h._isComposing?h._textarea.value.substring(v.start,v.end):h._textarea.value.substring(v.start),h._coreService.triggerDataEvent(o,!0)}},0)}else{this._isSendingComposition=!1;var d=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(d,!0)}},g.prototype._handleAnyTextareaChanges=function(){var l=this,h=this._textarea.value;setTimeout(function(){if(!l._isComposing){var v=l._textarea.value.replace(h,"");v.length>0&&l._coreService.triggerDataEvent(v,!0)}},0)},g.prototype.updateCompositionElements=function(l){var h=this;if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){var v=Math.ceil(this._charSizeService.height*this._optionsService.options.lineHeight),d=this._bufferService.buffer.y*v,o=this._bufferService.buffer.x*this._charSizeService.width;this._compositionView.style.left=o+"px",this._compositionView.style.top=d+"px",this._compositionView.style.height=v+"px",this._compositionView.style.lineHeight=v+"px",this._compositionView.style.fontFamily=this._optionsService.options.fontFamily,this._compositionView.style.fontSize=this._optionsService.options.fontSize+"px";var s=this._compositionView.getBoundingClientRect();this._textarea.style.left=o+"px",this._textarea.style.top=d+"px",this._textarea.style.width=s.width+"px",this._textarea.style.height=s.height+"px",this._textarea.style.lineHeight=s.height+"px"}l||setTimeout(function(){return h.updateCompositionElements(!0)},0)}},g=fe([i(2,E.IBufferService),i(3,E.IOptionsService),i(4,M.ICharSizeService),i(5,E.ICoreService)],g)}();Q.CompositionHelper=p},function(Ue,Q,he){"use strict";var fe,i=this&&this.__extends||(fe=function(d,o){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,u){s.__proto__=u}||function(s,u){for(var m in u)u.hasOwnProperty(m)&&(s[m]=u[m])})(d,o)},function(d,o){function s(){this.constructor=d}fe(d,o),d.prototype=o===null?Object.create(o):(s.prototype=o.prototype,new s)}),M=this&&this.__decorate||function(d,o,s,u){var m,y=arguments.length,_=y<3?o:u===null?u=Object.getOwnPropertyDescriptor(o,s):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(d,o,s,u);else for(var x=d.length-1;x>=0;x--)(m=d[x])&&(_=(y<3?m(_):y>3?m(o,s,_):m(o,s))||_);return y>3&&_&&Object.defineProperty(o,s,_),_},E=this&&this.__param||function(d,o){return function(s,u){o(s,u,d)}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.Viewport=void 0;var p=he(2),g=he(7),l=he(5),h=he(1),v=function(d){function o(s,u,m,y,_,x,S){var w=d.call(this)||this;return w._scrollLines=s,w._viewportElement=u,w._scrollArea=m,w._bufferService=y,w._optionsService=_,w._charSizeService=x,w._renderService=S,w.scrollBarWidth=0,w._currentRowHeight=0,w._lastRecordedBufferLength=0,w._lastRecordedViewportHeight=0,w._lastRecordedBufferHeight=0,w._lastTouchY=0,w._lastScrollTop=0,w._wheelPartialScroll=0,w._refreshAnimationFrame=null,w._ignoreNextScrollEvent=!1,w.scrollBarWidth=w._viewportElement.offsetWidth-w._scrollArea.offsetWidth||15,w.register(g.addDisposableDomListener(w._viewportElement,"scroll",w._onScroll.bind(w))),setTimeout(function(){return w.syncScrollArea()},0),w}return i(o,d),o.prototype.onThemeChange=function(s){this._viewportElement.style.backgroundColor=s.background.css},o.prototype._refresh=function(s){var u=this;if(s)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=requestAnimationFrame(function(){return u._innerRefresh()}))},o.prototype._innerRefresh=function(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;var s=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.canvasHeight);this._lastRecordedBufferHeight!==s&&(this._lastRecordedBufferHeight=s,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}var u=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==u&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=u),this._refreshAnimationFrame=null},o.prototype.syncScrollArea=function(s){if(s===void 0&&(s=!1),this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(s);if(this._lastRecordedViewportHeight===this._renderService.dimensions.canvasHeight){var u=this._bufferService.buffer.ydisp*this._currentRowHeight;this._lastScrollTop===u&&this._lastScrollTop===this._viewportElement.scrollTop&&this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio===this._currentRowHeight||this._refresh(s)}else this._refresh(s)},o.prototype._onScroll=function(s){if(this._lastScrollTop=this._viewportElement.scrollTop,this._viewportElement.offsetParent)if(this._ignoreNextScrollEvent)this._ignoreNextScrollEvent=!1;else{var u=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._scrollLines(u,!0)}},o.prototype._bubbleScroll=function(s,u){var m=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(u<0&&this._viewportElement.scrollTop!==0||u>0&&m<this._lastRecordedBufferHeight)||(s.cancelable&&s.preventDefault(),!1)},o.prototype.onWheel=function(s){var u=this._getPixelsScrolled(s);return u!==0&&(this._viewportElement.scrollTop+=u,this._bubbleScroll(s,u))},o.prototype._getPixelsScrolled=function(s){if(s.deltaY===0)return 0;var u=this._applyScrollModifier(s.deltaY,s);return s.deltaMode===WheelEvent.DOM_DELTA_LINE?u*=this._currentRowHeight:s.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(u*=this._currentRowHeight*this._bufferService.rows),u},o.prototype.getLinesScrolled=function(s){if(s.deltaY===0)return 0;var u=this._applyScrollModifier(s.deltaY,s);return s.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(u/=this._currentRowHeight+0,this._wheelPartialScroll+=u,u=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):s.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(u*=this._bufferService.rows),u},o.prototype._applyScrollModifier=function(s,u){var m=this._optionsService.options.fastScrollModifier;return m==="alt"&&u.altKey||m==="ctrl"&&u.ctrlKey||m==="shift"&&u.shiftKey?s*this._optionsService.options.fastScrollSensitivity*this._optionsService.options.scrollSensitivity:s*this._optionsService.options.scrollSensitivity},o.prototype.onTouchStart=function(s){this._lastTouchY=s.touches[0].pageY},o.prototype.onTouchMove=function(s){var u=this._lastTouchY-s.touches[0].pageY;return this._lastTouchY=s.touches[0].pageY,u!==0&&(this._viewportElement.scrollTop+=u,this._bubbleScroll(s,u))},o=M([E(3,h.IBufferService),E(4,h.IOptionsService),E(5,l.ICharSizeService),E(6,l.IRenderService)],o)}(p.Disposable);Q.Viewport=v},function(Ue,Q,he){"use strict";function fe(p){return p.replace(/\r?\n/g,"\r")}function i(p,g){return g?"\x1B[200~"+p+"\x1B[201~":p}function M(p,g,l){p=i(p=fe(p),l.decPrivateModes.bracketedPasteMode),l.triggerDataEvent(p,!0),g.value=""}function E(p,g,l){var h=l.getBoundingClientRect(),v=p.clientX-h.left-10,d=p.clientY-h.top-10;g.style.width="20px",g.style.height="20px",g.style.left=v+"px",g.style.top=d+"px",g.style.zIndex="1000",g.focus()}Object.defineProperty(Q,"__esModule",{value:!0}),Q.rightClickHandler=Q.moveTextAreaUnderMouseCursor=Q.paste=Q.handlePasteEvent=Q.copyHandler=Q.bracketTextForPaste=Q.prepareTextForTerminal=void 0,Q.prepareTextForTerminal=fe,Q.bracketTextForPaste=i,Q.copyHandler=function(p,g){p.clipboardData&&p.clipboardData.setData("text/plain",g.selectionText),p.preventDefault()},Q.handlePasteEvent=function(p,g,l){p.stopPropagation(),p.clipboardData&&M(p.clipboardData.getData("text/plain"),g,l)},Q.paste=M,Q.moveTextAreaUnderMouseCursor=E,Q.rightClickHandler=function(p,g,l,h,v){E(p,g,l),v&&!h.isClickInSelection(p)&&h.selectWordAtCursor(p),g.value=h.selectionText,g.select()}},function(Ue,Q,he){"use strict";var fe,i=this&&this.__extends||(fe=function(d,o){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,u){s.__proto__=u}||function(s,u){for(var m in u)u.hasOwnProperty(m)&&(s[m]=u[m])})(d,o)},function(d,o){function s(){this.constructor=d}fe(d,o),d.prototype=o===null?Object.create(o):(s.prototype=o.prototype,new s)});Object.defineProperty(Q,"__esModule",{value:!0}),Q.EscapeSequenceParser=Q.VT500_TRANSITION_TABLE=Q.TransitionTable=void 0;var M=he(2),E=he(15),p=he(21),g=he(22),l=he(24),h=function(){function d(o){this.table=new Uint8Array(o)}return d.prototype.setDefault=function(o,s){E.fill(this.table,o<<4|s)},d.prototype.add=function(o,s,u,m){this.table[s<<8|o]=u<<4|m},d.prototype.addMany=function(o,s,u,m){for(var y=0;y<o.length;y++)this.table[s<<8|o[y]]=u<<4|m},d}();Q.TransitionTable=h,Q.VT500_TRANSITION_TABLE=function(){var d=new h(4095),o=Array.apply(null,Array(256)).map(function(x,S){return S}),s=function(x,S){return o.slice(x,S)},u=s(32,127),m=s(0,24);m.push(25),m.push.apply(m,s(28,32));var y,_=s(0,14);for(y in d.setDefault(1,0),d.addMany(u,0,2,0),_)d.addMany([24,26,153,154],y,3,0),d.addMany(s(128,144),y,3,0),d.addMany(s(144,152),y,3,0),d.add(156,y,0,0),d.add(27,y,11,1),d.add(157,y,4,8),d.addMany([152,158,159],y,0,7),d.add(155,y,11,3),d.add(144,y,11,9);return d.addMany(m,0,3,0),d.addMany(m,1,3,1),d.add(127,1,0,1),d.addMany(m,8,0,8),d.addMany(m,3,3,3),d.add(127,3,0,3),d.addMany(m,4,3,4),d.add(127,4,0,4),d.addMany(m,6,3,6),d.addMany(m,5,3,5),d.add(127,5,0,5),d.addMany(m,2,3,2),d.add(127,2,0,2),d.add(93,1,4,8),d.addMany(u,8,5,8),d.add(127,8,5,8),d.addMany([156,27,24,26,7],8,6,0),d.addMany(s(28,32),8,0,8),d.addMany([88,94,95],1,0,7),d.addMany(u,7,0,7),d.addMany(m,7,0,7),d.add(156,7,0,0),d.add(127,7,0,7),d.add(91,1,11,3),d.addMany(s(64,127),3,7,0),d.addMany(s(48,60),3,8,4),d.addMany([60,61,62,63],3,9,4),d.addMany(s(48,60),4,8,4),d.addMany(s(64,127),4,7,0),d.addMany([60,61,62,63],4,0,6),d.addMany(s(32,64),6,0,6),d.add(127,6,0,6),d.addMany(s(64,127),6,0,0),d.addMany(s(32,48),3,9,5),d.addMany(s(32,48),5,9,5),d.addMany(s(48,64),5,0,6),d.addMany(s(64,127),5,7,0),d.addMany(s(32,48),4,9,5),d.addMany(s(32,48),1,9,2),d.addMany(s(32,48),2,9,2),d.addMany(s(48,127),2,10,0),d.addMany(s(48,80),1,10,0),d.addMany(s(81,88),1,10,0),d.addMany([89,90,92],1,10,0),d.addMany(s(96,127),1,10,0),d.add(80,1,11,9),d.addMany(m,9,0,9),d.add(127,9,0,9),d.addMany(s(28,32),9,0,9),d.addMany(s(32,48),9,9,12),d.addMany(s(48,60),9,8,10),d.addMany([60,61,62,63],9,9,10),d.addMany(m,11,0,11),d.addMany(s(32,128),11,0,11),d.addMany(s(28,32),11,0,11),d.addMany(m,10,0,10),d.add(127,10,0,10),d.addMany(s(28,32),10,0,10),d.addMany(s(48,60),10,8,10),d.addMany([60,61,62,63],10,0,11),d.addMany(s(32,48),10,9,12),d.addMany(m,12,0,12),d.add(127,12,0,12),d.addMany(s(28,32),12,0,12),d.addMany(s(32,48),12,9,12),d.addMany(s(48,64),12,0,11),d.addMany(s(64,127),12,12,13),d.addMany(s(64,127),10,12,13),d.addMany(s(64,127),9,12,13),d.addMany(m,13,13,13),d.addMany(u,13,13,13),d.add(127,13,0,13),d.addMany([27,156,24,26],13,14,0),d.add(160,0,2,0),d.add(160,8,5,8),d.add(160,6,0,6),d.add(160,11,0,11),d.add(160,13,13,13),d}();var v=function(d){function o(s){s===void 0&&(s=Q.VT500_TRANSITION_TABLE);var u=d.call(this)||this;return u._transitions=s,u.initialState=0,u.currentState=u.initialState,u._params=new p.Params,u._params.addParam(0),u._collect=0,u.precedingCodepoint=0,u._printHandlerFb=function(m,y,_){},u._executeHandlerFb=function(m){},u._csiHandlerFb=function(m,y){},u._escHandlerFb=function(m){},u._errorHandlerFb=function(m){return m},u._printHandler=u._printHandlerFb,u._executeHandlers=Object.create(null),u._csiHandlers=Object.create(null),u._escHandlers=Object.create(null),u._oscParser=new g.OscParser,u._dcsParser=new l.DcsParser,u._errorHandler=u._errorHandlerFb,u.setEscHandler({final:"\\"},function(){}),u}return i(o,d),o.prototype._identifier=function(s,u){u===void 0&&(u=[64,126]);var m=0;if(s.prefix){if(s.prefix.length>1)throw new Error("only one byte as prefix supported");if((m=s.prefix.charCodeAt(0))&&60>m||m>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(s.intermediates){if(s.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(var y=0;y<s.intermediates.length;++y){var _=s.intermediates.charCodeAt(y);if(32>_||_>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");m<<=8,m|=_}}if(s.final.length!==1)throw new Error("final must be a single byte");var x=s.final.charCodeAt(0);if(u[0]>x||x>u[1])throw new Error("final must be in range "+u[0]+" .. "+u[1]);return m<<=8,m|=x},o.prototype.identToString=function(s){for(var u=[];s;)u.push(String.fromCharCode(255&s)),s>>=8;return u.reverse().join("")},o.prototype.dispose=function(){this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser.dispose(),this._dcsParser.dispose()},o.prototype.setPrintHandler=function(s){this._printHandler=s},o.prototype.clearPrintHandler=function(){this._printHandler=this._printHandlerFb},o.prototype.addEscHandler=function(s,u){var m=this._identifier(s,[48,126]);this._escHandlers[m]===void 0&&(this._escHandlers[m]=[]);var y=this._escHandlers[m];return y.push(u),{dispose:function(){var _=y.indexOf(u);_!==-1&&y.splice(_,1)}}},o.prototype.setEscHandler=function(s,u){this._escHandlers[this._identifier(s,[48,126])]=[u]},o.prototype.clearEscHandler=function(s){this._escHandlers[this._identifier(s,[48,126])]&&delete this._escHandlers[this._identifier(s,[48,126])]},o.prototype.setEscHandlerFallback=function(s){this._escHandlerFb=s},o.prototype.setExecuteHandler=function(s,u){this._executeHandlers[s.charCodeAt(0)]=u},o.prototype.clearExecuteHandler=function(s){this._executeHandlers[s.charCodeAt(0)]&&delete this._executeHandlers[s.charCodeAt(0)]},o.prototype.setExecuteHandlerFallback=function(s){this._executeHandlerFb=s},o.prototype.addCsiHandler=function(s,u){var m=this._identifier(s);this._csiHandlers[m]===void 0&&(this._csiHandlers[m]=[]);var y=this._csiHandlers[m];return y.push(u),{dispose:function(){var _=y.indexOf(u);_!==-1&&y.splice(_,1)}}},o.prototype.setCsiHandler=function(s,u){this._csiHandlers[this._identifier(s)]=[u]},o.prototype.clearCsiHandler=function(s){this._csiHandlers[this._identifier(s)]&&delete this._csiHandlers[this._identifier(s)]},o.prototype.setCsiHandlerFallback=function(s){this._csiHandlerFb=s},o.prototype.addDcsHandler=function(s,u){return this._dcsParser.addHandler(this._identifier(s),u)},o.prototype.setDcsHandler=function(s,u){this._dcsParser.setHandler(this._identifier(s),u)},o.prototype.clearDcsHandler=function(s){this._dcsParser.clearHandler(this._identifier(s))},o.prototype.setDcsHandlerFallback=function(s){this._dcsParser.setHandlerFallback(s)},o.prototype.addOscHandler=function(s,u){return this._oscParser.addHandler(s,u)},o.prototype.setOscHandler=function(s,u){this._oscParser.setHandler(s,u)},o.prototype.clearOscHandler=function(s){this._oscParser.clearHandler(s)},o.prototype.setOscHandlerFallback=function(s){this._oscParser.setHandlerFallback(s)},o.prototype.setErrorHandler=function(s){this._errorHandler=s},o.prototype.clearErrorHandler=function(){this._errorHandler=this._errorHandlerFb},o.prototype.reset=function(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0},o.prototype.parse=function(s,u){for(var m=0,y=0,_=this.currentState,x=this._oscParser,S=this._dcsParser,w=this._collect,A=this._params,H=this._transitions.table,R=0;R<u;++R){switch((y=H[_<<8|((m=s[R])<160?m:160)])>>4){case 2:for(var F=R+1;;++F){if(F>=u||(m=s[F])<32||m>126&&m<160){this._printHandler(s,R,F),R=F-1;break}if(++F>=u||(m=s[F])<32||m>126&&m<160){this._printHandler(s,R,F),R=F-1;break}if(++F>=u||(m=s[F])<32||m>126&&m<160){this._printHandler(s,R,F),R=F-1;break}if(++F>=u||(m=s[F])<32||m>126&&m<160){this._printHandler(s,R,F),R=F-1;break}}break;case 3:this._executeHandlers[m]?this._executeHandlers[m]():this._executeHandlerFb(m),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:R,code:m,currentState:_,collect:w,params:A,abort:!1}).abort)return;break;case 7:for(var D=this._csiHandlers[w<<8|m],B=D?D.length-1:-1;B>=0&&D[B](A)===!1;B--);B<0&&this._csiHandlerFb(w<<8|m,A),this.precedingCodepoint=0;break;case 8:do switch(m){case 59:A.addParam(0);break;case 58:A.addSubParam(-1);break;default:A.addDigit(m-48)}while(++R<u&&(m=s[R])>47&&m<60);R--;break;case 9:w<<=8,w|=m;break;case 10:for(var P=this._escHandlers[w<<8|m],U=P?P.length-1:-1;U>=0&&P[U]()===!1;U--);U<0&&this._escHandlerFb(w<<8|m),this.precedingCodepoint=0;break;case 11:A.reset(),A.addParam(0),w=0;break;case 12:S.hook(w<<8|m,A);break;case 13:for(var G=R+1;;++G)if(G>=u||(m=s[G])===24||m===26||m===27||m>127&&m<160){S.put(s,R,G),R=G-1;break}break;case 14:S.unhook(m!==24&&m!==26),m===27&&(y|=1),A.reset(),A.addParam(0),w=0,this.precedingCodepoint=0;break;case 4:x.start();break;case 5:for(var ee=R+1;;ee++)if(ee>=u||(m=s[ee])<32||m>127&&m<=159){x.put(s,R,ee),R=ee-1;break}break;case 6:x.end(m!==24&&m!==26),m===27&&(y|=1),A.reset(),A.addParam(0),w=0,this.precedingCodepoint=0}_=15&y}this._collect=w,this.currentState=_},o}(M.Disposable);Q.EscapeSequenceParser=v},function(Ue,Q,he){"use strict";var fe,i=this&&this.__extends||(fe=function(x,S){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,A){w.__proto__=A}||function(w,A){for(var H in A)A.hasOwnProperty(H)&&(w[H]=A[H])})(x,S)},function(x,S){function w(){this.constructor=x}fe(x,S),x.prototype=S===null?Object.create(S):(w.prototype=S.prototype,new w)}),M=this&&this.__decorate||function(x,S,w,A){var H,R=arguments.length,F=R<3?S:A===null?A=Object.getOwnPropertyDescriptor(S,w):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(x,S,w,A);else for(var D=x.length-1;D>=0;D--)(H=x[D])&&(F=(R<3?H(F):R>3?H(S,w,F):H(S,w))||F);return R>3&&F&&Object.defineProperty(S,w,F),F},E=this&&this.__param||function(x,S){return function(w,A){S(w,A,x)}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.Renderer=void 0;var p=he(41),g=he(47),l=he(48),h=he(49),v=he(29),d=he(2),o=he(5),s=he(1),u=he(25),m=he(0),y=1,_=function(x){function S(w,A,H,R,F,D,B,P,U){var G=x.call(this)||this;G._colors=w,G._screenElement=A,G._bufferService=F,G._charSizeService=D,G._optionsService=B,G._id=y++,G._onRequestRedraw=new m.EventEmitter;var ee=G._optionsService.options.allowTransparency;return G._characterJoinerRegistry=new v.CharacterJoinerRegistry(G._bufferService),G._renderLayers=[new p.TextRenderLayer(G._screenElement,0,G._colors,G._characterJoinerRegistry,ee,G._id,G._bufferService,B),new g.SelectionRenderLayer(G._screenElement,1,G._colors,G._id,G._bufferService,B),new h.LinkRenderLayer(G._screenElement,2,G._colors,G._id,H,R,G._bufferService,B),new l.CursorRenderLayer(G._screenElement,3,G._colors,G._id,G._onRequestRedraw,G._bufferService,B,P,U)],G.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},G._devicePixelRatio=window.devicePixelRatio,G._updateDimensions(),G.onOptionsChanged(),G}return i(S,x),Object.defineProperty(S.prototype,"onRequestRedraw",{get:function(){return this._onRequestRedraw.event},enumerable:!1,configurable:!0}),S.prototype.dispose=function(){for(var w=0,A=this._renderLayers;w<A.length;w++)A[w].dispose();x.prototype.dispose.call(this),u.removeTerminalFromCache(this._id)},S.prototype.onDevicePixelRatioChange=function(){this._devicePixelRatio!==window.devicePixelRatio&&(this._devicePixelRatio=window.devicePixelRatio,this.onResize(this._bufferService.cols,this._bufferService.rows))},S.prototype.setColors=function(w){this._colors=w;for(var A=0,H=this._renderLayers;A<H.length;A++){var R=H[A];R.setColors(this._colors),R.reset()}},S.prototype.onResize=function(w,A){this._updateDimensions();for(var H=0,R=this._renderLayers;H<R.length;H++)R[H].resize(this.dimensions);this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},S.prototype.onCharSizeChanged=function(){this.onResize(this._bufferService.cols,this._bufferService.rows)},S.prototype.onBlur=function(){this._runOperation(function(w){return w.onBlur()})},S.prototype.onFocus=function(){this._runOperation(function(w){return w.onFocus()})},S.prototype.onSelectionChanged=function(w,A,H){H===void 0&&(H=!1),this._runOperation(function(R){return R.onSelectionChanged(w,A,H)})},S.prototype.onCursorMove=function(){this._runOperation(function(w){return w.onCursorMove()})},S.prototype.onOptionsChanged=function(){this._runOperation(function(w){return w.onOptionsChanged()})},S.prototype.clear=function(){this._runOperation(function(w){return w.reset()})},S.prototype._runOperation=function(w){for(var A=0,H=this._renderLayers;A<H.length;A++)w(H[A])},S.prototype.renderRows=function(w,A){for(var H=0,R=this._renderLayers;H<R.length;H++)R[H].onGridChanged(w,A)},S.prototype._updateDimensions=function(){this._charSizeService.hasValidSize&&(this.dimensions.scaledCharWidth=Math.floor(this._charSizeService.width*window.devicePixelRatio),this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*window.devicePixelRatio),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.options.lineHeight),this.dimensions.scaledCharTop=this._optionsService.options.lineHeight===1?0:Math.round((this.dimensions.scaledCellHeight-this.dimensions.scaledCharHeight)/2),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.options.letterSpacing),this.dimensions.scaledCharLeft=Math.floor(this._optionsService.options.letterSpacing/2),this.dimensions.scaledCanvasHeight=this._bufferService.rows*this.dimensions.scaledCellHeight,this.dimensions.scaledCanvasWidth=this._bufferService.cols*this.dimensions.scaledCellWidth,this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows,this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols)},S.prototype.registerCharacterJoiner=function(w){return this._characterJoinerRegistry.registerCharacterJoiner(w)},S.prototype.deregisterCharacterJoiner=function(w){return this._characterJoinerRegistry.deregisterCharacterJoiner(w)},S=M([E(4,s.IBufferService),E(5,o.ICharSizeService),E(6,s.IOptionsService),E(7,s.ICoreService),E(8,o.ICoreBrowserService)],S)}(d.Disposable);Q.Renderer=_},function(Ue,Q,he){"use strict";var fe,i=this&&this.__extends||(fe=function(d,o){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,u){s.__proto__=u}||function(s,u){for(var m in u)u.hasOwnProperty(m)&&(s[m]=u[m])})(d,o)},function(d,o){function s(){this.constructor=d}fe(d,o),d.prototype=o===null?Object.create(o):(s.prototype=o.prototype,new s)});Object.defineProperty(Q,"__esModule",{value:!0}),Q.TextRenderLayer=void 0;var M=he(42),E=he(13),p=he(6),g=he(3),l=he(29),h=he(4),v=function(d){function o(s,u,m,y,_,x,S,w){var A=d.call(this,s,"text",u,_,m,x,S,w)||this;return A._characterWidth=0,A._characterFont="",A._characterOverlapCache={},A._workCell=new h.CellData,A._state=new M.GridCache,A._characterJoinerRegistry=y,A}return i(o,d),o.prototype.resize=function(s){d.prototype.resize.call(this,s);var u=this._getFont(!1,!1);this._characterWidth===s.scaledCharWidth&&this._characterFont===u||(this._characterWidth=s.scaledCharWidth,this._characterFont=u,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)},o.prototype.reset=function(){this._state.clear(),this._clearAll()},o.prototype._forEachCell=function(s,u,m,y){for(var _=s;_<=u;_++)for(var x=_+this._bufferService.buffer.ydisp,S=this._bufferService.buffer.lines.get(x),w=m?m.getJoinedCharacters(x):[],A=0;A<this._bufferService.cols;A++){S.loadCell(A,this._workCell);var H=this._workCell,R=!1,F=A;if(H.getWidth()!==0){if(w.length>0&&A===w[0][0]){R=!0;var D=w.shift();H=new l.JoinedCellData(this._workCell,S.translateToString(!0,D[0],D[1]),D[1]-D[0]),F=D[1]-1}!R&&this._isOverlapping(H)&&F<S.length-1&&S.getCodePoint(F+1)===g.NULL_CELL_CODE&&(H.content&=-12582913,H.content|=2<<22),y(H,A,_),A=F}}},o.prototype._drawBackground=function(s,u){var m=this,y=this._ctx,_=this._bufferService.cols,x=0,S=0,w=null;y.save(),this._forEachCell(s,u,null,function(A,H,R){var F=null;A.isInverse()?F=A.isFgDefault()?m._colors.foreground.css:A.isFgRGB()?"rgb("+p.AttributeData.toColorRGB(A.getFgColor()).join(",")+")":m._colors.ansi[A.getFgColor()].css:A.isBgRGB()?F="rgb("+p.AttributeData.toColorRGB(A.getBgColor()).join(",")+")":A.isBgPalette()&&(F=m._colors.ansi[A.getBgColor()].css),w===null&&(x=H,S=R),R!==S?(y.fillStyle=w||"",m._fillCells(x,S,_-x,1),x=H,S=R):w!==F&&(y.fillStyle=w||"",m._fillCells(x,S,H-x,1),x=H,S=R),w=F}),w!==null&&(y.fillStyle=w,this._fillCells(x,S,_-x,1)),y.restore()},o.prototype._drawForeground=function(s,u){var m=this;this._forEachCell(s,u,this._characterJoinerRegistry,function(y,_,x){if(!y.isInvisible()&&(m._drawChars(y,_,x),y.isUnderline())){if(m._ctx.save(),y.isInverse())if(y.isBgDefault())m._ctx.fillStyle=m._colors.background.css;else if(y.isBgRGB())m._ctx.fillStyle="rgb("+p.AttributeData.toColorRGB(y.getBgColor()).join(",")+")";else{var S=y.getBgColor();m._optionsService.options.drawBoldTextInBrightColors&&y.isBold()&&S<8&&(S+=8),m._ctx.fillStyle=m._colors.ansi[S].css}else if(y.isFgDefault())m._ctx.fillStyle=m._colors.foreground.css;else if(y.isFgRGB())m._ctx.fillStyle="rgb("+p.AttributeData.toColorRGB(y.getFgColor()).join(",")+")";else{var w=y.getFgColor();m._optionsService.options.drawBoldTextInBrightColors&&y.isBold()&&w<8&&(w+=8),m._ctx.fillStyle=m._colors.ansi[w].css}m._fillBottomLineAtCells(_,x,y.getWidth()),m._ctx.restore()}})},o.prototype.onGridChanged=function(s,u){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,s,this._bufferService.cols,u-s+1),this._drawBackground(s,u),this._drawForeground(s,u))},o.prototype.onOptionsChanged=function(){this._setTransparency(this._optionsService.options.allowTransparency)},o.prototype._isOverlapping=function(s){if(s.getWidth()!==1||s.getCode()<256)return!1;var u=s.getChars();if(this._characterOverlapCache.hasOwnProperty(u))return this._characterOverlapCache[u];this._ctx.save(),this._ctx.font=this._characterFont;var m=Math.floor(this._ctx.measureText(u).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[u]=m,m},o}(E.BaseRenderLayer);Q.TextRenderLayer=v},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.GridCache=void 0;var fe=function(){function i(){this.cache=[]}return i.prototype.resize=function(M,E){for(var p=0;p<M;p++){this.cache.length<=p&&this.cache.push([]);for(var g=this.cache[p].length;g<E;g++)this.cache[p].push(void 0);this.cache[p].length=E}this.cache.length=M},i.prototype.clear=function(){for(var M=0;M<this.cache.length;M++)for(var E=0;E<this.cache[M].length;E++)this.cache[M][E]=void 0},i}();Q.GridCache=fe},function(Ue,Q,he){"use strict";var fe,i=this&&this.__extends||(fe=function(m,y){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,x){_.__proto__=x}||function(_,x){for(var S in x)x.hasOwnProperty(S)&&(_[S]=x[S])})(m,y)},function(m,y){function _(){this.constructor=m}fe(m,y),m.prototype=y===null?Object.create(y):(_.prototype=y.prototype,new _)});Object.defineProperty(Q,"__esModule",{value:!0}),Q.NoneCharAtlas=Q.DynamicCharAtlas=Q.getGlyphCacheKey=void 0;var M=he(9),E=he(44),p=he(27),g=he(46),l=he(11),h=he(28),v=he(10),d={css:"rgba(0, 0, 0, 0)",rgba:0};function o(m){return m.code<<21|m.bg<<12|m.fg<<3|(m.bold?0:4)+(m.dim?0:2)+(m.italic?0:1)}Q.getGlyphCacheKey=o;var s=function(m){function y(_,x){var S=m.call(this)||this;S._config=x,S._drawToCacheCount=0,S._glyphsWaitingOnBitmap=[],S._bitmapCommitTimeout=null,S._bitmap=null,S._cacheCanvas=_.createElement("canvas"),S._cacheCanvas.width=1024,S._cacheCanvas.height=1024,S._cacheCtx=h.throwIfFalsy(S._cacheCanvas.getContext("2d",{alpha:!0}));var w=_.createElement("canvas");w.width=S._config.scaledCharWidth,w.height=S._config.scaledCharHeight,S._tmpCtx=h.throwIfFalsy(w.getContext("2d",{alpha:S._config.allowTransparency})),S._width=Math.floor(1024/S._config.scaledCharWidth),S._height=Math.floor(1024/S._config.scaledCharHeight);var A=S._width*S._height;return S._cacheMap=new g.LRUMap(A),S._cacheMap.prealloc(A),S}return i(y,m),y.prototype.dispose=function(){this._bitmapCommitTimeout!==null&&(window.clearTimeout(this._bitmapCommitTimeout),this._bitmapCommitTimeout=null)},y.prototype.beginFrame=function(){this._drawToCacheCount=0},y.prototype.draw=function(_,x,S,w){if(x.code===32)return!0;if(!this._canCache(x))return!1;var A=o(x),H=this._cacheMap.get(A);if(H!=null)return this._drawFromCache(_,H,S,w),!0;if(this._drawToCacheCount<100){var R=void 0;R=this._cacheMap.size<this._cacheMap.capacity?this._cacheMap.size:this._cacheMap.peek().index;var F=this._drawToCache(x,R);return this._cacheMap.set(A,F),this._drawFromCache(_,F,S,w),!0}return!1},y.prototype._canCache=function(_){return _.code<256},y.prototype._toCoordinateX=function(_){return _%this._width*this._config.scaledCharWidth},y.prototype._toCoordinateY=function(_){return Math.floor(_/this._width)*this._config.scaledCharHeight},y.prototype._drawFromCache=function(_,x,S,w){if(!x.isEmpty){var A=this._toCoordinateX(x.index),H=this._toCoordinateY(x.index);_.drawImage(x.inBitmap?this._bitmap:this._cacheCanvas,A,H,this._config.scaledCharWidth,this._config.scaledCharHeight,S,w,this._config.scaledCharWidth,this._config.scaledCharHeight)}},y.prototype._getColorFromAnsiIndex=function(_){return _<this._config.colors.ansi.length?this._config.colors.ansi[_]:p.DEFAULT_ANSI_COLORS[_]},y.prototype._getBackgroundColor=function(_){return this._config.allowTransparency?d:_.bg===M.INVERTED_DEFAULT_COLOR?this._config.colors.foreground:_.bg<256?this._getColorFromAnsiIndex(_.bg):this._config.colors.background},y.prototype._getForegroundColor=function(_){return _.fg===M.INVERTED_DEFAULT_COLOR?v.color.opaque(this._config.colors.background):_.fg<256?this._getColorFromAnsiIndex(_.fg):this._config.colors.foreground},y.prototype._drawToCache=function(_,x){this._drawToCacheCount++,this._tmpCtx.save();var S=this._getBackgroundColor(_);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=S.css,this._tmpCtx.fillRect(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),this._tmpCtx.globalCompositeOperation="source-over";var w=_.bold?this._config.fontWeightBold:this._config.fontWeight,A=_.italic?"italic":"";this._tmpCtx.font=A+" "+w+" "+this._config.fontSize*this._config.devicePixelRatio+"px "+this._config.fontFamily,this._tmpCtx.textBaseline="middle",this._tmpCtx.fillStyle=this._getForegroundColor(_).css,_.dim&&(this._tmpCtx.globalAlpha=M.DIM_OPACITY),this._tmpCtx.fillText(_.chars,0,this._config.scaledCharHeight/2),this._tmpCtx.restore();var H=this._tmpCtx.getImageData(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),R=!1;this._config.allowTransparency||(R=function(P,U){for(var G=!0,ee=U.rgba>>>24,K=U.rgba>>>16&255,Z=U.rgba>>>8&255,$=0;$<P.data.length;$+=4)P.data[$]===ee&&P.data[$+1]===K&&P.data[$+2]===Z?P.data[$+3]=0:G=!1;return G}(H,S));var F=this._toCoordinateX(x),D=this._toCoordinateY(x);this._cacheCtx.putImageData(H,F,D);var B={index:x,isEmpty:R,inBitmap:!1};return this._addGlyphToBitmap(B),B},y.prototype._addGlyphToBitmap=function(_){var x=this;!("createImageBitmap"in window)||l.isFirefox||l.isSafari||(this._glyphsWaitingOnBitmap.push(_),this._bitmapCommitTimeout===null&&(this._bitmapCommitTimeout=window.setTimeout(function(){return x._generateBitmap()},100)))},y.prototype._generateBitmap=function(){var _=this,x=this._glyphsWaitingOnBitmap;this._glyphsWaitingOnBitmap=[],window.createImageBitmap(this._cacheCanvas).then(function(S){_._bitmap=S;for(var w=0;w<x.length;w++)x[w].inBitmap=!0}),this._bitmapCommitTimeout=null},y}(E.BaseCharAtlas);Q.DynamicCharAtlas=s;var u=function(m){function y(_,x){return m.call(this)||this}return i(y,m),y.prototype.draw=function(_,x,S,w){return!1},y}(E.BaseCharAtlas);Q.NoneCharAtlas=u},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.BaseCharAtlas=void 0;var fe=function(){function i(){this._didWarmUp=!1}return i.prototype.dispose=function(){},i.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},i.prototype._doWarmUp=function(){},i.prototype.beginFrame=function(){},i}();Q.BaseCharAtlas=fe},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.ColorContrastCache=void 0;var fe=function(){function i(){this._color={},this._rgba={}}return i.prototype.clear=function(){this._color={},this._rgba={}},i.prototype.setCss=function(M,E,p){this._rgba[M]||(this._rgba[M]={}),this._rgba[M][E]=p},i.prototype.getCss=function(M,E){return this._rgba[M]?this._rgba[M][E]:void 0},i.prototype.setColor=function(M,E,p){this._color[M]||(this._color[M]={}),this._color[M][E]=p},i.prototype.getColor=function(M,E){return this._color[M]?this._color[M][E]:void 0},i}();Q.ColorContrastCache=fe},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.LRUMap=void 0;var fe=function(){function i(M){this.capacity=M,this._map={},this._head=null,this._tail=null,this._nodePool=[],this.size=0}return i.prototype._unlinkNode=function(M){var E=M.prev,p=M.next;M===this._head&&(this._head=p),M===this._tail&&(this._tail=E),E!==null&&(E.next=p),p!==null&&(p.prev=E)},i.prototype._appendNode=function(M){var E=this._tail;E!==null&&(E.next=M),M.prev=E,M.next=null,this._tail=M,this._head===null&&(this._head=M)},i.prototype.prealloc=function(M){for(var E=this._nodePool,p=0;p<M;p++)E.push({prev:null,next:null,key:null,value:null})},i.prototype.get=function(M){var E=this._map[M];return E!==void 0?(this._unlinkNode(E),this._appendNode(E),E.value):null},i.prototype.peekValue=function(M){var E=this._map[M];return E!==void 0?E.value:null},i.prototype.peek=function(){var M=this._head;return M===null?null:M.value},i.prototype.set=function(M,E){var p=this._map[M];if(p!==void 0)p=this._map[M],this._unlinkNode(p),p.value=E;else if(this.size>=this.capacity)p=this._head,this._unlinkNode(p),delete this._map[p.key],p.key=M,p.value=E,this._map[M]=p;else{var g=this._nodePool;g.length>0?((p=g.pop()).key=M,p.value=E):p={prev:null,next:null,key:M,value:E},this._map[M]=p,this.size++}this._appendNode(p)},i}();Q.LRUMap=fe},function(Ue,Q,he){"use strict";var fe,i=this&&this.__extends||(fe=function(E,p){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,l){g.__proto__=l}||function(g,l){for(var h in l)l.hasOwnProperty(h)&&(g[h]=l[h])})(E,p)},function(E,p){function g(){this.constructor=E}fe(E,p),E.prototype=p===null?Object.create(p):(g.prototype=p.prototype,new g)});Object.defineProperty(Q,"__esModule",{value:!0}),Q.SelectionRenderLayer=void 0;var M=function(E){function p(g,l,h,v,d,o){var s=E.call(this,g,"selection",l,!0,h,v,d,o)||this;return s._clearState(),s}return i(p,E),p.prototype._clearState=function(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}},p.prototype.resize=function(g){E.prototype.resize.call(this,g),this._clearState()},p.prototype.reset=function(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())},p.prototype.onSelectionChanged=function(g,l,h){if(this._didStateChange(g,l,h,this._bufferService.buffer.ydisp))if(this._clearAll(),g&&l){var v=g[1]-this._bufferService.buffer.ydisp,d=l[1]-this._bufferService.buffer.ydisp,o=Math.max(v,0),s=Math.min(d,this._bufferService.rows-1);if(!(o>=this._bufferService.rows||s<0)){if(this._ctx.fillStyle=this._colors.selectionTransparent.css,h){var u=g[0],m=l[0]-u,y=s-o+1;this._fillCells(u,o,m,y)}else{u=v===o?g[0]:0;var _=o===s?l[0]:this._bufferService.cols;this._fillCells(u,o,_-u,1);var x=Math.max(s-o-1,0);if(this._fillCells(0,o+1,this._bufferService.cols,x),o!==s){var S=d===s?l[0]:this._bufferService.cols;this._fillCells(0,s,S,1)}}this._state.start=[g[0],g[1]],this._state.end=[l[0],l[1]],this._state.columnSelectMode=h,this._state.ydisp=this._bufferService.buffer.ydisp}}else this._clearState()},p.prototype._didStateChange=function(g,l,h,v){return!this._areCoordinatesEqual(g,this._state.start)||!this._areCoordinatesEqual(l,this._state.end)||h!==this._state.columnSelectMode||v!==this._state.ydisp},p.prototype._areCoordinatesEqual=function(g,l){return!(!g||!l)&&g[0]===l[0]&&g[1]===l[1]},p}(he(13).BaseRenderLayer);Q.SelectionRenderLayer=M},function(Ue,Q,he){"use strict";var fe,i=this&&this.__extends||(fe=function(l,h){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,d){v.__proto__=d}||function(v,d){for(var o in d)d.hasOwnProperty(o)&&(v[o]=d[o])})(l,h)},function(l,h){function v(){this.constructor=l}fe(l,h),l.prototype=h===null?Object.create(h):(v.prototype=h.prototype,new v)});Object.defineProperty(Q,"__esModule",{value:!0}),Q.CursorRenderLayer=void 0;var M=he(13),E=he(4),p=function(l){function h(v,d,o,s,u,m,y,_,x){var S=l.call(this,v,"cursor",d,!0,o,s,m,y)||this;return S._onRequestRedraw=u,S._coreService=_,S._coreBrowserService=x,S._cell=new E.CellData,S._state={x:0,y:0,isFocused:!1,style:"",width:0},S._cursorRenderers={bar:S._renderBarCursor.bind(S),block:S._renderBlockCursor.bind(S),underline:S._renderUnderlineCursor.bind(S)},S}return i(h,l),h.prototype.resize=function(v){l.prototype.resize.call(this,v),this._state={x:0,y:0,isFocused:!1,style:"",width:0}},h.prototype.reset=function(){this._clearCursor(),this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=void 0,this.onOptionsChanged())},h.prototype.onBlur=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},h.prototype.onFocus=function(){this._cursorBlinkStateManager?this._cursorBlinkStateManager.resume():this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},h.prototype.onOptionsChanged=function(){var v,d=this;this._optionsService.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new g(this._coreBrowserService.isFocused,function(){d._render(!0)})):((v=this._cursorBlinkStateManager)===null||v===void 0||v.dispose(),this._cursorBlinkStateManager=void 0),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},h.prototype.onCursorMove=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.restartBlinkAnimation()},h.prototype.onGridChanged=function(v,d){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(!1):this._cursorBlinkStateManager.restartBlinkAnimation()},h.prototype._render=function(v){if(this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden){var d=this._bufferService.buffer.ybase+this._bufferService.buffer.y,o=d-this._bufferService.buffer.ydisp;if(o<0||o>=this._bufferService.rows)this._clearCursor();else{var s=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(d).loadCell(s,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css;var u=this._optionsService.options.cursorStyle;return u&&u!=="block"?this._cursorRenderers[u](s,o,this._cell):this._renderBlurCursor(s,o,this._cell),this._ctx.restore(),this._state.x=s,this._state.y=o,this._state.isFocused=!1,this._state.style=u,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===s&&this._state.y===o&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.options.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.options.cursorStyle||"block"](s,o,this._cell),this._ctx.restore(),this._state.x=s,this._state.y=o,this._state.isFocused=!1,this._state.style=this._optionsService.options.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}}else this._clearCursor()},h.prototype._clearCursor=function(){this._state&&(this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})},h.prototype._renderBarCursor=function(v,d,o){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillLeftLineAtCell(v,d,this._optionsService.options.cursorWidth),this._ctx.restore()},h.prototype._renderBlockCursor=function(v,d,o){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillCells(v,d,o.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this._fillCharTrueColor(o,v,d),this._ctx.restore()},h.prototype._renderUnderlineCursor=function(v,d,o){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillBottomLineAtCells(v,d),this._ctx.restore()},h.prototype._renderBlurCursor=function(v,d,o){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this._strokeRectAtCell(v,d,o.getWidth(),1),this._ctx.restore()},h}(M.BaseRenderLayer);Q.CursorRenderLayer=p;var g=function(){function l(h,v){this._renderCallback=v,this.isCursorVisible=!0,h&&this._restartInterval()}return Object.defineProperty(l.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!1,configurable:!0}),l.prototype.dispose=function(){this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},l.prototype.restartBlinkAnimation=function(){var h=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){h._renderCallback(),h._animationFrame=void 0})))},l.prototype._restartInterval=function(h){var v=this;h===void 0&&(h=600),this._blinkInterval&&window.clearInterval(this._blinkInterval),this._blinkStartTimeout=window.setTimeout(function(){if(v._animationTimeRestarted){var d=600-(Date.now()-v._animationTimeRestarted);if(v._animationTimeRestarted=void 0,d>0)return void v._restartInterval(d)}v.isCursorVisible=!1,v._animationFrame=window.requestAnimationFrame(function(){v._renderCallback(),v._animationFrame=void 0}),v._blinkInterval=window.setInterval(function(){if(v._animationTimeRestarted){var o=600-(Date.now()-v._animationTimeRestarted);return v._animationTimeRestarted=void 0,void v._restartInterval(o)}v.isCursorVisible=!v.isCursorVisible,v._animationFrame=window.requestAnimationFrame(function(){v._renderCallback(),v._animationFrame=void 0})},600)},h)},l.prototype.pause=function(){this.isCursorVisible=!0,this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},l.prototype.resume=function(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()},l}()},function(Ue,Q,he){"use strict";var fe,i=this&&this.__extends||(fe=function(l,h){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,d){v.__proto__=d}||function(v,d){for(var o in d)d.hasOwnProperty(o)&&(v[o]=d[o])})(l,h)},function(l,h){function v(){this.constructor=l}fe(l,h),l.prototype=h===null?Object.create(h):(v.prototype=h.prototype,new v)});Object.defineProperty(Q,"__esModule",{value:!0}),Q.LinkRenderLayer=void 0;var M=he(13),E=he(9),p=he(26),g=function(l){function h(v,d,o,s,u,m,y,_){var x=l.call(this,v,"link",d,!0,o,s,y,_)||this;return u.onShowLinkUnderline(function(S){return x._onShowLinkUnderline(S)}),u.onHideLinkUnderline(function(S){return x._onHideLinkUnderline(S)}),m.onShowLinkUnderline(function(S){return x._onShowLinkUnderline(S)}),m.onHideLinkUnderline(function(S){return x._onHideLinkUnderline(S)}),x}return i(h,l),h.prototype.resize=function(v){l.prototype.resize.call(this,v),this._state=void 0},h.prototype.reset=function(){this._clearCurrentLink()},h.prototype._clearCurrentLink=function(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);var v=this._state.y2-this._state.y1-1;v>0&&this._clearCells(0,this._state.y1+1,this._state.cols,v),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}},h.prototype._onShowLinkUnderline=function(v){if(v.fg===E.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:v.fg&&p.is256Color(v.fg)?this._ctx.fillStyle=this._colors.ansi[v.fg].css:this._ctx.fillStyle=this._colors.foreground.css,v.y1===v.y2)this._fillBottomLineAtCells(v.x1,v.y1,v.x2-v.x1);else{this._fillBottomLineAtCells(v.x1,v.y1,v.cols-v.x1);for(var d=v.y1+1;d<v.y2;d++)this._fillBottomLineAtCells(0,d,v.cols);this._fillBottomLineAtCells(0,v.y2,v.x2)}this._state=v},h.prototype._onHideLinkUnderline=function(v){this._clearCurrentLink()},h}(M.BaseRenderLayer);Q.LinkRenderLayer=g},function(Ue,Q,he){"use strict";var fe=this&&this.__decorate||function(l,h,v,d){var o,s=arguments.length,u=s<3?h:d===null?d=Object.getOwnPropertyDescriptor(h,v):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(l,h,v,d);else for(var m=l.length-1;m>=0;m--)(o=l[m])&&(u=(s<3?o(u):s>3?o(h,v,u):o(h,v))||u);return s>3&&u&&Object.defineProperty(h,v,u),u},i=this&&this.__param||function(l,h){return function(v,d){h(v,d,l)}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.MouseZone=Q.Linkifier=void 0;var M=he(0),E=he(1),p=function(){function l(h,v,d){this._bufferService=h,this._logService=v,this._unicodeService=d,this._linkMatchers=[],this._nextLinkMatcherId=0,this._onShowLinkUnderline=new M.EventEmitter,this._onHideLinkUnderline=new M.EventEmitter,this._onLinkTooltip=new M.EventEmitter,this._rowsToLinkify={start:void 0,end:void 0}}return Object.defineProperty(l.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"onLinkTooltip",{get:function(){return this._onLinkTooltip.event},enumerable:!1,configurable:!0}),l.prototype.attachToDom=function(h,v){this._element=h,this._mouseZoneManager=v},l.prototype.linkifyRows=function(h,v){var d=this;this._mouseZoneManager&&(this._rowsToLinkify.start===void 0||this._rowsToLinkify.end===void 0?(this._rowsToLinkify.start=h,this._rowsToLinkify.end=v):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,h),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,v)),this._mouseZoneManager.clearAll(h,v),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout(function(){return d._linkifyRows()},l._timeBeforeLatency))},l.prototype._linkifyRows=function(){this._rowsTimeoutId=void 0;var h=this._bufferService.buffer;if(this._rowsToLinkify.start!==void 0&&this._rowsToLinkify.end!==void 0){var v=h.ydisp+this._rowsToLinkify.start;if(!(v>=h.lines.length)){for(var d=h.ydisp+Math.min(this._rowsToLinkify.end,this._bufferService.rows)+1,o=Math.ceil(2e3/this._bufferService.cols),s=this._bufferService.buffer.iterator(!1,v,d,o,o);s.hasNext();)for(var u=s.next(),m=0;m<this._linkMatchers.length;m++)this._doLinkifyRow(u.range.first,u.content,this._linkMatchers[m]);this._rowsToLinkify.start=void 0,this._rowsToLinkify.end=void 0}}else this._logService.debug("_rowToLinkify was unset before _linkifyRows was called")},l.prototype.registerLinkMatcher=function(h,v,d){if(d===void 0&&(d={}),!v)throw new Error("handler must be defined");var o={id:this._nextLinkMatcherId++,regex:h,handler:v,matchIndex:d.matchIndex,validationCallback:d.validationCallback,hoverTooltipCallback:d.tooltipCallback,hoverLeaveCallback:d.leaveCallback,willLinkActivate:d.willLinkActivate,priority:d.priority||0};return this._addLinkMatcherToList(o),o.id},l.prototype._addLinkMatcherToList=function(h){if(this._linkMatchers.length!==0){for(var v=this._linkMatchers.length-1;v>=0;v--)if(h.priority<=this._linkMatchers[v].priority)return void this._linkMatchers.splice(v+1,0,h);this._linkMatchers.splice(0,0,h)}else this._linkMatchers.push(h)},l.prototype.deregisterLinkMatcher=function(h){for(var v=0;v<this._linkMatchers.length;v++)if(this._linkMatchers[v].id===h)return this._linkMatchers.splice(v,1),!0;return!1},l.prototype._doLinkifyRow=function(h,v,d){for(var o,s=this,u=new RegExp(d.regex.source,(d.regex.flags||"")+"g"),m=-1,y=function(){var x=o[typeof d.matchIndex!="number"?0:d.matchIndex];if(!x)return _._logService.debug("match found without corresponding matchIndex",o,d),"break";if(m=v.indexOf(x,m+1),u.lastIndex=m+x.length,m<0)return"break";var S=_._bufferService.buffer.stringIndexToBufferIndex(h,m);if(S[0]<0)return"break";var w=_._bufferService.buffer.lines.get(S[0]);if(!w)return"break";var A=w.getFg(S[1]),H=A?A>>9&511:void 0;d.validationCallback?d.validationCallback(x,function(R){s._rowsTimeoutId||R&&s._addLink(S[1],S[0]-s._bufferService.buffer.ydisp,x,d,H)}):_._addLink(S[1],S[0]-_._bufferService.buffer.ydisp,x,d,H)},_=this;(o=u.exec(v))!==null&&y()!=="break";);},l.prototype._addLink=function(h,v,d,o,s){var u=this;if(this._mouseZoneManager&&this._element){var m=this._unicodeService.getStringCellWidth(d),y=h%this._bufferService.cols,_=v+Math.floor(h/this._bufferService.cols),x=(y+m)%this._bufferService.cols,S=_+Math.floor((y+m)/this._bufferService.cols);x===0&&(x=this._bufferService.cols,S--),this._mouseZoneManager.add(new g(y+1,_+1,x+1,S+1,function(w){if(o.handler)return o.handler(w,d);var A=window.open();A?(A.opener=null,A.location.href=d):console.warn("Opening link blocked as opener could not be cleared")},function(){u._onShowLinkUnderline.fire(u._createLinkHoverEvent(y,_,x,S,s)),u._element.classList.add("xterm-cursor-pointer")},function(w){u._onLinkTooltip.fire(u._createLinkHoverEvent(y,_,x,S,s)),o.hoverTooltipCallback&&o.hoverTooltipCallback(w,d,{start:{x:y,y:_},end:{x,y:S}})},function(){u._onHideLinkUnderline.fire(u._createLinkHoverEvent(y,_,x,S,s)),u._element.classList.remove("xterm-cursor-pointer"),o.hoverLeaveCallback&&o.hoverLeaveCallback()},function(w){return!o.willLinkActivate||o.willLinkActivate(w,d)}))}},l.prototype._createLinkHoverEvent=function(h,v,d,o,s){return{x1:h,y1:v,x2:d,y2:o,cols:this._bufferService.cols,fg:s}},l._timeBeforeLatency=200,l=fe([i(0,E.IBufferService),i(1,E.ILogService),i(2,E.IUnicodeService)],l)}();Q.Linkifier=p;var g=function(l,h,v,d,o,s,u,m,y){this.x1=l,this.y1=h,this.x2=v,this.y2=d,this.clickCallback=o,this.hoverCallback=s,this.tooltipCallback=u,this.leaveCallback=m,this.willLinkActivate=y};Q.MouseZone=g},function(Ue,Q,he){"use strict";var fe,i=this&&this.__extends||(fe=function(x,S){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,A){w.__proto__=A}||function(w,A){for(var H in A)A.hasOwnProperty(H)&&(w[H]=A[H])})(x,S)},function(x,S){function w(){this.constructor=x}fe(x,S),x.prototype=S===null?Object.create(S):(w.prototype=S.prototype,new w)}),M=this&&this.__decorate||function(x,S,w,A){var H,R=arguments.length,F=R<3?S:A===null?A=Object.getOwnPropertyDescriptor(S,w):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(x,S,w,A);else for(var D=x.length-1;D>=0;D--)(H=x[D])&&(F=(R<3?H(F):R>3?H(S,w,F):H(S,w))||F);return R>3&&F&&Object.defineProperty(S,w,F),F},E=this&&this.__param||function(x,S){return function(w,A){S(w,A,x)}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.SelectionService=void 0;var p=he(11),g=he(52),l=he(4),h=he(0),v=he(5),d=he(1),o=he(30),s=he(53),u=he(2),m="\xA0",y=new RegExp(m,"g"),_=function(x){function S(w,A,H,R,F,D,B){var P=x.call(this)||this;return P._element=w,P._screenElement=A,P._bufferService=H,P._coreService=R,P._mouseService=F,P._optionsService=D,P._renderService=B,P._dragScrollAmount=0,P._enabled=!0,P._workCell=new l.CellData,P._mouseDownTimeStamp=0,P._onLinuxMouseSelection=P.register(new h.EventEmitter),P._onRedrawRequest=P.register(new h.EventEmitter),P._onSelectionChange=P.register(new h.EventEmitter),P._onRequestScrollLines=P.register(new h.EventEmitter),P._mouseMoveListener=function(U){return P._onMouseMove(U)},P._mouseUpListener=function(U){return P._onMouseUp(U)},P._coreService.onUserInput(function(){P.hasSelection&&P.clearSelection()}),P._trimListener=P._bufferService.buffer.lines.onTrim(function(U){return P._onTrim(U)}),P.register(P._bufferService.buffers.onBufferActivate(function(U){return P._onBufferActivate(U)})),P.enable(),P._model=new g.SelectionModel(P._bufferService),P._activeSelectionMode=0,P}return i(S,x),Object.defineProperty(S.prototype,"onLinuxMouseSelection",{get:function(){return this._onLinuxMouseSelection.event},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onRequestRedraw",{get:function(){return this._onRedrawRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onRequestScrollLines",{get:function(){return this._onRequestScrollLines.event},enumerable:!1,configurable:!0}),S.prototype.dispose=function(){this._removeMouseDownListeners()},S.prototype.reset=function(){this.clearSelection()},S.prototype.disable=function(){this.clearSelection(),this._enabled=!1},S.prototype.enable=function(){this._enabled=!0},Object.defineProperty(S.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"hasSelection",{get:function(){var w=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;return!(!w||!A)&&(w[0]!==A[0]||w[1]!==A[1])},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"selectionText",{get:function(){var w=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;if(!w||!A)return"";var H=this._bufferService.buffer,R=[];if(this._activeSelectionMode===3){if(w[0]===A[0])return"";for(var F=w[1];F<=A[1];F++){var D=H.translateBufferLineToString(F,!0,w[0],A[0]);R.push(D)}}else{var B=w[1]===A[1]?A[0]:void 0;for(R.push(H.translateBufferLineToString(w[1],!0,w[0],B)),F=w[1]+1;F<=A[1]-1;F++){var P=H.lines.get(F);D=H.translateBufferLineToString(F,!0),P&&P.isWrapped?R[R.length-1]+=D:R.push(D)}w[1]!==A[1]&&(P=H.lines.get(A[1]),D=H.translateBufferLineToString(A[1],!0,0,A[0]),P&&P.isWrapped?R[R.length-1]+=D:R.push(D))}return R.map(function(U){return U.replace(y," ")}).join(p.isWindows?`\r
`:`
`)},enumerable:!1,configurable:!0}),S.prototype.clearSelection=function(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()},S.prototype.refresh=function(w){var A=this;this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame(function(){return A._refresh()})),p.isLinux&&w&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)},S.prototype._refresh=function(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})},S.prototype.isClickInSelection=function(w){var A=this._getMouseBufferCoords(w),H=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;return!!(H&&R&&A)&&this._areCoordsInSelection(A,H,R)},S.prototype._areCoordsInSelection=function(w,A,H){return w[1]>A[1]&&w[1]<H[1]||A[1]===H[1]&&w[1]===A[1]&&w[0]>=A[0]&&w[0]<H[0]||A[1]<H[1]&&w[1]===H[1]&&w[0]<H[0]||A[1]<H[1]&&w[1]===A[1]&&w[0]>=A[0]},S.prototype.selectWordAtCursor=function(w){var A=this._getMouseBufferCoords(w);A&&(this._selectWordAt(A,!1),this._model.selectionEnd=void 0,this.refresh(!0))},S.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()},S.prototype.selectLines=function(w,A){this._model.clearSelection(),w=Math.max(w,0),A=Math.min(A,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,w],this._model.selectionEnd=[this._bufferService.cols,A],this.refresh(),this._onSelectionChange.fire()},S.prototype._onTrim=function(w){this._model.onTrim(w)&&this.refresh()},S.prototype._getMouseBufferCoords=function(w){var A=this._mouseService.getCoords(w,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(A)return A[0]--,A[1]--,A[1]+=this._bufferService.buffer.ydisp,A},S.prototype._getMouseEventScrollAmount=function(w){var A=o.getCoordsRelativeToElement(w,this._screenElement)[1],H=this._renderService.dimensions.canvasHeight;return A>=0&&A<=H?0:(A>H&&(A-=H),A=Math.min(Math.max(A,-50),50),(A/=50)/Math.abs(A)+Math.round(14*A))},S.prototype.shouldForceSelection=function(w){return p.isMac?w.altKey&&this._optionsService.options.macOptionClickForcesSelection:w.shiftKey},S.prototype.onMouseDown=function(w){if(this._mouseDownTimeStamp=w.timeStamp,(w.button!==2||!this.hasSelection)&&w.button===0){if(!this._enabled){if(!this.shouldForceSelection(w))return;w.stopPropagation()}w.preventDefault(),this._dragScrollAmount=0,this._enabled&&w.shiftKey?this._onIncrementalClick(w):w.detail===1?this._onSingleClick(w):w.detail===2?this._onDoubleClick(w):w.detail===3&&this._onTripleClick(w),this._addMouseDownListeners(),this.refresh(!0)}},S.prototype._addMouseDownListeners=function(){var w=this;this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=window.setInterval(function(){return w._dragScroll()},50)},S.prototype._removeMouseDownListeners=function(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0},S.prototype._onIncrementalClick=function(w){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(w))},S.prototype._onSingleClick=function(w){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(w)?3:0,this._model.selectionStart=this._getMouseBufferCoords(w),this._model.selectionStart){this._model.selectionEnd=void 0;var A=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);A&&A.length!==this._model.selectionStart[0]&&A.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}},S.prototype._onDoubleClick=function(w){var A=this._getMouseBufferCoords(w);A&&(this._activeSelectionMode=1,this._selectWordAt(A,!0))},S.prototype._onTripleClick=function(w){var A=this._getMouseBufferCoords(w);A&&(this._activeSelectionMode=2,this._selectLineAt(A[1]))},S.prototype.shouldColumnSelect=function(w){return w.altKey&&!(p.isMac&&this._optionsService.options.macOptionClickForcesSelection)},S.prototype._onMouseMove=function(w){if(w.stopImmediatePropagation(),this._model.selectionStart){var A=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(w),this._model.selectionEnd){this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(w),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));var H=this._bufferService.buffer;if(this._model.selectionEnd[1]<H.lines.length){var R=H.lines.get(this._model.selectionEnd[1]);R&&R.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}A&&A[0]===this._model.selectionEnd[0]&&A[1]===this._model.selectionEnd[1]||this.refresh(!0)}else this.refresh(!0)}},S.prototype._dragScroll=function(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});var w=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(w.ydisp+this._bufferService.rows,w.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=w.ydisp),this.refresh()}},S.prototype._onMouseUp=function(w){var A=w.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&A<500&&w.altKey){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){var H=this._mouseService.getCoords(w,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(H&&H[0]!==void 0&&H[1]!==void 0){var R=s.moveToCellSequence(H[0]-1,H[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(R,!0)}}}else this.hasSelection&&this._onSelectionChange.fire()},S.prototype._onBufferActivate=function(w){var A=this;this.clearSelection(),this._trimListener.dispose(),this._trimListener=w.activeBuffer.lines.onTrim(function(H){return A._onTrim(H)})},S.prototype._convertViewportColToCharacterIndex=function(w,A){for(var H=A[0],R=0;A[0]>=R;R++){var F=w.loadCell(R,this._workCell).getChars().length;this._workCell.getWidth()===0?H--:F>1&&A[0]!==R&&(H+=F-1)}return H},S.prototype.setSelection=function(w,A,H){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[w,A],this._model.selectionStartLength=H,this.refresh()},S.prototype._getWordAt=function(w,A,H,R){if(H===void 0&&(H=!0),R===void 0&&(R=!0),!(w[0]>=this._bufferService.cols)){var F=this._bufferService.buffer,D=F.lines.get(w[1]);if(D){var B=F.translateBufferLineToString(w[1],!1),P=this._convertViewportColToCharacterIndex(D,w),U=P,G=w[0]-P,ee=0,K=0,Z=0,$=0;if(B.charAt(P)===" "){for(;P>0&&B.charAt(P-1)===" ";)P--;for(;U<B.length&&B.charAt(U+1)===" ";)U++}else{var oe=w[0],ae=w[0];D.getWidth(oe)===0&&(ee++,oe--),D.getWidth(ae)===2&&(K++,ae++);var ye=D.getString(ae).length;for(ye>1&&($+=ye-1,U+=ye-1);oe>0&&P>0&&!this._isCharWordSeparator(D.loadCell(oe-1,this._workCell));){D.loadCell(oe-1,this._workCell);var Y=this._workCell.getChars().length;this._workCell.getWidth()===0?(ee++,oe--):Y>1&&(Z+=Y-1,P-=Y-1),P--,oe--}for(;ae<D.length&&U+1<B.length&&!this._isCharWordSeparator(D.loadCell(ae+1,this._workCell));){D.loadCell(ae+1,this._workCell);var le=this._workCell.getChars().length;this._workCell.getWidth()===2?(K++,ae++):le>1&&($+=le-1,U+=le-1),U++,ae++}}U++;var xe=P+G-ee+Z,Ce=Math.min(this._bufferService.cols,U-P+ee+K-Z-$);if(A||B.slice(P,U).trim()!==""){if(H&&xe===0&&D.getCodePoint(0)!==32){var we=F.lines.get(w[1]-1);if(we&&D.isWrapped&&we.getCodePoint(this._bufferService.cols-1)!==32){var Le=this._getWordAt([this._bufferService.cols-1,w[1]-1],!1,!0,!1);if(Le){var de=this._bufferService.cols-Le.start;xe-=de,Ce+=de}}}if(R&&xe+Ce===this._bufferService.cols&&D.getCodePoint(this._bufferService.cols-1)!==32){var be=F.lines.get(w[1]+1);if(be&&be.isWrapped&&be.getCodePoint(0)!==32){var Te=this._getWordAt([0,w[1]+1],!1,!1,!0);Te&&(Ce+=Te.length)}}return{start:xe,length:Ce}}}}},S.prototype._selectWordAt=function(w,A){var H=this._getWordAt(w,A);if(H){for(;H.start<0;)H.start+=this._bufferService.cols,w[1]--;this._model.selectionStart=[H.start,w[1]],this._model.selectionStartLength=H.length}},S.prototype._selectToWordAt=function(w){var A=this._getWordAt(w,!0);if(A){for(var H=w[1];A.start<0;)A.start+=this._bufferService.cols,H--;if(!this._model.areSelectionValuesReversed())for(;A.start+A.length>this._bufferService.cols;)A.length-=this._bufferService.cols,H++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?A.start:A.start+A.length,H]}},S.prototype._isCharWordSeparator=function(w){return w.getWidth()!==0&&this._optionsService.options.wordSeparator.indexOf(w.getChars())>=0},S.prototype._selectLineAt=function(w){var A=this._bufferService.buffer.getWrappedRangeForLine(w);this._model.selectionStart=[0,A.first],this._model.selectionEnd=[this._bufferService.cols,A.last],this._model.selectionStartLength=0},S=M([E(2,d.IBufferService),E(3,d.ICoreService),E(4,v.IMouseService),E(5,d.IOptionsService),E(6,v.IRenderService)],S)}(u.Disposable);Q.SelectionService=_},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.SelectionModel=void 0;var fe=function(){function i(M){this._bufferService=M,this.isSelectAllActive=!1,this.selectionStartLength=0}return i.prototype.clearSelection=function(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(i.prototype,"finalSelectionStart",{get:function(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"finalSelectionEnd",{get:function(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){var M=this.selectionStart[0]+this.selectionStartLength;return M>this._bufferService.cols?[M%this._bufferService.cols,this.selectionStart[1]+Math.floor(M/this._bufferService.cols)]:[M,this.selectionStart[1]]}return this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?[Math.max(this.selectionStart[0]+this.selectionStartLength,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd}},enumerable:!1,configurable:!0}),i.prototype.areSelectionValuesReversed=function(){var M=this.selectionStart,E=this.selectionEnd;return!(!M||!E)&&(M[1]>E[1]||M[1]===E[1]&&M[0]>E[0])},i.prototype.onTrim=function(M){return this.selectionStart&&(this.selectionStart[1]-=M),this.selectionEnd&&(this.selectionEnd[1]-=M),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},i}();Q.SelectionModel=fe},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.moveToCellSequence=void 0;var fe=he(12);function i(h,v,d,o){var s=h-M(d,h),u=v-M(d,v);return l(Math.abs(s-u)-function(m,y,_){for(var x=0,S=m-M(_,m),w=y-M(_,y),A=0;A<Math.abs(S-w);A++){var H=E(m,y)==="A"?-1:1,R=_.buffer.lines.get(S+H*A);R&&R.isWrapped&&x++}return x}(h,v,d),g(E(h,v),o))}function M(h,v){for(var d=0,o=h.buffer.lines.get(v),s=o&&o.isWrapped;s&&v>=0&&v<h.rows;)d++,s=(o=h.buffer.lines.get(--v))&&o.isWrapped;return d}function E(h,v){return h>v?"A":"B"}function p(h,v,d,o,s,u){for(var m=h,y=v,_="";m!==d||y!==o;)m+=s?1:-1,s&&m>u.cols-1?(_+=u.buffer.translateBufferLineToString(y,!1,h,m),m=0,h=0,y++):!s&&m<0&&(_+=u.buffer.translateBufferLineToString(y,!1,0,h+1),h=m=u.cols-1,y--);return _+u.buffer.translateBufferLineToString(y,!1,h,m)}function g(h,v){var d=v?"O":"[";return fe.C0.ESC+d+h}function l(h,v){h=Math.floor(h);for(var d="",o=0;o<h;o++)d+=v;return d}Q.moveToCellSequence=function(h,v,d,o){var s,u=d.buffer.x,m=d.buffer.y;if(!d.buffer.hasScrollback)return function(_,x,S,w,A,H){return i(x,w,A,H).length===0?"":l(p(_,x,_,x-M(A,x),!1,A).length,g("D",H))}(u,m,0,v,d,o)+i(m,v,d,o)+function(_,x,S,w,A,H){var R;R=i(x,w,A,H).length>0?w-M(A,w):x;var F=w,D=function(B,P,U,G,ee,K){var Z;return Z=i(U,G,ee,K).length>0?G-M(ee,G):P,B<U&&Z<=G||B>=U&&Z<G?"C":"D"}(_,x,S,w,A,H);return l(p(_,R,S,F,D==="C",A).length,g(D,H))}(u,m,h,v,d,o);if(m===v)return s=u>h?"D":"C",l(Math.abs(u-h),g(s,o));s=m>v?"D":"C";var y=Math.abs(m-v);return l(function(_,x){return x.cols-_}(m>v?h:u,d)+(y-1)*d.cols+1+((m>v?u:h)-1),g(s,o))}},function(Ue,Q,he){"use strict";var fe=this&&this.__decorate||function(p,g,l,h){var v,d=arguments.length,o=d<3?g:h===null?h=Object.getOwnPropertyDescriptor(g,l):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(p,g,l,h);else for(var s=p.length-1;s>=0;s--)(v=p[s])&&(o=(d<3?v(o):d>3?v(g,l,o):v(g,l))||o);return d>3&&o&&Object.defineProperty(g,l,o),o},i=this&&this.__param||function(p,g){return function(l,h){g(l,h,p)}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.SoundService=void 0;var M=he(1),E=function(){function p(g){this._optionsService=g}return Object.defineProperty(p,"audioContext",{get:function(){if(!p._audioContext){var g=window.AudioContext||window.webkitAudioContext;if(!g)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),null;p._audioContext=new g}return p._audioContext},enumerable:!1,configurable:!0}),p.prototype.playBellSound=function(){var g=p.audioContext;if(g){var l=g.createBufferSource();g.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._optionsService.options.bellSound)),function(h){l.buffer=h,l.connect(g.destination),l.start(0)})}},p.prototype._base64ToArrayBuffer=function(g){for(var l=window.atob(g),h=l.length,v=new Uint8Array(h),d=0;d<h;d++)v[d]=l.charCodeAt(d);return v.buffer},p.prototype._removeMimeType=function(g){return g.split(",")[1]},p=fe([i(0,M.IOptionsService)],p)}();Q.SoundService=E},function(Ue,Q,he){"use strict";var fe,i=this&&this.__extends||(fe=function(d,o){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,u){s.__proto__=u}||function(s,u){for(var m in u)u.hasOwnProperty(m)&&(s[m]=u[m])})(d,o)},function(d,o){function s(){this.constructor=d}fe(d,o),d.prototype=o===null?Object.create(o):(s.prototype=o.prototype,new s)}),M=this&&this.__decorate||function(d,o,s,u){var m,y=arguments.length,_=y<3?o:u===null?u=Object.getOwnPropertyDescriptor(o,s):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(d,o,s,u);else for(var x=d.length-1;x>=0;x--)(m=d[x])&&(_=(y<3?m(_):y>3?m(o,s,_):m(o,s))||_);return y>3&&_&&Object.defineProperty(o,s,_),_},E=this&&this.__param||function(d,o){return function(s,u){o(s,u,d)}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.MouseZoneManager=void 0;var p=he(2),g=he(7),l=he(5),h=he(1),v=function(d){function o(s,u,m,y,_,x){var S=d.call(this)||this;return S._element=s,S._screenElement=u,S._bufferService=m,S._mouseService=y,S._selectionService=_,S._optionsService=x,S._zones=[],S._areZonesActive=!1,S._lastHoverCoords=[void 0,void 0],S._initialSelectionLength=0,S.register(g.addDisposableDomListener(S._element,"mousedown",function(w){return S._onMouseDown(w)})),S._mouseMoveListener=function(w){return S._onMouseMove(w)},S._mouseLeaveListener=function(w){return S._onMouseLeave(w)},S._clickListener=function(w){return S._onClick(w)},S}return i(o,d),o.prototype.dispose=function(){d.prototype.dispose.call(this),this._deactivate()},o.prototype.add=function(s){this._zones.push(s),this._zones.length===1&&this._activate()},o.prototype.clearAll=function(s,u){if(this._zones.length!==0){s&&u||(s=0,u=this._bufferService.rows-1);for(var m=0;m<this._zones.length;m++){var y=this._zones[m];(y.y1>s&&y.y1<=u+1||y.y2>s&&y.y2<=u+1||y.y1<s&&y.y2>u+1)&&(this._currentZone&&this._currentZone===y&&(this._currentZone.leaveCallback(),this._currentZone=void 0),this._zones.splice(m--,1))}this._zones.length===0&&this._deactivate()}},o.prototype._activate=function(){this._areZonesActive||(this._areZonesActive=!0,this._element.addEventListener("mousemove",this._mouseMoveListener),this._element.addEventListener("mouseleave",this._mouseLeaveListener),this._element.addEventListener("click",this._clickListener))},o.prototype._deactivate=function(){this._areZonesActive&&(this._areZonesActive=!1,this._element.removeEventListener("mousemove",this._mouseMoveListener),this._element.removeEventListener("mouseleave",this._mouseLeaveListener),this._element.removeEventListener("click",this._clickListener))},o.prototype._onMouseMove=function(s){this._lastHoverCoords[0]===s.pageX&&this._lastHoverCoords[1]===s.pageY||(this._onHover(s),this._lastHoverCoords=[s.pageX,s.pageY])},o.prototype._onHover=function(s){var u=this,m=this._findZoneEventAt(s);m!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),m&&(this._currentZone=m,m.hoverCallback&&m.hoverCallback(s),this._tooltipTimeout=window.setTimeout(function(){return u._onTooltip(s)},this._optionsService.options.linkTooltipHoverDuration)))},o.prototype._onTooltip=function(s){this._tooltipTimeout=void 0;var u=this._findZoneEventAt(s);u&&u.tooltipCallback&&u.tooltipCallback(s)},o.prototype._onMouseDown=function(s){if(this._initialSelectionLength=this._getSelectionLength(),this._areZonesActive){var u=this._findZoneEventAt(s);u!=null&&u.willLinkActivate(s)&&(s.preventDefault(),s.stopImmediatePropagation())}},o.prototype._onMouseLeave=function(s){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},o.prototype._onClick=function(s){var u=this._findZoneEventAt(s),m=this._getSelectionLength();u&&m===this._initialSelectionLength&&(u.clickCallback(s),s.preventDefault(),s.stopImmediatePropagation())},o.prototype._getSelectionLength=function(){var s=this._selectionService.selectionText;return s?s.length:0},o.prototype._findZoneEventAt=function(s){var u=this._mouseService.getCoords(s,this._screenElement,this._bufferService.cols,this._bufferService.rows);if(u)for(var m=u[0],y=u[1],_=0;_<this._zones.length;_++){var x=this._zones[_];if(x.y1===x.y2){if(y===x.y1&&m>=x.x1&&m<x.x2)return x}else if(y===x.y1&&m>=x.x1||y===x.y2&&m<x.x2||y>x.y1&&y<x.y2)return x}},o=M([E(2,h.IBufferService),E(3,l.IMouseService),E(4,l.ISelectionService),E(5,h.IOptionsService)],o)}(p.Disposable);Q.MouseZoneManager=v},function(Ue,Q,he){"use strict";var fe,i=this&&this.__extends||(fe=function(o,s){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,m){u.__proto__=m}||function(u,m){for(var y in m)m.hasOwnProperty(y)&&(u[y]=m[y])})(o,s)},function(o,s){function u(){this.constructor=o}fe(o,s),o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)});Object.defineProperty(Q,"__esModule",{value:!0}),Q.AccessibilityManager=void 0;var M=he(18),E=he(11),p=he(31),g=he(7),l=he(2),h=he(32),v=he(17),d=function(o){function s(u,m){var y=o.call(this)||this;y._terminal=u,y._renderService=m,y._liveRegionLineCount=0,y._charsToConsume=[],y._charsToAnnounce="",y._accessibilityTreeRoot=document.createElement("div"),y._accessibilityTreeRoot.classList.add("xterm-accessibility"),y._rowContainer=document.createElement("div"),y._rowContainer.classList.add("xterm-accessibility-tree"),y._rowContainer.setAttribute("role","list"),y._rowElements=[];for(var _=0;_<y._terminal.rows;_++)y._rowElements[_]=y._createAccessibilityTreeNode(),y._rowContainer.appendChild(y._rowElements[_]);if(y._topBoundaryFocusListener=function(x){return y._onBoundaryFocus(x,0)},y._bottomBoundaryFocusListener=function(x){return y._onBoundaryFocus(x,1)},y._rowElements[0].addEventListener("focus",y._topBoundaryFocusListener),y._rowElements[y._rowElements.length-1].addEventListener("focus",y._bottomBoundaryFocusListener),y._refreshRowsDimensions(),y._accessibilityTreeRoot.appendChild(y._rowContainer),y._renderRowsDebouncer=new p.RenderDebouncer(y._renderRows.bind(y)),y._refreshRows(),y._liveRegion=document.createElement("div"),y._liveRegion.classList.add("live-region"),y._liveRegion.setAttribute("aria-live","assertive"),y._accessibilityTreeRoot.appendChild(y._liveRegion),!y._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");return y._terminal.element.insertAdjacentElement("afterbegin",y._accessibilityTreeRoot),y.register(y._renderRowsDebouncer),y.register(y._terminal.onResize(function(x){return y._onResize(x.rows)})),y.register(y._terminal.onRender(function(x){return y._refreshRows(x.start,x.end)})),y.register(y._terminal.onScroll(function(){return y._refreshRows()})),y.register(y._terminal.onA11yChar(function(x){return y._onChar(x)})),y.register(y._terminal.onLineFeed(function(){return y._onChar(`
`)})),y.register(y._terminal.onA11yTab(function(x){return y._onTab(x)})),y.register(y._terminal.onKey(function(x){return y._onKey(x.key)})),y.register(y._terminal.onBlur(function(){return y._clearLiveRegion()})),y.register(y._renderService.onDimensionsChange(function(){return y._refreshRowsDimensions()})),y._screenDprMonitor=new h.ScreenDprMonitor,y.register(y._screenDprMonitor),y._screenDprMonitor.setListener(function(){return y._refreshRowsDimensions()}),y.register(g.addDisposableDomListener(window,"resize",function(){return y._refreshRowsDimensions()})),y}return i(s,o),s.prototype.dispose=function(){o.prototype.dispose.call(this),v.removeElementFromParent(this._accessibilityTreeRoot),this._rowElements.length=0},s.prototype._onBoundaryFocus=function(u,m){var y=u.target,_=this._rowElements[m===0?1:this._rowElements.length-2];if(y.getAttribute("aria-posinset")!==(m===0?"1":""+this._terminal.buffer.lines.length)&&u.relatedTarget===_){var x,S;if(m===0?(x=y,S=this._rowElements.pop(),this._rowContainer.removeChild(S)):(x=this._rowElements.shift(),S=y,this._rowContainer.removeChild(x)),x.removeEventListener("focus",this._topBoundaryFocusListener),S.removeEventListener("focus",this._bottomBoundaryFocusListener),m===0){var w=this._createAccessibilityTreeNode();this._rowElements.unshift(w),this._rowContainer.insertAdjacentElement("afterbegin",w)}else w=this._createAccessibilityTreeNode(),this._rowElements.push(w),this._rowContainer.appendChild(w);this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(m===0?-1:1),this._rowElements[m===0?1:this._rowElements.length-2].focus(),u.preventDefault(),u.stopImmediatePropagation()}},s.prototype._onResize=function(u){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(var m=this._rowContainer.children.length;m<this._terminal.rows;m++)this._rowElements[m]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[m]);for(;this._rowElements.length>u;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()},s.prototype._createAccessibilityTreeNode=function(){var u=document.createElement("div");return u.setAttribute("role","listitem"),u.tabIndex=-1,this._refreshRowDimensions(u),u},s.prototype._onTab=function(u){for(var m=0;m<u;m++)this._onChar(" ")},s.prototype._onChar=function(u){var m=this;this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==u&&(this._charsToAnnounce+=u):this._charsToAnnounce+=u,u===`
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=M.tooMuchOutput)),E.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(function(){m._accessibilityTreeRoot.appendChild(m._liveRegion)},0))},s.prototype._clearLiveRegion=function(){this._liveRegion.textContent="",this._liveRegionLineCount=0,E.isMac&&v.removeElementFromParent(this._liveRegion)},s.prototype._onKey=function(u){this._clearLiveRegion(),this._charsToConsume.push(u)},s.prototype._refreshRows=function(u,m){this._renderRowsDebouncer.refresh(u,m,this._terminal.rows)},s.prototype._renderRows=function(u,m){for(var y=this._terminal.buffer,_=y.lines.length.toString(),x=u;x<=m;x++){var S=y.translateBufferLineToString(y.ydisp+x,!0),w=(y.ydisp+x+1).toString(),A=this._rowElements[x];A&&(S.length===0?A.innerHTML="&nbsp;":A.textContent=S,A.setAttribute("aria-posinset",w),A.setAttribute("aria-setsize",_))}this._announceCharacters()},s.prototype._refreshRowsDimensions=function(){if(this._renderService.dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(var u=0;u<this._terminal.rows;u++)this._refreshRowDimensions(this._rowElements[u])}},s.prototype._refreshRowDimensions=function(u){u.style.height=this._renderService.dimensions.actualCellHeight+"px"},s.prototype._announceCharacters=function(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")},s}(l.Disposable);Q.AccessibilityManager=d},function(Ue,Q,he){"use strict";var fe,i=this&&this.__extends||(fe=function(y,_){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,S){x.__proto__=S}||function(x,S){for(var w in S)S.hasOwnProperty(w)&&(x[w]=S[w])})(y,_)},function(y,_){function x(){this.constructor=y}fe(y,_),y.prototype=_===null?Object.create(_):(x.prototype=_.prototype,new x)}),M=this&&this.__decorate||function(y,_,x,S){var w,A=arguments.length,H=A<3?_:S===null?S=Object.getOwnPropertyDescriptor(_,x):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(y,_,x,S);else for(var R=y.length-1;R>=0;R--)(w=y[R])&&(H=(A<3?w(H):A>3?w(_,x,H):w(_,x))||H);return A>3&&H&&Object.defineProperty(_,x,H),H},E=this&&this.__param||function(y,_){return function(x,S){_(x,S,y)}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.DomRenderer=void 0;var p=he(58),g=he(9),l=he(2),h=he(5),v=he(1),d=he(0),o=he(10),s=he(17),u=1,m=function(y){function _(x,S,w,A,H,R,F,D,B){var P=y.call(this)||this;return P._colors=x,P._element=S,P._screenElement=w,P._viewportElement=A,P._linkifier=H,P._linkifier2=R,P._charSizeService=F,P._optionsService=D,P._bufferService=B,P._terminalClass=u++,P._rowElements=[],P._rowContainer=document.createElement("div"),P._rowContainer.classList.add("xterm-rows"),P._rowContainer.style.lineHeight="normal",P._rowContainer.setAttribute("aria-hidden","true"),P._refreshRowElements(P._bufferService.cols,P._bufferService.rows),P._selectionContainer=document.createElement("div"),P._selectionContainer.classList.add("xterm-selection"),P._selectionContainer.setAttribute("aria-hidden","true"),P.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},P._updateDimensions(),P._injectCss(),P._rowFactory=new p.DomRendererRowFactory(document,P._optionsService,P._colors),P._element.classList.add("xterm-dom-renderer-owner-"+P._terminalClass),P._screenElement.appendChild(P._rowContainer),P._screenElement.appendChild(P._selectionContainer),P._linkifier.onShowLinkUnderline(function(U){return P._onLinkHover(U)}),P._linkifier.onHideLinkUnderline(function(U){return P._onLinkLeave(U)}),P._linkifier2.onShowLinkUnderline(function(U){return P._onLinkHover(U)}),P._linkifier2.onHideLinkUnderline(function(U){return P._onLinkLeave(U)}),P}return i(_,y),Object.defineProperty(_.prototype,"onRequestRedraw",{get:function(){return new d.EventEmitter().event},enumerable:!1,configurable:!0}),_.prototype.dispose=function(){this._element.classList.remove("xterm-dom-renderer-owner-"+this._terminalClass),s.removeElementFromParent(this._rowContainer,this._selectionContainer,this._themeStyleElement,this._dimensionsStyleElement),y.prototype.dispose.call(this)},_.prototype._updateDimensions=function(){this.dimensions.scaledCharWidth=this._charSizeService.width*window.devicePixelRatio,this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*window.devicePixelRatio),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.options.letterSpacing),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.options.lineHeight),this.dimensions.scaledCharLeft=0,this.dimensions.scaledCharTop=0,this.dimensions.scaledCanvasWidth=this.dimensions.scaledCellWidth*this._bufferService.cols,this.dimensions.scaledCanvasHeight=this.dimensions.scaledCellHeight*this._bufferService.rows,this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols,this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows;for(var x=0,S=this._rowElements;x<S.length;x++){var w=S[x];w.style.width=this.dimensions.canvasWidth+"px",w.style.height=this.dimensions.actualCellHeight+"px",w.style.lineHeight=this.dimensions.actualCellHeight+"px",w.style.overflow="hidden"}this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));var A=this._terminalSelector+" .xterm-rows span { display: inline-block; height: 100%; vertical-align: top; width: "+this.dimensions.actualCellWidth+"px}";this._dimensionsStyleElement.innerHTML=A,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},_.prototype.setColors=function(x){this._colors=x,this._injectCss()},_.prototype._injectCss=function(){var x=this;this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));var S=this._terminalSelector+" .xterm-rows { color: "+this._colors.foreground.css+"; font-family: "+this._optionsService.options.fontFamily+"; font-size: "+this._optionsService.options.fontSize+"px;}";S+=this._terminalSelector+" span:not(."+p.BOLD_CLASS+") { font-weight: "+this._optionsService.options.fontWeight+";}"+this._terminalSelector+" span."+p.BOLD_CLASS+" { font-weight: "+this._optionsService.options.fontWeightBold+";}"+this._terminalSelector+" span."+p.ITALIC_CLASS+" { font-style: italic;}",S+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { box-shadow: none; }}",S+="@keyframes blink_block_"+this._terminalClass+" { 0% { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+"; } 50% { background-color: "+this._colors.cursorAccent.css+"; color: "+this._colors.cursor.css+"; }}",S+=this._terminalSelector+" .xterm-rows:not(.xterm-focus) ."+p.CURSOR_CLASS+"."+p.CURSOR_STYLE_BLOCK_CLASS+" { outline: 1px solid "+this._colors.cursor.css+"; outline-offset: -1px;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+p.CURSOR_CLASS+"."+p.CURSOR_BLINK_CLASS+":not(."+p.CURSOR_STYLE_BLOCK_CLASS+") { animation: blink_box_shadow_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+p.CURSOR_CLASS+"."+p.CURSOR_BLINK_CLASS+"."+p.CURSOR_STYLE_BLOCK_CLASS+" { animation: blink_block_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+p.CURSOR_CLASS+"."+p.CURSOR_STYLE_BLOCK_CLASS+" { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+";}"+this._terminalSelector+" .xterm-rows ."+p.CURSOR_CLASS+"."+p.CURSOR_STYLE_BAR_CLASS+" { box-shadow: "+this._optionsService.options.cursorWidth+"px 0 0 "+this._colors.cursor.css+" inset;}"+this._terminalSelector+" .xterm-rows ."+p.CURSOR_CLASS+"."+p.CURSOR_STYLE_UNDERLINE_CLASS+" { box-shadow: 0 -1px 0 "+this._colors.cursor.css+" inset;}",S+=this._terminalSelector+" .xterm-selection { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}"+this._terminalSelector+" .xterm-selection div { position: absolute; background-color: "+this._colors.selectionTransparent.css+";}",this._colors.ansi.forEach(function(w,A){S+=x._terminalSelector+" .xterm-fg-"+A+" { color: "+w.css+"; }"+x._terminalSelector+" .xterm-bg-"+A+" { background-color: "+w.css+"; }"}),S+=this._terminalSelector+" .xterm-fg-"+g.INVERTED_DEFAULT_COLOR+" { color: "+o.color.opaque(this._colors.background).css+"; }"+this._terminalSelector+" .xterm-bg-"+g.INVERTED_DEFAULT_COLOR+" { background-color: "+this._colors.foreground.css+"; }",this._themeStyleElement.innerHTML=S},_.prototype.onDevicePixelRatioChange=function(){this._updateDimensions()},_.prototype._refreshRowElements=function(x,S){for(var w=this._rowElements.length;w<=S;w++){var A=document.createElement("div");this._rowContainer.appendChild(A),this._rowElements.push(A)}for(;this._rowElements.length>S;)this._rowContainer.removeChild(this._rowElements.pop())},_.prototype.onResize=function(x,S){this._refreshRowElements(x,S),this._updateDimensions()},_.prototype.onCharSizeChanged=function(){this._updateDimensions()},_.prototype.onBlur=function(){this._rowContainer.classList.remove("xterm-focus")},_.prototype.onFocus=function(){this._rowContainer.classList.add("xterm-focus")},_.prototype.onSelectionChanged=function(x,S,w){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(x&&S){var A=x[1]-this._bufferService.buffer.ydisp,H=S[1]-this._bufferService.buffer.ydisp,R=Math.max(A,0),F=Math.min(H,this._bufferService.rows-1);if(!(R>=this._bufferService.rows||F<0)){var D=document.createDocumentFragment();if(w)D.appendChild(this._createSelectionElement(R,x[0],S[0],F-R+1));else{var B=A===R?x[0]:0,P=R===F?S[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(R,B,P));var U=F-R-1;if(D.appendChild(this._createSelectionElement(R+1,0,this._bufferService.cols,U)),R!==F){var G=H===F?S[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(F,0,G))}}this._selectionContainer.appendChild(D)}}},_.prototype._createSelectionElement=function(x,S,w,A){A===void 0&&(A=1);var H=document.createElement("div");return H.style.height=A*this.dimensions.actualCellHeight+"px",H.style.top=x*this.dimensions.actualCellHeight+"px",H.style.left=S*this.dimensions.actualCellWidth+"px",H.style.width=this.dimensions.actualCellWidth*(w-S)+"px",H},_.prototype.onCursorMove=function(){},_.prototype.onOptionsChanged=function(){this._updateDimensions(),this._injectCss()},_.prototype.clear=function(){for(var x=0,S=this._rowElements;x<S.length;x++)S[x].innerHTML=""},_.prototype.renderRows=function(x,S){for(var w=this._bufferService.buffer.ybase+this._bufferService.buffer.y,A=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),H=this._optionsService.options.cursorBlink,R=x;R<=S;R++){var F=this._rowElements[R];F.innerHTML="";var D=R+this._bufferService.buffer.ydisp,B=this._bufferService.buffer.lines.get(D),P=this._optionsService.options.cursorStyle;F.appendChild(this._rowFactory.createRow(B,D===w,P,A,H,this.dimensions.actualCellWidth,this._bufferService.cols))}},Object.defineProperty(_.prototype,"_terminalSelector",{get:function(){return".xterm-dom-renderer-owner-"+this._terminalClass},enumerable:!1,configurable:!0}),_.prototype.registerCharacterJoiner=function(x){return-1},_.prototype.deregisterCharacterJoiner=function(x){return!1},_.prototype._onLinkHover=function(x){this._setCellUnderline(x.x1,x.x2,x.y1,x.y2,x.cols,!0)},_.prototype._onLinkLeave=function(x){this._setCellUnderline(x.x1,x.x2,x.y1,x.y2,x.cols,!1)},_.prototype._setCellUnderline=function(x,S,w,A,H,R){for(;x!==S||w!==A;){var F=this._rowElements[w];if(!F)return;var D=F.children[x];D&&(D.style.textDecoration=R?"underline":"none"),++x>=H&&(x=0,w++)}},_=M([E(6,h.ICharSizeService),E(7,v.IOptionsService),E(8,v.IBufferService)],_)}(l.Disposable);Q.DomRenderer=m},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.DomRendererRowFactory=Q.CURSOR_STYLE_UNDERLINE_CLASS=Q.CURSOR_STYLE_BAR_CLASS=Q.CURSOR_STYLE_BLOCK_CLASS=Q.CURSOR_BLINK_CLASS=Q.CURSOR_CLASS=Q.UNDERLINE_CLASS=Q.ITALIC_CLASS=Q.DIM_CLASS=Q.BOLD_CLASS=void 0;var fe=he(9),i=he(3),M=he(4),E=he(10);Q.BOLD_CLASS="xterm-bold",Q.DIM_CLASS="xterm-dim",Q.ITALIC_CLASS="xterm-italic",Q.UNDERLINE_CLASS="xterm-underline",Q.CURSOR_CLASS="xterm-cursor",Q.CURSOR_BLINK_CLASS="xterm-cursor-blink",Q.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",Q.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",Q.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";var p=function(){function l(h,v,d){this._document=h,this._optionsService=v,this._colors=d,this._workCell=new M.CellData}return l.prototype.setColors=function(h){this._colors=h},l.prototype.createRow=function(h,v,d,o,s,u,m){for(var y=this._document.createDocumentFragment(),_=0,x=Math.min(h.length,m)-1;x>=0;x--)if(h.loadCell(x,this._workCell).getCode()!==i.NULL_CELL_CODE||v&&x===o){_=x+1;break}for(x=0;x<_;x++){h.loadCell(x,this._workCell);var S=this._workCell.getWidth();if(S!==0){var w=this._document.createElement("span");if(S>1&&(w.style.width=u*S+"px"),v&&x===o)switch(w.classList.add(Q.CURSOR_CLASS),s&&w.classList.add(Q.CURSOR_BLINK_CLASS),d){case"bar":w.classList.add(Q.CURSOR_STYLE_BAR_CLASS);break;case"underline":w.classList.add(Q.CURSOR_STYLE_UNDERLINE_CLASS);break;default:w.classList.add(Q.CURSOR_STYLE_BLOCK_CLASS)}this._workCell.isBold()&&w.classList.add(Q.BOLD_CLASS),this._workCell.isItalic()&&w.classList.add(Q.ITALIC_CLASS),this._workCell.isDim()&&w.classList.add(Q.DIM_CLASS),this._workCell.isUnderline()&&w.classList.add(Q.UNDERLINE_CLASS),this._workCell.isInvisible()?w.textContent=i.WHITESPACE_CELL_CHAR:w.textContent=this._workCell.getChars()||i.WHITESPACE_CELL_CHAR;var A=this._workCell.getFgColor(),H=this._workCell.getFgColorMode(),R=this._workCell.getBgColor(),F=this._workCell.getBgColorMode(),D=!!this._workCell.isInverse();if(D){var B=A;A=R,R=B;var P=H;H=F,F=P}switch(H){case 16777216:case 33554432:this._workCell.isBold()&&A<8&&this._optionsService.options.drawBoldTextInBrightColors&&(A+=8),this._applyMinimumContrast(w,this._colors.background,this._colors.ansi[A])||w.classList.add("xterm-fg-"+A);break;case 50331648:var U=E.rgba.toColor(A>>16&255,A>>8&255,255&A);this._applyMinimumContrast(w,this._colors.background,U)||this._addStyle(w,"color:#"+g(A.toString(16),"0",6));break;case 0:default:this._applyMinimumContrast(w,this._colors.background,this._colors.foreground)||D&&w.classList.add("xterm-fg-"+fe.INVERTED_DEFAULT_COLOR)}switch(F){case 16777216:case 33554432:w.classList.add("xterm-bg-"+R);break;case 50331648:this._addStyle(w,"background-color:#"+g(R.toString(16),"0",6));break;case 0:default:D&&w.classList.add("xterm-bg-"+fe.INVERTED_DEFAULT_COLOR)}y.appendChild(w)}}return y},l.prototype._applyMinimumContrast=function(h,v,d){if(this._optionsService.options.minimumContrastRatio===1)return!1;var o=this._colors.contrastCache.getColor(this._workCell.bg,this._workCell.fg);return o===void 0&&(o=E.color.ensureContrastRatio(v,d,this._optionsService.options.minimumContrastRatio),this._colors.contrastCache.setColor(this._workCell.bg,this._workCell.fg,o!=null?o:null)),!!o&&(this._addStyle(h,"color:"+o.css),!0)},l.prototype._addStyle=function(h,v){h.setAttribute("style",""+(h.getAttribute("style")||"")+v+";")},l}();function g(l,h,v){for(;l.length<v;)l=h+l;return l}Q.DomRendererRowFactory=p},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.evaluateKeyboardEvent=void 0;var fe=he(12),i={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};Q.evaluateKeyboardEvent=function(M,E,p,g){var l={type:0,cancel:!1,key:void 0},h=(M.shiftKey?1:0)|(M.altKey?2:0)|(M.ctrlKey?4:0)|(M.metaKey?8:0);switch(M.keyCode){case 0:M.key==="UIKeyInputUpArrow"?l.key=E?fe.C0.ESC+"OA":fe.C0.ESC+"[A":M.key==="UIKeyInputLeftArrow"?l.key=E?fe.C0.ESC+"OD":fe.C0.ESC+"[D":M.key==="UIKeyInputRightArrow"?l.key=E?fe.C0.ESC+"OC":fe.C0.ESC+"[C":M.key==="UIKeyInputDownArrow"&&(l.key=E?fe.C0.ESC+"OB":fe.C0.ESC+"[B");break;case 8:if(M.shiftKey){l.key=fe.C0.BS;break}if(M.altKey){l.key=fe.C0.ESC+fe.C0.DEL;break}l.key=fe.C0.DEL;break;case 9:if(M.shiftKey){l.key=fe.C0.ESC+"[Z";break}l.key=fe.C0.HT,l.cancel=!0;break;case 13:l.key=M.altKey?fe.C0.ESC+fe.C0.CR:fe.C0.CR,l.cancel=!0;break;case 27:l.key=fe.C0.ESC,M.altKey&&(l.key=fe.C0.ESC+fe.C0.ESC),l.cancel=!0;break;case 37:if(M.metaKey)break;h?(l.key=fe.C0.ESC+"[1;"+(h+1)+"D",l.key===fe.C0.ESC+"[1;3D"&&(l.key=fe.C0.ESC+(p?"b":"[1;5D"))):l.key=E?fe.C0.ESC+"OD":fe.C0.ESC+"[D";break;case 39:if(M.metaKey)break;h?(l.key=fe.C0.ESC+"[1;"+(h+1)+"C",l.key===fe.C0.ESC+"[1;3C"&&(l.key=fe.C0.ESC+(p?"f":"[1;5C"))):l.key=E?fe.C0.ESC+"OC":fe.C0.ESC+"[C";break;case 38:if(M.metaKey)break;h?(l.key=fe.C0.ESC+"[1;"+(h+1)+"A",p||l.key!==fe.C0.ESC+"[1;3A"||(l.key=fe.C0.ESC+"[1;5A")):l.key=E?fe.C0.ESC+"OA":fe.C0.ESC+"[A";break;case 40:if(M.metaKey)break;h?(l.key=fe.C0.ESC+"[1;"+(h+1)+"B",p||l.key!==fe.C0.ESC+"[1;3B"||(l.key=fe.C0.ESC+"[1;5B")):l.key=E?fe.C0.ESC+"OB":fe.C0.ESC+"[B";break;case 45:M.shiftKey||M.ctrlKey||(l.key=fe.C0.ESC+"[2~");break;case 46:l.key=h?fe.C0.ESC+"[3;"+(h+1)+"~":fe.C0.ESC+"[3~";break;case 36:l.key=h?fe.C0.ESC+"[1;"+(h+1)+"H":E?fe.C0.ESC+"OH":fe.C0.ESC+"[H";break;case 35:l.key=h?fe.C0.ESC+"[1;"+(h+1)+"F":E?fe.C0.ESC+"OF":fe.C0.ESC+"[F";break;case 33:M.shiftKey?l.type=2:l.key=fe.C0.ESC+"[5~";break;case 34:M.shiftKey?l.type=3:l.key=fe.C0.ESC+"[6~";break;case 112:l.key=h?fe.C0.ESC+"[1;"+(h+1)+"P":fe.C0.ESC+"OP";break;case 113:l.key=h?fe.C0.ESC+"[1;"+(h+1)+"Q":fe.C0.ESC+"OQ";break;case 114:l.key=h?fe.C0.ESC+"[1;"+(h+1)+"R":fe.C0.ESC+"OR";break;case 115:l.key=h?fe.C0.ESC+"[1;"+(h+1)+"S":fe.C0.ESC+"OS";break;case 116:l.key=h?fe.C0.ESC+"[15;"+(h+1)+"~":fe.C0.ESC+"[15~";break;case 117:l.key=h?fe.C0.ESC+"[17;"+(h+1)+"~":fe.C0.ESC+"[17~";break;case 118:l.key=h?fe.C0.ESC+"[18;"+(h+1)+"~":fe.C0.ESC+"[18~";break;case 119:l.key=h?fe.C0.ESC+"[19;"+(h+1)+"~":fe.C0.ESC+"[19~";break;case 120:l.key=h?fe.C0.ESC+"[20;"+(h+1)+"~":fe.C0.ESC+"[20~";break;case 121:l.key=h?fe.C0.ESC+"[21;"+(h+1)+"~":fe.C0.ESC+"[21~";break;case 122:l.key=h?fe.C0.ESC+"[23;"+(h+1)+"~":fe.C0.ESC+"[23~";break;case 123:l.key=h?fe.C0.ESC+"[24;"+(h+1)+"~":fe.C0.ESC+"[24~";break;default:if(!M.ctrlKey||M.shiftKey||M.altKey||M.metaKey)if(p&&!g||!M.altKey||M.metaKey)p&&!M.altKey&&!M.ctrlKey&&M.metaKey?M.keyCode===65&&(l.type=1):M.key&&!M.ctrlKey&&!M.altKey&&!M.metaKey&&M.keyCode>=48&&M.key.length===1?l.key=M.key:M.key&&M.ctrlKey&&M.key==="_"&&(l.key=fe.C0.US);else{var v=i[M.keyCode],d=v&&v[M.shiftKey?1:0];if(d)l.key=fe.C0.ESC+d;else if(M.keyCode>=65&&M.keyCode<=90){var o=M.ctrlKey?M.keyCode-64:M.keyCode+32;l.key=fe.C0.ESC+String.fromCharCode(o)}}else M.keyCode>=65&&M.keyCode<=90?l.key=String.fromCharCode(M.keyCode-64):M.keyCode===32?l.key=fe.C0.NUL:M.keyCode>=51&&M.keyCode<=55?l.key=String.fromCharCode(M.keyCode-51+27):M.keyCode===56?l.key=fe.C0.DEL:M.keyCode===219?l.key=fe.C0.ESC:M.keyCode===220?l.key=fe.C0.FS:M.keyCode===221&&(l.key=fe.C0.GS)}return l}},function(Ue,Q,he){"use strict";var fe,i=this&&this.__extends||(fe=function(u,m){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,_){y.__proto__=_}||function(y,_){for(var x in _)_.hasOwnProperty(x)&&(y[x]=_[x])})(u,m)},function(u,m){function y(){this.constructor=u}fe(u,m),u.prototype=m===null?Object.create(m):(y.prototype=m.prototype,new y)}),M=this&&this.__decorate||function(u,m,y,_){var x,S=arguments.length,w=S<3?m:_===null?_=Object.getOwnPropertyDescriptor(m,y):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(u,m,y,_);else for(var A=u.length-1;A>=0;A--)(x=u[A])&&(w=(S<3?x(w):S>3?x(m,y,w):x(m,y))||w);return S>3&&w&&Object.defineProperty(m,y,w),w},E=this&&this.__param||function(u,m){return function(y,_){m(y,_,u)}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.RenderService=void 0;var p=he(31),g=he(0),l=he(2),h=he(32),v=he(7),d=he(1),o=he(5),s=function(u){function m(y,_,x,S,w,A){var H=u.call(this)||this;if(H._renderer=y,H._rowCount=_,H._isPaused=!1,H._needsFullRefresh=!1,H._isNextRenderRedrawOnly=!0,H._needsSelectionRefresh=!1,H._canvasWidth=0,H._canvasHeight=0,H._selectionState={start:void 0,end:void 0,columnSelectMode:!1},H._onDimensionsChange=new g.EventEmitter,H._onRender=new g.EventEmitter,H._onRefreshRequest=new g.EventEmitter,H.register({dispose:function(){return H._renderer.dispose()}}),H._renderDebouncer=new p.RenderDebouncer(function(F,D){return H._renderRows(F,D)}),H.register(H._renderDebouncer),H._screenDprMonitor=new h.ScreenDprMonitor,H._screenDprMonitor.setListener(function(){return H.onDevicePixelRatioChange()}),H.register(H._screenDprMonitor),H.register(A.onResize(function(F){return H._fullRefresh()})),H.register(S.onOptionChange(function(){return H._renderer.onOptionsChanged()})),H.register(w.onCharSizeChange(function(){return H.onCharSizeChanged()})),H._renderer.onRequestRedraw(function(F){return H.refreshRows(F.start,F.end,!0)}),H.register(v.addDisposableDomListener(window,"resize",function(){return H.onDevicePixelRatioChange()})),"IntersectionObserver"in window){var R=new IntersectionObserver(function(F){return H._onIntersectionChange(F[F.length-1])},{threshold:0});R.observe(x),H.register({dispose:function(){return R.disconnect()}})}return H}return i(m,u),Object.defineProperty(m.prototype,"onDimensionsChange",{get:function(){return this._onDimensionsChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"onRenderedBufferChange",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"onRefreshRequest",{get:function(){return this._onRefreshRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"dimensions",{get:function(){return this._renderer.dimensions},enumerable:!1,configurable:!0}),m.prototype._onIntersectionChange=function(y){this._isPaused=y.intersectionRatio===0,!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)},m.prototype.refreshRows=function(y,_,x){x===void 0&&(x=!1),this._isPaused?this._needsFullRefresh=!0:(x||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(y,_,this._rowCount))},m.prototype._renderRows=function(y,_){this._renderer.renderRows(y,_),this._needsSelectionRefresh&&(this._renderer.onSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRender.fire({start:y,end:_}),this._isNextRenderRedrawOnly=!0},m.prototype.resize=function(y,_){this._rowCount=_,this._fireOnCanvasResize()},m.prototype.changeOptions=function(){this._renderer.onOptionsChanged(),this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize()},m.prototype._fireOnCanvasResize=function(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)},m.prototype.dispose=function(){u.prototype.dispose.call(this)},m.prototype.setRenderer=function(y){var _=this;this._renderer.dispose(),this._renderer=y,this._renderer.onRequestRedraw(function(x){return _.refreshRows(x.start,x.end,!0)}),this._needsSelectionRefresh=!0,this._fullRefresh()},m.prototype._fullRefresh=function(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)},m.prototype.setColors=function(y){this._renderer.setColors(y),this._fullRefresh()},m.prototype.onDevicePixelRatioChange=function(){this._renderer.onDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1)},m.prototype.onResize=function(y,_){this._renderer.onResize(y,_),this._fullRefresh()},m.prototype.onCharSizeChanged=function(){this._renderer.onCharSizeChanged()},m.prototype.onBlur=function(){this._renderer.onBlur()},m.prototype.onFocus=function(){this._renderer.onFocus()},m.prototype.onSelectionChanged=function(y,_,x){this._selectionState.start=y,this._selectionState.end=_,this._selectionState.columnSelectMode=x,this._renderer.onSelectionChanged(y,_,x)},m.prototype.onCursorMove=function(){this._renderer.onCursorMove()},m.prototype.clear=function(){this._renderer.clear()},m.prototype.registerCharacterJoiner=function(y){return this._renderer.registerCharacterJoiner(y)},m.prototype.deregisterCharacterJoiner=function(y){return this._renderer.deregisterCharacterJoiner(y)},m=M([E(3,d.IOptionsService),E(4,o.ICharSizeService),E(5,d.IBufferService)],m)}(l.Disposable);Q.RenderService=s},function(Ue,Q,he){"use strict";var fe=this&&this.__decorate||function(l,h,v,d){var o,s=arguments.length,u=s<3?h:d===null?d=Object.getOwnPropertyDescriptor(h,v):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(l,h,v,d);else for(var m=l.length-1;m>=0;m--)(o=l[m])&&(u=(s<3?o(u):s>3?o(h,v,u):o(h,v))||u);return s>3&&u&&Object.defineProperty(h,v,u),u},i=this&&this.__param||function(l,h){return function(v,d){h(v,d,l)}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.CharSizeService=void 0;var M=he(1),E=he(0),p=function(){function l(h,v,d){this._optionsService=d,this.width=0,this.height=0,this._onCharSizeChange=new E.EventEmitter,this._measureStrategy=new g(h,v,this._optionsService)}return Object.defineProperty(l.prototype,"hasValidSize",{get:function(){return this.width>0&&this.height>0},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"onCharSizeChange",{get:function(){return this._onCharSizeChange.event},enumerable:!1,configurable:!0}),l.prototype.measure=function(){var h=this._measureStrategy.measure();h.width===this.width&&h.height===this.height||(this.width=h.width,this.height=h.height,this._onCharSizeChange.fire())},l=fe([i(2,M.IOptionsService)],l)}();Q.CharSizeService=p;var g=function(){function l(h,v,d){this._document=h,this._parentElement=v,this._optionsService=d,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W",this._measureElement.setAttribute("aria-hidden","true"),this._parentElement.appendChild(this._measureElement)}return l.prototype.measure=function(){this._measureElement.style.fontFamily=this._optionsService.options.fontFamily,this._measureElement.style.fontSize=this._optionsService.options.fontSize+"px";var h=this._measureElement.getBoundingClientRect();return h.width!==0&&h.height!==0&&(this._result.width=h.width,this._result.height=Math.ceil(h.height)),this._result},l}()},function(Ue,Q,he){"use strict";var fe=this&&this.__decorate||function(g,l,h,v){var d,o=arguments.length,s=o<3?l:v===null?v=Object.getOwnPropertyDescriptor(l,h):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(g,l,h,v);else for(var u=g.length-1;u>=0;u--)(d=g[u])&&(s=(o<3?d(s):o>3?d(l,h,s):d(l,h))||s);return o>3&&s&&Object.defineProperty(l,h,s),s},i=this&&this.__param||function(g,l){return function(h,v){l(h,v,g)}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.MouseService=void 0;var M=he(5),E=he(30),p=function(){function g(l,h){this._renderService=l,this._charSizeService=h}return g.prototype.getCoords=function(l,h,v,d,o){return E.getCoords(l,h,v,d,this._charSizeService.hasValidSize,this._renderService.dimensions.actualCellWidth,this._renderService.dimensions.actualCellHeight,o)},g.prototype.getRawByteCoords=function(l,h,v,d){var o=this.getCoords(l,h,v,d);return E.getRawByteCoords(o)},g=fe([i(0,M.IRenderService),i(1,M.ICharSizeService)],g)}();Q.MouseService=p},function(Ue,Q,he){"use strict";var fe,i=this&&this.__extends||(fe=function(d,o){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,u){s.__proto__=u}||function(s,u){for(var m in u)u.hasOwnProperty(m)&&(s[m]=u[m])})(d,o)},function(d,o){function s(){this.constructor=d}fe(d,o),d.prototype=o===null?Object.create(o):(s.prototype=o.prototype,new s)}),M=this&&this.__decorate||function(d,o,s,u){var m,y=arguments.length,_=y<3?o:u===null?u=Object.getOwnPropertyDescriptor(o,s):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(d,o,s,u);else for(var x=d.length-1;x>=0;x--)(m=d[x])&&(_=(y<3?m(_):y>3?m(o,s,_):m(o,s))||_);return y>3&&_&&Object.defineProperty(o,s,_),_},E=this&&this.__param||function(d,o){return function(s,u){o(s,u,d)}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.Linkifier2=void 0;var p=he(1),g=he(0),l=he(2),h=he(7),v=function(d){function o(s){var u=d.call(this)||this;return u._bufferService=s,u._linkProviders=[],u._linkCacheDisposables=[],u._isMouseOut=!0,u._activeLine=-1,u._onShowLinkUnderline=u.register(new g.EventEmitter),u._onHideLinkUnderline=u.register(new g.EventEmitter),u.register(l.getDisposeArrayDisposable(u._linkCacheDisposables)),u}return i(o,d),Object.defineProperty(o.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),o.prototype.registerLinkProvider=function(s){var u=this;return this._linkProviders.push(s),{dispose:function(){var m=u._linkProviders.indexOf(s);m!==-1&&u._linkProviders.splice(m,1)}}},o.prototype.attachToDom=function(s,u,m){var y=this;this._element=s,this._mouseService=u,this._renderService=m,this.register(h.addDisposableDomListener(this._element,"mouseleave",function(){y._isMouseOut=!0,y._clearCurrentLink()})),this.register(h.addDisposableDomListener(this._element,"mousemove",this._onMouseMove.bind(this))),this.register(h.addDisposableDomListener(this._element,"click",this._onClick.bind(this)))},o.prototype._onMouseMove=function(s){if(this._lastMouseEvent=s,this._element&&this._mouseService){var u=this._positionFromMouseEvent(s,this._element,this._mouseService);if(u){this._isMouseOut=!1;for(var m=s.composedPath(),y=0;y<m.length;y++){var _=m[y];if(_.classList.contains("xterm"))break;if(_.classList.contains("xterm-hover"))return}this._lastBufferCell&&u.x===this._lastBufferCell.x&&u.y===this._lastBufferCell.y||(this._onHover(u),this._lastBufferCell=u)}}},o.prototype._onHover=function(s){if(this._activeLine!==s.y)return this._clearCurrentLink(),void this._askForLink(s,!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,s)||(this._clearCurrentLink(),this._askForLink(s,!0))},o.prototype._askForLink=function(s,u){var m=this;this._activeProviderReplies&&u||(this._activeProviderReplies=new Map,this._activeLine=s.y);var y=!1;this._linkProviders.forEach(function(_,x){var S;u?!((S=m._activeProviderReplies)===null||S===void 0)&&S.get(x)&&(y=m._checkLinkProviderResult(x,s,y)):_.provideLinks(s.y,function(w){var A,H;if(!m._isMouseOut){var R=w==null?void 0:w.map(function(F){return{link:F}});(A=m._activeProviderReplies)===null||A===void 0||A.set(x,R),y=m._checkLinkProviderResult(x,s,y),((H=m._activeProviderReplies)===null||H===void 0?void 0:H.size)===m._linkProviders.length&&m._removeIntersectingLinks(s.y,m._activeProviderReplies)}})})},o.prototype._removeIntersectingLinks=function(s,u){for(var m=new Set,y=0;y<u.size;y++){var _=u.get(y);if(_)for(var x=0;x<_.length;x++)for(var S=_[x],w=S.link.range.start.y<s?0:S.link.range.start.x,A=S.link.range.end.y>s?this._bufferService.cols:S.link.range.end.x,H=w;H<=A;H++){if(m.has(H)){_.splice(x--,1);break}m.add(H)}}},o.prototype._checkLinkProviderResult=function(s,u,m){var y,_=this;if(!this._activeProviderReplies)return m;for(var x=this._activeProviderReplies.get(s),S=!1,w=0;w<s;w++)this._activeProviderReplies.has(w)&&!this._activeProviderReplies.get(w)||(S=!0);if(!S&&x){var A=x.find(function(R){return _._linkAtPosition(R.link,u)});A&&(m=!0,this._handleNewLink(A))}if(this._activeProviderReplies.size===this._linkProviders.length&&!m)for(w=0;w<this._activeProviderReplies.size;w++){var H=(y=this._activeProviderReplies.get(w))===null||y===void 0?void 0:y.find(function(R){return _._linkAtPosition(R.link,u)});if(H){m=!0,this._handleNewLink(H);break}}return m},o.prototype._onClick=function(s){if(this._element&&this._mouseService&&this._currentLink){var u=this._positionFromMouseEvent(s,this._element,this._mouseService);u&&this._linkAtPosition(this._currentLink.link,u)&&this._currentLink.link.activate(s,this._currentLink.link.text)}},o.prototype._clearCurrentLink=function(s,u){this._element&&this._currentLink&&this._lastMouseEvent&&(!s||!u||this._currentLink.link.range.start.y>=s&&this._currentLink.link.range.end.y<=u)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,l.disposeArray(this._linkCacheDisposables))},o.prototype._handleNewLink=function(s){var u=this;if(this._element&&this._lastMouseEvent&&this._mouseService){var m=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);m&&this._linkAtPosition(s.link,m)&&(this._currentLink=s,this._currentLink.state={decorations:{underline:s.link.decorations===void 0||s.link.decorations.underline,pointerCursor:s.link.decorations===void 0||s.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,s.link,this._lastMouseEvent),s.link.decorations={},Object.defineProperties(s.link.decorations,{pointerCursor:{get:function(){var y,_;return(_=(y=u._currentLink)===null||y===void 0?void 0:y.state)===null||_===void 0?void 0:_.decorations.pointerCursor},set:function(y){var _,x;!((_=u._currentLink)===null||_===void 0)&&_.state&&u._currentLink.state.decorations.pointerCursor!==y&&(u._currentLink.state.decorations.pointerCursor=y,u._currentLink.state.isHovered&&((x=u._element)===null||x===void 0||x.classList.toggle("xterm-cursor-pointer",y)))}},underline:{get:function(){var y,_;return(_=(y=u._currentLink)===null||y===void 0?void 0:y.state)===null||_===void 0?void 0:_.decorations.underline},set:function(y){var _,x,S;!((_=u._currentLink)===null||_===void 0)&&_.state&&((S=(x=u._currentLink)===null||x===void 0?void 0:x.state)===null||S===void 0?void 0:S.decorations.underline)!==y&&(u._currentLink.state.decorations.underline=y,u._currentLink.state.isHovered&&u._fireUnderlineEvent(s.link,y))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedBufferChange(function(y){var _=y.start===0?0:y.start+1+u._bufferService.buffer.ydisp;u._clearCurrentLink(_,y.end+1+u._bufferService.buffer.ydisp)})))}},o.prototype._linkHover=function(s,u,m){var y;!((y=this._currentLink)===null||y===void 0)&&y.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(u,!0),this._currentLink.state.decorations.pointerCursor&&s.classList.add("xterm-cursor-pointer")),u.hover&&u.hover(m,u.text)},o.prototype._fireUnderlineEvent=function(s,u){var m=s.range,y=this._bufferService.buffer.ydisp,_=this._createLinkUnderlineEvent(m.start.x-1,m.start.y-y-1,m.end.x,m.end.y-y-1,void 0);(u?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(_)},o.prototype._linkLeave=function(s,u,m){var y;!((y=this._currentLink)===null||y===void 0)&&y.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(u,!1),this._currentLink.state.decorations.pointerCursor&&s.classList.remove("xterm-cursor-pointer")),u.leave&&u.leave(m,u.text)},o.prototype._linkAtPosition=function(s,u){var m=s.range.start.y===s.range.end.y,y=s.range.start.y<u.y,_=s.range.end.y>u.y;return(m&&s.range.start.x<=u.x&&s.range.end.x>=u.x||y&&s.range.end.x>=u.x||_&&s.range.start.x<=u.x||y&&_)&&s.range.start.y<=u.y&&s.range.end.y>=u.y},o.prototype._positionFromMouseEvent=function(s,u,m){var y=m.getCoords(s,u,this._bufferService.cols,this._bufferService.rows);if(y)return{x:y[0],y:y[1]+this._bufferService.buffer.ydisp}},o.prototype._createLinkUnderlineEvent=function(s,u,m,y,_){return{x1:s,y1:u,x2:m,y2:y,cols:this._bufferService.cols,fg:_}},o=M([E(0,p.IBufferService)],o)}(l.Disposable);Q.Linkifier2=v},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.CoreBrowserService=void 0;var fe=function(){function i(M){this._textarea=M}return Object.defineProperty(i.prototype,"isFocused",{get:function(){return document.activeElement===this._textarea&&document.hasFocus()},enumerable:!1,configurable:!0}),i}();Q.CoreBrowserService=fe},function(Ue,Q,he){"use strict";var fe,i=this&&this.__extends||(fe=function(w,A){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(H,R){H.__proto__=R}||function(H,R){for(var F in R)R.hasOwnProperty(F)&&(H[F]=R[F])})(w,A)},function(w,A){function H(){this.constructor=w}fe(w,A),w.prototype=A===null?Object.create(A):(H.prototype=A.prototype,new H)});Object.defineProperty(Q,"__esModule",{value:!0}),Q.CoreTerminal=void 0;var M=he(2),E=he(1),p=he(66),g=he(67),l=he(68),h=he(74),v=he(75),d=he(0),o=he(76),s=he(77),u=he(78),m=he(80),y=he(81),_=he(19),x=he(82),S=function(w){function A(H){var R=w.call(this)||this;return R._onBinary=new d.EventEmitter,R._onData=new d.EventEmitter,R._onLineFeed=new d.EventEmitter,R._onResize=new d.EventEmitter,R._onScroll=new d.EventEmitter,R._instantiationService=new p.InstantiationService,R.optionsService=new h.OptionsService(H),R._instantiationService.setService(E.IOptionsService,R.optionsService),R._bufferService=R.register(R._instantiationService.createInstance(l.BufferService)),R._instantiationService.setService(E.IBufferService,R._bufferService),R._logService=R._instantiationService.createInstance(g.LogService),R._instantiationService.setService(E.ILogService,R._logService),R._coreService=R.register(R._instantiationService.createInstance(v.CoreService,function(){return R.scrollToBottom()})),R._instantiationService.setService(E.ICoreService,R._coreService),R._coreMouseService=R._instantiationService.createInstance(o.CoreMouseService),R._instantiationService.setService(E.ICoreMouseService,R._coreMouseService),R._dirtyRowService=R._instantiationService.createInstance(s.DirtyRowService),R._instantiationService.setService(E.IDirtyRowService,R._dirtyRowService),R.unicodeService=R._instantiationService.createInstance(u.UnicodeService),R._instantiationService.setService(E.IUnicodeService,R.unicodeService),R._charsetService=R._instantiationService.createInstance(m.CharsetService),R._instantiationService.setService(E.ICharsetService,R._charsetService),R._inputHandler=new _.InputHandler(R._bufferService,R._charsetService,R._coreService,R._dirtyRowService,R._logService,R.optionsService,R._coreMouseService,R.unicodeService),R.register(d.forwardEvent(R._inputHandler.onLineFeed,R._onLineFeed)),R.register(R._inputHandler),R.register(d.forwardEvent(R._bufferService.onResize,R._onResize)),R.register(d.forwardEvent(R._coreService.onData,R._onData)),R.register(d.forwardEvent(R._coreService.onBinary,R._onBinary)),R.register(R.optionsService.onOptionChange(function(F){return R._updateOptions(F)})),R._writeBuffer=new x.WriteBuffer(function(F){return R._inputHandler.parse(F)}),R}return i(A,w),Object.defineProperty(A.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"cols",{get:function(){return this._bufferService.cols},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"rows",{get:function(){return this._bufferService.rows},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"buffers",{get:function(){return this._bufferService.buffers},enumerable:!1,configurable:!0}),A.prototype.dispose=function(){var H;this._isDisposed||(w.prototype.dispose.call(this),(H=this._windowsMode)===null||H===void 0||H.dispose(),this._windowsMode=void 0)},A.prototype.write=function(H,R){this._writeBuffer.write(H,R)},A.prototype.writeSync=function(H){this._writeBuffer.writeSync(H)},A.prototype.resize=function(H,R){isNaN(H)||isNaN(R)||(H=Math.max(H,l.MINIMUM_COLS),R=Math.max(R,l.MINIMUM_ROWS),this._bufferService.resize(H,R))},A.prototype.scroll=function(H,R){R===void 0&&(R=!1);var F,D=this._bufferService.buffer;(F=this._cachedBlankLine)&&F.length===this.cols&&F.getFg(0)===H.fg&&F.getBg(0)===H.bg||(F=D.getBlankLine(H,R),this._cachedBlankLine=F),F.isWrapped=R;var B=D.ybase+D.scrollTop,P=D.ybase+D.scrollBottom;if(D.scrollTop===0){var U=D.lines.isFull;P===D.lines.length-1?U?D.lines.recycle().copyFrom(F):D.lines.push(F.clone()):D.lines.splice(P+1,0,F.clone()),U?this._bufferService.isUserScrolling&&(D.ydisp=Math.max(D.ydisp-1,0)):(D.ybase++,this._bufferService.isUserScrolling||D.ydisp++)}else{var G=P-B+1;D.lines.shiftElements(B+1,G-1,-1),D.lines.set(P,F.clone())}this._bufferService.isUserScrolling||(D.ydisp=D.ybase),this._dirtyRowService.markRangeDirty(D.scrollTop,D.scrollBottom),this._onScroll.fire(D.ydisp)},A.prototype.scrollLines=function(H,R){var F=this._bufferService.buffer;if(H<0){if(F.ydisp===0)return;this._bufferService.isUserScrolling=!0}else H+F.ydisp>=F.ybase&&(this._bufferService.isUserScrolling=!1);var D=F.ydisp;F.ydisp=Math.max(Math.min(F.ydisp+H,F.ybase),0),D!==F.ydisp&&(R||this._onScroll.fire(F.ydisp))},A.prototype.scrollPages=function(H){this.scrollLines(H*(this.rows-1))},A.prototype.scrollToTop=function(){this.scrollLines(-this._bufferService.buffer.ydisp)},A.prototype.scrollToBottom=function(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)},A.prototype.scrollToLine=function(H){var R=H-this._bufferService.buffer.ydisp;R!==0&&this.scrollLines(R)},A.prototype.addEscHandler=function(H,R){return this._inputHandler.addEscHandler(H,R)},A.prototype.addDcsHandler=function(H,R){return this._inputHandler.addDcsHandler(H,R)},A.prototype.addCsiHandler=function(H,R){return this._inputHandler.addCsiHandler(H,R)},A.prototype.addOscHandler=function(H,R){return this._inputHandler.addOscHandler(H,R)},A.prototype._setup=function(){this.optionsService.options.windowsMode&&this._enableWindowsMode()},A.prototype.reset=function(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this._coreService.reset(),this._coreMouseService.reset()},A.prototype._updateOptions=function(H){var R;switch(H){case"scrollback":this.buffers.resize(this.cols,this.rows);break;case"windowsMode":this.optionsService.options.windowsMode?this._enableWindowsMode():((R=this._windowsMode)===null||R===void 0||R.dispose(),this._windowsMode=void 0)}},A.prototype._enableWindowsMode=function(){var H=this;if(!this._windowsMode){var R=[];R.push(this.onLineFeed(y.updateWindowsModeWrappedState.bind(null,this._bufferService))),R.push(this.addCsiHandler({final:"H"},function(){return y.updateWindowsModeWrappedState(H._bufferService),!1})),this._windowsMode={dispose:function(){for(var F=0,D=R;F<D.length;F++)D[F].dispose()}}}},A}(M.Disposable);Q.CoreTerminal=S},function(Ue,Q,he){"use strict";var fe=this&&this.__spreadArrays||function(){for(var g=0,l=0,h=arguments.length;l<h;l++)g+=arguments[l].length;var v=Array(g),d=0;for(l=0;l<h;l++)for(var o=arguments[l],s=0,u=o.length;s<u;s++,d++)v[d]=o[s];return v};Object.defineProperty(Q,"__esModule",{value:!0}),Q.InstantiationService=Q.ServiceCollection=void 0;var i=he(1),M=he(14),E=function(){function g(){for(var l=[],h=0;h<arguments.length;h++)l[h]=arguments[h];this._entries=new Map;for(var v=0,d=l;v<d.length;v++){var o=d[v],s=o[0],u=o[1];this.set(s,u)}}return g.prototype.set=function(l,h){var v=this._entries.get(l);return this._entries.set(l,h),v},g.prototype.forEach=function(l){this._entries.forEach(function(h,v){return l(v,h)})},g.prototype.has=function(l){return this._entries.has(l)},g.prototype.get=function(l){return this._entries.get(l)},g}();Q.ServiceCollection=E;var p=function(){function g(){this._services=new E,this._services.set(i.IInstantiationService,this)}return g.prototype.setService=function(l,h){this._services.set(l,h)},g.prototype.getService=function(l){return this._services.get(l)},g.prototype.createInstance=function(l){for(var h=[],v=1;v<arguments.length;v++)h[v-1]=arguments[v];for(var d=M.getServiceDependencies(l).sort(function(x,S){return x.index-S.index}),o=[],s=0,u=d;s<u.length;s++){var m=u[s],y=this._services.get(m.id);if(!y)throw new Error("[createInstance] "+l.name+" depends on UNKNOWN service "+m.id+".");o.push(y)}var _=d.length>0?d[0].index:h.length;if(h.length!==_)throw new Error("[createInstance] First service dependency of "+l.name+" at position "+(_+1)+" conflicts with "+h.length+" static arguments");return new(l.bind.apply(l,fe([void 0],fe(h,o))))},g}();Q.InstantiationService=p},function(Ue,Q,he){"use strict";var fe=this&&this.__decorate||function(h,v,d,o){var s,u=arguments.length,m=u<3?v:o===null?o=Object.getOwnPropertyDescriptor(v,d):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(h,v,d,o);else for(var y=h.length-1;y>=0;y--)(s=h[y])&&(m=(u<3?s(m):u>3?s(v,d,m):s(v,d))||m);return u>3&&m&&Object.defineProperty(v,d,m),m},i=this&&this.__param||function(h,v){return function(d,o){v(d,o,h)}},M=this&&this.__spreadArrays||function(){for(var h=0,v=0,d=arguments.length;v<d;v++)h+=arguments[v].length;var o=Array(h),s=0;for(v=0;v<d;v++)for(var u=arguments[v],m=0,y=u.length;m<y;m++,s++)o[s]=u[m];return o};Object.defineProperty(Q,"__esModule",{value:!0}),Q.LogService=Q.LogLevel=void 0;var E,p=he(1);(function(h){h[h.DEBUG=0]="DEBUG",h[h.INFO=1]="INFO",h[h.WARN=2]="WARN",h[h.ERROR=3]="ERROR",h[h.OFF=4]="OFF"})(E=Q.LogLevel||(Q.LogLevel={}));var g={debug:E.DEBUG,info:E.INFO,warn:E.WARN,error:E.ERROR,off:E.OFF},l=function(){function h(v){var d=this;this._optionsService=v,this._updateLogLevel(),this._optionsService.onOptionChange(function(o){o==="logLevel"&&d._updateLogLevel()})}return h.prototype._updateLogLevel=function(){this._logLevel=g[this._optionsService.options.logLevel]},h.prototype._evalLazyOptionalParams=function(v){for(var d=0;d<v.length;d++)typeof v[d]=="function"&&(v[d]=v[d]())},h.prototype._log=function(v,d,o){this._evalLazyOptionalParams(o),v.call.apply(v,M([console,"xterm.js: "+d],o))},h.prototype.debug=function(v){for(var d=[],o=1;o<arguments.length;o++)d[o-1]=arguments[o];this._logLevel<=E.DEBUG&&this._log(console.log,v,d)},h.prototype.info=function(v){for(var d=[],o=1;o<arguments.length;o++)d[o-1]=arguments[o];this._logLevel<=E.INFO&&this._log(console.info,v,d)},h.prototype.warn=function(v){for(var d=[],o=1;o<arguments.length;o++)d[o-1]=arguments[o];this._logLevel<=E.WARN&&this._log(console.warn,v,d)},h.prototype.error=function(v){for(var d=[],o=1;o<arguments.length;o++)d[o-1]=arguments[o];this._logLevel<=E.ERROR&&this._log(console.error,v,d)},h=fe([i(0,p.IOptionsService)],h)}();Q.LogService=l},function(Ue,Q,he){"use strict";var fe,i=this&&this.__extends||(fe=function(d,o){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,u){s.__proto__=u}||function(s,u){for(var m in u)u.hasOwnProperty(m)&&(s[m]=u[m])})(d,o)},function(d,o){function s(){this.constructor=d}fe(d,o),d.prototype=o===null?Object.create(o):(s.prototype=o.prototype,new s)}),M=this&&this.__decorate||function(d,o,s,u){var m,y=arguments.length,_=y<3?o:u===null?u=Object.getOwnPropertyDescriptor(o,s):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(d,o,s,u);else for(var x=d.length-1;x>=0;x--)(m=d[x])&&(_=(y<3?m(_):y>3?m(o,s,_):m(o,s))||_);return y>3&&_&&Object.defineProperty(o,s,_),_},E=this&&this.__param||function(d,o){return function(s,u){o(s,u,d)}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.BufferService=Q.MINIMUM_ROWS=Q.MINIMUM_COLS=void 0;var p=he(1),g=he(69),l=he(0),h=he(2);Q.MINIMUM_COLS=2,Q.MINIMUM_ROWS=1;var v=function(d){function o(s){var u=d.call(this)||this;return u._optionsService=s,u.isUserScrolling=!1,u._onResize=new l.EventEmitter,u.cols=Math.max(s.options.cols,Q.MINIMUM_COLS),u.rows=Math.max(s.options.rows,Q.MINIMUM_ROWS),u.buffers=new g.BufferSet(s,u),u}return i(o,d),Object.defineProperty(o.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),o.prototype.dispose=function(){d.prototype.dispose.call(this),this.buffers.dispose()},o.prototype.resize=function(s,u){this.cols=s,this.rows=u,this.buffers.resize(s,u),this.buffers.setupTabStops(this.cols),this._onResize.fire({cols:s,rows:u})},o.prototype.reset=function(){this.buffers.dispose(),this.buffers=new g.BufferSet(this._optionsService,this),this.isUserScrolling=!1},o=M([E(0,p.IOptionsService)],o)}(h.Disposable);Q.BufferService=v},function(Ue,Q,he){"use strict";var fe,i=this&&this.__extends||(fe=function(g,l){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,v){h.__proto__=v}||function(h,v){for(var d in v)v.hasOwnProperty(d)&&(h[d]=v[d])})(g,l)},function(g,l){function h(){this.constructor=g}fe(g,l),g.prototype=l===null?Object.create(l):(h.prototype=l.prototype,new h)});Object.defineProperty(Q,"__esModule",{value:!0}),Q.BufferSet=void 0;var M=he(70),E=he(0),p=function(g){function l(h,v){var d=g.call(this)||this;return d._onBufferActivate=d.register(new E.EventEmitter),d._normal=new M.Buffer(!0,h,v),d._normal.fillViewportRows(),d._alt=new M.Buffer(!1,h,v),d._activeBuffer=d._normal,d.setupTabStops(),d}return i(l,g),Object.defineProperty(l.prototype,"onBufferActivate",{get:function(){return this._onBufferActivate.event},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"alt",{get:function(){return this._alt},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"normal",{get:function(){return this._normal},enumerable:!1,configurable:!0}),l.prototype.activateNormalBuffer=function(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))},l.prototype.activateAltBuffer=function(h){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(h),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))},l.prototype.resize=function(h,v){this._normal.resize(h,v),this._alt.resize(h,v)},l.prototype.setupTabStops=function(h){this._normal.setupTabStops(h),this._alt.setupTabStops(h)},l}(he(2).Disposable);Q.BufferSet=p},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.BufferStringIterator=Q.Buffer=Q.MAX_BUFFER_SIZE=void 0;var fe=he(71),i=he(16),M=he(4),E=he(3),p=he(72),g=he(73),l=he(20),h=he(6);Q.MAX_BUFFER_SIZE=4294967295;var v=function(){function o(s,u,m){this._hasScrollback=s,this._optionsService=u,this._bufferService=m,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.savedY=0,this.savedX=0,this.savedCurAttrData=i.DEFAULT_ATTR_DATA.clone(),this.savedCharset=l.DEFAULT_CHARSET,this.markers=[],this._nullCell=M.CellData.fromCharData([0,E.NULL_CELL_CHAR,E.NULL_CELL_WIDTH,E.NULL_CELL_CODE]),this._whitespaceCell=M.CellData.fromCharData([0,E.WHITESPACE_CELL_CHAR,E.WHITESPACE_CELL_WIDTH,E.WHITESPACE_CELL_CODE]),this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new fe.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}return o.prototype.getNullCell=function(s){return s?(this._nullCell.fg=s.fg,this._nullCell.bg=s.bg,this._nullCell.extended=s.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell},o.prototype.getWhitespaceCell=function(s){return s?(this._whitespaceCell.fg=s.fg,this._whitespaceCell.bg=s.bg,this._whitespaceCell.extended=s.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell},o.prototype.getBlankLine=function(s,u){return new i.BufferLine(this._bufferService.cols,this.getNullCell(s),u)},Object.defineProperty(o.prototype,"hasScrollback",{get:function(){return this._hasScrollback&&this.lines.maxLength>this._rows},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"isCursorInViewport",{get:function(){var s=this.ybase+this.y-this.ydisp;return s>=0&&s<this._rows},enumerable:!1,configurable:!0}),o.prototype._getCorrectBufferLength=function(s){if(!this._hasScrollback)return s;var u=s+this._optionsService.options.scrollback;return u>Q.MAX_BUFFER_SIZE?Q.MAX_BUFFER_SIZE:u},o.prototype.fillViewportRows=function(s){if(this.lines.length===0){s===void 0&&(s=i.DEFAULT_ATTR_DATA);for(var u=this._rows;u--;)this.lines.push(this.getBlankLine(s))}},o.prototype.clear=function(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new fe.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()},o.prototype.resize=function(s,u){var m=this.getNullCell(i.DEFAULT_ATTR_DATA),y=this._getCorrectBufferLength(u);if(y>this.lines.maxLength&&(this.lines.maxLength=y),this.lines.length>0){if(this._cols<s)for(var _=0;_<this.lines.length;_++)this.lines.get(_).resize(s,m);var x=0;if(this._rows<u)for(var S=this._rows;S<u;S++)this.lines.length<u+this.ybase&&(this._optionsService.options.windowsMode?this.lines.push(new i.BufferLine(s,m)):this.ybase>0&&this.lines.length<=this.ybase+this.y+x+1?(this.ybase--,x++,this.ydisp>0&&this.ydisp--):this.lines.push(new i.BufferLine(s,m)));else for(S=this._rows;S>u;S--)this.lines.length>u+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(y<this.lines.maxLength){var w=this.lines.length-y;w>0&&(this.lines.trimStart(w),this.ybase=Math.max(this.ybase-w,0),this.ydisp=Math.max(this.ydisp-w,0),this.savedY=Math.max(this.savedY-w,0)),this.lines.maxLength=y}this.x=Math.min(this.x,s-1),this.y=Math.min(this.y,u-1),x&&(this.y+=x),this.savedX=Math.min(this.savedX,s-1),this.scrollTop=0}if(this.scrollBottom=u-1,this._isReflowEnabled&&(this._reflow(s,u),this._cols>s))for(_=0;_<this.lines.length;_++)this.lines.get(_).resize(s,m);this._cols=s,this._rows=u},Object.defineProperty(o.prototype,"_isReflowEnabled",{get:function(){return this._hasScrollback&&!this._optionsService.options.windowsMode},enumerable:!1,configurable:!0}),o.prototype._reflow=function(s,u){this._cols!==s&&(s>this._cols?this._reflowLarger(s,u):this._reflowSmaller(s,u))},o.prototype._reflowLarger=function(s,u){var m=p.reflowLargerGetLinesToRemove(this.lines,this._cols,s,this.ybase+this.y,this.getNullCell(i.DEFAULT_ATTR_DATA));if(m.length>0){var y=p.reflowLargerCreateNewLayout(this.lines,m);p.reflowLargerApplyNewLayout(this.lines,y.layout),this._reflowLargerAdjustViewport(s,u,y.countRemoved)}},o.prototype._reflowLargerAdjustViewport=function(s,u,m){for(var y=this.getNullCell(i.DEFAULT_ATTR_DATA),_=m;_-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<u&&this.lines.push(new i.BufferLine(s,y))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-m,0)},o.prototype._reflowSmaller=function(s,u){for(var m=this.getNullCell(i.DEFAULT_ATTR_DATA),y=[],_=0,x=this.lines.length-1;x>=0;x--){var S=this.lines.get(x);if(!(!S||!S.isWrapped&&S.getTrimmedLength()<=s)){for(var w=[S];S.isWrapped&&x>0;)S=this.lines.get(--x),w.unshift(S);var A=this.ybase+this.y;if(!(A>=x&&A<x+w.length)){var H=w[w.length-1].getTrimmedLength(),R=p.reflowSmallerGetNewLineLengths(w,this._cols,s),F=R.length-w.length,D=void 0;D=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+F):Math.max(0,this.lines.length-this.lines.maxLength+F);for(var B=[],P=0;P<F;P++){var U=this.getBlankLine(i.DEFAULT_ATTR_DATA,!0);B.push(U)}B.length>0&&(y.push({start:x+w.length+_,newLines:B}),_+=B.length),w.push.apply(w,B);var G=R.length-1,ee=R[G];ee===0&&(ee=R[--G]);for(var K=w.length-F-1,Z=H;K>=0;){var $=Math.min(Z,ee);if(w[G].copyCellsFrom(w[K],Z-$,ee-$,$,!0),(ee-=$)===0&&(ee=R[--G]),(Z-=$)===0){K--;var oe=Math.max(K,0);Z=p.getWrappedLineTrimmedLength(w,oe,this._cols)}}for(P=0;P<w.length;P++)R[P]<s&&w[P].setCell(R[P],m);for(var ae=F-D;ae-- >0;)this.ybase===0?this.y<u-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+_)-u&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+F,this.ybase+u-1)}}}if(y.length>0){var ye=[],Y=[];for(P=0;P<this.lines.length;P++)Y.push(this.lines.get(P));var le=this.lines.length,xe=le-1,Ce=0,we=y[Ce];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+_);var Le=0;for(P=Math.min(this.lines.maxLength-1,le+_-1);P>=0;P--)if(we&&we.start>xe+Le){for(var de=we.newLines.length-1;de>=0;de--)this.lines.set(P--,we.newLines[de]);P++,ye.push({index:xe+1,amount:we.newLines.length}),Le+=we.newLines.length,we=y[++Ce]}else this.lines.set(P,Y[xe--]);var be=0;for(P=ye.length-1;P>=0;P--)ye[P].index+=be,this.lines.onInsertEmitter.fire(ye[P]),be+=ye[P].amount;var Te=Math.max(0,le+_-this.lines.maxLength);Te>0&&this.lines.onTrimEmitter.fire(Te)}},o.prototype.stringIndexToBufferIndex=function(s,u,m){for(m===void 0&&(m=!1);u;){var y=this.lines.get(s);if(!y)return[-1,-1];for(var _=m?y.getTrimmedLength():y.length,x=0;x<_;++x)if(y.get(x)[E.CHAR_DATA_WIDTH_INDEX]&&(u-=y.get(x)[E.CHAR_DATA_CHAR_INDEX].length||1),u<0)return[s,x];s++}return[s,0]},o.prototype.translateBufferLineToString=function(s,u,m,y){m===void 0&&(m=0);var _=this.lines.get(s);return _?_.translateToString(u,m,y):""},o.prototype.getWrappedRangeForLine=function(s){for(var u=s,m=s;u>0&&this.lines.get(u).isWrapped;)u--;for(;m+1<this.lines.length&&this.lines.get(m+1).isWrapped;)m++;return{first:u,last:m}},o.prototype.setupTabStops=function(s){for(s!=null?this.tabs[s]||(s=this.prevStop(s)):(this.tabs={},s=0);s<this._cols;s+=this._optionsService.options.tabStopWidth)this.tabs[s]=!0},o.prototype.prevStop=function(s){for(s==null&&(s=this.x);!this.tabs[--s]&&s>0;);return s>=this._cols?this._cols-1:s<0?0:s},o.prototype.nextStop=function(s){for(s==null&&(s=this.x);!this.tabs[++s]&&s<this._cols;);return s>=this._cols?this._cols-1:s<0?0:s},o.prototype.addMarker=function(s){var u=this,m=new g.Marker(s);return this.markers.push(m),m.register(this.lines.onTrim(function(y){m.line-=y,m.line<0&&m.dispose()})),m.register(this.lines.onInsert(function(y){m.line>=y.index&&(m.line+=y.amount)})),m.register(this.lines.onDelete(function(y){m.line>=y.index&&m.line<y.index+y.amount&&m.dispose(),m.line>y.index&&(m.line-=y.amount)})),m.register(m.onDispose(function(){return u._removeMarker(m)})),m},o.prototype._removeMarker=function(s){this.markers.splice(this.markers.indexOf(s),1)},o.prototype.iterator=function(s,u,m,y,_){return new d(this,s,u,m,y,_)},o}();Q.Buffer=v;var d=function(){function o(s,u,m,y,_,x){m===void 0&&(m=0),y===void 0&&(y=s.lines.length),_===void 0&&(_=0),x===void 0&&(x=0),this._buffer=s,this._trimRight=u,this._startIndex=m,this._endIndex=y,this._startOverscan=_,this._endOverscan=x,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}return o.prototype.hasNext=function(){return this._current<this._endIndex},o.prototype.next=function(){var s=this._buffer.getWrappedRangeForLine(this._current);s.first<this._startIndex-this._startOverscan&&(s.first=this._startIndex-this._startOverscan),s.last>this._endIndex+this._endOverscan&&(s.last=this._endIndex+this._endOverscan),s.first=Math.max(s.first,0),s.last=Math.min(s.last,this._buffer.lines.length);for(var u="",m=s.first;m<=s.last;++m)u+=this._buffer.translateBufferLineToString(m,this._trimRight);return this._current=s.last+1,{range:s,content:u}},o}();Q.BufferStringIterator=d},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.CircularList=void 0;var fe=he(0),i=function(){function M(E){this._maxLength=E,this.onDeleteEmitter=new fe.EventEmitter,this.onInsertEmitter=new fe.EventEmitter,this.onTrimEmitter=new fe.EventEmitter,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}return Object.defineProperty(M.prototype,"onDelete",{get:function(){return this.onDeleteEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"onInsert",{get:function(){return this.onInsertEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"onTrim",{get:function(){return this.onTrimEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"maxLength",{get:function(){return this._maxLength},set:function(E){if(this._maxLength!==E){for(var p=new Array(E),g=0;g<Math.min(E,this.length);g++)p[g]=this._array[this._getCyclicIndex(g)];this._array=p,this._maxLength=E,this._startIndex=0}},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"length",{get:function(){return this._length},set:function(E){if(E>this._length)for(var p=this._length;p<E;p++)this._array[p]=void 0;this._length=E},enumerable:!1,configurable:!0}),M.prototype.get=function(E){return this._array[this._getCyclicIndex(E)]},M.prototype.set=function(E,p){this._array[this._getCyclicIndex(E)]=p},M.prototype.push=function(E){this._array[this._getCyclicIndex(this._length)]=E,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++},M.prototype.recycle=function(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]},Object.defineProperty(M.prototype,"isFull",{get:function(){return this._length===this._maxLength},enumerable:!1,configurable:!0}),M.prototype.pop=function(){return this._array[this._getCyclicIndex(this._length---1)]},M.prototype.splice=function(E,p){for(var g=[],l=2;l<arguments.length;l++)g[l-2]=arguments[l];if(p){for(var h=E;h<this._length-p;h++)this._array[this._getCyclicIndex(h)]=this._array[this._getCyclicIndex(h+p)];this._length-=p}for(h=this._length-1;h>=E;h--)this._array[this._getCyclicIndex(h+g.length)]=this._array[this._getCyclicIndex(h)];for(h=0;h<g.length;h++)this._array[this._getCyclicIndex(E+h)]=g[h];if(this._length+g.length>this._maxLength){var v=this._length+g.length-this._maxLength;this._startIndex+=v,this._length=this._maxLength,this.onTrimEmitter.fire(v)}else this._length+=g.length},M.prototype.trimStart=function(E){E>this._length&&(E=this._length),this._startIndex+=E,this._length-=E,this.onTrimEmitter.fire(E)},M.prototype.shiftElements=function(E,p,g){if(!(p<=0)){if(E<0||E>=this._length)throw new Error("start argument out of range");if(E+g<0)throw new Error("Cannot shift elements in list beyond index 0");if(g>0){for(var l=p-1;l>=0;l--)this.set(E+l+g,this.get(E+l));var h=E+p+g-this._length;if(h>0)for(this._length+=h;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(l=0;l<p;l++)this.set(E+l+g,this.get(E+l))}},M.prototype._getCyclicIndex=function(E){return(this._startIndex+E)%this._maxLength},M}();Q.CircularList=i},function(Ue,Q,he){"use strict";function fe(i,M,E){if(M===i.length-1)return i[M].getTrimmedLength();var p=!i[M].hasContent(E-1)&&i[M].getWidth(E-1)===1,g=i[M+1].getWidth(0)===2;return p&&g?E-1:E}Object.defineProperty(Q,"__esModule",{value:!0}),Q.getWrappedLineTrimmedLength=Q.reflowSmallerGetNewLineLengths=Q.reflowLargerApplyNewLayout=Q.reflowLargerCreateNewLayout=Q.reflowLargerGetLinesToRemove=void 0,Q.reflowLargerGetLinesToRemove=function(i,M,E,p,g){for(var l=[],h=0;h<i.length-1;h++){var v=h,d=i.get(++v);if(d.isWrapped){for(var o=[i.get(h)];v<i.length&&d.isWrapped;)o.push(d),d=i.get(++v);if(p>=h&&p<v)h+=o.length-1;else{for(var s=0,u=fe(o,s,M),m=1,y=0;m<o.length;){var _=fe(o,m,M),x=_-y,S=E-u,w=Math.min(x,S);o[s].copyCellsFrom(o[m],y,u,w,!1),(u+=w)===E&&(s++,u=0),(y+=w)===_&&(m++,y=0),u===0&&s!==0&&o[s-1].getWidth(E-1)===2&&(o[s].copyCellsFrom(o[s-1],E-1,u++,1,!1),o[s-1].setCell(E-1,g))}o[s].replaceCells(u,E,g);for(var A=0,H=o.length-1;H>0&&(H>s||o[H].getTrimmedLength()===0);H--)A++;A>0&&(l.push(h+o.length-A),l.push(A)),h+=o.length-1}}}return l},Q.reflowLargerCreateNewLayout=function(i,M){for(var E=[],p=0,g=M[p],l=0,h=0;h<i.length;h++)if(g===h){var v=M[++p];i.onDeleteEmitter.fire({index:h-l,amount:v}),h+=v-1,l+=v,g=M[++p]}else E.push(h);return{layout:E,countRemoved:l}},Q.reflowLargerApplyNewLayout=function(i,M){for(var E=[],p=0;p<M.length;p++)E.push(i.get(M[p]));for(p=0;p<E.length;p++)i.set(p,E[p]);i.length=M.length},Q.reflowSmallerGetNewLineLengths=function(i,M,E){for(var p=[],g=i.map(function(u,m){return fe(i,m,M)}).reduce(function(u,m){return u+m}),l=0,h=0,v=0;v<g;){if(g-v<E){p.push(g-v);break}l+=E;var d=fe(i,h,M);l>d&&(l-=d,h++);var o=i[h].getWidth(l-1)===2;o&&l--;var s=o?E-1:E;p.push(s),v+=s}return p},Q.getWrappedLineTrimmedLength=fe},function(Ue,Q,he){"use strict";var fe,i=this&&this.__extends||(fe=function(p,g){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,h){l.__proto__=h}||function(l,h){for(var v in h)h.hasOwnProperty(v)&&(l[v]=h[v])})(p,g)},function(p,g){function l(){this.constructor=p}fe(p,g),p.prototype=g===null?Object.create(g):(l.prototype=g.prototype,new l)});Object.defineProperty(Q,"__esModule",{value:!0}),Q.Marker=void 0;var M=he(0),E=function(p){function g(l){var h=p.call(this)||this;return h.line=l,h._id=g._nextId++,h.isDisposed=!1,h._onDispose=new M.EventEmitter,h}return i(g,p),Object.defineProperty(g.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"onDispose",{get:function(){return this._onDispose.event},enumerable:!1,configurable:!0}),g.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire())},g._nextId=1,g}(he(2).Disposable);Q.Marker=E},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.OptionsService=Q.DEFAULT_OPTIONS=Q.DEFAULT_BELL_SOUND=void 0;var fe=he(0),i=he(11),M=he(33);Q.DEFAULT_BELL_SOUND="data:audio/mp3;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjMyLjEwNAAAAAAAAAAAAAAA//tQxAADB8AhSmxhIIEVCSiJrDCQBTcu3UrAIwUdkRgQbFAZC1CQEwTJ9mjRvBA4UOLD8nKVOWfh+UlK3z/177OXrfOdKl7pyn3Xf//WreyTRUoAWgBgkOAGbZHBgG1OF6zM82DWbZaUmMBptgQhGjsyYqc9ae9XFz280948NMBWInljyzsNRFLPWdnZGWrddDsjK1unuSrVN9jJsK8KuQtQCtMBjCEtImISdNKJOopIpBFpNSMbIHCSRpRR5iakjTiyzLhchUUBwCgyKiweBv/7UsQbg8isVNoMPMjAAAA0gAAABEVFGmgqK////9bP/6XCykxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",Q.DEFAULT_OPTIONS=Object.freeze({cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,bellSound:Q.DEFAULT_BELL_SOUND,bellStyle:"none",drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,linkTooltipHoverDuration:500,letterSpacing:0,logLevel:"info",scrollback:1e3,scrollSensitivity:1,screenReaderMode:!1,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!0,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:i.isMac,rendererType:"canvas",windowOptions:{},windowsMode:!1,wordSeparator:" ()[]{}',\"`",convertEol:!1,termName:"xterm",cancelEvents:!1});var E=["cols","rows"],p=function(){function g(l){this._onOptionChange=new fe.EventEmitter,this.options=M.clone(Q.DEFAULT_OPTIONS);for(var h=0,v=Object.keys(l);h<v.length;h++){var d=v[h];if(d in this.options){var o=l[d];this.options[d]=o}}}return Object.defineProperty(g.prototype,"onOptionChange",{get:function(){return this._onOptionChange.event},enumerable:!1,configurable:!0}),g.prototype.setOption=function(l,h){if(!(l in Q.DEFAULT_OPTIONS))throw new Error('No option with key "'+l+'"');if(E.indexOf(l)!==-1)throw new Error('Option "'+l+'" can only be set in the constructor');this.options[l]!==h&&(h=this._sanitizeAndValidateOption(l,h),this.options[l]!==h&&(this.options[l]=h,this._onOptionChange.fire(l)))},g.prototype._sanitizeAndValidateOption=function(l,h){switch(l){case"bellStyle":case"cursorStyle":case"fontWeight":case"fontWeightBold":case"rendererType":case"wordSeparator":h||(h=Q.DEFAULT_OPTIONS[l]);break;case"cursorWidth":h=Math.floor(h);case"lineHeight":case"tabStopWidth":if(h<1)throw new Error(l+" cannot be less than 1, value: "+h);break;case"minimumContrastRatio":h=Math.max(1,Math.min(21,Math.round(10*h)/10));break;case"scrollback":if((h=Math.min(h,4294967295))<0)throw new Error(l+" cannot be less than 0, value: "+h);break;case"fastScrollSensitivity":case"scrollSensitivity":if(h<=0)throw new Error(l+" cannot be less than or equal to 0, value: "+h)}return h},g.prototype.getOption=function(l){if(!(l in Q.DEFAULT_OPTIONS))throw new Error('No option with key "'+l+'"');return this.options[l]},g}();Q.OptionsService=p},function(Ue,Q,he){"use strict";var fe,i=this&&this.__extends||(fe=function(s,u){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,y){m.__proto__=y}||function(m,y){for(var _ in y)y.hasOwnProperty(_)&&(m[_]=y[_])})(s,u)},function(s,u){function m(){this.constructor=s}fe(s,u),s.prototype=u===null?Object.create(u):(m.prototype=u.prototype,new m)}),M=this&&this.__decorate||function(s,u,m,y){var _,x=arguments.length,S=x<3?u:y===null?y=Object.getOwnPropertyDescriptor(u,m):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(s,u,m,y);else for(var w=s.length-1;w>=0;w--)(_=s[w])&&(S=(x<3?_(S):x>3?_(u,m,S):_(u,m))||S);return x>3&&S&&Object.defineProperty(u,m,S),S},E=this&&this.__param||function(s,u){return function(m,y){u(m,y,s)}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.CoreService=void 0;var p=he(1),g=he(0),l=he(33),h=he(2),v=Object.freeze({insertMode:!1}),d=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),o=function(s){function u(m,y,_,x){var S=s.call(this)||this;return S._bufferService=y,S._logService=_,S._optionsService=x,S.isCursorInitialized=!1,S.isCursorHidden=!1,S._onData=S.register(new g.EventEmitter),S._onUserInput=S.register(new g.EventEmitter),S._onBinary=S.register(new g.EventEmitter),S._scrollToBottom=m,S.register({dispose:function(){return S._scrollToBottom=void 0}}),S.modes=l.clone(v),S.decPrivateModes=l.clone(d),S}return i(u,s),Object.defineProperty(u.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"onUserInput",{get:function(){return this._onUserInput.event},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),u.prototype.reset=function(){this.modes=l.clone(v),this.decPrivateModes=l.clone(d)},u.prototype.triggerDataEvent=function(m,y){if(y===void 0&&(y=!1),!this._optionsService.options.disableStdin){var _=this._bufferService.buffer;_.ybase!==_.ydisp&&this._scrollToBottom(),y&&this._onUserInput.fire(),this._logService.debug('sending data "'+m+'"',function(){return m.split("").map(function(x){return x.charCodeAt(0)})}),this._onData.fire(m)}},u.prototype.triggerBinaryEvent=function(m){this._optionsService.options.disableStdin||(this._logService.debug('sending binary "'+m+'"',function(){return m.split("").map(function(y){return y.charCodeAt(0)})}),this._onBinary.fire(m))},u=M([E(1,p.IBufferService),E(2,p.ILogService),E(3,p.IOptionsService)],u)}(h.Disposable);Q.CoreService=o},function(Ue,Q,he){"use strict";var fe=this&&this.__decorate||function(d,o,s,u){var m,y=arguments.length,_=y<3?o:u===null?u=Object.getOwnPropertyDescriptor(o,s):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(d,o,s,u);else for(var x=d.length-1;x>=0;x--)(m=d[x])&&(_=(y<3?m(_):y>3?m(o,s,_):m(o,s))||_);return y>3&&_&&Object.defineProperty(o,s,_),_},i=this&&this.__param||function(d,o){return function(s,u){o(s,u,d)}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.CoreMouseService=void 0;var M=he(1),E=he(0),p={NONE:{events:0,restrict:function(){return!1}},X10:{events:1,restrict:function(d){return d.button!==4&&d.action===1&&(d.ctrl=!1,d.alt=!1,d.shift=!1,!0)}},VT200:{events:19,restrict:function(d){return d.action!==32}},DRAG:{events:23,restrict:function(d){return d.action!==32||d.button!==3}},ANY:{events:31,restrict:function(d){return!0}}};function g(d,o){var s=(d.ctrl?16:0)|(d.shift?4:0)|(d.alt?8:0);return d.button===4?(s|=64,s|=d.action):(s|=3&d.button,4&d.button&&(s|=64),8&d.button&&(s|=128),d.action===32?s|=32:d.action!==0||o||(s|=3)),s}var l=String.fromCharCode,h={DEFAULT:function(d){var o=[g(d,!1)+32,d.col+32,d.row+32];return o[0]>255||o[1]>255||o[2]>255?"":"\x1B[M"+l(o[0])+l(o[1])+l(o[2])},SGR:function(d){var o=d.action===0&&d.button!==4?"m":"M";return"\x1B[<"+g(d,!0)+";"+d.col+";"+d.row+o}},v=function(){function d(o,s){this._bufferService=o,this._coreService=s,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._onProtocolChange=new E.EventEmitter,this._lastEvent=null;for(var u=0,m=Object.keys(p);u<m.length;u++){var y=m[u];this.addProtocol(y,p[y])}for(var _=0,x=Object.keys(h);_<x.length;_++){var S=x[_];this.addEncoding(S,h[S])}this.reset()}return d.prototype.addProtocol=function(o,s){this._protocols[o]=s},d.prototype.addEncoding=function(o,s){this._encodings[o]=s},Object.defineProperty(d.prototype,"activeProtocol",{get:function(){return this._activeProtocol},set:function(o){if(!this._protocols[o])throw new Error('unknown protocol "'+o+'"');this._activeProtocol=o,this._onProtocolChange.fire(this._protocols[o].events)},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"areMouseEventsActive",{get:function(){return this._protocols[this._activeProtocol].events!==0},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"activeEncoding",{get:function(){return this._activeEncoding},set:function(o){if(!this._encodings[o])throw new Error('unknown encoding "'+o+'"');this._activeEncoding=o},enumerable:!1,configurable:!0}),d.prototype.reset=function(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null},Object.defineProperty(d.prototype,"onProtocolChange",{get:function(){return this._onProtocolChange.event},enumerable:!1,configurable:!0}),d.prototype.triggerMouseEvent=function(o){if(o.col<0||o.col>=this._bufferService.cols||o.row<0||o.row>=this._bufferService.rows||o.button===4&&o.action===32||o.button===3&&o.action!==32||o.button!==4&&(o.action===2||o.action===3)||(o.col++,o.row++,o.action===32&&this._lastEvent&&this._compareEvents(this._lastEvent,o))||!this._protocols[this._activeProtocol].restrict(o))return!1;var s=this._encodings[this._activeEncoding](o);return s&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(s):this._coreService.triggerDataEvent(s,!0)),this._lastEvent=o,!0},d.prototype.explainEvents=function(o){return{down:!!(1&o),up:!!(2&o),drag:!!(4&o),move:!!(8&o),wheel:!!(16&o)}},d.prototype._compareEvents=function(o,s){return o.col===s.col&&o.row===s.row&&o.button===s.button&&o.action===s.action&&o.ctrl===s.ctrl&&o.alt===s.alt&&o.shift===s.shift},d=fe([i(0,M.IBufferService),i(1,M.ICoreService)],d)}();Q.CoreMouseService=v},function(Ue,Q,he){"use strict";var fe=this&&this.__decorate||function(p,g,l,h){var v,d=arguments.length,o=d<3?g:h===null?h=Object.getOwnPropertyDescriptor(g,l):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(p,g,l,h);else for(var s=p.length-1;s>=0;s--)(v=p[s])&&(o=(d<3?v(o):d>3?v(g,l,o):v(g,l))||o);return d>3&&o&&Object.defineProperty(g,l,o),o},i=this&&this.__param||function(p,g){return function(l,h){g(l,h,p)}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.DirtyRowService=void 0;var M=he(1),E=function(){function p(g){this._bufferService=g,this.clearRange()}return Object.defineProperty(p.prototype,"start",{get:function(){return this._start},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"end",{get:function(){return this._end},enumerable:!1,configurable:!0}),p.prototype.clearRange=function(){this._start=this._bufferService.buffer.y,this._end=this._bufferService.buffer.y},p.prototype.markDirty=function(g){g<this._start?this._start=g:g>this._end&&(this._end=g)},p.prototype.markRangeDirty=function(g,l){if(g>l){var h=g;g=l,l=h}g<this._start&&(this._start=g),l>this._end&&(this._end=l)},p.prototype.markAllDirty=function(){this.markRangeDirty(0,this._bufferService.rows-1)},p=fe([i(0,M.IBufferService)],p)}();Q.DirtyRowService=E},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.UnicodeService=void 0;var fe=he(0),i=he(79),M=function(){function E(){this._providers=Object.create(null),this._active="",this._onChange=new fe.EventEmitter;var p=new i.UnicodeV6;this.register(p),this._active=p.version,this._activeProvider=p}return Object.defineProperty(E.prototype,"onChange",{get:function(){return this._onChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"versions",{get:function(){return Object.keys(this._providers)},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"activeVersion",{get:function(){return this._active},set:function(p){if(!this._providers[p])throw new Error('unknown Unicode version "'+p+'"');this._active=p,this._activeProvider=this._providers[p],this._onChange.fire(p)},enumerable:!1,configurable:!0}),E.prototype.register=function(p){this._providers[p.version]=p},E.prototype.wcwidth=function(p){return this._activeProvider.wcwidth(p)},E.prototype.getStringCellWidth=function(p){for(var g=0,l=p.length,h=0;h<l;++h){var v=p.charCodeAt(h);if(55296<=v&&v<=56319){if(++h>=l)return g+this.wcwidth(v);var d=p.charCodeAt(h);56320<=d&&d<=57343?v=1024*(v-55296)+d-56320+65536:g+=this.wcwidth(d)}g+=this.wcwidth(v)}return g},E}();Q.UnicodeService=M},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.UnicodeV6=void 0;var fe,i=he(15),M=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],E=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],p=function(){function g(){if(this.version="6",!fe){fe=new Uint8Array(65536),i.fill(fe,1),fe[0]=0,i.fill(fe,0,1,32),i.fill(fe,0,127,160),i.fill(fe,2,4352,4448),fe[9001]=2,fe[9002]=2,i.fill(fe,2,11904,42192),fe[12351]=1,i.fill(fe,2,44032,55204),i.fill(fe,2,63744,64256),i.fill(fe,2,65040,65050),i.fill(fe,2,65072,65136),i.fill(fe,2,65280,65377),i.fill(fe,2,65504,65511);for(var l=0;l<M.length;++l)i.fill(fe,0,M[l][0],M[l][1]+1)}}return g.prototype.wcwidth=function(l){return l<32?0:l<127?1:l<65536?fe[l]:function(h,v){var d,o=0,s=v.length-1;if(h<v[0][0]||h>v[s][1])return!1;for(;s>=o;)if(h>v[d=o+s>>1][1])o=d+1;else{if(!(h<v[d][0]))return!0;s=d-1}return!1}(l,E)?0:l>=131072&&l<=196605||l>=196608&&l<=262141?2:1},g}();Q.UnicodeV6=p},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.CharsetService=void 0;var fe=function(){function i(){this.glevel=0,this._charsets=[]}return i.prototype.reset=function(){this.charset=void 0,this._charsets=[],this.glevel=0},i.prototype.setgLevel=function(M){this.glevel=M,this.charset=this._charsets[M]},i.prototype.setgCharset=function(M,E){this._charsets[M]=E,this.glevel===M&&(this.charset=E)},i}();Q.CharsetService=fe},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.updateWindowsModeWrappedState=void 0;var fe=he(3);Q.updateWindowsModeWrappedState=function(i){var M=i.buffer.lines.get(i.buffer.ybase+i.buffer.y-1),E=M==null?void 0:M.get(i.cols-1),p=i.buffer.lines.get(i.buffer.ybase+i.buffer.y);p&&E&&(p.isWrapped=E[fe.CHAR_DATA_CODE_INDEX]!==fe.NULL_CELL_CODE&&E[fe.CHAR_DATA_CODE_INDEX]!==fe.WHITESPACE_CELL_CODE)}},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.WriteBuffer=void 0;var fe=function(){function i(M){this._action=M,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0}return i.prototype.writeSync=function(M){if(this._writeBuffer.length){for(var E=this._bufferOffset;E<this._writeBuffer.length;++E){var p=this._writeBuffer[E],g=this._callbacks[E];this._action(p),g&&g()}this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=2147483647}this._action(M)},i.prototype.write=function(M,E){var p=this;if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");this._writeBuffer.length||(this._bufferOffset=0,setTimeout(function(){return p._innerWrite()})),this._pendingData+=M.length,this._writeBuffer.push(M),this._callbacks.push(E)},i.prototype._innerWrite=function(){for(var M=this,E=Date.now();this._writeBuffer.length>this._bufferOffset;){var p=this._writeBuffer[this._bufferOffset],g=this._callbacks[this._bufferOffset];if(this._bufferOffset++,this._action(p),this._pendingData-=p.length,g&&g(),Date.now()-E>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(function(){return M._innerWrite()},0)):(this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0)},i}();Q.WriteBuffer=fe},function(Ue,Q,he){"use strict";Object.defineProperty(Q,"__esModule",{value:!0}),Q.AddonManager=void 0;var fe=function(){function i(){this._addons=[]}return i.prototype.dispose=function(){for(var M=this._addons.length-1;M>=0;M--)this._addons[M].instance.dispose()},i.prototype.loadAddon=function(M,E){var p=this,g={instance:E,dispose:E.dispose,isDisposed:!1};this._addons.push(g),E.dispose=function(){return p._wrappedAddonDispose(g)},E.activate(M)},i.prototype._wrappedAddonDispose=function(M){if(!M.isDisposed){for(var E=-1,p=0;p<this._addons.length;p++)if(this._addons[p]===M){E=p;break}if(E===-1)throw new Error("Could not dispose an addon that has not been loaded");M.isDisposed=!0,M.dispose.apply(M.instance),this._addons.splice(E,1)}},i}();Q.AddonManager=fe}])})},84279:function(It,Ue,Q){"use strict";var he=Object.defineProperty,fe=Object.defineProperties,i=Object.getOwnPropertyDescriptors,M=Object.getOwnPropertySymbols,E=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,g=(e,t,r)=>t in e?he(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,l=(e,t)=>{for(var r in t||(t={}))E.call(t,r)&&g(e,r,t[r]);if(M)for(var r of M(t))p.call(t,r)&&g(e,r,t[r]);return e},h=(e,t)=>fe(e,i(t)),v=e=>typeof e=="symbol"?e:e+"",d=(e,t)=>{var r={};for(var a in e)E.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(e!=null&&M)for(var a of M(e))t.indexOf(a)<0&&p.call(e,a)&&(r[a]=e[a]);return r};function o(e){return Array.isArray(e)}var s={en:{"keyboard.tooltip.symbols":"\u7B26\u53F7","keyboard.tooltip.greek":"\u5E0C\u814A\u5B57\u6BCD","keyboard.tooltip.numeric":"\u6570\u5B57","keyboard.tooltip.alphabetic":"\u7F57\u9A6C\u5B57\u6BCD","tooltip.cut to clipboard":"\u526A\u5207\u5230\u526A\u8D34\u677F","tooltip.copy to clipboard":"\u590D\u5236\u5230\u526A\u8D34\u677F","tooltip.paste from clipboard":"\u7C98\u8D34","tooltip.redo":"\u91CD\u505A","tooltip.toggle virtual keyboard":"\u5207\u6362\u865A\u62DF\u952E\u76D8","tooltip.undo":"\u64A4\u6D88","menu.insert matrix":"\u63D2\u5165\u77E9\u9635","menu.borders":"\u77E9\u9635\u5206\u9694\u7B26","menu.array.add row above":"\u5728\u540E\u9762\u6DFB\u52A0\u884C","menu.array.add row below":"\u5728\u524D\u9762\u6DFB\u52A0\u884C","menu.array.add column after":"\u5728\u540E\u9762\u6DFB\u52A0\u5217r","menu.array.add column before":"\u5728\u524D\u9762\u6DFB\u52A0\u5217","menu.array.delete row":"\u5220\u9664\u884C","menu.array.delete rows":"\u5220\u9664\u9009\u5B9A\u884C","menu.array.delete column":"\u5220\u9664\u5217","menu.array.delete columns":"\u5220\u9664\u9009\u5B9A\u7684\u5217","menu.mode":"\u6A21\u5F0F","menu.mode-math":"\u6570\u5B66","menu.mode-text":"\u6587\u672C","menu.mode-latex":"LaTeX","tooltip.blackboard":"\u9ED1\u677F","tooltip.bold":"\u7C97\u4F53","tooltip.italic":"\u659C\u4F53","tooltip.fraktur":"Fraktur","tooltip.script":"\u811A\u672C","tooltip.caligraphic":"\u8349\u4E66","tooltip.typewriter":"\u6253\u5B57\u673A","tooltip.roman-upright":"\u7F57\u9A6C\u76F4\u7ACB","tooltip.row-by-col":"%@ \xD7 %@","menu.font-style":"\u5B57\u4F53\u6837\u5F0F","menu.accent":"\u91CD\u97F3","menu.decoration":"\u88C5\u9970","menu.color":"\u989C\u8272","menu.background-color":"\u80CC\u666F","menu.evaluate":"\u8BA1\u7B97","menu.simplify":"\u7B80\u5316","menu.solve":"\u6C42\u89E3","menu.solve-for":"\u6C42\u89E3 %@","menu.cut":"\u526A\u5207","menu.copy":"\u590D\u5236","menu.copy-as-latex":"\u590D\u5236\u4E3A LaTeX","menu.copy-as-ascii-math":"\u590D\u5236\u4E3A ASCII Math","menu.copy-as-mathml":"\u590D\u5236\u4E3A MathML","menu.paste":"\u7C98\u8D34","menu.select-all":"\u5168\u9009","color.red":"\u7EA2\u8272","color.orange":"\u6A59\u8272","color.yellow":"\u9EC4\u8272","color.lime":"\u7EFF\u9EC4\u8272","color.green":"\u7EFF\u8272","color.teal":"\u9752\u8272","color.cyan":"\u84DD\u7EFF\u8272","color.blue":"\u84DD\u8272","color.indigo":"\u975B\u84DD\u8272","color.purple":"\u7D2B\u8272","color.magenta":"\u6D0B\u7EA2\u8272","color.black":"\u9ED1\u8272","color.dark-grey":"\u6DF1\u7070\u8272","color.grey":"\u7070\u8272","color.light-grey":"\u6D45\u7070\u8272","color.white":"\u767D\u8272"}};function u(){return"window"in globalThis&&"document"in globalThis}function m(){return"matchMedia"in window?window.matchMedia("(pointer: coarse)").matches:"ontouchstart"in window||navigator.maxTouchPoints>0}function y(){return typeof navigator.vibrate=="function"}function _(){var e,t;if(!u())return"other";const r=(t=(e=navigator.userAgentData)==null?void 0:e.platform)!=null?t:navigator.platform;return/^mac/i.test(r)?navigator.maxTouchPoints===5?"ios":"macos":/^win/i.test(r)?"windows":/android/i.test(navigator.userAgent)?"android":/iphone|ipod|ipad/i.test(navigator.userAgent)?"ios":/\bcros\b/i.test(navigator.userAgent)?"chromeos":"other"}function x(){if(!u())return!0;if(/firefox/i.test(navigator.userAgent)){const e=navigator.userAgent.match(/firefox\/(\d+)/i);return e?parseInt(e[1])>=78:!1}if(/trident/i.test(navigator.userAgent))return!1;if(/edge/i.test(navigator.userAgent)){const e=navigator.userAgent.match(/edg\/(\d+)/i);return e?parseInt(e[1])>=79:!1}return!0}function S(){return HTMLElement.prototype.hasOwnProperty("popover")}var w={strings:s,_locale:"",_dirty:!1,_subscribers:[],_numberFormatter:void 0,get locale(){return w._locale||(w._locale=u()?navigator.language.slice(0,5):"en-US"),w._locale},set locale(e){w._locale=e,w._numberFormatter=void 0,w.dirty=!0},get numberFormatter(){return w._numberFormatter||(w._numberFormatter=new Intl.NumberFormat(w.locale)),w._numberFormatter},merge(e,t){if(typeof e=="string"&&t)w.strings[e]=l(l({},w.strings[e]),t),w.dirty=!0;else for(const r of Object.keys(e))w.merge(r,e[r])},get dirty(){return w._dirty},set dirty(e){w._dirty||w._dirty===e||(w._dirty=!0,setTimeout(()=>{w._dirty=!1,this._subscribers.forEach(t=>t==null?void 0:t())},0))},subscribe(e){return w._subscribers.push(e),w._subscribers.length-1},unsubscribe(e){e<0||e>=w._subscribers.length||(w._subscribers[e]=void 0)},update(e){let t=e.querySelectorAll("[data-l10n-tooltip]");for(const r of t){const a=r.getAttribute("data-l10n-tooltip");if(a){const b=A(a);b&&r.setAttribute("data-tooltip",b)}}t=e.querySelectorAll("[data-l10n-arial-label]");for(const r of t){const a=r.getAttribute("data-l10n-arial-label");if(a){const b=A(a);b&&r.setAttribute("aria-label",b)}}}};function A(e,...t){if(e===void 0)return;let r="";const a=w.locale;w.strings[a]&&(r=w.strings[a][e]);const b=a.slice(0,2);if(!r&&w.strings[b]&&(r=w.strings[b][e]),r||(r=w.strings.en[e]),!r)return;const L=/(%@|%([0-9]+)\$@)/g;let N=L.exec(r),J=0;for(;N;){if(t[J++]){const ue=N[2]?parseInt(N[2],10)-1:J-1;let pe=t[ue];typeof pe=="number"&&(pe=w.numberFormatter.format(pe)),r=r.replace(N[1],pe)}N=L.exec(r)}return r=r.replace(/%%/g,"%"),r}var H={m0:"#3F3D99",m1:"#993D71",m2:"#998B3D",m3:"#3D9956",m4:"#3D5A99",m5:"#993D90",m6:"#996D3D",m7:"#43993D",m8:"#3D7999",m9:"#843D99"},R={blue:"#0072BD",orange:"#D95319",yellow:"#EDB120",purple:"#7E2F8E",green:"#77AC30",cyan:"#4DBEEE",red:"#A2142F"},F={red:"#fbbbb6",orange:"#ffe0c2",yellow:"#fff1c2",lime:"#d0e8b9",green:"#bceac4",teal:"#b9f1f1",cyan:"#b8e5c9",blue:"#b6d9fb",indigo:"#d1c2f0",purple:"#e3baf8",magenta:"#f9c8e0",black:"#353535","dark-grey":"#8C8C8C",grey:"#D0D0D0","light-grey":"#F0F0F0",white:"#ffffff"},D={red:"#d7170b",orange:"#fe8a2b",yellow:"#ffc02b",lime:"#63b215",green:"#21ba3a",teal:"#17cfcf",cyan:"#13a7ec",blue:"#0d80f2",indigo:"#63c",purple:"#a219e6",magenta:"#eb4799",black:"#000","dark-grey":"#666",grey:"#A6A6A6","light-grey":"#d4d5d2",white:"#ffffff"},B={Red:"red",Orange:"orange",Yellow:"yellow",LimeGreen:"lime",Green:"green",TealBlue:"teal",Blue:"blue",Violet:"indigo",Purple:"purple",Magenta:"magenta",Black:"black",Gray:"grey",White:"white"},P={Apricot:"#FBB982",Aquamarine:"#00B5BE",Bittersweet:"#C04F17",Black:"#221E1F",Blue:"#2D2F92",BlueGreen:"#00B3B8",BlueViolet:"#473992",BrickRed:"#B6321C",Brown:"#792500",BurntOrange:"#F7921D",CadetBlue:"#74729A",CarnationPink:"#F282B4",Cerulean:"#00A2E3",CornflowerBlue:"#41B0E4",Cyan:"#00AEEF",Dandelion:"#FDBC42",DarkOrchid:"#A4538A",Emerald:"#00A99D",ForestGreen:"#009B55",Fuchsia:"#8C368C",Goldenrod:"#FFDF42",Gray:"#949698",Green:"#00A64F",GreenYellow:"#DFE674",JungleGreen:"#00A99A",Lavender:"#F49EC4",Limegreen:"#8DC73E",Magenta:"#EC008C",Mahogany:"#A9341F",Maroon:"#AF3235",Melon:"#F89E7B",MidnightBlue:"#006795",Mulberry:"#A93C93",NavyBlue:"#006EB8",OliveGreen:"#3C8031",Orange:"#F58137",OrangeRed:"#ED135A",Orchid:"#AF72B0",Peach:"#F7965A",Periwinkle:"#7977B8",PineGreen:"#008B72",Plum:"#92268F",ProcessBlue:"#00B0F0",Purple:"#99479B",RawSienna:"#974006",Red:"#ED1B23",RedOrange:"#F26035",RedViolet:"#A1246B",Rhodamine:"#EF559F",RoyalBlue:"#0071BC",RoyalPurple:"#613F99",RubineRed:"#ED017D",Salmon:"#F69289",SeaGreen:"#3FBC9D",Sepia:"#671800",SkyBlue:"#46C5DD",SpringGreen:"#C6DC67",Tan:"#DA9D76",TealBlue:"#00AEB3",Thistle:"#D883B7",Turquoise:"#00B4CE",Violet:"#58429B",VioletRed:"#EF58A0",White:"#FFFFFF",WildStrawberry:"#EE2967",Yellow:"#FFF200",YellowGreen:"#98CC70",YellowOrange:"#FAA21A"};function U(e){var t,r,a,b,L,N;const J=e.split("!");let ie,ue,pe,Ee=255,De=255,je=255,ze=-1;const Je=J.length>0&&J[0].startsWith("-");Je&&(J[0]=J[0].slice(1));for(let pt=0;pt<J.length;pt++){ie=Ee,ue=De,pe=je;const Xe=(t=J[pt].trim().match(/^([A-Za-z\d-]+)/))==null?void 0:t[1],ot=Xe==null?void 0:Xe.toLowerCase(),gt=Xe&&(N=(L=(b=(a=(r=D[ot])!=null?r:D[B[Xe]])!=null?a:R[Xe])!=null?b:P[Xe])!=null?L:H[Xe])!=null?N:J[pt].trim();let ct=gt.match(/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i);if(ct!=null&&ct[1]&&ct[2]&&ct[3])Ee=Math.max(0,Math.min(255,Number.parseInt(ct[1],16))),De=Math.max(0,Math.min(255,Number.parseInt(ct[2],16))),je=Math.max(0,Math.min(255,Number.parseInt(ct[3],16)));else if(ct=gt.match(/^#([\da-f]{3})$/i),ct!=null&&ct[1]){const Dt=Number.parseInt(ct[1][0],16),Bt=Number.parseInt(ct[1][1],16),Rt=Number.parseInt(ct[1][2],16);Ee=Math.max(0,Math.min(255,Dt*16+Dt)),De=Math.max(0,Math.min(255,Bt*16+Bt)),je=Math.max(0,Math.min(255,Rt*16+Rt))}else if(ct=gt.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i),ct!=null&&ct[1]&&ct[2]&&ct[3])Ee=Math.max(0,Math.min(255,Number.parseInt(ct[1]))),De=Math.max(0,Math.min(255,Number.parseInt(ct[2]))),je=Math.max(0,Math.min(255,Number.parseInt(ct[3])));else return;ze>=0&&(Ee=(1-ze)*Ee+ze*ie,De=(1-ze)*De+ze*ue,je=(1-ze)*je+ze*pe,ze=-1),pt+1<J.length&&(ze=Math.max(0,Math.min(100,Number.parseInt(J[++pt])))/100)}return ze>=0&&(Ee=ze*Ee+(1-ze)*ie,De=ze*De+(1-ze)*ue,je=ze*je+(1-ze)*pe),Je&&(Ee=255-Ee,De=255-De,je=255-je),"#"+("00"+Math.round(Ee).toString(16)).slice(-2)+("00"+Math.round(De).toString(16)).slice(-2)+("00"+Math.round(je).toString(16)).slice(-2)}function G(e){var t,r;return e=e.trim(),(r=(t=F[e.toLowerCase()])!=null?t:F[B[e]])!=null?r:U(e)}function ee(e){if(!e||e[0]!=="#")return;e=e.slice(1);let t;return e.length<=4?(t={r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16)},e.length===4&&(t.a=parseInt(e[3]+e[3],16)/255)):(t={r:parseInt(e[0]+e[1],16),g:parseInt(e[2]+e[3],16),b:parseInt(e[4]+e[5],16)},e.length===8&&(t.a=parseInt(e[6]+e[7],16)/255)),t&&t.a===void 0&&(t.a=1),t}function K(e,t,r){return r<0&&(r+=6),r>=6&&(r-=6),r<1?(t-e)*r+e:r<3?t:r<4?(t-e)*(4-r)+e:e}function Z(e){let[t,r,a]=[e.h,e.s,e.l];t=(t+360)%360/60,a=Math.max(0,Math.min(a,1)),r=Math.max(0,Math.min(r,1));const b=a<=.5?a*(r+1):a+r-a*r,L=a*2-b;return{r:Math.round(255*K(L,b,t+2)),g:Math.round(255*K(L,b,t)),b:Math.round(255*K(L,b,t-2))}}function $(e){return e<0?0:e>255?255:Math.round(e)}function oe(e){const{r:t,g:r,b:a}=e;let b=((1<<24)+($(t)<<16)+($(r)<<8)+$(a)).toString(16).slice(1);return b[0]===b[1]&&b[2]===b[3]&&b[4]===b[5]&&b[6]===b[7]&&(b=b[0]+b[2]+b[4]),"#"+b}function ae(e){let{r:t,g:r,b:a}=e;t=t/255,r=r/255,a=a/255;const b=Math.min(t,r,a),L=Math.max(t,r,a),N=L-b;let J,ie;L===b?J=0:t===L?J=(r-a)/N:r===L?J=2+(a-t)/N:a===L&&(J=4+(t-r)/N),J=Math.min(J*60,360),J<0&&(J+=360);const ue=(b+L)/2;return L===b?ie=0:ue<=.5?ie=N/(L+b):ie=N/(2-L-b),{h:J,s:ie,l:ue}}function ye(e){let t=ee(e);if(!t)return e;let{h:r,s:a,l:b}=ae(t);return a+=.1,b-=.1,oe(Z({h:r,s:a,l:b}))}var Y={60:"\\lt",62:"\\gt",111:"o",38:"\\&",123:"\\lbrace",125:"\\rbrace",91:"\\lbrack",93:"\\rbrack",58:"\\colon",160:"~",172:"\\neg",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8224:"\\dagger",8225:"\\ddagger",8230:"\\ldots",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",39:"\\prime",8592:"\\gets",8594:"\\to",9651:"\\triangle",9661:"\\triangledown",8715:"\\owns",8727:"\\ast",8739:"\\vert",8741:"\\Vert",8743:"\\land",8744:"\\lor",8901:"\\cdot",8904:"\\bowtie",8800:"\\ne",8804:"\\le",8805:"\\ge",8869:"\\bot",10231:"\\biconditional",10232:"\\impliedby",10233:"\\implies",10234:"\\iff",8450:"\\mathbb{C}",8469:"\\mathbb{N}",8473:"\\mathbb{P}",8474:"\\mathbb{Q}",8477:"\\mathbb{R}",8484:"\\mathbb{Z}",8461:"\\mathbb{H}",8476:"\\Re",8465:"\\Im",42:"\\ast",11036:"\\square",9633:"\\square",8720:"\\coprod",8716:"\\not\\ni",9671:"\\diamond",8846:"\\uplus",8851:"\\sqcap",8852:"\\sqcup",8768:"\\wr",8750:"\\oint",8226:"\\textbullet",8722:"-",978:"\\Upsilon"},le={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},xe=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"main",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function Ce(e,t,r){if(!/[A-Za-z\d]/.test(e)||(r==="up"&&(r=void 0),!t&&!r))return e;const a=e.codePointAt(0);if(a===void 0)return e;for(const b of xe)if((!t||b.variant===t)&&(!r||b.style===r)&&a>=b.offset&&a<b.offset+b.len){const L=b.start+a-b.offset;return String.fromCodePoint(le[L]||L)}return e}function we(e){var t;if((e<119808||e>120831)&&(e<8448||e>8527))return{char:String.fromCodePoint(e)};for(const r in le)if(le[r]===e){e=(t=r.codePointAt(0))!=null?t:0;break}for(const r of xe)if(e>=r.start&&e<r.start+r.len)return{char:String.fromCodePoint(e-r.start+r.offset),variant:r.variant,style:r.style};return{char:String.fromCodePoint(e)}}function Le(e){var t;let r="";for(const a of e){if("{}<>[]$&#^_%:'\u02DC".includes(a)){r+=a;continue}const b=(t=a.codePointAt(0))!=null?t:0;let L=Y[b];if(L)L.startsWith("\\")?r+=L+" ":r+=L;else{const{char:N,variant:J,style:ie}=we(b);switch(L=N,J){case"double-struck":L=`\\mathbb{${L}}`;break;case"fraktur":L=`\\mathfrak{${L}}`;break;case"script":L=`\\mathscr{${L}}`;break;case"sans-serif":L=`\\mathsf{${L}}`;break;case"monospace":L=`\\mathtt{${L}}`;break;case"calligraphic":L=`\\mathcal{${L}}`;break}switch(ie){case"bold":L=`\\mathbf{${L}}`;break;case"italic":L=`\\mathit{${L}}`;break;case"bolditalic":L=`\\mathbfit{${L}}`;break}r+=L}}return r}function de(e){return e?Array.isArray(e)?e:typeof e=="object"&&"group"in e?e.group:[]:[]}var be={},Te=l({},Y),Ae={},Be={},Pe={darr:"\\downarrow",dArr:"\\Downarrow",Darr:"\\Downarrow",lang:"\\langle",rang:"\\rangle",uarr:"\\uparrow",uArr:"\\Uparrow",Uarr:"\\Uparrow",N:"\\mathbb{N}",R:"\\mathbb{R}",Z:"\\mathbb{Z}",alef:"\\aleph",alefsym:"\\aleph",Alpha:"\\mathrm{A}",Beta:"\\mathrm{B}",bull:"\\bullet",Chi:"\\mathrm{X}",clubs:"\\clubsuit",cnums:"\\mathbb{C}",Complex:"\\mathbb{C}",Dagger:"\\ddagger",diamonds:"\\diamondsuit",empty:"\\emptyset",Epsilon:"\\mathrm{E}",Eta:"\\mathrm{H}",exist:"\\exists",harr:"\\leftrightarrow",hArr:"\\Leftrightarrow",Harr:"\\Leftrightarrow",hearts:"\\heartsuit",image:"\\Im",infin:"\\infty",Iota:"\\mathrm{I}",isin:"\\in",Kappa:"\\mathrm{K}",larr:"\\leftarrow",lArr:"\\Leftarrow",Larr:"\\Leftarrow",lrarr:"\\leftrightarrow",lrArr:"\\Leftrightarrow",Lrarr:"\\Leftrightarrow",Mu:"\\mathrm{M}",natnums:"\\mathbb{N}",Nu:"\\mathrm{N}",Omicron:"\\mathrm{O}",plusmn:"\\pm",rarr:"\\rightarrow",rArr:"\\Rightarrow",Rarr:"\\Rightarrow",real:"\\Re",reals:"\\mathbb{R}",Reals:"\\mathbb{R}",Rho:"\\mathrm{P}",sdot:"\\cdot",sect:"\\S",spades:"\\spadesuit",sub:"\\subset",sube:"\\subseteq",supe:"\\supseteq",Tau:"\\mathrm{T}",thetasym:"\\vartheta",weierp:"\\wp",Zeta:"\\mathrm{Z}"},_e={varGamma:"\\mathit{\\Gamma}",varDelta:"\\mathit{\\Delta}",varTheta:"\\mathit{\\Theta}",varLambda:"\\mathit{\\Lambda}",varXi:"\\mathit{\\Xi}",varPi:"\\mathit{\\Pi}",varSigma:"\\mathit{\\Sigma}",varUpsilon:"\\mathit{\\Upsilon}",varPhi:"\\mathit{\\Phi}",varPsi:"\\mathit{\\Psi}",varOmega:"\\mathit{\\Omega}",pmod:{def:"\\quad(\\operatorname{mod}\\ #1)",args:1,expand:!1,captureSelection:!1},mod:{def:"\\quad\\operatorname{mod}\\,\\,#1",args:1,expand:!1},bmod:{def:"\\;\\mathbin{\\operatorname{mod }}",expand:!1}},ne={bra:{def:"\\mathinner{\\langle{#1}|}",args:1,captureSelection:!1},ket:{def:"\\mathinner{|{#1}\\rangle}",args:1,captureSelection:!1},braket:{def:"\\mathinner{\\langle{#1}\\rangle}",args:1,captureSelection:!1},set:{def:"\\mathinner{\\lbrace #1 \\rbrace}",args:1,captureSelection:!1},Bra:{def:"\\left\\langle #1\\right|",args:1,captureSelection:!1},Ket:{def:"\\left|#1\\right\\rangle",args:1,captureSelection:!1},Braket:{def:"\\left\\langle{#1}\\right\\rangle",args:1,captureSelection:!1},Set:{def:"\\left\\lbrace #1 \\right\\rbrace",args:1,captureSelection:!1}},te={iff:{primitive:!0,captureSelection:!0,def:"\\;\u27FA\\;"},nicefrac:"^{#1}\\!\\!/\\!_{#2}",phase:{def:"\\enclose{phasorangle}{#1}",args:1,captureSelection:!1},rd:"\\mathrm{d}",rD:"\\mathrm{D}",doubleStruckCapitalN:"\\mathbb{N}",doubleStruckCapitalR:"\\mathbb{R}",doubleStruckCapitalQ:"\\mathbb{Q}",doubleStruckCapitalZ:"\\mathbb{Z}",doubleStruckCapitalP:"\\mathbb{P}",scriptCapitalE:"\\mathscr{E}",scriptCapitalH:"\\mathscr{H}",scriptCapitalL:"\\mathscr{L}",gothicCapitalC:"\\mathfrak{C}",gothicCapitalH:"\\mathfrak{H}",gothicCapitalI:"\\mathfrak{I}",gothicCapitalR:"\\mathfrak{R}",imaginaryI:"\\mathrm{i}",imaginaryJ:"\\mathrm{j}",exponentialE:"\\mathrm{e}",differentialD:"\\mathrm{d}",capitalDifferentialD:"\\mathrm{D}",mathstrut:{def:"\\vphantom{(}",primitive:!0},angl:"\\enclose{actuarial}{#1}",angln:"\\enclose{actuarial}{n}",anglr:"\\enclose{actuarial}{r}",anglk:"\\enclose{actuarial}{k}",mathtools:{primitive:!0,package:{ordinarycolon:":",vcentcolon:"\\mathrel{\\mathop\\ordinarycolon}",dblcolon:'{\\mathop{\\char"2237}}',coloneqq:'{\\mathop{\\char"2254}}',Coloneqq:'{\\mathop{\\char"2237\\char"3D}}',coloneq:'{\\mathop{\\char"3A\\char"2212}}',Coloneq:'{\\mathop{\\char"2237\\char"2212}}',eqqcolon:'{\\mathop{\\char"2255}}',Eqqcolon:'{\\mathop{\\char"3D\\char"2237}}',eqcolon:'{\\mathop{\\char"2239}}',Eqcolon:'{\\mathop{\\char"2212\\char"2237}}',colonapprox:'{\\mathop{\\char"003A\\char"2248}}',Colonapprox:'{\\mathop{\\char"2237\\char"2248}}',colonsim:'{\\mathop{\\char"3A\\char"223C}}',Colonsim:'{\\mathop{\\char"2237\\char"223C}}',colondash:"\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}",Colondash:"\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}",dashcolon:"\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Dashcolon:"\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}"}},ratio:"\\vcentcolon",coloncolon:"\\dblcolon",colonequals:"\\coloneq",coloncolonequals:"\\Coloneq",equalscolon:"\\eqcolon",equalscoloncolon:"\\Eqcolon",colonminus:"\\colondash",coloncolonminus:"\\Colondash",minuscolon:"\\dashcolon",minuscoloncolon:"\\Dashcolon",coloncolonapprox:"\\Colonapprox",coloncolonsim:"\\Colonsim",simcolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Simcolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}",simcoloncolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}",approxcolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Approxcolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}",approxcoloncolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}",notni:"\\mathrel{\\char`\u220C}",limsup:"\\operatorname*{lim\\,sup}",liminf:"\\operatorname*{lim\\,inf}",injlim:"\\operatorname*{inj\\,lim}",projlim:"\\operatorname*{proj\\,lim}",varlimsup:"\\operatorname*{\\overline{lim}}",varliminf:"\\operatorname*{\\underline{lim}}",varinjlim:"\\operatorname*{\\underrightarrow{lim}}",varprojlim:"\\operatorname*{\\underleftarrow{lim}}",argmin:"\\operatorname*{arg\\,min}",argmax:"\\operatorname*{arg\\,max}",plim:"\\mathop{\\operatorname{plim}}\\limits",tripledash:{def:"\\vphantom{-}\\raise{4mu}{\\mkern1.5mu\\rule{2mu}{1.5mu}\\mkern{2.25mu}\\rule{2mu}{1.5mu}\\mkern{2.25mu}\\rule{2mu}{1.5mu}\\mkern{2mu}}",expand:!0},"braket.sty":{package:ne},"amsmath.sty":{package:_e,primitive:!0},"texvc.sty":{package:Pe,primitive:!1}},T={" ":32,"\\!":33,"\\#":35,"\\$":36,"\\%":37,"\\&":38,"-":45,"\\textunderscore":95,"\\euro":8364,"\\maltese":10016,"\\{":123,"\\}":125,"\\textbraceleft":123,"\\textbraceright":125,"\\lbrace":123,"\\rbrace":125,"\\lbrack":91,"\\rbrack":93,"\\nobreakspace":160,"\\ldots":8230,"\\textellipsis":8230,"\\backslash":92,"`":8216,"'":8217,"``":8220,"''":8221,"\\degree":176,"\\textasciicircum":94,"\\textasciitilde":126,"\\textasteriskcentered":42,"\\textbackslash":92,"\\textbullet":8226,"\\textdollar":36,"\\textsterling":163,"\\textdagger":8224,"\\textdaggerdbl":8225,"\u2013":8211,"\u2014":8212,"\u2018":8216,"\u2019":8217,"\u201C":8220,"\u201D":8221,'"':8221,"\\ss":223,"\\ae":230,"\\oe":339,"\\AE":198,"\\OE":338,"\\O":216,"\\i":305,"\\j":567,"\\aa":229,"\\AA":197},I=/[\w!@*()-=+{}\[\]\\';:?/.,~<>`|$%#&^" ]/,re,q;x()?(re=new RegExp("\\p{Letter}","u"),q=new RegExp("[0-9\\p{Letter}]","u")):(re=/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/,q=/[\da-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/);function z(e,t,r="mord",a){t!==void 0&&(be[e]={definitionType:"symbol",type:r,variant:a,codepoint:t},Te[t]||(Te[t]=e))}function W(e,t,r){if(typeof e=="string"){for(let a=0;a<e.length;a++){const b=e.charAt(a);z(b,b.codePointAt(0))}return}for(const[a,b,L,N]of e)z(a,b,L!=null?L:t,N!=null?N:r)}function V(e,t){for(let r=e;r<=t;r++)z(String.fromCodePoint(r),r)}function se(e){var t;return(t=Be[e])!=null?t:null}function ge(e,t){var r,a;if(t.length===0||t==="\\"||!t.startsWith("\\"))return[];const b=[];for(const N in Ae)N.startsWith(t)&&!Ae[N].infix&&b.push({match:N,frequency:(r=Ae[N].frequency)!=null?r:0});for(const N in be)N.startsWith(t)&&b.push({match:N,frequency:(a=be[N].frequency)!=null?a:0});const L=t.substring(1);for(const N of Object.keys(e.options.macros))N.startsWith(L)&&b.push({match:"\\"+N,frequency:0});return b.sort((N,J)=>{var ie,ue;return N.frequency===J.frequency?N.match.length===J.match.length?N.match<J.match?-1:1:N.match.length-J.match.length:((ie=J.frequency)!=null?ie:0)-((ue=N.frequency)!=null?ue:0)}),b.map(N=>N.match)}function Me(e){let t="auto";const r=e.match(/:([^=]+)/);return r&&(t=r[1].trim()),t}function Fe(e){if(!e)return[];const t=[];let r=e.split("]");if(r[0].startsWith("[")){t.push({isOptional:!0,type:Me(r[0].slice(1))});for(let a=1;a<=r.length;a++)t.push(...Fe(r[a]))}else if(r=e.split("}"),r[0].startsWith("{")){t.push({isOptional:!1,type:Me(r[0].slice(1))});for(let a=1;a<=r.length;a++)t.push(...Fe(r[a]))}return t}function Re(e){if(!e)return"";let t="",r=!0;for(const a of e)typeof a.value=="string"?t+=a.value:r=!1;return r?t:""}function $e(e,t){typeof e=="string"&&(e=[e]);const r={tabular:!1,params:[],createAtom:t};for(const a of e)Be[a]=r}function lt(e,t,r){typeof e=="string"&&(e=[e]);const b={tabular:!0,params:Fe(t),createAtom:r};for(const L of e)Be[L]=b}function Ne(e,t,r){var a,b;r||(r={});const L={definitionType:"function",params:Fe(t),ifMode:r.ifMode,isFunction:(a=r.isFunction)!=null?a:!1,applyMode:r.applyMode,infix:(b=r.infix)!=null?b:!1,parse:r.parse,createAtom:r.createAtom,applyStyle:r.applyStyle,serialize:r.serialize,render:r.render};if(typeof e=="string")Ae["\\"+e]=L;else for(const N of e)Ae["\\"+N]=L}var Ze;function We(e){return Ze||(Ze=qe(te)),e?qe(l(l({},Ze),e)):Ze}function nt(e,t){var r,a,b,L;if(typeof e=="string"){let N=0;const J=e;return/(^|[^\\])#1/.test(J)&&(N=1),/(^|[^\\])#2/.test(J)&&(N=2),/(^|[^\\])#3/.test(J)&&(N=3),/(^|[^\\])#4/.test(J)&&(N=4),/(^|[^\\])#5/.test(J)&&(N=5),/(^|[^\\])#6/.test(J)&&(N=6),/(^|[^\\])#7/.test(J)&&(N=7),/(^|[^\\])#8/.test(J)&&(N=8),/(^|[^\\])#9/.test(J)&&(N=9),{expand:(r=t==null?void 0:t.expand)!=null?r:!0,captureSelection:(a=t==null?void 0:t.captureSelection)!=null?a:!0,args:N,def:J}}return l({expand:(b=t==null?void 0:t.expand)!=null?b:!0,captureSelection:(L=t==null?void 0:t.captureSelection)!=null?L:!0,args:0},e)}function qe(e){if(!e)return{};const t={};for(const r of Object.keys(e)){const a=e[r];if(a==null)delete t[r];else if(typeof a=="object"&&"package"in a)for(const b of Object.keys(a.package))t[b]=nt(a.package[b],{expand:!a.primitive,captureSelection:a.captureSelection});else t[r]=nt(a)}return t}function Qe(e,t="math"){if(!e||e.length===0)return null;let r=null;if(e.startsWith("\\")){if(r=Ae[e],r)return!r.ifMode||r.ifMode===t?r:null;t==="math"?r=be[e]:T[e]&&(r={definitionType:"symbol",type:"mord",codepoint:T[e]})}else if(t==="math"){if(r=be[e],!r&&e.length===1){const a=vt("math",e.codePointAt(0));return a.startsWith("\\")?h(l({},Qe(a,"math")),{command:a}):null}}else T[e]?r={definitionType:"symbol",type:"mord",codepoint:T[e]}:t==="text"&&(r={definitionType:"symbol",type:"mord",codepoint:e.codePointAt(0)});return r!=null?r:null}function ft(e,t){if(!e.startsWith("\\"))return null;const r=e.slice(1);return t[r]}function vt(e,t){if(t===void 0)return"";if(e==="math"&&Te[t])return Te[t];if(e==="text"){const r=Object.keys(T).find(a=>T[a]===t);return r||String.fromCodePoint(t)}return String.fromCodePoint(t)}var bt=[0,.68889,0,0,.72222],Tt=[0,.68889,0,0,.66667],kr=[0,.68889,0,0,.77778],jr=[0,.68889,0,0,.61111],xn=[.16667,.68889,0,0,.77778],on=[0,.68889,0,0,.55556],er=[0,0,0,0,.25],In=[0,.825,0,0,2.33334],ji=[0,.9,0,0,2.33334],Gi=[0,.68889,0,0,.54028],Bo=[-.03598,.46402,0,0,.5],Sn=[-.13313,.36687,0,0,1],Kt=[.01354,.52239,0,0,1],dt=[.01354,.52239,0,0,1.11111],st=[0,.54986,0,0,1],Et=[0,.69224,0,0,.5],Mt=[0,.43056,0,0,1],kt=[.08198,.58198,0,0,.77778],Yt=[.19444,.69224,0,0,.41667],Jt=[.1808,.675,0,0,1],hr=[.19444,.69224,0,0,.83334],$t=[.13667,.63667,0,0,1],dr=[-.064,.437,0,0,1.334],tr=[.08167,.58167,0,0,.77778],ur=[0,.69224,0,0,.72222],Sr=[0,.69224,0,0,.66667],Nr=[-.13313,.36687,0,0,.77778],sr=[.06062,.54986,0,0,.77778],Wt=[0,.69224,0,0,.77778],xt=[.25583,.75583,0,0,.77778],rr=[.25142,.75726,0,0,.77778],_r=[.20576,.70576,0,0,.77778],vr=[.30274,.79383,0,0,.77778],Zt=[.22958,.72958,0,0,.77778],Fr=[.1808,.675,0,0,.77778],Er=[.13667,.63667,0,0,.77778],Wr=[.13597,.63597,0,0,.77778],at=[.03517,.54986,0,0,.77778],Ht=[0,.675,0,0,.77778],Vi=[.19444,.69224,0,0,.61111],li=[0,.54986,0,0,.76042],ci=[0,.54986,0,0,.66667],Yn=[.0391,.5391,0,0,.77778],mi=[.03517,.54986,0,0,1.33334],Gt=[.38569,.88569,0,0,.77778],_o=[.23222,.74111,0,0,.77778],Bi=[.19444,.69224,0,0,.77778],Zn=[0,.37788,0,0,.5],Un=[0,.54986,0,0,.72222],Jn=[0,.69224,0,0,.83334],ln=[.11111,.69224,0,0,.66667],gi=[.26167,.75726,0,0,.77778],fs=[.48256,.98256,0,0,.77778],xa=[.28481,.79383,0,0,.77778],No=[.08167,.58167,0,0,.22222],Gs=[.08167,.58167,0,0,.38889],Fo=[0,.43056,.04028,0,.66667],zo=[.41951,.91951,0,0,.77778],Ho=[.24982,.74947,0,0,.38865],wo=[.08319,.58283,0,0,.75623],Sa=[0,.10803,0,0,.27764],hs=[0,.47534,0,0,.50181],An=[.18906,.47534,0,0,.50181],Vs=[0,.69141,0,0,.50181],Xs=[.24982,.74947,0,0,.27764],Ti=[0,.69141,0,0,.21471],so=[.25,.75,0,0,.44722],Wn=[0,.64444,0,0,.575],ao=[.08556,.58556,0,0,.89444],Uo=[0,.69444,0,0,.89444],Wo=[0,.68611,0,0,.9],Ko=[0,.68611,0,0,.86944],Ni=[.25,.75,0,0,.575],Fi=[.25,.75,0,0,.31944],Xi=[0,.69444,0,0,.63889],qn=[0,.69444,0,0,.31944],Kn=[0,.44444,0,0,.63889],ds=[0,.44444,0,0,.51111],Yi=[0,.69444,0,0,.575],Se=[.13333,.63333,0,0,.89444],Oe=[0,.44444,0,0,.31944],Ge=[0,.69444,0,0,.86944],Ye=[0,.68611,0,0,.69166],tt=[0,.68611,0,0,.83055],it=[0,.68611,0,0,.89444],_t=[0,.69444,0,0,.60278],Pt=[.19444,.69444,0,0,.51111],Ut=[0,.69444,0,0,.83055],Ft=[-.10889,.39111,0,0,1.14999],nr=[.19444,.69444,0,0,.575],jt=[.19444,.69444,0,0,1.14999],Vt=[.19444,.69444,0,0,.70277],or=[.05556,.75,0,0,.575],pr=[0,.68611,0,0,.95833],Mr=[.08556,.58556,0,0,.76666],Vr=[-.02639,.47361,0,0,.575],zr=[0,.44444,0,0,.89444],Or=[0,.55556,0,0,.76666],wr=[-.10889,.39111,0,0,.89444],cn=[.00222,.50222,0,0,.89444],Br=[.19667,.69667,0,0,.89444],Ar=[.08556,.58556,0,0,1.14999],Xr=[0,.69444,0,0,.70277],Hr=[-.02778,.47222,0,0,.575],yr=[.25,.75,0,0,.51111],Ur=[-.13889,.36111,0,0,1.14999],Kr=[.19444,.69444,0,0,1.02222],ir=[.12963,.69444,0,0,.89444],Lr=[.19444,.69444,0,0,.44722],cr=[0,.64444,.13167,0,.59111],Yr=[.19444,.64444,.13167,0,.59111],ui=[0,.68611,.17208,0,.8961],Ai=[.19444,.44444,.105,0,.53222],$n=[0,.44444,.085,0,.82666],Cr=[0,.69444,.06709,0,.59111],Li=[0,.69444,.12945,0,.35555],Zi=[0,.69444,0,0,.94888],xr=[0,.69444,.11472,0,.59111],un=[0,.68611,.10778,0,.88555],Gn=[0,.69444,.07939,0,.62055],Vn=[0,.69444,.12417,0,.30667],tn=[0,.64444,.13556,0,.51111],jn=[.19444,.64444,.13556,0,.51111],pn=[0,.68333,.16389,0,.74333],Ji=[.19444,.43056,.08847,0,.46],qi=[0,.43056,.07514,0,.71555],Ys=[0,.69444,.06646,0,.51111],Ca=[0,.69444,0,0,.83129],xo=[0,.69444,.1225,0,.51111],vi=[0,.68333,.09403,0,.76666],$o=[0,.68333,.11111,0,.76666],rn=[0,.69444,.06961,0,.51444],Qn=[0,.69444,0,0,.27778],Cn=[.25,.75,0,0,.38889],Bn=[0,.64444,0,0,.5],lo=[0,.69444,0,0,.77778],Qi=[0,.68333,0,0,.75],So=[0,.68333,0,0,.77778],ps=[0,.68333,0,0,.68056],Co=[0,.68333,0,0,.72222],Oi=[.25,.75,0,0,.5],eo=[.25,.75,0,0,.27778],mr=[0,.69444,0,0,.5],Go=[0,.69444,0,0,.55556],zi=[0,.43056,0,0,.44445],Hi=[0,.43056,0,0,.5],ka=[.19444,.43056,0,0,.55556],Ja=[0,.43056,0,0,.55556],Ci=[.08333,.58333,0,0,.77778],Ea=[0,.43056,0,0,.27778],co=[0,.66786,0,0,.27778],Ma=[0,.69444,0,0,.75],Zs=[0,.66786,0,0,.5],ms=[0,.68333,0,0,.625],gs=[.19444,.69444,0,0,.44445],Vo=[0,.69444,0,0,.72222],Ta=[.19444,.69444,0,0,.5],fi=[.19444,.69444,0,0,1],Aa=[.011,.511,0,0,1.126],ko=[.19444,.69444,0,0,.61111],vs=[.05556,.75,0,0,.5],La=[0,.68333,0,0,.83334],ys=[.0391,.5391,0,0,.66667],Js=[-.05555,.44445,0,0,.5],Rl=[0,.43056,0,0,.77778],Eo=[0,.55556,0,0,.66667],Qs=[-.03625,.46375,0,0,.77778],Mo=[-.01688,.48312,0,0,.77778],Xo=[.0391,.5391,0,0,1],yi=[0,.69444,0,0,.61111],to=[-.03472,.46528,0,0,.5],To=[.25,.75,0,0,.44445],ea=[-.14236,.35764,0,0,1],Yo=[.244,.744,0,0,.412],uo=[.19444,.69444,0,0,.88889],Rr=[.12963,.69444,0,0,.77778],Qt=[.19444,.69444,0,0,.38889],nn=[.011,.511,0,0,1.638],hn=[.19444,.69444,0,0,0],bi=[0,.44444,0,0,.575],_i=[.19444,.44444,0,0,.575],qa=[0,.68611,0,0,.75555],Oa=[0,.69444,0,0,.66759],Rc=[0,.68611,0,0,.80555],Ic=[0,.68611,.08229,0,.98229],Qa=[0,.68611,0,0,.76666],Ku=[0,.44444,0,0,.58472],Il=[.19444,.44444,0,0,.6118],Da=[.19444,.43056,0,0,.5],jc=[0,.68333,.02778,.08334,.76278],jl=[0,.68333,.08125,.05556,.83125],ta=[0,.43056,0,.05556,.48472],el=[.19444,.43056,0,.08334,.51702],Bc=[.25,.75,0,0,.42778],Nn=[0,.69444,0,0,.55],Zo=[0,.69444,0,0,.73334],bs=[0,.69444,0,0,.79445],$u=[0,.69444,0,0,.51945],tl=[0,.69444,0,0,.70278],Bl=[0,.69444,0,0,.76389],ra=[.25,.75,0,0,.34306],na=[0,.69444,0,0,.56111],Gu=[0,.69444,0,0,.25556],rl=[.19444,.45833,0,0,.56111],Nc=[0,.45833,0,0,.56111],_s=[0,.69444,0,0,.30556],Fc=[0,.69444,0,0,.58056],ws=[0,.69444,0,0,.67223],ia=[0,.69444,0,0,.85556],Jo=[0,.69444,0,0,.55834],Di=[0,.65556,.11156,0,.5],xs=[0,.69444,.08094,0,.70834],Nl=[.17014,0,0,0,.44445],zc=[0,.69444,.0799,0,.5],Hc=[0,.69444,0,0,.73752],Vu=[0,.69444,.09205,0,.5],Ss=[0,.69444,.09031,0,.77778],qo=[0,.69444,.07816,0,.27778],Xu=[0,.69444,.00316,0,.5],Yu=[.19444,.69444,0,0,.83334],Zu=[.05556,.75,0,0,.83334],Ju=[0,.75,0,0,.5],qu=[.125,.08333,0,0,.27778],Qu=[0,.08333,0,0,.27778],yn=[0,.65556,0,0,.5],Ln=[0,.69444,0,0,.47222],mn=[0,.69444,0,0,.66667],Fn=[0,.69444,0,0,.59722],oa=[0,.69444,0,0,.54167],Uc=[0,.69444,0,0,.70834],nl=[.25,.75,0,0,.28889],Wc=[0,.69444,0,0,.51667],ef=[0,.44444,0,0,.44445],tf=[.19444,.44444,0,0,.51667],Fl=[0,.44444,0,0,.38333],Kc=[0,.44444,0,0,.51667],zl=[0,.69444,0,0,.83334],rf=[.35001,.85,0,0,.45834],Hl=[.35001,.85,0,0,.57778],Ul=[.35001,.85,0,0,.41667],$c=[.35001,.85,0,0,.58334],il=[0,.72222,0,0,.55556],Wl=[1e-5,.6,0,0,.66667],Gc=[1e-5,.6,0,0,.77778],Pa=[.25001,.75,0,0,.94445],nf=[.306,.805,.19445,0,.47222],ol=[.30612,.805,.19445,0,.47222],ei=[.25001,.75,0,0,.83334],sa=[.35001,.85,0,0,.47222],Vc=[.25001,.75,0,0,1.11111],Xc=[.65002,1.15,0,0,.59722],Pi=[.65002,1.15,0,0,.81111],Ir=[.65002,1.15,0,0,.47222],ro=[.65002,1.15,0,0,.66667],fo=[0,.75,0,0,1],Qo=[.55001,1.05,0,0,1.27778],Yc=[.862,1.36,.44445,0,.55556],Kl=[.86225,1.36,.44445,0,.55556],aa=[.55001,1.05,0,0,1.11111],$l=[.65002,1.15,0,0,.52778],Gl=[.65002,1.15,0,0,.61111],la=[.55001,1.05,0,0,1.51112],Zc=[.95003,1.45,0,0,.73611],Vl=[.95003,1.45,0,0,1.04445],es=[.95003,1.45,0,0,.52778],sl=[.95003,1.45,0,0,.75],al=[0,.75,0,0,1.44445],Xl=[.95003,1.45,0,0,.58334],ll=[1.25003,1.75,0,0,.79167],Yl=[1.25003,1.75,0,0,1.27778],Jc=[1.25003,1.75,0,0,.58334],Zl=[1.25003,1.75,0,0,.80556],cl=[0,.825,0,0,1.8889],Jl=[1.25003,1.75,0,0,.63889],ql=[.64502,1.155,0,0,.875],ul=[1e-5,.6,0,0,.875],Ql=[-99e-5,.601,0,0,.66667],ec=[.64502,1.155,0,0,.66667],of=[1e-5,.9,0,0,.88889],qc=[.65002,1.15,0,0,.88889],ca=[.90001,0,0,0,.88889],tc=[-.00499,.605,0,0,1.05556],ua=[0,.12,0,0,.45],Ot=[0,.61111,0,0,.525],Ui=[.08333,.69444,0,0,.525],Qc=[-.08056,.53055,0,0,.525],sf=[-.05556,.55556,0,0,.525],wi=[0,.43056,0,0,.525],On=[.22222,.43056,0,0,.525],fl=[0,0,0,0,.525],af={"AMS-Regular":{32:er,65:bt,66:Tt,67:bt,68:bt,69:Tt,70:jr,71:kr,72:kr,73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:kr,76:Tt,77:[0,.68889,0,0,.94445],78:bt,79:xn,80:jr,81:xn,82:bt,83:on,84:Tt,85:bt,86:bt,87:[0,.68889,0,0,1],88:bt,89:bt,90:Tt,107:on,160:er,165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:on,295:Gi,710:In,732:ji,770:In,771:ji,989:tr,1008:Fo,8245:[0,.54986,0,0,.275],8463:Gi,8487:bt,8498:on,8502:Tt,8503:[0,.68889,0,0,.44445],8504:Tt,8513:[0,.68889,0,0,.63889],8592:Bo,8594:Bo,8602:Sn,8603:Sn,8606:Kt,8608:Kt,8610:dt,8611:dt,8619:st,8620:st,8621:[-.13313,.37788,0,0,1.38889],8622:Sn,8624:Et,8625:Et,8630:Mt,8631:Mt,8634:kt,8635:kt,8638:Yt,8639:Yt,8642:Yt,8643:Yt,8644:Jt,8646:Jt,8647:Jt,8648:hr,8649:Jt,8650:hr,8651:Kt,8652:Kt,8653:Sn,8654:Sn,8655:Sn,8666:$t,8667:$t,8669:[-.13313,.37788,0,0,1],8672:dr,8674:dr,8705:[0,.825,0,0,.5],8708:on,8709:tr,8717:[0,.43056,0,0,.42917],8722:Bo,8724:[.08198,.69224,0,0,.77778],8726:tr,8733:Wt,8736:ur,8737:ur,8738:[.03517,.52239,0,0,.72222],8739:No,8740:[.25142,.74111,0,0,.27778],8741:Gs,8742:[.25142,.74111,0,0,.5],8756:Sr,8757:Sr,8764:Nr,8765:[-.13313,.37788,0,0,.77778],8769:Nr,8770:Qs,8774:vr,8776:Mo,8778:tr,8782:sr,8783:sr,8785:kt,8786:kt,8787:kt,8790:Wt,8791:Zt,8796:[.08198,.91667,0,0,.77778],8806:xt,8807:xt,8808:rr,8809:rr,8812:[.25583,.75583,0,0,.5],8814:_r,8815:_r,8816:vr,8817:vr,8818:Zt,8819:Zt,8822:Fr,8823:Fr,8828:Er,8829:Er,8830:Zt,8831:Zt,8832:_r,8833:_r,8840:vr,8841:vr,8842:Wr,8843:Wr,8847:at,8848:at,8858:kt,8859:kt,8861:kt,8862:Ht,8863:Ht,8864:Ht,8865:Ht,8872:[0,.69224,0,0,.61111],8873:ur,8874:[0,.69224,0,0,.88889],8876:jr,8877:jr,8878:bt,8879:bt,8882:at,8883:at,8884:Er,8885:Er,8888:[0,.54986,0,0,1.11111],8890:ka,8891:Vi,8892:Vi,8901:[0,.54986,0,0,.27778],8903:tr,8905:tr,8906:tr,8907:Wt,8908:Wt,8909:[-.03598,.46402,0,0,.77778],8910:li,8911:li,8912:at,8913:at,8914:ci,8915:ci,8916:Sr,8918:Yn,8919:Yn,8920:mi,8921:mi,8922:Gt,8923:Gt,8926:Er,8927:Er,8928:vr,8929:vr,8934:_o,8935:_o,8936:_o,8937:_o,8938:_r,8939:_r,8940:vr,8941:vr,8994:Bi,8995:Bi,9416:[.15559,.69224,0,0,.90222],9484:Et,9488:Et,9492:Zn,9496:Zn,9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:Ht,9633:Ht,9650:Un,9651:Un,9654:at,9660:Un,9661:Un,9664:at,9674:ln,9733:[.19444,.69224,0,0,.94445],10003:Jn,10016:Jn,10731:ln,10846:[.19444,.75583,0,0,.61111],10877:Er,10878:Er,10885:xt,10886:xt,10887:Wr,10888:Wr,10889:gi,10890:gi,10891:fs,10892:fs,10901:Er,10902:Er,10933:rr,10934:rr,10935:gi,10936:gi,10937:gi,10938:gi,10949:xt,10950:xt,10955:xa,10956:xa,57350:No,57351:Gs,57352:tr,57353:Fo,57356:rr,57357:rr,57358:zo,57359:vr,57360:vr,57361:zo,57366:rr,57367:rr,57368:rr,57369:rr,57370:Wr,57371:Wr},"Caligraphic-Regular":{32:er,65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:er},"Fraktur-Regular":{32:er,33:[0,.69141,0,0,.29574],34:Ti,38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:Ho,41:Ho,42:[0,.62119,0,0,.27764],43:wo,44:Sa,45:wo,46:Sa,47:[.24982,.74947,0,0,.50181],48:hs,49:hs,50:hs,51:An,52:An,53:An,54:Vs,55:An,56:Vs,57:An,58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:Xs,93:Xs,94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:er,8216:Ti,8217:Ti,58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:er,33:[0,.69444,0,0,.35],34:_t,35:[.19444,.69444,0,0,.95833],36:or,37:[.05556,.75,0,0,.95833],38:Uo,39:qn,40:so,41:so,42:[0,.75,0,0,.575],43:Se,44:[.19444,.15556,0,0,.31944],45:Fl,46:[0,.15556,0,0,.31944],47:Ni,48:Wn,49:Wn,50:Wn,51:Wn,52:Wn,53:Wn,54:Wn,55:Wn,56:Wn,57:Wn,58:Oe,59:[.19444,.44444,0,0,.31944],60:ao,61:wr,62:ao,63:[0,.69444,0,0,.54305],64:Uo,65:Ko,66:[0,.68611,0,0,.81805],67:tt,68:[0,.68611,0,0,.88194],69:qa,70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:Wo,73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:Ye,77:[0,.68611,0,0,1.09166],78:Wo,79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:Ko,89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:Fi,92:Ni,93:Fi,94:Yi,95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:Xi,99:ds,100:Xi,101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:Xi,105:qn,106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:qn,109:[0,.44444,0,0,.95833],110:Kn,111:bi,112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:Kn,118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:ds,123:Ni,124:Fi,125:Ni,126:[.35,.34444,0,0,.575],160:er,163:[0,.69444,0,0,.86853],168:Yi,172:[0,.44444,0,0,.76666],176:Ge,177:Se,184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:Se,216:[.04861,.73472,0,0,.89444],223:Fn,230:[0,.44444,0,0,.83055],247:Se,248:[.09722,.54167,0,0,.575],305:Oe,338:[0,.68611,0,0,1.16944],339:zr,567:[.19444,.44444,0,0,.35139],710:Yi,711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:Yi,715:Yi,728:Yi,729:qn,730:Ge,732:Yi,733:Yi,915:Ye,916:pr,920:it,923:Rc,926:Qa,928:Wo,931:tt,933:it,934:tt,936:it,937:tt,8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:qn,8217:qn,8220:_t,8221:_t,8224:Pt,8225:Pt,8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:Oa,8465:Ut,8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:Ut,8501:Xr,8592:Ft,8593:nr,8594:Ft,8595:nr,8596:Ft,8597:Ni,8598:jt,8599:jt,8600:jt,8601:jt,8636:Ft,8637:Ft,8640:Ft,8641:Ft,8656:Ft,8657:Vt,8658:Ft,8659:Vt,8660:Ft,8661:[.25,.75,0,0,.70277],8704:Xi,8706:[0,.69444,.06389,0,.62847],8707:Xi,8709:or,8711:pr,8712:Mr,8715:Mr,8722:Se,8723:Se,8725:Ni,8726:Ni,8727:Hr,8728:Vr,8729:Vr,8730:[.18,.82,0,0,.95833],8733:zr,8734:[0,.44444,0,0,1.14999],8736:ur,8739:Fi,8741:Ni,8743:Or,8744:Or,8745:Or,8746:Or,8747:[.19444,.69444,.12778,0,.56875],8764:wr,8768:[.19444,.69444,0,0,.31944],8771:cn,8776:[.02444,.52444,0,0,.89444],8781:cn,8801:cn,8804:Br,8805:Br,8810:Ar,8811:Ar,8826:ao,8827:ao,8834:ao,8835:ao,8838:Br,8839:Br,8846:Or,8849:Br,8850:Br,8851:Or,8852:Or,8853:Se,8854:Se,8855:Se,8856:Se,8857:Se,8866:Xr,8867:Xr,8868:Uo,8869:Uo,8900:Vr,8901:[-.02639,.47361,0,0,.31944],8902:Hr,8968:yr,8969:yr,8970:yr,8971:yr,8994:Ur,8995:Ur,9651:Kr,9657:Hr,9661:Kr,9667:Hr,9711:jt,9824:ir,9825:ir,9826:ir,9827:ir,9837:[0,.75,0,0,.44722],9838:Lr,9839:Lr,10216:so,10217:so,10815:Wo,10927:Br,10928:Br,57376:hn},"Main-BoldItalic":{32:er,33:[0,.69444,.11417,0,.38611],34:Gn,35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:Li,40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:cr,49:cr,50:cr,51:cr,52:Yr,53:cr,54:cr,55:Yr,56:cr,57:cr,58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:xr,64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:ui,73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:ui,79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:Cr,95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:Ai,104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:Ai,114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:er,168:[0,.69444,.11473,0,.59111],176:Zi,184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:$n,248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:$n,567:[.19444,.44444,.04611,0,.385],710:Cr,711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:Li,730:Zi,732:xr,733:xr,915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:ui,931:[0,.68611,.11431,0,.82666],933:un,934:[0,.68611,.05632,0,.82666],936:un,937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:Li,8217:Li,8220:[0,.69444,.16772,0,.62055],8221:Gn},"Main-Italic":{32:er,33:Vn,34:rn,35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:Vn,40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:tn,49:tn,50:tn,51:tn,52:jn,53:tn,54:tn,55:jn,56:tn,57:tn,58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:xo,64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:pn,73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:pn,79:vi,80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:pn,86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:Ys,95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:Ji,104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:Ji,114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:er,168:[0,.66786,.10474,0,.51111],176:Ca,184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:qi,248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:qi,710:Ys,711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:Ca,732:[0,.66786,.11585,0,.51111],733:xo,915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:vi,923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:pn,931:[0,.68333,.12028,0,.71555],933:$o,934:[0,.68333,.05986,0,.71555],936:$o,937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:Vn,8217:Vn,8220:[0,.69444,.1685,0,.51444],8221:rn,8463:Gi},"Main-Regular":{32:er,33:Qn,34:mr,35:Yu,36:vs,37:Zu,38:lo,39:Qn,40:Cn,41:Cn,42:Ju,43:Ci,44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:Oi,48:Bn,49:Bn,50:Bn,51:Bn,52:Bn,53:Bn,54:Bn,55:Bn,56:Bn,57:Bn,58:Ea,59:[.19444,.43056,0,0,.27778],60:Yn,61:Nr,62:Yn,63:Ln,64:lo,65:Qi,66:[0,.68333,0,0,.70834],67:Co,68:[0,.68333,0,0,.76389],69:ps,70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:Qi,73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:So,76:ms,77:[0,.68333,0,0,.91667],78:Qi,79:So,80:ps,81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:Co,85:Qi,86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:Qi,89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:eo,92:Oi,93:eo,94:mr,95:[.31,.12056,.02778,0,.5],97:Hi,98:Go,99:zi,100:Go,101:zi,102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:Go,105:co,106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:Qn,109:[0,.43056,0,0,.83334],110:Ja,111:Hi,112:ka,113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:Ja,118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:zi,123:Oi,124:eo,125:Oi,126:[.35,.31786,0,0,.5],160:er,163:[0,.69444,0,0,.76909],167:gs,168:Zs,172:[0,.43056,0,0,.66667],176:Ma,177:Ci,182:ko,184:Nl,198:[0,.68333,0,0,.90278],215:Ci,216:[.04861,.73194,0,0,.77778],223:mr,230:[0,.43056,0,0,.72222],247:Ci,248:[.09722,.52778,0,0,.5],305:Ea,338:[0,.68333,0,0,1.01389],339:Rl,567:[.19444,.43056,0,0,.30556],710:mr,711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:mr,715:mr,728:mr,729:co,730:Ma,732:Zs,733:mr,915:ms,916:La,920:So,923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:Qi,931:Co,933:So,934:Co,936:So,937:Co,8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:Qn,8217:Qn,8220:mr,8221:mr,8224:gs,8225:gs,8230:[0,.12,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:Gi,8465:Vo,8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:Vo,8501:yi,8592:Sn,8593:Ta,8594:Sn,8595:Ta,8596:Sn,8597:Oi,8598:fi,8599:fi,8600:fi,8601:fi,8614:[.011,.511,0,0,1],8617:Aa,8618:Aa,8636:Sn,8637:Sn,8640:Sn,8641:Sn,8652:[.011,.671,0,0,1],8656:Sn,8657:ko,8658:Sn,8659:ko,8660:Sn,8661:[.25,.75,0,0,.61111],8704:Go,8706:[0,.69444,.05556,.08334,.5309],8707:Go,8709:vs,8711:La,8712:ys,8715:ys,8722:Ci,8723:Ci,8725:Oi,8726:Oi,8727:to,8728:Js,8729:Js,8730:[.2,.8,0,0,.83334],8733:Rl,8734:Mt,8736:ur,8739:eo,8741:Oi,8743:Eo,8744:Eo,8745:Eo,8746:Eo,8747:[.19444,.69444,.11111,0,.41667],8764:Nr,8768:[.19444,.69444,0,0,.27778],8771:Qs,8773:[-.022,.589,0,0,1],8776:Mo,8781:Qs,8784:[-.133,.67,0,0,.778],8801:Qs,8804:Wr,8805:Wr,8810:Xo,8811:Xo,8826:Yn,8827:Yn,8834:Yn,8835:Yn,8838:Wr,8839:Wr,8846:Eo,8849:Wr,8850:Wr,8851:Eo,8852:Eo,8853:Ci,8854:Ci,8855:Ci,8856:Ci,8857:Ci,8866:yi,8867:yi,8868:lo,8869:lo,8872:[.249,.75,0,0,.867],8900:Js,8901:[-.05555,.44445,0,0,.27778],8902:to,8904:[.005,.505,0,0,.9],8942:[.03,.9,0,0,.278],8943:[-.19,.31,0,0,1.172],8945:[-.1,.82,0,0,1.282],8968:To,8969:To,8970:To,8971:To,8994:ea,8995:ea,9136:Yo,9137:Yo,9651:uo,9657:to,9661:uo,9667:to,9711:fi,9824:Rr,9825:Rr,9826:Rr,9827:Rr,9837:[0,.75,0,0,.38889],9838:Qt,9839:Qt,10216:Cn,10217:Cn,10222:Yo,10223:Yo,10229:[.011,.511,0,0,1.609],10230:nn,10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:nn,10815:Qi,10927:Wr,10928:Wr,57376:hn},"Math-BoldItalic":{32:er,48:bi,49:bi,50:bi,51:_i,52:_i,53:_i,54:Wn,55:_i,56:Wn,57:_i,65:Ko,66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:Ic,73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:qa,77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:Oa,105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:Ku,112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:er,915:[0,.68611,.15972,0,.65694],916:pr,920:[0,.68611,.03194,0,.86722],923:Rc,926:[0,.68611,.07458,0,.84125],928:Ic,931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:Qa,936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:Ku,960:[0,.44444,.03704,0,.68241],961:Il,962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:Il,1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:er,48:Hi,49:Hi,50:Hi,51:Da,52:Da,53:Da,54:Bn,55:Da,56:Bn,57:Da,65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:jl,73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:jc,80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:ta,112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:er,915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:jc,923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:jl,931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:ta,960:[0,.43056,.03588,0,.57003],961:el,962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:el,1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:er,33:[0,.69444,0,0,.36667],34:Jo,35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:_s,40:Bc,41:Bc,42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:Nn,49:Nn,50:Nn,51:Nn,52:Nn,53:Nn,54:Nn,55:Nn,56:Nn,57:Nn,58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:$u,64:Zo,65:Zo,66:Zo,67:tl,68:bs,69:[0,.69444,0,0,.64167],70:yi,71:Zo,72:bs,73:[0,.69444,0,0,.33056],74:$u,75:Bl,76:Fc,77:[0,.69444,0,0,.97778],78:bs,79:bs,80:tl,81:[.10556,.69444,0,0,.79445],82:tl,83:yi,84:Zo,85:Bl,86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:Zo,89:[0,.69444,.0275,0,.73334],90:ws,91:ra,93:ra,94:Nn,95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:na,99:[0,.45833,0,0,.48889],100:na,101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:na,105:Gu,106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:Gu,109:[0,.45833,0,0,.86667],110:Nc,111:[0,.45833,0,0,.55],112:rl,113:rl,114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:Nc,118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:er,168:Nn,176:Zo,180:Nn,184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:Nn,711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:Nn,729:_s,730:Zo,732:Nn,733:Nn,915:Fc,916:[0,.69444,0,0,.91667],920:ia,923:ws,926:Zo,928:bs,931:bs,933:ia,934:bs,936:ia,937:bs,8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:_s,8217:_s,8220:Jo,8221:Jo},"SansSerif-Italic":{32:er,33:[0,.69444,.05733,0,.31945],34:Xu,35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:qo,40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:qu,45:[0,.44444,.01946,0,.33333],46:Qu,47:[.25,.75,.13164,0,.5],48:Di,49:Di,50:Di,51:Di,52:Di,53:Di,54:Di,55:Di,56:Di,57:Di,58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:mn,66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:xs,73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:oa,77:[0,.69444,.08094,0,.875],78:xs,79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:zc,95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:er,168:[0,.67937,.06385,0,.5],176:Hc,184:Nl,305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:zc,711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:Vu,715:mr,728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:Hc,732:[0,.67659,.08826,0,.5],733:Vu,915:[0,.69444,.13372,0,.54167],916:zl,920:[0,.69444,.07555,0,.77778],923:yi,926:[0,.69444,.12816,0,.66667],928:xs,931:[0,.69444,.11983,0,.72222],933:Ss,934:[0,.69444,.04603,0,.72222],936:Ss,937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:qo,8217:qo,8220:[0,.69444,.14205,0,.5],8221:Xu},"SansSerif-Regular":{32:er,33:[0,.69444,0,0,.31945],34:mr,35:Yu,36:vs,37:Zu,38:[0,.69444,0,0,.75834],39:Qn,40:Cn,41:Cn,42:Ju,43:Ci,44:qu,45:[0,.44444,0,0,.33333],46:Qu,47:Oi,48:yn,49:yn,50:yn,51:yn,52:yn,53:yn,54:yn,55:yn,56:yn,57:yn,58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:Ln,64:mn,65:mn,66:mn,67:Xi,68:[0,.69444,0,0,.72223],69:Fn,70:[0,.69444,0,0,.56945],71:mn,72:Uc,73:Qn,74:Ln,75:[0,.69444,0,0,.69445],76:oa,77:[0,.69444,0,0,.875],78:Uc,79:[0,.69444,0,0,.73611],80:Xi,81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:Go,84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:mn,89:[0,.69444,.025,0,.66667],90:yi,91:nl,93:nl,94:mr,95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:Wc,99:ef,100:Wc,101:ef,102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:Wc,105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:Kc,111:[0,.44444,0,0,.5],112:tf,113:tf,114:[0,.44444,.01389,0,.34167],115:Fl,116:[0,.57143,0,0,.36111],117:Kc,118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:er,168:[0,.67937,0,0,.5],176:mn,184:Nl,305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:mr,711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:mr,715:mr,728:mr,729:[0,.67937,0,0,.27778],730:mn,732:[0,.67659,0,0,.5],733:mr,915:oa,916:zl,920:lo,923:yi,926:mn,928:Uc,931:Vo,933:lo,934:Vo,936:lo,937:Vo,8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:Qn,8217:Qn,8220:mr,8221:mr},"Script-Regular":{32:er,65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:er},"Size1-Regular":{32:er,40:rf,41:rf,47:Hl,91:Ul,92:Hl,93:Ul,123:$c,125:$c,160:er,710:il,732:il,770:il,771:il,8214:[-99e-5,.601,0,0,.77778],8593:Wl,8595:Wl,8657:Gc,8659:Gc,8719:Pa,8720:Pa,8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:ol,8748:nf,8749:nf,8750:ol,8896:ei,8897:ei,8898:ei,8899:ei,8968:sa,8969:sa,8970:sa,8971:sa,9168:Ql,10216:sa,10217:sa,10752:Vc,10753:Vc,10754:Vc,10756:ei,10758:ei},"Size2-Regular":{32:er,40:Xc,41:Xc,47:Pi,91:Ir,92:Pi,93:Ir,123:ro,125:ro,160:er,710:fo,732:fo,770:fo,771:fo,8719:Qo,8720:Qo,8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:Kl,8748:Yc,8749:Yc,8750:Kl,8896:aa,8897:aa,8898:aa,8899:aa,8968:$l,8969:$l,8970:$l,8971:$l,10216:Gl,10217:Gl,10752:la,10753:la,10754:la,10756:aa,10758:aa},"Size3-Regular":{32:er,40:Zc,41:Zc,47:Vl,91:es,92:Vl,93:es,123:sl,125:sl,160:er,710:al,732:al,770:al,771:al,8730:[.95003,1.45,0,0,1],8968:Xl,8969:Xl,8970:Xl,8971:Xl,10216:sl,10217:sl},"Size4-Regular":{32:er,40:ll,41:ll,47:Yl,91:Jc,92:Yl,93:Jc,123:Zl,125:Zl,160:er,710:cl,732:cl,770:cl,771:cl,8730:[1.25003,1.75,0,0,1],8968:Jl,8969:Jl,8970:Jl,8971:Jl,9115:ql,9116:ul,9117:ql,9118:ql,9119:ul,9120:ql,9121:ec,9122:Ql,9123:ec,9124:ec,9125:Ql,9126:ec,9127:of,9128:qc,9129:ca,9130:[0,.3,0,0,.88889],9131:of,9132:qc,9133:ca,9143:[.88502,.915,0,0,1.05556],10216:Zl,10217:Zl,57344:tc,57345:tc,57680:ua,57681:ua,57682:ua,57683:ua},"Typewriter-Regular":{32:fl,33:Ot,34:Ot,35:Ot,36:Ui,37:Ui,38:Ot,39:Ot,40:Ui,41:Ui,42:[0,.52083,0,0,.525],43:Qc,44:[.13889,.125,0,0,.525],45:Qc,46:[0,.125,0,0,.525],47:Ui,48:Ot,49:Ot,50:Ot,51:Ot,52:Ot,53:Ot,54:Ot,55:Ot,56:Ot,57:Ot,58:wi,59:[.13889,.43056,0,0,.525],60:sf,61:[-.19549,.41562,0,0,.525],62:sf,63:Ot,64:Ot,65:Ot,66:Ot,67:Ot,68:Ot,69:Ot,70:Ot,71:Ot,72:Ot,73:Ot,74:Ot,75:Ot,76:Ot,77:Ot,78:Ot,79:Ot,80:Ot,81:[.13889,.61111,0,0,.525],82:Ot,83:Ot,84:Ot,85:Ot,86:Ot,87:Ot,88:Ot,89:Ot,90:Ot,91:Ui,92:Ui,93:Ui,94:Ot,95:[.09514,0,0,0,.525],96:Ot,97:wi,98:Ot,99:wi,100:Ot,101:wi,102:Ot,103:On,104:Ot,105:Ot,106:[.22222,.61111,0,0,.525],107:Ot,108:Ot,109:wi,110:wi,111:wi,112:On,113:On,114:wi,115:wi,116:[0,.55358,0,0,.525],117:wi,118:wi,119:wi,120:wi,121:On,122:wi,123:Ui,124:Ui,125:Ui,126:Ot,127:Ot,160:fl,176:Ot,184:[.19445,0,0,0,.525],305:wi,567:On,711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:Ot,715:Ot,728:Ot,730:Ot,770:Ot,771:Ot,776:Ot,915:Ot,916:Ot,920:Ot,923:Ot,926:Ot,928:Ot,931:Ot,933:Ot,934:Ot,936:Ot,937:Ot,8216:Ot,8217:Ot,8242:Ot,9251:[.11111,.21944,0,0,.525]}},lf=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,fa=10,xi=.25,rc=1.2,ts=.431,eu={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[ts,ts,ts],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.5,.732,.925],num2:[.394,.384,.5],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[xi,xi,xi],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04]},nc=[0,.5,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Cs=5,tu={"\xA0":" ","\u200B":" ",\u00C5:"A",\u00C7:"C",\u00D0:"D",\u00DE:"o",\u00E5:"a",\u00E7:"c",\u00F0:"d",\u00FE:"o",\u0410:"A",\u0411:"B",\u0412:"B",\u0413:"F",\u0414:"A",\u0415:"E",\u0416:"K",\u0417:"3",\u0418:"N",\u0419:"N",\u041A:"K",\u041B:"N",\u041C:"M",\u041D:"H",\u041E:"O",\u041F:"N",\u0420:"P",\u0421:"C",\u0422:"T",\u0423:"y",\u0424:"O",\u0425:"X",\u0426:"U",\u0427:"h",\u0428:"W",\u0429:"W",\u042A:"B",\u042B:"X",\u042C:"B",\u042D:"3",\u042E:"X",\u042F:"R",\u0430:"a",\u0431:"b",\u0432:"a",\u0433:"r",\u0434:"y",\u0435:"e",\u0436:"m",\u0437:"e",\u0438:"n",\u0439:"n",\u043A:"n",\u043B:"n",\u043C:"m",\u043D:"n",\u043E:"o",\u043F:"n",\u0440:"p",\u0441:"c",\u0442:"o",\u0443:"y",\u0444:"b",\u0445:"x",\u0446:"n",\u0447:"n",\u0448:"w",\u0449:"w",\u044A:"a",\u044B:"m",\u044C:"a",\u044D:"e",\u044E:"m",\u044F:"r"};function rs(e,t){e===void 0&&(e=77);const r=af[t][e];if(r)return{defaultMetrics:!1,depth:r[0],height:r[1],italic:r[2],skew:r[3],width:r[4]};if(e===11034)return{defaultMetrics:!0,depth:.2,height:.8,italic:0,skew:0,width:.8};const a=String.fromCodePoint(e);if(a in tu)e=tu[a].codePointAt(0);else if(lf.test(a))return e=77,{defaultMetrics:!0,depth:.2,height:.9,italic:0,skew:0,width:1};return{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0,width:.8}}var ic={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],longrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],longleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],longleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],longrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],longleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xleftrightarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],longleftrightarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xRightleftharpoons:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],longRightleftharpoons:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xLeftrightharpoons:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716],longLeftrightharpoons:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},ha={widehat1:[1062,239,.24],widehat2:[2364,300,.3],widehat3:[2364,360,.36],widehat4:[2364,420,.42],widecheck1:[1062,239,.24],widecheck2:[2364,300,.3],widecheck3:[2364,360,.36],widecheck4:[2364,420,.42],widetilde1:[600,260,.26],widetilde2:[1033,286,.286],widetilde3:[2339,306,.306],widetilde4:[2340,312,.34],overarc:[1061,159,.3],underarc:[1061,159,.3]},cf={doubleleftarrow:`M262 157
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,overarc:"M529 0c179 0 524 115 524 115 5 1 9 5 9 10 0 1-1 2-1 3l-4 22c-1 5-5 9-11 9h-2s-338-93-512-92c-174 0-513 92-513 92h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13 0 0 342-115 520-115z",underarc:`m 529 160
c -179 0 -524 -115 -524 -115
c -5 -1 -9 -5 -9 -10
c 0 -1 1 -2 1 -3
l 4 -22
c 1 -5 5 -9 11 -9
h 2
s 338 93 512 92
c 174 0 513 -92 513 -92
h 2
c 5 0 9 4 11 9
l 5 22
c 1 6 -2 12 -8 13
c 0 0 -342 115 -520 115
z
`,leftgroup:`M400000 80
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
435 0h399565z`,leftgroupunder:`M400000 262
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,widetilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
-68.267.847-113-73.952-191-73.952z`,widetilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,widetilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
-338 0-409-156.573-744-156.573z`,widetilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`};function Ra(e){if(ha[e]){const[ue,pe,Ee]=ha[e],De=`<span class="stretchy" style="height:${Ee}em"><svg width="100%" height="${Ee}em" viewBox="0 0 ${ue} ${pe}" preserveAspectRatio="none" ><path fill="currentcolor" d="${cf[e]}"></path></svg></span>`;return`<span style="display:inline-block;height:${Math.floor(100*Ee/2)/100}em;min-width:0">${De}</span>`}const[t,r,a,b]=ic[e];let L,N;const J=a/1e3;t.length===3?(L=["slice-1-of-3","slice-2-of-3","slice-3-of-3"],N=["xMinYMin","xMidYMin","xMaxYMin"]):t.length===2?(L=["slice-1-of-2","slice-2-of-2"],N=["xMinYMin","xMaxYMin"]):(L=["slice-1-of-1"],N=[b]);const ie=t.map((ue,pe)=>`<span class="${L[pe]}" style=height:${J}em><svg width=400em height=${J}em viewBox="0 0 400000 ${a}" preserveAspectRatio="${N[pe]} slice"><path fill="currentcolor" d="${cf[ue]}"></path></svg></span>`).join("");return`<span style="display:inline-block;height:${J}em;min-width:${r}em;">${ie}</span>`}function uf(e){return ic[e]?ic[e][2]/1e3:ha[e][2]}function ff(e){const t=[];for(let r=0;r<e.length;r++){let a=e.charCodeAt(r);if(a===13&&e.charCodeAt(r+1)===10&&(a=10,r++),(a===13||a===12)&&(a=10),a===0&&(a=65533),a>=55296&&a<=56319){const b=e.charCodeAt(r+1);if(b>=56320&&b<=57343){const L=a-55296,N=b-56320;a=$s(2,16)+L*$s(2,10)+N,r++}}t.push(a)}return t}var hl=8205,dl=[[hl,1],[65038,2],[127995,5],[129456,4],[917536,96]],ks,Ia=[127462,127487];function ja(e){var t;if(ks===void 0){ks={};for(const r of dl)for(let a=r[0];a<=r[0]+r[1]-1;a++)ks[a]=!0}return(t=ks[e])!=null?t:!1}function hf(e){return e>=Ia[0]&&e<=Ia[1]}function df(e){if(/^[\u0020-\u00FF]*$/.test(e))return e;const t=[],r=ff(e);let a=0;for(;a<r.length;){const b=r[a++],L=r[a];if(L===hl){const N=a-1;for(a+=2;r[a]===hl;)a+=2;t.push(String.fromCodePoint(...r.slice(N,a-N+1)))}else if(ja(L)){const N=a-1;for(;ja(r[a]);)a+=r[a]===hl?2:1;t.push(String.fromCodePoint(...r.slice(N,2*a-N-1)))}else hf(b)?(a+=1,t.push(String.fromCodePoint(...r.slice(a-2,2)))):t.push(String.fromCodePoint(b))}return t}var pf=class{constructor(e){this.obeyspaces=!1,this.pos=0,this.s=df(e)}end(){return this.pos>=this.s.length}get(){return this.pos<this.s.length?this.s[this.pos++]:""}peek(){return this.s[this.pos]}match(e){const t=typeof this.s=="string"?e.exec(this.s.slice(this.pos)):e.exec(this.s.slice(this.pos).join(""));return t!=null&&t[0]?(this.pos+=t[0].length,t[0]):""}next(){if(this.end())return null;if(!this.obeyspaces&&this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]+/)||this.obeyspaces&&this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]/))return"<space>";const e=this.get();if(e==="\\"){if(!this.end()){let t=this.match(/^[a-zA-Z\*]+/);return t?this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]*/):t=this.get(),"\\"+t}}else{if(e==="{")return"<{>";if(e==="}")return"<}>";if(e==="^"){if(this.peek()==="^"){this.get();const t=this.match(/^(\^(\^(\^(\^[\da-f])?[\da-f])?[\da-f])?[\da-f])?[\da-f]{2}/);if(t)return String.fromCodePoint(Number.parseInt(t.slice(t.lastIndexOf("^")+1),16))}return e}else if(e==="#"){if(!this.end()){let t=!1;if(/[\d?@]/.test(this.peek())&&(t=!0,this.pos+1<this.s.length)){const r=this.s[this.pos+1];t=/[^\dA-Za-z]/.test(r)}return t?"#"+this.get():"#"}}else if(e==="$")return this.peek()==="$"?(this.get(),"<$$>"):"<$>"}return e}};function Es(e,t){var r,a,b,L;const N=[];let J=e.next();if(J&&J!=="\\relax"){if(J==="\\noexpand")J=e.next(),J&&N.push(J);else if(J==="\\obeyspaces")e.obeyspaces=!0;else if(J==="\\bgroup")N.push("<{>");else if(J==="\\egroup")N.push("<}>");else if(J==="\\string"){if(J=e.next(),J)if(J.startsWith("\\"))for(const ie of J)N.push(ie==="\\"?"\\backslash":ie);else J==="<{>"?N.push("\\{"):J==="<space>"?N.push("~"):J==="<}>"&&N.push("\\}")}else if(J==="\\csname"){for(;e.peek()==="<space>";)e.next();let ie="",ue=!1,pe=[];do{if(pe.length===0)if(/^#[\d?@]$/.test(e.peek())){const Ee=e.get().slice(1);pe=ns((a=(r=t==null?void 0:t(Ee))!=null?r:t==null?void 0:t("?"))!=null?a:"\\placeholder{}",t),J=pe[0]}else J=e.next(),pe=J?[J]:[];ue=pe.length===0,!ue&&J==="\\endcsname"&&(ue=!0,pe.shift()),ue||(ue=J==="<$>"||J==="<$$>"||J==="<{>"||J==="<}>"||typeof J=="string"&&J.length>1&&J.startsWith("\\")),ue||(ie+=pe.shift())}while(!ue);ie&&N.push("\\"+ie),N.push(...pe)}else if(J!=="\\endcsname")if(J.length>1&&J.startsWith("#")){const ie=J.slice(1);N.push(...ns((L=(b=t==null?void 0:t(ie))!=null?b:t==null?void 0:t("?"))!=null?L:"\\placeholder{}",t))}else N.push(J)}return N}function ns(e,t=null){const r=[];let a="";for(const N of e.toString().split(/\r?\n/)){a&&r.push(a),a=" ";const J=N.match(/((?:\\%)|[^%])*/);J!==null&&r.push(J[0])}const b=new pf(Le(r.join(""))),L=[];do L.push(...Es(b,t));while(!b.end());return L}function ar(e){let t="";const r=[];for(const a of e)a&&(t&&/^[a-zA-Z\*]/.test(a)&&r.push(t),r.push(a),/^\\[a-zA-Z]+\*?[\"\'][^\ ]+$/.test(a)&&r.push(" "),t=/\\[a-zA-Z]+\*?$/.test(a)?" ":"");return r.join("")}function sn(e,...t){return console.assert(e.startsWith("\\")),t.length===0?e:ar([e,...t.map(r=>`{${r}}`)])}function Ms(e){return ar(e.map(t=>{var r;return(r={"<space>":" ","<$$>":"$$","<$>":"$","<{>":"{","<}>":"}"}[t])!=null?r:t}))}var mf=class Wu{constructor(t){Wu._registry[t]=this}static createAtom(t,r,a){return Wu._registry[t].createAtom(r,Qe(r,t),a)}static serialize(t,r){var a;if(!t||t.length===0)return"";if((a=r.skipStyles)!=null&&a){const b=[];for(const L of gf(t)){const N=Wu._registry[L[0].mode];b.push(...N.serialize(L,r))}return ar(b)}return ar(uh(t,r))}static getFont(t,r,a){return Wu._registry[t].getFont(r,a)}};mf._registry={};var Wi=mf;function gf(e){const t=[];let r=[],a="NONE";for(const b of e)b.type!=="first"&&(b.mode!==a?(r.length>0&&t.push(r),r=[b],a=b.mode):r.push(b));return r.length>0&&t.push(r),t}function kn(e,t){const r=[];let a=[],b;for(const L of e)if(L.type!=="first"&&L.style){let N;t==="variant"?(N=L.style.variant,L.style.variantStyle&&L.style.variantStyle!=="up"&&(N+="-"+L.style.variantStyle)):N=L.style[t],N===b?a.push(L):(a.length>0&&r.push(a),a=[L],b=N)}return a.length>0&&r.push(a),r}function ru(e,t){var r;const{parent:a}=e[0],b=a==null?void 0:a.computedStyle.color,L=[];for(const N of gf(e)){const J=t.defaultMode;for(const ie of kn(N,"color")){const ue=ie[0].computedStyle,pe=Wi._registry[ie[0].mode].serialize(ie,h(l({},t),{defaultMode:J==="text"?"text":"math"}));!t.skipStyles&&ue.color&&ue.color!=="none"&&(!a||b!==ue.color)?L.push(sn("\\textcolor",(r=ue.verbatimColor)!=null?r:ue.color,ar(pe))):L.push(ar(pe))}}return L}function ch(e,t){const{parent:r}=e[0],a=r==null?void 0:r.computedStyle.backgroundColor;return kn(e,"backgroundColor").map(b=>{var L;if(b.length>0||b[0].type!=="box"){const N=b[0].computedStyle;if(N.backgroundColor&&N.backgroundColor!=="none"&&(!r||a!==N.backgroundColor))return sn("\\colorbox",(L=N.verbatimBackgroundColor)!=null?L:N.backgroundColor,ar(ru(b,h(l({},t),{defaultMode:"text"}))))}return ar(ru(b,t))})}function uh(e,t){if(e.length===0)return[];const{parent:r}=e[0],a=r==null?void 0:r.computedStyle.fontSize,b=[];for(const L of kn(e,"fontSize")){const N=L[0].computedStyle.fontSize,J=ch(L,t);J&&(N&&N!=="auto"&&(!r||a!==N)?b.push(["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][N],...J):b.push(...J))}return b}function nu(e){return e?{mord:"ord",mbin:"bin",mop:"op",mrel:"rel",mopen:"open",mclose:"close",mpunct:"punct",minner:"inner",spacing:"ignore",latex:"latex",composition:"inner",error:"inner",placeholder:"ord",supsub:"ignore"}[e]:void 0}function Ba(e){if(e.length===0)return"ord";const t=nu(e[0].type),r=nu(e[e.length-1].type);return t&&t===r?t:"ord"}function Na(e,t){if(typeof e=="string")return e;if(typeof e=="number"){console.assert(Number.isFinite(e));const r=Math.ceil(100*e)/100;return r===0?"0":r.toString()+(t!=null?t:"")}return""}var mt=class Pp{constructor(t,r){var a,b,L,N,J;if(typeof t=="number"?this.value=String.fromCodePoint(t):typeof t=="string"?this.value=t:o(t)?this.children=t.filter(ue=>ue!==null):t&&t instanceof Pp&&(this.children=[t]),this.children)for(const ue of this.children)ue.parent=this;this.type=(a=r==null?void 0:r.type)!=null?a:"ignore",this.isSelected=(r==null?void 0:r.isSelected)===!0,r!=null&&r.caret&&(this.caret=r.caret),this.classes=(b=r==null?void 0:r.classes)!=null?b:"",this.isTight=(L=r==null?void 0:r.isTight)!=null?L:!1,r!=null&&r.attributes&&(this.attributes=r.attributes);let ie=r==null?void 0:r.fontFamily;r!=null&&r.style&&this.value&&(ie=(J=Wi.getFont((N=r.mode)!=null?N:"math",this,h(l({variant:"normal"},r.style),{letterShapeStyle:r.letterShapeStyle})))!=null?J:void 0),ie||(ie="Main-Regular"),this._height=0,this._depth=0,this._width=0,this.hasExplicitWidth=!1,this.skew=0,this.italic=0,this.maxFontSize=0,this.scale=1,(r==null?void 0:r.maxFontSize)!==void 0&&(this.maxFontSize=r.maxFontSize),pl(this,ie)}set atomID(t){t===void 0||t.length===0||(this.id=t)}selected(t){if(this.isSelected!==t&&(this.isSelected=t,this.children))for(const r of this.children)r.selected(t)}setStyle(t,r,a){if(r===void 0)return;const b=Na(r,a);b.length>0&&(this.cssProperties||(this.cssProperties={}),this.cssProperties[t]=b)}setTop(t){Number.isFinite(t)&&Math.abs(t)>.01&&(this.cssProperties||(this.cssProperties={}),this.cssProperties.top=Na(t,"em"),this.height-=t,this.depth+=t)}get left(){var t;return(t=this.cssProperties)!=null&&t["margin-left"]?Number.parseFloat(this.cssProperties["margin-left"]):0}set left(t){Number.isFinite(t)&&(t===0?this.cssProperties&&delete this.cssProperties["margin-left"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-left"]=Na(t,"em")))}set right(t){Number.isFinite(t)&&(t===0?this.cssProperties&&delete this.cssProperties["margin-right"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-right"]=Na(t,"em")))}set bottom(t){Number.isFinite(t)&&(t===0?this.cssProperties&&delete this.cssProperties["margin-bottom"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-bottom"]=Na(t,"em")))}get width(){return this._width*this.scale}set width(t){this._width=t,this.hasExplicitWidth=!0}set softWidth(t){}get height(){return this._height*this.scale}set height(t){this._height=t}get depth(){return this._depth*this.scale}set depth(t){this._depth=t}wrap(t){const r=t.parent;if(!r)return this;t.isPhantom&&this.setStyle("opacity",0);const a=t.color;a&&a!==r.color&&this.setStyle("color",a);let b=t.backgroundColor;this.isSelected&&(b=ye(b)),b&&b!==r.backgroundColor&&(this.setStyle("background-color",b),this.setStyle("display","inline-block"));const L=t.scalingFactor;return this.scale=L,this.skew*=L,this.italic*=L,this}toMarkup(){var t,r,a,b;let L=(t=this.value)!=null?t:"";if(this.children)for(const je of this.children)L+=je.toMarkup();let N="";if(this.svgBody)N=Ra(this.svgBody);else if(this.svgOverlay){N='<span style="',N+="display: inline-block;",N+=`height:${Math.floor(100*(this.height+this.depth))/100}em;`,N+=`vertical-align:${Math.floor(100*this.depth)/100}em;`,N+='">',N+=L,N+="</span>",N+='<svg style="position:absolute;overflow:visible;',N+=`height:${Math.floor(100*(this.height+this.depth))/100}em;`;const je=(r=this.cssProperties)==null?void 0:r.padding;je?(N+=`top:${je};`,N+=`left:${je};`,N+=`width:calc(100% - 2 * ${je} );`):N+="top:0;left:0;width:100%;",N+="z-index:2;",N+='"',this.svgStyle&&(N+=this.svgStyle),N+=` viewBox="0 0 ${Math.floor(100*this.width)/100} ${Math.floor(100*(this.height+this.depth))/100}"`,N+=`>${this.svgOverlay}</svg>`}let J="";const ie=this.classes.split(" ");ie.push((a={latex:"ML__raw-latex",placeholder:"ML__placeholder",error:"ML__error"}[this.type])!=null?a:""),this.caret==="latex"&&ie.push("ML__latex-caret"),this.isSelected&&ie.push("ML__selected");const ue=ie.length===1?ie[0]:ie.filter((je,ze,Je)=>je.length>0&&Je.indexOf(je)===ze).join(" ");if(ue.length>0&&(J+=` class="${ue}"`),this.id&&(J+=` data-atom-id=${this.id}`),this.cssId&&(J+=` id="${this.cssId.replace(/ /g,"-")}" `),this.attributes&&(J+=" "+Object.keys(this.attributes).map(je=>`${je}="${this.attributes[je]}"`).join(" ")),this.htmlData){const je=this.htmlData.split(",");for(const ze of je){const Je=ze.match(/([^=]+)=(.+$)/);if(Je){const pt=Je[1].trim().replace(/ /g,"-");pt&&(J+=` data-${pt}="${Je[2]}" `)}else{const pt=ze.trim().replace(/ /g,"-");pt&&(J+=` data-${pt} `)}}}const pe=(b=this.cssProperties)!=null?b:{};this.hasExplicitWidth&&pe.width===void 0&&(pe.width=`${Math.ceil(this._width*100)/100}em`);const Ee=Object.keys(pe).map(je=>`${je}:${pe[je]}`);if(this.scale!==void 0&&this.scale!==1&&(L.length>0||N.length>0)&&Ee.push(`font-size: ${Math.ceil(this.scale*1e4)/100}%`),this.htmlStyle){const je=this.htmlStyle.split(";");let ze="";for(const Je of je){const pt=Je.match(/([^=]+):(.+$)/);if(pt){const Xe=pt[1].trim().replace(/ /g,"-");Xe&&(ze+=`${Xe}:${pt[2]};`)}}ze&&(J+=` style="${ze}"`)}Ee.length>0&&(J+=` style="${Ee.join(";")}"`);let De="";return J.length>0||N.length>0?De=`<span${J}>${L}${N}</span>`:De=L,this.caret==="text"?De+='<span class="ML__text-caret"></span>':this.caret==="math"&&(De+='<span class="ML__caret"></span>'),De}tryCoalesceWith(t){if(this.svgBody||!this.value||t.svgBody||!t.value)return!1;const r=this.children&&this.children.length>0,a=t.children&&t.children.length>0;if(r||a)return!1;if(t.cssProperties||this.cssProperties){for(const ie of["border","border-left","border-right","border-right-width","left","margin","margin-left","margin-right","padding","position","width"])if(t.cssProperties&&ie in t.cssProperties||this.cssProperties&&ie in this.cssProperties)return!1}const b=this.cssProperties?Object.keys(this.cssProperties).length:0,L=t.cssProperties?Object.keys(t.cssProperties).length:0;if(b!==L)return!1;if(b>0){for(const ie of Object.keys(this.cssProperties))if(this.cssProperties[ie]!==t.cssProperties[ie])return!1}const N=this.classes.trim().replace(/\s+/g," ").split(" "),J=t.classes.trim().replace(/\s+/g," ").split(" ");if(N.length!==J.length)return!1;N.sort(),J.sort();for(const[ie,ue]of N.entries())if(ue==="vertical-separator"||ue!==J[ie])return!1;return this.value+=t.value,this.height=Math.max(this.height,t.height),this.depth=Math.max(this.depth,t.depth),this._width=this._width+t._width,this.maxFontSize=Math.max(this.maxFontSize,t.maxFontSize),this.italic=t.italic,!0}};function iu(e){if(!e||e.length===0)return[];e[0].children=iu(e[0].children);const t=[e[0]];for(let r=1;r<e.length;r++)t[t.length-1].tryCoalesceWith(e[r])||(e[r].children=iu(e[r].children),t.push(e[r]));return t}function oc(e){return e.children&&(e.children=iu(e.children)),e}function sc(e,t){if(!e)return new mt(null,t);const r=new mt(null,{classes:"ML__strut",type:"ignore"});r.setStyle("height",Math.max(0,e.height),"em");const a=[r];if(e.depth!==0){const b=new mt(null,{classes:"ML__strut--bottom",type:"ignore"});b.setStyle("height",e.height+e.depth,"em"),b.setStyle("vertical-align",-e.depth,"em"),a.push(b)}return a.push(e),new mt(a,h(l({},t),{type:"lift"}))}function ho(e){const t=uf(e)/2,r=new mt(null,{maxFontSize:0});return r.height=t+.166,r.depth=t-.166,r.svgBody=e,r}function pl(e,t){var r;if(e.type==="latex"){e.height=.9,e.depth=.2,e._width=1;return}if(e.value){e.height=-1/0,e.depth=-1/0,e._width=0,e.skew=-1/0,e.italic=-1/0;for(let a=0;a<e.value.length;a++){const b=rs(e.value.codePointAt(a),t);e.height=Math.max(e.height,b.height),e.depth=Math.max(e.depth,b.depth),e._width+=b.width,e.skew=b.skew,e.italic=b.italic}return}if(e.children&&e.children.length>0){let a=-1/0,b=-1/0,L=0;for(const N of e.children)N.height>a&&(a=N.height),N.depth>b&&(b=N.depth),L=Math.max(L,(r=N.maxFontSize)!=null?r:0);e.height=a,e.depth=b,e._width=e.children.reduce((N,J)=>N+J.width,0),e.maxFontSize=L}}function ac(e){if("individualShift"in e){const t=e.individualShift;let r=t[0];const a=[r],b=-r.shift-r.box.depth;let L=b;for(let N=1;N<t.length;N++){const J=t[N],ie=-J.shift-L-J.box.depth,ue=ie-(r.box.height+r.box.depth);L=L+ie,a.push(ue),a.push(J),r=J}return[a,b]}if("top"in e){let t=e.top;for(const r of e.children)t-=typeof r=="number"?r:r.box.height+r.box.depth;return[e.children,t]}else{if("bottom"in e)return[e.children,-e.bottom];if("firstBaseline"in e){const t=e.firstBaseline[0];if(typeof t=="number")throw new Error("First child must be an element.");return[e.firstBaseline,-t.box.depth]}else if("shift"in e){const t=e.children[0];if(typeof t=="number")throw new Error("First child must be an element.");return[e.children,-t.box.depth-e.shift]}}return[null,0]}function ml(e){var t;const[r,a]=ac(e);if(!r)return[[],0,0];const b=new mt(null,{classes:"pstrut"});let L=0;for(const ze of r)if(typeof ze!="number"){const Je=ze.box;L=Math.max(L,Je.maxFontSize,Je.height)}L+=2,b.height=L,b.setStyle("height",L,"em");const N=[];let J=a,ie=a,ue=a,pe=0;for(const ze of r){if(typeof ze=="number")ue+=ze;else{const Je=ze.box,pt=(t=ze.classes)!=null?t:[],Xe=new mt([b,Je],{classes:pt.join(" "),style:ze.style});Je.setStyle("height",Je.height+Je.depth,"em"),Je.setStyle("display","inline-block"),Xe.setStyle("top",-L-ue-Je.depth,"em"),ze.marginLeft&&Xe.setStyle("margin-left",ze.marginLeft,"em"),ze.marginRight&&Xe.setStyle("margin-right",ze.marginRight,"em"),N.push(Xe),ue+=Je.height+Je.depth,pe=Math.max(pe,Xe.width)}J=Math.min(J,ue),ie=Math.max(ie,ue)}N.forEach(ze=>{ze.softWidth=pe});const Ee=new mt(N,{classes:"vlist"});if(Ee.softWidth=pe,Ee.height=ie,Ee.setStyle("height",ie,"em"),J>=0)return[[new mt(Ee,{classes:"vlist-r"})],ie,-J];const De=new mt(new mt(null),{classes:"vlist"});De.height=-J,De.setStyle("height",-J,"em");const je=new mt(8203,{classes:"vlist-s",maxFontSize:0});return je.softWidth=0,je.height=0,je.depth=0,[[new mt([Ee,je],{classes:"vlist-r"}),new mt(De,{classes:"vlist-r"})],ie,-J]}var Zr=class extends mt{constructor(e,t){var r;const[a,b,L]=ml(e);super(a.length===1?a[0]:a,{type:t==null?void 0:t.type,classes:((r=t==null?void 0:t.classes)!=null?r:"")+" vlist-t"+(a.length===2?" vlist-t2":"")}),this.height=b,this.depth=L,this.softWidth=a.reduce((N,J)=>Math.max(N,J.width),0)}};function fh(e,t){var r,a,b,L,N;const J=e.metrics,ie=new mt(t.base),ue=(r=t.baseShift)!=null?r:0,pe=(a=t.slant)!=null?a:0;let Ee=0,De=0;t.above&&(Ee=(b=t.aboveShift)!=null?b:Math.max(J.bigOpSpacing1,J.bigOpSpacing3-t.above.depth)),t.below&&(De=(L=t.belowShift)!=null?L:Math.max(J.bigOpSpacing2,J.bigOpSpacing4-t.below.height));let je=null;if(t.below&&t.above){const ze=J.bigOpSpacing5+t.below.height+t.below.depth+De+ie.depth+ue;je=new Zr({bottom:ze,children:[J.bigOpSpacing5,{box:t.below,marginLeft:-pe,classes:["ML__center"]},De,{box:ie,classes:["ML__center"]},Ee,{box:t.above,marginLeft:pe,classes:["ML__center"]},J.bigOpSpacing5]}).wrap(e)}else if(t.below&&!t.above)je=new Zr({top:ie.height-ue,children:[J.bigOpSpacing5,{box:t.below,marginLeft:-pe,classes:["ML__center"]},De,{box:ie,classes:["ML__center"]}]}).wrap(e);else if(!t.below&&t.above){const ze=ie.depth+ue;je=new Zr({bottom:ze,children:[{box:ie,classes:["ML__center"]},Ee,{box:t.above,marginLeft:pe,classes:["ML__center"]},J.bigOpSpacing5]}).wrap(e)}else{const ze=ie.depth+ue;je=new Zr({bottom:ze,children:[{box:ie},J.bigOpSpacing5]}).wrap(e)}return new mt(je,{type:(N=t.type)!=null?N:"op"})}var ou=7,is=6,gl=5,Ts=4,da=3,Si=2,no=1,ti=0,Ao=class{constructor(e,t,r){this.id=e,this.sizeDelta=t,this.cramped=r;const a={"-4":2,"-3":1,0:0}[t];this.metrics=Object.keys(eu).reduce((b,L)=>h(l({},b),{[L]:eu[L][a]}),{})}getFontSize(e){return Math.max(1,e+this.sizeDelta)}get sup(){return Lo[[ti,no,ti,no,Si,da,Si,da][this.id]]}get sub(){return Lo[[ti,ti,ti,ti,Si,Si,Si,Si][this.id]]}get fracNum(){return Lo[[ti,no,ti,no,Si,da,Ts,gl][this.id]]}get fracDen(){return Lo[[ti,ti,ti,ti,Si,Si,Ts,Ts][this.id]]}get cramp(){return Lo[[ti,ti,Si,Si,Ts,Ts,is,is][this.id]]}get isTight(){return this.sizeDelta<0}},pa={7:new Ao(ou,0,!1),6:new Ao(is,0,!0),5:new Ao(gl,0,!1),4:new Ao(Ts,0,!0),3:new Ao(da,-3,!1),2:new Ao(Si,-3,!0),1:new Ao(no,-4,!1),0:new Ao(ti,-4,!0)},Lo=h(l({},pa),{displaystyle:pa[ou],textstyle:pa[gl],scriptstyle:pa[da],scriptscriptstyle:pa[no]});function Fa(e,t){var r;if(!e)return 0;const a={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:3/4,em:fa,bp:803/800,dd:1238/1157,pc:12,in:72.27,mu:10/18}[(r=e.unit)!=null?r:"pt"];if(Number.isFinite(t)){const b=$s(10,t);return Math.round(e.dimension/fa*a*b)/b}return e.dimension*a}function su(e,t){if(e===null)return 0;const r=Fa(e)/fa;if(Number.isFinite(t)){const a=$s(10,t);return Math.round(r*a)/a}return r}function au(e){var t;return`${e.dimension}${(t=e.unit)!=null?t:"pt"}`}function vf(e){let t=au(e.glue);return e.grow&&e.grow.dimension!==0&&(t+=` plus ${au(e.grow)}`),e.shrink&&e.shrink.dimension!==0&&(t+=` minus ${au(e.shrink)}`),t}function Dn(e){var t,r;if(e==null)return null;let a="";if("dimension"in e&&(a=`${e.dimension}${(t=e.unit)!=null?t:"pt"}`),"glue"in e&&(a=vf(e)),"number"in e)if(!("base"in e)||e.base==="decimal")a=Number(e.number).toString();else if(e.base==="alpha")a=`\`${String.fromCodePoint(e.number)}`;else{const b=Math.round(e.number)>>>0;e.base==="hexadecimal"?(a=Number(b).toString(16).toUpperCase(),b<=255?a=a.padStart(2,"0"):b<=65535?a=a.padStart(4,"0"):b<=16777215?a=a.padStart(6,"0"):a=a.padStart(8,"0"),a=`"${a}`):e.base==="octal"&&(a=Number(b).toString(8),b<=63?a=a.padStart(2,"0"):b<=30583?a=a.padStart(4,"0"):a=a.padStart(8,"0"),a=`'${a}`)}return"register"in e&&("factor"in e&&(e.factor===-1?a="-":e.factor!==1&&(a=Number(e.factor).toString())),"global"in e&&e.global&&(a+="\\global"),a+=`\\${e.register}`),"string"in e&&(a=e.string),(r=e.relax)!=null&&r&&(a+="\\relax"),a}function Oo(e,t){return e==null?null:"number"in e?h(l({},e),{number:e.number*t}):"register"in e?"factor"in e&&e.factor?h(l({},e),{factor:e.factor*t}):h(l({},e),{factor:t}):"dimension"in e?h(l({},e),{dimension:e.dimension*t}):"glue"in e?e.shrink&&e.grow?{glue:Oo(e.glue,t),shrink:Oo(e.shrink,t),grow:Oo(e.grow,t)}:e.shrink?{glue:Oo(e.glue,t),shrink:Oo(e.shrink,t)}:e.grow?{glue:Oo(e.glue,t),grow:Oo(e.grow,t)}:{glue:Oo(e.glue,t)}:null}var hh={"p@":{dimension:1},"z@":{dimension:0},maxdimen:{dimension:16383.99999},hfuzz:{dimension:.1},vfuzz:{dimension:.1},overfullrule:{dimension:5},hsize:{dimension:6.5,unit:"in"},vsize:{dimension:8.9,unit:"in"},parindent:{dimension:20},maxdepth:{dimension:4},splitmaxdepth:{register:"maxdimen"},boxmaxdepth:{register:"maxdimen"},delimitershortfall:{dimension:5},nulldelimiterspace:{dimension:1.2,unit:"pt"},scriptspace:{dimension:.5},topskip:{dimension:10},splittopskip:{dimension:10},normalbaselineskip:{dimension:12},normallineskip:{dimension:1},normallineskiplimit:{dimension:0},jot:{dimension:3},doublerulesep:{dimension:2},arrayrulewidth:{dimension:.4},arraycolsep:{dimension:5},fboxsep:{dimension:3},fboxrule:{dimension:.4},"z@skip":{glue:{dimension:0},shrink:{dimension:0},grow:{dimension:0}},hideskip:{glue:{dimension:-1e3},grow:{dimension:1,unit:"fill"}},"@flushglue":{glue:{dimension:0},grow:{dimension:1,unit:"fill"}},parskip:{glue:{dimension:0},grow:{dimension:1}},abovedisplayskip:{glue:{dimension:12},grow:{dimension:3},shrink:{dimension:9}},abovedisplayshortskip:{glue:{dimension:0},grow:{dimension:3}},belowdisplayskip:{glue:{dimension:12},grow:{dimension:3},shrink:{dimension:9}},belowdisplayshortskip:{glue:{dimension:7},grow:{dimension:3},shrink:{dimension:4}},parfillskip:{glue:{dimension:0},grow:{dimension:1,unit:"fil"}},thinmuskip:{glue:{dimension:3,unit:"mu"}},medmuskip:{glue:{dimension:4,unit:"mu"},grow:{dimension:2,unit:"mu"},shrink:{dimension:4,unit:"mu"}},thickmuskip:{glue:{dimension:5,unit:"mu"},grow:{dimension:5,unit:"mu"}},smallskipamount:{glue:{dimension:3},grow:{dimension:1},shrink:{dimension:1}},medskipamount:{glue:{dimension:6},grow:{dimension:2},shrink:{dimension:3}},bigskipamount:{glue:{dimension:12},grow:{dimension:2},shrink:{dimension:4}},pretolerance:100,tolerance:200,hbadness:1e3,vbadness:1e3,linepenalty:10,hyphenpenalty:50,exhyphenpenalty:50,binoppenalty:700,relpenalty:500,clubpenalty:150,widowpenalty:150,displaywidowpenalty:50,brokenpenalty:100,predisplaypenalty:1e4,doublehyphendemerits:1e4,finalhyphendemerits:5e3,adjdemerits:1e4,tracinglostchars:1,uchyph:1,delimiterfactor:901,defaulthyphenchar:"\\-",defaultskewchar:-1,newlinechar:-1,showboxbreadth:5,showboxdepth:3,errorcontextlines:5,interdisplaylinepenalty:100,interfootnotelinepenalty:100,baselineSkip:1.2,arraystretch:1,month:new Date().getMonth()+1,day:new Date().getDate(),year:new Date().getFullYear()};function za(){return l({},hh)}function lc(){return{registers:za(),smartFence:!1,renderPlaceholder:void 0,placeholderSymbol:"\u25A2",letterShapeStyle:w.locale.startsWith("fr")?"french":"tex",minFontScale:0,colorMap:U,backgroundColorMap:G,getMacro:e=>ft(e,We())}}var gr=class Rp{constructor(t,r){var a,b,L,N,J,ie,ue,pe,Ee,De,je,ze,Je,pt,Xe;let ot;t!=null&&t.parent?(this.parent=t.parent,ot=t.parent,this.registers={}):(ot=l(l({},lc()),(a=t==null?void 0:t.from)!=null?a:{}),this.registers=ot.registers),ot.atomIdsSettings&&(this.atomIdsSettings=l({},ot.atomIdsSettings)),this.renderPlaceholder=ot.renderPlaceholder,this.isPhantom=(N=(L=t==null?void 0:t.isPhantom)!=null?L:(b=this.parent)==null?void 0:b.isPhantom)!=null?N:!1,this.letterShapeStyle=ot.letterShapeStyle,this.minFontScale=ot.minFontScale,r!=null&&r.color&&r.color!=="none"?this.color=r.color:this.color=(ie=(J=this.parent)==null?void 0:J.color)!=null?ie:"",r!=null&&r.backgroundColor&&r.backgroundColor!=="none"?this.backgroundColor=r.backgroundColor:this.backgroundColor=(pe=(ue=this.parent)==null?void 0:ue.backgroundColor)!=null?pe:"",r!=null&&r.fontSize&&r.fontSize!=="auto"&&r.fontSize!==((Ee=this.parent)==null?void 0:Ee.size)?this.size=r.fontSize:this.size=(je=(De=this.parent)==null?void 0:De.size)!=null?je:Cs;let gt=(Je=(ze=this.parent)==null?void 0:ze.mathstyle)!=null?Je:Lo.displaystyle;if(typeof(t==null?void 0:t.mathstyle)=="string"){if(ot instanceof Rp)switch(t.mathstyle){case"cramp":gt=gt.cramp;break;case"superscript":gt=gt.sup;break;case"subscript":gt=gt.sub;break;case"numerator":gt=gt.fracNum;break;case"denominator":gt=gt.fracDen;break}switch(t.mathstyle){case"textstyle":gt=Lo.textstyle;break;case"displaystyle":gt=Lo.displaystyle;break;case"scriptstyle":gt=Lo.scriptstyle;break;case"scriptscriptstyle":gt=Lo.scriptscriptstyle;break;case"":case"auto":break}}this.mathstyle=gt,this.smartFence=ot.smartFence,this.placeholderSymbol=ot.placeholderSymbol,this.colorMap=(pt=ot.colorMap)!=null?pt:ct=>ct,this.backgroundColorMap=(Xe=ot.backgroundColorMap)!=null?Xe:ct=>ct,this.getMacro=ot.getMacro,console.assert(this.parent!==void 0||this.registers!==void 0)}makeID(){if(!this.atomIdsSettings)return;if(this.atomIdsSettings.overrideID)return this.atomIdsSettings.overrideID;if(typeof this.atomIdsSettings.seed!="number")return`${Date.now().toString(36).slice(-2)}${Math.floor(Math.random()*1e5).toString(36)}`;const t=this.atomIdsSettings.seed.toString(36);return this.atomIdsSettings.seed+=1,t}scale(t){return t*this.effectiveFontSize}get scalingFactor(){return this.parent?this.effectiveFontSize/this.parent.effectiveFontSize:1}get isDisplayStyle(){return this.mathstyle.id===ou||this.mathstyle.id===is}get isCramped(){return this.mathstyle.cramped}get isTight(){return this.mathstyle.isTight}get metrics(){return this.mathstyle.metrics}get effectiveFontSize(){return Math.max(nc[Math.max(1,this.size+this.mathstyle.sizeDelta)],this.minFontScale)}getRegister(t){var r;if((r=this.registers)!=null&&r[t])return this.registers[t];if(this.parent)return this.parent.getRegister(t)}getRegisterAsNumber(t){const r=this.getRegister(t);if(typeof r=="number")return r;if(typeof r=="string")return Number(r)}getRegisterAsGlue(t){var r;if((r=this.registers)!=null&&r[t]){const a=this.registers[t];return typeof a=="object"&&"glue"in a?a:typeof a=="object"&&"dimension"in a?{glue:{dimension:a.dimension}}:typeof a=="number"?{glue:{dimension:a}}:void 0}if(this.parent)return this.parent.getRegisterAsGlue(t)}getRegisterAsEm(t,r){return su(this.getRegisterAsDimension(t),r)}getRegisterAsDimension(t){var r;if((r=this.registers)!=null&&r[t]){const a=this.registers[t];return typeof a=="object"&&"glue"in a?a.glue:typeof a=="object"&&"dimension"in a?a:typeof a=="number"?{dimension:a}:void 0}if(this.parent)return this.parent.getRegisterAsDimension(t)}setRegister(t,r){if(r===void 0){delete this.registers[t];return}this.registers[t]=r}evaluate(t){if(!t||!("register"in t))return t;let r=this;if("global"in t&&t.global)for(;r.parent;)r=r.parent;let a=1;"factor"in t&&t.factor!==1&&t.factor!==void 0&&(a=t.factor);const b=r.getRegister(t.register);if(b===void 0)return;if(typeof b=="string")return{string:Number(b).toString()+b};if(typeof b=="number")return{number:a*b};const L=r.evaluate(b);if(L!==void 0)return"string"in L?{string:Number(b).toString()+L.string}:"number"in L?{number:a*L.number}:"dimension"in L?h(l({},L),{dimension:a*L.dimension}):"glue"in L?h(l({},L),{glue:h(l({},L.glue),{dimension:a*L.glue.dimension}),shrink:L.shrink?h(l({},L.shrink),{dimension:a*L.shrink.dimension}):void 0,grow:L.grow?h(l({},L.grow),{dimension:a*L.grow.dimension}):void 0}):t}toDimension(t){const r=this.evaluate(t);return r===void 0?null:"dimension"in r?r:"glue"in r?r.glue:"number"in r?{dimension:r.number}:null}toEm(t,r){if(t===null)return 0;const a=this.toDimension(t);return a===null?0:Fa(a,r)/fa}toNumber(t){if(t===null)return null;const r=this.evaluate(t);return r===void 0?null:"number"in r?r.number:"dimension"in r?r.dimension:"glue"in r?r.glue.dimension:"string"in r?Number(r.string):null}toColor(t){var r,a;if(t===null)return null;const b=this.evaluate(t);return b===void 0?null:"string"in b?(a=(r=this.colorMap)==null?void 0:r.call(this,b.string))!=null?a:b.string:null}toBackgroundColor(t){var r,a;if(t===null)return null;const b=this.evaluate(t);return b===void 0?null:"string"in b?(a=(r=this.backgroundColorMap)==null?void 0:r.call(this,b.string))!=null?a:b.string:null}},Ha=["body","above","below","superscript","subscript"];function os(e){return typeof e=="string"&&Ha.includes(e)}function vl(e){return e!==void 0&&Array.isArray(e)&&e.length===2}var et=class _a{constructor(t){var r,a,b,L,N,J;this.type=t.type,typeof t.value=="string"&&(this.value=t.value),this.command=(a=(r=t.command)!=null?r:this.value)!=null?a:"",this.mode=(b=t.mode)!=null?b:"math",t.isFunction&&(this.isFunction=!0),t.limits&&(this.subsupPlacement=t.limits),this.style=l({},t.style),this.displayContainsHighlight=(L=t.displayContainsHighlight)!=null?L:!1,this.captureSelection=(N=t.captureSelection)!=null?N:!1,this.skipBoundary=(J=t.skipBoundary)!=null?J:!1,t.verbatimLatex!==void 0&&t.verbatimLatex!==null&&(this.verbatimLatex=t.verbatimLatex),t.args&&(this.args=t.args),t.body&&(this.body=t.body),this._changeCounter=0}static createBox(t,r,a){var b;if(!r)return null;const L=yf(r),N=[];for(const ie of L){const ue=ie[0].style,pe=bf(t,ie,{style:{color:ue.color,backgroundColor:ue.backgroundColor,fontSize:ue.fontSize}});pe&&N.push(pe)}if(N.length===0)return null;const J=((b=a==null?void 0:a.classes)!=null?b:"").trim();return N.length===1&&!J&&!(a!=null&&a.type)?N[0].wrap(t):new mt(N,{classes:J,type:a==null?void 0:a.type}).wrap(t)}static serialize(t,r){return Wi.serialize(t,r)}static commonAncestor(t,r){if(t===r||t.parent===r.parent)return t.parent;const a=new WeakSet;let{parent:b}=t;for(;b;)a.add(b),b=b.parent;for(b=r.parent;b;){if(a.has(b))return b;b=b.parent}console.assert(!!b)}static fromJson(t){return typeof t=="string"?new _a({type:"mord",value:t,mode:"math"}):new _a(t)}get latexMode(){return this.mode==="math"?"math":"text"}toJson(){const t={};if(this.type&&(t.type=this.type),this.mode!=="math"&&(t.mode=this.mode),this.command&&this.command!==this.value&&(t.command=this.command),this.value!==void 0&&(t.value=this.value),this.style&&Object.keys(this.style).length>0&&(t.style=l({},this.style)),this.verbatimLatex!==void 0&&(t.verbatimLatex=this.verbatimLatex),this.subsupPlacement&&(t.subsupPlacement=this.subsupPlacement),this.explicitSubsupPlacement&&(t.explicitSubsupPlacement=!0),this.isFunction&&(t.isFunction=!0),this.displayContainsHighlight&&(t.displayContainsHighlight=!0),this.isExtensibleSymbol&&(t.isExtensibleSymbol=!0),this.skipBoundary&&(t.skipBoundary=!0),this.captureSelection&&(t.captureSelection=!0),this.args&&(t.args=cu(this.args)),this._branches)for(const r of Object.keys(this._branches))this._branches[r]&&(t[r]=this._branches[r].filter(a=>a.type!=="first").map(a=>a.toJson()));return t.type==="mord"&&Object.keys(t).length===2&&"value"in t?t.value:t}get changeCounter(){return this.parent?this.parent.changeCounter:this._changeCounter}set isDirty(t){if(t){this.parent||this._changeCounter++,"verbatimLatex"in this&&(this.verbatimLatex=void 0),this._children=void 0;let{parent:r}=this;for(;r;)r.parent||r._changeCounter++,"verbatimLatex"in r&&(r.verbatimLatex=void 0),r._children=void 0,r=r.parent}}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const r=Qe(this.command,this.mode);return r!=null&&r.serialize?r.serialize(this,t):this.body&&this.command?ar([sn(this.command,this.bodyToLatex(t)),this.supsubToLatex(t)]):this.body?ar([this.bodyToLatex(t),this.supsubToLatex(t)]):!this.value||this.value==="\u200B"?"":this.command}bodyToLatex(t){var r;return Wi.serialize(this.body,h(l({},t),{defaultMode:(r=t.defaultMode)!=null?r:this.latexMode}))}aboveToLatex(t){return Wi.serialize(this.above,t)}belowToLatex(t){return Wi.serialize(this.below,t)}supsubToLatex(t){let r="";if(t=h(l({},t),{defaultMode:"math"}),this.branch("subscript")!==void 0){const a=Wi.serialize(this.subscript,t);a.length===0?r+="_{}":a.length===1?/^[0-9]$/.test(a)?r+=`_${a}`:r+=`_{${a}}`:r+=`_{${a}}`}if(this.branch("superscript")!==void 0){const a=Wi.serialize(this.superscript,t);a.length===0?r+="^{}":a.length===1?a==="\u2032"?r+="^\\prime ":a==="\u2033"?r+="^\\doubleprime ":/^[0-9]$/.test(a)?r+=`^${a}`:r+=`^{${a}}`:r+=`^{${a}}`}return r}get treeDepth(){let t=1,r=this.parent;for(;r;)r=r.parent,t+=1;return t}get inCaptureSelection(){let t=this;for(;t;){if(t.captureSelection)return!0;t=t.parent}return!1}get parentPrompt(){let t=this.parent;for(;t;){if(t.type==="prompt"&&!t.captureSelection)return t;t=t.parent}return null}branch(t){if(os(t)&&this._branches)return this._branches[t]}get branches(){if(!this._branches)return[];const t=[];for(const r of Ha)this._branches[r]&&t.push(r);return t}createBranch(t){return console.assert(os(t)),os(t)?(this._branches?this._branches[t]||(this._branches[t]=[this.makeFirstAtom(t)]):this._branches={[t]:[this.makeFirstAtom(t)]},this.isDirty=!0,this._branches[t]):[]}get row(){return vl(this.parentBranch)?this.parentBranch[0]:-1}get col(){return vl(this.parentBranch)?this.parentBranch[1]:-1}get body(){var t;return(t=this._branches)==null?void 0:t.body}set body(t){this.setChildren(t,"body")}get superscript(){var t;return(t=this._branches)==null?void 0:t.superscript}set superscript(t){this.setChildren(t,"superscript")}get subscript(){var t;return(t=this._branches)==null?void 0:t.subscript}set subscript(t){this.setChildren(t,"subscript")}get above(){var t;return(t=this._branches)==null?void 0:t.above}set above(t){this.setChildren(t,"above")}get below(){var t;return(t=this._branches)==null?void 0:t.below}set below(t){this.setChildren(t,"below")}get computedStyle(){var t,r;const a=typeof this.style.verbatimColor=="string",b=typeof this.style.verbatimBackgroundColor=="string",L=l(l({},(r=(t=this.parent)==null?void 0:t.computedStyle)!=null?r:{}),this.style);return delete L.variant,delete L.variantStyle,b||delete L.verbatimBackgroundColor,a||delete L.verbatimColor,L}applyStyle(t){this.isDirty=!0,this.style=l(l({},this.style),t),this.style.fontFamily==="none"&&delete this.style.fontFamily,this.style.fontShape==="auto"&&delete this.style.fontShape,this.style.fontSeries==="auto"&&delete this.style.fontSeries,this.style.color==="none"&&(delete this.style.color,delete this.style.verbatimColor),this.style.backgroundColor==="none"&&(delete this.style.backgroundColor,delete this.style.verbatimBackgroundColor),this.style.fontSize==="auto"&&delete this.style.fontSize;for(const r of this.children)r.applyStyle(t)}getInitialBaseElement(){var t,r,a;return this.hasEmptyBranch("body")?this:(console.assert(((t=this.body)==null?void 0:t[0].type)==="first"),(a=(r=this.body[1])==null?void 0:r.getInitialBaseElement())!=null?a:this)}getFinalBaseElement(){return this.hasEmptyBranch("body")?this:this.body[this.body.length-1].getFinalBaseElement()}isCharacterBox(){return this.type==="leftright"||this.type==="genfrac"||this.type==="subsup"||this.type==="delim"||this.type==="array"||this.type==="surd"?!1:this.getFinalBaseElement().type==="mord"}hasEmptyBranch(t){const r=this.branch(t);return r?(console.assert(r.length>0),console.assert(r[0].type==="first"),r.length===1):!0}setChildren(t,r){var a;if(!t||(console.assert(os(r)),!os(r)))return;console.assert(((a=t[0])==null?void 0:a.type)!=="first");const b=[this.makeFirstAtom(r),...t];this._branches?this._branches[r]=b:this._branches={[r]:b};for(const L of t)L.parent=this,L.parentBranch=r;this.isDirty=!0}makeFirstAtom(t){const r=new _a({type:"first",mode:this.mode});return r.parent=this,r.parentBranch=t,r}addChild(t,r){console.assert(t.type!=="first"),this.createBranch(r).push(t),this.isDirty=!0,t.parent=this,t.parentBranch=r}addChildBefore(t,r){console.assert(r.parentBranch!==void 0);const a=this.createBranch(r.parentBranch);a.splice(a.indexOf(r),0,t),this.isDirty=!0,t.parent=this,t.parentBranch=r.parentBranch}addChildAfter(t,r){console.assert(r.parentBranch!==void 0);const a=this.createBranch(r.parentBranch);a.splice(a.indexOf(r)+1,0,t),this.isDirty=!0,t.parent=this,t.parentBranch=r.parentBranch}addChildren(t,r){const a=this.createBranch(r);for(const b of t)b.parent=this,b.parentBranch=r,a.push(b);this.isDirty=!0}addChildrenAfter(t,r){console.assert(t.length===0||t[0].type!=="first"),console.assert(r.parentBranch!==void 0);const a=this.createBranch(r.parentBranch);a.splice(a.indexOf(r)+1,0,...t),this.isDirty=!0;for(const b of t)b.parent=this,b.parentBranch=r.parentBranch;return t[t.length-1]}removeBranch(t){const r=this.branch(t);if(os(t)&&(this._branches[t]=void 0),!r)return[];for(const a of r)a.parent=void 0,a.parentBranch=void 0;return console.assert(r[0].type==="first"),r.shift(),this.isDirty=!0,r}removeChild(t){if(console.assert(t.parent===this),t.type==="first")return;const r=this.branch(t.parentBranch),a=r.indexOf(t);console.assert(a>=0),r.splice(a,1),this.isDirty=!0,t.parent=void 0,t.parentBranch=void 0}get siblings(){return this.parent?this.parent.branch(this.parentBranch):[]}get firstSibling(){return this.siblings[0]}get lastSibling(){const{siblings:t}=this;return t[t.length-1]}get isFirstSibling(){return this===this.firstSibling}get isLastSibling(){return this===this.lastSibling}get hasNoSiblings(){return this.siblings.length===1}get leftSibling(){console.assert(this.parent!==void 0);const t=this.parent.branch(this.parentBranch);return t[t.indexOf(this)-1]}get rightSibling(){console.assert(this.parent!==void 0);const t=this.parent.branch(this.parentBranch);return t[t.indexOf(this)+1]}get hasChildren(){return!!(this._branches&&this.children.length>0)}get firstChild(){return console.assert(this.hasChildren),this.children[0]}get lastChild(){console.assert(this.hasChildren);const{children:t}=this;return t[t.length-1]}get children(){if(this._children)return this._children;if(!this._branches)return[];const t=[];for(const r of Ha)if(this._branches[r])for(const a of this._branches[r])t.push(...a.children),t.push(a);return this._children=t,t}render(t){if(this.type==="first"&&!t.atomIdsSettings)return null;const r=Qe(this.command,this.mode);if(r!=null&&r.render)return r.render(this,t);const a=new gr({parent:t},this.style);let b=this.createBox(a,{classes:this.parent?"":"ML__base"});return b?(!this.subsupPlacement&&(this.superscript||this.subscript)&&(b=this.attachSupsub(a,{base:b})),b.wrap(a)):null}attachSupsub(t,r){var a;const b=r.base,L=this.superscript,N=this.subscript;if(!L&&!N)return b;let J=null,ie=null;const ue=(a=r.isCharacterBox)!=null?a:this.isCharacterBox();let pe=0;if(L){const Je=new gr({parent:t,mathstyle:"superscript"});J=_a.createBox(Je,L),ue||(pe=b.height-t.metrics.supDrop*Je.scalingFactor)}let Ee=0;if(N){const Je=new gr({parent:t,mathstyle:"subscript"});ie=_a.createBox(Je,N),ue||(Ee=b.depth+t.metrics.subDrop*Je.scalingFactor)}let De;t.isDisplayStyle?De=t.metrics.sup1:t.isCramped?De=t.metrics.sup3:De=t.metrics.sup2;const je=.5/fa/t.scalingFactor;let ze=null;if(ie&&J){pe=Math.max(pe,De,J.depth+.25*t.metrics.xHeight),Ee=Math.max(Ee,t.metrics.sub2);const Je=t.metrics.defaultRuleThickness;if(pe-J.depth-(ie.height-Ee)<4*Je){Ee=4*Je-(pe-J.depth)+ie.height;const Xe=.8*t.metrics.xHeight-(pe-J.depth);Xe>0&&(pe+=Xe,Ee-=Xe)}const pt=this.isExtensibleSymbol&&b.italic?-b.italic:0;ze=new Zr({individualShift:[{box:ie,shift:Ee,marginLeft:pt},{box:J,shift:-pe}]}).wrap(t)}else ie&&!J?(Ee=Math.max(Ee,t.metrics.sub1,ie.height-.8*ts),ze=new Zr({shift:Ee,children:[{box:ie,marginRight:je,marginLeft:this.isCharacterBox()?-b.italic:0}]})):!ie&&J&&(pe=Math.max(pe,De,J.depth+.25*ts),ze=new Zr({shift:-pe,children:[{box:J,marginRight:je}]}));return new mt([b,new mt(ze,{caret:this.caret,isSelected:this.isSelected,classes:"msubsup"})],{type:r.type})}attachLimits(t,r){const a=this.superscript?_a.createBox(new gr({parent:t,mathstyle:"superscript"},this.style),this.superscript):null,b=this.subscript?_a.createBox(new gr({parent:t,mathstyle:"subscript"},this.style),this.subscript):null;return!a&&!b?r.base.wrap(t):fh(t,h(l({},r),{above:a,below:b}))}bind(t,r){if(!r||t.isPhantom||this.value==="\u200B")return r;let a=this.parent;for(;a&&!a.captureSelection;)a=a.parent;return a!=null&&a.captureSelection||(this.id||(this.id=t.makeID()),r.atomID=this.id),r}createBox(t,r){var a,b,L,N;const J=(a=this.value)!=null?a:this.body,ie=(b=r==null?void 0:r.boxType)!=null?b:nu(this.type);let ue=(L=r==null?void 0:r.classes)!=null?L:"";this.mode==="text"&&(ue+=" ML__text");const pe=typeof J=="string"||J===void 0?new mt(J!=null?J:null,{type:ie,isSelected:this.isSelected,mode:this.mode,maxFontSize:t.scalingFactor,style:h(l({variant:"normal"},this.style),{fontSize:Math.max(1,t.size+t.mathstyle.sizeDelta)}),letterShapeStyle:t.letterShapeStyle,classes:ue}):(N=_a.createBox(t,J,{type:ie,classes:ue}))!=null?N:new mt(null);return t.isTight&&(pe.isTight=!0),(this.mode!=="math"||this.style.variant==="main")&&(pe.italic=0),pe.right=pe.italic,this.bind(t,pe),this.caret&&!this.superscript&&!this.subscript&&(pe.caret=this.caret),pe}isDigit(){var t;return this.type==="mord"&&this.value?/^[\d,\.]$/.test(this.value):this.type==="group"&&((t=this.body)==null?void 0:t.length)===2?this.body[0].type==="first"&&this.body[1].value===",":!1}asDigit(){var t;return this.type==="mord"&&this.value&&/^[\d,\.]$/.test(this.value)?this.value:this.type==="group"&&((t=this.body)==null?void 0:t.length)===2&&this.body[0].type==="first"&&this.body[1].value===","?".":""}};function yf(e){let t;const r=[];let a=[];for(const b of e)if(!t&&!b.style)a.push(b);else{const L=b.computedStyle;t&&L.color===t.color&&L.backgroundColor===t.backgroundColor&&L.fontSize===t.fontSize?a.push(b):(a.length>0&&r.push(a),a=[b],t=L)}return a.length>0&&r.push(a),r}function bf(e,t,r){var a,b,L,N,J;if(!t||t.length===0)return null;const ie=new gr({parent:e},r.style),ue=!((a=ie.atomIdsSettings)!=null&&a.groupNumbers);let pe=[];if(t.length===1){const De=t[0],je=De.render(ie);je&&(ue&&De.isSelected&&je.selected(!0),pe=[je])}else{let De="",je=!0;for(const ze of t){(b=ie.atomIdsSettings)!=null&&b.groupNumbers&&De&&(je&&ze.isDigit()||!je&&lu(ze))&&(ie.atomIdsSettings.overrideID=De);const Je=ze.render(ie);ie.atomIdsSettings&&(ie.atomIdsSettings.overrideID=void 0),Je&&((L=ie.atomIdsSettings)!=null&&L.groupNumbers&&((ze.isDigit()||lu(ze))&&(!De||je!==ze.isDigit())&&(je=ze.isDigit(),De=(N=ze.id)!=null?N:""),De&&(!(ze.isDigit()||lu(ze))||!ze.hasEmptyBranch("superscript")||!ze.hasEmptyBranch("subscript"))&&(De="")),ue&&ze.isSelected&&Je.selected(!0),pe.push(Je))}}if(pe.length===0)return null;const Ee=new mt(pe,h(l({isTight:ie.isTight},r),{type:(J=r.type)!=null?J:"lift"}));return Ee.isSelected=pe.every(De=>De.isSelected),Ee.wrap(ie)}function lu(e){return e.mode==="text"}function cu(e){return e.map(t=>t===null?"<null>":Array.isArray(t)&&t[0]instanceof et?{atoms:t.map(r=>r.toJson())}:typeof t=="object"&&"group"in t?{group:t.group.map(r=>r.toJson())}:t)}var ss=class Ip extends et{constructor(t,r,a){super({type:"text",command:t,mode:"text",displayContainsHighlight:!0}),this.value=r,this.verbatimLatex=r,this.applyStyle(a)}static fromJson(t){return new Ip(t.command,t.value,t.style)}render(t){const r=this.createBox(t);return this.caret&&(r.caret=this.caret),r}_serialize(t){var r;return(r=this.verbatimLatex)!=null?r:vt("text",this.value.codePointAt(0))}};function yl(e,t){if(e.direction===t.direction){const r=e.ranges.length;if(t.ranges.length===r){let a=0;for(;a<r&&dh(e.ranges[a],t.ranges[a])==="equal";)a++;return a===r?"equal":"different"}}return"different"}function dh(e,t){return e[0]===t[0]&&e[1]===t[1]?"equal":"different"}function ri(e){let t=1/0,r=-1/0;for(const a of e.ranges)t=Math.min(t,a[0],a[1]),r=Math.max(r,a[0],a[1]);return[t,r]}function As(e){return typeof e=="number"&&!Number.isNaN(e)}function cc(e){return Array.isArray(e)&&e.length===2}function uc(e){return e!=null&&typeof e=="object"&&"ranges"in e&&Array.isArray(e.ranges)}function ph(e,t){const r=e.at(t);let a;if(r){a=r.mode;let b=r.parent;for(;!a&&b;)b&&(a=b.mode),b=b.parent}return a}function _f(e,t){if(!t)return"";if(typeof t=="string")return t;if(!e||t.after===void 0)return t.value;let r=!1,a=!1,b=!1,L=!1,N=!1,J=!1,ie=!1,ue=!1,pe=!1,Ee=!1,De=!1,je=!1,ze=!1,Je=!1,pt=!1,Xe=e[0],ot=0;for(;Xe!=null&&Xe.type&&/^(subsup|placeholder)$/.test(Xe.type);)ot+=1,Xe=e[ot];return r=!Xe||Xe.type==="first",Xe&&(Je=Xe.mode==="text",a=!Je&&Xe.type==="mord"&&re.test(Xe.value),b=!Je&&Xe.type==="mord"&&/\d+$/.test(Xe.value),L=!Je&&Xe.isFunction,N=Xe.type==="genfrac",J=Xe.type==="surd",ie=Xe.type==="mbin",ue=Xe.type==="mrel",pe=Xe.type==="mop"||Xe.type==="operator"||Xe.type==="extensible-symbol",Ee=Xe.type==="mpunct"||Xe.type==="minner",De=Xe.type==="array",je=Xe.type==="mopen",ze=Xe.type==="mclose"||Xe.type==="leftright",pt=Xe.type==="space"),t.after.includes("nothing")&&r||t.after.includes("letter")&&a||t.after.includes("digit")&&b||t.after.includes("function")&&L||t.after.includes("frac")&&N||t.after.includes("surd")&&J||t.after.includes("binop")&&ie||t.after.includes("relop")&&ue||t.after.includes("operator")&&pe||t.after.includes("punct")&&Ee||t.after.includes("array")&&De||t.after.includes("openfence")&&je||t.after.includes("closefence")&&ze||t.after.includes("text")&&Je||t.after.includes("space")&&pt?t.value:""}function uu(e,t,r){return r?_f(e,r[t]):""}var wf={"&":"\\&","%":"\\%",$:"\\$","''":"^{\\doubleprime}","'''":"^{\\prime\\prime\\prime}","''''":"^{\\prime\\prime\\prime\\prime}",alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:"\\pi",Pi:"\\Pi",theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:"\\nabla",grad:"\\nabla",del:"\\partial",deg:{after:"digit+space",value:"\\degree"},infty:"\\infty","\u221E":"\\infty",oo:{after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"\u2211":"\\sum",sum:"\\sum_{#?}^{#?}",int:"\\int_{#?}^{#?}",prod:"\\prod_{#?}^{#?}",sqrt:"\\sqrt{#?}","\u2206":"\\differentialD","\u2202":"\\differentialD",arcsin:"\\arcsin",arccos:"\\arccos",arctan:"\\arctan",arcsec:"\\arcsec",arccsc:"\\arccsc",arsinh:"\\arsinh",arcosh:"\\arcosh",artanh:"\\artanh",arcsech:"\\arcsech",arccsch:"\\arccsch",arg:"\\arg",ch:"\\ch",cosec:"\\cosec",cosh:"\\cosh",cot:"\\cot",cotg:"\\cotg",coth:"\\coth",csc:"\\csc",ctg:"\\ctg",cth:"\\cth",sec:"\\sec",sinh:"\\sinh",sh:"\\sh",tanh:"\\tanh",tg:"\\tg",th:"\\th",sin:"\\sin",cos:"\\cos",tan:"\\tan",lg:"\\lg",lb:"\\lb",log:"\\log",ln:"\\ln",exp:"\\exp",lim:"\\lim_{#?}",dx:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD x"},dy:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD y"},dt:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD t"},AA:"\\forall",EE:"\\exists","!EE":"\\nexists","&&":"\\land",xin:{after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},sint:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\sin t"},in:{after:"nothing+letter+closefence",value:"\\in"},"!in":"\\notin",NN:"\\mathbb{N}",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",xx:"\\times","+-":"\\pm","\u2260":"\\ne","!=":"\\ne","\u2265":"\\ge",">=":"\\ge","\u2264":"\\le","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","\u2248":"\\approx","?=":"\\questeq","\xF7":"\\div","\xAC":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},nu:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},\u00B5:"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega",\u03A9:"\\omega",forall:"\\forall",exists:"\\exists","!exists":"\\nexists",":.":"\\therefore",liminf:"\\liminf_{#?}",limsup:"\\limsup_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:"\\bmod{#?}","(mod":"\\pmod{#?}",max:"\\max",min:"\\min",erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:"\\operatorname{bessel}",mean:"\\operatorname{mean}",median:"\\operatorname{median}",fft:"\\operatorname{fft}",lcm:"\\operatorname{lcm}",gcd:"\\operatorname{gcd}",randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:"\\operatorname{Re}",Im:"\\operatorname{Im}",mm:{after:"nothing+digit+operator",value:"\\operatorname{mm}"},cm:{after:"nothing+digit+operator",value:"\\operatorname{cm}"},km:{after:"nothing+digit+operator",value:"\\operatorname{km}"},kg:{after:"nothing+digit+operator",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","-->...":"\\longrightarrow\\cdots","->":"\\to","|->":"\\mapsto","-->":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","*":"\\cdot","**":"\\star","***":"\\ast","//":"\\slash","\\\\":"\\backslash",setminus:"\\backslash","|><":"\\ltimes","><|":"\\rtimes","|><|":"\\bowtie","-:":"\\div",divide:"\\div","@":"\\circ","^^":"\\wedge","^^^":"\\bigwedge",vv:"\\vee",vvv:"\\bigvee",nn:"\\cap",nnn:"\\bigcap",uu:"\\cup",uuu:"\\bigcup","-=":"\\equiv","~=":"\\cong",lt:"<","lt=":"\\leq",gt:">","gt=":"\\geq","-<":"\\prec","-lt":"\\prec","-<=":"\\preceq",">-=":"\\succeq",prop:"\\propto",diamond:"\\diamond",square:"\\square",iff:"\\iff",sub:"\\subset",sup:"\\supset",sube:"\\subseteq",supe:"\\supseteq",uarr:"\\uparrow",darr:"\\downarrow",rarr:"\\rightarrow",rArr:"\\Rightarrow",larr:"\\leftarrow",lArr:"\\Leftarrow",harr:"\\leftrightarrow",hArr:"\\Leftrightarrow",aleph:"\\aleph",and:"\\land",or:"\\lor",not:"\\neg","_|_":"\\bot",TT:"\\top","|--":"\\vdash","|==":"\\models","|__":"\\lfloor","__|":"\\rfloor","|~":"\\lceil","~|":"\\rceil",">->":"\\rightarrowtail","->>":"\\twoheadrightarrow",">->>":"\\twoheadrightarrowtail",frac:"\\frac{#?}{#?}",cbrt:"\\sqrt[3]{#?}",nthroot:"\\sqrt[#?]{#?}"};function bl(e,t){var r;let a=(r=t==null?void 0:t.format)!=null?r:"auto";return a==="auto"&&([a,e]=Sf(e)),a==="ascii-math"?(e=e.replace(/\u2061/gu,""),e=e.replace(/\u3016/gu,"{"),e=e.replace(/\u3017/gu,"}"),e=e.replace(/([^\\])sinx/g,"$1\\sin x"),e=e.replace(/([^\\])cosx/g,"$1\\cos x "),e=e.replace(/\u2013/g,"-"),["ascii-math",hi(e,{inlineShortcuts:t==null?void 0:t.inlineShortcuts})]):["latex",e]}function hi(e,t){var r,a,b;if(!e)return"";let L=!1,N;const J=(r=t.inlineShortcuts)!=null?r:wf;if(!L&&(e.startsWith("^")||e.startsWith("_"))&&(N=Ls(e.slice(1),{inlineShortcuts:J,noWrap:!0}),e=e[0]+"{"+N.match+"}",e+=hi(N.rest,t),L=!0),L||(N=e.match(/^(sqrt|\u221A)(.*)/),N&&(N=Ls(N[2],{inlineShortcuts:J,noWrap:!0}),e="\\sqrt{"+((a=N.match)!=null?a:"\\placeholder{}")+"}",e+=hi(N.rest,t),L=!0)),L||(N=e.match(/^(\\cbrt|\u221B)(.*)/),N&&(N=Ls(N[2],{inlineShortcuts:J,noWrap:!0}),e="\\sqrt[3]{"+((b=N.match)!=null?b:"\\placeholder{}")+"}",e+=hi(N.rest,t),L=!0)),L||(N=e.match(/^abs(.*)/),N&&(N=Ls(N[1],{inlineShortcuts:J,noWrap:!0}),e="\\left|"+N.match+"\\right|",e+=hi(N.rest,t),L=!0)),L||(N=e.match(/^["”“](.*?)["”“](.*)/),N&&(e="\\text{"+N[1]+"}",e+=hi(N[2],t),L=!0)),L||(N=e.match(/^([^a-zA-Z\(\{\[\_\^\\\s"]+)(.*)/),N&&(e=xf(N[1],J),e+=hi(N[2],t),L=!0)),!L&&/^([fgh])[^a-zA-Z]/.test(e)&&(N=Ls(e.slice(1),{inlineShortcuts:J,noWrap:!0}),e=e[1]==="("?e[0]+"\\left("+N.match+"\\right)":e[0]+N.match,e+=hi(N.rest,t),L=!0),L||(N=e.match(/^([a-zA-Z]+)(.*)/),N&&(e=xf(N[1],J),e+=hi(N[2],t),L=!0)),!L)if(N=Ls(e,{inlineShortcuts:J,noWrap:!0}),N.match&&N.rest[0]==="/"){const ie=Ls(N.rest.slice(1),{inlineShortcuts:J,noWrap:!0});ie.match&&(e="\\frac{"+N.match+"}{"+ie.match+"}"+hi(ie.rest,t)),L=!0}else N.match&&(e=e.startsWith("(")?"\\left("+N.match+"\\right)"+hi(N.rest,t):N.match+hi(N.rest,t),L=!0);return L||(N=e.match(/^(\s+)(.*)$/),N&&(e=" "+hi(N[2],t),L=!0)),e}function Ls(e,t){let r="";e=e.trim();let a=e,b=e.charAt(0),L={"(":")","{":"}","[":"]"}[b];if(L){let N=1,J=1;for(;J<e.length&&N>0;)e[J]===b&&N++,e[J]===L&&N--,J++;N===0?(t.noWrap&&b==="("?r=hi(e.substring(1,J-1),t):(b==="{"&&L==="}"&&(b="\\{",L="\\}"),r="\\left"+b+hi(e.substring(1,J-1),t)+"\\right"+L),a=e.slice(Math.max(0,J))):(r=e.substring(1,J),a="")}else{let N=e.match(/^([a-zA-Z]+)/);if(N){let J=uu(null,e,t.inlineShortcuts);if(J)return J=J.replace("_{#?}",""),J=J.replace("^{#?}",""),{match:J,rest:e.slice(J.length)}}if(N=e.match(/^([a-zA-Z])/),N)return{match:N[1],rest:e.slice(1)};if(N=e.match(/^(-)?\d+(\.\d*)?/),N)return{match:N[0],rest:e.slice(N[0].length)};/^\\(left|right)/.test(e)||(N=e.match(/^(\\[a-zA-Z]+)/),N&&(a=e.slice(N[1].length),r=N[1]))}return{match:r,rest:a}}function xf(e,t){let r=uu(null,e,t);return r?(r=r.replace("_{#?}",""),r=r.replace("^{#?}",""),r+=" "):r=e,r}var fu=[["\\[","\\]"],["\\(","\\)"],["$$","$$"],["$","$"],["\\begin{math}","\\end{math}"],["\\begin{displaymath}","\\end{displaymath}"],["\\begin{equation}","\\end{equation}"],["\\begin{equation*}","\\end{equation*}"]];function Os(e){const t=e.trim();for(const r of fu)if(t.startsWith(r[0])&&t.endsWith(r[1]))return[!0,t.substring(r[0].length,t.length-r[1].length)];return[!1,e]}function Sf(e){if(e=e.trim(),e.length<=1)return["latex",e];let t;return[t,e]=Os(e),t?["latex",e]:e.startsWith("`")&&e.endsWith("`")?(e=e.substring(1,e.length-1),["ascii-math",e]):e.includes("\\")?["latex",e]:/\$.+\$/.test(e)?["latex",`\\text{${e}}`]:[void 0,e]}var fc="$$",mh="$$",gh=(e,t,r)=>(fu.some(a=>t.startsWith(a[0])&&t.endsWith(a[1]))||(t=`${fc} ${t} ${mh}`),t),Cf=class lh{constructor(t){lh._modes[t]=this}static onPaste(t,r,a){var b;if(!r.contentEditable&&r.userSelect==="none")return r.model.announce("plonk"),!1;if(typeof a=="string"){const N=new DataTransfer;N.setData("text/plain",a),a=N}const L=new ClipboardEvent("paste",{clipboardData:a,cancelable:!0});return(b=r.host)!=null&&b.dispatchEvent(L)?lh._modes[t].onPaste(r,a):!1}static copyToClipboard(t,r){if(!t.contentEditable&&t.userSelect==="none"){t.model.announce("plonk");return}const a=t.model,b=a.selectionIsCollapsed?[0,a.lastOffset]:ri(a.selection),L=a.getValue(b,r);navigator.clipboard.writeText(L).then(()=>{},()=>t.model.announce("plonk"))}static onCopy(t,r){var a;if(!r.clipboardData)return;if(!t.contentEditable&&t.userSelect==="none"){t.model.announce("plonk");return}const b=t.model,L=b.selectionIsCollapsed?[0,b.lastOffset]:ri(b.selection);let N=b.getAtoms(L);if(N.every(J=>J.mode==="text"||!J.mode))r.clipboardData.setData("text/plain",N.filter(J=>J instanceof ss).map(J=>J.value).join(""));else if(N.every(J=>J.mode==="latex"))r.clipboardData.setData("text/plain",b.getAtoms(L,{includeChildren:!0}).map(J=>{var ie;return(ie=J.value)!=null?ie:""}).join(""));else{let J;N.length===1&&N[0].verbatimLatex!==void 0?J=N[0].verbatimLatex:J=b.getValue(L,"latex-expanded"),r.clipboardData.setData("application/x-latex",J);try{r.clipboardData.setData("text/plain",t.options.onExport(t,J,L))}catch(ie){}if(N.length===1){const ie=N[0];(ie.type==="root"||ie.type==="group")&&(N=ie.body.filter(ue=>ue.type!=="first"))}try{r.clipboardData.setData("application/json+mathlive",JSON.stringify(N.map(ie=>ie.toJson())))}catch(ie){}if((a=window[Symbol.for("io.cortexjs.compute-engine")])!=null&&a.ComputeEngine){const ie=window.MathfieldElement.computeEngine;if(ie)try{const ue=ie.jsonSerializationOptions;ie.jsonSerializationOptions={metadata:["latex"]};const pe=ie.parse(b.getValue(L,"latex-unstyled"));ie.jsonSerializationOptions=ue;const Ee=JSON.stringify(pe.json);Ee&&r.clipboardData.setData("application/json",Ee)}catch(ue){}}}r.preventDefault()}static insert(t,r,a={}){var b;const L=a.mode==="auto"?t.mode:(b=a.mode)!=null?b:t.mode;return lh._modes[L].insert(t,r,a)}onPaste(t,r){return!1}insert(t,r,a){return!1}};Cf._modes={};var Xt=Cf,vh=[{key:"left",command:"moveToPreviousChar"},{key:"right",command:"moveToNextChar"},{key:"up",command:"moveUp"},{key:"down",command:"moveDown"},{key:"shift+[ArrowLeft]",command:"extendSelectionBackward"},{key:"shift+[ArrowRight]",command:"extendSelectionForward"},{key:"shift+[ArrowUp]",command:"extendSelectionUpward"},{key:"shift+[ArrowDown]",command:"extendSelectionDownward"},{key:"[Backspace]",command:"deleteBackward"},{key:"alt+[Delete]",command:"deleteBackward"},{key:"[Delete]",command:"deleteForward"},{key:"alt+[Backspace]",command:"deleteForward"},{key:"alt+[ArrowLeft]",command:"moveToPreviousWord"},{key:"alt+[ArrowRight]",command:"moveToNextWord"},{key:"shift+alt+[ArrowLeft]",command:"extendToPreviousWord"},{key:"shift+alt+[ArrowRight]",command:"extendToNextWord"},{key:"ctrl+[ArrowLeft]",command:"moveToGroupStart"},{key:"ctrl+[ArrowRight]",command:"moveToGroupEnd"},{key:"shift+ctrl+[ArrowLeft]",command:"extendToGroupStart"},{key:"shift+ctrl+[ArrowRight]",command:"extendToGroupEnd"},{key:"[Home]",command:"moveToMathfieldStart"},{key:"cmd+[ArrowLeft]",command:"moveToMathfieldStart"},{key:"shift+[Home]",command:"extendToMathFieldStart"},{key:"shift+cmd+[ArrowLeft]",command:"extendToMathFieldStart"},{key:"[End]",command:"moveToMathfieldEnd"},{key:"cmd+[ArrowRight]",command:"moveToMathfieldEnd"},{key:"shift+[End]",command:"extendToMathFieldEnd"},{key:"shift+cmd+[ArrowRight]",command:"extendToMathFieldEnd"},{key:"[Pageup]",command:"moveToGroupStart"},{key:"[Pagedown]",command:"moveToGroupEnd"},{key:"[Tab]",command:"moveToNextGroup"},{key:"shift+[Tab]",command:"moveToPreviousGroup"},{key:"[Escape]",ifMode:"math",command:["switchMode","latex"]},{key:"[Escape]",ifMode:"text",command:["switchMode","latex"]},{key:"[Escape]",ifMode:"latex",command:["complete","complete",{selectItem:"true"}]},{key:"\\",ifMode:"math",command:["switchMode","latex","\\"]},{key:"[IntlBackslash]",ifMode:"math",command:["switchMode","latex","\\"]},{key:"[Tab]",ifMode:"latex",command:["complete","accept-suggestion"]},{key:"[Return]",ifMode:"latex",command:"complete"},{key:"[Enter]",ifMode:"latex",command:"complete"},{key:"shift+[Escape]",ifMode:"latex",command:["complete","reject"]},{key:"[ArrowDown]",ifMode:"latex",command:"nextSuggestion"},{key:"[ArrowUp]",ifMode:"latex",command:"previousSuggestion"},{key:"ctrl+a",ifPlatform:"!macos",command:"selectAll"},{key:"cmd+a",command:"selectAll"},{key:"[Cut]",command:"cutToClipboard"},{key:"[Copy]",command:"copyToClipboard"},{key:"[Paste]",command:"pasteFromClipboard"},{key:"[Clear]",command:"deleteBackward"},{key:"[Undo]",command:"undo"},{key:"[Redo]",command:"redo"},{key:"[EraseEof]",command:"deleteToGroupEnd"},{key:"ctrl+x",ifPlatform:"ios",command:"cutToClipboard"},{key:"cmd+x",ifPlatform:"ios",command:"cutToClipboard"},{key:"ctrl+c",ifPlatform:"ios",command:"copyToClipboard"},{key:"cmd+c",ifPlatform:"ios",command:"copyToClipboard"},{key:"ctrl+v",ifPlatform:"ios",command:"pasteFromClipboard"},{key:"cmd+v",ifPlatform:"ios",command:"pasteFromClipboard"},{key:"ctrl+z",ifPlatform:"!macos",command:"undo"},{key:"cmd+z",command:"undo"},{key:"ctrl+y",ifPlatform:"!macos",command:"redo"},{key:"shift+cmd+y",command:"redo"},{key:"shift+ctrl+z",ifPlatform:"!macos",command:"redo"},{key:"shift+cmd+z",command:"redo"},{key:"ctrl+b",ifPlatform:"macos",command:"moveToPreviousChar"},{key:"ctrl+f",ifPlatform:"macos",command:"moveToNextChar"},{key:"ctrl+p",ifPlatform:"macos",command:"moveUp"},{key:"ctrl+n",ifPlatform:"macos",command:"moveDown"},{key:"ctrl+a",ifPlatform:"macos",command:"moveToMathfieldStart"},{key:"ctrl+e",ifPlatform:"macos",command:"moveToMathfieldEnd"},{key:"shift+ctrl+b",ifPlatform:"macos",command:"extendSelectionBackward"},{key:"shift+ctrl+f",ifPlatform:"macos",command:"extendSelectionForward"},{key:"shift+ctrl+p",ifPlatform:"macos",command:"extendSelectionUpward"},{key:"shift+ctrl+n",ifPlatform:"macos",command:"extendSelectionDownward"},{key:"shift+ctrl+a",ifPlatform:"macos",command:"extendToMathFieldStart"},{key:"shift+ctrl+e",ifPlatform:"macos",command:"extendToMathFieldEnd"},{key:"alt+ctrl+b",ifPlatform:"macos",command:"moveToPreviousWord"},{key:"alt+ctrl+f",ifPlatform:"macos",command:"moveToNextWord"},{key:"shift+alt+ctrl+b",ifPlatform:"macos",command:"extendToPreviousWord"},{key:"shift+alt+ctrl+f",ifPlatform:"macos",command:"extendToNextWord"},{key:"ctrl+h",ifPlatform:"macos",command:"deleteBackward"},{key:"ctrl+d",ifPlatform:"macos",command:"deleteForward"},{key:"ctrl+l",ifPlatform:"macos",command:"scrollIntoView"},{key:"ctrl+[Digit2]",ifMode:"math",command:["insert","\\sqrt{#0}"]},{key:"ctrl+[Digit5]",ifMode:"math",command:"moveToOpposite"},{key:"ctrl+[Digit6]",ifMode:"math",command:"moveToSuperscript"},{key:"ctrl+[Return]",ifMode:"math",command:"addRowAfter"},{key:"ctrl+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"cmd+[Return]",ifMode:"math",command:"addRowAfter"},{key:"cmd+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"alt+p",ifMode:"math",command:["insert","\\pi"]},{key:"alt+v",ifMode:"math",command:["insert","\\sqrt{#0}"]},{key:"alt+o",ifMode:"math",command:["insert","\\emptyset"]},{key:"alt+d",ifMode:"math",command:["insert","\\differentialD"]},{key:"shift+alt+o",ifMode:"math",command:["insert","\\varnothing"]},{key:"shift+alt+d",ifMode:"math",command:["insert","\\partial"]},{key:"alt+[Backslash]",ifMode:"math",command:["insert","\\backslash"]},{key:"[NumpadDivide]",ifMode:"math",command:["insert","\\frac{#@}{#?}"]},{key:"alt+[NumpadDivide]",ifMode:"math",command:["insert","\\frac{#?}{#@}"]},{key:"shift+alt+k",command:"toggleKeystrokeCaption"},{key:"alt+[Space]",command:"toggleContextMenu"},{key:"alt+shift+[Space]",command:"toggleVirtualKeyboard"},{key:"alt+ctrl+[ArrowUp]",command:["speak","all",{withHighlighting:!1}]},{key:"alt+ctrl+[ArrowDown]",command:["speak","selection",{withHighlighting:!1}]},{key:"shift+[Quote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["switchMode","text","",""]},{key:"shift+alt+[KeyT]",ifMode:"math",command:["switchMode","text","",""]},{key:"shift+[Quote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"text",command:["switchMode","math","",""]},{key:"shift+alt+[KeyT]",ifMode:"text",command:["switchMode","math","",""]},{key:"/",ifMode:"math",command:["insert","\\frac{#@}{#?}"]},{key:"alt+/",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","/"]},{key:"alt+shift+/",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","/"]},{key:"alt+[BracketLeft]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\left\\lbrack #0 \\right\\rbrack"]},{key:"ctrl+[Minus]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"moveToSubscript"},{key:"shift+alt+[BracketLeft]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\left\\lbrace #0 \\right\\rbrace"]},{key:"ctrl+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowAfter"},{key:"cmd+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowAfter"},{key:"shift+ctrl+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowBefore"},{key:"shift+cmd+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowBefore"},{key:"ctrl+[Backspace]",ifMode:"math",command:"removeRow"},{key:"cmd+[Backspace]",ifMode:"math",command:"removeRow"},{key:"alt+[Tab]",ifMode:"math",command:"addColumnAfter"},{key:"shift+alt+[Tab]",ifMode:"math",command:"addColumnBefore"},{key:"alt+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"shift+alt+[Enter]",ifMode:"math",command:"addRowBefore"},{key:"alt+[Return]",ifMode:"math",command:"addRowAfter"},{key:"shift+alt+[Return]",ifMode:"math",command:"addRowBefore"},{key:"shift+[Backspace]",ifMode:"math",command:"removeColumn"},{key:"alt+[Digit5]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","$\\infty"]},{key:"alt+[Digit9]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","("]},{key:"alt+[Digit0]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert",")"]},{key:"alt+|",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","|"]},{key:"shift+[Backquote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\~"]},{key:"[Backquote]",ifLayout:["windows.french","linux.french"],ifMode:"math",command:["insert","^2"]},{key:"[Backquote]",ifLayout:["windows.german","linux.german"],ifMode:"math",command:["insert","^"]},{key:"[IntlBackslash]",ifLayout:["apple.german"],ifMode:"math",command:["insert","^"]}],hu={"\\sqrt":["alt+v","ctrl+[Digit2]"],"\\pi":"alt+p","\\infty":"alt+[Digit5]","\\differentialD":"alt+d","\\partial":"shift+alt+d","\\frac":"Slash","\\emptyset":"alt+o","\\varnothing":"shift+alt+o","\\~":"~"};function po(e){var t;return((t=e.element)==null?void 0:t.mathfield)===e}function mo(e){var t,r;return(r=(t=e.querySelector(".ML__caret"))!=null?t:e.querySelector(".ML__text-caret"))!=null?r:e.querySelector(".ML__latex-caret")}function Ds(e){const t=mo(e);if(!t)return null;const r=t.getBoundingClientRect();return{x:r.right,y:r.bottom,height:r.height}}function du(e){var t;if(!e.parent)return"root";let r=(t=e.parent.id)!=null?t:"";return r+=typeof e.parentBranch=="string"?"-"+e.parentBranch:`-${e.parentBranch[0]}/${e.parentBranch[0]}`,r}function pu(e,t,r){if(!t)return null;const a=e.field.getBoundingClientRect(),b=t.right-t.left,L=t.bottom-t.top,N=Math.ceil(t.left-a.left+e.field.scrollLeft*r),J=Math.ceil(t.top-a.top);return{left:N,right:N+b,top:J,bottom:J+L}}function mu(e){const t=e.getBoundingClientRect(),r=parseInt(getComputedStyle(e).marginRight),a={top:t.top-1,bottom:t.bottom,left:t.left,right:t.right-1+r};if(e.children.length===0||e.tagName.toUpperCase()==="SVG")return a;for(const b of e.children)if(b.nodeType===1&&"atomId"in b.dataset&&!b.classList.contains("pstrut")){const L=mu(b);a.left=Math.min(a.left,L.left),a.right=Math.max(a.right,L.right),a.top=Math.min(a.top,L.top),a.bottom=Math.max(a.bottom,L.bottom)}return a}function Ua(e,t){var r,a;if(!t.id)return null;let b=(a=(r=e.atomBoundsCache)==null?void 0:r.get(t.id))!=null?a:null;if(b!==null)return b;const L=e.field.querySelector(`[data-atom-id="${t.id}"]`);return b=L?mu(L):null,e.atomBoundsCache&&(b?e.atomBoundsCache.set(t.id,b):e.atomBoundsCache.delete(t.id)),b!=null?b:null}function kf(e,t,r){const a=new Map;for(const b of e.model.getAtoms(t,{includeChildren:!0})){if(r!=null&&r.excludeAtomsWithBackground&&b.style.backgroundColor)continue;const L=e.field,N=L.offsetWidth;let ie=Math.floor(L.getBoundingClientRect().width)/N;ie=isNaN(ie)?1:ie;const ue=pu(e,Ua(e,b),ie);if(ue){const pe=du(b);if(a.has(pe)){const Ee=a.get(pe);a.set(pe,{left:Math.min(Ee.left,ue.left),right:Math.max(Ee.right,ue.right),top:Math.min(Ee.top,ue.top),bottom:Math.max(Ee.bottom,ue.bottom)})}else a.set(pe,ue)}}return[...a.values()]}function gu(e,t){return e.model.selection.ranges.reduce((r,a)=>r.concat(...kf(e,a,t)),[])}function vu(e,t){return e==="*"||t==="none"?!0:t==="same-origin"?!window.origin||e===window.origin:typeof t=="function"?t(e):!1}function hc(e){let t=0,r=0;const a=e.offsetWidth,b=e.offsetHeight;for(;e instanceof HTMLElement;)t+=e.offsetTop,r+=e.offsetLeft,e=e.offsetParent;return new DOMRect(r,t,a,b)}var Ef=`@keyframes ML__caret-blink {
0%,
100% {
opacity: 1;
}
50% {
opacity: 0;
}
}
.ML__container {
display: inline-flex;
flex-flow: row;
justify-content: space-between;
align-items: flex-end;
min-height: 39px;
/* Need some room for the virtual keyboard toggle */
width: 100%;
/* Encourage browsers to consider allocating a hardware accelerated
layer for this element. */
isolation: isolate;
/* Prevent the browser from trying to interpret touch gestures in the field */
/* "Disabling double-tap to zoom removes the need for browsers to
delay the generation of click events when the user taps the screen." */
touch-action: none;
--_caret-color: var(--caret-color, hsl(var(--_hue), 40%, 49%));
--_selection-color: var(--selection-color, #000);
--_selection-background-color: var(--selection-background-color, hsl(var(--_hue), 70%, 85%));
--_text-highlight-background-color: var(--highlight-text, hsla(var(--_hue), 40%, 50%, 0.1));
--_contains-highlight-background-color: var(--contains-highlight-background-color, hsl(var(--_hue), 40%, 95%));
--_smart-fence-color: var(--smart-fence-color, currentColor);
--_smart-fence-opacity: var(--smart-fence-opacity, 0.5);
--_latex-color: var(--latex-color, hsl(var(--_hue), 80%, 40%));
--_correct-color: var(--correct-color, #10a000);
--_incorrect-color: var(--incorrect-color, #a01b00);
--_composition-background-color: var(--composition-background-color, #fff1c2);
--_composition-text-color: var(--composition-text-color, black);
--_composition-underline-color: var(--composition-underline-color, transparent);
}
/* This is the actual field content (formula) */
.ML__content {
display: flex;
align-items: center;
align-self: center;
position: relative;
overflow: hidden;
padding: 2px 3px 2px 1px;
width: 100%;
}
.ML__virtual-keyboard-toggle,
.ML__menu-toggle {
box-sizing: border-box;
display: flex;
align-self: center;
align-items: center;
flex-shrink: 0;
flex-direction: column;
justify-content: center;
width: 34px;
height: 34px;
padding: 0;
margin-right: 4px;
cursor: pointer;
/* Avoid some weird blinking with :hover */
border-radius: 8px;
border: 1px solid transparent;
transition: background 0.2s cubic-bezier(0.64, 0.09, 0.08, 1);
color: hsl(var(--_hue), 40%, 50%);
fill: currentColor;
background: transparent;
}
.ML__virtual-keyboard-toggle:hover,
.ML__menu-toggle:hover {
background: hsla(0, 0%, 70%, 0.3);
color: #333;
fill: currentColor;
}
.ML__virtual-keyboard-toggle > span,
.ML__menu-toggle > span {
display: flex;
align-self: center;
align-items: center;
}
/* The invisible element used to capture keyboard events. We're just trying
really hard to make sure it doesn't show. */
.ML__keyboard-sink {
display: inline-block;
resize: none;
outline: none;
border: none;
/* Need these for Microsoft Edge */
position: fixed;
clip: rect(0 0 0 0);
/* Need this to prevent iOS Safari from auto-zooming */
font-size: 1em;
font-family: KaTeX_Main;
line-height: 0.5;
/* On Chromium, if this is 0, no keyboard events are received */
}
[part="placeholder"] {
color: var(--neutral-400);
}
.ML__composition {
background: var(--_composition-background-color);
color: var(--_composition-text-color);
text-decoration: underline var(--_composition-underline-color);
}
.ML__caret::after {
content: '';
visibility: hidden;
width: 0;
display: inline-block;
height: 0.76em;
--_caret-width: clamp(2px, 0.08em, 10px);
border: none;
border-radius: calc(var(--_caret-width) / 2);
border-right: var(--_caret-width) solid var(--_caret-color);
margin-right: calc(-1 * var(--_caret-width));
position: relative;
left: -0.045em;
bottom: -0.05em;
animation: ML__caret-blink 1.05s step-end forwards infinite;
}
.ML__text-caret::after {
content: '';
visibility: hidden;
width: 0;
display: inline-block;
height: 0.76em;
--_caret-width: clamp(2px, 0.08em, 10px);
border: none;
border-radius: calc(var(--_caret-width) / 2);
border-right: var(--_caret-width) solid var(--_caret-color);
margin-right: calc(-1 * var(--_caret-width));
position: relative;
left: -0.045em;
bottom: -0.05em;
animation: ML__caret-blink 1.05s step-end forwards infinite;
}
.ML__latex-caret::after {
content: '';
visibility: hidden;
--_caret-width: clamp(2px, 0.08em, 10px);
border: none;
border-radius: calc(var(--_caret-width) / 2);
border-right: var(--_caret-width) solid var(--_latex-color);
margin-right: calc(-1 * var(--_caret-width));
position: relative;
left: -0.019em;
animation: ML__caret-blink 1.05s step-end forwards infinite;
}
.ML__focused .ML__latex-caret::after,
.ML__focused .ML__text-caret::after,
.ML__focused .ML__caret::after {
visibility: visible;
}
.ML__focused .ML__text {
background: var(--_text-highlight-background-color);
}
/* When using smartFence, the anticipated closing fence is displayed
with this style */
.ML__smart-fence__close {
opacity: var(--_smart-fence-opacity);
color: var(--_smart-fence-color);
}
.ML__selected,
.ML__focused .ML__selected .ML__contains-caret,
.ML__focused .ML__selected .ML__smart-fence__close,
.ML__focused .ML__selected .ML__placeholder {
color: var(--_selection-color);
opacity: 1;
}
.ML__selection {
box-sizing: border-box;
background: var(--_selection-background-color) !important;
}
.ML__contains-caret.ML__close,
.ML__contains-caret.ML__open,
.ML__contains-caret > .ML__close,
.ML__contains-caret > .ML__open,
.ML__contains-caret .ML__sqrt-sign,
.ML__contains-caret .ML__sqrt-line {
color: var(--_caret-color);
}
.ML__contains-highlight {
box-sizing: border-box;
background: transparent;
}
.ML__focused .ML__contains-highlight {
background: var(--_contains-highlight-background-color);
}
.ML__raw-latex {
font-family: 'Berkeley Mono', 'IBM Plex Mono', 'Source Code Pro', Consolas, 'Roboto Mono', Menlo, 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Courier, monospace;
font-weight: 400;
font-size: 0.8em;
letter-spacing: -0.05em;
color: var(--_latex-color);
}
.ML__suggestion {
color: var(--neutral-500);
}
.ML__virtual-keyboard-toggle.is-visible.is-pressed:hover {
background: hsl(var(--_hue), 25%, 35%);
color: #fafafa;
fill: currentColor;
}
.ML__virtual-keyboard-toggle:focus {
outline: none;
border-radius: 8px;
border: 2px solid hsl(var(--_hue), 40%, 50%);
}
.ML__virtual-keyboard-toggle.is-pressed,
.ML__virtual-keyboard-toggle.is-active:hover,
.ML__virtual-keyboard-toggle.is-active {
background: hsl(var(--_hue), 25%, 35%);
color: #fafafa;
fill: currentColor;
}
/* Add an attribute 'data-tooltip' to automatically show a
tooltip over a element on hover.
*/
[data-tooltip] {
position: relative;
}
[data-tooltip]::after {
content: attr(data-tooltip);
position: absolute;
display: block;
z-index: 2;
pointer-events: none;
right: auto;
top: calc(-100% - 4px);
width: max-content;
max-width: 200px;
padding: 8px 8px;
border-radius: 4px;
background: #616161;
color: #fff;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
text-align: center;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-style: normal;
font-weight: 400;
font-size: 13px;
/* Phone */
opacity: 0;
transform: scale(0.5);
}
@media only screen and (max-width: 767px) {
[data-tooltip]::after {
padding: 8px 16px;
font-size: 16px;
}
}
menu [data-tooltip]::after {
left: 100%;
top: 0%;
}
menu .ML__base {
cursor: default;
}
/** Don't display if we're tracking, i.e. have the pointer down */
.tracking [data-tooltip]:hover::after {
/* Use visibility, not display. Display will remove the after from the DOM, and the override below will not work */
visibility: hidden;
}
/** But do display if tracking and inside a menu */
.tracking menu li[data-tooltip]:hover::after,
[data-tooltip]:hover::after {
visibility: visible;
opacity: 1;
transform: scale(1);
transition-property: opacity, scale;
transition-duration: 0.15s;
transition-delay: 1s;
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}
.ML__prompt {
border-radius: 2px;
}
.ML__editablePromptBox {
outline: 1px solid #acacac;
border-radius: 2px;
z-index: -1;
}
.ML__focusedPromptBox {
outline: highlight auto 1px;
}
.ML__lockedPromptBox {
background-color: rgba(142, 142, 141, 0.4);
z-index: -1;
}
.ML__correctPromptBox {
outline: 1px solid var(--_correct-color);
box-shadow: 0 0 5px var(--_correct-color);
}
.ML__incorrectPromptBox {
outline: 1px solid var(--_incorrect-color);
box-shadow: 0 0 5px var(--_incorrect-color);
}
.variant-submenu {
display: flex;
flex-direction: column;
padding: 8px;
}
.variant-submenu [part=menu-item] {
font-size: 2rem;
text-align: center;
margin: 0;
}
.insert-matrix-submenu {
display: grid;
padding: 8px;
align-content: center;
justify-content: center;
grid-template-columns: repeat(5, minmax(0, 1fr));
}
.insert-matrix-submenu [part=menu-item] {
font-size: 21px;
border: none;
border-radius: 0;
line-height: 21px;
text-align: center;
padding: 0;
margin: 0;
}
.border-submenu [part=menu-item] {
font-size: 2rem;
line-height: 1.2;
text-align: center;
}
.swatches-submenu {
--_swatch-size: 2rem;
--_columns: 4;
display: flex;
flex-flow: wrap;
padding: 8px;
max-width: calc(var(--_columns) * (var(--_swatch-size) + 18px) + 16px);
box-sizing: border-box;
}
.menu-swatch {
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
width: fit-content;
height: fit-content;
margin: 2px;
padding: 0;
background: var(--neutral-200);
}
.menu-swatch > .label {
padding: 0;
margin: 0;
line-height: 0;
}
.menu-swatch > .label > span {
display: inline-block;
margin: 6px;
min-width: var(--_swatch-size);
min-height: var(--_swatch-size);
border-radius: 50%;
}
.menu-swatch.active {
background: var(--neutral-100);
scale: 1.4;
}
.menu-swatch.active > .label > span {
border-radius: 2px;
}
.menu-swatch .ui-checkmark,
.menu-swatch .ui-mixedmark {
position: absolute;
margin: 0;
padding: 0;
color: white;
}
.menu-swatch.dark-contrast .ui-checkmark,
.menu-swatch.dark-contrast .ui-mixedmark {
color: #000;
}
`,$r=`.ML__container {
min-height: auto !important;
--_hue: var(--hue, 212);
--_placeholder-color: var(--placeholder-color, hsl(var(--_hue), 40%, 49%));
--_placeholder-opacity: var(--placeholder-opacity, 0.4);
--_text-font-family: var(--text-font-family, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif);
}
.ML__sr-only {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
clip-path: inset(50%);
white-space: nowrap;
border: 0;
}
.ML__is-inline {
display: inline-block;
}
.ML__base {
visibility: inherit;
display: inline-block;
position: relative;
cursor: text;
padding: 0;
margin: 0;
box-sizing: content-box;
border: 0;
outline: 0;
vertical-align: baseline;
font-weight: inherit;
font-family: inherit;
font-style: inherit;
text-decoration: none;
width: min-content;
}
.ML__strut,
.ML__strut--bottom {
display: inline-block;
min-height: 0.5em;
}
.ML__small-delim {
font-family: KaTeX_Main;
}
/* Text mode */
.ML__text {
font-family: var(--_text-font-family);
white-space: pre;
}
/* Use cmr for 'math upright' */
.ML__cmr {
font-family: KaTeX_Main;
font-style: normal;
}
.ML__mathit {
font-family: KaTeX_Math;
/* The KaTeX_Math font is italic by default, so the font-style below is only
useful when a fallback font is used
*/
font-style: italic;
}
.ML__mathbf {
font-family: KaTeX_Main;
font-weight: bold;
}
/* Lowercase greek symbols should stick to math font when \\mathbf is applied
to match TeX idiosyncratic behavior */
.lcGreek.ML__mathbf {
font-family: KaTeX_Math;
font-weight: normal;
}
.ML__mathbfit {
font-family: KaTeX_Math;
font-weight: bold;
font-style: italic;
}
.ML__ams {
font-family: KaTeX_AMS;
}
/* Blackboard */
.ML__bb {
font-family: KaTeX_AMS;
}
.ML__cal {
font-family: KaTeX_Caligraphic;
}
.ML__frak {
font-family: KaTeX_Fraktur;
}
.ML__tt {
font-family: KaTeX_Typewriter;
}
.ML__script {
font-family: KaTeX_Script;
}
.ML__sans {
font-family: KaTeX_SansSerif;
}
.ML__series_ul {
font-weight: 100;
}
.ML__series_el {
font-weight: 100;
}
.ML__series_l {
font-weight: 200;
}
.ML__series_sl {
font-weight: 300;
}
.ML__series_sb {
font-weight: 500;
}
.ML__bold,
.ML__boldsymbol {
font-weight: 700;
}
.ML__series_eb {
font-weight: 800;
}
.ML__series_ub {
font-weight: 900;
}
.ML__series_uc {
font-stretch: ultra-condensed;
}
.ML__series_ec {
font-stretch: extra-condensed;
}
.ML__series_c {
font-stretch: condensed;
}
.ML__series_sc {
font-stretch: semi-condensed;
}
.ML__series_sx {
font-stretch: semi-expanded;
}
.ML__series_x {
font-stretch: expanded;
}
.ML__series_ex {
font-stretch: extra-expanded;
}
.ML__series_ux {
font-stretch: ultra-expanded;
}
.ML__it {
font-style: italic;
}
.ML__shape_ol {
-webkit-text-stroke: 1px black;
text-stroke: 1px black;
color: transparent;
}
.ML__shape_sc {
font-variant: small-caps;
}
.ML__shape_sl {
font-style: oblique;
}
/* First level emphasis */
.ML__emph {
color: #bc2612;
}
/* Second level emphasis */
.ML__emph .ML__emph {
color: #0c7f99;
}
.ML__highlight {
color: #007cb2;
background: #edd1b0;
}
.ML__center {
text-align: center;
}
.ML__label_padding {
padding: 0 0.5em;
}
.ML__frac-line {
width: 100%;
min-height: 1px;
}
.ML__frac-line:after {
content: '';
display: block;
margin-top: max(-1px, -0.04em);
min-height: max(1px, 0.04em);
/* Ensure the line is visible when printing even if "turn off background images" is on*/
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
/* There's a bug since Chrome 62 where
sub-pixel border lines don't draw at some zoom
levels (110%, 90%).
Setting the min-height used to work around it, but that workaround
broke in Chrome 84 or so.
Setting the background (and the min-height) seems to work for now.
*/
background: currentColor;
box-sizing: content-box;
/* Vuetify sets the box-sizing to inherit
causes the fraction line to not draw at all sizes (see #26) */
/* On some versions of Firefox on Windows, the line fails to
draw at some zoom levels, but setting the transform triggers
the hardware accelerated path, which works */
transform: translate(0, 0);
}
.ML__sqrt {
display: inline-block;
}
.ML__sqrt-sign {
display: inline-block;
position: relative;
}
.ML__sqrt-line {
display: inline-block;
height: max(1px, 0.04em);
width: 100%;
}
.ML__sqrt-line:before {
content: '';
display: block;
margin-top: min(-1px, -0.04em);
min-height: max(1px, 0.04em);
/* Ensure the line is visible when printing even if "turn off background images" is on*/
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
background: currentColor;
/* On some versions of Firefox on Windows, the line fails to
draw at some zoom levels, but setting the transform triggers
the hardware accelerated path, which works */
transform: translate(0, 0);
}
.ML__sqrt-line:after {
border-bottom-width: 1px;
content: ' ';
display: block;
margin-top: -0.1em;
}
.ML__sqrt-index {
margin-left: 0.27777778em;
margin-right: -0.55555556em;
}
.ML__delim-size1 {
font-family: KaTeX_Size1;
}
.ML__delim-size2 {
font-family: KaTeX_Size2;
}
.ML__delim-size3 {
font-family: KaTeX_Size3;
}
.ML__delim-size4 {
font-family: KaTeX_Size4;
}
.ML__delim-mult .delim-size1 > span {
font-family: KaTeX_Size1;
}
.ML__delim-mult .delim-size4 > span {
font-family: KaTeX_Size4;
}
.ML__accent-body > span {
font-family: KaTeX_Main;
width: 0;
}
.ML__accent-vec {
position: relative;
left: 0.24em;
}
/** The markup for a LaTeX formula, either in an editable mathfield or
in a static display.
*/
.ML__latex {
display: inline-block;
direction: ltr;
text-align: left;
text-indent: 0;
text-rendering: auto;
font-family: KaTeX_Main, 'Times New Roman', serif;
font-style: normal;
font-size-adjust: none;
font-stretch: normal;
font-variant-caps: normal;
letter-spacing: normal;
line-height: 1.2;
word-wrap: normal;
word-spacing: normal;
white-space: nowrap;
text-shadow: none;
-webkit-user-select: none;
user-select: none;
width: min-content;
}
.ML__latex .style-wrap {
position: relative;
}
.ML__latex .mfrac {
display: inline-block;
}
.ML__latex .left-right {
display: inline-block;
}
.ML__latex .vlist-t {
display: inline-table;
table-layout: fixed;
border-collapse: collapse;
}
.ML__latex .vlist-r {
display: table-row;
}
.ML__latex .vlist {
display: table-cell;
vertical-align: bottom;
position: relative;
}
.ML__latex .vlist > span {
display: block;
height: 0;
position: relative;
}
.ML__latex .vlist > span > span {
display: inline-block;
}
.ML__latex .vlist > span > .pstrut {
overflow: hidden;
width: 0;
}
.ML__latex .vlist-t2 {
margin-right: -2px;
}
.ML__latex .vlist-s {
display: table-cell;
vertical-align: bottom;
font-size: 1px;
width: 2px;
min-width: 2px;
}
.ML__latex .msubsup {
text-align: left;
}
.ML__latex .negativethinspace {
display: inline-block;
margin-left: -0.16667em;
height: 0.71em;
}
.ML__latex .thinspace {
display: inline-block;
width: 0.16667em;
height: 0.71em;
}
.ML__latex .mediumspace {
display: inline-block;
width: 0.22222em;
height: 0.71em;
}
.ML__latex .thickspace {
display: inline-block;
width: 0.27778em;
height: 0.71em;
}
.ML__latex .enspace {
display: inline-block;
width: 0.5em;
height: 0.71em;
}
.ML__latex .quad {
display: inline-block;
width: 1em;
height: 0.71em;
}
.ML__latex .qquad {
display: inline-block;
width: 2em;
height: 0.71em;
}
.ML__latex .llap,
.ML__latex .rlap {
width: 0;
position: relative;
display: inline-block;
}
.ML__latex .llap > .inner,
.ML__latex .rlap > .inner {
position: absolute;
}
.ML__latex .llap > .fix,
.ML__latex .rlap > .fix {
display: inline-block;
}
.ML__latex .llap > .inner {
right: 0;
}
.ML__latex .rlap > .inner {
left: 0;
}
.ML__latex .rule {
display: inline-block;
border: solid 0;
position: relative;
box-sizing: border-box;
}
.ML__latex .overline .overline-line,
.ML__latex .underline .underline-line {
width: 100%;
}
.ML__latex .overline .overline-line:before,
.ML__latex .underline .underline-line:before {
content: '';
border-bottom-style: solid;
border-bottom-width: max(1px, 0.04em);
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
display: block;
}
.ML__latex .overline .overline-line:after,
.ML__latex .underline .underline-line:after {
border-bottom-style: solid;
border-bottom-width: max(1px, 0.04em);
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
content: '';
display: block;
margin-top: -1px;
}
.ML__latex .stretchy {
display: block;
position: absolute;
width: 100%;
left: 0;
overflow: hidden;
}
.ML__latex .stretchy:before,
.ML__latex .stretchy:after {
content: '';
}
.ML__latex .stretchy svg {
display: block;
position: absolute;
width: 100%;
height: inherit;
fill: currentColor;
stroke: currentColor;
fill-rule: nonzero;
fill-opacity: 1;
stroke-width: 1;
stroke-linecap: butt;
stroke-linejoin: miter;
stroke-miterlimit: 4;
stroke-dasharray: none;
stroke-dashoffset: 0;
stroke-opacity: 1;
}
.ML__latex .slice-1-of-2 {
display: inline-flex;
position: absolute;
left: 0;
width: 50.2%;
overflow: hidden;
}
.ML__latex .slice-2-of-2 {
display: inline-flex;
position: absolute;
right: 0;
width: 50.2%;
overflow: hidden;
}
.ML__latex .slice-1-of-3 {
display: inline-flex;
position: absolute;
left: 0;
width: 25.1%;
overflow: hidden;
}
.ML__latex .slice-2-of-3 {
display: inline-flex;
position: absolute;
left: 25%;
width: 50%;
overflow: hidden;
}
.ML__latex .slice-3-of-3 {
display: inline-flex;
position: absolute;
right: 0;
width: 25.1%;
overflow: hidden;
}
.ML__latex .slice-1-of-1 {
display: inline-flex;
position: absolute;
width: 100%;
left: 0;
overflow: hidden;
}
.ML__latex .nulldelimiter {
display: inline-block;
}
.ML__latex .op-group {
display: inline-block;
}
.ML__latex .op-symbol {
position: relative;
}
.ML__latex .op-symbol.small-op {
font-family: KaTeX_Size1;
}
.ML__latex .op-symbol.large-op {
font-family: KaTeX_Size2;
}
.ML__latex .mtable .vertical-separator {
display: inline-block;
min-width: 1px;
box-sizing: border-box;
}
.ML__latex .mtable .arraycolsep {
display: inline-block;
}
.ML__latex .mtable .col-align-m > .vlist-t {
text-align: center;
}
.ML__latex .mtable .col-align-c > .vlist-t {
text-align: center;
}
.ML__latex .mtable .col-align-l > .vlist-t {
text-align: left;
}
.ML__latex .mtable .col-align-r > .vlist-t {
text-align: right;
}
.ML__error {
display: inline-block;
background-image: radial-gradient(ellipse at center, hsl(341, 100%, 40%), rgba(0, 0, 0, 0) 70%);
background-color: hsla(341, 100%, 40%, 0.1);
background-repeat: repeat-x;
background-size: 3px 3px;
padding-bottom: 3px;
background-position: 0 100%;
}
.ML__error > .ML__error {
background: transparent;
padding: 0;
}
.ML__placeholder {
color: var(--_placeholder-color);
opacity: var(--_placeholder-opacity);
padding-left: 0.4ex;
padding-right: 0.4ex;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}
.ML__notation {
position: absolute;
box-sizing: border-box;
line-height: 0;
}
/* This class is used to implement the \`\\mathtip\` and \`\\texttip\` commands
For UI elements, see \`[data-ML__tooltip]\`
*/
.ML__tooltip-container {
position: relative;
transform: scale(0);
}
.ML__tooltip-container .ML__tooltip-content {
position: fixed;
display: inline-table;
visibility: hidden;
z-index: 2;
width: max-content;
max-width: 400px;
padding: 12px 12px;
border-radius: 8px;
background: #616161;
--_selection-color: #fff;
color: #fff;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
opacity: 0;
transition: opacity 0.15s cubic-bezier(0.4, 0, 1, 1);
}
.ML__tooltip-container .ML__tooltip-content .ML__text {
white-space: normal;
}
.ML__tooltip-container .ML__tooltip-content .ML__base {
display: contents;
}
.ML__tooltip-container:hover .ML__tooltip-content {
visibility: visible;
opacity: 1;
font-size: 0.75em;
transform: scale(1) translate(0, 3em);
}
`,Mf=`#mathlive-environment-popover.is-visible {
visibility: visible;
}
#mathlive-environment-popover {
--_environment-panel-height: var(--environment-panel-height, 70px);
--_accent-color: var(--accent-color, #aaa);
--_background: var(--environment-panel-background, #fff);
--_button-background: var(--environment-panel-button-background, white);
--_button-background-hover: var(--environment-panel-button-background-hover, #f5f5f7);
--_button-background-active: var(--environment-panel-button-background-active, #f5f5f7);
--_button-text: var(--environment-panel-button-text, #e3e4e8);
position: absolute;
width: calc(var(--_environment-panel-height) * 2);
height: var(--_environment-panel-height);
border-radius: 4px;
border: 1.5px solid var(--_accent-color);
background-color: var(--_background);
box-shadow: 0 0 30px 0 var(--environment-shadow, rgba(0, 0, 0, 0.4));
pointer-events: all;
visibility: hidden;
}
#mathlive-environment-popover .MLEP__array-buttons {
height: calc(var(--_environment-panel-height) * 5/4);
width: calc(var(--_environment-panel-height) * 5/4);
margin-left: calc(0px - var(--_environment-panel-height) * 0.16);
margin-top: calc(0px - var(--_environment-panel-height) * 0.19);
}
#mathlive-environment-popover .MLEP__array-buttons .font {
fill: white;
}
#mathlive-environment-popover .MLEP__array-buttons circle {
fill: #7f7f7f;
transition: fill 300ms;
}
#mathlive-environment-popover .MLEP__array-buttons .MLEP__array-insert-background {
fill-opacity: 1;
fill: var(--_background);
stroke: var(--_accent-color);
stroke-width: 3px;
}
#mathlive-environment-popover .MLEP__array-buttons line {
stroke: var(--_accent-color);
stroke-opacity: 0;
stroke-width: 40;
pointer-events: none;
transition: stroke-opacity 300ms;
stroke-linecap: round;
}
#mathlive-environment-popover .MLEP__array-buttons g[data-command]:hover circle {
fill: var(--_accent-color);
}
#mathlive-environment-popover .MLEP__array-buttons g[data-command]:hover line {
stroke-opacity: 1;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls {
height: 100%;
width: 50%;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options {
width: var(--_environment-panel-height);
height: var(--_environment-panel-height);
display: flex;
flex-wrap: wrap;
flex-direction: row;
justify-content: space-around;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg {
pointer-events: all;
margin-top: 2px;
width: calc(var(--_environment-panel-height) / 3 * 28 / 24);
height: calc(var(--_environment-panel-height) / 3 - 2px);
border-radius: calc(var(--_environment-panel-height) / 25);
background-color: var(--_button-background);
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg:hover {
background-color: var(--_button-background-hover);
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg path,
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg line {
stroke: var(--_button-text);
stroke-width: 2;
stroke-linecap: round;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg rect,
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg path {
fill-opacity: 0;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active {
pointer-events: none;
background-color: var(--_button-background-active);
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active path,
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active line {
stroke: var(--_accent-color);
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active circle {
fill: var(--_accent-color);
}
`,yh=`/* The element that display info while in latex mode */
#mathlive-suggestion-popover {
background-color: rgba(97, 97, 97);
color: #fff;
text-align: center;
border-radius: 8px;
position: fixed;
z-index: 1;
display: none;
flex-direction: column;
justify-content: center;
box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
}
#mathlive-suggestion-popover.top-tip::after {
content: '';
position: absolute;
top: -15px;
left: calc(50% - 15px);
width: 0;
height: 0;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
border-bottom: 15px solid rgba(97, 97, 97);
font-size: 1rem;
}
#mathlive-suggestion-popover.bottom-tip::after {
content: '';
position: absolute;
bottom: -15px;
left: calc(50% - 15px);
width: 0;
height: 0;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
border-top: 15px solid rgba(97, 97, 97);
font-size: 1rem;
}
#mathlive-suggestion-popover.is-animated {
transition: all 0.2s cubic-bezier(0.64, 0.09, 0.08, 1);
animation: ML__fade-in cubic-bezier(0, 0, 0.2, 1) 0.15s;
}
#mathlive-suggestion-popover.is-visible {
display: flex;
}
@keyframes ML__fade-in {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
/* The wrapper class for the entire content of the popover panel */
#mathlive-suggestion-popover ul {
display: flex;
flex-flow: column;
list-style: none;
margin: 0;
padding: 0;
align-items: flex-start;
max-height: 400px;
overflow-y: auto;
}
#mathlive-suggestion-popover li {
display: flex;
flex-direction: row;
justify-content: space-between;
margin: 8px;
padding: 8px;
width: calc(100% - 16px - 16px);
column-gap: 1em;
border-radius: 8px;
cursor: pointer;
/* Since the content can be clicked on, provide feedback on hover */
}
#mathlive-suggestion-popover li a {
color: #5ea6fd;
padding-top: 0.3em;
margin-top: 0.4em;
display: block;
}
#mathlive-suggestion-popover li a:hover {
color: #5ea6fd;
text-decoration: underline;
}
#mathlive-suggestion-popover li:hover,
#mathlive-suggestion-popover li.is-pressed,
#mathlive-suggestion-popover li.is-active {
background: rgba(255, 255, 255, 0.1);
}
/* The command inside a popover (inside a #mathlive-suggestion-popover) */
.ML__popover__command {
font-size: 1.6rem;
font-family: KaTeX_Main;
}
.ML__popover__current {
background: #5ea6fd;
color: #fff;
}
.ML__popover__latex {
font-family: 'IBM Plex Mono', 'Source Code Pro', Consolas, 'Roboto Mono', Menlo, 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Courier, monospace;
align-self: center;
}
/* The keyboard shortcuts for a symbol as displayed in the popover */
.ML__popover__keybinding {
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 0.8em;
opacity: 0.7;
}
/* Style for the character that joins the modifiers of a keyboard shortcut
(usually a "+" sign)*/
.ML__shortcut-join {
opacity: 0.5;
}
`,Wa=`/* The element that displays the keys as the user type them */
#mathlive-keystroke-caption-panel {
visibility: hidden;
/*min-width: 160px;*/
/*background-color: rgba(97, 97, 200, .95);*/
background: var(--secondary, hsl(var(--_hue), 19%, 26%));
border-color: var(--secondary-border, hsl(0, 0%, 91%));
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
text-align: center;
border-radius: 6px;
padding: 16px;
position: absolute;
z-index: 1;
display: flex;
flex-direction: row-reverse;
justify-content: center;
--keystroke: white;
--on-keystroke: #555;
--keystroke-border: #f7f7f7;
}
@media (prefers-color-scheme: dark) {
body:not([theme='light']) #mathlive-keystroke-caption-panel {
--keystroke: hsl(var(--_hue), 50%, 30%);
--on-keystroke: hsl(0, 0%, 98%);
--keystroke-border: hsl(var(--_hue), 50%, 25%);
}
}
body[theme='dark'] #mathlive-keystroke-caption-panel {
--keystroke: hsl(var(--_hue), 50%, 30%);
--on-keystroke: hsl(0, 0%, 98%);
--keystroke-border: hsl(var(--_hue), 50%, 25%);
}
#mathlive-keystroke-caption-panel > span {
min-width: 14px;
/*height: 8px;*/
margin: 0 8px 0 0;
padding: 4px;
background-color: var(--keystroke);
color: var(--on-keystroke);
fill: currentColor;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 1em;
border-radius: 6px;
border: 2px solid var(--keystroke-border);
/*box-shadow: 0 7px 14px rgba(0,0,0,0.25), 0 5px 5px rgba(0,0,0,0.22);*/
}
`,bh=`.ML__keyboard {
--_keyboard-height: 0;
--_keyboard-zindex: var(--keyboard-zindex, 105);
--_accent-color: var(--keyboard-accent-color, #0c75d8);
--_background: var(--keyboard-background, #cacfd7);
--_border: var(--keyboard-border, #ddd);
--_padding-horizontal: var(--keyboard-padding-horizontal, 0px);
--_padding-top: var(--keyboard-padding-top, 5px);
--_padding-bottom: var(--keyboard-padding-bottom, 0px);
--_row-padding-left: var(--keyboard-row-padding-left, 0px);
--_row-padding-right: var(--keyboard-row-padding-right, 0px);
--_toolbar-text: var(--keyboard-toolbar-text, #2c2e2f);
--_toolbar-text-active: var(--keyboard-toolbar-text-active, var(--_accent-color));
--_toolbar-background: var(--keyboard-toolbar-background, transparent);
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #eee);
--_toolbar-background-selected: var(--keyboard-toolbar-background-selected, transparent);
--_toolbar-font-size: var(--keyboard-toolbar-font-size, '135%');
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #fff);
--_keycap-background: var(--keycap-background, white);
--_keycap-background-hover: var(--keycap-background-hover, #f5f5f7);
--_keycap-background-active: var(--keycap-background-active, var(--_accent-color));
--_keycap-background-pressed: var(--keycap-background-pressed, var(--_accent-color));
--_keycap-border: var(--keycap-border, #e5e6e9);
--_keycap-border-bottom: var(--keycap-border-bottom, #8d8f92);
--_keycap-text: var(--keycap-text, #000);
--_keycap-text-active: var(--keycap-text-active, #fff);
--_keycap-text-hover: var(--keycap-text-hover, var(--_keycap-text));
--_keycap-text-pressed: var(--keycap-text-pressed, #fff);
--_keycap-shift-text: var(--keycap-shift-text, var(--_accent-color));
--_keycap-primary-background: var(--keycap-primary-background, var(--_accent-color));
--_keycap-primary-text: var(--keycap-primary-text, #ddd);
--_keycap-primary-background-hover: var(--keycap-primary-background-hover, #0d80f2);
--_keycap-secondary-background: var(--keycap-secondary-background, #a0a9b8);
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #7d8795);
--_keycap-secondary-text: var(--keycap-secondary-text, #060707);
--_keycap-secondary-border: var(--keycap-secondary-border, #c5c9d0);
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, #989da6);
--_keycap-height: var(--keycap-height, 60px);
/* Keycap width (incl. margin) */
--_keycap-max-width: var(--keycap-max-width, 100px);
--_keycap-gap: var(--keycap-gap, 8px);
--_keycap-font-size: var(--keycap-font-size, clamp(16px, 4cqw, 24px));
--_keycap-small-font-size: var(--keycap-small-font-size, calc(var(--keycap-font-size) * 0.8));
--_keycap-extra-small-font-size: var(--keycap-extra-small-font-size, calc(var(--keycap-font-size) / 1.42));
--_variant-panel-background: var(--variant-panel-background, #fff);
--_variant-keycap-text: var(--variant-keycap-text, var(--_keycap-text));
--_variant-keycap-text-active: var(--variant-keycap-text-active, var(--_keycap-text-active));
--_variant-keycap-background-active: var(--variant-keycap-background-active, var(--_accent-color));
--_variant-keycap-length: var(--variant-keycap-length, 70px);
--_variant-keycap-font-size: var(--variant-keycap-font-size, 30px);
--_variant-keycap-aside-font-size: var(--variant-keycap-aside-font-size, 12px);
--_keycap-shift-font-size: var(--keycap-shift-font-size, 16px);
--_keycap-shift-color: var(--keycap-shift-color, var(--_accent-color));
--_box-placeholder-color: var(--box-placeholder-color, var(--_accent-color));
--_box-placeholder-pressed-color: var(--box-placeholder-pressed-color, var(--keycap-text-pressed));
}
.is-math-mode .MLK__rows .if-text-mode,
.is-text-mode .MLK__rows .if-math-mode {
display: none;
}
.if-can-undo,
.if-can-redo,
.if-can-copy,
.if-can-cut,
.if-can-paste {
opacity: 0.4;
pointer-events: none;
}
.can-undo .if-can-undo,
.can-redo .if-can-redo,
.can-copy .if-can-copy,
.can-cut .if-can-cut,
.can-paste .if-can-paste {
opacity: 1;
pointer-events: all;
}
body > .ML__keyboard {
position: fixed;
--_padding-bottom: calc(var(--keyboard-padding-bottom, 0px) + env(safe-area-inset-bottom, 0));
}
body > .ML__keyboard.is-visible > .MLK__backdrop {
box-shadow: 0 -5px 6px rgba(0, 0, 0, 0.08);
border-top: 1px solid var(--_border);
}
body > .ML__keyboard.backdrop-is-transparent.is-visible > .MLK__backdrop {
box-shadow: none;
border: none;
}
body > .ML__keyboard.is-visible.animate > .MLK__backdrop {
transition: 0.28s cubic-bezier(0, 0, 0.2, 1);
transition-property: transform, opacity;
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}
.ML__keyboard {
position: relative;
overflow: hidden;
top: 0;
left: 0;
height: 100%;
width: 100%;
z-index: var(--_keyboard-zindex);
box-sizing: border-box;
outline: none;
border: none;
margin: 0;
padding: 0;
line-height: 1;
overflow-wrap: unset;
text-align: left;
vertical-align: baseline;
cursor: auto;
white-space: pre;
box-shadow: none;
opacity: 1;
transform: none;
pointer-events: none;
}
.ML__keyboard :where(div) {
box-sizing: border-box;
outline: none;
border: none;
margin: 0;
padding: 0;
line-height: 1;
overflow-wrap: unset;
text-align: left;
vertical-align: baseline;
cursor: auto;
white-space: pre;
box-shadow: none;
transform: none;
}
.MLK__backdrop {
position: absolute;
bottom: calc(-1 * var(--_keyboard-height));
width: 100%;
height: var(--_keyboard-height);
box-sizing: border-box;
padding-top: var(--_padding-top);
padding-bottom: var(--_padding-bottom);
padding-left: var(--_padding-horizontal);
padding-right: var(--_padding-horizontal);
opacity: 0;
visibility: hidden;
transform: translate(0, 0);
background: var(--_background);
}
.backdrop-is-transparent .MLK__backdrop {
background: transparent;
}
/* If a custom layout has a custom container/backdrop
(backdrop-is-transparent), make sure to let pointer event go through. */
.backdrop-is-transparent .MLK__plate {
background: transparent;
pointer-events: none;
}
/* If a custom layout has a custom container/backdrop, make sure to
allow pointer events on it. */
.backdrop-is-transparent .MLK__layer > div > div {
pointer-events: all;
}
.ML__keyboard.is-visible > .MLK__backdrop {
transform: translate(0, calc(-1 * var(--_keyboard-height)));
opacity: 1;
visibility: visible;
}
.caps-lock-indicator {
display: none;
width: 8px;
height: 8px;
background: #0cbc0c;
box-shadow: inset 0 0 4px 0 #13ca13, 0 0 4px 0 #a9ef48;
border-radius: 8px;
right: 8px;
top: 8px;
position: absolute;
}
.ML__keyboard.is-caps-lock .caps-lock-indicator {
display: block;
}
.ML__keyboard.is-caps-lock .shift {
background: var(--_keycap-background-active);
color: var(--_keycap-text-active);
}
.MLK__plate {
position: absolute;
top: var(--_padding-top);
left: var(--_padding-horizontal);
width: calc(100% - 2 * var(--_padding-horizontal));
margin: 0;
padding: 0;
box-sizing: border-box;
container-type: inline-size;
touch-action: none;
-webkit-user-select: none;
user-select: none;
pointer-events: all;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 16px;
/* Size of toolbar labels */
font-weight: 400;
text-shadow: none;
}
.ML__box-placeholder {
color: var(--_box-placeholder-color);
}
.MLK__tex {
font-family: KaTeX_Main, KaTeX_Math, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
}
.MLK__tex-math {
font-family: KaTeX_Math, KaTeX_Main, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
font-style: italic;
}
.MLK__layer {
display: none;
outline: none;
}
.MLK__layer.is-visible {
display: flex;
flex-flow: column;
}
/* Keyboard layouts are made or rows of keys... */
.MLK__rows {
--_keycap-width: min(var(--_keycap-max-width), 10cqw);
display: flex;
flex-flow: column;
align-items: center;
border-collapse: separate;
clear: both;
border: 0;
margin: 0;
margin-bottom: var(--_keycap-gap);
gap: var(--_keycap-gap);
/* If the styling include, e.g., some shadows, they will be
cut off by the overflow. In that case, set the padding to
compensate. */
padding-left: var(--_row-padding-left);
padding-right: var(--_row-padding-right);
overflow: visible;
touch-action: none;
}
.MLK__rows > .MLK__row {
display: flex;
flex-flow: row;
justify-content: center;
width: 100%;
gap: var(--_keycap-gap);
margin: 0;
padding: 0;
/* For the alignment of the text on some modifiers (e.g. shift) */
/* Extra spacing between two adjacent keys */
}
.MLK__rows > .MLK__row .tex {
font-family: KaTeX_Math, KaTeX_Main, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
}
.MLK__rows > .MLK__row .tex-math {
font-family: KaTeX_Math, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
}
.MLK__rows > .MLK__row .big-op {
font-size: calc(1.25 * var(--_keycap-font-size));
}
.MLK__rows > .MLK__row .small {
font-size: var(--_keycap-small-font-size);
}
.MLK__rows > .MLK__row .bottom {
justify-content: flex-end;
}
.MLK__rows > .MLK__row .left {
align-items: flex-start;
padding-left: 12px;
}
.MLK__rows > .MLK__row .right {
align-items: flex-end;
padding-right: 12px;
}
.MLK__rows > .MLK__row .w0 {
width: 0;
}
.MLK__rows > .MLK__row .w5 {
width: calc(0.5 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .w15 {
width: calc(1.5 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .w20 {
width: calc(2 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .w40 {
width: calc(4 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .w50 {
width: calc(5 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .MLK__keycap.w50 {
font-size: 80%;
padding-top: 10px;
font-weight: 100;
}
.MLK__rows > .MLK__row .separator {
background: transparent;
border: none;
pointer-events: none;
}
.MLK__rows > .MLK__row .horizontal-rule {
height: 6px;
margin-top: 3px;
margin-bottom: 0;
width: 100%;
border-radius: 0;
border-top: var(--_horizontal-rule);
}
.MLK__rows > .MLK__row .ghost {
background: var(--_toolbar-background);
border: none;
color: var(--_toolbar-text);
}
.MLK__rows > .MLK__row .ghost:hover {
background: var(--_toolbar-background-hover);
}
.MLK__rows > .MLK__row .bigfnbutton {
font-size: var(--_keycap-extra-small-font-size);
}
.MLK__rows > .MLK__row .shift,
.MLK__rows > .MLK__row .action {
color: var(--_keycap-secondary-text);
background: var(--_keycap-secondary-background);
border-color: var(--_keycap-secondary-border);
border-bottom-color: var(--_keycap-secondary-border-bottom);
line-height: 0.8;
font-size: min(1rem, var(--_keycap-small-font-size));
font-weight: 600;
padding: 8px 12px 8px 12px;
}
.MLK__rows > .MLK__row .shift:hover,
.MLK__rows > .MLK__row .action:hover {
background: var(--_keycap-secondary-background-hover);
}
.MLK__rows > .MLK__row .action.primary {
background: var(--_keycap-primary-background);
color: var(--_keycap-primary-text);
}
.MLK__rows > .MLK__row .action.primary:hover {
background: var(--_keycap-primary-background-hover);
color: var(--_keycap-primary-text);
}
.MLK__rows > .MLK__row .shift.selected,
.MLK__rows > .MLK__row .action.selected {
color: var(--_toolbar-text-active);
}
.MLK__rows > .MLK__row .shift.selected.is-pressed,
.MLK__rows > .MLK__row .action.selected.is-pressed,
.MLK__rows > .MLK__row .shift.selected.is-active,
.MLK__rows > .MLK__row .action.selected.is-active {
color: white;
}
.MLK__rows > .MLK__row .warning {
background: #cd0030;
color: white;
}
.MLK__rows > .MLK__row .warning svg.svg-glyph {
width: 24px;
height: 24px;
min-height: 24px;
}
/** A regular keycap
* Use the :where() pseudo-class to give it a very low specifity,
* so that it can be overriden by custom style.
*/
:where(.MLK__rows > .MLK__row div) {
display: flex;
flex-flow: column;
align-items: center;
justify-content: space-evenly;
width: calc(var(--_keycap-width) - var(--_keycap-gap));
height: var(--_keycap-height);
box-sizing: border-box;
padding: 0;
vertical-align: top;
text-align: center;
float: left;
color: var(--_keycap-text);
fill: currentColor;
font-size: var(--_keycap-font-size);
background: var(--_keycap-background);
border: 1px solid var(--_keycap-border);
border-bottom-color: var(--_keycap-border-bottom);
border-radius: 6px;
cursor: pointer;
touch-action: none;
/* Keys with a variants panel */
position: relative;
overflow: hidden;
-webkit-user-select: none;
user-select: none;
-webkit-tap-highlight-color: transparent;
}
:where(.MLK__rows > .MLK__row div):hover {
overflow: visible;
background: var(--_keycap-background-hover);
}
:where(.MLK__rows > .MLK__row div) .ML__latex {
pointer-events: none;
touch-action: none;
}
:where(.MLK__rows > .MLK__row div) svg.svg-glyph {
margin: 8px 0;
width: 20px;
height: 20px;
min-height: 20px;
}
:where(.MLK__rows > .MLK__row div) svg.svg-glyph-lg {
margin: 8px 0;
width: 24px;
height: 24px;
min-height: 24px;
}
:where(.MLK__rows > .MLK__row div).MLK__tex-math {
font-size: 25px;
}
:where(.MLK__rows > .MLK__row div).is-pressed {
background: var(--_keycap-background-pressed);
color: var(--_keycap-text-pressed);
--_box-placeholder-color: var(--_box-placeholder-pressed-color);
}
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active,
:where(.MLK__rows > .MLK__row div).action.is-active,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed,
:where(.MLK__rows > .MLK__row div).action.is-pressed {
z-index: calc(var(--_keyboard-zindex) - 5);
}
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active aside,
:where(.MLK__rows > .MLK__row div).action.is-active aside,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed aside,
:where(.MLK__rows > .MLK__row div).action.is-pressed aside {
display: none;
}
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active .MLK__shift,
:where(.MLK__rows > .MLK__row div).action.is-active .MLK__shift,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed .MLK__shift,
:where(.MLK__rows > .MLK__row div).action.is-pressed .MLK__shift {
display: none;
}
:where(.MLK__rows > .MLK__row div).shift.is-pressed,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed,
:where(.MLK__rows > .MLK__row div).action.is-pressed {
background: var(--_keycap-background-pressed);
color: var(--_keycap-text-pressed);
}
:where(.MLK__rows > .MLK__row div).shift.is-active,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active,
:where(.MLK__rows > .MLK__row div).action.is-active {
background: var(--_keycap-background-active);
color: var(--_keycap-text-active);
--_box-placeholder-color: var(--_box-placeholder-pressed-color);
}
:where(.MLK__rows > .MLK__row div) small {
color: var(--_keycap-secondary-text);
}
:where(.MLK__rows > .MLK__row div) aside {
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 10px;
line-height: 10px;
color: var(--_keycap-secondary-text);
}
/* Add an attribute 'data-tooltip' to display a tooltip on hover.
Note there are a different set of tooltip rules for the keyboard toggle
(it's in a different CSS tree) */
.ML__keyboard [data-tooltip] {
position: relative;
}
.ML__keyboard [data-tooltip]::after {
position: absolute;
display: inline-table;
content: attr(data-tooltip);
top: inherit;
bottom: 100%;
width: max-content;
max-width: 200px;
padding: 8px 8px;
background: #616161;
color: #fff;
text-align: center;
z-index: 2;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
border-radius: 2px;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-weight: 400;
font-size: 12px;
transition: all 0.15s cubic-bezier(0.4, 0, 1, 1) 1s;
opacity: 0;
transform: scale(0.5);
}
.ML__keyboard [data-tooltip]:hover {
position: relative;
}
.ML__keyboard [data-tooltip]:hover::after {
opacity: 1;
transform: scale(1);
}
.MLK__toolbar {
align-self: center;
display: flex;
flex-flow: row;
justify-content: space-between;
width: 100%;
max-width: 996px;
min-height: 32px;
/* Icons for undo/redo, etc. */
}
.MLK__toolbar svg {
height: 20px;
width: 20px;
}
.MLK__toolbar > .left {
position: relative;
display: flex;
justify-content: flex-start;
flex-flow: row;
}
.MLK__toolbar > .right {
display: flex;
justify-content: flex-end;
flex-flow: row;
}
.MLK__toolbar > div > div {
/* "button" in the toolbar */
display: flex;
align-items: center;
justify-content: center;
color: var(--_toolbar-text);
fill: currentColor;
background: var(--_toolbar-background);
font-size: var(--_toolbar-font-size);
padding: 4px 15px;
cursor: pointer;
width: max-content;
min-width: 42px;
min-height: 34px;
border: none;
padding-left: 10px;
padding-right: 10px;
padding-bottom: 8px;
padding-top: 8px;
margin-top: 0;
margin-bottom: 4px;
margin-left: 4px;
margin-right: 4px;
border-radius: 8px;
box-shadow: none;
border-bottom: 2px solid transparent;
}
.MLK__toolbar > div > div:not(.disabled):not(.selected):hover {
background: var(--_toolbar-background-hover);
}
.MLK__toolbar > div > div.disabled svg,
.MLK__toolbar > div > div.disabled:hover svg,
.MLK__toolbar > div > div.disabled.is-pressed svg {
color: var(--_toolbar-text);
opacity: 0.2;
}
.MLK__toolbar > div > div:hover,
.MLK__toolbar > div > div:active,
.MLK__toolbar > div > div.is-pressed,
.MLK__toolbar > div > div.is-active {
color: var(--_toolbar-text-active);
}
.MLK__toolbar > div > div.selected {
color: var(--_toolbar-text-active);
background: var(--_toolbar-background-selected);
border-radius: 0;
border-bottom-color: var(--_toolbar-text-active);
padding-bottom: 4px;
margin-bottom: 8px;
}
/* This is the element that displays variants on press+hold */
.MLK__variant-panel {
visibility: hidden;
position: fixed;
display: flex;
flex-flow: row wrap-reverse;
justify-content: center;
align-content: center;
margin: 0;
padding: 0;
bottom: auto;
top: 0;
box-sizing: content-box;
transform: none;
z-index: calc(var(--_keyboard-zindex) + 1);
touch-action: none;
max-width: 350px;
background: var(--_variant-panel-background);
text-align: center;
border-radius: 6px;
padding: 6px;
box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
transition: none;
}
.MLK__variant-panel.is-visible {
visibility: visible;
}
.MLK__variant-panel.compact {
--_variant-keycap-length: var(--variant-keycap-length, 50px);
--_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);
--_variant-keycap-aside-font-size: var(--variant-keycap-aside-font-size, 10px);
}
.MLK__variant-panel .item {
display: flex;
flex-flow: column;
align-items: center;
justify-content: center;
font-size: var(--_variant-keycap-font-size);
height: var(--_variant-keycap-length);
width: var(--_variant-keycap-length);
margin: 0;
box-sizing: border-box;
border-radius: 5px;
border: 1px solid transparent;
background: transparent;
pointer-events: all;
cursor: pointer;
color: var(--_variant-keycap-text);
fill: currentColor;
}
@media (max-height: 412px) {
.MLK__variant-panel .item {
--_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);
--_variant-keycap-length: var(--variant-keycap-length, 50px);
}
}
.MLK__variant-panel .item .ML__latex {
pointer-events: none;
}
.MLK__variant-panel .item.is-active {
background: var(--_variant-keycap-background-active);
color: var(--_variant-keycap-text-active);
}
.MLK__variant-panel .item.is-pressed {
background: var(--_variant-keycap-background-pressed);
color: var(--_variant-keycap-text-pressed);
}
.MLK__variant-panel .item.small {
font-size: var(--_keycap-small-font-size);
}
.MLK__variant-panel .item.swatch-button {
box-sizing: border-box;
background: #fbfbfb;
}
.MLK__variant-panel .item.swatch-button > span {
display: inline-block;
margin: 6px;
width: calc(100% - 12px);
height: calc(100% - 12px);
border-radius: 50%;
}
.MLK__variant-panel .item.swatch-button:hover {
background: #f0f0f0;
}
.MLK__variant-panel .item.swatch-button:hover > span {
border-radius: 2px;
}
.MLK__variant-panel .item.box > div,
.MLK__variant-panel .item.box > span {
border: 1px dashed rgba(0, 0, 0, 0.24);
}
.MLK__variant-panel .item .warning {
min-height: 60px;
min-width: 60px;
background: #cd0030;
color: white;
padding: 5px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 5px;
}
.MLK__variant-panel .item .warning.is-pressed,
.MLK__variant-panel .item .warning.is-active {
background: red;
}
.MLK__variant-panel .item .warning svg.svg-glyph {
width: 50px;
height: 50px;
}
.MLK__variant-panel .item aside {
font-size: var(--_variant-keycap-aside-font-size);
line-height: 12px;
opacity: 0.78;
padding-top: 2px;
}
.MLK__keycap {
position: relative;
}
.MLK__shift {
display: block;
position: absolute;
right: 4px;
top: 4px;
font-size: var(--_keycap-shift-font-size);
color: var(--_keycap-shift-color);
}
.hide-shift .MLK__shift {
display: none;
}
@media (max-width: 414px) {
.MLK__variant-panel {
max-width: 350px;
--_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);
--_variant-keycap-length: var(--variant-keycap-length, 50px);
}
}
/* @xs breakpoint: iPhone 5 */
@container (max-width: 414px) {
.MLK__rows {
--_keycap-gap: max(var(--_keycap-gap, 2px), 2px);
--_keycap-height: max(var(--_keycap-height), 42px);
--_keycap-width: min(min(var(--_keycap-max-width), 10cqw), 62px);
}
.MLK__toolbar > div > div {
font-size: 100%;
margin-left: 2px;
margin-right: 2px;
}
.MLK__rows .shift,
.MLK__rows .action {
font-size: 65%;
}
.MLK__rows .warning svg.svg-glyph {
width: 14px;
height: 14px;
min-height: 14px;
}
}
@container (max-width: 744px) {
.MLK__rows {
--_keycap-gap: max(var(--keycap-gap, 2px), 2px);
--_keycap-height: max(var(--keycap-height, 52px), 52px);
--_keycap-width: min(min(var(--_keycap-max-width), 10cqw), 62px);
}
.MLK__toolbar > div > div {
padding-left: 0;
padding-right: 0;
}
.MLK__tooltip::after {
padding: 8px 16px;
font-size: 16px;
}
.MLK__rows > .MLK__row > div.fnbutton {
font-size: 16px;
}
.MLK__rows > .MLK__row > div.bigfnbutton {
font-size: calc(var(--_keycap-extra-small-font-size) / 1.55);
}
.MLK__rows > .MLK__row > div.small {
font-size: 13px;
}
.MLK__rows > .MLK__row > div > aside {
display: none;
}
.MLK__shift {
display: none;
}
}
/* Medium breakpoint: larger phones */
@container (max-width: 768px) {
.MLK__rows {
--_keycap-height: max(var(--keycap-height, 42px), 42px);
}
.MLK__rows > .MLK__row > div > small {
font-size: 14px;
}
}
@media (max-height: 768px) {
.MLK__rows {
--_keycap-height: max(var(--keycap-height, 42px), 42px);
}
.MLK__rows > .MLK__row > div > small {
font-size: 14px;
}
}
@container (max-width: 1444px) {
.MLK__rows .if-wide {
display: none;
}
}
@media (prefers-color-scheme: dark) {
.ML__keyboard {
--_accent-color: var(--keyboard-accent-color, #0b5c9c);
--_background: var(--keyboard-background, #151515);
--_border: var(--keyboard-border, transparent);
--_toolbar-text: var(--keyboard-toolbar-text, #e3e4e8);
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #303030);
--keyboard-toolbar-background-hover: #303030;
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #303030);
--_keycap-background: var(--keycap-background, #1f2022);
--_keycap-background-hover: var(--keycap-background-hover, #2f3032);
--_keycap-border: var(--_keycap-border, transparent);
--_keycap-border-bottom: var(--_keycap-border-bottom, transparent);
--_keycap-text: var(--keycap-text, #e3e4e8);
--_keycap-secondary-background: var(--keycap-secondary-background, #3d4144);
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #4d5154);
--_keycap-secondary-text: var(--keycap-secondary-text, #e7ebee);
--keycap-secondary-border: transparent;
--keycap-secondary-border-bottom: transparent;
--_keycap-secondary-border: var(--keycap-secondary-border, transparent);
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, transparent);
--_variant-panel-background: var(--variant-panel-background, #303030);
--_variant-keycap-text-active: var(--variant-keycap-text-active, #fff);
}
}
/* Same as the media query, but with a class */
[theme='dark'] .ML__keyboard {
--_accent-color: var(--keyboard-accent-color, #0b5c9c);
--_background: var(--keyboard-background, #151515);
--_border: var(--keyboard-border, transparent);
--_toolbar-text: var(--keyboard-toolbar-text, #e3e4e8);
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #303030);
--keyboard-toolbar-background-hover: #303030;
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #303030);
--_keycap-background: var(--keycap-background, #1f2022);
--_keycap-background-hover: var(--keycap-background-hover, #2f3032);
--_keycap-border: var(--_keycap-border, transparent);
--_keycap-border-bottom: var(--_keycap-border-bottom, transparent);
--_keycap-text: var(--keycap-text, #e3e4e8);
--_keycap-secondary-background: var(--keycap-secondary-background, #3d4144);
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #4d5154);
--_keycap-secondary-text: var(--keycap-secondary-text, #e7ebee);
--keycap-secondary-border: transparent;
--keycap-secondary-border-bottom: transparent;
--_keycap-secondary-border: var(--keycap-secondary-border, transparent);
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, transparent);
--_variant-panel-background: var(--variant-panel-background, #303030);
--_variant-keycap-text-active: var(--variant-keycap-text-active, #fff);
}
[theme='light'] .ML__keyboard {
--_accent-color: var(--keyboard-accent-color, #0c75d8);
--_background: var(--keyboard-background, #cacfd7);
--_border: var(--keyboard-border, #ddd);
--_toolbar-text: var(--keyboard-toolbar-text, #2c2e2f);
--_toolbar-background: var(--keyboard-toolbar-background, transparent);
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #eee);
--_toolbar-background-selected: var(--keyboard-toolbar-background-selected, transparent);
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #fff);
--_keycap-background: var(--keycap-background, white);
--_keycap-background-hover: var(--keycap-background-hover, #f5f5f7);
--_keycap-background-active: var(--keycap-background-active, var(--_accent-color));
--_keycap-background-pressed: var(--keycap-background-pressed, var(--_accent-color));
--_keycap-border: var(--_keycap-border, #e5e6e9);
--_keycap-border-bottom: var(--_keycap-border-bottom, #8d8f92);
--_keycap-text: var(--keycap-text, #000);
--_keycap-text-active: var(--keycap-text-active, #fff);
--_keycap-text-hover: var(--keycap-text-hover, var(--_keycap-text));
--_keycap-text-pressed: var(--keycap-text-pressed, #fff);
--_keycap-shift-text: var(--keycap-shift-text, var(--_accent-color));
--_keycap-secondary-background: var(--keycap-secondary-background, #a0a9b8);
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #7d8795);
--_keycap-secondary-text: var(--keycap-secondary-text, #060707);
--_keycap-secondary-border: var(--keycap-secondary-border, #c5c9d0);
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, #989da6);
--_variant-panel-background: var(--variant-panel-background, #fff);
--_variant-keycap-text: var(--variant-keycap-textvar, var(--_keycap-text));
--_variant-keycap-text-active: var(--variant-keycap-text-active, var(--_keycap-text-active));
--_variant-keycap-background-active: var(--variant-keycap-background-active, var(--_accent-color));
}
`,dc=`:host {
--primary-color: #5898ff;
--primary-color-dimmed: #c0c0f0;
--primary-color-dark: var(--blue-500);
--primary-color-light: var(--blue-100);
--primary-color-reverse: #ffffff;
--secondary-color: #ff8a65;
--secondary-color-dimmed: #f0d5c5;
--secondary-color-dark: var(--orange-500);
--secondary-color-light: var(--orange-100);
--secondary-color-reverse: #ffffff;
--link-color: #5898ff;
--link-color-dimmed: #c5c5c5;
--link-color-dark: #121212;
--link-color-light: #e2e2e2;
--link-color-reverse: #ffffff;
--semantic-blue: var(--blue-700);
--semantic-red: var(--red-400);
--semantic-orange: var(--orange-400);
--semantic-green: var(--green-700);
--neutral-100: #f5f5f5;
--neutral-200: #eeeeee;
--neutral-300: #e0e0e0;
--neutral-400: #bdbdbd;
--neutral-500: #9e9e9e;
--neutral-600: #757575;
--neutral-700: #616161;
--neutral-800: #424242;
--neutral-900: #212121;
--red-25: #fff8f7;
--red-50: #fff1ef;
--red-100: #ffeae6;
--red-200: #ffcac1;
--red-300: #ffa495;
--red-400: #ff7865;
--red-500: #f21c0d;
--red-600: #e50018;
--red-700: #d30024;
--red-800: #bd002c;
--red-900: #a1002f;
--orange-25: #fffbf8;
--orange-50: #fff7f1;
--orange-100: #fff3ea;
--orange-200: #ffe1c9;
--orange-300: #ffcca2;
--orange-400: #ffb677;
--orange-500: #fe9310;
--orange-600: #f58700;
--orange-700: #ea7c00;
--orange-800: #dc6d00;
--orange-900: #ca5b00;
--brown-25: #fff8ef;
--brown-50: #fff1df;
--brown-100: #ffe9ce;
--brown-200: #ebcca6;
--brown-300: #cdaf8a;
--brown-400: #af936f;
--brown-500: #856a47;
--brown-600: #7f5e34;
--brown-700: #78511f;
--brown-800: #6e4200;
--brown-900: #593200;
--yellow-25: #fffdf9;
--yellow-50: #fffcf2;
--yellow-100: #fffaec;
--yellow-200: #fff2ce;
--yellow-300: #ffe8ab;
--yellow-400: #ffdf85;
--yellow-500: #ffcf33;
--yellow-600: #f1c000;
--yellow-700: #dfb200;
--yellow-800: #c9a000;
--yellow-900: #ad8a00;
--lime-25: #f4ffee;
--lime-50: #e9ffdd;
--lime-100: #ddffca;
--lime-200: #a8fb6f;
--lime-300: #94e659;
--lime-400: #80d142;
--lime-500: #63b215;
--lime-600: #45a000;
--lime-700: #268e00;
--lime-800: #007417;
--lime-900: #005321;
--green-25: #f5fff5;
--green-50: #ebffea;
--green-100: #e0ffdf;
--green-200: #a7ffa7;
--green-300: #5afa65;
--green-400: #45e953;
--green-500: #17cf36;
--green-600: #00b944;
--green-700: #00a34a;
--green-800: #008749;
--green-900: #00653e;
--teal-25: #f3ffff;
--teal-50: #e6fffe;
--teal-100: #d9fffe;
--teal-200: #8dfffe;
--teal-300: #57f4f4;
--teal-400: #43e5e5;
--teal-500: #17cfcf;
--teal-600: #00c2c0;
--teal-700: #00b5b1;
--teal-800: #00a49e;
--teal-900: #009087;
--cyan-25: #f7fcff;
--cyan-50: #eff8ff;
--cyan-100: #e7f5ff;
--cyan-200: #c2e6ff;
--cyan-300: #95d5ff;
--cyan-400: #61c4ff;
--cyan-500: #13a7ec;
--cyan-600: #069eda;
--cyan-700: #0095c9;
--cyan-800: #0088b2;
--cyan-900: #0a7897;
--blue-25: #f7faff;
--blue-50: #eef5ff;
--blue-100: #e5f1ff;
--blue-200: #bfdbff;
--blue-300: #92c2ff;
--blue-400: #63a8ff;
--blue-500: #0d80f2;
--blue-600: #0077db;
--blue-700: #006dc4;
--blue-800: #0060a7;
--blue-900: #005086;
--indigo-25: #f8f7ff;
--indigo-50: #f1efff;
--indigo-100: #eae7ff;
--indigo-200: #ccc3ff;
--indigo-300: #ac99ff;
--indigo-400: #916aff;
--indigo-500: #63c;
--indigo-600: #5a21b2;
--indigo-700: #4e0b99;
--indigo-800: #3b0071;
--indigo-900: #220040;
--purple-25: #fbf7ff;
--purple-50: #f8f0ff;
--purple-100: #f4e8ff;
--purple-200: #e4c4ff;
--purple-300: #d49aff;
--purple-400: #c36aff;
--purple-500: #a219e6;
--purple-600: #9000c4;
--purple-700: #7c009f;
--purple-800: #600073;
--purple-900: #3d0043;
--magenta-25: #fff8fb;
--magenta-50: #fff2f6;
--magenta-100: #ffebf2;
--magenta-200: #ffcddf;
--magenta-300: #ffa8cb;
--magenta-400: #ff7fb7;
--magenta-500: #eb4799;
--magenta-600: #da3689;
--magenta-700: #c82179;
--magenta-800: #b00065;
--magenta-900: #8a004c;
}
@media (prefers-color-scheme: dark) {
:host {
--semantic-blue: var(--blue-700);
--semantic-red: var(--red-400);
--semantic-orange: var(--orange-400);
--semantic-green: var(--green-700);
--semantic-bg-blue: var(--blue-25);
--semantic-bg-red: var(--red-25);
--semantic-bg-orange: var(--orange-25);
--semantic-bg-green: var(--green-25);
--neutral-100: #121212;
--neutral-200: #424242;
--neutral-300: #616161;
--neutral-400: #757575;
--neutral-500: #9e9e9e;
--neutral-600: #bdbdbd;
--neutral-700: #e0e0e0;
--neutral-800: #eeeeee;
--neutral-900: #f5f5f5;
}
}
:host([theme='dark']) {
--semantic-blue: var(--blue-700);
--semantic-red: var(--red-400);
--semantic-orange: var(--orange-400);
--semantic-green: var(--green-700);
--semantic-bg-blue: var(--blue-25);
--semantic-bg-red: var(--red-25);
--semantic-bg-orange: var(--orange-25);
--semantic-bg-green: var(--green-25);
--neutral-100: #121212;
--neutral-200: #424242;
--neutral-300: #616161;
--neutral-400: #757575;
--neutral-500: #9e9e9e;
--neutral-600: #bdbdbd;
--neutral-700: #e0e0e0;
--neutral-800: #eeeeee;
--neutral-900: #f5f5f5;
}
/* @media (prefers-color-scheme: dark) {
:host {
--label-color: #fff;
--active-label-color: #000;
--menu-bg: #525252;
--active-bg: #5898ff;
--active-bg-dimmed: #5c5c5c;
}
} */
:host {
--ui-font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont,
'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji',
'Segoe UI Emoji', 'Segoe UI Symbol';
--ui-font-size: 14px;
--ui-line-height: 1.5;
--ui-letter-spacing: 0.007em;
--mono-font-family: 'Berkeley Mono', 'JetBrains Mono', 'IBM Plex Mono',
'Source Code Pro', Menlo, Monaco, 'Courier New', monospace;
--ui-layer-1: var(--neutral-100);
--ui-layer-2: var(--neutral-200);
--ui-layer-3: var(--neutral-300);
--ui-layer-4: var(--neutral-400);
--ui-layer-5: var(--neutral-500);
--ui-layer-6: var(--neutral-600);
--ui-border-color: var(--primary-color);
--ui-border-radius: 4px;
--ui-text: var(--neutral-900);
--ui-text-secondary: var(--neutral-700);
--ui-text-placeholder: var(--neutral-500);
--ui-text-muted: var(--neutral-300);
/** A field is a UI element in which a user can type data, for
* example an input or textarea element.
*/
--ui-field-bg: var(--neutral-100);
--ui-field-bg-hover: var(--neutral-100);
--ui-field-bg-disabled: var(--neutral-300);
--ui-field-bg-invalid: var(--red-100);
--ui-field-bg-focus: var(--neutral-100);
--ui-field-border: 0.5px solid var(--border-color);
--ui-field-border-hover: 0.5px solid var(--border-color);
--ui-field-border-disabled: 0.5px solid var(--border-color);
--ui-field-border-invalid: 0.5px solid var(--border-color);
--ui-field-border-focus: 0.5px solid var(--border-color);
--ui-menu-bg: var(--neutral-100);
--ui-menu-text: var(--neutral-900);
--ui-menu-bg-hover: var(--neutral-200);
--ui-menu-text-hover: var(--neutral-900);
/** The \`active\` state is used for the state of menu items
* when they are selected.
*/
--ui-menu-bg-active: var(--primary-color);
--ui-menu-text-active: var(--primary-color-reverse);
/** The \`active-muted\` set is used for the state of
* submenus when they are open.
*/
--ui-menu-bg-active-muted: var(--neutral-300);
--ui-menu-text-active-muted: var(--neutral-900);
/* --ui-menu-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.302),
0 2px 6px 2px rgba(60, 64, 67, 0.149); */
--ui-menu-shadow: 0 0 2px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 0, 0, 0.2);
--ui-menu-divider: 0.5px solid #c7c7c7;
/* var(--neutral-300); */
--ui-menu-z-index: 10000;
--page-bg: var(--neutral-100);
--content-bg: var(--neutral-200);
}
@media (prefers-color-scheme: dark) {
:host {
--ui-menu-bg: var(--neutral-200);
}
}
:host([theme='dark']) {
--ui-menu-bg: var(--neutral-200);
}
/* PingFang SC is a macOS font. Microsoft Yahei is a Windows font.
Noto is a Linux/Android font.
*/
:lang(zh-cn),
:lang(zh-sg),
:lang(zh-my),
:lang(zh) {
--ui-font-family: -apple-system, system-ui, 'PingFang SC', 'Hiragino Sans GB',
'Noto Sans CJK SC', 'Noto Sans SC', 'Noto Sans', 'Microsoft Yahei UI',
'Microsoft YaHei New', 'Microsoft Yahei', '\u5FAE\u8F6F\u96C5\u9ED1', SimSun, '\u5B8B\u4F53',
STXihei, '\u534E\u6587\u7EC6\u9ED1', sans-serif;
}
:lang(zh-tw),
:lang(zh-hk),
:lang(zh-mo) {
--ui-font-family: -apple-system, system-ui, 'Noto Sans',
'Microsoft JhengHei UI', 'Microsoft JhengHei', '\u5FAE\u8EDF\u6B63\u9ED1\u9AD4', '\u65B0\u7D30\u660E\u9AD4',
'PMingLiU', '\u7D30\u660E\u9AD4', 'MingLiU', sans-serif;
}
:lang(ja),
:lang(ja-jp),
:lang(ja-jp-mac) {
--ui-font-family: -apple-system, system-ui, 'Hiragino Sans',
'Hiragino Kaku Gothic ProN', 'Noto Sans CJK JP', 'Noto Sans JP', 'Noto Sans',
'\u6E38\u30B4\u30B7\u30C3\u30AF', '\u6E38\u30B4\u30B7\u30C3\u30AF\u4F53', YuGothic, 'Yu Gothic', '\u30E1\u30A4\u30EA\u30AA', Meiryo,
'\uFF2D\uFF33 \uFF30\u30B4\u30B7\u30C3\u30AF', 'MS PGothic', sans-serif;
}
:lang(ko),
:lang(ko-kr),
:lang(ko-kr-std) {
--ui-font-family: -apple-system, system-ui, 'Noto Sans CJK KR', 'Noto Sans KR',
'Noto Sans', 'Malgun Gothic', '\uB9D1\uC740 \uACE0\uB515', 'Apple SD Gothic Neo',
'\uC560\uD50C SD \uC0B0\uB3CC\uACE0\uB515 Neo', 'Apple SD \uC0B0\uB3CC\uACE0\uB515 Neo', '\uB3CB\uC6C0', Dotum, sans-serif;
}
:lang(ko-kr-apple) {
--ui-font-family: -apple-system, system-ui, 'Noto Sans CJK KR', 'Noto Sans KR',
'Noto Sans', 'Apple SD Gothic Neo', '\uC560\uD50C SD \uC0B0\uB3CC\uACE0\uB515 Neo',
'Apple SD \uC0B0\uB3CC\uACE0\uB515 Neo', '\uB3CB\uC6C0', Dotum, sans-serif;
}
:lang(zh-cn),
:lang(zh-sg),
:lang(zh-my),
:lang(zh),
:lang(zh-tw),
:lang(zh-hk),
:lang(zh-mo),
:lang(ja),
:lang(ja-jp),
:lang(ja-jp-mac),
:lang(ko),
:lang(ko-kr),
:lang(ko-kr-std),
:lang(ko-kr-apple) {
--ui-font-size: 1rem;
--ui-line-height: 1.7;
--ui-letter-spacing: 0;
}
:dir(rtl) {
--ui-line-height: auto;
--ui-letter-spacing: 0;
}
`,_h=`.ui-menu *,
.ui-menu ::before,
.ui-menu ::after {
box-sizing: border-box;
}
.ui-menu {
display: none;
color-scheme: light dark;
-webkit-user-select: none;
/* Important: Safari iOS doesn't respect user-select */
user-select: none;
cursor: default;
-webkit-touch-callout: none;
-webkit-tap-highlight-color: rgba(0 0 0 0);
--active-label-color: #fff;
/* ui-menu-text-active */
--label-color: #121212;
/* ui-menu-text */
--menu-bg: #e2e2e2;
/* ui-menu-background */
--active-bg: #5898ff;
/* ui-menu-background-active */
--active-bg-dimmed: #c5c5c5;
/* ui-menu-background-active-muted */
}
/** Use the :where pseudo selector to make the specificity of the
* selector 0, so that it can be overridden by the user.
*/
:where(.ui-menu-container) {
position: absolute;
overflow: visible;
width: auto;
height: auto;
z-index: 10000;
border-radius: 8px;
background: var(--ui-menu-bg);
box-shadow: var(--ui-menu-shadow);
list-style: none;
padding: 6px 0 6px 0;
margin: 0;
user-select: none;
cursor: default;
color: var(--ui-menu-text);
font-weight: normal;
font-style: normal;
text-shadow: none;
text-transform: none;
letter-spacing: 0;
outline: none;
opacity: 1;
/* The [popover] elements have a 1px solid black border. Ugh. */
border: none;
width: fit-content;
height: fit-content;
}
:where(.ui-menu-container > li) {
display: flex;
flex-flow: row;
align-items: center;
padding: 1px 7px 1px 7px;
margin-top: 0;
margin-left: 6px;
margin-right: 6px;
border-radius: 4px;
white-space: nowrap;
position: relative;
outline: none;
fill: currentColor;
user-select: none;
cursor: default;
text-align: left;
color: inherit;
font-family: var(--ui-font-family);
font-size: var(--ui-font-size);
line-height: var(--ui-line-height);
letter-spacing: var(--ui-letter-spacing);
}
:where(.ui-menu-container > li > .label) {
appearance: none;
background: none;
outline: none;
width: 100%;
margin: 0;
padding: 1px 2px 1px 1px;
overflow: visible;
border: 1px solid transparent;
white-space: nowrap;
text-align: start;
}
:where(.ui-menu-container > li:has(.heading)) {
margin-top: 0.5em;
}
:where(.ui-menu-container > li > .label.heading) {
font-weight: bold;
opacity: 0.4;
}
:where(.ui-menu-container > li.indent > .label) {
margin-inline-start: 12px;
}
:where(.ui-menu-container > li > .label.indent) {
margin-inline-start: 12px;
}
:where(.ui-menu-container > li[role='divider']) {
border-bottom: 1px solid var(--ui-menu-divider);
border-radius: 0;
padding: 0;
margin-left: 15px;
margin-right: 15px;
padding-top: 5px;
margin-bottom: 5px;
width: calc(100% - 30px);
/** 100% - (margin-left + margin-right) */
}
:where(.ui-menu-container > li[aria-disabled='true']) {
opacity: 0.5;
}
:where(.ui-menu-container > li.active) {
background: var(--ui-menu-bg-active);
background: -apple-system-control-accent;
color: var(--ui-menu-text-active);
}
:where(.ui-menu-container > li.active.is-submenu-open) {
background: var(--ui-menu-bg-active-muted);
color: inherit;
}
:where(.ui-menu-container > li[aria-haspopup='true'] > .label) {
padding-inline-end: 0;
}
:where(.ui-menu-container > li[aria-haspopup='true'].active::after) {
color: var(--ui-menu-text-active);
}
/** Keyboard shortcut */
:where(.ui-menu-container > li > kbd) {
font-family: var(--ui-font-family);
margin-inline-start: 12px;
opacity: 0.4;
}
:where(.ui-menu-container > li.active > kbd) {
opacity: 0.85;
}
.ui-trailing-chevron {
display: flex;
margin-inline-start: 24px;
width: 10px;
height: 10px;
margin-bottom: 4px;
}
.ui-trailing-chevron:dir(rtl) {
transform: scaleX(-1);
}
.ui-checkmark {
display: flex;
margin-inline-end: -11px;
margin-inline-start: -4px;
margin-top: 2px;
width: 16px;
height: 16px;
}
.ui-mixedmark {
display: flex;
margin-inline-end: -11px;
margin-inline-start: -4px;
margin-top: 2px;
width: 16px;
height: 16px;
}
`,Jr;function ma(e){let t="";switch(e){case"mathfield-element":t=`
:host { display: inline-block; background-color: field; color: fieldtext; border-width: 1px; border-style: solid; border-color: #acacac; border-radius: 2px; padding:4px;}
:host([hidden]) { display: none; }
:host([disabled]), :host([disabled]:focus), :host([disabled]:focus-within) { outline: none; opacity: .5; }
:host(:focus), :host(:focus-within) {
outline: Highlight auto 1px; /* For Firefox */
outline: -webkit-focus-ring-color auto 1px;
}
:host([readonly]:focus), :host([readonly]:focus-within),
:host([read-only]:focus), :host([read-only]:focus-within) {
outline: none;
}
@media (hover: none) and (pointer: coarse) {
:host(:not(:focus)) :first-child { pointer-events: none !important; }
}`;break;case"core":t=$r;break;case"mathfield":t=Ef;break;case"environment-popover":t=Mf;break;case"suggestion-popover":t=yh;break;case"keystroke-caption":t=Wa;break;case"virtual-keyboard":t=bh;break;case"ui":t=dc;break;case"menu":t=_h;break;default:debugger}return t}function Ka(e){return Jr||(Jr={}),Jr[e]||(Jr[e]=new CSSStyleSheet,Jr[e].replaceSync(ma(e))),Jr[e]}var as;function io(e){var t;if(!("adoptedStyleSheets"in document)){if(window.document.getElementById(`mathlive-style-${e}`))return;const r=window.document.createElement("style");r.id=`mathlive-style-${e}`,r.append(window.document.createTextNode(ma(e))),window.document.head.appendChild(r);return}if(as||(as={}),((t=as[e])!=null?t:0)!==0)as[e]+=1;else{const r=Ka(e);document.adoptedStyleSheets=[...document.adoptedStyleSheets,r],as[e]=1}}function n(e){if("adoptedStyleSheets"in document&&as!=null&&as[e]&&(as[e]-=1,as[e]<=0)){const t=Jr[e];document.adoptedStyleSheets=document.adoptedStyleSheets.filter(r=>r!==t)}}var c=class jp extends et{constructor(t){var r;super(h(l({},t),{type:"accent",body:(r=t.body)!=null?r:void 0})),t.accentChar?this.accent=t.accentChar:this.svgAccent=t==null?void 0:t.svgAccent,this.skipBoundary=!0,this.captureSelection=!0}static fromJson(t){return new jp(t)}toJson(){return h(l({},super.toJson()),{accentChar:this.accent,svgAccent:this.svgAccent})}render(t){var r;const a=new gr({parent:t,mathstyle:"cramp"},this.style),b=(r=et.createBox(a,this.body))!=null?r:new mt("\u25A2",{style:this.style});let L=0;!this.hasEmptyBranch("body")&&this.body.length===2&&this.body[1].isCharacterBox()&&(L=b.skew);let N=Math.min(b.height,ts),J;if(this.svgAccent)J=ho(this.svgAccent),N=a.metrics.bigOpSpacing1-N;else if(this.accent){const ue=new mt(this.accent,{fontFamily:"Main-Regular"});ue.italic=0;const pe=this.accent===8407?" ML__accent-vec":"";J=new mt(new mt(ue),{classes:"ML__accent-body"+pe})}J=new Zr({shift:0,children:[{box:new mt(b)},-N,{box:J,marginLeft:b.left+2*L,classes:["ML__center"]}]});const ie=new mt(J,{type:"lift"});return this.caret&&(ie.caret=this.caret),this.bind(a,ie.wrap(a)),this.attachSupsub(a,{base:ie})}},k={"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\lparen":"\\rparen","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},C=Object.fromEntries(Object.entries(k).map(([e,t])=>[t,e]));function O(e){var t;return(t={"[":91,"]":93,"(":40,")":41,"\\mid":8739,"|":8739,"\u2223":8739,"\u2225":8741,"\\|":8739,"\\{":123,"\\}":125,"\\lbrace":123,"\\rbrace":125,"\\lparen":40,"\\rparen":41,"\\lbrack":91,"\\rbrack":93,"\\vert":8739,"\\lvert":8739,"\\mvert":8739,"\\rvert":8739,"\\Vert":8741,"\\lVert":8741,"\\mVert":8741,"\\rVert":8741,"\\parallel":8741,"\\shortparallel":8741,"\\langle":10216,"\\rangle":10217,"\\lfloor":8970,"\\rfloor":8971,"\\lceil":8968,"\\rceil":8969,"\\ulcorner":9484,"\\urcorner":9488,"\\llcorner":9492,"\\lrcorner":9496,"\\lgroup":10222,"\\rgroup":10223,"\\lmoustache":9136,"\\rmoustache":9137,"\\surd":8730}[e])!=null?t:e.codePointAt(0)}function X(e,t,r,a){var b;const N=new mt(O(e),{fontFamily:"Main-Regular",isSelected:a.isSelected,classes:"ML__small-delim "+((b=a.classes)!=null?b:"")}).wrap(t);return r&&N.setTop((1-t.scalingFactor)*xi),N}function ce(e,t,r,a,b){var L,N;const J=new gr({parent:a,mathstyle:"textstyle"},b==null?void 0:b.style),ie=new mt(O(e),{fontFamily:`Size${t}-Regular`,isSelected:b.isSelected,classes:((L=b.classes)!=null?L:"")+` ML__delim-size${t}`,type:(N=b.type)!=null?N:"ignore"}).wrap(J);return r&&ie.setTop((1-J.scalingFactor)*xi),ie}function me(e,t,r,a,b){var L;let N,J,ie,ue;N=ie=ue=O(e),J=null;let pe="Size1-Regular";e==="\\vert"||e==="\\lvert"||e==="\\rvert"||e==="\\mvert"||e==="\\mid"?ie=N=ue=8739:e==="\\Vert"||e==="\\lVert"||e==="\\rVert"||e==="\\mVert"||e==="\\|"?ie=N=ue=8741:e==="\\uparrow"?ie=ue=9168:e==="\\Uparrow"?ie=ue=8214:e==="\\downarrow"?N=ie=9168:e==="\\Downarrow"?N=ie=8214:e==="\\updownarrow"?(N=8593,ie=9168,ue=8595):e==="\\Updownarrow"?(N=8657,ie=8214,ue=8659):e==="["||e==="\\lbrack"?(N=9121,ie=9122,ue=9123,pe="Size4-Regular"):e==="]"||e==="\\rbrack"?(N=9124,ie=9125,ue=9126,pe="Size4-Regular"):e==="\\lfloor"||e==="\u230A"?(ie=N=9122,ue=9123,pe="Size4-Regular"):e==="\\lceil"||e==="\u2308"?(N=9121,ie=ue=9122,pe="Size4-Regular"):e==="\\rfloor"||e==="\u230B"?(ie=N=9125,ue=9126,pe="Size4-Regular"):e==="\\rceil"||e==="\u2309"?(N=9124,ie=ue=9125,pe="Size4-Regular"):e==="("||e==="\\lparen"?(N=9115,ie=9116,ue=9117,pe="Size4-Regular"):e===")"||e==="\\rparen"?(N=9118,ie=9119,ue=9120,pe="Size4-Regular"):e==="\\{"||e==="\\lbrace"?(N=9127,J=9128,ue=9129,ie=9130,pe="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(N=9131,J=9132,ue=9133,ie=9130,pe="Size4-Regular"):e==="\\lgroup"||e==="\u27EE"?(N=9127,ue=9129,ie=9130,pe="Size4-Regular"):e==="\\rgroup"||e==="\u27EF"?(N=9131,ue=9133,ie=9130,pe="Size4-Regular"):e==="\\lmoustache"||e==="\u23B0"?(N=9127,ue=9133,ie=9130,pe="Size4-Regular"):e==="\\rmoustache"||e==="\u23B1"?(N=9131,ue=9129,ie=9130,pe="Size4-Regular"):e==="\\surd"?(N=57345,ue=9143,ie=57344,pe="Size4-Regular"):e==="\\ulcorner"?(N=9484,ie=ue=32):e==="\\urcorner"?(N=9488,ie=ue=32):e==="\\llcorner"?(ue=9492,ie=N=32):e==="\\lrcorner"&&(N=9496,ie=N=32);const Ee=rs(N,pe),De=Ee.height+Ee.depth,je=rs(ie,pe),ze=je.height+je.depth,Je=rs(ue,pe),pt=Je.height+Je.depth;let Xe=0,ot=1;if(J!==null){const si=rs(J,pe);Xe=si.height+si.depth,ot=2}const gt=De+pt+Xe,ct=Math.max(0,Math.ceil((t-gt)/(ot*ze))),Dt=gt+ct*ot*ze;let Bt=xi;r&&(Bt=Bt*a.scalingFactor);const Rt=Dt/2-Bt,br=.008,Gr=[];Gr.push({box:new mt(ue,{fontFamily:pe})}),Gr.push(-br);const wt=new mt(ie,{fontFamily:pe});if(J===null)for(let si=0;si<ct;si++)Gr.push({box:wt});else{for(let si=0;si<ct;si++)Gr.push({box:wt});Gr.push(-br),Gr.push({box:new mt(J,{fontFamily:pe})}),Gr.push(-br);for(let si=0;si<ct;si++)Gr.push({box:wt})}Gr.push(-br),Gr.push({box:new mt(N,{fontFamily:pe})});let yo="";pe==="Size1-Regular"?yo=" delim-size1":pe==="Size4-Regular"&&(yo=" delim-size4");const zs=new Zr({bottom:Rt,children:Gr},{classes:yo});return new mt(zs,h(l({},b!=null?b:{}),{classes:((L=b==null?void 0:b.classes)!=null?L:"")+" ML__delim-mult"}))}var ve=new Set(["(",")","\\lparen","\\rparen","[","]","\\lbrack","\\rbrack","\\{","\\}","\\lbrace","\\rbrace","\\lfloor","\\rfloor","\\lceil","\\rceil","\\surd","\u230A","\u230B","\u2308","\u2309"]),ke=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\mvert","\\mid","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache","\u27EE","\u27EF","\u23B0","\u23B1"]),Ie=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),He=[0,1.2,1.8,2.4,3];function Ve(e,t,r,a){return e===void 0||e==="."?Lt(r,a.classes):(e==="<"||e==="\\lt"||e==="\u27E8"?e="\\langle":(e===">"||e==="\\gt"||e==="\u27E9")&&(e="\\rangle"),ve.has(e)||Ie.has(e)?ce(e,t,!1,r,a):ke.has(e)?me(e,He[t],!1,r,a):(console.assert(!1,"Unknown delimiter '"+e+"'"),null))}var Ke=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],rt=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"stack"}],ut=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function yt(e){return e.type==="small"?"Main-Regular":e.type==="large"?"Size"+e.size+"-Regular":(console.assert(e.type==="stack"),"Size4-Regular")}function Ct(e,t,r,a){const b={"-4":0,"-3":1,0:2}[a.mathstyle.sizeDelta];for(let L=b;L<r.length&&r[L].type!=="stack";L++){const N=rs(e,yt(r[L]));if(N.defaultMetrics)return{type:"small",mathstyle:"scriptstyle"};let J=N.height+N.depth;if(r[L].type==="small"&&(r[L].mathstyle==="scriptscriptstyle"?J*=Math.max(nc[Math.max(1,a.size-2)],a.minFontScale):r[L].mathstyle==="scriptstyle"&&(J*=Math.max(nc[Math.max(1,a.size-1)],a.minFontScale))),J>t)return r[L]}return r[r.length-1]}function At(e,t,r,a,b,L){if(!t||t.length===0||t===".")return Lt(b);t==="<"||t==="\\lt"?t="\\langle":(t===">"||t==="\\gt")&&(t="\\rangle");let N;Ie.has(t)?N=Ke:ve.has(t)?N=ut:N=rt;const J=Ct(O(t),r,N,b),ie=new gr({parent:b,mathstyle:J.mathstyle},L==null?void 0:L.style);return J.type==="small"?X(t,ie,a,h(l({},L),{type:e})):J.type==="large"?ce(t,J.size,a,ie,h(l({},L),{type:e})):(console.assert(J.type==="stack"),me(t,r,a,ie,h(l({},L),{type:e})))}function St(e,t,r,a,b,L){if(t===".")return Lt(b,L==null?void 0:L.classes);const N=xi*b.scalingFactor,J=901,ie=5/fa,ue=Math.max(r-N,a+N),pe=Math.max(ue/500*J,2*ue-ie);return At(e,t,pe,!0,b,L)}function Lt(e,t){const r=new mt(null,{classes:" nulldelimiter "+(t!=null?t:""),type:"ignore"});return r.width=e.getRegisterAsEm("nulldelimiterspace"),r.wrap(new gr({parent:e,mathstyle:"textstyle"}))}var Nt=class Bp extends et{constructor(t){var r;super({type:"placeholder",command:"\\placeholder",mode:(r=t==null?void 0:t.mode)!=null?r:"math",style:t==null?void 0:t.style}),this.captureSelection=!0}static fromJson(t){return new Bp(t)}toJson(){return super.toJson()}render(t){let r;return this.value=t.placeholderSymbol,typeof t.renderPlaceholder=="function"?r=t.renderPlaceholder(t):r=this.createBox(t),this.caret&&(r.classes+=" ML__placeholder-selected"),r}_serialize(t){return t.skipPlaceholders?"":"\\placeholder{}"}},zt=["matrix","matrix*","pmatrix","pmatrix*","bmatrix","bmatrix*","Bmatrix","Bmatrix*","vmatrix","vmatrix*","Vmatrix","Vmatrix*"],lr=["cases","dcases","rcases"],qr=["align","align*","aligned","gather","gathered","split"],Xn=["array","subequations","eqnarray"];function gn(e){return Xn.concat(qr).concat(lr).concat(zt).includes(e)}function ki(e){return zt.includes(e)}function Ei(e){return lr.includes(e)}function Pn(e){return qr.includes(e)}function Mi(e,t,r){let a=0;for(const ue of r)"align"in ue&&(a+=1);let b=0;const L=[];for(const ue of t){let pe=0;for(b=Math.max(b,Math.min(ue.length,a));pe<ue.length;){const Ee=[],De=Math.min(ue.length,pe+a);for(;pe<De;){const je=ue[pe];je.length===0?Ee.push([new et({type:"first",mode:e.mode})]):je[0].type!=="first"?Ee.push([new et({type:"first",mode:e.mode}),...je]):(console.assert(!je.slice(1).some(ze=>ze.type==="first")),Ee.push(je)),pe+=1}L.push(Ee)}}L.length>0&&L[L.length-1].length===1&&L[L.length-1][0].length===1&&L[L.length-1][0][0].type==="first"&&L.pop();const N=[];for(const ue of L){if(ue.length!==b)for(let pe=ue.length;pe<b;pe++)ue.push([new et({type:"first",mode:e.mode}),new Nt]);N.push(ue)}let J=0,ie=0;for(const ue of N){ie=0;for(const pe of ue){for(const Ee of pe)Ee.parent=e,Ee.parentBranch=[J,ie];ie+=1}J+=1}return e.isDirty=!0,N}var qt=class Np extends et{constructor(t,r,a,b={}){var L;super({type:"array"}),this.environmentName=t,this.rowGaps=a,b.mathstyleName&&(this.mathstyleName=b.mathstyleName),b.columns&&(b.columns.length===0?this.colFormat=[{align:"l"}]:this.colFormat=b.columns),this.colFormat||(this.colFormat=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]),this.array=Mi(this,r,this.colFormat),b.leftDelim&&(this.leftDelim=b.leftDelim),b.rightDelim&&(this.rightDelim=b.rightDelim),b.arraycolsep!==void 0&&(this.arraycolsep=b.arraycolsep),this.colSeparationType=b.colSeparationType,b.arraystretch!==void 0&&(this.arraystretch=b.arraystretch),this.minColumns=(L=b.minColumns)!=null?L:1}static fromJson(t){return new Np(t.environmentName,t.array,t.rowGaps,t)}toJson(){const t=h(l({},super.toJson()),{environmentName:this.environmentName,array:this.array.map(r=>r.map(a=>a.map(b=>b.toJson()))),rowGaps:this.rowGaps,columns:this.colFormat,colSeparationType:this.colSeparationType});return this.arraystretch!==void 0&&(t.arraystretch=this.arraystretch),this.arraycolsep!==void 0&&(t.arraycolsep=this.arraycolsep),this.leftDelim&&(t.leftDelim=this.leftDelim),this.rightDelim&&(t.rightDelim=this.rightDelim),t}branch(t){var r;if(vl(t))return(r=this.array[t[0]][t[1]])!=null?r:void 0}createBranch(t){var r;return vl(t)?(this.isDirty=!0,(r=this.branch(t))!=null?r:[]):[]}get rowCount(){return this.array.length}get colCount(){return this.array[0].length}get maxColumns(){return this.colFormat.filter(t=>!!t.align).length}removeBranch(t){if(os(t))return super.removeBranch(t);const r=this.branch(t);return this.array[t[0]][t[1]]=void 0,r.forEach(a=>{a.parent=void 0,a.parentBranch=void 0}),console.assert(r[0].type==="first"),r.shift(),this.isDirty=!0,r}get hasChildren(){return this.children.length>0}get children(){const t=[];for(const r of this.array)for(const a of r)if(a)for(const b of a)t.push(...b.children),t.push(b);return[...t,...super.children]}render(t){var r,a,b,L,N,J;const ie=new gr({parent:t,mathstyle:this.mathstyleName},this.style),ue=ie.getRegisterAsEm("arrayrulewidth"),pe=ie.getRegisterAsEm("arraycolsep"),Ee=ie.getRegisterAsEm("doublerulesep"),De=(a=(r=this.arraystretch)!=null?r:ie.getRegisterAsNumber("arraystretch"))!=null?a:1;let je=typeof this.arraycolsep=="number"?this.arraycolsep:pe;this.colSeparationType==="small"&&(je=.2778*(new gr({parent:t,mathstyle:"scriptstyle"}).scalingFactor/t.scalingFactor));const ze=De*rc,Je=.7*ze,pt=.3*ze;let Xe=0;const ot=[];let gt=0;const ct=this.array.length;for(let en=0;en<ct;++en){const Tn=this.array[en];gt=Math.max(gt,Tn.length);const ai=new gr({parent:ie,mathstyle:this.mathstyleName},this.style);let Hs=Je/ai.scalingFactor,Us=pt/ai.scalingFactor;const Ws={cells:[],height:0,depth:0,pos:0};for(const us of Tn){const cd=(b=et.createBox(ai,us,{type:"ignore"}))!=null?b:new mt(null,{type:"ignore"});Us=Math.max(Us,cd.depth),Hs=Math.max(Hs,cd.height),Ws.cells.push(cd)}let Ks=(L=su(this.rowGaps[en]))!=null?L:0;Ks>0&&(Ks+=pt,Us=Math.max(Us,Ks),Ks=0),en<ct-1&&!ki(this.environmentName)&&this.environmentName!=="cases"&&this.environmentName!=="array"&&(Us+=ie.getRegisterAsEm("jot")),Ws.height=Hs,Ws.depth=Us,Xe+=Hs,Ws.pos=Xe,Xe+=Us+Ks,ot.push(Ws)}const Dt=Xe/2+xi,Bt=[];for(let en=0;en<gt;en++){const Tn=[];for(const ai of ot){const Hs=ai.cells[en];Hs.depth=ai.depth,Hs.height=ai.height,Tn.push({box:Hs,shift:ai.pos-Dt})}Tn.length>0&&Bt.push(new Zr({individualShift:Tn}))}const Rt=[];let br=!1,Gr=!1,wt=0,yo=!this.leftDelim;const{colFormat:zs}=this;for(const en of zs){if("align"in en&&wt>=Bt.length)break;if("align"in en)br?Rt.push(vn(2*je)):(Gr||yo)&&Rt.push(vn(je)),Rt.push(new mt(Bt[wt],{classes:"col-align-"+en.align})),wt++,br=!0,Gr=!1,yo=!1;else if("gap"in en){if(typeof en.gap=="number")Rt.push(vn(en.gap));else{const Tn=_n(t,ot,Dt,en.gap);Tn&&Rt.push(Tn)}br=!1,Gr=!1,yo=!1}else if("separator"in en){const Tn=new mt(null,{classes:"vertical-separator"});Tn.height=Xe,Tn.setStyle("height",Xe,"em"),Tn.setStyle("border-right",`${ue}em ${en.separator} currentColor`),Tn.setStyle("vertical-align",-(Xe-Dt),"em");let ai=0;Gr?ai=Ee-ue:br&&(ai=je-ue),Tn.left=ai,Rt.push(Tn),br=!1,Gr=!0,yo=!1}}br&&!this.rightDelim&&Rt.push(vn(je));const Io=new mt(Rt,{classes:"mtable"});if((!this.leftDelim||this.leftDelim===".")&&(!this.rightDelim||this.rightDelim==="."))return this.caret&&(Io.caret=this.caret),this.bind(t,Io);const si=Io.height,bo=Io.depth,$i=this.bind(t,new mt([this.bind(t,St("open",(N=this.leftDelim)!=null?N:".",si,bo,ie,{isSelected:this.isSelected})),Io,this.bind(t,St("close",(J=this.rightDelim)!=null?J:".",si,bo,ie,{isSelected:this.isSelected}))],{type:"ord"}));return $i?($i.setStyle("display","inline-block"),this.caret&&($i.caret=this.caret),this.bind(t,this.attachSupsub(t,{base:$i}))):null}_serialize(t){var r;const a=[];if(this.environmentName==="lines"?a.push("{\\displaylines"):a.push(`\\begin{${this.environmentName}}`),this.environmentName==="array"){if(a.push("{"),this.colFormat!==void 0)for(const b of this.colFormat)"align"in b&&typeof b.align=="string"?a.push(b.align):"separator"in b&&b.separator==="solid"?a.push("|"):"separator"in b&&b.separator==="dashed"&&a.push(":");a.push("}")}for(let b=0;b<this.array.length;b++){for(let L=0;L<this.array[b].length;L++)L>0&&a.push(" & "),a.push(et.serialize(this.array[b][L],t));if(b<this.array.length-1){const L=this.rowGaps[b];L!=null&&L.dimension?a.push(`\\\\[${L.dimension} ${(r=L.unit)!=null?r:"pt"}] `):a.push("\\\\ ")}}return this.environmentName==="lines"?a.push("}"):a.push(`\\end{${this.environmentName}}`),ar(a)}getCell(t,r){return this.array[t][r]}setCell(t,r,a){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.array[t][r]!==void 0);for(const L of this.array[t][r])L.parent=void 0,L.parentBranch=void 0;let b=a;(a.length===0||a[0].type!=="first")&&(b=[new et({type:"first",mode:this.mode}),...a]),this.array[t][r]=b;for(const L of b)L.parent=this,L.parentBranch=[t,r];this.isDirty=!0}addRowBefore(t){console.assert(this.type==="array"&&Array.isArray(this.array));const r=[];for(let a=0;a<this.colCount;a++)r.push(bn(this));this.array.splice(t,0,r);for(let a=t;a<this.rowCount;a++)for(let b=0;b<this.colCount;b++){const L=this.array[a][b];if(L)for(const N of L)N.parentBranch=[a,b]}this.isDirty=!0}addRowAfter(t){console.assert(this.type==="array"&&Array.isArray(this.array));const r=[];for(let a=0;a<this.colCount;a++)r.push(bn(this));this.array.splice(t+1,0,r);for(let a=t+1;a<this.rowCount;a++)for(let b=0;b<this.colCount;b++){const L=this.array[a][b];if(L)for(const N of L)N.parentBranch=[a,b]}this.isDirty=!0}removeRow(t){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.rowCount>t);const r=this.array.splice(t,1);for(const a of r)for(const b of a)if(b)for(const L of b)L.parent=void 0,L.parentBranch=void 0;for(let a=t;a<this.rowCount;a++)for(let b=0;b<this.colCount;b++){const L=this.array[a][b];if(L)for(const N of L)N.parentBranch=[a,b]}this.isDirty=!0}addColumnBefore(t){console.assert(this.type==="array"&&Array.isArray(this.array));for(const r of this.array)r.splice(t,0,bn(this));for(let r=0;r<this.rowCount;r++)for(let a=t;a<this.colCount;a++){const b=this.array[r][a];if(b)for(const L of b)L.parentBranch=[r,a]}this.isDirty=!0}addColumnAfter(t){console.assert(this.type==="array"&&Array.isArray(this.array));for(const r of this.array)r.splice(t+1,0,bn(this));for(let r=0;r<this.rowCount;r++)for(let a=t+1;a<this.colCount;a++){const b=this.array[r][a];if(b)for(const L of b)L.parentBranch=[r,a]}this.isDirty=!0}addColumn(){this.addColumnAfter(this.colCount-1)}removeColumn(t){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.colCount>t);for(const r of this.array){const a=r.splice(t,1);for(const b of a)if(b)for(const L of b)L.parent=void 0,L.parentBranch=void 0}for(let r=0;r<this.rowCount;r++)for(let a=t;a<this.colCount;a++){const b=this.array[r][a];if(b)for(const L of b)L.parentBranch=[r,a]}this.isDirty=!0}get cells(){const t=[];for(const r of this.array)for(const a of r)a&&t.push(a.filter(b=>b.type!=="first"));return t}};function bn(e){const t=new et({type:"first",mode:e.mode});t.parent=e;const r=new Nt;return r.parent=e,[t,r]}function vn(e){const t=new mt(null,{classes:"arraycolsep"});return t.width=e,t}function _n(e,t,r,a){if(!a)return null;const b=[];for(const L of t){const N=et.createBox(e,a,{type:"ignore"});N&&(N.depth=L.depth,N.height=L.height,b.push({box:N,shift:L.pos-r}))}return new Zr({individualShift:b}).wrap(e)}var En=class Fp extends et{constructor(t){super({mode:t.mode,command:t.command,style:t.style,body:t.body,type:"box"}),this.framecolor=t.framecolor,this.backgroundcolor=t.backgroundcolor,this.padding=t.padding,this.offset=t.offset,this.border=t.border}static fromJson(t){return new Fp(t)}toJson(){return h(l({},super.toJson()),{framecolor:this.framecolor,backgroundcolor:this.backgroundcolor,padding:this.padding,offset:this.offset,border:this.border})}render(t){var r,a,b,L;const N=et.createBox(t,this.body,{type:"lift"});if(!N)return null;const J=t.toEm((r=this.offset)!=null?r:{dimension:0});N.depth+=J,N.setStyle("display","inline-block"),N.setStyle("position","relative"),N.setStyle("height",Math.floor(100*N.height+N.depth)/100,"em"),N.setStyle("vertical-align",-Math.floor(100*N.height)/100,"em");const ie=new gr({parent:t},this.style),ue=ie.toEm((a=this.padding)!=null?a:{register:"fboxsep"}),pe=new mt(null,{classes:"ML__box"});pe.height=N.height+ue,pe.depth=N.depth+ue,pe.setStyle("box-sizing","border-box"),pe.setStyle("position","absolute"),pe.setStyle("top",-ue+.3,"em"),pe.setStyle("left",0),pe.setStyle("height",pe.height+pe.depth,"em"),pe.setStyle("width","100%"),this.backgroundcolor&&pe.setStyle("background-color",(b=ie.toColor(this.backgroundcolor))!=null?b:"transparent"),this.framecolor&&pe.setStyle("border",`${ie.getRegisterAsEm("fboxrule",2)}em solid ${(L=ie.toColor(this.framecolor))!=null?L:"black"}`),this.border&&pe.setStyle("border",this.border);const Ee=new mt([pe,N],{type:"lift"});return Ee.setStyle("display","inline-block"),Ee.setStyle("position","relative"),Ee.setStyle("line-height",0),Ee.height=N.height+ue+(J>0?J:0),Ee.depth=N.depth+ue+(J<0?-J:0),Ee.setStyle("padding-left",ue,"em"),Ee.setStyle("padding-right",ue,"em"),Ee.setStyle("height",Math.floor(100*(N.height+N.depth+2*ue+Math.abs(J)))/100,"em"),Ee.setStyle("margin-top",-ue,"em"),Ee.setStyle("top",Math.floor(100*(N.depth-N.height+2*ue-J))/100,"em"),Ee.setStyle("vertical-align",Math.floor(100*(N.depth+2*ue))/100,"em"),this.caret&&(Ee.caret=this.caret),this.attachSupsub(t,{base:Ee})}_serialize(t){return t.skipStyles?ar([this.bodyToLatex(t),this.supsubToLatex(t)]):super._serialize(t)}},ga=class zp extends et{constructor(t,r){var a;super({type:"composition",mode:(a=r==null?void 0:r.mode)!=null?a:"math",value:t})}static fromJson(t){return new zp(t.value,t)}toJson(){return super.toJson()}get computedStyle(){return{}}render(t){const r=new mt(this.value,{classes:"ML__composition",type:"composition"});return this.bind(t,r),this.caret&&(r.caret=this.caret),r}_serialize(t){return""}},Ri=class Hp extends et{constructor(t){super({type:"error",value:t,command:t,mode:"math"}),this.verbatimLatex=t}static fromJson(t){return new Hp(t.command)}toJson(){return super.toJson()}render(t){const r=this.createBox(t,{classes:"ML__error"});return this.caret&&(r.caret=this.caret),r}},ni=class Up extends et{constructor(t,r,a){super({type:"group",mode:r,style:a}),this.body=t,this.boxType=t.length>1?"ord":"ignore",this.skipBoundary=!0,this.displayContainsHighlight=!1,t&&t.length===1&&t[0].command===","&&(this.captureSelection=!0)}static fromJson(t){return new Up(t.body,t.mode,t.style)}render(t){const r=et.createBox(t,this.body,{type:this.boxType});return r?(this.caret&&(r.caret=this.caret),this.bind(t,r)):null}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const r=Qe(this.command,this.mode);return r!=null&&r.serialize?r.serialize(this,t):`{${this.bodyToLatex(t)}}`}},Dr=class Wp extends et{constructor(t,r,a){super({type:"leftright",style:a.style,displayContainsHighlight:!0}),this.variant=t,this.body=r,this.leftDelim=a.leftDelim,this.rightDelim=a.rightDelim}static fromJson(t){var r;return new Wp((r=t.variant)!=null?r:"",t.body,t)}toJson(){const t=super.toJson();return this.variant&&(t.variant=this.variant),this.leftDelim&&(t.leftDelim=this.leftDelim),this.rightDelim&&(t.rightDelim=this.rightDelim),t}_serialize(t){var r,a;const b=this.matchingRightDelim();return this.variant==="left...right"?ar(["\\left",(r=this.leftDelim)!=null?r:".",this.bodyToLatex(t),"\\right",b]):this.variant==="mleft...mright"?ar(["\\mleft",(a=this.leftDelim)!=null?a:".",this.bodyToLatex(t),"\\mright",b]):ar([!this.leftDelim||this.leftDelim==="."?"":this.leftDelim,this.bodyToLatex(t),b])}matchingRightDelim(){var t,r;if(this.rightDelim&&this.rightDelim!=="?")return this.rightDelim;const a=(t=this.leftDelim)!=null?t:".";return(r=k[a])!=null?r:a}render(t){var r,a;const b=new gr({parent:t},this.style);console.assert(this.body!==void 0);const L=new gr({parent:t,mathstyle:"textstyle"},this.style),N=(r=et.createBox(b,this.body,{type:"inner"}))!=null?r:new mt(null,{type:"inner"}),J=N.height/L.scalingFactor,ie=N.depth/L.scalingFactor,ue=[];if(this.leftDelim&&ue.push(this.bind(L,St("open",this.leftDelim,J,ie,L,{isSelected:this.isSelected,classes:"ML__open"+(this.containsCaret?" ML__contains-caret":""),mode:this.mode,style:this.style}))),N&&(zn(N.children,this,b,J,ie),ue.push(N)),this.rightDelim){let je=this.containsCaret?" ML__contains-caret":"",ze=this.rightDelim;ze==="?"&&(b.smartFence?(ze=this.matchingRightDelim(),je+=" ML__smart-fence__close"):ze="."),ue.push(this.bind(L,St("close",ze,J,ie,L,{isSelected:this.isSelected,classes:je+" ML__close",mode:this.mode,style:this.style})))}let pe=this.variant==="mleft...mright";const Ee=this.leftSibling;Ee&&(!pe&&Ee.isFunction&&(pe=!0),!pe&&Ee.type==="subsup"&&((a=Ee.leftSibling)!=null&&a.isFunction)&&(pe=!0));const De=new mt(ue,{type:pe?"close":"inner",classes:"left-right"});return De.setStyle("margin-top",`${-N.depth}em`),De.setStyle("height",`${N.height+N.depth}em`),this.caret&&(De.caret=this.caret),this.bind(b,De.wrap(b))}};function zn(e,t,r,a,b){if(e)for(let L=0;L<e.length;L++){const N=e[L];N.type==="middle"?(e[L]=t.bind(r,St("inner",N.value,a,b,r,{isSelected:t.isSelected})),e[L].caret=N.caret,e[L].isSelected=N.isSelected,e[L].cssId=N.cssId,e[L].htmlData=N.htmlData,e[L].htmlStyle=N.htmlStyle,e[L].attributes=N.attributes,e[L].cssProperties=N.cssProperties):N.children&&zn(N.children,t,r,a,b)}}var pc=class Kp extends et{constructor(t,r){var a;super({type:"macro",command:t,style:r.style}),this.body=r.body,r.captureSelection===void 0?r.args?this.captureSelection=!1:this.captureSelection=!0:this.captureSelection=r.captureSelection,this.macroArgs=r.args,this.expand=(a=r.expand)!=null?a:!1}static fromJson(t){return new Kp(t.command,t)}toJson(){const t=super.toJson();return this.expand&&(t.expand=!0),this.captureSelection!==void 0&&(t.captureSelection=this.captureSelection),this.macroArgs&&(t.args=this.macroArgs),t}_serialize(t){var r;return t.expandMacro&&this.expand?this.bodyToLatex(t):this.command+((r=this.macroArgs)!=null?r:"")}render(t){const r=et.createBox(t,this.body);return r?(this.caret&&(r.caret=this.caret),this.bind(t,r)):null}},ls=class $p extends et{constructor(){super({type:"macro-argument"})}static fromJson(t){return new $p}toJson(){return super.toJson()}_serialize(t){return""}render(t){return null}},Ps=class Gp extends et{constructor(t,r,a=!1,b,L){var N;super({type:"prompt",mode:(N=L==null?void 0:L.mode)!=null?N:"math",style:L==null?void 0:L.style,command:"\\placeholder"}),this.body=b,this.correctness=r,this.placeholderId=t,this.locked=a,this.captureSelection=this.locked}static fromJson(t){return new Gp(t.placeholderId,t.correctness,t.locked,t.body,t)}toJson(){const t=super.toJson();return this.placeholderId&&(t.placeholderId=this.placeholderId),this.body||delete t.body,this.body&&(t.body=this.body.filter(r=>r.type!=="first").map(r=>r.toJson())),this.correctness&&(t.correctness=this.correctness),t.locked=this.locked,t}render(t){const r=new gr({parent:t}),a=r.getRegisterAsEm("fboxsep"),b=a,L=a,N=et.createBox(t,this.body);if(!N)return null;N.height||(N.height=r.metrics.xHeight),N.setStyle("vertical-align",-N.height,"em"),this.correctness==="correct"?N.setStyle("color","var(--correct-color, var(--ML__correct-color))"):this.correctness==="incorrect"&&N.setStyle("color","var(--incorrect-color, var(--ML__incorrect-color))");const J=new mt(N,{type:"ord"});J.setStyle("display","inline-block"),J.setStyle("height",N.height+N.depth,"em"),J.setStyle("vertical-align",-L,"em");let ie="ML__prompt ";this.locked?ie+=" ML__lockedPromptBox ":ie+=" ML__editablePromptBox ",this.correctness==="correct"?ie+=" ML__correctPromptBox ":this.correctness==="incorrect"&&(ie+=" ML__incorrectPromptBox "),this.containsCaret&&(ie+=" ML__focusedPromptBox ");const ue=new mt(null,{classes:ie,attributes:{part:"prompt"}});ue.height=J.height+L,ue.depth=J.depth+L,ue.width=J.width+2*b,ue.setStyle("box-sizing","border-box"),ue.setStyle("position","absolute"),ue.setStyle("height",J.height+J.depth+2*L,"em"),b===0&&ue.setStyle("width","100%"),b!==0&&(ue.setStyle("width",`calc(100% + ${2*b}em)`),ue.setStyle("top",a,"em"),ue.setStyle("left",-b,"em")),(!this.body||this.body.length===1)&&(ue.width=3*b,ue.setStyle("width",`calc(100% + ${3*b}em)`),ue.setStyle("left",-1.5*b,"em"));let pe="";this.correctness==="incorrect"&&(pe+='<line x1="3%" y1="97%" x2="97%" y2="3%" stroke-width="0.5" stroke="var(--incorrect-color, var(--ML__incorrect-color))" stroke-linecap="round" />'),pe&&(ue.svgOverlay=pe);const Ee=new mt([ue,J],{classes:"ML__prompt-atom"});return Ee.setStyle("position","relative"),Ee.setStyle("display","inline-block"),Ee.setStyle("line-height",0),Ee.height=J.height+L+.2,Ee.depth=J.depth+L,Ee.left=b,Ee.right=b,Ee.setStyle("height",J.height+L,"em"),Ee.setStyle("top",J.depth-J.height,"em"),Ee.setStyle("vertical-align",J.depth+L,"em"),Ee.setStyle("margin-left",.5,"em"),Ee.setStyle("margin-right",.5,"em"),this.caret&&(Ee.caret=this.caret),this.bind(r,this.attachSupsub(t,{base:Ee}))}_serialize(t){var r;const a=(r=this.bodyToLatex(t))!=null?r:"";if(t.skipPlaceholders)return a;let b="\\placeholder";return this.placeholderId&&(b+=`[${this.placeholderId}]`),this.correctness==="correct"?b+="[correct]":this.correctness==="incorrect"&&(b+="[incorrect]"),this.locked&&(b+="[locked]"),sn(b,a)}},Do=class Vp extends et{constructor(t){super({type:"subsup",style:t==null?void 0:t.style}),this.subsupPlacement="auto"}static fromJson(t){const r=new Vp(t);for(const a of Ha)t[a]&&r.setChildren(t[a],a);return r}render(t){var r;const a=new gr({parent:t,isPhantom:!0}),b=this.leftSibling,L=(r=b.render(a))!=null?r:new mt(null),N=new mt(null);return N.height=L.height,N.depth=L.depth,this.attachSupsub(t,{base:N,isCharacterBox:b.isCharacterBox(),type:"ignore"})}_serialize(t){return this.supsubToLatex(t)}};function Rn(e){return e?!/^(<$$>|<$>|<space>|<{>|<}>|#[0-9\?]|\\.+)$/.test(e):!1}var va=class{constructor(e,t,r){this.errors=[],this.index=0,this.endCount=0;var a,b,L,N;r!=null||(r={}),this.tokens=e,this.context=t instanceof gr&&!(r!=null&&r.parseMode)&&!r.mathstyle?t:new gr({from:t,mathstyle:r.mathstyle},r.style),this.args=(a=r.args)!=null?a:void 0,this.smartFence=this.context.smartFence,this.parsingContext={parent:void 0,mathlist:[],style:(b=r.style)!=null?b:{},parseMode:(L=r.parseMode)!=null?L:"math",mathstyle:(N=r.mathstyle)!=null?N:"displaystyle",tabular:!1}}beginContext(e){var t,r,a;const b=this.parsingContext,L={parent:b,mathlist:[],style:l({},b.style),parseMode:(t=e==null?void 0:e.mode)!=null?t:b.parseMode,mathstyle:(r=e==null?void 0:e.mathstyle)!=null?r:b.mathstyle,tabular:(a=e==null?void 0:e.tabular)!=null?a:!1};this.parsingContext=L}endContext(){this.parsingContext=this.parsingContext.parent}onError(e){this.errors.push(l({before:Ms(this.tokens.slice(this.index,this.index+10)),after:Ms(this.tokens.slice(Math.max(0,this.index-10),this.index))},e))}get mathlist(){return this.parsingContext.mathlist}set mathlist(e){this.parsingContext.mathlist=e}get parseMode(){return this.parsingContext.parseMode}set parseMode(e){this.parsingContext.parseMode=e}get tabularMode(){return this.parsingContext.tabular}get style(){let e=this.parsingContext;for(;e;){if(e.style)return l({},e.style);e=e.parent}return{}}set style(e){this.parsingContext.style=e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}next(){this.index+=1}get(){return this.endCount=0,this.index<this.tokens.length?this.tokens[this.index++]:""}peek(){return this.tokens[this.index]}match(e){return this.tokens[this.index]===e?(this.index++,!0):!1}lastSubsupAtom(){let e;return this.mathlist.length>0&&(e=this.mathlist[this.mathlist.length-1],e.type==="subsup"||e.subsupPlacement!==void 0)||(e=new Do({style:this.style}),this.mathlist.push(e)),e}hasPattern(e){return e.test(this.tokens[this.index])}hasInfixCommand(){var e;const{index:t}=this;if(t<this.tokens.length&&this.tokens[t].startsWith("\\")){const r=Qe(this.tokens[t],this.parseMode);return!r||r.definitionType==="symbol"||r.ifMode&&!r.ifMode.includes(this.parseMode)?!1:(e=r.infix)!=null?e:!1}return!1}matchColumnSeparator(){return!this.tabularMode||this.peek()!=="&"?!1:(this.index++,!0)}matchRowSeparator(){if(!this.tabularMode)return!1;const e=this.peek();return e!=="\\\\"&&e!=="\\cr"&&e!=="\\tabularnewline"?!1:(this.index++,!0)}placeholder(){var e;const t=(e=this.args)==null?void 0:e.call(this,"?");return t?ii(t,{parseMode:this.parseMode,mathstyle:"textstyle"}):[new Nt({mode:this.parseMode,style:this.style})]}skipWhitespace(){for(;this.match("<space>"););}skipUntilToken(e){let t=this.tokens[this.index];for(;t&&t!==e;)t=this.tokens[++this.index];t===e&&this.index++}skipFiller(){for(;this.match("\\relax")||this.match("<space>"););}matchKeyword(e){const t=this.index;let r=this.end(),a="";for(;!r;){const L=this.get();Rn(L)?(a+=L,r=this.end()||a.length>=e.length):r=!0}const b=e.toUpperCase()===a.toUpperCase();return b||(this.index=t),b}scanString(){let e="";for(;!this.end();){const t=this.peek();if(t==="]")return e;if(t==="<space>")e+=" ";else if(t.startsWith("\\"))this.onError({code:"unexpected-command-in-string"}),e+=t.substring(1);else if(Rn(t))e+=t;else return e;this.next()}return e}scanBalancedString(){let e="",t=this.end(),r=1;for(;!t;){const a=this.get();a==="<space>"?e+=" ":a==="<{>"?(e+="{",r+=1):a==="<}>"?(r-=1,r>0?e+="}":this.index-=1):a==="<$>"?e+="$":a==="<$$>"?e+="$$":e+=a,t=r===0||this.end()}return e}scanLiteralGroup(){var e;if(!this.match("<{>"))return"";let t="",r=1;for(;r>0&&!this.end();){const a=this.get();a==="<}>"?(r-=1,r>0&&(t+="}")):a==="<{>"?(r+=1,t+="{"):(/\\[a-zA-Z]+$/.test(t)&&/^[a-zA-Z]/.test(a)&&(t+=" "),t+=(e={"<space>":" ","<$$>":"$$","<$>":"$"}[a])!=null?e:a)}return t}scanNumber(e=!0){var t,r;let a=!1,b=this.peek();for(;b==="<space>"||b==="+"||b==="-";)this.get(),b==="-"&&(a=!a),b=this.peek();e=!!e;let L=10,N=/\d/;if(this.match("'"))L=8,N=/[0-7]/,e=!0;else if(this.match('"'))L=16,N=/[\dA-F]/,e=!0;else if(this.match("x"))L=16,N=/[\dA-Fa-f]/,e=!0;else if(this.match("`"))return b=this.get(),b?b.length===2&&b.startsWith("\\")?{number:(a?-1:1)*((t=b.codePointAt(1))!=null?t:0),base:"alpha"}:{number:(a?-1:1)*((r=b.codePointAt(0))!=null?r:0),base:"alpha"}:null;let J="";for(;this.hasPattern(N);)J+=this.get();if(!e&&(this.match(".")||this.match(",")))for(J+=".";this.hasPattern(N);)J+=this.get();const ie=e?Number.parseInt(J,L):Number.parseFloat(J);return Number.isNaN(ie)?null:{number:a?-ie:ie,base:L===16?"hexadecimal":L===8?"octal":"decimal"}}scanRegister(){var e;const t=this.index,r=this.scanNumber(!1);if(this.skipWhitespace(),this.match("\\relax"))return r;let a=!1;if(r===null)for(;;){const L=this.peek();if(L==="-")a=!a;else if(L!=="+")break;this.next(),this.skipWhitespace()}if(this.match("\\global")){this.skipWhitespace();const L=this.get();return L.startsWith("\\")?r?{register:L,global:!0,factor:(a?-1:1)*r.number}:a?{register:L,global:!0,factor:-1}:{register:L,global:!0}:(this.index=t,null)}let b=this.get();return b!=null&&b.startsWith("\\")?(b=b.substring(1),this.context.registers[b]?!a||r!==null?{register:b,factor:(a?-1:1)*((e=r==null?void 0:r.number)!=null?e:1)}:{register:b}:(this.index=t,null)):(this.index=t,null)}scanValue(){const e=this.scanRegister();if(e)return e;const t=this.index,r=this.scanGlueOrDimen();if(r&&("unit"in r||"glue"in r&&"unit"in r.glue))return r;this.index=t;const a=this.scanNumber();if(a)return a;if(this.end()||!Rn(this.peek()))return null;const b=this.scanString();return b.length>0?{string:b}:null}scanDimen(){const e=this.scanNumber(!1);if(e===null)return null;const t=e.number;this.skipWhitespace(),this.matchKeyword("true"),this.skipWhitespace();let r;return this.matchKeyword("pt")?r="pt":this.matchKeyword("mm")?r="mm":this.matchKeyword("cm")?r="cm":this.matchKeyword("ex")?r="ex":this.matchKeyword("px")?r="px":this.matchKeyword("em")?r="em":this.matchKeyword("bp")?r="bp":this.matchKeyword("dd")?r="dd":this.matchKeyword("pc")?r="pc":this.matchKeyword("in")?r="in":this.matchKeyword("mu")&&(r="mu"),r?{dimension:t,unit:r}:{dimension:t}}scanGlueOrDimen(){const e=this.scanDimen();if(e===null)return null;if(this.skipWhitespace(),this.match("\\relax"))return e;const t={glue:e};if(this.matchKeyword("plus")){const r=this.scanDimen();if(r)t.grow=r;else return t}if(this.skipWhitespace(),this.match("\\relax"))return t;if(this.skipWhitespace(),this.matchKeyword("minus")){const r=this.scanDimen();if(r)t.shrink=r;else return t}return!t.grow&&!t.shrink?e:t}scanColspec(){this.skipWhitespace();const e=[];for(;!this.end()&&!(this.peek()==="<}>"||this.peek()==="]");){const t=this.get();t==="c"||t==="r"||t==="l"?e.push({align:t}):t==="|"?e.push({separator:"solid"}):t===":"?e.push({separator:"dashed"}):t==="@"&&(this.match("<{>")&&(this.beginContext({mode:"math"}),e.push({gap:this.scan(r=>r==="<}>")}),this.endContext()),this.match("<}>")||this.onError({code:"unbalanced-braces"}))}return e}scanModeSet(){let e;if(this.match("\\(")&&(e="textstyle"),!e&&this.match("\\[")&&(e="displaystyle"),!e)return null;this.beginContext({mode:"math",mathstyle:e});const t=this.scan(r=>r===(e==="displaystyle"?"\\]":"\\)"));return this.match(e==="displaystyle"?"\\]":"\\)")||this.onError({code:"unbalanced-mode-shift"}),this.endContext(),t}scanModeShift(){let e="";if(this.match("<$>")&&(e="<$>"),!e&&this.match("<$$>")&&(e="<$$>"),!e)return null;this.beginContext({mode:"math",mathstyle:"textstyle"});const t=this.scan(r=>r===e);return this.match(e)||this.onError({code:"unbalanced-mode-shift"}),this.endContext(),t}scanEnvironment(){if(!this.match("\\begin"))return null;const e=this.scanArgument("string");if(!e)return null;const t=se(e);if(!t)return this.onError({code:"unknown-environment",arg:e}),null;const r=[];if(t.params)for(const J of t.params)if(J.isOptional)r.push(this.scanOptionalArgument(J.type));else{const ie=this.scanArgument(J.type);ie||this.onError({code:"missing-argument",arg:e}),r.push(ie)}this.beginContext({tabular:t.tabular});const a=[],b=[];let L=[],N=!1;do if(this.end()&&(this.onError({code:"unbalanced-environment",arg:e}),N=!0),!N&&this.match("\\end")&&(this.scanArgument("string")!==e&&this.onError({code:"unbalanced-environment",arg:e}),N=!0),!N)if(this.matchColumnSeparator())L.push(this.mathlist),this.mathlist=[];else if(this.matchRowSeparator()){L.push(this.mathlist),this.mathlist=[];let J=null;this.skipWhitespace(),this.match("[")&&(J=this.scanDimen(),this.skipWhitespace(),this.match("]")),b.push(J!=null?J:{dimension:0}),a.push(L),L=[]}else this.mathlist.push(...this.scan(J=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline"].includes(J)));while(!N);return L.push(this.mathlist),L.length>0&&a.push(L),this.endContext(),t.createAtom(e,a,b,r)}scanExpression(){const e=this.mathlist;if(this.mathlist=[],this.parseExpression()){const t=this.mathlist;return this.mathlist=e,t}return this.mathlist=e,null}scan(e){this.beginContext(),e||(e=N=>N==="<}>");let t="",r=null,a=[],b=null;for(;!this.end()&&!e(this.peek());)this.hasInfixCommand()&&!t?(t=this.get(),r=Qe(t,"math"),r&&(a=this.scanArguments(r)[1]),b=this.mathlist,this.mathlist=[]):this.parseExpression();let L;return t?(console.assert(!!r),a.unshift(this.mathlist),b&&a.unshift(b),L=[r.createAtom({command:t,args:a,style:this.style,mode:this.parseMode})]):L=this.mathlist,this.endContext(),L}scanGroup(){const e=this.index;if(!this.match("<{>"))return null;const t=this.scan(a=>a==="<}>");this.match("<}>")||this.onError({code:"unbalanced-braces"});const r=new ni(t,this.parseMode,this.style);return r.verbatimLatex=Ms(this.tokens.slice(e,this.index)),r}scanSmartFence(){if(this.skipWhitespace(),!this.match("("))return null;this.beginContext();let e=1;for(;!this.end()&&e!==0;)this.match("(")&&(e+=1),this.match(")")&&(e-=1),e!==0&&this.parseExpression();const t=new Dr("",this.mathlist,{leftDelim:"(",rightDelim:e===0?")":"?"});return this.endContext(),t}scanDelim(){this.skipWhitespace();const e=this.peek();if(!e)return this.onError({code:"unexpected-end-of-string"}),null;if(!Rn(e)&&!e.startsWith("\\"))return null;this.next();const t=Qe(e,"math");return t?t.definitionType==="function"&&t.ifMode&&!t.ifMode.includes(this.parseMode)?(this.onError({code:"unexpected-delimiter",arg:e}),null):t.definitionType==="symbol"&&(t.type==="mopen"||t.type==="mclose")||/^(\.|\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:(this.onError({code:"unexpected-delimiter",arg:e}),null):(this.onError({code:"unknown-command",arg:e}),null)}scanLeftRight(){var e;if(this.match("\\right"))return this.onError({code:"unbalanced-braces"}),new Ri("\\right");if(this.match("\\mright"))return this.onError({code:"unbalanced-braces"}),new Ri("\\mright");let t="\\right";if(!this.match("\\left")){if(!this.match("\\mleft"))return null;t="\\mright"}const r=this.scanDelim();if(!r)return this.onError({code:"unexpected-delimiter"}),new Ri(t==="\\right"?"\\left":"\\mleft");for(this.beginContext();!this.end()&&!this.match(t);)this.parseExpression();const a=this.mathlist;this.endContext();const b=(e=this.scanDelim())!=null?e:".";return new Dr(t==="\\right"?"left...right":"mleft...mright",a,{leftDelim:r,rightDelim:b,style:this.style})}parseSupSub(){if(this.parseMode!=="math")return!1;let e=this.peek();if(e!=="^"&&e!=="_"&&e!=="'")return!1;const t=this.lastSubsupAtom();for(;e==="^"||e==="_"||e==="'";)this.match("'")?this.match("'")?t.addChild(new et({type:"mord",command:"\\doubleprime",mode:"math",value:"\u2032\u2032"}),"superscript"):t.addChild(new et({type:"mord",command:"\\prime",mode:"math",value:"\u2032"}),"superscript"):(this.match("^")||this.match("_"))&&t.addChildren(de(this.scanArgument("expression")),e==="_"?"subscript":"superscript"),e=this.peek();return!0}parseLimits(){if(this.parseMode!=="math")return!1;const e=this.match("\\limits"),t=!e&&this.match("\\nolimits"),r=!t&&!e&&this.match("\\displaylimits");if(!e&&!t&&!r)return!1;const a=this.mathlist.length>0?this.mathlist[this.mathlist.length-1]:null;return a===null?!1:(a.explicitSubsupPlacement=!0,e&&(a.subsupPlacement="over-under"),t&&(a.subsupPlacement="adjacent"),r&&(a.subsupPlacement="auto"),!0)}scanArguments(e){if(!(e!=null&&e.params))return[void 0,[]];let t;const r=[];let a=e.infix?2:0;for(;a<e.params.length;){const b=e.params[a];b.type==="rest"?r.push(this.scan(L=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline","\\right"].includes(L))):b.isOptional?r.push(this.scanOptionalArgument(b.type)):b.type.endsWith("*")?t=b.type.slice(0,-1):r.push(this.scanArgument(b.type)),a+=1}return[t,r]}scanSymbolOrLiteral(){const e=this.peek();if(!e)return null;this.next();let t;if(Rn(e)){const r=Wi.createAtom(this.parseMode,e,l({},this.style));return r?[r]:null}if(t=this.scanMacro(e),t)return[t];if(e.startsWith("\\")){const r=Qe(e,this.parseMode);if(!r)return this.onError({code:"unknown-command",arg:e}),[new Ri(e)];if(r.definitionType==="symbol"){const a=l({},this.style);r.variant&&(a.variant=r.variant),t=new et({type:r.type,command:e,style:a,value:String.fromCodePoint(r.codepoint),mode:this.parseMode,verbatimLatex:e})}else{if(r.applyMode||r.applyStyle||r.infix)return this.onError({code:"invalid-command",arg:e}),[new Ri(e)];r.createAtom&&(t=r.createAtom({command:e,args:[],style:this.style,mode:this.parseMode}))}}return t?[t]:null}scanArgument(e){var t;this.skipFiller();const r=this.parseMode;if(e==="auto"&&(e=r),!this.match("<{>")){if(e==="string")return this.scanString();if(e==="value")return this.scanValue();if(e==="delim")return(t=this.scanDelim())!=null?t:".";if(e==="expression")return this.scanExpression();if(e==="math"){e!==r&&this.beginContext({mode:"math"});const b=this.scanSymbolOrLiteral();return e!==r&&this.endContext(),b}if(e==="text"){e!==r&&this.beginContext({mode:"text"});const b=this.scanSymbolOrLiteral();return e!==r&&this.endContext(),b}return e==="balanced-string"||console.assert(!1),null}if(e==="text"){this.beginContext({mode:"text"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const b=this.mathlist;return this.endContext(),{group:b}}if(e==="math"){this.beginContext({mode:"math"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const b=this.mathlist;return this.endContext(),{group:b}}let a=null;if(e==="expression"){this.beginContext({mode:"math"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const b=this.mathlist;return this.endContext(),{group:b}}return e==="string"?a=this.scanString():e==="balanced-string"?a=this.scanBalancedString():e==="colspec"?a=this.scanColspec():e==="value"&&(a=this.scanValue()),this.skipUntilToken("<}>"),a}scanOptionalArgument(e){if(e=e==="auto"?this.parseMode:e,this.skipFiller(),!this.match("["))return null;let t=null;for(;!this.end()&&!this.match("]");)if(e==="string")t=this.scanString();else if(e==="value")t=this.scanValue();else if(e==="colspec")t=this.scanColspec();else if(e==="bbox"){const r={},a=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const b of a){const L=b.match(/^\s*([\d.]+)\s*([a-z]{2})/);if(L)r.padding={dimension:parseInt(L[1]),unit:L[2]};else{const N=b.match(/^\s*border\s*:\s*(.*)/);N?r.border=N[1]:r.backgroundcolor={string:b}}}t=r}else e==="math"&&(this.beginContext({mode:"math"}),t=this.mathlist.concat(this.scan(r=>r==="]")),this.endContext());return t}scanSymbolOrCommand(e){var t,r,a;if(e==="\\placeholder"){const J=this.scanOptionalArgument("string"),ie=this.scanOptionalArgument("math"),ue=et.serialize(ie,{defaultMode:"math"});let pe=[],Ee;!Ee&&ue==="correct"?Ee="correct":!Ee&&ue==="incorrect"?Ee="incorrect":ue!==""&&(pe=ie);const De=this.scanOptionalArgument("string")==="locked",je=this.scanArgument("auto");let ze;return je&&Array.isArray(je)&&je.length>0?ze=je:je&&typeof je=="object"&&"group"in je?ze=je.group:ze=pe,J?[new Ps(J,Ee,De,ze!=null?ze:pe,{mode:this.parseMode,style:this.style})]:[new Nt({mode:this.parseMode,style:this.style})]}if(e==="\\renewcommand"||e==="\\newcommand"||e==="\\providecommand"||e==="\\def"){const J=this.index,ie=this.scanLiteralGroup()||this.next();if(!ie)return null;if(this.context.registers[ie.substring(1)]){const ue=this.scanArgument("string");ue!==null&&(this.context.registers[ie.substring(1)]=ue);const pe=ar([e,Ms(this.tokens.slice(J,this.index))]);return[new et({type:"text",value:"",verbatimLatex:pe})]}}let b=this.scanMacro(e);if(b)return[b];const L=Qe(e,this.parseMode);if(!L)return this.parseMode==="text"?(/[a-zA-Z]/.test((t=this.peek())!=null?t:"")&&(e+=" "),[...e].map(J=>new et({type:"text",value:J,mode:"text",style:this.style}))):(this.onError({code:"unknown-command",arg:e}),[new Ri(e)]);const N=this.index;if(L.definitionType==="symbol"){const J=l({},this.style);L.variant&&(J.variant=L.variant),b=new et({type:L.type,command:e,style:J,value:String.fromCodePoint(L.codepoint),mode:this.parseMode})}else{if(L.ifMode&&!L.ifMode.includes(this.parseMode))return[];const J=this.parseMode;L.applyMode&&(this.parseMode=L.applyMode);let ie,ue=[];if(L.parse?ue=L.parse(this):[ie,ue]=this.scanArguments(L),this.parseMode=J,L.applyMode&&!L.applyStyle&&!L.createAtom)return de(ue[0]);if(L.infix)return this.onError({code:"too-many-infix-commands",arg:e}),null;if(typeof L.createAtom=="function")b=L.createAtom({command:e,args:ue,style:this.style,mode:this.parseMode}),ie&&(b.body=de(this.scanArgument(ie)));else if(typeof L.applyStyle=="function"){const pe=l(l({},this.style),L.applyStyle(e,ue,this.context)),Ee=this.parseMode;if(L.applyMode&&(this.parseMode=L.applyMode),ie){const De=this.style;this.style=pe;const je=this.scanArgument(ie);return this.style=De,this.parseMode=Ee,de(je)}this.style=pe}else b=new et({type:"mord",command:(r=L.command)!=null?r:e,style:l({},this.style),value:e,mode:(a=L.applyMode)!=null?a:this.parseMode})}if(!b)return null;if(b instanceof et&&b.verbatimLatex===void 0&&!/^\\(llap|rlap|class|cssId|htmlData)$/.test(e)){const J=ar([e,Ms(this.tokens.slice(N,this.index))]);J&&(b.verbatimLatex=J)}if(b.verbatimLatex===null&&(b.verbatimLatex=void 0),b.isFunction&&this.smartFence){const J=this.scanSmartFence();if(J)return[b,J]}return[b]}scanSymbolCommandOrLiteral(){const e=this.get();if(!e)return null;if(Rn(e)){const t=Wi.createAtom(this.parseMode,e,l({},this.style));if(!t)return null;if(t.isFunction&&this.smartFence){const r=this.scanSmartFence();if(r)return[t,r]}return[t]}return e.startsWith("\\")?this.scanSymbolOrCommand(e):e==="<space>"?this.parseMode==="text"?[new ss(" "," ",this.style)]:null:(e==="<}>"?this.onError({latex:"",code:"unbalanced-braces"}):this.onError({latex:"",code:"unexpected-token",arg:e}),null)}scanMacro(e){var t;const r=this.context.getMacro(e);if(!r)return null;const a=this.index,b=r.args,L={"?":(t=this.args)==null?void 0:t.call(this,"?")};for(let N=1;N<=b;N++){let J=this.scanLiteralGroup();if(!J){const ie=this.index;this.scanExpression(),J=Ms(this.tokens.slice(ie,this.index))}L[N]=J}return new pc(e,{expand:r.expand,captureSelection:r.captureSelection,args:a===this.index?null:Ms(this.tokens.slice(a,this.index)),style:this.parsingContext.style,body:ii(r.def,{context:this.context,parseMode:this.parseMode,args:N=>L[N],mathstyle:this.parsingContext.mathstyle,style:this.parsingContext.style})})}parseExpression(){var e,t,r,a;let b=(a=(r=(t=(e=this.scanEnvironment())!=null?e:this.scanModeShift())!=null?t:this.scanModeSet())!=null?r:this.scanGroup())!=null?a:this.scanLeftRight();if(b===null){if(this.parseSupSub()||this.parseLimits())return!0;b=this.scanSymbolCommandOrLiteral()}return b?(Array.isArray(b)?this.mathlist.push(...b):this.mathlist.push(b),!0):!1}};function ii(e,t){var r,a,b,L;const N=(r=t==null?void 0:t.args)!=null?r:void 0,J=new va(ns(e,N),t==null?void 0:t.context,{args:N,mathstyle:(a=t==null?void 0:t.mathstyle)!=null?a:"displaystyle",parseMode:(b=t==null?void 0:t.parseMode)!=null?b:"math",style:(L=t==null?void 0:t.style)!=null?L:{}}),ie=[];for(;!J.end();)ie.push(...J.scan(()=>!1));return ie}function ud(e,t){var r;const a=new va(ns(e,null),t==null?void 0:t.context,{mathstyle:"displaystyle",parseMode:(r=t==null?void 0:t.parseMode)!=null?r:"math"});for(;!a.end();)a.scan();return a.errors}var fd=class Xp extends et{constructor(t,r){super({type:"chem"},{command:t,mode:"math"});const a=dn.go(ht.go(r,t==="\\pu"?"pu":"ce"),!1);this.body=ii(a),this._verbatimLatex=t+"{"+r+"}",this.arg=r,this.captureSelection=!0}static fromJson(t){return new Xp(t.command,t.arg)}set verbatimLatex(t){}get verbatimLatex(){return this._verbatimLatex}toJson(){return h(l({},super.toJson()),{arg:this.arg})}render(t){const r=et.createBox(t,this.body,{type:"inner"});return this.caret&&(r.caret=this.caret),this.bind(t,r)}_serialize(t){return console.assert(this.verbatimLatex!==void 0),this.verbatimLatex}};Ne(["ce","pu"],"{chemformula:balanced-string}",{createAtom:e=>{var t;return new fd(e.command,(t=e.args[0])!=null?t:"")}});var ht={go:function(e,t){if(!e)return[];t===void 0&&(t="ce");var r="0",a={};a.parenthesisLevel=0,e=e.replace(/\n/g," "),e=e.replace(/[\u2212\u2013\u2014\u2010]/g,"-"),e=e.replace(/[\u2026]/g,"...");for(var b,L=10,N=[];;){b!==e?(L=10,b=e):L--;var J=ht.stateMachines[t],ie=J.transitions[r]||J.transitions["*"];e:for(var ue=0;ue<ie.length;ue++){var pe=ht.patterns.match_(ie[ue].pattern,e);if(pe){for(var Ee=ie[ue].task,De=0;De<Ee.action_.length;De++){var je;if(J.actions[Ee.action_[De].type_])je=J.actions[Ee.action_[De].type_](a,pe.match_,Ee.action_[De].option);else if(ht.actions[Ee.action_[De].type_])je=ht.actions[Ee.action_[De].type_](a,pe.match_,Ee.action_[De].option);else throw["MhchemBugA","mhchem bug A. Please report. ("+Ee.action_[De].type_+")"];ht.concatArray(N,je)}if(r=Ee.nextState||r,e.length>0){if(Ee.revisit||(e=pe.remainder),!Ee.toContinue)break e}else return N}}if(L<=0)throw["MhchemBugU","mhchem bug U. Please report."]}},concatArray:function(e,t){if(t)if(Object.prototype.toString.call(t)==="[object Array]")for(var r=0;r<t.length;r++)e.push(t[r]);else e.push(t)},patterns:{patterns:{empty:/^$/,else:/^./,else2:/^./,space:/^\s/,"space A":/^\s(?=[A-Z\\$])/,space$:/^\s$/,"a-z":/^[a-z]/,x:/^x/,x$:/^x$/,i$:/^i$/,letters:/^(?:[a-zA-Z\u03B1-\u03C9\u0391-\u03A9?@]|(?:\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))))+/,"\\greek":/^\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))/,"one lowercase latin letter $":/^(?:([a-z])(?:$|[^a-zA-Z]))$/,"$one lowercase latin letter$ $":/^\$(?:([a-z])(?:$|[^a-zA-Z]))\$$/,"one lowercase greek letter $":/^(?:\$?[\u03B1-\u03C9]\$?|\$?\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega)\s*\$?)(?:\s+|\{\}|(?![a-zA-Z]))$/,digits:/^[0-9]+/,"-9.,9":/^[+\-]?(?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))/,"-9.,9 no missing 0":/^[+\-]?[0-9]+(?:[.,][0-9]+)?/,"(-)(9.,9)(e)(99)":function(e){var t=e.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))?(\((?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))\))?(?:(?:([eE])|\s*(\*|x|\\times|\u00D7)\s*10\^)([+\-]?[0-9]+|\{[+\-]?[0-9]+\}))?/);return t&&t[0]?{match_:t.slice(1),remainder:e.substr(t[0].length)}:null},"(-)(9)^(-9)":function(e){var t=e.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\^([+\-]?[0-9]+|\{[+\-]?[0-9]+\})/);return t&&t[0]?{match_:t.slice(1),remainder:e.substr(t[0].length)}:null},"state of aggregation $":function(e){var t=ht.patterns.findObserveGroups(e,"",/^\([a-z]{1,3}(?=[\),])/,")","");if(t&&t.remainder.match(/^($|[\s,;\)\]\}])/))return t;var r=e.match(/^(?:\((?:\\ca\s?)?\$[amothc]\$\))/);return r?{match_:r[0],remainder:e.substr(r[0].length)}:null},"_{(state of aggregation)}$":/^_\{(\([a-z]{1,3}\))\}/,"{[(":/^(?:\\\{|\[|\()/,")]}":/^(?:\)|\]|\\\})/,", ":/^[,;]\s*/,",":/^[,;]/,".":/^[.]/,". ":/^([.\u22C5\u00B7\u2022])\s*/,"...":/^\.\.\.(?=$|[^.])/,"* ":/^([*])\s*/,"^{(...)}":function(e){return ht.patterns.findObserveGroups(e,"^{","","","}")},"^($...$)":function(e){return ht.patterns.findObserveGroups(e,"^","$","$","")},"^a":/^\^([0-9]+|[^\\_])/,"^\\x{}{}":function(e){return ht.patterns.findObserveGroups(e,"^",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"^\\x{}":function(e){return ht.patterns.findObserveGroups(e,"^",/^\\[a-zA-Z]+\{/,"}","")},"^\\x":/^\^(\\[a-zA-Z]+)\s*/,"^(-1)":/^\^(-?\d+)/,"'":/^'/,"_{(...)}":function(e){return ht.patterns.findObserveGroups(e,"_{","","","}")},"_($...$)":function(e){return ht.patterns.findObserveGroups(e,"_","$","$","")},_9:/^_([+\-]?[0-9]+|[^\\])/,"_\\x{}{}":function(e){return ht.patterns.findObserveGroups(e,"_",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"_\\x{}":function(e){return ht.patterns.findObserveGroups(e,"_",/^\\[a-zA-Z]+\{/,"}","")},"_\\x":/^_(\\[a-zA-Z]+)\s*/,"^_":/^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,"{}":/^\{\}/,"{...}":function(e){return ht.patterns.findObserveGroups(e,"","{","}","")},"{(...)}":function(e){return ht.patterns.findObserveGroups(e,"{","","","}")},"$...$":function(e){return ht.patterns.findObserveGroups(e,"","$","$","")},"${(...)}$":function(e){return ht.patterns.findObserveGroups(e,"${","","","}$")},"$(...)$":function(e){return ht.patterns.findObserveGroups(e,"$","","","$")},"=<>":/^[=<>]/,"#":/^[#\u2261]/,"+":/^\+/,"-$":/^-(?=[\s_},;\]/]|$|\([a-z]+\))/,"-9":/^-(?=[0-9])/,"- orbital overlap":/^-(?=(?:[spd]|sp)(?:$|[\s,;\)\]\}]))/,"-":/^-/,"pm-operator":/^(?:\\pm|\$\\pm\$|\+-|\+\/-)/,operator:/^(?:\+|(?:[\-=<>]|<<|>>|\\approx|\$\\approx\$)(?=\s|$|-?[0-9]))/,arrowUpDown:/^(?:v|\(v\)|\^|\(\^\))(?=$|[\s,;\)\]\}])/,"\\bond{(...)}":function(e){return ht.patterns.findObserveGroups(e,"\\bond{","","","}")},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,CMT:/^[CMT](?=\[)/,"[(...)]":function(e){return ht.patterns.findObserveGroups(e,"[","","","]")},"1st-level escape":/^(&|\\\\|\\hline)\s*/,"\\,":/^(?:\\[,\ ;:])/,"\\x{}{}":function(e){return ht.patterns.findObserveGroups(e,"",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"\\x{}":function(e){return ht.patterns.findObserveGroups(e,"",/^\\[a-zA-Z]+\{/,"}","")},"\\ca":/^\\ca(?:\s+|(?![a-zA-Z]))/,"\\x":/^(?:\\[a-zA-Z]+\s*|\\[_&{}%])/,orbital:/^(?:[0-9]{1,2}[spdfgh]|[0-9]{0,2}sp)(?=$|[^a-zA-Z])/,others:/^[\/~|]/,"\\frac{(...)}":function(e){return ht.patterns.findObserveGroups(e,"\\frac{","","","}","{","","","}")},"\\overset{(...)}":function(e){return ht.patterns.findObserveGroups(e,"\\overset{","","","}","{","","","}")},"\\underset{(...)}":function(e){return ht.patterns.findObserveGroups(e,"\\underset{","","","}","{","","","}")},"\\underbrace{(...)}":function(e){return ht.patterns.findObserveGroups(e,"\\underbrace{","","","}_","{","","","}")},"\\color{(...)}0":function(e){return ht.patterns.findObserveGroups(e,"\\color{","","","}")},"\\color{(...)}{(...)}1":function(e){return ht.patterns.findObserveGroups(e,"\\color{","","","}","{","","","}")},"\\color(...){(...)}2":function(e){return ht.patterns.findObserveGroups(e,"\\color","\\","",/^(?=\{)/,"{","","","}")},"\\ce{(...)}":function(e){return ht.patterns.findObserveGroups(e,"\\ce{","","","}")},oxidation$:/^(?:[+-][IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"d-oxidation$":/^(?:[+-]?\s?[IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"roman numeral":/^[IVX]+/,"1/2$":/^[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+(?:\$[a-z]\$|[a-z])?$/,amount:function(e){var t;if(t=e.match(/^(?:(?:(?:\([+\-]?[0-9]+\/[0-9]+\)|[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+|[+\-]?[0-9]+[.,][0-9]+|[+\-]?\.[0-9]+|[+\-]?[0-9]+)(?:[a-z](?=\s*[A-Z]))?)|[+\-]?[a-z](?=\s*[A-Z])|\+(?!\s))/),t)return{match_:t[0],remainder:e.substr(t[0].length)};var r=ht.patterns.findObserveGroups(e,"","$","$","");return r&&(t=r.match_.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/),t)?{match_:t[0],remainder:e.substr(t[0].length)}:null},amount2:function(e){return this.amount(e)},"(KV letters),":/^(?:[A-Z][a-z]{0,2}|i)(?=,)/,formula$:function(e){if(e.match(/^\([a-z]+\)$/))return null;var t=e.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);return t?{match_:t[0],remainder:e.substr(t[0].length)}:null},uprightEntities:/^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,"/":/^\s*(\/)\s*/,"//":/^\s*(\/\/)\s*/,"*":/^\s*[*.]\s*/},findObserveGroups:function(e,t,r,a,b,L,N,J,ie,ue){var pe=function(Xe,ot){if(typeof ot=="string")return Xe.indexOf(ot)!==0?null:ot;var gt=Xe.match(ot);return gt?gt[0]:null},Ee=function(Xe,ot,gt){for(var ct=0;ot<Xe.length;){var Dt=Xe.charAt(ot),Bt=pe(Xe.substr(ot),gt);if(Bt!==null&&ct===0)return{endMatchBegin:ot,endMatchEnd:ot+Bt.length};if(Dt==="{")ct++;else if(Dt==="}"){if(ct===0)throw["ExtraCloseMissingOpen","Extra close brace or missing open brace"];ct--}ot++}return ct>0,null},De=pe(e,t);if(De===null||(e=e.substr(De.length),De=pe(e,r),De===null))return null;var je=Ee(e,De.length,a||b);if(je===null)return null;var ze=e.substring(0,a?je.endMatchEnd:je.endMatchBegin);if(L||N){var Je=this.findObserveGroups(e.substr(je.endMatchEnd),L,N,J,ie);if(Je===null)return null;var pt=[ze,Je.match_];return{match_:ue?pt.join(""):pt,remainder:Je.remainder}}else return{match_:ze,remainder:e.substr(je.endMatchEnd)}},match_:function(e,t){var r=ht.patterns.patterns[e];if(r===void 0)throw["MhchemBugP","mhchem bug P. Please report. ("+e+")"];if(typeof r=="function")return ht.patterns.patterns[e](t);var a=t.match(r);if(a){var b;return a[2]?b=[a[1],a[2]]:a[1]?b=a[1]:b=a[0],{match_:b,remainder:t.substr(a[0].length)}}return null}},actions:{"a=":function(e,t){e.a=(e.a||"")+t},"b=":function(e,t){e.b=(e.b||"")+t},"p=":function(e,t){e.p=(e.p||"")+t},"o=":function(e,t){e.o=(e.o||"")+t},"q=":function(e,t){e.q=(e.q||"")+t},"d=":function(e,t){e.d=(e.d||"")+t},"rm=":function(e,t){e.rm=(e.rm||"")+t},"text=":function(e,t){e.text_=(e.text_||"")+t},insert:function(e,t,r){return{type_:r}},"insert+p1":function(e,t,r){return{type_:r,p1:t}},"insert+p1+p2":function(e,t,r){return{type_:r,p1:t[0],p2:t[1]}},copy:function(e,t){return t},rm:function(e,t){return{type_:"rm",p1:t||""}},text:function(e,t){return ht.go(t,"text")},"{text}":function(e,t){var r=["{"];return ht.concatArray(r,ht.go(t,"text")),r.push("}"),r},"tex-math":function(e,t){return ht.go(t,"tex-math")},"tex-math tight":function(e,t){return ht.go(t,"tex-math tight")},bond:function(e,t,r){return{type_:"bond",kind_:r||t}},"color0-output":function(e,t){return{type_:"color0",color:t[0]}},ce:function(e,t){return ht.go(t)},"1/2":function(e,t){var r=[];t.match(/^[+\-]/)&&(r.push(t.substr(0,1)),t=t.substr(1));var a=t.match(/^([0-9]+|\$[a-z]\$|[a-z])\/([0-9]+)(\$[a-z]\$|[a-z])?$/);return a[1]=a[1].replace(/\$/g,""),r.push({type_:"frac",p1:a[1],p2:a[2]}),a[3]&&(a[3]=a[3].replace(/\$/g,""),r.push({type_:"tex-math",p1:a[3]})),r},"9,9":function(e,t){return ht.go(t,"9,9")}},createTransitions:function(e){var t,r,a,b,L={};for(t in e)for(r in e[t])for(a=r.split("|"),e[t][r].stateArray=a,b=0;b<a.length;b++)L[a[b]]=[];for(t in e)for(r in e[t])for(a=e[t][r].stateArray||[],b=0;b<a.length;b++){var N=e[t][r];if(N.action_){N.action_=[].concat(N.action_);for(var J=0;J<N.action_.length;J++)typeof N.action_[J]=="string"&&(N.action_[J]={type_:N.action_[J]})}else N.action_=[];for(var ie=t.split("|"),ue=0;ue<ie.length;ue++)if(a[b]==="*")for(var pe in L)L[pe].push({pattern:ie[ue],task:N});else L[a[b]].push({pattern:ie[ue],task:N})}return L},stateMachines:{}};ht.stateMachines={ce:{transitions:ht.createTransitions({empty:{"*":{action_:"output"}},else:{"0|1|2":{action_:"beginsWithBond=false",revisit:!0,toContinue:!0}},oxidation$:{0:{action_:"oxidation-output"}},CMT:{r:{action_:"rdt=",nextState:"rt"},rd:{action_:"rqt=",nextState:"rdt"}},arrowUpDown:{"0|1|2|as":{action_:["sb=false","output","operator"],nextState:"1"}},uprightEntities:{"0|1|2":{action_:["o=","output"],nextState:"1"}},orbital:{"0|1|2|3":{action_:"o=",nextState:"o"}},"->":{"0|1|2|3":{action_:"r=",nextState:"r"},"a|as":{action_:["output","r="],nextState:"r"},"*":{action_:["output","r="],nextState:"r"}},"+":{o:{action_:"d= kv",nextState:"d"},"d|D":{action_:"d=",nextState:"d"},q:{action_:"d=",nextState:"qd"},"qd|qD":{action_:"d=",nextState:"qd"},dq:{action_:["output","d="],nextState:"d"},3:{action_:["sb=false","output","operator"],nextState:"0"}},amount:{"0|2":{action_:"a=",nextState:"a"}},"pm-operator":{"0|1|2|a|as":{action_:["sb=false","output",{type_:"operator",option:"\\pm"}],nextState:"0"}},operator:{"0|1|2|a|as":{action_:["sb=false","output","operator"],nextState:"0"}},"-$":{"o|q":{action_:["charge or bond","output"],nextState:"qd"},d:{action_:"d=",nextState:"d"},D:{action_:["output",{type_:"bond",option:"-"}],nextState:"3"},q:{action_:"d=",nextState:"qd"},qd:{action_:"d=",nextState:"qd"},"qD|dq":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},"-9":{"3|o":{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"3"}},"- orbital overlap":{o:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},d:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"}},"-":{"0|1|2":{action_:[{type_:"output",option:1},"beginsWithBond=true",{type_:"bond",option:"-"}],nextState:"3"},3:{action_:{type_:"bond",option:"-"}},a:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},as:{action_:[{type_:"output",option:2},{type_:"bond",option:"-"}],nextState:"3"},b:{action_:"b="},o:{action_:{type_:"- after o/d",option:!1},nextState:"2"},q:{action_:{type_:"- after o/d",option:!1},nextState:"2"},"d|qd|dq":{action_:{type_:"- after o/d",option:!0},nextState:"2"},"D|qD|p":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},amount2:{"1|3":{action_:"a=",nextState:"a"}},letters:{"0|1|2|3|a|as|b|p|bp|o":{action_:"o=",nextState:"o"},"q|dq":{action_:["output","o="],nextState:"o"},"d|D|qd|qD":{action_:"o after d",nextState:"o"}},digits:{o:{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},q:{action_:["output","o="],nextState:"o"},a:{action_:"o=",nextState:"o"}},"space A":{"b|p|bp":{}},space:{a:{nextState:"as"},0:{action_:"sb=false"},"1|2":{action_:"sb=true"},"r|rt|rd|rdt|rdq":{action_:"output",nextState:"0"},"*":{action_:["output","sb=true"],nextState:"1"}},"1st-level escape":{"1|2":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}]},"*":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}],nextState:"0"}},"[(...)]":{"r|rt":{action_:"rd=",nextState:"rd"},"rd|rdt":{action_:"rq=",nextState:"rdq"}},"...":{"o|d|D|dq|qd|qD":{action_:["output",{type_:"bond",option:"..."}],nextState:"3"},"*":{action_:[{type_:"output",option:1},{type_:"insert",option:"ellipsis"}],nextState:"1"}},". |* ":{"*":{action_:["output",{type_:"insert",option:"addition compound"}],nextState:"1"}},"state of aggregation $":{"*":{action_:["output","state of aggregation"],nextState:"1"}},"{[(":{"a|as|o":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"0|1|2|3":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"*":{action_:["output","o=","output","parenthesisLevel++"],nextState:"2"}},")]}":{"0|1|2|3|b|p|bp|o":{action_:["o=","parenthesisLevel--"],nextState:"o"},"a|as|d|D|q|qd|qD|dq":{action_:["output","o=","parenthesisLevel--"],nextState:"o"}},", ":{"*":{action_:["output","comma"],nextState:"0"}},"^_":{"*":{}},"^{(...)}|^($...$)":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"D"},q:{action_:"d=",nextState:"qD"},"d|D|qd|qD|dq":{action_:["output","d="],nextState:"D"}},"^a|^\\x{}{}|^\\x{}|^\\x|'":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"d"},q:{action_:"d=",nextState:"qd"},"d|qd|D|qD":{action_:"d="},dq:{action_:["output","d="],nextState:"d"}},"_{(state of aggregation)}$":{"d|D|q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"_{(...)}|_($...$)|_9|_\\x{}{}|_\\x{}|_\\x":{"0|1|2|as":{action_:"p=",nextState:"p"},b:{action_:"p=",nextState:"bp"},"3|o":{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},"q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"=<>":{"0|1|2|3|a|as|o|q|d|D|qd|qD|dq":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"#":{"0|1|2|3|a|as|o":{action_:[{type_:"output",option:2},{type_:"bond",option:"#"}],nextState:"3"}},"{}":{"*":{action_:{type_:"output",option:1},nextState:"1"}},"{...}":{"0|1|2|3|a|as|b|p|bp":{action_:"o=",nextState:"o"},"o|d|D|q|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"$...$":{a:{action_:"a="},"0|1|2|3|as|b|p|bp|o":{action_:"o=",nextState:"o"},"as|o":{action_:"o="},"q|d|D|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"\\bond{(...)}":{"*":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"\\frac{(...)}":{"*":{action_:[{type_:"output",option:1},"frac-output"],nextState:"3"}},"\\overset{(...)}":{"*":{action_:[{type_:"output",option:2},"overset-output"],nextState:"3"}},"\\underset{(...)}":{"*":{action_:[{type_:"output",option:2},"underset-output"],nextState:"3"}},"\\underbrace{(...)}":{"*":{action_:[{type_:"output",option:2},"underbrace-output"],nextState:"3"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:[{type_:"output",option:2},"color-output"],nextState:"3"}},"\\color{(...)}0":{"*":{action_:[{type_:"output",option:2},"color0-output"]}},"\\ce{(...)}":{"*":{action_:[{type_:"output",option:2},"ce"],nextState:"3"}},"\\,":{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"1"}},"\\x{}{}|\\x{}|\\x":{"0|1|2|3|a|as|b|p|bp|o|c0":{action_:["o=","output"],nextState:"3"},"*":{action_:["output","o=","output"],nextState:"3"}},others:{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"3"}},else2:{a:{action_:"a to o",nextState:"o",revisit:!0},as:{action_:["output","sb=true"],nextState:"1",revisit:!0},"r|rt|rd|rdt|rdq":{action_:["output"],nextState:"0",revisit:!0},"*":{action_:["output","copy"],nextState:"3"}}}),actions:{"o after d":function(e,t){var r;if((e.d||"").match(/^[0-9]+$/)){var a=e.d;e.d=void 0,r=this.output(e),e.b=a}else r=this.output(e);return ht.actions["o="](e,t),r},"d= kv":function(e,t){e.d=t,e.dType="kv"},"charge or bond":function(e,t){if(e.beginsWithBond){var r=[];return ht.concatArray(r,this.output(e)),ht.concatArray(r,ht.actions.bond(e,t,"-")),r}else e.d=t},"- after o/d":function(e,t,r){var a=ht.patterns.match_("orbital",e.o||""),b=ht.patterns.match_("one lowercase greek letter $",e.o||""),L=ht.patterns.match_("one lowercase latin letter $",e.o||""),N=ht.patterns.match_("$one lowercase latin letter$ $",e.o||""),J=t==="-"&&(a&&a.remainder===""||b||L||N);J&&!e.a&&!e.b&&!e.p&&!e.d&&!e.q&&!a&&L&&(e.o="$"+e.o+"$");var ie=[];return J?(ht.concatArray(ie,this.output(e)),ie.push({type_:"hyphen"})):(a=ht.patterns.match_("digits",e.d||""),r&&a&&a.remainder===""?(ht.concatArray(ie,ht.actions["d="](e,t)),ht.concatArray(ie,this.output(e))):(ht.concatArray(ie,this.output(e)),ht.concatArray(ie,ht.actions.bond(e,t,"-")))),ie},"a to o":function(e){e.o=e.a,e.a=void 0},"sb=true":function(e){e.sb=!0},"sb=false":function(e){e.sb=!1},"beginsWithBond=true":function(e){e.beginsWithBond=!0},"beginsWithBond=false":function(e){e.beginsWithBond=!1},"parenthesisLevel++":function(e){e.parenthesisLevel++},"parenthesisLevel--":function(e){e.parenthesisLevel--},"state of aggregation":function(e,t){return{type_:"state of aggregation",p1:ht.go(t,"o")}},comma:function(e,t){var r=t.replace(/\s*$/,""),a=r!==t;return a&&e.parenthesisLevel===0?{type_:"comma enumeration L",p1:r}:{type_:"comma enumeration M",p1:r}},output:function(e,t,r){var a;if(!e.r)a=[],!e.a&&!e.b&&!e.p&&!e.o&&!e.q&&!e.d&&!r||(e.sb&&a.push({type_:"entitySkip"}),!e.o&&!e.q&&!e.d&&!e.b&&!e.p&&r!==2?(e.o=e.a,e.a=void 0):!e.o&&!e.q&&!e.d&&(e.b||e.p)?(e.o=e.a,e.d=e.b,e.q=e.p,e.a=e.b=e.p=void 0):e.o&&e.dType==="kv"&&ht.patterns.match_("d-oxidation$",e.d||"")?e.dType="oxidation":e.o&&e.dType==="kv"&&!e.q&&(e.dType=void 0),a.push({type_:"chemfive",a:ht.go(e.a,"a"),b:ht.go(e.b,"bd"),p:ht.go(e.p,"pq"),o:ht.go(e.o,"o"),q:ht.go(e.q,"pq"),d:ht.go(e.d,e.dType==="oxidation"?"oxidation":"bd"),dType:e.dType}));else{var b;e.rdt==="M"?b=ht.go(e.rd,"tex-math"):e.rdt==="T"?b=[{type_:"text",p1:e.rd||""}]:b=ht.go(e.rd);var L;e.rqt==="M"?L=ht.go(e.rq,"tex-math"):e.rqt==="T"?L=[{type_:"text",p1:e.rq||""}]:L=ht.go(e.rq),a={type_:"arrow",r:e.r,rd:b,rq:L}}for(var N in e)N!=="parenthesisLevel"&&N!=="beginsWithBond"&&delete e[N];return a},"oxidation-output":function(e,t){var r=["{"];return ht.concatArray(r,ht.go(t,"oxidation")),r.push("}"),r},"frac-output":function(e,t){return{type_:"frac-ce",p1:ht.go(t[0]),p2:ht.go(t[1])}},"overset-output":function(e,t){return{type_:"overset",p1:ht.go(t[0]),p2:ht.go(t[1])}},"underset-output":function(e,t){return{type_:"underset",p1:ht.go(t[0]),p2:ht.go(t[1])}},"underbrace-output":function(e,t){return{type_:"underbrace",p1:ht.go(t[0]),p2:ht.go(t[1])}},"color-output":function(e,t){return{type_:"color",color1:t[0],color2:ht.go(t[1])}},"r=":function(e,t){e.r=t},"rdt=":function(e,t){e.rdt=t},"rd=":function(e,t){e.rd=t},"rqt=":function(e,t){e.rqt=t},"rq=":function(e,t){e.rq=t},operator:function(e,t,r){return{type_:"operator",kind_:r||t}}}},a:{transitions:ht.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},"$(...)$":{"*":{action_:"tex-math tight",nextState:"1"}},",":{"*":{action_:{type_:"insert",option:"commaDecimal"}}},else2:{"*":{action_:"copy"}}}),actions:{}},o:{transitions:ht.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},letters:{"*":{action_:"rm"}},"\\ca":{"*":{action_:{type_:"insert",option:"circa"}}},"\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"{text}"}},else2:{"*":{action_:"copy"}}}),actions:{}},text:{transitions:ht.createTransitions({empty:{"*":{action_:"output"}},"{...}":{"*":{action_:"text="}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"\\greek":{"*":{action_:["output","rm"]}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:["output","copy"]}},else:{"*":{action_:"text="}}}),actions:{output:function(e){if(e.text_){var t={type_:"text",p1:e.text_};for(var r in e)delete e[r];return t}}}},pq:{transitions:ht.createTransitions({empty:{"*":{}},"state of aggregation $":{"*":{action_:"state of aggregation"}},i$:{0:{nextState:"!f",revisit:!0}},"(KV letters),":{0:{action_:"rm",nextState:"0"}},formula$:{0:{nextState:"f",revisit:!0}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"!f",revisit:!0}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"a-z":{f:{action_:"tex-math"}},letters:{"*":{action_:"rm"}},"-9.,9":{"*":{action_:"9,9"}},",":{"*":{action_:{type_:"insert+p1",option:"comma enumeration S"}}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"state of aggregation":function(e,t){return{type_:"state of aggregation subscript",p1:ht.go(t,"o")}},"color-output":function(e,t){return{type_:"color",color1:t[0],color2:ht.go(t[1],"pq")}}}},bd:{transitions:ht.createTransitions({empty:{"*":{}},x$:{0:{nextState:"!f",revisit:!0}},formula$:{0:{nextState:"f",revisit:!0}},else:{0:{nextState:"!f",revisit:!0}},"-9.,9 no missing 0":{"*":{action_:"9,9"}},".":{"*":{action_:{type_:"insert",option:"electron dot"}}},"a-z":{f:{action_:"tex-math"}},x:{"*":{action_:{type_:"insert",option:"KV x"}}},letters:{"*":{action_:"rm"}},"'":{"*":{action_:{type_:"insert",option:"prime"}}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"color-output":function(e,t){return{type_:"color",color1:t[0],color2:ht.go(t[1],"bd")}}}},oxidation:{transitions:ht.createTransitions({empty:{"*":{}},"roman numeral":{"*":{action_:"roman-numeral"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},else:{"*":{action_:"copy"}}}),actions:{"roman-numeral":function(e,t){return{type_:"roman numeral",p1:t||""}}}},"tex-math":{transitions:ht.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},else:{"*":{action_:"o="}}}),actions:{output:function(e){if(e.o){var t={type_:"tex-math",p1:e.o};for(var r in e)delete e[r];return t}}}},"tex-math tight":{transitions:ht.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},"-|+":{"*":{action_:"tight operator"}},else:{"*":{action_:"o="}}}),actions:{"tight operator":function(e,t){e.o=(e.o||"")+"{"+t+"}"},output:function(e){if(e.o){var t={type_:"tex-math",p1:e.o};for(var r in e)delete e[r];return t}}}},"9,9":{transitions:ht.createTransitions({empty:{"*":{}},",":{"*":{action_:"comma"}},else:{"*":{action_:"copy"}}}),actions:{comma:function(){return{type_:"commaDecimal"}}}},pu:{transitions:ht.createTransitions({empty:{"*":{action_:"output"}},space$:{"*":{action_:["output","space"]}},"{[(|)]}":{"0|a":{action_:"copy"}},"(-)(9)^(-9)":{0:{action_:"number^",nextState:"a"}},"(-)(9.,9)(e)(99)":{0:{action_:"enumber",nextState:"a"}},space:{"0|a":{}},"pm-operator":{"0|a":{action_:{type_:"operator",option:"\\pm"},nextState:"0"}},operator:{"0|a":{action_:"copy",nextState:"0"}},"//":{d:{action_:"o=",nextState:"/"}},"/":{d:{action_:"o=",nextState:"/"}},"{...}|else":{"0|d":{action_:"d=",nextState:"d"},a:{action_:["space","d="],nextState:"d"},"/|q":{action_:"q=",nextState:"q"}}}),actions:{enumber:function(e,t){var r=[];return t[0]==="+-"||t[0]==="+/-"?r.push("\\pm "):t[0]&&r.push(t[0]),t[1]&&(ht.concatArray(r,ht.go(t[1],"pu-9,9")),t[2]&&(t[2].match(/[,.]/)?ht.concatArray(r,ht.go(t[2],"pu-9,9")):r.push(t[2])),(t[3]||t[4])&&(t[3]==="e"||t[4]==="*"?r.push({type_:"cdot"}):r.push({type_:"times"}))),t[5]&&r.push("10^{"+t[5]+"}"),r},"number^":function(e,t){var r=[];return t[0]==="+-"||t[0]==="+/-"?r.push("\\pm "):t[0]&&r.push(t[0]),ht.concatArray(r,ht.go(t[1],"pu-9,9")),r.push("^{"+t[2]+"}"),r},operator:function(e,t,r){return{type_:"operator",kind_:r||t}},space:function(){return{type_:"pu-space-1"}},output:function(e){var t,r=ht.patterns.match_("{(...)}",e.d||"");r&&r.remainder===""&&(e.d=r.match_);var a=ht.patterns.match_("{(...)}",e.q||"");if(a&&a.remainder===""&&(e.q=a.match_),e.d&&(e.d=e.d.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),e.d=e.d.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F")),e.q){e.q=e.q.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),e.q=e.q.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F");var b={d:ht.go(e.d,"pu"),q:ht.go(e.q,"pu")};e.o==="//"?t={type_:"pu-frac",p1:b.d,p2:b.q}:(t=b.d,b.d.length>1||b.q.length>1?t.push({type_:" / "}):t.push({type_:"/"}),ht.concatArray(t,b.q))}else t=ht.go(e.d,"pu-2");for(var L in e)delete e[L];return t}}},"pu-2":{transitions:ht.createTransitions({empty:{"*":{action_:"output"}},"*":{"*":{action_:["output","cdot"],nextState:"0"}},"\\x":{"*":{action_:"rm="}},space:{"*":{action_:["output","space"],nextState:"0"}},"^{(...)}|^(-1)":{1:{action_:"^(-1)"}},"-9.,9":{0:{action_:"rm=",nextState:"0"},1:{action_:"^(-1)",nextState:"0"}},"{...}|else":{"*":{action_:"rm=",nextState:"1"}}}),actions:{cdot:function(){return{type_:"tight cdot"}},"^(-1)":function(e,t){e.rm+="^{"+t+"}"},space:function(){return{type_:"pu-space-2"}},output:function(e){var t=[];if(e.rm){var r=ht.patterns.match_("{(...)}",e.rm||"");r&&r.remainder===""?t=ht.go(r.match_,"pu"):t={type_:"rm",p1:e.rm}}for(var a in e)delete e[a];return t}}},"pu-9,9":{transitions:ht.createTransitions({empty:{0:{action_:"output-0"},o:{action_:"output-o"}},",":{0:{action_:["output-0","comma"],nextState:"o"}},".":{0:{action_:["output-0","copy"],nextState:"o"}},else:{"*":{action_:"text="}}}),actions:{comma:function(){return{type_:"commaDecimal"}},"output-0":function(e){var t=[];if(e.text_=e.text_||"",e.text_.length>4){var r=e.text_.length%3;r===0&&(r=3);for(var a=e.text_.length-3;a>0;a-=3)t.push(e.text_.substr(a,3)),t.push({type_:"1000 separator"});t.push(e.text_.substr(0,r)),t.reverse()}else t.push(e.text_);for(var b in e)delete e[b];return t},"output-o":function(e){var t=[];if(e.text_=e.text_||"",e.text_.length>4){for(var r=e.text_.length-3,a=0;a<r;a+=3)t.push(e.text_.substr(a,3)),t.push({type_:"1000 separator"});t.push(e.text_.substr(a))}else t.push(e.text_);for(var b in e)delete e[b];return t}}}};var dn={go:function(e,t){if(!e)return"";for(var r="",a=!1,b=0;b<e.length;b++){var L=e[b];typeof L=="string"?r+=L:(r+=dn._go2(L),L.type_==="1st-level escape"&&(a=!0))}return!t&&!a&&r&&(r="{"+r+"}"),r},_goInner:function(e){return e&&dn.go(e,!0)},_go2:function(e){var t;switch(e.type_){case"chemfive":t="";var r={a:dn._goInner(e.a),b:dn._goInner(e.b),p:dn._goInner(e.p),o:dn._goInner(e.o),q:dn._goInner(e.q),d:dn._goInner(e.d)};r.a&&(r.a.match(/^[+\-]/)&&(r.a="{"+r.a+"}"),t+=r.a+"\\,"),(r.b||r.p)&&(t+="{\\vphantom{X}}",t+="^{\\hphantom{"+(r.b||"")+"}}_{\\hphantom{"+(r.p||"")+"}}",t+="{\\vphantom{X}}",t+="^{\\smash[t]{\\vphantom{2}}\\llap{"+(r.b||"")+"}}",t+="_{\\vphantom{2}\\llap{\\smash[t]{"+(r.p||"")+"}}}"),r.o&&(r.o.match(/^[+\-]/)&&(r.o="{"+r.o+"}"),t+=r.o),e.dType==="kv"?((r.d||r.q)&&(t+="{\\vphantom{X}}"),r.d&&(t+="^{"+r.d+"}"),r.q&&(t+="_{\\smash[t]{"+r.q+"}}")):e.dType==="oxidation"?(r.d&&(t+="{\\vphantom{X}}",t+="^{"+r.d+"}"),r.q&&(t+="{\\vphantom{X}}",t+="_{\\smash[t]{"+r.q+"}}")):(r.q&&(t+="{\\vphantom{X}}",t+="_{\\smash[t]{"+r.q+"}}"),r.d&&(t+="{\\vphantom{X}}",t+="^{"+r.d+"}"));break;case"rm":t="\\mathrm{"+e.p1+"}";break;case"text":e.p1.match(/[\^_]/)?(e.p1=e.p1.replace(" ","~").replace("-","\\text{-}"),t="\\mathrm{"+e.p1+"}"):t="\\text{"+e.p1+"}";break;case"roman numeral":t="\\mathrm{"+e.p1+"}";break;case"state of aggregation":t="\\mskip2mu "+dn._goInner(e.p1);break;case"state of aggregation subscript":t="\\mskip1mu "+dn._goInner(e.p1);break;case"bond":if(t=dn._getBond(e.kind_),!t)throw["MhchemErrorBond","mhchem Error. Unknown bond type ("+e.kind_+")"];break;case"frac":var a="\\frac{"+e.p1+"}{"+e.p2+"}";t="\\mathchoice{\\textstyle"+a+"}{"+a+"}{"+a+"}{"+a+"}";break;case"pu-frac":var b="\\frac{"+dn._goInner(e.p1)+"}{"+dn._goInner(e.p2)+"}";t="\\mathchoice{\\textstyle"+b+"}{"+b+"}{"+b+"}{"+b+"}";break;case"tex-math":t=e.p1+" ";break;case"frac-ce":t="\\frac{"+dn._goInner(e.p1)+"}{"+dn._goInner(e.p2)+"}";break;case"overset":t="\\overset{"+dn._goInner(e.p1)+"}{"+dn._goInner(e.p2)+"}";break;case"underset":t="\\underset{"+dn._goInner(e.p1)+"}{"+dn._goInner(e.p2)+"}";break;case"underbrace":t="\\underbrace{"+dn._goInner(e.p1)+"}_{"+dn._goInner(e.p2)+"}";break;case"color":t="{\\color{"+e.color1+"}{"+dn._goInner(e.color2)+"}}";break;case"color0":t="\\color{"+e.color+"}";break;case"arrow":var L={rd:dn._goInner(e.rd),rq:dn._goInner(e.rq)},N=dn._getArrow(e.r);L.rd||L.rq?e.r==="<=>"||e.r==="<=>>"||e.r==="<<=>"||e.r==="<-->"?(N="\\long"+N,L.rd&&(N="\\overset{"+L.rd+"}{"+N+"}"),L.rq&&(e.r==="<-->"?N="\\underset{\\lower2mu{"+L.rq+"}}{"+N+"}":N="\\underset{\\lower6mu{"+L.rq+"}}{"+N+"}"),N=" {}\\mathrel{"+N+"}{} "):(L.rq&&(N+="[{"+L.rq+"}]"),N+="{"+L.rd+"}",N=" {}\\mathrel{\\x"+N+"}{} "):N=" {}\\mathrel{\\long"+N+"}{} ",t=N;break;case"operator":t=dn._getOperator(e.kind_);break;case"1st-level escape":t=e.p1+" ";break;case"space":t=" ";break;case"entitySkip":t="~";break;case"pu-space-1":t="~";break;case"pu-space-2":t="\\mkern3mu ";break;case"1000 separator":t="\\mkern2mu ";break;case"commaDecimal":t="{,}";break;case"comma enumeration L":t="{"+e.p1+"}\\mkern6mu ";break;case"comma enumeration M":t="{"+e.p1+"}\\mkern3mu ";break;case"comma enumeration S":t="{"+e.p1+"}\\mkern1mu ";break;case"hyphen":t="\\text{-}";break;case"addition compound":t="\\,{\\cdot}\\,";break;case"electron dot":t="\\mkern1mu \\bullet\\mkern1mu ";break;case"KV x":t="{\\times}";break;case"prime":t="\\prime ";break;case"cdot":t="\\cdot ";break;case"tight cdot":t="\\mkern1mu{\\cdot}\\mkern1mu ";break;case"times":t="\\times ";break;case"circa":t="{\\sim}";break;case"^":t="uparrow";break;case"v":t="downarrow";break;case"ellipsis":t="\\ldots ";break;case"/":t="/";break;case" / ":t="\\,/\\,";break;default:throw["MhchemBugT","mhchem bug T. Please report."]}return t},_getArrow:function(e){switch(e){case"->":return"rightarrow";case"\u2192":return"rightarrow";case"\u27F6":return"rightarrow";case"<-":return"leftarrow";case"<->":return"leftrightarrow";case"<-->":return"leftrightarrows";case"<=>":return"rightleftharpoons";case"\u21CC":return"rightleftharpoons";case"<=>>":return"Rightleftharpoons";case"<<=>":return"Leftrightharpoons";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getBond:function(e){switch(e){case"-":return"{-}";case"1":return"{-}";case"=":return"{=}";case"2":return"{=}";case"#":return"{\\equiv}";case"3":return"{\\equiv}";case"~":return"{\\tripledash}";case"~-":return"{\\rlap{\\lower.1em{-}}\\raise.1em{\\tripledash}}";case"~=":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{\\tripledash}}-}";case"~--":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{\\tripledash}}-}";case"-~-":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{-}}\\tripledash}";case"...":return"{{\\cdot}{\\cdot}{\\cdot}}";case"....":return"{{\\cdot}{\\cdot}{\\cdot}{\\cdot}}";case"->":return"{\\rightarrow}";case"<-":return"{\\leftarrow}";case"<":return"{<}";case">":return"{>}";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getOperator:function(e){switch(e){case"+":return" {}+{} ";case"-":return" {}-{} ";case"=":return" {}={} ";case"<":return" {}<{} ";case">":return" {}>{} ";case"<<":return" {}\\ll{} ";case">>":return" {}\\gg{} ";case"\\pm":return" {}\\pm{} ";case"\\approx":return" {}\\approx{} ";case"$\\approx$":return" {}\\approx{} ";case"v":return" \\downarrow{} ";case"(v)":return" \\downarrow{} ";case"^":return" \\uparrow{} ";case"(^)":return" \\uparrow{} ";default:throw["MhchemBugT","mhchem bug T. Please report."]}}};function Rv(e){}function Iv(e){}var hd=class Yp extends et{constructor(t){super(h(l({},t),{type:"delim"})),this.value=t.delim,this.size=t.size}static fromJson(t){return new Yp(t)}toJson(){return h(l({},super.toJson()),{delim:this.value,size:this.size})}render(t){return new mt(this.value,{type:"middle"})}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const r=Qe(this.command,this.mode);return r!=null&&r.serialize?r.serialize(this,t):sn(this.command,this.value)}},dd=class Zp extends et{constructor(t){super(h(l({},t),{type:"sizeddelim",value:t.delim})),this.delimType=t.delimType,this.size=t.size}static fromJson(t){return new Zp(t)}toJson(){return h(l({},super.toJson()),{delim:this.value,size:this.size,delimType:this.delimType})}render(t){let r=Ve(this.value,this.size,t,{classes:{open:"mopen",close:"mclose"}[this.delimType],type:this.delimType,isSelected:this.isSelected});return r?(r=this.bind(t,r),this.caret&&(r.caret=this.caret),r):null}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const r=Qe(this.command,this.mode);return r!=null&&r.serialize?r.serialize(this,t):sn(this.command,this.value)}},yu=class Jp extends et{constructor(t,r,a,b){var L,N;super({type:"enclose",command:t,style:b.style}),this.body=r,this.backgroundcolor=b.backgroundcolor,a.updiagonalarrow&&(a.updiagonalstrike=!1),a.box&&(a.left=!1,a.right=!1,a.bottom=!1,a.top=!1),this.notation=a,this.shadow=(L=b.shadow)!=null?L:"none",this.strokeWidth=(N=b.strokeWidth)!=null?N:"0.06em",this.strokeWidth||(this.strokeWidth="0.06em"),this.strokeStyle=b.strokeStyle,this.svgStrokeStyle=b.svgStrokeStyle,this.strokeColor=b.strokeColor,this.borderStyle=b.borderStyle,this.padding=b.padding,this.captureSelection=!1}static fromJson(t){return new Jp(t.command,t.body,t.notation,t)}toJson(){return h(l({},super.toJson()),{notation:this.notation,shadow:this.shadow,strokeWidth:this.strokeWidth,strokeStyle:this.strokeStyle,svgStrokeStyle:this.svgStrokeStyle,strokeColor:this.strokeColor,borderStyle:this.borderStyle,padding:this.padding})}_serialize(t){var r;if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const a=Qe(this.command,this.mode);if(a!=null&&a.serialize)return a.serialize(this,t);let b=(r=this.command)!=null?r:"";if(this.command==="\\enclose"){b+="{"+Object.keys(this.notation).join(" ")+"}";let L="",N="";this.backgroundcolor&&this.backgroundcolor!=="transparent"&&(L+=N+'mathbackground="'+this.backgroundcolor+'"',N=","),this.shadow&&this.shadow!=="auto"&&(L+=N+'shadow="'+this.shadow+'"',N=","),this.strokeWidth||this.strokeStyle!=="solid"?(L+=N+this.borderStyle,N=","):this.strokeColor&&this.strokeColor!=="currentColor"&&(L+=N+'mathcolor="'+this.strokeColor+'"',N=","),L&&(b+=`[${L}]`)}return sn(b,this.bodyToLatex(t))}render(t){const r=new gr({parent:t},this.style),a=et.createBox(r,this.body);if(!a)return null;const b=d0(this.borderStyle),L=r.toEm(!this.padding||this.padding==="auto"?{register:"fboxsep"}:{string:this.padding});a.setStyle("position","relative"),a.setStyle("display","inline-block"),a.setStyle("top",L,"em"),a.setStyle("height",a.height+a.depth,"em"),a.setStyle("width",a.width,"em");const N=new mt(null,{classes:"ML__notation"});let J=a.height+a.depth+2*L;const ie=a.width+2*L;let ue="";if(this.notation.horizontalstrike&&(ue+=this.line(3,50,97,50)),this.notation.verticalstrike&&(ue+=this.line(50,3,50,97)),this.notation.updiagonalstrike&&(ue+=this.line(3,97,97,3)),this.notation.downdiagonalstrike&&(ue+=this.line(3,3,97,97)),this.notation.updiagonalarrow){ue+=this.line(L.toString(),(L+a.depth+a.height).toString(),(L+a.width).toString(),L.toString());const ze=.03*Math.sqrt(ie*ie+J*J)*1,Je=a.width*ze,pt=(a.depth+a.height)*ze,Xe=L+a.width;let ot=L;ot+pt-.4*Je<0&&(ot=.4*Je-pt),ue+='<polygon points="',ue+=`${Xe},${ot} ${Xe-Je-.4*pt},${ot+pt-.4*Je} `,ue+=`${Xe-.7*Je},${ot+.7*pt} ${Xe-Je+.4*pt},${ot+pt+.4*Je} `,ue+=`${Xe},${ot}`,ue+=`" stroke='none' fill="${this.strokeColor}"`,ue+="/>"}let pe=0;if(this.notation.phasorangle){const De=pd(r),je=(a.height+a.depth+2*De+L).toString(),ze=(a.height+a.depth)/2;ue+=this.line(L.toString(),je,(L+ze+a.width).toString(),je),ue+=this.line(L.toString(),je,(L+ze).toString(),(L-De).toString()),J+=De,pe=ze,a.left+=J/2-L}if(this.notation.longdiv){const De=pd(r);J+=De,ue+=this.line(L.toString(),L.toString(),(L+a.width).toString(),L.toString());const je=.3;pe=je+De,a.left+=je+De,a.setTop(L+De),ue+='<path d="',ue+=`M ${L} ${L} a${je} ${(a.depth+a.height+2*De)/2}, 0, 1, 1, 0 ${a.depth+a.height+2*De} "`,ue+=` stroke-width="${p0(r)}" stroke="${this.strokeColor}" fill="none"`,ue+="/>"}if(N.width=a.width+2*L+pe,N.height=a.height+L,N.depth=a.depth+L,N.setStyle("box-sizing","border-box"),N.setStyle("left",`calc(-${b} / 2 )`),N.setStyle("height",`${Math.floor(100*J)/100}em`),N.setStyle("top",`calc(${b} / 2 )`),this.backgroundcolor&&N.setStyle("background-color",this.backgroundcolor),this.notation.box&&N.setStyle("border","1px solid red"),this.notation.actuarial&&(N.setStyle("border-top",this.borderStyle),N.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(N.setStyle("border-bottom",this.borderStyle),N.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(N.setStyle("border-radius","8px"),N.setStyle("border",this.borderStyle)),this.notation.circle&&(N.setStyle("border-radius","50%"),N.setStyle("border",this.borderStyle)),this.notation.top&&N.setStyle("border-top",this.borderStyle),this.notation.left&&N.setStyle("border-left",this.borderStyle),this.notation.right&&N.setStyle("border-right",this.borderStyle),this.notation.bottom&&N.setStyle("border-bottom",this.borderStyle),ue){let De="";this.shadow==="auto"&&(De+="filter: drop-shadow(0 0 .5px rgba(255, 255, 255, .7)) drop-shadow(1px 1px 2px #333)"),this.shadow!=="none"&&(De+=`filter: drop-shadow(${this.shadow})`),De+=` stroke-width="${this.strokeWidth}" stroke="${this.strokeColor}"`,De+=' stroke-linecap="round"',this.svgStrokeStyle&&(De+=` stroke-dasharray="${this.svgStrokeStyle}"`),N.svgStyle=De,N.svgOverlay=ue}const Ee=new mt([N,a]);return Ee.setStyle("position","relative"),Ee.setStyle("vertical-align",L,"em"),Ee.setStyle("height",`${Math.floor(100*(a.height+a.depth+2*L))/100}em`),Ee.setStyle("display","inline-block"),Ee.height=N.height,Ee.depth=N.depth,Ee.width=N.width-2*L,Ee.left=L,Ee.right=L,this.caret&&(Ee.caret=this.caret),Ee.wrap(r)}line(t,r,a,b){return`<line x1="${Tf(t)}" y1="${Tf(r)}" x2="${Tf(a)}" y2="${Tf(b)}" vector-effect="non-scaling-stroke"></line>`}};function Tf(e){return typeof e=="number"?`${Math.floor(100*e)/100}%`:e}function d0(e){if(!e)return"1px";const t=e.match(/([0-9][a-zA-Z\%]+)/);return t===null?"1px":t[1]}function p0(e){return(Math.floor(100*e.metrics.sqrtRuleThickness/e.scalingFactor)/100/10).toString()+"em"}function pd(e){const t=e.isDisplayStyle?ts:e.metrics.defaultRuleThickness;return e.metrics.defaultRuleThickness+e.scalingFactor*t/4}var mc=class qp extends et{constructor(t,r,a){var b,L;super(h(l({},a),{type:"genfrac",displayContainsHighlight:!0})),this.above=t,this.below=r,this.hasBarLine=(b=a==null?void 0:a.hasBarLine)!=null?b:!0,this.continuousFraction=(L=a==null?void 0:a.continuousFraction)!=null?L:!1,this.numerPrefix=a==null?void 0:a.numerPrefix,this.denomPrefix=a==null?void 0:a.denomPrefix,this.mathstyleName=a==null?void 0:a.mathstyleName,this.leftDelim=a==null?void 0:a.leftDelim,this.rightDelim=a==null?void 0:a.rightDelim,this.fractionNavigationOrder=a==null?void 0:a.fractionNavigationOrder}static fromJson(t){return new qp(t.above,t.below,t)}toJson(){const t={};return this.continuousFraction&&(t.continuousFraction=!0),this.numerPrefix&&(t.numerPrefix=this.numerPrefix),this.denomPrefix&&(t.denomPrefix=this.denomPrefix),this.leftDelim&&(t.leftDelim=this.leftDelim),this.rightDelim&&(t.rightDelim=this.rightDelim),this.hasBarLine||(t.hasBarLine=!1),this.mathstyleName&&(t.mathstyleName=this.mathstyleName),this.fractionNavigationOrder&&(t.fractionNavigationOrder=this.fractionNavigationOrder),l(l({},super.toJson()),t)}get children(){if(this._children)return this._children;const t=[];if(this.fractionNavigationOrder==="denominator-numerator"){for(const r of this.below)t.push(...r.children),t.push(r);for(const r of this.above)t.push(...r.children),t.push(r)}else{for(const r of this.above)t.push(...r.children),t.push(r);for(const r of this.below)t.push(...r.children),t.push(r)}return this._children=t,t}render(t){var r,a;const b=new gr({parent:t,mathstyle:this.mathstyleName},this.style),L=b.metrics,N=new gr({parent:b,mathstyle:this.continuousFraction?"":"numerator"},this.style),J=this.numerPrefix?new mt([new mt(this.numerPrefix),et.createBox(N,this.above)],{isTight:N.isTight,type:"ignore"}):(r=et.createBox(N,this.above,{type:"ignore"}))!=null?r:new mt(null,{type:"ignore"}),ie=new gr({parent:b,mathstyle:this.continuousFraction?"":"denominator"},this.style),ue=this.denomPrefix?new mt([new mt(this.denomPrefix),et.createBox(ie,this.below,{type:"ignore"})]):(a=et.createBox(ie,this.below,{type:"ignore"}))!=null?a:new mt(null,{type:"ignore"}),pe=this.hasBarLine?L.defaultRuleThickness:0;let Ee,De=0,je;b.isDisplayStyle?(Ee=N.metrics.num1,De=pe>0?3*pe:7*pe,je=ie.metrics.denom1):(pe>0?(Ee=N.metrics.num2,De=pe):(Ee=N.metrics.num3,De=3*L.defaultRuleThickness),je=ie.metrics.denom2);const ze=[];this.isSelected&&ze.push("ML__selected");const Je=J.depth,pt=ue.height;let Xe;if(pe<=0){const Rt=Ee-Je-(pt-je);Rt<De&&(Ee+=(De-Rt)/2,je+=(De-Rt)/2),Xe=new Zr({individualShift:[{box:J,shift:-Ee,classes:[...ze,"ML__center"]},{box:ue,shift:je,classes:[...ze,"ML__center"]}]}).wrap(b)}else{const Rt=new mt(null,{classes:"ML__frac-line",mode:this.mode,style:this.style});Rt.softWidth=Math.max(J.width,ue.width),Rt.height=pe/2,Rt.depth=pe/2;const br=xi+pe/2;Ee<De+Je+br&&(Ee=De+Je+br);const Gr=xi-pe/2;je<De+pt-Gr&&(je=De+pt-Gr),Xe=new Zr({individualShift:[{box:ue,shift:je,classes:[...ze,"ML__center"]},{box:Rt,shift:-Gr,classes:ze},{box:J,shift:-Ee,classes:[...ze,"ML__center"]}]}).wrap(b)}const ot=b.isDisplayStyle?L.delim1:L.delim2,gt=this.leftDelim?this.bind(t,At("open",this.leftDelim,ot,!0,t,{style:this.style,mode:this.mode,isSelected:this.isSelected})):Lt(b,"open");let ct=null;this.continuousFraction?ct=new mt(null,{type:"close"}):this.rightDelim?ct=this.bind(t,At("close",this.rightDelim,ot,!0,t,{style:this.style,mode:this.mode,isSelected:this.isSelected})):ct=Lt(b,"close");const Dt=new mt([gt,Xe,ct],{isTight:b.isTight,type:"inner",classes:"mfrac"}),Bt=this.bind(t,Dt);return this.caret&&(Bt.caret=this.caret),this.attachSupsub(t,{base:Bt})}},di=class Qp extends et{constructor(t,r){var a;super({type:"latex",value:t,mode:"latex"}),this.isSuggestion=(a=r==null?void 0:r.isSuggestion)!=null?a:!1,this.isError=!1}static fromJson(t){const r=new Qp(t.value);return t.isSuggestion&&(r.isSuggestion=!0),t.isError&&(r.isError=!0),r}toJson(){const t={};return this.isSuggestion&&(t.isSuggestion=!0),this.isError&&(t.isError=!0),l({type:"latex",value:this.value},t)}get computedStyle(){return{}}render(t){const r=new mt(this.value,{classes:this.isSuggestion?"ML__suggestion":this.isError?"ML__error":"",type:"latex",maxFontSize:1});return r?(this.caret&&(r.caret=this.caret),this.bind(t,r)):null}},bu=class e0 extends et{constructor(t){super({type:"latexgroup",mode:"latex"}),this.body=[...t].map(r=>new di(r)),this.skipBoundary=!1}static fromJson(t){return new e0("")}toJson(){return super.toJson()}render(t){const r=et.createBox(t,this.body);return r?(this.caret&&(r.caret=this.caret),this.bind(t,r)):null}_serialize(t){var r,a;return(a=(r=this.body)==null?void 0:r.map(b=>b.value).join(""))!=null?a:""}},wh=class t0 extends et{constructor(t,r){super(h(l({},r),{type:"extensible-symbol",isFunction:r==null?void 0:r.isFunction})),this.value=t,this.variant=r==null?void 0:r.variant,this.subsupPlacement=r==null?void 0:r.limits}static fromJson(t){return new t0(t.symbol,t)}toJson(){const t=super.toJson();return this.variant&&(t.variant=this.variant),this.subsupPlacement&&(t.limits=this.subsupPlacement),this.isExtensibleSymbol&&(t.isExtensibleSymbol=!0),this.value&&(t.symbol=this.value),t}render(t){var r;const a=t.isDisplayStyle&&this.value!=="\\smallint",b=new mt(this.value,{fontFamily:a?"Size2-Regular":"Size1-Regular",classes:"op-symbol "+(a?"large-op":"small-op"),type:"op",maxFontSize:t.scalingFactor,isSelected:this.isSelected});if(!b)return null;b.right=b.italic;const L=(b.height-b.depth)/2-xi*t.scalingFactor,N=b.italic;b.setTop(L);let J=b;if(this.superscript||this.subscript){const ie=(r=this.subsupPlacement)!=null?r:"auto";J=ie==="over-under"||ie==="auto"&&t.isDisplayStyle?this.attachLimits(t,{base:b,baseShift:L,slant:N}):this.attachSupsub(t,{base:b})}return new mt(this.bind(t,J),{type:"op",caret:this.caret,isSelected:this.isSelected,classes:"op-group"}).wrap(t)}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const r=Qe(this.command,this.mode);if(r!=null&&r.serialize)return r.serialize(this,t);const a=[];return a.push(this.command),this.explicitSubsupPlacement&&(this.subsupPlacement==="over-under"&&a.push("\\limits"),this.subsupPlacement==="adjacent"&&a.push("\\nolimits"),this.subsupPlacement==="auto"&&a.push("\\displaylimits")),a.push(this.supsubToLatex(t)),ar(a)}},_l=class r0 extends et{constructor(t){const r=t.body;super(h(l({},t),{type:"overlap",body:typeof r=="string"?[new et({value:r})]:r,style:t==null?void 0:t.style})),this.skipBoundary=!0,this.align=t==null?void 0:t.align,this.boxType=t==null?void 0:t.boxType}static fromJson(t){return new r0(t)}toJson(){const t={};return this.align&&(t.align=this.align),this.boxType&&(t.boxType=this.boxType),l(l({},super.toJson()),t)}render(t){const r=et.createBox(t,this.body,{classes:"inner"});return r?(this.caret&&(r.caret=this.caret),this.bind(t,new mt([r,new mt(null,{classes:"fix"})],{classes:this.align==="right"?"rlap":"llap",type:this.boxType}))):null}},Po=class n0 extends et{constructor(t){var r,a,b,L;super({type:"overunder",command:t.command,style:t.style,mode:t.mode,body:t.body,skipBoundary:(r=t.skipBoundary)!=null?r:!0}),this.subsupPlacement=t.supsubPlacement,this.svgAbove=t.svgAbove,this.svgBelow=t.svgBelow,this.svgBody=t.svgBody,this.above=t.above,this.below=t.below,this.boxType=(a=t.boxType)!=null?a:"ord",this.paddedBody=(b=t.paddedBody)!=null?b:!1,this.paddedLabels=(L=t.paddedLabels)!=null?L:!1}static fromJson(t){return new n0(t)}toJson(){const t=super.toJson();return this.skipBoundary||(t.skipBoundary=!1),this.subsupPlacement&&(t.subsupPlacement=this.subsupPlacement),this.svgAbove&&(t.svgAbove=this.svgAbove),this.svgBelow&&(t.svgBelow=this.svgBelow),this.svgBody&&(t.svgBody=this.svgBody),this.boxType!=="ord"&&(t.boxType=this.boxType),this.paddedBody&&(t.paddedBody=!0),this.paddedLabels&&(t.paddedLabels=!0),t}render(t){let r=this.svgBody?ho(this.svgBody):et.createBox(t,this.body,{type:"ignore"});const a=new gr({parent:t,mathstyle:"scriptstyle"},this.style);let b=null;this.svgAbove?b=ho(this.svgAbove):this.above&&(b=et.createBox(a,this.above,{type:"ignore"}));let L=null;this.svgBelow?L=ho(this.svgBelow):this.below&&(L=et.createBox(a,this.below,{type:"ignore"})),this.paddedBody&&(r=new mt([Lt(t,"open"),r,Lt(t,"close")],{type:"ignore"}));let N=m0(t,{base:r,above:b,below:L,type:this.boxType==="bin"||this.boxType==="rel"?this.boxType:"ord",paddedAboveBelow:this.paddedLabels});return N?(this.subsupPlacement==="over-under"?N=this.attachLimits(t,{base:N,type:N.type}):N=this.attachSupsub(t,{base:N}),this.caret&&(N.caret=this.caret),this.bind(t,N)):null}};function m0(e,t){if(!t.base)return null;if(!t.above&&!t.below){const J=new mt(t.base,{type:t.type});return J.setStyle("position","relative"),J}let r=0;t.above&&(r=e.metrics.bigOpSpacing5);let a=null;const b=t.base,L=0,N=["ML__center"];if(t.paddedAboveBelow&&N.push("ML__label_padding"),t.below&&t.above){const J=e.metrics.bigOpSpacing5+t.below.height+t.below.depth+b.depth+L;a=new Zr({bottom:J,children:[e.metrics.bigOpSpacing5,{box:t.below,classes:N},{box:b,classes:["ML__center"]},r,{box:t.above,classes:N},e.metrics.bigOpSpacing5]})}else t.below?a=new Zr({top:b.height-L,children:[e.metrics.bigOpSpacing5,{box:t.below,classes:N},{box:b,classes:["ML__center"]}]}):t.above&&(a=new Zr({bottom:b.depth+L,children:[{box:b,classes:["ML__center"]},r,{box:t.above,classes:N},e.metrics.bigOpSpacing5]}));return new mt(a,{type:t.type})}var _u=class i0 extends et{constructor(t){var r,a,b,L;super(h(l({},t),{type:"phantom"})),this.captureSelection=!0,this.isInvisible=(r=t.isInvisible)!=null?r:!1,this.smashDepth=(a=t.smashDepth)!=null?a:!1,this.smashHeight=(b=t.smashHeight)!=null?b:!1,this.smashWidth=(L=t.smashWidth)!=null?L:!1}static fromJson(t){return new i0(t)}toJson(){const t={};return this.isInvisible&&(t.isInvisible=!0),this.smashDepth&&(t.smashDepth=!0),this.smashHeight&&(t.smashHeight=!0),this.smashWidth&&(t.smashWidth=!0),l(l({},super.toJson()),t)}render(t){const r=new gr({parent:t,isPhantom:!0});if(!this.smashDepth&&!this.smashHeight&&!this.smashWidth)return console.assert(this.isInvisible),et.createBox(r,this.body,{classes:"inner"});const a=et.createBox(this.isInvisible?r:t,this.body);if(!a)return null;if(this.smashWidth){const b=new mt(null,{classes:"fix"});return new mt([a,b],{classes:"rlap"}).wrap(t)}if(!this.smashHeight&&!this.smashDepth)return a;if(this.smashHeight&&(a.height=0),this.smashDepth&&(a.depth=0),a.children)for(const b of a.children)this.smashHeight&&(b.height=0),this.smashDepth&&(b.depth=0);return new Zr({firstBaseline:[{box:a}]},{type:a.type}).wrap(t)}},wu=class o0 extends et{constructor(t){var r;super(l({type:"spacing"},t)),this.width=t==null?void 0:t.width,this._braced=(r=t==null?void 0:t.braced)!=null?r:!1}static fromJson(t){return new o0(t)}toJson(){const t=super.toJson();return this.width!==void 0&&(t.width=this.width),this._braced&&(t.braced=!0),t}render(t){var r;if(this.command==="space")return new mt(this.mode==="math"?null:" ");let a;if(this.width!==void 0)a=new mt(null,{classes:"mspace"}),a.left=t.toEm(this.width);else{const b=(r={"\\qquad":"qquad","\\quad":"quad","\\enspace":"enspace","\\;":"thickspace","\\:":"mediumspace","\\>":"mediumspace","\\,":"thinspace","\\!":"negativethinspace"}[this.command])!=null?r:"mediumspace";a=new mt(null,{classes:b})}return a=this.bind(t,a),this.caret&&(a.caret=this.caret),a}_serialize(t){var r;if(!t.expandMacro&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const a=Qe(this.command,this.mode);if(a!=null&&a.serialize)return a.serialize(this,t);const b=(r=this.command)!=null?r:"";return this.width===void 0?b:this._braced&&!("register"in this.width)?`${b}{${Dn(this.width)}}`:`${b}${Dn(this.width)}`}},md=class s0 extends et{constructor(t){var r;super(h(l({},t),{type:"surd",mode:(r=t.mode)!=null?r:"math",style:t.style,displayContainsHighlight:!0,body:t.body})),this.above=t.index}static fromJson(t){return new s0(h(l({},t),{index:t.above}))}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const r=Qe(this.command,this.mode);if(r!=null&&r.serialize)return r.serialize(this,t);const a=this.command,b=this.bodyToLatex(t);return this.above&&!this.hasEmptyBranch("above")?sn(`${a}[${this.aboveToLatex(t)}]`,b):/^[0-9]$/.test(b)?`${a}${b}`:sn(a,b)}get children(){if(this._children)return this._children;const t=[];if(this.above)for(const r of this.above)t.push(...r.children),t.push(r);if(this.body)for(const r of this.body)t.push(...r.children),t.push(r);return this._children=t,t}render(t){var r;const a=new gr({parent:t,mathstyle:"cramp"},this.style),b=(r=et.createBox(a,this.body,{type:"inner"}))!=null?r:new mt(null),L=a.scalingFactor,N=a.metrics.defaultRuleThickness/L,J=t.isDisplayStyle?ts:N,ie=new mt(null,{classes:"ML__sqrt-line",style:this.style});ie.height=N,ie.softWidth=b.width;let ue=L*(N+J/4);const Ee=Math.max(L*2*J,b.height+b.depth)+ue+N,De=new gr({parent:t},this.style),je=this.bind(De,new mt(At("inner","\\surd",Ee,!1,De,{isSelected:this.isSelected}),{isSelected:this.isSelected,classes:"ML__sqrt-sign",style:this.style}));if(!je)return null;const ze=je.height+je.depth-N;ze>b.height+b.depth+ue&&(ue=(ue+ze-(b.height+b.depth))/2),je.setTop(je.height-b.height-ue);const Je=this.bind(t,new Zr({firstBaseline:[{box:new mt(b)},ue-2*N,{box:ie},N]})),pt=et.createBox(new gr({parent:t,mathstyle:"scriptscriptstyle"}),this.above,{type:"ignore"});if(!pt){const gt=new mt([je,Je],{classes:this.containsCaret?"ML__contains-caret":"",type:"inner"});return gt.setStyle("display","inline-block"),gt.setStyle("height",gt.height+gt.depth,"em"),this.caret&&(gt.caret=this.caret),this.bind(t,gt)}const Xe=new Zr({shift:-.6*(Math.max(je.height,Je.height)-Math.max(je.depth,Je.depth)),children:[{box:pt}]}),ot=new mt([new mt(Xe,{classes:"ML__sqrt-index",type:"ignore"}),je,Je],{type:"inner",classes:this.containsCaret?"ML__contains-caret":""});return ot.height=je.height,ot.depth=je.depth,this.caret&&(ot.caret=this.caret),this.bind(t,ot)}},g0=class extends mt{constructor(e){super(null,{type:"skip"}),this._width=e}toMarkup(){return`<span style="display:inline-block;width:${Math.ceil(this.width*100)/100}em"></span>`}};function Af(e,t){if(!e.parent)return;const r=e.parent.children,a=r.indexOf(e);let b=a-1;for(;b>=0&&r[b].type==="ignore";)b-=1;if(b<0&&e.parent.parent&&e.parent.type==="lift"){Af(e.parent,t);return}a>0&&r[a-1].type==="skip"?r[a-1].width+=t:r.splice(a,0,new g0(t))}var v0={ord:{op:3,bin:4,rel:5,inner:3},op:{ord:3,op:3,rel:5,inner:3},bin:{ord:4,op:4,open:4,inner:4},rel:{ord:5,op:5,open:5,inner:5},close:{op:3,bin:4,rel:5,inner:3},punct:{ord:3,op:3,rel:3,open:3,punct:3,inner:3},inner:{ord:3,op:3,bin:4,rel:5,open:3,punct:3,inner:3}},y0={ord:{op:3},op:{ord:3,op:3},close:{op:3},inner:{op:3}};function b0(e){Su(e,(t,r)=>{r.type==="bin"&&(!t||/^(middle|bin|op|rel|open|punct)$/.test(t.type))&&(r.type="ord"),(t==null?void 0:t.type)==="bin"&&/^(rel|close|punct)$/.test(r.type)&&(t.type="ord"),r.type!=="ignore"&&(t=r)})}function xu(e,t){if(!e.children)return e;const r=e.children;b0(r);const a=t.getRegisterAsEm("thinmuskip"),b=t.getRegisterAsEm("medmuskip"),L=t.getRegisterAsEm("thickmuskip");return Su(r,(N,J)=>{var ie,ue,pe;if(!N)return;const Ee=N.type,De=J.isTight?(ie=y0[Ee])!=null?ie:null:(ue=v0[Ee])!=null?ue:null,je=(pe=De==null?void 0:De[J.type])!=null?pe:null;je===3&&Af(J,a),je===4&&Af(J,b),je===5&&Af(J,L)}),e}function Su(e,t,r=void 0){if(!e)return r;e=[...e];for(const a of e)a.type==="lift"?r=Su(a.children,t,r):a.type==="ignore"?Su(a.children,t):(t(r,a),Su(a.children,t),r=a);return r}var xh=class a0 extends et{constructor(t){super({type:"tooltip",command:t.command,mode:t.mode,style:t.style,body:t.body,displayContainsHighlight:!0}),this.tooltip=new et({type:"root",mode:t.content,body:t.tooltip,style:{}}),this.skipBoundary=!0,this.captureSelection=!1}static fromJson(t){return new a0(h(l({},t),{tooltip:$a(t.tooltip)}))}toJson(){var t;const r=(t=this.tooltip.body)==null?void 0:t.filter(a=>a.type!=="first").map(a=>a.toJson());return h(l({},super.toJson()),{tooltip:r})}render(t){const r=et.createBox(new gr,this.body);if(!r)return null;const a=new gr({parent:t,mathstyle:"displaystyle"},{fontSize:Cs}),b=oc(xu(new mt(this.tooltip.render(a),{classes:"ML__tooltip-content"}),a)),L=new mt([b,r],{classes:"ML__tooltip-container"});return this.caret&&(L.caret=this.caret),this.bind(t,L)}},wl=class l0 extends et{constructor(t,r){super(h(l({},r),{type:"operator",isFunction:r==null?void 0:r.isFunction})),this.value=t,this.variant=r==null?void 0:r.variant,this.variantStyle=r==null?void 0:r.variantStyle,this.subsupPlacement=r==null?void 0:r.limits}static fromJson(t){return new l0(t.symbol,t)}toJson(){const t=super.toJson();return this.variant&&(t.variant=this.variant),this.variantStyle&&(t.variantStyle=this.variantStyle),this.subsupPlacement&&(t.limits=this.subsupPlacement),this.value&&(t.symbol=this.value),t}render(t){var r;const a=new mt(this.value,{type:"op",mode:"math",maxFontSize:t.scalingFactor,style:{variant:this.variant,variantStyle:this.variantStyle},isSelected:this.isSelected,letterShapeStyle:t.letterShapeStyle});let b=a;if(this.superscript||this.subscript){const L=(r=this.subsupPlacement)!=null?r:"auto";b=L==="over-under"||L==="auto"&&t.isDisplayStyle?this.attachLimits(t,{base:a}):this.attachSupsub(t,{base:a})}return new mt(this.bind(t,b),{type:"op",caret:this.caret,isSelected:this.isSelected,classes:"op-group"}).wrap(t)}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const r=Qe(this.command,this.mode);if(r!=null&&r.serialize)return r.serialize(this,t);const a=[this.command];return this.explicitSubsupPlacement&&(this.subsupPlacement==="over-under"&&a.push("\\limits"),this.subsupPlacement==="adjacent"&&a.push("\\nolimits"),this.subsupPlacement==="auto"&&a.push("\\displaylimits")),a.push(this.supsubToLatex(t)),ar(a)}};function $a(e){if(o(e))return e.map(a=>$a(a));if(typeof e=="string")return et.fromJson(e);e=l({},e);for(const a of Ha)e[a]&&(e[a]=$a(e[a]));e.args&&(e.args=_0(e.args)),e.array&&(e.array=$a(e.array));const t=e.type;let r;t==="accent"&&(r=c.fromJson(e)),t==="array"&&(r=qt.fromJson(e)),t==="box"&&(r=En.fromJson(e)),t==="chem"&&(r=fd.fromJson(e)),t==="composition"&&(r=ga.fromJson(e)),t==="delim"&&(r=hd.fromJson(e)),t==="enclose"&&(r=yu.fromJson(e)),t==="error"&&(r=Ri.fromJson(e)),t==="extensible-symbol"&&(r=wh.fromJson(e)),t==="genfrac"&&(r=mc.fromJson(e)),t==="group"&&(r=ni.fromJson(e)),t==="latex"&&(r=di.fromJson(e)),t==="latexgroup"&&(r=bu.fromJson(e)),t==="leftright"&&(r=Dr.fromJson(e)),t==="macro"&&(r=pc.fromJson(e)),t==="macro-argument"&&(r=ls.fromJson(e)),t==="operator"&&(r=wl.fromJson(e)),t==="overlap"&&(r=_l.fromJson(e)),t==="overunder"&&(r=Po.fromJson(e)),t==="placeholder"&&(r=Nt.fromJson(e)),t==="prompt"&&(r=Ps.fromJson(e)),t==="phantom"&&(r=_u.fromJson(e)),t==="sizeddelim"&&(r=dd.fromJson(e)),t==="spacing"&&(r=wu.fromJson(e)),t==="subsup"&&(r=Do.fromJson(e)),t==="surd"&&(r=md.fromJson(e)),t==="text"&&(r=ss.fromJson(e)),t==="tooltip"&&(r=xh.fromJson(e)),r||(console.assert(!t||["first","mbin","mrel","mclose","minner","mop","mopen","mord","mpunct","root","space"].includes(t),`MathLive 0.98.5: an unexpected atom type "${t}" was encountered. Add new atom constructors to \`fromJson()\` in "atom.ts"`),r=et.fromJson(e));for(const a of Ha)e[a]&&r.setChildren(e[a],a);return e.verbatimLatex!==void 0&&(r.verbatimLatex=e.verbatimLatex),e.subsupPlacement&&(r.subsupPlacement=e.subsupPlacement),e.explicitSubsupPlacement&&(r.explicitSubsupPlacement=!0),e.isFunction&&(r.isFunction=!0),e.isExtensibleSymbol&&(r.isExtensibleSymbol=!0),e.skipBoundary&&(r.skipBoundary=!0),e.captureSelection&&(r.captureSelection=!0),r}function _0(e){if(e&&Array.isArray(e))return e.map(t=>t==="<null>"?null:typeof t=="object"&&"group"in t?{group:t.group.map(r=>$a(r))}:typeof t=="object"&&"atoms"in t?t.atoms.map(r=>$a(r)):t)}var gd={main:["Main-Regular","ML__cmr"],"main-italic":["Main-Italic","ML__cmr ML__it"],"main-bold":["Main-Bold","ML__cmr ML__bold"],"main-bolditalic":["Main-BoldItalic","ML__cmr ML__bold ML__it"],normal:["Main-Regular","ML__cmr"],"normal-bold":["Main-Bold","ML__mathbf"],"normal-italic":["Math-Italic","ML__mathit"],"normal-bolditalic":["Math-BoldItalic","ML__mathbfit"],ams:["AMS-Regular","ML__ams"],"ams-bold":["AMS-Regular","ML__ams"],"ams-italic":["AMS-Regular","ML__ams"],"ams-bolditalic":["AMS-Regular","ML__ams"],"sans-serif":["SansSerif-Regular","ML__sans"],"sans-serif-bold":["SansSerif-Regular","ML__sans ML__bold"],"sans-serif-italic":["SansSerif-Regular","ML__sans"],"sans-serif-bolditalic":["SansSerif-Regular","ML__sans"],calligraphic:["Caligraphic-Regular","ML__cal"],"calligraphic-bold":["Caligraphic-Regular","ML__cal ML__bold"],"calligraphic-italic":["Caligraphic-Regular","ML__cal ML__it"],"calligraphic-bolditalic":["Caligraphic-Regular","ML__cal ML__bold ML__it"],script:["Script-Regular","ML__script"],"script-bold":["Script-Regular","ML__script ML__bold"],"script-italic":["Script-Regular","ML__script ML__it"],"script-bolditalic":["Script-Regular","ML__script ML__bold ML__it"],fraktur:["Fraktur-Regular","ML__frak"],"fraktur-bold":["Fraktur-Regular","ML__frak"],"fraktur-italic":["Fraktur-Regular","ML__frak"],"fraktur-bolditalic":["Fraktur-Regular","ML__frak"],monospace:["Typewriter-Regular","ML__tt"],"monospace-bold":["Typewriter-Regular","ML__tt ML__bold"],"monospace-italic":["Typewriter-Regular","ML__tt ML__it"],"monospace-bolditalic":["Typewriter-Regular","ML__tt ML__bold ML__it"],"double-struck":["AMS-Regular","ML__bb"],"double-struck-bold":["AMS-Regular","ML__bb"],"double-struck-italic":["AMS-Regular","ML__bb"],"double-struck-bolditalic":["AMS-Regular","ML__bb"]},Sh={"double-struck":/^[A-Z ]$/,script:/^[A-Z ]$/,calligraphic:/^[\dA-Z ]$/,fraktur:/^[\dA-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^]$/,monospace:/^[\dA-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A8\u03A9]$/,"sans-serif":/^[\dA-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A8\u03A9]$/},vd=/^[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5]$/,w0=/^[\u0393|\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A6\u03A8\u03A9]$/,x0=[/^[a-z]$/,/^[A-Z]$/,vd,w0],S0={iso:["it","it","it","it"],tex:["it","it","it","up"],french:["it","up","up","up"],upright:["up","up","up","up"]},C0=class extends Wi{constructor(){super("math")}createAtom(e,t,r){var a,b,L,N;if(t===null)return new et({type:"mord",mode:"math",command:e,value:e,style:r});const J=window.MathfieldElement.isFunction((a=t.command)!=null?a:e);if(t.definitionType==="symbol"){const ue=new et({type:(b=t.type)!=null?b:"mord",mode:"math",command:(L=t.command)!=null?L:e,value:String.fromCodePoint(t.codepoint),style:r});return J&&(ue.isFunction=!0),e.startsWith("\\")&&(ue.verbatimLatex=e),ue}const ie=new et({type:"mord",mode:"math",command:(N=t.command)!=null?N:e,value:e,style:r});return J&&(ie.isFunction=!0),e.startsWith("\\")&&(ie.verbatimLatex=e),ie}serialize(e,t){const r=k0(e,h(l({},t),{defaultMode:"math"}));return r.length===0||t.defaultMode!=="text"?r:["$ ",...r," $"]}getFont(e,t){console.assert(t.variant!==void 0);let{variant:r}=t,{variantStyle:a}=t;r==="normal"&&!a&&/[\u00A3\u0131\u0237]/.test(e.value)&&(r="main",a="italic"),r==="normal"&&!a&&e.value.length===1&&x0.forEach((J,ie)=>{var ue;J.test(e.value)&&S0[(ue=t.letterShapeStyle)!=null?ue:"tex"][ie]==="it"&&(a="italic")}),a==="up"&&(a=void 0);const b=a?r+"-"+a:r;console.assert(gd[b]!==void 0);const[L,N]=gd[b];return Sh[r]&&!Sh[r].test(e.value)?(e.value=Ce(e.value,r,a),null):(vd.test(e.value)&&(e.classes+=" lcGreek"),N&&(e.classes+=" "+N),L)}};function k0(e,t){const{parent:r}=e[0],a=yd(r);return kn(e,"variant").map(b=>{const L=yd(b[0]);let N="";L&&L!==a&&(N={calligraphic:"\\mathcal",fraktur:"\\mathfrak","double-struck":"\\mathbb",script:"\\mathscr",monospace:"\\mathtt","sans-serif":"\\mathsf",normal:"\\mathrm","normal-italic":"\\mathnormal","normal-bold":"\\mathbf","normal-bolditalic":"\\mathbfit",ams:"","ams-italic":"\\mathit","ams-bold":"\\mathbf","ams-bolditalic":"\\mathbfit",main:"","main-italic":"\\mathit","main-bold":"\\mathbf","main-bolditalic":"\\mathbfit"}[L],console.assert(N!==void 0));const J=ar(b.map(ie=>ie._serialize(t)));return N?sn(N,J):J})}function yd(e){if(!e)return"";const{style:t}=e;if(t.variant===void 0)return"";let r=t.variant;return!["calligraphic","fraktur","double-struck","script","monospace","sans-serif"].includes(t.variant)&&t.variantStyle&&t.variantStyle!=="up"&&(r+="-"+t.variantStyle),r}new C0;function E0(e,t){return e.map(r=>r._serialize(t))}function M0(e,t){return kn(e,"fontShape").map(r=>{const a=E0(r,t),{fontShape:b}=r[0].style;let L="";return b==="it"&&(L="\\textit"),b==="sl"&&(L="\\textsl"),b==="sc"&&(L="\\textsc"),b==="n"&&(L="\\textup"),!L&&b?`{${sn("\\fontshape",b)}${ar(a)}}`:L?sn(L,ar(a)):ar(a)})}function T0(e,t){return kn(e,"fontSeries").map(r=>{const a=M0(r,t),{fontSeries:b}=r[0].style;let L="";return b==="b"&&(L="\\textbf"),b==="l"&&(L="\\textlf"),b==="m"&&(L="\\textmd"),b&&!L?`{${sn("\\fontseries",b)}${ar(a)}}`:L?sn(L,ar(a)):ar(a)})}function A0(e,t){return kn(e,"fontSize").map(r=>{var a,b;const L=T0(r,t),N=(b=["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][(a=r[0].style.fontSize)!=null?a:""])!=null?b:"";return N?`${N} ${ar(L)}`:ar(L)})}function L0(e,t,r){return kn(e,"fontFamily").map(a=>{var b,L;const N=A0(a,t),J=(L={roman:"textrm",monospace:"texttt","sans-serif":"textsf"}[(b=a[0].style.fontFamily)!=null?b:""])!=null?L:"";return J?`\\${J}{${ar(N)}}`:a[0].style.fontFamily?`{\\fontfamily{${a[0].style.fontFamily}} ${ar(N)}}`:r?`\\text{${ar(N)}}`:ar(N)})}var bd={roman:"","sans-serif":"ML__sans",monospace:"ML__tt"},O0=class extends Wi{constructor(){super("text")}createAtom(e,t,r){return t&&t.definitionType==="symbol"?new ss(e,String.fromCodePoint(t.codepoint),r!=null?r:{}):null}serialize(e,t){return L0(e,h(l({},t),{defaultMode:"text"}),t.defaultMode!=="text")}getFont(e,t){var r,a,b,L,N;const{fontFamily:J}=t;if(bd[J]?e.classes+=" "+bd[J]:J&&e.setStyle("font-family",J),t.fontShape&&(e.classes+=" ",e.classes+=(r={it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape])!=null?r:""),t.fontSeries){const ie=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);ie&&(e.classes+=" ",e.classes+=(b={ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[(a=ie[1])!=null?a:""])!=null?b:"",e.classes+=" ",e.classes+=(N={uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[(L=ie[2])!=null?L:""])!=null?N:"")}return"Main-Regular"}};new O0;var D0=class extends Wi{constructor(){super("latex")}createAtom(e){return new di(e)}serialize(e,t){return e.filter(r=>r instanceof di&&!r.isSuggestion).map(r=>r.value)}getFont(){return null}};new D0;var P0={id:"dvorak",locale:"en",displayName:"Dvorak",virtualLayout:"dvorak",platform:"",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["x","X","\u2248","\u02DB"],KeyC:["j","J","\u2206","\xD4"],KeyD:["e","E","\xB4","\xB4"],KeyE:[".",">","\u2265","\u02D8"],KeyF:["u","U","\xA8","\xA8"],KeyG:["i","I","\u02C6","\u02C6"],KeyH:["d","D","\u2202","\xCE"],KeyI:["c","C","\xE7","\xC7"],KeyJ:["h","H","\u02D9","\xD3"],KeyK:["t","T","\u2020","\u02C7"],KeyL:["n","N","\u02DC","\u02DC"],KeyM:["m","M","\xB5","\xC2"],KeyN:["b","B","\u222B","\u0131"],KeyO:["r","R","\xAE","\u2030"],KeyP:["l","L","\xAC","\xD2"],KeyQ:["'",'"',"\xE6","\xC6"],KeyR:["p","P","\u03C0","\u220F"],KeyS:["o","O","\xF8","\xD8"],KeyT:["y","Y","\xA5","\xC1"],KeyU:["g","G","\xA9","\u02DD"],KeyV:["k","K","\u02DA","\uF8FF"],KeyW:[",","<","\u2264","\xAF"],KeyX:["q","Q","\u0153","\u0152"],KeyY:["f","F","\u0192","\xCF"],KeyZ:[";",":","\u2026","\xDA"],Digit1:["1","!","\xA1","\u2044"],Digit2:["2","@","\u2122","\u20AC"],Digit3:["3","#","\xA3","\u2039"],Digit4:["4","$","\xA2","\u203A"],Digit5:["5","%","\u221E","\uFB01"],Digit6:["6","^","\xA7","\uFB02"],Digit7:["7","&","\xB6","\u2021"],Digit8:["8","*","\u2022","\xB0"],Digit9:["9","(","\xAA","\xB7"],Digit0:["0",")","\xBA","\u201A"],Space:[" "," "," "," "],Minus:["[","{","\u201C","\u201D"],Equal:["]","}","\u2018","\u2019"],BracketLeft:["/","?","\xF7","\xBF"],BracketRight:["=","+","\u2260","\xB1"],Backslash:["\\","|","\xAB","\xBB"],Semicolon:["s","S","\xDF","\xCD"],Quote:["-","_","\u2013","\u2014"],Backquote:["`","~","`","`"],Comma:["w","W","\u2211","\u201E"],Period:["v","V","\u221A","\u25CA"],Slash:["z","Z","\u03A9","\xB8"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[".",".",".","."],IntlBackslash:["\xA7","\xB1","\xA7","\xB1"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}},Ch={id:"apple.en-intl",displayName:"English (international)",virtualLayout:"qwerty",platform:"apple",locale:"en",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\u222B","\u0131"],KeyC:["c","C","\xE7","\xC7"],KeyD:["d","D","\u2202","\xCE"],KeyE:["e","E","\xB4","\xB4"],KeyF:["f","F","\u0192","\xCF"],KeyG:["g","G","\xA9","\u02DD"],KeyH:["h","H","\u02D9","\xD3"],KeyI:["i","I","\u02C6","\u02C6"],KeyJ:["j","J","\u2206","\xD4"],KeyK:["k","K","\u02DA","\uF8FF"],KeyL:["l","L","\xAC","\xD2"],KeyM:["m","M","\xB5","\xC2"],KeyN:["n","N","\u02DC","\u02DC"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\u0153","\u0152"],KeyR:["r","R","\xAE","\u2030"],KeyS:["s","S","\xDF","\xCD"],KeyT:["t","T","\u2020","\u02C7"],KeyU:["u","U","\xA8","\xA8"],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\u2211","\u201E"],KeyX:["x","X","\u2248","\u02DB"],KeyY:["y","Y","\xA5","\xC1"],KeyZ:["z","Z","\u03A9","\xB8"],Digit1:["1","!","\xA1","\u2044"],Digit2:["2","@","\u2122","\u20AC"],Digit3:["3","#","\xA3","\u2039"],Digit4:["4","$","\xA2","\u203A"],Digit5:["5","%","\u221E","\uFB01"],Digit6:["6","^","\xA7","\uFB02"],Digit7:["7","&","\xB6","\u2021"],Digit8:["8","*","\u2022","\xB0"],Digit9:["9","(","\xAA","\xB7"],Digit0:["0",")","\xBA","\u201A"],Space:[" "," "," "," "],Minus:["-","_","\u2013","\u2014"],Equal:["=","+","\u2260","\xB1"],BracketLeft:["[","{","\u201C","\u201D"],BracketRight:["]","}","\u2018","\u2019"],Backslash:["\\","|","\xAB","\xBB"],Semicolon:[";",":","\u2026","\xDA"],Quote:["'",'"',"\xE6","\xC6"],Backquote:["`","\u02DC","`","`"],Comma:[",","<","\u2264","\xAF"],Period:[".",">","\u2265","\u02D8"],Slash:["/","?","\xF7","\xBF"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[".",".",".","."],IntlBackslash:["\xA7","\xB1","\xA7","\xB1"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}},_d={id:"windows.en-intl",displayName:"English (international)",platform:"windows",virtualLayout:"qwerty",locale:"en",score:0,mapping:{KeyA:["a","A","\xE1","\xC1"],KeyB:["b","B","",""],KeyC:["c","C","\xA9","\xA2"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\xE9","\xC9"],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","\xED","\xCD"],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","\xF8","\xD8"],KeyM:["m","M","\xB5",""],KeyN:["n","N","\xF1","\xD1"],KeyO:["o","O","\xF3","\xD3"],KeyP:["p","P","\xF6","\xD6"],KeyQ:["q","Q","\xE4","\xC4"],KeyR:["r","R","\xAE",""],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\xFE","\xDE"],KeyU:["u","U","\xFA","\xDA"],KeyV:["v","V","",""],KeyW:["w","W","\xE5","\xC5"],KeyX:["x","X","",""],KeyY:["y","Y","\xFC","\xDC"],KeyZ:["z","Z","\xE6","\xC6"],Digit1:["1","!","\xA1","\xB9"],Digit2:["2","@","\xB2",""],Digit3:["3","#","\xB3",""],Digit4:["4","$","\xA4","\xA3"],Digit5:["5","%","\u20AC",""],Digit6:["6","^","\xBC",""],Digit7:["7","&","\xBD",""],Digit8:["8","*","\xBE",""],Digit9:["9","(","\u2018",""],Digit0:["0",")","\u2019",""],Space:[" "," ","",""],Minus:["-","_","\xA5",""],Equal:["=","+","\xD7","\xF7"],BracketLeft:["[","{","\xAB",""],BracketRight:["]","}","\xBB",""],Backslash:["\\","|","\xAC","\xA6"],Semicolon:[";",":","\xB6","\xB0"],Quote:["'",'"',"\xB4","\xA8"],Backquote:["`","~","",""],Comma:[",","<","\xE7","\xC7"],Period:[".",">","",""],Slash:["/","?","\xBF",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["\\","|","",""]}},wd={id:"linux.en",displayName:"English",platform:"linux",virtualLayout:"qwerty",locale:"en",score:0,mapping:{KeyA:["a","A","a","A"],KeyB:["b","B","b","B"],KeyC:["c","C","c","C"],KeyD:["d","D","d","D"],KeyE:["e","E","e","E"],KeyF:["f","F","f","F"],KeyG:["g","G","g","G"],KeyH:["h","H","h","H"],KeyI:["i","I","i","I"],KeyJ:["j","J","j","J"],KeyK:["k","K","k","K"],KeyL:["l","L","l","L"],KeyM:["m","M","m","M"],KeyN:["n","N","n","N"],KeyO:["o","O","o","O"],KeyP:["p","P","p","P"],KeyQ:["q","Q","q","Q"],KeyR:["r","R","r","R"],KeyS:["s","S","s","S"],KeyT:["t","T","t","T"],KeyU:["u","U","u","U"],KeyV:["v","V","v","V"],KeyW:["w","W","w","W"],KeyX:["x","X","x","X"],KeyY:["y","Y","y","Y"],KeyZ:["z","Z","z","Z"],Digit1:["1","!","1","!"],Digit2:["2","@","2","@"],Digit3:["3","#","3","#"],Digit4:["4","$","4","$"],Digit5:["5","%","5","%"],Digit6:["6","^","6","^"],Digit7:["7","&","7","&"],Digit8:["8","*","8","*"],Digit9:["9","(","9","("],Digit0:["0",")","0",")"],Space:[" "," "," "," "],Minus:["-","_","-","_"],Equal:["=","+","=","+"],BracketLeft:["[","{","[","{"],BracketRight:["]","}","]","}"],Backslash:["\\","|","\\","|"],Semicolon:[";",":",";",":"],Quote:["'",'"',"'",'"'],Backquote:["`","~","`","~"],Comma:[",","<",",","<"],Period:[".",">",".",">"],Slash:["/","?","/","?"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}},R0={id:"apple.french",locale:"fr",displayName:"French",platform:"apple",virtualLayout:"azerty",score:0,mapping:{KeyA:["q","Q","\u2021","\u03A9"],KeyB:["b","B","\xDF","\u222B"],KeyC:["c","C","\xA9","\xA2"],KeyD:["d","D","\u2202","\u2206"],KeyE:["e","E","\xEA","\xCA"],KeyF:["f","F","\u0192","\xB7"],KeyG:["g","G","\uFB01","\uFB02"],KeyH:["h","H","\xCC","\xCE"],KeyI:["i","I","\xEE","\xEF"],KeyJ:["j","J","\xCF","\xCD"],KeyK:["k","K","\xC8","\xCB"],KeyL:["l","L","\xAC","|"],KeyM:[",","?","\u221E","\xBF"],KeyN:["n","N","~","\u0131"],KeyO:["o","O","\u0153","\u0152"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["a","A","\xE6","\xC6"],KeyR:["r","R","\xAE","\u201A"],KeyS:["s","S","\xD2","\u2211"],KeyT:["t","T","\u2020","\u2122"],KeyU:["u","U","\xBA","\xAA"],KeyV:["v","V","\u25CA","\u221A"],KeyW:["z","Z","\xC2","\xC5"],KeyX:["x","X","\u2248","\u2044"],KeyY:["y","Y","\xDA","\u0178"],KeyZ:["w","W","\u2039","\u203A"],Digit1:["&","1","\uF8FF","\xB4"],Digit2:["\xE9","2","\xEB","\u201E"],Digit3:['"',"3","\u201C","\u201D"],Digit4:["'","4","\u2018","\u2019"],Digit5:["(","5","{","["],Digit6:["\xA7","6","\xB6","\xE5"],Digit7:["\xE8","7","\xAB","\xBB"],Digit8:["!","8","\xA1","\xDB"],Digit9:["\xE7","9","\xC7","\xC1"],Digit0:["\xE0","0","\xF8","\xD8"],Space:[" "," "," "," "],Minus:[")","\xB0","}","]"],Equal:["-","_","\u2014","\u2013"],BracketLeft:["^","\xA8","\xF4","\xD4"],BracketRight:["$","*","\u20AC","\xA5"],Backslash:["`","\xA3","@","#"],Semicolon:["m","M","\xB5","\xD3"],Quote:["\xF9","%","\xD9","\u2030"],Backquote:["<",">","\u2264","\u2265"],Comma:[";",".","\u2026","\u2022"],Period:[":","/","\xF7","\\"],Slash:["=","+","\u2260","\xB1"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",".",",","."],IntlBackslash:["@","#","\u2022","\u0178"],NumpadEqual:["=","=","=","="]}},I0={id:"windows.french",locale:"fr",displayName:"French",virtualLayout:"azerty",platform:"windows",score:0,mapping:{KeyA:["q","Q","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:[",","?","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["a","A","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["z","Z","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["w","W","",""],Digit1:["&","1","",""],Digit2:["\xE9","2","~",""],Digit3:['"',"3","#",""],Digit4:["'","4","{",""],Digit5:["(","5","[",""],Digit6:["-","6","|",""],Digit7:["\xE8","7","`",""],Digit8:["_","8","\\",""],Digit9:["\xE7","9","^",""],Digit0:["\xE0","0","@",""],Space:[" "," ","",""],Minus:[")","\xB0","]",""],Equal:["=","+","}",""],BracketLeft:["^","\xA8","",""],BracketRight:["$","\xA3","\xA4",""],Backslash:["*","\xB5","",""],Semicolon:["m","M","",""],Quote:["\xF9","%","",""],Backquote:["\xB2","","",""],Comma:[";",".","",""],Period:[":","/","",""],Slash:["!","\xA7","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}},j0={id:"linux.french",locale:"fr",displayName:"French",virtualLayout:"azerty",platform:"linux",score:0,mapping:{KeyA:["q","Q","@","\u03A9"],KeyB:["b","B","\u201D","\u2019"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\xA2"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0309","\u031B"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:[",","?","\u0301","\u030B"],KeyN:["n","N","n","N"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["a","A","\xE6","\xC6"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201C","\u2018"],KeyW:["z","Z","\xAB","<"],KeyX:["x","X","\xBB",">"],KeyY:["y","Y","\u2190","\xA5"],KeyZ:["w","W","\u0142","\u0141"],Digit1:["&","1","\xB9","\xA1"],Digit2:["\xE9","2","~","\u215B"],Digit3:['"',"3","#","\xA3"],Digit4:["'","4","{","$"],Digit5:["(","5","[","\u215C"],Digit6:["-","6","|","\u215D"],Digit7:["\xE8","7","`","\u215E"],Digit8:["_","8","\\","\u2122"],Digit9:["\xE7","9","^","\xB1"],Digit0:["\xE0","0","@","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:[")","\xB0","]","\xBF"],Equal:["=","+","}","\u0328"],BracketLeft:["\u0302","\u0308","\u0308","\u030A"],BracketRight:["$","\xA3","\xA4","\u0304"],Backslash:["*","\xB5","\u0300","\u0306"],Semicolon:["m","M","\xB5","\xBA"],Quote:["\xF9","%","\u0302","\u030C"],Backquote:["\xB2","~","\xAC","\xAC"],Comma:[";",".","\u2500","\xD7"],Period:[":","/","\xB7","\xF7"],Slash:["!","\xA7","\u0323","\u0307"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"]}},B0={id:"apple.german",locale:"de",displayName:"German",virtualLayout:"qwertz",platform:"apple",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\u222B","\u2039"],KeyC:["c","C","\xE7","\xC7"],KeyD:["d","D","\u2202","\u2122"],KeyE:["e","E","\u20AC","\u2030"],KeyF:["f","F","\u0192","\xCF"],KeyG:["g","G","\xA9","\xCC"],KeyH:["h","H","\xAA","\xD3"],KeyI:["i","I","\u2044","\xDB"],KeyJ:["j","J","\xBA","\u0131"],KeyK:["k","K","\u2206","\u02C6"],KeyL:["l","L","@","\uFB02"],KeyM:["m","M","\xB5","\u02D8"],KeyN:["n","N","~","\u203A"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\xAB","\xBB"],KeyR:["r","R","\xAE","\xB8"],KeyS:["s","S","\u201A","\xCD"],KeyT:["t","T","\u2020","\u02DD"],KeyU:["u","U","\xA8","\xC1"],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\u2211","\u201E"],KeyX:["x","X","\u2248","\xD9"],KeyY:["z","Z","\u03A9","\u02C7"],KeyZ:["y","Y","\xA5","\u2021"],Digit1:["1","!","\xA1","\xAC"],Digit2:["2",'"',"\u201C","\u201D"],Digit3:["3","\xA7","\xB6","#"],Digit4:["4","$","\xA2","\xA3"],Digit5:["5","%","[","\uFB01"],Digit6:["6","&","]","^"],Digit7:["7","/","|","\\"],Digit8:["8","(","{","\u02DC"],Digit9:["9",")","}","\xB7"],Digit0:["0","=","\u2260","\xAF"],Space:[" "," "," "," "],Minus:["\xDF","?","\xBF","\u02D9"],Equal:["\xB4","`","'","\u02DA"],BracketLeft:["\xFC","\xDC","\u2022","\xB0"],BracketRight:["+","*","\xB1","\uF8FF"],Backslash:["#","'","\u2018","\u2019"],Semicolon:["\xF6","\xD6","\u0153","\u0152"],Quote:["\xE4","\xC4","\xE6","\xC6"],Backquote:["<",">","\u2264","\u2265"],Comma:[",",";","\u221E","\u02DB"],Period:[".",":","\u2026","\xF7"],Slash:["-","_","\u2013","\u2014"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",",",".","."],IntlBackslash:["^","\xB0","\u201E","\u201C"],NumpadEqual:["=","=","=","="]}},N0={id:"windows.german",locale:"de",displayName:"German",platform:"windows",virtualLayout:"qwertz",score:0,mapping:{KeyA:["a","A","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:["m","M","\xB5",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["q","Q","@",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["w","W","",""],KeyX:["x","X","",""],KeyY:["z","Z","",""],KeyZ:["y","Y","",""],Digit1:["1","!","",""],Digit2:["2",'"',"\xB2",""],Digit3:["3","\xA7","\xB3",""],Digit4:["4","$","",""],Digit5:["5","%","",""],Digit6:["6","&","",""],Digit7:["7","/","{",""],Digit8:["8","(","[",""],Digit9:["9",")","]",""],Digit0:["0","=","}",""],Space:[" "," ","",""],Minus:["\xDF","?","\\","\u1E9E"],Equal:["\xB4","`","",""],BracketLeft:["\xFC","\xDC","",""],BracketRight:["+","*","~",""],Backslash:["#","'","",""],Semicolon:["\xF6","\xD6","",""],Quote:["\xE4","\xC4","",""],Backquote:["^","\xB0","",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","|",""]}},F0={id:"linux.german",locale:"de",displayName:"German",platform:"windows",virtualLayout:"qwertz",score:0,mapping:{KeyA:["a","A","\xE6","\xC6"],KeyB:["b","B","\u201C","\u2018"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\u20AC"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0323","\u0307"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:["m","M","\xB5","\xBA"],KeyN:["n","N","\u201D","\u2019"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["q","Q","@","\u03A9"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\u017F","\u1E9E"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201E","\u201A"],KeyW:["w","W","\u0142","\u0141"],KeyX:["x","X","\xAB","\u2039"],KeyY:["z","Z","\u2190","\xA5"],KeyZ:["y","Y","\xBB","\u203A"],Digit1:["1","!","\xB9","\xA1"],Digit2:["2",'"',"\xB2","\u215B"],Digit3:["3","\xA7","\xB3","\xA3"],Digit4:["4","$","\xBC","\xA4"],Digit5:["5","%","\xBD","\u215C"],Digit6:["6","&","\xAC","\u215D"],Digit7:["7","/","{","\u215E"],Digit8:["8","(","[","\u2122"],Digit9:["9",")","]","\xB1"],Digit0:["0","=","}","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:["\xDF","?","\\","\xBF"],Equal:["\u0301","\u0300","\u0327","\u0328"],BracketLeft:["\xFC","\xDC","\u0308","\u030A"],BracketRight:["+","*","~","\xAF"],Backslash:["#","'","\u2019","\u0306"],Semicolon:["\xF6","\xD6","\u030B","\u0323"],Quote:["\xE4","\xC4","\u0302","\u030C"],Backquote:["\u0302","\xB0","\u2032","\u2033"],Comma:[",",";","\xB7","\xD7"],Period:[".",":","\u2026","\xF7"],Slash:["-","_","\u2013","\u2014"],PrintScreen:["","","",""],PageUp:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["","1","","1"],Numpad2:["","2","","2"],Numpad3:["","3","","3"],Numpad4:["","4","","4"],Numpad5:["","5","","5"],Numpad6:["","6","","6"],Numpad7:["","7","","7"],Numpad8:["","8","","8"],Numpad9:["","9","","9"],Numpad0:["","0","","0"],NumpadDecimal:["",",","",","],IntlBackslash:["<",">","|","\u0331"],AltRight:["\r","\r","\r","\r"],MetaRight:[".",".",".","."]}},z0={id:"apple.spanish",locale:"es",displayName:"Spanish ISO",platform:"apple",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\xDF",""],KeyC:["c","C","\xA9"," "],KeyD:["d","D","\u2202","\u2206"],KeyE:["e","E","\u20AC","\u20AC"],KeyF:["f","F","\u0192","\uFB01"],KeyG:["g","G","\uF8FF","\uFB02"],KeyH:["h","H","\u2122"," "],KeyI:["i","I"," "," "],KeyJ:["j","J","\xB6","\xAF"],KeyK:["k","K","\xA7","\u02C7"],KeyL:["l","L"," ","\u02D8"],KeyM:["m","M","\xB5","\u02DA"],KeyN:["n","N"," ","\u02D9"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\u0153","\u0152"],KeyR:["r","R","\xAE"," "],KeyS:["s","S","\u222B"," "],KeyT:["t","T","\u2020","\u2021"],KeyU:["u","U"," "," "],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\xE6","\xC6"],KeyX:["x","X","\u2211","\u203A"],KeyY:["y","Y","\xA5"," "],KeyZ:["z","Z","\u03A9","\u2039"],Digit1:["1","!","|","\u0131"],Digit2:["2",'"',"@","\u02DD"],Digit3:["3","\xB7","#","\u2022"],Digit4:["4","$","\xA2","\xA3"],Digit5:["5","%","\u221E","\u2030"],Digit6:["6","&","\xAC"," "],Digit7:["7","/","\xF7","\u2044"],Digit8:["8","(","\u201C","\u2018"],Digit9:["9",")","\u201D","\u2019"],Digit0:["0","=","\u2260","\u2248"],Space:[" "," "," "," "],Minus:["'","?","\xB4","\xB8"],Equal:["\xA1","\xBF","\u201A","\u02DB"],BracketLeft:["`","^","[","\u02C6"],BracketRight:["+","*","]","\xB1"],Backslash:["\xE7","\xC7","}","\xBB"],Semicolon:["\xF1","\xD1","~","\u02DC"],Quote:["\xB4","\xA8","{","\xAB"],Backquote:["<",">","\u2264","\u2265"],Comma:[",",";","\u201E",""],Period:[".",":","\u2026","\u2026"],Slash:["-","_","\u2013","\u2014"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[",",",",",",","],IntlBackslash:["\xBA","\xAA","\\","\xB0"]}},H0={id:"windows.spanish",locale:"es",displayName:"Spanish",platform:"windows",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:["m","M","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["q","Q","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["w","W","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["z","Z","",""],Digit1:["1","!","|",""],Digit2:["2",'"',"@",""],Digit3:["3","\xB7","#",""],Digit4:["4","$","~",""],Digit5:["5","%","\u20AC",""],Digit6:["6","&","\xAC",""],Digit7:["7","/","",""],Digit8:["8","(","",""],Digit9:["9",")","",""],Digit0:["0","=","",""],Space:[" "," ","",""],Minus:["'","?","",""],Equal:["\xA1","\xBF","",""],BracketLeft:["`","^","[",""],BracketRight:["+","*","]",""],Backslash:["\xE7","\xC7","}",""],Semicolon:["\xF1","\xD1","",""],Quote:["\xB4","\xA8","{",""],Backquote:["\xBA","\xAA","\\",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}},U0={id:"linux.spanish",locale:"es",displayName:"Spanish",platform:"linux",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","\xE6","\xC6"],KeyB:["b","B","\u201D","\u2019"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\xA2"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0309","\u031B"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:["m","M","\xB5","\xBA"],KeyN:["n","N","n","N"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["q","Q","@","\u03A9"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201C","\u2018"],KeyW:["w","W","\u0142","\u0141"],KeyX:["x","X","\xBB",">"],KeyY:["y","Y","\u2190","\xA5"],KeyZ:["z","Z","\xAB","<"],Digit1:["1","!","|","\xA1"],Digit2:["2",'"',"@","\u215B"],Digit3:["3","\xB7","#","\xA3"],Digit4:["4","$","~","$"],Digit5:["5","%","\xBD","\u215C"],Digit6:["6","&","\xAC","\u215D"],Digit7:["7","/","{","\u215E"],Digit8:["8","(","[","\u2122"],Digit9:["9",")","]","\xB1"],Digit0:["0","=","}","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:["'","?","\\","\xBF"],Equal:["\xA1","\xBF","\u0303","~"],BracketLeft:["\u0300","\u0302","[","\u030A"],BracketRight:["+","*","]","\u0304"],Backslash:["\xE7","\xC7","}","\u0306"],Semicolon:["\xF1","\xD1","~","\u030B"],Quote:["\u0301","\u0308","{","{"],Backquote:["\xBA","\xAA","\\","\\"],Comma:[",",";","\u2500","\xD7"],Period:[".",":","\xB7","\xF7"],Slash:["-","_","\u0323","\u0307"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadEnter:["\r","\r","\r","\r"],Numpad1:["","1","","1"],Numpad2:["","2","","2"],Numpad3:["","3","","3"],Numpad4:["","4","","4"],Numpad5:["","5","","5"],Numpad6:["","6","","6"],Numpad7:["","7","","7"],Numpad8:["","8","","8"],Numpad9:["","9","","9"],Numpad0:["","0","","0"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}};function xd(e){const t=e.split("+"),r={shift:!1,alt:!1,cmd:!1,win:!1,meta:!1,ctrl:!1,key:t.pop()};return t.includes("shift")&&(r.shift=!0),t.includes("alt")&&(r.alt=!0),t.includes("ctrl")&&(r.ctrl=!0),t.includes("cmd")&&(r.cmd=!0),t.includes("win")&&(r.win=!0),t.includes("meta")&&(r.meta=!0),r}function gc(e){let t="";return e.shift&&(t+="shift+"),e.alt&&(t+="alt+"),e.ctrl&&(t+="ctrl+"),e.cmd&&(t+="cmd+"),e.win&&(t+="win+"),e.meta&&(t+="meta+"),t+e.key}var W0={enter:"[Enter]",escape:"[Escape]",backspace:"[Backspace]",tab:"[Tab]",space:"[Space]",pausebreak:"[Pause]",insert:"[Insert]",home:"[Home]",pageup:"[PageUp]",delete:"[Delete]",end:"[End]",pagedown:"[PageDown]",right:"[ArrowRight]",left:"[ArrowLeft]",down:"[ArrowDown]",up:"[ArrowUp]",numpad0:"[Numpad0]",numpad1:"[Numpad1]",numpad2:"[Numpad2]",numpad3:"[Numpad3]",numpad4:"[Numpad4]",numpad5:"[Numpad5]",numpad6:"[Numpad6]",numpad7:"[Numpad7]",numpad8:"[Numpad8]",numpad9:"[Numpad9]",numpad_divide:"[NumpadDivide]",numpad_multiply:"[NumpadMultiply]",numpad_subtract:"[NumpadSubtract]",numpad_add:"[NumpadAdd]",numpad_decimal:"[NumpadDecimal]",numpad_separator:"[NumpadComma]",capslock:"[Capslock]",f1:"[F1]",f2:"[F2]",f3:"[F3]",f4:"[F4]",f5:"[F5]",f6:"[F6]",f7:"[F7]",f8:"[F8]",f9:"[F9]",f10:"[F10]",f11:"[F11]",f12:"[F12]",f13:"[F13]",f14:"[F14]",f15:"[F15]",f16:"[F16]",f17:"[F17]",f18:"[F18]",f19:"[F19]"},Cu=[],ku;function kh(){switch(_()){case"macos":case"ios":return"apple";case"windows":return"windows"}return"linux"}function go(e){(!e.platform||e.platform===kh())&&Cu.push(e)}function K0(e,t){var r;const a={shift:!1,alt:!1,cmd:!1,win:!1,meta:!1,ctrl:!1,key:""};if(!e)return a;for(const[b,L]of Object.entries(t.mapping)){if(L[0]===e)return a.key=`[${b}]`,a;if(L[1]===e)return a.shift=!0,a.key=`[${b}]`,a;if(L[2]===e)return a.alt=!0,a.key=`[${b}]`,a;if(L[3]===e)return a.shift=!0,a.alt=!0,a.key=`[${b}]`,a}return a.key=(r=W0[e])!=null?r:"",a}function $0(e){if(e.code)return e;const t=Object.entries(Eu().mapping);let r=!1,a=!1,b="";for(let L=0;L<4;L++){for(const[N,J]of t)if(J[L]===e.key){b=N,L===3?(r=!0,a=!0):L===2?r=!0:L===1&&(a=!0);break}if(b)break}return new KeyboardEvent(e.type,h(l({},e),{altKey:r,shiftKey:a,code:b}))}function G0(e){var t,r;if(!e||e.key==="Unidentified"||e.key==="Dead")return;const a=e.shiftKey&&e.altKey?3:e.altKey?2:e.shiftKey?1:0;for(const b of Cu)((t=b.mapping[e.code])==null?void 0:t[a])===e.key?b.score+=1:(r=b.mapping[e.code])!=null&&r[a]&&(b.score=0);Cu.sort((b,L)=>L.score-b.score)}function V0(e){ku=Cu.find(t=>e.startsWith(t.locale))}function Eu(){return ku!=null?ku:Cu[0]}function X0(){switch(kh()){case"apple":return Ch;case"windows":return _d;case"linux":return wd}return Ch}switch(kh()){case"apple":go(Ch),go(R0),go(z0),go(B0);break;case"windows":go(_d),go(I0),go(H0),go(N0);break;case"linux":go(wd),go(j0),go(U0),go(F0);break}go(P0);function Eh(e){var t;const r=/macos|ios/.test(_()),a=e.split("+");let b="";for(const L of a)b&&(b+=r?"\u2009":'<span class="ML__shortcut-join">+</span>'),L.startsWith("[Key")?b+=L.slice(4,5):L.startsWith("Key")?b+=L.slice(3,4):L.startsWith("[Digit")?b+=L.slice(6,7):L.startsWith("Digit")?b+=L.slice(5,6):b+=(t={cmd:"\u2318",meta:r?"\u2318":"Ctrl",shift:r?"\u21E7":"Shift",alt:r?"\u2325":"Alt",ctrl:r?"\u2303":"Ctrl","\n":r?"\u23CE":"Return","[return]":r?"\u23CE":"Return","[enter]":r?"\u2324":"Enter","[tab]":r?"\u21E5":"Tab","[escape]":"Esc","[backspace]":r?"\u232B":"Backspace","[delete]":r?"\u2326":"Del","[pageup]":r?"\u21DE":"Page Up","[pagedown]":r?"\u21DF":"Page Down","[home]":r?"\u2912":"Home","[end]":r?"\u2913":"End","[space]":"Space","[equal]":"=","[minus]":"-","[comma]":",","[slash]":"/","[backslash]":"\\","[bracketleft]":"[","[bracketright]":"]",semicolon:";",period:".",comma:",",minus:"-",equal:"=",quote:"'",backslash:"\\",intlbackslash:"\\",backquote:"`",slash:"/",numpadmultiply:"* &#128290;",numpaddivide:"/ &#128290;",numpadsubtract:"- &#128290;",numpadadd:"+ &#128290;",numpaddecimal:". &#128290;",numpadcomma:", &#128290;",help:"help",left:"\u21E0",up:"\u21E1",right:"\u21E2",down:"\u21E3","[arrowleft]":"\u21E0","[arrowup]":"\u21E1","[arrowright]":"\u21E2","[arrowdown]":"\u21E3"}[L.toLowerCase()])!=null?t:L.toUpperCase();return b}function Lf(e){if(e instanceof MouseEvent||e instanceof PointerEvent)return{x:e.clientX,y:e.clientY};if(e instanceof TouchEvent){const t=[...e.touches].reduce((a,b)=>({x:a.x+b.clientX,y:a.y+b.clientY}),{x:0,y:0}),r=e.touches.length;return{x:t.x/r,y:t.y/r}}}function xl(e){const t={alt:!1,control:!1,shift:!1,meta:!1};return(e instanceof MouseEvent||e instanceof PointerEvent||e instanceof TouchEvent||e instanceof KeyboardEvent)&&(e.altKey&&(t.alt=!0),e.ctrlKey&&(t.control=!0),e.metaKey&&(t.meta=!0),e.shiftKey&&(t.shift=!0)),t}function Y0(e,t){return!e&&t||e&&!t?!1:!e||!t?!0:e.alt===t.alt&&e.control===t.control&&e.shift===t.shift&&e.meta===t.meta}var Z0=new Set(["Backquote","Digit0","Digit1","Digit2","Digit3","Digit4","Digit5","Digit6","Digit7","Digit8","Digit9","Minus","Equal","IntlYen","KeyQ","KeyW","KeyE","KeyR","KeyT","KeyY","KeyU","KeyI","KeyO","KeyP","BracketLeft","BracketRight","Backslash","KeyA","KeyS","KeyD","KeyF","KeyG","KeyH","KeyJ","KeyK","KeyL","Semicolon","Quote","IntlBackslash","KeyZ","KeyX","KeyC","KeyV","KeyB","KeyN","KeyM","Comma","Period","Slash","IntlRo","Space","Numpad0","Numpad1","Numpad2","Numpad3","Numpad4","Numpad5","Numpad6","Numpad7","Numpad8","Numpad9","NumpadAdd","NumpadComma","NumpadDecimal","NumpadDivide","NumpadEqual","NumpadHash","NumpadMultiply","NumpadParenLeft","NumpadParenRight","NumpadStar","NumpadSubstract"]);function Of(e){return e.ctrlKey||e.metaKey||["Dead","Process"].includes(e.key)?!1:e.code===""?!0:Z0.has(e.code)}function Df(){var e;let t=document.activeElement;for(;(e=t==null?void 0:t.shadowRoot)!=null&&e.activeElement;)t=t.shadowRoot.activeElement;return t}var Rs=class wa{static get scrim(){return wa._scrim||(wa._scrim=new wa),wa._scrim}static open(t){wa.scrim.open(t)}static close(){wa.scrim.close()}static get state(){return wa.scrim.state}static get element(){return wa.scrim.element}constructor(t){var r,a;this.lightDismiss=(r=t==null?void 0:t.lightDismiss)!=null?r:!0,this.translucent=(a=t==null?void 0:t.translucent)!=null?a:!1,this.state="closed"}get element(){if(this._element)return this._element;const t=document.createElement("div");return t.setAttribute("role","presentation"),t.style.position="fixed",t.style.contain="content",t.style.top="0",t.style.left="0",t.style.right="0",t.style.bottom="0",t.style.zIndex="var(--scrim-zindex, 10099)",t.style.outline="none",this.translucent?(t.style.background="rgba(255, 255, 255, .2)",t.style.backdropFilter="contrast(40%)"):t.style.background="transparent",this._element=t,t}open(t){var r;if(this.state!=="closed")return;this.state="opening",this.onDismiss=t==null?void 0:t.onDismiss,this.savedActiveElement=Df();const{element:a}=this;((r=t==null?void 0:t.root)!=null?r:document.body).appendChild(a),a.addEventListener("click",this),document.addEventListener("touchmove",this,!1),document.addEventListener("scroll",this,!1);const b=window.innerWidth-document.documentElement.clientWidth;this.savedMarginRight=document.body.style.marginRight,this.savedOverflow=document.body.style.overflow,document.body.style.overflow="hidden";const L=Number.parseFloat(getComputedStyle(document.body).marginRight);document.body.style.marginRight=`${L+b}px`,t!=null&&t.child&&a.append(t.child),this.state="open"}close(){var t,r,a,b;if(this.state!=="open"){console.assert(this.element.parentElement!==null);return}this.state="closing",typeof this.onDismiss=="function"&&this.onDismiss(),this.onDismiss=void 0;const{element:L}=this;L.removeEventListener("click",this),document.removeEventListener("touchmove",this,!1),document.removeEventListener("scroll",this,!1),L.remove(),document.body.style.overflow=(t=this.savedOverflow)!=null?t:"",document.body.style.marginRight=(r=this.savedMarginRight)!=null?r:"",Df()!==this.savedActiveElement&&((b=(a=this.savedActiveElement)==null?void 0:a.focus)==null||b.call(a)),L.innerHTML="",this.state="closed"}handleEvent(t){this.lightDismiss&&(t.target===this._element&&t.type==="click"?(this.close(),t.preventDefault(),t.stopPropagation()):t.target===document&&(t.type==="touchmove"||t.type==="scroll")&&(this.close(),t.preventDefault(),t.stopPropagation()))}};function J0(e,t,r){let a=null,b=null,L=!1,N=!1,J=!1;const ie=new AbortController,ue=ie.signal;return e.addEventListener("keydown",pe=>{if(L||pe.key==="Process"||pe.code==="CapsLock"||/(Control|Meta|Alt|Shift)(Left|Right)/.test(pe.code)){a=null;return}a=pe,b=null,r.onKeystroke(pe)?e.textContent="":a=null},{capture:!0,signal:ue}),e.addEventListener("keypress",pe=>{L||(a&&b&&r.onKeystroke(a),b=pe)},{capture:!0,signal:ue}),e.addEventListener("compositionstart",pe=>{e.textContent="",L=!0,r.onCompositionStart(pe.data)},{capture:!0,signal:ue}),e.addEventListener("compositionupdate",pe=>{L&&r.onCompositionUpdate(pe.data)},{capture:!0,signal:ue}),e.addEventListener("compositionend",pe=>{e.textContent="",L&&(L=!1,r.onCompositionEnd(pe.data))},{capture:!0,signal:ue}),e.addEventListener("beforeinput",pe=>pe.stopImmediatePropagation(),{signal:ue}),e.addEventListener("input",pe=>{var Ee;if(!L&&(e.textContent="",pe.inputType!=="insertCompositionText")){if(pe.inputType==="insertFromPaste"){pe.preventDefault(),pe.stopPropagation();return}r.onInput((Ee=pe.data)!=null?Ee:""),pe.preventDefault(),pe.stopPropagation()}},{signal:ue}),e.addEventListener("paste",pe=>{e.focus({preventScroll:!0}),e.textContent="",r.onPaste(pe)||pe.preventDefault(),pe.stopImmediatePropagation()},{signal:ue}),e.addEventListener("cut",pe=>r.onCut(pe),{capture:!0,signal:ue}),e.addEventListener("copy",pe=>r.onCopy(pe),{capture:!0,signal:ue}),e.addEventListener("blur",pe=>{var Ee,De;if(((De=(Ee=pe.relatedTarget)==null?void 0:Ee._mathfield)==null?void 0:De.element)===t){e.focus({preventScroll:!0}),pe.preventDefault(),pe.stopPropagation();return}const je=Rs.state;if(je==="open"||je==="opening"){pe.preventDefault(),pe.stopPropagation();return}if(pe.relatedTarget===pe.target.getRootNode().host){pe.preventDefault(),pe.stopPropagation();return}J||N||(J=!0,a=null,b=null,r.onBlur(),J=!1)},{capture:!0,signal:ue}),e.addEventListener("focus",pe=>{J||N||(N=!0,r.onFocus(),N=!1)},{capture:!0,signal:ue}),{dispose:()=>ie.abort(),cancelComposition:()=>{L&&(e.blur(),requestAnimationFrame(()=>e.focus({preventScroll:!0})))},blur:()=>{typeof e.blur=="function"&&e.blur()},focus:()=>{!N&&typeof e.focus=="function"&&e.focus({preventScroll:!0})},hasFocus:()=>Df()===e,setAriaLabel:pe=>e.setAttribute("aria-label",pe),setValue:pe=>{var Ee;e.textContent=pe,e.style.left="-1000px",(Ee=window.getSelection())==null||Ee.selectAllChildren(e)},moveTo:(pe,Ee)=>{e.style.top=`${Ee}px`,e.style.left=`${pe}px`}}}function vc(e){var t;if(!e||!Of(e))return"";let r;return e.key==="Unidentified"&&e.target&&(r=e.target.value),r=(t=r!=null?r:e.key)!=null?t:e.code,/^(Dead|Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(r)&&(r=""),r}function Sd(e){e=$0(e);const t=[];return e.ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),e.altKey&&t.push("alt"),e.shiftKey&&t.push("shift"),t.length===0?`[${e.code}]`:(t.push(`[${e.code}]`),t.join("+"))}function q0(e){if(u()){const t=_(),r=e.startsWith("!"),a=e.endsWith(t);if(r&&!a||!r&&a)return!0}return e==="!other"?!1:e==="other"}function Q0(e,t,r){if(e.length===0)return"";const a=gc(xd(Sd(r))),b=gc({key:r.key,shift:r.shiftKey,alt:r.altKey,ctrl:r.ctrlKey,meta:r.metaKey||r.ctrlKey&&/macos|ios/.test(_()),cmd:!1,win:!1});for(let L=e.length-1;L>=0;L--)if((e[L].key===a||e[L].key===b)&&(!e[L].ifMode||e[L].ifMode===t))return e[L].command;return""}function Cd(e){let t=e;return o(t)&&(t=t.length>0?t[0]+"("+t.slice(1).join("")+")":""),t}function em(e,t){let r=[];if(typeof t=="string"){const L=hu[t];o(L)?r=L.slice():L&&r.push(L)}const a=Cd(t),b=new RegExp("^"+a.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");for(const L of e)b.test(Cd(L.command))&&r.push(L.key);return r.map(Eh)}function tm(e,t){if(e.ifPlatform&&!/^!?(macos|windows|android|ios|chromeos|other)$/.test(e.ifPlatform))throw new Error(`Unexpected platform "${e.ifPlatform}" for keybinding ${e.key}`);if(e.ifLayout!==void 0&&(t.score===0||!e.ifLayout.includes(t.id)))return;const r=xd(e.key);let a=e.ifPlatform;if(r.cmd){if(a&&a!=="macos"&&a!=="ios")throw new Error('Unexpected "cmd" modifier with platform "'+a+`"
"cmd" modifier can only be used with macOS or iOS platform.`);a||(a=_()==="ios"?"ios":"macos"),r.win=!1,r.cmd=!1,r.meta=!0}if(r.win){if(a&&a!=="windows")throw new Error('Unexpected "win" modifier with platform "'+a+`"
"win" modifier can only be used with Windows platform.`);a="windows",r.win=!1,r.cmd=!1,r.meta=!0}if(a&&!q0(a))return;if(/^\[.+\]$/.test(r.key))return h(l({},e),{key:gc(r)});const b=K0(r.key,t);if(!b)return h(l({},e),{key:gc(r)});if(b.shift&&r.shift||b.alt&&r.alt)throw new Error(`The keybinding ${e.key} (${Mh(e.command)}) is conflicting with the key combination ${gc(b)} using the ${t.displayName} keyboard layout`);return b.shift=b.shift||r.shift,b.alt=b.alt||r.alt,b.meta=r.meta,b.ctrl=r.ctrl,h(l({},e),{key:gc(b)})}function Mh(e){if(Array.isArray(e)){const t=[...e];return t.shift()+"("+t.map(r=>typeof r=="string"?`"${r}"`:r.toString()).join(", ")+")"}return e}function rm(e,t){const r=[],a=[];for(const b of e)try{const L=tm(b,t);if(!L)continue;const N=a.find(J=>J.key===L.key&&J.ifMode===L.ifMode);if(N)throw new Error(`Ambiguous key binding ${b.key} (${Mh(b.command)}) matches ${N.key} (${Mh(N.command)}) with the ${t.displayName} keyboard layout`);a.push(L)}catch(L){L instanceof Error&&r.push(L.message)}return[a,r]}var nm=class extends Xt{constructor(){super("latex")}createAtom(e){return new di(e)}onPaste(e,t){if(!t)return!1;const r=typeof t=="string"?t:t.getData("application/x-latex")||t.getData("text/plain");return r&&e.model.contentWillChange({inputType:"insertFromPaste",data:r})?(e.stopCoalescingUndo(),e.stopRecording(),this.insert(e.model,r)&&(e.startRecording(),e.snapshot("paste"),e.model.contentDidChange({inputType:"insertFromPaste"}),wn(e)),e.startRecording(),!0):!1}insert(e,t,r){if(!e.contentWillChange({data:t,inputType:"insertText"}))return!1;r||(r={}),r.insertionMode||(r.insertionMode="replaceSelection"),r.selectionMode||(r.selectionMode="placeholder");const{silenceNotifications:a}=e;r.silenceNotifications&&(e.silenceNotifications=!0);const b=e.silenceNotifications;e.silenceNotifications=!0,r.insertionMode==="replaceSelection"&&!e.selectionIsCollapsed?e.deleteAtoms(ri(e.selection)):r.insertionMode==="replaceAll"?(e.root.setChildren([],"body"),e.position=0):r.insertionMode==="insertBefore"?e.collapseSelection("backward"):r.insertionMode==="insertAfter"&&e.collapseSelection("forward");const L=[];for(const ie of t)I.test(ie)&&L.push(new di(ie));let N=e.at(e.position);if(N instanceof bu&&(N=N.lastChild),!(N.parent instanceof bu)){const ie=new bu("");N.parent.addChildAfter(ie,N),N=ie.firstChild}const J=N.parent.addChildrenAfter(L,N);return e.silenceNotifications=b,r.selectionMode==="before"||(r.selectionMode==="item"?e.setSelection(e.anchor,e.offsetOf(J)):J&&(e.position=e.offsetOf(J))),e.contentDidChange({data:t,inputType:"insertText"}),e.silenceNotifications=a,!0}};function im(e){return e.atoms.find(t=>t.type==="latexgroup")}function Mu(e){var t,r;const a=e.atoms.find(b=>b.type==="latexgroup");return a?(r=(t=a.body)==null?void 0:t.filter(b=>b.type==="latex"))!=null?r:[]:[]}function kd(e,t){var r;let a=0,b=!1;const L=Number.isFinite(t==null?void 0:t.before)?(r=t==null?void 0:t.before)!=null?r:0:e.lastOffset;for(;a<=L&&!b;){const ie=e.at(a);b=ie instanceof di&&ie.isSuggestion,b||a++}if(!b)return[void 0,void 0];let N=a,J=!1;for(;N<=L&&!J;){const ie=e.at(N);J=!(ie instanceof di&&ie.isSuggestion),J||N++}return[a-1,N-1]}new nm;function Pf(e){const t=Mu(e.model).filter(r=>r.isSuggestion);if(t.length!==0){e.model.position=e.model.offsetOf(t[0].leftSibling);for(const r of t)r.parent.removeChild(r)}}function Tu(e,t){var r;const{model:a}=e;Pf(e);for(const pe of Mu(a))pe.isError=!1;if(!a.selectionIsCollapsed||e.options.popoverPolicy==="off"){bc(e);return}const b=[];let L=a.at(a.position);for(;L&&L instanceof di&&/^[a-zA-Z\*]$/.test(L.value);)L=L.leftSibling;if(L&&L instanceof di&&L.value==="\\")for(b.push(L),L=L.rightSibling;L&&L instanceof di&&/^[a-zA-Z\*]$/.test(L.value);)b.push(L),L=L.rightSibling;const N=b.map(pe=>pe.value).join(""),J=ge(e,N);if(J.length===0){if(/^\\[a-zA-Z\*]+$/.test(N))for(const pe of b)pe.isError=!0;bc(e);return}const ie=(r=t==null?void 0:t.atIndex)!=null?r:0;e.suggestionIndex=ie<0?J.length-1:ie%J.length;const ue=J[e.suggestionIndex];if(ue!==N){const pe=b[b.length-1];pe.parent.addChildrenAfter([...ue.slice(N.length-ue.length)].map(Ee=>new di(Ee,{isSuggestion:!0})),pe),Sl(e,{interactive:!0})}sm(e,J)}function Ed(e){const[t,r]=kd(e,{before:e.position});if(t===void 0||r===void 0)return!1;let a=!1;return e.getAtoms([t,r]).forEach(b=>{b.isSuggestion&&(b.isSuggestion=!1,a=!0)}),a}function yc(e,t="accept",r){var a,b;bc(e);const L=im(e.model);if(!L)return!1;if(t==="accept-suggestion"||t==="accept-all"){const ue=Mu(e.model).filter(pe=>pe.isSuggestion);if(ue.length!==0){for(const pe of ue)pe.isSuggestion=!1;e.model.position=e.model.offsetOf(ue[ue.length-1])}if(t==="accept-suggestion")return ue.length!==0}const J=Mu(e.model).filter(ue=>!ue.isSuggestion).map(ue=>ue.value).join(""),ie=L.leftSibling;return L.parent.removeChild(L),e.model.position=e.model.offsetOf(ie),e.switchMode((a=r==null?void 0:r.mode)!=null?a:"math"),t==="reject"||(Xt.insert(e.model,J,{selectionMode:(b=r==null?void 0:r.selectItem)!=null&&b?"item":"placeholder",format:"latex",mode:"math"}),e.snapshot(),e.model.announce("replacement"),e.switchMode("math")),!0}function Rf(e){var t;let r=document.getElementById(e);return r?r.dataset.refcount=Number(Number.parseInt((t=r.dataset.refcount)!=null?t:"0")+1).toString():(r=document.createElement("div"),r.setAttribute("aria-hidden","true"),r.dataset.refcount="1",r.id=e,document.body.append(r)),r}function Th(e){var t;const r=document.getElementById(e);if(!r)return;const a=Number.parseInt((t=r.getAttribute("data-refcount"))!=null?t:"0");a<=1?r.remove():r.dataset.refcount=Number(a-1).toString()}function om(e,t){const r=new gr({from:e.context}),a=new et({mode:"math",type:"root",body:ii(t,{context:r})}),b=oc(xu(new mt(a.render(r),{classes:"ML__base"}),r));return sc(b,{classes:"ML__latex"}).toMarkup()}function sm(e,t){var r;if(t.length===0){bc(e);return}let a="";for(const[L,N]of t.entries()){const J=N,ie=om(e,N),ue=em(e.keybindings,J).join("<br>");a+=`<li role="button" data-command="${J}" ${L===e.suggestionIndex?"class=ML__popover__current":""}><span class="ML__popover__latex">${J}</span><span class="ML__popover__command">${ie}</span>`,ue&&(a+=`<span class="ML__popover__keybinding">${ue}</span>`),a+="</li>"}const b=am(e,`<ul>${a}</ul>`);Ah()&&((r=b.querySelector(".ML__popover__current"))==null||r.scrollIntoView({block:"nearest",inline:"nearest"})),setTimeout(()=>{var L;b&&!Ah()&&(b.classList.add("is-visible"),If(e),(L=b.querySelector(".ML__popover__current"))==null||L.scrollIntoView({block:"nearest",inline:"nearest"}))},32)}function Ah(){const e=document.getElementById("mathlive-suggestion-popover");return e?e.classList.contains("is-visible"):!1}function If(e,t){var r;if(!e.element||e.element.mathfield!==e||!Ah())return;if(((r=e.model.at(e.model.position))==null?void 0:r.type)!=="latex"){bc(e);return}if(t!=null&&t.deferred){setTimeout(()=>If(e),32);return}const a=Ds(e.field);if(!a)return;const b=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,L=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,N=window.innerWidth-document.documentElement.clientWidth,J=window.innerHeight-document.documentElement.clientHeight,ie=window.mathVirtualKeyboard.boundingRect.height,ue=document.getElementById("mathlive-suggestion-popover");a.x+ue.offsetWidth/2>L-N?ue.style.left=`${L-ue.offsetWidth-N}px`:a.x-ue.offsetWidth/2<0?ue.style.left="0":ue.style.left=`${a.x-ue.offsetWidth/2}px`;const pe=a.y-a.height;b-J-ie-a.y<pe?(ue.classList.add("ML__popover--reverse-direction"),ue.classList.remove("top-tip"),ue.classList.add("bottom-tip"),ue.style.top=`${a.y-a.height-ue.offsetHeight-15}px`):(ue.classList.remove("ML__popover--reverse-direction"),ue.classList.add("top-tip"),ue.classList.remove("bottom-tip"),ue.style.top=`${a.y+15}px`)}function bc(e){e.suggestionIndex=0;const t=document.getElementById("mathlive-suggestion-popover");t&&(t.classList.remove("is-visible"),t.innerHTML="")}function am(e,t){let r=document.getElementById("mathlive-suggestion-popover");return r||(r=Rf("mathlive-suggestion-popover"),io("suggestion-popover"),io("core"),r.addEventListener("pointerdown",a=>a.preventDefault()),r.addEventListener("click",a=>{let b=a.target;for(;b&&!b.dataset.command;)b=b.parentElement;b&&(yc(e,"reject"),Xt.insert(e.model,b.dataset.command,{selectionMode:"placeholder",format:"latex",mode:"math"}),e.dirty=!0,e.focus())})),r.innerHTML=window.MathfieldElement.createHTML(t),r}function lm(){document.getElementById("mathlive-suggestion-popover")&&(Th("mathlive-suggestion-popover"),n("suggestion-popover"),n("core"))}function cm(){const e=String(new Error().stack).replace(/^Error.*\n/,"").split(`
`);if(e.length===0)return console.error(`Can't use relative paths to specify assets location because the sourcefile location could not be determined (unexpected stack trace format "${new Error().stack}").`),"";let t=e[1],r=t.match(/http.*\.ts[\?:]/);return r&&(t=e[2]),r=t.match(/(https?:.*):[0-9]+:[0-9]+/),r||(r=t.match(/at (.*(\.ts))[\?:]/),r||(r=t.match(/at (.*(\.mjs|\.js))[\?:]/))),r?r[1]:(console.error(e),console.error(`Can't use relative paths to specify assets location because the source file location could not be determined (unexpected location "${t}").`),"")}var jf=null,Md,Td,Lh=((Td=(Md=globalThis==null?void 0:globalThis.document)==null?void 0:Md.currentScript)==null?void 0:Td.src)||cm();function Ad(e){return Za(this,null,function*(){if(/^(?:[a-z+]+:)?\/\//i.test(e))return new URL(e).href;if(jf===null)try{const t=yield fetch(Lh,{method:"HEAD"});t.status===200&&(jf=t.url)}catch(t){console.error(`Invalid URL "${e}" (relative to "${Lh}")`)}return new URL(e,jf!=null?jf:Lh).href})}function um(e,t,r={}){return new FontFace(e,`url(${t}.woff2) format('woff2')`,r)}var vo="not-loaded";function fm(){return Za(this,null,function*(){return vo="not-loaded",Bf()})}function Bf(){return Za(this,null,function*(){var e;if(vo!=="not-loaded")return;if(vo="loading",(e=getComputedStyle(document.documentElement).getPropertyValue("--ML__static-fonts"))!=null?e:!1){vo="ready";return}if(document.body.classList.remove("ML__fonts-did-not-load"),"fonts"in document){const r=["KaTeX_Main","KaTeX_Math","KaTeX_AMS","KaTeX_Caligraphic","KaTeX_Fraktur","KaTeX_SansSerif","KaTeX_Script","KaTeX_Typewriter","KaTeX_Size1","KaTeX_Size2","KaTeX_Size3","KaTeX_Size4"],a=Array.from(document.fonts).map(N=>N.family);if(r.every(N=>a.includes(N))){vo="ready";return}if(!window.MathfieldElement.fontsDirectory){vo="not-loaded";return}const b=yield Ad(window.MathfieldElement.fontsDirectory);if(!b){document.body.classList.add("ML__fonts-did-not-load"),vo="error";return}const L=[["KaTeX_Main-Regular"],["KaTeX_Main-BoldItalic",{style:"italic",weight:"bold"}],["KaTeX_Main-Bold",{weight:"bold"}],["KaTeX_Main-Italic",{style:"italic"}],["KaTeX_Math-Italic",{style:"italic"}],["KaTeX_Math-BoldItalic",{style:"italic",weight:"bold"}],["KaTeX_AMS-Regular"],["KaTeX_Caligraphic-Regular"],["KaTeX_Caligraphic-Bold",{weight:"bold"}],["KaTeX_Fraktur-Regular"],["KaTeX_Fraktur-Bold",{weight:"bold"}],["KaTeX_SansSerif-Regular"],["KaTeX_SansSerif-Bold",{weight:"bold"}],["KaTeX_SansSerif-Italic",{style:"italic"}],["KaTeX_Script-Regular"],["KaTeX_Typewriter-Regular"],["KaTeX_Size1-Regular"],["KaTeX_Size2-Regular"],["KaTeX_Size3-Regular"],["KaTeX_Size4-Regular"]].map(N=>um(N[0].replace(/-[a-zA-Z]+$/,""),`${b}/${N[0]}`,N[1]));try{(yield Promise.all(L.map(J=>{try{return J.load()}catch(ie){}}))).forEach(J=>document.fonts.add(J)),vo="ready";return}catch(N){console.error(`MathLive 0.98.5: The math fonts could not be loaded from "${b}"`,{cause:N}),document.body.classList.add("ML__fonts-did-not-load")}vo="error"}})}function hm(e){let t=0;for(let r=0;r<e.length;r++)t=t*31+e.charCodeAt(r),t=t|0;return Math.abs(t)}function wn(e,t){e&&(e.dirty||(e.dirty=!0,requestAnimationFrame(()=>{po(e)&&e.dirty&&(e.atomBoundsCache=new Map,Sl(e,t),e.atomBoundsCache=void 0)})))}function dm(e,t){var r;t=t!=null?t:{};const a=new gr({from:h(l({},e.context),{atomIdsSettings:{seed:t.forHighlighting?hm(et.serialize([e.model.root],{expandMacro:!1,defaultMode:e.options.defaultMode})):"random",groupNumbers:(r=t.forHighlighting)!=null?r:!1},letterShapeStyle:e.options.letterShapeStyle}),mathstyle:e.options.defaultMode==="inline-math"?"textstyle":"displaystyle"}),b=e.model.root.render(a);return sc(xu(b,a),{classes:e.hasEditablePrompts?"ML__latex ML__prompting":"ML__latex",attributes:{translate:"no","aria-hidden":"true"}})}function Ld(e,t){const{model:r}=e;r.root.caret=void 0,r.root.isSelected=!1,r.root.containsCaret=!0;for(const b of r.atoms)b.caret=void 0,b.isSelected=!1,b.containsCaret=!1;if(r.selectionIsCollapsed){const b=r.at(r.position);b.caret=e.model.mode;let L=b.parent;for(;L;)L.containsCaret=!0,L=L.parent}else{const b=r.getAtoms(r.selection,{includeChildren:!0});for(const L of b)L.isSelected=!0}return dm(e,t).toMarkup()}function Sl(e,t){if(!po(e))return;t!=null||(t={});const r=e.element.querySelector("[part=virtual-keyboard-toggle]");r&&(r.style.display=e.hasEditableContent?"":"none");const a=e.field;if(!a)return;const b=e.isSelectionEditable&&e.hasFocus(),L=a.classList.contains("ML__focused");L&&!b?a.classList.remove("ML__focused"):!L&&b&&a.classList.add("ML__focused");let N=Ld(e,t);const J=e.element.querySelector("[part=menu-toggle]");if(J&&(e.model.atoms.length<=1||e.disabled||e.readOnly&&!e.hasEditableContent||e.userSelect==="none"?J.style.display="none":J.style.display=""),e.model.atoms.length<=1){const ie=e.options.contentPlaceholder;ie&&(N+=`<span part=placeholder class="ML__content-placeholder">${oi(ie)}</span>`)}a.innerHTML=window.MathfieldElement.createHTML(N),Nf(e,t.interactive),e.dirty=!1}function Nf(e,t){const r=e.field;if(!r)return;for(const J of r.querySelectorAll(".ML__selection, .ML__contains-highlight"))J.remove();!(t!=null&&t)&&vo!=="error"&&vo!=="ready"&&setTimeout(()=>{vo==="ready"?Nf(e):setTimeout(()=>Nf(e),128)},32);const a=e.model,b=r.offsetWidth,L=r.getBoundingClientRect().width;let N=Math.floor(L)/b;if(N=isNaN(N)?1:N,a.selectionIsCollapsed){If(e,{deferred:!0});let J=a.at(a.position);for(;J&&J.type!=="prompt"&&!(J.containsCaret&&J.displayContainsHighlight);)J=J.parent;if(J!=null&&J.containsCaret&&J.displayContainsHighlight){const ie=pu(e,Ua(e,J),N);if(ie){ie.left/=N,ie.right/=N,ie.top/=N,ie.bottom/=N;const ue=document.createElement("div");ue.classList.add("ML__contains-highlight"),ue.style.position="absolute",ue.style.left=`${ie.left+1}px`,ue.style.top=`${Math.ceil(ie.top)}px`,ue.style.width=`${Math.ceil(ie.right-ie.left)}px`,ue.style.height=`${Math.ceil(ie.bottom-ie.top)}px`,r.insertBefore(ue,r.childNodes[0])}}return}for(const J of pm(gu(e,{excludeAtomsWithBackground:!0}))){J.left/=N,J.right/=N,J.top/=N,J.bottom/=N;const ie=document.createElement("div");ie.classList.add("ML__selection"),ie.style.position="absolute",ie.style.left=`${J.left}px`,ie.style.top=`${J.top}px`,ie.style.width=`${Math.ceil(J.right-J.left)}px`,ie.style.height=`${Math.ceil(J.bottom-J.top-1)}px`,r.insertBefore(ie,r.childNodes[0])}}function pm(e){let t=[];for(const r of e){let a=!1;for(const b of t)if(r.left===b.left&&r.right===b.right&&r.top===b.top&&r.bottom===b.bottom){a=!0;break}a||t.push(r)}e=t,t=[];for(const r of e){let a=0;for(const b of e)if(r.left>=b.left&&r.right<=b.right&&r.top>=b.top&&r.bottom<=b.bottom&&(a+=1,a>1))break;a===1&&t.push(r)}return t}var Od=3,Is;function oo(e,t){t=l({target:"mathfield",canUndo:!1,audioFeedback:void 0,changeContent:!1,changeSelection:!1},t!=null?t:{}),Is||(Is={});for(const r of Object.keys(e))console.assert(!Is[r],"Selector already defined: ",r),Is[r]=h(l({},t),{fn:e[r]})}function Oh(e){let t;if(Array.isArray(e)){if(e[0]==="performWithFeedback")return Oh(e[1]);t=e[0]}else t=e;return t=t.replace(/-\w/g,r=>r[1].toUpperCase()),Is[t]}function _c(e){var t;return(t=Oh(e))==null?void 0:t.target}function mm(e,t){var r;if(!t)return!1;let a,b=[],L=!1,N=!1;o(t)?(a=t[0],b=t.slice(1)):a=t,a=a.replace(/-\w/g,ue=>ue[1].toUpperCase());const J=Is[a],ie=J==null?void 0:J.target;if(ie==="model"){if(!e.isSelectionEditable&&(J!=null&&J.changeContent))return e.model.announce("plonk"),!1;/^(delete|add)/.test(a)&&(a!=="deleteBackward"&&e.flushInlineShortcutBuffer(),e.snapshot(a)),/^complete/.test(a)||Pf(e),Is[a].fn(e.model,...b),Tu(e),N=!0,L=!0}else if(ie==="virtual-keyboard")N=(r=window.mathVirtualKeyboard.executeCommand(t))!=null?r:!1,L=!0;else if(Is[a]){if(!e.isSelectionEditable&&(J!=null&&J.changeContent))return e.model.announce("plonk"),!1;/^(undo|redo)/.test(a)&&e.flushInlineShortcutBuffer(),N=Is[a].fn(e,...b),L=!0}else throw new Error(`Unknown command "${a}"`);return ie!=="virtual-keyboard"&&(!e.model.selectionIsCollapsed||J!=null&&J.changeSelection&&t!=="deleteBackward")&&(e.flushInlineShortcutBuffer(),J!=null&&J.changeContent||e.stopCoalescingUndo(),e.defaultStyle={}),N&&wn(e),L}function gm(e,t){var r;if(!e)return!1;e.focus(),Ep.keypressVibration&&y()&&navigator.vibrate(Od);const a=Oh(t);window.MathfieldElement.playSound((r=a==null?void 0:a.audioFeedback)!=null?r:"keypress");const b=e.executeCommand(t);return e.scrollIntoView(),b}oo({performWithFeedback:(e,t)=>gm(e,t)});function vm(e){return Tu(e,{atIndex:e.suggestionIndex+1}),!1}function ym(e){return Tu(e,{atIndex:e.suggestionIndex-1}),!1}oo({complete:yc},{target:"mathfield",audioFeedback:"return",canUndo:!0,changeContent:!0,changeSelection:!0}),oo({nextSuggestion:vm,previousSuggestion:ym},{target:"mathfield",audioFeedback:"keypress",changeSelection:!0});var Ff="mathlive#virtual-keyboard-message";function Dh(e){var t;return e.type!=="message"?!1:((t=e.data)==null?void 0:t.type)===Ff}var bm=class c0{constructor(){this.targetOrigin=window.origin,this.originValidator="none",this._boundingRect=new DOMRect(0,0,0,0),this._isShifted=!1,window.addEventListener("message",this),this.sendMessage("proxy-created"),this.listeners={}}static get singleton(){return this._singleton||(this._singleton=new c0),this._singleton}set alphabeticLayout(t){this.sendMessage("update-setting",{alphabeticLayout:t})}set layouts(t){this.sendMessage("update-setting",{layouts:t})}get normalizedLayouts(){return[]}set editToolbar(t){this.sendMessage("update-setting",{editToolbar:t})}set actionKeycap(t){this.sendMessage("update-setting",{actionKeycap:t})}set shiftKeycap(t){this.sendMessage("update-setting",{shiftKeycap:t})}set backspaceKeycap(t){this.sendMessage("update-setting",{backspaceKeycap:t})}set tabKeycap(t){this.sendMessage("update-setting",{tabKeycap:t})}set container(t){throw new Error("Container inside an iframe cannot be changed")}show(t){this.sendMessage("show",t)}hide(t){this.sendMessage("hide",t)}get isShifted(){return this._isShifted}get visible(){return this._boundingRect.height>0}set visible(t){t?this.show():this.hide()}get boundingRect(){return this._boundingRect}executeCommand(t){return this.sendMessage("execute-command",{command:t}),!0}updateToolbar(t){this.sendMessage("update-toolbar",t)}update(t){this.sendMessage("update-setting",t)}connect(){this.sendMessage("connect")}disconnect(){this.sendMessage("disconnect")}addEventListener(t,r,a){this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].has(r)||this.listeners[t].add(r)}dispatchEvent(t){return!this.listeners[t.type]||this.listeners[t.type].size===0?!0:(this.listeners[t.type].forEach(r=>{typeof r=="function"?r(t):r==null||r.handleEvent(t)}),!t.defaultPrevented)}removeEventListener(t,r,a){this.listeners[t]&&this.listeners[t].delete(r)}handleEvent(t){if(Dh(t)){if(!vu(t.origin,this.originValidator))throw new DOMException(`Message from unknown origin (${t.origin}) cannot be handled`,"SecurityError");this.handleMessage(t.data)}}handleMessage(t){const{action:r}=t;if(r==="execute-command"){const{command:a}=t;_c(a)==="virtual-keyboard"&&this.executeCommand(a);return}if(r==="synchronize-proxy"){this._boundingRect=t.boundingRect,this._isShifted=t.isShifted;return}if(r==="geometry-changed"){this._boundingRect=t.boundingRect,this.dispatchEvent(new Event("geometrychange"));return}}sendMessage(t,r={}){if(!window.top)throw new DOMException("A frame does not have access to the top window and can\u2018t communicate with the keyboard. Review virtualKeyboardTargetOrigin and originValidator on mathfields embedded in an iframe","SecurityError");window.top.postMessage(l({type:Ff,action:t},r),this.targetOrigin)}},Dd={numeric:{label:"123",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.numeric",rows:[[{latex:"x",shift:"y",variants:["y","z","t","r","x^2","x^n","x^{#?}","x_n","x_i","x_{#?}",{latex:"f(#?)",class:"small"},{latex:"g(#?)",class:"small"}]},{latex:"n",shift:"a",variants:["i","j","p","k","a","u"]},"[separator-5]","[7]","[8]","[9]","[/]","[separator-5]",{latex:"\\exponentialE",shift:"\\ln",variants:["\\exp","\\times 10^{#?}","\\ln","\\log_{10}","\\log"]},{latex:"\\imaginaryI",variants:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"]},{latex:"\\pi",shift:"\\sin",variants:["\\prod",{latex:"\\theta",aside:"theta"},{latex:"\\rho",aside:"rho"},{latex:"\\tau",aside:"tau"},"\\sin","\\cos","\\tan"]}],[{label:"<",latex:"<",class:"hide-shift",shift:{latex:"\\le",label:"\u2264"}},{label:">",latex:">",class:"hide-shift",shift:{latex:"\\ge",label:"\u2265"}},"[separator-5]","[4]","[5]","[6]","[*]","[separator-5]",{class:"hide-shift",latex:"#@^2}",shift:"#@^{\\prime}}"},{latex:"#@^{#0}}",class:"hide-shift",shift:"#@_{#?}"},{class:"hide-shift",latex:"\\sqrt{#0}",shift:{latex:"\\sqrt[#0]{#?}}"}}],["[(]","[)]","[separator-5]","[1]","[2]","[3]","[-]","[separator-5]",{latex:"\\int^{\\infty}_{0}\\!#?\\,\\mathrm{d}x",class:"small hide-shift",shift:"\\int",variants:[{latex:"\\int_{#?}^{#?}",class:"small"},{latex:"\\int",class:"small"},{latex:"\\iint",class:"small"},{latex:"\\iiint",class:"small"},{latex:"\\oint",class:"small"},"\\mathrm{d}x",{latex:"\\dfrac{\\mathrm{d}}{\\mathrm{d} x}",class:"small"},{latex:"\\frac{\\partial}{\\partial x}",class:"small"},"\\partial"]},{class:"hide-shift",latex:"\\forall",shift:"\\exists"},{label:"[backspace]",width:1}],[{label:"[shift]",width:2},"[separator-5]","[0]","[.]","[=]","[+]","[separator-5]","[left]","[right]",{label:"[action]",width:1}]]},greek:{label:"&alpha;&beta;&gamma;",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.greek",rows:[[{label:"<i>&#x03c6;</i>",class:"MLK__tex hide-shift",insert:"\\varphi",aside:"phi var.",shift:"\\Phi"},{label:"<i>&#x03c2;</i>",class:"MLK__tex hide-shift",insert:"\\varsigma",aside:"sigma var.",shift:"\\Sigma"},{label:"<i>&#x03f5;</i>",class:"MLK__tex hide-shift",insert:"\\epsilon",aside:"espilon",shift:'\\char"0190'},{label:"<i>&rho;</i>",class:"MLK__tex hide-shift",insert:"\\rho",aside:"rho",shift:'\\char"3A1'},{label:"<i>&tau;</i>",class:"MLK__tex hide-shift",insert:"\\tau",aside:"tau",shift:'\\char"3A4'},{label:"<i>&upsilon;</i>",class:"MLK__tex hide-shift",insert:"\\upsilon",aside:"upsilon",shift:"\\Upsilon"},{label:"<i>&theta;</i>",class:"MLK__tex hide-shift",insert:"\\theta",aside:"theta",shift:"\\Theta"},{label:"<i>&iota;</i>",class:"MLK__tex hide-shift",insert:"\\iota",aside:"iota",shift:'\\char"399'},{label:"<i>&omicron;</i>",class:"MLK__tex hide-shift",insert:"\\omicron",aside:"omicron",shift:'\\char"39F'},{label:"<i>&pi;</i>",class:"MLK__tex hide-shift",insert:"\\pi",aside:"pi",shift:"\\Pi"}],["[separator-5]",{label:"<i>&alpha;</i>",class:"MLK__tex hide-shift",insert:"\\alpha",aside:"alpha",shift:'\\char"391'},{label:"<i>&sigma;</i>",class:"MLK__tex hide-shift",insert:"\\sigma",aside:"sigma",shift:"\\Sigma"},{label:"<i>&delta;</i>",class:"MLK__tex hide-shift",insert:"\\delta",aside:"delta",shift:"\\Delta"},{latex:"\\phi",class:"MLK__tex hide-shift",insert:"\\phi",aside:"phi",shift:"\\Phi"},{label:"<i>&gamma;</i>",class:"MLK__tex hide-shift",insert:"\\gamma",aside:"gamma",shift:"\\Gamma"},{label:"<i>&eta;</i>",class:"MLK__tex hide-shift",insert:"\\eta",aside:"eta",shift:'\\char"397'},{label:"<i>&xi;</i>",class:"MLK__tex hide-shift",insert:"\\xi",aside:"xi",shift:"\\Xi"},{label:"<i>&kappa;</i>",class:"MLK__tex hide-shift",insert:"\\kappa",aside:"kappa",shift:"\\Kappa"},{label:"<i>&lambda;</i>",class:"MLK__tex hide-shift",insert:"\\lambda",aside:"lambda",shift:"\\Lambda"},"[separator-5]"],["[shift]",{label:"<i>&zeta;</i>",class:"MLK__tex hide-shift",insert:"\\zeta",aside:"zeta",shift:'\\char"396'},{label:"<i>&chi;</i>",class:"MLK__tex hide-shift",insert:"\\chi",aside:"chi",shift:'\\char"3A7'},{label:"<i>&psi;</i>",class:"MLK__tex hide-shift",insert:"\\psi",aside:"zeta",shift:"\\Psi"},{label:"<i>&omega;</i>",class:"MLK__tex hide-shift",insert:"\\omega",aside:"omega",shift:"\\Omega"},{label:"<i>&beta;</i>",class:"MLK__tex hide-shift",insert:"\\beta",aside:"beta",shift:'\\char"392'},{label:"<i>&nu;</i>",class:"MLK__tex hide-shift",insert:"\\nu",aside:"nu",shift:'\\char"39D'},{label:"<i>&mu;</i>",class:"MLK__tex hide-shift",insert:"\\mu",aside:"mu",shift:'\\char"39C'},"[backspace]"],["[separator]",{label:"<i>&#x03b5;</i>",class:"MLK__tex",insert:"\\varepsilon",aside:"espilon var."},{label:"<i>&#x03d1;</i>",class:"MLK__tex",insert:"\\vartheta",aside:"theta var."},{label:"<i>&#x3f0;</i>",class:"MLK__tex",insert:"\\varkappa",aside:"kappa var."},{label:"<i>&#x03d6;</i>",class:"MLK__tex",insert:"\\varpi",aside:"pi var."},{label:"<i>&#x03f1;</i>",class:"MLK__tex",insert:"\\varrho",aside:"rho var."},"[left]","[right]","[action]"]]},symbols:{label:"&infin;\u2260\u2208",labelClass:"MLK__tex",tooltip:"keyboard.tooltip.symbols",rows:[[{latex:"\\sin",shift:"\\sin^{-1}",variants:[{class:"small",latex:"\\sinh"},{class:"small",latex:"\\sin^{-1}"},{class:"small",latex:"\\arsinh"}]},"\\ln",{latex:"\\mathrm{abs}",insert:"\\mathrm{abs}\\left(#0\\right)"},{latex:"\\rarr",shift:"\\rArr",variants:[{latex:"\\implies",aside:"implies"},{latex:"\\to",aside:"to"},"\\dashv",{latex:"\\roundimplies",aside:"round implies"}]},{latex:"\\exists",variants:["\\nexists"],shift:"\\nexists"},{latex:"\\in",shift:"\\notin",variants:["\\notin","\\owns"]},"\\cup",{latex:"\\overrightarrow{#@}",shift:"\\overleftarrow{#@}",variants:["\\overleftarrow{#@}","\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"]},{class:"small",latex:"\\lim_{#?}",shift:"\\lim_{x\\to\\infty}",variants:[{class:"small",latex:"\\liminf_{#?}"},{class:"small",latex:"\\limsup_{#?}"}]},"\\exponentialE"],[{latex:"\\cos",shift:"\\cos^{-1}",variants:[{class:"small",latex:"\\cosh"},{class:"small",latex:"\\cos^{-1}"},{class:"small",latex:"\\arcosh"}]},{latex:"\\log",shift:"\\log_{10}",variants:["\\log_{#0}","\\log_{10}"]},"\\left\\vert#0\\right\\vert",{latex:"\\larr",shift:"\\lArr",variants:[{latex:"\\impliedby",aside:"implied by"},{latex:"\\gets",aside:"gets"},"\\lArr","\\vdash",{latex:"\\models",aside:"models"}]},{latex:"\\forall",shift:"\\lnot",variants:[{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"}]},{latex:"\\ni",shift:"\\not\\owns"},"\\cap",{latex:"\\overline{#@}",shift:"\\underline{#@}",variants:["\\overbrace{#@}","\\overlinesegment{#@}","\\overleftrightarrow{#@}","\\overrightarrow{#@}","\\overleftarrow{#@}","\\overgroup{#@}","\\underbrace{#@}","\\underlinesegment{#@}","\\underleftrightarrow{#@}","\\underrightarrow{#@}","\\underleftarrow{#@}","\\undergroup{#@}"]},{class:"hide-shift",latex:"\\int",shift:"\\iint",variants:[{latex:"\\int_{#?}^{#?}",class:"small"},{latex:"\\int",class:"small"},{latex:"\\smallint",class:"small"},{latex:"\\iint",class:"small"},{latex:"\\iiint",class:"small"},{latex:"\\oint",class:"small"},"\\intop","\\iiint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"]},{latex:"\\pi",shift:"\\tau",variants:["\\tau"]}],[{latex:"\\tan",shift:"\\tan^{-1}",variants:[{class:"small",latex:"\\tanh"},{class:"small",latex:"\\tan^{-1}"},{class:"small",latex:"\\artanh"},{class:"small",latex:"\\arctan"},{class:"small",latex:"\\arctg"},{class:"small",latex:"\\tg"}]},{latex:"\\exp",insert:"\\exp\\left(#0\\right)",variants:["\\exponentialE^{#0}"]},"\\left\\Vert#0\\right\\Vert",{latex:"\\lrArr",shift:"\\leftrightarrow",variants:[{latex:"\\iff",aside:"if and only if"},"\\leftrightarrow","\\leftrightarrows","\\Leftrightarrow",{latex:"^\\biconditional",aside:"biconditional"}]},{latex:"\\vert",shift:"!"},{latex:"#@^{\\complement}",aside:"complement",variants:[{latex:"\\setminus",aside:"set minus"},{latex:"\\smallsetminus",aside:"small set minus"}]},{latex:"\\subset",shift:"\\subseteq",variants:["\\subset","\\subseteq","\\subsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsubseteq","\\supset","\\supseteq","\\supsetneq","\\supsetneqq","\\nsupset","\\nsupseteq"]},{latex:"#@^{\\prime}",shift:"#@^{\\doubleprime}",variants:["#@^{\\doubleprime}","#@\\degree"]},{latex:"\\mathrm{d}",shift:"\\partial",variants:["\\mathrm{d}x",{latex:"\\dfrac{\\mathrm{d}}{\\mathrm{d} x}",class:"small"},{latex:"\\frac{\\partial}{\\partial x}",class:"small"},"\\partial"]},{latex:"\\infty",variants:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"]}],[{label:"[shift]",width:2},{class:"box",latex:",",shift:";",variants:[";","?"]},{class:"box",latex:"\\colon",shift:"\\Colon",variants:[{latex:"\\Colon",aside:"such that",class:"box"},{latex:":",aside:"ratio",class:"box"},{latex:"\\vdots",aside:"",class:"box"},{latex:"\\ddots",aside:"",class:"box"},{latex:"\\ldotp",aside:"low dot",class:"box"},{latex:"\\cdotp",aside:"center dot",class:"box"},{latex:"\\ldots",aside:"low ellipsis",class:"box"},{latex:"\\cdots",aside:"center ellipsis",class:"box"},{latex:"\\therefore",aside:"therefore",class:"box"},{latex:"\\because",aside:"because",class:"box"}]},{class:"box",latex:"\\cdot",aside:"centered dot",shift:"\\ast",variants:["\\circ","\\bigcirc","\\bullet","\\odot","\\oslash","\\circledcirc","\\ast","\\star","\\times","\\doteq","\\doteqdot"]},"[separator]","[left]","[right]",{label:"[backspace]",width:1,class:"action hide-shift"},{label:"[action]",width:1}]]},compact:{label:"compact",rows:[["[+]","[-]","[*]","[/]","[=]","[.]","[(]","[)]","\\sqrt{#0}","#@^{#?}"],["[1]","[2]","[3]","[4]","[5]","[6]","[7]","[8]","[9]","[0]"],["[hr]"],["[undo]","[redo]","[separator]","[separator]","[separator]","[left]","[right]",{label:"[backspace]",class:"action hide-shift"},"[hide-keyboard]"]]},minimalist:{label:"minimalist",layers:[{style:`
.minimalist-backdrop {
display: flex;
justify-content: center;
}
.minimalist-container {
--keycap-height: 40px;
--keycap-max-width: 53px;
--keycap-small-font-size: 12px;
background: var(--keyboard-background);
padding: 20px;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
border: 1px solid var(--keyboard-border);
box-shadow: 0 0 32px rgb(0 0 0 / 30%);
}
`,backdrop:"minimalist-backdrop",container:"minimalist-container",rows:[["+","-","\\times",{latex:"\\frac{#@}{#0}",class:"small"},"=","[.]","(",")",{latex:"\\sqrt{#0}",class:"small"},{latex:"#@^{#?}",class:"small"}],["1","2","3","4","5","6","7","8","9","0"],["[hr]"],["[undo]","[redo]","[separator]","[separator]","[separator]","[left]","[right]",{label:"[backspace]",class:"action hide-shift"},"[hide-keyboard]"]]}]},"numeric-only":{label:"123",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.numeric",id:"numeric-only",rows:[["7","8","9","[separator]",{label:"[backspace]",width:2}],["4","5","6","[separator]","[separator]","[separator]"],["1","2","3","[separator]","[separator]","[separator]"],["0",{label:"[.]",variants:[]},"-","[separator]","[left]","[right]"]]}},zf={0:["\\varnothing","\\infty"],1:["\\frac{1}{#@}","#@^{-1}","\\times 10^{#?}","\\phi","\\imaginaryI"],2:["\\frac{1}{2}","#@^2","\\sqrt2","\\exponentialE"],3:["\\frac{1}{3}","#@^3","\\sqrt3","\\pi"],4:["\\frac{1}{4}","#@^4"],5:["\\frac{1}{5}","#@^5","\\sqrt5"],6:["\\frac{1}{6}","#@^6"],7:["\\frac{1}{7}","#@^7"],8:["\\frac{1}{8}","#@^8"],9:["\\frac{1}{9}","#@^9"],".":[".",",",";","\\colon"],",":["{,}",".",";","\\colon"],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"},"\xE0","\xE1","\xE2","\xE4","\xE6"],b:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"},"\xE7"],d:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn\u2019t"},"\xE8","\xE9","\xEA","\xEB"],g:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"},"\xEC","\xED","\xEE","\xEF"],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\mathbb{N}",aside:"set of natural numbers"},"\xF1"],o:["\xF8","\u0153","\xF2","\xF3","\xF4","\xF6","\u0153"],p:[{latex:"\\mathbb{P}",aside:"set of primes"}],q:[{latex:"\\mathbb{Q}",aside:"set of rational numbers"}],r:[{latex:"\\mathbb{R}",aside:"set of real numbers"}],u:["\xF9","\xFA","\xFB","\xFC"],z:[{latex:"\\mathbb{Z}",aside:"set of integers"}],y:["\xFD","\xFF"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space<br>\u207B\xB3\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\,\\char"2039',insert:"\\,",aside:"thin space<br>\xB3\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\:\\char"2039',insert:"\\:",aside:"medium space<br>\u2074\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\;\\char"2039',insert:"\\;",aside:"thick space<br>\u2075\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\ \\char"2039',insert:"\\ ",aside:"\u2153 em"},{latex:'\\char"203A\\enspace\\char"2039',insert:"\\enspace",aside:"\xBD em"},{latex:'\\char"203A\\quad\\char"2039',insert:"\\quad",aside:"1 em"},{latex:'\\char"203A\\qquad\\char"2039',insert:"\\qquad",aside:"2 em"}]},Au;function Pd(e,t){var r,a,b;const L=Ga.singleton;if(!L)return;const N=wc(e),J=(a=(r=L.getKeycap(N==null?void 0:N.id))==null?void 0:r.variants)!=null?a:"";if(typeof J=="string"&&!Rd(J)||Array.isArray(J)&&J.length===0){t==null||t();return}const ie={};let ue="";for(const Je of wm(J)){const pt=jd(Je),Xe=Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);ie[Xe]=pt;const[ot,gt]=Hf(pt);ue+=`<div id=${Xe} class="item ${gt}">${ot}</div>`}const pe=document.createElement("div");pe.setAttribute("aria-hidden","true"),pe.className="MLK__variant-panel",pe.style.height="auto";const Ee=Object.keys(ie).length;let De=5;Ee===1?De=1:Ee===2||Ee===4?De=2:Ee===3||Ee===5||Ee===6?De=3:Ee>=7&&Ee<14&&(De=4),pe.style.width=`calc(var(--variant-keycap-length) * ${De} + 12px)`,pe.innerHTML=Ep.createHTML(ue),Rs.open({root:(b=L==null?void 0:L.container)==null?void 0:b.querySelector(".ML__keyboard"),child:pe}),Au=new AbortController;const{signal:je}=Au,ze=e==null?void 0:e.getBoundingClientRect();if(ze){ze.top-pe.clientHeight<0&&(pe.style.width="auto",Ee<=6?pe.style.height="56px":Ee<=12?pe.style.height="108px":Ee<=18?pe.style.height="205px":pe.classList.add("compact"));const Je=Math.max(0,Math.min(window.innerWidth-pe.offsetWidth,(ze.left+ze.right-pe.offsetWidth)/2)),pt=ze.top-pe.clientHeight+5;pe.style.transform=`translate(${Je}px, ${pt}px)`,pe.classList.add("is-visible"),requestAnimationFrame(()=>{pe.addEventListener("pointerup",Xe=>{const ot=wc(Xe.target);!(ot!=null&&ot.id)||!ie[ot.id]||(Ph(ie[ot.id]),Lu(),t==null||t(),Xe.preventDefault())},{capture:!0,passive:!1,signal:je}),pe.addEventListener("pointerenter",Xe=>{const ot=wc(Xe.target);!(ot!=null&&ot.id)||!ie[ot.id]||ot.classList.add("is-active")},{capture:!0,signal:je}),pe.addEventListener("pointerleave",Xe=>{const ot=wc(Xe.target);!(ot!=null&&ot.id)||!ie[ot.id]||ot.classList.remove("is-active")},{capture:!0,signal:je}),window.addEventListener("pointercancel",()=>{Lu(),t==null||t()},{signal:je}),window.addEventListener("pointerup",()=>{Lu(),t==null||t()},{signal:je})})}}function Lu(){Au==null||Au.abort(),Au=null,Rs.state==="open"&&Rs.close()}function _m(e){if(e==="foreground-color"){const t=[];for(const r of Object.keys(D))t.push({class:"swatch-button",label:'<span style="border: 3px solid '+D[r]+'"></span>',command:["applyStyle",{color:r}]});return t}if(e==="background-color"){const t=[];for(const r of Object.keys(F))t.push({class:"swatch-button",label:'<span style="background:'+F[r]+'"></span>',command:["applyStyle",{backgroundColor:r}]});return t}}function Rd(e){return zf[e]!==void 0}function wm(e){var t;return typeof e!="string"?e:(zf[e]||(zf[e]=(t=_m(e))!=null?t:[]),zf[e])}function xm(e){return typeof e=="string"?e:Object.entries(e).map(([t,r])=>`${t}:${r} !important`).join(";")}function Sm(e){return Object.keys(e).map(t=>`${t} {${xm(e[t])}}`).join("")}function Ou(e){if(!e)return"";const t=new gr,r=new et({mode:"math",type:"root",body:ii(e,{context:t,args:b=>b==="@"?"{\\class{ML__box-placeholder}{\\blacksquare}}":"\\placeholder{}"})}),a=oc(xu(new mt(r.render(t),{classes:"ML__base"}),t));return sc(a,{classes:"ML__latex"}).toMarkup()}function Du(e){var t;if(Array.isArray(e))return e.map(a=>Du(a)).flat();const r=typeof e=="string"?{markup:e}:e;return"rows"in r&&Array.isArray(r.rows)&&(r.rows=r.rows.map(a=>a.map(b=>jd(b)))),(t=r.id)!=null||(r.id="ML__layer_"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36)),[r]}function Cm(){var e,t;let a=window.mathVirtualKeyboard.alphabeticLayout;if(a==="auto"){const J=Eu();J&&(a=J.virtualLayout),(!a||a==="auto")&&(a=(e={fr:"azerty",be:"azerty",al:"qwertz",ba:"qwertz",cz:"qwertz",de:"qwertz",hu:"qwertz",sk:"qwertz",ch:"qwertz"}[w.locale.slice(0,2)])!=null?e:"qwerty")}const b={qwerty:["qwertyuiop"," asdfghjkl ","^zxcvbnm~"],azerty:["azertyuiop","qsdfghjklm","^ wxcvbn ~"],qwertz:["qwertzuiop"," asdfghjkl ","^yxcvbnm~"],dvorak:["^ pyfgcrl ","aoeuidhtns","qjkxbmwvz~"],colemak:[" qwfpgjluy ","arstdhneio","^zxcvbkm~"]},L=(t=b[a])!=null?t:b.qwerty,N=a==="azerty"?[[{label:"1",variants:"1"},{label:"2",shift:{latex:"\xE9"},variants:"2"},{label:"3",shift:{latex:"\xF9"},variants:"3"},{label:"4",variants:"4"},{label:"5",shift:{label:"(",latex:"("},variants:"5"},{label:"6",shift:{label:")",latex:")"},variants:"6"},{label:"7",shift:{latex:"\xE8"},variants:"7"},{label:"8",shift:{latex:"\xEA"},variants:"8"},{label:"9",shift:{latex:"\xE7"},variants:"9"},{label:"0",shift:{latex:"\xE0"},variants:"0"}]]:[[{label:"1",variants:"1"},{label:"2",variants:"2"},{label:"3",variants:"3"},{label:"4",variants:"4"},{label:"5",shift:{latex:"\\frac{#@}{#?}"},variants:"5"},{label:"6",shift:{latex:"#@^#?"},variants:"6"},{label:"7",variants:"7"},{label:"8",shift:{latex:"\\times"},variants:"8"},{label:"9",shift:{label:"(",latex:"("},variants:"9"},{label:"0",shift:{label:")",latex:")"},variants:"0"}]];for(const J of L){const ie=[];for(const ue of J)/[a-z]/.test(ue)?ie.push({label:ue,class:"hide-shift",shift:{label:ue.toUpperCase()},variants:Rd(ue)?ue:void 0}):ue==="~"?a!=="dvorak"?ie.push("[backspace]"):ie.push({label:"[backspace]",width:1}):ue==="^"?ie.push("[shift]"):ue===" "&&ie.push("[separator-5]");N.push(ie)}return N.push(["[-]","[+]","[=]",{label:" ",width:1.5},{label:",",shift:";",variants:".",class:"hide-shift"},"[.]","[left]","[right]",{label:"[action]",width:1.5}]),{label:"abc",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.alphabetic",layers:Du({rows:N})}}function Id(e){if(e==="alphabetic")return Cm();if(typeof e=="string")return console.assert(Dd[e]!==void 0,`MathLive 0.98.5: unknown keyboard layout "${e}"`),Id(Dd[e]);let t;if("rows"in e&&Array.isArray(e.rows)){console.assert(!("layers"in e||"markup"in e),'MathLive 0.98.5: when providing a "rows" property, "layers" and "markup" are ignored');const b=e,{rows:L}=b,N=d(b,["rows"]);t=h(l({},N),{layers:Du({rows:e.rows})})}else if("markup"in e&&typeof e.markup=="string"){const b=e,{markup:L}=b,N=d(b,["markup"]);t=h(l({},N),{layers:Du(e.markup)})}else t=l({},e),"layers"in e?t.layers=Du(e.layers):console.error('MathLive 0.98.5: provide either a "rows", "markup" or "layers" property');let r=!1,a=!1;for(const b of t.layers)if(b.rows)for(const L of b.rows.flat()){xc(L)&&(r=!0);const N=L.command;typeof N=="string"&&["undo","redo","cut","copy","paste"].includes(N)&&(a=!0)}return(!("displayShiftedKeycaps"in e)||e.displayShiftedKeycaps===void 0)&&(t.displayShiftedKeycaps=r),(!("displayEditToolbar"in e)||e.displayEditToolbar===void 0)&&(t.displayEditToolbar=!a),t}function km(e,t){var r,a;let b='<div class="left">';if(e.normalizedLayouts.length>1)for(const[L,N]of e.normalizedLayouts.entries()){const J=N,ie=[L===t?"selected":"layer-switch"];J.tooltip&&ie.push("MLK__tooltip"),J.labelClass&&ie.push(...J.labelClass.split(" ")),b+=`<div class="${ie.join(" ")}"`,J.tooltip&&(b+=" data-tooltip='"+((r=A(J.tooltip))!=null?r:J.tooltip)+"' "),L!==t&&(b+=`data-layer="${J.layers[0].id}"`),b+=`>${(a=J.label)!=null?a:"untitled"}</div>`}return b+="</div>",b}function Em(e,t){let r="";if(e.editToolbar==="none")return"";const b=[];t.selectionIsCollapsed?b.push("undo","redo","pasteFromClipboard"):b.push("cutToClipboard","copyToClipboard","pasteFromClipboard");const L={undo:`<div class='action ${t.canUndo===!1?"disabled":""}'
data-command='"undo"'
data-tooltip='${A("tooltip.undo")}'>
<svg><use xlink:href='#svg-undo' /></svg>
</div>`,redo:`<div class='action ${t.canRedo===!1?"disabled":""}'
data-command='"redo"'
data-tooltip='${A("tooltip.redo")}'>
<svg><use xlink:href='#svg-redo' /></svg>
</div>`,cutToClipboard:`
<div class='action'
data-command='"cutToClipboard"'
data-tooltip='${A("tooltip.cut to clipboard")}'>
<svg><use xlink:href='#svg-cut' /></svg>
</div>
`,copyToClipboard:`
<div class='action'
data-command='"copyToClipboard"'
data-tooltip='${A("tooltip.copy to clipboard")}'>
<svg><use xlink:href='#svg-copy' /></svg>
</div>
`,pasteFromClipboard:`
<div class='action'
data-command='"pasteFromClipboard"'
data-tooltip='${A("tooltip.paste from clipboard")}'>
<svg><use xlink:href='#svg-paste' /></svg>
</div>
`};return r+=b.map(N=>L[N]).join(""),r}function Mm(e){for(const t of e)Tm(t)}function Tm(e){const t=Ga.singleton;if(!t)return;const r={};if(!e.id){if(e.hasAttribute("data-label")&&(r.label=e.dataset.label),e.hasAttribute("data-latex")&&(r.latex=e.dataset.latex),e.hasAttribute("data-key")&&(r.key=e.dataset.key),e.hasAttribute("data-insert")&&(r.insert=e.dataset.insert),e.hasAttribute("data-variants")&&(r.variants=e.dataset.variants),e.hasAttribute("data-aside")&&(r.aside=e.dataset.aside),e.className&&(r.class=e.className),!r.label&&!r.latex&&!r.key&&!r.insert&&(r.latex=e.innerText,r.label=e.innerHTML),e.hasAttribute("data-command"))try{r.command=JSON.parse(e.dataset.command)}catch(a){}e.id=t.registerKeycap(r)}if(!e.innerHTML){const[a,b]=Hf(r);e.innerHTML=window.MathfieldElement.createHTML(a)}}function Am(){io("virtual-keyboard"),io("core"),Bf()}function Lm(){n("core"),n("virtual-keyboard")}var Om=`<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="svg-delete-backward" viewBox="0 0 576 512">
<path d="M432.1 208.1L385.9 256L432.1 303C442.3 312.4 442.3 327.6 432.1 336.1C423.6 346.3 408.4 346.3 399 336.1L352 289.9L304.1 336.1C295.6 346.3 280.4 346.3 271 336.1C261.7 327.6 261.7 312.4 271 303L318.1 256L271 208.1C261.7 199.6 261.7 184.4 271 175C280.4 165.7 295.6 165.7 304.1 175L352 222.1L399 175C408.4 165.7 423.6 165.7 432.1 175C442.3 184.4 442.3 199.6 432.1 208.1V208.1zM512 64C547.3 64 576 92.65 576 128V384C576 419.3 547.3 448 512 448H205.3C188.3 448 172 441.3 160 429.3L9.372 278.6C3.371 272.6 0 264.5 0 256C0 247.5 3.372 239.4 9.372 233.4L160 82.75C172 70.74 188.3 64 205.3 64L512 64zM528 128C528 119.2 520.8 112 512 112H205.3C201 112 196.9 113.7 193.9 116.7L54.63 256L193.9 395.3C196.9 398.3 201 400 205.3 400H512C520.8 400 528 392.8 528 384V128z"/>
</symbol>
<symbol id="svg-shift" viewBox="0 0 384 512">
<path d="M2.438 252.3C7.391 264.2 19.06 272 32 272h80v160c0 26.51 21.49 48 48 48h64C250.5 480 272 458.5 272 432v-160H352c12.94 0 24.61-7.797 29.56-19.75c4.953-11.97 2.219-25.72-6.938-34.88l-160-176C208.4 35.13 200.2 32 192 32S175.6 35.13 169.4 41.38l-160 176C.2188 226.5-2.516 240.3 2.438 252.3zM192 86.63L313.4 224H224v208H160V224H70.63L192 86.63z"/>
</symbol>
<symbol id="svg-commit" viewBox="0 0 512 512">
<path d="M135 432.1l-128-128C2.344 300.3 0 294.2 0 288s2.344-12.28 7.031-16.97l128-128c9.375-9.375 24.56-9.375 33.94 0s9.375 24.56 0 33.94L81.94 264H464v-208C464 42.75 474.8 32 488 32S512 42.75 512 56V288c0 13.25-10.75 24-24 24H81.94l87.03 87.03c9.375 9.375 9.375 24.56 0 33.94S144.4 442.3 135 432.1z"/>
</symbol>
<symbol id="circle-plus" viewBox="0 0 512 512"><path d="M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM232 344c0 13.3 10.7 24 24 24s24-10.7 24-24V280h64c13.3 0 24-10.7 24-24s-10.7-24-24-24H280V168c0-13.3-10.7-24-24-24s-24 10.7-24 24v64H168c-13.3 0-24 10.7-24 24s10.7 24 24 24h64v64z"/></symbol>
<symbol id="svg-command" viewBox="0 0 640 512">
<path d="M34.495 36.465l211.051 211.05c4.686 4.686 4.686 12.284 0 16.971L34.495 475.535c-4.686 4.686-12.284 4.686-16.97 0l-7.071-7.07c-4.686-4.686-4.686-12.284 0-16.971L205.947 256 10.454 60.506c-4.686-4.686-4.686-12.284 0-16.971l7.071-7.07c4.686-4.687 12.284-4.687 16.97 0zM640 468v-10c0-6.627-5.373-12-12-12H300c-6.627 0-12 5.373-12 12v10c0 6.627 5.373 12 12 12h328c6.627 0 12-5.373 12-12z"/>
</symbol>
<symbol id="svg-undo" viewBox="0 0 512 512">
<path d="M20 8h10c6.627 0 12 5.373 12 12v110.625C85.196 57.047 165.239 7.715 256.793 8.001 393.18 8.428 504.213 120.009 504 256.396 503.786 393.181 392.834 504 256 504c-63.926 0-122.202-24.187-166.178-63.908-5.113-4.618-5.354-12.561-.482-17.433l7.069-7.069c4.503-4.503 11.749-4.714 16.482-.454C150.782 449.238 200.935 470 256 470c117.744 0 214-95.331 214-214 0-117.744-95.331-214-214-214-82.862 0-154.737 47.077-190.289 116H180c6.627 0 12 5.373 12 12v10c0 6.627-5.373 12-12 12H20c-6.627 0-12-5.373-12-12V20c0-6.627 5.373-12 12-12z"/>
</symbol>
<symbol id="svg-redo" viewBox="0 0 512 512">
<path d="M492 8h-10c-6.627 0-12 5.373-12 12v110.625C426.804 57.047 346.761 7.715 255.207 8.001 118.82 8.428 7.787 120.009 8 256.396 8.214 393.181 119.166 504 256 504c63.926 0 122.202-24.187 166.178-63.908 5.113-4.618 5.354-12.561.482-17.433l-7.069-7.069c-4.503-4.503-11.749-4.714-16.482-.454C361.218 449.238 311.065 470 256 470c-117.744 0-214-95.331-214-214 0-117.744 95.331-214 214-214 82.862 0 154.737 47.077 190.289 116H332c-6.627 0-12 5.373-12 12v10c0 6.627 5.373 12 12 12h160c6.627 0 12-5.373 12-12V20c0-6.627-5.373-12-12-12z"/>
</symbol>
<symbol id="svg-arrow-left" viewBox="0 0 320 512">
<path d="M206.7 464.6l-183.1-191.1C18.22 267.1 16 261.1 16 256s2.219-11.97 6.688-16.59l183.1-191.1c9.152-9.594 24.34-9.906 33.9-.7187c9.625 9.125 9.938 24.37 .7187 33.91L73.24 256l168 175.4c9.219 9.5 8.906 24.78-.7187 33.91C231 474.5 215.8 474.2 206.7 464.6z"/>
</symbol>
<symbol id="svg-arrow-right" viewBox="0 0 320 512">
<path d="M113.3 47.41l183.1 191.1c4.469 4.625 6.688 10.62 6.688 16.59s-2.219 11.97-6.688 16.59l-183.1 191.1c-9.152 9.594-24.34 9.906-33.9 .7187c-9.625-9.125-9.938-24.38-.7187-33.91l168-175.4L78.71 80.6c-9.219-9.5-8.906-24.78 .7187-33.91C88.99 37.5 104.2 37.82 113.3 47.41z"/>
</symbol>
<symbol id="svg-tab" viewBox="0 0 448 512">
<path d="M32 217.1c0-8.8 7.2-16 16-16h144v-93.9c0-7.1 8.6-10.7 13.6-5.7l143.5 143.1c6.3 6.3 6.3 16.4 0 22.7L205.6 410.4c-5 5-13.6 1.5-13.6-5.7v-93.9H48c-8.8 0-16-7.2-16-16v-77.7m-32 0v77.7c0 26.5 21.5 48 48 48h112v61.9c0 35.5 43 53.5 68.2 28.3l143.6-143c18.8-18.8 18.8-49.2 0-68L228.2 78.9c-25.1-25.1-68.2-7.3-68.2 28.3v61.9H48c-26.5 0-48 21.6-48 48zM436 64h-8c-6.6 0-12 5.4-12 12v360c0 6.6 5.4 12 12 12h8c6.6 0 12-5.4 12-12V76c0-6.6-5.4-12-12-12z"/>
</symbol>
<symbol id="svg-paste" viewBox="0 0 512 512"><path d="M160 32c11.6 0 21.3 8.2 23.5 19.2C185 58.6 191.6 64 199.2 64H208c8.8 0 16 7.2 16 16V96H96V80c0-8.8 7.2-16 16-16h8.8c7.6 0 14.2-5.4 15.7-12.8C138.7 40.2 148.4 32 160 32zM64 64h2.7C65 69 64 74.4 64 80V96c0 17.7 14.3 32 32 32H224c17.7 0 32-14.3 32-32V80c0-5.6-1-11-2.7-16H256c17.7 0 32 14.3 32 32h32c0-35.3-28.7-64-64-64H210.6c-9-18.9-28.3-32-50.6-32s-41.6 13.1-50.6 32H64C28.7 32 0 60.7 0 96V384c0 35.3 28.7 64 64 64H192V416H64c-17.7 0-32-14.3-32-32V96c0-17.7 14.3-32 32-32zM288 480c-17.7 0-32-14.3-32-32V192c0-17.7 14.3-32 32-32h96v56c0 22.1 17.9 40 40 40h56V448c0 17.7-14.3 32-32 32H288zM416 165.3L474.7 224H424c-4.4 0-8-3.6-8-8V165.3zM448 512c35.3 0 64-28.7 64-64V235.9c0-12.7-5.1-24.9-14.1-33.9l-59.9-59.9c-9-9-21.2-14.1-33.9-14.1H288c-35.3 0-64 28.7-64 64V448c0 35.3 28.7 64 64 64H448z"/></symbol>
<symbol id="svg-cut" viewBox="0 0 512 512"><path d="M485.6 444.2L333.6 314.9C326.9 309.2 326.1 299.1 331.8 292.4C337.5 285.6 347.6 284.8 354.4 290.5L506.4 419.8C513.1 425.5 513.9 435.6 508.2 442.4C502.5 449.1 492.4 449.9 485.6 444.2zM485.7 67.76C492.5 62.07 502.5 62.94 508.2 69.69C513.9 76.45 513.1 86.55 506.3 92.24L208.5 343.1C218.3 359.7 224 379.2 224 400C224 461.9 173.9 512 112 512C50.14 512 0 461.9 0 400C0 338.1 50.14 288 112 288C141.5 288 168.4 299.4 188.4 318.1L262.2 256L188.4 193.9C168.4 212.6 141.5 224 112 224C50.14 224 0 173.9 0 112C0 50.14 50.14 0 112 0C173.9 0 224 50.14 224 112C224 132.8 218.3 152.3 208.5 168.9L287 235.1L485.7 67.76zM32 112C32 156.2 67.82 192 112 192C156.2 192 192 156.2 192 112C192 67.82 156.2 32 112 32C67.82 32 32 67.82 32 112zM112 480C156.2 480 192 444.2 192 400C192 355.8 156.2 320 112 320C67.82 320 32 355.8 32 400C32 444.2 67.82 480 112 480z"/></symbol>
<symbol id="svg-copy" viewBox="0 0 512 512"><path d="M272 416C263.2 416 256 423.2 256 432V448c0 17.67-14.33 32-32 32H64c-17.67 0-32-14.33-32-32V192c0-17.67 14.33-32 32-32h112C184.8 160 192 152.8 192 144C192 135.2 184.8 128 176 128H63.99c-35.35 0-64 28.65-64 64l.0098 256C0 483.3 28.65 512 64 512h160c35.35 0 64-28.65 64-64v-16C288 423.2 280.8 416 272 416zM502.6 86.63l-77.25-77.25C419.4 3.371 411.2 0 402.7 0H288C252.7 0 224 28.65 224 64v256c0 35.35 28.65 64 64 64h160c35.35 0 64-28.65 64-64V109.3C512 100.8 508.6 92.63 502.6 86.63zM416 45.25L466.7 96H416V45.25zM480 320c0 17.67-14.33 32-32 32h-160c-17.67 0-32-14.33-32-32V64c0-17.67 14.33-32 32-32h96l.0026 64c0 17.67 14.33 32 32 32H480V320z"/>
</symbol>
<symbol id="svg-angle-double-right" viewBox="0 0 512 512"><path d="M470.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 256 265.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160zm-352 160l160-160c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L210.7 256 73.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z"/>
</symbol>
<symbol id="svg-angle-double-left" viewBox="0 0 512 512"><path d="M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160zm352-160l-160 160c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L301.3 256 438.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0z"/>
</symbol>
<symbol id="svg-trash" viewBox="0 0 448 512">
<path d="M336 64l-33.6-44.8C293.3 7.1 279.1 0 264 0h-80c-15.1 0-29.3 7.1-38.4 19.2L112 64H24C10.7 64 0 74.7 0 88v2c0 3.3 2.7 6 6 6h26v368c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V96h26c3.3 0 6-2.7 6-6v-2c0-13.3-10.7-24-24-24h-88zM184 32h80c5 0 9.8 2.4 12.8 6.4L296 64H152l19.2-25.6c3-4 7.8-6.4 12.8-6.4zm200 432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V96h320v368zm-176-44V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12zm-80 0V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12zm160 0V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12z"/>
</symbol>
<symbol id="svg-keyboard-down" viewBox="0 0 576 512"><path d="M64 48c-8.8 0-16 7.2-16 16V240c0 8.8 7.2 16 16 16H512c8.8 0 16-7.2 16-16V64c0-8.8-7.2-16-16-16H64zM0 64C0 28.7 28.7 0 64 0H512c35.3 0 64 28.7 64 64V240c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V64zM159 359c9.4-9.4 24.6-9.4 33.9 0l95 95 95-95c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L305 505c-4.5 4.5-10.6 7-17 7s-12.5-2.5-17-7L159 393c-9.4-9.4-9.4-24.6 0-33.9zm1-167c0-8.8 7.2-16 16-16H400c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V192zM120 88h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H120c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16zm64 16c0-8.8 7.2-16 16-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H200c-8.8 0-16-7.2-16-16V104zm96-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H280c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16zm64 16c0-8.8 7.2-16 16-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H360c-8.8 0-16-7.2-16-16V104zm96-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H440c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16z"/></symbol>
</svg>`;function Dm(e){e.resetKeycapRegistry(),Am();const t=document.createElement("div");t.className="ML__keyboard";const r=document.createElement("div");r.className="MLK__plate",r.innerHTML=window.MathfieldElement.createHTML(Om+e.normalizedLayouts.map((N,J)=>Pm(e,N,J)).join(""));const a=document.createElement("div");a.className="MLK__backdrop",a.appendChild(r),t.appendChild(a),t.addEventListener("pointerdown",Im,{passive:!1});const b=t.querySelectorAll(".ML__edit-toolbar");if(b)for(const N of b)N.addEventListener("click",J=>{var ie,ue;let pe=J.target,Ee="";for(;pe&&!Ee;)Ee=(ie=pe==null?void 0:pe.getAttribute("data-command"))!=null?ie:"",pe=(ue=pe==null?void 0:pe.parentElement)!=null?ue:null;Ee&&e.executeCommand(JSON.parse(Ee))});Mm(t.querySelectorAll(".MLK__keycap, .action, .fnbutton, .bigfnbutton"));const L=t.querySelectorAll(".MLK__layer");console.assert(L.length>0,"No virtual keyboards available");for(const N of L)N.addEventListener("pointerdown",J=>J.preventDefault());return e.currentLayer=e.latentLayer,t}function Pm(e,t,r){const a=[];if(!("layers"in t))return"";for(const b of t.layers)a.push(`<div tabindex="-1" class="MLK__layer" id="${b.id}">`),(e.normalizedLayouts.length>1||t.displayEditToolbar)&&(a.push("<div class='MLK__toolbar' role='toolbar'>"),a.push(km(e,r)),t.displayEditToolbar&&a.push('<div class="ML__edit-toolbar right"></div>'),a.push("</div>")),a.push(Rm(e,b)),a.push("</div>");return a.join("")}function Rm(e,t){if(typeof t=="string")return t;let r="";if(typeof t.style=="string"?r+=`<style>${t.style}</style>`:typeof t.style=="object"&&(r+=`<style>${Sm(t.style)}</style>`),t.backdrop&&(r+=`<div class='${t.backdrop}'>`),t.container&&(r+=`<div class='${t.container}'>`),t.rows){r+="<div class=MLK__rows>";for(const a of t.rows){r+="<div dir='ltr' class=MLK__row>";for(const b of a)if(b){const L=e.registerKeycap(b),[N,J]=Hf(b);/(^|\s)separator/.test(J)?r+=`<div class="${J}"`:r+=`<div tabindex="-1" id="${L}" class="${J}"`,b.tooltip&&(r+=` data-tooltip="${b.tooltip}"`),r+=`>${N}</div>`}r+="</div>"}r+="</div>"}else t.markup&&(r+=t.markup);return t.container&&(r+="</div>"),t.backdrop&&(r+="</div>"),r}function Hf(e,t={shifted:!1}){var r,a,b,L,N,J,ie;let ue="",pe=(r=e.class)!=null?r:"";if(t.shifted&&xc(e)&&(pe+=" is-active"),t.shifted&&"shift"in e)typeof e.shift=="string"?ue=Ou(e.shift):typeof e.shift=="object"&&(ue=e.shift.label?e.shift.label:(a=Ou(e.shift.latex||e.shift.insert||"")||e.shift.key)!=null?a:""),typeof e.shift=="object"&&(pe=(L=(b=e.shift.class)!=null?b:e.class)!=null?L:"");else{if(ue=e.label?e.label:(N=Ou(e.latex||e.insert||"")||e.key)!=null?N:"",e.shift){let Ee;typeof e.shift=="string"?Ee=Ou(e.shift):e.shift.label?Ee=e.shift.label:Ee=(J=Ou(e.shift.latex||e.shift.insert||"")||e.shift.key)!=null?J:"",ue+=`<span class="MLK__shift">${Ee}</span>`}e.aside&&(ue+=`<aside>${e.aside}</aside>`)}return e.layer&&!/layer-switch/.test(pe)&&(pe+=" layer-switch"),/(^|\s)(separator|action|shift|fnbutton|bigfnbutton)($|\s)/.test(pe)||(pe+=" MLK__keycap"),!/\bw[0-9]+\b/.test(pe)&&e.width&&(pe+=(ie={0:" w0",.5:" w5",1.5:" w15",2:" w20",5:" w50"}[e.width])!=null?ie:""),[ue,pe||"MLK__keycap"]}var Cl={"[left]":{class:"action hide-shift",label:"<svg class=svg-glyph><use xlink:href=#svg-arrow-left /></svg>",command:["performWithFeedback","moveToPreviousChar"],shift:{label:"<svg class=svg-glyph><use xlink:href=#svg-angle-double-left /></svg>",command:["performWithFeedback","extendSelectionBackward"]}},"[right]":{class:"action hide-shift",label:"<svg class=svg-glyph><use xlink:href=#svg-arrow-right /></svg>",command:["performWithFeedback","moveToNextChar"],shift:{label:"<svg class=svg-glyph><use xlink:href=#svg-angle-double-right /></svg>",command:["performWithFeedback","extendSelectionForward"]}},"[up]":{class:"action hide-shift",label:"\u2191",command:["performWithFeedback","moveUp"],shift:{label:"\u219F",command:["performWithFeedback","extendSelectionUpward"]}},"[down]":{class:"action hide-shift",label:"\u2193",command:["performWithFeedback","moveDown"],shift:{label:"\u21A1",command:["performWithFeedback","extendSelectionDownward"]}},"[return]":{class:"action hide-shift",command:["performWithFeedback","commit"],shift:{command:["performWithFeedback","addRowAfter"]},width:1.5,label:"<svg class=svg-glyph><use xlink:href=#svg-commit /></svg>"},"[action]":{class:"action hide-shift",command:["performWithFeedback","commit"],shift:{label:"<svg class=svg-glyph><use xlink:href=#circle-plus /></svg>",command:["performWithFeedback","addRowAfter"]},width:1.5,label:"<svg class=svg-glyph><use xlink:href=#svg-commit /></svg>"},"[hr]":{class:"separator horizontal-rule"},"[hide-keyboard]":{class:"action",command:["hideVirtualKeyboard"],width:1.5,label:"<svg class=svg-glyph-lg><use xlink:href=#svg-keyboard-down /></svg>"},"[.]":{variants:".",command:["performWithFeedback","insertDecimalSeparator"],shift:",",class:"big-op hide-shift",label:"."},"[,]":{variants:",",command:["performWithFeedback","insertDecimalSeparator"],shift:".",class:"big-op hide-shift",label:","},"[+]":{variants:[{latex:"\\sum_{#0}^{#0}",class:"small"},"\\oplus"],latex:"+",label:"+",class:"big-op hide-shift",shift:{latex:"\\sum",insert:"\\sum",class:"small"}},"[-]":{variants:["\\pm","\\ominus"],latex:"-",label:"&#x2212;",shift:"\\pm",class:"big-op hide-shift"},"[/]":{class:"big-op hide-shift",shift:{class:"",latex:"\\frac{1}{#@}"},variants:["/","\\div","\\%","\\oslash"],latex:"\\frac{#@}{#?}",label:"&divide;"},"[*]":{variants:[{latex:"\\prod_{#0}^{#0}",class:"small"},"\\otimes","\\cdot"],latex:"\\cdot",label:"&times;",shift:{latex:"\\times"},class:"big-op hide-shift"},"[=]":{variants:["\\neq","\\equiv","\\varpropto","\\thickapprox","\\lt","\\gt","\\le","\\ge"],latex:"=",label:"=",shift:{label:"\u2260",latex:"\\ne"},class:"big-op hide-shift"},"[backspace]":{class:"action bottom right hide-shift",width:1.5,command:["performWithFeedback","deleteBackward"],label:"<svg class=svg-glyph><use xlink:href=#svg-delete-backward /></svg>",shift:{class:"action warning",label:"<svg class=svg-glyph><use xlink:href=#svg-trash /></svg>",command:"deleteAll"}},"[undo]":{class:"ghost if-can-undo",command:"undo",label:"<svg class=svg-glyph><use xlink:href=#svg-undo /></svg>",tooltip:"tooltip.undo"},"[redo]":{class:"ghost if-can-redo",command:"redo",label:"<svg class=svg-glyph><use xlink:href=#svg-redo /></svg>",tooltip:"tooltip.redo"},"[(]":{variants:[{latex:"\\lbrack",key:"["},"\\langle","\\lfloor","\\lceil",{latex:"\\lbrace",key:"{"}],key:"(",label:"(",shift:{label:"[",key:"["},class:"hide-shift"},"[)]":{variants:[{latex:"\\rbrack",key:"]"},"\\rangle","\\rfloor","\\rceil",{latex:"\\rbrace",key:"]"}],key:")",label:")",shift:{label:"]",latex:"\\rbrack"},class:"hide-shift"},"[0]":{variants:"0",latex:"0",label:"0",shift:"\\infty",class:"hide-shift"},"[1]":{variants:"1",latex:"1",label:"1",shift:"#@^{-1}",class:"hide-shift"},"[2]":{variants:"2",latex:"2",label:"2",shift:"#@^2",class:"hide-shift"},"[3]":{variants:"3",latex:"3",label:"3",shift:"#@^3",class:"hide-shift"},"[4]":{variants:"4",latex:"4",label:"4",shift:"#@^4",class:"hide-shift"},"[5]":{variants:"5",latex:"5",label:"5",shift:"#@^5",class:"hide-shift"},"[6]":{variants:"6",latex:"6",label:"6",shift:"#@^6",class:"hide-shift"},"[7]":{variants:"7",latex:"7",label:"7",shift:"#@^7",class:"hide-shift"},"[8]":{variants:"8",latex:"8",label:"8",shift:"#@^8",class:"hide-shift"},"[9]":{variants:"9",latex:"9",label:"9",shift:"#@^9",class:"hide-shift"},"[separator-5]":{class:"separator",width:.5},"[separator]":{class:"separator"},"[separator-10]":{class:"separator"},"[separator-15]":{class:"separator",width:1.5},"[separator-20]":{class:"separator",width:2},"[separator-50]":{class:"separator",width:5},"[shift]":{class:"shift bottom left",width:1.5,label:"<span class=caps-lock-indicator></span><svg class=svg-glyph><use xlink:href=#svg-shift /></svg>"},"[foreground-color]":{variants:"foreground-color",command:["applyStyle",{color:"red"}],label:"<span style='border-radius: 50%;width:22px;height:22px; border: 3px solid #cc2428; box-sizing: border-box'>"},"[background-color]":{variants:"background-color",command:["applyStyle",{backgroundColor:"yellow"}],label:"<span style='border-radius: 50%;width:22px;height:22px; background:#fff590; box-sizing: border-box'></span>"}};function jd(e){var t;if(typeof e=="string"){if(e==="[.]"&&window.MathfieldElement.decimalSeparator===","&&(e="[,]"),!Cl[e])return{latex:e};e={label:e}}let r;return"label"in e&&e.label&&Cl[e.label]&&(r=h(l(l({},Cl[e.label]),e),{label:Cl[e.label].label})),"key"in e&&e.key&&Cl[e.key]&&(r=h(l(l({},Cl[e.key]),e),{key:Cl[e.key].key})),r?(r.command==="insertDecimalSeparator"&&(r.label=(t=window.MathfieldElement.decimalSeparator)!=null?t:"."),e.label==="[action]"&&(r=l(l({},r),window.mathVirtualKeyboard.actionKeycap)),e.label==="[shift]"&&(r=l(l({},r),window.mathVirtualKeyboard.shiftKeycap)),e.label==="[backspace]"&&(r=l(l({},r),window.mathVirtualKeyboard.backspaceKeycap)),e.label==="[tab]"&&(r=l(l({},r),window.mathVirtualKeyboard.tabKeycap)),r):e}var Pu;function Im(e){var t;if(e.button!==0)return;const r=Ga.singleton;if(!r)return;let a=e.target;for(;a&&!a.getAttribute("data-layer");)a=a.parentElement;if(a){r.currentLayer=(t=a.getAttribute("data-layer"))!=null?t:"",e.preventDefault();return}const b=wc(e.target);if(!(b!=null&&b.id))return;const L=r.getKeycap(b.id);if(!L)return;console.assert(e.type==="pointerdown");const N=new AbortController,J=N.signal;b.classList.add("is-pressed"),b.addEventListener("pointerenter",Uf(N),{capture:!0,signal:J}),b.addEventListener("pointerleave",Uf(N),{capture:!0,signal:J}),b.addEventListener("pointercancel",Uf(N),{signal:J}),b.addEventListener("pointerup",Uf(N),{signal:J}),xc(L)&&(b.classList.add("is-active"),r.shiftPressCount++),L.variants&&(Pu&&clearTimeout(Pu),Pu=setTimeout(()=>{b.classList.contains("is-pressed")&&(b.classList.remove("is-pressed"),b.classList.add("is-active"),e.target&&"releasePointerCapture"in e.target&&e.target.releasePointerCapture(e.pointerId),Pd(b,()=>{N.abort(),b==null||b.classList.remove("is-active")}))},300)),e.preventDefault()}function Uf(e){return t=>{const r=wc(t.target);if(!(r!=null&&r.id))return;const a=Ga.singleton;if(!a)return;const b=a.getKeycap(r.id);if(b){if(t.type==="pointerenter"&&t.target===r&&t.isPrimary&&r.classList.add("is-pressed"),t.type==="pointercancel"){r.classList.remove("is-pressed"),xc(b)&&(a.shiftPressCount--,r.classList.toggle("is-active",a.isShifted)),e.abort();return}if(t.type==="pointerleave"&&t.target===r){r.classList.remove("is-pressed"),xc(b)&&(a.shiftPressCount--,r.classList.toggle("is-active",a.isShifted));return}if(t.type==="pointerup"){Pu&&clearTimeout(Pu),xc(b)?r.classList.toggle("is-active",a.isShifted):r.classList.contains("is-pressed")&&(r.classList.remove("is-pressed"),a.isShifted&&b.shift?typeof b.shift=="string"?a.executeCommand(["insert",b.shift,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]):Ph(b.shift):Ph(b),a.shiftPressCount===1&&!t.shiftKey&&(a.shiftPressCount=0)),e.abort(),t.preventDefault();return}}}}function Ph(e){var t;let r=e.command;!r&&e.insert&&(r=["insert",e.insert,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]),!r&&e.key&&(r=["typedText",e.key,{focus:!0,feedback:!0,simulateKeystroke:!0}]),!r&&e.latex&&(r=["insert",e.latex,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]),r||(r=["typedText",e.label,{focus:!0,feedback:!0,simulateKeystroke:!0}]),(t=Ga.singleton)==null||t.executeCommand(r)}function jm(e){if(e.nodeType!==1)return!1;const t=e.classList;return t.contains("MLK__keycap")||t.contains("shift")||t.contains("action")||t.contains("fnbutton")||t.contains("bigfnbutton")}function wc(e){if(!e)return;let t=e;for(;t&&!jm(t);)t=t.parentElement;return t!=null?t:void 0}function xc(e){return!!e.class&&/(^|\s)shift($|\s)/.test(e.class)}var Ga=class u0{constructor(){this.originalContainerBottomPadding=null,this.keycapRegistry={},this._shiftPressCount=0;var t,r,a;this.targetOrigin=window.origin,this.originValidator="none",this._alphabeticLayout="auto",this._layouts=Object.freeze(["default"]),this._editToolbar="default",this._container=(r=(t=window.document)==null?void 0:t.body)!=null?r:null,this._visible=!1,this._rebuilding=!1,this.observer=new ResizeObserver(b=>{this.adjustBoundingRect(),this.dispatchEvent(new Event("geometrychange")),this.sendMessage("geometry-changed",{boundingRect:this.boundingRect})}),this.listeners={};try{(a=window.top)==null||a.addEventListener("message",this)}catch(b){window.addEventListener("message",this)}document.body.addEventListener("focusin",b=>{const L=b.target;L!=null&&L.isConnected&&setTimeout(()=>{const N=Bd();N&&!N.readOnly&&N.mathVirtualKeyboardPolicy==="auto"&&m()&&this.show({animate:!0})},300)}),document.addEventListener("focusout",b=>{b.target.mathVirtualKeyboardPolicy!=="manual"&&setTimeout(()=>{Bd()||this.hide()},300)})}get currentLayer(){var t,r,a;return(a=(r=(t=this._element)==null?void 0:t.querySelector(".MLK__layer.is-visible"))==null?void 0:r.id)!=null?a:""}set currentLayer(t){var r;if(!this._element){this.latentLayer=t;return}let a=t?this._element.querySelector(`#${t}.MLK__layer`):null;a||(a=this._element.querySelector(".MLK__layer")),a&&((r=this._element.querySelector(".MLK__layer.is-visible"))==null||r.classList.remove("is-visible"),a.classList.add("is-visible")),this.render()}get shiftPressCount(){return this._shiftPressCount}set shiftPressCount(t){var r;this._shiftPressCount=t>2||t<0?0:t,(r=this._element)==null||r.classList.toggle("is-caps-lock",this.shiftPressCount===2),this.render()}get isShifted(){return this._shiftPressCount>0}resetKeycapRegistry(){this.keycapRegistry={}}registerKeycap(t){const r="ML__k"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);return this.keycapRegistry[r]=t,r}getKeycap(t){return t?this.keycapRegistry[t]:void 0}getLayer(t){const r=this.normalizedLayouts;for(const a of r)for(const b of a.layers)if(b.id===t)return b}get alphabeticLayout(){return this._alphabeticLayout}set alphabeticLayout(t){this._alphabeticLayout=t,this.rebuild()}get actionKeycap(){return this._actionKeycap}set actionKeycap(t){this._actionKeycap=typeof t=="string"?{label:t}:t}get shiftKeycap(){return this._shiftKeycap}set shiftKeycap(t){this._shiftKeycap=typeof t=="string"?{label:t}:t}get backspaceKeycap(){return this._backspaceKeycap}set backspaceKeycap(t){this._backspaceKeycap=typeof t=="string"?{label:t}:t}get tabKeycap(){return this._tabKeycap}set tabKeycap(t){this._tabKeycap=typeof t=="string"?{label:t}:t}get layouts(){return this._layouts}set layouts(t){this.updateNormalizedLayouts(t),this.rebuild()}updateNormalizedLayouts(t){const r=Array.isArray(t)?[...t]:[t],a=r.findIndex(b=>b==="default");a>=0&&r.splice(a,1,"numeric","symbols","alphabetic","greek"),this._layouts=Object.freeze(r),this._normalizedLayouts=r.map(b=>Id(b))}get normalizedLayouts(){return this._normalizedLayouts||this.updateNormalizedLayouts(this._layouts),this._normalizedLayouts}get editToolbar(){return this._editToolbar}set editToolbar(t){this._editToolbar=t,this.rebuild()}get container(){return this._container}set container(t){this._container=t,this.rebuild()}static get singleton(){if(this._singleton===void 0)try{this._singleton=new u0}catch(t){this._singleton=null}return this._singleton}get style(){return this._style}addEventListener(t,r,a){this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].has(r)||this.listeners[t].add(r)}dispatchEvent(t){return!this.listeners[t.type]||this.listeners[t.type].size===0?!0:(this.listeners[t.type].forEach(r=>{typeof r=="function"?r(t):r==null||r.handleEvent(t)}),!t.defaultPrevented)}removeEventListener(t,r,a){this.listeners[t]&&this.listeners[t].delete(r)}get element(){return this._element}set element(t){var r;this._element!==t&&((r=this._element)==null||r.remove(),this._element=t)}get visible(){return this._visible}set visible(t){t?this.show():this.hide()}get boundingRect(){var t;if(!this._visible)return new DOMRect;const r=(t=this._element)==null?void 0:t.getElementsByClassName("MLK__plate")[0];return r?r.getBoundingClientRect():new DOMRect}adjustBoundingRect(){var t,r;const a=this.boundingRect.height;if(this.container===document.body){(t=this._element)==null||t.style.setProperty("--_keyboard-height",`calc(${a}px + var(--_padding-top) + var(--_padding-bottom) + env(safe-area-inset-bottom, 0))`);const b=a-1;this.container.style.paddingBottom=this.originalContainerBottomPadding?`calc(${this.originalContainerBottomPadding} + ${b}px)`:`${b}px`}else(r=this._element)==null||r.style.setProperty("--_keyboard-height",`${a}px`)}rebuild(){if(this._rebuilding||!this._element)return;this._rebuilding=!0;const t=this.currentLayer;requestAnimationFrame(()=>{this._rebuilding=!1,this._element&&(this._element.remove(),this._element=void 0),this.visible&&(this.buildAndAttachElement(),this.currentLayer=t,this.render(),this.adjustBoundingRect(),this._element.classList.add("is-visible"))})}render(){if(!this._element)return;const t=this.getLayer(this.currentLayer);this._element.classList.toggle("backdrop-is-transparent",!!(t&&(t.backdrop||t.container)));const r=this._element.querySelectorAll(".MLK__layer.is-visible .MLK__keycap, .MLK__layer.is-visible .action, .fnbutton, .MLK__layer.is-visible .bigfnbutton, .MLK__layer.is-visible .shift");if(r)for(const a of r){const b=this.getKeycap(a.id);if(b){const[L,N]=Hf(b,{shifted:this.isShifted});a.innerHTML=window.MathfieldElement.createHTML(L),a.className=N}}}show(t){var r;if(this._visible)return;const a=this.container;if(a&&window.mathVirtualKeyboard&&this.stateWillChange(!0)){if(this._element||(this.buildAndAttachElement(),this.adjustBoundingRect()),!this._visible){const b=this._element.getElementsByClassName("MLK__plate")[0];if(b&&this.observer.observe(b),a===window.document.body){const L=a.style.paddingBottom;this.originalContainerBottomPadding=L;const N=b.offsetHeight-1;a.style.paddingBottom=L?`calc(${L} + ${N}px)`:`${N}px`}window.addEventListener("mouseup",this),window.addEventListener("blur",this),window.addEventListener("keydown",this,{capture:!0}),window.addEventListener("keyup",this,{capture:!0}),(r=this._element)==null||r.classList.toggle("is-caps-lock",this.shiftPressCount===2),this.currentLayer=this.latentLayer}this._visible=!0,t!=null&&t.animate?requestAnimationFrame(()=>{this._element&&(this._element.classList.add("animate"),this._element.addEventListener("transitionend",()=>{var b;return(b=this._element)==null?void 0:b.classList.remove("animate")},{once:!0}),this._element.classList.add("is-visible"),this.stateChanged())}):(this._element.classList.add("is-visible"),this.stateChanged())}}hide(t){var r;const a=this.container;if(a&&this._visible&&this.stateWillChange(!1)){if(this._visible=!1,this._element){this.latentLayer=this.currentLayer;const b=this._element.getElementsByClassName("MLK__plate")[0];b&&this.observer.unobserve(b),window.removeEventListener("mouseup",this),window.removeEventListener("blur",this),window.removeEventListener("keydown",this,{capture:!0}),window.removeEventListener("keyup",this,{capture:!0}),window.removeEventListener("contextmenu",this,{capture:!0}),Lu(),Lm(),(r=this._element)==null||r.remove(),this._element=void 0,this.originalContainerBottomPadding!==null&&(a.style.paddingBottom=this.originalContainerBottomPadding)}this.stateChanged()}}get height(){var t,r;return(r=(t=this.element)==null?void 0:t.offsetHeight)!=null?r:0}buildAndAttachElement(){var t;console.assert(!this.element),this.element=Dm(this),window.addEventListener("contextmenu",this,{capture:!0}),this.element.addEventListener("contextmenu",r=>{r.shiftKey||((r.ctrlKey||r.button===2)&&Pd(r.target),r.preventDefault(),r.stopPropagation())},{capture:!0}),(t=this.container)==null||t.appendChild(this.element)}handleEvent(t){if(Dh(t)){if(!vu(t.origin,this.originValidator))throw new DOMException(`Message from unknown origin (${t.origin}) cannot be handled`,"SecurityError");t.data.action==="disconnect"?this.connectedMathfieldWindow=void 0:t.data.action!=="update-setting"&&t.data.action!=="proxy-created"&&t.data.action!=="execute-command"&&(console.assert(t.source!==void 0),this.connectedMathfieldWindow=t.source),this.handleMessage(t.data,t.source)}if(this._element)switch(t.type){case"mouseup":case"blur":document.body.style.userSelect="",this.shiftPressCount=0;break;case"contextmenu":t.button!==2&&t.preventDefault();break;case"keydown":{t.key==="Shift"&&!t.repeat&&(this.shiftPressCount=1);break}case"keyup":{(t.key==="Shift"||!t.getModifierState("Shift")&&this.shiftPressCount!==2)&&(this.shiftPressCount=0);break}}}handleMessage(t,r){const{action:a}=t;if(a==="execute-command"){const{command:b}=t,L=_c(b);if(window.top!==void 0&&L!=="virtual-keyboard")return;this.executeCommand(b);return}if((a==="connect"||a==="show")&&this.sendMessage("synchronize-proxy",{boundingRect:this.boundingRect,alphabeticLayout:this._alphabeticLayout,layouts:this._layouts,editToolbar:this._editToolbar},r),a!=="disconnect"&&window===window.top){if(a==="show"){typeof t.animate!="undefined"?this.show({animate:t.animate}):this.show();return}if(a==="hide"){typeof t.animate!="undefined"?this.hide({animate:t.animate}):this.hide();return}if(a==="update-setting"){t.alphabeticLayout&&(this.alphabeticLayout=t.alphabeticLayout),t.layouts&&(this.layouts=t.layouts),t.editToolbar&&(this.editToolbar=t.editToolbar);return}if(a==="proxy-created"){this.sendMessage("synchronize-proxy",{boundingRect:this.boundingRect,alphabeticLayout:this._alphabeticLayout,layouts:this._layouts,editToolbar:this._editToolbar},r);return}}}sendMessage(t,r,a){if(a||(a=this.connectedMathfieldWindow),this.targetOrigin===null||this.targetOrigin==="null"||a===window){window.dispatchEvent(new MessageEvent("message",{source:window,data:l({type:Ff,action:t},r)}));return}if(a)a.postMessage(l({type:Ff,action:t},r),{targetOrigin:this.targetOrigin});else if(r.command&&this.dispatchEvent(new CustomEvent("math-virtual-keyboard-command",{detail:r.command})),t==="execute-command"&&Array.isArray(r.command)&&r.command[0]==="insert"){const b=r.command[1].split("");for(const L of b)this.dispatchEvent(new KeyboardEvent("keydown",{key:L,bubbles:!0})),this.dispatchEvent(new KeyboardEvent("keyup",{key:L,bubbles:!0}))}}stateWillChange(t){return this.dispatchEvent(new CustomEvent("before-virtual-keyboard-toggle",{detail:{visible:t},bubbles:!0,cancelable:!0,composed:!0}))}stateChanged(){this.dispatchEvent(new Event("virtual-keyboard-toggle")),this._visible||(this.dispatchEvent(new Event("geometrychange")),this.sendMessage("geometry-changed",{boundingRect:this.boundingRect}))}focus(){this.sendMessage("focus",{})}blur(){this.sendMessage("blur",{})}updateToolbar(t){const r=this._element;if(!r)return;r.classList.toggle("is-math-mode",t.mode==="math"),r.classList.toggle("is-text-mode",t.mode==="text"),r.classList.toggle("can-undo",t.canUndo),r.classList.toggle("can-redo",t.canRedo),r.classList.toggle("can-copy",!t.selectionIsCollapsed),r.classList.toggle("can-copy",!t.selectionIsCollapsed),r.classList.toggle("can-paste",!0);const a=r.querySelectorAll(".ML__edit-toolbar");if(a)for(const b of a)b.innerHTML=Em(this,t)}update(t){this._style=t.style,this.updateToolbar(t)}connect(){this.connectedMathfieldWindow=window}disconnect(){this.connectedMathfieldWindow=void 0}executeCommand(t){let r,a=[],b=_c(t);return o(t)?(r=t[0],r==="performWithFeedback"&&(t=t.slice(1),b=_c(t)),a=t.slice(1)):r=t,r=r.replace(/-\w/g,L=>L[1].toUpperCase()),b==="virtual-keyboard"?Is[r].fn(void 0,...a):(this.sendMessage("execute-command",{command:t}),!1)}dispose(){window.removeEventListener("mouseup",this),window.removeEventListener("blur",this),window.removeEventListener("message",this)}};function Bd(){var e,t;let r=Df(),a=null;for(;r;){if("host"in r&&((t=(e=r.host)==null?void 0:e.tagName)==null?void 0:t.toLowerCase())==="math-field"){a=r.host;break}r=r.parentNode}return a}if(u()&&!("mathVirtualKeyboard"in window))if(window===window.top){const e=Ga.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>e})}else Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>bm.singleton,configurable:!0});function Wf(e){const t={};for(const r of Object.keys(e))switch(r){case"scriptDepth":const a=e.scriptDepth;if(o(a))t.scriptDepth=[a[0],a[1]];else if(typeof a=="number")t.scriptDepth=[a,a];else if(typeof a=="string"){const[L,N]=a.split(",").map(J=>parseInt(J.trim()));t.scriptDepth=[L,N]}else throw new TypeError("Unexpected value for scriptDepth");break;case"mathVirtualKeyboardPolicy":let b=e.mathVirtualKeyboardPolicy.toLowerCase();if(b==="sandboxed"){if(window!==window.top){const L=Ga.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>L})}b="manual"}t.mathVirtualKeyboardPolicy=b;break;case"letterShapeStyle":e.letterShapeStyle==="auto"?w.locale.startsWith("fr")?t.letterShapeStyle="french":t.letterShapeStyle="tex":t.letterShapeStyle=e.letterShapeStyle;break;case"defaultMode":["text","math","inline-math"].includes(e.defaultMode)?t.defaultMode=e.defaultMode:(console.error('MathLive 0.98.5: valid values for defaultMode are "text", "math" or "inline-math"'),t.defaultMode="math");break;case"macros":t.macros=qe(e.macros);break;default:o(e[r])?t[r]=[...e[r]]:typeof e[r]=="object"&&!(e[r]instanceof Element)&&r!=="computeEngine"?t[r]=l({},e[r]):t[r]=e[r]}return t}function kl(e,t){let r;typeof t=="string"?r=[t]:t===void 0?r=Object.keys(e):r=t;const a={};for(const b of r)e[b]===null?a[b]=null:o(e[b])?a[b]=[...e[b]]:typeof e[b]=="object"&&!(e[b]instanceof Element)&&b!=="computeEngine"?a[b]=l({},e[b]):a[b]=e[b];return typeof t=="string"?a[t]:a}function Kf(){return{readOnly:!1,defaultMode:"math",macros:{},registers:{},colorMap:U,backgroundColorMap:G,letterShapeStyle:w.locale.startsWith("fr")?"french":"tex",minFontScale:0,smartMode:!1,smartFence:!0,smartSuperscript:!0,scriptDepth:[1/0,1/0],removeExtraneousParentheses:!0,isImplicitFunction:e=>["\\sin","\\cos","\\tan","\\arcsin","\\arccos","\\arctan","\\arcsec","\\arccsc","\\arsinh","\\arcosh","\\artanh","\\arcsech","\\arccsch","\\arg","\\ch","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\sec","\\sinh","\\sh","\\tanh","\\tg","\\th","\\lg","\\lb","\\log","\\ln"].includes(e),mathModeSpace:"",placeholderSymbol:"\u25A2",contentPlaceholder:"",popoverPolicy:"auto",environmentPopoverPolicy:"off",keybindings:vh,inlineShortcuts:wf,inlineShortcutTimeout:0,mathVirtualKeyboardPolicy:"auto",virtualKeyboardTargetOrigin:window==null?void 0:window.origin,originValidator:"none",onInlineShortcut:()=>"",onScrollIntoView:null,onExport:gh,value:""}}function Nd(e){return e.defaultMode==="inline-math"?"math":e.defaultMode}function Va(e,t){!e||!t||(o(e)?e.forEach(r=>Va(r,t)):typeof e=="object"&&!e.style.color&&!e.style.backgroundColor&&!e.style.fontFamily&&!e.style.fontShape&&!e.style.fontSeries&&!e.style.fontSize&&!e.style.variant&&!e.style.variantStyle&&(e.applyStyle(t),Va(e.body,t),Va(e.above,t),Va(e.below,t),Va(e.subscript,t),Va(e.superscript,t)))}function Rh(e,t,r,a){function b(N,J){for(const ie of L)if(ie.style[N]!==J)return!1;return!0}if(t=e.normalizeRange(t),t[0]===t[1])return!1;const L=e.getAtoms(t,{includeChildren:!0});a.operation==="toggle"&&(r.color&&b("color",r.color)&&(r.color="none",delete r.verbatimColor),r.backgroundColor&&b("backgroundColor",r.backgroundColor)&&(r.backgroundColor="none",delete r.verbatimBackgroundColor),r.fontFamily&&b("fontFamily",r.fontFamily)&&(r.fontFamily="none"),r.fontSeries&&b("fontSeries",r.fontSeries)&&(r.fontSeries="auto"),r.fontShape&&b("fontShape",r.fontShape)&&(r.fontShape="auto"),r.fontSize&&b("fontSize",r.fontSize)&&(r.fontSize=Cs),r.variant&&b("variant",r.variant)&&(r.variant="normal"),r.variantStyle&&b("variantStyle",r.variantStyle)&&(r.variantStyle=""));for(const N of L)N.applyStyle(r);return!0}function Bm(e,t){const r=e.at(e.position);if(r.type==="composition")r.value=t;else{const{caret:a}=r;r.caret=void 0;const b=new ga(t,{mode:r.mode});b.caret=a,r.parent.addChildAfter(b,r),e.position+=1}}function Nm(e){const t=e.at(e.position);t.type==="composition"&&(t.parent.removeChild(t),e.position-=1)}$e(["math","displaymath"],Ro),$e("center",Ro),Ne("displaylines","",{parse:e=>{const t=[];let r=[];e.beginContext({tabular:!0});do{if(e.end()||e.match("<}>"))break;e.matchColumnSeparator()||e.matchRowSeparator()?(t.push([r]),r=[]):r.push(...e.scan(a=>["<}>","&","\\cr","\\\\","\\tabularnewline"].includes(a)))}while(!0);return e.endContext(),t.push([r]),t},createAtom:e=>new qt("lines",e.args,[],{leftDelim:".",rightDelim:".",columns:[{align:"l"}]})}),lt("array","{columns:colspec}",(e,t,r,a)=>new qt(e,Ih(t),r,{columns:a[0],mathstyleName:"textstyle"})),lt(["equation","equation*","subequations"],"",(e,t,r)=>new qt(e,Ih(t),r,{columns:[{align:"c"}]})),lt(["multline","multline*"],"",Ro),lt(["align","align*","aligned","eqnarray"],"",Ro),lt("split","",Ro),lt(["gather","gathered"],"",Ro),lt(["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],"[columns:colspec]",Ro),lt(["smallmatrix","smallmatrix*"],"[columns:colspec]",Ro),lt(["cases","dcases","rcases"],"",Ro);function Fm(e){for(const t of e)for(const r of t)if(r.length>0)return!1;return!0}function Ih(e,t=1){return Fm(e)?Array(t).fill([[new et({type:"first"}),new Nt]]):e.map(r=>r.length===0?[[new et({type:"first"})]]:r.map(a=>a.length===0?[new et({type:"first"})]:(a[0].type!=="first"&&a.unshift(new et({type:"first"})),a)))}function Ro(e,t=[[[]]],r=[],a=[]){switch(t=Ih(t,["split","align","align*","aligned","eqnarray"].includes(e)?2:1),e){case"math":return new qt(e,t,r,{mathstyleName:"textstyle"});case"displaymath":return new qt(e,t,r,{mathstyleName:"textstyle"});case"center":return new qt(e,t,r,{columns:[{align:"c"}]});case"multline":case"multline*":return new qt(e,t,r,{columns:[{align:"m"}],leftDelim:".",rightDelim:"."});case"split":return new qt(e,t,r,{columns:[{align:"r"},{align:"l"}],minColumns:2});case"gather":case"gathered":return new qt(e,t,r,{columns:[{gap:.25},{align:"c"},{gap:0}]});case"pmatrix":case"pmatrix*":return new qt(e,t,r,{mathstyleName:"textstyle",leftDelim:"(",rightDelim:")",columns:El(a[0])});case"bmatrix":case"bmatrix*":return new qt(e,t,r,{mathstyleName:"textstyle",leftDelim:"[",rightDelim:"]",columns:El(a[0])});case"Bmatrix":case"Bmatrix*":return new qt(e,t,r,{mathstyleName:"textstyle",leftDelim:"\\lbrace",rightDelim:"\\rbrace",columns:El(a[0])});case"vmatrix":case"vmatrix*":return new qt(e,t,r,{mathstyleName:"textstyle",leftDelim:"\\vert",rightDelim:"\\vert",columns:El(a[0])});case"Vmatrix":case"Vmatrix*":return new qt(e,t,r,{mathstyleName:"textstyle",leftDelim:"\\Vert",rightDelim:"\\Vert",columns:El(a[0])});case"matrix":case"matrix*":return new qt(e,t,r,{mathstyleName:"textstyle",leftDelim:".",rightDelim:".",columns:El(a==null?void 0:a[0])});case"smallmatrix":case"smallmatrix*":return new qt(e,t,r,{mathstyleName:"scriptstyle",columns:El(a==null?void 0:a[0]),colSeparationType:"small",arraystretch:.5});case"cases":case"dcases":return new qt(e,t,r,{mathstyleName:e==="dcases"?"displaystyle":"textstyle",arraystretch:1.2,leftDelim:"\\lbrace",rightDelim:".",columns:[{align:"l"},{gap:1},{align:"l"}]});case"rcases":return new qt(e,t,r,{arraystretch:1.2,leftDelim:".",rightDelim:"\\rbrace",columns:[{align:"l"},{gap:1},{align:"l"}]});case"lines":return new qt(e,t,r,{leftDelim:".",rightDelim:".",columns:[{align:"l"}]});case"align":case"align*":case"aligned":case"eqnarray":{let b=0;for(const J of t)b=Math.max(b,J.length);const L=[{gap:0},{align:"r"},{gap:.25},{align:"l"}];let N=2;for(;N<b;)L.push({gap:1},{align:"r"},{gap:.25},{align:"l"}),N+=2;return L.push({gap:0}),new qt(e,t,r,{arraycolsep:0,columns:L,minColumns:2})}}return new qt(e,t,r,{mathstyleName:"textstyle"})}function El(e){return e!=null?e:[{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"}]}function zm(e,t){let r=e.at(e.position);for(;r&&!(r.parent instanceof qt);)r=r.parent;if(r&&r.type==="array"&&r.environmentName,!r||!(r.parent instanceof qt)){const a=e.at(e.position);if(r=a,!r.parent.parent){let b=e.extractAtoms([e.position,e.lastOffset]),L=e.extractAtoms([0,e.position]);L.length===0&&(L=Vf()),b.length===0&&(b=Vf());let N;return t.endsWith("column")?(N=Ro("split",[[L,b]]),e.root=N,Ml(N,0,0)?Tl(e,N,0,0):Ml(N,0,1)?Tl(e,N,0,1):e.position=e.offsetOf(a)):(N=Ro("lines",[[L],[b]]),e.root=N,Ml(N,0,0)?Tl(e,N,0,0):Ml(N,1,0)?Tl(e,N,1,0):e.position=e.offsetOf(a)),[void 0,[0,0]]}if(r.parent instanceof Dr){const b=r.parent;let L=e.extractAtoms([e.position,e.offsetOf(b.lastChild)]),N=e.extractAtoms([e.offsetOf(b.firstChild),e.position]);N.length===0&&(N=Vf()),L.length===0&&(L=Vf());let J="pmatrix";const ie=b.leftDelim,ue=b.rightDelim;ie==="("&&(ue===")"||ue==="?")?J="pmatrix":(ie==="["||ie==="\\lbrack")&&(ue==="]"||ue==="\\rbrack"||ue==="?")?J="bmatrix":ie==="\\vert"&&ue==="\\vert"?J="vmatrix":ie==="\\Vert"&&ue==="\\Vert"?J="Vmatrix":(ie==="{"||ie==="\\lbrace")&&(ue==="."||ue==="?")&&(J="cases");const pe=Ro(J,t.endsWith("column")?[[N,L]]:[[N],[L]]);return b.parent.addChildBefore(pe,b),b.parent.removeChild(b),Ml(pe,0,0)?Tl(e,pe,0,0):t.endsWith("column")?Ml(pe,0,1)?Tl(e,pe,0,1):e.position=e.offsetOf(r):Ml(pe,1,0)?Tl(e,pe,1,0):e.position=e.offsetOf(r),[void 0,[0,0]]}}return r&&r.parent instanceof qt?[r.parent,r.parentBranch]:[void 0,[0,0]]}function Ml(e,t,r){const a=e.getCell(t,r);return!a||a.length!==2?!1:a[1].type==="placeholder"}function Hm(e,t,r,a){const b=t.getCell(r,a);return b?[e.offsetOf(b[0]),e.offsetOf(b[b.length-1])]:-1}function Tl(e,t,r,a){const b=Hm(e,t,r,a);typeof b!="number"&&e.setSelection(b)}function $f(e,t,r,a,b){const L=t.getCell(r,a);L&&e.setPositionHandlingPlaceholder(e.offsetOf(L[b==="start"?0:L.length-1]))}function Gf(e,t){const[r,[a,b]]=zm(e,t);if(r)switch(t){case"after row":r.addRowAfter(a),$f(e,r,a+1,0,"end");break;case"after column":if(r.maxColumns<=r.colCount){e.announce("plonk");return}r.addColumnAfter(b),$f(e,r,a,b+1,"end");break;case"before row":r.addRowBefore(a),$f(e,r,a,0,"start");break;case"before column":if(r.maxColumns<=r.colCount){e.announce("plonk");return}r.addColumnBefore(b),$f(e,r,a,b,"start");break}}function Fd(e){return e.contentWillChange({inputType:"insertText"})?(Gf(e,"after row"),e.contentDidChange({inputType:"insertText"}),!0):!1}function Um(e){return e.contentWillChange({inputType:"insertText"})?(Gf(e,"before row"),e.contentDidChange({inputType:"insertText"}),!0):!1}function zd(e){return e.contentWillChange({inputType:"insertText"})?(Gf(e,"after column"),e.contentDidChange({inputType:"insertText"}),!0):!1}function Wm(e){return e.contentWillChange({inputType:"insertText"})?(Gf(e,"before column"),e.contentDidChange({inputType:"insertText"}),!0):!1}function Hd(e,t){if(!e.contentWillChange({}))return!1;e.mathfield.snapshot();let r=".",a=".";switch(t){case"pmatrix":case"pmatrix*":r="(",a=")";break;case"bmatrix":case"bmatrix*":r="[",a="]";break;case"Bmatrix":case"Bmatrix*":r="\\lbrace",a="\\rbrace";break;case"vmatrix":case"vmatrix*":r="\\vert",a="\\vert";break;case"Vmatrix":case"Vmatrix*":r="\\Vert",a="\\Vert";break;case"matrix":case"matrix*":r=".",a=".";break;case"cases":case"dcases":r="\\lbrace";break;case"rcases":a="\\rbrace";break}const b=e.at(e.position),L=b.type==="array"?b:e.parentEnvironment;return L.environmentName=t,L.leftDelim=r,L.rightDelim=a,e.contentDidChange({}),!0}function Ud(e,t){let r=e.at(e.position);for(;r&&!(Array.isArray(r.parentBranch)&&r.parent instanceof qt);)r=r.parent;if(Array.isArray(r==null?void 0:r.parentBranch)&&(r==null?void 0:r.parent)instanceof qt){const a=r.parent,b=r.parentBranch;let L;switch(t){case"row":if(a.rowCount>1){a.removeRow(b[0]);const N=a.getCell(Math.max(0,b[0]-1),b[1]);L=e.offsetOf(N[N.length-1])}break;case"column":if(a.colCount>a.minColumns){a.removeColumn(b[1]);const N=a.getCell(b[0],Math.max(0,b[1]-1));L=e.offsetOf(N[N.length-1])}break}L&&e.setPositionHandlingPlaceholder(L)}}function Km(e){return e.contentWillChange({inputType:"deleteContent"})?(Ud(e,"row"),e.contentDidChange({inputType:"deleteContent"}),!0):!1}function $m(e){return e.contentWillChange({inputType:"deleteContent"})?(Ud(e,"column"),e.contentDidChange({inputType:"deleteContent"}),!0):!1}oo({addRowAfter:Fd,addColumnAfter:zd,addRowBefore:Um,addColumnBefore:Wm,removeRow:Km,removeColumn:$m,setEnvironment:Hd},{target:"model",canUndo:!0,changeContent:!0,changeSelection:!0});function Vf(){return[new Nt]}var Wd=class f0{constructor(t){this.recording=!1,this.model=t,this.reset()}reset(){this.stack=[],this.index=-1,this.lastOp=""}startRecording(){this.recording=!0}stopRecording(){this.recording=!1}canUndo(){return this.index-1>=0}canRedo(){return this.stack.length-1>this.index}stopCoalescing(t){t&&this.index>=0&&(this.stack[this.index].selection=t),this.lastOp=""}undo(){return this.canUndo()?(this.model.setState(this.stack[this.index-1],{silenceNotifications:!1,type:"undo"}),this.index-=1,this.lastOp="",!0):!1}redo(){return this.canRedo()?(this.index+=1,this.model.setState(this.stack[this.index],{silenceNotifications:!1,type:"redo"}),this.lastOp="",!0):!1}pop(){this.canUndo()&&(this.stack.splice(this.index,this.stack.length-this.index),this.index-=1)}snapshot(t){return this.recording?(t&&t===this.lastOp&&this.pop(),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push(this.model.getState()),this.index+=1,this.stack.length>f0.maximumDepth&&(this.stack.shift(),this.index-=1),this.lastOp=t!=null?t:"",!0):!1}};Wd.maximumDepth=1e3;var Gm=Wd;function jh(e,t,r){if(e.at(t).mode!=="text")return t;const a=r==="backward"?-1:1;let b;if(q.test(e.at(t).value)){let L=t,N;do N=e.at(L).mode==="text"&&q.test(e.at(L).value),L+=a;while(e.at(L)&&N);b=e.at(L)?L-2*a:L-a}else if(/\s/.test(e.at(t).value)){let L=t;for(;e.at(L)&&e.at(L).mode==="text"&&/\s/.test(e.at(L).value);)L+=a;if(!e.at(L))b=L-a;else{let N=!0;do N=e.at(L).mode==="text"&&!/\s/.test(e.at(L).value),L+=a;while(e.at(L)&&N);b=e.at(L)?L-2*a:L-a}}else{let L=t;for(;e.at(L)&&e.at(L).mode==="text"&&!/\s/.test(e.at(L).value);)L+=a;b=e.at(L)?L:L-a;let N=!0;for(;e.at(L)&&N;)N=e.at(L).mode==="text"&&/\s/.test(e.at(L).value),N&&(b=L),L+=a;b=e.at(L)?L-2*a:L-a}return b-(a>0?0:1)}function Sc(e,t,r){var a,b,L,N,J,ie,ue;const pe=e.position;(a=r==null?void 0:r.extend)!=null&&a||e.collapseSelection(t);let Ee=e.at(e.position);if(t==="forward"&&(Ee.type==="subsup"?(Ee=Ee.rightSibling,Ee||(Ee=e.at(e.position+1))):Ee=e.at(e.position+1)),!Ee)return e.announce("plonk"),!1;let De=e.offsetOf(Ee);if(Ee instanceof ss)De=jh(e,De,t);else if(Ee instanceof di)if(Ee.isSuggestion)for(console.assert(t==="forward");Ee&&Ee instanceof di;)Ee.isSuggestion=!1,De=e.offsetOf(Ee),Ee=Ee.rightSibling;else if(t==="forward"){if(Ee=Ee.rightSibling,!Ee||!(Ee instanceof di))return e.announce("plonk"),!1;for(;Ee&&Ee instanceof di&&/[a-zA-Z\*]/.test(Ee.value);)De=e.offsetOf(Ee),Ee=Ee.rightSibling}else{if(Ee=Ee.leftSibling,!Ee||!(Ee instanceof di))return e.announce("plonk"),!1;for(;Ee&&Ee instanceof di&&/[a-zA-Z\*]/.test(Ee.value);)De=e.offsetOf(Ee),Ee=Ee.leftSibling}else if(t==="forward"&&Ee.type==="mopen"){let je=0;do Ee.type==="mopen"?je+=1:Ee.type==="mclose"&&(je-=1),Ee=Ee.rightSibling;while(!Ee.isLastSibling&&je!==0);De=e.offsetOf(Ee.leftSibling)}else if(t==="backward"&&Ee.type==="mclose"){let je=0;do Ee.type==="mopen"?je+=1:Ee.type==="mclose"&&(je-=1),Ee=Ee.leftSibling;while(!Ee.isFirstSibling&&je!==0);De=e.offsetOf(Ee)}else if(t==="backward")if(Ee.type==="first")for(;De>0&&Ee.type==="first";)De-=1,Ee=e.at(De);else{const je=Ee.type;Ee.type==="subsup"&&(De=e.offsetOf(e.at(De).leftSibling)),De-=1;let ze=(b=e.at(De))==null?void 0:b.type;for(;De>=0&&ze===je;)((L=e.at(De))==null?void 0:L.type)==="subsup"?De=e.offsetOf(e.at(De).leftSibling):De-=1,ze=e.at(De).type}else{const{type:je}=Ee;let ze=(N=e.at(De))==null?void 0:N.type;const{lastOffset:Je}=e;for(;De<=Je&&(ze===je||ze==="subsup");){for(;((J=e.at(De).rightSibling)==null?void 0:J.type)==="subsup";)De=e.offsetOf(e.at(De).rightSibling);De+=1,ze=(ie=e.at(De))==null?void 0:ie.type}De-=1}if((ue=r==null?void 0:r.extend)!=null&&ue){if(!e.setSelection(e.anchor,De))return e.announce("plonk"),!1}else{if(De===e.position)return e.announce("plonk"),!1;e.position=De}return e.announce("move",pe),e.mathfield.stopCoalescingUndo(),!0}function js(e,t,r){var a,b;if(r=r!=null?r:{extend:!1},e.mathfield.adoptStyle=t==="backward"?"right":"left",t!=="forward"){const[J,ie]=kd(e);J!==void 0&&ie!==void 0&&e.deleteAtoms([J,ie])}if(t==="upward")return Xm(e,r);if(t==="downward")return Ym(e,r);if(r.extend){let J=Xf(e,e.position,t);J<0&&(J=0),J>e.lastOffset&&(J=e.lastOffset);const ie=e.setSelection(e.anchor,J);return e.mathfield.stopCoalescingUndo(),ie}if(e.selectionIsPlaceholder){e.collapseSelection(t);const J=js(e,t);return e.mathfield.stopCoalescingUndo(),J}let L=e.position;const N=L;if(e.collapseSelection(t)?(L=e.position,Kd(e,L)||(L=Xf(e,L,t))):L=Xf(e,L,t),L<0||L>e.lastOffset){let J=!0;return e.silenceNotifications||(J=(b=(a=e.mathfield.host)==null?void 0:a.dispatchEvent(new CustomEvent("move-out",{detail:{direction:t},cancelable:!0,bubbles:!0,composed:!0})))!=null?b:!0),J&&e.announce("plonk"),J}return e.setPositionHandlingPlaceholder(L),e.mathfield.stopCoalescingUndo(),e.announce("move",N),!0}function Xf(e,t,r){return t=t+(r==="forward"?1:-1),t<0||t>e.lastOffset||Kd(e,t)?t:Xf(e,t,r)}function Kd(e,t){var r;const a=e.at(t);let b=a.parent;for(;b&&!b.inCaptureSelection;)b=b.parent;return!(b!=null&&b.inCaptureSelection||(r=a.parent)!=null&&r.skipBoundary&&(!a.isFirstSibling&&a.isLastSibling||a.type==="first")||e.mathfield.hasEditablePrompts&&!a.parentPrompt)}function Vm(e,t,r){let a=1/0,b=0;for(;b<t.length;b++){const L=hc(e.getHTMLElement(t[b])).right,N=Math.abs(r-L);if(N<=a)a=N;else break}return t[b-1]}function Yf(e,t,r,a,b){const L=e.mathfield.hasEditablePrompts,N=L?r.filter(ue=>ue.type==="prompt"&&!ue.captureSelection):r,J=hc(e.mathfield.getHTMLElement(t)).right,ie=e.offsetOf(Vm(e.mathfield,N,J))-(L?1:0);if(a){const[ue,pe]=e.selection.ranges[0];let Ee;ie<(b==="up"?ue:pe)?Ee={ranges:[[ie,pe]],direction:"backward"}:Ee={ranges:[[ue,ie]],direction:"forward"},e.setSelection(Ee)}else e.setPositionHandlingPlaceholder(ie);e.announce(`move ${b}`)}function Xm(e,t){var r,a;const b=(r=t==null?void 0:t.extend)!=null?r:!1;b||e.collapseSelection("backward");const L=()=>{var ie,ue;let pe=!0;return e.silenceNotifications||(pe=(ue=(ie=e.mathfield.host)==null?void 0:ie.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"upward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?ue:!0),e.announce(pe?"plonk":"line"),pe},N=e.at(e.position);let J=N;for(;J&&J.parentBranch!=="below"&&!(Array.isArray(J.parentBranch)&&J.parent instanceof qt);)J=J.parent;if(Array.isArray(J==null?void 0:J.parentBranch)&&J.parent instanceof qt){const ie=J.parent;if(J.parentBranch[0]<1)return L();const ue=J.parentBranch[0]-1,pe=ie.array[ue][J.parentBranch[1]];if(!pe.some(De=>De.type==="prompt"&&!De.captureSelection)&&e.mathfield.hasEditablePrompts)return L();Yf(e,N,pe,b,"up")}else if(J){const ie=(a=J.parent.branch("above"))!=null?a:J.parent.createBranch("above");if(!ie.some(pe=>pe.type==="prompt"&&pe.placeholderId)&&e.mathfield.hasEditablePrompts)return L();Yf(e,N,ie,b,"up")}else return L();return e.mathfield.stopCoalescingUndo(),!0}function Ym(e,t){var r,a;const b=(r=t==null?void 0:t.extend)!=null?r:!1;b||e.collapseSelection("forward");const L=()=>{var ie,ue;let pe=!0;return e.silenceNotifications||(pe=(ue=(ie=e.mathfield.host)==null?void 0:ie.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"downward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?ue:!0),e.announce(pe?"plonk":"line"),pe},N=e.at(e.position);let J=N;for(;J&&J.parentBranch!=="above"&&!(Array.isArray(J.parentBranch)&&J.parent instanceof qt);)J=J.parent;if(Array.isArray(J==null?void 0:J.parentBranch)&&J.parent instanceof qt){const ie=J.parent;if(J.parentBranch[0]+1>ie.array.length-1)return L();const ue=J.parentBranch[0]+1,pe=ie.array[ue][J.parentBranch[1]];if(!pe.some(De=>De.type==="prompt"&&!De.captureSelection)&&e.mathfield.hasEditablePrompts)return L();Yf(e,N,pe,b,"down")}else if(J){const ie=(a=J.parent.branch("below"))!=null?a:J.parent.createBranch("below");if(!ie.some(pe=>pe.type==="prompt")&&e.mathfield.hasEditablePrompts)return L();Yf(e,N,ie,b,"down")}else return L();return!0}function $d(e){const t=e.position,r=e.at(t).parent;return r!=null&&r.parent?(e.position=e.offsetOf(r),e.mathfield.stopCoalescingUndo(),e.announce("move",t),!0):(e.announce("plonk"),!1)}function Zm(e){let t=0,r=e.at(e.position),a=!1;for(;r;)(!r.hasEmptyBranch("superscript")||!r.hasEmptyBranch("subscript"))&&(t+=1),r.hasEmptyBranch("superscript")?r.hasEmptyBranch("subscript")||(a=!1):a=!0,r=r.parent;return a?t:0}function Jm(e){let t=0,r=e.at(e.position),a=!1;for(;r;)(!r.hasEmptyBranch("superscript")||!r.hasEmptyBranch("subscript"))&&(t+=1),r.hasEmptyBranch("superscript")?r.hasEmptyBranch("subscript")||(a=!0):a=!1,r=r.parent;return a?t:0}function Gd(e){var t;if(e.collapseSelection(),Zm(e)>=e.mathfield.options.scriptDepth[1])return e.announce("plonk"),!1;let r=e.at(e.position);return r.subsupPlacement===void 0&&(((t=r.rightSibling)==null?void 0:t.type)!=="subsup"&&r.parent.addChildAfter(new Do({style:r.computedStyle}),r),r=r.rightSibling),r.createBranch("superscript"),e.setSelection(e.getSiblingsRange(e.offsetOf(r.superscript[0]))),!0}function Vd(e){var t;if(e.collapseSelection(),Jm(e)>=e.mathfield.options.scriptDepth[0])return e.announce("plonk"),!1;let r=e.at(e.position);return r.subsupPlacement===void 0&&(((t=e.at(e.position+1))==null?void 0:t.type)!=="subsup"&&r.parent.addChildAfter(new Do({style:e.at(e.position).computedStyle}),r),r=e.at(e.position+1)),r.createBranch("subscript"),e.setSelection(e.getSiblingsRange(e.offsetOf(r.subscript[0]))),!0}function qm(){function e(ie){const ue=[],pe=[];return[...ie.querySelectorAll(`input, select, textarea, a[href], button,
[tabindex], audio[controls], video[controls],
[contenteditable]:not([contenteditable="false"]), details>summary`)].filter(t).forEach((De,je)=>{const ze=a(De);ze===0?ue.push(De):pe.push({documentOrder:je,tabIndex:ze,node:De})}),pe.sort((De,je)=>De.tabIndex===je.tabIndex?De.documentOrder-je.documentOrder:De.tabIndex-je.tabIndex).map(De=>De.node).concat(ue)}function t(ie){return!(!r(ie)||b(ie)||a(ie)<0)}function r(ie){return!(ie.disabled||ie.type==="hidden"&&ie.tagName.toUpperCase()==="INPUT"||J(ie))}function a(ie){var ue;const pe=Number.parseInt((ue=ie.getAttribute("tabindex"))!=null?ue:"NaN",10);return Number.isNaN(pe)?ie.contentEditable==="true"||(ie.nodeName==="AUDIO"||ie.nodeName==="VIDEO")&&ie.getAttribute("tabindex")===null?0:ie.tabIndex:pe}function b(ie){return ie.tagName.toUpperCase()==="INPUT"&&ie.type==="radio"&&!N(ie)}function L(ie,ue){for(const pe of ie)if(pe.checked&&pe.form===ue)return pe;return null}function N(ie){var ue;if(!ie.name)return!0;const Ee=((ue=ie.form)!=null?ue:ie.ownerDocument).querySelectorAll('input[type="radio"][name="'+ie.name+'"]'),De=L(Ee,ie.form);return!De||De===ie}function J(ie){if(!u()||ie===document.activeElement||ie.contains(document.activeElement))return!1;if(getComputedStyle(ie).visibility==="hidden")return!0;const ue=ie.getBoundingClientRect();if(ue.width===0||ue.height===0)return!0;for(;ie;){if(getComputedStyle(ie).display==="none")return!0;ie=ie.parentElement}return!1}return u()?e(document.body):[]}function Ii(e,t,r="forward"){const a=e.position;if(Array.isArray(t)){const b=e.offsetOf(t[0]),L=e.offsetOf(t[t.length-1]);return r==="forward"?e.setSelection(b,L):e.setSelection(L,b),e.announce("move",a),e.mathfield.stopCoalescingUndo(),!0}return r==="forward"?Ii(e,[t.leftSibling,t]):Ii(e,[t,t.leftSibling])}function cs(e,t){const r=e.position;if(typeof t=="number"&&(t=e.at(t)),t.type==="prompt")e.setSelection(e.offsetOf(t.firstChild),e.offsetOf(t.lastChild));else{const a=e.offsetOf(t);t.type==="placeholder"?e.setSelection(a-1,a):e.position=a}return e.announce("move",r),e.mathfield.stopCoalescingUndo(),!0}function Zf(e,t,r=!0){var a,b;const L=t==="forward"?1:-1;e.at(e.anchor).type==="placeholder"&&js(e,t);let N;const J=e.at(e.anchor).parentPrompt;J?t==="forward"?N=e.offsetOf(J)+1:N=e.offsetOf(J.leftSibling):N=Math.max(e.position+L,0);const ie=Bh(e,N,t);if(!ie||t==="forward"&&e.offsetOf(ie)<N||t==="backward"&&e.offsetOf(ie)>N){if(!r||!((b=(a=e.mathfield.host)==null?void 0:a.dispatchEvent(new CustomEvent("move-out",{detail:{direction:t},cancelable:!0,bubbles:!0,composed:!0})))==null||b))return e.announce("plonk"),!1;const pe=qm();if(!document.activeElement||pe.length<=1)return e.announce("plonk"),!1;let Ee=pe.indexOf(document.activeElement)+L;return Ee<0&&(Ee=pe.length-1),Ee>=pe.length&&(Ee=0),pe[Ee].focus(),e.mathfield.stopCoalescingUndo(),!0}return cs(e,ie),!0}function Bh(e,t=0,r="forward"){return e.findAtom(a=>a.type==="placeholder"||a.type==="prompt"||!e.mathfield.readOnly&&a.treeDepth>2&&a.isFirstSibling&&a.isLastSibling,t,r)}oo({moveToOpposite:e=>{const t={superscript:"subscript",subscript:"superscript",above:"below",below:"above"},r=e.at(e.position),{parent:a}=r;if(!a)return e.announce("plonk"),!1;const b=r.parentBranch;let L;if(typeof b=="string"&&(L=t[b]),!L){const J=r.subsupPlacement?Vd(e):Gd(e);return e.mathfield.stopCoalescingUndo(),J}a.branch(L)||a.createBranch(L);const N=e.setSelection(e.getBranchRange(e.offsetOf(a),L));return e.mathfield.stopCoalescingUndo(),N},moveBeforeParent:e=>{const{parent:t}=e.at(e.position);return t?(e.position=e.offsetOf(t),e.mathfield.stopCoalescingUndo(),!0):(e.announce("plonk"),!1)},moveAfterParent:e=>$d(e),moveToNextChar:e=>js(e,"forward"),moveToPreviousChar:e=>js(e,"backward"),moveUp:e=>js(e,"upward"),moveDown:e=>js(e,"downward"),moveToNextWord:e=>Sc(e,"forward"),moveToPreviousWord:e=>Sc(e,"backward"),moveToGroupStart:e=>{const t=e.offsetOf(e.at(e.position).firstSibling);return t===e.position?(e.announce("plonk"),!1):(e.position=t,e.mathfield.stopCoalescingUndo(),!0)},moveToGroupEnd:e=>{const t=e.offsetOf(e.at(e.position).lastSibling);return t===e.position?(e.announce("plonk"),!1):(e.position=t,e.mathfield.stopCoalescingUndo(),!0)},moveToNextGroup:e=>{var t,r,a,b;if(e.position===e.lastOffset&&e.anchor===e.lastOffset)return Zf(e,"forward");const L=e.at(e.position);if(L.mode==="text"){if(e.selectionIsCollapsed){let De=L;for(;De&&De.mode==="text";)De=De.leftSibling;let je=L;for(;((t=je.rightSibling)==null?void 0:t.mode)==="text";)je=je.rightSibling;if(De&&je)return Ii(e,[De,je])}if(L.rightSibling.mode==="text"){let De=L;for(;De&&De.mode==="text";)De=De.rightSibling;return De?(cs(e,(r=De.leftSibling)!=null?r:De),e.mathfield.switchMode("math"),!0):cs(e,e.lastOffset)}}const J=e.at(e.anchor).parentPrompt,ie=J?e.offsetOf(J)+1:Math.max(e.position+1,0),ue=Bh(e,ie,"forward");if(ue)return cs(e,ue);const pe=Xd(e,L,De=>De.type==="leftright"||De.type==="text","forward");if(pe){if(pe.mode==="text"){let De=pe;for(;De&&De.mode==="text";)De=De.rightSibling;return Ii(e,[(a=pe.leftSibling)!=null?a:pe,(b=De.leftSibling)!=null?b:De])}return Ii(e,pe)}const Ee=L.parent;if(Ee){if(Ee.type==="leftright"||Ee.type==="surd")return Ii(e,Ee);if(L.parentBranch==="superscript"&&Ee.subscript)return Ii(e,Ee.subscript);if(L.parentBranch==="above"&&Ee.below)return Ii(e,Ee.below);if(L.parentBranch==="superscript"||L.parentBranch==="subscript")return cs(e,Ee);if(L.parentBranch==="above"||L.parentBranch==="below")return Ii(e,Ee)}return cs(e,e.lastOffset)},moveToPreviousGroup:e=>{var t;if(e.position===0&&e.anchor===0)return Zf(e,"backward");let r=e.at(e.position);const a=r.mode;if(a==="text"){if(e.selectionIsCollapsed){let J=r;for(;J&&J.mode==="text";)J=J.leftSibling;let ie=r;for(;((t=ie.rightSibling)==null?void 0:t.mode)==="text";)ie=ie.rightSibling;if(J&&ie)return Ii(e,[J,ie])}for(;r&&r.mode==="text";)r=r.leftSibling;return r?cs(e,r):cs(e,0)}const b=e.at(e.anchor).parentPrompt,L=b?e.offsetOf(b.leftSibling):Math.max(e.position-1,0),N=Bh(e,L,"backward");if(N)return cs(e,N);if(a==="math"){const J=Xd(e,r,ue=>ue.type==="leftright"||ue.type==="text","backward");if(J){if(J.mode==="text"){let ue=J;for(;ue&&ue.mode==="text";)ue=ue.leftSibling;return Ii(e,[J,ue])}return Ii(e,J)}const ie=r.parent;if(ie){if(ie.type==="leftright"||ie.type==="surd")return Ii(e,ie);if(r.parentBranch==="subscript"&&ie.superscript)return Ii(e,ie.superscript);if(r.parentBranch==="below"&&ie.above)return Ii(e,ie.above);if(r.parentBranch==="superscript"||r.parentBranch==="subscript")return cs(e,ie);if(r.parentBranch==="above"||r.parentBranch==="below")return Ii(e,ie)}return cs(e,0)}return!1},moveToMathfieldStart:e=>e.selectionIsCollapsed&&e.position===0?(e.announce("plonk"),!1):(e.position=0,e.mathfield.stopCoalescingUndo(),!0),moveToMathfieldEnd:e=>e.selectionIsCollapsed&&e.position===e.lastOffset?(e.announce("plonk"),!1):(e.position=e.lastOffset,e.mathfield.stopCoalescingUndo(),!0),moveToSuperscript:Gd,moveToSubscript:Vd},{target:"model",changeSelection:!0}),oo({moveToNextPlaceholder:e=>Zf(e,"forward"),moveToPreviousPlaceholder:e=>Zf(e,"backward")},{target:"model",changeSelection:!0,audioFeedback:"return"});function Xd(e,t,r,a){if(a==="forward"){let L=t.rightSibling;for(;L&&!r(L);)L=L.rightSibling;return L}let b=t.leftSibling;for(;b&&!r(b);)b=b.leftSibling;return b}function Jf(e,t,r){typeof t=="function"&&(r=t,t=1/0),t===void 0&&(t=1/0);let a=e.position,b=!1,L="";for(;!b;){const N=e.at(a);b=t===0||N===void 0||N.type==="first"||N.mode!=="math"||!(N.type&&/mord|mpunct|operator/.test(N.type)||N.type==="mop"&&/[a-zA-Z ]+/.test(N.value))||!N.hasEmptyBranch("superscript")||!N.hasEmptyBranch("subscript")||typeof r=="function"&&!r(N),b||(N.mode="text",N.command=N.value,N.verbatimLatex=void 0,L+=N.value),a-=1,t-=1}e.contentDidChange({data:L,inputType:"insertText"})}function Al(e,t,r){typeof t=="function"&&(r=t,t=1/0),t===void 0&&(t=1/0);let a=e.position,b=!1;const L=[];for(;!b;){const N=e.at(a);b=t===0||!N||N.type==="first"||N.isFirstSibling||N.mode!=="text"||N.value===" "||typeof r=="function"&&!r(N),b||(L.push(et.serialize([N],{defaultMode:"math"})),N.mode="math"),a-=1,t-=1}Nh(e),e.contentDidChange({data:ar(L),inputType:"insertText"})}function Nh(e){var t;let r=e.position-1;for(;r>=0&&((t=e.at(r))==null?void 0:t.mode)==="math";)r-=1;if(!(r<0)&&e.at(r).mode==="text"&&e.at(r).value===" "&&e.at(r-1).mode==="math"){e.at(r-1).parent.removeChild(e.at(r-1));const a=e.silenceNotifications;e.silenceNotifications=!0,e.position-=1,e.silenceNotifications=a,e.contentDidChange({inputType:"deleteContent"})}}function Qm(e){let t="",r=e.position,a=!1;for(;!a;){const b=e.at(r);a=!(b&&(b.mode==="text"||b.mode==="math"&&b.type&&/mord|mpunct/.test(b.type))),a||(t=b.value+t),r-=1}return t}function eg(e,t,r){const{model:a}=e;if(a.mode==="latex"||!a.at(a.position).isLastSibling||!r||!Of(r))return!1;const b=vc(r);if(!a.selectionIsCollapsed)return!!(e.model.mode==="text"&&/[/_^]/.test(b));const L=Qm(a)+b;if(e.model.mode==="text"){if(t==="Esc"||/[/\\]/.test(b))return!0;if(/[\^_]/.test(b))return/(^|\s)[a-zA-Z][^_]$/.test(L)&&Al(a,1),!0;const N={")":"(","}":"{","]":"["}[b],{parent:J}=a.at(a.position);if(N&&J instanceof Dr&&J.leftDelim===N)return!0;if(/(^|[^a-zA-Z])(a|I) $/.test(L))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(b))return!0;if(/(^|[^a-zA-Z'])[a-zA-Z] $/.test(L))return Al(a,1),!1;if(/\D\.[^\d\s]$/.test(L)){Al(a,1);const ie=a.at(a.position);return ie.value="\u22C5",ie.style.variant="normal",ie.command="\\cdot",ie.verbatimLatex=void 0,a.contentDidChange({data:"\\cdot",inputType:"insertText"}),!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(L)||/\.\d$/.test(L)||/\([\d+\-.]$/.test(L))return Al(a,1),!0;if(/\([a-z][,;]$/.test(L))return Al(a,2),!0;if(/[\d+\-=><*|]$/.test(b))return Nh(a),!0}else{if(t==="[Space]")return Jf(a,void 0,N=>/[a-z][:,;.]$/.test(N.value)),!0;if(/[a-zA-Z]{3,}$/.test(L)&&!/(dxd|abc|xyz|uvw)$/.test(L))return Jf(a,void 0,N=>/[a-zA-Z]/.test(N.value)),!0;if(/(^|\W)(if)$/i.test(L))return Jf(a,1),!0;if(/(\u0393|\u0394|\u0398|\u039B|\u039E|\u03A0|\u03A3|\u03A5|\u03A6|\u03A8|\u03A9|[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5){3,}$/u.test(L)&&!/(αβγ)$/.test(L))return Jf(a,void 0,N=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039B|\u039E|\u03A0|\u03A3|\u03A5|\u03A6|\u03A8|\u03A9|[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5)/u.test(N.value)),!0;if(b==="?"||b==="."&&!/[\d-+]\.$/.test(L))return!0}return!1}function tg(e,t){if(!e.isSelectionEditable||!e.keystrokeCaptionVisible)return;const r=Yd(),a=e.element.getBoundingClientRect();r.style.left=`${a.left}px`,r.style.top=`${a.top-64}px`,r.innerHTML=window.MathfieldElement.createHTML("<span>"+(Eh(t)||t)+"</span>"+r.innerHTML),r.style.visibility="visible",setTimeout(()=>{r.childNodes.length>0&&r.childNodes[r.childNodes.length-1].remove(),r.childNodes.length===0&&(r.style.visibility="hidden")},3e3)}function rg(e){if(e.keystrokeCaptionVisible=!e.keystrokeCaptionVisible,e.keystrokeCaptionVisible){const t=Yd();t.innerHTML=""}else{const t=Rf("mathlive-keystroke-caption-panel");t.style.visibility="hidden"}return!1}function Yd(){const e=document.getElementById("mathlive-keystroke-caption-panel");return e||(io("keystroke-caption"),io("core"),Rf("mathlive-keystroke-caption-panel"))}function ng(){document.getElementById("mathlive-keystroke-caption-panel")&&(Th("mathlive-keystroke-caption-panel"),n("core"),n("keystroke-caption"))}function Zd(e,t){var r,a,b;const{model:L}=e,N=Sd(t);if(t.isTrusted){G0(t);const je=Eu();e.keyboardLayout!==je.id&&(e.keyboardLayout=je.id,e._keybindings=void 0)}if(clearTimeout(e.inlineShortcutBufferFlushTimer),e.inlineShortcutBufferFlushTimer=0,tg(e,N),t.isTrusted&&t.defaultPrevented)return e.flushInlineShortcutBuffer(),!1;let J,ie="",ue;const pe=e.inlineShortcutBuffer;if(e.isSelectionEditable){if(L.mode==="math")if(N==="[Backspace]")pe.pop();else if(!Of(t))e.flushInlineShortcutBuffer();else{const je=vc(t),ze=[...(a=(r=pe[pe.length-1])==null?void 0:r.keystrokes)!=null?a:[],je];pe.push({state:L.getState(),keystrokes:ze,leftSiblings:ig(e)});let Je=0,pt="";for(;!J&&Je<ze.length;)ue=pe.length-(ze.length-Je),pt=ze.slice(Je).join(""),J=uu(pe[ue].leftSiblings,pt,e.options.inlineShortcuts),!J&&/^[a-zA-Z][a-zA-Z0-9]+?([_\^][a-zA-Z0-9\*\+\-]+?)?$/.test(pt)&&(J=e.options.onInlineShortcut(e,pt)),Je+=1;e.flushInlineShortcutBuffer({defer:!0})}e.options.smartMode&&(J?e.switchMode("math"):eg(e,N,t)&&(e.switchMode({math:"text",text:"math"}[L.mode]),ie=""))}if(!J){if(ie||(ie=Q0(e.keybindings,L.mode,t)),!ie&&(N==="[Enter]"||N==="[Return]")){let je=!1;return L.contentWillChange({inputType:"insertLineBreak"})&&(e.host&&(je=!e.host.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),je||t.preventDefault&&(t.preventDefault(),t.stopPropagation()),L.contentDidChange({inputType:"insertLineBreak"})),je}if((!ie||N==="[Space]")&&L.mode==="math"){if(N==="[Space]"){if(e.adoptStyle="none",e.flushInlineShortcutBuffer(),e.options.mathModeSpace)return Xt.insert(L,e.options.mathModeSpace,{format:"latex",mode:"math"}),e.snapshot("insert-space"),ie="",e.dirty=!0,e.scrollIntoView(),t.preventDefault&&(t.preventDefault(),t.stopPropagation()),!1;const je=L.at(L.position+1),ze=L.at(L.position-1);if((je==null?void 0:je.mode)==="text"||(ze==null?void 0:ze.mode)==="text")return Xt.insert(L," ",{mode:"text"}),e.snapshot("insert-space"),e.dirty=!0,e.scrollIntoView(),!1}(b=L.at(L.position))!=null&&b.isDigit()&&window.MathfieldElement.decimalSeparator===","&&vc(t)===","&&(ie="insertDecimalSeparator")}}if(!J&&!ie){if(L.mathfield.smartFence){if(zh(L,vc(t),e.effectiveStyle))return e.dirty=!0,e.scrollIntoView(),t.preventDefault&&t.preventDefault(),!1}else{const{parent:je}=L.at(L.position);if(je instanceof Dr&&je.rightDelim==="?"&&L.at(L.position).isLastSibling&&/^[)}\]|]$/.test(N))return e.snapshot(),je.isDirty=!0,je.rightDelim=N,L.position+=1,L.selectionDidChange(),L.contentDidChange({data:vc(t),inputType:"insertText"}),e.snapshot("insert-fence"),e.dirty=!0,e.scrollIntoView(),t.preventDefault&&t.preventDefault(),!1;if(!L.selectionIsCollapsed){const ze=vc(t);if(ze==="("||ze==="{"||ze==="["){const Je={"(":"(","{":"\\lbrace","[":"\\lbrack"}[ze],pt={"(":")","{":"\\rbrace","[":"\\rbrack"}[ze],[Xe,ot]=ri(L.selection);return e.snapshot(),L.position=ot,Xt.insert(L,pt,{format:"latex"}),L.position=Xe,Xt.insert(L,Je,{format:"latex"}),L.setSelection(Xe+1,ot+1),L.contentDidChange({data:ze,inputType:"insertText"}),e.snapshot("insert-fence"),e.dirty=!0,e.scrollIntoView(),t.preventDefault&&t.preventDefault(),!1}}}return!0}const Ee=L.at(Math.max(L.position,L.anchor)),{parent:De}=Ee;if(ie==="moveAfterParent"&&(De==null?void 0:De.type)==="leftright"&&Ee.isLastSibling&&e.options.smartFence&&zh(L,".",e.defaultStyle)&&(ie="",wn(e)),e.keyboardDelegate.cancelComposition(),ie)e.executeCommand(ie);else if(J){const je=e.effectiveStyle;L.setState(pe[ue].state);const ze=pe[pe.length-1].keystrokes;for(const Je of ze)Xt.insert(L,Je,{silenceNotifications:!0,style:je});e.snapshot("insert-shortcut"),L.setState(pe[ue].state),L.deferNotifications({content:!0,selection:!0,data:J,type:"insertText"},()=>(Xt.insert(L,J,{format:"latex",style:je}),Nh(e.model),J.endsWith(" ")&&(e.switchMode("text"),Xt.insert(L," ",{style:je,mode:"text"})),e.snapshot(),L.selectionIsCollapsed||e.flushInlineShortcutBuffer(),!0)),e.dirty=!0,L.announce("replacement")}return e.scrollIntoView(),t.preventDefault&&t.preventDefault(),!1}function Fh(e,t,r){const{model:a}=e;if(!e.isSelectionEditable){a.announce("plonk");return}r!=null||(r={}),r.focus&&e.focus(),r.feedback&&window.MathfieldElement.playSound("keypress"),typeof r.mode=="string"&&(e.switchMode(r.mode),e.snapshot());let b=df(t);const L=window.mathVirtualKeyboard;if(L!=null&&L.isShifted&&(b=typeof b=="string"?b.toUpperCase():b.map(ie=>ie.toUpperCase())),r.simulateKeystroke){let ie=!0;for(const ue of b)Zd(e,new KeyboardEvent("keypress",{key:ue}))&&(ie=!1);if(ie)return}const N=a.at(a.position),J=l(l({},N.computedStyle),e.defaultStyle);if(a.selectionIsCollapsed||(a.deleteAtoms(ri(a.selection)),e.snapshot("delete")),a.mode==="latex")a.deferNotifications({content:!0,selection:!0,data:t,type:"insertText"},()=>{Pf(e);for(const ie of b)Xt.insert(a,ie);e.snapshot("insert-latex"),Tu(e)});else if(a.mode==="text"){for(const ie of b)Xt.insert(a,ie,{style:J});e.snapshot("insert-text")}else if(a.mode==="math")for(const ie of b)og(e,ie,J,N);e.dirty=!0,e.scrollIntoView()}function ig(e){const t=e.model,r=[];let a=t.at(Math.min(t.position,t.anchor));for(;a.type!=="first";)r.push(a),a=a.leftSibling;return r}function og(e,t,r,a){const b=e.model;let L={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(t===" "&&e.options.mathModeSpace&&(L=["insert",e.options.mathModeSpace]),L){e.executeCommand(L);return}if(/\d/.test(t)&&e.options.smartSuperscript&&a.parentBranch==="superscript"&&a.parent.type!=="mop"&&a.parent.type!=="operator"&&a.parent.type!=="extensible-symbol"&&a.hasNoSiblings){sg(b),Xt.insert(b,t,{style:r}),e.snapshot(),$d(b),e.snapshot();return}if(/[a-zA-Z0-9]/.test(t)&&e.adoptStyle!=="none"){const N=e.adoptStyle==="left"?a:a.parent?a.rightSibling:null;(N==null?void 0:N.type)==="mord"&&/[a-zA-Z0-9]/.test(N.value)&&(r=l({},r),N.style.variant&&(r.variant=N.style.variant),N.style.variantStyle&&(r.variantStyle=N.style.variantStyle))}Xt.insert(b,t,{style:r}),e.snapshot(`insert-${b.at(b.position).type}`)}function sg(e){e.selectionIsCollapsed||(e.deleteAtoms(ri(e.selection)),e.mathfield.snapshot("delete"))}function zh(e,t,r){if(!t||e.mode!=="math")return!1;const a=e.at(e.position),{parent:b}=a,L={"(":"(",")":")","{":"\\lbrace","}":"\\rbrace","[":"\\lbrack","]":"\\rbrack","|":"|"}[t];if(!L)return!1;const N=C[L],J=k[L];if(!e.selectionIsCollapsed){e.mathfield.snapshot();const[ie,ue]=ri(e.selection),pe=e.extractAtoms([ie,ue]),Ee=b.addChildrenAfter([new Dr("left...right",pe,{leftDelim:L,rightDelim:J})],e.at(ie));return e.setSelection(e.offsetOf(Ee.firstChild),e.offsetOf(Ee.lastChild)),e.mathfield.snapshot("insert-fence"),e.contentDidChange({data:L,inputType:"insertText"}),!0}if(L==="|"){const ie=b instanceof Dr?b.leftDelim+b.rightDelim:"";if(ie==="\\lbrace\\rbrace"||ie==="\\{\\}"||ie==="\\lbrace?")return e.mathfield.snapshot(),Xt.insert(e,"\\,\\middle\\vert\\,",{format:"latex",style:r}),e.mathfield.snapshot("insert-fence"),e.contentDidChange({data:L,inputType:"insertText"}),!0}if(J){if(b instanceof Dr&&b.firstChild===a&&(b.leftDelim==="?"||b.leftDelim==="."))return b.leftDelim=L,b.isDirty=!0,e.mathfield.snapshot(),e.contentDidChange({data:L,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;if(!(b instanceof Dr)){let Ee=a;for(;Ee&&!(Ee.type==="mclose"&&Ee.value===J);)Ee=Ee.rightSibling;if(Ee){e.mathfield.snapshot();const De=e.extractAtoms([e.offsetOf(a),e.offsetOf(Ee)]);return De.pop(),b.addChildrenAfter([new Dr("left...right",De,{leftDelim:L,rightDelim:J})],a),e.position=e.offsetOf(b.firstChild)+1,e.contentDidChange({data:L,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}}const ie=e.offsetOf(a.lastSibling);let ue;for(ue=e.position;ue<=ie;ue++){const Ee=e.at(ue);if(Ee instanceof Dr&&(Ee.leftDelim==="?"||Ee.leftDelim===".")&&Jd(L,Ee.rightDelim))break}const pe=e.at(ue);if(ue<=ie&&pe instanceof Dr){pe.leftDelim=L,e.mathfield.snapshot();let Ee=e.extractAtoms([e.position,ue-1]);return Ee=Ee.filter(De=>De.type!=="first"),pe.addChildren(Ee,pe.parentBranch),e.position+=1,e.contentDidChange({data:L,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}if(b instanceof Dr&&(b.leftDelim==="?"||b.leftDelim===".")&&Jd(L,b.rightDelim)){b.isDirty=!0,b.leftDelim=L,e.mathfield.snapshot();const Ee=e.extractAtoms([e.offsetOf(a.firstSibling),e.position]);for(const De of Ee)b.parent.addChildBefore(De,b);return e.contentDidChange({data:L,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}if(!(b instanceof Dr&&b.leftDelim==="|")){if(e.mathfield.snapshot(),Xt.insert(e,`\\left${L}\\right?`,{format:"latex",style:r}),a.lastSibling.type!=="first"){const Ee=e.offsetOf(a.lastSibling),De=e.extractAtoms([e.position,Ee]);e.at(e.position).body=De,e.position-=1}return e.mathfield.snapshot("insert-fence"),!0}}if(N){let ie=a;for(;ie;){if(ie.type==="mopen"&&ie.value===N){e.mathfield.snapshot();const je=ie.leftSibling,ze=e.extractAtoms([e.offsetOf(ie.leftSibling),e.offsetOf(a)]);ze.shift();const Je=new Dr("left...right",ze,{leftDelim:N,rightDelim:L});return b.addChildrenAfter([Je],je),e.position=e.offsetOf(Je),e.contentDidChange({data:L,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}ie=ie.leftSibling}if(b instanceof Dr&&a.isLastSibling&&Hh(b.leftDelim,L))return e.mathfield.snapshot(),b.isDirty=!0,b.rightDelim=L,e.position+=1,e.contentDidChange({data:L,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;const ue=e.offsetOf(a.firstSibling);let pe;for(pe=e.position;pe>=ue;pe--){const je=e.at(pe);if(je instanceof Dr&&(je.rightDelim==="?"||je.rightDelim===".")&&Hh(je.leftDelim,L))break}const Ee=e.at(pe);if(pe>=ue&&Ee instanceof Dr)return e.mathfield.snapshot(),Ee.rightDelim=L,Ee.addChildren(e.extractAtoms([pe,e.position]),Ee.parentBranch),e.contentDidChange({data:L,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;if(b instanceof Dr&&(b.rightDelim==="?"||b.rightDelim===".")&&Hh(b.leftDelim,L))return e.mathfield.snapshot(),b.isDirty=!0,b.rightDelim=L,b.parent.addChildren(e.extractAtoms([e.position,e.offsetOf(a.lastSibling)]),b.parentBranch),e.position=e.offsetOf(b),e.contentDidChange({data:L,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;const De=b.parent;return De instanceof Dr&&(De.rightDelim==="?"||De.rightDelim===".")&&e.at(e.position).isLastSibling?(e.position=e.offsetOf(De),zh(e,L,r)):!1}return!1}function Hh(e,t){return e?["(","\\lparen","{","\\{","\\lbrace","[","\\lbrack"].includes(e)?[")","\\rparen","}","\\}","\\rbrace","]","\\rbrack"].includes(t):k[e]===t:!0}function Jd(e,t){return t?[")","\\rparen","}","\\}","\\rbrace","]","\\rbrack"].includes(t)?["(","\\lparen","{","\\{","\\lbrace","[","\\lbrack"].includes(e):C[t]===e:!0}oo({undo:e=>(e.undo(),!0),redo:e=>(e.redo(),!0),scrollIntoView:e=>(e.scrollIntoView(),!0),scrollToStart:e=>(e.field.scroll(0,0),!0),scrollToEnd:e=>{const t=e.field.getBoundingClientRect();return e.field.scroll(t.left-window.scrollX,0),!0},toggleKeystrokeCaption:rg,toggleContextMenu:e=>{const t=e.toggleContextMenu();return t||e.model.announce("plonk"),t},plonk:e=>(e.model.announce("plonk"),!0),switchMode:(e,t,r,a)=>(e.switchMode(t,r,a),!0),insert:(e,t,r)=>e.insert(t,r),typedText:(e,t,r)=>(Fh(e,t,r),!0),insertDecimalSeparator:e=>{const t=e.model;return t.mode==="math"&&window.MathfieldElement.decimalSeparator===","&&t.at(Math.max(t.position,t.anchor)).isDigit()?(e.insert("{,}",{format:"latex"}),e.snapshot("insert-mord"),!0):(e.insert("."),!0)},commit:e=>{var t;return e.model.contentWillChange({inputType:"insertLineBreak"})&&((t=e.host)==null||t.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),e.model.contentDidChange({inputType:"insertLineBreak"})),!0},insertPrompt:(e,t,r)=>{const a=e.getPrompts();let b="prompt-"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36),L=0;for(;a.includes(b)&&L<100;){if(L===99)return console.error("could not find a unique ID after 100 tries"),!1;b="prompt-"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36),L++}return e.insert(`\\placeholder[${t!=null?t:b}]{}`,r),!0}}),oo({copyToClipboard:e=>(e.focus(),e.model.selectionIsCollapsed&&e.select(),"queryCommandSupported"in document&&document.queryCommandSupported("copy")?document.execCommand("copy"):e.element.querySelector(".ML__keyboard-sink").dispatchEvent(new ClipboardEvent("copy",{bubbles:!0,composed:!0})),!1)},{target:"mathfield"}),oo({cutToClipboard:e=>(e.focus(),"queryCommandSupported"in document&&document.queryCommandSupported("cut")?document.execCommand("cut"):e.element.querySelector(".ML__keyboard-sink").dispatchEvent(new ClipboardEvent("cut",{bubbles:!0,composed:!0})),!0),pasteFromClipboard:e=>(e.focus(),"queryCommandSupported"in document&&document.queryCommandSupported("paste")?(document.execCommand("paste"),!0):(navigator.clipboard.readText().then(t=>{t&&e.model.contentWillChange({inputType:"insertFromPaste",data:t})?(e.stopCoalescingUndo(),e.stopRecording(),e.insert(t,{mode:e.model.mode})&&(Tu(e),e.startRecording(),e.snapshot("paste"),e.model.contentDidChange({inputType:"insertFromPaste"}),wn(e))):e.model.announce("plonk"),e.startRecording()}),!0))},{target:"mathfield",canUndo:!0,changeContent:!0,changeSelection:!0});function ag(e,t){e.flushInlineShortcutBuffer(),e.stopCoalescingUndo();const r=Uh(e,t),{model:a}=e;return a.selectionIsCollapsed?(e.defaultStyle.fontSeries&&r.fontSeries===e.defaultStyle.fontSeries&&(r.fontSeries="auto"),r.fontShape&&r.fontShape===e.defaultStyle.fontShape&&(r.fontShape="auto"),r.color&&r.color===e.defaultStyle.color&&(r.color="none"),r.backgroundColor&&r.backgroundColor===e.defaultStyle.backgroundColor&&(r.backgroundColor="none"),r.fontSize&&r.fontSize===e.defaultStyle.fontSize&&(r.fontSize="auto"),e.defaultStyle=l(l({},e.defaultStyle),r)):e.model.deferNotifications({content:!0,type:"insertText"},()=>{a.selection.ranges.forEach(b=>Rh(a,b,r,{operation:"toggle"})),e.snapshot("style-change")}),!0}oo({applyStyle:ag},{target:"mathfield",canUndo:!0,changeContent:!0});function Uh(e,t){var r,a,b,L,N,J,ie,ue,pe,Ee;const De={};if(typeof t.color=="string"){const ze=(a=e.colorMap((r=t.color)!=null?r:t.verbatimColor))!=null?a:"none";ze!==t.color&&(De.verbatimColor=(b=t.verbatimColor)!=null?b:t.color),De.color=ze}if(typeof t.backgroundColor=="string"){const ze=(N=e.backgroundColorMap((L=t.backgroundColor)!=null?L:t.verbatimBackgroundColor))!=null?N:"none";ze!==t.backgroundColor&&(De.verbatimBackgroundColor=(J=t.verbatimBackgroundColor)!=null?J:t.backgroundColor),De.backgroundColor=ze}typeof t.fontFamily=="string"&&(De.fontFamily=t.fontFamily),typeof t.series=="string"&&(De.fontSeries=t.series),typeof t.fontSeries=="string"&&(De.fontSeries=t.fontSeries.toLowerCase()),De.fontSeries&&(De.fontSeries=(ie={bold:"b",medium:"m",normal:"m"}[De.fontSeries])!=null?ie:De.fontSeries),typeof t.shape=="string"&&(De.fontShape=t.shape),typeof t.fontShape=="string"&&(De.fontShape=t.fontShape.toLowerCase()),De.fontShape&&(De.fontShape=(ue={italic:"it",up:"n",upright:"n",normal:"n"}[De.fontShape])!=null?ue:De.fontShape),t.variant&&(De.variant=t.variant.toLowerCase()),t.variantStyle&&(De.variantStyle=t.variantStyle.toLowerCase());const je=(pe=t.size)!=null?pe:t.fontSize;return typeof je=="number"?De.fontSize=Math.max(1,Math.min(10,je)):typeof je=="string"&&(De.fontSize=(Ee={size1:1,size2:2,size3:3,size4:4,size5:5,size6:6,size7:7,size8:8,size9:9,size10:10}[je.toLowerCase()])!=null?Ee:{tiny:1,scriptsize:2,footnotesize:3,small:4,normal:5,normalsize:5,large:6,Large:7,LARGE:8,huge:9,Huge:10}[je]),De}function Wh(e){let[t,r]=ri(e.selection);if(t=qd(e,t,"backward"),r=qd(e,r,"forward"),t===r){const a=e.at(t);if(a.type==="leftright")return e.setSelection(e.offsetOf(a.firstChild)-1,r);if(a.type==="first"&&(a.parent.type==="leftright"||a.parent.type==="surd"))return e.setSelection(t-1,e.offsetOf(a.parent.lastChild)+1);e.setSelection(t-1,r)}else e.setSelection(t,r);return!0}function qd(e,t,r){var a,b,L;let N=e.at(t);if(!N)return t;const J=r==="forward"?1:-1;if(N.mode==="text"){for(;N&&!(N.mode!=="text"||!q.test(N.value));)t+=J,N=e.at(t);return r==="backward"?t-1:t}if(N.mode==="latex"){if(/[a-zA-Z\*]/.test(N.value))if(r==="backward")for(;N&&N.mode==="latex"&&N.value!=="\\"&&/[a-zA-Z]/.test(N.value);)t+=J,N=e.at(t);else for(;N&&N.mode==="latex"&&/[a-zA-Z\*]/.test(N.value);)t+=J,N=e.at(t);else if(N.value==="{"){if(r==="forward"){for(;N&&N.mode==="latex"&&N.value!=="}";)t+=J,N=e.at(t);return t}return t-1}else if(N.value==="}"){if(r==="backward"){for(;N&&N.mode==="latex"&&N.value!=="{";)t+=J,N=e.at(t);return t-1}return t}return t-1}if(N.mode==="math"){if(N.isDigit()){for(;(a=e.at(t+J))!=null&&a.isDigit();)t+=J;return r==="backward"?t-1:t}if(N.style.variant||N.style.variantStyle){let ie=(b=e.at(t))==null?void 0:b.style;for(;ie&&ie.variant===N.style.variant&&ie.variantStyle===N.style.variantStyle;)ie=(L=e.at(t+J))==null?void 0:L.style,t+=J;return r==="backward"?t-1:t}return t}return t}oo({selectGroup:e=>{const t=Wh(e);return t||e.announce("plonk"),t},selectAll:e=>e.setSelection(0,e.lastOffset),extendSelectionForward:e=>js(e,"forward",{extend:!0}),extendSelectionBackward:e=>js(e,"backward",{extend:!0}),extendToNextWord:e=>Sc(e,"forward",{extend:!0}),extendToPreviousWord:e=>Sc(e,"backward",{extend:!0}),extendSelectionUpward:e=>js(e,"upward",{extend:!0}),extendSelectionDownward:e=>js(e,"downward",{extend:!0}),extendToNextBoundary:e=>Sc(e,"forward",{extend:!0}),extendToPreviousBoundary:e=>Sc(e,"backward",{extend:!0}),extendToGroupStart:e=>{const t=e.setSelection(e.anchor,e.offsetOf(e.at(e.position).firstSibling));return t||e.announce("plonk"),t},extendToGroupEnd:e=>{const t=e.setSelection(e.anchor,e.offsetOf(e.at(e.position).lastSibling));return t||e.announce("plonk"),t},extendToMathFieldStart:e=>{const t=e.setSelection(e.anchor,0);return t||e.announce("plonk"),t},extendToMathFieldEnd:e=>{const t=e.setSelection(e.anchor,e.lastOffset);return t||e.announce("plonk"),t}},{target:"model",changeSelection:!0});var Ll=null,Ru=0,qf=class jo{static start(t,r,a,b){var L;jo.element=t,(L=jo.controller)==null||L.abort(),jo.controller=new AbortController;const N={signal:jo.controller.signal};"PointerEvent"in window?(t.addEventListener("pointermove",a,N),t.addEventListener("pointerup",b,N),t.addEventListener("pointercancel",b,N),Kh(r)&&(jo.pointerId=r.pointerId,t.setPointerCapture(r.pointerId))):(window.addEventListener("mousemove",a,N),window.addEventListener("blur",b,N),window.addEventListener("mouseup",b,N))}static stop(){var t;(t=jo.controller)==null||t.abort(),jo.controller=void 0,typeof jo.pointerId=="number"&&(jo.element.releasePointerCapture(jo.pointerId),jo.pointerId=void 0)}};function Kh(e){return e!==null&&globalThis.PointerEvent!==void 0&&e instanceof PointerEvent}function Qd(e,t){var r;if(t.buttons>1)return;e.atomBoundsCache=new Map;const a=e;let b,L=!1,N=!1,J="none",ie=!1,ue=!1;const pe=t.clientX,Ee=t.clientY,De=Date.now(),je=a.field,ze=setInterval(()=>{ie?je.scroll({top:0,left:je.scrollLeft-16}):ue&&je.scroll({top:0,left:je.scrollLeft+16})},32);function Je(){qf.stop(),L=!1,clearInterval(ze),e.element.classList.remove("tracking"),t&&t.preventDefault()}function pt(ot){if(!a.hasFocus()){Je();return}const gt=ot.clientX,ct=ot.clientY,Dt=Kh(ot)&&ot.pointerType==="touch"?20:5;if(Date.now()<De+500&&Math.abs(pe-gt)<Dt&&Math.abs(Ee-ct)<Dt){ot.preventDefault(),ot.stopPropagation();return}const Bt=je.getBoundingClientRect();ue=gt>Bt.right,ie=gt<Bt.left;let Rt=b;Kh(ot)&&(ot.isPrimary||(Rt=Iu(a,ot.clientX,ot.clientY,{bias:0})));const br=Iu(a,gt,ct,{bias:gt<=pe?gt===pe?0:-1:1});Rt>=0&&br>=0&&(a.model.extendSelectionTo(Rt,br),wn(e)),N&&Wh(a.model)}Ll&&Math.abs(Ll.x-pe)<5&&Math.abs(Ll.y-Ee)<5&&Date.now()<Ll.time+500?(Ru+=1,Ll.time=De):(Ll={x:pe,y:Ee,time:De},Ru=1);const Xe=je.getBoundingClientRect();if(pe>=Xe.left&&pe<=Xe.right&&Ee>=Xe.top&&Ee<=Xe.bottom){if(e.flushInlineShortcutBuffer(),e.adoptStyle="left",b=Iu(e,pe,Ee,{bias:0}),b>=0){if(e.element.classList.add("tracking"),t.shiftKey){const ot=e.model.selectionIsCollapsed;e.model.extendSelectionTo(e.model.anchor,b),Ed(e.model)||ot?J="all":J="selection"}else e.model.at(b).type==="placeholder"?(e.model.setSelection(b-1,b),J="selection"):((r=e.model.at(b).rightSibling)==null?void 0:r.type)==="placeholder"?(e.model.setSelection(b,b+1),J="selection"):(e.model.position=b,Ed(e.model)?J="all":J="selection");e.defaultStyle={},t.detail===3||Ru>2?(Je(),(t.detail===3||Ru===3)&&(e.model.selection={ranges:[[0,e.model.lastOffset]]},J="all")):L||(L=!0,qf.start(je,t,pt,Je),(t.detail===2||Ru===2)&&(N=!0,Wh(e.model),J="all"))}e.hasFocus()||(J="none",e.focus({preventScroll:!0}))}else Ll=null;e.stopCoalescingUndo(),J!=="none"&&(e.model.selectionIsCollapsed&&(J="all"),wn(e)),t.preventDefault()}function lg(e,t,r){if(e>=r.left&&e<=r.right&&t>=r.top&&t<=r.bottom)return 0;const a=e-(r.left+r.right)/2,b=t-(r.top+r.bottom)/2;return a*a+b*b}function ep(e,t,r,a,b){if(!r.id)return[1/0,null];if(t.has(r.id))return t.get(r.id);const L=Ua(e,r);if(!L)return[1/0,null];let N=[1/0,null];if(r.hasChildren&&!r.captureSelection&&a>=L.left&&a<=L.right)for(const J of r.children){const ie=ep(e,t,J,a,b);ie[0]<=N[0]&&(N=ie)}return N[1]||(N=[lg(a,b,L),r]),t.set(r.id,N),N}function cg(e,t,r){const[,a]=ep(e,new Map,e.model.root,t,r);return a}function Iu(e,t,r,a){var b;const L=e.field.querySelector(".ML__latex").getBoundingClientRect();if(!L)return 0;if(t>L.right||r>L.bottom+8)return e.model.lastOffset;if(t<L.left||r<L.top-8)return 0;a=a!=null?a:{},a.bias=(b=a.bias)!=null?b:0;let N=cg(e,t,r);const J=[];let ie=N;for(;ie;)J.unshift(ie),ie=ie.parent;for(const pe of J)if(pe.captureSelection){N=pe;break}let ue=e.model.offsetOf(N);if(ue<0)return-1;if(N.leftSibling)if(a.bias===0&&N.type!=="placeholder"){const pe=Ua(e,N);pe&&t<(pe.left+pe.right)/2&&(ue=e.model.offsetOf(N.leftSibling))}else a.bias<0&&(ue=e.model.offsetOf(N.leftSibling));return ue}var ug=class extends Xt{constructor(){super("math")}onPaste(e,t){if(!t||!e.model.contentWillChange({data:typeof t=="string"?t:null,dataTransfer:typeof t=="string"?null:t,inputType:"insertFromPaste"}))return!1;let r="",a="auto",b=typeof t!="string"?t.getData("application/json+mathlive"):"";if(b)try{const L=JSON.parse(b);if(L&&Array.isArray(L)){e.snapshot();const N=$a(L),{model:J}=e;J.selectionIsCollapsed||J.deleteAtoms(ri(J.selection));const ie=J.at(J.position);if(ie.parent instanceof qt){console.assert(ie.parentBranch!==void 0);const ue=[];let pe=[];N[0].type==="first"&&N.shift(),N[N.length-1].type==="first"&&N.pop();for(const ze of N)ze.type==="first"&&pe.length>0?(ue.push(pe),pe=[ze]):pe.push(ze);pe.length>0&&ue.push(pe);let Ee=Number(ie.parentBranch[0]),De=Number(ie.parentBranch[1]);const je=ie.parent.maxColumns;for(;ie.parent.colCount-De<ue.length&&ie.parent.colCount<je;)ie.parent.addColumn();ie.parent.addChildrenAfter(ue[0],ie);for(let ze=1;ze<ue.length;ze++)De++,De>=je&&(De=0,ie.parent.addRowAfter(Ee),Ee++),ie.parent.setCell(Ee,De,ue[ze])}else ie.parent.addChildrenAfter(N.filter(ue=>ue.type!=="first"),ie);return J.position=J.offsetOf(N[N.length-1]),J.contentDidChange({inputType:"insertFromPaste"}),wn(e),!0}}catch(L){}if(b=typeof t!="string"?t.getData("application/json"):"",b&&window.MathfieldElement.computeEngine)try{const L=JSON.parse(b);if(typeof L=="object"&&"latex"in L&&L.latex&&(r=L.latex),!r){const N=window.MathfieldElement.computeEngine.box(L);N&&!N.has("Error")&&(r=N.latex)}r||(a="latex")}catch(L){}if(!r&&typeof t!="string"&&(r=t.getData("application/x-latex"),r&&(a="latex")),r||(r=typeof t=="string"?t:t.getData("text/plain")),r){let L;return[L,r]=Os(r),a==="auto"&&L&&(a="latex"),e.stopCoalescingUndo(),e.stopRecording(),this.insert(e.model,r,{format:a})&&(e.startRecording(),e.snapshot("paste"),wn(e)),e.startRecording(),!0}return!1}insert(e,t,r){var a,b;const L=typeof t=="string"?t:(b=(a=window.MathfieldElement.computeEngine)==null?void 0:a.box(t).latex)!=null?b:"";if(!r.silenceNotifications&&!e.contentWillChange({data:L,inputType:"insertText"}))return!1;r.insertionMode||(r.insertionMode="replaceSelection"),r.selectionMode||(r.selectionMode="placeholder"),r.format||(r.format="auto");const{silenceNotifications:N}=e;r.silenceNotifications&&(e.silenceNotifications=!0);const J=e.silenceNotifications;e.silenceNotifications=!0;const ie={"?":"\\placeholder{}","@":"\\placeholder{}"};ie[0]=r.insertionMode==="replaceAll"?"":e.getValue(e.selection,"latex-unstyled"),r.insertionMode==="replaceSelection"&&!e.selectionIsCollapsed?e.deleteAtoms(ri(e.selection)):r.insertionMode==="replaceAll"?(e.root.setChildren([],"body"),e.position=0):r.insertionMode==="insertBefore"?e.collapseSelection("backward"):r.insertionMode==="insertAfter"&&e.collapseSelection("forward"),!e.at(e.position).isLastSibling&&e.at(e.position+1).type==="placeholder"?e.deleteAtoms([e.position,e.position+1]):e.at(e.position).type==="placeholder"&&e.deleteAtoms([e.position-1,e.position]);let ue=-1;ie[0]?ie["@"]=ie[0]:typeof t=="string"&&/(^|[^\\])#@/.test(t)&&(ue=hg(e),ue>=0&&(ie["@"]=e.getValue(ue,e.position,"latex"))),ie[0]||(ie[0]=ie["?"]);let pe=!1;const Ee=gt=>(pe=!0,ie[gt]);let[De,je]=tp(e,t,Ee,r);if(!je)return!1;const ze=je.length===1&&je[0].type==="genfrac";ze&&ue>=0&&typeof e.mathfield.options.isImplicitFunction=="function"&&e.mathfield.options.isImplicitFunction(e.at(e.position).command)?(ie["@"]=ie["?"],pe=!1,[De,je]=tp(e,t,Ee,r)):ue>=0&&e.deleteAtoms([ue,e.position]);const{parent:Je}=e.at(e.position),pt=Je.hasEmptyBranch("body");if(ze&&De!=="latex"&&e.mathfield.options.removeExtraneousParentheses&&Je instanceof Dr&&Je.leftDelim==="("&&pt){const gt=Je.parent,ct=Je.parentBranch;gt.removeChild(Je),gt.setChildren(je,ct)}const Xe=e.at(e.position);Xe.parent.addChildrenAfter(je,Xe),De==="latex"&&typeof t=="string"&&(Je==null?void 0:Je.type)==="root"&&pt&&!pe&&(Je.verbatimLatex=t),e.silenceNotifications=J;const ot=je[je.length-1];if(r.selectionMode==="placeholder"){const gt=je.flatMap(ct=>[ct,...ct.children]).find(ct=>ct.type==="placeholder");if(gt){const ct=e.offsetOf(gt);e.setSelection(ct-1,ct),e.announce("move")}else ot&&(e.position=e.offsetOf(ot))}else r.selectionMode==="before"||(r.selectionMode==="after"?ot&&(e.position=e.offsetOf(ot)):r.selectionMode==="item"&&e.setSelection(e.anchor,e.offsetOf(ot)));return e.contentDidChange({data:L,inputType:"insertText"}),e.silenceNotifications=N,!0}};function tp(e,t,r,a){var b;let L,N=[];if(typeof t!="string"||a.format==="math-json"){const J=window.MathfieldElement.computeEngine;if(!J)return["math-json",[]];[L,t]=["latex",J.box(t).latex],N=ii(t,{context:e.mathfield.context})}else typeof t=="string"&&a.format==="ascii-math"?([L,t]=bl(t,{format:"ascii-math",inlineShortcuts:e.mathfield.options.inlineShortcuts}),N=ii(t,{context:e.mathfield.context}),L!=="latex"&&e.mathfield.options.removeExtraneousParentheses&&Qf(N)):(a.format==="auto"||(b=a.format)!=null&&b.startsWith("latex"))&&(a.format==="auto"&&([L,t]=bl(t,{format:"auto",inlineShortcuts:e.mathfield.options.inlineShortcuts})),a.format==="latex"&&([,t]=Os(t)),N=ii(t,{context:e.mathfield.context,args:r}),a.format!=="latex"&&e.mathfield.options.removeExtraneousParentheses&&Qf(N));return Va(N,a.style),[L!=null?L:"latex",N]}function fg(e){if(!e||(console.assert(e[0].type==="first"),e.length>1))return null;const t=e[0];return t instanceof Dr&&t.leftDelim==="("&&t.rightDelim===")"?t.removeBranch("body"):null}function Qf(e){if(e){for(let t=0;e[t];t++){const r=e[t];if(r instanceof Dr&&r.leftDelim==="("){let a=0,b=0,L=0;for(let N=0;r.body[N];N++)r.body[N].type==="genfrac"&&(a++,b=N),L++;L===0&&a===1&&(e[t]=r.body[b])}}for(const t of e){for(const r of t.branches)if(!t.hasEmptyBranch(r)){Qf(t.branch(r));const a=fg(t.branch(r));a&&t.setChildren(a,r)}if(t instanceof qt)for(const r of t.cells)Qf(r)}}}function hg(e){let t=e.at(e.position);if(t.mode==="text"){for(;!t.isFirstSibling&&t.mode==="text";)t=t.leftSibling;return e.offsetOf(t)}const r=t;let a=!1;if(t.type==="mclose"){const b=C[t.value];for(;!t.isFirstSibling&&!(t.type==="mopen"&&t.value===b);)t=t.leftSibling;t.isFirstSibling||(t=t.leftSibling),a=!0}else t.type==="leftright"&&(t=t.leftSibling,a=!0);if(a)for(;!t.isFirstSibling&&(t.isFunction||rp(t));)t=t.leftSibling;else{const b=[];for(;!t.isFirstSibling&&(rp(t)||b.length>0);)t.type==="mclose"&&b.unshift(t.value),t.type==="mopen"&&b.length>0&&t.value===C[b[0]]&&b.shift(),t=t.leftSibling}return r===t?-1:e.offsetOf(t)}function rp(e){return e.isDigit()?!0:e.type&&/^(mord|surd|subsup|leftright|mop|mclose)$/.test(e.type)?!e.isExtensibleSymbol:!1}new ug;var dg=class extends Xt{constructor(){super("text")}onPaste(e,t){if(!t)return!1;const r=typeof t=="string"?t:t.getData("text/plain");return r&&e.model.contentWillChange({inputType:"insertFromPaste",data:r})?(e.stopCoalescingUndo(),e.stopRecording(),this.insert(e.model,r)&&(e.model.contentDidChange({inputType:"insertFromPaste"}),e.startRecording(),e.snapshot("paste"),wn(e)),e.startRecording(),!0):!1}insert(e,t,r={}){if(!e.contentWillChange({data:t,inputType:"insertText"}))return!1;r.insertionMode||(r.insertionMode="replaceSelection"),r.selectionMode||(r.selectionMode="placeholder"),r.format||(r.format="auto");const{silenceNotifications:a}=e;r.silenceNotifications&&(e.silenceNotifications=!0);const b=e.silenceNotifications;e.silenceNotifications=!0,r.insertionMode==="replaceSelection"&&!e.selectionIsCollapsed?e.deleteAtoms(ri(e.selection)):r.insertionMode==="replaceAll"?(e.root.setChildren([],"body"),e.position=0):r.insertionMode==="insertBefore"?e.collapseSelection("backward"):r.insertionMode==="insertAfter"&&e.collapseSelection("forward");const L=pg(t,e.mathfield.context);if(Va(L,r.style),!L)return!1;const N=e.at(e.position),J=N.parent.addChildrenAfter(L,N);return e.silenceNotifications=b,r.selectionMode==="before"||(r.selectionMode==="item"?e.setSelection(e.anchor,e.offsetOf(J)):J&&(e.position=e.offsetOf(J))),e.contentDidChange({data:t,inputType:"insertText"}),e.silenceNotifications=a,!0}};function pg(e,t){return e=e.replace(/\\/g,"\\textbackslash "),e=e.replace(/#/g,"\\#"),e=e.replace(/\$/g,"\\$"),e=e.replace(/%/g,"\\%"),e=e.replace(/&/g,"\\&"),e=e.replace(/_/g,"\\_"),e=e.replace(/{/g,"\\textbraceleft "),e=e.replace(/}/g,"\\textbraceright "),e=e.replace(/lbrace/g,"\\textbraceleft "),e=e.replace(/rbrace/g,"\\textbraceright "),e=e.replace(/\^/g,"\\textasciicircum "),e=e.replace(/~/g,"\\textasciitilde "),e=e.replace(/£/g,"\\textsterling "),ii(e,{context:t,parseMode:"text"})}new dg;function Bs(e){return{value:e.model.getValue(),selectionIsCollapsed:e.model.selectionIsCollapsed,canUndo:e.canUndo(),canRedo:e.canRedo(),style:e.selectionStyle,mode:e.model.mode}}var an=4,Ki=20,Hn=2*(Ki+an),eh=(e,t)=>`
<line x1="${e+Ki}" y1="${t+Ki}"
x2="${e>t?e+Ki:7*Ki+10*an}"
y2="${e<t?t+Ki:7*Ki+10*an}"/>
<svg id="plus" viewBox="0 0 40 40" x="${e}" y="${t}" width="40" height="40">
<circle class="cls-2" cx="20" cy="20" r="20"/>
<path class="font" d="m33.33,20c0,1.84-1.49,3.34-3.33,3.34h-6.67v6.66c0,1.84-1.49,3.34-3.33,3.34s-3.34-1.5-3.34-3.34v-6.66h-6.66c-1.84,0-3.34-1.5-3.34-3.34s1.5-3.33,3.34-3.33h6.66v-6.67c0-1.84,1.5-3.33,3.34-3.33s3.33,1.49,3.33,3.33v6.67h6.67c1.84,0,3.33,1.49,3.33,3.33Z"/>
</svg>`,np=(e,t)=>`
<line x1="${e+Ki}" y1="${t+Ki}"
x2="${e>t?e+Ki:7*Ki+10*an}"
y2="${e<t?t+Ki:7*Ki+10*an}"/>
<svg id="minus" viewBox="0 0 40 40" x="${e}" y="${t}" width="40" height="40">
<circle class="cls-2" cx="20" cy="20" r="20"/>
<path class="font" d="m33.33,20c0,1.84-1.49,3.33-3.33,3.33H10c-1.84,0-3.34-1.49-3.34-3.33s1.5-3.34,3.34-3.34h20c1.84,0,3.33,1.5,3.33,3.34Z"/>
</svg>`,th=(e,t,r)=>`
<svg id="arrow" viewBox="0 0 40 40" x="${e}" y="${t}" width="40" height="40">
<circle class="cls-2" cx="20" cy="20" r="20"/>
<g transform="rotate(${r})" transform-origin="20 20">
<path class="font" d="m17.7,7.23h4.6c.52,0,.94.42.94.94v13.82c0,.52.42.94.94.94h3.39c.83,0,1.25,1.01.66,1.6l-7.56,7.56c-.37.37-.96.37-1.32,0l-7.56-7.56c-.59-.59-.17-1.6.66-1.6h3.39c.52,0,.94-.42.94-.94v-13.82c0-.52.42-.94.94-.94Z"/>
</g>
</svg>`,mg=`
<svg class="MLEP__array-buttons" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox=
"-2 -2 ${8*Ki+10*an+5} ${8*Ki+10*an+5}">
<rect
class="MLEP__array-insert-background rows"
x="0"
y="${Hn+an}"
height="${3*Hn}"
width="${Hn}"
rx="${Hn/2}"/>
<rect
class="MLEP__array-insert-background columns"
x="${Hn+an}"
y="0"
height="${Hn}"
width="${3*Hn}"
rx="${Hn/2}"/>
<g data-command='"moveDown"'>
${th(2*(an+Hn),2*an+3*Hn,0)}
</g>
<g data-command='"moveUp"'>
${th(2*(an+Hn),2*an+Hn,180)}
</g>
<g data-command='"moveToNextWord"'>
${th(2*an+3*Hn,2*(an+Hn),-90)}
</g>
<g data-command='"moveToPreviousWord"'>
${th(2*an+Hn,2*(an+Hn),90)}
</g>
<g>
<g data-command='"addColumnBefore"'>
${eh(2*an+Hn,an)}
</g>
<g data-command='"removeColumn"'>
${np(2*an+2*Hn,an)}
</g>
<g data-command='"addColumnAfter"'>
${eh(2*an+3*Hn,an)}
</g>
<g data-command='"addRowBefore"'>
${eh(an,2*an+Hn)}
</g>
<g data-command='"removeRow"'>
${np(an,2*an+2*Hn)}
</g>
<g data-command='"addRowAfter"'>
${eh(an,2*an+3*Hn)}
</g>
</svg>`,gg=e=>`
<svg id="matrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","matrix"]'>
<rect class="cls-1" width="28" height="24"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/></svg>`,vg=e=>`
<svg id="pmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","pmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m6,4c-3.96,4.6-3.96,11.4,0,16"/>
<path class="cls-2" d="m22,4c3.96,4.6,3.96,11.4,0,16"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/></svg>`,ip=e=>`
<svg id="Bmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","Bmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m6,4c-1.1,0-2,.9-2,2v3c0,1.66-.9,3-2,3,1.1,0,2,1.34,2,3v3c0,1.1.9,2,2,2"/>
<path class="cls-2" d="m22,4c1.1,0,2,.9,2,2v3c0,1.66.9,3,2,3-1.1,0-2,1.34-2,3v3c0,1.1-.9,2-2,2"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/>
</svg>`,yg=e=>`
<svg id="bmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","bmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m6,4h-3v16h3"/>
<path class="cls-2" d="m22,4h3v16h-3"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/>
</svg>`,bg=e=>`
<svg id="vmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","vmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/>
<line class="cls-2" x1="4" y1="4" x2="4" y2="20"/>
<line class="cls-2" x1="24" y1="4" x2="24" y2="20"/>
</svg>`,_g=e=>`
<svg id="Vmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="-3.5 -3 35 30"
data-command='["setEnvironment","Vmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/>
<line class="cls-2" x1="6" y1="4" x2="6" y2="20"/>
<line class="cls-2" x1="22" y1="4" x2="22" y2="20"/>
<line class="cls-2" x1="2" y1="4" x2="2" y2="20"/>
<line class="cls-2" x1="26" y1="4" x2="26" y2="20"/>
</svg>`,wg=e=>`
<svg id="cases" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","cases"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m10,4c-1.1,0-2,.9-2,2v3c0,1.66-.9,3-2,3,1.1,0,2,1.34,2,3v3c0,1.1.9,2,2,2"/>
<circle cx="13" cy="8" r="1"/>
<circle cx="13" cy="16" r="1"/>
<circle cx="21" cy="8" r="1"/>
<circle cx="21" cy="16" r="1"/>
</svg>`,xg=e=>`
<svg id="rcases" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","rcases"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m18,20c1.1,0,2-.9,2-2v-3c0-1.66.9-3,2-3-1.1,0-2-1.34-2-3v-3c0-1.1-.9-2-2-2"/>
<circle cx="15" cy="8" r="1"/>
<circle cx="15" cy="16" r="1"/>
<circle cx="7" cy="8" r="1"/>
<circle cx="7" cy="16" r="1"/>
</svg>`,$h={matrix:gg,pmatrix:vg,bmatrix:yg,Bmatrix:ip,vmatrix:bg,Vmatrix:_g},Gh={cases:wg,rcases:xg,Bmatrix:ip};function Sg(e){var t,r;const a=(t=e.model.parentEnvironment)==null?void 0:t.array;if(!a)return;let b=0;a.forEach(ze=>{(!b||ze.length>b)&&(b=ze.length)});let L=document.getElementById("mathlive-environment-popover");L||(L=Rf("mathlive-environment-popover"),io("environment-popover"),io("core"),L.setAttribute("aria-hidden","true"));let N;const J=L.querySelector(".MLEP__environment-controls");J?N=J:(N=document.createElement("div"),L.innerHTML="",L.appendChild(N)),N.className="MLEP__environment-controls",N.style.display="flex",N.style.width="100%",N.style.height="100%",N.style.boxSizing="border-box",N.innerHTML=mg;let ie=[],ue="";const pe=e.model.parentEnvironment.environmentName;if(ki(pe)){const ze=kg(pe);ue=$h[ze]("active");const Je=$h,{[ze]:pt}=Je,Xe=d(Je,[v(ze)]);ie=Object.values(Xe).map(ot=>ot("inactive"))}else if(Ei(pe)){const ze=Eg(pe);ue=Gh[ze]("active");const Je=Gh,{[ze]:pt}=Je,Xe=d(Je,[v(ze)]);ie=Object.values(Xe).map(ot=>ot("inactive"))}else Pn(pe)&&(ue=$h.matrix("active"),ie=Object.values(Gh).map(ze=>ze("inactive")));const Ee=document.createElement("div");Ee.className="MLEP__environment-delimiter-controls",Ee.style.display="flex",Ee.style.flexDirection="column",Ee.innerHTML=`
<div class='MLEP__array-delimiter-options'>
${ue}
${ie.join("")}
</div>`,ue&&N.appendChild(Ee),N.querySelectorAll("[data-command]").forEach(ze=>{const Je=ze.dataset.command;let pt=Je;try{pt=JSON.parse(Je)}catch(Xe){}ze.addEventListener("mousedown",Xe=>Xe.preventDefault()),pt&&ze.addEventListener("click",()=>e.executeCommand(pt))});const je=(r=e.field)==null?void 0:r.getBoundingClientRect();je&&(L.style.top=`${window.scrollY+(je.top-L.clientHeight-15)}px`,L.style.left=`${je.left+20}px`,L.classList.add("is-visible"))}function Vh(){const e=document.getElementById("mathlive-environment-popover");e==null||e.classList.remove("is-visible")}function Cg(){document.getElementById("mathlive-environment-popover")&&(Th("mathlive-environment-popover"),n("environment-popover"),n("core"))}function rh(e){if(!e.hasFocus())return;let t=!1;if(e.model.mode==="math"){const r=e.model.parentEnvironment;if(r!=null&&r.array&&gn(r.environmentName)){const a=e.options.environmentPopoverPolicy;t=a==="auto"||a==="on"}}t?Sg(e):Vh()}function kg(e){return e.replace("*","")}function Eg(e){return e==="dcases"?"cases":e}function op(e){const t=getComputedStyle(e).direction;return t==="ltr"||t==="rtl"?t:"ltr"}function sp(e,t,r){return t==="left"||t==="leading"&&r==="ltr"||t==="trailing"&&r==="rtl"?e.left:e.right}function Xh(e,t,r,a){return r==="middle"?e-t/2:r==="start"&&a==="rtl"||r==="end"&&a==="ltr"||r==="top"||r==="right"?Math.max(0,e-t):e}function Mg(e,t,r,a){return r==="middle"?e-t/2:r==="start"&&a==="ltr"||r==="end"&&a==="rtl"||r==="top"||r==="right"?e:e-t}function Tg(e,t){var r,a,b;const L=(r=op(e))!=null?r:"ltr";e.style.position="fixed",e.style.left="",e.style.top="",e.style.right="",e.style.bottom="",e.style.height="",e.style.width="";const N=e.getBoundingClientRect(),J=Number.isFinite(t.maxHeight)?Math.min(t.maxHeight,window.innerHeight):window.innerHeight;let ie=Math.min(J,(a=t.height)!=null?a:N.height),ue=Xh(t.location.y,ie,t.verticalPos,L);ue+ie>window.innerHeight-8&&(t.alternateLocation?(ue=Xh(t.alternateLocation.y,ie,t.verticalPos,L),ue+ie>window.innerHeight-8&&(ue=void 0)):ue=void 0),Number.isFinite(ue)||(ue=Math.max(8,window.innerHeight-8-ie),8+ie>window.innerHeight-8&&(e.style.bottom="8px")),ie=Math.min(ue+ie,window.innerHeight-8)-ue;const pe=Number.isFinite(t.maxWidth)?Math.min(t.maxWidth,window.innerWidth):window.innerWidth;let Ee=Math.min(pe,(b=t.width)!=null?b:N.width),De=Xh(t.location.x,Ee,t.horizontalPos,L);De+Ee>window.innerWidth-8&&(t.alternateLocation?(De=Mg(t.alternateLocation.x,Ee,t.verticalPos,L),De+Ee>window.innerWidth-8&&(De=void 0)):De=void 0),Number.isFinite(De)||(De=Math.max(8,window.innerWidth-8-Ee),8+Ee>window.innerWidth-8&&(e.style.right="8px")),Ee=Math.min(De+Ee,window.innerWidth-8)-De,L==="rtl"?e.style.right=`${Math.ceil(window.innerWidth-De-Ee).toString()}px`:e.style.left=`${Math.ceil(De).toString()}px`,e.style.top=`${Math.ceil(ue).toString()}px`,ie!==N.height&&(e.style.height=`${Math.ceil(ie).toString()}px`),Ee!==N.width&&(e.style.width=`${Math.ceil(Ee).toString()}px`)}function Ag(e,t){return Math.hypot(t.x-e.x,t.y-e.y)}function Cc(e){return"submenu"in e}function Ns(e){return"type"in e&&e.type==="command"||"onMenuSelect"in e||"id"in e}function Yh(e){return"type"in e&&e.type==="divider"}function Zh(e){return"type"in e&&e.type==="heading"}var ap={};function Jh(e){let t=ap[e];if(!t){let r;switch(e){case"checkmark":r=`<span aria-hidden="true" class="ui-checkmark"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M435.848 83.466L172.804 346.51l-96.652-96.652c-4.686-4.686-12.284-4.686-16.971 0l-28.284 28.284c-4.686 4.686-4.686 12.284 0 16.971l133.421 133.421c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-28.284-28.284c-4.686-4.686-12.284-4.686-16.97 0z"></path></svg>
</span>`;break;case"trailing-chevron":r='<span aria-hidden="true" class="ui-trailing-chevron"><svg focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"></path></svg></span>';break;case"mixedmark":r='<span aria-hidden="true" class="ui-mixedmark"><svg xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 512 512"><path fill="currentColor" d="M0 256c0-13.3 10.7-24 24-24H488c13.3 0 24 10.7 24 24s-10.7 24-24 24H24c-13.3 0-24-10.7-24-24z"/></svg></span>'}if(r){const a=document.createElement("template");a.innerHTML=r,ap[e]=a,t=a}}if(t){if("content"in t)return t.content.cloneNode(!0);const r=document.createElement("svg");return r.innerHTML=t.innerHTML,r}}var lp=80,cp=class{constructor(e,t){this._element=null;var r;this.parentMenu=t,this._declaration=e,Cc(e)?(this.type="submenu",this.submenu=new up(e.submenu,{parentMenu:t,submenuClass:e.submenuClass,columnCount:e.columnCount})):this.type=(r=e.type)!=null?r:"command",this.hasCheck=Ns(e)&&e.checked!==void 0}get rootMenu(){return this.parentMenu.rootMenu}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}dispose(){var e,t;(e=this._abortController)==null||e.abort(),this._abortController=void 0,(t=this._element)==null||t.remove(),this._element=null,this.submenu&&this.submenu.dispose(),this.submenu=void 0}get menuItem(){return this._declaration}get label(){var e;return(e=this._label)!=null?e:""}set label(e){e===void 0&&(e=""),e!==this._label&&(this._label=e,this.dirty=!0)}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this.dirty=!0)}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.element&&(e?this.element.removeAttribute("aria-disabled"):this.element.setAttribute("aria-disabled","true")),this.dirty=!0}get checked(){return this._checked}set checked(e){this._checked=e,this.dirty=!0}get tooltip(){return this._tooltip}set tooltip(e){e!==this._tooltip&&(this._tooltip=e,this.dirty=!0)}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){e!==this._ariaLabel&&(this._ariaLabel=e,this.dirty=!0)}get active(){var e,t;return(t=(e=this.element)==null?void 0:e.classList.contains("active"))!=null?t:!1}set active(e){this.element&&this.element.classList.toggle("active",e)}updateState(e){var t,r,a;const b=this._declaration;if(Yh(b)){this.enabled=!1,this.checked=!1;return}Zh(b)&&(this.enabled=!1,this.checked=!1,this.visible=!0),Ns(b)&&(this.checked=Ns(b)&&((t=kc(b.checked,e))!=null?t:!1)),(Ns(b)||Cc(b))&&(this.enabled=(r=kc(b.enabled,e))!=null?r:!0,this.visible=(a=kc(b.visible,e))!=null?a:!0,this.visible&&this.enabled&&this.submenu&&(this.submenu.updateState(e),this.submenu.visible||(this.visible=!1))),(Ns(b)||Zh(b)||Cc(b))&&(this.label=kc(b.label,e),this.tooltip=kc(b.tooltip,e),this.ariaLabel=kc(b.ariaLabel,e)),this._element&&this.updateElement()}set dirty(e){console.assert(e===!0),e&&this.parentMenu&&(this.parentMenu.dirty=!0)}updateElement(){if(!this.visible||!this.element)return;const e=this.element;e.textContent="",this.enabled?e.removeAttribute("aria-disabled"):e.setAttribute("aria-disabled","true"),this.checked===!0?(e.setAttribute("aria-checked","true"),e.append(Jh("checkmark"))):this.checked==="mixed"?(e.setAttribute("aria-checked","mixed"),e.append(Jh("mixedmark"))):e.removeAttribute("aria-checked"),this.ariaLabel&&e.setAttribute("aria-label",this.ariaLabel);const t=document.createElement("span");if(t.className=this.parentMenu.hasCheck?"label indent":"label",this.type==="heading"&&t.classList.add("heading"),t.innerHTML=this.label,e.append(t),this._tooltip&&e.setAttribute("data-tooltip",this._tooltip),Ns(this._declaration)&&this._declaration.keyboardShortcut){const r=document.createElement("kbd");r.innerHTML=Eh(this._declaration.keyboardShortcut),e.append(r)}this.type==="submenu"&&e.append(Jh("trailing-chevron"))}get element(){if(this._element)return this._element;if(Yh(this._declaration)){const r=document.createElement("li");return r.setAttribute("part","menu-divider"),r.setAttribute("role","divider"),this._element=r,r}const e=document.createElement("li");this._element=e,(Ns(this._declaration)||Zh(this._declaration)||Cc(this._declaration))&&this._declaration.class&&(e.className=this._declaration.class),e.setAttribute("part","menu-item"),e.setAttribute("tabindex","-1"),this.hasCheck?e.setAttribute("role","menuitemcheckbox"):e.setAttribute("role","menuitem"),this.type==="submenu"&&(e.setAttribute("aria-haspopup","true"),e.setAttribute("aria-expanded","false"));const t=this.abortController.signal;return e.addEventListener("pointerenter",this,{signal:t}),e.addEventListener("pointerleave",this,{signal:t}),e.addEventListener("pointerup",this,{signal:t}),e.addEventListener("click",this,{signal:t}),this._element}dispatchSelect(){if(!Ns(this._declaration))return;const e=new CustomEvent("menu-select",{cancelable:!0,bubbles:!0,detail:{modifiers:this.rootMenu.modifiers,id:this._declaration.id,data:this._declaration.data}});this.parentMenu.dispatchEvent(e)&&typeof this._declaration.onMenuSelect=="function"&&this._declaration.onMenuSelect({modifiers:this.rootMenu.modifiers,id:this._declaration.id,data:this._declaration.data})}handleEvent(e){var t;if(!(!this.visible||!this.enabled)){if(e.type==="click"){this.rootMenu.state==="modal"&&this.select(),e.stopPropagation(),e.preventDefault();return}if(e.type==="pointerenter"){const r=e;this.rootMenu.cancelDelayedOperation(),this.parentMenu.isSubmenuOpen&&((t=this.parentMenu.activeMenuItem)!=null&&t.movingTowardSubmenu(r))?this.rootMenu.scheduleOperation(()=>{this.parentMenu.activeMenuItem=this,this.openSubmenu()}):(this.parentMenu.activeMenuItem=this,this.openSubmenu({withDelay:!0}));return}if(e.type==="pointerleave"){this.rootMenu.activeSubmenu===this.parentMenu&&(this.parentMenu.activeMenuItem=null);return}if(e.type==="pointerup"){this.rootMenu.state!=="modal"&&this.select(),e.stopPropagation(),e.preventDefault();return}}}select(){if(this.rootMenu.cancelDelayedOperation(),this.type==="submenu"){this.openSubmenu();return}this.active=!1,setTimeout(()=>{this.active=!0,setTimeout(()=>{this.rootMenu.hide(),this.dispatchSelect()},lp)},lp)}openSubmenu(e){var t;if(this.type!=="submenu"||!this.element)return;if((t=e==null?void 0:e.withDelay)!=null&&t){this.rootMenu.scheduleOperation(()=>this.openSubmenu());return}const r=this.element.getBoundingClientRect(),a=op(this.element);this.submenu.show({container:this.rootMenu.element.parentNode,location:{x:sp(r,"trailing",a),y:r.top-4},alternateLocation:{x:sp(r,"leading",a),y:r.top-4}})}movingTowardSubmenu(e){if(!this.element||this.type!=="submenu")return!1;const t=this.rootMenu.lastMoveEvent;if(!t)return!1;const r=e.timeStamp-t.timeStamp;if(r>500)return!1;const a=e.clientX-t.clientX;if(Lg(a,t.clientY-e.clientY,r)<=.2)return!1;let L="right";if(this.submenu.element){const N=this.submenu.element.getBoundingClientRect(),J=this.element.getBoundingClientRect();N.left<J.left+J.width/2&&(L="left")}return L==="right"?a>0:a<0}};function Lg(e,t,r){return Math.hypot(e,t)/r}function kc(e,t){return e===void 0||typeof e!="function"?e:(t!=null||(t={alt:!1,control:!1,shift:!1,meta:!1}),e(t))}var up=class Pc{constructor(t,r){this._element=null,this._activeMenuItem=null,this._dirty=!0;var a,b;this.parentMenu=(a=r==null?void 0:r.parentMenu)!=null?a:null,this._submenuClass=r==null?void 0:r.submenuClass,this.columnCount=(b=r==null?void 0:r.columnCount)!=null?b:1,this.isSubmenuOpen=!1,this.menuItems=t}get children(){return this._menuItems}set menuItems(t){const r=this.parentMenu;this.dispose(),this.parentMenu=r,t=[...t],this._menuItems=t.map(a=>a.onCreate?a.onCreate(a,this):new cp(a,this)),this.hasCheck=void 0,this.dirty=!0}dispose(){var t;this.hide(),this._element&&this._element.remove(),this._abortController&&this._abortController.abort(),(t=this._menuItems)==null||t.forEach(r=>r.dispose()),this._menuItems=[],this._activeMenuItem=null,this.parentMenu=null}handleEvent(t){if(t.type==="wheel"&&this._element){const r=t;this._element.scrollBy(0,r.deltaY),t.stopPropagation()}}dispatchEvent(t){return this.rootMenu.dispatchEvent(t)}get rootMenu(){return this.parentMenu.rootMenu}updateState(t){var r,a,b;this._menuItems.forEach(ue=>ue.updateState(t));const L=this.hasCheck;this.hasCheck=this._menuItems.some(ue=>ue.visible&&ue.hasCheck),this.hasCheck!==L&&this._menuItems.forEach(ue=>ue.updateState(t));let N,J=0;for(const ue of this._menuItems)ue.type==="heading"?(N&&J===0&&(N.visible=!1),N=ue,J=0):ue.type==="divider"&&N?(N.visible=J>0,N=void 0,J=0):N&&ue.visible&&(J+=1);N&&(N.visible=J>0);let ie=!0;for(const ue of this._menuItems)ue.type==="divider"?(ue.visible=!ie,ie=!0):ue.visible&&(ie=!1);(r=this.activeMenuItem)!=null&&r.visible||(this.activeMenuItem=null),!((a=this.activeMenuItem)!=null&&a.enabled)&&((b=this.activeMenuItem)==null?void 0:b.type)==="submenu"&&this._activeMenuItem.submenu.hide(),this._dirty=!1}get enabled(){return this.updateIfDirty(),this._menuItems.some(t=>t.type!=="divider"&&t.visible&&t.enabled)}get visible(){return this.updateIfDirty(),this._menuItems.some(t=>t.type!=="divider"&&t.visible)}set dirty(t){console.assert(t===!0),this._dirty!==t&&t&&this.parentMenu&&(this._dirty=!0,this.parentMenu.dirty=!0)}updateIfDirty(){this._dirty&&this.updateState(this.rootMenu.modifiers)}updateElement(){var t;if(this._element){this._element.textContent="";for(const{element:r,visible:a}of this._menuItems)r&&a&&this._element.append(r);(t=this._element.querySelector("li:first-of-type"))==null||t.setAttribute("tabindex","0")}}get element(){if(this._element)return this._element;const t=document.createElement("menu");t.setAttribute("role","menu"),t.setAttribute("tabindex","-1"),t.setAttribute("aria-orientation","vertical"),t.setAttribute("part","ui-menu-container"),this._submenuClass&&t.classList.add(this._submenuClass),t.classList.add("ui-menu-container"),this._abortController||(this._abortController=new AbortController);const r=this._abortController.signal;return t.addEventListener("focus",this,{signal:r}),t.addEventListener("wheel",this,{passive:!0,signal:r}),this._element=t,this.updateElement(),t}get activeMenuItem(){return this._activeMenuItem}set activeMenuItem(t){var r,a,b,L;if(this.rootMenu.cancelDelayedOperation(),t!==this._activeMenuItem){if(this.activeMenuItem){const N=this.activeMenuItem;N.active=!1,(r=N.submenu)==null||r.hide()}if(!((a=t==null?void 0:t.visible)==null||a)){this._activeMenuItem=null;return}this._activeMenuItem=t,t&&(t.active=!0)}t?(b=t.element)==null||b.focus({preventScroll:!0}):(L=this._element)==null||L.focus({preventScroll:!0})}get firstMenuItem(){this.updateIfDirty();let t=0,r=!1;const a=this._menuItems;for(;!r&&t<=a.length-1;){const b=a[t];r=b.type!=="divider"&&b.visible&&b.enabled,t+=1}return r?a[t-1]:null}get lastMenuItem(){this.updateIfDirty();const t=this._menuItems;let r=t.length-1,a=!1;for(;!a&&r>=0;){const b=t[r];a=b.type!=="divider"&&b.visible&&b.enabled,r-=1}return a?t[r+1]:null}nextMenuItem(t){if(t===0)return this._activeMenuItem;if(!this._activeMenuItem)return t>0?this.firstMenuItem:this.lastMenuItem;if(!this.firstMenuItem||!this.lastMenuItem||!this._activeMenuItem)return null;this.updateIfDirty();const r=this._menuItems.indexOf(this.firstMenuItem),a=this._menuItems.indexOf(this.lastMenuItem);let b=this._menuItems.indexOf(this._activeMenuItem),L=1;for(;b>=r&&b<=a;){b+=t>0?1:-1;const N=this._menuItems[b];if(!N)break;if(N.visible&&N.enabled){if(L===Math.abs(t))return this._menuItems[b];L+=1}}return t>0?this.lastMenuItem:this.firstMenuItem}getMenuItemColumn(t){this.updateIfDirty();const a=this._menuItems.filter(b=>b.visible&&b.enabled).indexOf(t);return a<0?-1:a%this.columnCount}static get collator(){return Pc._collator||(Pc._collator=new Intl.Collator(void 0,{usage:"search",sensitivity:"base"})),Pc._collator}findMenuItem(t){var r;this.updateIfDirty();const a=this._menuItems.filter(J=>J.type!=="divider"&&J.visible&&J.enabled);if(a.length===0)return null;const b=Math.max(...a.map(J=>J.label.length))-t.length;if(b<0)return null;let L=null,N=0;for(;N<b&&!L;)L=(r=a.find(J=>Pc.collator.compare(t,J.label.substring(N,t.length))===0))!=null?r:null,N++;return L}show(t){return!this.visible||!t.container?!1:(this.updateElement(),t.container.appendChild(this.element),S()&&(this.element.popover="manual",this.element.showPopover()),t.location&&Tg(this.element,{location:t.location,alternateLocation:t.alternateLocation,verticalPos:"bottom",horizontalPos:"start"}),this.element.focus({preventScroll:!0}),this.parentMenu&&(this.parentMenu.openSubmenu=this),!0)}hide(){var t,r,a,b,L;this.openSubmenu=null,this.activeMenuItem=null,this.parentMenu&&(this.parentMenu.openSubmenu=null),S()&&((t=this._element)!=null&&t.popover)&&this.element.hidePopover(),(a=(r=this.parentMenu)==null?void 0:r.element)==null||a.focus(),(L=(b=this._element)==null?void 0:b.parentNode)==null||L.removeChild(this._element)}set openSubmenu(t){var r,a,b,L;const N=t!==null;((r=this.activeMenuItem)==null?void 0:r.type)==="submenu"&&((a=this.activeMenuItem.element)==null||a.setAttribute("aria-expanded",N.toString())),(L=(b=this.activeMenuItem)==null?void 0:b.element)==null||L.classList.toggle("is-submenu-open",N),this.isSubmenuOpen=N}},fp=class h0 extends up{constructor(t,r){var a;super(t),this.state="closed",this.typingBufferResetTimer=0,this.hysteresisTimer=0,this._updating=!1,this._host=(a=r==null?void 0:r.host)!=null?a:null,this.isDynamic=t.some(hp),this._modifiers={shift:!1,control:!1,alt:!1,meta:!1},this.typingBuffer="",this.state="closed"}get modifiers(){return this._modifiers}set modifiers(t){Y0(this._modifiers,t)||(this._modifiers=t,this.dirty=!0)}get activeSubmenu(){let t=this;for(;t.isSubmenuOpen;)t=t.activeMenuItem.submenu;return t}set dirty(t){this._updating||(console.assert(t===!0),this._dirty!==t&&(this._dirty=!0,t&&setTimeout(()=>{this.updateState(this.modifiers),this.updateElement()})))}updateState(t){this._updating=!0,this.modifiers=t!=null?t:this.modifiers,super.updateState(this.modifiers),this._updating=!1}handleKeyupEvent(t){this.isDynamic&&(this.modifiers=xl(t)),t.stopImmediatePropagation()}handleKeydownEvent(t){var r,a,b;if(t.key==="Tab"||t.key==="Escape"){this.hide();return}this.isDynamic&&(this.modifiers=xl(t));let L=!0;const N=this.activeSubmenu,J=N.activeMenuItem;switch(t.key){case" ":case"Space":case"Return":case"Enter":J==null||J.select(xl(t));break;case"ArrowRight":if((J==null?void 0:J.type)==="submenu")J.select(xl(t)),this.activeSubmenu.activeMenuItem=this.activeSubmenu.firstMenuItem;else if(!J)N.activeMenuItem=N.firstMenuItem;else{const ie=(r=N.getMenuItemColumn(J))!=null?r:-1;if(ie>=0&&ie<((a=N.columnCount)!=null?a:1)-1){const ue=N.nextMenuItem(1);ue&&(N.activeMenuItem=ue)}}break;case"ArrowLeft":if(N===this.rootMenu)J||(N.activeMenuItem=N.firstMenuItem);else if((J&&(b=N.getMenuItemColumn(J))!=null?b:-1)<=0||!J){N.hide();const ue=N.parentMenu.activeMenuItem;if(ue){const{element:pe}=ue;pe==null||pe.focus(),pe==null||pe.classList.remove("is-submenu-open")}}else{const ue=N.nextMenuItem(-1);ue&&(N.activeMenuItem=ue)}break;case"ArrowDown":N.activeMenuItem=N.nextMenuItem(N.columnCount);break;case"ArrowUp":N.activeMenuItem=N.nextMenuItem(-N.columnCount);break;case"Home":case"PageUp":N.activeMenuItem=N.firstMenuItem;break;case"End":case"PageDown":N.activeMenuItem=N.lastMenuItem;break;case"Backspace":if(this.typingBuffer&&(this.typingBuffer=this.typingBuffer.slice(0,-1),this.typingBuffer)){clearTimeout(this.typingBufferResetTimer);const ie=N.findMenuItem(this.typingBuffer);ie&&(N.activeMenuItem=ie),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}break;default:if(Of(t)){isFinite(this.typingBufferResetTimer)&&clearTimeout(this.typingBufferResetTimer),this.typingBuffer+=t.key;const ie=N.findMenuItem(this.typingBuffer);ie&&(N.activeMenuItem=ie),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}else L=!1}L&&(t.preventDefault(),t.stopPropagation())}handleEvent(t){if(t.type==="keydown")this.handleKeydownEvent(t);else if(t.type==="keyup")this.handleKeyupEvent(t);else if(t.type==="pointermove")this.lastMoveEvent=t;else if(t.type==="pointerup"&&t.target===this.scrim)Number.isFinite(this.rootMenu._openTimestamp)&&Date.now()-this.rootMenu._openTimestamp<120?this.state="modal":this.state==="modal"&&this.hide();else if(t.type==="contextmenu"){t.preventDefault(),t.stopPropagation();return}super.handleEvent(t)}dispatchEvent(t){return this._host?this._host.dispatchEvent(t):!0}get scrim(){return Rs.element}connectScrim(t){const r=this.scrim;r.addEventListener("pointerup",this),r.addEventListener("contextmenu",this),r.addEventListener("keydown",this),r.addEventListener("keyup",this),r.addEventListener("pointermove",this),Rs.open({root:t,onDismiss:()=>this.hide()})}disconnectScrim(){const t=this.scrim;t.removeEventListener("pointerup",this),t.removeEventListener("contextmenu",this),t.removeEventListener("keydown",this),t.removeEventListener("keyup",this),t.removeEventListener("pointermove",this),Rs.state==="open"&&Rs.scrim.close()}get rootMenu(){return this}show(t){return this._onDismiss=t==null?void 0:t.onDismiss,t!=null&&t.modifiers&&(this.modifiers=t.modifiers),this.updateState(),this.connectScrim(t==null?void 0:t.target),super.show(h(l({},t),{container:this.scrim}))?(this._openTimestamp=Date.now(),this.state="open",!0):(this.disconnectScrim(),!1)}hide(){this.cancelDelayedOperation(),this.state!==void 0&&(this.state!=="closed"&&(this.activeMenuItem=null,Rs.element.parentElement.focus(),super.hide(),this.state="closed",this.disconnectScrim()),this._onDismiss&&(this._onDismiss(),this._onDismiss=void 0))}scheduleOperation(t){this.cancelDelayedOperation();const r=h0.SUBMENU_DELAY;if(r<=0){t();return}this.hysteresisTimer=setTimeout(()=>{this.hysteresisTimer=0,t()},r)}cancelDelayedOperation(){this.hysteresisTimer&&(clearTimeout(this.hysteresisTimer),this.hysteresisTimer=0)}};fp.SUBMENU_DELAY=120;var Og=fp;function hp(e){return Yh(e)?!1:typeof e.label=="function"||typeof e.ariaLabel=="function"||typeof e.tooltip=="function"||(Ns(e)||Cc(e))&&(typeof e.enabled=="function"||typeof e.visible=="function")||Ns(e)&&typeof e.checked=="function"?!0:Cc(e)?e.submenu.some(hp):!1}var nh=class{};nh.DELAY=300,nh.MAX_DISTANCE=10;function Dg(e){return new Promise((t,r)=>{const a=Lf(e);a||t(!1);let b=a;const L=setTimeout(()=>{N.abort(),t(Ag(b,a)<nh.MAX_DISTANCE)},nh.DELAY),N=new AbortController,J=N.signal;for(const ie of["pointermove","pointerup","pointercancel"])window.addEventListener(ie,ue=>{if(ue.type==="pointerup"||ue.type==="pointercancel")clearTimeout(L),N.abort(),t(!1);else if(ue.type==="pointermove"){const pe=Lf(ue);pe&&(b=pe)}},{passive:!0,signal:J})})}function dp(e,t,r){return Za(this,null,function*(){if(e.type==="contextmenu"){const a=e;if(r.show({target:t,location:Lf(a),modifiers:xl(a)}))return e.preventDefault(),e.stopPropagation(),!0}if(e.type==="keydown"){const a=e;if(a.code==="ContextMenu"||a.code==="F10"&&a.shiftKey){const b=t==null?void 0:t.getBoundingClientRect();if(b&&r.show({target:t,location:{x:Math.ceil(b.left+b.width/2),y:Math.ceil(b.top+b.height/2)},modifiers:xl(a)}))return e.preventDefault(),e.stopPropagation(),!0}}if(e.type==="pointerdown"&&e.pointerType!=="mouse"&&e.button===0){let a=e.target;for(;a&&t!==a;)a=a.parentNode;if(!a||!r.visible)return!1;const b=Lf(e);if(yield Dg(e))return r.state!=="closed"?!1:(r.show({target:t,location:b}),!0)}return!1})}var pp={acute:714,grave:715,dot:729,ddot:168,mathring:730,tilde:126,bar:713,breve:728,check:711,hat:94,vec:8407};Ne(Object.keys(pp),"{body:auto}",{createAtom:e=>new c(h(l({},e),{body:de(e.args[0]),accentChar:pp[e.command.slice(1)]}))}),Ne(["widehat","widecheck","widetilde"],"{body:auto}",{createAtom:e=>{const t=Re(de(e.args[0]));return new c(h(l({},e),{body:de(e.args[0]),svgAccent:e.command.slice(1)+(t.length>5?"4":["1","1","2","2","3","3"][t.length])}))}}),Ne(["overarc","overparen","wideparen"],"{body:auto}",{createAtom:e=>new c(h(l({},e),{body:de(e.args[0]),svgAccent:"overarc"}))}),Ne(["underarc","underparen"],"{body:auto}",{createAtom:e=>new Po(h(l({},e),{body:de(e.args[0]),svgBelow:"underarc"}))}),Ne("utilde","{body:auto}",{createAtom:e=>{const t=de(e.args[0]),r=Re(t),a="widetilde"+(r.length>5?"4":["1","1","2","2","3","3"][r.length]);return new Po(h(l({},e),{body:t,svgBelow:a,boxType:Ba(t)}))}}),Ne("^","{:string}",{createAtom:e=>{var t;return new et(h(l({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&(t={a:"\xE2",e:"\xEA",i:"\xEE",o:"\xF4",u:"\xFB",A:"\xC2",E:"\xCA",I:"\xCE",O:"\xD4",U:"\xDB"}[e.args[0]])!=null?t:"^"}))}}),Ne("`","{:string}",{createAtom:e=>{var t;return new et(h(l({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&(t={a:"\xE0",e:"\xE8",i:"\xEC",o:"\xF2",u:"\xF9",A:"\xC0",E:"\xC8",I:"\xCC",O:"\xD2",U:"\xD9"}[e.args[0]])!=null?t:"`"}))}}),Ne("'","{:string}",{createAtom:e=>{var t;return new et(h(l({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&(t={a:"\xE1",e:"\xE9",i:"\xED",o:"\xF3",u:"\xFA",A:"\xC1",E:"\xC9",I:"\xCD",O:"\xD3",U:"\xDA"}[e.args[0]])!=null?t:"'"}))}}),Ne('"',"{:string}",{createAtom:e=>{var t,r;return new et(h(l({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:(t=e.args)!=null&&t[0]?(r={a:"\xE4",e:"\xEB",i:"\xEF",o:"\xF6",u:"\xFC",A:"\xC4",E:"\xCB",I:"\xCB",O:"\xD6",U:"\xDC"}[e.args[0]])!=null?r:'"'+e.args[0]:'"'}))}}),Ne(".","{:string}",{createAtom:e=>{var t,r;return new et(h(l({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:(t=e.args)!=null&&t[0]?(r={a:"\u0227",e:"\u0117",i:"\u0307i",o:"\u022F",u:"\u0307u",A:"\u0226",E:"\u0116",I:"\u0130",O:"\u022E",U:"\u0307U"}[e.args[0]])!=null?r:"."+e.args[0]:"."}))}}),Ne("=","{:string}",{createAtom:e=>{var t,r;return new et(h(l({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:(t=e.args)!=null&&t[0]?(r={a:"\u0101",e:"\u0113",i:"\u012B",o:"\u014D",u:"\u016B",A:"\u0100",E:"\u0112",I:"\u012A",O:"\u014C",U:"\u016A"}[e.args[0]])!=null?r:"="+e.args[0]:"="}))}}),Ne("~","{:string}",{createAtom:e=>{var t;return new et(h(l({type:"mord"},e),{isFunction:!1,limits:"adjacent",value:e.args[0]&&(t={n:"\xF1",N:"\xD1",a:"\xE3",o:"\xF5",A:"\xC3",O:"\xD5"}[e.args[0]])!=null?t:"\xB4"}))}}),Ne("c","{:string}",{createAtom:e=>{var t;return new et(h(l({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&(t={c:"\xE7",C:"\xC7"}[e.args[0]])!=null?t:""}))}}),Ne("enclose","{notation:string}[style:string]{body:auto}",{createAtom:e=>{var t,r;const a=e.args,b={strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"none",svgStrokeStyle:void 0,borderStyle:void 0,style:(t=e.style)!=null?t:{}};if(a[1]){const N=a[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const J of N){const ie=J.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(ie)b.strokeWidth=ie[1],b.strokeStyle=ie[2],b.strokeColor=ie[3];else{const ue=J.match(/\s*([a-z]*)\s*=\s*"(.*)"/);ue&&(ue[1]==="mathbackground"?b.backgroundcolor=ue[2]:ue[1]==="mathcolor"?b.strokeColor=ue[2]:ue[1]==="padding"?b.padding=ue[2]:ue[1]==="shadow"&&(b.shadow=ue[2]))}}b.strokeStyle==="dashed"?b.svgStrokeStyle="5,5":b.strokeStyle==="dotted"&&(b.svgStrokeStyle="1,5")}b.borderStyle=`${b.strokeWidth} ${b.strokeStyle} ${b.strokeColor}`;const L={};return((r=a[0])!=null?r:"").split(/[, ]/).filter(N=>N.length>0).forEach(N=>{L[N.toLowerCase()]=!0}),new yu(e.command,de(a[2]),L,b)}}),Ne("cancel","{body:auto}",{createAtom:e=>{var t;return new yu(e.command,de(e.args[0]),{updiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(t=e.style)!=null?t:{}})}}),Ne("bcancel","{body:auto}",{createAtom:e=>{var t;return new yu(e.command,de(e.args[0]),{downdiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(t=e.style)!=null?t:{}})}}),Ne("xcancel","{body:auto}",{createAtom:e=>{var t;return new yu(e.command,de(e.args[0]),{updiagonalstrike:!0,downdiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(t=e.style)!=null?t:{}})}}),Ne(["overrightarrow","overleftarrow","Overrightarrow","overleftharpoon","overrightharpoon","overleftrightarrow","overlinesegment","overgroup"],"{:auto}",{createAtom:e=>{var t;return new Po(h(l({},e),{body:de((t=e.args)==null?void 0:t[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgAbove:e.command.slice(1)}))}}),Ne("overbrace","{:auto}",{createAtom:e=>new Po(h(l({},e),{body:de(e.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgAbove:e.command.slice(1)}))}),Ne(["underrightarrow","underleftarrow","underleftrightarrow","underlinesegment","undergroup"],"{:auto}",{createAtom:e=>new Po(h(l({},e),{body:de(e.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgBelow:e.command.slice(1)}))}),Ne(["underbrace"],"{:auto}",{createAtom:e=>new Po(h(l({},e),{body:de(e.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgBelow:e.command.slice(1)}))}),Ne(["xrightarrow","longrightarrow","xleftarrow","longleftarrow","xRightarrow","xLeftarrow","xleftharpoonup","xleftharpoondown","xrightharpoonup","xrightharpoondown","xlongequal","xtwoheadleftarrow","xtwoheadrightarrow","xleftrightarrow","longleftrightarrow","xLeftrightarrow","xrightleftharpoons","longrightleftharpoons","xleftrightharpoons","xhookleftarrow","xhookrightarrow","xmapsto","xtofrom","xleftrightarrows","longleftrightarrows","xRightleftharpoons","longRightleftharpoons","xLeftrightharpoons","longLeftrightharpoons"],"[:auto]{:auto}",{createAtom:e=>{var t,r,a,b,L;return new Po(h(l({},e),{svgBody:e.command.slice(1),above:((r=de((t=e.args)==null?void 0:t[1]))==null?void 0:r.length)===0?void 0:de((a=e.args)==null?void 0:a[1]),below:(L=de((b=e.args)==null?void 0:b[0]))!=null?L:null,skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,paddedLabels:!0,boxType:"rel"}))},serialize:(e,t)=>e.command+(e.hasEmptyBranch("below")?"":`[${e.belowToLatex(t)}]`)+`{${e.aboveToLatex(t)}}${e.supsubToLatex(t)}`}),Ne(["arccos","arcsin","arctan","arctg","arcctg","arg","ch","cos","cosh","cot","cotg","coth","ctg","cth","csc","cosec","deg","dim","exp","gcd","hom","inf","ker","lb","lg","ln","log","Pr","sec","sh","sin","sinh","sup","tan","tanh","tg","th","arcsec","arccsc","arsinh","arcosh","artanh","arcsech","arccsch"],"",{isFunction:!0,ifMode:"math",createAtom:e=>new wl(e.command.slice(1),h(l({},e),{limits:"adjacent",isFunction:!0,variant:"main",variantStyle:"up"}))}),Ne(["liminf","limsup"],"",{ifMode:"math",createAtom:e=>new wl({"\\liminf":"lim inf","\\limsup":"lim sup"}[e.command],h(l({},e),{limits:"over-under",variant:"main"}))}),Ne(["lim","mod"],"",{ifMode:"math",createAtom:e=>new wl(e.command.slice(1),h(l({},e),{limits:"over-under",variant:"main"}))}),Ne(["det","max","min"],"",{ifMode:"math",isFunction:!0,createAtom:e=>new wl(e.command.slice(1),h(l({},e),{limits:"over-under",isFunction:!0,variant:"main"}))}),Ne(["ang"],"{:math}",{ifMode:"math",createAtom:e=>new et(h(l({},e),{body:de(e.args[0])})),serialize:(e,t)=>`\\ang{${e.bodyToLatex(t)}}`,render:(e,t)=>{const r=e.createBox(t),a=r.caret;r.caret=void 0;const b=new mt("\xB0",{style:h(l({},e.style),{variant:"normal",variantStyle:"up"})});return new mt([r,b],{type:"inner",isSelected:e.isSelected,caret:a})}}),Ne("sqrt","[index:auto]{radicand:expression}",{ifMode:"math",createAtom:e=>new md(h(l({},e),{body:de(e.args[1]),index:e.args[0]?de(e.args[0]):void 0}))}),Ne(["frac","dfrac","tfrac","cfrac","binom","dbinom","tbinom"],"{:expression}{:expression}",{ifMode:"math",createAtom:e=>{const t=l({},e),r=e.command,a=e.args;switch(r){case"\\dfrac":case"\\frac":case"\\tfrac":t.hasBarLine=!0;break;case"\\atopfrac":t.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":t.hasBarLine=!1,t.leftDelim="(",t.rightDelim=")";break;case"\\cfrac":t.hasBarLine=!0,t.continuousFraction=!0;break;default:}switch(r){case"\\dfrac":case"\\dbinom":t.mathstyleName="displaystyle";break;case"\\tfrac":case"\\tbinom":t.mathstyleName="textstyle";break;default:}return new mc(a[0]?de(a[0]):[new Nt],a[1]?de(a[1]):[new Nt],t)},serialize:(e,t)=>{const r=e.aboveToLatex(t),a=e.belowToLatex(t);return/^[0-9]$/.test(r)&&/^[0-9]$/.test(a)?`${e.command}${r}${a}`:sn(e.command,r,a)}}),Ne(["brace","brack"],"",{infix:!0,createAtom:e=>new mc(de(e.args[0]),de(e.args[1]),h(l({},e),{hasBarLine:!1,leftDelim:e.command==="\\brace"?"\\lbrace":"\\lbrack",rightDelim:e.command==="\\brace"?"\\rbrace":"\\rbrack"})),serialize:(e,t)=>ar([e.aboveToLatex(t),e.command,e.belowToLatex(t)])}),Ne(["over","atop","choose"],"",{infix:!0,createAtom:e=>{let t,r;const a=e.args;return e.command==="\\choose"&&(t="(",r=")"),new mc(de(a[0]),de(a[1]),h(l({},e),{hasBarLine:e.command==="\\over",leftDelim:t,rightDelim:r}))},serialize:(e,t)=>ar([e.aboveToLatex(t),e.command,e.belowToLatex(t)])}),Ne(["overwithdelims","atopwithdelims"],"{numer:auto}{denom:auto}{left-delim:delim}{right-delim:delim}",{infix:!0,createAtom:e=>{var t,r;const a=e.args;return new mc(de(a[0]),de(a[1]),h(l({},e),{leftDelim:(t=a[2])!=null?t:".",rightDelim:(r=a[3])!=null?r:".",hasBarLine:!1}))},serialize:(e,t)=>`${e.aboveToLatex(t)} ${e.command}${e.leftDelim}${e.rightDelim}${e.belowToLatex(t)}`}),Ne("pdiff","{numerator}{denominator}",{ifMode:"math",createAtom:e=>new mc(de(e.args[0]),de(e.args[1]),h(l({},e),{hasBarLine:!0,numerPrefix:"\u2202",denomPrefix:"\u2202"}))}),Ne(["sum","prod","bigcup","bigcap","coprod","bigvee","bigwedge","biguplus","bigotimes","bigoplus","bigodot","bigsqcup","intop"],"",{ifMode:"math",createAtom:e=>new wh({coprod:"\u2210",bigvee:"\u22C1",bigwedge:"\u22C0",biguplus:"\u2A04",bigcap:"\u22C2",bigcup:"\u22C3",intop:"\u222B",prod:"\u220F",sum:"\u2211",bigotimes:"\u2A02",bigoplus:"\u2A01",bigodot:"\u2A00",bigsqcup:"\u2A06",smallint:"\u222B"}[e.command.slice(1)],h(l({},e),{limits:"auto",variant:"main"}))}),Ne("smallint","",{ifMode:"math",createAtom:e=>new wl("\u222B",h(l({},e),{limits:"adjacent",variant:"main"}))});var mp={int:"\u222B",iint:"\u222C",iiint:"\u222D",oint:"\u222E",oiint:"\u222F",oiiint:"\u2230",intclockwise:"\u2231",varointclockwise:"\u2232",ointctrclockwise:"\u2233",intctrclockwise:"\u2A11",sqcup:"\u2294",sqcap:"\u2293",uplus:"\u228E",wr:"\u2240",amalg:"\u2A3F",Cap:"\u22D2",Cup:"\u22D3",doublecap:"\u22D2",doublecup:"\u22D3"};Ne(Object.keys(mp),"",{ifMode:"math",createAtom:e=>{const t=e.command,r=mp[t.slice(1)];return new wh(r,h(l({},e),{limits:"adjacent",variant:{"\u22D2":"ams","\u22D3":"ams"}[r]}))}}),Ne(["Re","Im"],"",{ifMode:"math",createAtom:e=>new wl({"\\Re":"\u211C","\\Im":"\u2111"}[e.command],h(l({},e),{limits:"adjacent",isFunction:!0,variant:"fraktur"}))}),Ne("middle","{:delim}",{ifMode:"math",createAtom:e=>{var t;return new hd(h(l({},e),{delim:(t=e.args[0])!=null?t:"|",size:1}))}}),Ne("the","{:value}",{createAtom:e=>new et(h(l({},e),{captureSelection:!0,verbatimLatex:null})),render:(e,t)=>{var r;const a=new gr({parent:t},e.style);let b="";e.isSelected&&(b+=" ML__selected");const L=a.evaluate(e.args[0]);return new mt(((r=Dn(L))!=null?r:"").split("").map(N=>new mt(N,{type:"ord",classes:b,mode:e.mode,isSelected:e.isSelected,style:l({variant:"main"},e.style)})),{type:"lift",style:e.style,caret:e.caret,isSelected:e.isSelected,classes:b}).wrap(a)},serialize:e=>{var t;return`\\the${(t=Dn(e.args[0]))!=null?t:"\\relax"}`}}),Ne("mathtip","{:auto}{:math}",{createAtom:e=>new xh(h(l({},e),{body:de(e.args[0]),tooltip:de(e.args[1]),content:"math"})),serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`\\texttip{${e.bodyToLatex(t)}}{${et.serialize([e.tooltip],h(l({},t),{defaultMode:"math"}))}}`}),Ne("texttip","{:auto}{:text}",{createAtom:e=>new xh(h(l({},e),{body:de(e.args[0]),tooltip:de(e.args[1]),content:"text"})),serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`\\texttip{${e.bodyToLatex(t)}}{${et.serialize([e.tooltip],h(l({},t),{defaultMode:"text"}))}}`}),Ne("error","{:math}",{createAtom:e=>new et(h(l({},e),{body:de(e.args[0])})),serialize:(e,t)=>`\\error{${e.bodyToLatex(t)}}`,render:(e,t)=>e.createBox(t,{classes:"ML__error"})}),Ne("ensuremath","{:math}",{createAtom:e=>new et(h(l({},e),{body:de(e.args[0])})),serialize:(e,t)=>`${e.command}{${e.bodyToLatex(h(l({},t),{defaultMode:"math"}))}}`}),Ne("color","{:value}",{applyStyle:(e,t,r)=>{var a,b;return{verbatimColor:(a=Dn(t[0]))!=null?a:void 0,color:r.toColor((b=t[0])!=null?b:{string:"red"})}}}),Ne("textcolor","{:value}{content:auto*}",{applyStyle:(e,t,r)=>{var a,b;return{verbatimColor:(a=Dn(t[0]))!=null?a:void 0,color:r.toColor((b=t[0])!=null?b:{string:"red"})}}}),Ne("boxed","{content:math}",{createAtom:e=>new En(h(l({},e),{body:de(e.args[0]),framecolor:{string:"black"}}))}),Ne("colorbox","{:value}{:text*}",{applyStyle:(e,t,r)=>{var a,b;return{verbatimBackgroundColor:(a=Dn(t[0]))!=null?a:void 0,backgroundColor:r.toBackgroundColor((b=t[0])!=null?b:{string:"yellow"})}}}),Ne("fcolorbox","{frame-color:value}{background-color:value}{content:text}",{applyMode:"text",createAtom:e=>{var t,r;return new En(h(l({},e),{body:de(e.args[2]),framecolor:(t=e.args[0])!=null?t:{string:"blue"},backgroundcolor:(r=e.args[1])!=null?r:{string:"yellow"}}))},serialize:(e,t)=>{var r,a;return t.skipStyles?e.bodyToLatex(h(l({},t),{defaultMode:"text"})):sn(e.command,(r=Dn(e.framecolor))!=null?r:"",(a=Dn(e.backgroundcolor))!=null?a:"",e.bodyToLatex(h(l({},t),{defaultMode:"text"})))}}),Ne("bbox","[:bbox]{body:auto}",{createAtom:e=>{var t;const r=e.args[0],a=de(e.args[1]);return r?new En(h(l({},e),{body:a,padding:r.padding,border:r.border,backgroundcolor:(t=r.backgroundcolor)!=null?t:void 0})):new En(h(l({},e),{body:a}))},serialize:(e,t)=>{var r,a;if(t.skipStyles)return e.bodyToLatex(t);let b=e.command;if(Number.isFinite(e.padding)||e.border!==void 0||e.backgroundcolor!==void 0){const L=[];e.padding&&L.push((r=Dn(e.padding))!=null?r:""),e.border&&L.push(`border: ${e.border}`),e.backgroundcolor&&L.push((a=Dn(e.backgroundcolor))!=null?a:""),b+=`[${L.join(",")}]`}return sn(b,e.bodyToLatex(t))}}),Ne(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"],"{:rest}",{createAtom:e=>new et(h(l({},e),{body:de(e.args[0])})),render:(e,t)=>{const r=new gr({parent:t,mathstyle:e.command.slice(1)},e.style),a=et.createBox(r,e.body,{type:"lift"});return e.caret&&(a.caret=e.caret),e.bind(t,a)},serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`{${ar([e.command,e.bodyToLatex(t)])}}`}),Ne(["tiny","scriptsize","footnotesize","small","normalsize","large","Large","LARGE","huge","Huge"],"",{applyStyle:e=>({fontSize:{"\\tiny":1,"\\scriptsize":2,"\\footnotesize":3,"\\small":4,"\\normalsize":5,"\\large":6,"\\Large":7,"\\LARGE":8,"\\huge":9,"\\Huge":10}[e]})}),Ne("fontseries","{:string}",{ifMode:"text",applyStyle:(e,t)=>{var r;return{fontSeries:(r=t[0])!=null?r:"auto"}}}),Ne("fontshape","{:string}",{ifMode:"text",applyStyle:(e,t)=>{var r;return{fontShape:(r=t[0])!=null?r:"auto"}}}),Ne("fontfamily","{:string}",{ifMode:"text",applyStyle:(e,t)=>{var r;return{fontFamily:(r=t[0])!=null?r:"roman"}}}),Ne("selectfont","",{ifMode:"text",applyStyle:()=>({})}),Ne("bf","{:rest}",{applyStyle:()=>({fontSeries:"b",fontShape:"n",fontFamily:"roman"})}),Ne(["boldsymbol","bm"],"{:math}",{applyMode:"math",createAtom:e=>new et(h(l({},e),{body:de(e.args[0])})),serialize:(e,t)=>`${e.command}{${e.bodyToLatex(t)}}`,render:(e,t)=>e.createBox(t,{classes:"ML__boldsymbol"})}),Ne("bold","{:math*}",{applyMode:"math",applyStyle:()=>({variantStyle:"bold"})}),Ne("bfseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),Ne("mdseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),Ne("upshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),Ne("slshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),Ne("scshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),Ne("textbf","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),Ne("textmd","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),Ne("textup","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),Ne("textnormal","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n",fontSeries:"m"})}),Ne("textsl","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),Ne("textit","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"it"})}),Ne("textsc","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),Ne("textrm","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"roman"})}),Ne("textsf","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"sans-serif"})}),Ne("texttt","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"monospace"})}),Ne("mathbf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"bold"})}),Ne("mathit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"italic"})}),Ne("mathnormal","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"italic"})}),Ne("mathbfit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"bolditalic"})}),Ne("mathrm","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"up"})}),Ne("mathsf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"sans-serif",variantStyle:"up"})}),Ne("mathtt","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"monospace",variantStyle:"up"})}),Ne("it","{:rest}",{applyStyle:()=>({fontSeries:"m",fontShape:"it",fontFamily:"roman",variantStyle:"italic"})}),Ne("rmfamily","",{applyStyle:()=>({fontFamily:"roman"})}),Ne("sffamily","",{applyStyle:()=>({fontFamily:"sans-serif"})}),Ne("ttfamily","",{applyStyle:()=>({fontFamily:"monospace"})}),Ne(["Bbb","mathbb"],"{:math*}",{applyStyle:()=>({variant:"double-struck",variantStyle:"up"})}),Ne(["frak","mathfrak"],"{:math*}",{applyStyle:()=>({variant:"fraktur",variantStyle:"up"})}),Ne("mathcal","{:math*}",{applyStyle:()=>({variant:"calligraphic",variantStyle:"up"})}),Ne("mathscr","{:math*}",{applyStyle:()=>({variant:"script",variantStyle:"up"})}),Ne("mbox","{:text}",{ifMode:"math",createAtom:e=>new et(h(l({},e),{type:"mord",body:de(e.args[0]),mode:"math"})),serialize:(e,t)=>sn("\\mbox",e.bodyToLatex(h(l({},t),{defaultMode:"text"})))}),Ne("text","{:text}",{ifMode:"math",applyMode:"text"}),Ne(["class","htmlClass"],"{name:string}{content:auto}",{createAtom:e=>new et(h(l({},e),{body:de(e.args[1])})),serialize:(e,t)=>!e.args[0]||t.skipStyles?e.bodyToLatex(t):`${e.command}{${e.args[0]}}{${e.bodyToLatex(t)}}`,render:(e,t)=>{var r;return e.createBox(t,{classes:(r=e.args[0])!=null?r:""})}}),Ne(["cssId","htmlId"],"{id:string}{content:auto}",{createAtom:e=>new et(h(l({},e),{body:de(e.args[1])})),serialize:(e,t)=>{var r;return!((r=e.args)!=null&&r[0])||t.skipStyles?e.bodyToLatex(t):`${e.command}{${e.args[0]}}{${e.bodyToLatex(t)}}`},render:(e,t)=>{var r;const a=e.createBox(t);return a.cssId=(r=e.args[0])!=null?r:"",a}}),Ne("htmlData","{data:string}{content:auto}",{createAtom:e=>new et(h(l({},e),{body:de(e.args[1])})),serialize:(e,t)=>{var r;return!((r=e.args)!=null&&r[0])||t.skipStyles?e.bodyToLatex(t):`\\htmlData{${e.args[0]}}{${e.bodyToLatex(t)}}`},render:(e,t)=>{var r;const a=e.createBox(t);return a.htmlData=(r=e.args[0])!=null?r:"",a}}),Ne(["style","htmlStyle"],"{data:string}{content:auto}",{createAtom:e=>new et(h(l({},e),{body:de(e.args[1])})),serialize:(e,t)=>{var r;return!((r=e.args)!=null&&r[0])||t.skipStyles?e.bodyToLatex(t):`${e.command}{${e.args[0]}}{${e.bodyToLatex(t)}}`},render:(e,t)=>{var r;const a=e.createBox(t);return a.htmlStyle=(r=e.args[0])!=null?r:"",a}}),Ne("em","{:rest}",{createAtom:e=>new et(h(l({},e),{body:de(e.args[0])})),serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`{\\em ${e.bodyToLatex(t)}}`,render:(e,t)=>e.createBox(t,{classes:"ML__emph",boxType:"lift"})}),Ne("emph","{:auto}",{createAtom:e=>new et(h(l({},e),{body:de(e.args[1])})),serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`\\emph{${e.bodyToLatex(t)}}`,render:(e,t)=>e.createBox(t,{classes:"ML__emph",boxType:"lift"})});var gp={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};Ne(["bigl","Bigl","biggl","Biggl","bigr","Bigr","biggr","Biggr","bigm","Bigm","biggm","Biggm","big","Big","bigg","Bigg"],"{:delim}",{createAtom:e=>{var t;return new dd(h(l({},e),{delim:(t=e.args[0])!=null?t:".",size:gp[e.command].size,delimType:gp[e.command].mclass}))}}),Ne(["hspace","hspace*"],"{width:value}",{createAtom:e=>{var t;return new wu(h(l({},e),{width:(t=e.args[0])!=null?t:{dimension:0}}))}}),Ne(["mkern","kern","mskip","hskip","mspace"],"{width:value}",{createAtom:e=>{var t;return new wu(h(l({},e),{width:(t=e.args[0])!=null?t:{dimension:0}}))}}),Ne("mathchoice","{:math}{:math}{:math}{:math}",{createAtom:e=>new et(e),render:(e,t)=>{let r=0;const a=t.mathstyle.id;(a===gl||a===Ts)&&(r=1),(a===da||a===Si)&&(r=2),(a===no||a===ti)&&(r=3);const b=de(e.args[r]);return et.createBox(t,b)},serialize:(e,t)=>`\\mathchoice{${et.serialize(e.args[0],t)}}{${et.serialize(e.args[1],t)}}{${et.serialize(e.args[2],t)}}{${et.serialize(e.args[3],t)}}`}),Ne("mathop","{:auto}",{createAtom:e=>new et(h(l({},e),{type:"mop",body:de(e.args[0]),limits:"over-under",isFunction:!0,captureSelection:!0})),render:(e,t)=>{var r;let a=et.createBox(t,e.body);if(e.superscript||e.subscript){const b=(r=e.subsupPlacement)!=null?r:"auto";a=b==="over-under"||b==="auto"&&t.isDisplayStyle?e.attachLimits(t,{base:a}):e.attachSupsub(t,{base:a})}return new mt(e.bind(t,a),{type:"op",isSelected:e.isSelected,classes:"op-group"})},serialize:(e,t)=>{const r=[sn(e.command,e.bodyToLatex(t))];return e.explicitSubsupPlacement&&(e.subsupPlacement==="over-under"&&r.push("\\limits"),e.subsupPlacement==="adjacent"&&r.push("\\nolimits"),e.subsupPlacement==="auto"&&r.push("\\displaylimits")),r.push(e.supsubToLatex(t)),ar(r)}}),Ne(["mathbin","mathrel","mathopen","mathclose","mathpunct","mathord","mathinner"],"{:auto}",{createAtom:e=>new et(h(l({},e),{type:{"\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[e.command],body:de(e.args[0])}))}),Ne(["operatorname","operatorname*"],"{operator:math}",{createAtom:e=>{const t=de(e.args[0]).map(r=>{var a;return r.type!=="first"&&(r.type="mord",r.value=(a={"\u2217":"*","\u2212":"-"}[r.value])!=null?a:r.value,r.isFunction=!1,!r.style.variant&&!r.style.variantStyle&&(r.style.variant="main",r.style.variantStyle="up")),r});return new et(h(l({},e),{type:"mop",body:t,isFunction:!0,limits:e.command==="\\operatorname"?"adjacent":"over-under"}))},render:(e,t)=>{var r;let a=et.createBox(t,e.body);if(e.superscript||e.subscript){const b=(r=e.subsupPlacement)!=null?r:"auto";a=b==="over-under"||b==="auto"&&t.isDisplayStyle?e.attachLimits(t,{base:a}):e.attachSupsub(t,{base:a})}return e.caret&&(a.caret=e.caret),new mt(e.bind(t,a),{type:"op",isSelected:e.isSelected,classes:"op-group"})},serialize:(e,t)=>{const r=[sn(e.command,e.bodyToLatex(t))];return e.explicitSubsupPlacement&&(e.subsupPlacement==="over-under"&&r.push("\\limits"),e.subsupPlacement==="adjacent"&&r.push("\\nolimits"),e.subsupPlacement==="auto"&&r.push("\\displaylimits")),r.push(e.supsubToLatex(t)),ar(r)}}),Ne(["char","unicode"],"{charcode:value}",{createAtom:e=>new et(h(l({},e),{type:e.mode==="text"?"text":"mord"})),serialize:e=>{var t;return`${e.command}${Dn((t=e.args[0])!=null?t:{number:10067,base:"hexadecimal"})}`},render:(e,t)=>{let r=t.evaluate(e.args[0]);return(!r||!("number"in r))&&(r={number:10067,base:"hexadecimal"}),e.value=String.fromCodePoint(r.number),e.createBox(t)}}),Ne("rule","[raise:value]{width:value}{thickness:value}",{createAtom:e=>new et(e),render:(e,t)=>{var r,a,b;const L=new gr({parent:t,mathstyle:"textstyle"},e.style),N=L.toEm((r=e.args[0])!=null?r:{dimension:0}),J=L.toEm((a=e.args[1])!=null?a:{dimension:10}),ie=L.toEm((b=e.args[2])!=null?b:{dimension:10}),ue=new mt(null,{classes:"rule",type:"ord"});return ue.width=J,ue.height=ie+N,ue.depth=-N,ue.setStyle("border-right-width",J,"em"),ue.setStyle("border-top-width",ie,"em"),ue.setStyle("border-color",e.style.color),ue.setStyle("vertical-align",N,"em"),e.isSelected&&ue.setStyle("opacity","50%"),e.bind(L,ue),e.caret&&(ue.caret=e.caret),ue.wrap(t)},serialize:e=>`\\rule${e.args[0]?`[${Dn(e.args[0])}]`:""}{${Dn(e.args[1])}}{${Dn(e.args[2])}}`}),Ne(["overline","underline"],"{:auto}",{createAtom:e=>new et(h(l({},e),{body:de(e.args[0])})),render:(e,t)=>{const r=e.command.substring(1),a=new gr({parent:t,mathstyle:"cramp"},e.style),b=et.createBox(a,e.body);if(!b)return null;const L=a.metrics.defaultRuleThickness/a.scalingFactor,N=new mt(null,{classes:r+"-line"});N.height=L,N.maxFontSize=L*1.125*a.scalingFactor;let J;return r==="overline"?J=new Zr({shift:0,children:[{box:b},3*L,{box:N},L]}):J=new Zr({top:b.height,children:[L,{box:N},3*L,{box:b}]}),e.caret&&(J.caret=e.caret),new mt(J,{classes:r,type:"ignore"})}}),Ne("overset","{:auto}{base:auto}",{createAtom:e=>{const t=de(e.args[1]);return new Po(h(l({},e),{above:de(e.args[0]),body:t,skipBoundary:!1,boxType:Ba(t)}))},serialize:(e,t)=>sn(e.command,e.aboveToLatex(t),e.bodyToLatex(t))}),Ne("underset","{:auto}{base:auto}",{createAtom:e=>{const t=de(e.args[1]);return new Po(h(l({},e),{below:de(e.args[0]),body:t,skipBoundary:!1,boxType:Ba(t)}))},serialize:(e,t)=>sn(e.command,e.belowToLatex(t),e.bodyToLatex(t))}),Ne("overunderset","{above:auto}{below:auto}{base:auto}",{createAtom:e=>{const t=de(e.args[2]);return new Po(h(l({},e),{above:de(e.args[0]),below:de(e.args[1]),body:t,skipBoundary:!1,boxType:Ba(t)}))},serialize:(e,t)=>sn(e.command,e.belowToLatex(t),e.bodyToLatex(t))}),Ne(["stackrel","stackbin"],"[below:auto]{above:auto}{base:auto}",{createAtom:e=>new Po(h(l({},e),{body:de(e.args[2]),above:de(e.args[1]),below:de(e.args[0]),skipBoundary:!1,boxType:e.command==="\\stackrel"?"rel":"bin"})),serialize:(e,t)=>sn(e.command,e.aboveToLatex(t),e.bodyToLatex(t))}),Ne("smash","[:string]{:auto}",{createAtom:e=>{var t,r,a,b;return new _u(h(l({},e),{body:de(e.args[1]),smashHeight:(r=(t=e.args[0])==null?void 0:t.includes("t"))!=null?r:!0,smashDepth:(b=(a=e.args[0])==null?void 0:a.includes("b"))!=null?b:!0}))}}),Ne(["vphantom"],"{:auto}",{createAtom:e=>new _u(h(l({},e),{body:de(e.args[0]),isInvisible:!0,smashWidth:!0}))}),Ne(["hphantom"],"{:auto}",{createAtom:e=>new _u(h(l({},e),{body:de(e.args[0]),isInvisible:!0,smashHeight:!0,smashDepth:!0}))}),Ne(["phantom"],"{:auto}",{createAtom:e=>new _u(h(l({},e),{body:de(e.args[0]),isInvisible:!0}))}),Ne("not","{:math}",{createAtom:e=>{const t=de(e.args[0]);return t.length===0?new et(h(l({},e),{type:"mrel",value:"\uE020"})):new et(h(l({},e),{body:[new _l(h(l({},e),{body:"\uE020",align:"right"})),...t],captureSelection:!0}))},serialize:(e,t)=>{const r=e.args[0],a=r&&typeof r=="object"&&"group"in r;return e.value!=="\uE020"?a?`\\not{${et.serialize(r.group,t)}}`:`\\not${et.serialize(r,t)}`:a?"\\not{}":"\\not"},render:(e,t)=>{if(e.value)return e.createBox(t);const a=e.args[0]&&typeof e.args[0]=="object"&&"group"in e.args[0]?"ord":Ba(de(e.args[0])),b=et.createBox(t,e.body,{type:a});return e.caret&&(b.caret=e.caret),e.bind(t,b)}}),Ne(["ne","neq"],"",{createAtom:e=>new et(h(l({},e),{type:"mrel",body:[new _l(h(l({},e),{body:"\uE020",align:"right",boxType:"rel"})),new et(h(l({},e),{value:"="}))],captureSelection:!0})),serialize:e=>e.command}),Ne("rlap","{:auto}",{createAtom:e=>new _l(h(l({},e),{body:de(e.args[0]),align:"right"}))}),Ne("llap","{:auto}",{createAtom:e=>new _l(h(l({},e),{body:de(e.args[0]),align:"left"}))}),Ne("mathrlap","{:math}",{createAtom:e=>new _l(h(l({},e),{body:de(e.args[0]),align:"left"}))}),Ne("mathllap","{:math}",{createAtom:e=>new _l(h(l({},e),{body:de(e.args[0]),align:"left"}))}),Ne("raisebox","{:value}{:text}",{createAtom:e=>{var t;return new En(h(l({},e),{body:de(e.args[1]),padding:{dimension:0},offset:(t=e.args[0])!=null?t:{dimension:0}}))},serialize:(e,t)=>{var r;return sn("\\raisebox",(r=Dn(e.offset))!=null?r:"0pt",e.bodyToLatex(t))}}),Ne("raise","{:value}{:auto}",{createAtom:e=>{var t;return new En(h(l({},e),{body:de(e.args[1]),padding:{dimension:0},offset:(t=e.args[0])!=null?t:{dimension:0}}))},serialize:(e,t)=>{var r;return sn("\\raise",(r=Dn(e.offset))!=null?r:"0pt",e.bodyToLatex(t))}}),Ne("lower","{:value}{:auto}",{createAtom:e=>{var t;return new En(h(l({},e),{body:de(e.args[1]),padding:{dimension:0},offset:(t=Oo(e.args[0],-1))!=null?t:{dimension:0}}))},serialize:(e,t)=>{var r,a;return sn("\\lower",(a=Dn(Oo((r=e.offset)!=null?r:{dimension:0},-1)))!=null?a:"0pt",e.bodyToLatex(t))}}),W("0123456789/@.?!"),V(65,90),V(97,122),W([["\\forall",8704],["\\exists",8707],["\\nexists",8708,"mord","ams"],["\\mid",8739,"mrel"],["\\top",8868],["\\bot",8869]]),W([["\\#",35],["\\&",38],["\\parallelogram",9649],["\\spadesuit",9824],["\\heartsuit",9825],["\\diamondsuit",9826],["\\clubsuit",9827],["\\flat",9837],["\\natural",9838],["\\sharp",9839]]),W([["\\backslash",92],["\\nabla",8711],["\\partial",8706],["\\ell",8467],["\\hbar",8463],["\\Q",81,"mord","double-struck"],["\\C",67,"mord","double-struck"],["\\P",80,"mord","double-struck"],["\\pounds",163],["\\euro",8364]]),W([["\\rightarrow",8594],["\\to",8594],["\\leftarrow",8592],["\\gets",8592],["\\Rightarrow",8658],["\\Leftarrow",8656],["\\longrightarrow",10230],["\\longleftarrow",10229],["\\Longrightarrow",10233],["\\implies",10233],["\\Longleftarrow",10232],["\\impliedby",10232],["\\longleftrightarrow",10231],["\\biconditional",10231],["\\Longleftrightarrow",10234],["\\mapsto",8614],["\\longmapsto",10236],["\\uparrow",8593],["\\downarrow",8595],["\\Uparrow",8657],["\\Downarrow",8659],["\\updownarrow",8597],["\\Updownarrow",8661],["\\hookrightarrow",8618],["\\hookleftarrow",8617],["\\rightharpoonup",8640],["\\leftharpoonup",8636],["\\rightharpoondown",8641],["\\leftharpoondown",8637],["\\searrow",8600],["\\nearrow",8599],["\\swarrow",8601],["\\nwarrow",8598],["\\originalof",8886],["\\laplace",8886],["\\imageof",8887],["\\Laplace",8887]],"mrel"),W([["\\mapsfrom",8612,"mrel"],["\\Mapsfrom",10502,"mrel"],["\\MapsTo",10503,"mrel"],["\\Yup",8516,"mord"],["\\lightning",8623,"mrel"],["\\leftarrowtriangle",8701,"mrel"],["\\rightarrowtriangle",8702,"mrel"],["\\leftrightarrowtriangle",8703,"mrel"],["\\boxdot",8865,"mbin"],["\\bigtriangleup",9651,"mbin"],["\\bigtriangledown",9661,"mbin"],["\\boxbar",9707,"mbin"],["\\Lbag",10181,"mopen"],["\\Rbag",10182,"mclose"],["\\llbracket",10214,"mopen"],["\\rrbracket",10215,"mclose"],["\\longmapsfrom",10235,"mrel"],["\\Longmapsfrom",10237,"mrel"],["\\Longmapsto",10238,"mrel"],["\\boxslash",10692,"mbin"],["\\boxbslash",10693,"mbin"],["\\boxast",10694,"mbin"],["\\boxcircle",10695,"mbin"],["\\boxbox",10696,"mbin"],["\\fatsemi",10783,"mop"],["\\leftslice",10918,"mrel"],["\\rightslice",10919,"mrel"],["\\interleave",10996,"mbin"],["\\biginterleave",11004,"mop"],["\\sslash",11005,"mbin"],["\\talloblong",11006,"mbin"]]),W([["\\lbrace",123,"mopen"],["\\rbrace",125,"mclose"],["\\lparen",40,"mopen"],["\\rparen",41,"mclose"],["\\langle",10216,"mopen"],["\\rangle",10217,"mclose"],["\\lfloor",8970,"mopen"],["\\rfloor",8971,"mclose"],["\\lceil",8968,"mopen"],["\\rceil",8969,"mclose"],["\\vert",8739],["\\lvert",8739,"mopen"],["\\rvert",8739,"mclose"],["\\|",8741],["\\Vert",8741],["\\mVert",8741],["\\lVert",8741,"mopen"],["\\rVert",8741,"mclose"],["\\lbrack",91,"mopen"],["\\rbrack",93,"mclose"],["\\{",123,"mopen"],["\\}",125,"mclose"],["(",40,"mopen"],[")",41,"mclose"],["[",91,"mopen"],["]",93,"mclose"],["\\ulcorner",9484,"mopen","ams"],["\\urcorner",9488,"mclose","ams"],["\\llcorner",9492,"mopen","ams"],["\\lrcorner",9496,"mclose","ams"],["\\lgroup",10222,"mopen"],["\\rgroup",10223,"mclose"],["\\lmoustache",9136,"mopen"],["\\rmoustache",9137,"mclose"]]),W([["\\dashrightarrow",8674],["\\dashleftarrow",8672],["\\Rrightarrow",8667],["\\Lleftarrow",8666],["\\leftrightarrows",8646],["\\rightleftarrows",8644],["\\curvearrowright",8631],["\\curvearrowleft",8630],["\\rightrightarrows",8649],["\\leftleftarrows",8647],["\\upuparrows",8648],["\\downdownarrows",8650],["\\vartriangle",9651],["\\triangleq",8796],["\\vartriangleleft",8882],["\\trianglelefteq",8884],["\\ntriangleleft",8938],["\\ntrianglelefteq",8940],["\\vartriangleright",8883],["\\trianglerighteq",8885],["\\ntriangleright",8939],["\\ntrianglerighteq",8941],["\\blacktriangleleft",9664],["\\blacktriangleright",9654],["\\leftarrowtail",8610],["\\rightarrowtail",8611],["\\looparrowright",8620],["\\looparrowleft",8619],["\\twoheadleftarrow",8606],["\\twoheadrightarrow",8608],["\\twoheadrightarrowtail",10518],["\\rightleftharpoons",8652],["\\leftrightharpoons",8651],["\\Rsh",8625],["\\Lsh",8624],["\\circlearrowright",8635],["\\circlearrowleft",8634],["\\restriction",8638],["\\upharpoonright",8638],["\\upharpoonleft",8639],["\\downharpoonright",8642],["\\downharpoonleft",8643],["\\rightsquigarrow",8669],["\\leadsto",8669],["\\leftrightsquigarrow",8621],["\\multimap",8888],["\\nleftarrow",8602],["\\nrightarrow",8603],["\\nRightarrow",8655],["\\nLeftarrow",8653],["\\nleftrightarrow",8622],["\\nLeftrightarrow",8654],["\\nvrightarrow",8696],["\\nvtwoheadrightarrow",10496],["\\nvrightarrowtail",10516],["\\nvtwoheadrightarrowtail",10519],["\\shortparallel",8741],["\\nless",8814],["\\nleqslant",57360],["\\lneq",10887],["\\lneqq",8808],["\\nleqq",57361],["\\lvertneqq",57356],["\\lnsim",8934],["\\lnapprox",10889],["\\nprec",8832],["\\npreceq",8928],["\\precnsim",8936],["\\precnapprox",10937],["\\nsim",8769],["\\nshortmid",57350],["\\nmid",8740],["\\nvdash",8876],["\\nvDash",8877],["\\ngtr",8815],["\\ngeqslant",57359],["\\ngeqq",57358],["\\gneq",10888],["\\gneqq",8809],["\\gvertneqq",57357],["\\gnsim",8935],["\\gnapprox",10890],["\\nsucc",8833],["\\nsucceq",8929],["\\succnsim",8937],["\\succnapprox",10938],["\\ncong",8774],["\\nshortparallel",57351],["\\nparallel",8742],["\\nVDash",8879],["\\nsupseteqq",57368],["\\supsetneq",8843],["\\varsupsetneq",57371],["\\supsetneqq",10956],["\\varsupsetneqq",57369],["\\nVdash",8878],["\\precneqq",10933],["\\succneqq",10934],["\\nsubseteqq",57366],["\\leqslant",10877],["\\geqslant",10878],["\\gtrsim",8819],["\\approxeq",8778],["\\thickapprox",8776],["\\lessapprox",10885],["\\gtrapprox",10886],["\\precapprox",10935],["\\succapprox",10936],["\\thicksim",8764],["\\succsim",8831],["\\precsim",8830],["\\backsim",8765],["\\eqsim",8770],["\\backsimeq",8909],["\\lesssim",8818],["\\nleq",8816],["\\ngeq",8817],["\\smallsmile",8995],["\\smallfrown",8994],["\\leqq",8806],["\\eqslantless",10901],["\\lll",8920],["\\lessgtr",8822],["\\lesseqgtr",8922],["\\lesseqqgtr",10891],["\\risingdotseq",8787],["\\fallingdotseq",8786],["\\subseteqq",10949],["\\Subset",8912],["\\sqsubset",8847],["\\preccurlyeq",8828],["\\curlyeqprec",8926],["\\vDash",8872],["\\Vvdash",8874],["\\bumpeq",8783],["\\Bumpeq",8782],["\\geqq",8807],["\\eqslantgtr",10902],["\\ggg",8921],["\\gtrless",8823],["\\gtreqless",8923],["\\gtreqqless",10892],["\\supseteqq",10950],["\\Supset",8913],["\\sqsupset",8848],["\\succcurlyeq",8829],["\\curlyeqsucc",8927],["\\Vdash",8873],["\\shortmid",8739],["\\between",8812],["\\pitchfork",8916],["\\varpropto",8733],["\\backepsilon",8717],["\\llless",8920],["\\gggtr",8921],["\\doteqdot",8785],["\\Doteq",8785],["\\eqcirc",8790],["\\circeq",8791],["\\therefore",8756],["\\because",8757]],"mrel","ams"),W([["+",43],["-",8722],["\u2212",8722],["\\pm",177],["\\mp",8723],["*",8727],["\\times",215],["\\div",247],["\\divides",8739],["\\cdot",8901],["\\cap",8745],["\\cup",8746],["\\setminus",8726],["\\land",8743],["\\wedge",8743],["\\lor",8744],["\\vee",8744],["\\circ",8728],["\\bigcirc",9711],["\\bullet",8729],["\\oplus",8853],["\\ominus",8854],["\\otimes",8855],["\\odot",8857],["\\oslash",8856],["\\bigtriangleup",9651],["\\bigtriangledown",9661],["\\triangleleft",9667],["\\triangleright",9657],["\\And",38],["\\dagger",8224],["\\dag",8224],["\\ddag",8225],["\\ddagger",8225],["\\ast",8727],["\\star",8902],["\\bigstar",9733],["\\diamond",8900]],"mbin"),W([["\\lhd",8882],["\\rhd",8883],["\\lessdot",8918],["\\gtrdot",8919],["\\ltimes",8905],["\\rtimes",8906],["\\leftthreetimes",8907],["\\rightthreetimes",8908],["\\intercal",8890],["\\dotplus",8724],["\\doublebarwedge",10846],["\\divideontimes",8903],["\\centerdot",8901],["\\smallsetminus",8726],["\\barwedge",8892],["\\veebar",8891],["\\nor",8891],["\\curlywedge",8911],["\\curlyvee",8910],["\\boxminus",8863],["\\boxplus",8862],["\\boxtimes",8864],["\\boxdot",8865],["\\circleddash",8861],["\\circledast",8859],["\\circledcirc",8858],["\\unlhd",8884],["\\unrhd",8885]],"mbin","ams"),W([["\\surd",8730],["\\infty",8734],["\\prime",8242],["\\doubleprime",8243],["\\angle",8736],["`",8216],["\\$",36],["\\%",37],["\\_",95],["\\alpha",945],["\\beta",946],["\\gamma",947],["\\delta",948],["\\epsilon",1013],["\\varepsilon",949],["\\zeta",950],["\\eta",951],["\\theta",952],["\\vartheta",977],["\\iota",953],["\\kappa",954],["\\varkappa",1008,"mord","ams"],["\\lambda",955],["\\mu",956],["\\nu",957],["\\xi",958],["\\omicron",111],["\\pi",960],["\\varpi",982],["\\rho",961],["\\varrho",1009],["\\sigma",963],["\\varsigma",962],["\\tau",964],["\\phi",981],["\\varphi",966],["\\upsilon",965],["\\chi",967],["\\psi",968],["\\omega",969],["\\Gamma",915],["\\Delta",916],["\\Theta",920],["\\Lambda",923],["\\Xi",926],["\\Pi",928],["\\Sigma",931],["\\Upsilon",933],["\\Phi",934],["\\Psi",936],["\\Omega",937],["\\digamma",989,"mord","ams"],["\\emptyset",8709]]),W([["=",61],["<",60],["\\lt",60],[">",62],["\\gt",62],["\\le",8804],["\\leq",8804],["\\ge",8805],["\\geq",8805],["\\ll",8810],["\\gg",8811],["\\coloneq",8788],["\\coloneqq",8788],["\\colonequals",8788],["\\measeq",8797],["\\eqdef",8798],["\\questeq",8799],[":",58],["\\cong",8773],["\\equiv",8801],["\\prec",8826],["\\preceq",10927],["\\succ",8827],["\\succeq",10928],["\\perp",8869],["\\propto",8733],["\\Colon",8759],["\\smile",8995],["\\frown",8994],["\\sim",8764],["\\doteq",8784],["\\bowtie",8904],["\\Join",8904],["\\asymp",8781],["\\sqsubseteq",8849],["\\sqsupseteq",8850],["\\approx",8776],["\\~",126],["\\leftrightarrow",8596],["\\Leftrightarrow",8660],["\\models",8872],["\\vdash",8866],["\\dashv",8867],["\\roundimplies",10608],["\\in",8712],["\\notin",8713],["\\ni",8715],["\\owns",8715],["\\subset",8834],["\\supset",8835],["\\subseteq",8838],["\\supseteq",8839],["\\differencedelta",8710],["\\mvert",8739],["\\parallel",8741],["\\simeq",8771]],"mrel"),W([["\\lnot",172],["\\neg",172],["\\triangle",9651],["\\subsetneq",8842],["\\varsubsetneq",57370],["\\subsetneqq",10955],["\\varsubsetneqq",57367],["\\nsubset",8836],["\\nsupset",8837],["\\nsubseteq",8840],["\\nsupseteq",8841]],"mrel","ams"),W([["\\wp",8472],["\\aleph",8501]]),W([["\\blacktriangle",9650],["\\hslash",8463],["\\Finv",8498],["\\Game",8513],["\\eth",240],["\\mho",8487],["\\Bbbk",107],["\\yen",165],["\\square",9633],["\\Box",9633],["\\blacksquare",9632],["\\circledS",9416],["\\circledR",174],["\\triangledown",9661],["\\blacktriangledown",9660],["\\checkmark",10003],["\\diagup",9585],["\\measuredangle",8737],["\\sphericalangle",8738],["\\backprime",8245],["\\backdoubleprime",8246],["\\Diamond",9674],["\\lozenge",9674],["\\blacklozenge",10731],["\\varnothing",8709],["\\complement",8705],["\\maltese",10016],["\\beth",8502],["\\daleth",8504],["\\gimel",8503]],"mord","ams"),W([["\\ ",160],["~",160]],"space"),Ne(["!",",",":",";",">","enskip","enspace","quad","qquad"],"",{createAtom:e=>new wu(e)}),Ne("space","",{createAtom:e=>new wu(e)}),W([["\\colon",58],["\\cdotp",8901],["\\vdots",8942,"mord"],["\\ldotp",46],[",",44],[";",59]],"mpunct"),W([["\\cdots",8943],["\\ddots",8945],["\\ldots",8230],["\\mathellipsis",8230]],"minner"),W([["\\/",47],["|",8739,"mord"],["\\imath",305],["\\jmath",567],["\\degree",176],["'",8242],['"',8221]]);var vp="<mo>&#x2061;</mo>",ih="<mo>&#8290;</mo>";function oh(e){return e.replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Qr(e,t){return!e||!t.generateID?"":` extid="${e}"`}function Pg(e,t,r){var a,b,L,N,J,ie,ue,pe,Ee,De,je;let ze=!1;t=t!=null?t:e.atoms.length;let Je="",pt="",Xe=e.atoms[e.index];const ot=(b=(a=Xe.style)==null?void 0:a.variant)!=null?b:"",gt=(N=(L=Xe.style)==null?void 0:L.variantStyle)!=null?N:"";let ct="";if(ot||gt){const Bt=Ce(Xe.value,(J=Xe.style)==null?void 0:J.variant,(ie=Xe.style)==null?void 0:ie.variantStyle);if(Bt!==Xe.value)return e.index+=1,Je=`<mi${Qr(Xe.id,r)}>${Bt}</mi>`,ya(Je,e,r)||(e.mathML+=Je,e.lastType="mi"),!0;ct=(ue={upnormal:"normal",boldnormal:"bold",italicmain:"italic",bolditalicmain:"bold-italic","updouble-struck":"double-struck","double-struck":"double-struck",boldfraktur:"bold-fraktur",calligraphic:"script",upcalligraphic:"script",script:"script",boldscript:"bold-script",boldcalligraphic:"bold-script",fraktur:"fraktur","upsans-serif":"sans-serif","boldsans-serif":"bold-sans-serif","italicsans-serif":"sans-serif-italic","bolditalicsans-serif":"sans-serif-bold-italic",monospace:"monospace"}[gt+ot])!=null?ue:"",ct=` mathvariant="${ct}"`}const Dt={"\\exponentialE":"&#x02147;","\\imaginaryI":"&#x2148;","\\differentialD":"&#x2146;","\\capitalDifferentialD":"&#x2145;","\\alpha":"&#x03b1;","\\pi":"&#x03c0;","\\infty":"&#x221e;","\\forall":"&#x2200;","\\nexists":"&#x2204;","\\exists":"&#x2203;","\\hbar":"\u210F","\\cdotp":"\u22C5","\\ldots":"\u2026","\\cdots":"\u22EF","\\ddots":"\u22F1","\\vdots":"\u22EE","\\ldotp":"."};if(Xe.command==="!")return e.index+=1,Je="<mo>!</mo>",ya(Je,e,r)||(e.mathML+=Je,e.lastType="mo"),!0;if(Dt[Xe.command]){e.index+=1;let Bt=`<mi${Qr(Xe.id,r)}${ct}>${Dt[Xe.command]}</mi>`;return(e.lastType==="mi"||e.lastType==="mn"||e.lastType==="mtext"||e.lastType==="fence")&&(Bt=ih+Bt),ya(Bt,e,r)||(e.mathML+=Bt,e.lastType="mi"),!0}if(Xe.command==="\\operatorname")pt=Ec(Xe.body),e.index+=1;else if(ot||gt)for(;e.index<t&&(Xe.type==="mord"||Xe.type==="macro")&&!Xe.isDigit()&&ot===((Ee=(pe=Xe.style)==null?void 0:pe.variant)!=null?Ee:"")&&gt===((je=(De=Xe.style)==null?void 0:De.variantStyle)!=null?je:"");)pt+=Ec([Xe]),e.index+=1,Xe=e.atoms[e.index];else(Xe.type==="mord"||Xe.type==="macro")&&!Xe.isDigit()&&(pt+=Ec([Xe]),e.index+=1);if(pt.length>0){ze=!0,Je=`<mi${ct}>${pt}</mi>`;const Bt=e.lastType;Je.endsWith(">f</mi>")||Je.endsWith(">g</mi>")?(Je+=vp,e.lastType="applyfunction"):e.lastType=/^<mo>(.*)<\/mo>$/.test(Je)?"mo":"mi",ya(Je,e,r)||((Bt==="mi"||Bt==="mn"||Bt==="mtext"||Bt==="fence")&&(Je=ih+Je),e.mathML+=Je)}return ze}function Rg(e){return e.index<e.atoms.length&&e.atoms[e.index].superscript&&e.atoms[e.index].type==="subsup"}function Ig(e){let t=-1,r=e.index,a=!1,b=!1;for(;r<e.atoms.length&&!a&&!b;){const L=e.atoms[r];a=!L.isDigit(),b=!a&&L.superscript!==void 0,r++}return b&&(t=r-1),t}function ya(e,t,r){var a;let b=t.atoms[t.index-1];if(!b)return!1;if(!b.superscript&&!b.subscript)if(((a=t.atoms[t.index])==null?void 0:a.type)==="subsup")b=t.atoms[t.index],t.index+=1;else return!1;const L=t.lastType;t.lastType="";const N=Pr(b.superscript,r);t.lastType="";const J=Pr(b.subscript,r);if(t.lastType=L,!N&&!J)return!1;let ie="";return N&&J?ie=`<msubsup>${e}${J}${N}</msubsup>`:N?ie=`<msup>${e}${N}</msup>`:J&&(ie=`<msub>${e}${J}</msub>`),t.mathML+=ie,t.lastType="",!0}function jg(e,t,r){t=t!=null?t:e.atoms.length;const a=e.index;let b="";for(;e.index<t&&e.atoms[e.index].mode==="text";)b+=e.atoms[e.index].value?e.atoms[e.index].value:" ",e.index+=1;return b.length>0?(e.mathML+=`<mtext ${Qr(e.atoms[a].id,r)}>${b}</mtext>`,e.lastType="mtext",!0):!1}function Bg(e,t,r){t=t!=null?t:e.atoms.length;const a=e.index;let b="",L=Ig(e);for(L>=0&&L<t&&(t=L);e.index<t&&e.atoms[e.index].isDigit();)b+=e.atoms[e.index].asDigit(),e.index+=1;return b.length<=0?!1:(b="<mn"+Qr(e.atoms[a].id,r)+">"+b+"</mn>",L<0&&Rg(e)&&(L=e.index,e.index+=1),ya(b,e,r)||(e.mathML+=b,e.lastType="mn"),!0)}function Ng(e,t,r){let a=!1;t=t!=null?t:e.atoms.length;let b="",L="";if(e.index<t&&e.atoms[e.index].type==="mopen"){let N=!1,J=0;const ie=e.index;let ue=-1,pe=ie+1;for(;pe<t&&!N;)e.atoms[pe].type==="mopen"?J+=1:e.atoms[pe].type==="mclose"&&(J-=1),J===-1&&(N=!0,ue=pe),pe+=1;N&&(b="<mrow>",b+=Ol(e.atoms[ie],r),b+=Pr(e.atoms,r,ie+1,ue),b+=Ol(e.atoms[ue],r),b+="</mrow>",e.index=ue+1,(e.lastType==="mi"||e.lastType==="mn"||e.lastType==="mfrac"||e.lastType==="fence")&&(e.mathML+=ih),ya(b,e,r)&&(a=!0,e.lastType="",b=""),L="fence")}return b.length>0&&(a=!0,e.mathML+=b,e.lastType=L),a}function Fg(e,t,r){let a=!1;t=t!=null?t:e.atoms.length;let b="",L="";const N=e.atoms[e.index];if(!N)return!1;const J={"\\ne":"&ne;","\\neq":"&neq;","\\pm":"&#177;","\\times":"&#215;","\\colon":":","\\vert":"|","\\Vert":"\u2225","\\mid":"\u2223","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lbrack":"[","\\rbrack":"]","\\lparen":"(","\\rparen":")","\\langle":"\u27E8","\\rangle":"\u27E9","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309"};if(J[N.command]){e.index+=1;const ie=`<mo${Qr(N.id,r)}>${J[N.command]}</mo>`;return ya(ie,e,r)||(e.mathML+=ie,e.lastType="mo"),!0}if(e.index<t&&(N.type==="mbin"||N.type==="mrel"))b+=qh(e.atoms[e.index],r),e.index+=1,L="mo";else if(e.index<t&&(N.type==="mop"||N.type==="operator"||N.type==="extensible-symbol")){if(N.subsupPlacement==="over-under"&&(N.superscript||N.subscript)){const ie=Ol(N,r);return N.superscript&&N.subscript?(b+="<munderover>"+ie,b+=Pr(N.subscript,r),b+=Pr(N.superscript,r),b+="</munderover>"):N.superscript?(b+="<mover>"+ie,b+=Pr(N.superscript,r),b+="</mover>"):N.subscript&&(b+="<munder>"+ie,b+=Pr(N.subscript,r),b+="</munder>"),e.mathML+=b,e.lastType="mo",e.index+=1,!0}{const ie=e.atoms[e.index],ue=ie.value==="\\operatorname",pe=ue?'<mi class="MathML-Unit"'+Qr(ie.id,r)+">"+Ec(ie.value)+"</mi>":Ol(ie,r);b+=pe,!ue&&!/^<mo>(.*)<\/mo>$/.test(pe)?(b+=vp,L="applyfunction"):L=ue?"mi":"mo"}(e.lastType==="mi"||e.lastType==="mn")&&!/^<mo>(.*)<\/mo>$/.test(b)&&(b=ih+b),e.index+=1}return b.length>0&&(a=!0,ya(b,e,r)||(e.mathML+=b,e.lastType=L)),a}function Pr(e,t,r,a){t!=null||(t={});const b={atoms:[],index:r!=null?r:0,mathML:"",lastType:""};if(typeof e=="number"||typeof e=="boolean")b.mathML=e.toString();else if(typeof e=="string")b.mathML=e;else if(e instanceof et)b.mathML=qh(e,t);else if(Array.isArray(e)){b.atoms=e;let L=0;for(a=a||(e?e.length:0);b.index<a;)if(jg(b,a,t)||Bg(b,a,t)||Pg(b,a,t)||Fg(b,a,t)||Ng(b,a,t))L+=1;else if(b.index<a){let N=qh(b.atoms[b.index],t);b.lastType==="mn"&&N.length>0&&b.atoms[b.index].type==="genfrac"&&(N="<mo>&#x2064;</mo>"+N),b.atoms[b.index].type==="genfrac"?b.lastType="mfrac":b.lastType="",b.index+=1,ya(N,b,t)?L+=1:N.length>0&&(b.mathML+=N,L+=1)}L>1&&(b.mathML="<mrow>"+b.mathML+"</mrow>")}return b.mathML}function Ol(e,t){let r="";const a=Ec(e.value);return a&&(r="<mo"+Qr(e.id,t)+">"+a+"</mo>"),r}function Ec(e){if(!e)return"";if(typeof e=="string")return oh(e);if(!Array.isArray(e)&&typeof e.body=="string")return oh(e.body);let t="";for(const r of e)typeof r.value=="string"&&(t+=r.value);return oh(t)}function qh(e,t){var r,a,b,L,N,J,ie,ue,pe,Ee,De,je,ze,Je,pt,Xe,ot,gt,ct,Dt,Bt,Rt;if(e.mode==="text")return`<mi${Qr(e.id,t)}>${e.value}</mi>`;const br={widehat:"^",widecheck:"\u02C7",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",longleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",longrightarrow:"\u2192",underbrace:"\u23DF",overbrace:"\u23DE",overgroup:"\u23E0",undergroup:"\u23E1",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21D2",xRightarrow:"\u21D2",overleftharpoon:"\u21BC",xleftharpoonup:"\u21BC",overrightharpoon:"\u21C0",xrightharpoonup:"\u21C0",xLeftarrow:"\u21D0",xLeftrightarrow:"\u21D4",xhookleftarrow:"\u21A9",xhookrightarrow:"\u21AA",xmapsto:"\u21A6",xrightharpoondown:"\u21C1",xleftharpoondown:"\u21BD",xrightleftharpoons:"\u21CC",longrightleftharpoons:"\u21CC",xleftrightharpoons:"\u21CB",xtwoheadleftarrow:"\u219E",xtwoheadrightarrow:"\u21A0",xlongequal:"=",xtofrom:"\u21C4",xleftrightarrows:"\u21C4",xRightleftharpoons:"\u21CC",longRightleftharpoons:"\u21CC",xLeftrightharpoons:"\u21CB",longLeftrightharpoons:"\u21CB"},Gr={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\>":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let wt="",yo="",zs,Io,si,bo,$i,en;const{command:Tn}=e;if(e.command==="\\error")return`<merror${Qr(e.id,t)}>${Pr(e.body,t)}</merror>`;const ai={"\\vert":"|","\\Vert":"\u2225","\\mid":"\u2223","\\lbrack":"[","\\rbrack":"]","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"\u27E8","\\rangle":"\u27E9","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309"},Hs={"\\vec":"&#x20d7;","\\acute":"&#x00b4;","\\grave":"&#x0060;","\\dot":"&#x02d9;","\\ddot":"&#x00a8;","\\tilde":"&#x007e;","\\bar":"&#x00af;","\\breve":"&#x02d8;","\\check":"&#x02c7;","\\hat":"&#x005e;"};switch(e.type){case"first":break;case"group":case"root":wt=Pr(e.body,t);break;case"array":if((e.leftDelim&&e.leftDelim!=="."||e.rightDelim&&e.rightDelim!==".")&&(wt+="<mrow>",e.leftDelim&&e.leftDelim!=="."&&(wt+="<mo>"+(ai[e.leftDelim]||e.leftDelim)+"</mo>")),wt+="<mtable",e.colFormat){for(wt+=' columnalign="',si=0;si<e.colFormat.length;si++)e.colFormat[si].align&&(wt+={l:"left",c:"center",r:"right"}[e.colFormat[si].align]+" ");wt+='"'}for(wt+=">",Io=0;Io<e.array.length;Io++){for(wt+="<mtr>",zs=0;zs<e.array[Io].length;zs++)wt+="<mtd>"+Pr(e.array[Io][zs],t)+"</mtd>";wt+="</mtr>"}wt+="</mtable>",(e.leftDelim&&e.leftDelim!=="."||e.rightDelim&&e.rightDelim!==".")&&(e.rightDelim&&e.rightDelim!=="."&&(wt+="<mo>"+(ai[e.leftDelim]||e.rightDelim)+"</mo>"),wt+="</mrow>");break;case"genfrac":(e.leftDelim||e.rightDelim)&&(wt+="<mrow>"),e.leftDelim&&e.leftDelim!=="."&&(wt+="<mo"+Qr(e.id,t)+">"+(ai[e.leftDelim]||e.leftDelim)+"</mo>"),e.hasBarLine?(wt+="<mfrac>",wt+=Pr(e.above,t)||"<mi>&nbsp;</mi>",wt+=Pr(e.below,t)||"<mi>&nbsp;</mi>",wt+="</mfrac>"):(wt+="<mtable"+Qr(e.id,t)+">",wt+="<mtr>"+Pr(e.above,t)+"</mtr>",wt+="<mtr>"+Pr(e.below,t)+"</mtr>",wt+="</mtable>"),e.rightDelim&&e.rightDelim!=="."&&(wt+="<mo"+Qr(e.id,t)+">"+(ai[e.rightDelim]||e.rightDelim)+"</mo>"),(e.leftDelim||e.rightDelim)&&(wt+="</mrow>");break;case"surd":e.hasEmptyBranch("above")?(wt+="<msqrt"+Qr(e.id,t)+">",wt+=Pr(e.body,t),wt+="</msqrt>"):(wt+="<mroot"+Qr(e.id,t)+">",wt+=Pr(e.body,t),wt+=Pr(e.above,t),wt+="</mroot>");break;case"leftright":const Us=e,Ws=Us.leftDelim;wt="<mrow>",Ws&&Ws!=="."&&(wt+=`<mo${Qr(e.id,t)}>${(r=ai[Ws])!=null?r:Ws}</mo>`),e.body&&(wt+=Pr(e.body,t));const Ks=Us.matchingRightDelim();Ks&&Ks!=="."&&(wt+=`<mo${Qr(e.id,t)}>${(a=ai[Ks])!=null?a:Ks}</mo>`),wt+="</mrow>";break;case"sizeddelim":case"delim":wt+=`<mo${Qr(e.id,t)}>${ai[e.value]||e.value}</mo>`;break;case"accent":wt+='<mover accent="true"'+Qr(e.id,t)+">",wt+=Pr(e.body,t),wt+="<mo>"+(Hs[Tn]||e.accent)+"</mo>",wt+="</mover>";break;case"line":case"overlap":break;case"overunder":$i=e.above,bo=e.below,(e.svgAbove||$i)&&(e.svgBelow||bo)?en=e.body:$i&&$i.length>0?(en=e.body,(L=(b=e.body)==null?void 0:b[0])!=null&&L.below?(bo=e.body[0].below,en=e.body[0].body):((J=(N=e.body)==null?void 0:N[0])==null?void 0:J.type)==="first"&&((ue=(ie=e.body)==null?void 0:ie[1])!=null&&ue.below)&&(bo=e.body[1].below,en=e.body[1].body)):bo&&bo.length>0&&(en=e.body,(Ee=(pe=e.body)==null?void 0:pe[0])!=null&&Ee.above?($i=e.body[0].above,en=e.body[0].body):((je=(De=e.body)==null?void 0:De[0])==null?void 0:je.type)==="first"&&((Je=(ze=e.body)==null?void 0:ze[1])!=null&&Je.above)&&($i=e.body[1].overscript,en=e.body[1].body)),(e.svgAbove||$i)&&(e.svgBelow||bo)?(wt+=`<munderover ${Qr(e.id,t)}>`,wt+=(pt=br[e.svgBody])!=null?pt:Pr(en,t),wt+=(Xe=br[e.svgBelow])!=null?Xe:Pr(bo,t),wt+=(ot=br[e.svgAbove])!=null?ot:Pr($i,t),wt+="</munderover>"):e.svgAbove||$i?(wt+=`<mover ${Qr(e.id,t)}>`+((gt=br[e.svgBody])!=null?gt:Pr(en,t)),wt+=(ct=br[e.svgAbove])!=null?ct:Pr($i,t),wt+="</mover>"):(e.svgBelow||bo)&&(wt+=`<munder ${Qr(e.id,t)}>`+((Dt=br[e.svgBody])!=null?Dt:Pr(en,t)),wt+=(Bt=br[e.svgBelow])!=null?Bt:Pr(bo,t),wt+="</munder>");break;case"placeholder":wt+="?";break;case"mord":{wt=typeof e.value=="string"?e.value:Tn,Tn==="\\char"?wt="&#x"+("000000"+e.args[0].number.toString(16)).slice(-4)+";":wt.length>0&&wt.startsWith("\\")&&(typeof e.value=="string"&&e.value.charCodeAt(0)>255?wt="&#x"+("000000"+e.value.charCodeAt(0).toString(16)).slice(-4)+";":typeof e.value=="string"?wt=e.value.charAt(0):(console.error("Did not expect this"),wt=""));const us=/\d/.test(wt)?"mn":"mi";wt=`<${us}${Qr(e.id,t)}>${oh(wt)}</${us}>`;break}case"mbin":case"mrel":case"minner":wt=Ol(e,t);break;case"mpunct":wt='<mo separator="true"'+Qr(e.id,t)+">"+Tn+"</mo>";break;case"mop":case"operator":case"extensible-symbol":e.body!=="\u200B"&&(wt="<mo"+Qr(e.id,t)+">",wt+=Tn==="\\operatorname"?e.body:Tn||e.body,wt+="</mo>");break;case"box":wt='<menclose notation="box"',e.backgroundcolor&&(wt+=' mathbackground="'+e.backgroundcolor+'"'),wt+=Qr(e.id,t)+">"+Pr(e.body,t)+"</menclose>";break;case"spacing":wt+='<mspace width="'+((Rt=Gr[Tn])!=null?Rt:0)+'em"/>';break;case"enclose":wt='<menclose notation="';for(const us in e.notation)Object.prototype.hasOwnProperty.call(e.notation,us)&&e.notation[us]&&(wt+=yo+us,yo=" ");wt+=Qr(e.id,t)+'">'+Pr(e.body,t)+"</menclose>";break;case"prompt":wt='<menclose notation="roundexbox""">'+Pr(e.body,t)+"</menclose>";break;case"space":wt+="&nbsp;";break;case"subsup":break;case"phantom":break;case"composition":break;case"rule":break;case"chem":break;case"mopen":wt+=Ol(e,t);break;case"mclose":wt+=Ol(e,t);break;case"macro":{const us=e.command+Ec(e.macroArgs);us&&(wt+=`<mo ${Qr(e.id,t)}>${us}</mo>`)}break;case"latexgroup":wt+=Pr(e.body,t);break;case"latex":wt+="<mtext"+Qr(e.id,t)+">"+e.value+"</mtext>";break;case"tooltip":wt+=Pr(e.body,t);break;case"text":wt+=`<mtext ${Qr(e.id,t)}x>${e.value}</mtext>`;break;default:if(e.command==="\\displaystyle")return`<mrow ${Qr(e.id,t)} displaystyle="true">${Pr(e.body,t)}</mrow>`;if(e.command==="\\textstyle")return`<mrow ${Qr(e.id,t)} displaystyle="false">${Pr(e.body,t)}</mrow>`;console.info("Unexpected element in conversion to MathML:",e)}return wt}var Mc={"\\alpha":"alpha ","\\mu":"mew ","\\sigma":"sigma ","\\pi":"pie ","\\imaginaryI":"imaginary eye ","\\imaginaryJ":"imaginary jay ","\\sum":"Summation ","\\prod":"Product ","+":"plus ","-":"minus ",";":'<break time="150ms"/> semi-colon <break time="150ms"/>',",":'<break time="150ms"/> comma <break time="150ms"/>',"|":'<break time="150ms"/>Vertical bar<break time="150ms"/>',"(":'<break time="150ms"/>Open paren. <break time="150ms"/>',")":'<break time="150ms"/> Close paren. <break time="150ms"/>',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\pm":"plus or minus","\\mp":"minus or plus","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","\\ne":"is not equal to ","\\neq":"is not equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","\u200B":"","\u2212":"minus ",":":'<break time="150ms"/> such that <break time="200ms"/> ',"\\colon":'<break time="150ms"/> such that <break time="200ms"/> ',"\\hbar":"etch bar ","\\iff":'<break time="200ms"/>if, and only if, <break time="200ms"/>',"\\Longleftrightarrow":'<break time="200ms"/>if, and only if, <break time="200ms"/>',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set <break time="150ms"/><say-as interpret-as="character">n</say-as>',"\\C":'the set <break time="150ms"/><say-as interpret-as="character">c</say-as>',"\\Z":'the set <break time="150ms"/><say-as interpret-as="character">z</say-as>',"\\Q":'the set <break time="150ms"/><say-as interpret-as="character">q</say-as>',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdot":"times ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lparen":'<break time="150ms"/>open paren<break time="150ms"/>',"\\rparen":'<break time="150ms"/>close paren<break time="150ms"/>',"\\lbrace":'<break time="150ms"/>open brace<break time="150ms"/>',"\\{":'<break time="150ms"/>open brace<break time="150ms"/>',"\\rbrace":'<break time="150ms"/>close brace<break time="150ms"/>',"\\}":'<break time="150ms"/>close brace<break time="150ms"/>',"\\langle":'<break time="150ms"/>left angle bracket<break time="150ms"/>',"\\rangle":'<break time="150ms"/>right angle bracket<break time="150ms"/>',"\\lfloor":'<break time="150ms"/>open floor<break time="150ms"/>',"\\rfloor":'<break time="150ms"/>close floor<break time="150ms"/>',"\\lceil":'<break time="150ms"/>open ceiling<break time="150ms"/>',"\\rceil":'<break time="150ms"/>close ceiling<break time="150ms"/>',"\\vert":'<break time="150ms"/>vertical bar<break time="150ms"/>',"\\mvert":'<break time="150ms"/>divides<break time="150ms"/>',"\\lvert":'<break time="150ms"/>left vertical bar<break time="150ms"/>',"\\rvert":'<break time="150ms"/>right vertical bar<break time="150ms"/>',"\\lbrack":'<break time="150ms"/> open square bracket <break time="150ms"/>',"\\rbrack":'<break time="150ms"/> close square bracket <break time="150ms"/>',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"},Qh={array:"array",matrix:"matrix",pmatrix:"parenthesis matrix",bmatrix:"square brackets matrix",Bmatrix:"braces matrix",vmatrix:"bars matrix",Vmatrix:"double bars matrix","matrix*":"matrix",smallmatrix:"small matrix"};function zg(e){let t="";return e.startsWith("\\")&&(t=" "+e.replace("\\","")+" "),t}function ju(e){let t=0;if(o(e))for(const r of e)r.type!=="first"&&(t+=1);return t===1}function Hg(e){if(o(e)){for(const t of e)if(t.type!=="first"&&t.id)return t.id.toString()}return""}function yp(e){let t="";if(o(e))for(const r of e)r.type!=="first"&&typeof r.value=="string"&&(t+=r.value);return t}function Ug(e){return e?e.map(t=>t.value).join(""):""}function fr(e,t){var r,a,b,L,N;function J(pe){return window.MathfieldElement.textToSpeechMarkup?/[a-z]/.test(pe)?` <say-as interpret-as="character">${pe}</say-as>`:/[A-Z]/.test(pe)?`capital <say-as interpret-as="character">${pe.toLowerCase()}</say-as>`:pe:/[a-z]/.test(pe)?" '"+pe.toUpperCase()+"'":/[A-Z]/.test(pe)?" 'capital "+pe.toUpperCase()+"'":pe}function ie(pe){return"<emphasis>"+pe+"</emphasis>"}if(!t)return"";let ue="";if(o(t)){let pe=!1,Ee=!1;for(let De=0;De<t.length;De++)t[De].type!=="first"&&(t[De].mode!=="text"&&(Ee=!1),De<t.length-2&&t[De].type==="mopen"&&t[De+2].type==="mclose"&&t[De+1].type==="mord"?(ue+=" of ",ue+=ie(fr(e,t[De+1])),De+=2):t[De].mode==="text"?Ee?ue+=(r=t[De].value)!=null?r:" ":(Ee=!0,ue+=fr("text",t[De])):t[De].isDigit()?pe?ue+=t[De].asDigit():(pe=!0,ue+=fr(e,t[De])):(pe=!1,ue+=fr(e,t[De])))}else if(t.mode==="text")t.id&&e==="math"&&(ue+='<mark name="'+t.id.toString()+'"/>'),ue+=t.value;else{t.id&&e==="math"&&(ue+='<mark name="'+t.id.toString()+'"/>');let pe="",Ee="",De="",je=!1;const{command:ze}=t;switch(ze){case"\\vec":return"vector "+fr(e,t.body);case"\\acute":return fr(e,t.body)+" acute";case"\\grave":return fr(e,t.body)+" grave";case"\\dot":return"dot over"+fr(e,t.body);case"\\ddot":return"double dot over"+fr(e,t.body);case"\\mathring":return"ring over"+fr(e,t.body);case"\\tilde":case"\\widetilde":return"tilde over"+fr(e,t.body);case"\\bar":return fr(e,t.body)+" bar";case"\\breve":return fr(e,t.body)+" breve";case"\\check":case"\\widecheck":return"check over "+fr(e,t.body);case"\\hat":case"\\widehat":return"hat over"+fr(e,t.body);case"\\overarc":case"\\overparen":case"\\wideparen":return"arc over "+fr(e,t.body);case"\\underarc":case"\\underparen":return"arc under "+fr(e,t.body)}switch(t.type){case"prompt":const Je=t.body.length>1?'start input . <break time="500ms"/> '+fr(e,t.body)+'. <break time="500ms"/> end input':"blank";ue+=' <break time="300ms"/> '+Je+'. <break time="700ms"/>'+((a=t.correctness)!=null?a:"")+' . <break time="700ms"/> ';break;case"array":const pt=t.array,Xe=t.environmentName;if(Object.keys(Qh).includes(Xe)){ue+=` begin ${Qh[Xe]} `;for(let ct=0;ct<pt.length;ct++){ct>0&&(ue+=","),ue+=` row ${ct+1} `;for(let Dt=0;Dt<pt[ct].length;Dt++)Dt>0&&(ue+=","),ue+=` column ${Dt+1}: `,ue+=fr("math",pt[ct][Dt])}ue+=` end ${Qh[Xe]} `}break;case"group":ze==="\\ne"?ue+=" not equal ":(ze==="\\not"&&(ue+=" not "),ue+=fr("math",t.body));break;case"root":ue+=fr("math",t.body);break;case"genfrac":if(pe=fr("math",t.above),Ee=fr("math",t.below),ju(t.above)&&ju(t.below)){const Dt={"1/2":" half ","1/3":" one third ","2/3":" two third","1/4":" one quarter ","3/4":" three quarter ","1/5":" one fifth ","2/5":" two fifths ","3/5":" three fifths ","4/5":" four fifths ","1/6":" one sixth ","5/6":" five sixths ","1/8":" one eight ","3/8":" three eights ","5/8":" five eights ","7/8":" seven eights ","1/9":" one ninth ","2/9":" two ninths ","4/9":" four ninths ","5/9":" five ninths ","7/9":" seven ninths ","8/9":" eight ninths "}[yp(t.above)+"/"+yp(t.below)];Dt?ue=Dt:ue+=pe+" over "+Ee}else ue+=' the fraction <break time="150ms"/>'+pe+' over <break time="150ms"/>'+Ee+'.<break time="150ms"/> End fraction.<break time="150ms"/>';break;case"surd":if(De=fr("math",t.body),t.hasEmptyBranch("above"))ue+=ju(t.body)?" the square root of "+De+" , ":' the square root of <break time="200ms"/>'+De+'. <break time="200ms"/> End square root';else{let ct=fr("math",t.above);ct=ct.trim();const Dt=ct.replace(/<mark([^/]*)\/>/g,"");Dt==="3"?ue+=' the cube root of <break time="200ms"/>'+De+'. <break time="200ms"/> End cube root':Dt==="n"?ue+=' the nth root of <break time="200ms"/>'+De+'. <break time="200ms"/> End root':ue+=' the root with index: <break time="200ms"/>'+ct+', of <break time="200ms"/>'+De+'. <break time="200ms"/> End root'}break;case"leftright":{const ct=t;ue+=(b=ct.leftDelim?Mc[ct.leftDelim]:void 0)!=null?b:ct.leftDelim,ue+=fr("math",t.body),ue+=(L=ct.rightDelim?Mc[ct.rightDelim]:void 0)!=null?L:ct.rightDelim}break;case"rule":break;case"overunder":break;case"overlap":break;case"macro":const ot=ze.replace(/^\\/g,""),gt=We()[ot];gt&&(gt!=null&&gt.expand?ue+=fr("math",t.body):ue+=`${ot} `);break;case"placeholder":ue+="placeholder ";break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":{if(ze==="\\mathbin"||ze==="\\mathrel"||ze==="\\mathopen"||ze==="\\mathclose"||ze==="\\mathpunct"||ze==="\\mathord"||ze==="\\mathinner"){ue=fr(e,t.body);break}let ct=t.isDigit()?t.asDigit():t.value,Dt=t.command;if((t.type==="delim"||t.type==="sizeddelim")&&(Dt=t.value,ct=Dt),e==="text")ue+=ct;else{if(t.type==="mbin"&&(ue+='<break time="150ms"/>'),ct){const Bt=Mc[ct]||(Dt?Mc[Dt.trim()]:"");if(Bt)ue+=" "+Bt;else{const Rt=Dt?zg(Dt.trim()):"";ue+=Rt||J(ct)}}else ue+=fr("math",t.body);t.type==="mbin"&&(ue+='<break time="150ms"/>')}break}case"mop":case"operator":case"extensible-symbol":if(t.value!=="\u200B"){const ct=t.command;if(ct==="\\sum")if(!t.hasEmptyBranch("superscript")&&!t.hasEmptyBranch("subscript")){let Dt=fr("math",t.superscript);Dt=Dt.trim();let Bt=fr("math",t.subscript);Bt=Bt.trim(),ue+=' the summation from <break time="200ms"/>'+Bt+'<break time="200ms"/> to <break time="200ms"/>'+Dt+'<break time="200ms"/> of <break time="150ms"/>',je=!0}else if(t.hasEmptyBranch("subscript"))ue+=" the summation of";else{let Dt=fr("math",t.subscript);Dt=Dt.trim(),ue+=' the summation from <break time="200ms"/>'+Dt+'<break time="200ms"/> of <break time="150ms"/>',je=!0}else if(ct==="\\prod")if(!t.hasEmptyBranch("superscript")&&!t.hasEmptyBranch("subscript")){let Dt=fr("math",t.superscript);Dt=Dt.trim();let Bt=fr("math",t.subscript);Bt=Bt.trim(),ue+=' the product from <break time="200ms"/>'+Bt+'<break time="200ms"/> to <break time="200ms"/>'+Dt+'<break time="200ms"/> of <break time="150ms"/>',je=!0}else if(t.hasEmptyBranch("subscript"))ue+=" the product of ";else{let Dt=fr("math",t.subscript);Dt=Dt.trim(),ue+=' the product from <break time="200ms"/>'+Dt+'<break time="200ms"/> of <break time="150ms"/>',je=!0}else if(ct==="\\int")if(!t.hasEmptyBranch("superscript")&&!t.hasEmptyBranch("subscript")){let Dt=fr("math",t.superscript);Dt=Dt.trim();let Bt=fr("math",t.subscript);Bt=Bt.trim(),ue+=' the integral from <break time="200ms"/>'+ie(Bt)+'<break time="200ms"/> to <break time="200ms"/>'+ie(Dt)+' <break time="200ms"/> of ',je=!0}else ue+=' the integral of <break time="200ms"/> ';else if(typeof t.value=="string"){const Dt=(N=Mc[t.value])!=null?N:t.command?Mc[t.command]:void 0;ue+=Dt||" "+t.value}else t.command&&(t.command==="\\mathop"?ue+=fr("math",t.body):t.command==="\\operatorname"?ue+=Ug(t.body):ue+=t.command.startsWith("\\")?" "+t.command.slice(1):" "+t.command)}break;case"enclose":De=fr("math",t.body),ue+=" crossed out "+De+". End crossed out.";break;case"space":case"spacing":break}if(!je&&!t.hasEmptyBranch("superscript")){let Je=fr(e,t.superscript);Je=Je.trim();const pt=Je.replace(/<[^>]*>/g,"");if(ju(t.superscript)){if(e==="math"){const Xe=Hg(t.superscript);Xe&&(ue+='<mark name="'+Xe+'"/>')}pt==="\u2032"?ue+=" prime ":pt==="2"?ue+=" squared ":pt==="3"?ue+=" cubed ":Number.isNaN(Number.parseInt(pt))?ue+=" to the "+Je+"; ":ue+=' to the <say-as interpret-as="ordinal">'+pt+"</say-as> power; "}else Number.isNaN(Number.parseInt(pt))?ue+=" raised to the "+Je+"; ":ue+=' raised to the <say-as interpret-as="ordinal">'+pt+"</say-as> power; "}if(!je&&!t.hasEmptyBranch("subscript")){let Je=fr("math",t.subscript);Je=Je.trim(),ue+=ju(t.subscript)?" sub "+Je:" subscript "+Je+". End subscript. "}}return ue}function Tc(e){var t,r;if(window.MathfieldElement.textToSpeechRules==="sre"&&("sre"in window||"SRE"in window)){const b=Pr(e);if(b){window.MathfieldElement.textToSpeechMarkup&&(window.MathfieldElement.textToSpeechRulesOptions=(t=window.MathfieldElement.textToSpeechRulesOptions)!=null?t:{},window.MathfieldElement.textToSpeechRulesOptions=h(l({},window.MathfieldElement.textToSpeechRulesOptions),{markup:window.MathfieldElement.textToSpeechMarkup}),window.MathfieldElement.textToSpeechRulesOptions.markup==="ssml"&&(window.MathfieldElement.textToSpeechRulesOptions=h(l({},window.MathfieldElement.textToSpeechRulesOptions),{markup:"ssml_step"})),window.MathfieldElement.textToSpeechRulesOptions=h(l({},window.MathfieldElement.textToSpeechRulesOptions),{rate:window.MathfieldElement.speechEngineRate}));const L=(r=window.SRE)!=null?r:window.sre.System.getInstance();window.MathfieldElement.textToSpeechRulesOptions&&L.setupEngine(window.MathfieldElement.textToSpeechRulesOptions);let N="";try{N=L.toSpeech(b)}catch(J){console.error("MathLive 0.98.5: `SRE.toSpeech()` runtime error",J)}return N}return""}let a=fr("math",e);if(window.MathfieldElement.textToSpeechMarkup==="ssml"){let b="";window.MathfieldElement.speechEngineRate&&(b='<prosody rate="'+window.MathfieldElement.speechEngineRate+'">'),a='<?xml version="1.0"?><speak version="1.1" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="en-US"><amazon:auto-breaths>'+b+"<p><s>"+a+"</s></p>"+(b?"</prosody>":"")+"</amazon:auto-breaths></speak>"}else window.MathfieldElement.textToSpeechMarkup==="mac"&&_()==="macos"?a=a.replace(/<mark([^/]*)\/>/g,"").replace(/<emphasis>/g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(/<break time="(\d*)ms"\/>/g,"[[slc $1]]").replace(/<say-as[^>]*>/g,"").replace(/<\/say-as>/g,""):a=a.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return a}var Bu={"\\ne":"\u2260","\\neq":"\u2260","\u2212":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega","\\exponentialE":"e","\\imaginaryI":"i","\\imaginaryJ":"j","\\!":" ","\\,":" ","\\:":" ","\\>":" ","\\;":" ","\\enskip":" ","\\enspace":" ","\\qquad":" ","\\quad":" ","\\infty":"oo"},Nu={"\\pm":"+-","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrack":"[","\\rbrack":"]","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"(:","\\rangle":":)","\\sum":" sum ","\\prod":" prod ","\\bigcap":" nnn ","\\bigcup":" uuu ","\\int":" int ","\\oint":" oint ","\\ge":">=","\\le":"<=","\\ne":"!=","\\neq":"!=","\\lt":"<","\\gt":">","\\gets":"<-","\\to":"->","\\land":" and ","\\lor":" or ","\\lnot":" not ","\\forall":" AA ","\\exists":" EE ","\\in":" in ","\\notin":" !in ","\\mapsto":"|->","\\implies":"=>","\\iff":"<=>","\\cdot":"*","\\ast":"**","\\star":"***","\\times":"xx","\\div":"-:","\\ltimes":"|><","\\rtimes":"><|","\\bowtie":"|><|","\\circ":"@"};function Wg(e){let t="";for(const r of e){const a=t[t.length-1];a!==void 0&&/\d/.test(a)&&/^\d/.test(r)&&(t+=" "),t+=r}return t}function Mn(e){var t,r,a,b,L,N,J,ie,ue,pe,Ee,De,je;if(!e)return"";if(o(e)){if(e.length===0)return"";if(e[0].mode==="latex")return e.map(Mn).join("");if(e[0].mode==="text"){let gt=0,ct="";for(;((t=e[gt])==null?void 0:t.mode)==="text";)ct+=e[gt].body?Mn(e[gt].body):e[gt].value,gt++;return`"${ct}" ${Mn(e.slice(gt))}`}let Xe=0;const ot=[];for(;e[Xe]&&e[Xe].mode==="math";){let gt="";for(;e[Xe]&&e[Xe].type==="mord"&&/\d/.test(e[Xe].value);)gt+=e[Xe++].value;gt?ot.push(gt):ot.push(Mn(e[Xe++]))}return ot.push(Mn(e.slice(Xe))),Wg(ot)}if(e.mode==="text")return`"${e.value}"`;let ze="";const{command:Je}=e;let pt;if(Je==="\\placeholder")return`(${Mn(e.body)})`;switch(e.type){case"accent":const Xe={"\\vec":"vec","\\dot":"dot","\\ddot":"ddot","\\bar":"bar","\\hat":"hat","\\acute":"acute;","\\grave":"grave","\\tilde":"tilde","\\breve":"breave","\\check":"check"}[Je];ze=`${Xe!=null?Xe:""} ${Mn(e.body)} `;break;case"first":return"";case"latexgroup":return e.body.map(Rt=>Rt.value).join("");case"group":case"root":ze=(r=Bu[Je])!=null?r:Mn(e.body);break;case"genfrac":{const Rt=e;(Rt.leftDelim||Rt.rightDelim)&&(ze=Rt.leftDelim==="."||!Rt.leftDelim?"{:":Rt.leftDelim),Rt.hasBarLine?(ze+="(",ze+=Mn(Rt.above),ze+=")/(",ze+=Mn(Rt.below),ze+=")"):(ze+="("+Mn(Rt.above)+"),",ze+="("+Mn(Rt.below)+")"),(Rt.leftDelim||Rt.rightDelim)&&(ze+=Rt.rightDelim==="."||!Rt.rightDelim?"{:":Rt.rightDelim)}break;case"surd":ze+=e.hasEmptyBranch("above")?"sqrt("+Mn(e.body)+")":"root("+Mn(e.above)+")("+Mn(e.body)+")";break;case"latex":ze=e.value;break;case"leftright":{const Rt=e,br=Rt.leftDelim;ze+=br==="."||!br?"{:":br,ze+=Mn(Rt.body);const Gr=Rt.matchingRightDelim();ze+=Gr==="."||!Gr?":}":Gr}break;case"sizeddelim":case"delim":ze=e.value;break;case"overlap":break;case"overunder":break;case"mord":ze=(b=(a=Bu[Je])!=null?a:Je)!=null?b:typeof e.value=="string"?e.value:"",ze.startsWith("\\")&&(ze+=" "),pt=Je?Je.match(/{?\\char"([\dabcdefABCDEF]+)}?/):null,pt?ze=String.fromCodePoint(Number.parseInt("0x"+pt[1])):ze.length>0&&ze.startsWith("\\")&&(ze=typeof e.value=="string"?e.value.charAt(0):e.command),ze=Kg(ze,e.style);break;case"mbin":case"mrel":case"minner":ze=(N=(L=Bu[Je])!=null?L:Nu[Je])!=null?N:e.value;break;case"mopen":case"mclose":ze=e.value;break;case"mpunct":ze=(J=Nu[Je])!=null?J:Je;break;case"mop":case"operator":case"extensible-symbol":e.value!=="\u200B"&&(Nu[Je]?ze=Nu[Je]:ze=Je==="\\operatorname"?Mn(e.body):(ie=e.value)!=null?ie:Je,ze+=" ");break;case"array":const ot=e.array,gt=e.environmentName,ct=(ue={bmatrix:["[","]"],"bmatrix*":["[","]"]}[gt])!=null?ue:["(",")"],Dt=[];for(const Rt of ot){const br=[];for(const Gr of Rt)br.push(ct[0]+Mn(Gr)+ct[1]);Dt.push(br.join(","))}const Bt=(pe={bmatrix:["[","]"],"bmatrix*":["[","]"],cases:["{",":}"]}[gt])!=null?pe:["(",")"];ze=Bt[0]+Dt.join(",")+Bt[1];break;case"box":break;case"spacing":ze=(Ee=Bu[Je])!=null?Ee:" ";break;case"enclose":ze="("+Mn(e.body)+")";break;case"space":ze=" ";break;case"subsup":ze="";break;case"macro":ze=(je=(De=Bu[Je])!=null?De:Nu[Je])!=null?je:Mn(e.body);break}if(!e.hasEmptyBranch("subscript")){ze+="_";const Xe=Mn(e.subscript);ze+=Xe.length!==1?`(${Xe})`:Xe}if(!e.hasEmptyBranch("superscript")){ze+="^";const Xe=Mn(e.superscript);ze+=Xe.length!==1?`(${Xe})`:Xe}return ze}function Kg(e,t){if(!t)return e;let r=e;return t.variant==="double-struck"&&(r=`bbb "${r}"`),t.variant==="script"&&(r=`cc "${r}"`),t.variant==="fraktur"&&(r=`fr "${r}"`),t.variant==="sans-serif"&&(r=`sf "${r}"`),t.variant==="monospace"&&(r=`tt "${r}"`),t.variantStyle==="bold"&&(r=`bb "${r}"`),t.color?`color({${t.color}})(${r})`:r}function oi(e,t){var r,a;t!=null||(t={}),t.mathstyle=(r=t.mathstyle)!=null?r:"displaystyle";const b=new gr({from:h(l({},lc()),{renderPlaceholder:()=>new mt(160,{maxFontSize:1}),letterShapeStyle:(a=t==null?void 0:t.letterShapeStyle)!=null?a:"tex"}),mathstyle:t.mathstyle}),N=new et({mode:"math",type:"root",body:ii(e,{context:b,parseMode:"math",mathstyle:t.mathstyle})}).render(b);return N?(oc(xu(N,b)),sc(N,{classes:"ML__latex"}).toMarkup()):""}function jv(e){return ud(e,{context:lc()})}function $g(e,t={}){return Pr(ii(e,{parseMode:"math",args:()=>"",mathstyle:"displaystyle"}),t)}function Gg(e){const t=ii(e,{parseMode:"math",mathstyle:"displaystyle"});return Tc(t)}var sh;function Vg(e){var t,r;if(!sh){const a=(t=globalThis[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:t.ComputeEngine;a?sh=new a:console.error(`MathLive 0.98.5: The CortexJS Compute Engine library is not available.
Load the library, for example with:
import "https://unpkg.com/@cortex-js/compute-engine?module"`)}return(r=sh==null?void 0:sh.box(e).latex)!=null?r:""}function Bv(e,t="math"){return Mn(new et({type:"root",body:ii(e,{parseMode:t})}))}function Nv(e){return bl(e,{format:"ascii-math"})[1]}function ed(e){if(typeof e=="string"){const t=Xg(e);if(!t)throw new Error(`Invalid color: ${e}`);return t}return"C"in e?Zg(e):"a"in e?bp(e):e}function Ac(e){return e<0?0:e>255?255:Math.round(e)}function Xg(e){if(!e||e[0]!=="#")return;e=e.slice(1);let t;return e.length<=4?(t={r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16)},e.length===4&&(t.a=parseInt(e[3]+e[3],16)/255)):(t={r:parseInt(e[0]+e[1],16),g:parseInt(e[2]+e[3],16),b:parseInt(e[4]+e[5],16)},e.length===8&&(t.a=parseInt(e[6]+e[7],16)/255)),t&&typeof t.a=="undefined"&&(t.a=1),t}function td(e){const[t,r,a]=[e.L,e.C,e.H],b=a*Math.PI/180,L={L:t,a:r*Math.cos(b),b:r*Math.sin(b)};return e.alpha!==void 0&&(L.alpha=e.alpha),L}function Yg(e){const[t,r,a]=[e.L,e.a,e.b],b=Math.sqrt(r*r+a*a),N=Math.atan2(a,r)*180/Math.PI,J={L:t,C:b,H:N};return e.alpha!==void 0&&(J.alpha=e.alpha),J}function rd(e){const[t,r,a]=[e.L,e.a,e.b],b=Math.pow(.9999999984505198*t+.39633779217376786*r+.2158037580607588*a,3),L=Math.pow(1.00000000888176*t-.10556134232365635*r-.0638541747717059*a,3),N=Math.pow(t*1.000000054672411-.0894841820949657*r-1.2914855378640917*a,3),J=4.076741661347994*b-3.307711590408193*L+.230969928729428*N,ie=-1.2684380040921763*b+2.6097574006633715*L-.3413193963102197*N,ue=-.004196086541837188*b-.7034186144594493*L+1.7076147009309444*N,pe=Ee=>{const De=Math.abs(Ee);return De<=.0031308?Ee*12.92:(Math.sign(Ee)||1)*(1.055*Math.pow(De,1/2.4)-.055)};return[pe(J),pe(ie),pe(ue)]}function nd(e){const[t,r,a]=e;return t>=0&&t<=1&&r>=0&&r<=1&&a>=0&&a<=1}function id(e,t){let[r,a,b]=e;return r=Ac(r*255),a=Ac(a*255),b=Ac(b*255),t!==void 0?{r,g:a,b,alpha:t}:{r,g:a,b}}function bp(e){let[t,r,a]=rd(e);if(nd([t,r,a]))return id([t,r,a],e.alpha);const b=Yg(e);if(b.C=0,[t,r,a]=rd(td(b)),!nd([t,r,a]))return id([t,r,a],e.alpha);let L=0,N=e.L,J=(L+N)/2;b.C=J;const ie=.36/Math.pow(2,12);for(;N-L>ie;)J=(L+N)/2,b.C=J,[t,r,a]=rd(td(b)),nd([t,r,a])?L=J:N=J;return id([t,r,a],e.alpha)}function Zg(e){return bp(td(e))}function _p(e,t){const r=ed(e),a=ed(t),b=.56,L=.57,N=.62,J=.65,ie=.022,ue=1.414,pe=.1,Ee=5e-4,De=1.14,je=.027,ze=1.14,Je=.027;function pt(Rt){return Rt>=ie?Rt:Rt+$s(ie-Rt,ue)}function Xe(Rt){return(Rt<0?-1:1)*Math.pow(Math.abs(Rt),2.4)}const ot=pt(Xe(a.r/255)*.2126729+Xe(a.g/255)*.7151522+Xe(a.b/255)*.072175),gt=pt(Xe(r.r/255)*.2126729+Xe(r.g/255)*.7151522+Xe(r.b/255)*.072175);let ct,Dt,Bt;return Math.abs(gt-ot)<Ee?Dt=0:gt>ot?(ct=$s(gt,b)-$s(ot,L),Dt=ct*De):(ct=$s(gt,J)-$s(ot,N),Dt=ct*ze),Math.abs(Dt)<pe?Bt=0:Dt>0?Bt=Dt-Je:Bt=Dt+je,Bt*100}function wp(e,t,r){r!=null||(r="#fff"),t!=null||(t="#000");const a=_p(e,r),b=_p(e,t);return Math.abs(a)>Math.abs(b)?r:t}function Jg(e){const t=ed(e);let r=((1<<24)+(Ac(t.r)<<16)+(Ac(t.g)<<8)+Ac(t.b)).toString(16).slice(1);return t.alpha!==void 0&&t.alpha<1&&(r+=("00"+Math.round(t.alpha*255).toString(16)).slice(-2)),r[0]===r[1]&&r[2]===r[3]&&r[4]===r[5]&&r[6]===r[7]&&(r=r[0]+r[2]+r[4]+(t.alpha!==void 0&&t.alpha<1?r[6]:"")),"#"+r}function fn(e){const t=xp(e);let r="";for(const a of t){if(typeof a.value!="string")return"";r+=a.value}return r}function xp(e){const r=e.model.selection.ranges;return r.length!==1?[]:e.model.getAtoms(r[0])}function qg(e,t){const r=xp(e);if(r.length!==1)return!1;const a=Sh[t];return a?!!a.test(r[0].value):!1}function Qg(e,t){return fn(e).length>0}function ev(e){return[od(e,"double-struck","mathbb","tooltip.blackboard"),od(e,"fraktur","mathfrak","tooltip.fraktur"),od(e,"calligraphic","mathcal","tooltip.caligraphic"),sd(e,"up","mathrm","tooltip.roman-upright"),sd(e,"bold","mathbf","tooltip.bold"),sd(e,"italic","mathit","tooltip.italic")]}function tv(e){return[{label:()=>oi(`\\vec{${fn(e)}}`),visible:()=>fn(e).length===1,onMenuSelect:()=>e.insert("\\vec{#@}",{selectionMode:"item"})},{label:()=>oi(`\\overrightarrow{${fn(e)}}`),visible:()=>fn(e).length>0,onMenuSelect:()=>e.insert("\\overrightarrow{#@}",{selectionMode:"item"})},{label:()=>oi(`\\overleftarrow{${fn(e)}}`),visible:()=>fn(e).length>0,onMenuSelect:()=>e.insert("\\overleftarrow{#@}",{selectionMode:"item"})},{label:()=>oi(`\\dot{${fn(e)}}`),visible:()=>fn(e).length===1,onMenuSelect:()=>e.insert("\\dot{#@}",{selectionMode:"item"})},{label:()=>oi(`\\ddot{${fn(e)}}`),visible:()=>fn(e).length===1,onMenuSelect:()=>e.insert("\\ddot{#@}",{selectionMode:"item"})},{label:()=>oi(`\\bar{${fn(e)}}`),visible:()=>fn(e).length===1,onMenuSelect:()=>e.insert("\\bar{#@}",{selectionMode:"item"})},{label:()=>oi(`\\overline{${fn(e)}}`),visible:()=>fn(e).length>0,onMenuSelect:()=>e.insert("\\overline{#@}",{selectionMode:"item"})},{label:()=>oi(`\\overgroup{${fn(e)}}`),visible:()=>fn(e).length>0,onMenuSelect:()=>e.insert("\\overgroup{#@}",{selectionMode:"item"})},{label:()=>oi(`\\overbrace{${fn(e)}}`),visible:()=>fn(e).length>0,onMenuSelect:()=>e.insert("\\overbrace{#@}",{selectionMode:"item"})},{label:()=>oi(`\\underline{${fn(e)}}`),visible:()=>fn(e).length>0,onMenuSelect:()=>e.insert("\\underline{#@}",{selectionMode:"item"})},{label:()=>oi(`\\undergroup{${fn(e)}}`),visible:()=>fn(e).length>0,onMenuSelect:()=>e.insert("\\undergroup{#@}",{selectionMode:"item"})},{label:()=>oi(`\\underbrace{${fn(e)}}`),visible:()=>fn(e).length>0,onMenuSelect:()=>e.insert("\\underbrace{#@}",{selectionMode:"item"})}]}function rv(e){return[{label:()=>oi(`\\boxed{${e.getValue(e.model.selection)}}}`),onMenuSelect:()=>e.insert("\\boxed{#@}",{selectionMode:"item"})},{label:()=>oi(`\\bbox[5px, border: 2px solid red]{${e.getValue(e.model.selection)}}`),onMenuSelect:()=>e.insert("\\bbox[5px, border: 2px solid red]{#@}",{selectionMode:"item"})},{label:()=>oi(`\\bbox[5px, border: 2px dashed black]{${e.getValue(e.model.selection)}}`),onMenuSelect:()=>e.insert("\\bbox[5px, border: 2px dashed black]{#@}",{selectionMode:"item"})}]}function nv(e){const t=[];for(const r of Object.keys(F))t.push({class:(Jg(wp(F[r]))==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${F[r]} "></span>`,ariaLabel:()=>{var a;return(a=A(r))!=null?a:r},checked:()=>{var a;return{some:"mixed",all:!0}[(a=e.queryStyle({backgroundColor:r}))!=null?a:!1]},onMenuSelect:()=>{e.applyStyle({backgroundColor:r},{operation:"toggle"}),e.adoptStyle="none"}});return t}function iv(e){const t=[];for(const r of Object.keys(D))t.push({class:(wp(D[r])==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${D[r]} "></span>`,ariaLabel:()=>{var a;return(a=A(r))!=null?a:r},checked:()=>{var a;return{some:"mixed",all:!0}[(a=e.queryStyle({color:r}))!=null?a:!1]},onMenuSelect:()=>{e.applyStyle({color:r},{operation:"toggle"}),e.adoptStyle="none"}});return t}var ov=class extends cp{constructor(e,t,r,a){super(e,t),this.row=r,this.col=a}set active(e){const t=this.parentMenu.children;if(e)for(const r of t)r.element.classList.toggle("active",r.row<=this.row&&r.col<=this.col);else for(const r of t)r.element.classList.remove("active")}};function sv(e){const t=[];for(let r=1;r<=5;r++)for(let a=1;a<=5;a++)t.push({onCreate:(b,L)=>new ov(b,L,r,a),label:"\u2610",tooltip:()=>A("tooltip.row-by-col",r,a),data:{row:r,col:a},onMenuSelect:()=>{e.insert(`\\begin{pmatrix}${Array(r).fill(Array(a).fill("#?").join(" & ")).join("\\\\")}\\end{pmatrix}`,{selectionMode:"item"})}});return t}function av(e){return[{label:()=>A("menu.array.add row above"),id:"add-row-above",onMenuSelect:()=>e.executeCommand("addRowBefore"),visible:()=>Dl(e)},{label:()=>A("menu.array.add row below"),id:"add-row-below",onMenuSelect:()=>e.executeCommand("addRowAfter"),visible:()=>Dl(e)},{label:()=>A("menu.array.add column before"),id:"add-column-before",onMenuSelect:()=>e.executeCommand("addColumnBefore"),visible:()=>Dl(e),enabled:()=>{const t=e.model.parentEnvironment;if(!t)return!1;const[r,a]=cv(e);return r<t.maxColumns}},{label:()=>A("menu.array.add column after"),id:"add-column-after",onMenuSelect:()=>e.executeCommand("addColumnAfter"),visible:()=>Dl(e)},{type:"divider"},{label:()=>A("menu.array.delete row"),id:"delete-row",onMenuSelect:()=>e.executeCommand("removeRow"),visible:()=>Dl(e)},{label:()=>A("menu.array.delete column"),id:"delete-column",onMenuSelect:()=>e.executeCommand("removeColumn"),visible:()=>Dl(e)},{type:"divider"},{label:()=>A("menu.borders"),visible:()=>(lv(e)||Dl(e))&&e.isSelectionEditable,submenu:[{label:" \u22F1 ",id:"environment-no-border",onMenuSelect:()=>Fu(e,"matrix")},{label:"(\u22F1)",id:"environment-parentheses",onMenuSelect:()=>Fu(e,"pmatrix")},{label:"[\u22F1]",id:"environment-brackets",onMenuSelect:()=>Fu(e,"bmatrix")},{label:"|\u22F1|",id:"environment-bar",onMenuSelect:()=>Fu(e,"vmatrix")},{label:"{\u22F1}",id:"environment-braces",onMenuSelect:()=>Fu(e,"Bmatrix")}],submenuClass:"border-submenu"},{type:"divider"},{label:()=>A("menu.insert matrix"),id:"insert-matrix",visible:()=>e.isSelectionEditable,submenu:sv(e),submenuClass:"insert-matrix-submenu",columnCount:5},{label:()=>A("menu.mode"),id:"mode",visible:()=>e.isSelectionEditable&&e.model.selectionIsCollapsed,submenu:[{label:()=>A("menu.mode-math"),id:"mode-math",onMenuSelect:()=>{yc(e,"accept-all"),e.executeCommand(["switchMode","math"])},checked:()=>e.model.mode==="math"},{label:()=>A("menu.mode-text"),id:"mode-text",onMenuSelect:()=>{yc(e,"accept-all"),e.executeCommand(["switchMode","text"])},checked:()=>e.model.mode==="text"},{label:()=>A("menu.mode-latex"),id:"mode-latex",onMenuSelect:()=>e.executeCommand(["switchMode","latex"]),checked:()=>e.model.mode==="latex"}]},{type:"divider"},{label:()=>A("menu.font-style"),id:"variant",visible:()=>e.isSelectionEditable,submenu:ev(e),submenuClass:"variant-submenu"},{label:()=>A("menu.color"),id:"color",visible:()=>e.isSelectionEditable,submenu:iv(e),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>A("menu.background-color"),id:"background-color",visible:()=>e.isSelectionEditable,submenu:nv(e),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>A("menu.accent"),id:"accent",visible:()=>e.isSelectionEditable,submenu:tv(e),submenuClass:"variant-submenu"},{label:()=>A("menu.decoration"),id:"decoration",visible:()=>e.isSelectionEditable&&fn(e).length>0,submenu:rv(e),submenuClass:"variant-submenu"},{type:"divider"},{label:()=>A("menu.evaluate"),id:"ce-evaluate",visible:()=>e.isSelectionEditable&&window.MathfieldElement.computeEngine!==null,onMenuSelect:()=>{const t=uv(e);if(!t){e.model.announce("plonk");return}e.model.selectionIsCollapsed?(e.model.position=e.model.lastOffset,e.insert(`=${t}`,{insertionMode:"insertAfter",selectionMode:"item"})):e.insert(t,{insertionMode:"replaceSelection",selectionMode:"item"})}},{label:()=>A("menu.simplify"),id:"ce-simplify",visible:()=>e.isSelectionEditable&&window.MathfieldElement.computeEngine!==null,onMenuSelect:()=>{var t,r;if(e.model.selectionIsCollapsed){const a=(t=e.expression)==null?void 0:t.simplify();if(e.model.position=e.model.lastOffset,!a){e.model.announce("plonk");return}e.insert(`=${a.latex}`,{insertionMode:"insertAfter",selectionMode:"item"})}else{const a=(r=window.MathfieldElement.computeEngine)==null?void 0:r.parse(e.getValue(e.model.selection)).simplify();if(!a){e.model.announce("plonk");return}e.insert(a.latex,{insertionMode:"replaceSelection",selectionMode:"item"})}}},{label:()=>{var t;if(window.MathfieldElement.computeEngine===null)return"";const r=(t=e.expression)==null?void 0:t.unknowns[0];return r?A("menu.solve-for",oi(r)):A("menu.solve")},id:"ce-solve",visible:()=>{var t;return e.isSelectionEditable&&window.MathfieldElement.computeEngine!==null&&((t=e.expression)==null?void 0:t.unknowns.length)===1&&e.expression.unknowns[0]!=="Nothing"},onMenuSelect:()=>{var t;const r=e.expression,a=r==null?void 0:r.unknowns[0],b=(t=r.solve(a))==null?void 0:t.map(L=>{var N;return(N=L.simplify().latex)!=null?N:""});if(!b){e.model.announce("plonk");return}e.insert(`${a}=${b.length===1?b[0]:"\\left\\lbrace"+(b==null?void 0:b.join(", "))+"\\right\\rbrace"}`,{insertionMode:"replaceAll",selectionMode:"item"})}},{type:"divider"},{label:()=>A("menu.cut"),onMenuSelect:()=>e.executeCommand("cutToClipboard"),visible:()=>!e.options.readOnly&&e.isSelectionEditable,keyboardShortcut:"meta+X"},{label:()=>A("menu.copy"),id:"copy",submenu:[{label:()=>A("menu.copy-as-latex"),id:"copy-latex",onMenuSelect:()=>Xt.copyToClipboard(e,"latex"),keyboardShortcut:"meta+C"},{label:()=>A("menu.copy-as-ascii-math"),id:"copy-ascii-math",onMenuSelect:()=>Xt.copyToClipboard(e,"ascii-math")},{label:()=>A("menu.copy-as-mathml"),id:"copy-math-ml",onMenuSelect:()=>Xt.copyToClipboard(e,"math-ml")}]},{label:()=>A("menu.paste"),id:"paste",onMenuSelect:()=>e.executeCommand("pasteFromClipboard"),visible:()=>e.hasEditableContent,keyboardShortcut:"meta+V"},{label:()=>A("menu.select-all"),id:"select-all",keyboardShortcut:"meta+A",onMenuSelect:()=>e.executeCommand("selectAll")}]}function Dl(e){var t;return!!((t=e.model.parentEnvironment)!=null&&t.array)}function lv(e){return e.model.at(e.model.position).type==="array"}function cv(e){var t;const r=(t=e.model.parentEnvironment)==null?void 0:t.array;return r?[r.length,r.reduce((a,b)=>Math.max(a,b.length),0)]:[0,0]}function Fu(e,t){Pf(e),e.flushInlineShortcutBuffer(),Hd(e.model,t),wn(e)}function uv(e){var t,r;let a;if(e.model.selectionIsCollapsed?a=(t=window.MathfieldElement.computeEngine)==null?void 0:t.parse(e.getValue(),{canonical:!1}):a=(r=window.MathfieldElement.computeEngine)==null?void 0:r.parse(e.getValue(e.model.selection),{canonical:!1}),!a)return"";let b=a.evaluate();return b.isSame(a)&&(b=a.N()),b.latex}function od(e,t,r,a){return{label:()=>oi(`\\${r}{${fn(e)}}`),tooltip:()=>{var b;return(b=A(a))!=null?b:a},visible:()=>qg(e,t),checked:()=>{var b;return{some:"mixed",all:!0}[(b=e.queryStyle({variant:t}))!=null?b:!1]},onMenuSelect:()=>{e.applyStyle({variant:t},{operation:"toggle"}),e.adoptStyle="none"}}}function sd(e,t,r,a){return{label:()=>oi(`\\${r}{${fn(e)}}`),tooltip:()=>{var b;return(b=A(a))!=null?b:a},visible:()=>Qg(e,t),checked:()=>{var b;return{some:"mixed",all:!0}[(b=e.queryStyle({variantStyle:t}))!=null?b:!1]},onMenuSelect:()=>{e.applyStyle({variantStyle:t},{operation:"toggle"}),e.adoptStyle="none"}}}function Lc(e,t){return e+Tc(t)}oo({speak:(e,t,r)=>fv(e,t,r)},{target:"mathfield"});function fv(e,t,r){var a,b;r=r!=null?r:{withHighlighting:!1};const{model:L}=e;function N(pe){let Ee=null;switch(pe){case"all":Ee=L.root;break;case"selection":Ee=L.getAtoms(L.selection);break;case"left":{Ee=L.getAtoms(L.offsetOf(L.at(L.position).leftSibling),L.position);break}case"right":{Ee=L.getAtoms(L.position,L.offsetOf(L.at(L.position).rightSibling));break}case"group":Ee=L.getAtoms(L.getSiblingsRange(L.position));break;case"parent":{const{parent:De}=L.at(L.position);De!=null&&De.parent?Ee=De:Ee=L.root;break}default:Ee=L.root}return Ee}function J(pe){let Ee="";switch(pe){case"all":console.log("Internal failure: speak all failed");break;case"selection":Ee="no selection";break;case"left":Ee="at start";break;case"right":Ee="at end";break;case"group":console.log("Internal failure: speak group failed");break;case"parent":Ee="no parent";break;default:console.log('unknown speak_ param value: "'+pe+'"');break}return Ee}const ie=N(t);if(ie===null)return(b=(a=window.MathfieldElement).speakHook)==null||b.call(a,J(t)),!1;(r.withHighlighting||window.MathfieldElement.speechEngine==="amazon")&&(window.MathfieldElement.textToSpeechMarkup=window.sre&&window.MathfieldElement.textToSpeechRules==="sre"?"ssml_step":"ssml");const ue=Tc(ie);return u()&&r.withHighlighting?(Ya().readAloudMathfield=e,Sl(e,{forHighlighting:!0}),window.MathfieldElement.readAloudHook&&window.MathfieldElement.readAloudHook(e.field,ue)):window.MathfieldElement.speakHook&&window.MathfieldElement.speakHook(ue),!1}function hv(e){var t,r;if(!u()){console.log("Speak:",e);return}if(!window.MathfieldElement.speechEngine||window.MathfieldElement.speechEngine==="local"){const a=new SpeechSynthesisUtterance(e);window.speechSynthesis.speak(a)}else if(window.MathfieldElement.speechEngine==="amazon")if(!("AWS"in window))console.error("MathLive 0.98.5: AWS SDK not loaded. See https://www.npmjs.com/package/aws-sdk");else{const a=new window.AWS.Polly({apiVersion:"2016-06-10"}),b={OutputFormat:"mp3",VoiceId:(t=window.MathfieldElement.speechEngineVoice)!=null?t:"Joanna",Engine:["Amy","Emma","Brian","Ivy","Joanna","Kendra","Kimberly","Salli","Joey","Justin","Matthew"].includes((r=window.MathfieldElement.speechEngineVoice)!=null?r:"Joanna")?"neural":"standard",Text:e,TextType:"ssml"};a.synthesizeSpeech(b,(L,N)=>{if(L)console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech()\` error: ${L}`);else if(N!=null&&N.AudioStream){const J=new Uint8Array(N.AudioStream),ie=new Blob([J.buffer],{type:"audio/mpeg"}),ue=URL.createObjectURL(ie);new Audio(ue).play().catch(Ee=>console.log(Ee))}else console.log("polly.synthesizeSpeech():",N)})}else window.MathfieldElement.speechEngine==="google"&&console.error("MathLive 0.98.5: The Google speech engine is not supported yet. Please come again.")}function Sp(e){var t;let r;if(e.parent.type==="prompt")e.parentBranch==="body"&&(r="prompt");else if(e.parentBranch==="body")r=e.type&&(t={enclose:"cross out",leftright:"delimiter",surd:"square root",root:"math field",mop:"operator",first:"first"}[e.type])!=null?t:"parent";else if(e.parent.type==="genfrac"){if(e.parentBranch==="above")return"numerator";if(e.parentBranch==="below")return"denominator"}else e.parent.type==="surd"?e.parentBranch==="above"&&(r="index"):e.parentBranch==="superscript"?r="superscript":e.parentBranch==="subscript"&&(r="subscript");return r||console.log("unknown relationship"),r!=null?r:"parent"}function dv(e,t,r,a){let b="";if(t==="plonk")window.MathfieldElement.playSound("plonk"),e.flushInlineShortcutBuffer();else if(t==="delete")b=Lc("deleted: ",a);else if(t==="focus"||t.includes("move"))b=pv(e.model,r)+(e.model.selectionIsCollapsed?"":"selected: ")+mv(e.model);else if(t==="replacement")b=Lc("",e.model.at(e.model.position));else if(t==="line"){const L=Lc("",e.model.root);e.keyboardDelegate.setAriaLabel(L)}else b=a?Lc(t+" ",a):t;if(b){const L=e.ariaLiveText.textContent.includes("\xA0")?" \u202F ":" \xA0 ";e.ariaLiveText.textContent=b+L}}function pv(e,t){if(Number.isNaN(t))return"";const r=e.at(t);if(!r||r.treeDepth<=e.at(e.position).treeDepth)return"";let a="",b=r.parent;const L=e.at(e.position).parent;for(;b!==e.root&&b!==L;)a+=`out of ${Sp(b)};`,b=b.parent;return a}function mv(e){if(!e.selectionIsCollapsed)return Lc("",e.getAtoms(e.selection));let t="";const r=e.at(e.position),a=Sp(r);return r.isFirstSibling&&(t=(a?"start of "+a:"unknown")+": "),r.isLastSibling?r.isFirstSibling||(t+=a?"end of "+a:"unknown"):t+=Lc("",r),t}var gv=class{constructor(e,t,r){this.mathfield=e,this.mode=t,this.silenceNotifications=!1,this._selection={ranges:[[0,0]],direction:"none"},this._anchor=0,this._position=0,this.root=r}dispose(){this.mathfield=void 0}getState(){const e={ranges:[...this._selection.ranges]};return this.selection.direction&&this.selection.direction!=="none"&&(e.direction=this.selection.direction),{content:this.root.toJson(),selection:e,mode:this.mode}}setState(e,t){var r;const a=this.silenceNotifications;this.silenceNotifications=(r=t==null?void 0:t.silenceNotifications)!=null?r:!0;let b={};if((t==null?void 0:t.type)==="undo"&&(b={inputType:"historyUndo"}),(t==null?void 0:t.type)==="redo"&&(b={inputType:"historyRedo"}),this.contentWillChange(b)){const L=this.silenceNotifications;this.silenceNotifications=!0,this.mode=e.mode,this.root=$a(e.content),this.selection=e.selection,this.silenceNotifications=L,this.contentDidChange(b)}this.silenceNotifications=a}get atoms(){return this.root.children}get selection(){return this._selection}set selection(e){this.setSelection(e)}setSelection(e,t){return!this.mathfield.contentEditable&&this.mathfield.userSelect==="none"?!1:this.deferNotifications({selection:!0},()=>{var r,a,b;const L=this.normalizeSelection(e,t);if(L===void 0)throw new TypeError("Invalid selection");if(L.ranges.length===1&&L.ranges[0][0]===L.ranges[0][1]){const pe=L.ranges[0][0];if(!this.mathfield.dirty&&!((r=this.at(pe))!=null&&r.parentPrompt)&&this.mathfield.hasEditablePrompts){if((a=this.at(pe-1))!=null&&a.parentPrompt){this._anchor=this.normalizeOffset(pe-1),this._position=this._anchor,this._selection=this.normalizeSelection(this._anchor);return}if((b=this.at(pe+1))!=null&&b.parentPrompt){this._anchor=this.normalizeOffset(pe+1),this._position=this._anchor,this._selection=this.normalizeSelection(this._anchor);return}this._anchor=0,this._position=0,this._selection={ranges:[[0,0]]};return}this._anchor=pe,this._position=pe,this._selection=L;return}const N=ri(L);L.direction==="backward"?[this._position,this._anchor]=N:[this._anchor,this._position]=N;const J=this.at(N[0]+1),ie=this.at(N[1]),ue=et.commonAncestor(J,ie);(ue==null?void 0:ue.type)==="array"&&J.parent===ue&&ie.parent===ue?this._selection={ranges:[N],direction:L.direction}:this._selection={ranges:[N],direction:L.direction},console.assert(this._position>=0&&this._position<=this.lastOffset)})}setPositionHandlingPlaceholder(e){var t;const r=this.at(e);(r==null?void 0:r.type)==="placeholder"?this.setSelection(e-1,e):((t=r==null?void 0:r.rightSibling)==null?void 0:t.type)==="placeholder"?this.setSelection(e,e+1):this.position=e,r instanceof di&&r.isSuggestion&&(r.isSuggestion=!1),this.mathfield.stopCoalescingUndo()}get position(){return this._position}set position(e){this.setSelection(e,e)}get anchor(){return this._anchor}get selectionIsCollapsed(){return this._anchor===this._position}get selectionIsPlaceholder(){return Math.abs(this._anchor-this._position)===1?this.at(Math.max(this._anchor,this._position)).type==="placeholder":!1}collapseSelection(e="forward"){return this._anchor===this._position?!1:(e==="backward"?this.position=Math.min(this._anchor,this._position):this.position=Math.max(this._anchor,this._position),!0)}get lastOffset(){return this.atoms.length-1}at(e){return this.atoms[e]}offsetOf(e){return this.atoms.indexOf(e)}getSiblingsRange(e){const t=this.at(e),{parent:r}=t;if(!r)return[0,this.lastOffset];const a=t.parent.branch(t.parentBranch);return[this.offsetOf(a[0]),this.offsetOf(a[a.length-1])]}getBranchRange(e,t){const r=this.at(e).branch(t);return[this.offsetOf(r[0]),this.offsetOf(r[r.length-1])]}getAtoms(e,t,r){let a=r!=null?r:{};if(uc(e)){if(a=t!=null?t:{},e.ranges.length>1)return e.ranges.reduce((ue,pe)=>[...ue,...this.getAtoms(pe,a)],[]);e=e.ranges[0]}let b,L;if(As(e)){if(b=e,!As(t))return[];L=t}else[b,L]=e,a=t!=null?t:{};if(!Number.isFinite(b))return[];a.includeChildren===void 0&&(a.includeChildren=!1),b<0&&(b=this.lastOffset-b+1),L<0&&(L=this.lastOffset-L+1);const N=Math.min(b,L)+1,J=Math.max(b,L);if(!a.includeChildren&&N===1&&J===this.lastOffset)return[this.root];let ie=[];for(let ue=N;ue<=J;ue++){const pe=this.atoms[ue];Cp(this,pe,N,J)&&ie.push(pe)}return a.includeChildren||(ie=ie.filter(ue=>{let pe=!1,{parent:Ee}=ue;for(;Ee&&!pe;)pe=Cp(this,Ee,N,J),Ee=Ee.parent;return!pe})),ie}getAllAtoms(e=0){const t=[],r=this.lastOffset;for(let a=e;a<=r;a++)t.push(this.atoms[a]);for(let a=0;a<e;a++)t.push(this.atoms[a]);return t}findAtom(e,t=0,r="forward"){let a;const b=this.lastOffset;if(r==="forward"){for(let L=t;L<=b;L++)if(a=this.atoms[L],e(a))return a;for(let L=0;L<t;L++)if(a=this.atoms[L],e(a))return a;return}for(let L=t;L>=0;L--)if(a=this.atoms[L],e(a))return a;for(let L=b;L>t;L--)if(a=this.atoms[L],e(a))return a}extractAtoms(e){let t=this.getAtoms(e);if(t.length===1&&!t[0].parent)if(t[0].type==="root")t=[...t[0].body],t.shift();else return t=this.root.cells.flat(),this.root=new et({type:"root",body:[]}),t;for(const r of t)r.parent.removeChild(r);return t}deleteAtoms(e){this.extractAtoms(e),this.position=e[0]}atomToString(e,t){const r=t!=null?t:"latex";if(r.startsWith("latex"))return et.serialize([e],{expandMacro:r==="latex-expanded",skipStyles:r==="latex-unstyled",skipPlaceholders:r==="latex-without-placeholders",defaultMode:this.mathfield.options.defaultMode});if(r==="math-ml")return Pr(e);if(r==="spoken")return Tc(e);if(r==="spoken-text"){const a=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="";const b=Tc(e);return window.MathfieldElement.textToSpeechMarkup=a,b}if(r==="spoken-ssml"||r==="spoken-ssml-with-highlighting"){const a=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="ssml";const b=Tc(e);return window.MathfieldElement.textToSpeechMarkup=a,b}return r==="ascii-math"?Mn(e):(console.error(`MathLive 0.98.5: Unexpected format "${r}`),"")}getValue(e,t,r){if(e===void 0)return this.atomToString(this.root,"latex");if(typeof e=="string"&&e!=="math-json")return this.atomToString(this.root,e);let a,b;if(As(e)&&As(t)?(a=[this.normalizeRange([e,t])],b=r):cc(e)?(a=[this.normalizeRange(e)],b=t):uc(e)?(a=e.ranges,b=t):(a=[this.normalizeRange([0,-1])],b=e),b!=null||(b="latex"),b==="math-json"){if(!window.MathfieldElement.computeEngine)return window[Symbol.for("io.cortexjs.compute-engine")]||console.error(`The CortexJS Compute Engine library is not available.
Load the library, for example with:
import "https://unpkg.com/@cortex-js/compute-engine?module"`),'["Error", "compute-engine-not-available"]';const L=this.getValue({ranges:a},"latex-unstyled");try{const N=window.MathfieldElement.computeEngine.parse(L);return JSON.stringify(N.json)}catch(N){return JSON.stringify(["Error",`'${N.toString()}'`])}}if(b.startsWith("latex")){const L={expandMacro:b==="latex-expanded",skipStyles:b==="latex-unstyled",skipPlaceholders:b==="latex-without-placeholders",defaultMode:this.mathfield.options.defaultMode};return ar(a.map(N=>et.serialize(this.getAtoms(N),L)))}return a.map(L=>this.getAtoms(L).map(N=>this.atomToString(N,b)).join("")).join("")}extendSelectionTo(e,t){return!this.mathfield.contentEditable&&this.mathfield.userSelect==="none"?!1:this.deferNotifications({selection:!0},()=>{const r=this.normalizeRange([e,t]);let[a,b]=r,{parent:L}=this.at(b);if(L&&(L.type==="genfrac"||L.type==="subsup"))for(;L!==this.root&&ad(this,L,[a,b]);)b=this.offsetOf(L),L=L.parent;for(L=this.at(a).parent;L!==this.root&&ad(this,L,[a,b]);)a=this.offsetOf(L.leftSibling),L=L.parent;if(L=this.at(b).parent,(L==null?void 0:L.type)==="genfrac")for(;L!==this.root&&ad(this,L,[a,b]);)b=this.offsetOf(L),console.assert(b>=0),L=L.parent;this._position=this.normalizeOffset(t),this._selection={ranges:[[a,b]],direction:"none"}})}announce(e,t,r=[]){var a,b;((b=(a=this.mathfield.host)==null?void 0:a.dispatchEvent(new CustomEvent("announce",{detail:{command:e,previousPosition:t,atoms:r},cancelable:!0,bubbles:!0,composed:!0})))!=null?b:!0)&&dv(this.mathfield,e,t,r)}deferNotifications(e,t){const r=this._selection,a=this._anchor,b=this._position,L=this.silenceNotifications;this.silenceNotifications=!0;const N=this.root.changeCounter;t();const J=this.root.changeCounter!==N,ie=a!==this._anchor||b!==this._position||yl(this._selection,r)==="different";return this.silenceNotifications=L,e.content&&J&&this.contentDidChange({inputType:e.type}),e.selection&&ie&&this.selectionDidChange(),J||ie}normalizeOffset(e){return e>0?e=Math.min(e,this.lastOffset):e<0&&(e=this.lastOffset+e+1),e}normalizeRange(e){let[t,r]=e;return t=this.normalizeOffset(t),r=this.normalizeOffset(r),t<r?[t,r]:[r,t]}normalizeSelection(e,t){var r;let a;if(As(e)){const b=this.normalizeOffset(e);if(As(t)){const L=this.normalizeOffset(t);a=b<=L?{ranges:[[b,L]],direction:"none"}:{ranges:[[L,b]],direction:"backward"}}else a={ranges:[[b,b]],direction:"none"}}else if(cc(e)){const b=this.normalizeOffset(e[0]),L=this.normalizeOffset(e[1]);a=b<=L?{ranges:[[b,L]],direction:"none"}:{ranges:[[L,b]],direction:"backward"}}else uc(e)&&(a={ranges:e.ranges.map(b=>this.normalizeRange(b)),direction:(r=e.direction)!=null?r:"none"});return console.assert(a!==void 0),a}get parentEnvironment(){let e=this.at(this.position).parent;if(e){for(;e.parent&&e.type!=="array";)e=e.parent;if(e.type==="array")return e}}get cell(){var e;let t=this.at(this.position);if(t){for(;t&&((e=t.parent)==null?void 0:e.type)!=="array";)t=t.parent;if(!(!(t!=null&&t.parent)||t.parent.type!=="array"))return t.parentBranch}}contentWillChange(e={}){if(this.silenceNotifications||!this.mathfield)return!0;const t=this.silenceNotifications;this.silenceNotifications=!0;const r=this.mathfield.onContentWillChange(e);return this.silenceNotifications=t,r}contentDidChange(e){var t;if(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Bs(this.mathfield)),this.silenceNotifications||!this.mathfield.host||!this.mathfield)return;const r=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.host.dispatchEvent(new InputEvent("input",h(l({},e),{data:e.data?e.data:(t=e.inputType)!=null?t:"",bubbles:!0,composed:!0}))),this.silenceNotifications=r}selectionDidChange(){if(!this.mathfield||(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Bs(this.mathfield)),this.silenceNotifications))return;const e=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.onSelectionDidChange(),this.silenceNotifications=e}};function Cp(e,t,r,a){const b=e.offsetOf(t);if(b<r||b>a)return!1;if(!t.hasChildren)return!0;const L=e.offsetOf(t.firstChild);if(L>=r&&L<=a){const N=e.offsetOf(t.lastChild);if(N>=r&&N<=a)return!0}return!1}function ad(e,t,r){if(!(t!=null&&t.hasChildren))return!1;const[a,b]=r,L=e.offsetOf(t.firstChild),N=e.offsetOf(t.lastChild);return L>=a&&L<=b&&N>=L&&N<=b}function zu(e,t,r,a){var b,L,N,J,ie,ue;const pe=r.parent;if(pe&&r instanceof Dr){const Ee=!a&&t==="forward"||a==="body"&&t==="backward";let De=Ee?e.offsetOf(r.firstChild):e.offsetOf(r.lastChild);return Ee?r.rightDelim!=="?"&&r.rightDelim!=="."?(r.leftDelim=".",r.isDirty=!0):(pe.addChildrenAfter(r.removeBranch("body"),r),pe.removeChild(r),De--):r.leftDelim!=="?"&&r.leftDelim!=="."?(r.rightDelim=".",r.isDirty=!0):(pe.addChildrenAfter(r.removeBranch("body"),r),pe.removeChild(r),De--),e.position=De,!0}if(pe&&r.type==="surd"){if(t==="forward"&&!a||t==="backward"&&a==="body"){const Ee=r.leftSibling;r.hasChildren&&pe.addChildrenAfter(r.removeBranch("body"),r),pe.removeChild(r),e.position=e.offsetOf(Ee)}else t==="forward"&&a==="body"?e.position=e.offsetOf(r):!a&&t==="backward"?r.hasChildren?e.position=e.offsetOf(r.lastChild):(e.position=Math.max(0,e.offsetOf(r)-1),pe.removeChild(r)):a==="above"&&(r.hasEmptyBranch("above")&&r.removeBranch("above"),t==="backward"?e.position=e.offsetOf(r.leftSibling):e.position=e.offsetOf(r.body[0]));return!0}if(pe&&(r.type==="box"||r.type==="enclose")){const Ee=a&&t==="backward"||!a&&t==="forward"?r.leftSibling:r.lastChild;return pe.addChildrenAfter(r.removeBranch("body"),r),pe.removeChild(r),e.position=e.offsetOf(Ee),!0}if(r.type==="genfrac"||r.type==="overunder"){if(!a)return r.type==="overunder"&&r.hasEmptyBranch("body")||r.type==="genfrac"&&r.hasEmptyBranch("below")&&r.hasEmptyBranch("above")?!1:(e.position=e.offsetOf(t==="forward"?r.firstChild:r.lastChild),!0);const Ee=Hu.fractionNavigationOrder==="numerator-denominator"?"above":"below",De=Ee==="above"?"below":"above";if(pe&&(t==="forward"&&a===Ee||t==="backward"&&a===De)){const je=r.removeBranch(Ee),ze=r.removeBranch(De);return pe.addChildrenAfter([...je,...ze],r),pe.removeChild(r),e.position=e.offsetOf(je.length>0?je[je.length-1]:ze[0]),!0}return t==="backward"?e.position=e.offsetOf(r.leftSibling):e.position=e.offsetOf(r),!0}if(r.isExtensibleSymbol||r.type==="subsup"){if(!a&&t==="forward")return!1;if(!a){if(r.subscript||r.superscript){const Ee=t==="forward"?(N=(b=r.superscript)==null?void 0:b[0])!=null?N:(L=r.subscript)==null?void 0:L[0]:(ue=(J=r.subscript)==null?void 0:J[0].lastSibling)!=null?ue:(ie=r.superscript)==null?void 0:ie[0].lastSibling;return Ee&&(e.position=e.offsetOf(Ee)),!0}return!1}if(!r.hasChildren&&r.type==="subsup"){const Ee=t==="forward"?e.offsetOf(r):Math.max(0,e.offsetOf(r)-1);return r.parent.removeChild(r),e.position=Ee,!0}if(a==="superscript")if(t==="backward"){const Ee=e.offsetOf(r.firstChild)-1;console.assert(Ee>=0),e.position=Ee}else r.subscript?e.position=e.offsetOf(r.subscript[0]):e.position=e.offsetOf(r);else a==="subscript"&&(t==="backward"&&r.superscript?e.position=e.offsetOf(r.superscript[0].lastSibling):t==="backward"?e.position=e.offsetOf(r.firstChild)-1:e.position=e.offsetOf(r));if(a&&r.hasEmptyBranch(a)&&(r.removeBranch(a),r.type==="subsup"&&!r.subscript&&!r.superscript)){const Ee=t==="forward"?e.offsetOf(r):Math.max(0,e.offsetOf(r)-1);r.parent.removeChild(r),e.position=Ee}return!0}if((pe==null?void 0:pe.type)==="genfrac"&&!a&&r.type!=="first"){let Ee=e.offsetOf(r.leftSibling);return pe.removeChild(r),pe.hasEmptyBranch("above")&&pe.hasEmptyBranch("below")?(Ee=e.offsetOf(pe.leftSibling),pe.parent.removeChild(pe),e.announce("delete",void 0,[pe]),e.position=Ee,!0):(e.announce("delete",void 0,[r]),e.position=Ee,!0)}if(t==="backward"&&((pe==null?void 0:pe.command)==="\\ln"||(pe==null?void 0:pe.command)==="\\log")&&r.parentBranch!=="body"){const Ee=e.offsetOf(pe.leftSibling);return pe.parent.removeChild(pe),e.announce("delete",void 0,[pe]),e.position=Ee,!0}return!1}function vv(e){return!e.mathfield.isSelectionEditable||!e.contentWillChange({inputType:"deleteContentBackward"})?!1:e.selectionIsCollapsed?e.deferNotifications({content:!0,selection:!0,type:"deleteContentBackward"},()=>{let t=e.at(e.position);if(!(t&&zu(e,"backward",t))){if(t!=null&&t.isFirstSibling){if(zu(e,"backward",t.parent,t.parentBranch))return;t=null}if(!t){e.announce("plonk");return}e.position=e.offsetOf(t.leftSibling),t.parent.removeChild(t),e.announce("delete",void 0,[t])}}):Fs(e,ri(e.selection),"deleteContentBackward")}function yv(e){return!e.mathfield.isSelectionEditable||!e.contentWillChange({inputType:"deleteContentForward"})?!1:e.selectionIsCollapsed?e.deferNotifications({content:!0,selection:!0,type:"deleteContentForward"},()=>{var t,r;let a=e.at(e.position).rightSibling;if(a&&zu(e,"forward",a))return;if(a){if(e.at(e.position).isLastSibling&&zu(e,"forward",a.parent,a.parentBranch))return}else{if(a=e.at(e.position),a.isLastSibling&&zu(e,"forward",a.parent,a.parentBranch))return;a=void 0}if(e.position===e.lastOffset||!a){e.announce("plonk");return}a.parent.removeChild(a);let b=(t=e.at(e.position))==null?void 0:t.rightSibling;for(;(b==null?void 0:b.type)==="subsup";)b.parent.removeChild(b),b=(r=e.at(e.position))==null?void 0:r.rightSibling;e.announce("delete",void 0,[a])}):Fs(e,ri(e.selection),"deleteContentForward")}function Fs(e,t,r){const a=e.getAtoms(t);if(a.length>0&&a[0].parent){let b=a[0].parent.firstChild;b.type==="first"&&(b=b.rightSibling);const L=a[a.length-1].parent.lastChild;let N=a[0];N.type==="first"&&(N=N.rightSibling);const J=a[a.length-1];if(N===b&&J===L){const ie=a[0].parent;ie.parent&&ie.type!=="prompt"&&(t=[e.offsetOf(ie.leftSibling),e.offsetOf(ie)])}if(a.length===1&&a[0].type==="placeholder"&&a[0].parent.type==="genfrac"){const ie=a[0].parent,ue=a[0].parentBranch==="below"?"above":"below",pe=e.offsetOf(ie.leftSibling);return e.deferNotifications({content:!0,selection:!0,type:r},()=>{var Ee,De;const je=ie.removeBranch(ue);if(je.length===1&&je[0].type==="placeholder")(De=ie.parent)==null||De.removeChild(ie),e.position=Math.max(0,pe);else{const ze=ie.parent.addChildrenAfter(je,ie);(Ee=ie.parent)==null||Ee.removeChild(ie),e.position=e.offsetOf(ze)}})}}return e.deferNotifications({content:!0,selection:!0,type:r},()=>e.deleteAtoms(t))}oo({deleteAll:e=>e.contentWillChange({inputType:"deleteContent"})&&Fs(e,[0,-1],"deleteContent"),deleteForward:e=>yv(e),deleteBackward:e=>vv(e),deleteNextWord:e=>e.contentWillChange({inputType:"deleteWordForward"})&&Fs(e,[e.anchor,jh(e,e.position,"forward")],"deleteWordForward"),deletePreviousWord:e=>e.contentWillChange({inputType:"deleteWordBackward"})&&Fs(e,[e.anchor,jh(e,e.position,"backward")],"deleteWordBackward"),deleteToGroupStart:e=>e.contentWillChange({inputType:"deleteSoftLineBackward"})&&Fs(e,[e.anchor,e.offsetOf(e.at(e.position).firstSibling)],"deleteSoftLineBackward"),deleteToGroupEnd:e=>e.contentWillChange({inputType:"deleteSoftLineForward"})&&Fs(e,[e.anchor,e.offsetOf(e.at(e.position).lastSibling)],"deleteSoftLineForward"),deleteToMathFieldStart:e=>e.contentWillChange({inputType:"deleteHardLineBackward"})&&Fs(e,[e.anchor,0],"deleteHardLineBackward"),deleteToMathFieldEnd:e=>e.contentWillChange({inputType:"deleteHardLineForward"})&&Fs(e,[e.anchor,-1],"deleteHardLineForward")},{target:"model",audioFeedback:"delete",canUndo:!0,changeContent:!0,changeSelection:!0});var bv=`<svg xmlns="http://www.w3.org/2000/svg" style="width: 21px;" viewBox="0 0 576 512" role="img" aria-label="${A("tooltip.toggle virtual keyboard")}"><path d="M528 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h480c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm16 336c0 8.823-7.177 16-16 16H48c-8.823 0-16-7.177-16-16V112c0-8.823 7.177-16 16-16h480c8.823 0 16 7.177 16 16v288zM168 268v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm-336 80v-24c0-6.627-5.373-12-12-12H84c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm384 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zM120 188v-24c0-6.627-5.373-12-12-12H84c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm-96 152v-8c0-6.627-5.373-12-12-12H180c-6.627 0-12 5.373-12 12v8c0 6.627 5.373 12 12 12h216c6.627 0 12-5.373 12-12z"/></svg>`,_v=`<svg xmlns="http://www.w3.org/2000/svg" style="height: 18px;" viewBox="0 0 448 512" role="img" aria-label="${A("tooltip.menu")}"><path d="M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"/></svg>`,wv=class{constructor(e,t){this.focusBlurInProgress=!1;var r,a,b;this.options=l(h(l({},Kf()),{macros:We(),registers:za()}),Wf(t)),this.eventController=new AbortController;const L=this.eventController.signal;t.eventSink&&(this.host=t.eventSink),this.element=e,e.mathfield=this,this.blurred=!0,this.keystrokeCaptionVisible=!1,this.suggestionIndex=0,this.inlineShortcutBuffer=[],this.inlineShortcutBufferFlushTimer=0,this.defaultStyle={},this.adoptStyle="left",this.options.defaultMode==="inline-math"?this.element.classList.add("ML__is-inline"):this.element.classList.remove("ML__is-inline"),this.dirty=!1;let N=(a=(r=t.value)!=null?r:this.element.textContent)!=null?a:"";N=N.trim();const J=Nd(this.options),ie=new et({type:"root",mode:J,body:ii(N,{context:this.context})});this.model=new gv(this,J,ie),this.undoManager=new Gm(this.model);const ue=[];if(ue.push("<span contenteditable=true aria-multiline=false part=keyboard-sink class=ML__keyboard-sink autocapitalize=off autocomplete=off autocorrect=off spellcheck=false inputmode=none tabindex=0></span>"),ue.push('<span part=container class=ML__container aria-hidden=true style="visibility:hidden">'),ue.push("<span part=content class=ML__content>"),ue.push(Ld(this)),ue.push("</span>"),window.mathVirtualKeyboard&&(ue.push(`<div part=virtual-keyboard-toggle class=ML__virtual-keyboard-toggle role=button ${this.hasEditableContent?"":'style="display:none;"'} data-l10n-tooltip="tooltip.toggle virtual keyboard">`),ue.push(bv),ue.push("</div>")),ue.push('<div part=menu-toggle class=ML__menu-toggle role=button data-l10n-tooltip="tooltip.menu">'),ue.push(_v),ue.push("</div>"),ue.push("</span>"),ue.push("<span class=ML__sr-only>"),ue.push("<span role=status aria-live=assertive aria-atomic=true></span>"),ue.push("</span>"),this.element.innerHTML=window.MathfieldElement.createHTML(ue.join("")),!this.element.children){console.error("%cMathLive 0.98.5: Something went wrong and the mathfield could not be created.%c\nIf you are using Vue, this may be because you are using the runtime-only build of Vue. Make sure to include `runtimeCompiler: true` in your Vue configuration. There may a warning from Vue in the log above.","color:red;font-family:system-ui;font-size:1.2rem;font-weight:bold","color:inherit;font-family:system-ui;font-size:inherit;font-weight:inherit");return}this._l10Subscription=w.subscribe(()=>w.update(this.element)),w.update(this.element),this.field=this.element.querySelector("[part=content]"),this.field.addEventListener("click",Ee=>Ee.stopImmediatePropagation(),{capture:!1,signal:L}),this.field.addEventListener("wheel",this,{passive:!1,signal:L}),"PointerEvent"in window?this.field.addEventListener("pointerdown",this,{signal:L}):this.field.addEventListener("mousedown",this,{signal:L}),(b=this.element.querySelector("[part=virtual-keyboard-toggle]"))==null||b.addEventListener("click",()=>{window.mathVirtualKeyboard.visible?window.mathVirtualKeyboard.hide():(window.mathVirtualKeyboard.show({animate:!0}),window.mathVirtualKeyboard.update(Bs(this)))},{signal:L}),this._menu=new Og(av(this),{host:this.host}),this.field.addEventListener("contextmenu",this,{signal:L});const pe=this.element.querySelector("[part=menu-toggle]");pe==null||pe.addEventListener("pointerdown",Ee=>{if(Ee.currentTarget!==pe||this._menu.state!=="closed")return;this.element.classList.add("tracking");const De=pe.getBoundingClientRect();this._menu.modifiers=xl(Ee),this._menu.show({target:pe,location:{x:De.left,y:De.bottom},onDismiss:()=>this.element.classList.remove("tracking")}),Ee.preventDefault(),Ee.stopPropagation()},{signal:L}),(this.model.atoms.length<=1||this.disabled||this.readOnly&&!this.hasEditableContent||this.userSelect==="none")&&(pe.style.display="none"),this.ariaLiveText=this.element.querySelector("[role=status]"),this.keyboardDelegate=J0(this.element.querySelector(".ML__keyboard-sink"),this.element,this),window.addEventListener("resize",this,{signal:L}),document.addEventListener("scroll",this,{signal:L}),this.resizeObserver=new ResizeObserver(()=>wn(this)),this.resizeObserver.observe(this.field),window.mathVirtualKeyboard.addEventListener("virtual-keyboard-toggle",this,{signal:L}),ku&&!w.locale.startsWith(ku.locale)&&V0(w.locale),vo!=="ready"&&document.fonts.ready.then(()=>Nf(this)),e.querySelector("[part=container]").style.removeProperty("visibility"),this.undoManager.startRecording(),this.undoManager.snapshot("set-value")}get defaultStyle(){return this._defaultStyle}set defaultStyle(e){this._defaultStyle=e}get effectiveStyle(){if(this.adoptStyle==="none")return this.defaultStyle;const e=this.model.at(this.model.position),t=this.adoptStyle==="right"?e.rightSibling:e;if(!t)return this.defaultStyle;if(t.type==="group"){const r=t.branch("body");return!r||r.length<2?{}:this.adoptStyle==="right"?r[1].computedStyle:r[r.length-1].computedStyle}return t.computedStyle}connectToVirtualKeyboard(){this.connectedToVirtualKeyboard||(this.connectedToVirtualKeyboard=!0,window.addEventListener("message",this,{signal:this.eventController.signal}),window.mathVirtualKeyboard.connect(),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Bs(this)),rh(this))}disconnectFromVirtualKeyboard(){this.connectedToVirtualKeyboard&&(window.removeEventListener("message",this),window.mathVirtualKeyboard.disconnect(),this.connectedToVirtualKeyboard=!1,Vh())}showMenu(e){var t,r;const a=(r=(t=e==null?void 0:e.location)!=null?t:Ds(this.field))!=null?r:void 0,b=e==null?void 0:e.modifiers,L=this.element.querySelector("[part=container]");return this._menu.show({target:L,location:a,modifiers:b})}get colorMap(){return e=>{var t,r,a;return(a=(r=(t=this.options).colorMap)==null?void 0:r.call(t,e))!=null?a:U(e)}}get backgroundColorMap(){return e=>{var t,r,a,b,L,N;return(N=(L=(r=(t=this.options).backgroundColorMap)==null?void 0:r.call(t,e))!=null?L:(b=(a=this.options).colorMap)==null?void 0:b.call(a,e))!=null?N:G(e)}}get smartFence(){var e;return(e=this.options.smartFence)!=null?e:!1}get readOnly(){var e;return(e=this.options.readOnly)!=null?e:!1}get disabled(){var e,t;return(t=(e=this.host)==null?void 0:e.disabled)!=null?t:!1}get contentEditable(){return this.host?this.host.getAttribute("contenteditable")!=="false":!1}get userSelect(){if(!this.host)return"";const e=getComputedStyle(this.host);return e.getPropertyValue("user-select")||e.getPropertyValue("-webkit-user-select")}get hasEditableContent(){return this.disabled||!this.contentEditable?!1:!this.readOnly||this.hasEditablePrompts}get hasEditablePrompts(){return this.readOnly&&!this.disabled&&this.contentEditable&&this.model.findAtom(e=>e.type==="prompt"&&!e.locked)!==void 0}get isSelectionEditable(){if(this.disabled||!this.contentEditable)return!1;if(!this.readOnly)return!0;const e=this.model.at(this.model.anchor),t=this.model.at(this.model.position),r=et.commonAncestor(e,t);return!!((r==null?void 0:r.type)==="prompt"||r!=null&&r.parentPrompt)}get letterShapeStyle(){var e;return(e=this.options.letterShapeStyle)!=null?e:"tex"}get minFontScale(){return this.options.minFontScale}get selectionStyle(){if(this.model.selectionIsCollapsed)return this.effectiveStyle;const e=this.model.getAtoms(this.model.selection);if(e.length===0)return{};const t=l({},e[0].style);for(const r of e)for(const[a,b]of Object.entries(r.style))t[a]!==b&&delete t[a];return t}queryStyle(e){const t=Uh(this,e);"verbatimColor"in t&&delete t.verbatimColor,"verbatimBackgroundColor"in t&&delete t.verbatimBackgroundColor;const r=Object.keys(t).length;if(r===0)return"all";if(r>1){for(const ie of Object.keys(t)){const ue=this.queryStyle({[ie]:t[ie]});if(ue==="none")return"none";if(ue==="some")return"some"}return"all"}const a=Object.keys(t)[0],b=t[a];if(this.model.selectionIsCollapsed)return this.effectiveStyle[a]===b?"all":"none";const L=this.model.getAtoms(this.model.selection,{includeChildren:!0});let N=L.length;if(N===0)return"none";let J=0;for(const ie of L){if(ie.type==="first"){N-=1;continue}ie.style[a]===b&&(J+=1)}return J===0?"none":J===N?"all":"some"}get keybindings(){var e,t;if(this._keybindings)return this._keybindings;const[r,a]=rm(this.options.keybindings,(e=Eu())!=null?e:X0());return((t=Eu())==null?void 0:t.score)>0&&(this._keybindings=r,a.length>0&&console.error("MathLive 0.98.5: Invalid keybindings for current keyboard layout",a)),r}get menu(){return this._menu}setOptions(e){var t;this.options=l(l({},this.options),Wf(e)),this._keybindings=void 0,this.options.defaultMode==="inline-math"?this.element.classList.add("ML__is-inline"):this.element.classList.remove("ML__is-inline");let r=this.options.defaultMode;r==="inline-math"&&(r="math"),((t=this.model.root.firstChild)==null?void 0:t.mode)!==r&&(this.model.root.firstChild.mode=r),this.options.readOnly&&this.hasFocus()&&window.mathVirtualKeyboard.visible&&this.executeCommand("hideVirtualKeyboard");const a=et.serialize([this.model.root],{expandMacro:!1,defaultMode:this.options.defaultMode});("macros"in e||this.model.getValue()!==a)&&Xt.insert(this.model,a,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",silenceNotifications:!0,mode:"math"}),("value"in e||"macros"in e||"registers"in e||"colorMap"in e||"backgroundColorMap"in e||"letterShapeStyle"in e||"minFontScale"in e||"readOnly"in e||"placeholderSymbol"in e)&&wn(this)}getOptions(e){return kl(this.options,e)}getOption(e){return kl(this.options,e)}handleEvent(e){return Za(this,null,function*(){var t;if(po(this)){if(Dh(e)){if(!vu(e.origin,(t=this.options.originValidator)!=null?t:"none"))throw new DOMException(`Message from unknown origin (${e.origin}) cannot be handled`,"SecurityError");const{action:r}=e.data;if(r==="execute-command"){const a=e.data.command;if(_c(a)==="virtual-keyboard")return;this.executeCommand(a)}else r==="update-state"||(r==="focus"?this.focus({preventScroll:!0}):r==="blur"&&this.blur());return}switch(e.type){case"focus":this.onFocus();break;case"blur":this.onBlur();break;case"mousedown":this.userSelect!=="none"&&Qd(this,e);break;case"pointerdown":this.userSelect!=="none"&&(Qd(this,e),e.shiftKey===!1&&(yield dp(e,this.element.querySelector("[part=container]"),this._menu))&&qf.stop());break;case"contextmenu":this.userSelect!=="none"&&e.shiftKey===!1&&(yield dp(e,this.element.querySelector("[part=container]"),this._menu))&&qf.stop();break;case"virtual-keyboard-toggle":this.hasFocus()&&rh(this);break;case"resize":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>po(this)&&this.onGeometryChange());break;case"scroll":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>po(this)&&this.onGeometryChange());break;case"wheel":this.onWheel(e);break;default:console.warn("Unexpected event type",e.type)}}})}dispose(){if(!po(this))return;w.unsubscribe(this._l10Subscription),this.keyboardDelegate.dispose(),this.keyboardDelegate=void 0,this.eventController.abort(),this.eventController=void 0,this.resizeObserver.disconnect(),window.mathVirtualKeyboard.removeEventListener("virtual-keyboard-toggle",this),this.disconnectFromVirtualKeyboard(),this.model.dispose();const e=this.element;delete e.mathfield,this.element=void 0,this.host=void 0,this.field=void 0,this.ariaLiveText=void 0,ng(),lm(),Cg()}flushInlineShortcutBuffer(e){if(e!=null||(e={defer:!1}),!e.defer){this.inlineShortcutBuffer=[],clearTimeout(this.inlineShortcutBufferFlushTimer),this.inlineShortcutBufferFlushTimer=0;return}this.options.inlineShortcutTimeout>0&&(clearTimeout(this.inlineShortcutBufferFlushTimer),this.inlineShortcutBufferFlushTimer=setTimeout(()=>this.flushInlineShortcutBuffer(),this.options.inlineShortcutTimeout))}executeCommand(e){return _c(e)==="virtual-keyboard"?(this.focus({preventScroll:!0}),window.mathVirtualKeyboard.executeCommand(e),requestAnimationFrame(()=>window.mathVirtualKeyboard.update(Bs(this))),!1):mm(this,e)}get errors(){return ud(this.model.getValue(),{context:this.context})}getValue(e,t,r){return this.model.getValue(e,t,r)}setValue(e,t){var r;t=t!=null?t:{mode:"math"},t.insertionMode===void 0&&(t.insertionMode="replaceAll"),(t.format===void 0||t.format==="auto")&&(t.format="latex"),(t.mode===void 0||t.mode==="auto")&&(t.mode=(r=ph(this.model,this.model.position))!=null?r:"math");const a=this.undoManager.canUndo();Xt.insert(this.model,e,t)&&(wn(this),a||this.undoManager.reset(),this.undoManager.snapshot("set-value"))}get expression(){const e=window.MathfieldElement.computeEngine;return e?e.box(e.parse(this.model.getValue("latex-unstyled"))):(console.error("MathLive 0.98.5: no compute engine available. Make sure the Compute Engine library is loaded."),null)}scrollIntoView(){var e;if(!this.element)return;if(this.host){if(this.options.onScrollIntoView)this.options.onScrollIntoView(this);else if(this.host.scrollIntoView({block:"nearest",inline:"nearest"}),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.container===window.document.body){const a=window.mathVirtualKeyboard.boundingRect,b=this.host.getBoundingClientRect();b.bottom>a.top&&((e=window.document.scrollingElement)==null||e.scrollBy(0,b.bottom-a.top+8))}}this.dirty&&Sl(this,{interactive:!0});const t=this.field.getBoundingClientRect();let r=null;if(this.model.selectionIsCollapsed)r=Ds(this.field);else{const a=gu(this);if(a.length>0){let b=-1/0,L=-1/0;for(const N of a)N.right>b&&(b=N.right),N.top<L&&(L=N.top);r={x:b+t.left-this.field.scrollLeft,y:L+t.top-this.field.scrollTop,height:0}}}if(this.host&&r){const a=this.host.getBoundingClientRect(),b=r.y;let L=this.host.scrollTop;b<a.top?L=b-a.top+this.host.scrollTop:b>a.bottom&&(L=b-a.bottom+this.host.scrollTop+r.height),this.host.scroll({top:L,left:0})}if(r){const a=r.x-window.scrollX;let b=this.field.scrollLeft;a<t.left?b=a-t.left+this.field.scrollLeft-20:a>t.right&&(b=a-t.right+this.field.scrollLeft+20),this.field.scroll({top:this.field.scrollTop,left:b})}}insert(e,t){return typeof e!="string"||e.length===0&&((t==null?void 0:t.insertionMode)==="insertBefore"||(t==null?void 0:t.insertionMode)==="insertAfter")||e.length===0&&this.model.selectionIsCollapsed?!1:(this.flushInlineShortcutBuffer(),t=t!=null?t:{mode:"math"},t.focus&&this.focus(),t.feedback&&(window.MathfieldElement.keypressVibration&&y()&&navigator.vibrate(Od),window.MathfieldElement.playSound("keypress")),e==="\\\\"?Fd(this.model):e==="&"?zd(this.model):this.model.selectionIsCollapsed?Xt.insert(this.model,e,l({style:this.model.at(this.model.position).computedStyle},t)):Xt.insert(this.model,e,t),this.snapshot(`insert-${this.model.at(this.model.position).type}`),wn(this),t.scrollIntoView&&this.scrollIntoView(),!0)}switchMode(e,t="",r=""){var a;if(this.model.mode===e||!this.hasEditableContent||!this.contentEditable||this.disabled)return;const b=this.model.mode;if(this.model.mode=e,!((a=this.host)!=null&&a.dispatchEvent(new Event("mode-change",{bubbles:!0,composed:!0,cancelable:!0})))){this.model.mode=b;return}const L=this.model.mode,{model:N}=this;N.deferNotifications({content:!!r||!!t,selection:!0,type:"insertText"},()=>{let J=!1;if(this.flushInlineShortcutBuffer(),this.stopCoalescingUndo(),t&&e!=="latex"){const ie=ii(t,{context:this.context,parseMode:e});N.collapseSelection("forward");const ue=N.at(N.position);N.position=N.offsetOf(ue.parent.addChildrenAfter(ie,ue)),J=!0}if(this.model.mode=e,e==="latex"){let ie=N.selectionIsCollapsed;yc(this,"accept");let ue,pe=N.at(N.position);if(ie)ue="\\";else{const De=ri(N.selection);ue=this.model.getValue(De,"latex");const je=this.model.extractAtoms(De);je.length===1&&je[0].type==="placeholder"&&(ue=t,ie=!0),pe=N.at(De[0])}const Ee=new bu(ue);pe.parent.addChildAfter(Ee,pe),ie?N.position=N.offsetOf(Ee.lastChild):N.setSelection(N.offsetOf(Ee.firstChild),N.offsetOf(Ee.lastChild))}else Mu(N).forEach(ie=>{ie.isError=!1});if(r){const ie=ii(r,{context:this.context,parseMode:L});N.collapseSelection("forward");const ue=N.at(N.position);N.position=N.offsetOf(ue.parent.addChildrenAfter(ie,ue)),J=!0}return wn(this),this.undoManager.snapshot(e==="latex"?"insert-latex":"insert"),J}),this.model.mode=e,window.mathVirtualKeyboard.update(Bs(this))}hasFocus(){return!this.blurred}focus(e){var t;this.hasFocus()||(this.keyboardDelegate.focus(),this.connectToVirtualKeyboard(),this.onFocus(),this.model.announce("line")),(t=e==null?void 0:e.preventScroll)!=null&&t||this.scrollIntoView()}blur(){this.disconnectFromVirtualKeyboard(),this.hasFocus()&&this.keyboardDelegate.blur()}select(){this.model.selection={ranges:[[0,this.model.lastOffset]]},this.focus()}applyStyle(e,t={}){var r,a;const b={operation:"set",silenceNotifications:!1};cc(t)?b.range=t:(t.operation==="toggle"&&(b.operation="toggle"),b.range=t.range,b.silenceNotifications=(r=t.silenceNotifications)!=null?r:!1);const L=Uh(this,e),N=(a=b.operation)!=null?a:"set";if(b.range===void 0&&this.model.selectionIsCollapsed){if(N==="set"){this.defaultStyle=l(l({},this.defaultStyle),L);return}const J=l({},this.defaultStyle);for(const ie of Object.keys(L))J[ie]===L[ie]?(ie==="color"&&delete J.verbatimColor,ie==="backgroundColor"&&delete J.verbatimBackgroundColor,delete J[ie]):J[ie]=L[ie];this.defaultStyle=J;return}this.model.deferNotifications({content:!b.silenceNotifications,type:"insertText"},()=>{if(b.range===void 0)for(const J of this.model.selection.ranges)Rh(this.model,J,L,{operation:N});else Rh(this.model,b.range,L,{operation:N})}),wn(this)}toggleContextMenu(){var e;return this._menu.visible?this._menu.state==="open"?(this._menu.hide(),!0):(this._menu.show({target:this.element.querySelector("[part=container]"),location:(e=this.getCaretPoint())!=null?e:void 0,onDismiss:()=>{var t;return(t=this.element)==null?void 0:t.focus()}}),!0):!1}getCaretPoint(){const e=Ds(this.field);return e?{x:e.x,y:e.y}:null}setCaretPoint(e,t){const r=Iu(this,e,t,{bias:0});if(r<0)return!1;const a=this.model.position;return this.model.position=r,this.model.announce("move",a),wn(this),!0}getPrompt(e){const t=this.model.findAtom(r=>r.type==="prompt"&&r.placeholderId===e);return console.assert(t!==void 0,"MathLive 0.98.5: no prompts with matching ID found"),t}getPromptValue(e,t){const r=this.getPrompt(e);if(!r)return"";const a=this.model.offsetOf(r.firstChild),b=this.model.offsetOf(r.lastChild);return this.model.getValue(a,b,t)}getPrompts(e){return this.model.getAllAtoms().filter(t=>t.type!=="prompt"?!1:e?!(e.id&&t.placeholderId!==e.id||e.locked&&t.locked!==e.locked||e.correctness==="undefined"&&t.correctness||e.correctness&&t.correctness!==e.correctness):!0).map(t=>t.placeholderId)}setPromptValue(e,t,r){if(t!==void 0){const a=this.getPrompt(e);if(!a){console.error(`MathLive 0.98.5: unknown prompt ${e}`);return}const b=this.model.getBranchRange(this.model.offsetOf(a),"body");this.model.setSelection(b),this.insert(t,h(l({},r),{insertionMode:"replaceSelection"}))}r!=null&&r.silenceNotifications&&(this.valueOnFocus=this.getValue()),wn(this)}setPromptState(e,t,r){const a=this.getPrompt(e);if(!a){console.error(`MathLive 0.98.5: unknown prompt ${e}`);return}t==="undefined"?a.correctness=void 0:typeof t=="string"&&(a.correctness=t),typeof r=="boolean"&&(a.locked=r,a.captureSelection=r),wn(this)}getPromptState(e){const t=this.getPrompt(e);return t?[t.correctness,t.locked]:(console.error(`MathLive 0.98.5: unknown prompt ${e}`),[void 0,!0])}getPromptRange(e){const t=this.getPrompt(e);return t?this.model.getBranchRange(this.model.offsetOf(t),"body"):(console.error(`MathLive 0.98.5: unknown prompt ${e}`),[0,0])}canUndo(){return this.undoManager.canUndo()}canRedo(){return this.undoManager.canRedo()}popUndoStack(){this.undoManager.pop()}snapshot(e){var t;this.undoManager.snapshot(e)&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Bs(this)),(t=this.host)==null||t.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"snapshot"}})))}stopCoalescingUndo(){this.undoManager.stopCoalescing(this.model.selection)}stopRecording(){this.undoManager.stopRecording()}startRecording(){this.undoManager.startRecording()}undo(){var e;this.undoManager.undo()&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Bs(this)),(e=this.host)==null||e.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"undo"}})))}redo(){var e;this.undoManager.redo()&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Bs(this)),(e=this.host)==null||e.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"undo"}})))}resetUndo(){var e;(e=this.undoManager)==null||e.reset()}onSelectionDidChange(){var e,t;const r=this.model;this.keyboardDelegate.setValue(r.getValue(this.model.selection,"latex-expanded"));{const a=r.at(r.position),b=(e=a.mode)!=null?e:Nd(this.options);this.model.mode!==b&&(this.model.mode==="latex"?(yc(this,"accept",{mode:b}),r.position=r.offsetOf(a)):this.switchMode(b))}(t=this.host)==null||t.dispatchEvent(new Event("selection-change",{bubbles:!0,composed:!0})),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Bs(this)),rh(this)}onContentWillChange(e){var t,r,a;return(a=(r=this.host)==null?void 0:r.dispatchEvent(new InputEvent("beforeinput",h(l({},e),{data:e.data?e.data:(t=e.inputType)!=null?t:"",cancelable:!0,bubbles:!0,composed:!0}))))!=null?a:!0}onFocus(){this.focusBlurInProgress||!this.blurred||(this.focusBlurInProgress=!0,this.blurred=!1,this.keyboardDelegate.focus(),this.stopCoalescingUndo(),Sl(this,{interactive:!0}),this.valueOnFocus=this.model.getValue(),this.hasEditablePrompts&&!this.model.at(this.model.anchor).parentPrompt&&this.executeCommand("moveToNextPlaceholder"),this.focusBlurInProgress=!1)}onBlur(){var e,t,r;if(this.focusBlurInProgress||this.blurred)return;this.focusBlurInProgress=!0,this.stopCoalescingUndo(),this.blurred=!0,this.ariaLiveText.textContent="",bc(this),this.model.getValue()!==this.valueOnFocus&&((e=this.host)==null||e.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),this.disconnectFromVirtualKeyboard(),(t=this.host)==null||t.dispatchEvent(new Event("blur",{bubbles:!1,composed:!0})),(r=this.host)==null||r.dispatchEvent(new UIEvent("focusout",{bubbles:!0,composed:!0})),wn(this),this.focusBlurInProgress=!1,Vh();const a=new AbortController,b=a.signal;document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&document.addEventListener("visibilitychange",()=>{po(this)&&document.visibilityState==="visible"&&this.focus({preventScroll:!0})},{once:!0,signal:b})},{once:!0,signal:b}),setTimeout(()=>a.abort(),100)}onInput(e){Fh(this,e)}onKeystroke(e){return Zd(this,e)}onCompositionStart(e){this.model.deleteAtoms(ri(this.model.selection));const t=Ds(this.field);t&&requestAnimationFrame(()=>{Sl(this),this.keyboardDelegate.moveTo(t.x,t.y-t.height)})}onCompositionUpdate(e){Bm(this.model,e),wn(this)}onCompositionEnd(e){Nm(this.model),Fh(this,e,{simulateKeystroke:!0})}onCut(e){if(!this.isSelectionEditable){this.model.announce("plonk");return}this.model.contentWillChange({inputType:"deleteByCut"})&&(this.stopCoalescingUndo(),Xt.onCopy(this,e),Fs(this.model,ri(this.model.selection),"deleteByCut"),this.snapshot("cut"),wn(this))}onCopy(e){Xt.onCopy(this,e)}onPaste(e){let t=this.isSelectionEditable;return t&&(t=Xt.onPaste(this.model.at(this.model.position).mode,this,e.clipboardData)),t||this.model.announce("plonk"),e.preventDefault(),e.stopPropagation(),t}onGeometryChange(){this._menu.hide(),If(this),rh(this)}onWheel(e){const t=5*e.deltaX;if(!Number.isFinite(t)||t===0)return;const r=this.field;t<0&&r.scrollLeft===0||t>0&&r.offsetWidth+r.scrollLeft>=r.scrollWidth||(r.scrollBy({top:0,left:t}),e.preventDefault(),e.stopPropagation())}getHTMLElement(e){let t=e;for(;!t.id&&t.hasChildren;)t=e.children[0];return this.field.querySelector(`[data-atom-id="${t.id}"]`)}get context(){var e,t;return{registers:(e=this.options.registers)!=null?e:{},smartFence:this.smartFence,letterShapeStyle:this.letterShapeStyle,minFontScale:this.minFontScale,placeholderSymbol:(t=this.options.placeholderSymbol)!=null?t:"\u25A2",colorMap:r=>this.colorMap(r),backgroundColorMap:r=>this.backgroundColorMap(r),getMacro:r=>ft(r,this.options.macros),atomIdsSettings:{seed:"random",groupNumbers:!1}}}};function kp(e){if(e&&(e.classList.remove("ML__highlight"),e.children))for(const t of e.children)kp(t)}function ld(e,t){var r;e&&(!t||((r=e.dataset)==null?void 0:r.atomId)===t?(e.classList.add("ML__highlight"),e.children&&e.children.length>0&&[...e.children].forEach(a=>{a instanceof HTMLElement&&ld(a)})):(e.classList.remove("ML__highlight"),e.children&&e.children.length>0&&[...e.children].forEach(a=>{a instanceof HTMLElement&&ld(a,t)})))}function xv(e,t){var r;if(!u())return;if(window.MathfieldElement.speechEngine!=="amazon"){console.error("MathLive 0.98.5: Use Amazon TTS Engine for synchronized highlighting"),typeof window.MathfieldElement.speakHook=="function"&&window.MathfieldElement.speakHook(t);return}if(!window.AWS){console.error("MathLive 0.98.5: AWS SDK not loaded. See https://www.npmjs.com/package/aws-sdk");return}const a=new window.AWS.Polly({apiVersion:"2016-06-10"}),b={OutputFormat:"json",VoiceId:(r=window.MathfieldElement.speechEngineVoice)!=null?r:"Joanna",Engine:"standard",Text:t,TextType:"ssml",SpeechMarkTypes:["ssml"]};Ya().readAloudElement=e,a.synthesizeSpeech(b,(L,N)=>{if(L){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech()\` error: ${L}`);return}if(!(N!=null&&N.AudioStream)){console.log("polly.synthesizeSpeech():",N);return}const J=new TextDecoder("utf-8").decode(new Uint8Array(N.AudioStream));Ya().readAloudMarks=J.split(`
`).map(ie=>ie?JSON.parse(ie):{}),Ya().readAloudTokens=[];for(const ie of Ya().readAloudMarks)ie.value&&Ya().readAloudTokens.push(ie.value);Ya().readAloudCurrentMark="",b.OutputFormat="mp3",b.SpeechMarkTypes=[],a.synthesizeSpeech(b,(ie,ue)=>{if(ie){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech("${t}") error:${ie}`);return}if(!(ue!=null&&ue.AudioStream))return;const pe=new Uint8Array(ue.AudioStream),Ee=new Blob([pe.buffer],{type:"audio/mpeg"}),De=URL.createObjectURL(Ee),je=Ya();je.readAloudAudio?je.readAloudAudio.pause():(je.readAloudAudio=new Audio,je.readAloudAudio.addEventListener("ended",()=>{const ze=je.readAloudMathfield;je.readAloudStatus="ended",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),ze?(Sl(ze),je.readAloudElement=null,je.readAloudMathfield=null,je.readAloudTokens=[],je.readAloudMarks=[],je.readAloudCurrentMark=""):kp(je.readAloudElement)}),je.readAloudAudio.addEventListener("timeupdate",()=>{let ze="";const Je=je.readAloudAudio.currentTime*1e3+100;for(const pt of je.readAloudMarks)pt.time<Je&&(ze=pt.value);je.readAloudCurrentMark!==ze&&(je.readAloudCurrentToken=ze,ze&&ze===je.readAloudFinalToken?je.readAloudAudio.pause():(je.readAloudCurrentMark=ze,ld(je.readAloudElement,je.readAloudCurrentMark)))})),je.readAloudAudio.src=De,je.readAloudStatus="playing",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),je.readAloudAudio.play()})})}u()||console.error('MathLive 0.98.5: this version of the MathLive library is for use in the browser. A subset of the API is available on the server side in the "mathlive-ssr" library. If using server side rendering (with React for example) you may want to do a dynamic import of the MathLive library inside a `useEffect()` call.');var Tr=new WeakMap,Sv=.5,Xa={letterShapeStyle:"mf.letterShapeStyle = ...",horizontalSpacingScale:'Removed. Use `"thinmuskip"`, `"medmuskip"`, and `"thickmuskip"` registers ',macros:"mf.macros = ...",registers:"mf.registers = ...",backgroundColorMap:"mf.backgroundColorMap = ...",colorMap:"mf.colorMap = ...",enablePopover:"mf.popoverPolicy = ...",mathModeSpace:"mf.mathModeSpace = ...",placeholderSymbol:"mf.placeholderSymbol = ...",readOnly:"mf.readOnly = ...",removeExtraneousParentheses:"mf.removeExtraneousParentheses = ...",scriptDepth:"mf.scriptDepth = ...",smartFence:"mf.smartFence = ...",smartMode:"mf.smartMode = ...",smartSuperscript:"mf.smartSuperscript = ...",inlineShortcutTimeout:"mf.inlineShortcutTimeout = ...",inlineShortcuts:"mf.inlineShortcuts = ...",keybindings:"mf.keybindings = ...",virtualKeyboardMode:"mf.mathVirtualKeyboardPolicy = ...",customVirtualKeyboardLayers:"mathVirtualKeyboard.layers = ...",customVirtualKeyboards:"mathVirtualKeyboard.layouts = ...",keypressSound:"mathVirtualKeyboard.keypressSound = ...",keypressVibration:"mathVirtualKeyboard.keypressVibration = ...",plonkSound:"mathVirtualKeyboard.plonkSound = ...",virtualKeyboardContainer:"mathVirtualKeyboard.container = ...",virtualKeyboardLayout:"mathVirtualKeyboard.alphabeticLayout = ...",virtualKeyboardTheme:"No longer supported",virtualKeyboardToggleGlyph:"No longer supported",virtualKeyboardToolbar:"mathVirtualKeyboard.editToolbar = ...",virtualKeyboards:"Use `mathVirtualKeyboard.layouts`",speechEngine:"`MathfieldElement.speechEngine`",speechEngineRate:"`MathfieldElement.speechEngineRate`",speechEngineVoice:"`MathfieldElement.speechEngineVoice`",textToSpeechMarkup:"`MathfieldElement.textToSpeechMarkup`",textToSpeechRules:"`MathfieldElement.textToSpeechRules`",textToSpeechRulesOptions:"`MathfieldElement.textToSpeechRulesOptions`",readAloudHook:"`MathfieldElement.readAloudHook`",speakHook:"`MathfieldElement.speakHook`",computeEngine:"`MathfieldElement.computeEngine`",fontsDirectory:"`MathfieldElement.fontsDirectory`",soundsDirectory:"`MathfieldElement.soundsDirectory`",createHTML:"`MathfieldElement.createHTML`",onExport:"`MathfieldElement.onExport`",onInlineShortcut:"`MathfieldElement.onInlineShortcut`",onScrollIntoView:"`MathfieldElement.onScrollIntoView`",locale:"MathfieldElement.locale = ...",strings:"MathfieldElement.strings = ...",decimalSeparator:"MathfieldElement.decimalSeparator = ...",fractionNavigationOrder:"MathfieldElement.fractionNavigationOrder = ..."},pi=class Pl extends HTMLElement{static get formAssociated(){return Oc()}static get optionsAttributes(){return{"default-mode":"string","letter-shape-style":"string","min-font-scale":"number","popover-policy":"string","math-mode-space":"string","read-only":"boolean","remove-extraneous-parentheses":"on/off","smart-fence":"on/off","smart-mode":"on/off","smart-superscript":"on/off","inline-shortcut-timeout":"string","script-depth":"string",placeholder:"string","virtual-keyboard-target-origin":"string","math-virtual-keyboard-policy":"string"}}static get observedAttributes(){return[...Object.keys(this.optionsAttributes),"contenteditable","disabled","readonly","read-only"]}static get fontsDirectory(){return this._fontsDirectory}static set fontsDirectory(t){t!==this._fontsDirectory&&(this._fontsDirectory=t,fm())}get fontsDirectory(){throw new Error("Use MathfieldElement.fontsDirectory instead")}set fontsDirectory(t){throw new Error("Use MathfieldElement.fontsDirectory instead")}static get soundsDirectory(){return this._soundsDirectory}static set soundsDirectory(t){this._soundsDirectory=t,this.audioBuffers={}}get soundsDirectory(){throw new Error("Use MathfieldElement.soundsDirectory instead")}set soundsDirectory(t){throw new Error("Use MathfieldElement.soundsDirectory instead")}static get keypressSound(){return this._keypressSound}static set keypressSound(t){var r,a,b;this.audioBuffers={},t===null?this._keypressSound={spacebar:null,return:null,delete:null,default:null}:typeof t=="string"?this._keypressSound={spacebar:t,return:t,delete:t,default:t}:typeof t=="object"&&"default"in t&&(this._keypressSound={spacebar:(r=t.spacebar)!=null?r:t.default,return:(a=t.return)!=null?a:t.default,delete:(b=t.delete)!=null?b:t.default,default:t.default})}static get plonkSound(){return this._plonkSound}static set plonkSound(t){this.audioBuffers={},this._plonkSound=t}static get audioContext(){return this._audioContext||(this._audioContext=new AudioContext),this._audioContext}static get speechEngine(){return this._speechEngine}static set speechEngine(t){this._speechEngine=t}static get speechEngineRate(){return this._speechEngineRate}static set speechEngineRate(t){this._speechEngineRate=t}static get speechEngineVoice(){return this._speechEngineVoice}static set speechEngineVoice(t){this._speechEngineVoice=t}static get textToSpeechMarkup(){return this._textToSpeechMarkup}static set textToSpeechMarkup(t){this._textToSpeechMarkup=t}static get textToSpeechRules(){return this._textToSpeechRules}static set textToSpeechRules(t){this._textToSpeechRules=t}static get textToSpeechRulesOptions(){return this._textToSpeechRulesOptions}static set textToSpeechRulesOptions(t){this._textToSpeechRulesOptions=t}static get locale(){return w.locale}static set locale(t){t==="auto"&&(t=navigator.language.slice(0,5)),w.locale=t}get locale(){throw new Error("Use MathfieldElement.locale instead")}set locale(t){throw new Error("Use MathfieldElement.locale instead")}static get strings(){return w.strings}static set strings(t){w.merge(t)}get strings(){throw new Error("Use MathfieldElement.strings instead")}set strings(t){throw new Error("Use MathfieldElement.strings instead")}static get decimalSeparator(){return this._decimalSeparator}static set decimalSeparator(t){this._decimalSeparator=t,this._computeEngine&&(this._computeEngine.latexOptions.decimalMarker=this.decimalSeparator===","?"{,}":".")}get decimalSeparator(){throw new Error("Use MathfieldElement.decimalSeparator instead")}set decimalSeparator(t){throw new Error("Use MathfieldElement.decimalSeparator instead")}static get computeEngine(){var t,r;if(this._computeEngine===void 0){const a=(t=window[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:t.ComputeEngine;if(!a)return null;this._computeEngine=new a,this._computeEngine&&this.decimalSeparator===","&&(this._computeEngine.latexOptions.decimalMarker="{,}")}return(r=this._computeEngine)!=null?r:null}static set computeEngine(t){this._computeEngine=t}get computeEngine(){throw new Error("Use MathfieldElement.computeEngine instead")}set computeEngine(t){throw new Error("Use MathfieldElement.computeEngine instead")}static get isFunction(){return typeof this._isFunction!="function"?()=>!1:this._isFunction}static set isFunction(t){this._isFunction=t}static loadSound(t){return Za(this,null,function*(){delete this.audioBuffers[t];let r="";switch(t){case"keypress":r=this._keypressSound.default;break;case"return":r=this._keypressSound.return;break;case"spacebar":r=this._keypressSound.spacebar;break;case"delete":r=this._keypressSound.delete;break;case"plonk":r=this.plonkSound;break}if(typeof r!="string")return;r=r.trim();const a=this.soundsDirectory;if(!(a==null||a==="null"||r==="none"||r==="null"))try{const L=yield(yield fetch(yield Ad(`${a}/${r}`))).arrayBuffer(),N=yield this.audioContext.decodeAudioData(L);this.audioBuffers[t]=N}catch(b){}})}static playSound(t){return Za(this,null,function*(){if((this.audioContext.state==="suspended"||this.audioContext.state==="interrupted")&&(yield this.audioContext.resume()),this.audioBuffers[t]||(yield this.loadSound(t)),!this.audioBuffers[t])return;const r=this.audioContext.createBufferSource();r.buffer=this.audioBuffers[t];const a=this.audioContext.createGain();a.gain.value=Sv,r.connect(a).connect(this.audioContext.destination),r.start()})}constructor(t){if(super(),t){const r=[];for(const a of Object.keys(t))if(Xa[a])if(Xa[a].startsWith("mf."))if(Xa[a].startsWith(`mf.${a}`))r.push(`Option \`${a}\` cannot be used as a constructor option. Use ${Xa[a]}`);else{const b=Xa[a].match(/([a-zA-Z]+) =/);r.push(`Option \`${a}\` has been renamed \`${b[1]}\``)}else r.push(`Option \`${a}\` cannot be used as a constructor option. Use ${Xa[a]}`);if(r.length>0){console.group("%cMathLive 0.98.5: %cInvalid Options","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),console.warn("Some of the options passed to `new MathfieldElement(...)` are invalid. \n See https://cortexjs.io/mathlive/changelog/ for details.");for(const a of r)console.warn(a);console.groupEnd()}}if(Oc()&&(this._internals=this.attachInternals(),this._internals.role="math",this._internals.ariaLabel="math input field",this._internals.ariaMultiLine="false"),this.attachShadow({mode:"open",delegatesFocus:!0}),this.shadowRoot&&"adoptedStyleSheets"in this.shadowRoot){this.shadowRoot.adoptedStyleSheets=[Ka("core"),Ka("mathfield"),Ka("mathfield-element"),Ka("ui"),Ka("menu")],this.shadowRoot.appendChild(document.createElement("span"));const r=document.createElement("slot");r.style.display="none",this.shadowRoot.appendChild(r)}else this.shadowRoot.innerHTML="<style>"+ma("core")+ma("mathfield")+ma("mathfield-element")+ma("ui")+ma("menu")+'</style><span></span><slot style="display:none"></slot>';t&&this._setOptions(t),this.shadowRoot.addEventListener("slotchange",()=>{var r;const a=this.shadowRoot.querySelector("slot:not([name])");this.value=(r=a==null?void 0:a.assignedNodes().map(b=>b.nodeType===3?b.textContent:"").join("").trim())!=null?r:""})}showMenu(t){var r,a;return(a=(r=this._mathfield)==null?void 0:r.showMenu(t))!=null?a:!1}get mathVirtualKeyboard(){throw new Error("The `mathVirtualKeyboard` property is not available on the MathfieldElement. Use `window.mathVirtualKeyboard` instead.")}onPointerDown(){window.addEventListener("pointerup",t=>{var r;t.target===this&&!((r=this._mathfield)!=null&&r.disabled)&&this.dispatchEvent(new MouseEvent("click",{altKey:t.altKey,button:t.button,buttons:t.buttons,clientX:t.clientX,clientY:t.clientY,ctrlKey:t.ctrlKey,metaKey:t.metaKey,movementX:t.movementX,movementY:t.movementY,relatedTarget:t.relatedTarget,screenX:t.screenX,screenY:t.screenY,shiftKey:t.shiftKey}))},{once:!0})}getPromptValue(t,r){var a,b;return(b=(a=this._mathfield)==null?void 0:a.getPromptValue(t,r))!=null?b:""}setPromptValue(t,r,a){var b;(b=this._mathfield)==null||b.setPromptValue(t,r,a)}getPromptRange(t){var r,a;return(a=(r=this._mathfield)==null?void 0:r.getPromptRange(t))!=null?a:null}getPrompts(t){var r,a;return(a=(r=this._mathfield)==null?void 0:r.getPrompts(t))!=null?a:[]}get form(){var t;return(t=this._internals)==null?void 0:t.form}get name(){var t;return(t=this.getAttribute("name"))!=null?t:""}get type(){return this.localName}get mode(){var t,r;return(r=(t=this._mathfield)==null?void 0:t.model.mode)!=null?r:this.defaultMode==="text"?"text":"math"}set mode(t){var r;(r=this._mathfield)==null||r.switchMode(t)}get expression(){if(this._mathfield)return window[Symbol.for("io.cortexjs.compute-engine")]?this._mathfield.expression:(console.error(`MathLive 0.98.5: The CortexJS Compute Engine library is not available.
Load the library, for example with:
import "https://unpkg.com/@cortex-js/compute-engine?module"`),null)}set expression(t){var r,a;if(!this._mathfield)return;const b=(a=(r=Pl.computeEngine)==null?void 0:r.box(t).latex)!=null?a:null;b!==null&&this._mathfield.setValue(b),window[Symbol.for("io.cortexjs.compute-engine")]||console.error(`MathLive 0.98.5: The CortexJS Compute Engine library is not available.
Load the library, for example with:
import "https://unpkg.com/@cortex-js/compute-engine?module"`)}get errors(){var t,r;return(r=(t=this._mathfield)==null?void 0:t.errors)!=null?r:[]}_getOptions(t){return this._mathfield?kl(this._mathfield.options,t):Tr.has(this)?l({},kl(l(l({},Kf()),Wf(Tr.get(this).options)),t)):null}getOptions(t){return console.warn("%cMathLive 0.98.5: %cDeprecated Usage%c\n `mf.getOptions()` is deprecated. Read the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem","color: inherit, font-size: 1rem"),this._mathfield?kl(this._mathfield.options,t):Tr.has(this)?kl(l(l({},Kf()),Wf(Tr.get(this).options)),t):null}reflectAttributes(){const t=Kf(),r=this._getOptions();Object.keys(Pl.optionsAttributes).forEach(a=>{const b=ba(a);Pl.optionsAttributes[a]==="on/off"?t[b]!==r[b]?this.setAttribute(a,r[b]?"on":"off"):this.removeAttribute(a):t[b]!==r[b]&&(Pl.optionsAttributes[a]==="boolean"?r[b]?this.setAttribute(a,""):this.removeAttribute(a):(typeof r[b]=="string"||typeof r[b]=="number")&&this.setAttribute(a,r[b].toString()))})}getOption(t){return console.warn("%cMathLive 0.98.5: %cDeprecated Usage%c\n `mf.getOption()` is deprecated. Read the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem","color: inherit, font-size: 1rem"),this._getOptions([t])[t]}_getOption(t){return this._getOptions([t])[t]}_setOptions(t){if(this._mathfield)this._mathfield.setOptions(t);else if(Tr.has(this)){const r=l(l({},Tr.get(this).options),t);Tr.set(this,h(l({},Tr.get(this)),{selection:{ranges:r.readOnly?[[0,0]]:[[0,-1]]},options:r}))}else Tr.set(this,{value:void 0,selection:{ranges:[[0,0]]},options:t,menuItems:void 0});this.reflectAttributes()}setOptions(t){console.group("%cMathLive 0.98.5: %cDeprecated Usage","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),console.warn(" `mf.setOptions()` is deprecated. Set the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.");for(const r of Object.keys(t))Xa[r]&&console.warn(`\`mf.setOptions({${r}:...})\` -> ${Xa[r]}`);console.groupEnd(),this._setOptions(t)}executeCommand(t){var r,a;return(a=(r=this._mathfield)==null?void 0:r.executeCommand(t))!=null?a:!1}getValue(t,r,a){var b,L;if(this._mathfield)return this._mathfield.model.getValue(t,r,a);if(Tr.has(this)){let N,J,ie;if(uc(t)?([N,J]=t.ranges[0],ie=r):cc(t)?([N,J]=t,ie=r):As(t)&&As(r)?(N=t,J=r,ie=a):(N=0,J=-1,ie=t),(ie===void 0||ie==="latex")&&N===0&&J===-1)return(L=(b=Tr.get(this).value)!=null?b:this.textContent)!=null?L:""}return""}setValue(t,r){if(this._mathfield&&t!==void 0){r!=null||(r={silenceNotifications:!0,mode:"math"}),this._mathfield.setValue(t,r);return}if(Tr.has(this)){const b=Tr.get(this).options;Tr.set(this,{value:t,selection:{ranges:[[-1,-1]],direction:"forward"},options:b,menuItems:void 0});return}const a=Uu(this);Tr.set(this,{value:t,selection:{ranges:[[-1,-1]],direction:"forward"},options:a,menuItems:void 0})}hasFocus(){var t,r;return(r=(t=this._mathfield)==null?void 0:t.hasFocus())!=null?r:!1}focus(){var t;(t=this._mathfield)==null||t.focus()}blur(){var t;(t=this._mathfield)==null||t.blur()}select(){var t;(t=this._mathfield)==null||t.select()}insert(t,r){var a,b;return(b=(a=this._mathfield)==null?void 0:a.insert(t,r))!=null?b:!1}applyStyle(t,r){var a;return(a=this._mathfield)==null?void 0:a.applyStyle(t,r)}queryStyle(t){var r,a;return(a=(r=this._mathfield)==null?void 0:r.queryStyle(t))!=null?a:"none"}get caretPoint(){var t,r;return(r=(t=this._mathfield)==null?void 0:t.getCaretPoint())!=null?r:null}set caretPoint(t){var r;t&&((r=this._mathfield)==null||r.setCaretPoint(t.x,t.y))}setCaretPoint(t,r){var a,b;return(b=(a=this._mathfield)==null?void 0:a.setCaretPoint(t,r))!=null?b:!1}offsetFromPoint(t,r,a){return this._mathfield?Iu(this._mathfield,t,r,a):-1}hitboxFromOffset(t){if(!this._mathfield)return null;const r=this._mathfield.model.at(t);if(!r)return null;const a=Ua(this._mathfield,r);return a?new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top):null}resetUndo(){var t;(t=this._mathfield)==null||t.resetUndo()}canUndo(){return this._mathfield?this._mathfield.canUndo():!1}canRedo(){return this._mathfield?this._mathfield.canRedo():!1}handleEvent(t){var r,a,b,L;Rs.state==="closed"&&((a=(r=this._mathfield)==null?void 0:r.menu)==null?void 0:a.state)==="closed"&&(t.type==="pointerdown"&&this.onPointerDown(),t.type==="focus"&&((b=this._mathfield)==null||b.focus()),t.type==="blur"&&((L=this._mathfield)==null||L.blur()))}connectedCallback(){var t,r,a,b;const L=window.getComputedStyle(this),N=this.shadowRoot,J=L.userSelect!=="none";if(J)N.host.addEventListener("pointerdown",this,!0);else{const pe=N.querySelector("span");pe.style.pointerEvents="none"}N.host.addEventListener("focus",this,!0),N.host.addEventListener("blur",this,!0),Oc()||(this.hasAttribute("role")||this.setAttribute("role","math"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","math input field"),this.setAttribute("aria-multiline","false")),J&&!this.hasAttribute("contenteditable")&&this.setAttribute("contenteditable","true"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0");const ie=N.querySelector("slot:not([name])");if(ie)try{this._style=ie.assignedElements().filter(pe=>pe.tagName.toLowerCase()==="style").map(pe=>pe.textContent).join("")}catch(pe){console.error(pe)}if(this._style){const pe=document.createElement("style");pe.textContent=this._style,N.appendChild(pe)}let ue="";if(this.hasAttribute("value")?ue=this.getAttribute("value"):ue=(t=ie==null?void 0:ie.assignedNodes().map(pe=>pe.nodeType===3?pe.textContent:"").join("").trim())!=null?t:"",this._mathfield=new wv(N.querySelector(":host > span"),h(l({},(a=(r=Tr.get(this))==null?void 0:r.options)!=null?a:Uu(this)),{eventSink:this,value:ue})),!Tr.has(this)){this.upgradeProperty("disabled"),this.upgradeProperty("readonly");for(const pe of Object.keys(Pl.optionsAttributes))this.upgradeProperty(ba(pe))}if(!((b=this._mathfield)!=null&&b.model)){this._mathfield=null;return}if(Tr.has(this)){const pe=this._mathfield,Ee=Tr.get(this),De=Ee.menuItems;pe.model.deferNotifications({content:!1,selection:!1},()=>{const je=Ee.value;je!==void 0&&pe.setValue(je),pe.model.selection=Ee.selection,Tr.delete(this)}),De&&(this.menuItems=De)}window.queueMicrotask(()=>{this.isConnected&&this.dispatchEvent(new Event("mount",{cancelable:!1,bubbles:!0,composed:!0}))}),Bf()}disconnectedCallback(){var t,r;if(this.shadowRoot.host.removeEventListener("pointerdown",this,!0),!this._mathfield)return;window.queueMicrotask(()=>this.dispatchEvent(new Event("unmount",{cancelable:!1,bubbles:!0,composed:!0})));const a=kl(this._mathfield.options,Object.keys(Pl.optionsAttributes).map(b=>ba(b)));Tr.set(this,{value:this._mathfield.getValue(),selection:this._mathfield.model.selection,menuItems:(r=(t=this._mathfield.menu)==null?void 0:t.menuItems)!=null?r:void 0,options:a}),this._mathfield.dispose(),this._mathfield=null}upgradeProperty(t){if(this.hasOwnProperty(t)){const r=this[t];delete this[t],(t==="readonly"||t==="read-only")&&(t="readOnly"),this[t]=r}}attributeChangedCallback(t,r,a){if(r===a)return;const b=a!==null;switch(t){case"contenteditable":wn(this._mathfield);break;case"disabled":this.disabled=b;break;case"read-only":case"readonly":this.readOnly=b;break;default:}}get readonly(){return this.hasAttribute("readonly")||this.hasAttribute("read-only")}set readonly(t){const r=!!t;r?(this.setAttribute("readonly",""),Oc()?this._internals.ariaReadOnly="true":this.setAttribute("aria-readonly","true"),this.setAttribute("aria-readonly","true")):(Oc()?this._internals.ariaReadOnly="false":this.removeAttribute("aria-readonly"),this.removeAttribute("readonly"),this.removeAttribute("read-only")),this._setOptions({readOnly:r})}get disabled(){return this.hasAttribute("disabled")}set disabled(t){var r;const a=!!t;a?this.setAttribute("disabled",""):this.removeAttribute("disabled"),Oc()?this._internals.ariaDisabled=a?"true":"false":this.setAttribute("aria-disabled",a?"true":"false"),a&&((r=this._mathfield)!=null&&r.hasFocus)&&window.mathVirtualKeyboard.visible&&this._mathfield.executeCommand("hideVirtualKeyboard")}get value(){return this.getValue()}set value(t){this.setValue(t)}get defaultMode(){return this._getOption("defaultMode")}set defaultMode(t){this._setOptions({defaultMode:t})}get macros(){return this._getOption("macros")}set macros(t){this._setOptions({macros:t})}get registers(){const t=this;return new Proxy({},{get:(r,a)=>{if(typeof a=="string")return t._getOption("registers")[a]},set(r,a,b){return typeof a!="string"?!1:(t._setOptions({registers:h(l({},t._getOption("registers")),{[a]:b})}),!0)}})}set registers(t){this._setOptions({registers:t})}get colorMap(){return this._getOption("colorMap")}set colorMap(t){this._setOptions({colorMap:t})}get backgroundColorMap(){return this._getOption("backgroundColorMap")}set backgroundColorMap(t){this._setOptions({backgroundColorMap:t})}get letterShapeStyle(){return this._getOption("letterShapeStyle")}set letterShapeStyle(t){this._setOptions({letterShapeStyle:t})}get minFontScale(){return this._getOption("minFontScale")}set minFontScale(t){this._setOptions({minFontScale:t})}get smartMode(){return this._getOption("smartMode")}set smartMode(t){this._setOptions({smartMode:t})}get smartFence(){return this._getOption("smartFence")}set smartFence(t){this._setOptions({smartFence:t})}get smartSuperscript(){return this._getOption("smartSuperscript")}set smartSuperscript(t){this._setOptions({smartSuperscript:t})}get scriptDepth(){return this._getOption("scriptDepth")}set scriptDepth(t){this._setOptions({scriptDepth:t})}get removeExtraneousParentheses(){return this._getOption("removeExtraneousParentheses")}set removeExtraneousParentheses(t){this._setOptions({removeExtraneousParentheses:t})}get mathModeSpace(){return this._getOption("mathModeSpace")}set mathModeSpace(t){this._setOptions({mathModeSpace:t})}get placeholderSymbol(){return this._getOption("placeholderSymbol")}set placeholderSymbol(t){this._setOptions({placeholderSymbol:t})}get popoverPolicy(){return this._getOption("popoverPolicy")}set popoverPolicy(t){this._setOptions({popoverPolicy:t})}get environmentPopoverPolicy(){return this._getOption("environmentPopoverPolicy")}set environmentPopoverPolicy(t){this._setOptions({environmentPopoverPolicy:t})}get menuItems(){var t,r,a;return this._mathfield?(t=this._mathfield.menu._menuItems.map(b=>b.menuItem))!=null?t:[]:(a=(r=Tr.get(this))==null?void 0:r.menuItems)!=null?a:[]}set menuItems(t){var r;if(this._mathfield){const a=(r=this._mathfield.element)==null?void 0:r.querySelector("[part=menu-toggle]");a&&(a.style.display=t.length===0?"none":""),this._mathfield.menu.menuItems=t}Tr.has(this)?Tr.set(this,h(l({},Tr.get(this)),{menuItems:t})):Tr.set(this,{value:void 0,selection:{ranges:[[0,0]]},options:Uu(this),menuItems:t})}get mathVirtualKeyboardPolicy(){return this._getOption("mathVirtualKeyboardPolicy")}set mathVirtualKeyboardPolicy(t){this._setOptions({mathVirtualKeyboardPolicy:t})}get inlineShortcuts(){return this._getOption("inlineShortcuts")}set inlineShortcuts(t){this._setOptions({inlineShortcuts:t})}get inlineShortcutTimeout(){return this._getOption("inlineShortcutTimeout")}set inlineShortcutTimeout(t){this._setOptions({inlineShortcutTimeout:t})}get keybindings(){return this._getOption("keybindings")}set keybindings(t){this._setOptions({keybindings:t})}get onInlineShortcut(){return this._getOption("onInlineShortcut")}set onInlineShortcut(t){this._setOptions({onInlineShortcut:t})}get onScrollIntoView(){return this._getOption("onScrollIntoView")}set onScrollIntoView(t){this._setOptions({onScrollIntoView:t})}get onExport(){return this._getOption("onExport")}set onExport(t){this._setOptions({onExport:t})}get readOnly(){return this._getOption("readOnly")}set readOnly(t){this._setOptions({readOnly:t})}get isSelectionEditable(){var t,r;return(r=(t=this._mathfield)==null?void 0:t.isSelectionEditable)!=null?r:!1}setPromptState(t,r,a){var b;(b=this._mathfield)==null||b.setPromptState(t,r,a)}getPromptState(t){var r,a;return(a=(r=this._mathfield)==null?void 0:r.getPromptState(t))!=null?a:[void 0,!0]}get virtualKeyboardTargetOrigin(){return this._getOption("virtualKeyboardTargetOrigin")}set virtualKeyboardTargetOrigin(t){this._setOptions({virtualKeyboardTargetOrigin:t})}get selection(){return this._mathfield?this._mathfield.model.selection:Tr.has(this)?Tr.get(this).selection:{ranges:[[0,0]],direction:"forward"}}set selection(t){if(typeof t=="number"&&(t={ranges:[[t,t]]}),this._mathfield){this._mathfield.model.selection=t,wn(this._mathfield);return}if(Tr.has(this)){Tr.set(this,h(l({},Tr.get(this)),{selection:t}));return}Tr.set(this,{value:void 0,selection:t,options:Uu(this),menuItems:void 0})}get selectionIsCollapsed(){const t=this.selection;return t.ranges.length===1&&t.ranges[0][0]===t.ranges[0][1]}get position(){return this._mathfield?this._mathfield.model.position:Tr.has(this)?Tr.get(this).selection.ranges[0][0]:0}set position(t){if(this._mathfield&&(this._mathfield.model.position=t,wn(this._mathfield)),Tr.has(this)){Tr.set(this,h(l({},Tr.get(this)),{selection:{ranges:[[t,t]]}}));return}Tr.set(this,{value:void 0,selection:{ranges:[[t,t]]},options:Uu(this),menuItems:void 0})}getOffsetDepth(t){var r,a;return this._mathfield?((a=(r=this._mathfield.model.at(t))==null?void 0:r.treeDepth)!=null?a:2)-2:0}get lastOffset(){var t,r;return(r=(t=this._mathfield)==null?void 0:t.model.lastOffset)!=null?r:-1}};pi.version="0.98.5",pi._fontsDirectory="./fonts",pi._soundsDirectory="./sounds",pi.keypressVibration=!0,pi._keypressSound={spacebar:"keypress-spacebar.wav",return:"keypress-return.wav",delete:"keypress-delete.wav",default:"keypress-standard.wav"},pi._plonkSound="plonk.wav",pi.audioBuffers={},pi.createHTML=e=>e,pi._speechEngineRate="100%",pi._speechEngineVoice="Joanna",pi._textToSpeechMarkup="",pi._textToSpeechRules="mathlive",pi._textToSpeechRulesOptions={},pi.speakHook=hv,pi.readAloudHook=xv,pi._decimalSeparator=".",pi.fractionNavigationOrder="numerator-denominator",pi._isFunction=e=>{var t,r;const a=window.MathfieldElement.computeEngine;return(r=(t=a==null?void 0:a.parse(e).domain)==null?void 0:t.isFunction)!=null?r:!1};var Hu=pi;function ba(e){return e.replace(/[^a-zA-Z\d]+(.)/g,(t,r)=>r.toUpperCase())}function Uu(e){const t={readOnly:!1},r=Hu.optionsAttributes;return Object.keys(r).forEach(a=>{if(e.hasAttribute(a)){const b=e.getAttribute(a);a==="placeholder"?t.contentPlaceholder=b!=null?b:"":r[a]==="boolean"?t[ba(a)]=!0:r[a]==="on/off"?b==="on"?t[ba(a)]=!0:b==="off"?t[ba(a)]=!1:t[ba(a)]=void 0:r[a]==="number"?t[ba(a)]=Number.parseFloat(b!=null?b:"0"):t[ba(a)]=b}}),t}function Oc(){return!(!("ElementInternals"in window)||!HTMLElement.prototype.attachInternals||!("role"in window.ElementInternals.prototype))}var Ep=Hu,Mp,Tp,Ap,Lp;if(u()&&!((Mp=window.customElements)!=null&&Mp.get("math-field"))){(Ap=window[Tp=Symbol.for("io.cortexjs.mathlive")])!=null||(window[Tp]={});const e=window[Symbol.for("io.cortexjs.mathlive")];e.version="0.98.5",window.MathfieldElement=Hu,(Lp=window.customElements)==null||Lp.define("math-field",Hu)}function Cv(e,t,r){let a=r,b=0;const L=e.length;for(;a<t.length;){const N=t[a];if(b<=0&&t.slice(a,a+L)===e)return a;N==="\\"?a++:N==="{"?b++:N==="}"&&b--,a++}return-1}function ah(e,t,r,a,b="latex"){const L=[];for(const N of e)if(N.type==="text"){const J=N.data;let ie=!0,ue=0,pe;pe=J.indexOf(t),pe!==-1&&(ue=pe,ue>0&&L.push({type:"text",data:J.slice(0,ue)}),ie=!1);let Ee=!1;for(;!Ee;){if(ie){if(pe=J.indexOf(t,ue),pe===-1){Ee=!0;break}ue!==pe&&L.push({type:"text",data:J.slice(ue,pe)}),ue=pe}else{if(pe=Cv(r,J,ue+t.length),pe===-1){Ee=!0;break}let De=J.slice(ue+t.length,pe);b==="ascii-math"&&([,De]=bl(De,{format:"ascii-math"})),L.push({type:"math",data:De,rawData:J.slice(ue,pe+r.length),mathstyle:a}),ue=pe+r.length}ie=!ie}ue<J.length&&L.push({type:"text",data:J.slice(ue)})}else L.push(N);return L}function Op(e,t,r){let a=[{type:"text",data:e}];return t!=null&&t.inline&&t.inline.forEach(([b,L])=>{a=ah(a,b,L,"textstyle")}),t!=null&&t.display&&t.display.forEach(([b,L])=>{a=ah(a,b,L,"displaystyle")}),r!=null&&r.inline&&r.inline.forEach(([b,L])=>{a=ah(a,b,L,"textstyle","ascii-math")}),r!=null&&r.display&&r.display.forEach(([b,L])=>{a=ah(a,b,L,"displaystyle","ascii-math")}),a}function kv(e,t){const r=document.createElement("span");r.setAttribute("translate","no");try{const a="<math xmlns='http://www.w3.org/1998/Math/MathML'>"+t.renderToMathML(e)+"</math>";r.innerHTML=window.MathfieldElement.createHTML(a)}catch(a){console.error(`MathLive 0.98.5: Could not convert "${e}"' to MathML with ${a}`),r.textContent=e}return r.className="ML__sr-only",r}function Ev(e,t,r,a){try{const b=t.renderToMarkup(e,{mathstyle:r,format:"html"}),L=document.createElement("span");return L.dataset.latex=e,L.style.display=r==="displaystyle"?"flex":"inline-flex",L.setAttribute("aria-hidden","true"),L.setAttribute("translate","no"),L.innerHTML=window.MathfieldElement.createHTML(b),L}catch(b){if(console.error("Could not parse'"+e+"' with ",b),a)return document.createTextNode(e)}return null}function Dc(e,t,r,a){var b;const L=Ev(e,r,t||"textstyle",a),N=(b=r.renderAccessibleContent)!=null?b:"";if(L&&/\b(mathml|speakable-text)\b/i.test(N)){const J=document.createElement("span");if(/\bmathml\b/i.test(N)&&r.renderToMathML&&J.append(kv(e,r)),/\bspeakable-text\b/i.test(N)&&r.renderToSpeakableText){const ie=document.createElement("span");ie.setAttribute("translate","no");const ue=r.renderToSpeakableText(e);ie.innerHTML=window.MathfieldElement.createHTML(ue),ie.className="ML__sr-only",J.append(ie)}return J.append(L),J}return L}function Mv(e,t){var r,a,b;let L=null;if((r=t.TeX)!=null&&r.processEnvironments&&/^\s*\\begin/.test(e)){L=document.createDocumentFragment();const N=Dc(e,"",t,!0);N&&L.appendChild(N)}else{if(!e.trim())return null;const N=Op(e,(a=t.TeX)==null?void 0:a.delimiters,(b=t.asciiMath)==null?void 0:b.delimiters);if(N.length===1&&N[0].type==="text")return null;L=document.createDocumentFragment();for(const J of N)if(J.type==="text")L.appendChild(document.createTextNode(J.data));else{const ie=Dc(J.data,J.mathstyle==="textstyle"?"textstyle":"displaystyle",t,!0);ie&&L.appendChild(ie)}}return L}function Dp(e,t){var r,a,b,L,N,J,ie,ue,pe,Ee,De,je,ze,Je,pt,Xe;if(e.childNodes.length===1&&e.childNodes[0].nodeType===3){const ot=(r=e.childNodes[0].textContent)!=null?r:"";if((a=t.TeX)!=null&&a.processEnvironments&&/^\s*\\begin/.test(ot)){e.textContent="";const ct=Dc(ot,"",t,!0);ct&&e.append(ct);return}const gt=Op(ot,(b=t.TeX)==null?void 0:b.delimiters,(L=t.asciiMath)==null?void 0:L.delimiters);if(gt.length===1&&gt[0].type==="math"){e.textContent="";const ct=Dc(gt[0].data,gt[0].mathstyle==="textstyle"?"textstyle":"displaystyle",t,!0);ct&&e.append(ct);return}if(gt.length===1&&gt[0].type==="text")return}for(let ot=e.childNodes.length-1;ot>=0;ot--){const gt=e.childNodes[ot];if(gt.nodeType===3){const ct=Mv((N=gt.textContent)!=null?N:"",t);ct&&(ot+=ct.childNodes.length-1,gt.replaceWith(ct))}else if(gt.nodeType===1){const ct=gt,Dt=gt.nodeName.toLowerCase();if(Dt==="script"){const Bt=gt;let Rt;if((J=t.processScriptTypePattern)!=null&&J.test(Bt.type))Rt=(ie=Bt.textContent)!=null?ie:"";else if((ue=t.processMathJSONScriptTypePattern)!=null&&ue.test(Bt.type))try{Rt=(Ee=t.serializeToLatex)==null?void 0:Ee.call(t,JSON.parse((pe=Bt.textContent)!=null?pe:""))}catch(br){console.error(br)}if(Rt){let br="textstyle";for(const wt of Bt.type.split(";")){const[yo,zs]=wt.toLowerCase().split("=");yo.trim()==="mode"&&(br=zs.trim()==="display"?"displaystyle":"textstyle")}const Gr=Dc(Rt,br,t,!0);Gr&&Bt.parentNode.replaceChild(Gr,Bt)}}else if(((je=(De=t.processClassPattern)==null?void 0:De.test(ct.className))!=null?je:!1)||!((Je=(ze=t.skipTags)==null?void 0:ze.includes(Dt))!=null&&Je||(Xe=(pt=t.ignoreClassPattern)==null?void 0:pt.test(ct.className))!=null&&Xe))if(e.childNodes.length===1&&e.childNodes[0].nodeType===3){const Rt=e.textContent;e.textContent="";const br=Dc(Rt!=null?Rt:"","displaystyle",t,!0);br&&e.append(br)}else Dp(ct,t)}}}var Tv={skipTags:["math-field","noscript","style","textarea","pre","code","annotation","annotation-xml"],processScriptType:"math/tex",processMathJSONScriptType:"math/json",ignoreClass:"tex2jax_ignore",processClass:"tex2jax_process",renderAccessibleContent:"mathml",asciiMath:{delimiters:{inline:[["`","`"]]}},TeX:{processEnvironments:!0,delimiters:{inline:[["\\(","\\)"]],display:[["$$","$$"],["\\[","\\]"]]}}};function Av(e,t){var r,a,b,L;try{const N=l(l({},Tv),t);N.ignoreClassPattern=new RegExp((r=N.ignoreClass)!=null?r:""),N.processClassPattern=new RegExp((a=N.processClass)!=null?a:""),N.processScriptTypePattern=new RegExp((b=N.processScriptType)!=null?b:""),N.processMathJSONScriptTypePattern=new RegExp((L=N.processMathJSONScriptType)!=null?L:""),Bf(),io("core"),Dp(e,N)}catch(N){N instanceof Error?console.error("renderMathInElement(): "+N.message):console.error("renderMathInElement(): Could not render math for element",e)}}function Lv(e,t){const r=Ga.singleton;return r?(r.show(),Lu(),r.currentLayer=t,r.render(),r.focus(),!0):!1}function Ov(){const e=window.mathVirtualKeyboard;return e.visible?e.hide({animate:!0}):e.show({animate:!0}),!1}oo({switchKeyboardLayer:Lv,toggleVirtualKeyboard:Ov,hideVirtualKeyboard:()=>(window.mathVirtualKeyboard.hide({animate:!0}),!1),showVirtualKeyboard:()=>(window.mathVirtualKeyboard.show({animate:!0}),!1)},{target:"virtual-keyboard"});function Ya(){var e,t;return(t=globalThis[e=Symbol.for("io.cortexjs.mathlive")])!=null||(globalThis[e]={}),globalThis[Symbol.for("io.cortexjs.mathlive")]}function Fv(){return console.warn("%cMathLive 0.98.5: %cmakeSharedVirtualKeyboard() is deprecated. \n Use `window.mathVirtualKeyboard` to access the virtual keyboard instance.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),window.mathVirtualKeyboard}function zv(e){Pv(document.body,e)}function Dv(e){if(typeof e=="string"){const t=document.getElementById(e);if(t===null)throw new Error(`The element with ID "${e}" could not be found.`);return t}return typeof e=="string"?null:e}function Pv(e,t){var r,a,b,L;const N=Dv(e);if(!N)return;const J=t!=null?t:{};(r=J.renderToMarkup)!=null||(J.renderToMarkup=oi),(a=J.renderToMathML)!=null||(J.renderToMathML=$g),(b=J.renderToSpeakableText)!=null||(J.renderToSpeakableText=Gg),(L=J.serializeToLatex)!=null||(J.serializeToLatex=Vg),Av(N,J)}var Hv={mathlive:"0.98.5"}}}]);
}());