!(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(84089),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(84089),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 `.concat(x,` `),S&&(H+="".concat(S,` `)),H+=` `,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=` `,R=function(oe){H+="".concat(oe,"")},F=function(oe){H+="".concat(oe,"")},D=function(oe){H+="".concat(oe,"")},B=function(oe){H+="".concat(oe,"")},P=0,U=S.length;P",u(G.allowedOrigin).forEach(R),u(G.allowedMethod).forEach(F),u(G.allowedHeader).forEach(D),u(G.exposeHeader).forEach(B),G.maxAgeSeconds&&(H+="".concat(G.maxAgeSeconds,"")),H+="";return H+="",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=` `,R+=" ".concat(S?"true":"false",` `),w&&w.length>0){for(R+=` `,F=0;F".concat(w[F],` `);R+=` `}else R+=` `;return R+="",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,!(Z0&&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.startthis.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 P1&&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,!(F0)){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 `,U=0;U `,P+="".concat(G.number,` `),P+="".concat(G.etag,` `),P+=` `;return P+="",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;S1&&_[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(!(B0){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]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&&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],""):g(h[o])==="object"?d+="<".concat(o,">").concat(l(h[o]),""):g(h[o])==="array"?d+=h[o].map(function(s){return"<".concat(o,">").concat(l(s),"")}).join(""):d+="<".concat(o,">").concat(h[o].toString(),""))}):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);o2&&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){v1&&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=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=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=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=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-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;d0)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>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;FB?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=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=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);Fe2&&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;sese&&(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;We2147483647?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;NeRe&&(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>>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;Me239?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;gege)&&(se=ge);for(var Me="",Fe=V;Fege&&(V=ge),se<0?(se+=ge,se<0&&(se=0)):se>ge&&(se=ge),sese)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>>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=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||VW.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>>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>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&<===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=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=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>>0,ge=ge===void 0?this.length:ge>>>0,V||(V=0);var Re;if(typeof V=="number")for(Re=se;Re55295&&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>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=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>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(y0;)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;u0;)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;_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<>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<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<>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;Yb)","g");return h.exec("b").groups.a!=="b"||"b".replace(h,"$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)});xn1?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=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=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;P3)){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;Zd(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;oeS)throw y(w);for(ee=o(F,G),K=0;KD-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;K2){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;Lexe)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($,"$")!=="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=_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=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=[];Ae2?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;u1?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(;Px;)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]/;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;s0&&(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;G0&&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=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=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;x1&&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){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<>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<>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<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&&++h1)for(var A=1;A=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>>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>>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;g0)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;y2){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;s0&&(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;uw){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(;++$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;u1)for(var R=1;R= 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=55296&&Te<=56319&&de65535&&(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=128&&G("not-basic"),Le.push(we.charCodeAt(_e));for(ne=Pe>0?Pe+1:0;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,!(reB(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=Le&&TB((o-de)/q)&&G("overflow"),de+=(Pe-Le)*q,Le=Pe,Be=0;Beo&&G("overflow"),T==Le){for(_e=de,ne=s;te=ne<=Ae?u:ne>=Ae+m?m:ne-Ae,!(_e0&&m>u&&(m=u);for(var y=0;y=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;s0?(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=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-T0?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.length1&&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=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 TW.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-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.length0?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=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=0;--we){var Le=this.tryEntries[we];if(Le.tryLoc<=this.prev&&h.call(Le,"finallyLoc")&&this.prev=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;Tne)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"||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",_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.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"?(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+=""?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="";++z1114111||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;d0)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=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-z0?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.length1&&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;Me0,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=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-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.length0?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 HB.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;m0;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>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=0?(P>0&&(R.lastNeed=P-1),P):--B=0?(P>0&&(R.lastNeed=P-2),P):--B=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=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=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-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-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""},l=function(o){return o.replace("]]>","]]]]>")},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;A0&&(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=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)+""),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)+""+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=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=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;eeG},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;ee0){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"),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("")):(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("");else{for(this.stream.write(">"+this.endline(u,m,y)),m.state=g.InsideTag,B=u.children,A=0,H=B.length;A")}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","]]]]>"),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,"&").replace(//g,">").replace(/\r/g," "))},h.prototype.attEscape=function(v){var d;return this.options.noValidation?v:(d=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,v.replace(d,"&").replace(/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)+""+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)+""+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)+"",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+="0){for(K+=" [",K+=this.endline(D,B,P),B.state=g.InsideTag,Z=D.children,G=0,ee=Z.length;G",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+=""+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+=""+this.endline(D,B,P);else{if(B.dontPrettyTextNodes){for(Ce=D.children,Z=0,oe=Ce.length;Z"+this.endline(D,B,P),B.state=g.InsideTag,we=D.children,$=0,ae=we.length;$",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)+"",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)+""+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)+""+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)+""+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)+""+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;hv?y=m(y):y.length>5]|=128<<_%32,y[(_+64>>>9<<4)+14]=_;for(var x=1732584193,S=-271733879,w=-1732584194,A=271733878,H=0;H>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>16)+(s>>16)+(u>>16);return m<<16|u&65535}function d(o,s){return 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&&$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;Y0?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{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;zq.length)&&(z=q.length);for(var W=0,V=new Array(z);W=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=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=$.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{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;_tcr?(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;MrVt+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]=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=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;tn1&&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=SoHi?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.rightYr+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);ttOe)}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{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(29691),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{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{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=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;S0;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=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'"]=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;su.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?` `:"")+"",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?"/":""&&(A+=">"),o[y]=A}if(h.replaceSelections(o),d=h.listSelections(),!m)for(var y=0;y=0&&v[_]==d;_--)++y;o=m.to;for(var _=1;_=_.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)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=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"\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:ck?-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;Xc||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;Oc)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-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;O0}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.posc},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.lastColumnPos0?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=n.first&&ck?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;Cthis.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;VeKe&&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(;utn.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&&kec.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.posn.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(;vece;--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.highlightFrontierk;C--){var O=xt(n,C).stateAfter;if(O&&(!(O instanceof Zn)||C+O.lookAhead=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=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.from0&&me)for(var Lt=0;Lt0)){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;kc)&&(!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=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;Oc.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;Oke&&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;ceve||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=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;X2&&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;Ck)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=k.lineN&&cc)&&(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=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+me0&&(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=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=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=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=utyt)&&(Ie=Ke,He=yt)}}return Ie||(Ie=O[O.length-1]),Ie.fromke&&(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;ce0&&(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;Cc)&&(O.updateLineNumbers=c),n.curOp.viewChanged=!0,c>=O.viewTo)An&&Ut(n.doc,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=O.lineN&&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;ve0){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.viewFromk&&(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=n.display.viewTo||me.to().line0?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.005||Ie<-.005)&&(vr(O.line,ce),Bc(O.line),O.rest))for(var He=0;Hen.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=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.topme-C;if(c.topO+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.leftKe+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.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=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&&Vek)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=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.viewFromce&&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-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;cece.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=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;X0: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;C1&&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;me1&&!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-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=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=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=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;Cn.lastLine())){if(c.from.lineX&&(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){k1||!(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;c50){for(var ce=O.lines.length%25+25,me=ce;me10);n.parent.maybeSpill()}},iterN:function(n,c,k){for(var C=0;Cn.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;O0||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=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.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=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;Cn)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.linec&&(c=n.from),n.to!=null&&n.to-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=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=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&&Ct0==(Nt.level!=1),lr=zt?St.begin:me(St.end,-1);if(Nt.from<=lr&&lr0?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.line0)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;Cn&&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.lineKe.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=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;me20*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(Vece,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=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-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;CX&&(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;He0&&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]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;ke0&&Ie(X.charAt(ce-1));)--ce;for(;me.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+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&&Mf(c,C)||{node:me[0].measure.map[2],offset:0},ke=O.linen.firstLine()&&(C=at(C.line-1,xt(n.doc,C.line-1).length)),O.ch==xt(n.doc,O.line).text.length&&O.linec.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);KeC.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=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);ce1e3||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=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=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:"",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-1&&M.substring(g+1,M.length);if(l)return he.findModeByExtension(l)},he.findModeByName=function(M){M=M.toLowerCase();for(var E=0;E0?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&&/$/,blockCommentStart:"",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;$>>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>>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]',"select"),this.addActionButton(re,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(re,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(re,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(re,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(re,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(re,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(re,'',"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='',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,'',"render"),this.addActionButton(q,'',"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;I0&&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||'')||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=` `),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||'')||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||'')||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=` `;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='',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='',T}(P),G=function(te){function T(I,re,q,z){var W=te.call(this,I,z||'')||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='',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;ge0&&(se=!0,geV&&(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='',T}(A),Z=function(te){function T(I,re,q){var z=te.call(this,I,q||'')||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=` `,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=` `,$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='',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='',T}(H),ae=function(te){function T(I,re,q,z){var W=te.call(this,I,z||'')||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='',T}(oe),Y='',le='',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.width/2&&this.tipPosition.y>=this.height/2?z.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='',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='',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='',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='',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;rethis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*T:this.editorCanvas.clientWidth,re=I',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-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),q1&&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=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'),_.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>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;l65535?(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)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=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)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>>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));w0||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>>0}l.ensureContrastRatio=function(d,o,s){var u=M.relativeLuminance(d>>8),m=M.relativeLuminance(o>>8);if(g(u,m)>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>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=0;--s)this.setCell(l+h+s,this.loadCell(l+s,o));for(s=0;sthis.length){var v=new Uint32Array(3*l);this.length&&(3*l=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=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=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>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;M24)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.length131072)for(var U=0;U0&&ye.getWidth(G.x-1)===2&&ye.setCellFromCodePoint(G.x-1,0,1,ae.fg,ae.bg,ae.extended);for(var Y=D;Y=Z){if($){for(;G.x=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.x0&&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.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.yB.scrollBottom||B.yD.scrollBottom||D.yD.scrollBottom||D.yD.scrollBottom||D.yD.scrollBottom||D.y0||(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=2||P[1]===2&&G+U>=5)break;P[1]&&(U=1)}while(++G+D5)&&(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=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;B256)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>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>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(;l0&&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=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;d1)for(var w=this._getJoinedRanges(s,y,m,d,u),A=0;A1)for(w=this._getJoinedRanges(s,y,m,d,u),A=0;A=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;Be47)},$.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=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&&m0?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;y1)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_||_>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>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(++R47&&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;w0&&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)&&Fthis._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>>24,K=U.rgba>>>16&255,Z=U.rgba>>>8&255,$=0;$=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=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=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>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]=A[0]&&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]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]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(;U1&&($+=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(;ae1&&($+=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=0&&vv?"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;o0?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&&Zh?"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=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;ms&&y.y1<=u+1||y.y2>s&&y.y2<=u+1||y.y1u+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;_=x.x1&&m=x.x1||y===x.y2&&mx.y1&&yu;)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;m0?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=" ":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=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;xS;)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=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"],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;ys?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&&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.yu.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;F0?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=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&&sQ.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._cols0&&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(y0&&(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._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=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&&A0&&(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;P0;)this.ybase===0?this.y0){var ye=[],Y=[];for(P=0;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+10;);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?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.liney.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._currentthis._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;gthis._length)for(var p=this._length;p=E;h--)this._array[this._getCyclicIndex(h+g.length)]=this._array[this._getCyclicIndex(h)];for(h=0;hthis._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=h&&p0&&(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;hd&&(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=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=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){gthis._end&&(this._end=g)},p.prototype.markRangeDirty=function(g,l){if(g>l){var h=g;g=l,l=h}gthis._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)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;lv[s][1])return!1;for(;s>=o;)if(h>v[d=o+s>>1][1])o=d+1;else{if(!(h=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;E5e7)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;pt 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=0&&(Ee=(1-ze)*Ee+ze*ie,De=(1-ze)*De+ze*ue,je=(1-ze)*je+ze*pe,ze=-1),pt+1=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&&a120831)&&(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[]$&#^_%:'\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{var ie,ue;return N.frequency===J.frequency?N.match.length===J.match.length?N.matchN.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=``;return`${De}`}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)=>``).join("");return`${ie}`}function uf(e){return ic[e]?ic[e][2]/1e3:ha[e][2]}function ff(e){const t=[];for(let r=0;r=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=this.s.length}get(){return this.pos";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"):"<$>"}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===""?N.push("~"):J==="<}>"&&N.push("\\}")}else if(J==="\\csname"){for(;e.peek()==="";)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={"":" ","<$$>":"$$","<$>":"$","<{>":"{","<}>":"}"}[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='',N+=L,N+="",N+='${this.svgOverlay}`}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=`${L}${N}`:De=L,this.caret==="text"?De+='':this.caret==="math"&&(De+=''),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;r0){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{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?"":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=":"\\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(;J0;)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","\\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;Lt)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));peze.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;per.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;en0&&(Ks+=pt,Us=Math.max(Us,Ks),Ks=0),en0&&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;b0&&a.push(" & "),a.push(et.serialize(this.array[b][L],t));if(bt);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;at);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;rb.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;Lr.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+=''),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?!/^(<$$>|<$>||<{>|<}>|#[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.index0&&(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"););}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(""););}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==="")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===""?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={"":" ","<$$>":"$$","<$>":"$"}[a])!=null?e:a)}return t}scanNumber(e=!0){var t,r;let a=!1,b=this.peek();for(;b===""||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["<}>","&","\\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===""?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;ue0){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":/^[=<>]/,"#":/^[#\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;ot0,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":{"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"||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+='`}};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);Rtnew 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``}};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: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":'+'),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:"* 🔢",numpaddivide:"/ 🔢",numpadsubtract:"- 🔢",numpadadd:"+ 🔢",numpaddecimal:". 🔢",numpadcomma:", 🔢",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("
");a+=`
  • ${J}${ie}`,ue&&(a+=`${ue}`),a+="
  • "}const b=am(e,`
      ${a}
    `);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.ya.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{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+=`${oi(ie)}`)}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:"αβγ",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.greek",rows:[[{label:"φ",class:"MLK__tex hide-shift",insert:"\\varphi",aside:"phi var.",shift:"\\Phi"},{label:"ς",class:"MLK__tex hide-shift",insert:"\\varsigma",aside:"sigma var.",shift:"\\Sigma"},{label:"ϵ",class:"MLK__tex hide-shift",insert:"\\epsilon",aside:"espilon",shift:'\\char"0190'},{label:"ρ",class:"MLK__tex hide-shift",insert:"\\rho",aside:"rho",shift:'\\char"3A1'},{label:"τ",class:"MLK__tex hide-shift",insert:"\\tau",aside:"tau",shift:'\\char"3A4'},{label:"υ",class:"MLK__tex hide-shift",insert:"\\upsilon",aside:"upsilon",shift:"\\Upsilon"},{label:"θ",class:"MLK__tex hide-shift",insert:"\\theta",aside:"theta",shift:"\\Theta"},{label:"ι",class:"MLK__tex hide-shift",insert:"\\iota",aside:"iota",shift:'\\char"399'},{label:"ο",class:"MLK__tex hide-shift",insert:"\\omicron",aside:"omicron",shift:'\\char"39F'},{label:"π",class:"MLK__tex hide-shift",insert:"\\pi",aside:"pi",shift:"\\Pi"}],["[separator-5]",{label:"α",class:"MLK__tex hide-shift",insert:"\\alpha",aside:"alpha",shift:'\\char"391'},{label:"σ",class:"MLK__tex hide-shift",insert:"\\sigma",aside:"sigma",shift:"\\Sigma"},{label:"δ",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:"γ",class:"MLK__tex hide-shift",insert:"\\gamma",aside:"gamma",shift:"\\Gamma"},{label:"η",class:"MLK__tex hide-shift",insert:"\\eta",aside:"eta",shift:'\\char"397'},{label:"ξ",class:"MLK__tex hide-shift",insert:"\\xi",aside:"xi",shift:"\\Xi"},{label:"κ",class:"MLK__tex hide-shift",insert:"\\kappa",aside:"kappa",shift:"\\Kappa"},{label:"λ",class:"MLK__tex hide-shift",insert:"\\lambda",aside:"lambda",shift:"\\Lambda"},"[separator-5]"],["[shift]",{label:"ζ",class:"MLK__tex hide-shift",insert:"\\zeta",aside:"zeta",shift:'\\char"396'},{label:"χ",class:"MLK__tex hide-shift",insert:"\\chi",aside:"chi",shift:'\\char"3A7'},{label:"ψ",class:"MLK__tex hide-shift",insert:"\\psi",aside:"zeta",shift:"\\Psi"},{label:"ω",class:"MLK__tex hide-shift",insert:"\\omega",aside:"omega",shift:"\\Omega"},{label:"β",class:"MLK__tex hide-shift",insert:"\\beta",aside:"beta",shift:'\\char"392'},{label:"ν",class:"MLK__tex hide-shift",insert:"\\nu",aside:"nu",shift:'\\char"39D'},{label:"μ",class:"MLK__tex hide-shift",insert:"\\mu",aside:"mu",shift:'\\char"39C'},"[backspace]"],["[separator]",{label:"ε",class:"MLK__tex",insert:"\\varepsilon",aside:"espilon var."},{label:"ϑ",class:"MLK__tex",insert:"\\vartheta",aside:"theta var."},{label:"ϰ",class:"MLK__tex",insert:"\\varkappa",aside:"kappa var."},{label:"ϖ",class:"MLK__tex",insert:"\\varpi",aside:"pi var."},{label:"ϱ",class:"MLK__tex",insert:"\\varrho",aside:"rho var."},"[left]","[right]","[action]"]]},symbols:{label:"∞\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
    \u207B\xB3\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\,\\char"2039',insert:"\\,",aside:"thin space
    \xB3\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\:\\char"2039',insert:"\\:",aside:"medium space
    \u2074\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\;\\char"2039',insert:"\\;",aside:"thick space
    \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+=`
    ${ot}
    `}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:'',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:'',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='
    ';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+=`
    ${(a=J.label)!=null?a:"untitled"}
    `}return b+="
    ",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:`
    `,redo:`
    `,cutToClipboard:`
    `,copyToClipboard:`
    `,pasteFromClipboard:`
    `};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=` `;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(`
    `),(e.normalizedLayouts.length>1||t.displayEditToolbar)&&(a.push("")),a.push(Rm(e,b)),a.push("
    ");return a.join("")}function Rm(e,t){if(typeof t=="string")return t;let r="";if(typeof t.style=="string"?r+=``:typeof t.style=="object"&&(r+=``),t.backdrop&&(r+=`
    `),t.container&&(r+=`
    `),t.rows){r+="
    ";for(const a of t.rows){r+="
    ";for(const b of a)if(b){const L=e.registerKeycap(b),[N,J]=Hf(b);/(^|\s)separator/.test(J)?r+=`
    ${N}
    `}r+="
    "}r+="
    "}else t.markup&&(r+=t.markup);return t.container&&(r+="
    "),t.backdrop&&(r+="
    "),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+=`${Ee}`}e.aside&&(ue+=``)}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:"",command:["performWithFeedback","moveToPreviousChar"],shift:{label:"",command:["performWithFeedback","extendSelectionBackward"]}},"[right]":{class:"action hide-shift",label:"",command:["performWithFeedback","moveToNextChar"],shift:{label:"",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:""},"[action]":{class:"action hide-shift",command:["performWithFeedback","commit"],shift:{label:"",command:["performWithFeedback","addRowAfter"]},width:1.5,label:""},"[hr]":{class:"separator horizontal-rule"},"[hide-keyboard]":{class:"action",command:["hideVirtualKeyboard"],width:1.5,label:""},"[.]":{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:"−",shift:"\\pm",class:"big-op hide-shift"},"[/]":{class:"big-op hide-shift",shift:{class:"",latex:"\\frac{1}{#@}"},variants:["/","\\div","\\%","\\oslash"],latex:"\\frac{#@}{#?}",label:"÷"},"[*]":{variants:[{latex:"\\prod_{#0}^{#0}",class:"small"},"\\otimes","\\cdot"],latex:"\\cdot",label:"×",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:"",shift:{class:"action warning",label:"",command:"deleteAll"}},"[undo]":{class:"ghost if-can-undo",command:"undo",label:"",tooltip:"tooltip.undo"},"[redo]":{class:"ghost if-can-redo",command:"redo",label:"",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:""},"[foreground-color]":{variants:"foreground-color",command:["applyStyle",{color:"red"}],label:""},"[background-color]":{variants:"background-color",command:["applyStyle",{backgroundColor:"yellow"}],label:""}};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(;N1){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(;bue.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){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(""+(Eh(t)||t)+""+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(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()Bt.right,ie=gt=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()=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(t0?(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=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)=>` `,np=(e,t)=>` `,th=(e,t,r)=>` `,mg=` ${th(2*(an+Hn),2*an+3*Hn,0)} ${th(2*(an+Hn),2*an+Hn,180)} ${th(2*an+3*Hn,2*(an+Hn),-90)} ${th(2*an+Hn,2*(an+Hn),90)} ${eh(2*an+Hn,an)} ${np(2*an+2*Hn,an)} ${eh(2*an+3*Hn,an)} ${eh(an,2*an+Hn)} ${np(an,2*an+2*Hn)} ${eh(an,2*an+3*Hn)} `,gg=e=>` `,vg=e=>` `,ip=e=>` `,yg=e=>` `,bg=e=>` `,_g=e=>` `,wg=e=>` `,xg=e=>` `,$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=`
    ${ue} ${ie.join("")}
    `,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=``;break;case"trailing-chevron":r='';break;case"mixedmark":r=''}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.left0: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(;NPc.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){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="",ih="";function oh(e){return e.replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}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=`${Bt}`,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":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"\u210F","\\cdotp":"\u22C5","\\ldots":"\u2026","\\cdots":"\u22EF","\\ddots":"\u22F1","\\vdots":"\u22EE","\\ldotp":"."};if(Xe.command==="!")return e.index+=1,Je="!",ya(Je,e,r)||(e.mathML+=Je,e.lastType="mo"),!0;if(Dt[Xe.command]){e.index+=1;let Bt=`${Dt[Xe.command]}`;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.index0){ze=!0,Je=`${pt}`;const Bt=e.lastType;Je.endsWith(">f")||Je.endsWith(">g")?(Je+=vp,e.lastType="applyfunction"):e.lastType=/^(.*)<\/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}${J}${N}`:N?ie=`${e}${N}`:J&&(ie=`${e}${J}`),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.index0?(e.mathML+=`${b}`,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"+b+"",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",b+=Ol(e.atoms[ie],r),b+=Pr(e.atoms,r,ie+1,ue),b+=Ol(e.atoms[ue],r),b+="",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":"≠","\\neq":"&neq;","\\pm":"±","\\times":"×","\\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=`${J[N.command]}`;return ya(ie,e,r)||(e.mathML+=ie,e.lastType="mo"),!0}if(e.index"):N.superscript?(b+=""+ie,b+=Pr(N.superscript,r),b+=""):N.subscript&&(b+=""+ie,b+=Pr(N.subscript,r),b+=""),e.mathML+=b,e.lastType="mo",e.index+=1,!0}{const ie=e.atoms[e.index],ue=ie.value==="\\operatorname",pe=ue?'"+Ec(ie.value)+"":Ol(ie,r);b+=pe,!ue&&!/^(.*)<\/mo>$/.test(pe)?(b+=vp,L="applyfunction"):L=ue?"mi":"mo"}(e.lastType==="mi"||e.lastType==="mn")&&!/^(.*)<\/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.index0&&b.atoms[b.index].type==="genfrac"&&(N=""+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=""+b.mathML+"")}return b.mathML}function Ol(e,t){let r="";const a=Ec(e.value);return a&&(r=""+a+""),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`${e.value}`;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`${Pr(e.body,t)}`;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":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};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+="",e.leftDelim&&e.leftDelim!=="."&&(wt+=""+(ai[e.leftDelim]||e.leftDelim)+"")),wt+="",zs=0;zs"+Pr(e.array[Io][zs],t)+"";wt+=""}wt+="",(e.leftDelim&&e.leftDelim!=="."||e.rightDelim&&e.rightDelim!==".")&&(e.rightDelim&&e.rightDelim!=="."&&(wt+=""+(ai[e.leftDelim]||e.rightDelim)+""),wt+="");break;case"genfrac":(e.leftDelim||e.rightDelim)&&(wt+=""),e.leftDelim&&e.leftDelim!=="."&&(wt+=""+(ai[e.leftDelim]||e.leftDelim)+""),e.hasBarLine?(wt+="",wt+=Pr(e.above,t)||" ",wt+=Pr(e.below,t)||" ",wt+=""):(wt+="",wt+=""+Pr(e.above,t)+"",wt+=""+Pr(e.below,t)+"",wt+=""),e.rightDelim&&e.rightDelim!=="."&&(wt+=""+(ai[e.rightDelim]||e.rightDelim)+""),(e.leftDelim||e.rightDelim)&&(wt+="");break;case"surd":e.hasEmptyBranch("above")?(wt+="",wt+=Pr(e.body,t),wt+=""):(wt+="",wt+=Pr(e.body,t),wt+=Pr(e.above,t),wt+="");break;case"leftright":const Us=e,Ws=Us.leftDelim;wt="",Ws&&Ws!=="."&&(wt+=`${(r=ai[Ws])!=null?r:Ws}`),e.body&&(wt+=Pr(e.body,t));const Ks=Us.matchingRightDelim();Ks&&Ks!=="."&&(wt+=`${(a=ai[Ks])!=null?a:Ks}`),wt+="";break;case"sizeddelim":case"delim":wt+=`${ai[e.value]||e.value}`;break;case"accent":wt+='",wt+=Pr(e.body,t),wt+=""+(Hs[Tn]||e.accent)+"",wt+="";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+=``,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+=""):e.svgAbove||$i?(wt+=``+((gt=br[e.svgBody])!=null?gt:Pr(en,t)),wt+=(ct=br[e.svgAbove])!=null?ct:Pr($i,t),wt+=""):(e.svgBelow||bo)&&(wt+=``+((Dt=br[e.svgBody])!=null?Dt:Pr(en,t)),wt+=(Bt=br[e.svgBelow])!=null?Bt:Pr(bo,t),wt+="");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)}`;break}case"mbin":case"mrel":case"minner":wt=Ol(e,t);break;case"mpunct":wt='"+Tn+"";break;case"mop":case"operator":case"extensible-symbol":e.body!=="\u200B"&&(wt="",wt+=Tn==="\\operatorname"?e.body:Tn||e.body,wt+="");break;case"box":wt='"+Pr(e.body,t)+"";break;case"spacing":wt+='';break;case"enclose":wt=''+Pr(e.body,t)+"";break;case"prompt":wt=''+Pr(e.body,t)+"";break;case"space":wt+=" ";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+=`${us}`)}break;case"latexgroup":wt+=Pr(e.body,t);break;case"latex":wt+=""+e.value+"";break;case"tooltip":wt+=Pr(e.body,t);break;case"text":wt+=`${e.value}`;break;default:if(e.command==="\\displaystyle")return`${Pr(e.body,t)}`;if(e.command==="\\textstyle")return`${Pr(e.body,t)}`;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 ",";":' semi-colon ',",":' comma ',"|":'Vertical bar',"(":'Open paren. ',")":' Close paren. ',"=":"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 ",":":' such that ',"\\colon":' such that ',"\\hbar":"etch bar ","\\iff":'if, and only if, ',"\\Longleftrightarrow":'if, and only if, ',"\\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 n',"\\C":'the set c',"\\Z":'the set z',"\\Q":'the set q',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdot":"times ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lparen":'open paren',"\\rparen":'close paren',"\\lbrace":'open brace',"\\{":'open brace',"\\rbrace":'close brace',"\\}":'close brace',"\\langle":'left angle bracket',"\\rangle":'right angle bracket',"\\lfloor":'open floor',"\\rfloor":'close floor',"\\lceil":'open ceiling',"\\rceil":'close ceiling',"\\vert":'vertical bar',"\\mvert":'divides',"\\lvert":'left vertical bar',"\\rvert":'right vertical bar',"\\lbrack":' open square bracket ',"\\rbrack":' close square bracket ',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)?` ${pe}`:/[A-Z]/.test(pe)?`capital ${pe.toLowerCase()}`:pe:/[a-z]/.test(pe)?" '"+pe.toUpperCase()+"'":/[A-Z]/.test(pe)?" 'capital "+pe.toUpperCase()+"'":pe}function ie(pe){return""+pe+""}if(!t)return"";let ue="";if(o(t)){let pe=!1,Ee=!1;for(let De=0;De'),ue+=t.value;else{t.id&&e==="math"&&(ue+='');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 . '+fr(e,t.body)+'. end input':"blank";ue+=' '+Je+'. '+((a=t.correctness)!=null?a:"")+' . ';break;case"array":const pt=t.array,Xe=t.environmentName;if(Object.keys(Qh).includes(Xe)){ue+=` begin ${Qh[Xe]} `;for(let ct=0;ct0&&(ue+=","),ue+=` row ${ct+1} `;for(let Dt=0;Dt0&&(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 '+pe+' over '+Ee+'. End fraction.';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 '+De+'. End square root';else{let ct=fr("math",t.above);ct=ct.trim();const Dt=ct.replace(//g,"");Dt==="3"?ue+=' the cube root of '+De+'. End cube root':Dt==="n"?ue+=' the nth root of '+De+'. End root':ue+=' the root with index: '+ct+', of '+De+'. 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&>.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+=''),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}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 '+Bt+' to '+Dt+' of ',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 '+Dt+' of ',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 '+Bt+' to '+Dt+' of ',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 '+Dt+' of ',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 '+ie(Bt)+' to '+ie(Dt)+' of ',je=!0}else ue+=' the integral of ';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+='')}pt==="\u2032"?ue+=" prime ":pt==="2"?ue+=" squared ":pt==="3"?ue+=" cubed ":Number.isNaN(Number.parseInt(pt))?ue+=" to the "+Je+"; ":ue+=' to the '+pt+" power; "}else Number.isNaN(Number.parseInt(pt))?ue+=" raised to the "+Je+"; ":ue+=' raised to the '+pt+" 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=''),a=''+b+"

    "+a+"

    "+(b?"
    ":"")+""}else window.MathfieldElement.textToSpeechMarkup==="mac"&&_()==="macos"?a=a.replace(//g,"").replace(//g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(//g,"[[slc $1]]").replace(/]*>/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)ot?(ct=$s(gt,b)-$s(ot,L),Dt=ct*De):(ct=$s(gt,J)-$s(ot,N),Dt=ct*ze),Math.abs(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:``,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:``,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 rA("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=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),tthis.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(ba)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=``,_v=``,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(""),ue.push('"),ue.push(""),ue.push(""),ue.push(""),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.topa.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;at.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!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="';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(;a0&&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{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=""+t.renderToMathML(e)+"";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&>[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&>[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"}}}]); }());