function Ik(r,e){for(var t=0;tn[i]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function t(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=t(i);fetch(i.href,a)}})();var wp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function cl(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Nk(r){if(Object.prototype.hasOwnProperty.call(r,"__esModule"))return r;var e=r.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}),t}var a1={exports:{}},nf={};/** * @license React * react-jsx-runtime.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var NT;function Lk(){if(NT)return nf;NT=1;var r=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(n,i,a){var s=null;if(a!==void 0&&(s=""+a),i.key!==void 0&&(s=""+i.key),"key"in i){a={};for(var o in i)o!=="key"&&(a[o]=i[o])}else a=i;return i=a.ref,{$$typeof:r,type:n,key:s,ref:i!==void 0?i:null,props:a}}return nf.Fragment=e,nf.jsx=t,nf.jsxs=t,nf}var LT;function kk(){return LT||(LT=1,a1.exports=Lk()),a1.exports}var N=kk(),s1={exports:{}},Pt={};/** * @license React * react.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var kT;function Bk(){if(kT)return Pt;kT=1;var r=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),s=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),v=Symbol.iterator;function g(L){return L===null||typeof L!="object"?null:(L=v&&L[v]||L["@@iterator"],typeof L=="function"?L:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,y={};function _(L,Y,G){this.props=L,this.context=Y,this.refs=y,this.updater=G||m}_.prototype.isReactComponent={},_.prototype.setState=function(L,Y){if(typeof L!="object"&&typeof L!="function"&&L!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,L,Y,"setState")},_.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function w(){}w.prototype=_.prototype;function S(L,Y,G){this.props=L,this.context=Y,this.refs=y,this.updater=G||m}var A=S.prototype=new w;A.constructor=S,x(A,_.prototype),A.isPureReactComponent=!0;var C=Array.isArray;function M(){}var E={H:null,A:null,T:null,S:null},O=Object.prototype.hasOwnProperty;function D(L,Y,G){var re=G.ref;return{$$typeof:r,type:L,key:Y,ref:re!==void 0?re:null,props:G}}function I(L,Y){return D(L.type,Y,L.props)}function k(L){return typeof L=="object"&&L!==null&&L.$$typeof===r}function U(L){var Y={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(G){return Y[G]})}var V=/\/+/g;function X(L,Y){return typeof L=="object"&&L!==null&&L.key!=null?U(""+L.key):Y.toString(36)}function W(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(M,M):(L.status="pending",L.then(function(Y){L.status==="pending"&&(L.status="fulfilled",L.value=Y)},function(Y){L.status==="pending"&&(L.status="rejected",L.reason=Y)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function P(L,Y,G,re,ie){var le=typeof L;(le==="undefined"||le==="boolean")&&(L=null);var ce=!1;if(L===null)ce=!0;else switch(le){case"bigint":case"string":case"number":ce=!0;break;case"object":switch(L.$$typeof){case r:case e:ce=!0;break;case h:return ce=L._init,P(ce(L._payload),Y,G,re,ie)}}if(ce)return ie=ie(L),ce=re===""?"."+X(L,0):re,C(ie)?(G="",ce!=null&&(G=ce.replace(V,"$&/")+"/"),P(ie,Y,G,"",function(ae){return ae})):ie!=null&&(k(ie)&&(ie=I(ie,G+(ie.key==null||L&&L.key===ie.key?"":(""+ie.key).replace(V,"$&/")+"/")+ce)),Y.push(ie)),1;ce=0;var _e=re===""?".":re+":";if(C(L))for(var pe=0;pe>>1,B=P[$];if(0>>1;$i(G,z))rei(ie,G)?(P[$]=ie,P[re]=z,$=re):(P[$]=G,P[Y]=z,$=Y);else if(rei(ie,z))P[$]=ie,P[re]=z,$=re;else break e}}return H}function i(P,H){var z=P.sortIndex-H.sortIndex;return z!==0?z:P.id-H.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;r.unstable_now=function(){return a.now()}}else{var s=Date,o=s.now();r.unstable_now=function(){return s.now()-o}}var l=[],c=[],h=1,d=null,v=3,g=!1,m=!1,x=!1,y=!1,_=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function A(P){for(var H=t(c);H!==null;){if(H.callback===null)n(c);else if(H.startTime<=P)n(c),H.sortIndex=H.expirationTime,e(l,H);else break;H=t(c)}}function C(P){if(x=!1,A(P),!m)if(t(l)!==null)m=!0,M||(M=!0,U());else{var H=t(c);H!==null&&W(C,H.startTime-P)}}var M=!1,E=-1,O=5,D=-1;function I(){return y?!0:!(r.unstable_now()-DP&&I());){var $=d.callback;if(typeof $=="function"){d.callback=null,v=d.priorityLevel;var B=$(d.expirationTime<=P);if(P=r.unstable_now(),typeof B=="function"){d.callback=B,A(P),H=!0;break t}d===t(l)&&n(l),A(P)}else n(l);d=t(l)}if(d!==null)H=!0;else{var L=t(c);L!==null&&W(C,L.startTime-P),H=!1}}break e}finally{d=null,v=z,g=!1}H=void 0}}finally{H?U():M=!1}}}var U;if(typeof S=="function")U=function(){S(k)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,X=V.port2;V.port1.onmessage=k,U=function(){X.postMessage(null)}}else U=function(){_(k,0)};function W(P,H){E=_(function(){P(r.unstable_now())},H)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(P){P.callback=null},r.unstable_forceFrameRate=function(P){0>P||125$?(P.sortIndex=z,e(c,P),t(l)===null&&P===t(c)&&(x?(w(E),E=-1):x=!0,W(C,z-$))):(P.sortIndex=B,e(l,P),m||g||(m=!0,M||(M=!0,U()))),P},r.unstable_shouldYield=I,r.unstable_wrapCallback=function(P){var H=v;return function(){var z=v;v=H;try{return P.apply(this,arguments)}finally{v=z}}}})(u1)),u1}var zT;function Uk(){return zT||(zT=1,l1.exports=zk()),l1.exports}var c1={exports:{}},ei={};/** * @license React * react-dom.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var UT;function Gk(){if(UT)return ei;UT=1;var r=B_();function e(l){var c="https://react.dev/errors/"+l;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(e){console.error(e)}}return r(),c1.exports=Gk(),c1.exports}/** * @license React * react-dom-client.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var HT;function Hk(){if(HT)return af;HT=1;var r=Uk(),e=B_(),t=g9();function n(u){var f="https://react.dev/errors/"+u;if(1B||(u.current=$[B],$[B]=null,B--)}function G(u,f){B++,$[B]=u.current,u.current=f}var re=L(null),ie=L(null),le=L(null),ce=L(null);function _e(u,f){switch(G(le,f),G(ie,u),G(re,null),f.nodeType){case 9:case 11:u=(u=f.documentElement)&&(u=u.namespaceURI)?nT(u):0;break;default:if(u=f.tagName,f=f.namespaceURI)f=nT(f),u=iT(f,u);else switch(u){case"svg":u=1;break;case"math":u=2;break;default:u=0}}Y(re),G(re,u)}function pe(){Y(re),Y(ie),Y(le)}function ae(u){u.memoizedState!==null&&G(ce,u);var f=re.current,p=iT(f,u.type);f!==p&&(G(ie,u),G(re,p))}function oe(u){ie.current===u&&(Y(re),Y(ie)),ce.current===u&&(Y(ce),Jh._currentValue=z)}var de,ye;function Ee(u){if(de===void 0)try{throw Error()}catch(p){var f=p.stack.trim().match(/\n( *(at )?)/);de=f&&f[1]||"",ye=-1)":-1T||ve[b]!==Ce[T]){var Le=` `+ve[b].replace(" at new "," at ");return u.displayName&&Le.includes("")&&(Le=Le.replace("",u.displayName)),Le}while(1<=b&&0<=T);break}}}finally{Re=!1,Error.prepareStackTrace=p}return(p=u?u.displayName||u.name:"")?Ee(p):""}function Be(u,f){switch(u.tag){case 26:case 27:case 5:return Ee(u.type);case 16:return Ee("Lazy");case 13:return u.child!==f&&f!==null?Ee("Suspense Fallback"):Ee("Suspense");case 19:return Ee("SuspenseList");case 0:case 15:return Ne(u.type,!1);case 11:return Ne(u.type.render,!1);case 1:return Ne(u.type,!0);case 31:return Ee("Activity");default:return""}}function $e(u){try{var f="",p=null;do f+=Be(u,p),p=u,u=u.return;while(u);return f}catch(b){return` Error generating stack: `+b.message+` `+b.stack}}var Ye=Object.prototype.hasOwnProperty,He=r.unstable_scheduleCallback,tt=r.unstable_cancelCallback,ot=r.unstable_shouldYield,ct=r.unstable_requestPaint,Ze=r.unstable_now,bt=r.unstable_getCurrentPriorityLevel,Se=r.unstable_ImmediatePriority,ke=r.unstable_UserBlockingPriority,We=r.unstable_NormalPriority,Ke=r.unstable_LowPriority,rt=r.unstable_IdlePriority,nt=r.log,De=r.unstable_setDisableYieldValue,Q=null,ne=null;function be(u){if(typeof nt=="function"&&De(u),ne&&typeof ne.setStrictMode=="function")try{ne.setStrictMode(Q,u)}catch{}}var ee=Math.clz32?Math.clz32:Ae,se=Math.log,Pe=Math.LN2;function Ae(u){return u>>>=0,u===0?32:31-(se(u)/Pe|0)|0}var Ge=256,J=262144,Oe=4194304;function Ve(u){var f=u&42;if(f!==0)return f;switch(u&-u){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return u&261888;case 262144:case 524288:case 1048576:case 2097152:return u&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return u&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return u}}function Ue(u,f,p){var b=u.pendingLanes;if(b===0)return 0;var T=0,R=u.suspendedLanes,q=u.pingedLanes;u=u.warmLanes;var Z=b&134217727;return Z!==0?(b=Z&~R,b!==0?T=Ve(b):(q&=Z,q!==0?T=Ve(q):p||(p=Z&~u,p!==0&&(T=Ve(p))))):(Z=b&~R,Z!==0?T=Ve(Z):q!==0?T=Ve(q):p||(p=b&~u,p!==0&&(T=Ve(p)))),T===0?0:f!==0&&f!==T&&(f&R)===0&&(R=T&-T,p=f&-f,R>=p||R===32&&(p&4194048)!==0)?f:T}function je(u,f){return(u.pendingLanes&~(u.suspendedLanes&~u.pingedLanes)&f)===0}function yt(u,f){switch(u){case 1:case 2:case 4:case 8:case 64:return f+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return f+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function vt(){var u=Oe;return Oe<<=1,(Oe&62914560)===0&&(Oe=4194304),u}function Ot(u){for(var f=[],p=0;31>p;p++)f.push(u);return f}function jt(u,f){u.pendingLanes|=f,f!==268435456&&(u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0)}function Nr(u,f,p,b,T,R){var q=u.pendingLanes;u.pendingLanes=p,u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0,u.expiredLanes&=p,u.entangledLanes&=p,u.errorRecoveryDisabledLanes&=p,u.shellSuspendCounter=0;var Z=u.entanglements,ve=u.expirationTimes,Ce=u.hiddenUpdates;for(p=q&~p;0"u")return null;try{return u.activeElement||u.body}catch{return u.body}}var AN=/[\n"\\]/g;function Zi(u){return u.replace(AN,function(f){return"\\"+f.charCodeAt(0).toString(16)+" "})}function Jg(u,f,p,b,T,R,q,Z){u.name="",q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"?u.type=q:u.removeAttribute("type"),f!=null?q==="number"?(f===0&&u.value===""||u.value!=f)&&(u.value=""+Nn(f)):u.value!==""+Nn(f)&&(u.value=""+Nn(f)):q!=="submit"&&q!=="reset"||u.removeAttribute("value"),f!=null?em(u,q,Nn(f)):p!=null?em(u,q,Nn(p)):b!=null&&u.removeAttribute("value"),T==null&&R!=null&&(u.defaultChecked=!!R),T!=null&&(u.checked=T&&typeof T!="function"&&typeof T!="symbol"),Z!=null&&typeof Z!="function"&&typeof Z!="symbol"&&typeof Z!="boolean"?u.name=""+Nn(Z):u.removeAttribute("name")}function Z3(u,f,p,b,T,R,q,Z){if(R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"&&(u.type=R),f!=null||p!=null){if(!(R!=="submit"&&R!=="reset"||f!=null)){jd(u);return}p=p!=null?""+Nn(p):"",f=f!=null?""+Nn(f):p,Z||f===u.value||(u.value=f),u.defaultValue=f}b=b??T,b=typeof b!="function"&&typeof b!="symbol"&&!!b,u.checked=Z?u.checked:!!b,u.defaultChecked=!!b,q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"&&(u.name=q),jd(u)}function em(u,f,p){f==="number"&&qd(u.ownerDocument)===u||u.defaultValue===""+p||(u.defaultValue=""+p)}function Au(u,f,p,b){if(u=u.options,f){f={};for(var T=0;T"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),am=!1;if(ps)try{var mh={};Object.defineProperty(mh,"passive",{get:function(){am=!0}}),window.addEventListener("test",mh,mh),window.removeEventListener("test",mh,mh)}catch{am=!1}var no=null,sm=null,Yd=null;function i5(){if(Yd)return Yd;var u,f=sm,p=f.length,b,T="value"in no?no.value:no.textContent,R=T.length;for(u=0;u=xh),c5=" ",h5=!1;function f5(u,f){switch(u){case"keyup":return tL.indexOf(f.keyCode)!==-1;case"keydown":return f.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function d5(u){return u=u.detail,typeof u=="object"&&"data"in u?u.data:null}var Du=!1;function nL(u,f){switch(u){case"compositionend":return d5(f);case"keypress":return f.which!==32?null:(h5=!0,c5);case"textInput":return u=f.data,u===c5&&h5?null:u;default:return null}}function iL(u,f){if(Du)return u==="compositionend"||!hm&&f5(u,f)?(u=i5(),Yd=sm=no=null,Du=!1,u):null;switch(u){case"paste":return null;case"keypress":if(!(f.ctrlKey||f.altKey||f.metaKey)||f.ctrlKey&&f.altKey){if(f.char&&1=f)return{node:p,offset:f-u};u=b}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=_5(p)}}function S5(u,f){return u&&f?u===f?!0:u&&u.nodeType===3?!1:f&&f.nodeType===3?S5(u,f.parentNode):"contains"in u?u.contains(f):u.compareDocumentPosition?!!(u.compareDocumentPosition(f)&16):!1:!1}function E5(u){u=u!=null&&u.ownerDocument!=null&&u.ownerDocument.defaultView!=null?u.ownerDocument.defaultView:window;for(var f=qd(u.document);f instanceof u.HTMLIFrameElement;){try{var p=typeof f.contentWindow.location.href=="string"}catch{p=!1}if(p)u=f.contentWindow;else break;f=qd(u.document)}return f}function vm(u){var f=u&&u.nodeName&&u.nodeName.toLowerCase();return f&&(f==="input"&&(u.type==="text"||u.type==="search"||u.type==="tel"||u.type==="url"||u.type==="password")||f==="textarea"||u.contentEditable==="true")}var fL=ps&&"documentMode"in document&&11>=document.documentMode,Pu=null,pm=null,Eh=null,gm=!1;function T5(u,f,p){var b=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;gm||Pu==null||Pu!==qd(b)||(b=Pu,"selectionStart"in b&&vm(b)?b={start:b.selectionStart,end:b.selectionEnd}:(b=(b.ownerDocument&&b.ownerDocument.defaultView||window).getSelection(),b={anchorNode:b.anchorNode,anchorOffset:b.anchorOffset,focusNode:b.focusNode,focusOffset:b.focusOffset}),Eh&&Sh(Eh,b)||(Eh=b,b=U0(pm,"onSelect"),0>=q,T-=q,Fa=1<<32-ee(f)+T|p<kt?(Xt=mt,mt=null):Xt=mt.sibling;var er=Me(we,mt,Te[kt],Fe);if(er===null){mt===null&&(mt=Xt);break}u&&mt&&er.alternate===null&&f(we,mt),ge=R(er,ge,kt),Jt===null?_t=er:Jt.sibling=er,Jt=er,mt=Xt}if(kt===Te.length)return p(we,mt),Yt&&ms(we,kt),_t;if(mt===null){for(;ktkt?(Xt=mt,mt=null):Xt=mt.sibling;var Co=Me(we,mt,er.value,Fe);if(Co===null){mt===null&&(mt=Xt);break}u&&mt&&Co.alternate===null&&f(we,mt),ge=R(Co,ge,kt),Jt===null?_t=Co:Jt.sibling=Co,Jt=Co,mt=Xt}if(er.done)return p(we,mt),Yt&&ms(we,kt),_t;if(mt===null){for(;!er.done;kt++,er=Te.next())er=ze(we,er.value,Fe),er!==null&&(ge=R(er,ge,kt),Jt===null?_t=er:Jt.sibling=er,Jt=er);return Yt&&ms(we,kt),_t}for(mt=b(mt);!er.done;kt++,er=Te.next())er=Ie(mt,we,kt,er.value,Fe),er!==null&&(u&&er.alternate!==null&&mt.delete(er.key===null?kt:er.key),ge=R(er,ge,kt),Jt===null?_t=er:Jt.sibling=er,Jt=er);return u&&mt.forEach(function(Pk){return f(we,Pk)}),Yt&&ms(we,kt),_t}function wr(we,ge,Te,Fe){if(typeof Te=="object"&&Te!==null&&Te.type===x&&Te.key===null&&(Te=Te.props.children),typeof Te=="object"&&Te!==null){switch(Te.$$typeof){case g:e:{for(var _t=Te.key;ge!==null;){if(ge.key===_t){if(_t=Te.type,_t===x){if(ge.tag===7){p(we,ge.sibling),Fe=T(ge,Te.props.children),Fe.return=we,we=Fe;break e}}else if(ge.elementType===_t||typeof _t=="object"&&_t!==null&&_t.$$typeof===O&&Rl(_t)===ge.type){p(we,ge.sibling),Fe=T(ge,Te.props),Oh(Fe,Te),Fe.return=we,we=Fe;break e}p(we,ge);break}else f(we,ge);ge=ge.sibling}Te.type===x?(Fe=El(Te.props.children,we.mode,Fe,Te.key),Fe.return=we,we=Fe):(Fe=n0(Te.type,Te.key,Te.props,null,we.mode,Fe),Oh(Fe,Te),Fe.return=we,we=Fe)}return q(we);case m:e:{for(_t=Te.key;ge!==null;){if(ge.key===_t)if(ge.tag===4&&ge.stateNode.containerInfo===Te.containerInfo&&ge.stateNode.implementation===Te.implementation){p(we,ge.sibling),Fe=T(ge,Te.children||[]),Fe.return=we,we=Fe;break e}else{p(we,ge);break}else f(we,ge);ge=ge.sibling}Fe=Sm(Te,we.mode,Fe),Fe.return=we,we=Fe}return q(we);case O:return Te=Rl(Te),wr(we,ge,Te,Fe)}if(W(Te))return gt(we,ge,Te,Fe);if(U(Te)){if(_t=U(Te),typeof _t!="function")throw Error(n(150));return Te=_t.call(Te),At(we,ge,Te,Fe)}if(typeof Te.then=="function")return wr(we,ge,c0(Te),Fe);if(Te.$$typeof===S)return wr(we,ge,s0(we,Te),Fe);h0(we,Te)}return typeof Te=="string"&&Te!==""||typeof Te=="number"||typeof Te=="bigint"?(Te=""+Te,ge!==null&&ge.tag===6?(p(we,ge.sibling),Fe=T(ge,Te),Fe.return=we,we=Fe):(p(we,ge),Fe=wm(Te,we.mode,Fe),Fe.return=we,we=Fe),q(we)):p(we,ge)}return function(we,ge,Te,Fe){try{Rh=0;var _t=wr(we,ge,Te,Fe);return ju=null,_t}catch(mt){if(mt===Hu||mt===l0)throw mt;var Jt=Li(29,mt,null,we.mode);return Jt.lanes=Fe,Jt.return=we,Jt}finally{}}}var Dl=W5(!0),$5=W5(!1),lo=!1;function Lm(u){u.updateQueue={baseState:u.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function km(u,f){u=u.updateQueue,f.updateQueue===u&&(f.updateQueue={baseState:u.baseState,firstBaseUpdate:u.firstBaseUpdate,lastBaseUpdate:u.lastBaseUpdate,shared:u.shared,callbacks:null})}function uo(u){return{lane:u,tag:0,payload:null,callback:null,next:null}}function co(u,f,p){var b=u.updateQueue;if(b===null)return null;if(b=b.shared,(ir&2)!==0){var T=b.pending;return T===null?f.next=f:(f.next=T.next,T.next=f),b.pending=f,f=r0(u),P5(u,null,p),f}return t0(u,b,f,p),r0(u)}function Dh(u,f,p){if(f=f.updateQueue,f!==null&&(f=f.shared,(p&4194048)!==0)){var b=f.lanes;b&=u.pendingLanes,p|=b,f.lanes=p,Qt(u,p)}}function Bm(u,f){var p=u.updateQueue,b=u.alternate;if(b!==null&&(b=b.updateQueue,p===b)){var T=null,R=null;if(p=p.firstBaseUpdate,p!==null){do{var q={lane:p.lane,tag:p.tag,payload:p.payload,callback:null,next:null};R===null?T=R=q:R=R.next=q,p=p.next}while(p!==null);R===null?T=R=f:R=R.next=f}else T=R=f;p={baseState:b.baseState,firstBaseUpdate:T,lastBaseUpdate:R,shared:b.shared,callbacks:b.callbacks},u.updateQueue=p;return}u=p.lastBaseUpdate,u===null?p.firstBaseUpdate=f:u.next=f,p.lastBaseUpdate=f}var Fm=!1;function Ph(){if(Fm){var u=Gu;if(u!==null)throw u}}function Ih(u,f,p,b){Fm=!1;var T=u.updateQueue;lo=!1;var R=T.firstBaseUpdate,q=T.lastBaseUpdate,Z=T.shared.pending;if(Z!==null){T.shared.pending=null;var ve=Z,Ce=ve.next;ve.next=null,q===null?R=Ce:q.next=Ce,q=ve;var Le=u.alternate;Le!==null&&(Le=Le.updateQueue,Z=Le.lastBaseUpdate,Z!==q&&(Z===null?Le.firstBaseUpdate=Ce:Z.next=Ce,Le.lastBaseUpdate=ve))}if(R!==null){var ze=T.baseState;q=0,Le=Ce=ve=null,Z=R;do{var Me=Z.lane&-536870913,Ie=Me!==Z.lane;if(Ie?(qt&Me)===Me:(b&Me)===Me){Me!==0&&Me===Uu&&(Fm=!0),Le!==null&&(Le=Le.next={lane:0,tag:Z.tag,payload:Z.payload,callback:null,next:null});e:{var gt=u,At=Z;Me=f;var wr=p;switch(At.tag){case 1:if(gt=At.payload,typeof gt=="function"){ze=gt.call(wr,ze,Me);break e}ze=gt;break e;case 3:gt.flags=gt.flags&-65537|128;case 0:if(gt=At.payload,Me=typeof gt=="function"?gt.call(wr,ze,Me):gt,Me==null)break e;ze=d({},ze,Me);break e;case 2:lo=!0}}Me=Z.callback,Me!==null&&(u.flags|=64,Ie&&(u.flags|=8192),Ie=T.callbacks,Ie===null?T.callbacks=[Me]:Ie.push(Me))}else Ie={lane:Me,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null},Le===null?(Ce=Le=Ie,ve=ze):Le=Le.next=Ie,q|=Me;if(Z=Z.next,Z===null){if(Z=T.shared.pending,Z===null)break;Ie=Z,Z=Ie.next,Ie.next=null,T.lastBaseUpdate=Ie,T.shared.pending=null}}while(!0);Le===null&&(ve=ze),T.baseState=ve,T.firstBaseUpdate=Ce,T.lastBaseUpdate=Le,R===null&&(T.shared.lanes=0),go|=q,u.lanes=q,u.memoizedState=ze}}function K5(u,f){if(typeof u!="function")throw Error(n(191,u));u.call(f)}function Z5(u,f){var p=u.callbacks;if(p!==null)for(u.callbacks=null,u=0;uR?R:8;var q=P.T,Z={};P.T=Z,ny(u,!1,f,p);try{var ve=T(),Ce=P.S;if(Ce!==null&&Ce(Z,ve),ve!==null&&typeof ve=="object"&&typeof ve.then=="function"){var Le=_L(ve,b);kh(u,f,Le,Ui(u))}else kh(u,f,b,Ui(u))}catch(ze){kh(u,f,{then:function(){},status:"rejected",reason:ze},Ui())}finally{H.p=R,q!==null&&Z.types!==null&&(q.types=Z.types),P.T=q}}function AL(){}function ty(u,f,p,b){if(u.tag!==5)throw Error(n(476));var T=RS(u).queue;MS(u,T,f,z,p===null?AL:function(){return OS(u),p(b)})}function RS(u){var f=u.memoizedState;if(f!==null)return f;f={memoizedState:z,baseState:z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_s,lastRenderedState:z},next:null};var p={};return f.next={memoizedState:p,baseState:p,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_s,lastRenderedState:p},next:null},u.memoizedState=f,u=u.alternate,u!==null&&(u.memoizedState=f),f}function OS(u){var f=RS(u);f.next===null&&(f=u.alternate.memoizedState),kh(u,f.next.queue,{},Ui())}function ry(){return jn(Jh)}function DS(){return dn().memoizedState}function PS(){return dn().memoizedState}function ML(u){for(var f=u.return;f!==null;){switch(f.tag){case 24:case 3:var p=Ui();u=uo(p);var b=co(f,u,p);b!==null&&(wi(b,f,p),Dh(b,f,p)),f={cache:Dm()},u.payload=f;return}f=f.return}}function RL(u,f,p){var b=Ui();p={lane:b,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},_0(u)?NS(f,p):(p=xm(u,f,p,b),p!==null&&(wi(p,u,b),LS(p,f,b)))}function IS(u,f,p){var b=Ui();kh(u,f,p,b)}function kh(u,f,p,b){var T={lane:b,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null};if(_0(u))NS(f,T);else{var R=u.alternate;if(u.lanes===0&&(R===null||R.lanes===0)&&(R=f.lastRenderedReducer,R!==null))try{var q=f.lastRenderedState,Z=R(q,p);if(T.hasEagerState=!0,T.eagerState=Z,Ni(Z,q))return t0(u,f,T,0),Er===null&&e0(),!1}catch{}finally{}if(p=xm(u,f,T,b),p!==null)return wi(p,u,b),LS(p,f,b),!0}return!1}function ny(u,f,p,b){if(b={lane:2,revertLane:Ly(),gesture:null,action:b,hasEagerState:!1,eagerState:null,next:null},_0(u)){if(f)throw Error(n(479))}else f=xm(u,p,b,2),f!==null&&wi(f,u,2)}function _0(u){var f=u.alternate;return u===Nt||f!==null&&f===Nt}function NS(u,f){qu=v0=!0;var p=u.pending;p===null?f.next=f:(f.next=p.next,p.next=f),u.pending=f}function LS(u,f,p){if((p&4194048)!==0){var b=f.lanes;b&=u.pendingLanes,p|=b,f.lanes=p,Qt(u,p)}}var Bh={readContext:jn,use:m0,useCallback:an,useContext:an,useEffect:an,useImperativeHandle:an,useLayoutEffect:an,useInsertionEffect:an,useMemo:an,useReducer:an,useRef:an,useState:an,useDebugValue:an,useDeferredValue:an,useTransition:an,useSyncExternalStore:an,useId:an,useHostTransitionStatus:an,useFormState:an,useActionState:an,useOptimistic:an,useMemoCache:an,useCacheRefresh:an};Bh.useEffectEvent=an;var kS={readContext:jn,use:m0,useCallback:function(u,f){return si().memoizedState=[u,f===void 0?null:f],u},useContext:jn,useEffect:bS,useImperativeHandle:function(u,f,p){p=p!=null?p.concat([u]):null,b0(4194308,4,SS.bind(null,f,u),p)},useLayoutEffect:function(u,f){return b0(4194308,4,u,f)},useInsertionEffect:function(u,f){b0(4,2,u,f)},useMemo:function(u,f){var p=si();f=f===void 0?null:f;var b=u();if(Pl){be(!0);try{u()}finally{be(!1)}}return p.memoizedState=[b,f],b},useReducer:function(u,f,p){var b=si();if(p!==void 0){var T=p(f);if(Pl){be(!0);try{p(f)}finally{be(!1)}}}else T=f;return b.memoizedState=b.baseState=T,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:u,lastRenderedState:T},b.queue=u,u=u.dispatch=RL.bind(null,Nt,u),[b.memoizedState,u]},useRef:function(u){var f=si();return u={current:u},f.memoizedState=u},useState:function(u){u=Km(u);var f=u.queue,p=IS.bind(null,Nt,f);return f.dispatch=p,[u.memoizedState,p]},useDebugValue:Jm,useDeferredValue:function(u,f){var p=si();return ey(p,u,f)},useTransition:function(){var u=Km(!1);return u=MS.bind(null,Nt,u.queue,!0,!1),si().memoizedState=u,[!1,u]},useSyncExternalStore:function(u,f,p){var b=Nt,T=si();if(Yt){if(p===void 0)throw Error(n(407));p=p()}else{if(p=f(),Er===null)throw Error(n(349));(qt&127)!==0||nS(b,f,p)}T.memoizedState=p;var R={value:p,getSnapshot:f};return T.queue=R,bS(aS.bind(null,b,R,u),[u]),b.flags|=2048,Yu(9,{destroy:void 0},iS.bind(null,b,R,p,f),null),p},useId:function(){var u=si(),f=Er.identifierPrefix;if(Yt){var p=za,b=Fa;p=(b&~(1<<32-ee(b)-1)).toString(32)+p,f="_"+f+"R_"+p,p=p0++,0<\/script>",R=R.removeChild(R.firstChild);break;case"select":R=typeof b.is=="string"?q.createElement("select",{is:b.is}):q.createElement("select"),b.multiple?R.multiple=!0:b.size&&(R.size=b.size);break;default:R=typeof b.is=="string"?q.createElement(T,{is:b.is}):q.createElement(T)}}R[nr]=f,R[Lr]=b;e:for(q=f.child;q!==null;){if(q.tag===5||q.tag===6)R.appendChild(q.stateNode);else if(q.tag!==4&&q.tag!==27&&q.child!==null){q.child.return=q,q=q.child;continue}if(q===f)break e;for(;q.sibling===null;){if(q.return===null||q.return===f)break e;q=q.return}q.sibling.return=q.return,q=q.sibling}f.stateNode=R;e:switch(qn(R,T,b),T){case"button":case"input":case"select":case"textarea":b=!!b.autoFocus;break e;case"img":b=!0;break e;default:b=!1}b&&Ss(f)}}return Br(f),my(f,f.type,u===null?null:u.memoizedProps,f.pendingProps,p),null;case 6:if(u&&f.stateNode!=null)u.memoizedProps!==b&&Ss(f);else{if(typeof b!="string"&&f.stateNode===null)throw Error(n(166));if(u=le.current,Fu(f)){if(u=f.stateNode,p=f.memoizedProps,b=null,T=Hn,T!==null)switch(T.tag){case 27:case 5:b=T.memoizedProps}u[nr]=f,u=!!(u.nodeValue===p||b!==null&&b.suppressHydrationWarning===!0||tT(u.nodeValue,p)),u||so(f,!0)}else u=G0(u).createTextNode(b),u[nr]=f,f.stateNode=u}return Br(f),null;case 31:if(p=f.memoizedState,u===null||u.memoizedState!==null){if(b=Fu(f),p!==null){if(u===null){if(!b)throw Error(n(318));if(u=f.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(n(557));u[nr]=f}else Tl(),(f.flags&128)===0&&(f.memoizedState=null),f.flags|=4;Br(f),u=!1}else p=Am(),u!==null&&u.memoizedState!==null&&(u.memoizedState.hydrationErrors=p),u=!0;if(!u)return f.flags&256?(Bi(f),f):(Bi(f),null);if((f.flags&128)!==0)throw Error(n(558))}return Br(f),null;case 13:if(b=f.memoizedState,u===null||u.memoizedState!==null&&u.memoizedState.dehydrated!==null){if(T=Fu(f),b!==null&&b.dehydrated!==null){if(u===null){if(!T)throw Error(n(318));if(T=f.memoizedState,T=T!==null?T.dehydrated:null,!T)throw Error(n(317));T[nr]=f}else Tl(),(f.flags&128)===0&&(f.memoizedState=null),f.flags|=4;Br(f),T=!1}else T=Am(),u!==null&&u.memoizedState!==null&&(u.memoizedState.hydrationErrors=T),T=!0;if(!T)return f.flags&256?(Bi(f),f):(Bi(f),null)}return Bi(f),(f.flags&128)!==0?(f.lanes=p,f):(p=b!==null,u=u!==null&&u.memoizedState!==null,p&&(b=f.child,T=null,b.alternate!==null&&b.alternate.memoizedState!==null&&b.alternate.memoizedState.cachePool!==null&&(T=b.alternate.memoizedState.cachePool.pool),R=null,b.memoizedState!==null&&b.memoizedState.cachePool!==null&&(R=b.memoizedState.cachePool.pool),R!==T&&(b.flags|=2048)),p!==u&&p&&(f.child.flags|=8192),C0(f,f.updateQueue),Br(f),null);case 4:return pe(),u===null&&zy(f.stateNode.containerInfo),Br(f),null;case 10:return bs(f.type),Br(f),null;case 19:if(Y(fn),b=f.memoizedState,b===null)return Br(f),null;if(T=(f.flags&128)!==0,R=b.rendering,R===null)if(T)zh(b,!1);else{if(sn!==0||u!==null&&(u.flags&128)!==0)for(u=f.child;u!==null;){if(R=d0(u),R!==null){for(f.flags|=128,zh(b,!1),u=R.updateQueue,f.updateQueue=u,C0(f,u),f.subtreeFlags=0,u=p,p=f.child;p!==null;)I5(p,u),p=p.sibling;return G(fn,fn.current&1|2),Yt&&ms(f,b.treeForkCount),f.child}u=u.sibling}b.tail!==null&&Ze()>D0&&(f.flags|=128,T=!0,zh(b,!1),f.lanes=4194304)}else{if(!T)if(u=d0(R),u!==null){if(f.flags|=128,T=!0,u=u.updateQueue,f.updateQueue=u,C0(f,u),zh(b,!0),b.tail===null&&b.tailMode==="hidden"&&!R.alternate&&!Yt)return Br(f),null}else 2*Ze()-b.renderingStartTime>D0&&p!==536870912&&(f.flags|=128,T=!0,zh(b,!1),f.lanes=4194304);b.isBackwards?(R.sibling=f.child,f.child=R):(u=b.last,u!==null?u.sibling=R:f.child=R,b.last=R)}return b.tail!==null?(u=b.tail,b.rendering=u,b.tail=u.sibling,b.renderingStartTime=Ze(),u.sibling=null,p=fn.current,G(fn,T?p&1|2:p&1),Yt&&ms(f,b.treeForkCount),u):(Br(f),null);case 22:case 23:return Bi(f),Um(),b=f.memoizedState!==null,u!==null?u.memoizedState!==null!==b&&(f.flags|=8192):b&&(f.flags|=8192),b?(p&536870912)!==0&&(f.flags&128)===0&&(Br(f),f.subtreeFlags&6&&(f.flags|=8192)):Br(f),p=f.updateQueue,p!==null&&C0(f,p.retryQueue),p=null,u!==null&&u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(p=u.memoizedState.cachePool.pool),b=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(b=f.memoizedState.cachePool.pool),b!==p&&(f.flags|=2048),u!==null&&Y(Ml),null;case 24:return p=null,u!==null&&(p=u.memoizedState.cache),f.memoizedState.cache!==p&&(f.flags|=2048),bs(pn),Br(f),null;case 25:return null;case 30:return null}throw Error(n(156,f.tag))}function NL(u,f){switch(Tm(f),f.tag){case 1:return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 3:return bs(pn),pe(),u=f.flags,(u&65536)!==0&&(u&128)===0?(f.flags=u&-65537|128,f):null;case 26:case 27:case 5:return oe(f),null;case 31:if(f.memoizedState!==null){if(Bi(f),f.alternate===null)throw Error(n(340));Tl()}return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 13:if(Bi(f),u=f.memoizedState,u!==null&&u.dehydrated!==null){if(f.alternate===null)throw Error(n(340));Tl()}return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 19:return Y(fn),null;case 4:return pe(),null;case 10:return bs(f.type),null;case 22:case 23:return Bi(f),Um(),u!==null&&Y(Ml),u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 24:return bs(pn),null;case 25:return null;default:return null}}function sE(u,f){switch(Tm(f),f.tag){case 3:bs(pn),pe();break;case 26:case 27:case 5:oe(f);break;case 4:pe();break;case 31:f.memoizedState!==null&&Bi(f);break;case 13:Bi(f);break;case 19:Y(fn);break;case 10:bs(f.type);break;case 22:case 23:Bi(f),Um(),u!==null&&Y(Ml);break;case 24:bs(pn)}}function Uh(u,f){try{var p=f.updateQueue,b=p!==null?p.lastEffect:null;if(b!==null){var T=b.next;p=T;do{if((p.tag&u)===u){b=void 0;var R=p.create,q=p.inst;b=R(),q.destroy=b}p=p.next}while(p!==T)}}catch(Z){gr(f,f.return,Z)}}function vo(u,f,p){try{var b=f.updateQueue,T=b!==null?b.lastEffect:null;if(T!==null){var R=T.next;b=R;do{if((b.tag&u)===u){var q=b.inst,Z=q.destroy;if(Z!==void 0){q.destroy=void 0,T=f;var ve=p,Ce=Z;try{Ce()}catch(Le){gr(T,ve,Le)}}}b=b.next}while(b!==R)}}catch(Le){gr(f,f.return,Le)}}function oE(u){var f=u.updateQueue;if(f!==null){var p=u.stateNode;try{Z5(f,p)}catch(b){gr(u,u.return,b)}}}function lE(u,f,p){p.props=Il(u.type,u.memoizedProps),p.state=u.memoizedState;try{p.componentWillUnmount()}catch(b){gr(u,f,b)}}function Gh(u,f){try{var p=u.ref;if(p!==null){switch(u.tag){case 26:case 27:case 5:var b=u.stateNode;break;case 30:b=u.stateNode;break;default:b=u.stateNode}typeof p=="function"?u.refCleanup=p(b):p.current=b}}catch(T){gr(u,f,T)}}function Ua(u,f){var p=u.ref,b=u.refCleanup;if(p!==null)if(typeof b=="function")try{b()}catch(T){gr(u,f,T)}finally{u.refCleanup=null,u=u.alternate,u!=null&&(u.refCleanup=null)}else if(typeof p=="function")try{p(null)}catch(T){gr(u,f,T)}else p.current=null}function uE(u){var f=u.type,p=u.memoizedProps,b=u.stateNode;try{e:switch(f){case"button":case"input":case"select":case"textarea":p.autoFocus&&b.focus();break e;case"img":p.src?b.src=p.src:p.srcSet&&(b.srcset=p.srcSet)}}catch(T){gr(u,u.return,T)}}function yy(u,f,p){try{var b=u.stateNode;rk(b,u.type,p,f),b[Lr]=f}catch(T){gr(u,u.return,T)}}function cE(u){return u.tag===5||u.tag===3||u.tag===26||u.tag===27&&_o(u.type)||u.tag===4}function by(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||cE(u.return))return null;u=u.return}for(u.sibling.return=u.return,u=u.sibling;u.tag!==5&&u.tag!==6&&u.tag!==18;){if(u.tag===27&&_o(u.type)||u.flags&2||u.child===null||u.tag===4)continue e;u.child.return=u,u=u.child}if(!(u.flags&2))return u.stateNode}}function xy(u,f,p){var b=u.tag;if(b===5||b===6)u=u.stateNode,f?(p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p).insertBefore(u,f):(f=p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p,f.appendChild(u),p=p._reactRootContainer,p!=null||f.onclick!==null||(f.onclick=vs));else if(b!==4&&(b===27&&_o(u.type)&&(p=u.stateNode,f=null),u=u.child,u!==null))for(xy(u,f,p),u=u.sibling;u!==null;)xy(u,f,p),u=u.sibling}function A0(u,f,p){var b=u.tag;if(b===5||b===6)u=u.stateNode,f?p.insertBefore(u,f):p.appendChild(u);else if(b!==4&&(b===27&&_o(u.type)&&(p=u.stateNode),u=u.child,u!==null))for(A0(u,f,p),u=u.sibling;u!==null;)A0(u,f,p),u=u.sibling}function hE(u){var f=u.stateNode,p=u.memoizedProps;try{for(var b=u.type,T=f.attributes;T.length;)f.removeAttributeNode(T[0]);qn(f,b,p),f[nr]=u,f[Lr]=p}catch(R){gr(u,u.return,R)}}var Es=!1,yn=!1,_y=!1,fE=typeof WeakSet=="function"?WeakSet:Set,Ln=null;function LL(u,f){if(u=u.containerInfo,Hy=W0,u=E5(u),vm(u)){if("selectionStart"in u)var p={start:u.selectionStart,end:u.selectionEnd};else e:{p=(p=u.ownerDocument)&&p.defaultView||window;var b=p.getSelection&&p.getSelection();if(b&&b.rangeCount!==0){p=b.anchorNode;var T=b.anchorOffset,R=b.focusNode;b=b.focusOffset;try{p.nodeType,R.nodeType}catch{p=null;break e}var q=0,Z=-1,ve=-1,Ce=0,Le=0,ze=u,Me=null;t:for(;;){for(var Ie;ze!==p||T!==0&&ze.nodeType!==3||(Z=q+T),ze!==R||b!==0&&ze.nodeType!==3||(ve=q+b),ze.nodeType===3&&(q+=ze.nodeValue.length),(Ie=ze.firstChild)!==null;)Me=ze,ze=Ie;for(;;){if(ze===u)break t;if(Me===p&&++Ce===T&&(Z=q),Me===R&&++Le===b&&(ve=q),(Ie=ze.nextSibling)!==null)break;ze=Me,Me=ze.parentNode}ze=Ie}p=Z===-1||ve===-1?null:{start:Z,end:ve}}else p=null}p=p||{start:0,end:0}}else p=null;for(jy={focusedElem:u,selectionRange:p},W0=!1,Ln=f;Ln!==null;)if(f=Ln,u=f.child,(f.subtreeFlags&1028)!==0&&u!==null)u.return=f,Ln=u;else for(;Ln!==null;){switch(f=Ln,R=f.alternate,u=f.flags,f.tag){case 0:if((u&4)!==0&&(u=f.updateQueue,u=u!==null?u.events:null,u!==null))for(p=0;p title"))),qn(R,b,p),R[nr]=u,cr(R),b=R;break e;case"link":var q=yT("link","href",T).get(b+(p.href||""));if(q){for(var Z=0;Zwr&&(q=wr,wr=At,At=q);var we=w5(Z,At),ge=w5(Z,wr);if(we&&ge&&(Ie.rangeCount!==1||Ie.anchorNode!==we.node||Ie.anchorOffset!==we.offset||Ie.focusNode!==ge.node||Ie.focusOffset!==ge.offset)){var Te=ze.createRange();Te.setStart(we.node,we.offset),Ie.removeAllRanges(),At>wr?(Ie.addRange(Te),Ie.extend(ge.node,ge.offset)):(Te.setEnd(ge.node,ge.offset),Ie.addRange(Te))}}}}for(ze=[],Ie=Z;Ie=Ie.parentNode;)Ie.nodeType===1&&ze.push({element:Ie,left:Ie.scrollLeft,top:Ie.scrollTop});for(typeof Z.focus=="function"&&Z.focus(),Z=0;Zp?32:p,P.T=null,p=My,My=null;var R=yo,q=Rs;if(Cn=0,Qu=yo=null,Rs=0,(ir&6)!==0)throw Error(n(331));var Z=ir;if(ir|=4,SE(R.current),xE(R,R.current,q,p),ir=Z,Yh(0,!1),ne&&typeof ne.onPostCommitFiberRoot=="function")try{ne.onPostCommitFiberRoot(Q,R)}catch{}return!0}finally{H.p=T,P.T=b,GE(u,f)}}function jE(u,f,p){f=Ji(p,f),f=oy(u.stateNode,f,2),u=co(u,f,2),u!==null&&(jt(u,2),Ga(u))}function gr(u,f,p){if(u.tag===3)jE(u,u,p);else for(;f!==null;){if(f.tag===3){jE(f,u,p);break}else if(f.tag===1){var b=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof b.componentDidCatch=="function"&&(mo===null||!mo.has(b))){u=Ji(p,u),p=VS(2),b=co(f,p,2),b!==null&&(qS(p,b,f,u),jt(b,2),Ga(b));break}}f=f.return}}function Py(u,f,p){var b=u.pingCache;if(b===null){b=u.pingCache=new FL;var T=new Set;b.set(f,T)}else T=b.get(f),T===void 0&&(T=new Set,b.set(f,T));T.has(p)||(Ey=!0,T.add(p),u=jL.bind(null,u,f,p),f.then(u,u))}function jL(u,f,p){var b=u.pingCache;b!==null&&b.delete(f),u.pingedLanes|=u.suspendedLanes&p,u.warmLanes&=~p,Er===u&&(qt&p)===p&&(sn===4||sn===3&&(qt&62914560)===qt&&300>Ze()-O0?(ir&2)===0&&Ju(u,0):Ty|=p,Zu===qt&&(Zu=0)),Ga(u)}function VE(u,f){f===0&&(f=vt()),u=Sl(u,f),u!==null&&(jt(u,f),Ga(u))}function VL(u){var f=u.memoizedState,p=0;f!==null&&(p=f.retryLane),VE(u,p)}function qL(u,f){var p=0;switch(u.tag){case 31:case 13:var b=u.stateNode,T=u.memoizedState;T!==null&&(p=T.retryLane);break;case 19:b=u.stateNode;break;case 22:b=u.stateNode._retryCache;break;default:throw Error(n(314))}b!==null&&b.delete(f),VE(u,p)}function XL(u,f){return He(u,f)}var B0=null,tc=null,Iy=!1,F0=!1,Ny=!1,xo=0;function Ga(u){u!==tc&&u.next===null&&(tc===null?B0=tc=u:tc=tc.next=u),F0=!0,Iy||(Iy=!0,WL())}function Yh(u,f){if(!Ny&&F0){Ny=!0;do for(var p=!1,b=B0;b!==null;){if(u!==0){var T=b.pendingLanes;if(T===0)var R=0;else{var q=b.suspendedLanes,Z=b.pingedLanes;R=(1<<31-ee(42|u)+1)-1,R&=T&~(q&~Z),R=R&201326741?R&201326741|1:R?R|2:0}R!==0&&(p=!0,WE(b,R))}else R=qt,R=Ue(b,b===Er?R:0,b.cancelPendingCommit!==null||b.timeoutHandle!==-1),(R&3)===0||je(b,R)||(p=!0,WE(b,R));b=b.next}while(p);Ny=!1}}function YL(){qE()}function qE(){F0=Iy=!1;var u=0;xo!==0&&ik()&&(u=xo);for(var f=Ze(),p=null,b=B0;b!==null;){var T=b.next,R=XE(b,f);R===0?(b.next=null,p===null?B0=T:p.next=T,T===null&&(tc=p)):(p=b,(u!==0||(R&3)!==0)&&(F0=!0)),b=T}Cn!==0&&Cn!==5||Yh(u),xo!==0&&(xo=0)}function XE(u,f){for(var p=u.suspendedLanes,b=u.pingedLanes,T=u.expirationTimes,R=u.pendingLanes&-62914561;0Z)break;var Le=ve.transferSize,ze=ve.initiatorType;Le&&rT(ze)&&(ve=ve.responseEnd,q+=Le*(ve"u"?null:document;function vT(u,f,p){var b=rc;if(b&&typeof f=="string"&&f){var T=Zi(f);T='link[rel="'+u+'"][href="'+T+'"]',typeof p=="string"&&(T+='[crossorigin="'+p+'"]'),dT.has(T)||(dT.add(T),u={rel:u,crossOrigin:p,href:f},b.querySelector(T)===null&&(f=b.createElement("link"),qn(f,"link",u),cr(f),b.head.appendChild(f)))}}function dk(u){Os.D(u),vT("dns-prefetch",u,null)}function vk(u,f){Os.C(u,f),vT("preconnect",u,f)}function pk(u,f,p){Os.L(u,f,p);var b=rc;if(b&&u&&f){var T='link[rel="preload"][as="'+Zi(f)+'"]';f==="image"&&p&&p.imageSrcSet?(T+='[imagesrcset="'+Zi(p.imageSrcSet)+'"]',typeof p.imageSizes=="string"&&(T+='[imagesizes="'+Zi(p.imageSizes)+'"]')):T+='[href="'+Zi(u)+'"]';var R=T;switch(f){case"style":R=nc(u);break;case"script":R=ic(u)}aa.has(R)||(u=d({rel:"preload",href:f==="image"&&p&&p.imageSrcSet?void 0:u,as:f},p),aa.set(R,u),b.querySelector(T)!==null||f==="style"&&b.querySelector(Zh(R))||f==="script"&&b.querySelector(Qh(R))||(f=b.createElement("link"),qn(f,"link",u),cr(f),b.head.appendChild(f)))}}function gk(u,f){Os.m(u,f);var p=rc;if(p&&u){var b=f&&typeof f.as=="string"?f.as:"script",T='link[rel="modulepreload"][as="'+Zi(b)+'"][href="'+Zi(u)+'"]',R=T;switch(b){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":R=ic(u)}if(!aa.has(R)&&(u=d({rel:"modulepreload",href:u},f),aa.set(R,u),p.querySelector(T)===null)){switch(b){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(p.querySelector(Qh(R)))return}b=p.createElement("link"),qn(b,"link",u),cr(b),p.head.appendChild(b)}}}function mk(u,f,p){Os.S(u,f,p);var b=rc;if(b&&u){var T=Zn(b).hoistableStyles,R=nc(u);f=f||"default";var q=T.get(R);if(!q){var Z={loading:0,preload:null};if(q=b.querySelector(Zh(R)))Z.loading=5;else{u=d({rel:"stylesheet",href:u,"data-precedence":f},p),(p=aa.get(R))&&Ky(u,p);var ve=q=b.createElement("link");cr(ve),qn(ve,"link",u),ve._p=new Promise(function(Ce,Le){ve.onload=Ce,ve.onerror=Le}),ve.addEventListener("load",function(){Z.loading|=1}),ve.addEventListener("error",function(){Z.loading|=2}),Z.loading|=4,j0(q,f,b)}q={type:"stylesheet",instance:q,count:1,state:Z},T.set(R,q)}}}function yk(u,f){Os.X(u,f);var p=rc;if(p&&u){var b=Zn(p).hoistableScripts,T=ic(u),R=b.get(T);R||(R=p.querySelector(Qh(T)),R||(u=d({src:u,async:!0},f),(f=aa.get(T))&&Zy(u,f),R=p.createElement("script"),cr(R),qn(R,"link",u),p.head.appendChild(R)),R={type:"script",instance:R,count:1,state:null},b.set(T,R))}}function bk(u,f){Os.M(u,f);var p=rc;if(p&&u){var b=Zn(p).hoistableScripts,T=ic(u),R=b.get(T);R||(R=p.querySelector(Qh(T)),R||(u=d({src:u,async:!0,type:"module"},f),(f=aa.get(T))&&Zy(u,f),R=p.createElement("script"),cr(R),qn(R,"link",u),p.head.appendChild(R)),R={type:"script",instance:R,count:1,state:null},b.set(T,R))}}function pT(u,f,p,b){var T=(T=le.current)?H0(T):null;if(!T)throw Error(n(446));switch(u){case"meta":case"title":return null;case"style":return typeof p.precedence=="string"&&typeof p.href=="string"?(f=nc(p.href),p=Zn(T).hoistableStyles,b=p.get(f),b||(b={type:"style",instance:null,count:0,state:null},p.set(f,b)),b):{type:"void",instance:null,count:0,state:null};case"link":if(p.rel==="stylesheet"&&typeof p.href=="string"&&typeof p.precedence=="string"){u=nc(p.href);var R=Zn(T).hoistableStyles,q=R.get(u);if(q||(T=T.ownerDocument||T,q={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},R.set(u,q),(R=T.querySelector(Zh(u)))&&!R._p&&(q.instance=R,q.state.loading=5),aa.has(u)||(p={rel:"preload",as:"style",href:p.href,crossOrigin:p.crossOrigin,integrity:p.integrity,media:p.media,hrefLang:p.hrefLang,referrerPolicy:p.referrerPolicy},aa.set(u,p),R||xk(T,u,p,q.state))),f&&b===null)throw Error(n(528,""));return q}if(f&&b!==null)throw Error(n(529,""));return null;case"script":return f=p.async,p=p.src,typeof p=="string"&&f&&typeof f!="function"&&typeof f!="symbol"?(f=ic(p),p=Zn(T).hoistableScripts,b=p.get(f),b||(b={type:"script",instance:null,count:0,state:null},p.set(f,b)),b):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,u))}}function nc(u){return'href="'+Zi(u)+'"'}function Zh(u){return'link[rel="stylesheet"]['+u+"]"}function gT(u){return d({},u,{"data-precedence":u.precedence,precedence:null})}function xk(u,f,p,b){u.querySelector('link[rel="preload"][as="style"]['+f+"]")?b.loading=1:(f=u.createElement("link"),b.preload=f,f.addEventListener("load",function(){return b.loading|=1}),f.addEventListener("error",function(){return b.loading|=2}),qn(f,"link",p),cr(f),u.head.appendChild(f))}function ic(u){return'[src="'+Zi(u)+'"]'}function Qh(u){return"script[async]"+u}function mT(u,f,p){if(f.count++,f.instance===null)switch(f.type){case"style":var b=u.querySelector('style[data-href~="'+Zi(p.href)+'"]');if(b)return f.instance=b,cr(b),b;var T=d({},p,{"data-href":p.href,"data-precedence":p.precedence,href:null,precedence:null});return b=(u.ownerDocument||u).createElement("style"),cr(b),qn(b,"style",T),j0(b,p.precedence,u),f.instance=b;case"stylesheet":T=nc(p.href);var R=u.querySelector(Zh(T));if(R)return f.state.loading|=4,f.instance=R,cr(R),R;b=gT(p),(T=aa.get(T))&&Ky(b,T),R=(u.ownerDocument||u).createElement("link"),cr(R);var q=R;return q._p=new Promise(function(Z,ve){q.onload=Z,q.onerror=ve}),qn(R,"link",b),f.state.loading|=4,j0(R,p.precedence,u),f.instance=R;case"script":return R=ic(p.src),(T=u.querySelector(Qh(R)))?(f.instance=T,cr(T),T):(b=p,(T=aa.get(R))&&(b=d({},p),Zy(b,T)),u=u.ownerDocument||u,T=u.createElement("script"),cr(T),qn(T,"link",b),u.head.appendChild(T),f.instance=T);case"void":return null;default:throw Error(n(443,f.type))}else f.type==="stylesheet"&&(f.state.loading&4)===0&&(b=f.instance,f.state.loading|=4,j0(b,p.precedence,u));return f.instance}function j0(u,f,p){for(var b=p.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),T=b.length?b[b.length-1]:null,R=T,q=0;q title"):null)}function _k(u,f,p){if(p===1||f.itemProp!=null)return!1;switch(u){case"meta":case"title":return!0;case"style":if(typeof f.precedence!="string"||typeof f.href!="string"||f.href==="")break;return!0;case"link":if(typeof f.rel!="string"||typeof f.href!="string"||f.href===""||f.onLoad||f.onError)break;switch(f.rel){case"stylesheet":return u=f.disabled,typeof f.precedence=="string"&&u==null;default:return!0}case"script":if(f.async&&typeof f.async!="function"&&typeof f.async!="symbol"&&!f.onLoad&&!f.onError&&f.src&&typeof f.src=="string")return!0}return!1}function xT(u){return!(u.type==="stylesheet"&&(u.state.loading&3)===0)}function wk(u,f,p,b){if(p.type==="stylesheet"&&(typeof b.media!="string"||matchMedia(b.media).matches!==!1)&&(p.state.loading&4)===0){if(p.instance===null){var T=nc(b.href),R=f.querySelector(Zh(T));if(R){f=R._p,f!==null&&typeof f=="object"&&typeof f.then=="function"&&(u.count++,u=q0.bind(u),f.then(u,u)),p.state.loading|=4,p.instance=R,cr(R);return}R=f.ownerDocument||f,b=gT(b),(T=aa.get(T))&&Ky(b,T),R=R.createElement("link"),cr(R);var q=R;q._p=new Promise(function(Z,ve){q.onload=Z,q.onerror=ve}),qn(R,"link",b),p.instance=R}u.stylesheets===null&&(u.stylesheets=new Map),u.stylesheets.set(p,f),(f=p.state.preload)&&(p.state.loading&3)===0&&(u.count++,p=q0.bind(u),f.addEventListener("load",p),f.addEventListener("error",p))}}var Qy=0;function Sk(u,f){return u.stylesheets&&u.count===0&&Y0(u,u.stylesheets),0Qy?50:800)+f);return u.unsuspend=p,function(){u.unsuspend=null,clearTimeout(b),clearTimeout(T)}}:null}function q0(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Y0(this,this.stylesheets);else if(this.unsuspend){var u=this.unsuspend;this.unsuspend=null,u()}}}var X0=null;function Y0(u,f){u.stylesheets=null,u.unsuspend!==null&&(u.count++,X0=new Map,f.forEach(Ek,u),X0=null,q0.call(u))}function Ek(u,f){if(!(f.state.loading&4)){var p=X0.get(u);if(p)var b=p.get(null);else{p=new Map,X0.set(u,p);for(var T=u.querySelectorAll("link[data-precedence],style[data-precedence]"),R=0;R"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(e){console.error(e)}}return r(),o1.exports=Hk(),o1.exports}var Vk=jk();const qk=cl(Vk);g9();/** * @remix-run/router v1.23.2 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Xf(){return Xf=Object.assign?Object.assign.bind():function(r){for(var e=1;e"u")throw new Error(e)}function F_(r,e){if(!r){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function Yk(){return Math.random().toString(36).substr(2,8)}function qT(r,e){return{usr:r.state,key:r.key,idx:e}}function $x(r,e,t,n){return t===void 0&&(t=null),Xf({pathname:typeof r=="string"?r:r.pathname,search:"",hash:""},typeof e=="string"?$c(e):e,{state:t,key:e&&e.key||n||Yk()})}function Sp(r){let{pathname:e="/",search:t="",hash:n=""}=r;return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function $c(r){let e={};if(r){let t=r.indexOf("#");t>=0&&(e.hash=r.substr(t),r=r.substr(0,t));let n=r.indexOf("?");n>=0&&(e.search=r.substr(n),r=r.substr(0,n)),r&&(e.pathname=r)}return e}function Wk(r,e,t,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:a=!1}=n,s=i.history,o=ko.Pop,l=null,c=h();c==null&&(c=0,s.replaceState(Xf({},s.state,{idx:c}),""));function h(){return(s.state||{idx:null}).idx}function d(){o=ko.Pop;let y=h(),_=y==null?null:y-c;c=y,l&&l({action:o,location:x.location,delta:_})}function v(y,_){o=ko.Push;let w=$x(x.location,y,_);c=h()+1;let S=qT(w,c),A=x.createHref(w);try{s.pushState(S,"",A)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;i.location.assign(A)}a&&l&&l({action:o,location:x.location,delta:1})}function g(y,_){o=ko.Replace;let w=$x(x.location,y,_);c=h();let S=qT(w,c),A=x.createHref(w);s.replaceState(S,"",A),a&&l&&l({action:o,location:x.location,delta:0})}function m(y){let _=i.location.origin!=="null"?i.location.origin:i.location.href,w=typeof y=="string"?y:Sp(y);return w=w.replace(/ $/,"%20"),Jr(_,"No window.location.(origin|href) available to create URL for href: "+w),new URL(w,_)}let x={get action(){return o},get location(){return r(i,s)},listen(y){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(VT,d),l=y,()=>{i.removeEventListener(VT,d),l=null}},createHref(y){return e(i,y)},createURL:m,encodeLocation(y){let _=m(y);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:v,replace:g,go(y){return s.go(y)}};return x}var XT;(function(r){r.data="data",r.deferred="deferred",r.redirect="redirect",r.error="error"})(XT||(XT={}));function $k(r,e,t){return t===void 0&&(t="/"),Kk(r,e,t)}function Kk(r,e,t,n){let i=typeof e=="string"?$c(e):e,a=Bc(i.pathname||"/",t);if(a==null)return null;let s=m9(r);Zk(s);let o=null;for(let l=0;o==null&&l{let l={relativePath:o===void 0?a.path||"":o,caseSensitive:a.caseSensitive===!0,childrenIndex:s,route:a};l.relativePath.startsWith("/")&&(Jr(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let c=jo([n,l.relativePath]),h=t.concat(l);a.children&&a.children.length>0&&(Jr(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),m9(a.children,e,h,c)),!(a.path==null&&!a.index)&&e.push({path:c,score:iB(c,a.index),routesMeta:h})};return r.forEach((a,s)=>{var o;if(a.path===""||!((o=a.path)!=null&&o.includes("?")))i(a,s);else for(let l of y9(a.path))i(a,s,l)}),e}function y9(r){let e=r.split("/");if(e.length===0)return[];let[t,...n]=e,i=t.endsWith("?"),a=t.replace(/\?$/,"");if(n.length===0)return i?[a,""]:[a];let s=y9(n.join("/")),o=[];return o.push(...s.map(l=>l===""?a:[a,l].join("/"))),i&&o.push(...s),o.map(l=>r.startsWith("/")&&l===""?"/":l)}function Zk(r){r.sort((e,t)=>e.score!==t.score?t.score-e.score:aB(e.routesMeta.map(n=>n.childrenIndex),t.routesMeta.map(n=>n.childrenIndex)))}const Qk=/^:[\w-]+$/,Jk=3,eB=2,tB=1,rB=10,nB=-2,YT=r=>r==="*";function iB(r,e){let t=r.split("/"),n=t.length;return t.some(YT)&&(n+=nB),e&&(n+=eB),t.filter(i=>!YT(i)).reduce((i,a)=>i+(Qk.test(a)?Jk:a===""?tB:rB),n)}function aB(r,e){return r.length===e.length&&r.slice(0,-1).every((n,i)=>n===e[i])?r[r.length-1]-e[e.length-1]:0}function sB(r,e,t){let{routesMeta:n}=r,i={},a="/",s=[];for(let o=0;o{let{paramName:v,isOptional:g}=h;if(v==="*"){let x=o[d]||"";s=a.slice(0,a.length-x.length).replace(/(.)\/+$/,"$1")}const m=o[d];return g&&!m?c[v]=void 0:c[v]=(m||"").replace(/%2F/g,"/"),c},{}),pathname:a,pathnameBase:s,pattern:r}}function oB(r,e,t){e===void 0&&(e=!1),t===void 0&&(t=!0),F_(r==="*"||!r.endsWith("*")||r.endsWith("/*"),'Route path "'+r+'" will be treated as if it were '+('"'+r.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+r.replace(/\*$/,"/*")+'".'));let n=[],i="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,o,l)=>(n.push({paramName:o,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return r.endsWith("*")?(n.push({paramName:"*"}),i+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?i+="\\/*$":r!==""&&r!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),n]}function lB(r){try{return r.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return F_(!1,'The URL path "'+r+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),r}}function Bc(r,e){if(e==="/")return r;if(!r.toLowerCase().startsWith(e.toLowerCase()))return null;let t=e.endsWith("/")?e.length-1:e.length,n=r.charAt(t);return n&&n!=="/"?null:r.slice(t)||"/"}const uB=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,cB=r=>uB.test(r);function hB(r,e){e===void 0&&(e="/");let{pathname:t,search:n="",hash:i=""}=typeof r=="string"?$c(r):r,a;if(t)if(cB(t))a=t;else{if(t.includes("//")){let s=t;t=t.replace(/\/\/+/g,"/"),F_(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+t))}t.startsWith("/")?a=WT(t.substring(1),"/"):a=WT(t,e)}else a=e;return{pathname:a,search:vB(n),hash:pB(i)}}function WT(r,e){let t=e.replace(/\/+$/,"").split("/");return r.split("/").forEach(i=>{i===".."?t.length>1&&t.pop():i!=="."&&t.push(i)}),t.length>1?t.join("/"):"/"}function h1(r,e,t,n){return"Cannot include a '"+r+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+t+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function fB(r){return r.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function z_(r,e){let t=fB(r);return e?t.map((n,i)=>i===t.length-1?n.pathname:n.pathnameBase):t.map(n=>n.pathnameBase)}function U_(r,e,t,n){n===void 0&&(n=!1);let i;typeof r=="string"?i=$c(r):(i=Xf({},r),Jr(!i.pathname||!i.pathname.includes("?"),h1("?","pathname","search",i)),Jr(!i.pathname||!i.pathname.includes("#"),h1("#","pathname","hash",i)),Jr(!i.search||!i.search.includes("#"),h1("#","search","hash",i)));let a=r===""||i.pathname==="",s=a?"/":i.pathname,o;if(s==null)o=t;else{let d=e.length-1;if(!n&&s.startsWith("..")){let v=s.split("/");for(;v[0]==="..";)v.shift(),d-=1;i.pathname=v.join("/")}o=d>=0?e[d]:"/"}let l=hB(i,o),c=s&&s!=="/"&&s.endsWith("/"),h=(a||s===".")&&t.endsWith("/");return!l.pathname.endsWith("/")&&(c||h)&&(l.pathname+="/"),l}const jo=r=>r.join("/").replace(/\/\/+/g,"/"),dB=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/"),vB=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,pB=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r;function gB(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}const b9=["post","put","patch","delete"];new Set(b9);const mB=["get",...b9];new Set(mB);/** * React Router v6.30.3 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Yf(){return Yf=Object.assign?Object.assign.bind():function(r){for(var e=1;e{o.current=!0}),he.useCallback(function(c,h){if(h===void 0&&(h={}),!o.current)return;if(typeof c=="number"){n.go(c);return}let d=U_(c,JSON.parse(s),a,h.relative==="path");r==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:jo([e,d.pathname])),(h.replace?n.replace:n.push)(d,h.state,h)},[e,n,s,a,r])}const xB=he.createContext(null);function _B(r){let e=he.useContext(Ys).outlet;return e&&he.createElement(xB.Provider,{value:r},e)}function rg(r,e){let{relative:t}=e===void 0?{}:e,{future:n}=he.useContext(Xs),{matches:i}=he.useContext(Ys),{pathname:a}=Zc(),s=JSON.stringify(z_(i,n.v7_relativeSplatPath));return he.useMemo(()=>U_(r,JSON.parse(s),a,t==="path"),[r,s,a,t])}function wB(r,e){return SB(r,e)}function SB(r,e,t,n){Kc()||Jr(!1);let{navigator:i}=he.useContext(Xs),{matches:a}=he.useContext(Ys),s=a[a.length-1],o=s?s.params:{};s&&s.pathname;let l=s?s.pathnameBase:"/";s&&s.route;let c=Zc(),h;if(e){var d;let y=typeof e=="string"?$c(e):e;l==="/"||(d=y.pathname)!=null&&d.startsWith(l)||Jr(!1),h=y}else h=c;let v=h.pathname||"/",g=v;if(l!=="/"){let y=l.replace(/^\//,"").split("/");g="/"+v.replace(/^\//,"").split("/").slice(y.length).join("/")}let m=$k(r,{pathname:g}),x=MB(m&&m.map(y=>Object.assign({},y,{params:Object.assign({},o,y.params),pathname:jo([l,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:jo([l,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),a,t,n);return e&&x?he.createElement(tg.Provider,{value:{location:Yf({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:ko.Pop}},x):x}function EB(){let r=PB(),e=gB(r)?r.status+" "+r.statusText:r instanceof Error?r.message:JSON.stringify(r),t=r instanceof Error?r.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return he.createElement(he.Fragment,null,he.createElement("h2",null,"Unexpected Application Error!"),he.createElement("h3",{style:{fontStyle:"italic"}},e),t?he.createElement("pre",{style:i},t):null,null)}const TB=he.createElement(EB,null);class CB extends he.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?he.createElement(Ys.Provider,{value:this.props.routeContext},he.createElement(_9.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function AB(r){let{routeContext:e,match:t,children:n}=r,i=he.useContext(eg);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),he.createElement(Ys.Provider,{value:e},n)}function MB(r,e,t,n){var i;if(e===void 0&&(e=[]),t===void 0&&(t=null),n===void 0&&(n=null),r==null){var a;if(!t)return null;if(t.errors)r=t.matches;else if((a=n)!=null&&a.v7_partialHydration&&e.length===0&&!t.initialized&&t.matches.length>0)r=t.matches;else return null}let s=r,o=(i=t)==null?void 0:i.errors;if(o!=null){let h=s.findIndex(d=>d.route.id&&(o==null?void 0:o[d.route.id])!==void 0);h>=0||Jr(!1),s=s.slice(0,Math.min(s.length,h+1))}let l=!1,c=-1;if(t&&n&&n.v7_partialHydration)for(let h=0;h=0?s=s.slice(0,c+1):s=[s[0]];break}}}return s.reduceRight((h,d,v)=>{let g,m=!1,x=null,y=null;t&&(g=o&&d.route.id?o[d.route.id]:void 0,x=d.route.errorElement||TB,l&&(c<0&&v===0?(NB("route-fallback"),m=!0,y=null):c===v&&(m=!0,y=d.route.hydrateFallbackElement||null)));let _=e.concat(s.slice(0,v+1)),w=()=>{let S;return g?S=x:m?S=y:d.route.Component?S=he.createElement(d.route.Component,null):d.route.element?S=d.route.element:S=h,he.createElement(AB,{match:d,routeContext:{outlet:h,matches:_,isDataRoute:t!=null},children:S})};return t&&(d.route.ErrorBoundary||d.route.errorElement||v===0)?he.createElement(CB,{location:t.location,revalidation:t.revalidation,component:x,error:g,children:w(),routeContext:{outlet:null,matches:_,isDataRoute:!0}}):w()},null)}var S9=(function(r){return r.UseBlocker="useBlocker",r.UseRevalidator="useRevalidator",r.UseNavigateStable="useNavigate",r})(S9||{}),E9=(function(r){return r.UseBlocker="useBlocker",r.UseLoaderData="useLoaderData",r.UseActionData="useActionData",r.UseRouteError="useRouteError",r.UseNavigation="useNavigation",r.UseRouteLoaderData="useRouteLoaderData",r.UseMatches="useMatches",r.UseRevalidator="useRevalidator",r.UseNavigateStable="useNavigate",r.UseRouteId="useRouteId",r})(E9||{});function RB(r){let e=he.useContext(eg);return e||Jr(!1),e}function OB(r){let e=he.useContext(x9);return e||Jr(!1),e}function DB(r){let e=he.useContext(Ys);return e||Jr(!1),e}function T9(r){let e=DB(),t=e.matches[e.matches.length-1];return t.route.id||Jr(!1),t.route.id}function PB(){var r;let e=he.useContext(_9),t=OB(),n=T9();return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function IB(){let{router:r}=RB(S9.UseNavigateStable),e=T9(E9.UseNavigateStable),t=he.useRef(!1);return w9(()=>{t.current=!0}),he.useCallback(function(i,a){a===void 0&&(a={}),t.current&&(typeof i=="number"?r.navigate(i):r.navigate(i,Yf({fromRouteId:e},a)))},[r,e])}const $T={};function NB(r,e,t){$T[r]||($T[r]=!0)}function LB(r,e){r==null||r.v7_startTransition,r==null||r.v7_relativeSplatPath}function Zx(r){let{to:e,replace:t,state:n,relative:i}=r;Kc()||Jr(!1);let{future:a,static:s}=he.useContext(Xs),{matches:o}=he.useContext(Ys),{pathname:l}=Zc(),c=yu(),h=U_(e,z_(o,a.v7_relativeSplatPath),l,i==="path"),d=JSON.stringify(h);return he.useEffect(()=>c(JSON.parse(d),{replace:t,state:n,relative:i}),[c,d,i,t,n]),null}function kB(r){return _B(r.context)}function Gi(r){Jr(!1)}function BB(r){let{basename:e="/",children:t=null,location:n,navigationType:i=ko.Pop,navigator:a,static:s=!1,future:o}=r;Kc()&&Jr(!1);let l=e.replace(/^\/*/,"/"),c=he.useMemo(()=>({basename:l,navigator:a,static:s,future:Yf({v7_relativeSplatPath:!1},o)}),[l,o,a,s]);typeof n=="string"&&(n=$c(n));let{pathname:h="/",search:d="",hash:v="",state:g=null,key:m="default"}=n,x=he.useMemo(()=>{let y=Bc(h,l);return y==null?null:{location:{pathname:y,search:d,hash:v,state:g,key:m},navigationType:i}},[l,h,d,v,g,m,i]);return x==null?null:he.createElement(Xs.Provider,{value:c},he.createElement(tg.Provider,{children:t,value:x}))}function FB(r){let{children:e,location:t}=r;return wB(Qx(e),t)}new Promise(()=>{});function Qx(r,e){e===void 0&&(e=[]);let t=[];return he.Children.forEach(r,(n,i)=>{if(!he.isValidElement(n))return;let a=[...e,i];if(n.type===he.Fragment){t.push.apply(t,Qx(n.props.children,a));return}n.type!==Gi&&Jr(!1),!n.props.index||!n.props.children||Jr(!1);let s={id:n.props.id||a.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(s.children=Qx(n.props.children,a)),t.push(s)}),t}/** * React Router DOM v6.30.3 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Ep(){return Ep=Object.assign?Object.assign.bind():function(r){for(var e=1;e=0)&&(t[i]=r[i]);return t}function zB(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function UB(r,e){return r.button===0&&(!e||e==="_self")&&!zB(r)}const GB=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],HB=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],jB="6";try{window.__reactRouterVersion=jB}catch{}const VB=he.createContext({isTransitioning:!1}),qB="startTransition",KT=Fk[qB];function XB(r){let{basename:e,children:t,future:n,window:i}=r,a=he.useRef();a.current==null&&(a.current=Xk({window:i,v5Compat:!0}));let s=a.current,[o,l]=he.useState({action:s.action,location:s.location}),{v7_startTransition:c}=n||{},h=he.useCallback(d=>{c&&KT?KT(()=>l(d)):l(d)},[l,c]);return he.useLayoutEffect(()=>s.listen(h),[s,h]),he.useEffect(()=>LB(n),[n]),he.createElement(BB,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:s,future:n})}const YB=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",WB=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,A9=he.forwardRef(function(e,t){let{onClick:n,relative:i,reloadDocument:a,replace:s,state:o,target:l,to:c,preventScrollReset:h,viewTransition:d}=e,v=C9(e,GB),{basename:g}=he.useContext(Xs),m,x=!1;if(typeof c=="string"&&WB.test(c)&&(m=c,YB))try{let S=new URL(window.location.href),A=c.startsWith("//")?new URL(S.protocol+c):new URL(c),C=Bc(A.pathname,g);A.origin===S.origin&&C!=null?c=C+A.search+A.hash:x=!0}catch{}let y=yB(c,{relative:i}),_=KB(c,{replace:s,state:o,target:l,preventScrollReset:h,relative:i,viewTransition:d});function w(S){n&&n(S),S.defaultPrevented||_(S)}return he.createElement("a",Ep({},v,{href:m||y,onClick:x||a?n:w,ref:t,target:l}))}),tv=he.forwardRef(function(e,t){let{"aria-current":n="page",caseSensitive:i=!1,className:a="",end:s=!1,style:o,to:l,viewTransition:c,children:h}=e,d=C9(e,HB),v=rg(l,{relative:d.relative}),g=Zc(),m=he.useContext(x9),{navigator:x,basename:y}=he.useContext(Xs),_=m!=null&&ZB(v)&&c===!0,w=x.encodeLocation?x.encodeLocation(v).pathname:v.pathname,S=g.pathname,A=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;i||(S=S.toLowerCase(),A=A?A.toLowerCase():null,w=w.toLowerCase()),A&&y&&(A=Bc(A,y)||A);const C=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let M=S===w||!s&&S.startsWith(w)&&S.charAt(C)==="/",E=A!=null&&(A===w||!s&&A.startsWith(w)&&A.charAt(w.length)==="/"),O={isActive:M,isPending:E,isTransitioning:_},D=M?n:void 0,I;typeof a=="function"?I=a(O):I=[a,M?"active":null,E?"pending":null,_?"transitioning":null].filter(Boolean).join(" ");let k=typeof o=="function"?o(O):o;return he.createElement(A9,Ep({},d,{"aria-current":D,className:I,ref:t,style:k,to:l,viewTransition:c}),typeof h=="function"?h(O):h)});var Jx;(function(r){r.UseScrollRestoration="useScrollRestoration",r.UseSubmit="useSubmit",r.UseSubmitFetcher="useSubmitFetcher",r.UseFetcher="useFetcher",r.useViewTransitionState="useViewTransitionState"})(Jx||(Jx={}));var ZT;(function(r){r.UseFetcher="useFetcher",r.UseFetchers="useFetchers",r.UseScrollRestoration="useScrollRestoration"})(ZT||(ZT={}));function $B(r){let e=he.useContext(eg);return e||Jr(!1),e}function KB(r,e){let{target:t,replace:n,state:i,preventScrollReset:a,relative:s,viewTransition:o}=e===void 0?{}:e,l=yu(),c=Zc(),h=rg(r,{relative:s});return he.useCallback(d=>{if(UB(d,t)){d.preventDefault();let v=n!==void 0?n:Sp(c)===Sp(h);l(r,{replace:v,state:i,preventScrollReset:a,relative:s,viewTransition:o})}},[c,l,h,n,i,t,r,a,s,o])}function ZB(r,e){e===void 0&&(e={});let t=he.useContext(VB);t==null&&Jr(!1);let{basename:n}=$B(Jx.useViewTransitionState),i=rg(r,{relative:e.relative});if(!t.isTransitioning)return!1;let a=Bc(t.currentLocation.pathname,n)||t.currentLocation.pathname,s=Bc(t.nextLocation.pathname,n)||t.nextLocation.pathname;return Kx(i.pathname,s)!=null||Kx(i.pathname,a)!=null}const G_="kmb_access_token",QB="kmb_user_cache";function M9(){return localStorage.getItem(G_)}function JB(r){localStorage.setItem(G_,r)}function R9(){localStorage.removeItem(G_),sessionStorage.removeItem(QB)}const eF="/api/v1";async function lr(r,e){const t=M9(),n=new Headers(e==null?void 0:e.headers),i=(e==null?void 0:e.body)instanceof FormData;!n.has("Content-Type")&&(e!=null&&e.body)&&!i&&n.set("Content-Type","application/json"),t&&n.set("Authorization",`Bearer ${t}`);const a=await fetch(`${eF}${r}`,{...e,headers:n});if(a.status===401&&R9(),!a.ok){let s=`HTTP ${a.status}`;try{const o=await a.json();s=(o==null?void 0:o.detail)??JSON.stringify(o)}catch{}throw new Error(s)}return await a.json()}async function tF(r,e,t){return lr("/auth/register",{method:"POST",body:JSON.stringify({username:r,password:e,role:t})})}async function rF(r,e){const t=new URLSearchParams;return t.set("username",r),t.set("password",e),lr("/auth/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t.toString()})}async function nF(){return lr("/users/me")}async function f1(r){return lr(`/knowledge-graph/knowledge/${encodeURIComponent(r)}`)}async function H_(){return lr("/knowledge-graph/catalog")}async function iF(){return lr("/knowledge-graph/maintenance/seed-catalog",{method:"POST"})}async function aF(r,e){return lr("/knowledge-graph/prerequisite",{method:"POST",body:JSON.stringify({prerequisite_code:r,dependent_code:e})})}async function sF(r,e){const t=new URLSearchParams({prerequisite_code:r,dependent_code:e});return lr(`/knowledge-graph/prerequisite?${t.toString()}`,{method:"DELETE"})}async function QT(r,e,t,n){const i=new URLSearchParams({name:e});return t!=null&&t.trim()&&i.set("grade",t.trim()),n!=null&&n.trim()&&i.set("category",n.trim()),lr(`/knowledge-graph/knowledge/${encodeURIComponent(r)}?${i.toString()}`,{method:"POST"})}async function oF(r,e,t){const n=new URLSearchParams({grade:r,old_name:e,new_name:t});return lr(`/knowledge-graph/categories/rename?${n.toString()}`,{method:"PATCH"})}async function lF(r,e){const t=new URLSearchParams({grade:r,name:e});return lr(`/knowledge-graph/categories?${t.toString()}`,{method:"DELETE"})}async function uF(r,e){const t=new URLSearchParams({new_name:e});return lr(`/knowledge-graph/knowledge/${encodeURIComponent(r)}/rename?${t.toString()}`,{method:"PATCH"})}async function cF(r){return lr(`/knowledge-graph/knowledge/${encodeURIComponent(r)}`,{method:"DELETE"})}async function O9(r,e,t){const n=new FormData;n.append("file",e);const i=new URLSearchParams;t!=null&&t.trim()&&i.set("knowledge_code",t.trim());const a=i.toString()?`?${i.toString()}`:"";return lr(`${r}${a}`,{method:"POST",body:n})}async function hF(r,e){return O9("/knowledge-graph/exercises/import",r,e)}async function fF(r,e){return O9("/knowledge-graph/exercises/import/preview",r,e)}async function dF(r,e,t,n,i,a,s){return lr("/digital-human/ask",{method:"POST",body:JSON.stringify({question:r,knowledge_code:e,session_id:t,model_name:n,model_provider:i,model_id:a}),signal:s})}async function vF(){return lr("/digital-human/voice-assets")}async function pF(r){const e=new FormData;return e.append("file",r),lr("/digital-human/voice-assets",{method:"POST",body:e})}async function gF(r){return lr(`/digital-human/voice-assets/${encodeURIComponent(r)}`,{method:"DELETE"})}async function mF(r,e=6,t,n){return lr("/recommendation/recommend",{method:"POST",body:JSON.stringify({knowledge_code:r,limit:e,mode:t,...(n==null?void 0:n.knowledge_grade)!=null&&n.knowledge_grade!==""?{knowledge_grade:n.knowledge_grade}:{},...(n==null?void 0:n.knowledge_category)!=null&&n.knowledge_category!==""?{knowledge_category:n.knowledge_category}:{}})})}async function yF(r){return lr("/assessment/exercises",{method:"POST",body:JSON.stringify(r)})}async function bF(r){const e=r?`?knowledge_code=${encodeURIComponent(r)}`:"";return lr(`/assessment/exercises${e}`)}async function xF(r){return r.length?lr("/assessment/exercises/batch",{method:"POST",body:JSON.stringify({ids:r})}):[]}async function _F(r,e){return lr(`/assessment/exercises/${encodeURIComponent(r)}/attempts`,{method:"POST",body:JSON.stringify({answer:e})})}async function JT(){return lr("/assessment/attempts/me")}async function wF(){return lr("/learning-analytics/me")}async function SF(){return lr("/learning-analytics/me/knowledge-breakdown")}async function EF(){return lr("/learning-analytics/students")}async function TF(){return lr("/learning-analytics/wrong-book/me")}async function CF(){return lr("/learning-analytics/wrong-book/summary")}async function AF(){return lr("/modules")}async function MF(r,e,t){return lr("/modules/register",{method:"POST",body:JSON.stringify({name:r,base_url:e,is_enabled:t})})}const j_="kmb_user_cache";function e6(){try{const r=sessionStorage.getItem(j_);return r?JSON.parse(r):null}catch{return null}}function RF(r){sessionStorage.setItem(j_,JSON.stringify(r))}function OF(){sessionStorage.removeItem(j_)}const D9=he.createContext(null);function DF({children:r}){const e=e6(),[t,n]=he.useState(e),[i,a]=he.useState(!e),s=he.useCallback(async()=>{e6()||a(!0);try{const l=await nF();n(l),RF(l)}catch{n(null),OF()}finally{a(!1)}},[]);he.useEffect(()=>{s()},[s]);const o={user:t,role:(t==null?void 0:t.role)??null,username:(t==null?void 0:t.username)??"",loading:i,refresh:s};return N.jsx(D9.Provider,{value:o,children:r})}function bu(){const r=he.useContext(D9);if(!r)throw new Error("useCurrentUser must be used within UserProvider");return r}function PF(){const r=yu(),{role:e,username:t}=bu(),n=e==="teacher"?"教师":e==="student"?"学生":"";return N.jsxs(N.Fragment,{children:[N.jsx("div",{className:"nav",children:N.jsxs("div",{className:"nav-inner",children:[N.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[N.jsxs("div",{className:"row",style:{alignItems:"center"},children:[N.jsx(A9,{to:"/",className:"brand",children:"KnowMathBot"}),N.jsx("span",{className:"pill",children:"初中数学 · AI 数字人辅助教学"})]}),t||n?N.jsxs("div",{className:"row",style:{gap:10,alignItems:"center",flexWrap:"wrap"},children:[t?N.jsxs("div",{className:"row",style:{gap:8,alignItems:"center"},children:[N.jsx("span",{className:"pill",children:"当前用户"}),N.jsx("span",{className:"mono",children:t})]}):null,n?N.jsxs("div",{className:"row",style:{gap:8,alignItems:"center"},children:[N.jsx("span",{className:"pill",children:"角色"}),N.jsx("span",{className:"mono",children:n})]}):null]}):null]}),N.jsxs("div",{className:"row",style:{gap:10,alignItems:"center",flexWrap:"wrap"},children:[N.jsx(tv,{to:"/knowledge",className:({isActive:i})=>`btn ${i?"primary":""}`.trim(),children:"知识图谱"}),N.jsx(tv,{to:"/digital-human",className:({isActive:i})=>`btn ${i?"primary":""}`.trim(),children:"数字人答疑"}),N.jsx(tv,{to:"/assessment",className:({isActive:i})=>`btn ${i?"primary":""}`.trim(),children:"习题测评"}),N.jsx(tv,{to:"/analytics",className:({isActive:i})=>`btn ${i?"primary":""}`.trim(),children:"学情统计"}),N.jsx("button",{className:"btn danger",onClick:()=>{R9(),r("/login")},children:"退出"})]})]})}),N.jsx("div",{className:"container",children:N.jsx(kB,{})})]})}function IF(){return N.jsx(DF,{children:N.jsx(PF,{})})}function NF(){const r=yu(),[e,t]=he.useState("login"),[n,i]=he.useState("student1"),[a,s]=he.useState("123456"),[o,l]=he.useState("student"),[c,h]=he.useState(null),[d,v]=he.useState(null),[g,m]=he.useState(!1);async function x(y){y.preventDefault(),v(null),h(null),m(!0);try{if(e==="register")await tF(n,a,o),h("注册成功,请登录。"),t("login");else{const _=await rF(n,a);JB(_.access_token),r("/")}}catch(_){v(_ instanceof Error?_.message:"操作失败")}finally{m(!1)}}return N.jsx("div",{className:"container",style:{maxWidth:520,minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",paddingTop:24,paddingBottom:24},children:N.jsxs("div",{className:"card",style:{padding:18,width:"100%"},children:[N.jsxs("div",{className:"row",style:{justifyContent:"space-between"},children:[N.jsxs("div",{children:[N.jsx("div",{style:{fontSize:20,fontWeight:800},children:"KnowMathBot"}),N.jsx("div",{className:"muted",style:{marginTop:6},children:"更懂你的AI数学辅助机器人"})]}),N.jsxs("div",{className:"row",children:[N.jsx("button",{className:`btn ${e==="login"?"primary":""}`,onClick:()=>t("login"),children:"登录"}),N.jsx("button",{className:`btn ${e==="register"?"primary":""}`,onClick:()=>t("register"),children:"注册"})]})]}),N.jsxs("form",{onSubmit:x,style:{marginTop:14},children:[N.jsxs("div",{style:{marginBottom:10},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"用户名"}),N.jsx("input",{className:"input",value:n,onChange:y=>i(y.target.value)})]}),N.jsxs("div",{style:{marginBottom:10},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"密码"}),N.jsx("input",{className:"input",type:"password",value:a,onChange:y=>s(y.target.value)})]}),e==="register"?N.jsxs("div",{style:{marginBottom:10},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"角色"}),N.jsxs("select",{className:"select",value:o,onChange:y=>l(y.target.value),children:[N.jsx("option",{value:"student",children:"学生"}),N.jsx("option",{value:"teacher",children:"教师"})]})]}):null,d?N.jsx("div",{className:"error",style:{marginBottom:10},children:d}):null,c?N.jsx("div",{className:"success",style:{marginBottom:10},children:c}):null,N.jsx("button",{className:"btn primary",disabled:g,style:{width:"100%"},children:g?"处理中...":e==="login"?"登录":"注册"})]})]})})}function e4(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(l){throw l},f:i}}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 a,s=!0,o=!1;return{s:function(){t=t.call(r)},n:function(){var l=t.next();return s=l.done,l},e:function(l){o=!0,a=l},f:function(){try{s||t.return==null||t.return()}finally{if(o)throw a}}}}function P9(r,e,t){return(e=I9(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function FF(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function zF(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,a,s,o=[],l=!0,c=!1;try{if(a=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(n=a.call(t)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(h){c=!0,i=h}finally{try{if(!l&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(c)throw i}}return o}}function UF(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GF(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _n(r,e){return LF(r)||zF(r,e)||V_(r,e)||UF()}function Tp(r){return kF(r)||FF(r)||V_(r)||GF()}function HF(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function I9(r){var e=HF(r,"string");return typeof e=="symbol"?e:e+""}function On(r){"@babel/helpers - typeof";return On=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},On(r)}function V_(r,e){if(r){if(typeof r=="string")return e4(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?e4(r,e):void 0}}var An=typeof window>"u"?null:window,t6=An?An.navigator:null;An&&An.document;var jF=On(""),N9=On({}),VF=On(function(){}),qF=typeof HTMLElement>"u"?"undefined":On(HTMLElement),Ed=function(e){return e&&e.instanceString&&en(e.instanceString)?e.instanceString():null},xt=function(e){return e!=null&&On(e)==jF},en=function(e){return e!=null&&On(e)===VF},Cr=function(e){return!qi(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Zt=function(e){return e!=null&&On(e)===N9&&!Cr(e)&&e.constructor===Object},XF=function(e){return e!=null&&On(e)===N9},ut=function(e){return e!=null&&On(e)===On(1)&&!isNaN(e)},YF=function(e){return ut(e)&&Math.floor(e)===e},Cp=function(e){if(qF!=="undefined")return e!=null&&e instanceof HTMLElement},qi=function(e){return Td(e)||L9(e)},Td=function(e){return Ed(e)==="collection"&&e._private.single},L9=function(e){return Ed(e)==="collection"&&!e._private.single},q_=function(e){return Ed(e)==="core"},k9=function(e){return Ed(e)==="stylesheet"},WF=function(e){return Ed(e)==="event"},$o=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},$F=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},KF=function(e){return Zt(e)&&ut(e.x1)&&ut(e.x2)&&ut(e.y1)&&ut(e.y2)},ZF=function(e){return XF(e)&&en(e.then)},QF=function(){return t6&&t6.userAgent.match(/msie|trident|edge/i)},Fc=function(e,t){t||(t=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var a=[],s=0;st?1:0},az=function(e,t){return-1*F9(e,t)},Ct=Object.assign!=null?Object.assign.bind(Object):function(r){for(var e=arguments,t=1;t1&&(y-=1),y<1/6?m+(x-m)*6*y:y<1/2?x:y<2/3?m+(x-m)*(2/3-y)*6:m}var d=new RegExp("^"+tz+"$").exec(e);if(d){if(n=parseInt(d[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=360,i=parseFloat(d[2]),i<0||i>100||(i=i/100,a=parseFloat(d[3]),a<0||a>100)||(a=a/100,s=d[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(i===0)o=l=c=Math.round(a*255);else{var v=a<.5?a*(1+i):a+i-a*i,g=2*a-v;o=Math.round(255*h(g,v,n+1/3)),l=Math.round(255*h(g,v,n)),c=Math.round(255*h(g,v,n-1/3))}t=[o,l,c,s]}return t},lz=function(e){var t,n=new RegExp("^"+JF+"$").exec(e);if(n){t=[];for(var i=[],a=1;a<=3;a++){var s=n[a];if(s[s.length-1]==="%"&&(i[a]=!0),s=parseFloat(s),i[a]&&(s=s/100*255),s<0||s>255)return;t.push(Math.floor(s))}var o=i[1]||i[2]||i[3],l=i[1]&&i[2]&&i[3];if(o&&!l)return;var c=n[4];if(c!==void 0){if(c=parseFloat(c),c<0||c>1)return;t.push(c)}}return t},uz=function(e){return cz[e.toLowerCase()]},z9=function(e){return(Cr(e)?e:null)||uz(e)||sz(e)||lz(e)||oz(e)},cz={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},U9=function(e){for(var t=e.map,n=e.keys,i=n.length,a=0;a=l||X<0||w&&W>=v}function O(){var V=e();if(E(V))return D(V);m=setTimeout(O,M(V))}function D(V){return m=void 0,S&&h?A(V):(h=d=void 0,g)}function I(){m!==void 0&&clearTimeout(m),y=0,h=x=d=m=void 0}function k(){return m===void 0?g:D(e())}function U(){var V=e(),X=E(V);if(h=arguments,d=this,x=V,X){if(m===void 0)return C(x);if(w)return clearTimeout(m),m=setTimeout(O,l),A(x)}return m===void 0&&(m=setTimeout(O,l)),g}return U.cancel=I,U.flush=k,U}return C1=s,C1}var xz=bz(),Rd=Cd(xz),A1=An?An.performance:null,j9=A1&&A1.now?function(){return A1.now()}:function(){return Date.now()},_z=(function(){if(An){if(An.requestAnimationFrame)return function(r){An.requestAnimationFrame(r)};if(An.mozRequestAnimationFrame)return function(r){An.mozRequestAnimationFrame(r)};if(An.webkitRequestAnimationFrame)return function(r){An.webkitRequestAnimationFrame(r)};if(An.msRequestAnimationFrame)return function(r){An.msRequestAnimationFrame(r)}}return function(r){r&&setTimeout(function(){r(j9())},1e3/60)}})(),Ap=function(e){return _z(e)},js=j9,nu=9261,V9=65599,wc=5381,q9=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:nu,n=t,i;i=e.next(),!i.done;)n=n*V9+i.value|0;return n},Wf=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:nu;return t*V9+e|0},$f=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:wc;return(t<<5)+t+e|0},wz=function(e,t){return e*2097152+t},Ao=function(e){return e[0]*2097152+e[1]},nv=function(e,t){return[Wf(e[0],t[0]),$f(e[1],t[1])]},m6=function(e,t){var n={value:0,done:!1},i=0,a=e.length,s={next:function(){return i=0;i--)e[i]===t&&e.splice(i,1)},K_=function(e){e.splice(0,e.length)},Pz=function(e,t){for(var n=0;n"u"?"undefined":On(Set))!==Nz?Set:Lz,ag=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||t===void 0||!q_(e)){jr("An element must have a core reference and parameters set");return}var i=t.group;if(i==null&&(t.data&&t.data.source!=null&&t.data.target!=null?i="edges":i="nodes"),i!=="nodes"&&i!=="edges"){jr("An element must be of type `nodes` or `edges`; you specified `"+i+"`");return}this.length=1,this[0]=this;var a=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:i,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:t.selectable===void 0?!0:!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:t.grabbable===void 0?!0:!!t.grabbable,pannable:t.pannable===void 0?i==="edges":!!t.pannable,active:!1,classes:new Qc,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(a.position.x==null&&(a.position.x=0),a.position.y==null&&(a.position.y=0),t.renderedPosition){var s=t.renderedPosition,o=e.pan(),l=e.zoom();a.position={x:(s.x-o.x)/l,y:(s.y-o.y)/l}}var c=[];Cr(t.classes)?c=t.classes:xt(t.classes)&&(c=t.classes.split(/\s+/));for(var h=0,d=c.length;hw?1:0},h=function(_,w,S,A,C){var M;if(S==null&&(S=0),C==null&&(C=n),S<0)throw new Error("lo must be non-negative");for(A==null&&(A=_.length);SI;0<=I?D++:D--)O.push(D);return O}).apply(this).reverse(),E=[],A=0,C=M.length;Ak;0<=k?++O:--O)U.push(s(_,S));return U},x=function(_,w,S,A){var C,M,E;for(A==null&&(A=n),C=_[S];S>w;){if(E=S-1>>1,M=_[E],A(C,M)<0){_[S]=M,S=E;continue}break}return _[S]=C},y=function(_,w,S){var A,C,M,E,O;for(S==null&&(S=n),C=_.length,O=w,M=_[w],A=2*w+1;A0;){var M=w.pop(),E=y(M),O=M.id();if(v[O]=E,E!==1/0)for(var D=M.neighborhood().intersect(m),I=0;I0)for(z.unshift(H);d[B];){var L=d[B];z.unshift(L.edge),z.unshift(L.node),$=L.node,B=$.id()}return o.spawn(z)}}}},Hz={kruskal:function(e){e=e||function(S){return 1};for(var t=this.byGroup(),n=t.nodes,i=t.edges,a=n.length,s=new Array(a),o=n,l=function(A){for(var C=0;C0;){if(C(),E++,A===h){for(var O=[],D=a,I=h,k=_[I];O.unshift(D),k!=null&&O.unshift(k),D=y[I],D!=null;)I=D.id(),k=_[I];return{found:!0,distance:d[A],path:this.spawn(O),steps:E}}g[A]=!0;for(var U=S._private.edges,V=0;Vk&&(m[I]=k,w[I]=D,S[I]=C),!a){var U=D*h+O;!a&&m[U]>k&&(m[U]=k,w[U]=O,S[U]=C)}}}for(var V=0;V1&&arguments[1]!==void 0?arguments[1]:s,He=S($e),tt=[],ot=He;;){if(ot==null)return t.spawn();var ct=w(ot),Ze=ct.edge,bt=ct.pred;if(tt.unshift(ot[0]),ot.same(Ye)&&tt.length>0)break;Ze!=null&&tt.unshift(Ze),ot=bt}return l.spawn(tt)},M=0;M=0;h--){var d=c[h],v=d[1],g=d[2];(t[v]===o&&t[g]===l||t[v]===l&&t[g]===o)&&c.splice(h,1)}for(var m=0;mi;){var a=Math.floor(Math.random()*t.length);t=Kz(a,e,t),n--}return t},Zz={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,i=t.edges;i.unmergeBy(function(z){return z.isLoop()});var a=n.length,s=i.length,o=Math.ceil(Math.pow(Math.log(a)/Math.LN2,2)),l=Math.floor(a/$z);if(a<2){jr("At least 2 nodes are required for Karger-Stein algorithm");return}for(var c=[],h=0;h1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=1/0,a=t;a1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=-1/0,a=t;a1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=0,a=0,s=t;s1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;i?e=e.slice(t,n):(n0&&e.splice(0,t));for(var o=0,l=e.length-1;l>=0;l--){var c=e[l];s?isFinite(c)||(e[l]=-1/0,o++):e.splice(l,1)}a&&e.sort(function(v,g){return v-g});var h=e.length,d=Math.floor(h/2);return h%2!==0?e[d+1+o]:(e[d-1+o]+e[d+o])/2},nU=function(e){return Math.PI*e/180},iv=function(e,t){return Math.atan2(t,e)-Math.PI/2},Z_=Math.log2||function(r){return Math.log(r)/Math.log(2)},Q_=function(e){return e>0?1:e<0?-1:0},hu=function(e,t){return Math.sqrt(Wl(e,t))},Wl=function(e,t){var n=t.x-e.x,i=t.y-e.y;return n*n+i*i},iU=function(e){for(var t=e.length,n=0,i=0;i=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},sU=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},oU=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},lU=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},Q9=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},tp=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},rp=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,i,a,s;if(t.length===1)n=i=a=s=t[0];else if(t.length===2)n=a=t[0],s=i=t[1];else if(t.length===4){var o=_n(t,4);n=o[0],i=o[1],a=o[2],s=o[3]}return e.x1-=s,e.x2+=i,e.y1-=n,e.y2+=a,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},S6=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},J_=function(e,t){return!(e.x1>t.x2||t.x1>e.x2||e.x2t.y2||t.y1>e.y2)},Fo=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},E6=function(e,t){return Fo(e,t.x,t.y)},J9=function(e,t){return Fo(e,t.x1,t.y1)&&Fo(e,t.x2,t.y2)},uU=(O1=Math.hypot)!==null&&O1!==void 0?O1:function(r,e){return Math.sqrt(r*r+e*e)};function cU(r,e){if(r.length<3)throw new Error("Need at least 3 vertices");var t=function(O,D){return{x:O.x+D.x,y:O.y+D.y}},n=function(O,D){return{x:O.x-D.x,y:O.y-D.y}},i=function(O,D){return{x:O.x*D,y:O.y*D}},a=function(O,D){return O.x*D.y-O.y*D.x},s=function(O){var D=uU(O.x,O.y);return D===0?{x:0,y:0}:{x:O.x/D,y:O.y/D}},o=function(O){for(var D=0,I=0;I7&&arguments[7]!==void 0?arguments[7]:"auto",c=l==="auto"?Zo(a,s):l,h=a/2,d=s/2;c=Math.min(c,h,d);var v=c!==h,g=c!==d,m;if(v){var x=n-h+c-o,y=i-d-o,_=n+h-c+o,w=y;if(m=zo(e,t,n,i,x,y,_,w,!1),m.length>0)return m}if(g){var S=n+h+o,A=i-d+c-o,C=S,M=i+d-c+o;if(m=zo(e,t,n,i,S,A,C,M,!1),m.length>0)return m}if(v){var E=n-h+c-o,O=i+d+o,D=n+h-c+o,I=O;if(m=zo(e,t,n,i,E,O,D,I,!1),m.length>0)return m}if(g){var k=n-h-o,U=i-d+c-o,V=k,X=i+d-c+o;if(m=zo(e,t,n,i,k,U,V,X,!1),m.length>0)return m}var W;{var P=n-h+c,H=i-d+c;if(W=Af(e,t,n,i,P,H,c+o),W.length>0&&W[0]<=P&&W[1]<=H)return[W[0],W[1]]}{var z=n+h-c,$=i-d+c;if(W=Af(e,t,n,i,z,$,c+o),W.length>0&&W[0]>=z&&W[1]<=$)return[W[0],W[1]]}{var B=n+h-c,L=i+d-c;if(W=Af(e,t,n,i,B,L,c+o),W.length>0&&W[0]>=B&&W[1]>=L)return[W[0],W[1]]}{var Y=n-h+c,G=i+d-c;if(W=Af(e,t,n,i,Y,G,c+o),W.length>0&&W[0]<=Y&&W[1]>=G)return[W[0],W[1]]}return[]},fU=function(e,t,n,i,a,s,o){var l=o,c=Math.min(n,a),h=Math.max(n,a),d=Math.min(i,s),v=Math.max(i,s);return c-l<=e&&e<=h+l&&d-l<=t&&t<=v+l},dU=function(e,t,n,i,a,s,o,l,c){var h={x1:Math.min(n,o,a)-c,x2:Math.max(n,o,a)+c,y1:Math.min(i,l,s)-c,y2:Math.max(i,l,s)+c};return!(eh.x2||th.y2)},vU=function(e,t,n,i){n-=i;var a=t*t-4*e*n;if(a<0)return[];var s=Math.sqrt(a),o=2*e,l=(-t+s)/o,c=(-t-s)/o;return[l,c]},pU=function(e,t,n,i,a){var s=1e-5;e===0&&(e=s),t/=e,n/=e,i/=e;var o,l,c,h,d,v,g,m;if(l=(3*n-t*t)/9,c=-(27*i)+t*(9*n-2*(t*t)),c/=54,o=l*l*l+c*c,a[1]=0,g=t/3,o>0){d=c+Math.sqrt(o),d=d<0?-Math.pow(-d,1/3):Math.pow(d,1/3),v=c-Math.sqrt(o),v=v<0?-Math.pow(-v,1/3):Math.pow(v,1/3),a[0]=-g+d+v,g+=(d+v)/2,a[4]=a[2]=-g,g=Math.sqrt(3)*(-v+d)/2,a[3]=g,a[5]=-g;return}if(a[5]=a[3]=0,o===0){m=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),a[0]=-g+2*m,a[4]=a[2]=-(m+g);return}l=-l,h=l*l*l,h=Math.acos(c/Math.sqrt(h)),m=2*Math.sqrt(l),a[0]=-g+m*Math.cos(h/3),a[2]=-g+m*Math.cos((h+2*Math.PI)/3),a[4]=-g+m*Math.cos((h+4*Math.PI)/3)},gU=function(e,t,n,i,a,s,o,l){var c=1*n*n-4*n*a+2*n*o+4*a*a-4*a*o+o*o+i*i-4*i*s+2*i*l+4*s*s-4*s*l+l*l,h=9*n*a-3*n*n-3*n*o-6*a*a+3*a*o+9*i*s-3*i*i-3*i*l-6*s*s+3*s*l,d=3*n*n-6*n*a+n*o-n*e+2*a*a+2*a*e-o*e+3*i*i-6*i*s+i*l-i*t+2*s*s+2*s*t-l*t,v=1*n*a-n*n+n*e-a*e+i*s-i*i+i*t-s*t,g=[];pU(c,h,d,v,g);for(var m=1e-7,x=[],y=0;y<6;y+=2)Math.abs(g[y+1])=0&&g[y]<=1&&x.push(g[y]);x.push(1),x.push(0);for(var _=-1,w,S,A,C=0;C=0?A<_&&(_=A):_=A;return _},mU=function(e,t,n,i,a,s){var o=[e-n,t-i],l=[a-n,s-i],c=l[0]*l[0]+l[1]*l[1],h=o[0]*o[0]+o[1]*o[1],d=o[0]*l[0]+o[1]*l[1],v=d*d/c;return d<0?h:v>c?(e-a)*(e-a)+(t-s)*(t-s):h-v},Mi=function(e,t,n){for(var i,a,s,o,l,c=0,h=0;h=e&&e>=s||i<=e&&e<=s)l=(e-i)/(s-i)*(o-a)+a,l>t&&c++;else continue;return c%2!==0},Vs=function(e,t,n,i,a,s,o,l,c){var h=new Array(n.length),d;l[0]!=null?(d=Math.atan(l[1]/l[0]),l[0]<0?d=d+Math.PI/2:d=-d-Math.PI/2):d=l;for(var v=Math.cos(-d),g=Math.sin(-d),m=0;m0){var y=Op(h,-c);x=Rp(y)}else x=h;return Mi(e,t,x)},yU=function(e,t,n,i,a,s,o,l){for(var c=new Array(n.length*2),h=0;h=0&&y<=1&&w.push(y),_>=0&&_<=1&&w.push(_),w.length===0)return[];var S=w[0]*l[0]+e,A=w[0]*l[1]+t;if(w.length>1){if(w[0]==w[1])return[S,A];var C=w[1]*l[0]+e,M=w[1]*l[1]+t;return[S,A,C,M]}else return[S,A]},D1=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},zo=function(e,t,n,i,a,s,o,l,c){var h=e-a,d=n-e,v=o-a,g=t-s,m=i-t,x=l-s,y=v*g-x*h,_=d*g-m*h,w=x*d-v*m;if(w!==0){var S=y/w,A=_/w,C=.001,M=0-C,E=1+C;return M<=S&&S<=E&&M<=A&&A<=E?[e+S*d,t+S*m]:c?[e+S*d,t+S*m]:[]}else return y===0||_===0?D1(e,n,o)===o?[o,l]:D1(e,n,a)===a?[a,s]:D1(a,o,n)===n?[n,i]:[]:[]},xU=function(e,t,n,i,a){var s=[],o=i/2,l=a/2,c=t,h=n;s.push({x:c+o*e[0],y:h+l*e[1]});for(var d=1;d0){var x=Op(d,-l);g=Rp(x)}else g=d}else g=n;for(var y,_,w,S,A=0;A2){for(var m=[h[0],h[1]],x=Math.pow(m[0]-e,2)+Math.pow(m[1]-t,2),y=1;yh&&(h=A)},get:function(S){return c[S]}},v=0;v0?W=X.edgesTo(V)[0]:W=V.edgesTo(X)[0];var P=i(W);V=V.id(),E[V]>E[k]+P&&(E[V]=E[k]+P,O.nodes.indexOf(V)<0?O.push(V):O.updateItem(V),M[V]=0,C[V]=[]),E[V]==E[k]+P&&(M[V]=M[V]+M[k],C[V].push(k))}else for(var H=0;H0;){for(var L=A.pop(),Y=0;Y0&&o.push(n[l]);o.length!==0&&a.push(i.collection(o))}return a},LU=function(e,t){for(var n=0;n5&&arguments[5]!==void 0?arguments[5]:FU,o=i,l,c,h=0;h=2?sf(e,t,n,0,R6,zU):sf(e,t,n,0,M6)},squaredEuclidean:function(e,t,n){return sf(e,t,n,0,R6)},manhattan:function(e,t,n){return sf(e,t,n,0,M6)},max:function(e,t,n){return sf(e,t,n,-1/0,UU)}};zc["squared-euclidean"]=zc.squaredEuclidean;zc.squaredeuclidean=zc.squaredEuclidean;function og(r,e,t,n,i,a){var s;return en(r)?s=r:s=zc[r]||zc.euclidean,e===0&&en(r)?s(i,a):s(e,t,n,i,a)}var GU=$n({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),tw=function(e){return GU(e)},Dp=function(e,t,n,i,a){var s=a!=="kMedoids",o=s?function(d){return n[d]}:function(d){return i[d](n)},l=function(v){return i[v](t)},c=n,h=t;return og(e,i.length,o,l,c,h)},I1=function(e,t,n){for(var i=n.length,a=new Array(i),s=new Array(i),o=new Array(t),l=null,c=0;cn)return!1}return!0},VU=function(e,t,n){for(var i=0;io&&(o=t[c][h],l=h);a[l].push(e[c])}for(var d=0;d=a.threshold||a.mode==="dendrogram"&&e.length===1)return!1;var m=t[s],x=t[i[s]],y;a.mode==="dendrogram"?y={left:m,right:x,key:m.key}:y={value:m.value.concat(x.value),key:m.key},e[m.index]=y,e.splice(x.index,1),t[m.key]=y;for(var _=0;_n[x.key][w.key]&&(l=n[x.key][w.key])):a.linkage==="max"?(l=n[m.key][w.key],n[m.key][w.key]0&&i.push(a);return i},L6=function(e,t,n){for(var i=[],a=0;ao&&(s=c,o=t[a*e+c])}s>0&&i.push(s)}for(var h=0;hc&&(l=h,c=d)}n[a]=s[l]}return i=L6(e,t,n),i},k6=function(e){for(var t=this.cy(),n=this.nodes(),i=rG(e),a={},s=0;s=k?(U=k,k=X,V=W):X>U&&(U=X);for(var P=0;P0?1:0;E[D%i.minIterations*o+Y]=G,L+=G}if(L>0&&(D>=i.minIterations-1||D==i.maxIterations-1)){for(var re=0,ie=0;ie1||M>1)&&(o=!0),d[S]=[],w.outgoers().forEach(function(O){O.isEdge()&&d[S].push(O.id())})}else v[S]=[void 0,w.target().id()]}):s.forEach(function(w){var S=w.id();if(w.isNode()){var A=w.degree(!0);A%2&&(l?c?o=!0:c=S:l=S),d[S]=[],w.connectedEdges().forEach(function(C){return d[S].push(C.id())})}else v[S]=[w.source().id(),w.target().id()]});var g={found:!1,trail:void 0};if(o)return g;if(c&&l)if(a){if(h&&c!=h)return g;h=c}else{if(h&&c!=h&&l!=h)return g;h||(h=c)}else h||(h=s[0].id());var m=function(S){for(var A=S,C=[S],M,E,O;d[A].length;)M=d[A].shift(),E=v[M][0],O=v[M][1],A!=O?(d[O]=d[O].filter(function(D){return D!=M}),A=O):!a&&A!=E&&(d[E]=d[E].filter(function(D){return D!=M}),A=E),C.unshift(M),C.unshift(A);return C},x=[],y=[];for(y=m(h);y.length!=1;)d[y[0]].length==0?(x.unshift(s.getElementById(y.shift())),x.unshift(s.getElementById(y.shift()))):y=m(y.shift()).concat(y);x.unshift(s.getElementById(y.shift()));for(var _ in d)if(d[_].length)return g;return g.found=!0,g.trail=this.spawn(x,!0),g}},sv=function(){var e=this,t={},n=0,i=0,a=[],s=[],o={},l=function(v,g){for(var m=s.length-1,x=[],y=e.spawn();s[m].x!=v||s[m].y!=g;)x.push(s.pop().edge),m--;x.push(s.pop().edge),x.forEach(function(_){var w=_.connectedNodes().intersection(e);y.merge(_),w.forEach(function(S){var A=S.id(),C=S.connectedEdges().intersection(e);y.merge(S),t[A].cutVertex?y.merge(C.filter(function(M){return M.isLoop()})):y.merge(C)})}),a.push(y)},c=function(v,g,m){v===m&&(i+=1),t[g]={id:n,low:n++,cutVertex:!1};var x=e.getElementById(g).connectedEdges().intersection(e);if(x.size()===0)a.push(e.spawn(e.getElementById(g)));else{var y,_,w,S;x.forEach(function(A){y=A.source().id(),_=A.target().id(),w=y===g?_:y,w!==m&&(S=A.id(),o[S]||(o[S]=!0,s.push({x:g,y:w,edge:A})),w in t?t[g].low=Math.min(t[g].low,t[w].id):(c(v,w,g),t[g].low=Math.min(t[g].low,t[w].low),t[g].id<=t[w].low&&(t[g].cutVertex=!0,l(g,w))))})}};e.forEach(function(d){if(d.isNode()){var v=d.id();v in t||(i=0,c(v,v),t[v].cutVertex=i>1)}});var h=Object.keys(t).filter(function(d){return t[d].cutVertex}).map(function(d){return e.getElementById(d)});return{cut:e.spawn(h),components:a}},cG={hopcroftTarjanBiconnected:sv,htbc:sv,htb:sv,hopcroftTarjanBiconnectedComponents:sv},ov=function(){var e=this,t={},n=0,i=[],a=[],s=e.spawn(e),o=function(c){a.push(c),t[c]={index:n,low:n++,explored:!1};var h=e.getElementById(c).connectedEdges().intersection(e);if(h.forEach(function(x){var y=x.target().id();y!==c&&(y in t||o(y),t[y].explored||(t[c].low=Math.min(t[c].low,t[y].low)))}),t[c].index===t[c].low){for(var d=e.spawn();;){var v=a.pop();if(d.merge(e.getElementById(v)),t[v].low=t[c].index,t[v].explored=!0,v===c)break}var g=d.edgesWith(d),m=d.merge(g);i.push(m),s=s.difference(m)}};return e.forEach(function(l){if(l.isNode()){var c=l.id();c in t||o(c)}}),{cut:s,components:i}},hG={tarjanStronglyConnected:ov,tsc:ov,tscc:ov,tarjanStronglyConnectedComponents:ov},oR={};[Kf,Gz,Hz,Vz,Xz,Wz,Zz,EU,Rc,Oc,n4,BU,KU,eG,oG,uG,cG,hG].forEach(function(r){Ct(oR,r)});/*! Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com) Licensed under The MIT License (http://opensource.org/licenses/MIT) */var lR=0,uR=1,cR=2,La=function(e){if(!(this instanceof La))return new La(e);this.id="Thenable/1.0.7",this.state=lR,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};La.prototype={fulfill:function(e){return B6(this,uR,"fulfillValue",e)},reject:function(e){return B6(this,cR,"rejectReason",e)},then:function(e,t){var n=this,i=new La;return n.onFulfilled.push(z6(e,i,"fulfill")),n.onRejected.push(z6(t,i,"reject")),hR(n),i.proxy}};var B6=function(e,t,n,i){return e.state===lR&&(e.state=t,e[n]=i,hR(e)),e},hR=function(e){e.state===uR?F6(e,"onFulfilled",e.fulfillValue):e.state===cR&&F6(e,"onRejected",e.rejectReason)},F6=function(e,t,n){if(e[t].length!==0){var i=e[t];e[t]=[];var a=function(){for(var o=0;o0}},clearQueue:function(){return function(){var t=this,n=t.length!==void 0,i=n?t:[t],a=this._private.cy||this;if(!a.styleEnabled())return this;for(var s=0;s-1}return t2=e,t2}var r2,l8;function OG(){if(l8)return r2;l8=1;var r=cg();function e(t,n){var i=this.__data__,a=r(i,t);return a<0?(++this.size,i.push([t,n])):i[a][1]=n,this}return r2=e,r2}var n2,u8;function DG(){if(u8)return n2;u8=1;var r=CG(),e=AG(),t=MG(),n=RG(),i=OG();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o-1&&n%1==0&&n0&&this.spawn(i).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return t!=null&&t._private.classes.has(e)},toggleClass:function(e,t){Cr(e)||(e=e.match(/\S+/g)||[]);for(var n=this,i=t===void 0,a=[],s=0,o=n.length;s0&&this.spawn(a).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(t==null)t=250;else if(t===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},t),n}};np.className=np.classNames=np.classes;var Kt={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:Rn,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Kt.variable="(?:[\\w-.]|(?:\\\\"+Kt.metaChar+"))+";Kt.className="(?:[\\w-]|(?:\\\\"+Kt.metaChar+"))+";Kt.value=Kt.string+"|"+Kt.number;Kt.id=Kt.variable;(function(){var r,e,t;for(r=Kt.comparatorOp.split("|"),t=0;t=0)&&e!=="="&&(Kt.comparatorOp+="|\\!"+e)})();var Sr=function(){return{checks:[]}},pt={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},o4=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(r,e){return az(r.selector,e.selector)}),lH=(function(){for(var r={},e,t=0;t0&&h.edgeCount>0)return fr("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(h.edgeCount>1)return fr("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;h.edgeCount===1&&fr("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},vH=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(h){return h??""},t=function(h){return xt(h)?'"'+h+'"':e(h)},n=function(h){return" "+h+" "},i=function(h,d){var v=h.type,g=h.value;switch(v){case pt.GROUP:{var m=e(g);return m.substring(0,m.length-1)}case pt.DATA_COMPARE:{var x=h.field,y=h.operator;return"["+x+n(e(y))+t(g)+"]"}case pt.DATA_BOOL:{var _=h.operator,w=h.field;return"["+e(_)+w+"]"}case pt.DATA_EXIST:{var S=h.field;return"["+S+"]"}case pt.META_COMPARE:{var A=h.operator,C=h.field;return"[["+C+n(e(A))+t(g)+"]]"}case pt.STATE:return g;case pt.ID:return"#"+g;case pt.CLASS:return"."+g;case pt.PARENT:case pt.CHILD:return a(h.parent,d)+n(">")+a(h.child,d);case pt.ANCESTOR:case pt.DESCENDANT:return a(h.ancestor,d)+" "+a(h.descendant,d);case pt.COMPOUND_SPLIT:{var M=a(h.left,d),E=a(h.subject,d),O=a(h.right,d);return M+(M.length>0?" ":"")+E+O}case pt.TRUE:return""}},a=function(h,d){return h.checks.reduce(function(v,g,m){return v+(d===h&&m===0?"$":"")+i(g,d)},"")},s="",o=0;o1&&o=0&&(t=t.replace("!",""),d=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),h=!0),(a||o||h)&&(l=!a&&!s?"":""+e,c=""+n),h&&(e=l=l.toLowerCase(),n=c=c.toLowerCase()),t){case"*=":i=l.indexOf(c)>=0;break;case"$=":i=l.indexOf(c,l.length-c.length)>=0;break;case"^=":i=l.indexOf(c)===0;break;case"=":i=e===n;break;case">":v=!0,i=e>n;break;case">=":v=!0,i=e>=n;break;case"<":v=!0,i=e0;){var h=i.shift();e(h),a.add(h.id()),o&&n(i,a,h)}return r}function bR(r,e,t){if(t.isParent())for(var n=t._private.children,i=0;i1&&arguments[1]!==void 0?arguments[1]:!0;return aw(this,r,e,bR)};function xR(r,e,t){if(t.isChild()){var n=t._private.parent;e.has(n.id())||r.push(n)}}Uc.forEachUp=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return aw(this,r,e,xR)};function wH(r,e,t){xR(r,e,t),bR(r,e,t)}Uc.forEachUpAndDown=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return aw(this,r,e,wH)};Uc.ancestors=Uc.parents;var Jf,_R;Jf=_R={data:hr.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:hr.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:hr.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:hr.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:hr.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:hr.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};Jf.attr=Jf.data;Jf.removeAttr=Jf.removeData;var SH=_R,fg={};function D2(r){return function(e){var t=this;if(e===void 0&&(e=!0),t.length!==0)if(t.isNode()&&!t.removed()){for(var n=0,i=t[0],a=i._private.edges,s=0;se}),minIndegree:oc("indegree",function(r,e){return re}),minOutdegree:oc("outdegree",function(r,e){return re})});Ct(fg,{totalDegree:function(e){for(var t=0,n=this.nodes(),i=0;i0,v=d;d&&(h=h[0]);var g=v?h.position():{x:0,y:0};t!==void 0?c.position(e,t+g[e]):a!==void 0&&c.position({x:a.x+g.x,y:a.y+g.y})}else{var m=n.position(),x=o?n.parent():null,y=x&&x.length>0,_=y;y&&(x=x[0]);var w=_?x.position():{x:0,y:0};return a={x:m.x-w.x,y:m.y-w.y},e===void 0?a:a[e]}else if(!s)return;return this}};Pa.modelPosition=Pa.point=Pa.position;Pa.modelPositions=Pa.points=Pa.positions;Pa.renderedPoint=Pa.renderedPosition;Pa.relativePoint=Pa.relativePosition;var EH=wR,Dc,dl;Dc=dl={};dl.renderedBoundingBox=function(r){var e=this.boundingBox(r),t=this.cy(),n=t.zoom(),i=t.pan(),a=e.x1*n+i.x,s=e.x2*n+i.x,o=e.y1*n+i.y,l=e.y2*n+i.y;return{x1:a,x2:s,y1:o,y2:l,w:s-a,h:l-o}};dl.dirtyCompoundBoundsCache=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,r||t.emitAndNotify("bounds")}}),this)};dl.updateCompoundBounds=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!r&&e.batching())return this;function t(s){if(!s.isParent())return;var o=s._private,l=s.children(),c=s.pstyle("compound-sizing-wrt-labels").value==="include",h={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},d=l.boundingBox({includeLabels:c,includeOverlays:!1,useCache:!1}),v=o.position;(d.w===0||d.h===0)&&(d={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},d.x1=v.x-d.w/2,d.x2=v.x+d.w/2,d.y1=v.y-d.h/2,d.y2=v.y+d.h/2);function g(D,I,k){var U=0,V=0,X=I+k;return D>0&&X>0&&(U=I/X*D,V=k/X*D),{biasDiff:U,biasComplementDiff:V}}function m(D,I,k,U){if(k.units==="%")switch(U){case"width":return D>0?k.pfValue*D:0;case"height":return I>0?k.pfValue*I:0;case"average":return D>0&&I>0?k.pfValue*(D+I)/2:0;case"min":return D>0&&I>0?D>I?k.pfValue*I:k.pfValue*D:0;case"max":return D>0&&I>0?D>I?k.pfValue*D:k.pfValue*I:0;default:return 0}else return k.units==="px"?k.pfValue:0}var x=h.width.left.value;h.width.left.units==="px"&&h.width.val>0&&(x=x*100/h.width.val);var y=h.width.right.value;h.width.right.units==="px"&&h.width.val>0&&(y=y*100/h.width.val);var _=h.height.top.value;h.height.top.units==="px"&&h.height.val>0&&(_=_*100/h.height.val);var w=h.height.bottom.value;h.height.bottom.units==="px"&&h.height.val>0&&(w=w*100/h.height.val);var S=g(h.width.val-d.w,x,y),A=S.biasDiff,C=S.biasComplementDiff,M=g(h.height.val-d.h,_,w),E=M.biasDiff,O=M.biasComplementDiff;o.autoPadding=m(d.w,d.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),o.autoWidth=Math.max(d.w,h.width.val),v.x=(-A+d.x1+d.x2+C)/2,o.autoHeight=Math.max(d.h,h.height.val),v.y=(-E+d.y1+d.y2+O)/2}for(var n=0;ne.x2?i:e.x2,e.y1=ne.y2?a:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},Lo=function(e,t){return t==null?e:Oa(e,t.x1,t.y1,t.x2,t.y2)},of=function(e,t,n){return Ai(e,t,n)},lv=function(e,t,n){if(!t.cy().headless()){var i=t._private,a=i.rstyle,s=a.arrowWidth/2,o=t.pstyle(n+"-arrow-shape").value,l,c;if(o!=="none"){n==="source"?(l=a.srcX,c=a.srcY):n==="target"?(l=a.tgtX,c=a.tgtY):(l=a.midX,c=a.midY);var h=i.arrowBounds=i.arrowBounds||{},d=h[n]=h[n]||{};d.x1=l-s,d.y1=c-s,d.x2=l+s,d.y2=c+s,d.w=d.x2-d.x1,d.h=d.y2-d.y1,tp(d,1),Oa(e,d.x1,d.y1,d.x2,d.y2)}}},P2=function(e,t,n){if(!t.cy().headless()){var i;n?i=n+"-":i="";var a=t._private,s=a.rstyle,o=t.pstyle(i+"label").strValue;if(o){var l=t.pstyle("text-halign"),c=t.pstyle("text-valign"),h=of(s,"labelWidth",n),d=of(s,"labelHeight",n),v=of(s,"labelX",n),g=of(s,"labelY",n),m=t.pstyle(i+"text-margin-x").pfValue,x=t.pstyle(i+"text-margin-y").pfValue,y=t.isEdge(),_=t.pstyle(i+"text-rotation"),w=t.pstyle("text-outline-width").pfValue,S=t.pstyle("text-border-width").pfValue,A=S/2,C=t.pstyle("text-background-padding").pfValue,M=2,E=d,O=h,D=O/2,I=E/2,k,U,V,X;if(y)k=v-D,U=v+D,V=g-I,X=g+I;else{switch(l.value){case"left":k=v-O,U=v;break;case"center":k=v-D,U=v+D;break;case"right":k=v,U=v+O;break}switch(c.value){case"top":V=g-E,X=g;break;case"center":V=g-I,X=g+I;break;case"bottom":V=g,X=g+E;break}}var W=m-Math.max(w,A)-C-M,P=m+Math.max(w,A)+C+M,H=x-Math.max(w,A)-C-M,z=x+Math.max(w,A)+C+M;k+=W,U+=P,V+=H,X+=z;var $=n||"main",B=a.labelBounds,L=B[$]=B[$]||{};L.x1=k,L.y1=V,L.x2=U,L.y2=X,L.w=U-k,L.h=X-V,L.leftPad=W,L.rightPad=P,L.topPad=H,L.botPad=z;var Y=y&&_.strValue==="autorotate",G=_.pfValue!=null&&_.pfValue!==0;if(Y||G){var re=Y?of(a.rstyle,"labelAngle",n):_.pfValue,ie=Math.cos(re),le=Math.sin(re),ce=(k+U)/2,_e=(V+X)/2;if(!y){switch(l.value){case"left":ce=U;break;case"right":ce=k;break}switch(c.value){case"top":_e=X;break;case"bottom":_e=V;break}}var pe=function(Be,$e){return Be=Be-ce,$e=$e-_e,{x:Be*ie-$e*le+ce,y:Be*le+$e*ie+_e}},ae=pe(k,V),oe=pe(k,X),de=pe(U,V),ye=pe(U,X);k=Math.min(ae.x,oe.x,de.x,ye.x),U=Math.max(ae.x,oe.x,de.x,ye.x),V=Math.min(ae.y,oe.y,de.y,ye.y),X=Math.max(ae.y,oe.y,de.y,ye.y)}var Ee=$+"Rot",Re=B[Ee]=B[Ee]||{};Re.x1=k,Re.y1=V,Re.x2=U,Re.y2=X,Re.w=U-k,Re.h=X-V,Oa(e,k,V,U,X),Oa(a.labelBounds.all,k,V,U,X)}return e}},F8=function(e,t){if(!t.cy().headless()){var n=t.pstyle("outline-opacity").value,i=t.pstyle("outline-width").value,a=t.pstyle("outline-offset").value,s=i+a;ER(e,t,n,s,"outside",s/2)}},ER=function(e,t,n,i,a,s){if(!(n===0||i<=0||a==="inside")){var o=t.cy(),l=o.renderer(),c=l.nodeShapes[l.getNodeShape(t)];if(c){var h=t.position(),d=h.x,v=h.y,g=t.width(),m=t.height();if(c.hasMiterBounds){a==="center"&&(i/=2);var x=c.miterBounds(d,v,g,m,i);Lo(e,x)}else s!=null&&s>0&&rp(e,[s,s,s,s])}}},TH=function(e,t){if(!t.cy().headless()){var n=t.pstyle("border-opacity").value,i=t.pstyle("border-width").pfValue,a=t.pstyle("border-position").value;ER(e,t,n,i,a)}},CH=function(e,t){var n=e._private.cy,i=n.styleEnabled(),a=n.headless(),s=di(),o=e._private,l=e.isNode(),c=e.isEdge(),h,d,v,g,m,x,y=o.rstyle,_=l&&i?e.pstyle("bounds-expansion").pfValue:[0],w=function(Ne){return Ne.pstyle("display").value!=="none"},S=!i||w(e)&&(!c||w(e.source())&&w(e.target()));if(S){var A=0,C=0;i&&t.includeOverlays&&(A=e.pstyle("overlay-opacity").value,A!==0&&(C=e.pstyle("overlay-padding").value));var M=0,E=0;i&&t.includeUnderlays&&(M=e.pstyle("underlay-opacity").value,M!==0&&(E=e.pstyle("underlay-padding").value));var O=Math.max(C,E),D=0,I=0;if(i&&(D=e.pstyle("width").pfValue,I=D/2),l&&t.includeNodes){var k=e.position();m=k.x,x=k.y;var U=e.outerWidth(),V=U/2,X=e.outerHeight(),W=X/2;h=m-V,d=m+V,v=x-W,g=x+W,Oa(s,h,v,d,g),i&&F8(s,e),i&&t.includeOutlines&&!a&&F8(s,e),i&&TH(s,e)}else if(c&&t.includeEdges)if(i&&!a){var P=e.pstyle("curve-style").strValue;if(h=Math.min(y.srcX,y.midX,y.tgtX),d=Math.max(y.srcX,y.midX,y.tgtX),v=Math.min(y.srcY,y.midY,y.tgtY),g=Math.max(y.srcY,y.midY,y.tgtY),h-=I,d+=I,v-=I,g+=I,Oa(s,h,v,d,g),P==="haystack"){var H=y.haystackPts;if(H&&H.length===2){if(h=H[0].x,v=H[0].y,d=H[1].x,g=H[1].y,h>d){var z=h;h=d,d=z}if(v>g){var $=v;v=g,g=$}Oa(s,h-I,v-I,d+I,g+I)}}else if(P==="bezier"||P==="unbundled-bezier"||Bo(P,"segments")||Bo(P,"taxi")){var B;switch(P){case"bezier":case"unbundled-bezier":B=y.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":B=y.linePts;break}if(B!=null)for(var L=0;Ld){var ce=h;h=d,d=ce}if(v>g){var _e=v;v=g,g=_e}h-=I,d+=I,v-=I,g+=I,Oa(s,h,v,d,g)}if(i&&t.includeEdges&&c&&(lv(s,e,"mid-source"),lv(s,e,"mid-target"),lv(s,e,"source"),lv(s,e,"target")),i){var pe=e.pstyle("ghost").value==="yes";if(pe){var ae=e.pstyle("ghost-offset-x").pfValue,oe=e.pstyle("ghost-offset-y").pfValue;Oa(s,s.x1+ae,s.y1+oe,s.x2+ae,s.y2+oe)}}var de=o.bodyBounds=o.bodyBounds||{};S6(de,s),rp(de,_),tp(de,1),i&&(h=s.x1,d=s.x2,v=s.y1,g=s.y2,Oa(s,h-O,v-O,d+O,g+O));var ye=o.overlayBounds=o.overlayBounds||{};S6(ye,s),rp(ye,_),tp(ye,1);var Ee=o.labelBounds=o.labelBounds||{};Ee.all!=null?oU(Ee.all):Ee.all=di(),i&&t.includeLabels&&(t.includeMainLabels&&P2(s,e,null),c&&(t.includeSourceLabels&&P2(s,e,"source"),t.includeTargetLabels&&P2(s,e,"target")))}return s.x1=ca(s.x1),s.y1=ca(s.y1),s.x2=ca(s.x2),s.y2=ca(s.y2),s.w=ca(s.x2-s.x1),s.h=ca(s.y2-s.y1),s.w>0&&s.h>0&&S&&(rp(s,_),tp(s,1)),s},TR=function(e){var t=0,n=function(s){return(s?1:0)<0&&arguments[0]!==void 0?arguments[0]:GH,e=arguments.length>1?arguments[1]:void 0,t=0;t=0;o--)s(o);return this};el.removeAllListeners=function(){return this.removeListener("*")};el.emit=el.trigger=function(r,e,t){var n=this.listeners,i=n.length;return this.emitting++,Cr(e)||(e=[e]),HH(this,function(a,s){t!=null&&(n=[{event:s.event,type:s.type,namespace:s.namespace,callback:t}],i=n.length);for(var o=function(){var h=n[l];if(h.type===s.type&&(!h.namespace||h.namespace===s.namespace||h.namespace===UH)&&a.eventMatches(a.context,h,s)){var d=[s];e!=null&&Pz(d,e),a.beforeEmit(a.context,h,s),h.conf&&h.conf.one&&(a.listeners=a.listeners.filter(function(m){return m!==h}));var v=a.callbackContext(a.context,h,s),g=h.callback.apply(v,d);a.afterEmit(a.context,h,s),g===!1&&(s.stopPropagation(),s.preventDefault())}},l=0;l1&&!s){var o=this.length-1,l=this[o],c=l._private.data.id;this[o]=void 0,this[e]=l,a.set(c,{ele:l,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,n=e._private.data.id,i=t.map,a=i.get(n);if(!a)return this;var s=a.index;return this.unmergeAt(s),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&xt(e)){var n=e;e=t.mutableElements().filter(n)}for(var i=0;i=0;t--){var n=this[t];e(n)&&this.unmergeAt(t)}return this},map:function(e,t){for(var n=[],i=this,a=0;an&&(n=l,i=o)}return{value:n,ele:i}},min:function(e,t){for(var n=1/0,i,a=this,s=0;s=0&&a"u"?"undefined":On(Symbol))!=e&&On(Symbol.iterator)!=e;t&&(Pp[Symbol.iterator]=function(){var n=this,i={value:void 0,done:!1},a=0,s=this.length;return P9({next:function(){return a1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],i=n.cy();if(i.styleEnabled()&&n){n._private.styleDirty&&(n._private.styleDirty=!1,i.style().apply(n));var a=n._private.style[e];return a??(t?i.style().getDefaultProperty(e):null)}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled()&&t)return t.pstyle(e).units},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];if(n)return t.style().getRenderedStyle(n,e)},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var i=!1,a=n.style();if(Zt(e)){var s=e;a.applyBypass(this,s,i),this.emitAndNotify("style")}else if(xt(e))if(t===void 0){var o=this[0];return o?a.getStylePropertyValue(o,e):void 0}else a.applyBypass(this,e,t,i),this.emitAndNotify("style");else if(e===void 0){var l=this[0];return l?a.getRawStyle(l):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=!1,i=t.style(),a=this;if(e===void 0)for(var s=0;s0&&e.push(h[0]),e.push(o[0])}return this.spawn(e,!0).filter(r)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}});ri.neighbourhood=ri.neighborhood;ri.closedNeighbourhood=ri.closedNeighborhood;ri.openNeighbourhood=ri.openNeighborhood;Ct(ri,{source:va(function(e){var t=this[0],n;return t&&(n=t._private.source||t.cy().collection()),n&&e?n.filter(e):n},"source"),target:va(function(e){var t=this[0],n;return t&&(n=t._private.target||t.cy().collection()),n&&e?n.filter(e):n},"target"),sources:$8({attr:"source"}),targets:$8({attr:"target"})});function $8(r){return function(t){for(var n=[],i=0;i0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});ri.componentsOf=ri.components;var Wn=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){jr("A collection must have a reference to the core");return}var a=new zs,s=!1;if(!t)t=[];else if(t.length>0&&Zt(t[0])&&!Td(t[0])){s=!0;for(var o=[],l=new Qc,c=0,h=t.length;c0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this,n=t.cy(),i=n._private,a=[],s=[],o,l=0,c=t.length;l0){for(var $=o.length===t.length?t:new Wn(n,o),B=0;B<$.length;B++){var L=$[B];L.isNode()||(L.parallelEdges().clearTraversalCache(),L.source().clearTraversalCache(),L.target().clearTraversalCache())}var Y;i.hasCompoundNodes?Y=n.collection().merge($).merge($.connectedNodes()).merge($.parent()):Y=$,Y.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(r),r?$.emitAndNotify("add"):e&&$.emit("add")}return t};Pr.removed=function(){var r=this[0];return r&&r._private.removed};Pr.inside=function(){var r=this[0];return r&&!r._private.removed};Pr.remove=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this,n=[],i={},a=t._private.cy;function s(X){for(var W=X._private.edges,P=0;P0&&(r?k.emitAndNotify("remove"):e&&k.emit("remove"));for(var U=0;U0?U=X:k=X;while(Math.abs(V)>s&&++W=a?w(I,W):P===0?W:A(I,k,k+c)}var M=!1;function E(){M=!0,(r!==e||t!==n)&&S()}var O=function(k){return M||E(),r===e&&t===n?k:k===0?0:k===1?1:y(C(k),e,n)};O.getControlPoints=function(){return[{x:r,y:e},{x:t,y:n}]};var D="generateBezier("+[r,e,t,n]+")";return O.toString=function(){return D},O}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var JH=(function(){function r(n){return-n.tension*n.x-n.friction*n.v}function e(n,i,a){var s={x:n.x+a.dx*i,v:n.v+a.dv*i,tension:n.tension,friction:n.friction};return{dx:s.v,dv:r(s)}}function t(n,i){var a={dx:n.v,dv:r(n)},s=e(n,i*.5,a),o=e(n,i*.5,s),l=e(n,i,o),c=1/6*(a.dx+2*(s.dx+o.dx)+l.dx),h=1/6*(a.dv+2*(s.dv+o.dv)+l.dv);return n.x=n.x+c*i,n.v=n.v+h*i,n}return function n(i,a,s){var o={x:-1,v:0,tension:null,friction:null},l=[0],c=0,h=1/1e4,d=16/1e3,v,g,m;for(i=parseFloat(i)||500,a=parseFloat(a)||20,s=s||null,o.tension=i,o.friction=a,v=s!==null,v?(c=n(i,a),g=c/s*d):g=d;m=t(m||o,g),l.push(1+m.x),c+=16,Math.abs(m.x)>h&&Math.abs(m.v)>h;);return v?function(x){return l[x*(l.length-1)|0]}:c}})(),Rr=function(e,t,n,i){var a=QH(e,t,n,i);return function(s,o,l){return s+(o-s)*a(l)}},ap={linear:function(e,t,n){return e+(t-e)*n},ease:Rr(.25,.1,.25,1),"ease-in":Rr(.42,0,1,1),"ease-out":Rr(0,0,.58,1),"ease-in-out":Rr(.42,0,.58,1),"ease-in-sine":Rr(.47,0,.745,.715),"ease-out-sine":Rr(.39,.575,.565,1),"ease-in-out-sine":Rr(.445,.05,.55,.95),"ease-in-quad":Rr(.55,.085,.68,.53),"ease-out-quad":Rr(.25,.46,.45,.94),"ease-in-out-quad":Rr(.455,.03,.515,.955),"ease-in-cubic":Rr(.55,.055,.675,.19),"ease-out-cubic":Rr(.215,.61,.355,1),"ease-in-out-cubic":Rr(.645,.045,.355,1),"ease-in-quart":Rr(.895,.03,.685,.22),"ease-out-quart":Rr(.165,.84,.44,1),"ease-in-out-quart":Rr(.77,0,.175,1),"ease-in-quint":Rr(.755,.05,.855,.06),"ease-out-quint":Rr(.23,1,.32,1),"ease-in-out-quint":Rr(.86,0,.07,1),"ease-in-expo":Rr(.95,.05,.795,.035),"ease-out-expo":Rr(.19,1,.22,1),"ease-in-out-expo":Rr(1,0,0,1),"ease-in-circ":Rr(.6,.04,.98,.335),"ease-out-circ":Rr(.075,.82,.165,1),"ease-in-out-circ":Rr(.785,.135,.15,.86),spring:function(e,t,n){if(n===0)return ap.linear;var i=JH(e,t,n);return function(a,s,o){return a+(s-a)*i(o)}},"cubic-bezier":Rr};function Q8(r,e,t,n,i){if(n===1||e===t)return t;var a=i(e,t,n);return r==null||((r.roundValue||r.color)&&(a=Math.round(a)),r.min!==void 0&&(a=Math.max(a,r.min)),r.max!==void 0&&(a=Math.min(a,r.max))),a}function J8(r,e){return r.pfValue!=null||r.value!=null?r.pfValue!=null&&(e==null||e.type.units!=="%")?r.pfValue:r.value:r}function lc(r,e,t,n,i){var a=i!=null?i.type:null;t<0?t=0:t>1&&(t=1);var s=J8(r,i),o=J8(e,i);if(ut(s)&&ut(o))return Q8(a,s,o,t,n);if(Cr(s)&&Cr(o)){for(var l=[],c=0;c0?(g==="spring"&&m.push(s.duration),s.easingImpl=ap[g].apply(null,m)):s.easingImpl=ap[g]}var x=s.easingImpl,y;if(s.duration===0?y=1:y=(t-l)/s.duration,s.applying&&(y=s.progress),y<0?y=0:y>1&&(y=1),s.delay==null){var _=s.startPosition,w=s.position;if(w&&i&&!r.locked()){var S={};uf(_.x,w.x)&&(S.x=lc(_.x,w.x,y,x)),uf(_.y,w.y)&&(S.y=lc(_.y,w.y,y,x)),r.position(S)}var A=s.startPan,C=s.pan,M=a.pan,E=C!=null&&n;E&&(uf(A.x,C.x)&&(M.x=lc(A.x,C.x,y,x)),uf(A.y,C.y)&&(M.y=lc(A.y,C.y,y,x)),r.emit("pan"));var O=s.startZoom,D=s.zoom,I=D!=null&&n;I&&(uf(O,D)&&(a.zoom=Zf(a.minZoom,lc(O,D,y,x),a.maxZoom)),r.emit("zoom")),(E||I)&&r.emit("viewport");var k=s.style;if(k&&k.length>0&&i){for(var U=0;U=0;E--){var O=M[E];O()}M.splice(0,M.length)},w=g.length-1;w>=0;w--){var S=g[w],A=S._private;if(A.stopped){g.splice(w,1),A.hooked=!1,A.playing=!1,A.started=!1,_(A.frames);continue}!A.playing&&!A.applying||(A.playing&&A.applying&&(A.applying=!1),A.started||tj(h,S,r),ej(h,S,r,d),A.applying&&(A.applying=!1),_(A.frames),A.step!=null&&A.step(r),S.completed()&&(g.splice(w,1),A.hooked=!1,A.playing=!1,A.started=!1,_(A.completes)),x=!0)}return!d&&g.length===0&&m.length===0&&n.push(h),x}for(var a=!1,s=0;s0?e.notify("draw",t):e.notify("draw")),t.unmerge(n),e.emit("step")}var rj={animate:hr.animate(),animation:hr.animation(),animated:hr.animated(),clearQueue:hr.clearQueue(),delay:hr.delay(),delayAnimation:hr.delayAnimation(),stop:hr.stop(),addToAnimationPool:function(e){var t=this;t.styleEnabled()&&t._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function t(){e._private.animationsRunning&&Ap(function(a){e7(a,e),t()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(a,s){e7(s,e)},n.beforeRenderPriorities.animations):t()}},nj={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,n){var i=t.qualifier;return i!=null?e!==n.target&&Td(n.target)&&i.matches(n.target):!0},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return t.qualifier!=null?n.target:e}},hv=function(e){return xt(e)?new Qo(e):e},kR={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new dg(nj,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,hv(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,hv(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,hv(t),n),this},once:function(e,t,n){return this.emitter().one(e,hv(t),n),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};hr.eventAliasesOn(kR);var u4={png:function(e){var t=this._private.renderer;return e=e||{},t.png(e)},jpg:function(e){var t=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",t.jpg(e)}};u4.jpeg=u4.jpg;var sp={layout:function(e){var t=this;if(e==null){jr("Layout options must be specified to make a layout");return}if(e.name==null){jr("A `name` must be specified to make a layout");return}var n=e.name,i=t.extension("layout",n);if(i==null){jr("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var a;xt(e.eles)?a=t.$(e.eles):a=e.eles!=null?e.eles:t.$();var s=new i(Ct({},e,{cy:t,eles:a}));return s}};sp.createLayout=sp.makeLayout=sp.layout;var ij={notify:function(e,t){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var i=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();t!=null&&i.merge(t);return}if(n.notificationsEnabled){var a=this.renderer();this.destroyed()||!a||a.notify(e,t)}},notifications:function(e){var t=this._private;return e===void 0?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var i=e.batchNotifications[n];i.empty()?t.notify(n):t.notify(n,i)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch(function(){for(var n=Object.keys(e),i=0;i0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var i=n._private;i.rscratch={},i.rstyle={},i.animation.current=[],i.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};c4.invalidateDimensions=c4.resize;var op={collection:function(e,t){return xt(e)?this.$(e):qi(e)?e.collection():Cr(e)?(t||(t={}),new Wn(this,e,t.unique,t.removed)):new Wn(this)},nodes:function(e){var t=this.$(function(n){return n.isNode()});return e?t.filter(e):t},edges:function(e){var t=this.$(function(n){return n.isEdge()});return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};op.elements=op.filter=op.$;var Un={},Bf="t",sj="f";Un.apply=function(r){for(var e=this,t=e._private,n=t.cy,i=n.collection(),a=0;a0;if(v||d&&g){var m=void 0;v&&g||v?m=c.properties:g&&(m=c.mappedProperties);for(var x=0;x1&&(A=1),o.color){var M=n.valueMin[0],E=n.valueMax[0],O=n.valueMin[1],D=n.valueMax[1],I=n.valueMin[2],k=n.valueMax[2],U=n.valueMin[3]==null?1:n.valueMin[3],V=n.valueMax[3]==null?1:n.valueMax[3],X=[Math.round(M+(E-M)*A),Math.round(O+(D-O)*A),Math.round(I+(k-I)*A),Math.round(U+(V-U)*A)];a={bypass:n.bypass,name:n.name,value:X,strValue:"rgb("+X[0]+", "+X[1]+", "+X[2]+")"}}else if(o.number){var W=n.valueMin+(n.valueMax-n.valueMin)*A;a=this.parse(n.name,W,n.bypass,v)}else return!1;if(!a)return x(),!1;a.mapping=n,n=a;break}case s.data:{for(var P=n.field.split("."),H=d.data,z=0;z0&&a>0){for(var o={},l=!1,c=0;c0?r.delayAnimation(s).play().promise().then(S):S()}).then(function(){return r.animation({style:o,duration:a,easing:r.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){t.removeBypasses(r,i),r.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(r,i),r.emitAndNotify("style"),n.transitioning=!1)};Un.checkTrigger=function(r,e,t,n,i,a){var s=this.properties[e],o=i(s);r.removed()||o!=null&&o(t,n,r)&&a(s)};Un.checkZOrderTrigger=function(r,e,t,n){var i=this;this.checkTrigger(r,e,t,n,function(a){return a.triggersZOrder},function(){i._private.cy.notify("zorder",r)})};Un.checkBoundsTrigger=function(r,e,t,n){this.checkTrigger(r,e,t,n,function(i){return i.triggersBounds},function(i){r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache()})};Un.checkConnectedEdgesBoundsTrigger=function(r,e,t,n){this.checkTrigger(r,e,t,n,function(i){return i.triggersBoundsOfConnectedEdges},function(i){r.connectedEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})};Un.checkParallelEdgesBoundsTrigger=function(r,e,t,n){this.checkTrigger(r,e,t,n,function(i){return i.triggersBoundsOfParallelEdges},function(i){r.parallelEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})};Un.checkTriggers=function(r,e,t,n){r.dirtyStyleCache(),this.checkZOrderTrigger(r,e,t,n),this.checkBoundsTrigger(r,e,t,n),this.checkConnectedEdgesBoundsTrigger(r,e,t,n),this.checkParallelEdgesBoundsTrigger(r,e,t,n)};var Pd={};Pd.applyBypass=function(r,e,t,n){var i=this,a=[],s=!0;if(e==="*"||e==="**"){if(t!==void 0)for(var o=0;oi.length?n=n.substr(i.length):n=""}function l(){a.length>s.length?a=a.substr(s.length):a=""}for(;;){var c=n.match(/^\s*$/);if(c)break;var h=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!h){fr("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}i=h[0];var d=h[1];if(d!=="core"){var v=new Qo(d);if(v.invalid){fr("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),o();continue}}var g=h[2],m=!1;a=g;for(var x=[];;){var y=a.match(/^\s*$/);if(y)break;var _=a.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!_){fr("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+g),m=!0;break}s=_[0];var w=_[1],S=_[2],A=e.properties[w];if(!A){fr("Skipping property: Invalid property name in: "+s),l();continue}var C=t.parse(w,S);if(!C){fr("Skipping property: Invalid property definition in: "+s),l();continue}x.push({name:w,val:S}),l()}if(m){o();break}t.selector(d);for(var M=0;M=7&&e[0]==="d"&&(h=new RegExp(o.data.regex).exec(e))){if(t)return!1;var v=o.data;return{name:r,value:h,strValue:""+e,mapped:v,field:h[1],bypass:t}}else if(e.length>=10&&e[0]==="m"&&(d=new RegExp(o.mapData.regex).exec(e))){if(t||c.multiple)return!1;var g=o.mapData;if(!(c.color||c.number))return!1;var m=this.parse(r,d[4]);if(!m||m.mapped)return!1;var x=this.parse(r,d[5]);if(!x||x.mapped)return!1;if(m.pfValue===x.pfValue||m.strValue===x.strValue)return fr("`"+r+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+r+": "+m.strValue+"`"),this.parse(r,m.strValue);if(c.color){var y=m.value,_=x.value,w=y[0]===_[0]&&y[1]===_[1]&&y[2]===_[2]&&(y[3]===_[3]||(y[3]==null||y[3]===1)&&(_[3]==null||_[3]===1));if(w)return!1}return{name:r,value:d,strValue:""+e,mapped:g,field:d[1],fieldMin:parseFloat(d[2]),fieldMax:parseFloat(d[3]),valueMin:m.value,valueMax:x.value,bypass:t}}}if(c.multiple&&n!=="multiple"){var S;if(l?S=e.split(/\s+/):Cr(e)?S=e:S=[e],c.evenMultiple&&S.length%2!==0)return null;for(var A=[],C=[],M=[],E="",O=!1,D=0;D0?" ":"")+I.strValue}return c.validate&&!c.validate(A,C)?null:c.singleEnum&&O?A.length===1&&xt(A[0])?{name:r,value:A[0],strValue:A[0],bypass:t}:null:{name:r,value:A,pfValue:M,strValue:E,bypass:t,units:C}}var k=function(){for(var pe=0;pec.max||c.strictMax&&e===c.max))return null;var P={name:r,value:e,strValue:""+e+(U||""),units:U,bypass:t};return c.unitless||U!=="px"&&U!=="em"?P.pfValue=e:P.pfValue=U==="px"||!U?e:this.getEmSizeInPixels()*e,(U==="ms"||U==="s")&&(P.pfValue=U==="ms"?e:1e3*e),(U==="deg"||U==="rad")&&(P.pfValue=U==="rad"?e:nU(e)),U==="%"&&(P.pfValue=e/100),P}else if(c.propList){var H=[],z=""+e;if(z!=="none"){for(var $=z.split(/\s*,\s*|\s+/),B=0;B<$.length;B++){var L=$[B].trim();i.properties[L]?H.push(L):fr("`"+L+"` is not a valid property name")}if(H.length===0)return null}return{name:r,value:H,strValue:H.length===0?"none":H.join(" "),bypass:t}}else if(c.color){var Y=z9(e);return Y?{name:r,value:Y,pfValue:Y,strValue:"rgb("+Y[0]+","+Y[1]+","+Y[2]+")",bypass:t}:null}else if(c.regex||c.regexes){if(c.enums){var G=k();if(G)return G}for(var re=c.regexes?c.regexes:[c.regex],ie=0;ie0&&o>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((s-2*t)/n.w,(o-2*t)/n.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t=this._private,n=t.pan,i=t.zoom,a,s,o=!1;if(t.zoomingEnabled||(o=!0),ut(e)?s=e:Zt(e)&&(s=e.level,e.position!=null?a=sg(e.position,i,n):e.renderedPosition!=null&&(a=e.renderedPosition),a!=null&&!t.panningEnabled&&(o=!0)),s=s>t.maxZoom?t.maxZoom:s,s=st.maxZoom||!t.zoomingEnabled?s=!0:(t.zoom=l,a.push("zoom"))}if(i&&(!s||!e.cancelOnFailedZoom)&&t.panningEnabled){var c=e.pan;ut(c.x)&&(t.pan.x=c.x,o=!1),ut(c.y)&&(t.pan.y=c.y,o=!1),o||a.push("pan")}return a.length>0&&(a.push("viewport"),this.emit(a.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(xt(e)){var n=e;e=this.mutableElements().filter(n)}else qi(e)||(e=this.mutableElements());if(e.length!==0){var i=e.boundingBox(),a=this.width(),s=this.height();t=t===void 0?this._private.zoom:t;var o={x:(a-t*(i.x1+i.x2))/2,y:(s-t*(i.y1+i.y2))/2};return o}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,t=e.container,n=this;return e.sizeCache=e.sizeCache||(t?(function(){var i=n.window().getComputedStyle(t),a=function(o){return parseFloat(i.getPropertyValue(o))};return{width:t.clientWidth-a("padding-left")-a("padding-right"),height:t.clientHeight-a("padding-top")-a("padding-bottom")}})():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,n=this.renderedExtent(),i={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return i.w=i.x2-i.x1,i.h=i.y2-i.y1,i},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};du.centre=du.center;du.autolockNodes=du.autolock;du.autoungrabifyNodes=du.autoungrabify;var td={data:hr.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:hr.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:hr.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:hr.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};td.attr=td.data;td.removeAttr=td.removeData;var rd=function(e){var t=this;e=Ct({},e);var n=e.container;n&&!Cp(n)&&Cp(n[0])&&(n=n[0]);var i=n?n._cyreg:null;i=i||{},i&&i.cy&&(i.cy.destroy(),i={});var a=i.readies=i.readies||[];n&&(n._cyreg=i),i.cy=t;var s=An!==void 0&&n!==void 0&&!e.headless,o=e;o.layout=Ct({name:s?"grid":"null"},o.layout),o.renderer=Ct({name:s?"canvas":"null"},o.renderer);var l=function(m,x,y){return x!==void 0?x:y!==void 0?y:m},c=this._private={container:n,ready:!1,options:o,elements:new Wn(this),listeners:[],aniEles:new Wn(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,o.zoomingEnabled),userZoomingEnabled:l(!0,o.userZoomingEnabled),panningEnabled:l(!0,o.panningEnabled),userPanningEnabled:l(!0,o.userPanningEnabled),boxSelectionEnabled:l(!0,o.boxSelectionEnabled),autolock:l(!1,o.autolock,o.autolockNodes),autoungrabify:l(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:l(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?s:o.styleEnabled,zoom:ut(o.zoom)?o.zoom:1,pan:{x:Zt(o.pan)&&ut(o.pan.x)?o.pan.x:0,y:Zt(o.pan)&&ut(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var h=function(m,x){var y=m.some(ZF);if(y)return Jc.all(m).then(x);x(m)};c.styleEnabled&&t.setStyle([]);var d=Ct({},o,o.renderer);t.initRenderer(d);var v=function(m,x,y){t.notifications(!1);var _=t.mutableElements();_.length>0&&_.remove(),m!=null&&(Zt(m)||Cr(m))&&t.add(m),t.one("layoutready",function(S){t.notifications(!0),t.emit(S),t.one("load",x),t.emitAndNotify("load")}).one("layoutstop",function(){t.one("done",y),t.emit("done")});var w=Ct({},t._private.options.layout);w.eles=t.elements(),t.layout(w).run()};h([o.style,o.elements],function(g){var m=g[0],x=g[1];c.styleEnabled&&t.style().append(m),v(x,function(){t.startAnimationLoop(),c.ready=!0,en(o.ready)&&t.on("ready",o.ready);for(var y=0;y0,o=!!r.boundingBox,l=di(o?r.boundingBox:structuredClone(e.extent())),c;if(qi(r.roots))c=r.roots;else if(Cr(r.roots)){for(var h=[],d=0;d0;){var X=V(),W=D(X,k);if(W)X.outgoers().filter(function(Ye){return Ye.isNode()&&t.has(Ye)}).forEach(U);else if(W===null){fr("Detected double maximal shift for node `"+X.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var P=0;if(r.avoidOverlap)for(var H=0;H0&&_[0].length<=3?Ze/2:0),Se=2*Math.PI/_[ot].length*ct;return ot===0&&_[0].length===1&&(bt=1),{x:de.x+bt*Math.cos(Se),y:de.y+bt*Math.sin(Se)}}else{var ke=_[ot].length,We=Math.max(ke===1?0:o?(l.w-r.padding*2-ye.w)/((r.grid?Re:ke)-1):(l.w-r.padding*2-ye.w)/((r.grid?Re:ke)+1),P),Ke={x:de.x+(ct+1-(ke+1)/2)*We,y:de.y+(ot+1-(ie+1)/2)*Ee};return Ke}},Be={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(Be).indexOf(r.direction)===-1&&jr("Invalid direction '".concat(r.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(Be).join(", ")));var $e=function(He){return Cz(Ne(He),l,Be[r.direction])};return t.nodes().layoutPositions(this,r,$e),this};var hj={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function FR(r){this.options=Ct({},hj,r)}FR.prototype.run=function(){var r=this.options,e=r,t=r.cy,n=e.eles,i=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,a=n.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));for(var s=di(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=e.sweep===void 0?2*Math.PI-2*Math.PI/a.length:e.sweep,c=l/Math.max(1,a.length-1),h,d=0,v=0;v1&&e.avoidOverlap){d*=1.75;var _=Math.cos(c)-Math.cos(0),w=Math.sin(c)-Math.sin(0),S=Math.sqrt(d*d/(_*_+w*w));h=Math.max(S,h)}var A=function(M,E){var O=e.startAngle+E*c*(i?1:-1),D=h*Math.cos(O),I=h*Math.sin(O),k={x:o.x+D,y:o.y+I};return k};return n.nodes().layoutPositions(this,e,A),this};var fj={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function zR(r){this.options=Ct({},fj,r)}zR.prototype.run=function(){for(var r=this.options,e=r,t=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,n=r.cy,i=e.eles,a=i.nodes().not(":parent"),s=di(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=[],c=0,h=0;h0){var C=Math.abs(w[0].value-A.value);C>=y&&(w=[],_.push(w))}w.push(A)}var M=c+e.minNodeSpacing;if(!e.avoidOverlap){var E=_.length>0&&_[0].length>1,O=Math.min(s.w,s.h)/2-M,D=O/(_.length+E?1:0);M=Math.min(M,D)}for(var I=0,k=0;k<_.length;k++){var U=_[k],V=e.sweep===void 0?2*Math.PI-2*Math.PI/U.length:e.sweep,X=U.dTheta=V/Math.max(1,U.length-1);if(U.length>1&&e.avoidOverlap){var W=Math.cos(X)-Math.cos(0),P=Math.sin(X)-Math.sin(0),H=Math.sqrt(M*M/(W*W+P*P));I=Math.max(H,I)}U.r=I,I+=M}if(e.equidistant){for(var z=0,$=0,B=0;B<_.length;B++){var L=_[B],Y=L.r-$;z=Math.max(z,Y)}$=0;for(var G=0;G<_.length;G++){var re=_[G];G===0&&($=re.r),re.r=$,$+=z}}for(var ie={},le=0;le<_.length;le++)for(var ce=_[le],_e=ce.dTheta,pe=ce.r,ae=0;ae=r.numIter||(bj(n,r),n.temperature=n.temperature*r.coolingFactor,n.temperature=r.animationThreshold&&a(),Ap(h)}};h()}else{for(;c;)c=s(l),l++;n7(n,r),o()}return this};yg.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};yg.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var vj=function(e,t,n){for(var i=n.eles.edges(),a=n.eles.nodes(),s=di(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:a.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:i.size(),temperature:n.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},l=n.eles.components(),c={},h=0;h0){o.graphSet.push(O);for(var h=0;hi.count?0:i.graph},UR=function(e,t,n,i){var a=i.graphSet[n];if(-10)var d=i.nodeOverlap*h,v=Math.sqrt(o*o+l*l),g=d*o/v,m=d*l/v;else var x=Np(e,o,l),y=Np(t,-1*o,-1*l),_=y.x-x.x,w=y.y-x.y,S=_*_+w*w,v=Math.sqrt(S),d=(e.nodeRepulsion+t.nodeRepulsion)/S,g=d*_/v,m=d*w/v;e.isLocked||(e.offsetX-=g,e.offsetY-=m),t.isLocked||(t.offsetX+=g,t.offsetY+=m)}},wj=function(e,t,n,i){if(n>0)var a=e.maxX-t.minX;else var a=t.maxX-e.minX;if(i>0)var s=e.maxY-t.minY;else var s=t.maxY-e.minY;return a>=0&&s>=0?Math.sqrt(a*a+s*s):0},Np=function(e,t,n){var i=e.positionX,a=e.positionY,s=e.height||1,o=e.width||1,l=n/t,c=s/o,h={};return t===0&&0n?(h.x=i,h.y=a+s/2,h):0t&&-1*c<=l&&l<=c?(h.x=i-o/2,h.y=a-o*n/2/t,h):0=c)?(h.x=i+s*t/2/n,h.y=a+s/2,h):(0>n&&(l<=-1*c||l>=c)&&(h.x=i-s*t/2/n,h.y=a-s/2),h)},Sj=function(e,t){for(var n=0;nn){var y=t.gravity*g/x,_=t.gravity*m/x;v.offsetX+=y,v.offsetY+=_}}}}},Tj=function(e,t){var n=[],i=0,a=-1;for(n.push.apply(n,e.graphSet[0]),a+=e.graphSet[0].length;i<=a;){var s=n[i++],o=e.idToIndex[s],l=e.layoutNodes[o],c=l.children;if(0n)var a={x:n*e/i,y:n*t/i};else var a={x:e,y:t};return a},HR=function(e,t){var n=e.parentId;if(n!=null){var i=t.layoutNodes[t.idToIndex[n]],a=!1;if((i.maxX==null||e.maxX+i.padRight>i.maxX)&&(i.maxX=e.maxX+i.padRight,a=!0),(i.minX==null||e.minX-i.padLefti.maxY)&&(i.maxY=e.maxY+i.padBottom,a=!0),(i.minY==null||e.minY-i.padTop_&&(m+=y+t.componentSpacing,g=0,x=0,y=0)}}},Mj={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function jR(r){this.options=Ct({},Mj,r)}jR.prototype.run=function(){var r=this.options,e=r,t=r.cy,n=e.eles,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));var a=di(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});if(a.h===0||a.w===0)n.nodes().layoutPositions(this,e,function(G){return{x:a.x1,y:a.y1}});else{var s=i.size(),o=Math.sqrt(s*a.h/a.w),l=Math.round(o),c=Math.round(a.w/a.h*o),h=function(re){if(re==null)return Math.min(l,c);var ie=Math.min(l,c);ie==l?l=re:c=re},d=function(re){if(re==null)return Math.max(l,c);var ie=Math.max(l,c);ie==l?l=re:c=re},v=e.rows,g=e.cols!=null?e.cols:e.columns;if(v!=null&&g!=null)l=v,c=g;else if(v!=null&&g==null)l=v,c=Math.ceil(s/l);else if(v==null&&g!=null)c=g,l=Math.ceil(s/c);else if(c*l>s){var m=h(),x=d();(m-1)*x>=s?h(m-1):(x-1)*m>=s&&d(x-1)}else for(;c*l=s?d(_+1):h(y+1)}var w=a.w/c,S=a.h/l;if(e.condense&&(w=0,S=0),e.avoidOverlap)for(var A=0;A=c&&(W=0,X++)},H={},z=0;z(W=mU(r,e,P[H],P[H+1],P[H+2],P[H+3])))return y(E,W),!0}else if(D.edgeType==="bezier"||D.edgeType==="multibezier"||D.edgeType==="self"||D.edgeType==="compound"){for(var P=D.allpts,H=0;H+5(W=gU(r,e,P[H],P[H+1],P[H+2],P[H+3],P[H+4],P[H+5])))return y(E,W),!0}for(var z=z||O.source,$=$||O.target,B=i.getArrowWidth(I,k),L=[{name:"source",x:D.arrowStartX,y:D.arrowStartY,angle:D.srcArrowAngle},{name:"target",x:D.arrowEndX,y:D.arrowEndY,angle:D.tgtArrowAngle},{name:"mid-source",x:D.midX,y:D.midY,angle:D.midsrcArrowAngle},{name:"mid-target",x:D.midX,y:D.midY,angle:D.midtgtArrowAngle}],H=0;H0&&(_(z),_($))}function S(E,O,D){return Ai(E,O,D)}function A(E,O){var D=E._private,I=v,k;O?k=O+"-":k="",E.boundingBox();var U=D.labelBounds[O||"main"],V=E.pstyle(k+"label").value,X=E.pstyle("text-events").strValue==="yes";if(!(!X||!V)){var W=S(D.rscratch,"labelX",O),P=S(D.rscratch,"labelY",O),H=S(D.rscratch,"labelAngle",O),z=E.pstyle(k+"text-margin-x").pfValue,$=E.pstyle(k+"text-margin-y").pfValue,B=U.x1-I-z,L=U.x2+I-z,Y=U.y1-I-$,G=U.y2+I-$;if(H){var re=Math.cos(H),ie=Math.sin(H),le=function(ye,Ee){return ye=ye-W,Ee=Ee-P,{x:ye*re-Ee*ie+W,y:ye*ie+Ee*re+P}},ce=le(B,Y),_e=le(B,G),pe=le(L,Y),ae=le(L,G),oe=[ce.x+z,ce.y+$,pe.x+z,pe.y+$,ae.x+z,ae.y+$,_e.x+z,_e.y+$];if(Mi(r,e,oe))return y(E),!0}else if(Fo(U,r,e))return y(E),!0}}for(var C=s.length-1;C>=0;C--){var M=s[C];M.isNode()?_(M)||A(M):w(M)||A(M)||A(M,"source")||A(M,"target")}return o};xu.getAllInBox=function(r,e,t,n){var i=this.getCachedZSortedEles().interactive,a=this.cy.zoom(),s=2/a,o=[],l=Math.min(r,t),c=Math.max(r,t),h=Math.min(e,n),d=Math.max(e,n);r=l,t=c,e=h,n=d;var v=di({x1:r,y1:e,x2:t,y2:n}),g=[{x:v.x1,y:v.y1},{x:v.x2,y:v.y1},{x:v.x2,y:v.y2},{x:v.x1,y:v.y2}],m=[[g[0],g[1]],[g[1],g[2]],[g[2],g[3]],[g[3],g[0]]];function x(ye,Ee,Re){return Ai(ye,Ee,Re)}function y(ye,Ee){var Re=ye._private,Ne=s,Be="";ye.boundingBox();var $e=Re.labelBounds.main;if(!$e)return null;var Ye=x(Re.rscratch,"labelX",Ee),He=x(Re.rscratch,"labelY",Ee),tt=x(Re.rscratch,"labelAngle",Ee),ot=ye.pstyle(Be+"text-margin-x").pfValue,ct=ye.pstyle(Be+"text-margin-y").pfValue,Ze=$e.x1-Ne-ot,bt=$e.x2+Ne-ot,Se=$e.y1-Ne-ct,ke=$e.y2+Ne-ct;if(tt){var We=Math.cos(tt),Ke=Math.sin(tt),rt=function(De,Q){return De=De-Ye,Q=Q-He,{x:De*We-Q*Ke+Ye,y:De*Ke+Q*We+He}};return[rt(Ze,Se),rt(bt,Se),rt(bt,ke),rt(Ze,ke)]}else return[{x:Ze,y:Se},{x:bt,y:Se},{x:bt,y:ke},{x:Ze,y:ke}]}function _(ye,Ee,Re,Ne){function Be($e,Ye,He){return(He.y-$e.y)*(Ye.x-$e.x)>(Ye.y-$e.y)*(He.x-$e.x)}return Be(ye,Re,Ne)!==Be(Ee,Re,Ne)&&Be(ye,Ee,Re)!==Be(ye,Ee,Ne)}for(var w=0;w0?-(Math.PI-e.ang):Math.PI+e.ang},Nj=function(e,t,n,i,a){if(e!==l7?u7(t,e,Xa):Ij(oa,Xa),u7(t,n,oa),s7=Xa.nx*oa.ny-Xa.ny*oa.nx,o7=Xa.nx*oa.nx-Xa.ny*-oa.ny,Ds=Math.asin(Math.max(-1,Math.min(1,s7))),Math.abs(Ds)<1e-6){h4=t.x,f4=t.y,$l=cc=0;return}iu=1,lp=!1,o7<0?Ds<0?Ds=Math.PI+Ds:(Ds=Math.PI-Ds,iu=-1,lp=!0):Ds>0&&(iu=-1,lp=!0),t.radius!==void 0?cc=t.radius:cc=i,kl=Ds/2,fv=Math.min(Xa.len/2,oa.len/2),a?(Ha=Math.abs(Math.cos(kl)*cc/Math.sin(kl)),Ha>fv?(Ha=fv,$l=Math.abs(Ha*Math.sin(kl)/Math.cos(kl))):$l=cc):(Ha=Math.min(fv,cc),$l=Math.abs(Ha*Math.sin(kl)/Math.cos(kl))),d4=t.x+oa.nx*Ha,v4=t.y+oa.ny*Ha,h4=d4-oa.ny*$l*iu,f4=v4+oa.nx*$l*iu,YR=t.x+Xa.nx*Ha,WR=t.y+Xa.ny*Ha,l7=t};function $R(r,e){e.radius===0?r.lineTo(e.cx,e.cy):r.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function hw(r,e,t,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return n===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(Nj(r,e,t,n,i),{cx:h4,cy:f4,radius:$l,startX:YR,startY:WR,stopX:d4,stopY:v4,startAngle:Xa.ang+Math.PI/2*iu,endAngle:oa.ang-Math.PI/2*iu,counterClockwise:lp})}var nd=.01,Lj=Math.sqrt(2*nd),ii={};ii.findMidptPtsEtc=function(r,e){var t=e.posPts,n=e.intersectionPts,i=e.vectorNormInverse,a,s=r.pstyle("source-endpoint"),o=r.pstyle("target-endpoint"),l=s.units!=null&&o.units!=null,c=function(C,M,E,O){var D=O-M,I=E-C,k=Math.sqrt(I*I+D*D);return{x:-D/k,y:I/k}},h=r.pstyle("edge-distances").value;switch(h){case"node-position":a=t;break;case"intersection":a=n;break;case"endpoints":{if(l){var d=this.manualEndptToPx(r.source()[0],s),v=_n(d,2),g=v[0],m=v[1],x=this.manualEndptToPx(r.target()[0],o),y=_n(x,2),_=y[0],w=y[1],S={x1:g,y1:m,x2:_,y2:w};i=c(g,m,_,w),a=S}else fr("Edge ".concat(r.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),a=n;break}}return{midptPts:a,vectorNormInverse:i}};ii.findHaystackPoints=function(r){for(var e=0;e0?Math.max(Q-ne,0):Math.min(Q+ne,0)},V=U(I,O),X=U(k,D),W=!1;w===c?_=Math.abs(V)>Math.abs(X)?i:n:w===l||w===o?(_=n,W=!0):(w===a||w===s)&&(_=i,W=!0);var P=_===n,H=P?X:V,z=P?k:I,$=Q_(z),B=!1;!(W&&(A||M))&&(w===o&&z<0||w===l&&z>0||w===a&&z>0||w===s&&z<0)&&($*=-1,H=$*Math.abs(H),B=!0);var L;if(A){var Y=C<0?1+C:C;L=Y*H}else{var G=C<0?H:0;L=G+C*$}var re=function(Q){return Math.abs(Q)=Math.abs(H)},ie=re(L),le=re(Math.abs(H)-Math.abs(L)),ce=ie||le;if(ce&&!B)if(P){var _e=Math.abs(z)<=v/2,pe=Math.abs(I)<=g/2;if(_e){var ae=(h.x1+h.x2)/2,oe=h.y1,de=h.y2;t.segpts=[ae,oe,ae,de]}else if(pe){var ye=(h.y1+h.y2)/2,Ee=h.x1,Re=h.x2;t.segpts=[Ee,ye,Re,ye]}else t.segpts=[h.x1,h.y2]}else{var Ne=Math.abs(z)<=d/2,Be=Math.abs(k)<=m/2;if(Ne){var $e=(h.y1+h.y2)/2,Ye=h.x1,He=h.x2;t.segpts=[Ye,$e,He,$e]}else if(Be){var tt=(h.x1+h.x2)/2,ot=h.y1,ct=h.y2;t.segpts=[tt,ot,tt,ct]}else t.segpts=[h.x2,h.y1]}else if(P){var Ze=h.y1+L+(y?v/2*$:0),bt=h.x1,Se=h.x2;t.segpts=[bt,Ze,Se,Ze]}else{var ke=h.x1+L+(y?d/2*$:0),We=h.y1,Ke=h.y2;t.segpts=[ke,We,ke,Ke]}if(t.isRound){var rt=r.pstyle("taxi-radius").value,nt=r.pstyle("radius-type").value[0]==="arc-radius";t.radii=new Array(t.segpts.length/2).fill(rt),t.isArcRadius=new Array(t.segpts.length/2).fill(nt)}};ii.tryToCorrectInvalidPoints=function(r,e){var t=r._private.rscratch;if(t.edgeType==="bezier"){var n=e.srcPos,i=e.tgtPos,a=e.srcW,s=e.srcH,o=e.tgtW,l=e.tgtH,c=e.srcShape,h=e.tgtShape,d=e.srcCornerRadius,v=e.tgtCornerRadius,g=e.srcRs,m=e.tgtRs,x=!ut(t.startX)||!ut(t.startY),y=!ut(t.arrowStartX)||!ut(t.arrowStartY),_=!ut(t.endX)||!ut(t.endY),w=!ut(t.arrowEndX)||!ut(t.arrowEndY),S=3,A=this.getArrowWidth(r.pstyle("width").pfValue,r.pstyle("arrow-scale").value)*this.arrowShapeWidth,C=S*A,M=hu({x:t.ctrlpts[0],y:t.ctrlpts[1]},{x:t.startX,y:t.startY}),E=Mz.poolIndex()){var $=H;H=z,z=$}var B=V.srcPos=H.position(),L=V.tgtPos=z.position(),Y=V.srcW=H.outerWidth(),G=V.srcH=H.outerHeight(),re=V.tgtW=z.outerWidth(),ie=V.tgtH=z.outerHeight(),le=V.srcShape=t.nodeShapes[e.getNodeShape(H)],ce=V.tgtShape=t.nodeShapes[e.getNodeShape(z)],_e=V.srcCornerRadius=H.pstyle("corner-radius").value==="auto"?"auto":H.pstyle("corner-radius").pfValue,pe=V.tgtCornerRadius=z.pstyle("corner-radius").value==="auto"?"auto":z.pstyle("corner-radius").pfValue,ae=V.tgtRs=z._private.rscratch,oe=V.srcRs=H._private.rscratch;V.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var de=0;de=Lj||(Se=Math.sqrt(Math.max(bt*bt,nd)+Math.max(Ze*Ze,nd)));var ke=V.vector={x:bt,y:Ze},We=V.vectorNorm={x:ke.x/Se,y:ke.y/Se},Ke={x:-We.y,y:We.x};V.nodesOverlap=!ut(Se)||ce.checkPoint($e[0],$e[1],0,re,ie,L.x,L.y,pe,ae)||le.checkPoint(He[0],He[1],0,Y,G,B.x,B.y,_e,oe),V.vectorNormInverse=Ke,X={nodesOverlap:V.nodesOverlap,dirCounts:V.dirCounts,calculatedIntersection:!0,hasBezier:V.hasBezier,hasUnbundled:V.hasUnbundled,eles:V.eles,srcPos:L,srcRs:ae,tgtPos:B,tgtRs:oe,srcW:re,srcH:ie,tgtW:Y,tgtH:G,srcIntn:tt,tgtIntn:Ye,srcShape:ce,tgtShape:le,posPts:{x1:ct.x2,y1:ct.y2,x2:ct.x1,y2:ct.y1},intersectionPts:{x1:ot.x2,y1:ot.y2,x2:ot.x1,y2:ot.y1},vector:{x:-ke.x,y:-ke.y},vectorNorm:{x:-We.x,y:-We.y},vectorNormInverse:{x:-Ke.x,y:-Ke.y}}}var rt=Be?X:V;Ee.nodesOverlap=rt.nodesOverlap,Ee.srcIntn=rt.srcIntn,Ee.tgtIntn=rt.tgtIntn,Ee.isRound=Re.startsWith("round"),i&&(H.isParent()||H.isChild()||z.isParent()||z.isChild())&&(H.parents().anySame(z)||z.parents().anySame(H)||H.same(z)&&H.isParent())?e.findCompoundLoopPoints(ye,rt,de,Ne):H===z?e.findLoopPoints(ye,rt,de,Ne):Re.endsWith("segments")?e.findSegmentsPoints(ye,rt):Re.endsWith("taxi")?e.findTaxiPoints(ye,rt):Re==="straight"||!Ne&&V.eles.length%2===1&&de===Math.floor(V.eles.length/2)?e.findStraightEdgePoints(ye):e.findBezierPoints(ye,rt,de,Ne,Be),e.findEndpoints(ye),e.tryToCorrectInvalidPoints(ye,rt),e.checkForInvalidEdgeWarning(ye),e.storeAllpts(ye),e.storeEdgeProjections(ye),e.calculateArrowAngles(ye),e.recalculateEdgeLabelProjections(ye),e.calculateLabelAngles(ye)}},E=0;E0){var $e=c,Ye=Wl($e,Tc(s)),He=Wl($e,Tc(Be)),tt=Ye;if(He2){var ot=Wl($e,{x:Be[2],y:Be[3]});ot0){var be=h,ee=Wl(be,Tc(s)),se=Wl(be,Tc(ne)),Pe=ee;if(se2){var Ae=Wl(be,{x:ne[2],y:ne[3]});Ae=m||E){y={cp:A,segment:M};break}}if(y)break}var O=y.cp,D=y.segment,I=(m-_)/D.length,k=D.t1-D.t0,U=g?D.t0+k*I:D.t1-k*I;U=Zf(0,U,1),e=Mc(O.p0,O.p1,O.p2,U),v=Bj(O.p0,O.p1,O.p2,U);break}case"straight":case"segments":case"haystack":{for(var V=0,X,W,P,H,z=n.allpts.length,$=0;$+3=m));$+=2);var B=m-W,L=B/X;L=Zf(0,L,1),e=aU(P,H,L),v=QR(P,H);break}}s("labelX",d,e.x),s("labelY",d,e.y),s("labelAutoAngle",d,v)}};c("source"),c("target"),this.applyLabelDimensions(r)}};os.applyLabelDimensions=function(r){this.applyPrefixedLabelDimensions(r),r.isEdge()&&(this.applyPrefixedLabelDimensions(r,"source"),this.applyPrefixedLabelDimensions(r,"target"))};os.applyPrefixedLabelDimensions=function(r,e){var t=r._private,n=this.getLabelText(r,e),i=cu(n,r._private.labelDimsKey);if(Ai(t.rscratch,"prefixedLabelDimsKey",e)!==i){ks(t.rscratch,"prefixedLabelDimsKey",e,i);var a=this.calculateLabelDimensions(r,n),s=r.pstyle("line-height").pfValue,o=r.pstyle("text-wrap").strValue,l=Ai(t.rscratch,"labelWrapCachedLines",e)||[],c=o!=="wrap"?1:Math.max(l.length,1),h=a.height/c,d=h*s,v=a.width,g=a.height+(c-1)*(s-1)*h;ks(t.rstyle,"labelWidth",e,v),ks(t.rscratch,"labelWidth",e,v),ks(t.rstyle,"labelHeight",e,g),ks(t.rscratch,"labelHeight",e,g),ks(t.rscratch,"labelLineHeight",e,d)}};os.getLabelText=function(r,e){var t=r._private,n=e?e+"-":"",i=r.pstyle(n+"label").strValue,a=r.pstyle("text-transform").value,s=function(G,re){return re?(ks(t.rscratch,G,e,re),re):Ai(t.rscratch,G,e)};if(!i)return"";a=="none"||(a=="uppercase"?i=i.toUpperCase():a=="lowercase"&&(i=i.toLowerCase()));var o=r.pstyle("text-wrap").value;if(o==="wrap"){var l=s("labelKey");if(l!=null&&s("labelWrapKey")===l)return s("labelWrapCachedText");for(var c="​",h=i.split(` `),d=r.pstyle("text-max-width").pfValue,v=r.pstyle("text-overflow-wrap").value,g=v==="anywhere",m=[],x=/[\s\u200b]+|$/g,y=0;yd){var C=_.matchAll(x),M="",E=0,O=Ri(C),D;try{for(O.s();!(D=O.n()).done;){var I=D.value,k=I[0],U=_.substring(E,I.index);E=I.index+k.length;var V=M.length===0?U:M+U+k,X=this.calculateLabelDimensions(r,V),W=X.width;W<=d?M+=U+k:(M&&m.push(M),M=U+k)}}catch(Y){O.e(Y)}finally{O.f()}M.match(/^[\s\u200b]+$/)||m.push(M)}else m.push(_)}s("labelWrapCachedLines",m),i=s("labelWrapCachedText",m.join(` `)),s("labelWrapKey",l)}else if(o==="ellipsis"){var P=r.pstyle("text-max-width").pfValue,H="",z="…",$=!1;if(this.calculateLabelDimensions(r,i).widthP)break;H+=i[B],B===i.length-1&&($=!0)}return $||(H+=z),H}return i};os.getLabelJustification=function(r){var e=r.pstyle("text-justification").strValue,t=r.pstyle("text-halign").strValue;if(e==="auto")if(r.isNode())switch(t){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return e};os.calculateLabelDimensions=function(r,e){var t=this,n=t.cy.window(),i=n.document,a=0,s=r.pstyle("font-style").strValue,o=r.pstyle("font-size").pfValue,l=r.pstyle("font-family").strValue,c=r.pstyle("font-weight").strValue,h=this.labelCalcCanvas,d=this.labelCalcCanvasContext;if(!h){h=this.labelCalcCanvas=i.createElement("canvas"),d=this.labelCalcCanvasContext=h.getContext("2d");var v=h.style;v.position="absolute",v.left="-9999px",v.top="-9999px",v.zIndex="-1",v.visibility="hidden",v.pointerEvents="none"}d.font="".concat(s," ").concat(c," ").concat(o,"px ").concat(l);for(var g=0,m=0,x=e.split(` `),y=0;y1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var l=0;l=r.desktopTapThreshold2}var ur=a(Q);Ot&&(r.hoverData.tapholdCancelled=!0);var In=function(){var lt=r.hoverData.dragDelta=r.hoverData.dragDelta||[];lt.length===0?(lt.push(yt[0]),lt.push(yt[1])):(lt[0]+=yt[0],lt[1]+=yt[1])};be=!0,i(Ve,["mousemove","vmousemove","tapdrag"],Q,{x:Ae[0],y:Ae[1]});var vr=function(lt){return{originalEvent:Q,type:lt,position:{x:Ae[0],y:Ae[1]}}},Gn=function(){r.data.bgActivePosistion=void 0,r.hoverData.selecting||ee.emit(vr("boxstart")),Oe[4]=1,r.hoverData.selecting=!0,r.redrawHint("select",!0),r.redraw()};if(r.hoverData.which===3){if(Ot){var Yr=vr("cxtdrag");je?je.emit(Yr):ee.emit(Yr),r.hoverData.cxtDragged=!0,(!r.hoverData.cxtOver||Ve!==r.hoverData.cxtOver)&&(r.hoverData.cxtOver&&r.hoverData.cxtOver.emit(vr("cxtdragout")),r.hoverData.cxtOver=Ve,Ve&&Ve.emit(vr("cxtdragover")))}}else if(r.hoverData.dragging){if(be=!0,ee.panningEnabled()&&ee.userPanningEnabled()){var nr;if(r.hoverData.justStartedPan){var Lr=r.hoverData.mdownPos;nr={x:(Ae[0]-Lr[0])*se,y:(Ae[1]-Lr[1])*se},r.hoverData.justStartedPan=!1}else nr={x:yt[0]*se,y:yt[1]*se};ee.panBy(nr),ee.emit(vr("dragpan")),r.hoverData.dragged=!0}Ae=r.projectIntoViewport(Q.clientX,Q.clientY)}else if(Oe[4]==1&&(je==null||je.pannable())){if(Ot){if(!r.hoverData.dragging&&ee.boxSelectionEnabled()&&(ur||!ee.panningEnabled()||!ee.userPanningEnabled()))Gn();else if(!r.hoverData.selecting&&ee.panningEnabled()&&ee.userPanningEnabled()){var cn=s(je,r.hoverData.downs);cn&&(r.hoverData.dragging=!0,r.hoverData.justStartedPan=!0,Oe[4]=0,r.data.bgActivePosistion=Tc(Ge),r.redrawHint("select",!0),r.redraw())}je&&je.pannable()&&je.active()&&je.unactivate()}}else{if(je&&je.pannable()&&je.active()&&je.unactivate(),(!je||!je.grabbed())&&Ve!=Ue&&(Ue&&i(Ue,["mouseout","tapdragout"],Q,{x:Ae[0],y:Ae[1]}),Ve&&i(Ve,["mouseover","tapdragover"],Q,{x:Ae[0],y:Ae[1]}),r.hoverData.last=Ve),je)if(Ot){if(ee.boxSelectionEnabled()&&ur)je&&je.grabbed()&&(_(vt),je.emit(vr("freeon")),vt.emit(vr("free")),r.dragData.didDrag&&(je.emit(vr("dragfreeon")),vt.emit(vr("dragfree")))),Gn();else if(je&&je.grabbed()&&r.nodeIsDraggable(je)){var Ur=!r.dragData.didDrag;Ur&&r.redrawHint("eles",!0),r.dragData.didDrag=!0,r.hoverData.draggingEles||x(vt,{inDragLayer:!0});var Wr={x:0,y:0};if(ut(yt[0])&&ut(yt[1])&&(Wr.x+=yt[0],Wr.y+=yt[1],Ur)){var xe=r.hoverData.dragDelta;xe&&ut(xe[0])&&ut(xe[1])&&(Wr.x+=xe[0],Wr.y+=xe[1])}r.hoverData.draggingEles=!0,vt.silentShift(Wr).emit(vr("position")).emit(vr("drag")),r.redrawHint("drag",!0),r.redraw()}}else In();be=!0}if(Oe[2]=Ae[0],Oe[3]=Ae[1],be)return Q.stopPropagation&&Q.stopPropagation(),Q.preventDefault&&Q.preventDefault(),!1}},!1);var U,V,X;r.registerBinding(e,"mouseup",function(Q){if(!(r.hoverData.which===1&&Q.which!==1&&r.hoverData.capture)){var ne=r.hoverData.capture;if(ne){r.hoverData.capture=!1;var be=r.cy,ee=r.projectIntoViewport(Q.clientX,Q.clientY),se=r.selection,Pe=r.findNearestElement(ee[0],ee[1],!0,!1),Ae=r.dragData.possibleDragElements,Ge=r.hoverData.down,J=a(Q);r.data.bgActivePosistion&&(r.redrawHint("select",!0),r.redraw()),r.hoverData.tapholdCancelled=!0,r.data.bgActivePosistion=void 0,Ge&&Ge.unactivate();var Oe=function(jt){return{originalEvent:Q,type:jt,position:{x:ee[0],y:ee[1]}}};if(r.hoverData.which===3){var Ve=Oe("cxttapend");if(Ge?Ge.emit(Ve):be.emit(Ve),!r.hoverData.cxtDragged){var Ue=Oe("cxttap");Ge?Ge.emit(Ue):be.emit(Ue)}r.hoverData.cxtDragged=!1,r.hoverData.which=null}else if(r.hoverData.which===1){if(i(Pe,["mouseup","tapend","vmouseup"],Q,{x:ee[0],y:ee[1]}),!r.dragData.didDrag&&!r.hoverData.dragged&&!r.hoverData.selecting&&!r.hoverData.isOverThresholdDrag&&(i(Ge,["click","tap","vclick"],Q,{x:ee[0],y:ee[1]}),V=!1,Q.timeStamp-X<=be.multiClickDebounceTime()?(U&&clearTimeout(U),V=!0,X=null,i(Ge,["dblclick","dbltap","vdblclick"],Q,{x:ee[0],y:ee[1]})):(U=setTimeout(function(){V||i(Ge,["oneclick","onetap","voneclick"],Q,{x:ee[0],y:ee[1]})},be.multiClickDebounceTime()),X=Q.timeStamp)),Ge==null&&!r.dragData.didDrag&&!r.hoverData.selecting&&!r.hoverData.dragged&&!a(Q)&&(be.$(t).unselect(["tapunselect"]),Ae.length>0&&r.redrawHint("eles",!0),r.dragData.possibleDragElements=Ae=be.collection()),Pe==Ge&&!r.dragData.didDrag&&!r.hoverData.selecting&&Pe!=null&&Pe._private.selectable&&(r.hoverData.dragging||(be.selectionType()==="additive"||J?Pe.selected()?Pe.unselect(["tapunselect"]):Pe.select(["tapselect"]):J||(be.$(t).unmerge(Pe).unselect(["tapunselect"]),Pe.select(["tapselect"]))),r.redrawHint("eles",!0)),r.hoverData.selecting){var je=be.collection(r.getAllInBox(se[0],se[1],se[2],se[3]));r.redrawHint("select",!0),je.length>0&&r.redrawHint("eles",!0),be.emit(Oe("boxend"));var yt=function(jt){return jt.selectable()&&!jt.selected()};be.selectionType()==="additive"||J||be.$(t).unmerge(je).unselect(),je.emit(Oe("box")).stdFilter(yt).select().emit(Oe("boxselect")),r.redraw()}if(r.hoverData.dragging&&(r.hoverData.dragging=!1,r.redrawHint("select",!0),r.redrawHint("eles",!0),r.redraw()),!se[4]){r.redrawHint("drag",!0),r.redrawHint("eles",!0);var vt=Ge&&Ge.grabbed();_(Ae),vt&&(Ge.emit(Oe("freeon")),Ae.emit(Oe("free")),r.dragData.didDrag&&(Ge.emit(Oe("dragfreeon")),Ae.emit(Oe("dragfree"))))}}se[4]=0,r.hoverData.down=null,r.hoverData.cxtStarted=!1,r.hoverData.draggingEles=!1,r.hoverData.selecting=!1,r.hoverData.isOverThresholdDrag=!1,r.dragData.didDrag=!1,r.hoverData.dragged=!1,r.hoverData.dragDelta=[],r.hoverData.mdownPos=null,r.hoverData.mdownGPos=null,r.hoverData.which=null}}},!1);var W=[],P=4,H,z=1e5,$=function(Q,ne){for(var be=0;be=P){var ee=W;if(H=$(ee,5),!H){var se=Math.abs(ee[0]);H=B(ee)&&se>5}if(H)for(var Pe=0;Pe5&&(be=Q_(be)*5),Ue=be/-250,H&&(Ue/=z,Ue*=3),Ue=Ue*r.wheelSensitivity;var je=Q.deltaMode===1;je&&(Ue*=33);var yt=Ae.zoom()*Math.pow(10,Ue);Q.type==="gesturechange"&&(yt=r.gestureStartZoom*Q.scale),Ae.zoom({level:yt,renderedPosition:{x:Ve[0],y:Ve[1]}}),Ae.emit({type:Q.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:Q,position:{x:Oe[0],y:Oe[1]}})}}}};r.registerBinding(r.container,"wheel",L,!0),r.registerBinding(e,"scroll",function(Q){r.scrollingPage=!0,clearTimeout(r.scrollingPageTimeout),r.scrollingPageTimeout=setTimeout(function(){r.scrollingPage=!1},250)},!0),r.registerBinding(r.container,"gesturestart",function(Q){r.gestureStartZoom=r.cy.zoom(),r.hasTouchStarted||Q.preventDefault()},!0),r.registerBinding(r.container,"gesturechange",function(De){r.hasTouchStarted||L(De)},!0),r.registerBinding(r.container,"mouseout",function(Q){var ne=r.projectIntoViewport(Q.clientX,Q.clientY);r.cy.emit({originalEvent:Q,type:"mouseout",position:{x:ne[0],y:ne[1]}})},!1),r.registerBinding(r.container,"mouseover",function(Q){var ne=r.projectIntoViewport(Q.clientX,Q.clientY);r.cy.emit({originalEvent:Q,type:"mouseover",position:{x:ne[0],y:ne[1]}})},!1);var Y,G,re,ie,le,ce,_e,pe,ae,oe,de,ye,Ee,Re=function(Q,ne,be,ee){return Math.sqrt((be-Q)*(be-Q)+(ee-ne)*(ee-ne))},Ne=function(Q,ne,be,ee){return(be-Q)*(be-Q)+(ee-ne)*(ee-ne)},Be;r.registerBinding(r.container,"touchstart",Be=function(Q){if(r.hasTouchStarted=!0,!!I(Q)){S(),r.touchData.capture=!0,r.data.bgActivePosistion=void 0;var ne=r.cy,be=r.touchData.now,ee=r.touchData.earlier;if(Q.touches[0]){var se=r.projectIntoViewport(Q.touches[0].clientX,Q.touches[0].clientY);be[0]=se[0],be[1]=se[1]}if(Q.touches[1]){var se=r.projectIntoViewport(Q.touches[1].clientX,Q.touches[1].clientY);be[2]=se[0],be[3]=se[1]}if(Q.touches[2]){var se=r.projectIntoViewport(Q.touches[2].clientX,Q.touches[2].clientY);be[4]=se[0],be[5]=se[1]}var Pe=function(ur){return{originalEvent:Q,type:ur,position:{x:be[0],y:be[1]}}};if(Q.touches[1]){r.touchData.singleTouchMoved=!0,_(r.dragData.touchDragEles);var Ae=r.findContainerClientCoords();ae=Ae[0],oe=Ae[1],de=Ae[2],ye=Ae[3],Y=Q.touches[0].clientX-ae,G=Q.touches[0].clientY-oe,re=Q.touches[1].clientX-ae,ie=Q.touches[1].clientY-oe,Ee=0<=Y&&Y<=de&&0<=re&&re<=de&&0<=G&&G<=ye&&0<=ie&&ie<=ye;var Ge=ne.pan(),J=ne.zoom();le=Re(Y,G,re,ie),ce=Ne(Y,G,re,ie),_e=[(Y+re)/2,(G+ie)/2],pe=[(_e[0]-Ge.x)/J,(_e[1]-Ge.y)/J];var Oe=200,Ve=Oe*Oe;if(ce=1){for(var Nr=r.touchData.startPosition=[null,null,null,null,null,null],Vt=0;Vt=r.touchTapThreshold2}if(ne&&r.touchData.cxt){Q.preventDefault();var Vt=Q.touches[0].clientX-ae,Qt=Q.touches[0].clientY-oe,rr=Q.touches[1].clientX-ae,ur=Q.touches[1].clientY-oe,In=Ne(Vt,Qt,rr,ur),vr=In/ce,Gn=150,Yr=Gn*Gn,nr=1.5,Lr=nr*nr;if(vr>=Lr||In>=Yr){r.touchData.cxt=!1,r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var cn=J("cxttapend");r.touchData.start?(r.touchData.start.unactivate().emit(cn),r.touchData.start=null):ee.emit(cn)}}if(ne&&r.touchData.cxt){var cn=J("cxtdrag");r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.touchData.start?r.touchData.start.emit(cn):ee.emit(cn),r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxtDragged=!0;var Ur=r.findNearestElement(se[0],se[1],!0,!0);(!r.touchData.cxtOver||Ur!==r.touchData.cxtOver)&&(r.touchData.cxtOver&&r.touchData.cxtOver.emit(J("cxtdragout")),r.touchData.cxtOver=Ur,Ur&&Ur.emit(J("cxtdragover")))}else if(ne&&Q.touches[2]&&ee.boxSelectionEnabled())Q.preventDefault(),r.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,r.touchData.selecting||ee.emit(J("boxstart")),r.touchData.selecting=!0,r.touchData.didSelect=!0,be[4]=1,!be||be.length===0||be[0]===void 0?(be[0]=(se[0]+se[2]+se[4])/3,be[1]=(se[1]+se[3]+se[5])/3,be[2]=(se[0]+se[2]+se[4])/3+1,be[3]=(se[1]+se[3]+se[5])/3+1):(be[2]=(se[0]+se[2]+se[4])/3,be[3]=(se[1]+se[3]+se[5])/3),r.redrawHint("select",!0),r.redraw();else if(ne&&Q.touches[1]&&!r.touchData.didSelect&&ee.zoomingEnabled()&&ee.panningEnabled()&&ee.userZoomingEnabled()&&ee.userPanningEnabled()){Q.preventDefault(),r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var Wr=r.dragData.touchDragEles;if(Wr){r.redrawHint("drag",!0);for(var xe=0;xe0&&!r.hoverData.draggingEles&&!r.swipePanning&&r.data.bgActivePosistion!=null&&(r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.redraw())}},!1);var Ye;r.registerBinding(e,"touchcancel",Ye=function(Q){var ne=r.touchData.start;r.touchData.capture=!1,ne&&ne.unactivate()});var He,tt,ot,ct;if(r.registerBinding(e,"touchend",He=function(Q){var ne=r.touchData.start,be=r.touchData.capture;if(be)Q.touches.length===0&&(r.touchData.capture=!1),Q.preventDefault();else return;var ee=r.selection;r.swipePanning=!1,r.hoverData.draggingEles=!1;var se=r.cy,Pe=se.zoom(),Ae=r.touchData.now,Ge=r.touchData.earlier;if(Q.touches[0]){var J=r.projectIntoViewport(Q.touches[0].clientX,Q.touches[0].clientY);Ae[0]=J[0],Ae[1]=J[1]}if(Q.touches[1]){var J=r.projectIntoViewport(Q.touches[1].clientX,Q.touches[1].clientY);Ae[2]=J[0],Ae[3]=J[1]}if(Q.touches[2]){var J=r.projectIntoViewport(Q.touches[2].clientX,Q.touches[2].clientY);Ae[4]=J[0],Ae[5]=J[1]}var Oe=function(Yr){return{originalEvent:Q,type:Yr,position:{x:Ae[0],y:Ae[1]}}};ne&&ne.unactivate();var Ve;if(r.touchData.cxt){if(Ve=Oe("cxttapend"),ne?ne.emit(Ve):se.emit(Ve),!r.touchData.cxtDragged){var Ue=Oe("cxttap");ne?ne.emit(Ue):se.emit(Ue)}r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxt=!1,r.touchData.start=null,r.redraw();return}if(!Q.touches[2]&&se.boxSelectionEnabled()&&r.touchData.selecting){r.touchData.selecting=!1;var je=se.collection(r.getAllInBox(ee[0],ee[1],ee[2],ee[3]));ee[0]=void 0,ee[1]=void 0,ee[2]=void 0,ee[3]=void 0,ee[4]=0,r.redrawHint("select",!0),se.emit(Oe("boxend"));var yt=function(Yr){return Yr.selectable()&&!Yr.selected()};je.emit(Oe("box")).stdFilter(yt).select().emit(Oe("boxselect")),je.nonempty()&&r.redrawHint("eles",!0),r.redraw()}if(ne!=null&&ne.unactivate(),Q.touches[2])r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);else if(!Q.touches[1]){if(!Q.touches[0]){if(!Q.touches[0]){r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var vt=r.dragData.touchDragEles;if(ne!=null){var Ot=ne._private.grabbed;_(vt),r.redrawHint("drag",!0),r.redrawHint("eles",!0),Ot&&(ne.emit(Oe("freeon")),vt.emit(Oe("free")),r.dragData.didDrag&&(ne.emit(Oe("dragfreeon")),vt.emit(Oe("dragfree")))),i(ne,["touchend","tapend","vmouseup","tapdragout"],Q,{x:Ae[0],y:Ae[1]}),ne.unactivate(),r.touchData.start=null}else{var jt=r.findNearestElement(Ae[0],Ae[1],!0,!0);i(jt,["touchend","tapend","vmouseup","tapdragout"],Q,{x:Ae[0],y:Ae[1]})}var Nr=r.touchData.startPosition[0]-Ae[0],Vt=Nr*Nr,Qt=r.touchData.startPosition[1]-Ae[1],rr=Qt*Qt,ur=Vt+rr,In=ur*Pe*Pe;r.touchData.singleTouchMoved||(ne||se.$(":selected").unselect(["tapunselect"]),i(ne,["tap","vclick"],Q,{x:Ae[0],y:Ae[1]}),tt=!1,Q.timeStamp-ct<=se.multiClickDebounceTime()?(ot&&clearTimeout(ot),tt=!0,ct=null,i(ne,["dbltap","vdblclick"],Q,{x:Ae[0],y:Ae[1]})):(ot=setTimeout(function(){tt||i(ne,["onetap","voneclick"],Q,{x:Ae[0],y:Ae[1]})},se.multiClickDebounceTime()),ct=Q.timeStamp)),ne!=null&&!r.dragData.didDrag&&ne._private.selectable&&In"u"){var Ze=[],bt=function(Q){return{clientX:Q.clientX,clientY:Q.clientY,force:1,identifier:Q.pointerId,pageX:Q.pageX,pageY:Q.pageY,radiusX:Q.width/2,radiusY:Q.height/2,screenX:Q.screenX,screenY:Q.screenY,target:Q.target}},Se=function(Q){return{event:Q,touch:bt(Q)}},ke=function(Q){Ze.push(Se(Q))},We=function(Q){for(var ne=0;ne0)return Y[0]}return null},m=Object.keys(v),x=0;x0?g:eR(a,s,e,t,n,i,o,l)},checkPoint:function(e,t,n,i,a,s,o,l){l=l==="auto"?Zo(i,a):l;var c=2*l;if(Vs(e,t,this.points,s,o,i,a-c,[0,-1],n)||Vs(e,t,this.points,s,o,i-c,a,[0,-1],n))return!0;var h=i/2+2*n,d=a/2+2*n,v=[s-h,o-d,s-h,o,s+h,o,s+h,o-d];return!!(Mi(e,t,v)||su(e,t,c,c,s+i/2-l,o+a/2-l,n)||su(e,t,c,c,s-i/2+l,o+a/2-l,n))}}};Ws.registerNodeShapes=function(){var r=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",ui(3,0)),this.generateRoundPolygon("round-triangle",ui(3,0)),this.generatePolygon("rectangle",ui(4,0)),r.square=r.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var t=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",t),this.generateRoundPolygon("round-diamond",t)}this.generatePolygon("pentagon",ui(5,0)),this.generateRoundPolygon("round-pentagon",ui(5,0)),this.generatePolygon("hexagon",ui(6,0)),this.generateRoundPolygon("round-hexagon",ui(6,0)),this.generatePolygon("heptagon",ui(7,0)),this.generateRoundPolygon("round-heptagon",ui(7,0)),this.generatePolygon("octagon",ui(8,0)),this.generateRoundPolygon("round-octagon",ui(8,0));var n=new Array(20);{var i=t4(5,0),a=t4(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o=e.deqFastCost*A)break}else if(c){if(w>=e.deqCost*g||w>=e.deqAvgCost*v)break}else if(S>=e.deqNoDrawCost*L2)break;var C=e.deq(n,y,x);if(C.length>0)for(var M=0;M0&&(e.onDeqd(n,m),!c&&e.shouldRedraw(n,m,y,x)&&a())},o=e.priority||$_;i.beforeRender(s,o(n))}}}},zj=(function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Mp;hl(this,r),this.idsByKey=new zs,this.keyForId=new zs,this.cachesByLvl=new zs,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=t}return fl(r,[{key:"getIdsFor",value:function(t){t==null&&jr("Can not get id list for null key");var n=this.idsByKey,i=this.idsByKey.get(t);return i||(i=new Qc,n.set(t,i)),i}},{key:"addIdForKey",value:function(t,n){t!=null&&this.getIdsFor(t).add(n)}},{key:"deleteIdForKey",value:function(t,n){t!=null&&this.getIdsFor(t).delete(n)}},{key:"getNumberOfIdsForKey",value:function(t){return t==null?0:this.getIdsFor(t).size}},{key:"updateKeyMappingFor",value:function(t){var n=t.id(),i=this.keyForId.get(n),a=this.getKey(t);this.deleteIdForKey(i,n),this.addIdForKey(a,n),this.keyForId.set(n,a)}},{key:"deleteKeyMappingFor",value:function(t){var n=t.id(),i=this.keyForId.get(n);this.deleteIdForKey(i,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(t){var n=t.id(),i=this.keyForId.get(n),a=this.getKey(t);return i!==a}},{key:"isInvalid",value:function(t){return this.keyHasChangedFor(t)||this.doesEleInvalidateKey(t)}},{key:"getCachesAt",value:function(t){var n=this.cachesByLvl,i=this.lvls,a=n.get(t);return a||(a=new zs,n.set(t,a),i.push(t)),a}},{key:"getCache",value:function(t,n){return this.getCachesAt(n).get(t)}},{key:"get",value:function(t,n){var i=this.getKey(t),a=this.getCache(i,n);return a!=null&&this.updateKeyMappingFor(t),a}},{key:"getForCachedKey",value:function(t,n){var i=this.keyForId.get(t.id()),a=this.getCache(i,n);return a}},{key:"hasCache",value:function(t,n){return this.getCachesAt(n).has(t)}},{key:"has",value:function(t,n){var i=this.getKey(t);return this.hasCache(i,n)}},{key:"setCache",value:function(t,n,i){i.key=t,this.getCachesAt(n).set(t,i)}},{key:"set",value:function(t,n,i){var a=this.getKey(t);this.setCache(a,n,i),this.updateKeyMappingFor(t)}},{key:"deleteCache",value:function(t,n){this.getCachesAt(n).delete(t)}},{key:"delete",value:function(t,n){var i=this.getKey(t);this.deleteCache(i,n)}},{key:"invalidateKey",value:function(t){var n=this;this.lvls.forEach(function(i){return n.deleteCache(t,i)})}},{key:"invalidate",value:function(t){var n=t.id(),i=this.keyForId.get(n);this.deleteKeyMappingFor(t);var a=this.doesEleInvalidateKey(t);return a&&this.invalidateKey(i),a||this.getNumberOfIdsForKey(i)===0}}])})(),d7=25,dv=50,up=-4,p4=3,iO=7.99,Uj=8,Gj=1024,Hj=1024,jj=1024,Vj=.2,qj=.8,Xj=10,Yj=.15,Wj=.1,$j=.9,Kj=.9,Zj=100,Qj=1,Ac={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Jj=$n({getKey:null,doesEleInvalidateKey:Mp,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Y9,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Rf=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var i=Jj(t);Ct(n,i),n.lookup=new zj(i.getKey,i.doesEleInvalidateKey),n.setupDequeueing()},Pn=Rf.prototype;Pn.reasons=Ac;Pn.getTextureQueue=function(r){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[r]=e.eleImgCaches[r]||[]};Pn.getRetiredTextureQueue=function(r){var e=this,t=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=t[r]=t[r]||[];return n};Pn.getElementQueue=function(){var r=this,e=r.eleCacheQueue=r.eleCacheQueue||new Od(function(t,n){return n.reqs-t.reqs});return e};Pn.getElementKeyToQueue=function(){var r=this,e=r.eleKeyToCacheQueue=r.eleKeyToCacheQueue||{};return e};Pn.getElement=function(r,e,t,n,i){var a=this,s=this.renderer,o=s.cy.zoom(),l=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!r.visible()||r.removed()||!a.allowEdgeTxrCaching&&r.isEdge()||!a.allowParentTxrCaching&&r.isParent())return null;if(n==null&&(n=Math.ceil(Z_(o*t))),n=iO||n>p4)return null;var c=Math.pow(2,n),h=e.h*c,d=e.w*c,v=s.eleTextBiggerThanMin(r,c);if(!this.isVisible(r,v))return null;var g=l.get(r,n);if(g&&g.invalidated&&(g.invalidated=!1,g.texture.invalidatedWidth-=g.width),g)return g;var m;if(h<=d7?m=d7:h<=dv?m=dv:m=Math.ceil(h/dv)*dv,h>jj||d>Hj)return null;var x=a.getTextureQueue(m),y=x[x.length-2],_=function(){return a.recycleTexture(m,d)||a.addTexture(m,d)};y||(y=x[x.length-1]),y||(y=_()),y.width-y.usedWidthn;k--)D=a.getElement(r,e,t,k,Ac.downscale);I()}else return a.queueElement(r,M.level-1),M;else{var U;if(!S&&!A&&!C)for(var V=n-1;V>=up;V--){var X=l.get(r,V);if(X){U=X;break}}if(w(U))return a.queueElement(r,n),U;y.context.translate(y.usedWidth,0),y.context.scale(c,c),this.drawElement(y.context,r,e,v,!1),y.context.scale(1/c,1/c),y.context.translate(-y.usedWidth,0)}return g={x:y.usedWidth,texture:y,level:n,scale:c,width:d,height:h,scaledLabelShown:v},y.usedWidth+=Math.ceil(d+Uj),y.eleCaches.push(g),l.set(r,n,g),a.checkTextureFullness(y),g};Pn.invalidateElements=function(r){for(var e=0;e=Vj*r.width&&this.retireTexture(r)};Pn.checkTextureFullness=function(r){var e=this,t=e.getTextureQueue(r.height);r.usedWidth/r.width>qj&&r.fullnessChecks>=Xj?Ko(t,r):r.fullnessChecks++};Pn.retireTexture=function(r){var e=this,t=r.height,n=e.getTextureQueue(t),i=this.lookup;Ko(n,r),r.retired=!0;for(var a=r.eleCaches,s=0;s=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,K_(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),Ko(i,s),n.push(s),s}};Pn.queueElement=function(r,e){var t=this,n=t.getElementQueue(),i=t.getElementKeyToQueue(),a=this.getKey(r),s=i[a];if(s)s.level=Math.max(s.level,e),s.eles.merge(r),s.reqs++,n.updateItem(s);else{var o={eles:r.spawn().merge(r),level:e,reqs:1,key:a};n.push(o),i[a]=o}};Pn.dequeue=function(r){for(var e=this,t=e.getElementQueue(),n=e.getElementKeyToQueue(),i=[],a=e.lookup,s=0;s0;s++){var o=t.pop(),l=o.key,c=o.eles[0],h=a.hasCache(c,o.level);if(n[l]=null,h)continue;i.push(o);var d=e.getBoundingBox(c);e.getElement(c,d,r,o.level,Ac.dequeue)}return i};Pn.removeFromQueue=function(r){var e=this,t=e.getElementQueue(),n=e.getElementKeyToQueue(),i=this.getKey(r),a=n[i];a!=null&&(a.eles.length===1?(a.reqs=W_,t.updateItem(a),t.pop(),n[i]=null):a.eles.unmerge(r))};Pn.onDequeue=function(r){this.onDequeues.push(r)};Pn.offDequeue=function(r){Ko(this.onDequeues,r)};Pn.setupDequeueing=nO.setupDequeueing({deqRedrawThreshold:Zj,deqCost:Yj,deqAvgCost:Wj,deqNoDrawCost:$j,deqFastCost:Kj,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n=tV||t>kp)return null}n.validateLayersElesOrdering(t,r);var l=n.layersByLevel,c=Math.pow(2,t),h=l[t]=l[t]||[],d,v=n.levelIsComplete(t,r),g,m=function(){var I=function(W){if(n.validateLayersElesOrdering(W,r),n.levelIsComplete(W,r))return g=l[W],!0},k=function(W){if(!g)for(var P=t+W;Ff<=P&&P<=kp&&!I(P);P+=W);};k(1),k(-1);for(var U=h.length-1;U>=0;U--){var V=h[U];V.invalid&&Ko(h,V)}};if(!v)m();else return h;var x=function(){if(!d){d=di();for(var I=0;Ip7||V>p7)return null;var X=U*V;if(X>uV)return null;var W=n.makeLayer(d,t);if(k!=null){var P=h.indexOf(k)+1;h.splice(P,0,W)}else(I.insert===void 0||I.insert)&&h.unshift(W);return W};if(n.skipping&&!o)return null;for(var _=null,w=r.length/eV,S=!o,A=0;A=w||!J9(_.bb,C.boundingBox()))&&(_=y({insert:!0,after:_}),!_))return null;g||S?n.queueLayer(_,C):n.drawEleInLayer(_,C,t,e),_.eles.push(C),E[t]=_}return g||(S?null:h)};Kn.getEleLevelForLayerLevel=function(r,e){return r};Kn.drawEleInLayer=function(r,e,t,n){var i=this,a=this.renderer,s=r.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(t=i.getEleLevelForLayerLevel(t,n),a.setImgSmoothing(s,!1),a.drawCachedElement(s,e,null,null,t,cV),a.setImgSmoothing(s,!0))};Kn.levelIsComplete=function(r,e){var t=this,n=t.layersByLevel[r];if(!n||n.length===0)return!1;for(var i=0,a=0;a0||s.invalid)return!1;i+=s.eles.length}return i===e.length};Kn.validateLayersElesOrdering=function(r,e){var t=this.layersByLevel[r];if(t)for(var n=0;n0){e=!0;break}}return e};Kn.invalidateElements=function(r){var e=this;r.length!==0&&(e.lastInvalidationTime=js(),!(r.length===0||!e.haveLayers())&&e.updateElementsInLayers(r,function(n,i,a){e.invalidateLayer(n)}))};Kn.invalidateLayer=function(r){if(this.lastInvalidationTime=js(),!r.invalid){var e=r.level,t=r.eles,n=this.layersByLevel[e];Ko(n,r),r.elesQueue=[],r.invalid=!0,r.replacement&&(r.replacement.invalid=!0);for(var i=0;i3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o=e._private.rscratch;if(!(a&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var l;t&&(l=t,r.translate(-l.x1,-l.y1));var c=a?e.pstyle("opacity").value:1,h=a?e.pstyle("line-opacity").value:1,d=e.pstyle("curve-style").value,v=e.pstyle("line-style").value,g=e.pstyle("width").pfValue,m=e.pstyle("line-cap").value,x=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,_=c*h,w=c*h,S=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_;d==="straight-triangle"?(s.eleStrokeStyle(r,e,W),s.drawEdgeTrianglePath(e,r,o.allpts)):(r.lineWidth=g,r.lineCap=m,s.eleStrokeStyle(r,e,W),s.drawEdgePath(e,r,o.allpts,v),r.lineCap="butt")},A=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_;if(r.lineWidth=g+x,r.lineCap=m,x>0)s.colorStrokeStyle(r,y[0],y[1],y[2],W);else{r.lineCap="butt";return}d==="straight-triangle"?s.drawEdgeTrianglePath(e,r,o.allpts):(s.drawEdgePath(e,r,o.allpts,v),r.lineCap="butt")},C=function(){i&&s.drawEdgeOverlay(r,e)},M=function(){i&&s.drawEdgeUnderlay(r,e)},E=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:w;s.drawArrowheads(r,e,W)},O=function(){s.drawElementText(r,e,null,n)};r.lineJoin="round";var D=e.pstyle("ghost").value==="yes";if(D){var I=e.pstyle("ghost-offset-x").pfValue,k=e.pstyle("ghost-offset-y").pfValue,U=e.pstyle("ghost-opacity").value,V=_*U;r.translate(I,k),S(V),E(V),r.translate(-I,-k)}else A();M(),S(),E(),C(),O(),t&&r.translate(l.x1,l.y1)}};var oO=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n){if(n.visible()){var i=n.pstyle("".concat(e,"-opacity")).value;if(i!==0){var a=this,s=a.usePaths(),o=n._private.rscratch,l=n.pstyle("".concat(e,"-padding")).pfValue,c=2*l,h=n.pstyle("".concat(e,"-color")).value;t.lineWidth=c,o.edgeType==="self"&&!s?t.lineCap="butt":t.lineCap="round",a.colorStrokeStyle(t,h[0],h[1],h[2],i),a.drawEdgePath(n,t,o.allpts,"solid")}}}};$s.drawEdgeOverlay=oO("overlay");$s.drawEdgeUnderlay=oO("underlay");$s.drawEdgePath=function(r,e,t,n){var i=r._private.rscratch,a=e,s,o=!1,l=this.usePaths(),c=r.pstyle("line-dash-pattern").pfValue,h=r.pstyle("line-dash-offset").pfValue;if(l){var d=t.join("$"),v=i.pathCacheKey&&i.pathCacheKey===d;v?(s=e=i.pathCache,o=!0):(s=e=new Path2D,i.pathCacheKey=d,i.pathCache=s)}if(a.setLineDash)switch(n){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(c),a.lineDashOffset=h;break;case"solid":a.setLineDash([]);break}if(!o&&!i.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(t[0],t[1]),i.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var g=2;g+35&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(n==null){if(a&&!s.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var l=s.getLabelJustification(e);r.textAlign=l,r.textBaseline="bottom"}else{var c=e.element()._private.rscratch.badLine,h=e.pstyle("label"),d=e.pstyle("source-label"),v=e.pstyle("target-label");if(c||(!h||!h.value)&&(!d||!d.value)&&(!v||!v.value))return;r.textAlign="center",r.textBaseline="bottom"}var g=!t,m;t&&(m=t,r.translate(-m.x1,-m.y1)),i==null?(s.drawText(r,e,null,g,a),e.isEdge()&&(s.drawText(r,e,"source",g,a),s.drawText(r,e,"target",g,a))):s.drawText(r,e,i,g,a),t&&r.translate(m.x1,m.y1)};_u.getFontCache=function(r){var e;this.fontCaches=this.fontCaches||[];for(var t=0;t2&&arguments[2]!==void 0?arguments[2]:!0,n=e.pstyle("font-style").strValue,i=e.pstyle("font-size").pfValue+"px",a=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,o=t?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,c=e.pstyle("color").value,h=e.pstyle("text-outline-color").value;r.font=n+" "+s+" "+i+" "+a,r.lineJoin="round",this.colorFillStyle(r,c[0],c[1],c[2],o),this.colorStrokeStyle(r,h[0],h[1],h[2],l)};function _V(r,e,t,n,i){var a=Math.min(n,i),s=a/2,o=e+n/2,l=t+i/2;r.beginPath(),r.arc(o,l,s,0,Math.PI*2),r.closePath()}function b7(r,e,t,n,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=Math.min(a,n/2,i/2);r.beginPath(),r.moveTo(e+s,t),r.lineTo(e+n-s,t),r.quadraticCurveTo(e+n,t,e+n,t+s),r.lineTo(e+n,t+i-s),r.quadraticCurveTo(e+n,t+i,e+n-s,t+i),r.lineTo(e+s,t+i),r.quadraticCurveTo(e,t+i,e,t+i-s),r.lineTo(e,t+s),r.quadraticCurveTo(e,t,e+s,t),r.closePath()}_u.getTextAngle=function(r,e){var t,n=r._private,i=n.rscratch,a=e?e+"-":"",s=r.pstyle(a+"text-rotation");if(s.strValue==="autorotate"){var o=Ai(i,"labelAngle",e);t=r.isEdge()?o:0}else s.strValue==="none"?t=0:t=s.pfValue;return t};_u.drawText=function(r,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=e._private,s=a.rscratch,o=i?e.effectiveOpacity():1;if(!(i&&(o===0||e.pstyle("text-opacity").value===0))){t==="main"&&(t=null);var l=Ai(s,"labelX",t),c=Ai(s,"labelY",t),h,d,v=this.getLabelText(e,t);if(v!=null&&v!==""&&!isNaN(l)&&!isNaN(c)){this.setupTextStyle(r,e,i);var g=t?t+"-":"",m=Ai(s,"labelWidth",t),x=Ai(s,"labelHeight",t),y=e.pstyle(g+"text-margin-x").pfValue,_=e.pstyle(g+"text-margin-y").pfValue,w=e.isEdge(),S=e.pstyle("text-halign").value,A=e.pstyle("text-valign").value;w&&(S="center",A="center"),l+=y,c+=_;var C;switch(n?C=this.getTextAngle(e,t):C=0,C!==0&&(h=l,d=c,r.translate(h,d),r.rotate(C),l=0,c=0),A){case"top":break;case"center":c+=x/2;break;case"bottom":c+=x;break}var M=e.pstyle("text-background-opacity").value,E=e.pstyle("text-border-opacity").value,O=e.pstyle("text-border-width").pfValue,D=e.pstyle("text-background-padding").pfValue,I=e.pstyle("text-background-shape").strValue,k=I==="round-rectangle"||I==="roundrectangle",U=I==="circle",V=2;if(M>0||O>0&&E>0){var X=r.fillStyle,W=r.strokeStyle,P=r.lineWidth,H=e.pstyle("text-background-color").value,z=e.pstyle("text-border-color").value,$=e.pstyle("text-border-style").value,B=M>0,L=O>0&&E>0,Y=l-D;switch(S){case"left":Y-=m;break;case"center":Y-=m/2;break}var G=c-x-D,re=m+2*D,ie=x+2*D;if(B&&(r.fillStyle="rgba(".concat(H[0],",").concat(H[1],",").concat(H[2],",").concat(M*o,")")),L&&(r.strokeStyle="rgba(".concat(z[0],",").concat(z[1],",").concat(z[2],",").concat(E*o,")"),r.lineWidth=O,r.setLineDash))switch($){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"double":r.lineWidth=O/4,r.setLineDash([]);break;case"solid":default:r.setLineDash([]);break}if(k?(r.beginPath(),b7(r,Y,G,re,ie,V)):U?(r.beginPath(),_V(r,Y,G,re,ie)):(r.beginPath(),r.rect(Y,G,re,ie)),B&&r.fill(),L&&r.stroke(),L&&$==="double"){var le=O/2;r.beginPath(),k?b7(r,Y+le,G+le,re-2*le,ie-2*le,V):r.rect(Y+le,G+le,re-2*le,ie-2*le),r.stroke()}r.fillStyle=X,r.strokeStyle=W,r.lineWidth=P,r.setLineDash&&r.setLineDash([])}var ce=2*e.pstyle("text-outline-width").pfValue;if(ce>0&&(r.lineWidth=ce),e.pstyle("text-wrap").value==="wrap"){var _e=Ai(s,"labelWrapCachedLines",t),pe=Ai(s,"labelLineHeight",t),ae=m/2,oe=this.getLabelJustification(e);switch(oe==="auto"||(S==="left"?oe==="left"?l+=-m:oe==="center"&&(l+=-ae):S==="center"?oe==="left"?l+=-ae:oe==="right"&&(l+=ae):S==="right"&&(oe==="center"?l+=ae:oe==="right"&&(l+=m))),A){case"top":c-=(_e.length-1)*pe;break;case"center":case"bottom":c-=(_e.length-1)*pe;break}for(var de=0;de<_e.length;de++)ce>0&&r.strokeText(_e[de],l,c),r.fillText(_e[de],l,c),c+=pe}else ce>0&&r.strokeText(v,l,c),r.fillText(v,l,c);C!==0&&(r.rotate(-C),r.translate(-h,-d))}}};var vl={};vl.drawNode=function(r,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o,l,c=e._private,h=c.rscratch,d=e.position();if(!(!ut(d.x)||!ut(d.y))&&!(a&&!e.visible())){var v=a?e.effectiveOpacity():1,g=s.usePaths(),m,x=!1,y=e.padding();o=e.width()+2*y,l=e.height()+2*y;var _;t&&(_=t,r.translate(-_.x1,-_.y1));for(var w=e.pstyle("background-image"),S=w.value,A=new Array(S.length),C=new Array(S.length),M=0,E=0;E0&&arguments[0]!==void 0?arguments[0]:V;s.eleFillStyle(r,e,nt)},pe=function(){var nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:L;s.colorStrokeStyle(r,X[0],X[1],X[2],nt)},ae=function(){var nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ie;s.colorStrokeStyle(r,G[0],G[1],G[2],nt)},oe=function(nt,De,Q,ne){var be=s.nodePathCache=s.nodePathCache||[],ee=X9(Q==="polygon"?Q+","+ne.join(","):Q,""+De,""+nt,""+ce),se=be[ee],Pe,Ae=!1;return se!=null?(Pe=se,Ae=!0,h.pathCache=Pe):(Pe=new Path2D,be[ee]=h.pathCache=Pe),{path:Pe,cacheHit:Ae}},de=e.pstyle("shape").strValue,ye=e.pstyle("shape-polygon-points").pfValue;if(g){r.translate(d.x,d.y);var Ee=oe(o,l,de,ye);m=Ee.path,x=Ee.cacheHit}var Re=function(){if(!x){var nt=d;g&&(nt={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(m||r,nt.x,nt.y,o,l,ce,h)}g?r.fill(m):r.fill()},Ne=function(){for(var nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v,De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,Q=c.backgrounding,ne=0,be=0;be0&&arguments[0]!==void 0?arguments[0]:!1,De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:v;s.hasPie(e)&&(s.drawPie(r,e,De),nt&&(g||s.nodeShapes[s.getNodeShape(e)].draw(r,d.x,d.y,o,l,ce,h)))},$e=function(){var nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:v;s.hasStripe(e)&&(r.save(),g?r.clip(h.pathCache):(s.nodeShapes[s.getNodeShape(e)].draw(r,d.x,d.y,o,l,ce,h),r.clip()),s.drawStripe(r,e,De),r.restore(),nt&&(g||s.nodeShapes[s.getNodeShape(e)].draw(r,d.x,d.y,o,l,ce,h)))},Ye=function(){var nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v,De=(k>0?k:-k)*nt,Q=k>0?0:255;k!==0&&(s.colorFillStyle(r,Q,Q,Q,De),g?r.fill(m):r.fill())},He=function(){if(U>0){if(r.lineWidth=U,r.lineCap=H,r.lineJoin=P,r.setLineDash)switch(W){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash($),r.lineDashOffset=B;break;case"solid":case"double":r.setLineDash([]);break}if(z!=="center"){if(r.save(),r.lineWidth*=2,z==="inside")g?r.clip(m):r.clip();else{var nt=new Path2D;nt.rect(-o/2-U,-l/2-U,o+2*U,l+2*U),nt.addPath(m),r.clip(nt,"evenodd")}g?r.stroke(m):r.stroke(),r.restore()}else g?r.stroke(m):r.stroke();if(W==="double"){r.lineWidth=U/3;var De=r.globalCompositeOperation;r.globalCompositeOperation="destination-out",g?r.stroke(m):r.stroke(),r.globalCompositeOperation=De}r.setLineDash&&r.setLineDash([])}},tt=function(){if(Y>0){if(r.lineWidth=Y,r.lineCap="butt",r.setLineDash)switch(re){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"solid":case"double":r.setLineDash([]);break}var nt=d;g&&(nt={x:0,y:0});var De=s.getNodeShape(e),Q=U;z==="inside"&&(Q=0),z==="outside"&&(Q*=2);var ne=(o+Q+(Y+le))/o,be=(l+Q+(Y+le))/l,ee=o*ne,se=l*be,Pe=s.nodeShapes[De].points,Ae;if(g){var Ge=oe(ee,se,De,Pe);Ae=Ge.path}if(De==="ellipse")s.drawEllipsePath(Ae||r,nt.x,nt.y,ee,se);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(De)){var J=0,Oe=0,Ve=0;De==="round-diamond"?J=(Q+le+Y)*1.4:De==="round-heptagon"?(J=(Q+le+Y)*1.075,Ve=-(Q/2+le+Y)/35):De==="round-hexagon"?J=(Q+le+Y)*1.12:De==="round-pentagon"?(J=(Q+le+Y)*1.13,Ve=-(Q/2+le+Y)/15):De==="round-tag"?(J=(Q+le+Y)*1.12,Oe=(Q/2+Y+le)*.07):De==="round-triangle"&&(J=(Q+le+Y)*(Math.PI/2),Ve=-(Q+le/2+Y)/Math.PI),J!==0&&(ne=(o+J)/o,ee=o*ne,["round-hexagon","round-tag"].includes(De)||(be=(l+J)/l,se=l*be)),ce=ce==="auto"?rR(ee,se):ce;for(var Ue=ee/2,je=se/2,yt=ce+(Q+Y+le)/2,vt=new Array(Pe.length/2),Ot=new Array(Pe.length/2),jt=0;jt0){if(i=i||n.position(),a==null||s==null){var g=n.padding();a=n.width()+2*g,s=n.height()+2*g}o.colorFillStyle(t,h[0],h[1],h[2],c),o.nodeShapes[d].draw(t,i.x,i.y,a+l*2,s+l*2,v),t.fill()}}}};vl.drawNodeOverlay=lO("overlay");vl.drawNodeUnderlay=lO("underlay");vl.hasPie=function(r){return r=r[0],r._private.hasPie};vl.hasStripe=function(r){return r=r[0],r._private.hasStripe};vl.drawPie=function(r,e,t,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=e.pstyle("pie-size"),s=e.pstyle("pie-hole"),o=e.pstyle("pie-start-angle").pfValue,l=n.x,c=n.y,h=e.width(),d=e.height(),v=Math.min(h,d)/2,g,m=0,x=this.usePaths();if(x&&(l=0,c=0),a.units==="%"?v=v*a.pfValue:a.pfValue!==void 0&&(v=a.pfValue/2),s.units==="%"?g=v*s.pfValue:s.pfValue!==void 0&&(g=s.pfValue/2),!(g>=v))for(var y=1;y<=i.pieBackgroundN;y++){var _=e.pstyle("pie-"+y+"-background-size").value,w=e.pstyle("pie-"+y+"-background-color").value,S=e.pstyle("pie-"+y+"-background-opacity").value*t,A=_/100;A+m>1&&(A=1-m);var C=1.5*Math.PI+2*Math.PI*m;C+=o;var M=2*Math.PI*A,E=C+M;_===0||m>=1||m+A>1||(g===0?(r.beginPath(),r.moveTo(l,c),r.arc(l,c,v,C,E),r.closePath()):(r.beginPath(),r.arc(l,c,v,C,E),r.arc(l,c,g,E,C,!0),r.closePath()),this.colorFillStyle(r,w[0],w[1],w[2],S),r.fill(),m+=A)}};vl.drawStripe=function(r,e,t,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=n.x,s=n.y,o=e.width(),l=e.height(),c=0,h=this.usePaths();r.save();var d=e.pstyle("stripe-direction").value,v=e.pstyle("stripe-size");switch(d){case"vertical":break;case"righward":r.rotate(-Math.PI/2);break}var g=o,m=l;v.units==="%"?(g=g*v.pfValue,m=m*v.pfValue):v.pfValue!==void 0&&(g=v.pfValue,m=v.pfValue),h&&(a=0,s=0),s-=g/2,a-=m/2;for(var x=1;x<=i.stripeBackgroundN;x++){var y=e.pstyle("stripe-"+x+"-background-size").value,_=e.pstyle("stripe-"+x+"-background-color").value,w=e.pstyle("stripe-"+x+"-background-opacity").value*t,S=y/100;S+c>1&&(S=1-c),!(y===0||c>=1||c+S>1)&&(r.beginPath(),r.rect(a,s+m*c,g,m*S),r.closePath(),this.colorFillStyle(r,_[0],_[1],_[2],w),r.fill(),c+=S)}r.restore()};var vi={},wV=100;vi.getPixelRatio=function(){var r=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),t=r.backingStorePixelRatio||r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||r.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/t};vi.paintCache=function(r){for(var e=this.paintCaches=this.paintCaches||[],t=!0,n,i=0;ie.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!d&&(h[e.NODE]=!0,h[e.SELECT_BOX]=!0);var w=t.style(),S=t.zoom(),A=s!==void 0?s:S,C=t.pan(),M={x:C.x,y:C.y},E={zoom:S,pan:{x:C.x,y:C.y}},O=e.prevViewport,D=O===void 0||E.zoom!==O.zoom||E.pan.x!==O.pan.x||E.pan.y!==O.pan.y;!D&&!(x&&!m)&&(e.motionBlurPxRatio=1),o&&(M=o),A*=l,M.x*=l,M.y*=l;var I=e.getCachedZSortedEles();function k(pe,ae,oe,de,ye){var Ee=pe.globalCompositeOperation;pe.globalCompositeOperation="destination-out",e.colorFillStyle(pe,255,255,255,e.motionBlurTransparency),pe.fillRect(ae,oe,de,ye),pe.globalCompositeOperation=Ee}function U(pe,ae){var oe,de,ye,Ee;!e.clearingMotionBlur&&(pe===c.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||pe===c.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(oe={x:C.x*g,y:C.y*g},de=S*g,ye=e.canvasWidth*g,Ee=e.canvasHeight*g):(oe=M,de=A,ye=e.canvasWidth,Ee=e.canvasHeight),pe.setTransform(1,0,0,1,0,0),ae==="motionBlur"?k(pe,0,0,ye,Ee):!n&&(ae===void 0||ae)&&pe.clearRect(0,0,ye,Ee),i||(pe.translate(oe.x,oe.y),pe.scale(de,de)),o&&pe.translate(o.x,o.y),s&&pe.scale(s,s)}if(d||(e.textureDrawLastFrame=!1),d){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=t.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var V=e.data.bufferContexts[e.TEXTURE_BUFFER];V.setTransform(1,0,0,1,0,0),V.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:V,drawOnlyNodeLayer:!0,forcedPxRatio:l*e.textureMult});var E=e.textureCache.viewport={zoom:t.zoom(),pan:t.pan(),width:e.canvasWidth,height:e.canvasHeight};E.mpan={x:(0-E.pan.x)/E.zoom,y:(0-E.pan.y)/E.zoom}}h[e.DRAG]=!1,h[e.NODE]=!1;var X=c.contexts[e.NODE],W=e.textureCache.texture,E=e.textureCache.viewport;X.setTransform(1,0,0,1,0,0),v?k(X,0,0,E.width,E.height):X.clearRect(0,0,E.width,E.height);var P=w.core("outside-texture-bg-color").value,H=w.core("outside-texture-bg-opacity").value;e.colorFillStyle(X,P[0],P[1],P[2],H),X.fillRect(0,0,E.width,E.height);var S=t.zoom();U(X,!1),X.clearRect(E.mpan.x,E.mpan.y,E.width/E.zoom/l,E.height/E.zoom/l),X.drawImage(W,E.mpan.x,E.mpan.y,E.width/E.zoom/l,E.height/E.zoom/l)}else e.textureOnViewport&&!n&&(e.textureCache=null);var z=t.extent(),$=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),B=e.hideEdgesOnViewport&&$,L=[];if(L[e.NODE]=!h[e.NODE]&&v&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,L[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),L[e.DRAG]=!h[e.DRAG]&&v&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,L[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),h[e.NODE]||i||a||L[e.NODE]){var Y=v&&!L[e.NODE]&&g!==1,X=n||(Y?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:c.contexts[e.NODE]),G=v&&!Y?"motionBlur":void 0;U(X,G),B?e.drawCachedNodes(X,I.nondrag,l,z):e.drawLayeredElements(X,I.nondrag,l,z),e.debug&&e.drawDebugPoints(X,I.nondrag),!i&&!v&&(h[e.NODE]=!1)}if(!a&&(h[e.DRAG]||i||L[e.DRAG])){var Y=v&&!L[e.DRAG]&&g!==1,X=n||(Y?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:c.contexts[e.DRAG]);U(X,v&&!Y?"motionBlur":void 0),B?e.drawCachedNodes(X,I.drag,l,z):e.drawCachedElements(X,I.drag,l,z),e.debug&&e.drawDebugPoints(X,I.drag),!i&&!v&&(h[e.DRAG]=!1)}if(this.drawSelectionRectangle(r,U),v&&g!==1){var re=c.contexts[e.NODE],ie=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],le=c.contexts[e.DRAG],ce=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],_e=function(ae,oe,de){ae.setTransform(1,0,0,1,0,0),de||!_?ae.clearRect(0,0,e.canvasWidth,e.canvasHeight):k(ae,0,0,e.canvasWidth,e.canvasHeight);var ye=g;ae.drawImage(oe,0,0,e.canvasWidth*ye,e.canvasHeight*ye,0,0,e.canvasWidth,e.canvasHeight)};(h[e.NODE]||L[e.NODE])&&(_e(re,ie,L[e.NODE]),h[e.NODE]=!1),(h[e.DRAG]||L[e.DRAG])&&(_e(le,ce,L[e.DRAG]),h[e.DRAG]=!1)}e.prevViewport=E,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),v&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!d,e.mbFrames=0,h[e.NODE]=!0,h[e.DRAG]=!0,e.redraw()},wV)),n||t.emit("render")};var cf;vi.drawSelectionRectangle=function(r,e){var t=this,n=t.cy,i=t.data,a=n.style(),s=r.drawOnlyNodeLayer,o=r.drawAllLayers,l=i.canvasNeedsRedraw,c=r.forcedContext;if(t.showFps||!s&&l[t.SELECT_BOX]&&!o){var h=c||i.contexts[t.SELECT_BOX];if(e(h),t.selection[4]==1&&(t.hoverData.selecting||t.touchData.selecting)){var d=t.cy.zoom(),v=a.core("selection-box-border-width").value/d;h.lineWidth=v,h.fillStyle="rgba("+a.core("selection-box-color").value[0]+","+a.core("selection-box-color").value[1]+","+a.core("selection-box-color").value[2]+","+a.core("selection-box-opacity").value+")",h.fillRect(t.selection[0],t.selection[1],t.selection[2]-t.selection[0],t.selection[3]-t.selection[1]),v>0&&(h.strokeStyle="rgba("+a.core("selection-box-border-color").value[0]+","+a.core("selection-box-border-color").value[1]+","+a.core("selection-box-border-color").value[2]+","+a.core("selection-box-opacity").value+")",h.strokeRect(t.selection[0],t.selection[1],t.selection[2]-t.selection[0],t.selection[3]-t.selection[1]))}if(i.bgActivePosistion&&!t.hoverData.selecting){var d=t.cy.zoom(),g=i.bgActivePosistion;h.fillStyle="rgba("+a.core("active-bg-color").value[0]+","+a.core("active-bg-color").value[1]+","+a.core("active-bg-color").value[2]+","+a.core("active-bg-opacity").value+")",h.beginPath(),h.arc(g.x,g.y,a.core("active-bg-size").pfValue/d,0,2*Math.PI),h.fill()}var m=t.lastRedrawTime;if(t.showFps&&m){m=Math.round(m);var x=Math.round(1e3/m),y="1 frame = "+m+" ms = "+x+" fps";if(h.setTransform(1,0,0,1,0,0),h.fillStyle="rgba(255, 0, 0, 0.75)",h.strokeStyle="rgba(255, 0, 0, 0.75)",h.font="30px Arial",!cf){var _=h.measureText(y);cf=_.actualBoundingBoxAscent}h.fillText(y,0,cf);var w=60;h.strokeRect(0,cf+10,250,20),h.fillRect(0,cf+10,250*Math.min(x/w,1),20)}o||(l[t.SELECT_BOX]=!1)}};function x7(r,e,t){var n=r.createShader(e);if(r.shaderSource(n,t),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw new Error(r.getShaderInfoLog(n));return n}function SV(r,e,t){var n=x7(r,r.VERTEX_SHADER,e),i=x7(r,r.FRAGMENT_SHADER,t),a=r.createProgram();if(r.attachShader(a,n),r.attachShader(a,i),r.linkProgram(a),!r.getProgramParameter(a,r.LINK_STATUS))throw new Error("Could not initialize shaders");return a}function EV(r,e,t){t===void 0&&(t=e);var n=r.makeOffscreenCanvas(e,t),i=n.context=n.getContext("2d");return n.clear=function(){return i.clearRect(0,0,n.width,n.height)},n.clear(),n}function vw(r){var e=r.pixelRatio,t=r.cy.zoom(),n=r.cy.pan();return{zoom:t*e,pan:{x:n.x*e,y:n.y*e}}}function TV(r){var e=r.pixelRatio,t=r.cy.zoom();return t*e}function CV(r,e,t,n,i){var a=n*t+e.x,s=i*t+e.y;return s=Math.round(r.canvasHeight-s),[a,s]}function AV(r,e){return e.picking?!0:r.pstyle("background-fill").value!=="solid"||r.pstyle("background-image").strValue!=="none"?!1:r.pstyle("border-width").value===0||r.pstyle("border-opacity").value===0?!0:r.pstyle("border-style").value==="solid"}function MV(r,e){if(r.length!==e.length)return!1;for(var t=0;t>0&255)/255,t[1]=(r>>8&255)/255,t[2]=(r>>16&255)/255,t[3]=(r>>24&255)/255,t}function RV(r){return r[0]+(r[1]<<8)+(r[2]<<16)+(r[3]<<24)}function OV(r,e){var t=r.createTexture();return t.buffer=function(n){r.bindTexture(r.TEXTURE_2D,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR_MIPMAP_NEAREST),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,n),r.generateMipmap(r.TEXTURE_2D),r.bindTexture(r.TEXTURE_2D,null)},t.deleteTexture=function(){r.deleteTexture(t)},t}function uO(r,e){switch(e){case"float":return[1,r.FLOAT,4];case"vec2":return[2,r.FLOAT,4];case"vec3":return[3,r.FLOAT,4];case"vec4":return[4,r.FLOAT,4];case"int":return[1,r.INT,4];case"ivec2":return[2,r.INT,4]}}function cO(r,e,t){switch(e){case r.FLOAT:return new Float32Array(t);case r.INT:return new Int32Array(t)}}function DV(r,e,t,n,i,a){switch(e){case r.FLOAT:return new Float32Array(t.buffer,a*n,i);case r.INT:return new Int32Array(t.buffer,a*n,i)}}function PV(r,e,t,n){var i=uO(r,e),a=_n(i,2),s=a[0],o=a[1],l=cO(r,o,n),c=r.createBuffer();return r.bindBuffer(r.ARRAY_BUFFER,c),r.bufferData(r.ARRAY_BUFFER,l,r.STATIC_DRAW),o===r.FLOAT?r.vertexAttribPointer(t,s,o,!1,0,0):o===r.INT&&r.vertexAttribIPointer(t,s,o,0,0),r.enableVertexAttribArray(t),r.bindBuffer(r.ARRAY_BUFFER,null),c}function ja(r,e,t,n){var i=uO(r,t),a=_n(i,3),s=a[0],o=a[1],l=a[2],c=cO(r,o,e*s),h=s*l,d=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,d),r.bufferData(r.ARRAY_BUFFER,e*h,r.DYNAMIC_DRAW),r.enableVertexAttribArray(n),o===r.FLOAT?r.vertexAttribPointer(n,s,o,!1,h,0):o===r.INT&&r.vertexAttribIPointer(n,s,o,h,0),r.vertexAttribDivisor(n,1),r.bindBuffer(r.ARRAY_BUFFER,null);for(var v=new Array(e),g=0;gs&&(o=s/n,l=n*o,c=i*o),{scale:o,texW:l,texH:c}}},{key:"draw",value:function(t,n,i){var a=this;if(this.locked)throw new Error("can't draw, atlas is locked");var s=this.texSize,o=this.texRows,l=this.texHeight,c=this.getScale(n),h=c.scale,d=c.texW,v=c.texH,g=function(S,A){if(i&&A){var C=A.context,M=S.x,E=S.row,O=M,D=l*E;C.save(),C.translate(O,D),C.scale(h,h),i(C,n),C.restore()}},m=[null,null],x=function(){g(a.freePointer,a.canvas),m[0]={x:a.freePointer.x,y:a.freePointer.row*l,w:d,h:v},m[1]={x:a.freePointer.x+d,y:a.freePointer.row*l,w:0,h:v},a.freePointer.x+=d,a.freePointer.x==s&&(a.freePointer.x=0,a.freePointer.row++)},y=function(){var S=a.scratch,A=a.canvas;S.clear(),g({x:0,row:0},S);var C=s-a.freePointer.x,M=d-C,E=l;{var O=a.freePointer.x,D=a.freePointer.row*l,I=C;A.context.drawImage(S,0,0,I,E,O,D,I,E),m[0]={x:O,y:D,w:I,h:v}}{var k=C,U=(a.freePointer.row+1)*l,V=M;A&&A.context.drawImage(S,k,0,V,E,0,U,V,E),m[1]={x:0,y:U,w:V,h:v}}a.freePointer.x=M,a.freePointer.row++},_=function(){a.freePointer.x=0,a.freePointer.row++};if(this.freePointer.x+d<=s)x();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===s?(_(),x()):this.enableWrapping?y():(_(),x())}return this.keyToLocation.set(t,m),this.needsBuffer=!0,m}},{key:"getOffsets",value:function(t){return this.keyToLocation.get(t)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(t){if(this.locked)return!1;var n=this.texSize,i=this.texRows,a=this.getScale(t),s=a.texW;return this.freePointer.x+s>n?this.freePointer.row1&&arguments[1]!==void 0?arguments[1]:{},a=i.forceRedraw,s=a===void 0?!1:a,o=i.filterEle,l=o===void 0?function(){return!0}:o,c=i.filterType,h=c===void 0?function(){return!0}:c,d=!1,v=!1,g=Ri(t),m;try{for(g.s();!(m=g.n()).done;){var x=m.value;if(l(x)){var y=Ri(this.renderTypes.values()),_;try{var w=function(){var A=_.value,C=A.type;if(h(C)){var M=n.collections.get(A.collection),E=A.getKey(x),O=Array.isArray(E)?E:[E];if(s)O.forEach(function(U){return M.markKeyForGC(U)}),v=!0;else{var D=A.getID?A.getID(x):x.id(),I=n._key(C,D),k=n.typeAndIdToKey.get(I);k!==void 0&&!MV(O,k)&&(d=!0,n.typeAndIdToKey.delete(I),k.forEach(function(U){return M.markKeyForGC(U)}))}}};for(y.s();!(_=y.n()).done;)w()}catch(S){y.e(S)}finally{y.f()}}}}catch(S){g.e(S)}finally{g.f()}return v&&(this.gc(),d=!1),d}},{key:"gc",value:function(){var t=Ri(this.collections.values()),n;try{for(t.s();!(n=t.n()).done;){var i=n.value;i.gc()}}catch(a){t.e(a)}finally{t.f()}}},{key:"getOrCreateAtlas",value:function(t,n,i,a){var s=this.renderTypes.get(n),o=this.collections.get(s.collection),l=!1,c=o.draw(a,i,function(v){s.drawClipped?(v.save(),v.beginPath(),v.rect(0,0,i.w,i.h),v.clip(),s.drawElement(v,t,i,!0,!0),v.restore()):s.drawElement(v,t,i,!0,!0),l=!0});if(l){var h=s.getID?s.getID(t):t.id(),d=this._key(n,h);this.typeAndIdToKey.has(d)?this.typeAndIdToKey.get(d).push(a):this.typeAndIdToKey.set(d,[a])}return c}},{key:"getAtlasInfo",value:function(t,n){var i=this,a=this.renderTypes.get(n),s=a.getKey(t),o=Array.isArray(s)?s:[s];return o.map(function(l){var c=a.getBoundingBox(t,l),h=i.getOrCreateAtlas(t,n,c,l),d=h.getOffsets(l),v=_n(d,2),g=v[0],m=v[1];return{atlas:h,tex:g,tex1:g,tex2:m,bb:c}})}},{key:"getDebugInfo",value:function(){var t=[],n=Ri(this.collections),i;try{for(n.s();!(i=n.n()).done;){var a=_n(i.value,2),s=a[0],o=a[1],l=o.getCounts(),c=l.keyCount,h=l.atlasCount;t.push({type:s,keyCount:c,atlasCount:h})}}catch(d){n.e(d)}finally{n.f()}return t}}])})(),GV=(function(){function r(e){hl(this,r),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return fl(r,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(t,n){return n})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(t){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(t):!0}},{key:"getAtlasIndexForBatch",value:function(t){var n=this.batchAtlases.indexOf(t);if(n<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(t),n=this.batchAtlases.length-1}return n}}])})(),HV=` float circleSD(vec2 p, float r) { return distance(vec2(0), p) - r; // signed distance } `,jV=` float rectangleSD(vec2 p, vec2 b) { vec2 d = abs(p)-b; return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0); } `,VV=` float roundRectangleSD(vec2 p, vec2 b, vec4 cr) { cr.xy = (p.x > 0.0) ? cr.xy : cr.zw; cr.x = (p.y > 0.0) ? cr.x : cr.y; vec2 q = abs(p) - b + cr.x; return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x; } `,qV=` float ellipseSD(vec2 p, vec2 ab) { p = abs( p ); // symmetry // find root with Newton solver vec2 q = ab*(p-ab); float w = (q.x1.0) ? d : -d; } `,zf={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},Bp={IGNORE:1,USE_BB:2},F2=0,E7=1,T7=2,z2=3,fc=4,vv=5,hf=6,ff=7,XV=(function(){function r(e,t,n){hl(this,r),this.r=e,this.gl=t,this.maxInstances=n.webglBatchSize,this.atlasSize=n.webglTexSize,this.bgColor=n.bgColor,this.debug=n.webglDebug,this.batchDebugInfo=[],n.enableWrapping=!0,n.createTextureCanvas=EV,this.atlasManager=new UV(e,n),this.batchManager=new GV(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(zf.SCREEN),this.pickingProgram=this._createShaderProgram(zf.PICKING),this.vao=this._createVAO()}return fl(r,[{key:"addAtlasCollection",value:function(t,n){this.atlasManager.addAtlasCollection(t,n)}},{key:"addTextureAtlasRenderType",value:function(t,n){this.atlasManager.addRenderType(t,n)}},{key:"addSimpleShapeRenderType",value:function(t,n){this.simpleShapeOptions.set(t,n)}},{key:"invalidate",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.type,a=this.atlasManager;return i?a.invalidate(t,{filterType:function(o){return o===i},forceRedraw:!0}):a.invalidate(t)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(t){var n=this.gl,i=`#version 300 es precision highp float; uniform mat3 uPanZoomMatrix; uniform int uAtlasSize; // instanced in vec2 aPosition; // a vertex from the unit square in mat3 aTransform; // used to transform verticies, eg into a bounding box in int aVertType; // the type of thing we are rendering // the z-index that is output when using picking mode in vec4 aIndex; // For textures in int aAtlasId; // which shader unit/atlas to use in vec4 aTex; // x/y/w/h of texture in atlas // for edges in vec4 aPointAPointB; in vec4 aPointCPointD; in vec2 aLineWidth; // also used for node border width // simple shapes in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left] in vec4 aColor; // also used for edges in vec4 aBorderColor; // aLineWidth is used for border width // output values passed to the fragment shader out vec2 vTexCoord; out vec4 vColor; out vec2 vPosition; // flat values are not interpolated flat out int vAtlasId; flat out int vVertType; flat out vec2 vTopRight; flat out vec2 vBotLeft; flat out vec4 vCornerRadius; flat out vec4 vBorderColor; flat out vec2 vBorderWidth; flat out vec4 vIndex; void main(void) { int vid = gl_VertexID; vec2 position = aPosition; // TODO make this a vec3, simplifies some code below if(aVertType == `.concat(F2,`) { float texX = aTex.x; // texture coordinates float texY = aTex.y; float texW = aTex.z; float texH = aTex.w; if(vid == 1 || vid == 2 || vid == 4) { texX += texW; } if(vid == 2 || vid == 4 || vid == 5) { texY += texH; } float d = float(uAtlasSize); vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1 gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); } else if(aVertType == `).concat(fc," || aVertType == ").concat(ff,` || aVertType == `).concat(vv," || aVertType == ").concat(hf,`) { // simple shapes // the bounding box is needed by the fragment shader vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated // calculations are done in the fragment shader, just pass these along vColor = aColor; vCornerRadius = aCornerRadius; vBorderColor = aBorderColor; vBorderWidth = aLineWidth; gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); } else if(aVertType == `).concat(E7,`) { vec2 source = aPointAPointB.xy; vec2 target = aPointAPointB.zw; // adjust the geometry so that the line is centered on the edge position.y = position.y - 0.5; // stretch the unit square into a long skinny rectangle vec2 xBasis = target - source; vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x)); vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y; gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0); vColor = aColor; } else if(aVertType == `).concat(T7,`) { vec2 pointA = aPointAPointB.xy; vec2 pointB = aPointAPointB.zw; vec2 pointC = aPointCPointD.xy; vec2 pointD = aPointCPointD.zw; // adjust the geometry so that the line is centered on the edge position.y = position.y - 0.5; vec2 p0, p1, p2, pos; if(position.x == 0.0) { // The left side of the unit square p0 = pointA; p1 = pointB; p2 = pointC; pos = position; } else { // The right side of the unit square, use same approach but flip the geometry upside down p0 = pointD; p1 = pointC; p2 = pointB; pos = vec2(0.0, -position.y); } vec2 p01 = p1 - p0; vec2 p12 = p2 - p1; vec2 p21 = p1 - p2; // Find the normal vector. vec2 tangent = normalize(normalize(p12) + normalize(p01)); vec2 normal = vec2(-tangent.y, tangent.x); // Find the vector perpendicular to p0 -> p1. vec2 p01Norm = normalize(vec2(-p01.y, p01.x)); // Determine the bend direction. float sigma = sign(dot(p01 + p21, normal)); float width = aLineWidth[0]; if(sign(pos.y) == -sigma) { // This is an intersecting vertex. Adjust the position so that there's no overlap. vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm); gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0); } else { // This is a non-intersecting vertex. Treat it like a mitre join. vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm); gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0); } vColor = aColor; } else if(aVertType == `).concat(z2,` && vid < 3) { // massage the first triangle into an edge arrow if(vid == 0) position = vec2(-0.15, -0.3); if(vid == 1) position = vec2( 0.0, 0.0); if(vid == 2) position = vec2( 0.15, -0.3); gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); vColor = aColor; } else { gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space } vAtlasId = aAtlasId; vVertType = aVertType; vIndex = aIndex; } `),a=this.batchManager.getIndexArray(),s=`#version 300 es precision highp float; // declare texture unit for each texture atlas in the batch `.concat(a.map(function(c){return"uniform sampler2D uTexture".concat(c,";")}).join(` `),` uniform vec4 uBGColor; uniform float uZoom; in vec2 vTexCoord; in vec4 vColor; in vec2 vPosition; // model coordinates flat in int vAtlasId; flat in vec4 vIndex; flat in int vVertType; flat in vec2 vTopRight; flat in vec2 vBotLeft; flat in vec4 vCornerRadius; flat in vec4 vBorderColor; flat in vec2 vBorderWidth; out vec4 outColor; `).concat(HV,` `).concat(jV,` `).concat(VV,` `).concat(qV,` vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha return vec4( top.rgb + (bot.rgb * (1.0 - top.a)), top.a + (bot.a * (1.0 - top.a)) ); } vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance // scale to the zoom level so that borders don't look blurry when zoomed in // note 1.5 is an aribitrary value chosen because it looks good return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d))); } void main(void) { if(vVertType == `).concat(F2,`) { // look up the texel from the texture unit `).concat(a.map(function(c){return"if(vAtlasId == ".concat(c,") outColor = texture(uTexture").concat(c,", vTexCoord);")}).join(` else `),` } else if(vVertType == `).concat(z2,`) { // mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out'; outColor = blend(vColor, uBGColor); outColor.a = 1.0; // make opaque, masks out line under arrow } else if(vVertType == `).concat(fc,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done } else if(vVertType == `).concat(fc," || vVertType == ").concat(ff,` || vVertType == `).concat(vv," || vVertType == ").concat(hf,`) { // use SDF float outerBorder = vBorderWidth[0]; float innerBorder = vBorderWidth[1]; float borderPadding = outerBorder * 2.0; float w = vTopRight.x - vBotLeft.x - borderPadding; float h = vTopRight.y - vBotLeft.y - borderPadding; vec2 b = vec2(w/2.0, h/2.0); // half width, half height vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center float d; // signed distance if(vVertType == `).concat(fc,`) { d = rectangleSD(p, b); } else if(vVertType == `).concat(ff,` && w == h) { d = circleSD(p, b.x); // faster than ellipse } else if(vVertType == `).concat(ff,`) { d = ellipseSD(p, b); } else { d = roundRectangleSD(p, b, vCornerRadius.wzyx); } // use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling // we must smooth colors inwards, because we can't change pixels outside the shape's bounding box if(d > 0.0) { if(d > outerBorder) { discard; } else { outColor = distInterp(vBorderColor, vec4(0), d - outerBorder); } } else { if(d > innerBorder) { vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor; vec4 innerBorderColor = blend(vBorderColor, vColor); outColor = distInterp(innerBorderColor, outerColor, d); } else { vec4 outerColor; if(innerBorder == 0.0 && outerBorder == 0.0) { outerColor = vec4(0); } else if(innerBorder == 0.0) { outerColor = vBorderColor; } else { outerColor = blend(vBorderColor, vColor); } outColor = distInterp(vColor, outerColor, d - innerBorder); } } } else { outColor = vColor; } `).concat(t.picking?`if(outColor.a == 0.0) discard; else outColor = vIndex;`:"",` } `),o=SV(n,i,s);o.aPosition=n.getAttribLocation(o,"aPosition"),o.aIndex=n.getAttribLocation(o,"aIndex"),o.aVertType=n.getAttribLocation(o,"aVertType"),o.aTransform=n.getAttribLocation(o,"aTransform"),o.aAtlasId=n.getAttribLocation(o,"aAtlasId"),o.aTex=n.getAttribLocation(o,"aTex"),o.aPointAPointB=n.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=n.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=n.getAttribLocation(o,"aLineWidth"),o.aColor=n.getAttribLocation(o,"aColor"),o.aCornerRadius=n.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=n.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=n.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=n.getUniformLocation(o,"uAtlasSize"),o.uBGColor=n.getUniformLocation(o,"uBGColor"),o.uZoom=n.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var l=0;l1&&arguments[1]!==void 0?arguments[1]:zf.SCREEN;this.panZoomMatrix=t,this.renderTarget=n,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(t,n){return t.visible()?n&&n.isVisible?n.isVisible(t):!0:!1}},{key:"drawTexture",value:function(t,n,i){var a=this.atlasManager,s=this.batchManager,o=a.getRenderTypeOpts(i);if(this._isVisible(t,o)&&!(t.isEdge()&&!this._isValidEdge(t))){if(this.renderTarget.picking&&o.getTexPickingMode){var l=o.getTexPickingMode(t);if(l===Bp.IGNORE)return;if(l==Bp.USE_BB){this.drawPickingRectangle(t,n,i);return}}var c=a.getAtlasInfo(t,i),h=Ri(c),d;try{for(h.s();!(d=h.n()).done;){var v=d.value,g=v.atlas,m=v.tex1,x=v.tex2;s.canAddToCurrentBatch(g)||this.endBatch();for(var y=s.getAtlasIndexForBatch(g),_=0,w=[[m,!0],[x,!1]];_=this.maxInstances&&this.endBatch()}}}}catch(k){h.e(k)}finally{h.f()}}}},{key:"setTransformMatrix",value:function(t,n,i,a){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;if(i.shapeProps&&i.shapeProps.padding&&(o=t.pstyle(i.shapeProps.padding).pfValue),a){var l=a.bb,c=a.tex1,h=a.tex2,d=c.w/(c.w+h.w);s||(d=1-d);var v=this._getAdjustedBB(l,o,s,d);this._applyTransformMatrix(n,v,i,t)}else{var g=i.getBoundingBox(t),m=this._getAdjustedBB(g,o,!0,1);this._applyTransformMatrix(n,m,i,t)}}},{key:"_applyTransformMatrix",value:function(t,n,i,a){var s,o;w7(t);var l=i.getRotation?i.getRotation(a):0;if(l!==0){var c=i.getRotationPoint(a),h=c.x,d=c.y;cp(t,t,[h,d]),S7(t,t,l);var v=i.getRotationOffset(a);s=v.x+(n.xOffset||0),o=v.y+(n.yOffset||0)}else s=n.x1,o=n.y1;cp(t,t,[s,o]),g4(t,t,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(t,n,i,a){var s=t.x1,o=t.y1,l=t.w,c=t.h,h=t.yOffset;n&&(s-=n,o-=n,l+=2*n,c+=2*n);var d=0,v=l*a;return i&&a<1?l=v:!i&&a<1&&(d=l-v,s+=d,l=v),{x1:s,y1:o,w:l,h:c,xOffset:d,yOffset:h}}},{key:"drawPickingRectangle",value:function(t,n,i){var a=this.atlasManager.getRenderTypeOpts(i),s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=fc;var o=this.indexBuffer.getView(s);hc(n,o);var l=this.colorBuffer.getView(s);Bl([0,0,0],1,l);var c=this.transformBuffer.getMatrixView(s);this.setTransformMatrix(t,c,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(t,n,i){var a=this.simpleShapeOptions.get(i);if(this._isVisible(t,a)){var s=a.shapeProps,o=this._getVertTypeForShape(t,s.shape);if(o===void 0||a.isSimple&&!a.isSimple(t,this.renderTarget)){this.drawTexture(t,n,i);return}var l=this.instanceCount;if(this.vertTypeBuffer.getView(l)[0]=o,o===vv||o===hf){var c=a.getBoundingBox(t),h=this._getCornerRadius(t,s.radius,c),d=this.cornerRadiusBuffer.getView(l);d[0]=h,d[1]=h,d[2]=h,d[3]=h,o===hf&&(d[0]=0,d[2]=0)}var v=this.indexBuffer.getView(l);hc(n,v);var g=this.renderTarget.picking?1:t.pstyle(s.opacity).value,m=t.pstyle(s.color).value,x=this.colorBuffer.getView(l);Bl(m,g,x);var y=this.lineWidthBuffer.getView(l);if(y[0]=0,y[1]=0,s.border){var _=t.pstyle("border-width").value;if(_>0){var w=t.pstyle("border-color").value,S=t.pstyle("border-opacity").value,A=this.borderColorBuffer.getView(l);Bl(w,S,A);var C=t.pstyle("border-position").value;if(C==="inside")y[0]=0,y[1]=-_;else if(C==="outside")y[0]=_,y[1]=0;else{var M=_/2;y[0]=M,y[1]=-M}}}var E=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(t,E,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(t,n){var i=t.pstyle(n).value;switch(i){case"rectangle":return fc;case"ellipse":return ff;case"roundrectangle":case"round-rectangle":return vv;case"bottom-round-rectangle":return hf;default:return}}},{key:"_getCornerRadius",value:function(t,n,i){var a=i.w,s=i.h;if(t.pstyle(n).value==="auto")return Zo(a,s);var o=t.pstyle(n).pfValue,l=a/2,c=s/2;return Math.min(o,c,l)}},{key:"drawEdgeArrow",value:function(t,n,i){if(t.visible()){var a=t._private.rscratch,s,o,l;if(i==="source"?(s=a.arrowStartX,o=a.arrowStartY,l=a.srcArrowAngle):(s=a.arrowEndX,o=a.arrowEndY,l=a.tgtArrowAngle),!(isNaN(s)||s==null||isNaN(o)||o==null||isNaN(l)||l==null)){var c=t.pstyle(i+"-arrow-shape").value;if(c!=="none"){var h=t.pstyle(i+"-arrow-color").value,d=t.pstyle("opacity").value,v=t.pstyle("line-opacity").value,g=d*v,m=t.pstyle("width").pfValue,x=t.pstyle("arrow-scale").value,y=this.r.getArrowWidth(m,x),_=this.instanceCount,w=this.transformBuffer.getMatrixView(_);w7(w),cp(w,w,[s,o]),g4(w,w,[y,y]),S7(w,w,l),this.vertTypeBuffer.getView(_)[0]=z2;var S=this.indexBuffer.getView(_);hc(n,S);var A=this.colorBuffer.getView(_);Bl(h,g,A),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(t,n){if(t.visible()){var i=this._getEdgePoints(t);if(i){var a=t.pstyle("opacity").value,s=t.pstyle("line-opacity").value,o=t.pstyle("width").pfValue,l=t.pstyle("line-color").value,c=a*s;if(i.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),i.length==4){var h=this.instanceCount;this.vertTypeBuffer.getView(h)[0]=E7;var d=this.indexBuffer.getView(h);hc(n,d);var v=this.colorBuffer.getView(h);Bl(l,c,v);var g=this.lineWidthBuffer.getView(h);g[0]=o;var m=this.pointAPointBBuffer.getView(h);m[0]=i[0],m[1]=i[1],m[2]=i[2],m[3]=i[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var x=0;x=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(t){var n=t._private.rscratch;return!(n.badLine||n.allpts==null||isNaN(n.allpts[0]))}},{key:"_getEdgePoints",value:function(t){var n=t._private.rscratch;if(this._isValidEdge(t)){var i=n.allpts;if(i.length==4)return i;var a=this._getNumSegments(t);return this._getCurveSegmentPoints(i,a)}}},{key:"_getNumSegments",value:function(t){var n=15;return Math.min(Math.max(n,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(t,n){if(t.length==4)return t;for(var i=Array((n+1)*2),a=0;a<=n;a++)if(a==0)i[0]=t[0],i[1]=t[1];else if(a==n)i[a*2]=t[t.length-2],i[a*2+1]=t[t.length-1];else{var s=a/n;this._setCurvePoint(t,s,i,a*2)}return i}},{key:"_setCurvePoint",value:function(t,n,i,a){if(t.length<=2)i[a]=t[0],i[a+1]=t[1];else{for(var s=Array(t.length-2),o=0;o0}},o=function(d){var v=d.pstyle("text-events").strValue==="yes";return v?Bp.USE_BB:Bp.IGNORE},l=function(d){var v=d.position(),g=v.x,m=v.y,x=d.outerWidth(),y=d.outerHeight();return{w:x,h:y,x1:g-x/2,y1:m-y/2}};t.drawing.addAtlasCollection("node",{texRows:r.webglTexRowsNodes}),t.drawing.addAtlasCollection("label",{texRows:r.webglTexRows}),t.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),t.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:l,isSimple:AV,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),t.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:s("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),t.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:l,isVisible:s("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),t.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:o,getKey:U2(e.getLabelKey,null),getBoundingBox:G2(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:i(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:a("label")}),t.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:o,getKey:U2(e.getSourceLabelKey,"source"),getBoundingBox:G2(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:i("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:a("source-label")}),t.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:o,getKey:U2(e.getTargetLabelKey,"target"),getBoundingBox:G2(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:i("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:a("target-label")});var c=Rd(function(){console.log("garbage collect flag set"),t.data.gc=!0},1e4);t.onUpdateEleCalcs(function(h,d){var v=!1;d&&d.length>0&&(v|=t.drawing.invalidate(d)),v&&c()}),WV(t)};function YV(r){var e=r.cy.container(),t=e&&e.style&&e.style.backgroundColor||"white";return z9(t)}function fO(r,e){var t=r._private.rscratch;return Ai(t,"labelWrapCachedLines",e)||[]}var U2=function(e,t){return function(n){var i=e(n),a=fO(n,t);return a.length>1?a.map(function(s,o){return"".concat(i,"_").concat(o)}):i}},G2=function(e,t){return function(n,i){var a=e(n);if(typeof i=="string"){var s=i.indexOf("_");if(s>0){var o=Number(i.substring(s+1)),l=fO(n,t),c=a.h/l.length,h=c*o,d=a.y1+h;return{x1:a.x1,w:a.w,y1:d,h:c,yOffset:h}}}return a}};function WV(r){{var e=r.render;r.render=function(a){a=a||{};var s=r.cy;r.webgl&&(s.zoom()>iO?($V(r),e.call(r,a)):(KV(r),vO(r,a,zf.SCREEN)))}}{var t=r.matchCanvasSize;r.matchCanvasSize=function(a){t.call(r,a),r.pickingFrameBuffer.setFramebufferAttachmentSizes(r.canvasWidth,r.canvasHeight),r.pickingFrameBuffer.needsDraw=!0}}r.findNearestElements=function(a,s,o,l){return rq(r,a,s)};{var n=r.invalidateCachedZSortedEles;r.invalidateCachedZSortedEles=function(){n.call(r),r.pickingFrameBuffer.needsDraw=!0}}{var i=r.notify;r.notify=function(a,s){i.call(r,a,s),a==="viewport"||a==="bounds"?r.pickingFrameBuffer.needsDraw=!0:a==="background"&&r.drawing.invalidate(s,{type:"node-body"})}}}function $V(r){var e=r.data.contexts[r.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function KV(r){var e=function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,r.canvasWidth,r.canvasHeight),n.restore()};e(r.data.contexts[r.NODE]),e(r.data.contexts[r.DRAG])}function ZV(r){var e=r.canvasWidth,t=r.canvasHeight,n=vw(r),i=n.pan,a=n.zoom,s=B2();cp(s,s,[i.x,i.y]),g4(s,s,[a,a]);var o=B2();kV(o,e,t);var l=B2();return LV(l,o,s),l}function dO(r,e){var t=r.canvasWidth,n=r.canvasHeight,i=vw(r),a=i.pan,s=i.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t,n),e.translate(a.x,a.y),e.scale(s,s)}function QV(r,e){r.drawSelectionRectangle(e,function(t){return dO(r,t)})}function JV(r){var e=r.data.contexts[r.NODE];e.save(),dO(r,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function eq(r){var e=function(i,a,s){for(var o=i.atlasManager.getAtlasCollection(a),l=r.data.contexts[r.NODE],c=o.atlases,h=0;h=0&&A.add(E)}return A}function rq(r,e,t){var n=tq(r,e,t),i=r.getCachedZSortedEles(),a,s,o=Ri(n),l;try{for(o.s();!(l=o.n()).done;){var c=l.value,h=i[c];if(!a&&h.isNode()&&(a=h),!s&&h.isEdge()&&(s=h),a&&s)break}}catch(d){o.e(d)}finally{o.f()}return[a,s].filter(Boolean)}function H2(r,e,t){var n=r.drawing;e+=1,t.isNode()?(n.drawNode(t,e,"node-underlay"),n.drawNode(t,e,"node-body"),n.drawTexture(t,e,"label"),n.drawNode(t,e,"node-overlay")):(n.drawEdgeLine(t,e),n.drawEdgeArrow(t,e,"source"),n.drawEdgeArrow(t,e,"target"),n.drawTexture(t,e,"label"),n.drawTexture(t,e,"edge-source-label"),n.drawTexture(t,e,"edge-target-label"))}function vO(r,e,t){var n;r.webglDebug&&(n=performance.now());var i=r.drawing,a=0;if(t.screen&&r.data.canvasNeedsRedraw[r.SELECT_BOX]&&QV(r,e),r.data.canvasNeedsRedraw[r.NODE]||t.picking){var s=r.data.contexts[r.WEBGL];t.screen?(s.clearColor(0,0,0,0),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA)):s.disable(s.BLEND),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.viewport(0,0,s.canvas.width,s.canvas.height);var o=ZV(r),l=r.getCachedZSortedEles();if(a=l.length,i.startFrame(o,t),t.screen){for(var c=0;c0&&s>0){g.clearRect(0,0,a,s),g.globalCompositeOperation="source-over";var m=this.getCachedZSortedEles();if(r.full)g.translate(-n.x1*c,-n.y1*c),g.scale(c,c),this.drawElements(g,m),g.scale(1/c,1/c),g.translate(n.x1*c,n.y1*c);else{var x=e.pan(),y={x:x.x*c,y:x.y*c};c*=e.zoom(),g.translate(y.x,y.y),g.scale(c,c),this.drawElements(g,m),g.scale(1/c,1/c),g.translate(-y.x,-y.y)}r.bg&&(g.globalCompositeOperation="destination-over",g.fillStyle=r.bg,g.rect(0,0,a,s),g.fill())}return v};function nq(r,e){for(var t=atob(r),n=new ArrayBuffer(t.length),i=new Uint8Array(n),a=0;a"u"?"undefined":On(OffscreenCanvas))!=="undefined")t=new OffscreenCanvas(r,e);else{var n=this.cy.window(),i=n.document;t=i.createElement("canvas"),t.width=r,t.height=e}return t};[sO,ls,$s,dw,_u,vl,vi,hO,pl,Ld,mO].forEach(function(r){Ct(zt,r)});var sq=[{name:"null",impl:XR},{name:"base",impl:rO},{name:"canvas",impl:iq}],oq=[{type:"layout",extensions:Pj},{type:"renderer",extensions:sq}],bO={},xO={};function _O(r,e,t){var n=t,i=function(O){fr("Can not register `"+e+"` for `"+r+"` since `"+O+"` already exists in the prototype and can not be overridden")};if(r==="core"){if(rd.prototype[e])return i(e);rd.prototype[e]=t}else if(r==="collection"){if(Wn.prototype[e])return i(e);Wn.prototype[e]=t}else if(r==="layout"){for(var a=function(O){this.options=O,t.call(this,O),Zt(this._private)||(this._private={}),this._private.cy=O.cy,this._private.listeners=[],this.createEmitter()},s=a.prototype=Object.create(t.prototype),o=[],l=0;lm&&(this.rect.x-=(this.labelWidth-m)/2,this.setWidth(this.labelWidth)),this.labelHeight>x&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-x)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-x),this.setHeight(this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(g){var m=this.rect.x;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var x=this.rect.y;x>l.WORLD_BOUNDARY?x=l.WORLD_BOUNDARY:x<-l.WORLD_BOUNDARY&&(x=-l.WORLD_BOUNDARY);var y=new h(m,x),_=g.inverseTransformPoint(y);this.setLocation(_.x,_.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},t.exports=d}),(function(t,n,i){function a(s,o){s==null&&o==null?(this.x=0,this.y=0):(this.x=s,this.y=o)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(s){this.x=s},a.prototype.setY=function(s){this.y=s},a.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},t.exports=a}),(function(t,n,i){var a=i(2),s=i(10),o=i(0),l=i(6),c=i(3),h=i(1),d=i(13),v=i(12),g=i(11);function m(y,_,w){a.call(this,w),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=y,_!=null&&_ instanceof l?this.graphManager=_:_!=null&&_ instanceof Layout&&(this.graphManager=_.graphManager)}m.prototype=Object.create(a.prototype);for(var x in a)m[x]=a[x];m.prototype.getNodes=function(){return this.nodes},m.prototype.getEdges=function(){return this.edges},m.prototype.getGraphManager=function(){return this.graphManager},m.prototype.getParent=function(){return this.parent},m.prototype.getLeft=function(){return this.left},m.prototype.getRight=function(){return this.right},m.prototype.getTop=function(){return this.top},m.prototype.getBottom=function(){return this.bottom},m.prototype.isConnected=function(){return this.isConnected},m.prototype.add=function(y,_,w){if(_==null&&w==null){var S=y;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(S)>-1)throw"Node already in graph!";return S.owner=this,this.getNodes().push(S),S}else{var A=y;if(!(this.getNodes().indexOf(_)>-1&&this.getNodes().indexOf(w)>-1))throw"Source or target not in graph!";if(!(_.owner==w.owner&&_.owner==this))throw"Both owners must be this graph!";return _.owner!=w.owner?null:(A.source=_,A.target=w,A.isInterGraph=!1,this.getEdges().push(A),_.edges.push(A),w!=_&&w.edges.push(A),A)}},m.prototype.remove=function(y){var _=y;if(y instanceof c){if(_==null)throw"Node is null!";if(!(_.owner!=null&&_.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var w=_.edges.slice(),S,A=w.length,C=0;C-1&&O>-1))throw"Source and/or target doesn't know this edge!";S.source.edges.splice(E,1),S.target!=S.source&&S.target.edges.splice(O,1);var M=S.source.owner.getEdges().indexOf(S);if(M==-1)throw"Not in owner's edge list!";S.source.owner.getEdges().splice(M,1)}},m.prototype.updateLeftTop=function(){for(var y=s.MAX_VALUE,_=s.MAX_VALUE,w,S,A,C=this.getNodes(),M=C.length,E=0;Ew&&(y=w),_>S&&(_=S)}return y==s.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?A=C[0].getParent().paddingLeft:A=this.margin,this.left=_-A,this.top=y-A,new v(this.left,this.top))},m.prototype.updateBounds=function(y){for(var _=s.MAX_VALUE,w=-s.MAX_VALUE,S=s.MAX_VALUE,A=-s.MAX_VALUE,C,M,E,O,D,I=this.nodes,k=I.length,U=0;UC&&(_=C),wE&&(S=E),AC&&(_=C),wE&&(S=E),A=this.nodes.length){var k=0;w.forEach(function(U){U.owner==y&&k++}),k==this.nodes.length&&(this.isConnected=!0)}},t.exports=m}),(function(t,n,i){var a,s=i(1);function o(l){a=i(5),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),c=this.layout.newNode(null),h=this.add(l,c);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,c,h,d,v){if(h==null&&d==null&&v==null){if(l==null)throw"Graph is null!";if(c==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(c.child!=null)throw"Already has a child!";return l.parent=c,c.child=l,l}else{v=h,d=c,h=l;var g=d.getOwner(),m=v.getOwner();if(!(g!=null&&g.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(m!=null&&m.getGraphManager()==this))throw"Target not in this graph mgr!";if(g==m)return h.isInterGraph=!1,g.add(h,d,v);if(h.isInterGraph=!0,h.source=d,h.target=v,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof a){var c=l;if(c.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(c==this.rootGraph||c.parent!=null&&c.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(c.getEdges());for(var d,v=h.length,g=0;g=l.getRight()?c[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(c[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?c[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(c[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var v=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(v=1);var g=v*c[0],m=c[1]/v;c[0]g)return c[0]=h,c[1]=x,c[2]=v,c[3]=I,!1;if(dv)return c[0]=m,c[1]=d,c[2]=O,c[3]=g,!1;if(hv?(c[0]=_,c[1]=w,X=!0):(c[0]=y,c[1]=x,X=!0):P===z&&(h>v?(c[0]=m,c[1]=x,X=!0):(c[0]=S,c[1]=w,X=!0)),-H===z?v>h?(c[2]=D,c[3]=I,W=!0):(c[2]=O,c[3]=E,W=!0):H===z&&(v>h?(c[2]=M,c[3]=E,W=!0):(c[2]=k,c[3]=I,W=!0)),X&&W)return!1;if(h>v?d>g?($=this.getCardinalDirection(P,z,4),B=this.getCardinalDirection(H,z,2)):($=this.getCardinalDirection(-P,z,3),B=this.getCardinalDirection(-H,z,1)):d>g?($=this.getCardinalDirection(-P,z,1),B=this.getCardinalDirection(-H,z,3)):($=this.getCardinalDirection(P,z,2),B=this.getCardinalDirection(H,z,4)),!X)switch($){case 1:Y=x,L=h+-C/z,c[0]=L,c[1]=Y;break;case 2:L=S,Y=d+A*z,c[0]=L,c[1]=Y;break;case 3:Y=w,L=h+C/z,c[0]=L,c[1]=Y;break;case 4:L=_,Y=d+-A*z,c[0]=L,c[1]=Y;break}if(!W)switch(B){case 1:re=E,G=v+-V/z,c[2]=G,c[3]=re;break;case 2:G=k,re=g+U*z,c[2]=G,c[3]=re;break;case 3:re=I,G=v+V/z,c[2]=G,c[3]=re;break;case 4:G=D,re=g+-U*z,c[2]=G,c[3]=re;break}}return!1},s.getCardinalDirection=function(o,l,c){return o>l?c:1+c%4},s.getIntersection=function(o,l,c,h){if(h==null)return this.getIntersection2(o,l,c);var d=o.x,v=o.y,g=l.x,m=l.y,x=c.x,y=c.y,_=h.x,w=h.y,S=void 0,A=void 0,C=void 0,M=void 0,E=void 0,O=void 0,D=void 0,I=void 0,k=void 0;return C=m-v,E=d-g,D=g*v-d*m,M=w-y,O=x-_,I=_*y-x*w,k=C*O-M*E,k===0?null:(S=(E*I-O*D)/k,A=(M*D-C*I)/k,new a(S,A))},s.angleOfVector=function(o,l,c,h){var d=void 0;return o!==c?(d=Math.atan((h-l)/(c-o)),c0?1:s<0?-1:0},a.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},a.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},t.exports=a}),(function(t,n,i){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,t.exports=a}),(function(t,n,i){var a=(function(){function d(v,g){for(var m=0;m"u"?"undefined":a(o);return o==null||l!="object"&&l!="function"},t.exports=s}),(function(t,n,i){function a(x){if(Array.isArray(x)){for(var y=0,_=Array(x.length);y0&&y;){for(C.push(E[0]);C.length>0&&y;){var O=C[0];C.splice(0,1),A.add(O);for(var D=O.getEdges(),S=0;S-1&&E.splice(V,1)}A=new Set,M=new Map}}return x},m.prototype.createDummyNodesForBendpoints=function(x){for(var y=[],_=x.source,w=this.graphManager.calcLowestCommonAncestor(x.source,x.target),S=0;S0){for(var w=this.edgeToDummyNodes.get(_),S=0;S=0&&y.splice(I,1);var k=M.getNeighborsList();k.forEach(function(X){if(_.indexOf(X)<0){var W=w.get(X),P=W-1;P==1&&O.push(X),w.set(X,P)}})}_=_.concat(O),(y.length==1||y.length==2)&&(S=!0,A=y[0])}return A},m.prototype.setGraphManager=function(x){this.graphManager=x},t.exports=m}),(function(t,n,i){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},t.exports=a}),(function(t,n,i){var a=i(4);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,c=this.lworldExtX;return c!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/c),l},s.prototype.transformY=function(o){var l=0,c=this.lworldExtY;return c!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/c),l},s.prototype.inverseTransformX=function(o){var l=0,c=this.ldeviceExtX;return c!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/c),l},s.prototype.inverseTransformY=function(o){var l=0,c=this.ldeviceExtY;return c!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/c),l},s.prototype.inverseTransformPoint=function(o){var l=new a(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},t.exports=s}),(function(t,n,i){function a(g){if(Array.isArray(g)){for(var m=0,x=Array(g.length);mo.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(g-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(g>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(g-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var g=this.getAllEdges(),m,x=0;x0&&arguments[0]!==void 0?arguments[0]:!0,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,x,y,_,w,S=this.getAllNodes(),A;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&g&&this.updateGrid(),A=new Set,x=0;xC||A>C)&&(g.gravitationForceX=-this.gravityConstant*_,g.gravitationForceY=-this.gravityConstant*w)):(C=m.getEstimatedSize()*this.compoundGravityRangeFactor,(S>C||A>C)&&(g.gravitationForceX=-this.gravityConstant*_*this.compoundGravityConstant,g.gravitationForceY=-this.gravityConstant*w*this.compoundGravityConstant))},d.prototype.isConverged=function(){var g,m=!1;return this.totalIterations>this.maxIterations/3&&(m=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),g=this.totalDisplacement=S.length||C>=S[0].length)){for(var M=0;Md}}]),c})();t.exports=l}),(function(t,n,i){var a=(function(){function l(c,h){for(var d=0;d2&&arguments[2]!==void 0?arguments[2]:1,v=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,g=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,l),this.sequence1=c,this.sequence2=h,this.match_score=d,this.mismatch_penalty=v,this.gap_penalty=g,this.iMax=c.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var m=0;m=0;c--){var h=this.listeners[c];h.event===o&&h.callback===l&&this.listeners.splice(c,1)}},s.emit=function(o,l){for(var c=0;ch.coolingFactor*h.maxNodeDisplacement&&(this.displacementX=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementX)),Math.abs(this.displacementY)>h.coolingFactor*h.maxNodeDisplacement&&(this.displacementY=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),h.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},l.prototype.propogateDisplacementToChildren=function(h,d){for(var v=this.getChild().getNodes(),g,m=0;m0)this.positionNodesRadially(E);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var O=new Set(this.getAllNodes()),D=this.nodesWithGravity.filter(function(I){return O.has(I)});this.graphManager.setAllNodesToApplyGravitation(D),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},C.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%v.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),O=this.nodesWithGravity.filter(function(k){return E.has(k)});this.graphManager.setAllNodesToApplyGravitation(O),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var D=!this.isTreeGrowing&&!this.isGrowthFinished,I=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(D,I),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},C.prototype.getPositionsData=function(){for(var E=this.graphManager.getAllNodes(),O={},D=0;D1){var X;for(X=0;XI&&(I=Math.floor(V.y)),U=Math.floor(V.x+d.DEFAULT_COMPONENT_SEPERATION)}this.transform(new x(g.WORLD_CENTER_X-V.x/2,g.WORLD_CENTER_Y-V.y/2))},C.radialLayout=function(E,O,D){var I=Math.max(this.maxDiagonalInTree(E),d.DEFAULT_RADIAL_SEPARATION);C.branchRadialLayout(O,null,0,359,0,I);var k=S.calculateBounds(E),U=new A;U.setDeviceOrgX(k.getMinX()),U.setDeviceOrgY(k.getMinY()),U.setWorldOrgX(D.x),U.setWorldOrgY(D.y);for(var V=0;V1;){var re=G[0];G.splice(0,1);var ie=z.indexOf(re);ie>=0&&z.splice(ie,1),L--,$--}O!=null?Y=(z.indexOf(G[0])+1)%L:Y=0;for(var le=Math.abs(I-D)/$,ce=Y;B!=$;ce=++ce%L){var _e=z[ce].getOtherEnd(E);if(_e!=O){var pe=(D+B*le)%360,ae=(pe+le)%360;C.branchRadialLayout(_e,E,pe,ae,k+U,U),B++}}},C.maxDiagonalInTree=function(E){for(var O=_.MIN_VALUE,D=0;DO&&(O=k)}return O},C.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},C.prototype.groupZeroDegreeMembers=function(){var E=this,O={};this.memberGroups={},this.idToDummyNode={};for(var D=[],I=this.graphManager.getAllNodes(),k=0;k"u"&&(O[X]=[]),O[X]=O[X].concat(U)}Object.keys(O).forEach(function(W){if(O[W].length>1){var P="DummyCompound_"+W;E.memberGroups[P]=O[W];var H=O[W][0].getParent(),z=new c(E.graphManager);z.id=P,z.paddingLeft=H.paddingLeft||0,z.paddingRight=H.paddingRight||0,z.paddingBottom=H.paddingBottom||0,z.paddingTop=H.paddingTop||0,E.idToDummyNode[P]=z;var $=E.getGraphManager().add(E.newGraph(),z),B=H.getChild();B.add(z);for(var L=0;L=0;E--){var O=this.compoundOrder[E],D=O.id,I=O.paddingLeft,k=O.paddingTop;this.adjustLocations(this.tiledMemberPack[D],O.rect.x,O.rect.y,I,k)}},C.prototype.repopulateZeroDegreeMembers=function(){var E=this,O=this.tiledZeroDegreePack;Object.keys(O).forEach(function(D){var I=E.idToDummyNode[D],k=I.paddingLeft,U=I.paddingTop;E.adjustLocations(O[D],I.rect.x,I.rect.y,k,U)})},C.prototype.getToBeTiled=function(E){var O=E.id;if(this.toBeTiled[O]!=null)return this.toBeTiled[O];var D=E.getChild();if(D==null)return this.toBeTiled[O]=!1,!1;for(var I=D.getNodes(),k=0;k0)return this.toBeTiled[O]=!1,!1;if(U.getChild()==null){this.toBeTiled[U.id]=!1;continue}if(!this.getToBeTiled(U))return this.toBeTiled[O]=!1,!1}return this.toBeTiled[O]=!0,!0},C.prototype.getNodeDegree=function(E){E.id;for(var O=E.getEdges(),D=0,I=0;IW&&(W=H.rect.height)}D+=W+E.verticalPadding}},C.prototype.tileCompoundMembers=function(E,O){var D=this;this.tiledMemberPack=[],Object.keys(E).forEach(function(I){var k=O[I];D.tiledMemberPack[I]=D.tileNodes(E[I],k.paddingLeft+k.paddingRight),k.rect.width=D.tiledMemberPack[I].width,k.rect.height=D.tiledMemberPack[I].height})},C.prototype.tileNodes=function(E,O){var D=d.TILING_PADDING_VERTICAL,I=d.TILING_PADDING_HORIZONTAL,k={rows:[],rowWidth:[],rowHeight:[],width:0,height:O,verticalPadding:D,horizontalPadding:I};E.sort(function(X,W){return X.rect.width*X.rect.height>W.rect.width*W.rect.height?-1:X.rect.width*X.rect.height0&&(V+=E.horizontalPadding),E.rowWidth[D]=V,E.width0&&(X+=E.verticalPadding);var W=0;X>E.rowHeight[D]&&(W=E.rowHeight[D],E.rowHeight[D]=X,W=E.rowHeight[D]-W),E.height+=W,E.rows[D].push(O)},C.prototype.getShortestRowIndex=function(E){for(var O=-1,D=Number.MAX_VALUE,I=0;ID&&(O=I,D=E.rowWidth[I]);return O},C.prototype.canAddHorizontal=function(E,O,D){var I=this.getShortestRowIndex(E);if(I<0)return!0;var k=E.rowWidth[I];if(k+E.horizontalPadding+O<=E.width)return!0;var U=0;E.rowHeight[I]0&&(U=D+E.verticalPadding-E.rowHeight[I]);var V;E.width-k>=O+E.horizontalPadding?V=(E.height+U)/(k+O+E.horizontalPadding):V=(E.height+U)/E.width,U=D+E.verticalPadding;var X;return E.widthU&&O!=D){I.splice(-1,1),E.rows[D].push(k),E.rowWidth[O]=E.rowWidth[O]-U,E.rowWidth[D]=E.rowWidth[D]+U,E.width=E.rowWidth[instance.getLongestRowIndex(E)];for(var V=Number.MIN_VALUE,X=0;XV&&(V=I[X].height);O>0&&(V+=E.verticalPadding);var W=E.rowHeight[O]+E.rowHeight[D];E.rowHeight[O]=V,E.rowHeight[D]0)for(var B=k;B<=U;B++)$[0]+=this.grid[B][V-1].length+this.grid[B][V].length-1;if(U0)for(var B=V;B<=X;B++)$[3]+=this.grid[k-1][B].length+this.grid[k][B].length-1;for(var L=_.MAX_VALUE,Y,G,re=0;re<$.length;re++)$[re]0){var X;X=A.getGraphManager().add(A.newGraph(),D),this.processChildrenList(X,O,A)}}},x.prototype.stop=function(){return this.stopped=!0,this};var _=function(S){S("layout","cose-bilkent",x)};typeof cytoscape<"u"&&_(cytoscape),n.exports=_})])})})(hp)),hp.exports}var mq=gq();const yq=cl(mq),Uo={七年级:{代数与方程:[{code:"J7-EQ-001",name:"一元一次方程"},{code:"J7-EQ-002",name:"二元一次方程组"}],几何基础:[{code:"J7-GEO-001",name:"线段与角"},{code:"J7-GEO-002",name:"相交线与平行线"}]},八年级:{代数与函数:[{code:"J8-FUNC-001",name:"一次函数"},{code:"J8-ROOT-001",name:"二次根式"}],几何证明:[{code:"J8-GEO-001",name:"全等三角形"},{code:"J8-GEO-002",name:"轴对称"}]},九年级:{代数进阶:[{code:"J9-EQ-001",name:"一元二次方程"},{code:"J9-FUNC-001",name:"二次函数"}],圆与统计:[{code:"J9-CIRCLE-001",name:"圆的基本性质"},{code:"J9-STAT-001",name:"概率初步"}]}},bq={display:"flex",flexDirection:"column",gap:10},xq={marginTop:8,display:"flex",justifyContent:"flex-end"},_q={display:"flex",gap:8,alignItems:"center",flexWrap:"nowrap"},pv={height:40},df={height:40,minWidth:92};function j2(r){var n;const e=(r||"").trim();if(!e)return{label:""};const t=e.match(/^(?.*?)[((]\s*(?[^))]+)\s*[))]\s*$/);if((n=t==null?void 0:t.groups)!=null&&n.code){const i=String(t.groups.code).trim();return{label:String(t.groups.name||"").trim()||e,code:i}}return{label:e}}function wq(r){const e=[],t=[],n="category",i="center";e.push({id:n,kind:"category",label:`类别:${r.category}`}),e.push({id:i,kind:"center",label:r.centerName||r.centerCode,code:r.centerCode}),t.push({id:"e_cat_center",from:n,to:i,label:"CONTAINS"});const a=(r.prerequisites||[]).slice(0,10),s=(r.next_steps||[]).slice(0,10),o=(r.related||[]).slice(0,12);return a.forEach((l,c)=>{const h=j2(l),d=`prereq_${c}`;e.push({id:d,kind:"prereq",label:h.label||l,code:h.code}),t.push({id:`e_${d}_center`,from:d,to:i,label:"PREREQUISITE"})}),s.forEach((l,c)=>{const h=j2(l),d=`next_${c}`;e.push({id:d,kind:"next",label:h.label||l,code:h.code}),t.push({id:`e_center_${d}`,from:i,to:d,label:"PREREQUISITE"})}),o.forEach((l,c)=>{const h=j2(l),d=`related_${c}`;e.push({id:d,kind:"related",label:h.label||l,code:h.code}),t.push({id:`e_cat_${d}`,from:n,to:d,label:"CONTAINS"})}),{nodes:e,edges:t}}tl.use(yq);function Sq(r){const{nodes:e,edges:t}=wq(r),n=[];for(const i of e)n.push({data:{id:i.id,label:i.code?`${i.label} (${i.code})`:i.label,kind:i.kind,code:i.code||""}});for(const i of t)n.push({data:{id:i.id,source:i.from,target:i.to,label:i.label}});return n}function Eq({preview:r,onSelectCode:e}){const t=he.useRef(null),n=he.useRef(null),i=he.useRef(null),[a,s]=he.useState(!1),o=he.useMemo(()=>Sq(r),[r]),l=he.useCallback(()=>{const d=i.current;d&&(d.resize(),d.fit(void 0,40))},[]);he.useEffect(()=>{const d=()=>{const v=document.fullscreenElement===t.current;s(v),requestAnimationFrame(()=>l())};return document.addEventListener("fullscreenchange",d),()=>document.removeEventListener("fullscreenchange",d)},[l]),he.useEffect(()=>{if(!n.current||i.current)return;const d=tl({container:n.current,elements:[],style:[{selector:"node",style:{label:"data(label)","text-wrap":"wrap","text-max-width":"110px","text-valign":"center","text-halign":"center","font-size":"11px",color:"#111827","background-color":"#ffffff","border-color":"#e5e7eb","border-width":1,shape:"ellipse",width:"44px",height:"44px"}},{selector:'node[kind = "category"]',style:{"background-color":"#eff6ff","border-color":"#bfdbfe"}},{selector:'node[kind = "center"]',style:{"background-color":"#eef2ff","border-color":"#c7d2fe",width:"56px",height:"56px","font-size":"12px"}},{selector:'node[kind = "prereq"]',style:{"background-color":"#fffbeb","border-color":"#fde68a"}},{selector:'node[kind = "next"]',style:{"background-color":"#f0fdf4","border-color":"#bbf7d0"}},{selector:"edge",style:{width:1.5,"line-color":"#94a3b8","target-arrow-color":"#94a3b8","target-arrow-shape":"triangle","curve-style":"bezier",label:"data(label)","font-size":"9px","text-rotation":"autorotate",color:"#64748b","text-background-color":"#ffffff","text-background-opacity":.8,"text-background-padding":"2px"}}],layout:{name:"preset"},wheelSensitivity:.15});return d.on("tap","node",v=>{const g=String(v.target.data("code")||"").trim();g&&e(g)}),i.current=d,()=>{d.destroy(),i.current=null}},[e]),he.useEffect(()=>{const d=i.current;d&&(d.elements().remove(),d.add(o),d.layout({name:"cose-bilkent",animate:!0,fit:!0,padding:30,nodeRepulsion:9e3,idealEdgeLength:120,edgeElasticity:.25,gravity:.25,numIter:800}).run())},[o]);async function c(){const d=t.current;if(d)try{await d.requestFullscreen()}catch{}}async function h(){if(document.fullscreenElement)try{await document.exitFullscreen()}catch{}}return N.jsxs("div",{ref:t,style:{display:"flex",flexDirection:"column",gap:8,width:"100%",background:a?"#ffffff":void 0},children:[N.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,flexWrap:"wrap"},children:[N.jsxs("span",{className:"muted",style:{fontSize:12},children:["图关系预览",a?"(全屏 · 点击节点可切换中心 · Esc 退出)":""]}),N.jsx("button",{type:"button",className:"btn",style:{padding:"6px 12px",fontSize:13},onClick:()=>a?void h():void c(),children:a?"退出全屏":"全屏"})]}),N.jsx("div",{ref:n,style:{flex:a?1:void 0,height:a?void 0:420,minHeight:a?0:420,width:"100%",border:"1px solid #e5e7eb",borderRadius:12,background:"#ffffff"}})]})}function Tq(){var ee,se,Pe,Ae,Ge;const[r,e]=he.useState(Uo),t=Object.keys(r),[n,i]=he.useState(t[0]),[a,s]=he.useState(Object.keys(r[t[0]])[0]),[o,l]=he.useState(r[t[0]][Object.keys(r[t[0]])[0]][0].code),[c,h]=he.useState(o),[d,v]=he.useState(""),[g,m]=he.useState(""),[x,y]=he.useState(""),[_,w]=he.useState(null),[S,A]=he.useState(null),[C,M]=he.useState(!1),{role:E}=bu(),[O,D]=he.useState(!1),[I,k]=he.useState(""),[U,V]=he.useState(""),[X,W]=he.useState(""),[P,H]=he.useState(""),z=E==="teacher",[$,B]=he.useState(null),[L,Y]=he.useState(""),[G,re]=he.useState(""),[ie,le]=he.useState(t[0]||""),[ce,_e]=he.useState(Object.keys(r[t[0]]||{})[0]||""),[pe,ae]=he.useState(t[0]||""),[oe,de]=he.useState(Object.keys(r[t[0]]||{})[0]||"");async function ye(J,Oe){const Ve=(J||"").trim();if(Ve){w(null),A(null),M(!0);try{const Ue=await f1(Ve);y(JSON.stringify(Ue,null,2)),h(Ve),B({grade:Ue.grade||n,category:Ue.category||a,centerName:Ue.name||Oe||Ve,centerCode:Ue.knowledge_code||Ve,related:Ue.related||[],prerequisites:Ue.prerequisites||[],next_steps:Ue.next_steps||[]})}catch(Ue){w(Ue instanceof Error?Ue.message:"查询失败")}finally{M(!1)}}}function Ee(J){return J.includes("七")?"J7":J.includes("八")?"J8":J.includes("九")?"J9":"JX"}function Re(J){return J.includes("方程")||J.includes("代数")?"EQ":J.includes("函数")?"FUNC":J.includes("几何")?"GEO":J.includes("圆")?"CIRCLE":J.includes("统计")||J.includes("概率")?"STAT":"GEN"}function Ne(J){return J.replace(/\s+/g,"")||"知识点"}function Be(J,Oe,Ve,Ue){const je=String(Ue).padStart(3,"0");return`${Ee(J)}-${Re(Oe)}-${je}-${Ne(Ve)}`}const $e=((ee=r[n])==null?void 0:ee[a])||[],Ye=$e.find(J=>J.code===o),He=Be(n,a,g||(Ye==null?void 0:Ye.name)||"知识点",($e.length||0)+1),tt=((se=r[ie])==null?void 0:se[ce])||[],ot=((Pe=r[pe])==null?void 0:Pe[oe])||[],ct=Object.keys(r[n]||{}),Ze=((Ae=r[n])==null?void 0:Ae[I])||[];async function bt(){try{const J=await H_();J&&Object.keys(J).length&&e(J)}catch{}}he.useEffect(()=>{bt()},[]),he.useEffect(()=>{const J=Object.keys(r[ie]||{});J.length&&!J.includes(ce)&&_e(J[0]||"");const Oe=Object.keys(r[pe]||{});Oe.length&&!Oe.includes(oe)&&de(Oe[0]||"")},[r,ie,ce,pe,oe]),he.useEffect(()=>{var Ve,Ue,je,yt,vt;const J=((Ve=r[ie])==null?void 0:Ve[ce])||[];J.some(Ot=>Ot.code===L)||Y(((Ue=J[0])==null?void 0:Ue.code)||"");const Oe=((je=r[pe])==null?void 0:je[oe])||[];Oe.some(Ot=>Ot.code===G)||re(((yt=Oe[1])==null?void 0:yt.code)||((vt=Oe[0])==null?void 0:vt.code)||"")},[r,ie,ce,pe,oe,L,G]),he.useEffect(()=>{const J=Object.keys(r);!J.includes(n)&&J[0]&&i(J[0])},[r,n]),he.useEffect(()=>{const J=Object.keys(r[n]||{});J.includes(a)||s(J[0]||"")},[r,n,a]),he.useEffect(()=>{var Oe,Ve;const J=((Oe=r[n])==null?void 0:Oe[a])||[];J.some(Ue=>Ue.code===o)||l(((Ve=J[0])==null?void 0:Ve.code)||"")},[r,n,a,o]),he.useEffect(()=>{var Ue,je;if(!O)return;const J=Object.keys(r[n]||{})[0]||"",Oe=I&&((Ue=r[n])!=null&&Ue[I]?I:J);k(Oe),V(Oe);const Ve=(((je=r[n])==null?void 0:je[Oe])||[])[0];W((Ve==null?void 0:Ve.code)||""),H((Ve==null?void 0:Ve.name)||"")},[O,r,n]),he.useEffect(()=>{var Oe;if(!O)return;const J=(((Oe=r[n])==null?void 0:Oe[I])||[]).find(Ve=>Ve.code===X);H((J==null?void 0:J.name)||"")},[O,r,n,I,X]),he.useEffect(()=>{O&&I&&V(I)},[O,I]),he.useEffect(()=>{var Oe;const J=(((Oe=r[n])==null?void 0:Oe[a])||[]).find(Ve=>Ve.code===o);J&&h(J.code)},[r,n,a,o]);async function Se(){var jt,Nr;w(null),A(null);const J=d.trim(),Oe=g.trim(),Ve=!!J,Ue=!!Oe;if(!Ve&&!Ue){w("请至少输入类别或具体知识点");return}if(!Ve&&Ue&&!a){w("请先选择类别");return}const je=Ve?J:a;if(!je){w("请先选择或输入类别");return}if(Ve&&((jt=r[n])!=null&&jt[je])){w("该类别已存在");return}const yt=Ve?[]:((Nr=r[n])==null?void 0:Nr[je])||[],vt=Ue?{code:Be(n,je,Oe,yt.length+1),name:Oe}:null;if(e(Vt=>{const Qt=Vt[n]||{},rr=Ve?[]:Qt[je]||[],ur=vt?[...rr,vt]:rr;return{...Vt,[n]:{...Qt,[je]:ur}}}),Ve&&(s(je),v("")),vt){l(vt.code),h(vt.code),m("");try{const Vt=await QT(vt.code,vt.name,n,je);y(JSON.stringify(Vt,null,2))}catch(Vt){w(Vt instanceof Error?Vt.message:"新增后写入图谱失败")}}const Ot=[];Ve&&Ot.push("已添加类别"),Ue&&Ot.push("已添加具体知识点"),A(Ot.join(","))}async function ke(){var Ue,je;const J=U.trim();if(!J){w("类别名称不能为空");return}if(J===I){A("类别名称未变化");return}if((Ue=r[n])!=null&&Ue[J]){w("目标类别已存在");return}const Oe=I;M(!0);try{await oF(n,Oe,J)}catch(yt){w(yt instanceof Error?yt.message:"修改类别失败"),M(!1);return}const Ve=((je=r[n])==null?void 0:je[Oe])||[];e(yt=>{const vt={...yt[n]||{}};return delete vt[Oe],vt[J]=Ve,{...yt,[n]:vt}}),s(J),k(J),V(J),A(`已将类别“${Oe}”修改为“${J}”`),w(null),M(!1)}async function We(){const J=I.trim();if(!J)return;const Oe=Object.keys(r[n]||{});if(Oe.length<=1){w("至少保留一个类别,无法删除");return}M(!0);try{await lF(n,J)}catch(Ue){w(Ue instanceof Error?Ue.message:"删除类别失败"),M(!1);return}e(Ue=>{const je={...Ue[n]||{}};return delete je[J],{...Ue,[n]:je}});const Ve=Oe.find(Ue=>Ue!==J)||"";s(Ve),k(Ve),A(`已删除类别:${J}`),w(null),M(!1)}async function Ke(){const J=P.trim();if(!J||!X){w("请先选择知识点并填写名称");return}M(!0);try{await uF(X,J)}catch(Oe){w(Oe instanceof Error?Oe.message:"修改知识点失败"),M(!1);return}e(Oe=>{const Ve={...Oe[n]||{}},Ue=[...Ve[I]||[]],je=Ue.findIndex(yt=>yt.code===X);return je>=0&&(Ue[je]={...Ue[je],name:J}),Ve[I]=Ue,{...Oe,[n]:Ve}}),A("已修改具体知识点名称"),w(null),M(!1)}async function rt(){if(!X){w("请先选择具体知识点");return}M(!0);try{await cF(X)}catch(J){w(J instanceof Error?J.message:"删除知识点失败"),M(!1);return}e(J=>{const Oe={...J[n]||{}},Ve=[...Oe[I]||[]];return Oe[I]=Ve.filter(Ue=>Ue.code!==X),{...J,[n]:Oe}}),W(""),H(""),A("已删除具体知识点"),w(null),M(!1)}async function nt(){await ye(c,Ye==null?void 0:Ye.name)}async function De(){w(null),A(null),M(!0);try{const J=await QT(c,(Ye==null?void 0:Ye.name)||"未命名知识点",n,a);y(JSON.stringify(J,null,2)),B({grade:J.grade||n,category:J.category||a,centerName:J.name||(Ye==null?void 0:Ye.name)||c,centerCode:J.knowledge_code||c,related:J.related||[],prerequisites:J.prerequisites||[],next_steps:J.next_steps||[]}),await bt()}catch(J){w(J instanceof Error?J.message:"写入失败(需要teacher权限)")}finally{M(!1)}}async function Q(){w(null),A(null),M(!0);try{const J=await iF();y(JSON.stringify(J,null,2)),A(`已同步默认知识点目录到 Neo4j:共 ${J.upserted} 条(可重复执行)`),await bt()}catch(J){w(J instanceof Error?J.message:"同步失败(需要 teacher 权限且 Neo4j 可用)")}finally{M(!1)}}async function ne(){w(null),A(null),M(!0);try{await aF(L,G),A(`已建立递进关系:必须先掌握「${L}」再学「${G}」`);const J=await f1(G);y(JSON.stringify(J,null,2)),B({grade:J.grade||n,category:J.category||a,centerName:J.name||c,centerCode:J.knowledge_code||G,related:J.related||[],prerequisites:J.prerequisites||[],next_steps:J.next_steps||[]}),await bt()}catch(J){w(J instanceof Error?J.message:"建立递进关系失败")}finally{M(!1)}}async function be(){w(null),A(null),M(!0);try{const J=await sF(L,G);A(J.deleted?"已解除该递进关系":"图中不存在该递进关系(可能已删除)");const Oe=await f1(G);y(JSON.stringify(Oe,null,2)),B({grade:Oe.grade||n,category:Oe.category||a,centerName:Oe.name||c,centerCode:Oe.knowledge_code||G,related:Oe.related||[],prerequisites:Oe.prerequisites||[],next_steps:Oe.next_steps||[]}),await bt()}catch(J){w(J instanceof Error?J.message:"解除失败")}finally{M(!1)}}return N.jsxs("div",{className:"grid",children:[N.jsx("div",{className:"col-12",children:N.jsxs("div",{className:"card",style:{height:"100%"},children:[N.jsx("div",{className:"card-header",children:N.jsx("div",{style:{fontSize:16,fontWeight:800},children:"知识图谱查询与维护"})}),N.jsxs("div",{className:"card-body",style:{...bq,minHeight:z?260:0},children:[N.jsxs("div",{className:"row",style:{alignItems:"flex-end",gap:8,flexWrap:"nowrap"},children:[N.jsxs("div",{style:{flex:.9,minWidth:96},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"年级"}),N.jsx("select",{className:"select",value:n,onChange:J=>i(J.target.value),children:t.map(J=>N.jsx("option",{value:J,children:J},J))})]}),N.jsxs("div",{style:{flex:1.05,minWidth:118},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"类别"}),N.jsx("select",{className:"select",value:a,onChange:J=>s(J.target.value),children:Object.keys(r[n]||{}).map(J=>N.jsx("option",{value:J,children:J},J))})]}),N.jsxs("div",{style:{flex:1.55,minWidth:176},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"具体知识点"}),N.jsx("select",{className:"select",value:o,onChange:J=>l(J.target.value),children:(((Ge=r[n])==null?void 0:Ge[a])||[]).map(J=>N.jsx("option",{value:J.code,children:J.name},J.code))})]})]}),z?N.jsxs(N.Fragment,{children:[N.jsxs("div",{className:"row",style:{alignItems:"flex-end",gap:8,flexWrap:"nowrap",marginTop:2},children:[N.jsxs("div",{style:{flex:1.05,minWidth:176},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"添加类别"}),N.jsx("div",{className:"row",style:{gap:8},children:N.jsx("input",{className:"input",style:{flex:1,height:42,paddingTop:0,paddingBottom:0},value:d,onChange:J=>v(J.target.value),placeholder:"输入新类别名称"})})]}),N.jsxs("div",{style:{flex:1.2,minWidth:196},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"添加具体知识点"}),N.jsx("div",{className:"row",style:{gap:8},children:N.jsx("input",{className:"input",style:{flex:1,height:42,paddingTop:0,paddingBottom:0},value:g,onChange:J=>m(J.target.value),placeholder:"如:一元一次不等式"})})]}),N.jsx("div",{style:{width:72,minWidth:72},children:N.jsx("button",{className:"btn",style:{width:"100%",height:42,padding:0,lineHeight:"42px",boxSizing:"border-box"},onClick:Se,disabled:C,children:"添加"})})]}),N.jsxs("div",{style:{marginTop:4},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"知识点编码(自动生成:年级码-类别码-序号-知识点名称)"}),N.jsx("input",{className:"input",value:He,readOnly:!0})]})]}):N.jsxs("div",{style:{marginBottom:10},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"知识点编码"}),N.jsx("input",{className:"input",value:c,readOnly:!0})]}),z?null:N.jsxs("div",{className:"row",style:{marginTop:4,justifyContent:"space-between",alignItems:"center",gap:8,flexWrap:"nowrap"},children:[N.jsx("div",{className:"muted",style:{fontSize:12},children:"当前为学生账号:仅可查询知识点。"}),N.jsx("button",{className:"btn",onClick:nt,disabled:C,children:"查询"})]}),_?N.jsx("div",{className:"error",style:{marginTop:12},children:_}):null,S?N.jsx("div",{className:"success",style:{marginTop:12},children:S}):null,N.jsxs("div",{style:{...xq,justifyContent:"space-between"},children:[N.jsx("div",{children:z?N.jsx("button",{className:"btn",onClick:()=>D(!0),disabled:C,children:"修改"}):null}),N.jsxs("div",{style:_q,children:[z?N.jsx("button",{className:"btn",onClick:nt,disabled:C,children:"查询"}):null,z?N.jsx("button",{className:"btn",type:"button",onClick:Q,disabled:C,children:"同步默认目录到 Neo4j"}):null,z?N.jsx("button",{className:"btn primary",onClick:De,disabled:C,children:"写入/更新"}):null]})]})]})]})}),z?N.jsx("div",{className:"col-12",children:N.jsxs("div",{className:"card",children:[N.jsx("div",{className:"card-header",children:N.jsx("div",{style:{fontSize:16,fontWeight:800},children:"递进关系(手动连边)"})}),N.jsxs("div",{className:"card-body",style:{display:"flex",flexDirection:"column",gap:12},children:[!tt.length||!ot.length?N.jsx("div",{className:"muted",style:{fontSize:12},children:"当前所选年级/类别下知识点为空。先「同步默认目录到 Neo4j」或在知识图谱里先「写入/更新」对应知识点。"}):null,N.jsxs("div",{className:"row",style:{alignItems:"flex-end",gap:10,flexWrap:"wrap"},children:[N.jsxs("div",{style:{flex:1,minWidth:200},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"前置"}),N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"年级"}),N.jsx("select",{className:"select",value:ie,onChange:J=>le(J.target.value),children:Object.keys(r).map(J=>N.jsx("option",{value:J,children:J},J))}),N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6,marginTop:8},children:"类别"}),N.jsx("select",{className:"select",value:ce,onChange:J=>_e(J.target.value),children:Object.keys(r[ie]||{}).map(J=>N.jsx("option",{value:J,children:J},J))}),N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6,marginTop:8},children:"具体知识点"}),N.jsx("select",{className:"select",value:L,onChange:J=>Y(J.target.value),disabled:!tt.length,children:tt.map(J=>N.jsxs("option",{value:J.code,children:[(J.name||J.code).trim(),"(",J.code,")"]},J.code))})]}),N.jsxs("div",{style:{flex:1,minWidth:200},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"后置"}),N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"年级"}),N.jsx("select",{className:"select",value:pe,onChange:J=>ae(J.target.value),children:Object.keys(r).map(J=>N.jsx("option",{value:J,children:J},J))}),N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6,marginTop:8},children:"类别"}),N.jsx("select",{className:"select",value:oe,onChange:J=>de(J.target.value),children:Object.keys(r[pe]||{}).map(J=>N.jsx("option",{value:J,children:J},J))}),N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6,marginTop:8},children:"具体知识点"}),N.jsx("select",{className:"select",value:G,onChange:J=>re(J.target.value),disabled:!ot.length,children:ot.map(J=>N.jsxs("option",{value:J.code,children:[(J.name||J.code).trim(),"(",J.code,")"]},J.code))})]})]}),N.jsxs("div",{className:"row",style:{gap:8,justifyContent:"flex-end"},children:[N.jsx("button",{className:"btn primary",type:"button",onClick:ne,disabled:C||!L||!G||L===G,children:"建立递进关系"}),N.jsx("button",{className:"btn",type:"button",onClick:be,disabled:C||!L||!G,children:"解除递进关系"})]})]})]})}):null,N.jsx("div",{className:"col-12",children:N.jsxs("div",{className:"card",children:[N.jsxs("div",{className:"card-header",children:[N.jsx("div",{style:{fontSize:16,fontWeight:800},children:"效果预览"}),N.jsx("div",{className:"muted",style:{marginTop:6},children:"展示查询与写入的返回数据"})]}),N.jsx("div",{className:"card-body",children:N.jsx("div",{style:{marginBottom:12,border:"1px solid #e5e7eb",borderRadius:10,padding:10,background:"#fafafa"},children:$?N.jsx(Eq,{preview:$,onSelectCode:J=>void ye(J)}):N.jsx("div",{className:"muted",style:{fontSize:12},children:"暂无预览数据"})})})]})}),O?N.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(17,24,39,0.35)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},onClick:()=>D(!1),children:N.jsxs("div",{className:"card",style:{width:640,maxWidth:"92vw"},onClick:J=>J.stopPropagation(),children:[N.jsx("div",{className:"card-header",children:N.jsx("div",{style:{fontSize:16,fontWeight:800},children:"修改类别与具体知识点"})}),N.jsxs("div",{className:"card-body",style:{display:"flex",flexDirection:"column",gap:12},children:[N.jsxs("div",{className:"row",style:{alignItems:"flex-end",gap:10},children:[N.jsxs("div",{style:{flex:1},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"选择类别"}),N.jsx("select",{className:"select",style:pv,value:I,onChange:J=>k(J.target.value),children:ct.map(J=>N.jsx("option",{value:J,children:J},J))})]}),N.jsxs("div",{style:{flex:1},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"类别新名称"}),N.jsx("input",{className:"input",style:pv,value:U,onChange:J=>V(J.target.value)})]}),N.jsx("button",{className:"btn",style:df,onClick:ke,children:"修改类别"}),N.jsx("button",{className:"btn danger",style:df,onClick:We,children:"删除类别"})]}),N.jsxs("div",{className:"row",style:{alignItems:"flex-end",gap:10},children:[N.jsxs("div",{style:{flex:1},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"选择具体知识点"}),N.jsxs("select",{className:"select",style:pv,value:X,onChange:J=>W(J.target.value),children:[N.jsx("option",{value:"",children:"请选择"}),Ze.map(J=>N.jsx("option",{value:J.code,children:J.name},J.code))]})]}),N.jsxs("div",{style:{flex:1},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"具体知识点新名称"}),N.jsx("input",{className:"input",style:pv,value:P,onChange:J=>H(J.target.value)})]}),N.jsx("button",{className:"btn",style:df,onClick:Ke,children:"修改知识点"}),N.jsx("button",{className:"btn danger",style:df,onClick:rt,children:"删除知识点"})]}),N.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:N.jsx("button",{className:"btn",style:df,onClick:()=>D(!1),children:"关闭"})})]})]})}):null]})}function Cq(r){var e=this.constructor;return this.then(function(t){return e.resolve(r()).then(function(){return t})},function(t){return e.resolve(r()).then(function(){return e.reject(t)})})}function Aq(r){var e=this;return new e(function(t,n){if(!(r&&typeof r.length<"u"))return n(new TypeError(typeof r+" "+r+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var i=Array.prototype.slice.call(r);if(i.length===0)return t([]);var a=i.length;function s(l,c){if(c&&(typeof c=="object"||typeof c=="function")){var h=c.then;if(typeof h=="function"){h.call(c,function(d){s(l,d)},function(d){i[l]={status:"rejected",reason:d},--a===0&&t(i)});return}}i[l]={status:"fulfilled",value:c},--a===0&&t(i)}for(var o=0;o"u"&&(typeof self<"u"?self.globalThis=self:typeof global<"u"&&(global.globalThis=global));globalThis.Promise||(globalThis.Promise=tn);Object.assign||(Object.assign=Lq);var kq=16;Date.now&&Date.prototype.getTime||(Date.now=function(){return new Date().getTime()});if(!(globalThis.performance&&globalThis.performance.now)){var Bq=Date.now();globalThis.performance||(globalThis.performance={}),globalThis.performance.now=function(){return Date.now()-Bq}}var q2=Date.now(),I7=["ms","moz","webkit","o"];for(var X2=0;X20?1:-1});Number.isInteger||(Number.isInteger=function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e});globalThis.ArrayBuffer||(globalThis.ArrayBuffer=Array);globalThis.Float32Array||(globalThis.Float32Array=Array);globalThis.Uint32Array||(globalThis.Uint32Array=Array);globalThis.Uint16Array||(globalThis.Uint16Array=Array);globalThis.Uint8Array||(globalThis.Uint8Array=Array);globalThis.Int32Array||(globalThis.Int32Array=Array);/*! * @pixi/constants - v6.5.10 * Compiled Thu, 06 Jul 2023 15:25:11 UTC * * @pixi/constants is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license */var ns;(function(r){r[r.WEBGL_LEGACY=0]="WEBGL_LEGACY",r[r.WEBGL=1]="WEBGL",r[r.WEBGL2=2]="WEBGL2"})(ns||(ns={}));var Gc;(function(r){r[r.UNKNOWN=0]="UNKNOWN",r[r.WEBGL=1]="WEBGL",r[r.CANVAS=2]="CANVAS"})(Gc||(Gc={}));var ad;(function(r){r[r.COLOR=16384]="COLOR",r[r.DEPTH=256]="DEPTH",r[r.STENCIL=1024]="STENCIL"})(ad||(ad={}));var Et;(function(r){r[r.NORMAL=0]="NORMAL",r[r.ADD=1]="ADD",r[r.MULTIPLY=2]="MULTIPLY",r[r.SCREEN=3]="SCREEN",r[r.OVERLAY=4]="OVERLAY",r[r.DARKEN=5]="DARKEN",r[r.LIGHTEN=6]="LIGHTEN",r[r.COLOR_DODGE=7]="COLOR_DODGE",r[r.COLOR_BURN=8]="COLOR_BURN",r[r.HARD_LIGHT=9]="HARD_LIGHT",r[r.SOFT_LIGHT=10]="SOFT_LIGHT",r[r.DIFFERENCE=11]="DIFFERENCE",r[r.EXCLUSION=12]="EXCLUSION",r[r.HUE=13]="HUE",r[r.SATURATION=14]="SATURATION",r[r.COLOR=15]="COLOR",r[r.LUMINOSITY=16]="LUMINOSITY",r[r.NORMAL_NPM=17]="NORMAL_NPM",r[r.ADD_NPM=18]="ADD_NPM",r[r.SCREEN_NPM=19]="SCREEN_NPM",r[r.NONE=20]="NONE",r[r.SRC_OVER=0]="SRC_OVER",r[r.SRC_IN=21]="SRC_IN",r[r.SRC_OUT=22]="SRC_OUT",r[r.SRC_ATOP=23]="SRC_ATOP",r[r.DST_OVER=24]="DST_OVER",r[r.DST_IN=25]="DST_IN",r[r.DST_OUT=26]="DST_OUT",r[r.DST_ATOP=27]="DST_ATOP",r[r.ERASE=26]="ERASE",r[r.SUBTRACT=28]="SUBTRACT",r[r.XOR=29]="XOR"})(Et||(Et={}));var pa;(function(r){r[r.POINTS=0]="POINTS",r[r.LINES=1]="LINES",r[r.LINE_LOOP=2]="LINE_LOOP",r[r.LINE_STRIP=3]="LINE_STRIP",r[r.TRIANGLES=4]="TRIANGLES",r[r.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",r[r.TRIANGLE_FAN=6]="TRIANGLE_FAN"})(pa||(pa={}));var at;(function(r){r[r.RGBA=6408]="RGBA",r[r.RGB=6407]="RGB",r[r.RG=33319]="RG",r[r.RED=6403]="RED",r[r.RGBA_INTEGER=36249]="RGBA_INTEGER",r[r.RGB_INTEGER=36248]="RGB_INTEGER",r[r.RG_INTEGER=33320]="RG_INTEGER",r[r.RED_INTEGER=36244]="RED_INTEGER",r[r.ALPHA=6406]="ALPHA",r[r.LUMINANCE=6409]="LUMINANCE",r[r.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",r[r.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",r[r.DEPTH_STENCIL=34041]="DEPTH_STENCIL"})(at||(at={}));var Xo;(function(r){r[r.TEXTURE_2D=3553]="TEXTURE_2D",r[r.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",r[r.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",r[r.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",r[r.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",r[r.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",r[r.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"})(Xo||(Xo={}));var wt;(function(r){r[r.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",r[r.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",r[r.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",r[r.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",r[r.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",r[r.UNSIGNED_INT=5125]="UNSIGNED_INT",r[r.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",r[r.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",r[r.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",r[r.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",r[r.BYTE=5120]="BYTE",r[r.SHORT=5122]="SHORT",r[r.INT=5124]="INT",r[r.FLOAT=5126]="FLOAT",r[r.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",r[r.HALF_FLOAT=36193]="HALF_FLOAT"})(wt||(wt={}));var sd;(function(r){r[r.FLOAT=0]="FLOAT",r[r.INT=1]="INT",r[r.UINT=2]="UINT"})(sd||(sd={}));var Da;(function(r){r[r.NEAREST=0]="NEAREST",r[r.LINEAR=1]="LINEAR"})(Da||(Da={}));var Ia;(function(r){r[r.CLAMP=33071]="CLAMP",r[r.REPEAT=10497]="REPEAT",r[r.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"})(Ia||(Ia={}));var ba;(function(r){r[r.OFF=0]="OFF",r[r.POW2=1]="POW2",r[r.ON=2]="ON",r[r.ON_MANUAL=3]="ON_MANUAL"})(ba||(ba={}));var xa;(function(r){r[r.NPM=0]="NPM",r[r.UNPACK=1]="UNPACK",r[r.PMA=2]="PMA",r[r.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",r[r.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",r[r.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",r[r.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"})(xa||(xa={}));var ha;(function(r){r[r.NO=0]="NO",r[r.YES=1]="YES",r[r.AUTO=2]="AUTO",r[r.BLEND=0]="BLEND",r[r.CLEAR=1]="CLEAR",r[r.BLIT=2]="BLIT"})(ha||(ha={}));var od;(function(r){r[r.AUTO=0]="AUTO",r[r.MANUAL=1]="MANUAL"})(od||(od={}));var Oi;(function(r){r.LOW="lowp",r.MEDIUM="mediump",r.HIGH="highp"})(Oi||(Oi={}));var vn;(function(r){r[r.NONE=0]="NONE",r[r.SCISSOR=1]="SCISSOR",r[r.STENCIL=2]="STENCIL",r[r.SPRITE=3]="SPRITE",r[r.COLOR=4]="COLOR"})(vn||(vn={}));var w4;(function(r){r[r.RED=1]="RED",r[r.GREEN=2]="GREEN",r[r.BLUE=4]="BLUE",r[r.ALPHA=8]="ALPHA"})(w4||(w4={}));var Fr;(function(r){r[r.NONE=0]="NONE",r[r.LOW=2]="LOW",r[r.MEDIUM=4]="MEDIUM",r[r.HIGH=8]="HIGH"})(Fr||(Fr={}));var Na;(function(r){r[r.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",r[r.ARRAY_BUFFER=34962]="ARRAY_BUFFER",r[r.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"})(Na||(Na={}));/*! * @pixi/settings - v6.5.10 * Compiled Thu, 06 Jul 2023 15:25:11 UTC * * @pixi/settings is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license */var AO={createCanvas:function(r,e){var t=document.createElement("canvas");return t.width=r,t.height=e,t},getWebGLRenderingContext:function(){return WebGLRenderingContext},getNavigator:function(){return navigator},getBaseUrl:function(){var r;return(r=document.baseURI)!==null&&r!==void 0?r:window.location.href},fetch:function(r,e){return fetch(r,e)}},W2=/iPhone/i,N7=/iPod/i,L7=/iPad/i,k7=/\biOS-universal(?:.+)Mac\b/i,$2=/\bAndroid(?:.+)Mobile\b/i,B7=/Android/i,vc=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,gv=/Silk/i,Ps=/Windows Phone/i,F7=/\bWindows(?:.+)ARM\b/i,z7=/BlackBerry/i,U7=/BB10/i,G7=/Opera Mini/i,H7=/\b(CriOS|Chrome)(?:.+)Mobile/i,j7=/Mobile(?:.+)Firefox\b/i,V7=function(r){return typeof r<"u"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints=="number"&&r.maxTouchPoints>1&&typeof MSStream>"u"};function Fq(r){return function(e){return e.test(r)}}function zq(r){var e={userAgent:"",platform:"",maxTouchPoints:0};!r&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof r=="string"?e.userAgent=r:r&&r.userAgent&&(e={userAgent:r.userAgent,platform:r.platform,maxTouchPoints:r.maxTouchPoints||0});var t=e.userAgent,n=t.split("[FBAN");typeof n[1]<"u"&&(t=n[0]),n=t.split("Twitter"),typeof n[1]<"u"&&(t=n[0]);var i=Fq(t),a={apple:{phone:i(W2)&&!i(Ps),ipod:i(N7),tablet:!i(W2)&&(i(L7)||V7(e))&&!i(Ps),universal:i(k7),device:(i(W2)||i(N7)||i(L7)||i(k7)||V7(e))&&!i(Ps)},amazon:{phone:i(vc),tablet:!i(vc)&&i(gv),device:i(vc)||i(gv)},android:{phone:!i(Ps)&&i(vc)||!i(Ps)&&i($2),tablet:!i(Ps)&&!i(vc)&&!i($2)&&(i(gv)||i(B7)),device:!i(Ps)&&(i(vc)||i(gv)||i($2)||i(B7))||i(/\bokhttp\b/i)},windows:{phone:i(Ps),tablet:i(F7),device:i(Ps)||i(F7)},other:{blackberry:i(z7),blackberry10:i(U7),opera:i(G7),firefox:i(j7),chrome:i(H7),device:i(z7)||i(U7)||i(G7)||i(j7)||i(H7)},any:!1,phone:!1,tablet:!1};return a.any=a.apple.device||a.android.device||a.windows.device||a.other.device,a.phone=a.apple.phone||a.android.phone||a.windows.phone,a.tablet=a.apple.tablet||a.android.tablet||a.windows.tablet,a}var ga=zq(globalThis.navigator);function Uq(){return!ga.apple.device}function Gq(r){var e=!0;if(ga.tablet||ga.phone){if(ga.apple.device){var t=navigator.userAgent.match(/OS (\d+)_(\d+)?/);if(t){var n=parseInt(t[1],10);n<11&&(e=!1)}}if(ga.android.device){var t=navigator.userAgent.match(/Android\s([0-9.]*)/);if(t){var n=parseInt(t[1],10);n<7&&(e=!1)}}}return e?r:4}var ht={ADAPTER:AO,MIPMAP_TEXTURES:ba.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:Fr.NONE,SPRITE_MAX_TEXTURES:Gq(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,width:800,height:600,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,antialias:!1,preserveDrawingBuffer:!1},GC_MODE:od.AUTO,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:Ia.CLAMP,SCALE_MODE:Da.LINEAR,PRECISION_VERTEX:Oi.HIGH,PRECISION_FRAGMENT:ga.apple.device?Oi.HIGH:Oi.MEDIUM,CAN_UPLOAD_SAME_BUFFER:Uq(),CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},K2={exports:{}},q7;function Hq(){return q7||(q7=1,(function(r){var e=Object.prototype.hasOwnProperty,t="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(t=!1));function i(l,c,h){this.fn=l,this.context=c,this.once=h||!1}function a(l,c,h,d,v){if(typeof h!="function")throw new TypeError("The listener must be a function");var g=new i(h,d||l,v),m=t?t+c:c;return l._events[m]?l._events[m].fn?l._events[m]=[l._events[m],g]:l._events[m].push(g):(l._events[m]=g,l._eventsCount++),l}function s(l,c){--l._eventsCount===0?l._events=new n:delete l._events[c]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var c=[],h,d;if(this._eventsCount===0)return c;for(d in h=this._events)e.call(h,d)&&c.push(t?d.slice(1):d);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(h)):c},o.prototype.listeners=function(c){var h=t?t+c:c,d=this._events[h];if(!d)return[];if(d.fn)return[d.fn];for(var v=0,g=d.length,m=new Array(g);v80*z){G=ie=P[0],re=le=P[1];for(var ae=z;aeie&&(ie=ce),_e>le&&(le=_e);pe=Math.max(ie-G,le-re),pe=pe!==0?32767/pe:0}return n(L,Y,z,G,re,pe,0),Y}function e(P,H,z,$,B){var L,Y;if(B===W(P,H,z,$)>0)for(L=H;L=H;L-=$)Y=U(L,P[L],P[L+1],Y);return Y&&A(Y,Y.next)&&(V(Y),Y=Y.next),Y}function t(P,H){if(!P)return P;H||(H=P);var z=P,$;do if($=!1,!z.steiner&&(A(z,z.next)||S(z.prev,z,z.next)===0)){if(V(z),z=H=z.prev,z===z.next)break;$=!0}else z=z.next;while($||z!==H);return H}function n(P,H,z,$,B,L,Y){if(P){!Y&&L&&g(P,$,B,L);for(var G=P,re,ie;P.prev!==P.next;){if(re=P.prev,ie=P.next,L?a(P,$,B,L):i(P)){H.push(re.i/z|0),H.push(P.i/z|0),H.push(ie.i/z|0),V(P),P=ie.next,G=ie.next;continue}if(P=ie,P===G){Y?Y===1?(P=s(t(P),H,z),n(P,H,z,$,B,L,2)):Y===2&&o(P,H,z,$,B,L):n(t(P),H,z,$,B,L,1);break}}}}function i(P){var H=P.prev,z=P,$=P.next;if(S(H,z,$)>=0)return!1;for(var B=H.x,L=z.x,Y=$.x,G=H.y,re=z.y,ie=$.y,le=BL?B>Y?B:Y:L>Y?L:Y,pe=G>re?G>ie?G:ie:re>ie?re:ie,ae=$.next;ae!==H;){if(ae.x>=le&&ae.x<=_e&&ae.y>=ce&&ae.y<=pe&&_(B,G,L,re,Y,ie,ae.x,ae.y)&&S(ae.prev,ae,ae.next)>=0)return!1;ae=ae.next}return!0}function a(P,H,z,$){var B=P.prev,L=P,Y=P.next;if(S(B,L,Y)>=0)return!1;for(var G=B.x,re=L.x,ie=Y.x,le=B.y,ce=L.y,_e=Y.y,pe=Gre?G>ie?G:ie:re>ie?re:ie,de=le>ce?le>_e?le:_e:ce>_e?ce:_e,ye=x(pe,ae,H,z,$),Ee=x(oe,de,H,z,$),Re=P.prevZ,Ne=P.nextZ;Re&&Re.z>=ye&&Ne&&Ne.z<=Ee;){if(Re.x>=pe&&Re.x<=oe&&Re.y>=ae&&Re.y<=de&&Re!==B&&Re!==Y&&_(G,le,re,ce,ie,_e,Re.x,Re.y)&&S(Re.prev,Re,Re.next)>=0||(Re=Re.prevZ,Ne.x>=pe&&Ne.x<=oe&&Ne.y>=ae&&Ne.y<=de&&Ne!==B&&Ne!==Y&&_(G,le,re,ce,ie,_e,Ne.x,Ne.y)&&S(Ne.prev,Ne,Ne.next)>=0))return!1;Ne=Ne.nextZ}for(;Re&&Re.z>=ye;){if(Re.x>=pe&&Re.x<=oe&&Re.y>=ae&&Re.y<=de&&Re!==B&&Re!==Y&&_(G,le,re,ce,ie,_e,Re.x,Re.y)&&S(Re.prev,Re,Re.next)>=0)return!1;Re=Re.prevZ}for(;Ne&&Ne.z<=Ee;){if(Ne.x>=pe&&Ne.x<=oe&&Ne.y>=ae&&Ne.y<=de&&Ne!==B&&Ne!==Y&&_(G,le,re,ce,ie,_e,Ne.x,Ne.y)&&S(Ne.prev,Ne,Ne.next)>=0)return!1;Ne=Ne.nextZ}return!0}function s(P,H,z){var $=P;do{var B=$.prev,L=$.next.next;!A(B,L)&&C(B,$,$.next,L)&&D(B,L)&&D(L,B)&&(H.push(B.i/z|0),H.push($.i/z|0),H.push(L.i/z|0),V($),V($.next),$=P=L),$=$.next}while($!==P);return t($)}function o(P,H,z,$,B,L){var Y=P;do{for(var G=Y.next.next;G!==Y.prev;){if(Y.i!==G.i&&w(Y,G)){var re=k(Y,G);Y=t(Y,Y.next),re=t(re,re.next),n(Y,H,z,$,B,L,0),n(re,H,z,$,B,L,0);return}G=G.next}Y=Y.next}while(Y!==P)}function l(P,H,z,$){var B=[],L,Y,G,re,ie;for(L=0,Y=H.length;L=z.next.y&&z.next.y!==z.y){var G=z.x+(B-z.y)*(z.next.x-z.x)/(z.next.y-z.y);if(G<=$&&G>L&&(L=G,Y=z.x=z.x&&z.x>=ie&&$!==z.x&&_(BY.x||z.x===Y.x&&v(Y,z)))&&(Y=z,ce=_e)),z=z.next;while(z!==re);return Y}function v(P,H){return S(P.prev,P,H.prev)<0&&S(H.next,P,P.next)<0}function g(P,H,z,$){var B=P;do B.z===0&&(B.z=x(B.x,B.y,H,z,$)),B.prevZ=B.prev,B.nextZ=B.next,B=B.next;while(B!==P);B.prevZ.nextZ=null,B.prevZ=null,m(B)}function m(P){var H,z,$,B,L,Y,G,re,ie=1;do{for(z=P,P=null,L=null,Y=0;z;){for(Y++,$=z,G=0,H=0;H0||re>0&&$;)G!==0&&(re===0||!$||z.z<=$.z)?(B=z,z=z.nextZ,G--):(B=$,$=$.nextZ,re--),L?L.nextZ=B:P=B,B.prevZ=L,L=B;z=$}L.nextZ=null,ie*=2}while(Y>1);return P}function x(P,H,z,$,B){return P=(P-z)*B|0,H=(H-$)*B|0,P=(P|P<<8)&16711935,P=(P|P<<4)&252645135,P=(P|P<<2)&858993459,P=(P|P<<1)&1431655765,H=(H|H<<8)&16711935,H=(H|H<<4)&252645135,H=(H|H<<2)&858993459,H=(H|H<<1)&1431655765,P|H<<1}function y(P){var H=P,z=P;do(H.x=(P-Y)*(L-G)&&(P-Y)*($-G)>=(z-Y)*(H-G)&&(z-Y)*(L-G)>=(B-Y)*($-G)}function w(P,H){return P.next.i!==H.i&&P.prev.i!==H.i&&!O(P,H)&&(D(P,H)&&D(H,P)&&I(P,H)&&(S(P.prev,P,H.prev)||S(P,H.prev,H))||A(P,H)&&S(P.prev,P,P.next)>0&&S(H.prev,H,H.next)>0)}function S(P,H,z){return(H.y-P.y)*(z.x-H.x)-(H.x-P.x)*(z.y-H.y)}function A(P,H){return P.x===H.x&&P.y===H.y}function C(P,H,z,$){var B=E(S(P,H,z)),L=E(S(P,H,$)),Y=E(S(z,$,P)),G=E(S(z,$,H));return!!(B!==L&&Y!==G||B===0&&M(P,z,H)||L===0&&M(P,$,H)||Y===0&&M(z,P,$)||G===0&&M(z,H,$))}function M(P,H,z){return H.x<=Math.max(P.x,z.x)&&H.x>=Math.min(P.x,z.x)&&H.y<=Math.max(P.y,z.y)&&H.y>=Math.min(P.y,z.y)}function E(P){return P>0?1:P<0?-1:0}function O(P,H){var z=P;do{if(z.i!==P.i&&z.next.i!==P.i&&z.i!==H.i&&z.next.i!==H.i&&C(z,z.next,P,H))return!0;z=z.next}while(z!==P);return!1}function D(P,H){return S(P.prev,P,P.next)<0?S(P,H,P.next)>=0&&S(P,P.prev,H)>=0:S(P,H,P.prev)<0||S(P,P.next,H)<0}function I(P,H){var z=P,$=!1,B=(P.x+H.x)/2,L=(P.y+H.y)/2;do z.y>L!=z.next.y>L&&z.next.y!==z.y&&B<(z.next.x-z.x)*(L-z.y)/(z.next.y-z.y)+z.x&&($=!$),z=z.next;while(z!==P);return $}function k(P,H){var z=new X(P.i,P.x,P.y),$=new X(H.i,H.x,H.y),B=P.next,L=H.prev;return P.next=H,H.prev=P,z.next=B,B.prev=z,$.next=z,z.prev=$,L.next=$,$.prev=L,$}function U(P,H,z,$){var B=new X(P,H,z);return $?(B.next=$.next,B.prev=$,$.next.prev=B,$.next=B):(B.prev=B,B.next=B),B}function V(P){P.next.prev=P.prev,P.prev.next=P.next,P.prevZ&&(P.prevZ.nextZ=P.nextZ),P.nextZ&&(P.nextZ.prevZ=P.prevZ)}function X(P,H,z){this.i=P,this.x=H,this.y=z,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}r.deviation=function(P,H,z,$){var B=H&&H.length,L=B?H[0]*z:P.length,Y=Math.abs(W(P,0,L,z));if(B)for(var G=0,re=H.length;G0&&($+=P[B-1].length,z.holes.push($))}return z},mv.exports}var qq=Vq();const pw=cl(qq);var Fl={},Of={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var Xq=Of.exports,Y7;function Yq(){return Y7||(Y7=1,(function(r,e){(function(t){var n=e&&!e.nodeType&&e,i=r&&!r.nodeType&&r,a=typeof wp=="object"&℘(a.global===a||a.window===a||a.self===a)&&(t=a);var s,o=2147483647,l=36,c=1,h=26,d=38,v=700,g=72,m=128,x="-",y=/^xn--/,_=/[^\x20-\x7E]/,w=/[\x2E\u3002\uFF0E\uFF61]/g,S={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=l-c,C=Math.floor,M=String.fromCharCode,E;function O(B){throw new RangeError(S[B])}function D(B,L){for(var Y=B.length,G=[];Y--;)G[Y]=L(B[Y]);return G}function I(B,L){var Y=B.split("@"),G="";Y.length>1&&(G=Y[0]+"@",B=Y[1]),B=B.replace(w,".");var re=B.split("."),ie=D(re,L).join(".");return G+ie}function k(B){for(var L=[],Y=0,G=B.length,re,ie;Y=55296&&re<=56319&&Y65535&&(L-=65536,Y+=M(L>>>10&1023|55296),L=56320|L&1023),Y+=M(L),Y}).join("")}function V(B){return B-48<10?B-22:B-65<26?B-65:B-97<26?B-97:l}function X(B,L){return B+22+75*(B<26)-((L!=0)<<5)}function W(B,L,Y){var G=0;for(B=Y?C(B/v):B>>1,B+=C(B/L);B>A*h>>1;G+=l)B=C(B/A);return C(G+(A+1)*B/(B+d))}function P(B){var L=[],Y=B.length,G,re=0,ie=m,le=g,ce,_e,pe,ae,oe,de,ye,Ee,Re;for(ce=B.lastIndexOf(x),ce<0&&(ce=0),_e=0;_e=128&&O("not-basic"),L.push(B.charCodeAt(_e));for(pe=ce>0?ce+1:0;pe=Y&&O("invalid-input"),ye=V(B.charCodeAt(pe++)),(ye>=l||ye>C((o-re)/oe))&&O("overflow"),re+=ye*oe,Ee=de<=le?c:de>=le+h?h:de-le,!(yeC(o/Re)&&O("overflow"),oe*=Re;G=L.length+1,le=W(re-ae,G,ae==0),C(re/G)>o-ie&&O("overflow"),ie+=C(re/G),re%=G,L.splice(re++,0,ie)}return U(L)}function H(B){var L,Y,G,re,ie,le,ce,_e,pe,ae,oe,de=[],ye,Ee,Re,Ne;for(B=k(B),ye=B.length,L=m,Y=0,ie=g,le=0;le=L&&oeC((o-Y)/Ee)&&O("overflow"),Y+=(ce-L)*Ee,L=ce,le=0;leo&&O("overflow"),oe==L){for(_e=Y,pe=l;ae=pe<=ie?c:pe>=ie+h?h:pe-ie,!(_e-1e3&&ee<1e3||M.call(/e/,se))return se;var Pe=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof ee=="number"){var Ae=ee<0?-I(-ee):I(ee);if(Ae!==ee){var Ge=String(Ae),J=w.call(se,Ge.length+1);return S.call(Ge,Pe,"$&_")+"."+S.call(S.call(J,/([0-9]{3})/g,"$&_"),/_$/,"")}}return S.call(se,Pe,"$&_")}var $=Kq,B=$.custom,L=Ee(B)?B:null,Y={__proto__:null,double:'"',single:"'"},G={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Q2=function ee(se,Pe,Ae,Ge){var J=Pe||{};if(Be(J,"quoteStyle")&&!Be(Y,J.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Be(J,"maxStringLength")&&(typeof J.maxStringLength=="number"?J.maxStringLength<0&&J.maxStringLength!==1/0:J.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Oe=Be(J,"customInspect")?J.customInspect:!0;if(typeof Oe!="boolean"&&Oe!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Be(J,"indent")&&J.indent!==null&&J.indent!==" "&&!(parseInt(J.indent,10)===J.indent&&J.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Be(J,"numericSeparator")&&typeof J.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Ve=J.numericSeparator;if(typeof se>"u")return"undefined";if(se===null)return"null";if(typeof se=="boolean")return se?"true":"false";if(typeof se=="string")return ke(se,J);if(typeof se=="number"){if(se===0)return 1/0/se>0?"0":"-0";var Ue=String(se);return Ve?z(se,Ue):Ue}if(typeof se=="bigint"){var je=String(se)+"n";return Ve?z(se,je):je}var yt=typeof J.depth>"u"?5:J.depth;if(typeof Ae>"u"&&(Ae=0),Ae>=yt&&yt>0&&typeof se=="object")return ce(se)?"[Array]":"[Object]";var vt=Q(J,Ae);if(typeof Ge>"u")Ge=[];else if(He(Ge,se)>=0)return"[Circular]";function Ot(st,lt,Ut){if(lt&&(Ge=D.call(Ge),Ge.push(lt)),Ut){var br={depth:J.depth};return Be(J,"quoteStyle")&&(br.quoteStyle=J.quoteStyle),ee(st,br,Ae+1,Ge)}return ee(st,J,Ae+1,Ge)}if(typeof se=="function"&&!pe(se)){var jt=Ye(se),Nr=be(se,Ot);return"[Function"+(jt?": "+jt:" (anonymous)")+"]"+(Nr.length>0?" { "+O.call(Nr,", ")+" }":"")}if(Ee(se)){var Vt=X?S.call(String(se),/^(Symbol\(.*\))_[^)]*$/,"$1"):V.call(se);return typeof se=="object"&&!X?Ke(Vt):Vt}if(Se(se)){for(var Qt="<"+C.call(String(se.nodeName)),rr=se.attributes||[],ur=0;ur",Qt}if(ce(se)){if(se.length===0)return"[]";var In=be(se,Ot);return vt&&!De(In)?"["+ne(In,vt)+"]":"[ "+O.call(In,", ")+" ]"}if(ae(se)){var vr=be(se,Ot);return!("cause"in Error.prototype)&&"cause"in se&&!P.call(se,"cause")?"{ ["+String(se)+"] "+O.call(E.call("[cause]: "+Ot(se.cause),vr),", ")+" }":vr.length===0?"["+String(se)+"]":"{ ["+String(se)+"] "+O.call(vr,", ")+" }"}if(typeof se=="object"&&Oe){if(L&&typeof se[L]=="function"&&$)return $(se,{depth:yt-Ae});if(Oe!=="symbol"&&typeof se.inspect=="function")return se.inspect()}if(tt(se)){var Gn=[];return n&&n.call(se,function(st,lt){Gn.push(Ot(lt,se,!0)+" => "+Ot(st,se))}),nt("Map",t.call(se),Gn,vt)}if(Ze(se)){var Yr=[];return o&&o.call(se,function(st){Yr.push(Ot(st,se))}),nt("Set",s.call(se),Yr,vt)}if(ot(se))return rt("WeakMap");if(bt(se))return rt("WeakSet");if(ct(se))return rt("WeakRef");if(de(se))return Ke(Ot(Number(se)));if(Re(se))return Ke(Ot(k.call(se)));if(ye(se))return Ke(m.call(se));if(oe(se))return Ke(Ot(String(se)));if(typeof window<"u"&&se===window)return"{ [object Window] }";if(typeof globalThis<"u"&&se===globalThis||typeof wp<"u"&&se===wp)return"{ [object globalThis] }";if(!_e(se)&&!pe(se)){var nr=be(se,Ot),Lr=H?H(se)===Object.prototype:se instanceof Object||se.constructor===Object,cn=se instanceof Object?"":"null prototype",Ur=!Lr&&W&&Object(se)===se&&W in se?w.call($e(se),8,-1):cn?"Object":"",Wr=Lr||typeof se.constructor!="function"?"":se.constructor.name?se.constructor.name+" ":"",xe=Wr+(Ur||cn?"["+O.call(E.call([],Ur||[],cn||[]),": ")+"] ":"");return nr.length===0?xe+"{}":vt?xe+"{"+ne(nr,vt)+"}":xe+"{ "+O.call(nr,", ")+" }"}return String(se)};function re(ee,se,Pe){var Ae=Pe.quoteStyle||se,Ge=Y[Ae];return Ge+ee+Ge}function ie(ee){return S.call(String(ee),/"/g,""")}function le(ee){return!W||!(typeof ee=="object"&&(W in ee||typeof ee[W]<"u"))}function ce(ee){return $e(ee)==="[object Array]"&&le(ee)}function _e(ee){return $e(ee)==="[object Date]"&&le(ee)}function pe(ee){return $e(ee)==="[object RegExp]"&&le(ee)}function ae(ee){return $e(ee)==="[object Error]"&&le(ee)}function oe(ee){return $e(ee)==="[object String]"&&le(ee)}function de(ee){return $e(ee)==="[object Number]"&&le(ee)}function ye(ee){return $e(ee)==="[object Boolean]"&&le(ee)}function Ee(ee){if(X)return ee&&typeof ee=="object"&&ee instanceof Symbol;if(typeof ee=="symbol")return!0;if(!ee||typeof ee!="object"||!V)return!1;try{return V.call(ee),!0}catch{}return!1}function Re(ee){if(!ee||typeof ee!="object"||!k)return!1;try{return k.call(ee),!0}catch{}return!1}var Ne=Object.prototype.hasOwnProperty||function(ee){return ee in this};function Be(ee,se){return Ne.call(ee,se)}function $e(ee){return x.call(ee)}function Ye(ee){if(ee.name)return ee.name;var se=_.call(y.call(ee),/^function\s*([\w$]+)/);return se?se[1]:null}function He(ee,se){if(ee.indexOf)return ee.indexOf(se);for(var Pe=0,Ae=ee.length;Pese.maxStringLength){var Pe=ee.length-se.maxStringLength,Ae="... "+Pe+" more character"+(Pe>1?"s":"");return ke(w.call(ee,0,se.maxStringLength),se)+Ae}var Ge=G[se.quoteStyle||"single"];Ge.lastIndex=0;var J=S.call(S.call(ee,Ge,"\\$1"),/[\x00-\x1f]/g,We);return re(J,"single",se)}function We(ee){var se=ee.charCodeAt(0),Pe={8:"b",9:"t",10:"n",12:"f",13:"r"}[se];return Pe?"\\"+Pe:"\\x"+(se<16?"0":"")+A.call(se.toString(16))}function Ke(ee){return"Object("+ee+")"}function rt(ee){return ee+" { ? }"}function nt(ee,se,Pe,Ae){var Ge=Ae?ne(Pe,Ae):O.call(Pe,", ");return ee+" ("+se+") {"+Ge+"}"}function De(ee){for(var se=0;se=0)return!1;return!0}function Q(ee,se){var Pe;if(ee.indent===" ")Pe=" ";else if(typeof ee.indent=="number"&&ee.indent>0)Pe=O.call(Array(ee.indent+1)," ");else return null;return{base:Pe,prev:O.call(Array(se+1),Pe)}}function ne(ee,se){if(ee.length===0)return"";var Pe=` `+se.prev+se.base;return Pe+O.call(ee,","+Pe)+` `+se.prev}function be(ee,se){var Pe=ce(ee),Ae=[];if(Pe){Ae.length=ee.length;for(var Ge=0;Ge"u"||!E?r:E(Uint8Array),X={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":M&&E?E([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":U,"%AsyncGenerator%":U,"%AsyncGeneratorFunction%":U,"%AsyncIteratorPrototype%":U,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":n,"%Float16Array%":typeof Float16Array>"u"?r:Float16Array,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":y,"%GeneratorFunction%":U,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":M&&E?E(E([][Symbol.iterator]())):r,"%JSON%":typeof JSON=="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!M||!E?r:E(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":w,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":i,"%ReferenceError%":a,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!M||!E?r:E(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":M&&E?E(""[Symbol.iterator]()):r,"%Symbol%":M?Symbol:r,"%SyntaxError%":s,"%ThrowTypeError%":C,"%TypedArray%":V,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":l,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet,"%Function.prototype.call%":k,"%Function.prototype.apply%":I,"%Object.defineProperty%":S,"%Object.getPrototypeOf%":O,"%Math.abs%":c,"%Math.floor%":h,"%Math.max%":d,"%Math.min%":v,"%Math.pow%":g,"%Math.round%":m,"%Math.sign%":x,"%Reflect.getPrototypeOf%":D};if(E)try{null.error}catch(pe){var W=E(E(pe));X["%Error.prototype%"]=W}var P=function pe(ae){var oe;if(ae==="%AsyncFunction%")oe=_("async function () {}");else if(ae==="%GeneratorFunction%")oe=_("function* () {}");else if(ae==="%AsyncGeneratorFunction%")oe=_("async function* () {}");else if(ae==="%AsyncGenerator%"){var de=pe("%AsyncGeneratorFunction%");de&&(oe=de.prototype)}else if(ae==="%AsyncIteratorPrototype%"){var ye=pe("%AsyncGenerator%");ye&&E&&(oe=E(ye.prototype))}return X[ae]=oe,oe},H={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},z=wg(),$=_X(),B=z.call(k,Array.prototype.concat),L=z.call(I,Array.prototype.splice),Y=z.call(k,String.prototype.replace),G=z.call(k,String.prototype.slice),re=z.call(k,RegExp.prototype.exec),ie=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,le=/\\(\\)?/g,ce=function(ae){var oe=G(ae,0,1),de=G(ae,-1);if(oe==="%"&&de!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(de==="%"&&oe!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var ye=[];return Y(ae,ie,function(Ee,Re,Ne,Be){ye[ye.length]=Ne?Y(Be,le,"$1"):Re||Ee}),ye},_e=function(ae,oe){var de=ae,ye;if($(H,de)&&(ye=H[de],de="%"+ye[0]+"%"),$(X,de)){var Ee=X[de];if(Ee===U&&(Ee=P(de)),typeof Ee>"u"&&!oe)throw new o("intrinsic "+ae+" exists, but is not available. Please file an issue!");return{alias:ye,name:de,value:Ee}}throw new s("intrinsic "+ae+" does not exist!")};return Pb=function(ae,oe){if(typeof ae!="string"||ae.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof oe!="boolean")throw new o('"allowMissing" argument must be a boolean');if(re(/^%?[^%]*%?$/,ae)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var de=ce(ae),ye=de.length>0?de[0]:"",Ee=_e("%"+ye+"%",oe),Re=Ee.name,Ne=Ee.value,Be=!1,$e=Ee.alias;$e&&(ye=$e[0],L(de,B([0,1],$e)));for(var Ye=1,He=!0;Ye=de.length){var Ze=w(Ne,tt);He=!!Ze,He&&"get"in Ze&&!("originalValue"in Ze.get)?Ne=Ze.get:Ne=Ne[tt]}else He=$(Ne,tt),Ne=Ne[tt];He&&!Be&&(X[Re]=Ne)}}return Ne},Pb}var Ib,OC;function NO(){if(OC)return Ib;OC=1;var r=mw(),e=IO(),t=e([r("%String.prototype.indexOf%")]);return Ib=function(i,a){var s=r(i,!!a);return typeof s=="function"&&t(i,".prototype.")>-1?e([s]):s},Ib}var Nb,DC;function LO(){if(DC)return Nb;DC=1;var r=mw(),e=NO(),t=_g(),n=ih(),i=r("%Map%",!0),a=e("Map.prototype.get",!0),s=e("Map.prototype.set",!0),o=e("Map.prototype.has",!0),l=e("Map.prototype.delete",!0),c=e("Map.prototype.size",!0);return Nb=!!i&&function(){var d,v={assert:function(g){if(!v.has(g))throw new n("Side channel does not contain "+t(g))},delete:function(g){if(d){var m=l(d,g);return c(d)===0&&(d=void 0),m}return!1},get:function(g){if(d)return a(d,g)},has:function(g){return d?o(d,g):!1},set:function(g,m){d||(d=new i),s(d,g,m)}};return v},Nb}var Lb,PC;function wX(){if(PC)return Lb;PC=1;var r=mw(),e=NO(),t=_g(),n=LO(),i=ih(),a=r("%WeakMap%",!0),s=e("WeakMap.prototype.get",!0),o=e("WeakMap.prototype.set",!0),l=e("WeakMap.prototype.has",!0),c=e("WeakMap.prototype.delete",!0);return Lb=a?function(){var d,v,g={assert:function(m){if(!g.has(m))throw new i("Side channel does not contain "+t(m))},delete:function(m){if(a&&m&&(typeof m=="object"||typeof m=="function")){if(d)return c(d,m)}else if(n&&v)return v.delete(m);return!1},get:function(m){return a&&m&&(typeof m=="object"||typeof m=="function")&&d?s(d,m):v&&v.get(m)},has:function(m){return a&&m&&(typeof m=="object"||typeof m=="function")&&d?l(d,m):!!v&&v.has(m)},set:function(m,x){a&&m&&(typeof m=="object"||typeof m=="function")?(d||(d=new a),o(d,m,x)):n&&(v||(v=n()),v.set(m,x))}};return g}:n,Lb}var kb,IC;function kO(){if(IC)return kb;IC=1;var r=ih(),e=_g(),t=Zq(),n=LO(),i=wX(),a=i||n||t;return kb=function(){var o,l={assert:function(c){if(!l.has(c))throw new r("Side channel does not contain "+e(c))},delete:function(c){return!!o&&o.delete(c)},get:function(c){return o&&o.get(c)},has:function(c){return!!o&&o.has(c)},set:function(c,h){o||(o=a()),o.set(c,h)}};return l},kb}var Bb,NC;function yw(){if(NC)return Bb;NC=1;var r=String.prototype.replace,e=/%20/g,t={RFC1738:"RFC1738",RFC3986:"RFC3986"};return Bb={default:t.RFC3986,formatters:{RFC1738:function(n){return r.call(n,e,"+")},RFC3986:function(n){return String(n)}},RFC1738:t.RFC1738,RFC3986:t.RFC3986},Bb}var Fb,LC;function BO(){if(LC)return Fb;LC=1;var r=yw(),e=kO(),t=Object.prototype.hasOwnProperty,n=Array.isArray,i=e(),a=function(E,O){return i.set(E,O),E},s=function(E){return i.has(E)},o=function(E){return i.get(E)},l=function(E,O){i.set(E,O)},c=(function(){for(var M=[],E=0;E<256;++E)M[M.length]="%"+((E<16?"0":"")+E.toString(16)).toUpperCase();return M})(),h=function(E){for(;E.length>1;){var O=E.pop(),D=O.obj[O.prop];if(n(D)){for(var I=[],k=0;kD.arrayLimit)return a(d(E.concat(O),D),I);E[I]=O}else if(E&&typeof E=="object")if(s(E)){var k=o(E)+1;E[k]=O,l(E,k)}else{if(D&&D.strictMerge)return[E,O];(D&&(D.plainObjects||D.allowPrototypes)||!t.call(Object.prototype,O))&&(E[O]=!0)}else return[E,O];return E}if(!E||typeof E!="object"){if(s(O)){for(var U=Object.keys(O),V=D&&D.plainObjects?{__proto__:null,0:E}:{0:E},X=0;XD.arrayLimit?a(d(P,D),P.length-1):P}var H=E;return n(E)&&!n(O)&&(H=d(E,D)),n(E)&&n(O)?(O.forEach(function(z,$){if(t.call(E,$)){var B=E[$];B&&typeof B=="object"&&z&&typeof z=="object"?E[$]=M(B,z,D):E[E.length]=z}else E[$]=z}),E):Object.keys(O).reduce(function(z,$){var B=O[$];if(t.call(z,$)?z[$]=M(z[$],B,D):z[$]=B,s(O)&&!s(z)&&a(z,o(O)),s(z)){var L=parseInt($,10);String(L)===$&&L>=0&&L>o(z)&&l(z,L)}return z},H)},g=function(E,O){return Object.keys(O).reduce(function(D,I){return D[I]=O[I],D},E)},m=function(M,E,O){var D=M.replace(/\+/g," ");if(O==="iso-8859-1")return D.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(D)}catch{return D}},x=1024,y=function(E,O,D,I,k){if(E.length===0)return E;var U=E;if(typeof E=="symbol"?U=Symbol.prototype.toString.call(E):typeof E!="string"&&(U=String(E)),D==="iso-8859-1")return escape(U).replace(/%u[0-9a-f]{4}/gi,function($){return"%26%23"+parseInt($.slice(2),16)+"%3B"});for(var V="",X=0;X=x?U.slice(X,X+x):U,P=[],H=0;H=48&&z<=57||z>=65&&z<=90||z>=97&&z<=122||k===r.RFC1738&&(z===40||z===41)){P[P.length]=W.charAt(H);continue}if(z<128){P[P.length]=c[z];continue}if(z<2048){P[P.length]=c[192|z>>6]+c[128|z&63];continue}if(z<55296||z>=57344){P[P.length]=c[224|z>>12]+c[128|z>>6&63]+c[128|z&63];continue}H+=1,z=65536+((z&1023)<<10|W.charCodeAt(H)&1023),P[P.length]=c[240|z>>18]+c[128|z>>12&63]+c[128|z>>6&63]+c[128|z&63]}V+=P.join("")}return V},_=function(E){for(var O=[{obj:{o:E},prop:"o"}],D=[],I=0;ID?a(d(U,{plainObjects:I}),U.length-1):U},C=function(E,O){if(n(E)){for(var D=[],I=0;I"u"&&(B=0)}if(typeof D=="function"?z=D(_,z):z instanceof Date?z=U(z):w==="comma"&&a(z)&&(z=e.maybeMap(z,function(Re){return Re instanceof Date?U(Re):Re})),z===null){if(C)return O&&!W?O(_,h.encoder,P,"key",V):_;z=""}if(d(z)||e.isBuffer(z)){if(O){var G=W?_:O(_,h.encoder,P,"key",V);return[X(G)+"="+X(O(z,h.encoder,P,"value",V))]}return[X(_)+"="+X(String(z))]}var re=[];if(typeof z>"u")return re;var ie;if(w==="comma"&&a(z))W&&O&&(z=e.maybeMap(z,O)),ie=[{value:z.length>0?z.join(",")||null:void 0}];else if(a(D))ie=D;else{var le=Object.keys(z);ie=I?le.sort(I):le}var ce=E?String(_).replace(/\./g,"%2E"):String(_),_e=S&&a(z)&&z.length===1?ce+"[]":ce;if(A&&a(z)&&z.length===0)return _e+"[]";for(var pe=0;pe"u"?y.encodeDotInKeys===!0?!0:h.allowDots:!!y.allowDots;return{addQueryPrefix:typeof y.addQueryPrefix=="boolean"?y.addQueryPrefix:h.addQueryPrefix,allowDots:M,allowEmptyArrays:typeof y.allowEmptyArrays=="boolean"?!!y.allowEmptyArrays:h.allowEmptyArrays,arrayFormat:C,charset:_,charsetSentinel:typeof y.charsetSentinel=="boolean"?y.charsetSentinel:h.charsetSentinel,commaRoundTrip:!!y.commaRoundTrip,delimiter:typeof y.delimiter>"u"?h.delimiter:y.delimiter,encode:typeof y.encode=="boolean"?y.encode:h.encode,encodeDotInKeys:typeof y.encodeDotInKeys=="boolean"?y.encodeDotInKeys:h.encodeDotInKeys,encoder:typeof y.encoder=="function"?y.encoder:h.encoder,encodeValuesOnly:typeof y.encodeValuesOnly=="boolean"?y.encodeValuesOnly:h.encodeValuesOnly,filter:A,format:w,formatter:S,serializeDate:typeof y.serializeDate=="function"?y.serializeDate:h.serializeDate,skipNulls:typeof y.skipNulls=="boolean"?y.skipNulls:h.skipNulls,sort:typeof y.sort=="function"?y.sort:null,strictNullHandling:typeof y.strictNullHandling=="boolean"?y.strictNullHandling:h.strictNullHandling}};return zb=function(x,y){var _=x,w=m(y),S,A;typeof w.filter=="function"?(A=w.filter,_=A("",_)):a(w.filter)&&(A=w.filter,S=A);var C=[];if(typeof _!="object"||_===null)return"";var M=i[w.arrayFormat],E=M==="comma"&&w.commaRoundTrip;S||(S=Object.keys(_)),w.sort&&S.sort(w.sort);for(var O=r(),D=0;D0?V+U:""},zb}var Ub,BC;function EX(){if(BC)return Ub;BC=1;var r=BO(),e=Object.prototype.hasOwnProperty,t=Array.isArray,n={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:r.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},i=function(g){return g.replace(/&#(\d+);/g,function(m,x){return String.fromCharCode(parseInt(x,10))})},a=function(g,m,x){if(g&&typeof g=="string"&&m.comma&&g.indexOf(",")>-1)return g.split(",");if(m.throwOnLimitExceeded&&x>=m.arrayLimit)throw new RangeError("Array limit exceeded. Only "+m.arrayLimit+" element"+(m.arrayLimit===1?"":"s")+" allowed in an array.");return g},s="utf8=%26%2310003%3B",o="utf8=%E2%9C%93",l=function(m,x){var y={__proto__:null},_=x.ignoreQueryPrefix?m.replace(/^\?/,""):m;_=_.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var w=x.parameterLimit===1/0?void 0:x.parameterLimit,S=_.split(x.delimiter,x.throwOnLimitExceeded?w+1:w);if(x.throwOnLimitExceeded&&S.length>w)throw new RangeError("Parameter limit exceeded. Only "+w+" parameter"+(w===1?"":"s")+" allowed.");var A=-1,C,M=x.charset;if(x.charsetSentinel)for(C=0;C-1&&(k=t(k)?[k]:k),x.comma&&t(k)&&k.length>x.arrayLimit){if(x.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+x.arrayLimit+" element"+(x.arrayLimit===1?"":"s")+" allowed in an array.");k=r.combine([],k,x.arrayLimit,x.plainObjects)}if(I!==null){var U=e.call(y,I);U&&(x.duplicates==="combine"||E.indexOf("[]=")>-1)?y[I]=r.combine(y[I],k,x.arrayLimit,x.plainObjects):(!U||x.duplicates==="last")&&(y[I]=k)}}return y},c=function(g,m,x,y){var _=0;if(g.length>0&&g[g.length-1]==="[]"){var w=g.slice(0,-1).join("");_=Array.isArray(m)&&m[w]?m[w].length:0}for(var S=y?m:a(m,x,_),A=g.length-1;A>=0;--A){var C,M=g[A];if(M==="[]"&&x.parseArrays)r.isOverflow(S)?C=S:C=x.allowEmptyArrays&&(S===""||x.strictNullHandling&&S===null)?[]:r.combine([],S,x.arrayLimit,x.plainObjects);else{C=x.plainObjects?{__proto__:null}:{};var E=M.charAt(0)==="["&&M.charAt(M.length-1)==="]"?M.slice(1,-1):M,O=x.decodeDotInKeys?E.replace(/%2E/g,"."):E,D=parseInt(O,10),I=!isNaN(D)&&M!==O&&String(D)===O&&D>=0&&x.parseArrays;if(!x.parseArrays&&O==="")C={0:S};else if(I&&D"u"?n.charset:m.charset,y=typeof m.duplicates>"u"?n.duplicates:m.duplicates;if(y!=="combine"&&y!=="first"&&y!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var _=typeof m.allowDots>"u"?m.decodeDotInKeys===!0?!0:n.allowDots:!!m.allowDots;return{allowDots:_,allowEmptyArrays:typeof m.allowEmptyArrays=="boolean"?!!m.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof m.allowPrototypes=="boolean"?m.allowPrototypes:n.allowPrototypes,allowSparse:typeof m.allowSparse=="boolean"?m.allowSparse:n.allowSparse,arrayLimit:typeof m.arrayLimit=="number"?m.arrayLimit:n.arrayLimit,charset:x,charsetSentinel:typeof m.charsetSentinel=="boolean"?m.charsetSentinel:n.charsetSentinel,comma:typeof m.comma=="boolean"?m.comma:n.comma,decodeDotInKeys:typeof m.decodeDotInKeys=="boolean"?m.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof m.decoder=="function"?m.decoder:n.decoder,delimiter:typeof m.delimiter=="string"||r.isRegExp(m.delimiter)?m.delimiter:n.delimiter,depth:typeof m.depth=="number"||m.depth===!1?+m.depth:n.depth,duplicates:y,ignoreQueryPrefix:m.ignoreQueryPrefix===!0,interpretNumericEntities:typeof m.interpretNumericEntities=="boolean"?m.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof m.parameterLimit=="number"?m.parameterLimit:n.parameterLimit,parseArrays:m.parseArrays!==!1,plainObjects:typeof m.plainObjects=="boolean"?m.plainObjects:n.plainObjects,strictDepth:typeof m.strictDepth=="boolean"?!!m.strictDepth:n.strictDepth,strictMerge:typeof m.strictMerge=="boolean"?!!m.strictMerge:n.strictMerge,strictNullHandling:typeof m.strictNullHandling=="boolean"?m.strictNullHandling:n.strictNullHandling,throwOnLimitExceeded:typeof m.throwOnLimitExceeded=="boolean"?m.throwOnLimitExceeded:!1}};return Ub=function(g,m){var x=v(m);if(g===""||g===null||typeof g>"u")return x.plainObjects?{__proto__:null}:{};for(var y=typeof g=="string"?l(g,x):g,_=x.plainObjects?{__proto__:null}:{},w=Object.keys(y),S=0;S",'"',"`"," ","\r",` `," "],s=["{","}","|","\\","^","`"].concat(a),o=["'"].concat(s),l=["%","/","?",";","#"].concat(o),c=["/","?","#"],h=255,d=/^[+a-z0-9A-Z_-]{0,63}$/,v=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},x={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=TX();function _(C,M,E){if(C&&typeof C=="object"&&C instanceof e)return C;var O=new e;return O.parse(C,M,E),O}e.prototype.parse=function(C,M,E){if(typeof C!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof C);var O=C.indexOf("?"),D=O!==-1&&O127?le+="x":le+=ie[ce];if(!le.match(d)){var pe=G.slice(0,z),ae=G.slice(z+1),oe=ie.match(v);oe&&(pe.push(oe[1]),ae.unshift(oe[2])),ae.length&&(U="/"+ae.join(".")+U),this.hostname=pe.join(".");break}}}this.hostname.length>h?this.hostname="":this.hostname=this.hostname.toLowerCase(),Y||(this.hostname=r.toASCII(this.hostname));var de=this.port?":"+this.port:"",ye=this.hostname||"";this.host=ye+de,this.href+=this.host,Y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),U[0]!=="/"&&(U="/"+U))}if(!g[W])for(var z=0,re=o.length;z0?E.host.split("@"):!1;le&&(E.auth=le.shift(),E.hostname=le.shift(),E.host=E.hostname)}return E.search=C.search,E.query=C.query,(E.pathname!==null||E.search!==null)&&(E.path=(E.pathname?E.pathname:"")+(E.search?E.search:"")),E.href=E.format(),E}if(!G.length)return E.pathname=null,E.search?E.path="/"+E.search:E.path=null,E.href=E.format(),E;for(var ce=G.slice(-1)[0],_e=(E.host||C.host||G.length>1)&&(ce==="."||ce==="..")||ce==="",pe=0,ae=G.length;ae>=0;ae--)ce=G[ae],ce==="."?G.splice(ae,1):ce===".."?(G.splice(ae,1),pe++):pe&&(G.splice(ae,1),pe--);if(!L&&!Y)for(;pe--;pe)G.unshift("..");L&&G[0]!==""&&(!G[0]||G[0].charAt(0)!=="/")&&G.unshift(""),_e&&G.join("/").substr(-1)!=="/"&&G.push("");var oe=G[0]===""||G[0]&&G[0].charAt(0)==="/";if(ie){E.hostname=oe?"":G.length?G.shift():"",E.host=E.hostname;var le=E.host&&E.host.indexOf("@")>0?E.host.split("@"):!1;le&&(E.auth=le.shift(),E.hostname=le.shift(),E.host=E.hostname)}return L=L||E.host&&G.length,L&&!oe&&G.unshift(""),G.length>0?E.pathname=G.join("/"):(E.pathname=null,E.path=null),(E.pathname!==null||E.search!==null)&&(E.path=(E.pathname?E.pathname:"")+(E.search?E.search:"")),E.auth=C.auth||E.auth,E.slashes=E.slashes||C.slashes,E.href=E.format(),E},e.prototype.parseHost=function(){var C=this.host,M=n.exec(C);M&&(M=M[0],M!==":"&&(this.port=M.substr(1)),C=C.substr(0,C.length-M.length)),C&&(this.hostname=C)},Fl.parse=_,Fl.resolve=S,Fl.resolveObject=A,Fl.format=w,Fl.Url=e,Fl}var Hb=CX();/*! * @pixi/utils - v6.5.10 * Compiled Thu, 06 Jul 2023 15:25:11 UTC * * @pixi/utils is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license */var es={parse:Hb.parse,format:Hb.format,resolve:Hb.resolve};function Ca(r){if(typeof r!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(r))}function UC(r){var e=r.split("?")[0];return e.split("#")[0]}function AX(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function MX(r,e,t){return r.replace(new RegExp(AX(e),"g"),t)}function RX(r,e){for(var t="",n=0,i=-1,a=0,s,o=0;o<=r.length;++o){if(o2){var l=t.lastIndexOf("/");if(l!==t.length-1){l===-1?(t="",n=0):(t=t.slice(0,l),n=t.length-1-t.lastIndexOf("/")),i=o,a=0;continue}}else if(t.length===2||t.length===1){t="",n=0,i=o,a=0;continue}}}else t.length>0?t+="/"+r.slice(i+1,o):t=r.slice(i+1,o),n=o-i-1;i=o,a=0}else s===46&&a!==-1?++a:a=-1}return t}var FO={toPosix:function(r){return MX(r,"\\","/")},isUrl:function(r){return/^https?:/.test(this.toPosix(r))},isDataUrl:function(r){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(r)},hasProtocol:function(r){return/^[^/:]+:\//.test(this.toPosix(r))},getProtocol:function(r){Ca(r),r=this.toPosix(r);var e="",t=/^file:\/\/\//.exec(r),n=/^[^/:]+:\/\//.exec(r),i=/^[^/:]+:\//.exec(r);if(t||n||i){var a=(t==null?void 0:t[0])||(n==null?void 0:n[0])||(i==null?void 0:i[0]);e=a,r=r.slice(a.length)}return e},toAbsolute:function(r,e,t){if(this.isDataUrl(r))return r;var n=UC(this.toPosix(e??ht.ADAPTER.getBaseUrl())),i=UC(this.toPosix(t??this.rootname(n)));if(Ca(r),r=this.toPosix(r),r.startsWith("/"))return FO.join(i,r.slice(1));var a=this.isAbsolute(r)?r:this.join(n,r);return a},normalize:function(r){if(r=this.toPosix(r),Ca(r),r.length===0)return".";var e="",t=r.startsWith("/");this.hasProtocol(r)&&(e=this.rootname(r),r=r.slice(e.length));var n=r.endsWith("/");return r=RX(r),r.length>0&&n&&(r+="/"),t?"/"+r:e+r},isAbsolute:function(r){return Ca(r),r=this.toPosix(r),this.hasProtocol(r)?!0:r.startsWith("/")},join:function(){for(var r=arguments,e,t=[],n=0;n0)if(i===void 0)i=s;else{var o=(e=t[a-1])!==null&&e!==void 0?e:"";this.extname(o)?i+="/../"+s:i+="/"+s}}return i===void 0?".":this.normalize(i)},dirname:function(r){if(Ca(r),r.length===0)return".";r=this.toPosix(r);var e=r.charCodeAt(0),t=e===47,n=-1,i=!0,a=this.getProtocol(r),s=r;r=r.slice(a.length);for(var o=r.length-1;o>=1;--o)if(e=r.charCodeAt(o),e===47){if(!i){n=o;break}}else i=!1;return n===-1?t?"/":this.isUrl(s)?a+r:a:t&&n===1?"//":a+r.slice(0,n)},rootname:function(r){Ca(r),r=this.toPosix(r);var e="";if(r.startsWith("/")?e="/":e=this.getProtocol(r),this.isUrl(r)){var t=r.indexOf("/",e.length);t!==-1?e=r.slice(0,t):e=r,e.endsWith("/")||(e+="/")}return e},basename:function(r,e){Ca(r),e&&Ca(e),r=this.toPosix(r);var t=0,n=-1,i=!0,a;if(e!==void 0&&e.length>0&&e.length<=r.length){if(e.length===r.length&&e===r)return"";var s=e.length-1,o=-1;for(a=r.length-1;a>=0;--a){var l=r.charCodeAt(a);if(l===47){if(!i){t=a+1;break}}else o===-1&&(i=!1,o=a+1),s>=0&&(l===e.charCodeAt(s)?--s===-1&&(n=a):(s=-1,n=o))}return t===n?n=o:n===-1&&(n=r.length),r.slice(t,n)}for(a=r.length-1;a>=0;--a)if(r.charCodeAt(a)===47){if(!i){t=a+1;break}}else n===-1&&(i=!1,n=a+1);return n===-1?"":r.slice(t,n)},extname:function(r){Ca(r),r=this.toPosix(r);for(var e=-1,t=0,n=-1,i=!0,a=0,s=r.length-1;s>=0;--s){var o=r.charCodeAt(s);if(o===47){if(!i){t=s+1;break}continue}n===-1&&(i=!1,n=s+1),o===46?e===-1?e=s:a!==1&&(a=1):e!==-1&&(a=-1)}return e===-1||n===-1||a===0||a===1&&e===n-1&&e===t+1?"":r.slice(e,n)},parse:function(r){Ca(r);var e={root:"",dir:"",base:"",ext:"",name:""};if(r.length===0)return e;r=this.toPosix(r);var t=r.charCodeAt(0),n=this.isAbsolute(r),i;e.root=this.rootname(r),n||this.hasProtocol(r)?i=1:i=0;for(var a=-1,s=0,o=-1,l=!0,c=r.length-1,h=0;c>=i;--c){if(t=r.charCodeAt(c),t===47){if(!l){s=c+1;break}continue}o===-1&&(l=!1,o=c+1),t===46?a===-1?a=c:h!==1&&(h=1):a!==-1&&(h=-1)}return a===-1||o===-1||h===0||h===1&&a===o-1&&a===s+1?o!==-1&&(s===0&&n?e.base=e.name=r.slice(1,o):e.base=e.name=r.slice(s,o)):(s===0&&n?(e.name=r.slice(1,a),e.base=r.slice(1,o)):(e.name=r.slice(s,a),e.base=r.slice(s,o)),e.ext=r.slice(a,o)),e.dir=this.dirname(r),e},sep:"/",delimiter:":"};ht.RETINA_PREFIX=/@([0-9\.]+)x/;ht.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var S4=!1,GC="6.5.10";function OX(){S4=!0}function zO(r){var e;if(!S4){if(ht.ADAPTER.getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){var t=[` %c %c %c PixiJS `+GC+" - ✰ "+r+` ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ `,"background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(e=globalThis.console).log.apply(e,t)}else globalThis.console&&globalThis.console.log("PixiJS "+GC+" - "+r+" - http://www.pixijs.com/");S4=!0}}var jb;function UO(){return typeof jb>"u"&&(jb=(function(){var e={stencil:!0,failIfMajorPerformanceCaveat:ht.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!ht.ADAPTER.getWebGLRenderingContext())return!1;var t=ht.ADAPTER.createCanvas(),n=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),i=!!(n&&n.getContextAttributes().stencil);if(n){var a=n.getExtension("WEBGL_lose_context");a&&a.loseContext()}return n=null,i}catch{return!1}})()),jb}var DX="#f0f8ff",PX="#faebd7",IX="#00ffff",NX="#7fffd4",LX="#f0ffff",kX="#f5f5dc",BX="#ffe4c4",FX="#000000",zX="#ffebcd",UX="#0000ff",GX="#8a2be2",HX="#a52a2a",jX="#deb887",VX="#5f9ea0",qX="#7fff00",XX="#d2691e",YX="#ff7f50",WX="#6495ed",$X="#fff8dc",KX="#dc143c",ZX="#00ffff",QX="#00008b",JX="#008b8b",eY="#b8860b",tY="#a9a9a9",rY="#006400",nY="#a9a9a9",iY="#bdb76b",aY="#8b008b",sY="#556b2f",oY="#ff8c00",lY="#9932cc",uY="#8b0000",cY="#e9967a",hY="#8fbc8f",fY="#483d8b",dY="#2f4f4f",vY="#2f4f4f",pY="#00ced1",gY="#9400d3",mY="#ff1493",yY="#00bfff",bY="#696969",xY="#696969",_Y="#1e90ff",wY="#b22222",SY="#fffaf0",EY="#228b22",TY="#ff00ff",CY="#dcdcdc",AY="#f8f8ff",MY="#daa520",RY="#ffd700",OY="#808080",DY="#008000",PY="#adff2f",IY="#808080",NY="#f0fff0",LY="#ff69b4",kY="#cd5c5c",BY="#4b0082",FY="#fffff0",zY="#f0e68c",UY="#fff0f5",GY="#e6e6fa",HY="#7cfc00",jY="#fffacd",VY="#add8e6",qY="#f08080",XY="#e0ffff",YY="#fafad2",WY="#d3d3d3",$Y="#90ee90",KY="#d3d3d3",ZY="#ffb6c1",QY="#ffa07a",JY="#20b2aa",eW="#87cefa",tW="#778899",rW="#778899",nW="#b0c4de",iW="#ffffe0",aW="#00ff00",sW="#32cd32",oW="#faf0e6",lW="#ff00ff",uW="#800000",cW="#66cdaa",hW="#0000cd",fW="#ba55d3",dW="#9370db",vW="#3cb371",pW="#7b68ee",gW="#00fa9a",mW="#48d1cc",yW="#c71585",bW="#191970",xW="#f5fffa",_W="#ffe4e1",wW="#ffe4b5",SW="#ffdead",EW="#000080",TW="#fdf5e6",CW="#808000",AW="#6b8e23",MW="#ffa500",RW="#ff4500",OW="#da70d6",DW="#eee8aa",PW="#98fb98",IW="#afeeee",NW="#db7093",LW="#ffefd5",kW="#ffdab9",BW="#cd853f",FW="#ffc0cb",zW="#dda0dd",UW="#b0e0e6",GW="#800080",HW="#663399",jW="#ff0000",VW="#bc8f8f",qW="#4169e1",XW="#8b4513",YW="#fa8072",WW="#f4a460",$W="#2e8b57",KW="#fff5ee",ZW="#a0522d",QW="#c0c0c0",JW="#87ceeb",e$="#6a5acd",t$="#708090",r$="#708090",n$="#fffafa",i$="#00ff7f",a$="#4682b4",s$="#d2b48c",o$="#008080",l$="#d8bfd8",u$="#ff6347",c$="#40e0d0",h$="#ee82ee",f$="#f5deb3",d$="#ffffff",v$="#f5f5f5",p$="#ffff00",g$="#9acd32",m$={aliceblue:DX,antiquewhite:PX,aqua:IX,aquamarine:NX,azure:LX,beige:kX,bisque:BX,black:FX,blanchedalmond:zX,blue:UX,blueviolet:GX,brown:HX,burlywood:jX,cadetblue:VX,chartreuse:qX,chocolate:XX,coral:YX,cornflowerblue:WX,cornsilk:$X,crimson:KX,cyan:ZX,darkblue:QX,darkcyan:JX,darkgoldenrod:eY,darkgray:tY,darkgreen:rY,darkgrey:nY,darkkhaki:iY,darkmagenta:aY,darkolivegreen:sY,darkorange:oY,darkorchid:lY,darkred:uY,darksalmon:cY,darkseagreen:hY,darkslateblue:fY,darkslategray:dY,darkslategrey:vY,darkturquoise:pY,darkviolet:gY,deeppink:mY,deepskyblue:yY,dimgray:bY,dimgrey:xY,dodgerblue:_Y,firebrick:wY,floralwhite:SY,forestgreen:EY,fuchsia:TY,gainsboro:CY,ghostwhite:AY,goldenrod:MY,gold:RY,gray:OY,green:DY,greenyellow:PY,grey:IY,honeydew:NY,hotpink:LY,indianred:kY,indigo:BY,ivory:FY,khaki:zY,lavenderblush:UY,lavender:GY,lawngreen:HY,lemonchiffon:jY,lightblue:VY,lightcoral:qY,lightcyan:XY,lightgoldenrodyellow:YY,lightgray:WY,lightgreen:$Y,lightgrey:KY,lightpink:ZY,lightsalmon:QY,lightseagreen:JY,lightskyblue:eW,lightslategray:tW,lightslategrey:rW,lightsteelblue:nW,lightyellow:iW,lime:aW,limegreen:sW,linen:oW,magenta:lW,maroon:uW,mediumaquamarine:cW,mediumblue:hW,mediumorchid:fW,mediumpurple:dW,mediumseagreen:vW,mediumslateblue:pW,mediumspringgreen:gW,mediumturquoise:mW,mediumvioletred:yW,midnightblue:bW,mintcream:xW,mistyrose:_W,moccasin:wW,navajowhite:SW,navy:EW,oldlace:TW,olive:CW,olivedrab:AW,orange:MW,orangered:RW,orchid:OW,palegoldenrod:DW,palegreen:PW,paleturquoise:IW,palevioletred:NW,papayawhip:LW,peachpuff:kW,peru:BW,pink:FW,plum:zW,powderblue:UW,purple:GW,rebeccapurple:HW,red:jW,rosybrown:VW,royalblue:qW,saddlebrown:XW,salmon:YW,sandybrown:WW,seagreen:$W,seashell:KW,sienna:ZW,silver:QW,skyblue:JW,slateblue:e$,slategray:t$,slategrey:r$,snow:n$,springgreen:i$,steelblue:a$,tan:s$,teal:o$,thistle:l$,tomato:u$,turquoise:c$,violet:h$,wheat:f$,white:d$,whitesmoke:v$,yellow:p$,yellowgreen:g$};function pu(r,e){return e===void 0&&(e=[]),e[0]=(r>>16&255)/255,e[1]=(r>>8&255)/255,e[2]=(r&255)/255,e}function bw(r){var e=r.toString(16);return e="000000".substring(0,6-e.length)+e,"#"+e}function xw(r){return typeof r=="string"&&(r=m$[r.toLowerCase()]||r,r[0]==="#"&&(r=r.slice(1))),parseInt(r,16)}function y$(r){return(r[0]*255<<16)+(r[1]*255<<8)+(r[2]*255|0)}function b$(){for(var r=[],e=[],t=0;t<32;t++)r[t]=t,e[t]=t;r[Et.NORMAL_NPM]=Et.NORMAL,r[Et.ADD_NPM]=Et.ADD,r[Et.SCREEN_NPM]=Et.SCREEN,e[Et.NORMAL]=Et.NORMAL_NPM,e[Et.ADD]=Et.ADD_NPM,e[Et.SCREEN]=Et.SCREEN_NPM;var n=[];return n.push(e),n.push(r),n}var _w=b$();function ww(r,e){return _w[e?1:0][r]}function GO(r,e,t,n){return t=t||new Float32Array(4),n||n===void 0?(t[0]=r[0]*e,t[1]=r[1]*e,t[2]=r[2]*e):(t[0]=r[0],t[1]=r[1],t[2]=r[2]),t[3]=e,t}function Sg(r,e){if(e===1)return(e*255<<24)+r;if(e===0)return 0;var t=r>>16&255,n=r>>8&255,i=r&255;return t=t*e+.5|0,n=n*e+.5|0,i=i*e+.5|0,(e*255<<24)+(t<<16)+(n<<8)+i}function Sw(r,e,t,n){return t=t||new Float32Array(4),t[0]=(r>>16&255)/255,t[1]=(r>>8&255)/255,t[2]=(r&255)/255,(n||n===void 0)&&(t[0]*=e,t[1]*=e,t[2]*=e),t[3]=e,t}function HO(r,e){e===void 0&&(e=null);var t=r*6;if(e=e||new Uint16Array(t),e.length!==t)throw new Error("Out buffer length is incorrect, got "+e.length+" and expected "+t);for(var n=0,i=0;n>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r+1}function E4(r){return!(r&r-1)&&!!r}function T4(r){var e=(r>65535?1:0)<<4;r>>>=e;var t=(r>255?1:0)<<3;return r>>>=t,e|=t,t=(r>15?1:0)<<2,r>>>=t,e|=t,t=(r>3?1:0)<<1,r>>>=t,e|=t,e|r>>1}function lu(r,e,t){var n=r.length,i;if(!(e>=n||t===0)){t=e+t>n?n-e:t;var a=n-t;for(i=e;i"u"?console.warn("PixiJS Deprecation Warning: ",e+` Deprecated since v`+r):(n=n.split(` `).splice(t).join(` `),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",e+` Deprecated since v`+r),console.warn(n),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",e+` Deprecated since v`+r),console.warn(n))),HC[e]=!0}}var C4={},Ti=Object.create(null),ua=Object.create(null);function S$(){var r;for(r in Ti)Ti[r].destroy();for(r in ua)ua[r].destroy()}function E$(){var r;for(r in Ti)delete Ti[r];for(r in ua)delete ua[r]}var A4=(function(){function r(e,t,n){this.canvas=ht.ADAPTER.createCanvas(),this.context=this.canvas.getContext("2d"),this.resolution=n||ht.RESOLUTION,this.resize(e,t)}return r.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},r.prototype.resize=function(e,t){this.canvas.width=Math.round(e*this.resolution),this.canvas.height=Math.round(t*this.resolution)},r.prototype.destroy=function(){this.context=null,this.canvas=null},Object.defineProperty(r.prototype,"width",{get:function(){return this.canvas.width},set:function(e){this.canvas.width=Math.round(e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this.canvas.height},set:function(e){this.canvas.height=Math.round(e)},enumerable:!1,configurable:!0}),r})();function jO(r){var e=r.width,t=r.height,n=r.getContext("2d",{willReadFrequently:!0}),i=n.getImageData(0,0,e,t),a=i.data,s=a.length,o={top:null,left:null,right:null,bottom:null},l=null,c,h,d;for(c=0;c=this.x&&e=this.y&&te.right?e.right:this.right;if(i<=n)return!1;var a=this.ye.bottom?e.bottom:this.bottom;return s>a}var o=this.left,l=this.right,c=this.top,h=this.bottom;if(l<=o||h<=c)return!1;var d=bv[0].set(e.left,e.top),v=bv[1].set(e.left,e.bottom),g=bv[2].set(e.right,e.top),m=bv[3].set(e.right,e.bottom);if(g.x<=d.x||v.y<=d.y)return!1;var x=Math.sign(t.a*t.d-t.b*t.c);if(x===0||(t.apply(d,d),t.apply(v,v),t.apply(g,g),t.apply(m,m),Math.max(d.x,v.x,g.x,m.x)<=o||Math.min(d.x,v.x,g.x,m.x)>=l||Math.max(d.y,v.y,g.y,m.y)<=c||Math.min(d.y,v.y,g.y,m.y)>=h))return!1;var y=x*(v.y-d.y),_=x*(d.x-v.x),w=y*o+_*c,S=y*l+_*c,A=y*o+_*h,C=y*l+_*h;if(Math.max(w,S,A,C)<=y*d.x+_*d.y||Math.min(w,S,A,C)>=y*m.x+_*m.y)return!1;var M=x*(d.y-g.y),E=x*(g.x-d.x),O=M*o+E*c,D=M*l+E*c,I=M*o+E*h,k=M*l+E*h;return!(Math.max(O,D,I,k)<=M*d.x+E*d.y||Math.min(O,D,I,k)>=M*m.x+E*m.y)},r.prototype.pad=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=e),this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2,this},r.prototype.fit=function(e){var t=Math.max(this.x,e.x),n=Math.min(this.x+this.width,e.x+e.width),i=Math.max(this.y,e.y),a=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(n-t,0),this.y=i,this.height=Math.max(a-i,0),this},r.prototype.ceil=function(e,t){e===void 0&&(e=1),t===void 0&&(t=.001);var n=Math.ceil((this.x+this.width-t)*e)/e,i=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=n-this.x,this.height=i-this.y,this},r.prototype.enlarge=function(e){var t=Math.min(this.x,e.x),n=Math.max(this.x+this.width,e.x+e.width),i=Math.min(this.y,e.y),a=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=n-t,this.y=i,this.height=a-i,this},r.prototype.toString=function(){return"[@pixi/math:Rectangle x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},r})(),WO=(function(){function r(e,t,n){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0),this.x=e,this.y=t,this.radius=n,this.type=Mn.CIRC}return r.prototype.clone=function(){return new r(this.x,this.y,this.radius)},r.prototype.contains=function(e,t){if(this.radius<=0)return!1;var n=this.radius*this.radius,i=this.x-e,a=this.y-t;return i*=i,a*=a,i+a<=n},r.prototype.getBounds=function(){return new $t(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)},r.prototype.toString=function(){return"[@pixi/math:Circle x="+this.x+" y="+this.y+" radius="+this.radius+"]"},r})(),$O=(function(){function r(e,t,n,i){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0),i===void 0&&(i=0),this.x=e,this.y=t,this.width=n,this.height=i,this.type=Mn.ELIP}return r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.contains=function(e,t){if(this.width<=0||this.height<=0)return!1;var n=(e-this.x)/this.width,i=(t-this.y)/this.height;return n*=n,i*=i,n+i<=1},r.prototype.getBounds=function(){return new $t(this.x-this.width,this.y-this.height,this.width,this.height)},r.prototype.toString=function(){return"[@pixi/math:Ellipse x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},r})(),Uf=(function(){function r(){for(var e=arguments,t=[],n=0;nt!=h>t&&e<(c-o)*((t-l)/(h-l))+o;d&&(n=!n)}return n},r.prototype.toString=function(){return"[@pixi/math:Polygon"+("closeStroke="+this.closeStroke)+("points="+this.points.reduce(function(e,t){return e+", "+t},"")+"]")},r})(),KO=(function(){function r(e,t,n,i,a){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0),i===void 0&&(i=0),a===void 0&&(a=20),this.x=e,this.y=t,this.width=n,this.height=i,this.radius=a,this.type=Mn.RREC}return r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height,this.radius)},r.prototype.contains=function(e,t){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){var n=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+n&&t<=this.y+this.height-n||e>=this.x+n&&e<=this.x+this.width-n)return!0;var i=e-(this.x+n),a=t-(this.y+n),s=n*n;if(i*i+a*a<=s||(i=e-(this.x+this.width-n),i*i+a*a<=s)||(a=t-(this.y+this.height-n),i*i+a*a<=s)||(i=e-(this.x+n),i*i+a*a<=s))return!0}return!1},r.prototype.toString=function(){return"[@pixi/math:RoundedRectangle x="+this.x+" y="+this.y+("width="+this.width+" height="+this.height+" radius="+this.radius+"]")},r})(),Go=(function(){function r(e,t,n,i){n===void 0&&(n=0),i===void 0&&(i=0),this._x=n,this._y=i,this.cb=e,this.scope=t}return r.prototype.clone=function(e,t){return e===void 0&&(e=this.cb),t===void 0&&(t=this.scope),new r(e,t,this._x,this._y)},r.prototype.set=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=e),(this._x!==e||this._y!==t)&&(this._x=e,this._y=t,this.cb.call(this.scope)),this},r.prototype.copyFrom=function(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this.cb.call(this.scope)),this},r.prototype.copyTo=function(e){return e.set(this._x,this._y),e},r.prototype.equals=function(e){return e.x===this._x&&e.y===this._y},r.prototype.toString=function(){return"[@pixi/math:ObservablePoint x=0 y=0 scope="+this.scope+"]"},Object.defineProperty(r.prototype,"x",{get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"y",{get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),r})(),qr=(function(){function r(e,t,n,i,a,s){e===void 0&&(e=1),t===void 0&&(t=0),n===void 0&&(n=0),i===void 0&&(i=1),a===void 0&&(a=0),s===void 0&&(s=0),this.array=null,this.a=e,this.b=t,this.c=n,this.d=i,this.tx=a,this.ty=s}return r.prototype.fromArray=function(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]},r.prototype.set=function(e,t,n,i,a,s){return this.a=e,this.b=t,this.c=n,this.d=i,this.tx=a,this.ty=s,this},r.prototype.toArray=function(e,t){this.array||(this.array=new Float32Array(9));var n=t||this.array;return e?(n[0]=this.a,n[1]=this.b,n[2]=0,n[3]=this.c,n[4]=this.d,n[5]=0,n[6]=this.tx,n[7]=this.ty,n[8]=1):(n[0]=this.a,n[1]=this.c,n[2]=this.tx,n[3]=this.b,n[4]=this.d,n[5]=this.ty,n[6]=0,n[7]=0,n[8]=1),n},r.prototype.apply=function(e,t){t=t||new Ar;var n=e.x,i=e.y;return t.x=this.a*n+this.c*i+this.tx,t.y=this.b*n+this.d*i+this.ty,t},r.prototype.applyInverse=function(e,t){t=t||new Ar;var n=1/(this.a*this.d+this.c*-this.b),i=e.x,a=e.y;return t.x=this.d*n*i+-this.c*n*a+(this.ty*this.c-this.tx*this.d)*n,t.y=this.a*n*a+-this.b*n*i+(-this.ty*this.a+this.tx*this.b)*n,t},r.prototype.translate=function(e,t){return this.tx+=e,this.ty+=t,this},r.prototype.scale=function(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this},r.prototype.rotate=function(e){var t=Math.cos(e),n=Math.sin(e),i=this.a,a=this.c,s=this.tx;return this.a=i*t-this.b*n,this.b=i*n+this.b*t,this.c=a*t-this.d*n,this.d=a*n+this.d*t,this.tx=s*t-this.ty*n,this.ty=s*n+this.ty*t,this},r.prototype.append=function(e){var t=this.a,n=this.b,i=this.c,a=this.d;return this.a=e.a*t+e.b*i,this.b=e.a*n+e.b*a,this.c=e.c*t+e.d*i,this.d=e.c*n+e.d*a,this.tx=e.tx*t+e.ty*i+this.tx,this.ty=e.tx*n+e.ty*a+this.ty,this},r.prototype.setTransform=function(e,t,n,i,a,s,o,l,c){return this.a=Math.cos(o+c)*a,this.b=Math.sin(o+c)*a,this.c=-Math.sin(o-l)*s,this.d=Math.cos(o-l)*s,this.tx=e-(n*this.a+i*this.c),this.ty=t-(n*this.b+i*this.d),this},r.prototype.prepend=function(e){var t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){var n=this.a,i=this.c;this.a=n*e.a+this.b*e.c,this.b=n*e.b+this.b*e.d,this.c=i*e.a+this.d*e.c,this.d=i*e.b+this.d*e.d}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this},r.prototype.decompose=function(e){var t=this.a,n=this.b,i=this.c,a=this.d,s=e.pivot,o=-Math.atan2(-i,a),l=Math.atan2(n,t),c=Math.abs(o+l);return c<1e-5||Math.abs(cd-c)<1e-5?(e.rotation=l,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=o,e.skew.y=l),e.scale.x=Math.sqrt(t*t+n*n),e.scale.y=Math.sqrt(i*i+a*a),e.position.x=this.tx+(s.x*t+s.y*i),e.position.y=this.ty+(s.x*n+s.y*a),e},r.prototype.invert=function(){var e=this.a,t=this.b,n=this.c,i=this.d,a=this.tx,s=e*i-t*n;return this.a=i/s,this.b=-t/s,this.c=-n/s,this.d=e/s,this.tx=(n*this.ty-i*a)/s,this.ty=-(e*this.ty-t*a)/s,this},r.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},r.prototype.clone=function(){var e=new r;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},r.prototype.copyTo=function(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},r.prototype.copyFrom=function(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this},r.prototype.toString=function(){return"[@pixi/math:Matrix a="+this.a+" b="+this.b+" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+"]"},Object.defineProperty(r,"IDENTITY",{get:function(){return new r},enumerable:!1,configurable:!0}),Object.defineProperty(r,"TEMP_MATRIX",{get:function(){return new r},enumerable:!1,configurable:!0}),r})(),Kl=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Zl=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Ql=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Jl=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],M4=[],ZO=[],xv=Math.sign;function A$(){for(var r=0;r<16;r++){var e=[];M4.push(e);for(var t=0;t<16;t++)for(var n=xv(Kl[r]*Kl[t]+Ql[r]*Zl[t]),i=xv(Zl[r]*Kl[t]+Jl[r]*Zl[t]),a=xv(Kl[r]*Ql[t]+Ql[r]*Jl[t]),s=xv(Zl[r]*Ql[t]+Jl[r]*Jl[t]),o=0;o<16;o++)if(Kl[o]===n&&Zl[o]===i&&Ql[o]===a&&Jl[o]===s){e.push(o);break}}for(var r=0;r<16;r++){var l=new qr;l.set(Kl[r],Zl[r],Ql[r],Jl[r],0,0),ZO.push(l)}}A$();var Hr={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(r){return Kl[r]},uY:function(r){return Zl[r]},vX:function(r){return Ql[r]},vY:function(r){return Jl[r]},inv:function(r){return r&8?r&15:-r&7},add:function(r,e){return M4[r][e]},sub:function(r,e){return M4[r][Hr.inv(e)]},rotate180:function(r){return r^4},isVertical:function(r){return(r&3)===2},byDirection:function(r,e){return Math.abs(r)*2<=Math.abs(e)?e>=0?Hr.S:Hr.N:Math.abs(e)*2<=Math.abs(r)?r>0?Hr.E:Hr.W:e>0?r>0?Hr.SE:Hr.SW:r>0?Hr.NE:Hr.NW},matrixAppendRotationInv:function(r,e,t,n){t===void 0&&(t=0),n===void 0&&(n=0);var i=ZO[Hr.inv(e)];i.tx=t,i.ty=n,r.append(i)}},Tg=(function(){function r(){this.worldTransform=new qr,this.localTransform=new qr,this.position=new Go(this.onChange,this,0,0),this.scale=new Go(this.onChange,this,1,1),this.pivot=new Go(this.onChange,this,0,0),this.skew=new Go(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return r.prototype.onChange=function(){this._localID++},r.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},r.prototype.toString=function(){return"[@pixi/math:Transform "+("position=("+this.position.x+", "+this.position.y+") ")+("rotation="+this.rotation+" ")+("scale=("+this.scale.x+", "+this.scale.y+") ")+("skew=("+this.skew.x+", "+this.skew.y+") ")+"]"},r.prototype.updateLocalTransform=function(){var e=this.localTransform;this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1)},r.prototype.updateTransform=function(e){var t=this.localTransform;if(this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==e._worldID){var n=e.worldTransform,i=this.worldTransform;i.a=t.a*n.a+t.b*n.c,i.b=t.a*n.b+t.b*n.d,i.c=t.c*n.a+t.d*n.c,i.d=t.c*n.b+t.d*n.d,i.tx=t.tx*n.a+t.ty*n.c+n.tx,i.ty=t.tx*n.b+t.ty*n.d+n.ty,this._parentID=e._worldID,this._worldID++}},r.prototype.setFromMatrix=function(e){e.decompose(this),this._localID++},Object.defineProperty(r.prototype,"rotation",{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,this.updateSkew())},enumerable:!1,configurable:!0}),r.IDENTITY=new r,r})();/*! * @pixi/display - v6.5.10 * Compiled Thu, 06 Jul 2023 15:25:11 UTC * * @pixi/display is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license */ht.SORTABLE_CHILDREN=!1;var hd=(function(){function r(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}return r.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},r.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},r.prototype.getRectangle=function(e){return this.minX>this.maxX||this.minY>this.maxY?$t.EMPTY:(e=e||new $t(0,0,1,1),e.x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)},r.prototype.addPoint=function(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)},r.prototype.addPointMatrix=function(e,t){var n=e.a,i=e.b,a=e.c,s=e.d,o=e.tx,l=e.ty,c=n*t.x+a*t.y+o,h=i*t.x+s*t.y+l;this.minX=Math.min(this.minX,c),this.maxX=Math.max(this.maxX,c),this.minY=Math.min(this.minY,h),this.maxY=Math.max(this.maxY,h)},r.prototype.addQuad=function(e){var t=this.minX,n=this.minY,i=this.maxX,a=this.maxY,s=e[0],o=e[1];t=si?s:i,a=o>a?o:a,s=e[2],o=e[3],t=si?s:i,a=o>a?o:a,s=e[4],o=e[5],t=si?s:i,a=o>a?o:a,s=e[6],o=e[7],t=si?s:i,a=o>a?o:a,this.minX=t,this.minY=n,this.maxX=i,this.maxY=a},r.prototype.addFrame=function(e,t,n,i,a){this.addFrameMatrix(e.worldTransform,t,n,i,a)},r.prototype.addFrameMatrix=function(e,t,n,i,a){var s=e.a,o=e.b,l=e.c,c=e.d,h=e.tx,d=e.ty,v=this.minX,g=this.minY,m=this.maxX,x=this.maxY,y=s*t+l*n+h,_=o*t+c*n+d;v=ym?y:m,x=_>x?_:x,y=s*i+l*n+h,_=o*i+c*n+d,v=ym?y:m,x=_>x?_:x,y=s*t+l*a+h,_=o*t+c*a+d,v=ym?y:m,x=_>x?_:x,y=s*i+l*a+h,_=o*i+c*a+d,v=ym?y:m,x=_>x?_:x,this.minX=v,this.minY=g,this.maxX=m,this.maxY=x},r.prototype.addVertexData=function(e,t,n){for(var i=this.minX,a=this.minY,s=this.maxX,o=this.maxY,l=t;ls?c:s,o=h>o?h:o}this.minX=i,this.minY=a,this.maxX=s,this.maxY=o},r.prototype.addVertices=function(e,t,n,i){this.addVerticesMatrix(e.worldTransform,t,n,i)},r.prototype.addVerticesMatrix=function(e,t,n,i,a,s){a===void 0&&(a=0),s===void 0&&(s=a);for(var o=e.a,l=e.b,c=e.c,h=e.d,d=e.tx,v=e.ty,g=this.minX,m=this.minY,x=this.maxX,y=this.maxY,_=n;_i?e.maxX:i,this.maxY=e.maxY>a?e.maxY:a},r.prototype.addBoundsMask=function(e,t){var n=e.minX>t.minX?e.minX:t.minX,i=e.minY>t.minY?e.minY:t.minY,a=e.maxXc?a:c,this.maxY=s>h?s:h}},r.prototype.addBoundsMatrix=function(e,t){this.addFrameMatrix(t,e.minX,e.minY,e.maxX,e.maxY)},r.prototype.addBoundsArea=function(e,t){var n=e.minX>t.x?e.minX:t.x,i=e.minY>t.y?e.minY:t.y,a=e.maxXc?a:c,this.maxY=s>h?s:h}},r.prototype.pad=function(e,t){e===void 0&&(e=0),t===void 0&&(t=e),this.isEmpty()||(this.minX-=e,this.maxX+=e,this.minY-=t,this.maxY+=t)},r.prototype.addFramePad=function(e,t,n,i,a,s){e-=a,t-=s,n+=a,i+=s,this.minX=this.minXn?this.maxX:n,this.minY=this.minYi?this.maxY:i},r})();/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var R4=function(r,e){return R4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},R4(r,e)};function Ew(r,e){R4(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var ln=(function(r){Ew(e,r);function e(){var t=r.call(this)||this;return t.tempDisplayObjectParent=null,t.transform=new Tg,t.alpha=1,t.visible=!0,t.renderable=!0,t.cullable=!1,t.cullArea=null,t.parent=null,t.worldAlpha=1,t._lastSortedIndex=0,t._zIndex=0,t.filterArea=null,t.filters=null,t._enabledFilters=null,t._bounds=new hd,t._localBounds=null,t._boundsID=0,t._boundsRect=null,t._localBoundsRect=null,t._mask=null,t._maskRefCount=0,t._destroyed=!1,t.isSprite=!1,t.isMask=!1,t}return e.mixin=function(t){for(var n=Object.keys(t),i=0;i1)for(var a=0;athis.children.length)throw new Error(t+"addChildAt: The index "+n+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(n,0,t),this._boundsID++,this.onChildrenChange(n),t.emit("added",this),this.emit("childAdded",t,this,n),t},e.prototype.swapChildren=function(t,n){if(t!==n){var i=this.getChildIndex(t),a=this.getChildIndex(n);this.children[i]=n,this.children[a]=t,this.onChildrenChange(i=this.children.length)throw new Error("The index "+n+" supplied is out of bounds "+this.children.length);var i=this.getChildIndex(t);lu(this.children,i,1),this.children.splice(n,0,t),this.onChildrenChange(n)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(){for(var t=arguments,n=[],i=0;i1)for(var a=0;a0&&s<=a){o=this.children.splice(i,s);for(var l=0;l1&&this.children.sort(M$),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,n=this.children.length;t0&&n.height>0){var i,a;if(this.cullArea?(i=this.cullArea,a=this.worldTransform):this._render!==e.prototype._render&&(i=this.getBounds(!0)),i&&n.intersects(i,a))this._render(t);else if(this.cullArea)return;for(var s=0,o=this.children.length;s8)throw new Error("max arguments reached");var c=this,h=c.name,d=c.items;this._aliasCount++;for(var v=0,g=d.length;v0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},r.prototype.add=function(e){return e[this._name]&&(this.ensureNonAliasedItems(),this.remove(e),this.items.push(e)),this},r.prototype.remove=function(e){var t=this.items.indexOf(e);return t!==-1&&(this.ensureNonAliasedItems(),this.items.splice(t,1)),this},r.prototype.contains=function(e){return this.items.indexOf(e)!==-1},r.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},r.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(r.prototype,"empty",{get:function(){return this.items.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),r})();Object.defineProperties(Bn.prototype,{dispatch:{value:Bn.prototype.emit},run:{value:Bn.prototype.emit}});/*! * @pixi/ticker - v6.5.10 * Compiled Thu, 06 Jul 2023 15:25:11 UTC * * @pixi/ticker is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license */ht.TARGET_FPMS=.06;var is;(function(r){r[r.INTERACTION=50]="INTERACTION",r[r.HIGH=25]="HIGH",r[r.NORMAL=0]="NORMAL",r[r.LOW=-25]="LOW",r[r.UTILITY=-50]="UTILITY"})(is||(is={}));var Vb=(function(){function r(e,t,n,i){t===void 0&&(t=null),n===void 0&&(n=0),i===void 0&&(i=!1),this.next=null,this.previous=null,this._destroyed=!1,this.fn=e,this.context=t,this.priority=n,this.once=i}return r.prototype.match=function(e,t){return t===void 0&&(t=null),this.fn===e&&this.context===t},r.prototype.emit=function(e){this.fn&&(this.context?this.fn.call(this.context,e):this.fn(e));var t=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),t},r.prototype.connect=function(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this},r.prototype.destroy=function(e){e===void 0&&(e=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var t=this.next;return this.next=e?null:t,this.previous=null,t},r})(),Fn=(function(){function r(){var e=this;this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new Vb(null,null,1/0),this.deltaMS=1/ht.TARGET_FPMS,this.elapsedMS=1/ht.TARGET_FPMS,this._tick=function(t){e._requestId=null,e.started&&(e.update(t),e.started&&e._requestId===null&&e._head.next&&(e._requestId=requestAnimationFrame(e._tick)))}}return r.prototype._requestIfNeeded=function(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},r.prototype._cancelIfNeeded=function(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)},r.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},r.prototype.add=function(e,t,n){return n===void 0&&(n=is.NORMAL),this._addListener(new Vb(e,t,n))},r.prototype.addOnce=function(e,t,n){return n===void 0&&(n=is.NORMAL),this._addListener(new Vb(e,t,n,!0))},r.prototype._addListener=function(e){var t=this._head.next,n=this._head;if(!t)e.connect(n);else{for(;t;){if(e.priority>t.priority){e.connect(n);break}n=t,t=t.next}e.previous||e.connect(n)}return this._startIfPossible(),this},r.prototype.remove=function(e,t){for(var n=this._head.next;n;)n.match(e,t)?n=n.destroy():n=n.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(r.prototype,"count",{get:function(){if(!this._head)return 0;for(var e=0,t=this._head;t=t.next;)e++;return e},enumerable:!1,configurable:!0}),r.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},r.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},r.prototype.destroy=function(){if(!this._protected){this.stop();for(var e=this._head.next;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}},r.prototype.update=function(e){e===void 0&&(e=performance.now());var t;if(e>this.lastTime){if(t=this.elapsedMS=e-this.lastTime,t>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){var n=e-this._lastFrame|0;if(n=0;--i){var a=fd[i];if(a.test&&a.test(r,t))return new a(r,e)}throw new Error("Unrecognized source type to auto-detect Resource")}/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var O4=function(r,e){return O4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},O4(r,e)};function Ir(r,e){O4(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var D4=function(){return D4=Object.assign||function(e){for(var t=arguments,n,i=1,a=arguments.length;i0&&h>0,i.textureCacheIds=[],i.destroyed=!1,i.resource=null,i._batchEnabled=0,i._batchLocation=0,i.parentTextureArray=null,i.setResource(t),i}return Object.defineProperty(e.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mipmap",{get:function(){return this._mipmap},set:function(t){this._mipmap!==t&&(this._mipmap=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(t){this._scaleMode!==t&&(this._scaleMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(t){this._wrapMode!==t&&(this._wrapMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),e.prototype.setStyle=function(t,n){var i;return t!==void 0&&t!==this.scaleMode&&(this.scaleMode=t,i=!0),n!==void 0&&n!==this.mipmap&&(this.mipmap=n,i=!0),i&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,n,i){return i=i||this.resolution,this.setRealSize(t*i,n*i,i)},e.prototype.setRealSize=function(t,n,i){return this.resolution=i||this.resolution,this.width=Math.round(t)/this.resolution,this.height=Math.round(n)/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=E4(this.realWidth)&&E4(this.realHeight)},e.prototype.setResolution=function(t){var n=this.resolution;return n===t?this:(this.resolution=t,this.valid&&(this.width=Math.round(this.width*n)/t,this.height=Math.round(this.height*n)/t,this.emit("update",this)),this._refreshPOT(),this)},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.onError=function(t){this.emit("error",this,t)},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete ua[this.cacheId],delete Ti[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.prototype.castToBaseTexture=function(){return this},e.from=function(t,n,i){i===void 0&&(i=ht.STRICT_TEXTURE_CACHE);var a=typeof t=="string",s=null;if(a)s=t;else{if(!t._pixiId){var o=n&&n.pixiIdPrefix||"pixiid";t._pixiId=o+"_"+rl()}s=t._pixiId}var l=ua[s];if(a&&i&&!l)throw new Error('The cacheId "'+s+'" does not exist in BaseTextureCache.');return l||(l=new e(t,n),l.cacheId=s,e.addToCache(l,s)),l},e.fromBuffer=function(t,n,i,a){t=t||new Float32Array(n*i*4);var s=new wu(t,{width:n,height:i}),o=t instanceof Float32Array?wt.FLOAT:wt.UNSIGNED_BYTE;return new e(s,Object.assign({},O$,a||{width:n,height:i,type:o}))},e.addToCache=function(t,n){n&&(t.textureCacheIds.indexOf(n)===-1&&t.textureCacheIds.push(n),ua[n]&&console.warn("BaseTexture added to the cache with an id ["+n+"] that already had an entry"),ua[n]=t)},e.removeFromCache=function(t){if(typeof t=="string"){var n=ua[t];if(n){var i=n.textureCacheIds.indexOf(t);return i>-1&&n.textureCacheIds.splice(i,1),delete ua[t],n}}else if(t&&t.textureCacheIds){for(var a=0;a0)if(t.resource)this.addResourceAt(t.resource,n);else throw new Error("CubeResource does not support copying of renderTexture.");else t.target=Xo.TEXTURE_CUBE_MAP_POSITIVE_X+n,t.parentTextureArray=this.baseTexture,this.items[n]=t;return t.valid&&!this.valid&&this.resize(t.realWidth,t.realHeight),this.items[n]=t,this},e.prototype.upload=function(t,n,i){for(var a=this.itemDirtyIds,s=0;s)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,e})(as),Ow=(function(r){Ir(e,r);function e(t,n){var i=this;if(n=n||{},!(t instanceof HTMLVideoElement)){var a=document.createElement("video");a.setAttribute("preload","auto"),a.setAttribute("webkit-playsinline",""),a.setAttribute("playsinline",""),typeof t=="string"&&(t=[t]);var s=t[0].src||t[0];as.crossOrigin(a,s,n.crossorigin);for(var o=0;o2},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(Fn.shared.add(this.update,this),this._isConnectedToTicker=!0)},e.prototype._onPlayStop=function(){this._isConnectedToTicker&&(Fn.shared.remove(this.update,this),this._isConnectedToTicker=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var n=this.valid;this.resize(t.videoWidth,t.videoHeight),!n&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isConnectedToTicker&&(Fn.shared.remove(this.update,this),this._isConnectedToTicker=!1);var t=this.source;t&&(t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),r.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(Fn.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(Fn.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(t){t!==this._updateFPS&&(this._updateFPS=t)},enumerable:!1,configurable:!0}),e.test=function(t,n){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement||e.TYPES.indexOf(n)>-1},e.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],e.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},e})(as),Dw=(function(r){Ir(e,r);function e(t){return r.call(this,t)||this}return e.test=function(t){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&t instanceof ImageBitmap},e})(as);fd.push(Mg,Dw,Aw,Ow,Rw,wu,Mw,Cw);var JO={__proto__:null,Resource:gu,BaseImageResource:as,INSTALLED:fd,autoDetectResource:Cg,AbstractMultiResource:Ag,ArrayResource:Cw,BufferResource:wu,CanvasResource:Aw,CubeResource:Mw,ImageResource:Mg,SVGResource:Rw,VideoResource:Ow,ImageBitmapResource:Dw},D$=(function(r){Ir(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.upload=function(t,n,i){var a=t.gl;a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.alphaMode===xa.UNPACK);var s=n.realWidth,o=n.realHeight;return i.width===s&&i.height===o?a.texSubImage2D(n.target,0,0,0,s,o,n.format,i.type,this.data):(i.width=s,i.height=o,a.texImage2D(n.target,0,i.internalFormat,s,o,0,n.format,i.type,this.data)),!0},e})(wu),zp=(function(){function r(e,t){this.width=Math.round(e||100),this.height=Math.round(t||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new Bn("disposeFramebuffer"),this.multisample=Fr.NONE}return Object.defineProperty(r.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),r.prototype.addColorTexture=function(e,t){return e===void 0&&(e=0),this.colorTextures[e]=t||new Wt(null,{scaleMode:Da.NEAREST,resolution:1,mipmap:ba.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},r.prototype.addDepthTexture=function(e){return this.depthTexture=e||new Wt(new D$(null,{width:this.width,height:this.height}),{scaleMode:Da.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:ba.OFF,format:at.DEPTH_COMPONENT,type:wt.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},r.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},r.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},r.prototype.resize=function(e,t){if(e=Math.round(e),t=Math.round(t),!(e===this.width&&t===this.height)){this.width=e,this.height=t,this.dirtyId++,this.dirtySize++;for(var n=0;n-1&&n.textureCacheIds.splice(i,1),delete Ti[t],n}}else if(t&&t.textureCacheIds){for(var a=0;athis.baseTexture.width,l=i+s>this.baseTexture.height;if(o||l){var c=o&&l?"and":"or",h="X: "+n+" + "+a+" = "+(n+a)+" > "+this.baseTexture.width,d="Y: "+i+" + "+s+" = "+(i+s)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+(h+" "+c+" "+d))}this.valid=a&&s&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=t),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotate",{get:function(){return this._rotate},set:function(t){this._rotate=t,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),e.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(e,"EMPTY",{get:function(){return e._EMPTY||(e._EMPTY=new e(new Wt),_v(e._EMPTY),_v(e._EMPTY.baseTexture)),e._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"WHITE",{get:function(){if(!e._WHITE){var t=ht.ADAPTER.createCanvas(16,16),n=t.getContext("2d");t.width=16,t.height=16,n.fillStyle="white",n.fillRect(0,0,16,16),e._WHITE=new e(Wt.from(t)),_v(e._WHITE),_v(e._WHITE.baseTexture)}return e._WHITE},enumerable:!1,configurable:!0}),e})(Ks),nl=(function(r){Ir(e,r);function e(t,n){var i=r.call(this,t,n)||this;return i.valid=!0,i.filterFrame=null,i.filterPoolKey=null,i.updateUvs(),i}return Object.defineProperty(e.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(t){this.framebuffer.multisample=t},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,n,i){i===void 0&&(i=!0);var a=this.baseTexture.resolution,s=Math.round(t*a)/a,o=Math.round(n*a)/a;this.valid=s>0&&o>0,this._frame.width=this.orig.width=s,this._frame.height=this.orig.height=o,i&&this.baseTexture.resize(s,o),this.updateUvs()},e.prototype.setResolution=function(t){var n=this.baseTexture;n.resolution!==t&&(n.setResolution(t),this.resize(n.width,n.height,!1))},e.create=function(t){for(var n=arguments,i=[],a=1;a>>0,i>1&&(a+=i*4294967296)):a=i>1?-i:-1,this.texturePool[a]||(this.texturePool[a]=[]);var s=this.texturePool[a].pop();return s||(s=this.createTexture(e,t,i)),s.filterPoolKey=a,s.setResolution(n),s},r.prototype.getFilterTexture=function(e,t,n){var i=this.getOptimalTexture(e.width,e.height,t||e.resolution,n||Fr.NONE);return i.filterFrame=e.filterFrame,i},r.prototype.returnTexture=function(e){var t=e.filterPoolKey;e.filterFrame=null,this.texturePool[t].push(e)},r.prototype.returnFilterTexture=function(e){this.returnTexture(e)},r.prototype.clear=function(e){if(e=e!==!1,e)for(var t in this.texturePool){var n=this.texturePool[t];if(n)for(var i=0;i0&&e.height>0;for(var t in this.texturePool)if(Number(t)<0){var n=this.texturePool[t];if(n)for(var i=0;i1){for(var h=0;h1&&(d=this.getOptimalFilterTexture(h.width,h.height,t.resolution),d.filterFrame=h.filterFrame),n[v].apply(this,h,d,ha.CLEAR,t);var g=h;h=d,d=g}n[v].apply(this,h,c.renderTexture,ha.BLEND,t),v>1&&t.multisample>1&&this.returnFilterTexture(t.renderTexture),this.returnFilterTexture(h),this.returnFilterTexture(d)}t.clear(),this.statePool.push(t)},r.prototype.bindAndClear=function(e,t){t===void 0&&(t=ha.CLEAR);var n=this.renderer,i=n.renderTexture,a=n.state;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e&&e.filterFrame){var s=this.tempRect;s.x=0,s.y=0,s.width=e.filterFrame.width,s.height=e.filterFrame.height,i.bind(e,e.filterFrame,s)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?i.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var o=a.stateId&1||this.forceClear;(t===ha.CLEAR||t===ha.BLIT&&o)&&this.renderer.framebuffer.clear(0,0,0,0)},r.prototype.applyFilter=function(e,t,n,i){var a=this.renderer;a.state.set(e.state),this.bindAndClear(n,i),e.uniforms.uSampler=t,e.uniforms.filterGlobals=this.globalUniforms,a.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(t._frame,t.filterFrame),a.geometry.bind(this.quadUv),a.geometry.draw(pa.TRIANGLES)):(a.geometry.bind(this.quad),a.geometry.draw(pa.TRIANGLE_STRIP))},r.prototype.calculateSpriteMatrix=function(e,t){var n=this.activeState,i=n.sourceFrame,a=n.destinationFrame,s=t._texture.orig,o=e.set(a.width,0,0,a.height,i.x,i.y),l=t.worldTransform.copyTo(qr.TEMP_MATRIX);return l.invert(),o.prepend(l),o.scale(1/s.width,1/s.height),o.translate(t.anchor.x,t.anchor.y),o},r.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},r.prototype.getOptimalFilterTexture=function(e,t,n,i){return n===void 0&&(n=1),i===void 0&&(i=Fr.NONE),this.texturePool.getOptimalTexture(e,t,n,i)},r.prototype.getFilterTexture=function(e,t,n){if(typeof e=="number"){var i=e;e=t,t=i}e=e||this.activeState.renderTexture;var a=this.texturePool.getOptimalTexture(e.width,e.height,t||e.resolution,n||Fr.NONE);return a.filterFrame=e.filterFrame,a},r.prototype.returnFilterTexture=function(e){this.texturePool.returnTexture(e)},r.prototype.emptyPool=function(){this.texturePool.clear(!0)},r.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},r.prototype.transformAABB=function(e,t){var n=wv[0],i=wv[1],a=wv[2],s=wv[3];n.set(t.left,t.top),i.set(t.left,t.bottom),a.set(t.right,t.top),s.set(t.right,t.bottom),e.apply(n,n),e.apply(i,i),e.apply(a,a),e.apply(s,s);var o=Math.min(n.x,i.x,a.x,s.x),l=Math.min(n.y,i.y,a.y,s.y),c=Math.max(n.x,i.x,a.x,s.x),h=Math.max(n.y,i.y,a.y,s.y);t.x=o,t.y=l,t.width=c-o,t.height=h-l},r.prototype.roundFrame=function(e,t,n,i,a){if(!(e.width<=0||e.height<=0||n.width<=0||n.height<=0)){if(a){var s=a.a,o=a.b,l=a.c,c=a.d;if((Math.abs(o)>1e-4||Math.abs(l)>1e-4)&&(Math.abs(s)>1e-4||Math.abs(c)>1e-4))return}a=a?qb.copyFrom(a):qb.identity(),a.translate(-n.x,-n.y).scale(i.width/n.width,i.height/n.height).translate(i.x,i.y),this.transformAABB(a,e),e.ceil(t),this.transformAABB(a.invert(),e)}},r})(),kd=(function(){function r(e){this.renderer=e}return r.prototype.flush=function(){},r.prototype.destroy=function(){this.renderer=null},r.prototype.start=function(){},r.prototype.stop=function(){this.flush()},r.prototype.render=function(e){},r})(),kw=(function(){function r(e){this.renderer=e,this.emptyRenderer=new kd(e),this.currentRenderer=this.emptyRenderer}return r.prototype.setObjectRenderer=function(e){this.currentRenderer!==e&&(this.currentRenderer.stop(),this.currentRenderer=e,this.currentRenderer.start())},r.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},r.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},r.prototype.copyBoundTextures=function(e,t){for(var n=this.renderer.texture.boundTextures,i=t-1;i>=0;--i)e[i]=n[i]||null,e[i]&&(e[i]._batchLocation=i)},r.prototype.boundArray=function(e,t,n,i){for(var a=e.elements,s=e.ids,o=e.count,l=0,c=0;c=0&&d=ns.WEBGL2&&(n=e.getContext("webgl2",t)),n)this.webGLVersion=2;else if(this.webGLVersion=1,n=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),!n)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=n,this.getExtensions(),this.gl},r.prototype.getExtensions=function(){var e=this.gl,t={loseContext:e.getExtension("WEBGL_lose_context"),anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc")};this.webGLVersion===1?Object.assign(this.extensions,t,{drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,t,{colorBufferFloat:e.getExtension("EXT_color_buffer_float")})},r.prototype.handleContextLost=function(e){var t=this;e.preventDefault(),setTimeout(function(){t.gl.isContextLost()&&t.extensions.loseContext&&t.extensions.loseContext.restoreContext()},0)},r.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},r.prototype.destroy=function(){var e=this.renderer.view;this.renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},r.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},r.prototype.validateContext=function(e){var t=e.getContextAttributes(),n="WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext;n&&(this.webGLVersion=2),t&&!t.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var i=n||!!e.getExtension("OES_element_index_uint");this.supports.uint32Indices=i,i||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},r})(),nD=(function(){function r(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=Fr.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}return r})(),F$=new $t,Fw=(function(){function r(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new zp(10,10),this.msaaSamples=null}return r.prototype.contextChange=function(){this.disposeAll(!0);var e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new $t,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){var t=this.renderer.context.extensions.drawBuffers,n=this.renderer.context.extensions.depthTexture;ht.PREFER_ENV===ns.WEBGL_LEGACY&&(t=null,n=null),t?e.drawBuffers=function(i){return t.drawBuffersWEBGL(i)}:(this.hasMRT=!1,e.drawBuffers=function(){}),n||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)},r.prototype.bind=function(e,t,n){n===void 0&&(n=0);var i=this.gl;if(e){var a=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,i.bindFramebuffer(i.FRAMEBUFFER,a.framebuffer)),a.mipLevel!==n&&(e.dirtyId++,e.dirtyFormat++,a.mipLevel=n),a.dirtyId!==e.dirtyId&&(a.dirtyId=e.dirtyId,a.dirtyFormat!==e.dirtyFormat?(a.dirtyFormat=e.dirtyFormat,a.dirtySize=e.dirtySize,this.updateFramebuffer(e,n)):a.dirtySize!==e.dirtySize&&(a.dirtySize=e.dirtySize,this.resizeFramebuffer(e)));for(var s=0;s>n,c=t.height>>n,h=l/t.width;this.setViewport(t.x*h,t.y*h,l,c)}else{var l=e.width>>n,c=e.height>>n;this.setViewport(0,0,l,c)}}else this.current&&(this.current=null,i.bindFramebuffer(i.FRAMEBUFFER,null)),t?this.setViewport(t.x,t.y,t.width,t.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},r.prototype.setViewport=function(e,t,n,i){var a=this.viewport;e=Math.round(e),t=Math.round(t),n=Math.round(n),i=Math.round(i),(a.width!==n||a.height!==i||a.x!==e||a.y!==t)&&(a.x=e,a.y=t,a.width=n,a.height=i,this.gl.viewport(e,t,n,i))},Object.defineProperty(r.prototype,"size",{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),r.prototype.clear=function(e,t,n,i,a){a===void 0&&(a=ad.COLOR|ad.DEPTH);var s=this.gl;s.clearColor(e,t,n,i),s.clear(a)},r.prototype.initFramebuffer=function(e){var t=this.gl,n=new nD(t.createFramebuffer());return n.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=n,this.managedFramebuffers.push(e),e.disposeRunner.add(this),n},r.prototype.resizeFramebuffer=function(e){var t=this.gl,n=e.glFramebuffers[this.CONTEXT_UID];n.msaaBuffer&&(t.bindRenderbuffer(t.RENDERBUFFER,n.msaaBuffer),t.renderbufferStorageMultisample(t.RENDERBUFFER,n.multisample,t.RGBA8,e.width,e.height)),n.stencil&&(t.bindRenderbuffer(t.RENDERBUFFER,n.stencil),n.msaaBuffer?t.renderbufferStorageMultisample(t.RENDERBUFFER,n.multisample,t.DEPTH24_STENCIL8,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,e.width,e.height));var i=e.colorTextures,a=i.length;t.drawBuffers||(a=Math.min(a,1));for(var s=0;s1&&this.canMultisampleFramebuffer(e)?(i.msaaBuffer=i.msaaBuffer||n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,i.msaaBuffer),n.renderbufferStorageMultisample(n.RENDERBUFFER,i.multisample,n.RGBA8,e.width,e.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,i.msaaBuffer)):i.msaaBuffer&&(n.deleteRenderbuffer(i.msaaBuffer),i.msaaBuffer=null,i.blitFramebuffer&&(i.blitFramebuffer.dispose(),i.blitFramebuffer=null));for(var o=[],l=0;l1&&n.drawBuffers(o),e.depthTexture){var d=this.writeDepthTexture;if(d){var v=e.depthTexture;this.renderer.texture.bind(v,0),n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,v._glTextures[this.CONTEXT_UID].texture,t)}}(e.stencil||e.depth)&&!(e.depthTexture&&this.writeDepthTexture)?(i.stencil=i.stencil||n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,i.stencil),i.msaaBuffer?n.renderbufferStorageMultisample(n.RENDERBUFFER,i.multisample,n.DEPTH24_STENCIL8,e.width,e.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,e.width,e.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,i.stencil)):i.stencil&&(n.deleteRenderbuffer(i.stencil),i.stencil=null)},r.prototype.canMultisampleFramebuffer=function(e){return this.renderer.context.webGLVersion!==1&&e.colorTextures.length<=1&&!e.depthTexture},r.prototype.detectSamples=function(e){var t=this.msaaSamples,n=Fr.NONE;if(e<=1||t===null)return n;for(var i=0;i=0&&this.managedFramebuffers.splice(a,1),e.disposeRunner.remove(this),t||(i.deleteFramebuffer(n.framebuffer),n.msaaBuffer&&i.deleteRenderbuffer(n.msaaBuffer),n.stencil&&i.deleteRenderbuffer(n.stencil)),n.blitFramebuffer&&n.blitFramebuffer.dispose()}},r.prototype.disposeAll=function(e){var t=this.managedFramebuffers;this.managedFramebuffers=[];for(var n=0;n=ns.WEBGL2&&(e=r.getContext("webgl2",{})),e||(e=r.getContext("webgl",{})||r.getContext("experimental-webgl",{}),e?e.getExtension("WEBGL_draw_buffers"):e=null),vf=e}return vf}var Sv;function U$(){if(!Sv){Sv=Oi.MEDIUM;var r=oD();if(r&&r.getShaderPrecisionFormat){var e=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT);Sv=e.precision?Oi.HIGH:Oi.MEDIUM}}return Sv}function $C(r,e,t){if(r.substring(0,9)!=="precision"){var n=e;return e===Oi.HIGH&&t!==Oi.HIGH&&(n=Oi.MEDIUM),"precision "+n+` float; `+r}else if(t!==Oi.HIGH&&r.substring(0,15)==="precision highp")return r.replace("precision highp","precision mediump");return r}var G$={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function lD(r){return G$[r]}var Ev=null,KC={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function uD(r,e){if(!Ev){var t=Object.keys(KC);Ev={};for(var n=0;n0&&(e+=` else `),t"u"?.5:t,this.isSimple=!1}return Object.defineProperty(r.prototype,"texture",{get:function(){return this._texture},set:function(e){this._texture=e,this._textureID=-1},enumerable:!1,configurable:!0}),r.prototype.multiplyUvs=function(e,t){t===void 0&&(t=e);for(var n=this.mapCoord,i=0;i0?this.maskStack[this.maskStack.length-1]._colorMask:15;n!==t&&this.renderer.gl.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)},r.prototype.destroy=function(){this.renderer=null},r})(),fD=(function(){function r(e){this.renderer=e,this.maskStack=[],this.glConst=0}return r.prototype.getStackLength=function(){return this.maskStack.length},r.prototype.setMaskStack=function(e){var t=this.renderer.gl,n=this.getStackLength();this.maskStack=e;var i=this.getStackLength();i!==n&&(i===0?t.disable(this.glConst):(t.enable(this.glConst),this._useCurrent()))},r.prototype._useCurrent=function(){},r.prototype.destroy=function(){this.renderer=null,this.maskStack=null},r})(),QC=new qr,JC=[],Gw=(function(r){Ir(e,r);function e(t){var n=r.call(this,t)||this;return n.glConst=ht.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST,n}return e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._scissorCounter:0},e.prototype.calcScissorRect=function(t){var n;if(!t._scissorRectLocal){var i=t._scissorRect,a=t.maskObject,s=this.renderer,o=s.renderTexture,l=a.getBounds(!0,(n=JC.pop())!==null&&n!==void 0?n:new $t);this.roundFrameToPixels(l,o.current?o.current.resolution:s.resolution,o.sourceFrame,o.destinationFrame,s.projection.transform),i&&l.fit(i),t._scissorRectLocal=l}},e.isMatrixRotated=function(t){if(!t)return!1;var n=t.a,i=t.b,a=t.c,s=t.d;return(Math.abs(i)>1e-4||Math.abs(a)>1e-4)&&(Math.abs(n)>1e-4||Math.abs(s)>1e-4)},e.prototype.testScissor=function(t){var n=t.maskObject;if(!n.isFastRect||!n.isFastRect()||e.isMatrixRotated(n.worldTransform)||e.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(t);var i=t._scissorRectLocal;return i.width>0&&i.height>0},e.prototype.roundFrameToPixels=function(t,n,i,a,s){e.isMatrixRotated(s)||(s=s?QC.copyFrom(s):QC.identity(),s.translate(-i.x,-i.y).scale(a.width/i.width,a.height/i.height).translate(a.x,a.y),this.renderer.filter.transformAABB(s,t),t.fit(a),t.x=Math.round(t.x*n),t.y=Math.round(t.y*n),t.width=Math.round(t.width*n),t.height=Math.round(t.height*n))},e.prototype.push=function(t){t._scissorRectLocal||this.calcScissorRect(t);var n=this.renderer.gl;t._scissorRect||n.enable(n.SCISSOR_TEST),t._scissorCounter++,t._scissorRect=t._scissorRectLocal,this._useCurrent()},e.prototype.pop=function(t){var n=this.renderer.gl;t&&JC.push(t._scissorRectLocal),this.getStackLength()>0?this._useCurrent():n.disable(n.SCISSOR_TEST)},e.prototype._useCurrent=function(){var t=this.maskStack[this.maskStack.length-1]._scissorRect,n;this.renderer.renderTexture.current?n=t.y:n=this.renderer.height-t.height-t.y,this.renderer.gl.scissor(t.x,n,t.width,t.height)},e})(fD),Hw=(function(r){Ir(e,r);function e(t){var n=r.call(this,t)||this;return n.glConst=ht.ADAPTER.getWebGLRenderingContext().STENCIL_TEST,n}return e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0},e.prototype.push=function(t){var n=t.maskObject,i=this.renderer.gl,a=t._stencilCounter;a===0&&(this.renderer.framebuffer.forceStencil(),i.clearStencil(0),i.clear(i.STENCIL_BUFFER_BIT),i.enable(i.STENCIL_TEST)),t._stencilCounter++;var s=t._colorMask;s!==0&&(t._colorMask=0,i.colorMask(!1,!1,!1,!1)),i.stencilFunc(i.EQUAL,a,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.INCR),n.renderable=!0,n.render(this.renderer),this.renderer.batch.flush(),n.renderable=!1,s!==0&&(t._colorMask=s,i.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)),this._useCurrent()},e.prototype.pop=function(t){var n=this.renderer.gl;if(this.getStackLength()===0)n.disable(n.STENCIL_TEST);else{var i=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,a=i?i._colorMask:15;a!==0&&(i._colorMask=0,n.colorMask(!1,!1,!1,!1)),n.stencilOp(n.KEEP,n.KEEP,n.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,a!==0&&(i._colorMask=a,n.colorMask((a&1)!==0,(a&2)!==0,(a&4)!==0,(a&8)!==0)),this._useCurrent()}},e.prototype._useCurrent=function(){var t=this.renderer.gl;t.stencilFunc(t.EQUAL,this.getStackLength(),4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)},e})(fD),jw=(function(){function r(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new qr,this.transform=null}return r.prototype.update=function(e,t,n,i){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=t||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,n,i),this.transform&&this.projectionMatrix.append(this.transform);var a=this.renderer;a.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,a.globalUniforms.update(),a.shader.shader&&a.shader.syncUniformGroup(a.shader.shader.uniforms.globals)},r.prototype.calculateProjection=function(e,t,n,i){var a=this.projectionMatrix,s=i?-1:1;a.identity(),a.a=1/t.width*2,a.d=s*(1/t.height*2),a.tx=-1-t.x*a.a,a.ty=-s-t.y*a.d},r.prototype.setTransform=function(e){},r.prototype.destroy=function(){this.renderer=null},r})(),zl=new $t,gf=new $t,Vw=(function(){function r(e){this.renderer=e,this.clearColor=e._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new $t,this.destinationFrame=new $t,this.viewportFrame=new $t}return r.prototype.bind=function(e,t,n){e===void 0&&(e=null);var i=this.renderer;this.current=e;var a,s,o;e?(a=e.baseTexture,o=a.resolution,t||(zl.width=e.frame.width,zl.height=e.frame.height,t=zl),n||(gf.x=e.frame.x,gf.y=e.frame.y,gf.width=t.width,gf.height=t.height,n=gf),s=a.framebuffer):(o=i.resolution,t||(zl.width=i.screen.width,zl.height=i.screen.height,t=zl),n||(n=zl,n.width=t.width,n.height=t.height));var l=this.viewportFrame;l.x=n.x*o,l.y=n.y*o,l.width=n.width*o,l.height=n.height*o,e||(l.y=i.view.height-(l.y+l.height)),l.ceil(),this.renderer.framebuffer.bind(s,l),this.renderer.projection.update(n,t,o,!s),e?this.renderer.mask.setMaskStack(a.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(t),this.destinationFrame.copyFrom(n)},r.prototype.clear=function(e,t){this.current?e=e||this.current.baseTexture.clearColor:e=e||this.clearColor;var n=this.destinationFrame,i=this.current?this.current.baseTexture:this.renderer.screen,a=n.width!==i.width||n.height!==i.height;if(a){var s=this.viewportFrame,o=s.x,l=s.y,c=s.width,h=s.height;o=Math.round(o),l=Math.round(l),c=Math.round(c),h=Math.round(h),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(o,l,c,h)}this.renderer.framebuffer.clear(e[0],e[1],e[2],e[3],t),a&&this.renderer.scissor.pop()},r.prototype.resize=function(){this.bind(null)},r.prototype.reset=function(){this.bind(null)},r.prototype.destroy=function(){this.renderer=null},r})();function tK(r,e,t,n,i){t.buffer.update(i)}var rK={float:` data[offset] = v; `,vec2:` data[offset] = v[0]; data[offset+1] = v[1]; `,vec3:` data[offset] = v[0]; data[offset+1] = v[1]; data[offset+2] = v[2]; `,vec4:` data[offset] = v[0]; data[offset+1] = v[1]; data[offset+2] = v[2]; data[offset+3] = v[3]; `,mat2:` data[offset] = v[0]; data[offset+1] = v[1]; data[offset+4] = v[2]; data[offset+5] = v[3]; `,mat3:` data[offset] = v[0]; data[offset+1] = v[1]; data[offset+2] = v[2]; data[offset + 4] = v[3]; data[offset + 5] = v[4]; data[offset + 6] = v[5]; data[offset + 8] = v[6]; data[offset + 9] = v[7]; data[offset + 10] = v[8]; `,mat4:` for(var i = 0; i < 16; i++) { data[offset + i] = v[i]; } `},dD={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:32,mat3:48,mat4:64};function vD(r){for(var e=r.map(function(l){return{data:l,offset:0,dataLen:0,dirty:0}}),t=0,n=0,i=0,a=0;a1&&(t=Math.max(t,16)*s.data.size),s.dataLen=t,n%t!==0&&n<16){var o=n%t%16;n+=o,i+=o}n+t>16?(i=Math.ceil(i/16)*16,s.offset=i,i+=t,n=t):(s.offset=i,n+=t,i+=t)}return i=Math.ceil(i/16)*16,{uboElements:e,size:i}}function pD(r,e){var t=[];for(var n in r)e[n]&&t.push(e[n]);return t.sort(function(i,a){return i.index-a.index}),t}function gD(r,e){if(!r.autoManage)return{size:0,syncFunc:tK};for(var t=pD(r.uniforms,e),n=vD(t),i=n.uboElements,a=n.size,s=[` var v = null; var v2 = null; var cv = null; var t = 0; var gl = renderer.gl var index = 0; var data = buffer.data; `],o=0;o1){var m=lD(l.data.type),x=Math.max(dD[l.data.type]/16,1),y=m/x,_=(4-y%4)%4;s.push(` cv = ud.`+h+`.value; v = uv.`+h+`; offset = `+l.offset/4+`; t = 0; for(var i=0; i < `+l.data.size*x+`; i++) { for(var j = 0; j < `+y+`; j++) { data[offset++] = v[t++]; } offset += `+_+`; } `)}else{var w=rK[l.data.type];s.push(` cv = ud.`+h+`.value; v = uv.`+h+`; offset = `+l.offset/4+`; `+w+`; `)}}return s.push(` renderer.buffer.update(buffer); `),{size:a,syncFunc:new Function("ud","uv","renderer","syncData","buffer",s.join(` `))}}var nK=(function(){function r(){}return r})(),mD=(function(){function r(e,t){this.program=e,this.uniformData=t,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return r.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},r})();function iK(r,e){for(var t={},n=e.getProgramParameter(r,e.ACTIVE_ATTRIBUTES),i=0;id?1:-1});for(var s=0;s>1,n++;this.stateId=e.data}for(var n=0;nthis.checkCountMax&&(this.checkCount=0,this.run())))},r.prototype.run=function(){for(var e=this.renderer.texture,t=e.managedTextures,n=!1,i=0;ithis.maxIdle&&(e.destroyTexture(a,!0),t[i]=null,n=!0)}if(n){for(var s=0,i=0;i=0;i--)this.unload(e.children[i])},r.prototype.destroy=function(){this.renderer=null},r})();function vK(r){var e,t,n,i,a,s,o,l,c,h,d,v,g,m,x,y,_,w,S,A,C,M,E;return"WebGL2RenderingContext"in globalThis&&r instanceof globalThis.WebGL2RenderingContext?E=(e={},e[wt.UNSIGNED_BYTE]=(t={},t[at.RGBA]=r.RGBA8,t[at.RGB]=r.RGB8,t[at.RG]=r.RG8,t[at.RED]=r.R8,t[at.RGBA_INTEGER]=r.RGBA8UI,t[at.RGB_INTEGER]=r.RGB8UI,t[at.RG_INTEGER]=r.RG8UI,t[at.RED_INTEGER]=r.R8UI,t[at.ALPHA]=r.ALPHA,t[at.LUMINANCE]=r.LUMINANCE,t[at.LUMINANCE_ALPHA]=r.LUMINANCE_ALPHA,t),e[wt.BYTE]=(n={},n[at.RGBA]=r.RGBA8_SNORM,n[at.RGB]=r.RGB8_SNORM,n[at.RG]=r.RG8_SNORM,n[at.RED]=r.R8_SNORM,n[at.RGBA_INTEGER]=r.RGBA8I,n[at.RGB_INTEGER]=r.RGB8I,n[at.RG_INTEGER]=r.RG8I,n[at.RED_INTEGER]=r.R8I,n),e[wt.UNSIGNED_SHORT]=(i={},i[at.RGBA_INTEGER]=r.RGBA16UI,i[at.RGB_INTEGER]=r.RGB16UI,i[at.RG_INTEGER]=r.RG16UI,i[at.RED_INTEGER]=r.R16UI,i[at.DEPTH_COMPONENT]=r.DEPTH_COMPONENT16,i),e[wt.SHORT]=(a={},a[at.RGBA_INTEGER]=r.RGBA16I,a[at.RGB_INTEGER]=r.RGB16I,a[at.RG_INTEGER]=r.RG16I,a[at.RED_INTEGER]=r.R16I,a),e[wt.UNSIGNED_INT]=(s={},s[at.RGBA_INTEGER]=r.RGBA32UI,s[at.RGB_INTEGER]=r.RGB32UI,s[at.RG_INTEGER]=r.RG32UI,s[at.RED_INTEGER]=r.R32UI,s[at.DEPTH_COMPONENT]=r.DEPTH_COMPONENT24,s),e[wt.INT]=(o={},o[at.RGBA_INTEGER]=r.RGBA32I,o[at.RGB_INTEGER]=r.RGB32I,o[at.RG_INTEGER]=r.RG32I,o[at.RED_INTEGER]=r.R32I,o),e[wt.FLOAT]=(l={},l[at.RGBA]=r.RGBA32F,l[at.RGB]=r.RGB32F,l[at.RG]=r.RG32F,l[at.RED]=r.R32F,l[at.DEPTH_COMPONENT]=r.DEPTH_COMPONENT32F,l),e[wt.HALF_FLOAT]=(c={},c[at.RGBA]=r.RGBA16F,c[at.RGB]=r.RGB16F,c[at.RG]=r.RG16F,c[at.RED]=r.R16F,c),e[wt.UNSIGNED_SHORT_5_6_5]=(h={},h[at.RGB]=r.RGB565,h),e[wt.UNSIGNED_SHORT_4_4_4_4]=(d={},d[at.RGBA]=r.RGBA4,d),e[wt.UNSIGNED_SHORT_5_5_5_1]=(v={},v[at.RGBA]=r.RGB5_A1,v),e[wt.UNSIGNED_INT_2_10_10_10_REV]=(g={},g[at.RGBA]=r.RGB10_A2,g[at.RGBA_INTEGER]=r.RGB10_A2UI,g),e[wt.UNSIGNED_INT_10F_11F_11F_REV]=(m={},m[at.RGB]=r.R11F_G11F_B10F,m),e[wt.UNSIGNED_INT_5_9_9_9_REV]=(x={},x[at.RGB]=r.RGB9_E5,x),e[wt.UNSIGNED_INT_24_8]=(y={},y[at.DEPTH_STENCIL]=r.DEPTH24_STENCIL8,y),e[wt.FLOAT_32_UNSIGNED_INT_24_8_REV]=(_={},_[at.DEPTH_STENCIL]=r.DEPTH32F_STENCIL8,_),e):E=(w={},w[wt.UNSIGNED_BYTE]=(S={},S[at.RGBA]=r.RGBA,S[at.RGB]=r.RGB,S[at.ALPHA]=r.ALPHA,S[at.LUMINANCE]=r.LUMINANCE,S[at.LUMINANCE_ALPHA]=r.LUMINANCE_ALPHA,S),w[wt.UNSIGNED_SHORT_5_6_5]=(A={},A[at.RGB]=r.RGB,A),w[wt.UNSIGNED_SHORT_4_4_4_4]=(C={},C[at.RGBA]=r.RGBA,C),w[wt.UNSIGNED_SHORT_5_5_5_1]=(M={},M[at.RGBA]=r.RGBA,M),w),E}var vp=(function(){function r(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=wt.UNSIGNED_BYTE,this.internalFormat=at.RGBA,this.samplerType=0}return r})(),Ww=(function(){function r(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new Wt,this.hasIntegerTextures=!1}return r.prototype.contextChange=function(){var e=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=vK(e);var t=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=t;for(var n=0;n=0;--s){var o=n[s];if(o){var l=o._glTextures[a];l.samplerType!==sd.FLOAT&&this.renderer.texture.unbind(o)}}},r.prototype.initTexture=function(e){var t=new vp(this.gl.createTexture());return t.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=t,this.managedTextures.push(e),e.on("dispose",this.destroyTexture,this),t},r.prototype.initTextureType=function(e,t){var n,i;t.internalFormat=(i=(n=this.internalFormats[e.type])===null||n===void 0?void 0:n[e.format])!==null&&i!==void 0?i:e.format,this.webGLVersion===2&&e.type===wt.HALF_FLOAT?t.type=this.gl.HALF_FLOAT:t.type=e.type},r.prototype.updateTexture=function(e){var t=e._glTextures[this.CONTEXT_UID];if(t){var n=this.renderer;if(this.initTextureType(e,t),e.resource&&e.resource.upload(n,e,t))t.samplerType!==sd.FLOAT&&(this.hasIntegerTextures=!0);else{var i=e.realWidth,a=e.realHeight,s=n.gl;(t.width!==i||t.height!==a||t.dirtyId<0)&&(t.width=i,t.height=a,s.texImage2D(e.target,0,t.internalFormat,i,a,0,e.format,t.type,null))}e.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(e),t.dirtyId=e.dirtyId}},r.prototype.destroyTexture=function(e,t){var n=this.gl;if(e=e.castToBaseTexture(),e._glTextures[this.CONTEXT_UID]&&(this.unbind(e),n.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off("dispose",this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!t)){var i=this.managedTextures.indexOf(e);i!==-1&&lu(this.managedTextures,i,1)}},r.prototype.updateTextureStyle=function(e){var t=e._glTextures[this.CONTEXT_UID];t&&((e.mipmap===ba.POW2||this.webGLVersion!==2)&&!e.isPowerOfTwo?t.mipmap=!1:t.mipmap=e.mipmap>=1,this.webGLVersion!==2&&!e.isPowerOfTwo?t.wrapMode=Ia.CLAMP:t.wrapMode=e.wrapMode,e.resource&&e.resource.style(this.renderer,e,t)||this.setStyle(e,t),t.dirtyStyleId=e.dirtyStyleId)},r.prototype.setStyle=function(e,t){var n=this.gl;if(t.mipmap&&e.mipmap!==ba.ON_MANUAL&&n.generateMipmap(e.target),n.texParameteri(e.target,n.TEXTURE_WRAP_S,t.wrapMode),n.texParameteri(e.target,n.TEXTURE_WRAP_T,t.wrapMode),t.mipmap){n.texParameteri(e.target,n.TEXTURE_MIN_FILTER,e.scaleMode===Da.LINEAR?n.LINEAR_MIPMAP_LINEAR:n.NEAREST_MIPMAP_NEAREST);var i=this.renderer.context.extensions.anisotropicFiltering;if(i&&e.anisotropicLevel>0&&e.scaleMode===Da.LINEAR){var a=Math.min(e.anisotropicLevel,n.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT));n.texParameterf(e.target,i.TEXTURE_MAX_ANISOTROPY_EXT,a)}}else n.texParameteri(e.target,n.TEXTURE_MIN_FILTER,e.scaleMode===Da.LINEAR?n.LINEAR:n.NEAREST);n.texParameteri(e.target,n.TEXTURE_MAG_FILTER,e.scaleMode===Da.LINEAR?n.LINEAR:n.NEAREST)},r.prototype.destroy=function(){this.renderer=null},r})(),bD={__proto__:null,FilterSystem:Lw,BatchSystem:kw,ContextSystem:Bw,FramebufferSystem:Fw,GeometrySystem:zw,MaskSystem:Uw,ScissorSystem:Gw,StencilSystem:Hw,ProjectionSystem:jw,RenderTextureSystem:Vw,ShaderSystem:qw,StateSystem:Xw,TextureGCSystem:Yw,TextureSystem:Ww},ex=new qr,xD=(function(r){Ir(e,r);function e(t,n){t===void 0&&(t=Gc.UNKNOWN);var i=r.call(this)||this;return n=Object.assign({},ht.RENDER_OPTIONS,n),i.options=n,i.type=t,i.screen=new $t(0,0,n.width,n.height),i.view=n.view||ht.ADAPTER.createCanvas(),i.resolution=n.resolution||ht.RESOLUTION,i.useContextAlpha=n.useContextAlpha,i.autoDensity=!!n.autoDensity,i.preserveDrawingBuffer=n.preserveDrawingBuffer,i.clearBeforeRender=n.clearBeforeRender,i._backgroundColor=0,i._backgroundColorRgba=[0,0,0,1],i._backgroundColorString="#000000",i.backgroundColor=n.backgroundColor||i._backgroundColor,i.backgroundAlpha=n.backgroundAlpha,n.transparent!==void 0&&(fi("6.0.0","Option transparent is deprecated, please use backgroundAlpha instead."),i.useContextAlpha=n.transparent,i.backgroundAlpha=n.transparent?0:1),i._lastObjectRendered=null,i.plugins={},i}return e.prototype.initPlugins=function(t){for(var n in t)this.plugins[n]=new t[n](this)},Object.defineProperty(e.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,n){this.view.width=Math.round(t*this.resolution),this.view.height=Math.round(n*this.resolution);var i=this.view.width/this.resolution,a=this.view.height/this.resolution;this.screen.width=i,this.screen.height=a,this.autoDensity&&(this.view.style.width=i+"px",this.view.style.height=a+"px"),this.emit("resize",i,a)},e.prototype.generateTexture=function(t,n,i,a){n===void 0&&(n={}),typeof n=="number"&&(fi("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),n={scaleMode:n,resolution:i,region:a});var s=n.region,o=R$(n,["region"]);a=s||t.getLocalBounds(null,!0),a.width===0&&(a.width=1),a.height===0&&(a.height=1);var l=nl.create(D4({width:a.width,height:a.height},o));return ex.tx=-a.x,ex.ty=-a.y,this.render(t,{renderTexture:l,clear:!1,transform:ex,skipUpdateTransform:!!t.parent}),l},e.prototype.destroy=function(t){for(var n in this.plugins)this.plugins[n].destroy(),this.plugins[n]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view);var i=this;i.plugins=null,i.type=Gc.UNKNOWN,i.view=null,i.screen=null,i._tempDisplayObjectParent=null,i.options=null,this._backgroundColorRgba=null,this._backgroundColorString=null,this._lastObjectRendered=null},Object.defineProperty(e.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this._backgroundColorString=bw(t),pu(t,this._backgroundColorRgba)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backgroundAlpha",{get:function(){return this._backgroundColorRgba[3]},set:function(t){this._backgroundColorRgba[3]=t},enumerable:!1,configurable:!0}),e})(Ks),pK=(function(){function r(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}return r})(),gK=(function(){function r(e){this.renderer=e,this.managedBuffers={},this.boundBufferBases={}}return r.prototype.destroy=function(){this.renderer=null},r.prototype.contextChange=function(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID},r.prototype.bind=function(e){var t=this,n=t.gl,i=t.CONTEXT_UID,a=e._glBuffers[i]||this.createGLBuffer(e);n.bindBuffer(e.type,a.buffer)},r.prototype.bindBufferBase=function(e,t){var n=this,i=n.gl,a=n.CONTEXT_UID;if(this.boundBufferBases[t]!==e){var s=e._glBuffers[a]||this.createGLBuffer(e);this.boundBufferBases[t]=e,i.bindBufferBase(i.UNIFORM_BUFFER,t,s.buffer)}},r.prototype.bindBufferRange=function(e,t,n){var i=this,a=i.gl,s=i.CONTEXT_UID;n=n||0;var o=e._glBuffers[s]||this.createGLBuffer(e);a.bindBufferRange(a.UNIFORM_BUFFER,t||0,o.buffer,n*256,256)},r.prototype.update=function(e){var t=this,n=t.gl,i=t.CONTEXT_UID,a=e._glBuffers[i];if(e._updateID!==a.updateID)if(a.updateID=e._updateID,n.bindBuffer(e.type,a.buffer),a.byteLength>=e.data.byteLength)n.bufferSubData(e.type,0,e.data);else{var s=e.static?n.STATIC_DRAW:n.DYNAMIC_DRAW;a.byteLength=e.data.byteLength,n.bufferData(e.type,e.data,s)}},r.prototype.dispose=function(e,t){if(this.managedBuffers[e.id]){delete this.managedBuffers[e.id];var n=e._glBuffers[this.CONTEXT_UID],i=this.gl;e.disposeRunner.remove(this),n&&(t||i.deleteBuffer(n.buffer),delete e._glBuffers[this.CONTEXT_UID])}},r.prototype.disposeAll=function(e){for(var t=Object.keys(this.managedBuffers),n=0;n=Fr.HIGH?this.multisample=Fr.HIGH:n>=Fr.MEDIUM?this.multisample=Fr.MEDIUM:n>=Fr.LOW?this.multisample=Fr.LOW:this.multisample=Fr.NONE},e.prototype.addSystem=function(t,n){var i=new t(this);if(this[n])throw new Error('Whoops! The name "'+n+'" is already in use');this[n]=i;for(var a in this.runners)this.runners[a].add(i);return this},e.prototype.render=function(t,n){var i,a,s,o;if(n&&(n instanceof nl?(fi("6.0.0","Renderer#render arguments changed, use options instead."),i=n,a=arguments[2],s=arguments[3],o=arguments[4]):(i=n.renderTexture,a=n.clear,s=n.transform,o=n.skipUpdateTransform)),this.renderingToScreen=!i,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=s,!this.context.isLost){if(i||(this._lastObjectRendered=t),!o){var l=t.enableTempParent();t.updateTransform(),t.disableTempParent(l)}this.renderTexture.bind(i),this.batch.currentRenderer.start(),(a!==void 0?a:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),i&&i.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},e.prototype.generateTexture=function(t,n,i,a){n===void 0&&(n={});var s=r.prototype.generateTexture.call(this,t,n,i,a);return this.framebuffer.blit(),s},e.prototype.resize=function(t,n){r.prototype.resize.call(this,t,n),this.runners.resize.emit(this.screen.height,this.screen.width)},e.prototype.reset=function(){return this.runners.reset.emit(),this},e.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},e.prototype.destroy=function(t){this.runners.destroy.emit();for(var n in this.runners)this.runners[n].destroy();r.prototype.destroy.call(this,t),this.gl=null},Object.defineProperty(e.prototype,"extract",{get:function(){return fi("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),e.registerPlugin=function(t,n){fi("6.5.0","Renderer.registerPlugin() has been deprecated, please use extensions.add() instead."),us.add({name:t,type:yr.RendererPlugin,ref:n})},e.__plugins={},e})(xD);us.handleByMap(yr.RendererPlugin,$w.__plugins);function _D(r){return $w.create(r)}var mK=`attribute vec2 aVertexPosition; attribute vec2 aTextureCoord; uniform mat3 projectionMatrix; varying vec2 vTextureCoord; void main(void) { gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); vTextureCoord = aTextureCoord; }`,yK=`attribute vec2 aVertexPosition; uniform mat3 projectionMatrix; varying vec2 vTextureCoord; uniform vec4 inputSize; uniform vec4 outputFrame; vec4 filterVertexPosition( void ) { vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); } vec2 filterTextureCoord( void ) { return aVertexPosition * (outputFrame.zw * inputSize.zw); } void main(void) { gl_Position = filterVertexPosition(); vTextureCoord = filterTextureCoord(); } `,wD=mK,Kw=yK,bK=(function(){function r(e){fi("6.1.0","System class is deprecated, implemement ISystem interface instead."),this.renderer=e}return r.prototype.destroy=function(){this.renderer=null},r})(),Up=(function(){function r(){this.texArray=null,this.blend=0,this.type=pa.TRIANGLES,this.start=0,this.size=0,this.data=null}return r})(),Gp=(function(){function r(){this.elements=[],this.ids=[],this.count=0}return r.prototype.clear=function(){for(var e=0;ethis.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedTextures[this._bufferSize]=t._texture.baseTexture,this._bufferedElements[this._bufferSize++]=t)},e.prototype.buildTexturesAndDrawCalls=function(){var t=this,n=t._bufferedTextures,i=t.MAX_TEXTURES,a=e._textureArrayPool,s=this.renderer.batch,o=this._tempBoundTextures,l=this.renderer.textureGC.count,c=++Wt._globalBatch,h=0,d=a[0],v=0;s.copyBoundTextures(o,i);for(var g=0;g=i&&(s.boundArray(d,o,c,i),this.buildDrawCalls(d,v,g),v=g,d=a[++h],++c),m._batchEnabled=c,m.touched=l,d.elements[d.count++]=m)}d.count>0&&(s.boundArray(d,o,c,i),this.buildDrawCalls(d,v,this._bufferSize),++h,++c);for(var g=0;g0&&(t+=` else `),n title : "+e.title+"
tabIndex: "+e.tabIndex},r.prototype.capHitArea=function(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);var t=this.renderer,n=t.width,i=t.height;e.x+e.width>n&&(e.width=n-e.x),e.y+e.height>i&&(e.height=i-e.y)},r.prototype.addChild=function(e){var t=this.pool.pop();t||(t=document.createElement("button"),t.style.width=Av+"px",t.style.height=Av+"px",t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=rA.toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?t.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(t.title="displayObject "+e.tabIndex),e.accessibleHint&&e.accessibleHint!==null&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this.updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.displayObject=e,this.children.push(e),this.div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex},r.prototype._onClick=function(e){var t=this.renderer.plugins.interaction,n=e.target.displayObject,i=t.eventData;t.dispatchEvent(n,"click",i),t.dispatchEvent(n,"pointertap",i),t.dispatchEvent(n,"tap",i)},r.prototype._onFocus=function(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive");var t=this.renderer.plugins.interaction,n=e.target.displayObject,i=t.eventData;t.dispatchEvent(n,"mouseover",i)},r.prototype._onFocusOut=function(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite");var t=this.renderer.plugins.interaction,n=e.target.displayObject,i=t.eventData;t.dispatchEvent(n,"mouseout",i)},r.prototype._onKeyDown=function(e){e.keyCode===SK&&this.activate()},r.prototype._onMouseMove=function(e){e.movementX===0&&e.movementY===0||this.deactivate()},r.prototype.destroy=function(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null},r.extension={name:"accessibility",type:[yr.RendererPlugin,yr.CanvasRendererPlugin]},r})();/*! * @pixi/interaction - v6.5.10 * Compiled Thu, 06 Jul 2023 15:25:11 UTC * * @pixi/interaction is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license */var I4=(function(){function r(){this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0,this.global=new Ar,this.target=null,this.originalEvent=null,this.identifier=null,this.isPrimary=!1,this.button=0,this.buttons=0,this.width=0,this.height=0,this.tiltX=0,this.tiltY=0,this.pointerType=null,this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0}return Object.defineProperty(r.prototype,"pointerId",{get:function(){return this.identifier},enumerable:!1,configurable:!0}),r.prototype.getLocalPosition=function(e,t,n){return e.worldTransform.applyInverse(n||this.global,t)},r.prototype.copyEvent=function(e){"isPrimary"in e&&e.isPrimary&&(this.isPrimary=!0),this.button="button"in e&&e.button;var t="buttons"in e&&e.buttons;this.buttons=Number.isInteger(t)?t:"which"in e&&e.which,this.width="width"in e&&e.width,this.height="height"in e&&e.height,this.tiltX="tiltX"in e&&e.tiltX,this.tiltY="tiltY"in e&&e.tiltY,this.pointerType="pointerType"in e&&e.pointerType,this.pressure="pressure"in e&&e.pressure,this.rotationAngle="rotationAngle"in e&&e.rotationAngle,this.twist="twist"in e&&e.twist||0,this.tangentialPressure="tangentialPressure"in e&&e.tangentialPressure||0},r.prototype.reset=function(){this.isPrimary=!1},r})();/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var N4=function(r,e){return N4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},N4(r,e)};function RK(r,e){N4(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var OD=(function(){function r(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null}return r.prototype.stopPropagation=function(){this.stopped=!0,this.stopPropagationHint=!0,this.stopsPropagatingAt=this.currentTarget},r.prototype.reset=function(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.currentTarget=null,this.target=null},r})(),pp=(function(){function r(e){this._pointerId=e,this._flags=r.FLAGS.NONE}return r.prototype._doSet=function(e,t){t?this._flags=this._flags|e:this._flags=this._flags&~e},Object.defineProperty(r.prototype,"pointerId",{get:function(){return this._pointerId},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"flags",{get:function(){return this._flags},set:function(e){this._flags=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"none",{get:function(){return this._flags===r.FLAGS.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"over",{get:function(){return(this._flags&r.FLAGS.OVER)!==0},set:function(e){this._doSet(r.FLAGS.OVER,e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"rightDown",{get:function(){return(this._flags&r.FLAGS.RIGHT_DOWN)!==0},set:function(e){this._doSet(r.FLAGS.RIGHT_DOWN,e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"leftDown",{get:function(){return(this._flags&r.FLAGS.LEFT_DOWN)!==0},set:function(e){this._doSet(r.FLAGS.LEFT_DOWN,e)},enumerable:!1,configurable:!0}),r.FLAGS=Object.freeze({NONE:0,OVER:1,LEFT_DOWN:2,RIGHT_DOWN:4}),r})(),OK=(function(){function r(){this._tempPoint=new Ar}return r.prototype.recursiveFindHit=function(e,t,n,i,a){var s;if(!t||!t.visible)return!1;var o=e.data.global;a=t.interactive||a;var l=!1,c=a,h=!0;if(t.hitArea)i&&(t.worldTransform.applyInverse(o,this._tempPoint),t.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?l=!0:(i=!1,h=!1)),c=!1;else if(t._mask&&i){var d=t._mask.isMaskData?t._mask.maskObject:t._mask;d&&!(!((s=d.containsPoint)===null||s===void 0)&&s.call(d,o))&&(i=!1)}if(h&&t.interactiveChildren&&t.children)for(var v=t.children,g=v.length-1;g>=0;g--){var m=v[g],x=this.recursiveFindHit(e,m,n,i,c);if(x){if(!m.parent)continue;c=!1,x&&(e.target&&(i=!1),l=!0)}}return a&&(i&&!e.target&&!t.hitArea&&t.containsPoint&&t.containsPoint(o)&&(l=!0),t.interactive&&(l&&!e.target&&(e.target=t),n&&n(e,t,!!l))),l},r.prototype.findHit=function(e,t,n,i){this.recursiveFindHit(e,t,n,i,!1)},r})(),DD={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return this.cursor==="pointer"},set buttonMode(r){r?this.cursor="pointer":this.cursor==="pointer"&&(this.cursor=null)},cursor:null,get trackedPointers(){return this._trackedPointers===void 0&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};ln.mixin(DD);var Mv=1,Rv={target:null,data:{global:null}},PD=(function(r){RK(e,r);function e(t,n){var i=r.call(this)||this;return n=n||{},i.renderer=t,i.autoPreventDefault=n.autoPreventDefault!==void 0?n.autoPreventDefault:!0,i.interactionFrequency=n.interactionFrequency||10,i.mouse=new I4,i.mouse.identifier=Mv,i.mouse.global.set(-999999),i.activeInteractionData={},i.activeInteractionData[Mv]=i.mouse,i.interactionDataPool=[],i.eventData=new OD,i.interactionDOMElement=null,i.moveWhenInside=!1,i.eventsAdded=!1,i.tickerAdded=!1,i.mouseOverRenderer=!("PointerEvent"in globalThis),i.supportsTouchEvents="ontouchstart"in globalThis,i.supportsPointerEvents=!!globalThis.PointerEvent,i.onPointerUp=i.onPointerUp.bind(i),i.processPointerUp=i.processPointerUp.bind(i),i.onPointerCancel=i.onPointerCancel.bind(i),i.processPointerCancel=i.processPointerCancel.bind(i),i.onPointerDown=i.onPointerDown.bind(i),i.processPointerDown=i.processPointerDown.bind(i),i.onPointerMove=i.onPointerMove.bind(i),i.processPointerMove=i.processPointerMove.bind(i),i.onPointerOut=i.onPointerOut.bind(i),i.processPointerOverOut=i.processPointerOverOut.bind(i),i.onPointerOver=i.onPointerOver.bind(i),i.cursorStyles={default:"inherit",pointer:"pointer"},i.currentCursorMode=null,i.cursor=null,i.resolution=1,i.delayedEvents=[],i.search=new OK,i._tempDisplayObject=new Tw,i._eventListenerOptions={capture:!0,passive:!1},i._useSystemTicker=n.useSystemTicker!==void 0?n.useSystemTicker:!0,i.setTargetElement(i.renderer.view,i.renderer.resolution),i}return Object.defineProperty(e.prototype,"useSystemTicker",{get:function(){return this._useSystemTicker},set:function(t){this._useSystemTicker=t,t?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastObjectRendered",{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),e.prototype.hitTest=function(t,n){return Rv.target=null,Rv.data.global=t,n||(n=this.lastObjectRendered),this.processInteractive(Rv,n,null,!0),Rv.target},e.prototype.setTargetElement=function(t,n){n===void 0&&(n=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=t,this.resolution=n,this.addEvents(),this.addTickerListener()},e.prototype.addTickerListener=function(){this.tickerAdded||!this.interactionDOMElement||!this._useSystemTicker||(Fn.system.add(this.tickerUpdate,this,is.INTERACTION),this.tickerAdded=!0)},e.prototype.removeTickerListener=function(){this.tickerAdded&&(Fn.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},e.prototype.addEvents=function(){if(!(this.eventsAdded||!this.interactionDOMElement)){var t=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(t.msContentZooming="none",t.msTouchAction="none"):this.supportsPointerEvents&&(t.touchAction="none"),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.addEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.addEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.eventsAdded=!0}},e.prototype.removeEvents=function(){if(!(!this.eventsAdded||!this.interactionDOMElement)){var t=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(t.msContentZooming="",t.msTouchAction=""):this.supportsPointerEvents&&(t.touchAction=""),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.removeEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.removeEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.interactionDOMElement=null,this.eventsAdded=!1}},e.prototype.tickerUpdate=function(t){this._deltaTime+=t,!(this._deltaTime0&&(o=t.composedPath()[0]);for(var l=o!==this.interactionDOMElement?"outside":"",c=0;c"u"&&(s.button=t.touches.length?1:0),typeof s.buttons>"u"&&(s.buttons=t.touches.length?1:0),typeof s.isPrimary>"u"&&(s.isPrimary=t.touches.length===1&&t.type==="touchstart"),typeof s.width>"u"&&(s.width=s.radiusX||1),typeof s.height>"u"&&(s.height=s.radiusY||1),typeof s.tiltX>"u"&&(s.tiltX=0),typeof s.tiltY>"u"&&(s.tiltY=0),typeof s.pointerType>"u"&&(s.pointerType="touch"),typeof s.pointerId>"u"&&(s.pointerId=s.identifier||0),typeof s.pressure>"u"&&(s.pressure=s.force||.5),typeof s.twist>"u"&&(s.twist=0),typeof s.tangentialPressure>"u"&&(s.tangentialPressure=0),typeof s.layerX>"u"&&(s.layerX=s.offsetX=s.clientX),typeof s.layerY>"u"&&(s.layerY=s.offsetY=s.clientY),s.isNormalized=!0,n.push(s)}else if(!globalThis.MouseEvent||t instanceof MouseEvent&&(!this.supportsPointerEvents||!(t instanceof globalThis.PointerEvent))){var o=t;typeof o.isPrimary>"u"&&(o.isPrimary=!0),typeof o.width>"u"&&(o.width=1),typeof o.height>"u"&&(o.height=1),typeof o.tiltX>"u"&&(o.tiltX=0),typeof o.tiltY>"u"&&(o.tiltY=0),typeof o.pointerType>"u"&&(o.pointerType="mouse"),typeof o.pointerId>"u"&&(o.pointerId=Mv),typeof o.pressure>"u"&&(o.pressure=.5),typeof o.twist>"u"&&(o.twist=0),typeof o.tangentialPressure>"u"&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n},e.prototype.destroy=function(){this.removeEvents(),this.removeTickerListener(),this.removeAllListeners(),this.renderer=null,this.mouse=null,this.eventData=null,this.interactionDOMElement=null,this.onPointerDown=null,this.processPointerDown=null,this.onPointerUp=null,this.processPointerUp=null,this.onPointerCancel=null,this.processPointerCancel=null,this.onPointerMove=null,this.processPointerMove=null,this.onPointerOut=null,this.processPointerOverOut=null,this.onPointerOver=null,this.search=null},e.extension={name:"interaction",type:[yr.RendererPlugin,yr.CanvasRendererPlugin]},e})(Ks);/*! * @pixi/extract - v6.5.10 * Compiled Thu, 06 Jul 2023 15:25:11 UTC * * @pixi/extract is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license */var DK=new $t,PK=4,ID=(function(){function r(e){this.renderer=e}return r.prototype.image=function(e,t,n){var i=new Image;return i.src=this.base64(e,t,n),i},r.prototype.base64=function(e,t,n){return this.canvas(e).toDataURL(t,n)},r.prototype.canvas=function(e,t){var n=this._rawPixels(e,t),i=n.pixels,a=n.width,s=n.height,o=n.flipY,l=new A4(a,s,1),c=l.context.getImageData(0,0,a,s);if(r.arrayPostDivide(i,c.data),l.context.putImageData(c,0,0),o){var h=new A4(l.width,l.height,1);h.context.scale(1,-1),h.context.drawImage(l.canvas,0,-s),l.destroy(),l=h}return l.canvas},r.prototype.pixels=function(e,t){var n=this._rawPixels(e,t).pixels;return r.arrayPostDivide(n,n),n},r.prototype._rawPixels=function(e,t){var n=this.renderer,i,a=!1,s,o=!1;if(e)if(e instanceof nl)s=e;else{var l=n.context.webGLVersion>=2?n.multisample:Fr.NONE;if(s=this.renderer.generateTexture(e,{multisample:l}),l!==Fr.NONE){var c=nl.create({width:s.width,height:s.height});n.framebuffer.bind(s.framebuffer),n.framebuffer.blit(c.framebuffer),n.framebuffer.bind(null),s.destroy(!0),s=c}o=!0}s?(i=s.baseTexture.resolution,t=t??s.frame,a=!1,n.renderTexture.bind(s)):(i=n.resolution,t||(t=DK,t.width=n.width,t.height=n.height),a=!0,n.renderTexture.bind(null));var h=Math.round(t.width*i),d=Math.round(t.height*i),v=new Uint8Array(PK*h*d),g=n.gl;return g.readPixels(Math.round(t.x*i),Math.round(t.y*i),h,d,g.RGBA,g.UNSIGNED_BYTE,v),o&&s.destroy(!0),{pixels:v,width:h,height:d,flipY:a}},r.prototype.destroy=function(){this.renderer=null},r.arrayPostDivide=function(e,t){for(var n=0;n"u"&&(tx=!!(globalThis.XDomainRequest&&!("withCredentials"in new XMLHttpRequest))),tx&&this.crossOrigin?this._loadXdr():this._loadXhr();break}}},r.prototype._hasFlag=function(e){return(this._flags&e)!==0},r.prototype._setFlag=function(e,t){this._flags=t?this._flags|e:this._flags&~e},r.prototype._clearEvents=function(){clearTimeout(this._elementTimer),this.data&&this.data.removeEventListener&&(this.data.removeEventListener("error",this._boundOnError,!1),this.data.removeEventListener("load",this._boundComplete,!1),this.data.removeEventListener("progress",this._boundOnProgress,!1),this.data.removeEventListener("canplaythrough",this._boundComplete,!1)),this.xhr&&(this.xhr.removeEventListener?(this.xhr.removeEventListener("error",this._boundXhrOnError,!1),this.xhr.removeEventListener("timeout",this._boundXhrOnTimeout,!1),this.xhr.removeEventListener("abort",this._boundXhrOnAbort,!1),this.xhr.removeEventListener("progress",this._boundOnProgress,!1),this.xhr.removeEventListener("load",this._boundXhrOnLoad,!1)):(this.xhr.onerror=null,this.xhr.ontimeout=null,this.xhr.onprogress=null,this.xhr.onload=null))},r.prototype._finish=function(){if(this.isComplete)throw new Error("Complete called again for an already completed resource.");this._setFlag(r.STATUS_FLAGS.COMPLETE,!0),this._setFlag(r.STATUS_FLAGS.LOADING,!1),this.onComplete.dispatch(this)},r.prototype._loadElement=function(e){this.metadata.loadElement?this.data=this.metadata.loadElement:e==="image"&&typeof globalThis.Image<"u"?this.data=new Image:this.data=document.createElement(e),this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),this.metadata.skipSource||(this.data.src=this.url),this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))},r.prototype._loadSourceElement=function(e){if(this.metadata.loadElement?this.data=this.metadata.loadElement:e==="audio"&&typeof globalThis.Audio<"u"?this.data=new Audio:this.data=document.createElement(e),this.data===null){this.abort("Unsupported element: "+e);return}if(this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),!this.metadata.skipSource)if(navigator.isCocoonJS)this.data.src=Array.isArray(this.url)?this.url[0]:this.url;else if(Array.isArray(this.url))for(var t=this.metadata.mimeType,n=0;n"u"?aA:e.status;(e.responseType===""||e.responseType==="text"||typeof e.responseType>"u")&&(t=e.responseText),n===IK&&(t.length>0||e.responseType===r.XHR_RESPONSE_TYPE.BUFFER)?n=aA:n===LK&&(n=NK);var i=n/100|0;if(i===kK)if(this.xhrType===r.XHR_RESPONSE_TYPE.TEXT)this.data=t,this.type=r.TYPE.TEXT;else if(this.xhrType===r.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(t),this.type=r.TYPE.JSON}catch(o){this.abort("Error trying to parse loaded json: "+o);return}else if(this.xhrType===r.XHR_RESPONSE_TYPE.DOCUMENT)try{if(globalThis.DOMParser){var a=new DOMParser;this.data=a.parseFromString(t,"text/xml")}else{var s=document.createElement("div");s.innerHTML=t,this.data=s}this.type=r.TYPE.XML}catch(o){this.abort("Error trying to parse loaded xml: "+o);return}else this.data=e.response||t;else{this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL);return}this.complete()},r.prototype._determineCrossOrigin=function(e,t){if(e.indexOf("data:")===0)return"";if(globalThis.origin!==globalThis.location.origin)return"anonymous";t=t||globalThis.location,Dv||(Dv=document.createElement("a")),Dv.href=e;var n=ND(Dv.href,{strictMode:!0}),i=!n.port&&t.port===""||n.port===t.port,a=n.protocol?n.protocol+":":"";return n.host!==t.hostname||!i||a!==t.protocol?"anonymous":""},r.prototype._determineXhrType=function(){return r._xhrTypeMap[this.extension]||r.XHR_RESPONSE_TYPE.TEXT},r.prototype._determineLoadType=function(){return r._loadTypeMap[this.extension]||r.LOAD_TYPE.XHR},r.prototype._getExtension=function(e){e===void 0&&(e=this.url);var t="";if(this.isDataUrl){var n=e.indexOf("/");t=e.substring(n+1,e.indexOf(";",n))}else{var i=e.indexOf("?"),a=e.indexOf("#"),s=Math.min(i>-1?i:e.length,a>-1?a:e.length);e=e.substring(0,s),t=e.substring(e.lastIndexOf(".")+1)}return t.toLowerCase()},r.prototype._getMimeFromXhrType=function(e){switch(e){case r.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case r.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case r.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case r.XHR_RESPONSE_TYPE.JSON:return"application/json";case r.XHR_RESPONSE_TYPE.DEFAULT:case r.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r})();(function(r){(function(e){e[e.NONE=0]="NONE",e[e.DATA_URL=1]="DATA_URL",e[e.COMPLETE=2]="COMPLETE",e[e.LOADING=4]="LOADING"})(r.STATUS_FLAGS||(r.STATUS_FLAGS={})),(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.JSON=1]="JSON",e[e.XML=2]="XML",e[e.IMAGE=3]="IMAGE",e[e.AUDIO=4]="AUDIO",e[e.VIDEO=5]="VIDEO",e[e.TEXT=6]="TEXT"})(r.TYPE||(r.TYPE={})),(function(e){e[e.XHR=1]="XHR",e[e.IMAGE=2]="IMAGE",e[e.AUDIO=3]="AUDIO",e[e.VIDEO=4]="VIDEO"})(r.LOAD_TYPE||(r.LOAD_TYPE={})),(function(e){e.DEFAULT="text",e.BUFFER="arraybuffer",e.BLOB="blob",e.DOCUMENT="document",e.JSON="json",e.TEXT="text"})(r.XHR_RESPONSE_TYPE||(r.XHR_RESPONSE_TYPE={})),r._loadTypeMap={gif:r.LOAD_TYPE.IMAGE,png:r.LOAD_TYPE.IMAGE,bmp:r.LOAD_TYPE.IMAGE,jpg:r.LOAD_TYPE.IMAGE,jpeg:r.LOAD_TYPE.IMAGE,tif:r.LOAD_TYPE.IMAGE,tiff:r.LOAD_TYPE.IMAGE,webp:r.LOAD_TYPE.IMAGE,tga:r.LOAD_TYPE.IMAGE,avif:r.LOAD_TYPE.IMAGE,svg:r.LOAD_TYPE.IMAGE,"svg+xml":r.LOAD_TYPE.IMAGE,mp3:r.LOAD_TYPE.AUDIO,ogg:r.LOAD_TYPE.AUDIO,wav:r.LOAD_TYPE.AUDIO,mp4:r.LOAD_TYPE.VIDEO,webm:r.LOAD_TYPE.VIDEO},r._xhrTypeMap={xhtml:r.XHR_RESPONSE_TYPE.DOCUMENT,html:r.XHR_RESPONSE_TYPE.DOCUMENT,htm:r.XHR_RESPONSE_TYPE.DOCUMENT,xml:r.XHR_RESPONSE_TYPE.DOCUMENT,tmx:r.XHR_RESPONSE_TYPE.DOCUMENT,svg:r.XHR_RESPONSE_TYPE.DOCUMENT,tsx:r.XHR_RESPONSE_TYPE.DOCUMENT,gif:r.XHR_RESPONSE_TYPE.BLOB,png:r.XHR_RESPONSE_TYPE.BLOB,bmp:r.XHR_RESPONSE_TYPE.BLOB,jpg:r.XHR_RESPONSE_TYPE.BLOB,jpeg:r.XHR_RESPONSE_TYPE.BLOB,tif:r.XHR_RESPONSE_TYPE.BLOB,tiff:r.XHR_RESPONSE_TYPE.BLOB,webp:r.XHR_RESPONSE_TYPE.BLOB,tga:r.XHR_RESPONSE_TYPE.BLOB,avif:r.XHR_RESPONSE_TYPE.BLOB,json:r.XHR_RESPONSE_TYPE.JSON,text:r.XHR_RESPONSE_TYPE.TEXT,txt:r.XHR_RESPONSE_TYPE.TEXT,ttf:r.XHR_RESPONSE_TYPE.BUFFER,otf:r.XHR_RESPONSE_TYPE.BUFFER},r.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="})(Qr||(Qr={}));function Ul(){}function BK(r){return function(){for(var t=arguments,n=[],i=0;i>2,i[1]=(n[0]&3)<<4|n[1]>>4,i[2]=(n[1]&15)<<2|n[2]>>6,i[3]=n[2]&63;var s=t-(r.length-1);switch(s){case 2:i[3]=64,i[2]=64;break;case 1:i[3]=64;break}for(var a=0;a0&&a[a.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]=33776&&t<=33779)return"s3tc";if(t>=37488&&t<=37497)return"etc";if(t>=35840&&t<=35843)return"pvrtc";if(t>=36196)return"etc1";if(t>=35986&&t<=34798)return"atc";throw new Error("Invalid (compressed) texture format given!")},e._createLevelBuffers=function(t,n,i,a,s,o,l){for(var c=new Array(i),h=t.byteOffset,d=o,v=l,g=d+a-1&~(a-1),m=v+s-1&~(s-1),x=g*m*vd[n],y=0;y1?d:g,levelHeight:i>1?v:m,levelBuffer:new Uint8Array(t.buffer,h,x)},h+=x,d=d>>1||1,v=v>>1||1,g=d+a-1&~(a-1),m=v+s-1&~(s-1),x=g*m*vd[n];return c},e})(FD),zD=(function(){function r(){}return r.use=function(e,t){var n=e.data,i=this;if(e.type===Qr.TYPE.JSON&&n&&n.cacheID&&n.textures){for(var a=n.textures,s=void 0,o=void 0,l=0,c=a.length;l>>1,I=I>>>1}for(var W=M,k=0;k1||a!==0?D:k,levelHeight:g>1||a!==0?I:U,levelBuffer:new Uint8Array(e,P,O)},P+=O}V+=W+4,V=V%4!==0?V+4-V%4:V,D=D>>1||1,I=I>>1||1,k=D+x-1&-4,U=I+y-1&-4,O=k*U*C}return a!==0?{uncompressed:S.map(function($){var B=$[0].levelBuffer,L=!1;return a===wt.FLOAT?B=new Float32Array($[0].levelBuffer.buffer,$[0].levelBuffer.byteOffset,$[0].levelBuffer.byteLength/4):a===wt.UNSIGNED_INT?(L=!0,B=new Uint32Array($[0].levelBuffer.buffer,$[0].levelBuffer.byteOffset,$[0].levelBuffer.byteLength/4)):a===wt.INT&&(L=!0,B=new Int32Array($[0].levelBuffer.buffer,$[0].levelBuffer.byteOffset,$[0].levelBuffer.byteLength/4)),{resource:new wu(B,{width:$[0].levelWidth,height:$[0].levelHeight}),type:a,format:L?cZ(s):s}}),kvData:M}:{compressed:S.map(function($){return new jp(null,{format:o,width:l,height:c,levels:g,levelBuffers:$})}),kvData:M}}function uZ(r,e){for(var t=0;te-i){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}for(var l=0;lo&&(i=o),s._properties=[!1,!0,!1,!1,!1],s._maxSize=t,s._batchSize=i,s._buffers=null,s._bufferUpdateIDs=[],s._updateID=0,s.interactiveChildren=!1,s.blendMode=Et.NORMAL,s.autoResize=a,s.roundPixels=!0,s.baseTexture=null,s.setProperties(n),s._tint=0,s.tintRgb=new Float32Array(4),s.tint=16777215,s}return e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t,pu(t,this.tintRgb)},enumerable:!1,configurable:!0}),e.prototype.render=function(t){var n=this;!this.visible||this.worldAlpha<=0||!this.children.length||!this.renderable||(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return n.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var n=Math.floor(t/this._batchSize);this._bufferUpdateIDs.lengthi&&!t.autoResize&&(o=i);var l=t._buffers;l||(l=t._buffers=this.generateBuffers(t));var c=n[0]._texture.baseTexture,h=c.alphaMode>0;this.state.blendMode=ww(t.blendMode,h),s.state.set(this.state);var d=s.gl,v=t.worldTransform.copyTo(this.tempMatrix);v.prepend(s.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=v.toArray(!0),this.shader.uniforms.uColor=GO(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,h),this.shader.uniforms.uSampler=c,this.renderer.shader.bind(this.shader);for(var g=!1,m=0,x=0;ma&&(y=a),x>=l.length&&l.push(this._generateOneMoreBuffer(t));var _=l[x];_.uploadDynamic(n,m,y);var w=t._bufferUpdateIDs[x]||0;g=g||_._updateID0,d=c.alpha,v=d<1&&h?Sg(c._tintRGB,d):c._tintRGB+(d*255<<24);a[o]=v,a[o+s]=v,a[o+s*2]=v,a[o+s*3]=v,o+=s*4}},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},e.extension={name:"particle",type:yr.RendererPlugin},e})(kd);/*! * @pixi/graphics - v6.5.10 * Compiled Thu, 06 Jul 2023 15:25:11 UTC * * @pixi/graphics is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license */var Za;(function(r){r.MITER="miter",r.BEVEL="bevel",r.ROUND="round"})(Za||(Za={}));var Us;(function(r){r.BUTT="butt",r.ROUND="round",r.SQUARE="square"})(Us||(Us={}));var Hc={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount:function(r,e){if(e===void 0&&(e=20),!this.adaptive||!r||isNaN(r))return e;var t=Math.ceil(r/this.maxLength);return tthis.maxSegments&&(t=this.maxSegments),t}},e3=(function(){function r(){this.color=16777215,this.alpha=1,this.texture=Rt.WHITE,this.matrix=null,this.visible=!1,this.reset()}return r.prototype.clone=function(){var e=new r;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e},r.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=Rt.WHITE,this.matrix=null,this.visible=!1},r.prototype.destroy=function(){this.texture=null,this.matrix=null},r})();/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var U4=function(r,e){return U4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},U4(r,e)};function t3(r,e){U4(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function hA(r,e){var t,n;e===void 0&&(e=!1);var i=r.length;if(!(i<6)){for(var a=0,s=0,o=r[i-2],l=r[i-1];s0||e&&a<=0)for(var d=i/2,s=d+d%2;s=6){hA(t,!1);for(var s=[],o=0;o=0&&o>=0&&i>=0&&a>=0)){e.length=0;return}var g=Math.ceil(2.3*Math.sqrt(s+o)),m=g*8+(i?4:0)+(a?4:0);if(e.length=m,m!==0){if(g===0){e.length=8,e[0]=e[6]=t+i,e[1]=e[3]=n+a,e[2]=e[4]=t-i,e[5]=e[7]=n-a;return}var x=0,y=g*4+(i?2:0)+2,_=y,w=m;{var S=i+s,A=a,C=t+S,M=t-S,E=n+A;if(e[x++]=C,e[x++]=E,e[--y]=E,e[--y]=M,a){var O=n-A;e[_++]=M,e[_++]=O,e[--w]=O,e[--w]=C}}for(var D=1;Dd&&(d+=Math.PI*2);var v=h,g=d-h,m=Math.abs(g),x=Math.sqrt(l*l+c*c),y=(15*m*Math.sqrt(x)/Math.PI>>0)+1,_=g/y;if(v+=_,o){s.push(r,e),s.push(t,n);for(var w=1,S=v;w=0&&(a.join===Za.ROUND?m+=Gl(C,M,C-D*W,M-I*W,C-k*W,M-U*W,v,!1)+4:m+=2,v.push(C-k*P,M-U*P),v.push(C+k*W,M+U*W));continue}var ie=(-D+S)*(-I+M)-(-D+C)*(-I+A),le=(-k+E)*(-U+M)-(-k+C)*(-U+O),ce=(z*le-B*ie)/G,_e=(L*ie-$*le)/G,pe=(ce-C)*(ce-C)+(_e-M)*(_e-M),ae=C+(ce-C)*W,oe=M+(_e-M)*W,de=C-(ce-C)*P,ye=M-(_e-M)*P,Ee=Math.min(z*z+$*$,B*B+L*L),Re=re?W:P,Ne=Ee+Re*Re*_,Be=pe<=Ne;Be?a.join===Za.BEVEL||pe/_>w?(re?(v.push(ae,oe),v.push(C+D*P,M+I*P),v.push(ae,oe),v.push(C+k*P,M+U*P)):(v.push(C-D*W,M-I*W),v.push(de,ye),v.push(C-k*W,M-U*W),v.push(de,ye)),m+=2):a.join===Za.ROUND?re?(v.push(ae,oe),v.push(C+D*P,M+I*P),m+=Gl(C,M,C+D*P,M+I*P,C+k*P,M+U*P,v,!0)+4,v.push(ae,oe),v.push(C+k*P,M+U*P)):(v.push(C-D*W,M-I*W),v.push(de,ye),m+=Gl(C,M,C-D*W,M-I*W,C-k*W,M-U*W,v,!1)+4,v.push(C-k*W,M-U*W),v.push(de,ye)):(v.push(ae,oe),v.push(de,ye)):(v.push(C-D*W,M-I*W),v.push(C+D*P,M+I*P),a.join===Za.ROUND?re?m+=Gl(C,M,C+D*P,M+I*P,C+k*P,M+U*P,v,!0)+2:m+=Gl(C,M,C-D*W,M-I*W,C-k*W,M-U*W,v,!1)+2:a.join===Za.MITER&&pe/_<=w&&(re?(v.push(de,ye),v.push(de,ye)):(v.push(ae,oe),v.push(ae,oe)),m+=2),v.push(C-k*W,M-U*W),v.push(C+k*P,M+U*P),m+=2)}S=n[(g-2)*2],A=n[(g-2)*2+1],C=n[(g-1)*2],M=n[(g-1)*2+1],D=-(A-M),I=S-C,V=Math.sqrt(D*D+I*I),D/=V,I/=V,D*=y,I*=y,v.push(C-D*W,M-I*W),v.push(C+D*P,M+I*P),l||(a.cap===Us.ROUND?m+=Gl(C-D*(W-P)*.5,M-I*(W-P)*.5,C-D*W,M-I*W,C+D*P,M+I*P,v,!1)+2:a.cap===Us.SQUARE&&(m+=fA(C,M,D,I,W,P,!1,v)));for(var $e=e.indices,Ye=Hc.epsilon*Hc.epsilon,H=x;Hv*c}},r.arc=function(e,t,n,i,a,s,o,l,c){for(var h=o-s,d=Hc._segmentsCount(Math.abs(h)*a,Math.ceil(Math.abs(h)/cd)*40),v=h/(d*2),g=v*2,m=Math.cos(v),x=Math.sin(v),y=d-1,_=y%1/y,w=0;w<=y;++w){var S=w+_*w,A=v+s+g*S,C=Math.cos(A),M=-Math.sin(A);c.push((m*C+x*M)*a+n,(m*-M+x*C)*a+i)}},r})(),ZD=(function(){function r(){}return r.curveLength=function(e,t,n,i,a,s,o,l){for(var c=10,h=0,d=0,v=0,g=0,m=0,x=0,y=0,_=0,w=0,S=0,A=0,C=e,M=t,E=1;E<=c;++E)d=E/c,v=d*d,g=v*d,m=1-d,x=m*m,y=x*m,_=y*e+3*x*d*n+3*m*v*a+g*o,w=y*t+3*x*d*i+3*m*v*s+g*l,S=C-_,A=M-w,C=_,M=w,h+=Math.sqrt(S*S+A*A);return h},r.curveTo=function(e,t,n,i,a,s,o){var l=o[o.length-2],c=o[o.length-1];o.length-=2;var h=Hc._segmentsCount(r.curveLength(l,c,e,t,n,i,a,s)),d=0,v=0,g=0,m=0,x=0;o.push(l,c);for(var y=1,_=0;y<=h;++y)_=y/h,d=1-_,v=d*d,g=v*d,m=_*_,x=m*_,o.push(g*l+3*v*_*e+3*d*m*n+x*a,g*c+3*v*_*t+3*d*m*i+x*s)},r})(),QD=(function(){function r(){}return r.curveLength=function(e,t,n,i,a,s){var o=e-2*n+a,l=t-2*i+s,c=2*n-2*e,h=2*i-2*t,d=4*(o*o+l*l),v=4*(o*c+l*h),g=c*c+h*h,m=2*Math.sqrt(d+v+g),x=Math.sqrt(d),y=2*d*x,_=2*Math.sqrt(g),w=v/x;return(y*m+x*v*(m-_)+(4*g*d-v*v)*Math.log((2*x+w+m)/(w+_)))/(4*y)},r.curveTo=function(e,t,n,i,a){for(var s=a[a.length-2],o=a[a.length-1],l=Hc._segmentsCount(r.curveLength(s,o,e,t,n,i)),c=0,h=0,d=1;d<=l;++d){var v=d/l;c=s+(e-s)*v,h=o+(t-o)*v,a.push(c+(e+(n-e)*v-c)*v,h+(t+(i-t)*v-h)*v)}},r})(),JD=(function(){function r(){this.reset()}return r.prototype.begin=function(e,t,n){this.reset(),this.style=e,this.start=t,this.attribStart=n},r.prototype.end=function(e,t){this.attribSize=t-this.attribStart,this.size=e-this.start},r.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},r})(),Hl,gp=(Hl={},Hl[Mn.POLY]=r3,Hl[Mn.CIRC]=pd,Hl[Mn.ELIP]=pd,Hl[Mn.RECT]=$D,Hl[Mn.RREC]=KD,Hl),j4=[],Df=[],V4=(function(){function r(e,t,n,i){t===void 0&&(t=null),n===void 0&&(n=null),i===void 0&&(i=null),this.points=[],this.holes=[],this.shape=e,this.lineStyle=n,this.fillStyle=t,this.matrix=i,this.type=e.type}return r.prototype.clone=function(){return new r(this.shape,this.fillStyle,this.lineStyle,this.matrix)},r.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null},r})(),gc=new Ar,eP=(function(r){t3(e,r);function e(){var t=r.call(this)||this;return t.closePointEps=1e-4,t.boundsPadding=0,t.uvsFloat32=null,t.indicesUint16=null,t.batchable=!1,t.points=[],t.colors=[],t.uvs=[],t.indices=[],t.textureIds=[],t.graphicsData=[],t.drawCalls=[],t.batchDirty=-1,t.batches=[],t.dirty=0,t.cacheDirty=-1,t.clearDirty=0,t.shapeIndex=0,t._bounds=new hd,t.boundsDirty=-1,t}return Object.defineProperty(e.prototype,"bounds",{get:function(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},enumerable:!1,configurable:!0}),e.prototype.invalidate=function(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},e.prototype.drawShape=function(t,n,i,a){n===void 0&&(n=null),i===void 0&&(i=null),a===void 0&&(a=null);var s=new V4(t,n,i,a);return this.graphicsData.push(s),this.dirty++,this},e.prototype.drawHole=function(t,n){if(n===void 0&&(n=null),!this.graphicsData.length)return null;var i=new V4(t,null,null,n),a=this.graphicsData[this.graphicsData.length-1];return i.lineStyle=a.lineStyle,a.holes.push(i),this.dirty++,this},e.prototype.destroy=function(){r.prototype.destroy.call(this);for(var t=0;t0&&(i=this.batches[this.batches.length-1],a=i.style);for(var s=this.shapeIndex;s65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&S===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=S?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}},e.prototype._compareStyles=function(t,n){return!(!t||!n||t.texture.baseTexture!==n.texture.baseTexture||t.color+t.alpha!==n.color+n.alpha||!!t.native!=!!n.native)},e.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var t=0,n=this.graphicsData.length;t65535*2)return!1;for(var t=this.batches,n=0;n0&&(s=Df.pop(),s||(s=new Up,s.texArray=new Gp),this.drawCalls.push(s)),s.start=v,s.size=0,s.texArray.count=0,s.type=d),y.touched=1,y._batchEnabled=t,y._batchLocation=o,y.wrapMode=Ia.REPEAT,s.texArray.elements[s.texArray.count++]=y,o++)),s.size+=g.size,v+=g.size,c=y._batchLocation,this.addColors(i,x.color,x.alpha,g.attribSize,g.attribStart),this.addTextureIds(a,c,g.attribSize,g.attribStart)}Wt._globalBatch=t,this.packAttributes()},e.prototype.packAttributes=function(){for(var t=this.points,n=this.uvs,i=this.colors,a=this.textureIds,s=new ArrayBuffer(t.length*3*4),o=new Float32Array(s),l=new Uint32Array(s),c=0,h=0;h>16)+(n&65280)+((n&255)<<16),l=Sg(o,i);t.length=Math.max(t.length,s+a);for(var c=0;c0&&t.alpha>0;return n?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:n},t)):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,n=this.currentPath.points.length;n>2&&(this.drawShape(this.currentPath),this.currentPath=new Uf,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[n-2],t[n-1]))}else this.currentPath=new Uf,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,n){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=n,this},e.prototype.lineTo=function(t,n){this.currentPath||this.moveTo(0,0);var i=this.currentPath.points,a=i[i.length-2],s=i[i.length-1];return(a!==t||s!==n)&&i.push(t,n),this},e.prototype._initCurve=function(t,n){t===void 0&&(t=0),n===void 0&&(n=0),this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[t,n]):this.moveTo(t,n)},e.prototype.quadraticCurveTo=function(t,n,i,a){this._initCurve();var s=this.currentPath.points;return s.length===0&&this.moveTo(0,0),QD.curveTo(t,n,i,a,s),this},e.prototype.bezierCurveTo=function(t,n,i,a,s,o){return this._initCurve(),ZD.curveTo(t,n,i,a,s,o,this.currentPath.points),this},e.prototype.arcTo=function(t,n,i,a,s){this._initCurve(t,n);var o=this.currentPath.points,l=H4.curveTo(t,n,i,a,s,o);if(l){var c=l.cx,h=l.cy,d=l.radius,v=l.startAngle,g=l.endAngle,m=l.anticlockwise;this.arc(c,h,d,v,g,m)}return this},e.prototype.arc=function(t,n,i,a,s,o){if(o===void 0&&(o=!1),a===s)return this;!o&&s<=a?s+=cd:o&&a<=s&&(a+=cd);var l=s-a;if(l===0)return this;var c=t+Math.cos(a)*i,h=n+Math.sin(a)*i,d=this._geometry.closePointEps,v=this.currentPath?this.currentPath.points:null;if(v){var g=Math.abs(v[v.length-2]-c),m=Math.abs(v[v.length-1]-h);g0;return n?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:n},t)):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,n,i,a){return this.drawShape(new $t(t,n,i,a))},e.prototype.drawRoundedRect=function(t,n,i,a,s){return this.drawShape(new KO(t,n,i,a,s))},e.prototype.drawCircle=function(t,n,i){return this.drawShape(new WO(t,n,i))},e.prototype.drawEllipse=function(t,n,i,a){return this.drawShape(new $O(t,n,i,a))},e.prototype.drawPolygon=function(){for(var t=arguments,n=[],i=0;i>16&255)/255*s,o.tint[1]=(a>>8&255)/255*s,o.tint[2]=(a&255)/255*s,o.tint[3]=s,t.shader.bind(n),t.geometry.bind(i,n),t.state.set(this.state);for(var c=0,h=l.length;c>16)+(c&65280)+((c&255)<<16)}}},e.prototype.calculateVertices=function(){var t=this.transform._worldID;if(this._transformID!==t){this._transformID=t;for(var n=this.transform.worldTransform,i=n.a,a=n.b,s=n.c,o=n.d,l=n.tx,c=n.ty,h=this._geometry.points,d=this.vertexData,v=0,g=0;g=a&&bf.x=s&&bf.y>16)+(t&65280)+((t&255)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=t||Rt.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},enumerable:!1,configurable:!0}),e})(_a);/*! * @pixi/text - v6.5.10 * Compiled Thu, 06 Jul 2023 15:25:11 UTC * * @pixi/text is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license *//*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var X4=function(r,e){return X4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},X4(r,e)};function _Z(r,e){X4(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var jc;(function(r){r[r.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",r[r.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"})(jc||(jc={}));var ox={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:jc.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},wZ=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],mu=(function(){function r(e){this.styleID=0,this.reset(),ux(this,e,e)}return r.prototype.clone=function(){var e={};return ux(e,this,ox),new r(e)},r.prototype.reset=function(){ux(this,ox,ox)},Object.defineProperty(r.prototype,"align",{get:function(){return this._align},set:function(e){this._align!==e&&(this._align=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"breakWords",{get:function(){return this._breakWords},set:function(e){this._breakWords!==e&&(this._breakWords=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadow",{get:function(){return this._dropShadow},set:function(e){this._dropShadow!==e&&(this._dropShadow=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowAlpha",{get:function(){return this._dropShadowAlpha},set:function(e){this._dropShadowAlpha!==e&&(this._dropShadowAlpha=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowAngle",{get:function(){return this._dropShadowAngle},set:function(e){this._dropShadowAngle!==e&&(this._dropShadowAngle=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowBlur",{get:function(){return this._dropShadowBlur},set:function(e){this._dropShadowBlur!==e&&(this._dropShadowBlur=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowColor",{get:function(){return this._dropShadowColor},set:function(e){var t=lx(e);this._dropShadowColor!==t&&(this._dropShadowColor=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowDistance",{get:function(){return this._dropShadowDistance},set:function(e){this._dropShadowDistance!==e&&(this._dropShadowDistance=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fill",{get:function(){return this._fill},set:function(e){var t=lx(e);this._fill!==t&&(this._fill=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fillGradientType",{get:function(){return this._fillGradientType},set:function(e){this._fillGradientType!==e&&(this._fillGradientType=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fillGradientStops",{get:function(){return this._fillGradientStops},set:function(e){SZ(this._fillGradientStops,e)||(this._fillGradientStops=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontFamily",{get:function(){return this._fontFamily},set:function(e){this.fontFamily!==e&&(this._fontFamily=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontSize",{get:function(){return this._fontSize},set:function(e){this._fontSize!==e&&(this._fontSize=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontStyle",{get:function(){return this._fontStyle},set:function(e){this._fontStyle!==e&&(this._fontStyle=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontVariant",{get:function(){return this._fontVariant},set:function(e){this._fontVariant!==e&&(this._fontVariant=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontWeight",{get:function(){return this._fontWeight},set:function(e){this._fontWeight!==e&&(this._fontWeight=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"lineHeight",{get:function(){return this._lineHeight},set:function(e){this._lineHeight!==e&&(this._lineHeight=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"leading",{get:function(){return this._leading},set:function(e){this._leading!==e&&(this._leading=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"lineJoin",{get:function(){return this._lineJoin},set:function(e){this._lineJoin!==e&&(this._lineJoin=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"miterLimit",{get:function(){return this._miterLimit},set:function(e){this._miterLimit!==e&&(this._miterLimit=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"padding",{get:function(){return this._padding},set:function(e){this._padding!==e&&(this._padding=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"stroke",{get:function(){return this._stroke},set:function(e){var t=lx(e);this._stroke!==t&&(this._stroke=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"strokeThickness",{get:function(){return this._strokeThickness},set:function(e){this._strokeThickness!==e&&(this._strokeThickness=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"textBaseline",{get:function(){return this._textBaseline},set:function(e){this._textBaseline!==e&&(this._textBaseline=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"trim",{get:function(){return this._trim},set:function(e){this._trim!==e&&(this._trim=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"whiteSpace",{get:function(){return this._whiteSpace},set:function(e){this._whiteSpace!==e&&(this._whiteSpace=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wordWrap",{get:function(){return this._wordWrap},set:function(e){this._wordWrap!==e&&(this._wordWrap=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wordWrapWidth",{get:function(){return this._wordWrapWidth},set:function(e){this._wordWrapWidth!==e&&(this._wordWrapWidth=e,this.styleID++)},enumerable:!1,configurable:!0}),r.prototype.toFontString=function(){var e=typeof this.fontSize=="number"?this.fontSize+"px":this.fontSize,t=this.fontFamily;Array.isArray(this.fontFamily)||(t=this.fontFamily.split(","));for(var n=t.length-1;n>=0;n--){var i=t[n].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&wZ.indexOf(i)<0&&(i='"'+i+'"'),t[n]=i}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+e+" "+t.join(",")},r})();function dA(r){return typeof r=="number"?bw(r):(typeof r=="string"&&r.indexOf("0x")===0&&(r=r.replace("0x","#")),r)}function lx(r){if(Array.isArray(r)){for(var e=0;em)if(s!==""&&(o+=r.addLine(s),s="",a=0),r.canBreakWords(_,t.breakWords))for(var C=r.wordWrapSplit(_),M=0;Mm&&(o+=r.addLine(s),g=!1,s="",a=0),s+=E,a+=k}else{s.length>0&&(o+=r.addLine(s),s="",a=0);var U=y===x.length-1;o+=r.addLine(_,!U),g=!1,s="",a=0}else A+a>m&&(g=!1,o+=r.addLine(s),s="",a=0),(s.length>0||!r.isBreakingSpace(_)||g)&&(s+=_,a+=A)}return o+=r.addLine(s,!1),o},r.addLine=function(e,t){return t===void 0&&(t=!0),e=r.trimRight(e),e=t?e+` `:e,e},r.getFromCache=function(e,t,n,i){var a=n[e];if(typeof a!="number"){var s=e.length*t;a=i.measureText(e).width+s,n[e]=a}return a},r.collapseSpaces=function(e){return e==="normal"||e==="pre-line"},r.collapseNewlines=function(e){return e==="normal"},r.trimRight=function(e){if(typeof e!="string")return"";for(var t=e.length-1;t>=0;t--){var n=e[t];if(!r.isBreakingSpace(n))break;e=e.slice(0,-1)}return e},r.isNewline=function(e){return typeof e!="string"?!1:r._newlines.indexOf(e.charCodeAt(0))>=0},r.isBreakingSpace=function(e,t){return typeof e!="string"?!1:r._breakingSpaces.indexOf(e.charCodeAt(0))>=0},r.tokenize=function(e){var t=[],n="";if(typeof e!="string")return t;for(var i=0;io;--v){for(var x=0;x0&&y>_&&(w=(_+y)/2);var S=_+x,A=i.lineHeight*(m+1),C=S;m+10},r})();function CZ(r,e){var t=!1;if(r&&r._textures&&r._textures.length){for(var n=0;n=0;t--)this.add(e.children[t]);return this},r.prototype.destroy=function(){this.ticking&&Fn.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null},r})();function iP(r,e){return e instanceof Wt?(e._glTextures[r.CONTEXT_UID]||r.texture.bind(e),!0):!1}function IZ(r,e){if(!(e instanceof gd))return!1;var t=e.geometry;e.finishPoly(),t.updateBatches();for(var n=t.batches,i=0;i=a&&xf.x=s&&xf.y1?Gs.from(zZ,UZ,n):Gs.from(vA,FZ,n)},e.prototype.render=function(t){var n=this.renderer,i=this.quad,a=i.vertices;a[0]=a[6]=t._width*-t.anchor.x,a[1]=a[3]=t._height*-t.anchor.y,a[2]=a[4]=t._width*(1-t.anchor.x),a[5]=a[7]=t._height*(1-t.anchor.y);var s=t.uvRespectAnchor?t.anchor.x:0,o=t.uvRespectAnchor?t.anchor.y:0;a=i.uvs,a[0]=a[6]=-s,a[1]=a[3]=-o,a[2]=a[4]=1-s,a[5]=a[7]=1-o,i.invalidate();var l=t._texture,c=l.baseTexture,h=c.alphaMode>0,d=t.tileTransform.localTransform,v=t.uvMatrix,g=c.isPowerOfTwo&&l.frame.width===c.width&&l.frame.height===c.height;g&&(c._glTextures[n.CONTEXT_UID]?g=c.wrapMode!==Ia.CLAMP:c.wrapMode===Ia.CLAMP&&(c.wrapMode=Ia.REPEAT));var m=g?this.simpleShader:this.shader,x=l.width,y=l.height,_=t._width,w=t._height;Bv.set(d.a*x/_,d.b*x/w,d.c*y/_,d.d*y/w,d.tx/_,d.ty/w),Bv.invert(),g?Bv.prepend(v.mapCoord):(m.uniforms.uMapCoord=v.mapCoord.toArray(!0),m.uniforms.uClampFrame=v.uClampFrame,m.uniforms.uClampOffset=v.uClampOffset),m.uniforms.uTransform=Bv.toArray(!0),m.uniforms.uColor=Sw(t.tint,t.worldAlpha,m.uniforms.uColor,h),m.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),m.uniforms.uSampler=l,n.shader.bind(m),n.geometry.bind(i),this.state.blendMode=ww(t.blendMode,h),n.state.set(this.state),n.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},e.extension={name:"tilingSprite",type:yr.RendererPlugin},e})(kd);/*! * @pixi/mesh - v6.5.10 * Compiled Thu, 06 Jul 2023 15:25:11 UTC * * @pixi/mesh is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license *//*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var $4=function(r,e){return $4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},$4(r,e)};function i3(r,e){$4(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var cP=(function(){function r(e,t){this.uvBuffer=e,this.uvMatrix=t,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}return r.prototype.update=function(e){if(!(!e&&this._bufferUpdateId===this.uvBuffer._updateID&&this._textureUpdateId===this.uvMatrix._updateID)){this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;var t=this.uvBuffer.data;(!this.data||this.data.length!==t.length)&&(this.data=new Float32Array(t.length)),this.uvMatrix.multiplyUvs(t,this.data),this._updateID++}},r})(),cx=new Ar,pA=new Uf,Vc=(function(r){i3(e,r);function e(t,n,i,a){a===void 0&&(a=pa.TRIANGLES);var s=r.call(this)||this;return s.geometry=t,s.shader=n,s.state=i||gl.for2d(),s.drawMode=a,s.start=0,s.size=0,s.uvs=null,s.indices=null,s.vertexData=new Float32Array(1),s.vertexDirty=-1,s._transformID=-1,s._roundPixels=ht.ROUND_PIXELS,s.batchUvs=null,s}return Object.defineProperty(e.prototype,"geometry",{get:function(){return this._geometry},set:function(t){this._geometry!==t&&(this._geometry&&(this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose()),this._geometry=t,this._geometry&&this._geometry.refCount++,this.vertexDirty=-1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"uvBuffer",{get:function(){return this.geometry.buffers[1]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"verticesBuffer",{get:function(){return this.geometry.buffers[0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"material",{get:function(){return this.shader},set:function(t){this.shader=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return"tint"in this.shader?this.shader.tint:null},set:function(t){this.shader.tint=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){return"texture"in this.shader?this.shader.texture:null},set:function(t){this.shader.texture=t},enumerable:!1,configurable:!0}),e.prototype._render=function(t){var n=this.geometry.buffers[0].data,i=this.shader;i.batchable&&this.drawMode===pa.TRIANGLES&&n.length>16)+(t&65280)+((t&255)<<16),this._colorDirty=!0)},enumerable:!1,configurable:!0}),e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;Sw(this._tint,this._alpha,this.uniforms.uColor,t.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},e})(Gs),Bd=(function(r){i3(e,r);function e(t,n,i){var a=r.call(this)||this,s=new wn(t),o=new wn(n,!0),l=new wn(i,!0,!0);return a.addAttribute("aVertexPosition",s,2,!1,wt.FLOAT).addAttribute("aTextureCoord",o,2,!1,wt.FLOAT).addIndex(l),a._updateId=-1,a}return Object.defineProperty(e.prototype,"vertexDirtyId",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0}),e})(ah);/*! * @pixi/text-bitmap - v6.5.10 * Compiled Thu, 06 Jul 2023 15:25:11 UTC * * @pixi/text-bitmap is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license *//*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var K4=function(r,e){return K4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},K4(r,e)};function jZ(r,e){K4(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var md=(function(){function r(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}return r})(),hP=(function(){function r(){}return r.test=function(e){return typeof e=="string"&&e.indexOf("info face=")===0},r.parse=function(e){var t=e.match(/^[a-z]+\s+.+$/gm),n={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(var i in t){var a=t[i].match(/^[a-z]+/gm)[0],s=t[i].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),o={};for(var l in s){var c=s[l].split("="),h=c[0],d=c[1].replace(/"/gm,""),v=parseFloat(d),g=isNaN(v)?d:v;o[h]=g}n[a].push(o)}var m=new md;return n.info.forEach(function(x){return m.info.push({face:x.face,size:parseInt(x.size,10)})}),n.common.forEach(function(x){return m.common.push({lineHeight:parseInt(x.lineHeight,10)})}),n.page.forEach(function(x){return m.page.push({id:parseInt(x.id,10),file:x.file})}),n.char.forEach(function(x){return m.char.push({id:parseInt(x.id,10),page:parseInt(x.page,10),x:parseInt(x.x,10),y:parseInt(x.y,10),width:parseInt(x.width,10),height:parseInt(x.height,10),xoffset:parseInt(x.xoffset,10),yoffset:parseInt(x.yoffset,10),xadvance:parseInt(x.xadvance,10)})}),n.kerning.forEach(function(x){return m.kerning.push({first:parseInt(x.first,10),second:parseInt(x.second,10),amount:parseInt(x.amount,10)})}),n.distanceField.forEach(function(x){return m.distanceField.push({distanceRange:parseInt(x.distanceRange,10),fieldType:x.fieldType})}),m},r})(),Vp=(function(){function r(){}return r.test=function(e){return e instanceof XMLDocument&&e.getElementsByTagName("page").length&&e.getElementsByTagName("info")[0].getAttribute("face")!==null},r.parse=function(e){for(var t=new md,n=e.getElementsByTagName("info"),i=e.getElementsByTagName("common"),a=e.getElementsByTagName("page"),s=e.getElementsByTagName("char"),o=e.getElementsByTagName("kerning"),l=e.getElementsByTagName("distanceField"),c=0;c")>-1){var t=new globalThis.DOMParser().parseFromString(e,"text/xml");return Vp.test(t)}return!1},r.parse=function(e){var t=new globalThis.DOMParser().parseFromString(e,"text/xml");return Vp.parse(t)},r})(),hx=[hP,Vp,fP];function a3(r){for(var e=0;e=c-D*o){if(x===0)throw new Error("[BitmapFont] textureHeight "+c+"px is too small "+("(fontFamily: '"+d.fontFamily+"', fontSize: "+d.fontSize+"px, char: '"+M+"')"));--C,y=null,_=null,w=null,x=0,m=0,S=0;continue}if(S=Math.max(D+E.fontProperties.descent,S),I*o+m>=v){if(m===0)throw new Error("[BitmapFont] textureWidth "+l+"px is too small "+("(fontFamily: '"+d.fontFamily+"', fontSize: "+d.fontSize+"px, char: '"+M+"')"));--C,x+=S*o,x=Math.ceil(x),m=0,S=0;continue}qZ(y,_,E,m,x,o,d);var k=mp(E.text);g.char.push({id:k,page:A.length-1,x:m/o,y:x/o,width:I,height:D,xoffset:0,yoffset:0,xadvance:Math.ceil(O-(d.dropShadow?d.dropShadowDistance:0)-(d.stroke?d.strokeThickness:0))}),m+=(I+2*s)*o,m=Math.ceil(m)}if(!(n!=null&&n.skipKerning))for(var C=0,U=h.length;C 0.99) {\r alpha = 1.0;\r }\r \r // NPM Textures, NPM outputs\r gl_FragColor = vec4(uColor.rgb, uColor.a * alpha);\r \r }\r `,WZ=`// Mesh material default fragment\r attribute vec2 aVertexPosition;\r attribute vec2 aTextureCoord;\r \r uniform mat3 projectionMatrix;\r uniform mat3 translationMatrix;\r uniform mat3 uTextureMatrix;\r \r varying vec2 vTextureCoord;\r \r void main(void)\r {\r gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r \r vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\r }\r `,gA=[],mA=[],yA=[],$Z=(function(r){jZ(e,r);function e(t,n){n===void 0&&(n={});var i=r.call(this)||this;i._tint=16777215;var a=Object.assign({},e.styleDefaults,n),s=a.align,o=a.tint,l=a.maxWidth,c=a.letterSpacing,h=a.fontName,d=a.fontSize;if(!Ls.available[h])throw new Error('Missing BitmapFont "'+h+'"');return i._activePagesMeshData=[],i._textWidth=0,i._textHeight=0,i._align=s,i._tint=o,i._font=void 0,i._fontName=h,i._fontSize=d,i.text=t,i._maxWidth=l,i._maxLineHeight=0,i._letterSpacing=c,i._anchor=new Go(function(){i.dirty=!0},i,0,0),i._roundPixels=ht.ROUND_PIXELS,i.dirty=!0,i._resolution=ht.RESOLUTION,i._autoResolution=!0,i._textureCache={},i}return e.prototype.updateText=function(){for(var t,n=Ls.available[this._fontName],i=this.fontSize,a=i/n.size,s=new Ar,o=[],l=[],c=[],h=this._text.replace(/(?:\r\n|\r)/g,` `)||" ",d=dP(h),v=this._maxWidth*n.size/i,g=n.distanceFieldType==="none"?gA:mA,m=null,x=0,y=0,_=0,w=-1,S=0,A=0,C=0,M=0,E=0;E0&&s.x>v&&(++A,lu(o,1+w-A,1+E-w),E=w,w=-1,l.push(S),c.push(o.length>0?o[o.length-1].prevSpaces:0),y=Math.max(y,S),_++,s.x=0,s.y+=n.lineHeight,m=null,M=0)}}var U=d[d.length-1];U!=="\r"&&U!==` `&&(/(?:\s)/.test(U)&&(x=S),l.push(x),y=Math.max(y,x),c.push(-1));for(var V=[],E=0;E<=_;E++){var X=0;this._align==="right"?X=y-l[E]:this._align==="center"?X=(y-l[E])/2:this._align==="justify"&&(X=c[E]<0?0:(y-l[E])/c[E]),V.push(X)}var W=o.length,P={},H=[],z=this._activePagesMeshData;g.push.apply(g,z);for(var E=0;E6*ce)||L.vertices.length=t&&(s=r-o-1),l=l.replace("%value%",e[s].toString()),i+=l,i+=` `}return n=n.replace("%blur%",i),n=n.replace("%size%",r.toString()),n}var J4=(function(r){pP(e,r);function e(t,n,i,a,s){n===void 0&&(n=8),i===void 0&&(i=4),a===void 0&&(a=ht.FILTER_RESOLUTION),s===void 0&&(s=5);var o=this,l=eQ(s,t),c=nQ(s);return o=r.call(this,l,c)||this,o.horizontal=t,o.resolution=a,o._quality=0,o.quality=i,o.blur=n,o}return e.prototype.apply=function(t,n,i,a){if(i?this.horizontal?this.uniforms.strength=1/i.width*(i.width/n.width):this.uniforms.strength=1/i.height*(i.height/n.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/n.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/n.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,this.passes===1)t.applyFilter(this,n,i,a);else{var s=t.getFilterTexture(),o=t.renderer,l=n,c=s;this.state.blend=!1,t.applyFilter(this,l,c,ha.CLEAR);for(var h=1;h 0.0) { c.rgb /= c.a; } vec4 result; result.r = (m[0] * c.r); result.r += (m[1] * c.g); result.r += (m[2] * c.b); result.r += (m[3] * c.a); result.r += m[4]; result.g = (m[5] * c.r); result.g += (m[6] * c.g); result.g += (m[7] * c.b); result.g += (m[8] * c.a); result.g += m[9]; result.b = (m[10] * c.r); result.b += (m[11] * c.g); result.b += (m[12] * c.b); result.b += (m[13] * c.a); result.b += m[14]; result.a = (m[15] * c.r); result.a += (m[16] * c.g); result.a += (m[17] * c.b); result.a += (m[18] * c.a); result.a += m[19]; vec3 rgb = mix(c.rgb, result.rgb, uAlpha); // Premultiply alpha again. rgb *= result.a; gl_FragColor = vec4(rgb, result.a); } `,t_=(function(r){aQ(e,r);function e(){var t=this,n={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};return t=r.call(this,Kw,sQ,n)||this,t.alpha=1,t}return e.prototype._loadMatrix=function(t,n){n===void 0&&(n=!1);var i=t;n&&(this._multiply(i,this.uniforms.m,t),i=this._colorMatrix(i)),this.uniforms.m=i},e.prototype._multiply=function(t,n,i){return t[0]=n[0]*i[0]+n[1]*i[5]+n[2]*i[10]+n[3]*i[15],t[1]=n[0]*i[1]+n[1]*i[6]+n[2]*i[11]+n[3]*i[16],t[2]=n[0]*i[2]+n[1]*i[7]+n[2]*i[12]+n[3]*i[17],t[3]=n[0]*i[3]+n[1]*i[8]+n[2]*i[13]+n[3]*i[18],t[4]=n[0]*i[4]+n[1]*i[9]+n[2]*i[14]+n[3]*i[19]+n[4],t[5]=n[5]*i[0]+n[6]*i[5]+n[7]*i[10]+n[8]*i[15],t[6]=n[5]*i[1]+n[6]*i[6]+n[7]*i[11]+n[8]*i[16],t[7]=n[5]*i[2]+n[6]*i[7]+n[7]*i[12]+n[8]*i[17],t[8]=n[5]*i[3]+n[6]*i[8]+n[7]*i[13]+n[8]*i[18],t[9]=n[5]*i[4]+n[6]*i[9]+n[7]*i[14]+n[8]*i[19]+n[9],t[10]=n[10]*i[0]+n[11]*i[5]+n[12]*i[10]+n[13]*i[15],t[11]=n[10]*i[1]+n[11]*i[6]+n[12]*i[11]+n[13]*i[16],t[12]=n[10]*i[2]+n[11]*i[7]+n[12]*i[12]+n[13]*i[17],t[13]=n[10]*i[3]+n[11]*i[8]+n[12]*i[13]+n[13]*i[18],t[14]=n[10]*i[4]+n[11]*i[9]+n[12]*i[14]+n[13]*i[19]+n[14],t[15]=n[15]*i[0]+n[16]*i[5]+n[17]*i[10]+n[18]*i[15],t[16]=n[15]*i[1]+n[16]*i[6]+n[17]*i[11]+n[18]*i[16],t[17]=n[15]*i[2]+n[16]*i[7]+n[17]*i[12]+n[18]*i[17],t[18]=n[15]*i[3]+n[16]*i[8]+n[17]*i[13]+n[18]*i[18],t[19]=n[15]*i[4]+n[16]*i[9]+n[17]*i[14]+n[18]*i[19]+n[19],t},e.prototype._colorMatrix=function(t){var n=new Float32Array(t);return n[4]/=255,n[9]/=255,n[14]/=255,n[19]/=255,n},e.prototype.brightness=function(t,n){var i=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(i,n)},e.prototype.tint=function(t,n){var i=t>>16&255,a=t>>8&255,s=t&255,o=[i/255,0,0,0,0,0,a/255,0,0,0,0,0,s/255,0,0,0,0,0,1,0];this._loadMatrix(o,n)},e.prototype.greyscale=function(t,n){var i=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(i,n)},e.prototype.blackAndWhite=function(t){var n=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0];this._loadMatrix(n,t)},e.prototype.hue=function(t,n){t=(t||0)/180*Math.PI;var i=Math.cos(t),a=Math.sin(t),s=Math.sqrt,o=1/3,l=s(o),c=i+(1-i)*o,h=o*(1-i)-l*a,d=o*(1-i)+l*a,v=o*(1-i)+l*a,g=i+o*(1-i),m=o*(1-i)-l*a,x=o*(1-i)-l*a,y=o*(1-i)+l*a,_=i+o*(1-i),w=[c,h,d,0,0,v,g,m,0,0,x,y,_,0,0,0,0,0,1,0];this._loadMatrix(w,n)},e.prototype.contrast=function(t,n){var i=(t||0)+1,a=-.5*(i-1),s=[i,0,0,0,a,0,i,0,0,a,0,0,i,0,a,0,0,0,1,0];this._loadMatrix(s,n)},e.prototype.saturate=function(t,n){t===void 0&&(t=0);var i=t*2/3+1,a=(i-1)*-.5,s=[i,a,a,0,0,a,i,a,0,0,a,a,i,0,0,0,0,0,1,0];this._loadMatrix(s,n)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){var n=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0];this._loadMatrix(n,t)},e.prototype.sepia=function(t){var n=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0];this._loadMatrix(n,t)},e.prototype.technicolor=function(t){var n=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0];this._loadMatrix(n,t)},e.prototype.polaroid=function(t){var n=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0];this._loadMatrix(n,t)},e.prototype.toBGR=function(t){var n=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0];this._loadMatrix(n,t)},e.prototype.kodachrome=function(t){var n=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0];this._loadMatrix(n,t)},e.prototype.browni=function(t){var n=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0];this._loadMatrix(n,t)},e.prototype.vintage=function(t){var n=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0];this._loadMatrix(n,t)},e.prototype.colorTone=function(t,n,i,a,s){t=t||.2,n=n||.15,i=i||16770432,a=a||3375104;var o=(i>>16&255)/255,l=(i>>8&255)/255,c=(i&255)/255,h=(a>>16&255)/255,d=(a>>8&255)/255,v=(a&255)/255,g=[.3,.59,.11,0,0,o,l,c,t,0,h,d,v,n,0,o-h,l-d,c-v,0,0];this._loadMatrix(g,s)},e.prototype.night=function(t,n){t=t||.1;var i=[t*-2,-t,0,0,0,-t,0,t,0,0,0,t,t*2,0,0,0,0,0,1,0];this._loadMatrix(i,n)},e.prototype.predator=function(t,n){var i=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(i,n)},e.prototype.lsd=function(t){var n=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(n,t)},e.prototype.reset=function(){var t=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(t,!1)},Object.defineProperty(e.prototype,"matrix",{get:function(){return this.uniforms.m},set:function(t){this.uniforms.m=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t},enumerable:!1,configurable:!0}),e})(Zs);t_.prototype.grayscale=t_.prototype.greyscale;/*! * @pixi/filter-displacement - v6.5.10 * Compiled Thu, 06 Jul 2023 15:25:11 UTC * * @pixi/filter-displacement is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license *//*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var r_=function(r,e){return r_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},r_(r,e)};function oQ(r,e){r_(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var lQ=`varying vec2 vFilterCoord; varying vec2 vTextureCoord; uniform vec2 scale; uniform mat2 rotation; uniform sampler2D uSampler; uniform sampler2D mapSampler; uniform highp vec4 inputSize; uniform vec4 inputClamp; void main(void) { vec4 map = texture2D(mapSampler, vFilterCoord); map -= 0.5; map.xy = scale * inputSize.zw * (rotation * map.xy); gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw)); } `,uQ=`attribute vec2 aVertexPosition; uniform mat3 projectionMatrix; uniform mat3 filterMatrix; varying vec2 vTextureCoord; varying vec2 vFilterCoord; uniform vec4 inputSize; uniform vec4 outputFrame; vec4 filterVertexPosition( void ) { vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); } vec2 filterTextureCoord( void ) { return aVertexPosition * (outputFrame.zw * inputSize.zw); } void main(void) { gl_Position = filterVertexPosition(); vTextureCoord = filterTextureCoord(); vFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy; } `,cQ=(function(r){oQ(e,r);function e(t,n){var i=this,a=new qr;return t.renderable=!1,i=r.call(this,uQ,lQ,{mapSampler:t._texture,filterMatrix:a,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])})||this,i.maskSprite=t,i.maskMatrix=a,n==null&&(n=20),i.scale=new Ar(n,n),i}return e.prototype.apply=function(t,n,i,a){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var s=this.maskSprite.worldTransform,o=Math.sqrt(s.a*s.a+s.b*s.b),l=Math.sqrt(s.c*s.c+s.d*s.d);o!==0&&l!==0&&(this.uniforms.rotation[0]=s.a/o,this.uniforms.rotation[1]=s.b/o,this.uniforms.rotation[2]=s.c/l,this.uniforms.rotation[3]=s.d/l),t.applyFilter(this,n,i,a)},Object.defineProperty(e.prototype,"map",{get:function(){return this.uniforms.mapSampler},set:function(t){this.uniforms.mapSampler=t},enumerable:!1,configurable:!0}),e})(Zs);/*! * @pixi/filter-fxaa - v6.5.10 * Compiled Thu, 06 Jul 2023 15:25:11 UTC * * @pixi/filter-fxaa is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license *//*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var n_=function(r,e){return n_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},n_(r,e)};function hQ(r,e){n_(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var fQ=` attribute vec2 aVertexPosition; uniform mat3 projectionMatrix; varying vec2 v_rgbNW; varying vec2 v_rgbNE; varying vec2 v_rgbSW; varying vec2 v_rgbSE; varying vec2 v_rgbM; varying vec2 vFragCoord; uniform vec4 inputSize; uniform vec4 outputFrame; vec4 filterVertexPosition( void ) { vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); } void texcoords(vec2 fragCoord, vec2 inverseVP, out vec2 v_rgbNW, out vec2 v_rgbNE, out vec2 v_rgbSW, out vec2 v_rgbSE, out vec2 v_rgbM) { v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP; v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP; v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP; v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP; v_rgbM = vec2(fragCoord * inverseVP); } void main(void) { gl_Position = filterVertexPosition(); vFragCoord = aVertexPosition * outputFrame.zw; texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM); } `,dQ=`varying vec2 v_rgbNW; varying vec2 v_rgbNE; varying vec2 v_rgbSW; varying vec2 v_rgbSE; varying vec2 v_rgbM; varying vec2 vFragCoord; uniform sampler2D uSampler; uniform highp vec4 inputSize; /** Basic FXAA implementation based on the code on geeks3d.com with the modification that the texture2DLod stuff was removed since it's unsupported by WebGL. -- From: https://github.com/mitsuhiko/webgl-meincraft Copyright (c) 2011 by Armin Ronacher. Some rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef FXAA_REDUCE_MIN #define FXAA_REDUCE_MIN (1.0/ 128.0) #endif #ifndef FXAA_REDUCE_MUL #define FXAA_REDUCE_MUL (1.0 / 8.0) #endif #ifndef FXAA_SPAN_MAX #define FXAA_SPAN_MAX 8.0 #endif //optimized version for mobile, where dependent //texture reads can be a bottleneck vec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP, vec2 v_rgbNW, vec2 v_rgbNE, vec2 v_rgbSW, vec2 v_rgbSE, vec2 v_rgbM) { vec4 color; vec3 rgbNW = texture2D(tex, v_rgbNW).xyz; vec3 rgbNE = texture2D(tex, v_rgbNE).xyz; vec3 rgbSW = texture2D(tex, v_rgbSW).xyz; vec3 rgbSE = texture2D(tex, v_rgbSE).xyz; vec4 texColor = texture2D(tex, v_rgbM); vec3 rgbM = texColor.xyz; vec3 luma = vec3(0.299, 0.587, 0.114); float lumaNW = dot(rgbNW, luma); float lumaNE = dot(rgbNE, luma); float lumaSW = dot(rgbSW, luma); float lumaSE = dot(rgbSE, luma); float lumaM = dot(rgbM, luma); float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE))); float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE))); mediump vec2 dir; dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE)); dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE)); float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) * (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN); float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce); dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX), max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX), dir * rcpDirMin)) * inverseVP; vec3 rgbA = 0.5 * ( texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz + texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz); vec3 rgbB = rgbA * 0.5 + 0.25 * ( texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz + texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz); float lumaB = dot(rgbB, luma); if ((lumaB < lumaMin) || (lumaB > lumaMax)) color = vec4(rgbA, texColor.a); else color = vec4(rgbB, texColor.a); return color; } void main() { vec4 color; color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM); gl_FragColor = color; } `,vQ=(function(r){hQ(e,r);function e(){return r.call(this,fQ,dQ)||this}return e})(Zs);/*! * @pixi/filter-noise - v6.5.10 * Compiled Thu, 06 Jul 2023 15:25:11 UTC * * @pixi/filter-noise is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license *//*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var i_=function(r,e){return i_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},i_(r,e)};function pQ(r,e){i_(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var gQ=`precision highp float; varying vec2 vTextureCoord; varying vec4 vColor; uniform float uNoise; uniform float uSeed; uniform sampler2D uSampler; float rand(vec2 co) { return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453); } void main() { vec4 color = texture2D(uSampler, vTextureCoord); float randomValue = rand(gl_FragCoord.xy * uSeed); float diff = (randomValue - 0.5) * uNoise; // Un-premultiply alpha before applying the color matrix. See issue #3539. if (color.a > 0.0) { color.rgb /= color.a; } color.r += diff; color.g += diff; color.b += diff; // Premultiply alpha again. color.rgb *= color.a; gl_FragColor = color; } `,mQ=(function(r){pQ(e,r);function e(t,n){t===void 0&&(t=.5),n===void 0&&(n=Math.random());var i=r.call(this,Kw,gQ,{uNoise:0,uSeed:0})||this;return i.noise=t,i.seed=n,i}return Object.defineProperty(e.prototype,"noise",{get:function(){return this.uniforms.uNoise},set:function(t){this.uniforms.uNoise=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"seed",{get:function(){return this.uniforms.uSeed},set:function(t){this.uniforms.uSeed=t},enumerable:!1,configurable:!0}),e})(Zs);/*! * @pixi/mixin-cache-as-bitmap - v6.5.10 * Compiled Thu, 06 Jul 2023 15:25:11 UTC * * @pixi/mixin-cache-as-bitmap is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license */var gP=new qr;ln.prototype._cacheAsBitmap=!1;ln.prototype._cacheData=null;ln.prototype._cacheAsBitmapResolution=null;ln.prototype._cacheAsBitmapMultisample=Fr.NONE;var yQ=(function(){function r(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.originalContainsPoint=null,this.sprite=null}return r})();Object.defineProperties(ln.prototype,{cacheAsBitmapResolution:{get:function(){return this._cacheAsBitmapResolution},set:function(r){r!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=r,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get:function(){return this._cacheAsBitmapMultisample},set:function(r){r!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=r,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(r){if(this._cacheAsBitmap!==r){this._cacheAsBitmap=r;var e;r?(this._cacheData||(this._cacheData=new yQ),e=this._cacheData,e.originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):(e=this._cacheData,e.sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea)}}}});ln.prototype._renderCached=function(e){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(e),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(e))};ln.prototype._initCachedDisplayObject=function(e){var t;if(!(this._cacheData&&this._cacheData.sprite)){var n=this.alpha;this.alpha=1,e.batch.flush();var i=this.getLocalBounds(null,!0).clone();if(this.filters&&this.filters.length){var a=this.filters[0].padding;i.pad(a)}i.ceil(ht.RESOLUTION);var s=e.renderTexture.current,o=e.renderTexture.sourceFrame.clone(),l=e.renderTexture.destinationFrame.clone(),c=e.projection.transform,h=nl.create({width:i.width,height:i.height,resolution:this.cacheAsBitmapResolution||e.resolution,multisample:(t=this.cacheAsBitmapMultisample)!==null&&t!==void 0?t:e.multisample}),d="cacheAsBitmap_"+rl();this._cacheData.textureCacheId=d,Wt.addToCache(h.baseTexture,d),Rt.addToCache(h,d);var v=this.transform.localTransform.copyTo(gP).invert().translate(-i.x,-i.y);this.render=this._cacheData.originalRender,e.render(this,{renderTexture:h,clear:!0,transform:v,skipUpdateTransform:!1}),e.framebuffer.blit(),e.projection.transform=c,e.renderTexture.bind(s,o,l),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=n;var g=new oh(h);g.transform.worldTransform=this.transform.worldTransform,g.anchor.x=-(i.x/i.width),g.anchor.y=-(i.y/i.height),g.alpha=n,g._bounds=this._bounds,this._cacheData.sprite=g,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=g.containsPoint.bind(g)}};ln.prototype._renderCachedCanvas=function(e){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(e),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(e))};ln.prototype._initCachedDisplayObjectCanvas=function(e){if(!(this._cacheData&&this._cacheData.sprite)){var t=this.getLocalBounds(null,!0),n=this.alpha;this.alpha=1;var i=e.context,a=e._projTransform;t.ceil(ht.RESOLUTION);var s=nl.create({width:t.width,height:t.height}),o="cacheAsBitmap_"+rl();this._cacheData.textureCacheId=o,Wt.addToCache(s.baseTexture,o),Rt.addToCache(s,o);var l=gP;this.transform.localTransform.copyTo(l),l.invert(),l.tx-=t.x,l.ty-=t.y,this.renderCanvas=this._cacheData.originalRenderCanvas,e.render(this,{renderTexture:s,clear:!0,transform:l,skipUpdateTransform:!1}),e.context=i,e._projTransform=a,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=n;var c=new oh(s);c.transform.worldTransform=this.transform.worldTransform,c.anchor.x=-(t.x/t.width),c.anchor.y=-(t.y/t.height),c.alpha=n,c._bounds=this._bounds,this._cacheData.sprite=c,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=e._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=c.containsPoint.bind(c)}};ln.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID};ln.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)};ln.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,Wt.removeFromCache(this._cacheData.textureCacheId),Rt.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null};ln.prototype._cacheAsBitmapDestroy=function(e){this.cacheAsBitmap=!1,this.destroy(e)};/*! * @pixi/mixin-get-child-by-name - v6.5.10 * Compiled Thu, 06 Jul 2023 15:25:11 UTC * * @pixi/mixin-get-child-by-name is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license */ln.prototype.name=null;_a.prototype.getChildByName=function(e,t){for(var n=0,i=this.children.length;n0){var m=c.x-t[v].x,x=c.y-t[v].y,y=Math.sqrt(m*m+x*x);c=t[v],l+=y/h}else l=v/(d-1);s[g]=l,s[g+1]=0,s[g+2]=l,s[g+3]=1}for(var _=0,v=0;v0?this.textureScale*this._width/2:this._width/2;a/=v,s/=v,a*=g,s*=g,o[d]=h.x+a,o[d+1]=h.y+s,o[d+2]=h.x-a,o[d+3]=h.y-s,n=h}this.buffers[0].update()}},e.prototype.update=function(){this.textureScale>0?this.build():this.updateVertices()},e})(Bd),bQ=(function(r){lh(e,r);function e(t,n,i){i===void 0&&(i=0);var a=this,s=new bP(t.height,n,i),o=new qc(t);return i>0&&(t.baseTexture.wrapMode=Ia.REPEAT),a=r.call(this,s,o)||this,a.autoUpdate=!0,a}return e.prototype._render=function(t){var n=this.geometry;(this.autoUpdate||n._width!==this.shader.texture.height)&&(n._width=this.shader.texture.height,n.update()),r.prototype._render.call(this,t)},e})(Vc),xP=(function(r){lh(e,r);function e(t,n,i){var a=this,s=new yP(t.width,t.height,n,i),o=new qc(Rt.WHITE);return a=r.call(this,s,o)||this,a.texture=t,a.autoResize=!0,a}return e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID;var t=this.geometry,n=this.shader.texture,i=n.width,a=n.height;this.autoResize&&(t.width!==i||t.height!==a)&&(t.width=this.shader.texture.width,t.height=this.shader.texture.height,t.build())},Object.defineProperty(e.prototype,"texture",{get:function(){return this.shader.texture},set:function(t){this.shader.texture!==t&&(this.shader.texture=t,this._textureID=-1,t.baseTexture.valid?this.textureUpdated():t.once("update",this.textureUpdated,this))},enumerable:!1,configurable:!0}),e.prototype._render=function(t){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),r.prototype._render.call(this,t)},e.prototype.destroy=function(t){this.shader.texture.off("update",this.textureUpdated,this),r.prototype.destroy.call(this,t)},e})(Vc),xQ=(function(r){lh(e,r);function e(t,n,i,a,s){t===void 0&&(t=Rt.EMPTY);var o=this,l=new Bd(n,i,a);l.getBuffer("aVertexPosition").static=!1;var c=new qc(t);return o=r.call(this,l,c,null,s)||this,o.autoUpdate=!0,o}return Object.defineProperty(e.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(t){this.geometry.getBuffer("aVertexPosition").data=t},enumerable:!1,configurable:!0}),e.prototype._render=function(t){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),r.prototype._render.call(this,t)},e})(Vc),Fv=10,_Q=(function(r){lh(e,r);function e(t,n,i,a,s){n===void 0&&(n=Fv),i===void 0&&(i=Fv),a===void 0&&(a=Fv),s===void 0&&(s=Fv);var o=r.call(this,Rt.WHITE,4,4)||this;return o._origWidth=t.orig.width,o._origHeight=t.orig.height,o._width=o._origWidth,o._height=o._origHeight,o._leftWidth=n,o._rightWidth=a,o._topHeight=i,o._bottomHeight=s,o.texture=t,o}return e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this._refresh()},Object.defineProperty(e.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(t){this.geometry.getBuffer("aVertexPosition").data=t},enumerable:!1,configurable:!0}),e.prototype.updateHorizontalVertices=function(){var t=this.vertices,n=this._getMinScale();t[9]=t[11]=t[13]=t[15]=this._topHeight*n,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*n,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,n=this._getMinScale();t[2]=t[10]=t[18]=t[26]=this._leftWidth*n,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*n,t[6]=t[14]=t[22]=t[30]=this._width},e.prototype._getMinScale=function(){var t=this._leftWidth+this._rightWidth,n=this._width>t?1:this._width/t,i=this._topHeight+this._bottomHeight,a=this._height>i?1:this._height/i,s=Math.min(n,a);return s},Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"leftWidth",{get:function(){return this._leftWidth},set:function(t){this._leftWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rightWidth",{get:function(){return this._rightWidth},set:function(t){this._rightWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"topHeight",{get:function(){return this._topHeight},set:function(t){this._topHeight=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bottomHeight",{get:function(){return this._bottomHeight},set:function(t){this._bottomHeight=t,this._refresh()},enumerable:!1,configurable:!0}),e.prototype._refresh=function(){var t=this.texture,n=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var i=1/this._origWidth,a=1/this._origHeight;n[0]=n[8]=n[16]=n[24]=0,n[1]=n[3]=n[5]=n[7]=0,n[6]=n[14]=n[22]=n[30]=1,n[25]=n[27]=n[29]=n[31]=1,n[2]=n[10]=n[18]=n[26]=i*this._leftWidth,n[4]=n[12]=n[20]=n[28]=1-i*this._rightWidth,n[9]=n[11]=n[13]=n[15]=a*this._topHeight,n[17]=n[19]=n[21]=n[23]=1-a*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},e})(xP);/*! * @pixi/sprite-animated - v6.5.10 * Compiled Thu, 06 Jul 2023 15:25:11 UTC * * @pixi/sprite-animated is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license *//*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var s_=function(r,e){return s_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},s_(r,e)};function wQ(r,e){s_(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var SQ=(function(r){wQ(e,r);function e(t,n){n===void 0&&(n=!0);var i=r.call(this,t[0]instanceof Rt?t[0]:t[0].texture)||this;return i._textures=null,i._durations=null,i._autoUpdate=n,i._isConnectedToTicker=!1,i.animationSpeed=1,i.loop=!0,i.updateAnchor=!1,i.onComplete=null,i.onFrameChange=null,i.onLoop=null,i._currentTime=0,i._playing=!1,i._previousFrame=null,i.textures=t,i}return e.prototype.stop=function(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(Fn.shared.remove(this.update,this),this._isConnectedToTicker=!1))},e.prototype.play=function(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(Fn.shared.add(this.update,this,is.HIGH),this._isConnectedToTicker=!0))},e.prototype.gotoAndStop=function(t){this.stop();var n=this.currentFrame;this._currentTime=t,n!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var n=this.currentFrame;this._currentTime=t,n!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){if(this._playing){var n=this.animationSpeed*t,i=this.currentFrame;if(this._durations!==null){var a=this._currentTime%1*this._durations[this.currentFrame];for(a+=n/60*1e3;a<0;)this._currentTime--,a+=this._durations[this.currentFrame];var s=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);a>=this._durations[this.currentFrame];)a-=this._durations[this.currentFrame]*s,this._currentTime+=s;this._currentTime+=a/this._durations[this.currentFrame]}else this._currentTime+=n;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):i!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramei&&this.onLoop()),this.updateTexture())}},e.prototype.updateTexture=function(){var t=this.currentFrame;this._previousFrame!==t&&(this._previousFrame=t,this._texture=this._textures[t],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))},e.prototype.destroy=function(t){this.stop(),r.prototype.destroy.call(this,t),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var n=[],i=0;inew Promise((n,i)=>{var a=l=>{try{o(t.next(l))}catch(c){i(c)}},s=l=>{try{o(t.throw(l))}catch(c){i(c)}},o=l=>l.done?n(l.value):Promise.resolve(l.value).then(a,s);o((t=t.apply(r,e)).next())});class o3{constructor(){this._breathParameters=[],this._currentTime=0}static create(){return new o3}setParameters(e){this._breathParameters=e}getParameters(){return this._breathParameters}updateParameters(e,t){this._currentTime+=t;const n=this._currentTime*2*3.14159;for(let i=0;i=1&&(n=1,this._blinkingState=la.EyeState_Closed,this._stateStartTimeSeconds=this._userTimeSeconds),t=1-n;break;case la.EyeState_Closed:n=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._closedSeconds,n>=1&&(this._blinkingState=la.EyeState_Opening,this._stateStartTimeSeconds=this._userTimeSeconds),t=0;break;case la.EyeState_Opening:n=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._openingSeconds,n>=1&&(n=1,this._blinkingState=la.EyeState_Interval,this._nextBlinkingTime=this.determinNextBlinkingTiming()),t=n;break;case la.EyeState_Interval:this._nextBlinkingTime(r[r.EyeState_First=0]="EyeState_First",r[r.EyeState_Interval=1]="EyeState_Interval",r[r.EyeState_Closing=2]="EyeState_Closing",r[r.EyeState_Closed=3]="EyeState_Closed",r[r.EyeState_Opening=4]="EyeState_Opening",r))(la||{});const CQ=.001,bA=.5;class l3{static create(e){const t=new l3;typeof e.FadeInTime=="number"&&(t._fadeTimeSeconds=e.FadeInTime,t._fadeTimeSeconds<=0&&(t._fadeTimeSeconds=bA));const n=e.Groups,i=n.length;for(let a=0;aCQ){if(a>=0)break;a=c,s=e.getPartOpacityByIndex(h),s+=t/this._fadeTimeSeconds,s>1&&(s=1)}}a<0&&(a=0,s=1);for(let c=n;cl&&(v=1-l/(1-s)),d>v&&(d=v),e.setPartOpacityByIndex(h,d)}}}constructor(){this._fadeTimeSeconds=bA,this._lastModel=void 0,this._partGroups=[],this._partGroupCounts=[]}}class qp{constructor(e){this.parameterIndex=0,this.partIndex=0,this.partId="",this.link=[],e!=null&&this.assignment(e)}assignment(e){return this.partId=e.partId,this.link=e.link.map(t=>t.clone()),this}initialize(e){this.parameterIndex=e.getParameterIndex(this.partId),this.partIndex=e.getPartIndex(this.partId),e.setParameterValueByIndex(this.parameterIndex,1)}clone(){const e=new qp;return e.partId=this.partId,e.parameterIndex=this.parameterIndex,e.partIndex=this.partIndex,e.link=this.link.map(t=>t.clone()),e}}class It{constructor(e,t){this.x=e||0,this.y=t||0}add(e){const t=new It(0,0);return t.x=this.x+e.x,t.y=this.y+e.y,t}substract(e){const t=new It(0,0);return t.x=this.x-e.x,t.y=this.y-e.y,t}multiply(e){const t=new It(0,0);return t.x=this.x*e.x,t.y=this.y*e.y,t}multiplyByScaler(e){return this.multiply(new It(e,e))}division(e){const t=new It(0,0);return t.x=this.x/e.x,t.y=this.y/e.y,t}divisionByScalar(e){return this.division(new It(e,e))}getLength(){return Math.sqrt(this.x*this.x+this.y*this.y)}getDistanceWith(e){return Math.sqrt((this.x-e.x)*(this.x-e.x)+(this.y-e.y)*(this.y-e.y))}dot(e){return this.x*e.x+this.y*e.y}normalize(){const e=Math.pow(this.x*this.x+this.y*this.y,.5);this.x=this.x/e,this.y=this.y/e}isEqual(e){return this.x==e.x&&this.y==e.y}isNotEqual(e){return!this.isEqual(e)}}const yp=class{static range(r,e,t){return rt&&(r=t),r}static sin(r){return Math.sin(r)}static cos(r){return Math.cos(r)}static abs(r){return Math.abs(r)}static sqrt(r){return Math.sqrt(r)}static cbrt(r){if(r===0)return r;let e=r;const t=e<0;t&&(e=-e);let n;return e===1/0?n=1/0:(n=Math.exp(Math.log(e)/3),n=(e/(n*n)+2*n)/3),t?-n:n}static getEasingSine(r){return r<0?0:r>1?1:.5-.5*this.cos(r*Math.PI)}static max(r,e){return r>e?r:e}static min(r,e){return r>e?e:r}static degreesToRadian(r){return r/180*Math.PI}static radianToDegrees(r){return r*180/Math.PI}static directionToRadian(r,e){const t=Math.atan2(e.y,e.x),n=Math.atan2(r.y,r.x);let i=t-n;for(;i<-Math.PI;)i+=Math.PI*2;for(;i>Math.PI;)i-=Math.PI*2;return i}static directionToDegrees(r,e){const t=this.directionToRadian(r,e);let n=this.radianToDegrees(t);return e.x-r.x>0&&(n=-n),n}static radianToDirection(r){const e=new It;return e.x=this.sin(r),e.y=this.cos(r),e}static quadraticEquation(r,e,t){return this.abs(r)1&&(e=1),t<0?t=0:t>1&&(t=1),n<0?n=0:n>1&&(n=1),i<0?i=0:i>1&&(i=1),this._modelColor.R=e,this._modelColor.G=t,this._modelColor.B=n,this._modelColor.A=i}getModelColor(){return Object.assign({},this._modelColor)}setIsPremultipliedAlpha(e){this._isPremultipliedAlpha=e}isPremultipliedAlpha(){return this._isPremultipliedAlpha}setIsCulling(e){this._isCulling=e}isCulling(){return this._isCulling}setAnisotropy(e){this._anisortopy=e}getAnisotropy(){return this._anisortopy}getModel(){return this._model}constructor(){this._isCulling=!1,this._isPremultipliedAlpha=!1,this._anisortopy=0,this._modelColor=new Pf,this._mvpMatrix4x4=new ma,this._mvpMatrix4x4.loadIdentity()}}var Wo=(r=>(r[r.CubismBlendMode_Normal=0]="CubismBlendMode_Normal",r[r.CubismBlendMode_Additive=1]="CubismBlendMode_Additive",r[r.CubismBlendMode_Multiplicative=2]="CubismBlendMode_Multiplicative",r))(Wo||{});class Pf{constructor(){this.R=1,this.G=1,this.B=1,this.A=1}}let Va=!1,mc=!1,yc;const fx={vertexOffset:0,vertexStep:2};class yd{static startUp(e){if(Va)return wf("CubismFramework.startUp() is already done."),Va;if(Live2DCubismCore._isStarted)return Va=!0,!0;if(Live2DCubismCore._isStarted=!0,yc=e,yc&&Live2DCubismCore.Logging.csmSetLogFunction(yc.logFunction),Va=!0,Va){const t=Live2DCubismCore.Version.csmGetVersion(),n=(t&4278190080)>>24,i=(t&16711680)>>16,a=t&65535,s=t;wf("Live2D Cubism Core version: {0}.{1}.{2} ({3})",("00"+n).slice(-2),("00"+i).slice(-2),("0000"+a).slice(-4),s)}return wf("CubismFramework.startUp() is complete."),Va}static cleanUp(){Va=!1,mc=!1,yc=void 0}static initialize(){if(!Va){If("CubismFramework is not started.");return}if(mc){If("CubismFramework.initialize() skipped, already initialized.");return}mc=!0,wf("CubismFramework.initialize() is complete.")}static dispose(){if(!Va){If("CubismFramework is not started.");return}if(!mc){If("CubismFramework.dispose() skipped, not initialized.");return}u3.staticRelease(),mc=!1,wf("CubismFramework.dispose() is complete.")}static isStarted(){return Va}static isInitialized(){return mc}static coreLogFunction(e){Live2DCubismCore.Logging.csmGetLogFunction()&&Live2DCubismCore.Logging.csmGetLogFunction()(e)}static getLoggingLevel(){return yc!=null?yc.loggingLevel:Su.LogLevel_Off}constructor(){}}var Su=(r=>(r[r.LogLevel_Verbose=0]="LogLevel_Verbose",r[r.LogLevel_Debug=1]="LogLevel_Debug",r[r.LogLevel_Info=2]="LogLevel_Info",r[r.LogLevel_Warning=3]="LogLevel_Warning",r[r.LogLevel_Error=4]="LogLevel_Error",r[r.LogLevel_Off=5]="LogLevel_Off",r))(Su||{});const zv=()=>{};function xA(r,...e){Og.print(Su.LogLevel_Debug,"[CSM][D]"+r+` `,e)}function wf(r,...e){Og.print(Su.LogLevel_Info,"[CSM][I]"+r+` `,e)}function If(r,...e){Og.print(Su.LogLevel_Warning,"[CSM][W]"+r+` `,e)}function Sc(r,...e){Og.print(Su.LogLevel_Error,"[CSM][E]"+r+` `,e)}class Og{static print(e,t,n){if(en[o]);i(a)}static dumpBytes(e,t,n){for(let i=0;i0?this.print(e,` `):i%8==0&&i>0&&this.print(e," "),this.print(e,"{0} ",[t[i]&255]);this.print(e,` `)}constructor(){}}class AQ{update(){this._model.update(),this._model.drawables.resetDynamicFlags()}getCanvasWidth(){return this._model==null?0:this._model.canvasinfo.CanvasWidth/this._model.canvasinfo.PixelsPerUnit}getCanvasHeight(){return this._model==null?0:this._model.canvasinfo.CanvasHeight/this._model.canvasinfo.PixelsPerUnit}saveParameters(){const e=this._model.parameters.count,t=this._savedParameters.length;for(let n=0;nt&&(t=this._model.parameters.minimumValues[e]),this._parameterValues[e]=n==1?t:this._parameterValues[e]=this._parameterValues[e]*(1-n)+t*n}setParameterValueById(e,t,n=1){const i=this.getParameterIndex(e);this.setParameterValueByIndex(i,t,n)}addParameterValueByIndex(e,t,n=1){this.setParameterValueByIndex(e,this.getParameterValueByIndex(e)+t*n)}addParameterValueById(e,t,n=1){const i=this.getParameterIndex(e);this.addParameterValueByIndex(i,t,n)}multiplyParameterValueById(e,t,n=1){const i=this.getParameterIndex(e);this.multiplyParameterValueByIndex(i,t,n)}multiplyParameterValueByIndex(e,t,n=1){this.setParameterValueByIndex(e,this.getParameterValueByIndex(e)*(1+(t-1)*n))}getDrawableIds(){return this._drawableIds.slice()}getDrawableIndex(e){const t=this._model.drawables.count;for(let n=0;nt&&(e=t);for(let n=0;n0&&t.getEndTime()(r[r.ExpressionBlendType_Add=0]="ExpressionBlendType_Add",r[r.ExpressionBlendType_Multiply=1]="ExpressionBlendType_Multiply",r[r.ExpressionBlendType_Overwrite=2]="ExpressionBlendType_Overwrite",r))(eu||{}),bd;(r=>{r.supportMoreMaskDivisions=!0,r.setOpacityFromMotion=!1})(bd||(bd={}));var tu=(r=>(r[r.CubismMotionCurveTarget_Model=0]="CubismMotionCurveTarget_Model",r[r.CubismMotionCurveTarget_Parameter=1]="CubismMotionCurveTarget_Parameter",r[r.CubismMotionCurveTarget_PartOpacity=2]="CubismMotionCurveTarget_PartOpacity",r))(tu||{}),Ya=(r=>(r[r.CubismMotionSegmentType_Linear=0]="CubismMotionSegmentType_Linear",r[r.CubismMotionSegmentType_Bezier=1]="CubismMotionSegmentType_Bezier",r[r.CubismMotionSegmentType_Stepped=2]="CubismMotionSegmentType_Stepped",r[r.CubismMotionSegmentType_InverseStepped=3]="CubismMotionSegmentType_InverseStepped",r))(Ya||{});class No{constructor(e=0,t=0){this.time=e,this.value=t}}class MQ{constructor(){this.basePointIndex=0,this.segmentType=0}}class RQ{constructor(){this.id="",this.type=0,this.segmentCount=0,this.baseSegmentIndex=0,this.fadeInTime=0,this.fadeOutTime=0}}class OQ{constructor(){this.fireTime=0,this.value=""}}class DQ{constructor(){this.duration=0,this.loop=!1,this.curveCount=0,this.eventCount=0,this.fps=0,this.curves=[],this.segments=[],this.points=[],this.events=[]}}class SP{constructor(e){this._json=e}release(){this._json=void 0}getMotionDuration(){return this._json.Meta.Duration}isMotionLoop(){return this._json.Meta.Loop||!1}getEvaluationOptionFlag(e){return f3.EvaluationOptionFlag_AreBeziersRistricted==e?!!this._json.Meta.AreBeziersRestricted:!1}getMotionCurveCount(){return this._json.Meta.CurveCount}getMotionFps(){return this._json.Meta.Fps}getMotionTotalSegmentCount(){return this._json.Meta.TotalSegmentCount}getMotionTotalPointCount(){return this._json.Meta.TotalPointCount}getMotionFadeInTime(){return this._json.Meta.FadeInTime}getMotionFadeOutTime(){return this._json.Meta.FadeOutTime}getMotionCurveTarget(e){return this._json.Curves[e].Target}getMotionCurveId(e){return this._json.Curves[e].Id}getMotionCurveFadeInTime(e){return this._json.Curves[e].FadeInTime}getMotionCurveFadeOutTime(e){return this._json.Curves[e].FadeOutTime}getMotionCurveSegmentCount(e){return this._json.Curves[e].Segments.length}getMotionCurveSegment(e,t){return this._json.Curves[e].Segments[t]}getEventCount(){return this._json.Meta.UserDataCount||0}getTotalEventValueSize(){return this._json.Meta.TotalUserDataSize}getEventTime(e){return this._json.UserData[e].Time}getEventValue(e){return this._json.UserData[e].Value}}var f3=(r=>(r[r.EvaluationOptionFlag_AreBeziersRistricted=0]="EvaluationOptionFlag_AreBeziersRistricted",r))(f3||{});const PQ="EyeBlink",IQ="LipSync",NQ="Model",LQ="Parameter",kQ="PartOpacity",BQ=!1;function fa(r,e,t){const n=new No;return n.time=r.time+(e.time-r.time)*t,n.value=r.value+(e.value-r.value)*t,n}function FQ(r,e){let t=(e-r[0].time)/(r[1].time-r[0].time);return t<0&&(t=0),r[0].value+(r[1].value-r[0].value)*t}function zQ(r,e){let t=(e-r[0].time)/(r[3].time-r[0].time);t<0&&(t=0);const n=fa(r[0],r[1],t),i=fa(r[1],r[2],t),a=fa(r[2],r[3],t),s=fa(n,i,t),o=fa(i,a,t);return fa(s,o,t).value}function UQ(r,e){const t=e,n=r[0].time,i=r[3].time,a=r[1].time,s=r[2].time,o=i-3*s+3*a-n,l=3*s-6*a+3*n,c=3*a-3*n,h=n-t,d=Dr.cardanoAlgorithmForBezier(o,l,c,h),v=fa(r[0],r[1],d),g=fa(r[1],r[2],d),m=fa(r[2],r[3],d),x=fa(v,g,d),y=fa(g,m,d);return fa(x,y,d).value}function GQ(r,e){return r[0].value}function HQ(r,e){return r[1].value}function dx(r,e,t){const n=r.curves[e];let i=-1;const a=n.baseSegmentIndex+n.segmentCount;let s=0;for(let l=n.baseSegmentIndex;lt){i=l;break}if(i==-1)return r.points[s].value;const o=r.segments[i];return o.evaluate(r.points.slice(o.basePointIndex),t)}class d3 extends wP{constructor(){super(),this._eyeBlinkParameterIds=[],this._lipSyncParameterIds=[],this._sourceFrameRate=30,this._loopDurationSeconds=-1,this._isLoop=!1,this._isLoopFadeIn=!0,this._lastWeight=0}static create(e,t){const n=new d3;return n.parse(e),n._sourceFrameRate=n._motionData.fps,n._loopDurationSeconds=n._motionData.duration,n._onFinishedMotion=t,n}doUpdateParameters(e,t,n,i){this._modelCurveIdEyeBlink==null&&(this._modelCurveIdEyeBlink=PQ),this._modelCurveIdLipSync==null&&(this._modelCurveIdLipSync=IQ);let a=t-i.getStartTime();a<0&&(a=0);let s=Number.MAX_VALUE,o=Number.MAX_VALUE;const l=64;let c=0,h=0;this._eyeBlinkParameterIds.length>l&&xA("too many eye blink targets : {0}",this._eyeBlinkParameterIds.length),this._lipSyncParameterIds.length>l&&xA("too many lip sync targets : {0}",this._lipSyncParameterIds.length);const d=this._fadeInSeconds<=0?1:Dr.getEasingSine((t-i.getFadeInStartTime())/this._fadeInSeconds),v=this._fadeOutSeconds<=0||i.getEndTime()<0?1:Dr.getEasingSine((i.getEndTime()-t)/this._fadeOutSeconds);let g,m,x,y=a;if(this._isLoop)for(;y>this._motionData.duration;)y-=this._motionData.duration;const _=this._motionData.curves;for(m=0;m>w&1)continue;const A=S+(o-S)*n;e.setParameterValueById(this._eyeBlinkParameterIds[w],A)}if(s!=Number.MAX_VALUE)for(let w=0;w>w&1)continue;const A=S+(s-S)*n;e.setParameterValueById(this._lipSyncParameterIds[w],A)}}for(;m=this._motionData.duration&&(this._isLoop?(i.setStartTime(t),this._isLoopFadeIn&&i.setFadeInStartTime(t)):(this._onFinishedMotion&&this._onFinishedMotion(this),i.setIsFinished(!0))),this._lastWeight=n}setIsLoop(e){this._isLoop=e}isLoop(){return this._isLoop}setIsLoopFadeIn(e){this._isLoopFadeIn=e}isLoopFadeIn(){return this._isLoopFadeIn}getDuration(){return this._isLoop?-1:this._loopDurationSeconds}getLoopDuration(){return this._loopDurationSeconds}setParameterFadeInTime(e,t){const n=this._motionData.curves;for(let i=0;inew RQ),this._motionData.segments=Array.from({length:t.getMotionTotalSegmentCount()}).map(()=>new MQ),this._motionData.events=Array.from({length:this._motionData.eventCount}).map(()=>new OQ),this._motionData.points=[];let s=0,o=0;for(let l=0;le&&this._motionData.events[n].fireTime<=t&&this._firedEventValues.push(this._motionData.events[n].value);return this._firedEventValues}}class jQ{constructor(){this._autoDelete=!1,this._available=!0,this._finished=!1,this._started=!1,this._startTimeSeconds=-1,this._fadeInStartTimeSeconds=0,this._endTimeSeconds=-1,this._stateTimeSeconds=0,this._stateWeight=0,this._lastEventCheckSeconds=0,this._motionQueueEntryHandle=this,this._fadeOutSeconds=0,this._isTriggeredFadeOut=!1}release(){this._autoDelete&&this._motion&&this._motion.release()}setFadeOut(e){this._fadeOutSeconds=e,this._isTriggeredFadeOut=!0}startFadeOut(e,t){const n=t+e;this._isTriggeredFadeOut=!0,(this._endTimeSeconds<0||nt!=null&&t._motionQueueEntryHandle==e)}setEventCallback(e,t=null){this._eventCallBack=e,this._eventCustomData=t}doUpdateMotion(e,t){let n=!1,i=0;for(;i(r[r.CubismPhysicsTargetType_Parameter=0]="CubismPhysicsTargetType_Parameter",r))(l_||{}),ru=(r=>(r[r.CubismPhysicsSource_X=0]="CubismPhysicsSource_X",r[r.CubismPhysicsSource_Y=1]="CubismPhysicsSource_Y",r[r.CubismPhysicsSource_Angle=2]="CubismPhysicsSource_Angle",r))(ru||{});class qQ{constructor(){this.initialPosition=new It(0,0),this.position=new It(0,0),this.lastPosition=new It(0,0),this.lastGravity=new It(0,0),this.force=new It(0,0),this.velocity=new It(0,0)}}class XQ{constructor(){this.normalizationPosition={},this.normalizationAngle={}}}class YQ{constructor(){this.source={}}}class WQ{constructor(){this.destination={},this.translationScale=new It(0,0)}}class $Q{constructor(){this.settings=[],this.inputs=[],this.outputs=[],this.particles=[],this.gravity=new It(0,0),this.wind=new It(0,0)}}class KQ{constructor(e){this._json=e}release(){this._json=void 0}getGravity(){const e=new It(0,0);return e.x=this._json.Meta.EffectiveForces.Gravity.X,e.y=this._json.Meta.EffectiveForces.Gravity.Y,e}getWind(){const e=new It(0,0);return e.x=this._json.Meta.EffectiveForces.Wind.X,e.y=this._json.Meta.EffectiveForces.Wind.Y,e}getSubRigCount(){return this._json.Meta.PhysicsSettingCount}getTotalInputCount(){return this._json.Meta.TotalInputCount}getTotalOutputCount(){return this._json.Meta.TotalOutputCount}getVertexCount(){return this._json.Meta.VertexCount}getNormalizationPositionMinimumValue(e){return this._json.PhysicsSettings[e].Normalization.Position.Minimum}getNormalizationPositionMaximumValue(e){return this._json.PhysicsSettings[e].Normalization.Position.Maximum}getNormalizationPositionDefaultValue(e){return this._json.PhysicsSettings[e].Normalization.Position.Default}getNormalizationAngleMinimumValue(e){return this._json.PhysicsSettings[e].Normalization.Angle.Minimum}getNormalizationAngleMaximumValue(e){return this._json.PhysicsSettings[e].Normalization.Angle.Maximum}getNormalizationAngleDefaultValue(e){return this._json.PhysicsSettings[e].Normalization.Angle.Default}getInputCount(e){return this._json.PhysicsSettings[e].Input.length}getInputWeight(e,t){return this._json.PhysicsSettings[e].Input[t].Weight}getInputReflect(e,t){return this._json.PhysicsSettings[e].Input[t].Reflect}getInputType(e,t){return this._json.PhysicsSettings[e].Input[t].Type}getInputSourceId(e,t){return this._json.PhysicsSettings[e].Input[t].Source.Id}getOutputCount(e){return this._json.PhysicsSettings[e].Output.length}getOutputVertexIndex(e,t){return this._json.PhysicsSettings[e].Output[t].VertexIndex}getOutputAngleScale(e,t){return this._json.PhysicsSettings[e].Output[t].Scale}getOutputWeight(e,t){return this._json.PhysicsSettings[e].Output[t].Weight}getOutputDestinationId(e,t){return this._json.PhysicsSettings[e].Output[t].Destination.Id}getOutputType(e,t){return this._json.PhysicsSettings[e].Output[t].Type}getOutputReflect(e,t){return this._json.PhysicsSettings[e].Output[t].Reflect}getParticleCount(e){return this._json.PhysicsSettings[e].Vertices.length}getParticleMobility(e,t){return this._json.PhysicsSettings[e].Vertices[t].Mobility}getParticleDelay(e,t){return this._json.PhysicsSettings[e].Vertices[t].Delay}getParticleAcceleration(e,t){return this._json.PhysicsSettings[e].Vertices[t].Acceleration}getParticleRadius(e,t){return this._json.PhysicsSettings[e].Vertices[t].Radius}getParticlePosition(e,t){const n=new It(0,0);return n.x=this._json.PhysicsSettings[e].Vertices[t].Position.X,n.y=this._json.PhysicsSettings[e].Vertices[t].Position.Y,n}}const wA="X",SA="Y",EA="Angle",ZQ=5,TP=100,QQ=.001;class v3{static create(e){const t=new v3;return t.parse(e),t._physicsRig.gravity.y=0,t}evaluate(e,t){let n,i,a,s;const o=new It;let l,c,h,d,v,g,m,x;v=e.getModel().parameters.values,g=e.getModel().parameters.maximumValues,m=e.getModel().parameters.minimumValues,x=e.getModel().parameters.defaultValues;for(let y=0;y=l.particleCount)break;h[_].destinationParameterIndex==-1&&(h[_].destinationParameterIndex=e.getParameterIndex(h[_].destination.id));const S=new It;S.x=d[w].position.x-d[w-1].position.x,S.y=d[w].position.y-d[w-1].position.y,s=h[_].getValue(S,d,w,h[_].reflect,this._options.gravity);const A=h[_].destinationParameterIndex,C=!Float32Array.prototype.slice&&"subarray"in Float32Array.prototype?JSON.parse(JSON.stringify(v.subarray(A))):v.slice(A);fJ(C,m[A],g[A],s,h[_]);for(let M=A,E=0;M=2?i=e[t-1].position.substract(e[t-2].position):i=i.multiplyByScaler(-1),a=Dr.directionToRadian(i,r),n&&(a*=-1),a}function sJ(r,e){return Math.abs(Math.max(r,e)-Math.min(r,e))}function oJ(r,e){return Math.min(r,e)+sJ(r,e)/2}function lJ(r,e){return r.x}function uJ(r,e){return r.y}function cJ(r,e){return e}function hJ(r,e,t,n,i,a,s,o){let l,c,h,d,v=new It(0,0),g=new It(0,0),m=new It(0,0),x=new It(0,0);r[0].position=new It(t.x,t.y),l=Dr.degreesToRadian(n),d=Dr.radianToDirection(l),d.normalize();for(let y=1;yt&&(s>i.valueExceededMaximum&&(i.valueExceededMaximum=s),s=t),o=i.weight/TP,o>=1||(s=r[0]*(1-o)+s*o),r[0]=s}function p3(r,e,t,n,i,a,s,o){let l=0;const c=Dr.max(t,e);cr&&(r=h);const d=Dr.min(i,a),v=Dr.max(i,a),g=s,m=oJ(h,c),x=r-m;switch(Math.sign(x)){case 1:{const y=v-g,_=c-m;_!=0&&(l=x*(y/_),l+=g);break}case-1:{const y=d-g,_=h-m;_!=0&&(l=x*(y/_),l+=g);break}case 0:{l=g;break}}return o?l:l*-1}class u_{constructor(e=0,t=0,n=0,i=0){this.x=e,this.y=t,this.width=n,this.height=i}getCenterX(){return this.x+.5*this.width}getCenterY(){return this.y+.5*this.height}getRight(){return this.x+this.width}getBottom(){return this.y+this.height}setRect(e){this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height}expand(e,t){this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2}}const vx=4,dJ=10;let Vl,Nf,c_;class px{getChannelFlagAsColor(e){return this._channelColors[e]}getMaskRenderTexture(){let e=0;if(this._maskTexture&&this._maskTexture.texture!=0&&(this._maskTexture.frameNo=this._currentFrameNo,e=this._maskTexture.texture),e==0){const t=this._clippingMaskBufferSize;this._colorBuffer=this.gl.createTexture(),this.gl.bindTexture(this.gl.TEXTURE_2D,this._colorBuffer),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,t,t,0,this.gl.RGBA,this.gl.UNSIGNED_BYTE,null),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.LINEAR),this.gl.bindTexture(this.gl.TEXTURE_2D,null),e=this.gl.createFramebuffer(),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,e),this.gl.framebufferTexture2D(this.gl.FRAMEBUFFER,this.gl.COLOR_ATTACHMENT0,this.gl.TEXTURE_2D,this._colorBuffer,0),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,c_),this._maskTexture=new vJ(this._currentFrameNo,e)}return e}setGL(e){this.gl=e}calcClippedDrawTotalBounds(e,t){let n=Number.MAX_VALUE,i=Number.MAX_VALUE,a=Number.MIN_VALUE,s=Number.MIN_VALUE;const o=t._clippedDrawableIndexList.length;for(let l=0;lm&&(m=w),Sx&&(x=S)}if(v!=Number.MAX_VALUE)if(va&&(a=m),x>s&&(s=x),n==Number.MAX_VALUE)t._allClippedDrawRect.x=0,t._allClippedDrawRect.y=0,t._allClippedDrawRect.width=0,t._allClippedDrawRect.height=0,t._isUsing=!1;else{t._isUsing=!0;const _=a-n,w=s-i;t._allClippedDrawRect.x=n,t._allClippedDrawRect.y=i,t._allClippedDrawRect.width=_,t._allClippedDrawRect.height=w}}}constructor(){this._maskRenderTexture=null,this._colorBuffer=null,this._currentFrameNo=0,this._clippingMaskBufferSize=256,this._clippingContextListForMask=[],this._clippingContextListForDraw=[],this._channelColors=[],this._tmpBoundsOnModel=new u_,this._tmpMatrix=new ma,this._tmpMatrixForMask=new ma,this._tmpMatrixForDraw=new ma;let e=new Pf;e.R=1,e.G=0,e.B=0,e.A=0,this._channelColors.push(e),e=new Pf,e.R=0,e.G=1,e.B=0,e.A=0,this._channelColors.push(e),e=new Pf,e.R=0,e.G=0,e.B=1,e.A=0,this._channelColors.push(e),e=new Pf,e.R=0,e.G=0,e.B=0,e.A=1,this._channelColors.push(e)}release(){var e,t,n;const i=this;for(let a=0;a0){this.gl.viewport(0,0,this._clippingMaskBufferSize,this._clippingMaskBufferSize),this._maskRenderTexture=this.getMaskRenderTexture(),t.getMvpMatrix(),t.preDraw(),this.setupLayoutBounds(n),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,this._maskRenderTexture),this.gl.clearColor(1,1,1,1),this.gl.clear(this.gl.COLOR_BUFFER_BIT);for(let i=0;i(r[r.ShaderNames_SetupMask=0]="ShaderNames_SetupMask",r[r.ShaderNames_NormalPremultipliedAlpha=1]="ShaderNames_NormalPremultipliedAlpha",r[r.ShaderNames_NormalMaskedPremultipliedAlpha=2]="ShaderNames_NormalMaskedPremultipliedAlpha",r[r.ShaderNames_NomralMaskedInvertedPremultipliedAlpha=3]="ShaderNames_NomralMaskedInvertedPremultipliedAlpha",r[r.ShaderNames_AddPremultipliedAlpha=4]="ShaderNames_AddPremultipliedAlpha",r[r.ShaderNames_AddMaskedPremultipliedAlpha=5]="ShaderNames_AddMaskedPremultipliedAlpha",r[r.ShaderNames_AddMaskedPremultipliedAlphaInverted=6]="ShaderNames_AddMaskedPremultipliedAlphaInverted",r[r.ShaderNames_MultPremultipliedAlpha=7]="ShaderNames_MultPremultipliedAlpha",r[r.ShaderNames_MultMaskedPremultipliedAlpha=8]="ShaderNames_MultMaskedPremultipliedAlpha",r[r.ShaderNames_MultMaskedPremultipliedAlphaInverted=9]="ShaderNames_MultMaskedPremultipliedAlphaInverted",r))(Lf||{});const gJ="attribute vec4 a_position;attribute vec2 a_texCoord;varying vec2 v_texCoord;varying vec4 v_myPos;uniform mat4 u_clipMatrix;void main(){ gl_Position = u_clipMatrix * a_position; v_myPos = u_clipMatrix * a_position; v_texCoord = a_texCoord; v_texCoord.y = 1.0 - v_texCoord.y;}",mJ="precision mediump float;varying vec2 v_texCoord;varying vec4 v_myPos;uniform vec4 u_baseColor;uniform vec4 u_channelFlag;uniform sampler2D s_texture0;void main(){ float isInside = step(u_baseColor.x, v_myPos.x/v_myPos.w) * step(u_baseColor.y, v_myPos.y/v_myPos.w) * step(v_myPos.x/v_myPos.w, u_baseColor.z) * step(v_myPos.y/v_myPos.w, u_baseColor.w); gl_FragColor = u_channelFlag * texture2D(s_texture0, v_texCoord).a * isInside;}",yJ="attribute vec4 a_position;attribute vec2 a_texCoord;varying vec2 v_texCoord;uniform mat4 u_matrix;void main(){ gl_Position = u_matrix * a_position; v_texCoord = a_texCoord; v_texCoord.y = 1.0 - v_texCoord.y;}",TA="attribute vec4 a_position;attribute vec2 a_texCoord;varying vec2 v_texCoord;varying vec4 v_clipPos;uniform mat4 u_matrix;uniform mat4 u_clipMatrix;void main(){ gl_Position = u_matrix * a_position; v_clipPos = u_clipMatrix * a_position; v_texCoord = a_texCoord; v_texCoord.y = 1.0 - v_texCoord.y;}",bJ="precision mediump float;varying vec2 v_texCoord;uniform vec4 u_baseColor;uniform sampler2D s_texture0;void main(){ gl_FragColor = texture2D(s_texture0 , v_texCoord) * u_baseColor;}",xJ="precision mediump float;varying vec2 v_texCoord;varying vec4 v_clipPos;uniform vec4 u_baseColor;uniform vec4 u_channelFlag;uniform sampler2D s_texture0;uniform sampler2D s_texture1;void main(){ vec4 col_formask = texture2D(s_texture0 , v_texCoord) * u_baseColor; vec4 clipMask = (1.0 - texture2D(s_texture1, v_clipPos.xy / v_clipPos.w)) * u_channelFlag; float maskVal = clipMask.r + clipMask.g + clipMask.b + clipMask.a; col_formask = col_formask * maskVal; gl_FragColor = col_formask;}",_J="precision mediump float;varying vec2 v_texCoord;varying vec4 v_clipPos;uniform sampler2D s_texture0;uniform sampler2D s_texture1;uniform vec4 u_channelFlag;uniform vec4 u_baseColor;void main(){vec4 col_formask = texture2D(s_texture0, v_texCoord) * u_baseColor;vec4 clipMask = (1.0 - texture2D(s_texture1, v_clipPos.xy / v_clipPos.w)) * u_channelFlag;float maskVal = clipMask.r + clipMask.g + clipMask.b + clipMask.a;col_formask = col_formask * (1.0 - maskVal);gl_FragColor = col_formask;}";class CP extends u3{constructor(){super(),this._clippingContextBufferForMask=null,this._clippingContextBufferForDraw=null,this._clippingManager=new px,this.firstDraw=!0,this._textures={},this._sortedDrawableIndexList=[],this._bufferData={vertex:null,uv:null,index:null}}initialize(e){e.isUsingMasking()&&(this._clippingManager=new px,this._clippingManager.initialize(e,e.getDrawableCount(),e.getDrawableMasks(),e.getDrawableMaskCounts()));for(let t=e.getDrawableCount()-1;t>=0;t--)this._sortedDrawableIndexList[t]=0;super.initialize(e)}bindTexture(e,t){this._textures[e]=t}getBindedTextures(){return this._textures}setClippingMaskBufferSize(e){this._clippingManager.release(),this._clippingManager=new px,this._clippingManager.setClippingMaskBufferSize(e),this._clippingManager.initialize(this.getModel(),this.getModel().getDrawableCount(),this.getModel().getDrawableMasks(),this.getModel().getDrawableMaskCounts())}getClippingMaskBufferSize(){return this._clippingManager.getClippingMaskBufferSize()}release(){var e,t,n;const i=this;this._clippingManager.release(),i._clippingManager=void 0,(e=this.gl)==null||e.deleteBuffer(this._bufferData.vertex),this._bufferData.vertex=null,(t=this.gl)==null||t.deleteBuffer(this._bufferData.uv),this._bufferData.uv=null,(n=this.gl)==null||n.deleteBuffer(this._bufferData.index),this._bufferData.index=null,i._bufferData=void 0,i._textures=void 0}doDrawModel(){this.preDraw(),this._clippingManager!=null&&this._clippingManager.setupClippingContext(this.getModel(),this);const e=this.getModel().getDrawableCount(),t=this.getModel().getDrawableRenderOrders();for(let n=0;n{CP.doStaticRelease()};class AP{constructor(e){this.groups=e.Groups,this.hitAreas=e.HitAreas,this.layout=e.Layout,this.moc=e.FileReferences.Moc,this.expressions=e.FileReferences.Expressions,this.motions=e.FileReferences.Motions,this.textures=e.FileReferences.Textures,this.physics=e.FileReferences.Physics,this.pose=e.FileReferences.Pose}getEyeBlinkParameters(){var e,t;return(t=(e=this.groups)==null?void 0:e.find(n=>n.Name==="EyeBlink"))==null?void 0:t.Ids}getLipSyncParameters(){var e,t;return(t=(e=this.groups)==null?void 0:e.find(n=>n.Name==="LipSync"))==null?void 0:t.Ids}}const wJ="ParamAngleX",SJ="ParamAngleY",EJ="ParamAngleZ",TJ="ParamEyeBallX",CJ="ParamEyeBallY",AJ="ParamBodyAngleX",MJ="ParamBreath",CA=2,AA=2;var ji;(r=>{r.LOG_LEVEL_VERBOSE=0,r.LOG_LEVEL_WARNING=1,r.LOG_LEVEL_ERROR=2,r.LOG_LEVEL_NONE=999,r.logLevel=r.LOG_LEVEL_WARNING,r.sound=!0,r.motionSync=!0,r.motionFadingDuration=500,r.idleMotionFadingDuration=2e3,r.expressionFadingDuration=500,r.preserveExpressionOnMotion=!0,r.cubism4=bd})(ji||(ji={}));const Tr={log(r,...e){ji.logLevel<=ji.LOG_LEVEL_VERBOSE&&console.log(`[${r}]`,...e)},warn(r,...e){ji.logLevel<=ji.LOG_LEVEL_WARNING&&console.warn(`[${r}]`,...e)},error(r,...e){ji.logLevel<=ji.LOG_LEVEL_ERROR&&console.error(`[${r}]`,...e)}};function MA(r,e,t){return rt?t:r}function MP(r,e){e.forEach(t=>{Object.getOwnPropertyNames(t.prototype).forEach(n=>{n!=="constructor"&&Object.defineProperty(r.prototype,n,Object.getOwnPropertyDescriptor(t.prototype,n))})})}function RJ(r){let e=r.lastIndexOf("/");return e!=-1&&(r=r.slice(0,e)),e=r.lastIndexOf("/"),e!==-1&&(r=r.slice(e+1)),r}function OJ(r,e){const t=r.indexOf(e);t!==-1&&r.splice(t,1)}class RP extends Ks{constructor(e,t){super(),this.expressions=[],this.reserveExpressionIndex=-1,this.destroyed=!1,this.settings=e,this.tag=`ExpressionManager(${e.name})`}init(){this.defaultExpression=this.createExpression({},void 0),this.currentExpression=this.defaultExpression,this.stopAllExpressions()}loadExpression(e){return Kr(this,null,function*(){if(!this.definitions[e]){Tr.warn(this.tag,`Undefined expression at [${e}]`);return}if(this.expressions[e]===null){Tr.warn(this.tag,`Cannot set expression at [${e}] because it's already failed in loading.`);return}if(this.expressions[e])return this.expressions[e];const t=yield this._loadExpression(e);return this.expressions[e]=t,t})}_loadExpression(e){throw new Error("Not implemented.")}setRandomExpression(){return Kr(this,null,function*(){if(this.definitions.length){const e=[];for(let t=0;t-1&&ec&&(s*=c/l,o*=c/l),this.vx+=s,this.vy+=o;const h=Math.sqrt(jl(this.vx,2)+jl(this.vy,2)),d=.5*(Math.sqrt(jl(c,2)+8*c*i)-c);h>d&&(this.vx*=d/h,this.vy*=d/h),this.x+=this.vx,this.y+=this.vy}}class g3{constructor(e){this.json=e;let t=e.url;if(typeof t!="string")throw new TypeError("The `url` field in settings JSON must be defined as a string.");this.url=t,this.name=RJ(this.url)}resolveURL(e){return es.resolve(this.url,e)}replaceFiles(e){this.moc=e(this.moc,"moc"),this.pose!==void 0&&(this.pose=e(this.pose,"pose")),this.physics!==void 0&&(this.physics=e(this.physics,"physics"));for(let t=0;t(e.push(t),t)),e}validateFiles(e){const t=(a,s)=>{const o=this.resolveURL(a);if(!e.includes(o)){if(s)throw new Error(`File "${a}" is defined in settings, but doesn't exist in given files`);return!1}return!0};return[this.moc,...this.textures].forEach(a=>t(a,!0)),this.getDefinedFiles().filter(a=>t(a,!1))}}var h_=(r=>(r[r.NONE=0]="NONE",r[r.IDLE=1]="IDLE",r[r.NORMAL=2]="NORMAL",r[r.FORCE=3]="FORCE",r))(h_||{});class NJ{constructor(){this.debug=!1,this.currentPriority=0,this.reservePriority=0}reserve(e,t,n){if(n<=0)return Tr.log(this.tag,"Cannot start a motion with MotionPriority.NONE."),!1;if(e===this.currentGroup&&t===this.currentIndex)return Tr.log(this.tag,"Motion is already playing.",this.dump(e,t)),!1;if(e===this.reservedGroup&&t===this.reservedIndex||e===this.reservedIdleGroup&&t===this.reservedIdleIndex)return Tr.log(this.tag,"Motion is already reserved.",this.dump(e,t)),!1;if(n===1){if(this.currentPriority!==0)return Tr.log(this.tag,"Cannot start idle motion because another motion is playing.",this.dump(e,t)),!1;if(this.reservedIdleGroup!==void 0)return Tr.log(this.tag,"Cannot start idle motion because another idle motion has reserved.",this.dump(e,t)),!1;this.setReservedIdle(e,t)}else{if(n<3){if(n<=this.currentPriority)return Tr.log(this.tag,"Cannot start motion because another motion is playing as an equivalent or higher priority.",this.dump(e,t)),!1;if(n<=this.reservePriority)return Tr.log(this.tag,"Cannot start motion because another motion has reserved as an equivalent or higher priority.",this.dump(e,t)),!1}this.setReserved(e,t,n)}return!0}start(e,t,n,i){if(i===1){if(this.setReservedIdle(void 0,void 0),this.currentPriority!==0)return Tr.log(this.tag,"Cannot start idle motion because another motion is playing.",this.dump(t,n)),!1}else{if(t!==this.reservedGroup||n!==this.reservedIndex)return Tr.log(this.tag,"Cannot start motion because another motion has taken the place.",this.dump(t,n)),!1;this.setReserved(void 0,void 0,0)}return e?(this.setCurrent(t,n,i),!0):!1}complete(){this.setCurrent(void 0,void 0,0)}setCurrent(e,t,n){this.currentPriority=n,this.currentGroup=e,this.currentIndex=t}setReserved(e,t,n){this.reservePriority=n,this.reservedGroup=e,this.reservedIndex=t}setReservedIdle(e,t){this.reservedIdleGroup=e,this.reservedIdleIndex=t}isActive(e,t){return e===this.currentGroup&&t===this.currentIndex||e===this.reservedGroup&&t===this.reservedIndex||e===this.reservedIdleGroup&&t===this.reservedIdleIndex}reset(){this.setCurrent(void 0,void 0,0),this.setReserved(void 0,void 0,0),this.setReservedIdle(void 0,void 0)}shouldRequestIdleMotion(){return this.currentGroup===void 0&&this.reservedIdleGroup===void 0}shouldOverrideExpression(){return!ji.preserveExpressionOnMotion&&this.currentPriority>1}dump(e,t){if(this.debug){const n=["currentPriority","reservePriority","currentGroup","currentIndex","reservedGroup","reservedIndex","reservedIdleGroup","reservedIdleIndex"];return` group = "${e}", index = ${t} `+n.map(i=>"["+i+"] "+this[i]).join(` `)}return""}}const LJ="SoundManager",kJ=.5;class au{static get volume(){return this._volume}static set volume(e){this._volume=(e>1?1:e<0?0:e)||0,this.audios.forEach(t=>t.volume=this._volume)}static add(e,t,n){const i=new Audio(e);return i.volume=this._volume,i.preload="auto",i.addEventListener("ended",()=>{this.dispose(i),t==null||t()}),i.addEventListener("error",a=>{this.dispose(i),Tr.warn(LJ,`Error occurred on "${e}"`,a.error),n==null||n(a.error)}),this.audios.push(i),i}static play(e){return new Promise((t,n)=>{var i;(i=e.play())==null||i.catch(a=>{e.dispatchEvent(new ErrorEvent("error",{error:a})),n(a)}),e.readyState===e.HAVE_ENOUGH_DATA?t():e.addEventListener("canplaythrough",t)})}static dispose(e){e.pause(),e.removeAttribute("src"),OJ(this.audios,e)}static destroy(){for(let e=this.audios.length-1;e>=0;e--)this.dispose(this.audios[e])}}au.audios=[];au._volume=kJ;class m3 extends Ks{constructor(e,t){super(),this.motionGroups={},this.state=new NJ,this.playing=!1,this.destroyed=!1,this.settings=e,this.tag=`MotionManager(${e.name})`,this.state.tag=this.tag}init(e){e!=null&&e.idleMotionGroup&&(this.groups.idle=e.idleMotionGroup),this.setupMotions(e),this.stopAllMotions()}setupMotions(e){for(const n of Object.keys(this.definitions))this.motionGroups[n]=[];let t;switch(e==null?void 0:e.motionPreload){case"NONE":return;case"ALL":t=Object.keys(this.definitions);break;case"IDLE":default:t=[this.groups.idle];break}for(const n of t)if(this.definitions[n])for(let i=0;ithis.currentAudio=void 0,()=>this.currentAudio=void 0),this.currentAudio=l}catch(d){Tr.warn(this.tag,"Failed to create audio",h,d)}}const c=yield this.loadMotion(n,i);if(l){const h=au.play(l).catch(d=>Tr.warn(this.tag,"Failed to play audio",l.src,d));ji.motionSync&&(yield h)}return this.state.start(c,n,i,a)?(Tr.log(this.tag,"Start motion:",this.getMotionName(o)),this.emit("motionStart",n,i,l),this.state.shouldOverrideExpression()&&this.expressionManager&&this.expressionManager.resetExpression(),this.playing=!0,this._startMotion(c),!0):(l&&(au.dispose(l),this.currentAudio=void 0),!1)})}startRandomMotion(e,t){return Kr(this,null,function*(){const n=this.definitions[e];if(n!=null&&n.length){const i=[];for(let a=0;at.index>=0);for(const t of e)this.hitAreas[t.name]=t}hitTest(e,t){return Object.keys(this.hitAreas).filter(n=>this.isHit(n,e,t))}isHit(e,t,n){if(!this.hitAreas[e])return!1;const i=this.hitAreas[e].index,a=this.getDrawableBounds(i,BJ);return a.x<=t&&t<=a.x+a.width&&a.y<=n&&n<=a.y+a.height}getDrawableBounds(e,t){const n=this.getDrawableVertices(e);let i=n[0],a=n[0],s=n[1],o=n[1];for(let l=0;l{(a.status===200||a.status===0)&&a.response?n(a.response):a.onerror()},a.onerror=()=>{Tr.warn(zJ,`Failed to load resource as ${a.responseType} (Status ${a.status}): ${e}`),i(new OA("Network error.",e,a.status))},a.onabort=()=>i(new OA("Aborted.",e,a.status,!0)),a.onloadend=()=>{var s;li.allXhrSet.delete(a),r&&((s=li.xhrMap.get(r))==null||s.delete(a))},a}static cancelXHRs(){var r;(r=li.xhrMap.get(this))==null||r.forEach(e=>{e.abort(),li.allXhrSet.delete(e)}),li.xhrMap.delete(this)}static release(){li.allXhrSet.forEach(r=>r.abort()),li.allXhrSet.clear(),li.xhrMap=new WeakMap}};let Dg=li;Dg.xhrMap=new WeakMap;Dg.allXhrSet=new Set;Dg.loader=(r,e)=>new Promise((t,n)=>{li.createXHR(r.target,r.settings?r.settings.resolveURL(r.url):r.url,r.type,a=>{r.result=a,t()},n).send()});function OP(r,e){let t=-1;return n(0);function n(i,a){if(a)return Promise.reject(a);if(i<=t)return Promise.reject(new Error("next() called multiple times"));t=i;const s=r[i];if(!s)return Promise.resolve();try{return Promise.resolve(s(e,n.bind(null,i+1)))}catch(o){return Promise.reject(o)}}}class il{static load(e){return OP(this.middlewares,e).then(()=>e.result)}}il.middlewares=[Dg.loader];function UJ(r,e={}){var t;const n={resourceOptions:{crossorigin:e.crossOrigin}};if(Rt.fromURL)return Rt.fromURL(r,n).catch(s=>{if(s instanceof Error)throw s;const o=new Error("Texture loading error");throw o.event=s,o});n.resourceOptions.autoLoad=!1;const i=Rt.from(r,n);if(i.baseTexture.valid)return Promise.resolve(i);const a=i.baseTexture.resource;return(t=a._live2d_load)!=null||(a._live2d_load=new Promise((s,o)=>{const l=c=>{a.source.removeEventListener("error",l);const h=new Error("Texture loading error");h.event=c,o(h)};a.source.addEventListener("error",l),a.load().then(()=>s(i)).catch(l)})),a._live2d_load}const DA="Live2DFactory",DP=(r,e)=>Kr(void 0,null,function*(){if(typeof r.source=="string"){const t=yield il.load({url:r.source,type:"json",target:r.live2dModel});t.url=r.source,r.source=t,r.live2dModel.emit("settingsJSONLoaded",t)}return e()}),PP=(r,e)=>Kr(void 0,null,function*(){if(r.source instanceof g3)return r.settings=r.source,e();if(typeof r.source=="object"){const t=rn.findRuntime(r.source);if(t){const n=t.createModelSettings(r.source);return r.settings=n,r.live2dModel.emit("settingsLoaded",n),e()}}throw new TypeError("Unknown settings format.")}),IP=(r,e)=>{if(r.settings){const t=rn.findRuntime(r.settings);if(t)return t.ready().then(e)}return e()},NP=(r,e)=>Kr(void 0,null,function*(){yield e();const t=r.internalModel;if(t){const n=r.settings,i=rn.findRuntime(n);if(i){const a=[];n.pose&&a.push(il.load({settings:n,url:n.pose,type:"json",target:t}).then(s=>{t.pose=i.createPose(t.coreModel,s),r.live2dModel.emit("poseLoaded",t.pose)}).catch(s=>{r.live2dModel.emit("poseLoadError",s),Tr.warn(DA,"Failed to load pose.",s)})),n.physics&&a.push(il.load({settings:n,url:n.physics,type:"json",target:t}).then(s=>{t.physics=i.createPhysics(t.coreModel,s),r.live2dModel.emit("physicsLoaded",t.physics)}).catch(s=>{r.live2dModel.emit("physicsLoadError",s),Tr.warn(DA,"Failed to load physics.",s)})),a.length&&(yield Promise.all(a))}}}),LP=(r,e)=>Kr(void 0,null,function*(){if(r.settings){const t=r.live2dModel,n=r.settings.textures.map(i=>{const a=r.settings.resolveURL(i);return UJ(a,{crossOrigin:r.options.crossOrigin})});if(yield e(),r.internalModel)t.internalModel=r.internalModel,t.emit("modelLoaded",r.internalModel);else throw new TypeError("Missing internal model.");t.textures=yield Promise.all(n),t.emit("textureLoaded",t.textures)}else throw new TypeError("Missing settings.")}),kP=(r,e)=>Kr(void 0,null,function*(){const t=r.settings;if(t instanceof g3){const n=rn.findRuntime(t);if(!n)throw new TypeError("Unknown model settings.");const i=yield il.load({settings:t,url:t.moc,type:"arraybuffer",target:r.live2dModel});if(!n.isValidMoc(i))throw new Error("Invalid moc data");const a=n.createCoreModel(i);return r.internalModel=n.createInternalModel(a,t,r.options),e()}throw new TypeError("Missing settings.")}),Xn=class{static registerRuntime(r){Xn.runtimes.push(r),Xn.runtimes.sort((e,t)=>t.version-e.version)}static findRuntime(r){for(const e of Xn.runtimes)if(e.test(r))return e}static setupLive2DModel(r,e,t){return Kr(this,null,function*(){const n=new Promise(s=>r.once("textureLoaded",s)),i=new Promise(s=>r.once("modelLoaded",s)),a=Promise.all([n,i]).then(()=>r.emit("ready"));yield OP(Xn.live2DModelMiddlewares,{live2dModel:r,source:e,options:t||{}}),yield a,r.emit("load")})}static loadMotion(r,e,t){var n,i;const a=s=>r.emit("motionLoadError",e,t,s);try{const s=(n=r.definitions[e])==null?void 0:n[t];if(!s)return Promise.resolve(void 0);r.listeners("destroy").includes(Xn.releaseTasks)||r.once("destroy",Xn.releaseTasks);let o=Xn.motionTasksMap.get(r);o||(o={},Xn.motionTasksMap.set(r,o));let l=o[e];l||(l=[],o[e]=l);const c=r.getMotionFile(s);return(i=l[t])!=null||(l[t]=il.load({url:c,settings:r.settings,type:r.motionDataType,target:r}).then(h=>{var d;const v=(d=Xn.motionTasksMap.get(r))==null?void 0:d[e];v&&delete v[t];const g=r.createMotion(h,e,s);return r.emit("motionLoaded",e,t,g),g}).catch(h=>{Tr.warn(r.tag,`Failed to load motion: ${c} `,h),a(h)})),l[t]}catch(s){Tr.warn(r.tag,`Failed to load motion at "${e}"[${t}] `,s),a(s)}return Promise.resolve(void 0)}static loadExpression(r,e){var t;const n=i=>r.emit("expressionLoadError",e,i);try{const i=r.definitions[e];if(!i)return Promise.resolve(void 0);r.listeners("destroy").includes(Xn.releaseTasks)||r.once("destroy",Xn.releaseTasks);let a=Xn.expressionTasksMap.get(r);a||(a=[],Xn.expressionTasksMap.set(r,a));const s=r.getExpressionFile(i);return(t=a[e])!=null||(a[e]=il.load({url:s,settings:r.settings,type:"json",target:r}).then(o=>{const l=Xn.expressionTasksMap.get(r);l&&delete l[e];const c=r.createExpression(o,i);return r.emit("expressionLoaded",e,c),c}).catch(o=>{Tr.warn(r.tag,`Failed to load expression: ${s} `,o),n(o)})),a[e]}catch(i){Tr.warn(r.tag,`Failed to load expression at [${e}] `,i),n(i)}return Promise.resolve(void 0)}static releaseTasks(){this instanceof m3?Xn.motionTasksMap.delete(this):Xn.expressionTasksMap.delete(this)}};let rn=Xn;rn.runtimes=[];rn.urlToJSON=DP;rn.jsonToSettings=PP;rn.waitUntilReady=IP;rn.setupOptionals=NP;rn.setupEssentials=LP;rn.createInternalModel=kP;rn.live2DModelMiddlewares=[DP,PP,IP,NP,LP,kP];rn.motionTasksMap=new WeakMap;rn.expressionTasksMap=new WeakMap;m3.prototype._loadMotion=function(r,e){return rn.loadMotion(this,r,e)};RP.prototype._loadExpression=function(r){return rn.loadExpression(this,r)};class GJ{constructor(){this._autoInteract=!1}get autoInteract(){return this._autoInteract}set autoInteract(e){e!==this._autoInteract&&(e?this.on("pointertap",PA,this):this.off("pointertap",PA,this),this._autoInteract=e)}registerInteraction(e){e!==this.interactionManager&&(this.unregisterInteraction(),this._autoInteract&&e&&(this.interactionManager=e,e.on("pointermove",IA,this)))}unregisterInteraction(){var e;this.interactionManager&&((e=this.interactionManager)==null||e.off("pointermove",IA,this),this.interactionManager=void 0)}}function PA(r){this.tap(r.data.global.x,r.data.global.y)}function IA(r){this.focus(r.data.global.x,r.data.global.y)}class HJ extends Tg{}const sa=new Ar,jJ=new qr;let Oo;class BP extends _a{constructor(e){super(),this.tag="Live2DModel(uninitialized)",this.textures=[],this.transform=new HJ,this.anchor=new Go(this.onAnchorChange,this,0,0),this.glContextID=-1,this.elapsedTime=performance.now(),this.deltaTime=0,this._autoUpdate=!1,this.once("modelLoaded",()=>this.init(e))}static from(e,t){const n=new this(t);return rn.setupLive2DModel(n,e,t).then(()=>n)}static fromSync(e,t){const n=new this(t);return rn.setupLive2DModel(n,e,t).then(t==null?void 0:t.onLoad).catch(t==null?void 0:t.onError),n}static registerTicker(e){Oo=e}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){var t;Oo||(Oo=(t=window.PIXI)==null?void 0:t.Ticker),e?this._destroyed||(Oo?(Oo.shared.add(this.onTickerUpdate,this),this._autoUpdate=!0):Tr.warn(this.tag,"No Ticker registered, please call Live2DModel.registerTicker(Ticker).")):(Oo==null||Oo.shared.remove(this.onTickerUpdate,this),this._autoUpdate=!1)}init(e){this.tag=`Live2DModel(${this.internalModel.settings.name})`;const t=Object.assign({autoUpdate:!0,autoInteract:!0},e);t.autoInteract&&(this.interactive=!0),this.autoInteract=t.autoInteract,this.autoUpdate=t.autoUpdate}onAnchorChange(){this.pivot.set(this.anchor.x*this.internalModel.width,this.anchor.y*this.internalModel.height)}motion(e,t,n){return t===void 0?this.internalModel.motionManager.startRandomMotion(e,n):this.internalModel.motionManager.startMotion(e,t,n)}expression(e){return this.internalModel.motionManager.expressionManager?e===void 0?this.internalModel.motionManager.expressionManager.setRandomExpression():this.internalModel.motionManager.expressionManager.setExpression(e):Promise.resolve(!1)}focus(e,t,n=!1){sa.x=e,sa.y=t,this.toModelPosition(sa,sa,!0);let i=sa.x/this.internalModel.originalWidth*2-1,a=sa.y/this.internalModel.originalHeight*2-1,s=Math.atan2(a,i);this.internalModel.focusController.focus(Math.cos(s),-Math.sin(s),n)}tap(e,t){const n=this.hitTest(e,t);n.length&&(Tr.log(this.tag,"Hit",n),this.emit("hit",n))}hitTest(e,t){return sa.x=e,sa.y=t,this.toModelPosition(sa,sa),this.internalModel.hitTest(sa.x,sa.y)}toModelPosition(e,t=e.clone(),n){return n||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.transform.worldTransform.applyInverse(e,t),this.internalModel.localTransform.applyInverse(t,t),t}containsPoint(e){return this.getBounds(!0).contains(e.x,e.y)}_calculateBounds(){this._bounds.addFrame(this.transform,0,0,this.internalModel.width,this.internalModel.height)}onTickerUpdate(){this.update(Oo.shared.deltaMS)}update(e){this.deltaTime+=e,this.elapsedTime+=e}_render(e){this.registerInteraction(e.plugins.interaction),e.batch.reset(),e.geometry.reset(),e.shader.reset(),e.state.reset();let t=!1;this.glContextID!==e.CONTEXT_UID&&(this.glContextID=e.CONTEXT_UID,this.internalModel.updateWebGLContext(e.gl,this.glContextID),t=!0);for(let a=0;at.destroy(e.baseTexture)),this.internalModel.destroy(),super.destroy(e)}}MP(BP,[GJ]);const $a=class{static resolveURL(r,e){var t;const n=(t=$a.filesMap[r])==null?void 0:t[e];if(n===void 0)throw new Error("Cannot find this file from uploaded files: "+e);return n}static upload(r,e){return Kr(this,null,function*(){const t={};for(const n of e.getDefinedFiles()){const i=decodeURI(es.resolve(e.url,n)),a=r.find(s=>s.webkitRelativePath===i);a&&(t[n]=URL.createObjectURL(a))}$a.filesMap[e._objectURL]=t})}static createSettings(r){return Kr(this,null,function*(){const e=r.find(s=>s.name.endsWith("model.json")||s.name.endsWith("model3.json"));if(!e)throw new TypeError("Settings file not found");const t=yield $a.readText(e),n=JSON.parse(t);n.url=e.webkitRelativePath;const i=rn.findRuntime(n);if(!i)throw new Error("Unknown settings JSON");const a=i.createModelSettings(n);return a._objectURL=URL.createObjectURL(e),a})}static readText(r){return Kr(this,null,function*(){return new Promise((e,t)=>{const n=new FileReader;n.onload=()=>e(n.result),n.onerror=t,n.readAsText(r,"utf8")})})}};let y3=$a;y3.filesMap={};y3.factory=(r,e)=>Kr(void 0,null,function*(){if(Array.isArray(r.source)&&r.source[0]instanceof File){const t=r.source;let n=t.settings;if(!n)n=yield $a.createSettings(t);else if(!n._objectURL)throw new Error('"_objectURL" must be specified in ModelSettings');n.validateFiles(t.map(i=>encodeURI(i.webkitRelativePath))),yield $a.upload(t,n),n.resolveURL=function(i){return $a.resolveURL(this._objectURL,i)},r.source=n,r.live2dModel.once("modelLoaded",i=>{i.once("destroy",function(){const a=this.settings._objectURL;if(URL.revokeObjectURL(a),$a.filesMap[a])for(const s of Object.values($a.filesMap[a]))URL.revokeObjectURL(s);delete $a.filesMap[a]})})}return e()});rn.live2DModelMiddlewares.unshift(y3.factory);const Ei=class{static unzip(r,e){return Kr(this,null,function*(){const t=yield Ei.getFilePaths(r),n=[];for(const a of e.getDefinedFiles()){const s=decodeURI(es.resolve(e.url,a));t.includes(s)&&n.push(s)}const i=yield Ei.getFiles(r,n);for(let a=0;as.endsWith("model.json")||s.endsWith("model3.json"));if(!t)throw new Error("Settings file not found");const n=yield Ei.readText(r,t);if(!n)throw new Error("Empty settings file: "+t);const i=JSON.parse(n);i.url=t;const a=rn.findRuntime(i);if(!a)throw new Error("Unknown settings JSON");return a.createModelSettings(i)})}static zipReader(r,e){return Kr(this,null,function*(){throw new Error("Not implemented")})}static getFilePaths(r){return Kr(this,null,function*(){throw new Error("Not implemented")})}static getFiles(r,e){return Kr(this,null,function*(){throw new Error("Not implemented")})}static readText(r,e){return Kr(this,null,function*(){throw new Error("Not implemented")})}static releaseReader(r){}};let Pg=Ei;Pg.ZIP_PROTOCOL="zip://";Pg.uid=0;Pg.factory=(r,e)=>Kr(void 0,null,function*(){const t=r.source;let n,i,a;if(typeof t=="string"&&(t.endsWith(".zip")||t.startsWith(Ei.ZIP_PROTOCOL))?(t.startsWith(Ei.ZIP_PROTOCOL)?n=t.slice(Ei.ZIP_PROTOCOL.length):n=t,i=yield il.load({url:n,type:"blob",target:r.live2dModel})):Array.isArray(t)&&t.length===1&&t[0]instanceof File&&t[0].name.endsWith(".zip")&&(i=t[0],n=URL.createObjectURL(i),a=t.settings),i){if(!i.size)throw new Error("Empty zip file");const s=yield Ei.zipReader(i,n);a||(a=yield Ei.createSettings(s)),a._objectURL=Ei.ZIP_PROTOCOL+Ei.uid+"/"+a.url;const o=yield Ei.unzip(s,a);o.settings=a,r.source=o,n.startsWith("blob:")&&r.live2dModel.once("modelLoaded",l=>{l.once("destroy",function(){URL.revokeObjectURL(n)})}),Ei.releaseReader(s)}return e()});rn.live2DModelMiddlewares.unshift(Pg.factory);if(!window.Live2DCubismCore)throw new Error("Could not find Cubism 4 runtime. This plugin requires live2dcubismcore.js to be loaded.");class VJ extends RP{constructor(e,t){var n;super(e,t),this.queueManager=new EP,this.definitions=(n=e.expressions)!=null?n:[],this.init()}isFinished(){return this.queueManager.isFinished()}getExpressionIndex(e){return this.definitions.findIndex(t=>t.Name===e)}getExpressionFile(e){return e.File}createExpression(e,t){return h3.create(e)}_setExpression(e){return this.queueManager.startMotion(e,!1,performance.now())}stopAllExpressions(){this.queueManager.stopAllMotions()}updateParameters(e,t){return this.queueManager.doUpdateMotion(e,t)}}class Ic extends g3{constructor(e){if(super(e),!Ic.isValidJSON(e))throw new TypeError("Invalid JSON.");Object.assign(this,new AP(e))}static isValidJSON(e){var t;return!!(e!=null&&e.FileReferences)&&typeof e.FileReferences.Moc=="string"&&((t=e.FileReferences.Textures)==null?void 0:t.length)>0&&e.FileReferences.Textures.every(n=>typeof n=="string")}replaceFiles(e){if(super.replaceFiles(e),this.motions)for(const[t,n]of Object.entries(this.motions))for(let i=0;i{this.emit("motion:"+n)})}isFinished(){return this.queueManager.isFinished()}_startMotion(e,t){return e.setFinishedMotionHandler(t),this.queueManager.stopAllMotions(),this.queueManager.startMotion(e,!1,performance.now())}_stopAllMotions(){this.queueManager.stopAllMotions()}createMotion(e,t,n){const i=d3.create(e),a=new SP(e),s=(t===this.groups.idle?ji.idleMotionFadingDuration:ji.motionFadingDuration)/1e3;return a.getMotionFadeInTime()===void 0&&i.setFadeInTime(n.FadeInTime>0?n.FadeInTime:s),a.getMotionFadeOutTime()===void 0&&i.setFadeOutTime(n.FadeOutTime>0?n.FadeOutTime:s),i.setEffectIds(this.eyeBlinkIds,this.lipSyncIds),i}getMotionFile(e){return e.File}getMotionName(e){return e.File}getSoundFile(e){return e.Sound}updateParameters(e,t){return this.queueManager.doUpdateMotion(e,t)}destroy(){super.destroy(),this.queueManager.release(),this.queueManager=void 0}}const NA=new ma;class XJ extends FJ{constructor(e,t,n){super(),this.lipSync=!0,this.breath=o3.create(),this.renderer=new CP,this.idParamAngleX=wJ,this.idParamAngleY=SJ,this.idParamAngleZ=EJ,this.idParamEyeBallX=TJ,this.idParamEyeBallY=CJ,this.idParamBodyAngleX=AJ,this.idParamBreath=MJ,this.pixelsPerUnit=1,this.centeringTransform=new qr,this.coreModel=e,this.settings=t,this.motionManager=new qJ(t,n),this.init()}init(){var e;super.init(),((e=this.settings.getEyeBlinkParameters())==null?void 0:e.length)>0&&(this.eyeBlink=_P.create(this.settings)),this.breath.setParameters([new _f(this.idParamAngleX,0,15,6.5345,.5),new _f(this.idParamAngleY,0,8,3.5345,.5),new _f(this.idParamAngleZ,0,10,5.5345,.5),new _f(this.idParamBodyAngleX,0,4,15.5345,.5),new _f(this.idParamBreath,0,.5,3.2345,.5)]),this.renderer.initialize(this.coreModel),this.renderer.setIsPremultipliedAlpha(!0)}getSize(){return[this.coreModel.getModel().canvasinfo.CanvasWidth,this.coreModel.getModel().canvasinfo.CanvasHeight]}getLayout(){const e={};if(this.settings.layout)for(const t of Object.keys(this.settings.layout)){const n=t.charAt(0).toLowerCase()+t.slice(1);e[n]=this.settings.layout[t]}return e}setupLayout(){super.setupLayout(),this.pixelsPerUnit=this.coreModel.getModel().canvasinfo.PixelsPerUnit,this.centeringTransform.scale(this.pixelsPerUnit,this.pixelsPerUnit).translate(this.originalWidth/2,this.originalHeight/2)}updateWebGLContext(e,t){this.renderer.firstDraw=!0,this.renderer._bufferData={vertex:null,uv:null,index:null},this.renderer.startUp(e),this.renderer._clippingManager._currentFrameNo=t,this.renderer._clippingManager._maskTexture=void 0,Pc.getInstance()._shaderSets=[]}bindTexture(e,t){this.renderer.bindTexture(e,t)}getHitAreaDefs(){var e,t;return(t=(e=this.settings.hitAreas)==null?void 0:e.map(n=>({id:n.Id,name:n.Name,index:this.coreModel.getDrawableIndex(n.Id)})))!=null?t:[]}getDrawableIDs(){return this.coreModel.getDrawableIds()}getDrawableIndex(e){return this.coreModel.getDrawableIndex(e)}getDrawableVertices(e){if(typeof e=="string"&&(e=this.coreModel.getDrawableIndex(e),e===-1))throw new TypeError("Unable to find drawable ID: "+e);const t=this.coreModel.getDrawableVertices(e).slice();for(let n=0;n{function t(){try{WJ(),r()}catch(n){if(LA--,LA<0){const i=new Error("Failed to start up Cubism 4 framework.");i.cause=n,e(i);return}Tr.log("Cubism4","Startup failed, retrying 10ms later..."),setTimeout(t,10)}}t()})),Uv)}function WJ(r){r=Object.assign({logFunction:console.log,loggingLevel:Su.LogLevel_Verbose},r),yd.startUp(r),yd.initialize()}rn.registerRuntime({version:4,ready:YJ,test(r){return r instanceof Ic||Ic.isValidJSON(r)},isValidMoc(r){if(r.byteLength<4)return!1;const e=new Int8Array(r,0,4);return String.fromCharCode(...e)==="MOC3"},createModelSettings(r){return new Ic(r)},createCoreModel(r){const e=c3.create(r);try{const t=e.createModel();return t.__moc=e,t}catch(t){try{e.release()}catch{}throw t}},createInternalModel(r,e,t){const n=new XJ(r,e,t),i=r;return i.__moc&&(n.__moc=i.__moc,delete i.__moc,n.once("destroy",$J)),n},createPhysics(r,e){return v3.create(e)},createPose(r,e){return l3.create(e)}});function $J(){var r;(r=this.__moc)==null||r.release()}function kA(r){const e=[],t=String(r||"");let n=t.indexOf(","),i=0,a=!1;for(;!a;){n===-1&&(n=t.length,a=!0);const s=t.slice(i,n).trim();(s||!a)&&e.push(s),i=n+1,n=t.indexOf(",",i)}return e}function KJ(r,e){const t={};return(r[r.length-1]===""?[...r,""]:r).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const ZJ=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,QJ=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,JJ={};function BA(r,e){return(JJ.jsx?QJ:ZJ).test(r)}const eee=/[ \t\n\f\r]/g;function tee(r){return typeof r=="object"?r.type==="text"?FA(r.value):!1:FA(r)}function FA(r){return r.replace(eee,"")===""}class Fd{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}Fd.prototype.normal={};Fd.prototype.property={};Fd.prototype.space=void 0;function FP(r,e){const t={},n={};for(const i of r)Object.assign(t,i.property),Object.assign(n,i.normal);return new Fd(t,n,e)}function xd(r){return r.toLowerCase()}class Pi{constructor(e,t){this.attribute=t,this.property=e}}Pi.prototype.attribute="";Pi.prototype.booleanish=!1;Pi.prototype.boolean=!1;Pi.prototype.commaOrSpaceSeparated=!1;Pi.prototype.commaSeparated=!1;Pi.prototype.defined=!1;Pi.prototype.mustUseProperty=!1;Pi.prototype.number=!1;Pi.prototype.overloadedBoolean=!1;Pi.prototype.property="";Pi.prototype.spaceSeparated=!1;Pi.prototype.space=void 0;let ree=0;const Bt=Eu(),bn=Eu(),f_=Eu(),Je=Eu(),Or=Eu(),Nc=Eu(),Hi=Eu();function Eu(){return 2**++ree}const d_=Object.freeze(Object.defineProperty({__proto__:null,boolean:Bt,booleanish:bn,commaOrSpaceSeparated:Hi,commaSeparated:Nc,number:Je,overloadedBoolean:f_,spaceSeparated:Or},Symbol.toStringTag,{value:"Module"})),gx=Object.keys(d_);class b3 extends Pi{constructor(e,t,n,i){let a=-1;if(super(e,t),zA(this,"space",i),typeof n=="number")for(;++a4&&t.slice(0,4)==="data"&&oee.test(e)){if(e.charAt(4)==="-"){const a=e.slice(5).replace(UA,uee);n="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=e.slice(4);if(!UA.test(a)){let s=a.replace(see,lee);s.charAt(0)!=="-"&&(s="-"+s),e="data"+s}}i=b3}return new i(n,e)}function lee(r){return"-"+r.toLowerCase()}function uee(r){return r.charAt(1).toUpperCase()}const XP=FP([zP,nee,HP,jP,VP],"html"),Ig=FP([zP,iee,HP,jP,VP],"svg");function GA(r){const e=String(r||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function cee(r){return r.join(" ").trim()}var bc={},mx,HA;function hee(){if(HA)return mx;HA=1;var r=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,t=/^\s*/,n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,o=/^\s+|\s+$/g,l=` `,c="/",h="*",d="",v="comment",g="declaration";function m(y,_){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];_=_||{};var w=1,S=1;function A(X){var W=X.match(e);W&&(w+=W.length);var P=X.lastIndexOf(l);S=~P?X.length-P:S+X.length}function C(){var X={line:w,column:S};return function(W){return W.position=new M(X),D(),W}}function M(X){this.start=X,this.end={line:w,column:S},this.source=_.source}M.prototype.content=y;function E(X){var W=new Error(_.source+":"+w+":"+S+": "+X);if(W.reason=X,W.filename=_.source,W.line=w,W.column=S,W.source=y,!_.silent)throw W}function O(X){var W=X.exec(y);if(W){var P=W[0];return A(P),y=y.slice(P.length),W}}function D(){O(t)}function I(X){var W;for(X=X||[];W=k();)W!==!1&&X.push(W);return X}function k(){var X=C();if(!(c!=y.charAt(0)||h!=y.charAt(1))){for(var W=2;d!=y.charAt(W)&&(h!=y.charAt(W)||c!=y.charAt(W+1));)++W;if(W+=2,d===y.charAt(W-1))return E("End of comment missing");var P=y.slice(2,W-2);return S+=2,A(P),y=y.slice(W),S+=2,X({type:v,comment:P})}}function U(){var X=C(),W=O(n);if(W){if(k(),!O(i))return E("property missing ':'");var P=O(a),H=X({type:g,property:x(W[0].replace(r,d)),value:P?x(P[0].replace(r,d)):d});return O(s),H}}function V(){var X=[];I(X);for(var W;W=U();)W!==!1&&(X.push(W),I(X));return X}return D(),V()}function x(y){return y?y.replace(o,d):d}return mx=m,mx}var jA;function fee(){if(jA)return bc;jA=1;var r=bc&&bc.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(bc,"__esModule",{value:!0}),bc.default=t;const e=r(hee());function t(n,i){let a=null;if(!n||typeof n!="string")return a;const s=(0,e.default)(n),o=typeof i=="function";return s.forEach(l=>{if(l.type!=="declaration")return;const{property:c,value:h}=l;o?i(c,h,l):h&&(a=a||{},a[c]=h)}),a}return bc}var Sf={},VA;function dee(){if(VA)return Sf;VA=1,Object.defineProperty(Sf,"__esModule",{value:!0}),Sf.camelCase=void 0;var r=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,t=/^[^-]+$/,n=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(c){return!c||t.test(c)||r.test(c)},s=function(c,h){return h.toUpperCase()},o=function(c,h){return"".concat(h,"-")},l=function(c,h){return h===void 0&&(h={}),a(c)?c:(c=c.toLowerCase(),h.reactCompat?c=c.replace(i,o):c=c.replace(n,o),c.replace(e,s))};return Sf.camelCase=l,Sf}var Ef,qA;function vee(){if(qA)return Ef;qA=1;var r=Ef&&Ef.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},e=r(fee()),t=dee();function n(i,a){var s={};return!i||typeof i!="string"||(0,e.default)(i,function(o,l){o&&l&&(s[(0,t.camelCase)(o,a)]=l)}),s}return n.default=n,Ef=n,Ef}var pee=vee();const gee=cl(pee),YP=WP("end"),x3=WP("start");function WP(r){return e;function e(t){const n=t&&t.position&&t.position[r]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function mee(r){const e=x3(r),t=YP(r);if(e&&t)return{start:e,end:t}}function Hf(r){return!r||typeof r!="object"?"":"position"in r||"type"in r?XA(r.position):"start"in r||"end"in r?XA(r):"line"in r||"column"in r?v_(r):""}function v_(r){return YA(r&&r.line)+":"+YA(r&&r.column)}function XA(r){return v_(r&&r.start)+"-"+v_(r&&r.end)}function YA(r){return r&&typeof r=="number"?r:1}class ai extends Error{constructor(e,t,n){super(),typeof t=="string"&&(n=t,t=void 0);let i="",a={},s=!1;if(t&&("line"in t&&"column"in t?a={place:t}:"start"in t&&"end"in t?a={place:t}:"type"in t?a={ancestors:[t],place:t.position}:a={...t}),typeof e=="string"?i=e:!a.cause&&e&&(s=!0,i=e.message,a.cause=e),!a.ruleId&&!a.source&&typeof n=="string"){const l=n.indexOf(":");l===-1?a.ruleId=n:(a.source=n.slice(0,l),a.ruleId=n.slice(l+1))}if(!a.place&&a.ancestors&&a.ancestors){const l=a.ancestors[a.ancestors.length-1];l&&(a.place=l.position)}const o=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=Hf(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=s&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ai.prototype.file="";ai.prototype.name="";ai.prototype.reason="";ai.prototype.message="";ai.prototype.stack="";ai.prototype.column=void 0;ai.prototype.line=void 0;ai.prototype.ancestors=void 0;ai.prototype.cause=void 0;ai.prototype.fatal=void 0;ai.prototype.place=void 0;ai.prototype.ruleId=void 0;ai.prototype.source=void 0;const _3={}.hasOwnProperty,yee=new Map,bee=/[A-Z]/g,xee=new Set(["table","tbody","thead","tfoot","tr"]),_ee=new Set(["td","th"]),$P="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function wee(r,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=e.filePath||void 0;let n;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=Oee(t,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=Ree(t,e.jsx,e.jsxs)}const i={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:n,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Ig:XP,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},a=KP(i,r,void 0);return a&&typeof a!="string"?a:i.create(r,i.Fragment,{children:a||void 0},void 0)}function KP(r,e,t){if(e.type==="element")return See(r,e,t);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return Eee(r,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return Cee(r,e,t);if(e.type==="mdxjsEsm")return Tee(r,e);if(e.type==="root")return Aee(r,e,t);if(e.type==="text")return Mee(r,e)}function See(r,e,t){const n=r.schema;let i=n;e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(i=Ig,r.schema=i),r.ancestors.push(e);const a=QP(r,e.tagName,!1),s=Dee(r,e);let o=S3(r,e);return xee.has(e.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!tee(l):!0})),ZP(r,s,a,e),w3(s,o),r.ancestors.pop(),r.schema=n,r.create(e,a,s,t)}function Eee(r,e){if(e.data&&e.data.estree&&r.evaluater){const n=e.data.estree.body[0];return n.type,r.evaluater.evaluateExpression(n.expression)}_d(r,e.position)}function Tee(r,e){if(e.data&&e.data.estree&&r.evaluater)return r.evaluater.evaluateProgram(e.data.estree);_d(r,e.position)}function Cee(r,e,t){const n=r.schema;let i=n;e.name==="svg"&&n.space==="html"&&(i=Ig,r.schema=i),r.ancestors.push(e);const a=e.name===null?r.Fragment:QP(r,e.name,!0),s=Pee(r,e),o=S3(r,e);return ZP(r,s,a,e),w3(s,o),r.ancestors.pop(),r.schema=n,r.create(e,a,s,t)}function Aee(r,e,t){const n={};return w3(n,S3(r,e)),r.create(e,r.Fragment,n,t)}function Mee(r,e){return e.value}function ZP(r,e,t,n){typeof t!="string"&&t!==r.Fragment&&r.passNode&&(e.node=n)}function w3(r,e){if(e.length>0){const t=e.length>1?e:e[0];t&&(r.children=t)}}function Ree(r,e,t){return n;function n(i,a,s,o){const c=Array.isArray(s.children)?t:e;return o?c(a,s,o):c(a,s)}}function Oee(r,e){return t;function t(n,i,a,s){const o=Array.isArray(a.children),l=x3(n);return e(i,a,s,o,{columnNumber:l?l.column-1:void 0,fileName:r,lineNumber:l?l.line:void 0},void 0)}}function Dee(r,e){const t={};let n,i;for(i in e.properties)if(i!=="children"&&_3.call(e.properties,i)){const a=Iee(r,i,e.properties[i]);if(a){const[s,o]=a;r.tableCellAlignToStyle&&s==="align"&&typeof o=="string"&&_ee.has(e.tagName)?n=o:t[s]=o}}if(n){const a=t.style||(t.style={});a[r.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return t}function Pee(r,e){const t={};for(const n of e.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&r.evaluater){const a=n.data.estree.body[0];a.type;const s=a.expression;s.type;const o=s.properties[0];o.type,Object.assign(t,r.evaluater.evaluateExpression(o.argument))}else _d(r,e.position);else{const i=n.name;let a;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&r.evaluater){const o=n.value.data.estree.body[0];o.type,a=r.evaluater.evaluateExpression(o.expression)}else _d(r,e.position);else a=n.value===null?!0:n.value;t[i]=a}return t}function S3(r,e){const t=[];let n=-1;const i=r.passKeys?new Map:yee;for(;++ni?0:i+e:e=e>i?i:e,t=t>0?t:0,n.length<1e4)s=Array.from(n),s.unshift(e,t),r.splice(...s);else for(t&&r.splice(e,t);a0?(ss(r,r.length,0,e),r):e}const KA={}.hasOwnProperty;function Gee(r){const e={};let t=-1;for(;++t13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function Lc(r){return r.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Qa=ml(/[A-Za-z]/),Vi=ml(/[\dA-Za-z]/),Vee=ml(/[#-'*+\--9=?A-Z^-~]/);function p_(r){return r!==null&&(r<32||r===127)}const g_=ml(/\d/),qee=ml(/[\dA-Fa-f]/),Xee=ml(/[!-/:-@[-`{-~]/);function St(r){return r!==null&&r<-2}function Di(r){return r!==null&&(r<0||r===32)}function ar(r){return r===-2||r===-1||r===32}const Yee=ml(new RegExp("\\p{P}|\\p{S}","u")),Wee=ml(/\s/);function ml(r){return e;function e(t){return t!==null&&t>-1&&r.test(String.fromCharCode(t))}}function ch(r){const e=[];let t=-1,n=0,i=0;for(;++t55295&&a<57344){const o=r.charCodeAt(t+1);a<56320&&o>56319&&o<57344?(s=String.fromCharCode(a,o),i=1):s="�"}else s=String.fromCharCode(a);s&&(e.push(r.slice(n,t),encodeURIComponent(s)),n=t+i+1,s=""),i&&(t+=i,i=0)}return e.join("")+r.slice(n)}function dr(r,e,t,n){const i=n?n-1:Number.POSITIVE_INFINITY;let a=0;return s;function s(l){return ar(l)?(r.enter(t),o(l)):e(l)}function o(l){return ar(l)&&a++s))return;const E=e.events.length;let O=E,D,I;for(;O--;)if(e.events[O][0]==="exit"&&e.events[O][1].type==="chunkFlow"){if(D){I=e.events[O][1].end;break}D=!0}for(_(n),M=E;MS;){const C=t[A];e.containerState=C[1],C[0].exit.call(e,r)}t.length=S}function w(){i.write([null]),a=void 0,i=void 0,e.containerState._closeFlow=void 0}}function Jee(r,e,t){return dr(r,r.attempt(this.parser.constructs.document,e,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function QA(r){if(r===null||Di(r)||Wee(r))return 1;if(Yee(r))return 2}function T3(r,e,t){const n=[];let i=-1;for(;++i1&&r[t][1].end.offset-r[t][1].start.offset>1?2:1;const d={...r[n][1].end},v={...r[t][1].start};JA(d,-l),JA(v,l),s={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...r[n][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...r[t][1].start},end:v},a={type:l>1?"strongText":"emphasisText",start:{...r[n][1].end},end:{...r[t][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...o.end}},r[n][1].end={...s.start},r[t][1].start={...o.end},c=[],r[n][1].end.offset-r[n][1].start.offset&&(c=da(c,[["enter",r[n][1],e],["exit",r[n][1],e]])),c=da(c,[["enter",i,e],["enter",s,e],["exit",s,e],["enter",a,e]]),c=da(c,T3(e.parser.constructs.insideSpan.null,r.slice(n+1,t),e)),c=da(c,[["exit",a,e],["enter",o,e],["exit",o,e],["exit",i,e]]),r[t][1].end.offset-r[t][1].start.offset?(h=2,c=da(c,[["enter",r[t][1],e],["exit",r[t][1],e]])):h=0,ss(r,n-1,t-n+3,c),t=n+c.length-h-2;break}}for(t=-1;++t0&&ar(M)?dr(r,w,"linePrefix",a+1)(M):w(M)}function w(M){return M===null||St(M)?r.check(eM,x,A)(M):(r.enter("codeFlowValue"),S(M))}function S(M){return M===null||St(M)?(r.exit("codeFlowValue"),w(M)):(r.consume(M),S)}function A(M){return r.exit("codeFenced"),e(M)}function C(M,E,O){let D=0;return I;function I(W){return M.enter("lineEnding"),M.consume(W),M.exit("lineEnding"),k}function k(W){return M.enter("codeFencedFence"),ar(W)?dr(M,U,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):U(W)}function U(W){return W===o?(M.enter("codeFencedFenceSequence"),V(W)):O(W)}function V(W){return W===o?(D++,M.consume(W),V):D>=s?(M.exit("codeFencedFenceSequence"),ar(W)?dr(M,X,"whitespace")(W):X(W)):O(W)}function X(W){return W===null||St(W)?(M.exit("codeFencedFence"),E(W)):O(W)}}}function hte(r,e,t){const n=this;return i;function i(s){return s===null?t(s):(r.enter("lineEnding"),r.consume(s),r.exit("lineEnding"),a)}function a(s){return n.parser.lazy[n.now().line]?t(s):e(s)}}const bx={name:"codeIndented",tokenize:dte},fte={partial:!0,tokenize:vte};function dte(r,e,t){const n=this;return i;function i(c){return r.enter("codeIndented"),dr(r,a,"linePrefix",5)(c)}function a(c){const h=n.events[n.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?s(c):t(c)}function s(c){return c===null?l(c):St(c)?r.attempt(fte,s,l)(c):(r.enter("codeFlowValue"),o(c))}function o(c){return c===null||St(c)?(r.exit("codeFlowValue"),s(c)):(r.consume(c),o)}function l(c){return r.exit("codeIndented"),e(c)}}function vte(r,e,t){const n=this;return i;function i(s){return n.parser.lazy[n.now().line]?t(s):St(s)?(r.enter("lineEnding"),r.consume(s),r.exit("lineEnding"),i):dr(r,a,"linePrefix",5)(s)}function a(s){const o=n.events[n.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(s):St(s)?i(s):t(s)}}const pte={name:"codeText",previous:mte,resolve:gte,tokenize:yte};function gte(r){let e=r.length-4,t=3,n,i;if((r[t][1].type==="lineEnding"||r[t][1].type==="space")&&(r[e][1].type==="lineEnding"||r[e][1].type==="space")){for(n=t;++n=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const i=t||0;this.setCursor(Math.trunc(e));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return n&&Tf(this.left,n),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Tf(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Tf(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e=4?e(s):r.interrupt(n.parser.constructs.flow,t,e)(s)}}function aI(r,e,t,n,i,a,s,o,l){const c=l||Number.POSITIVE_INFINITY;let h=0;return d;function d(_){return _===60?(r.enter(n),r.enter(i),r.enter(a),r.consume(_),r.exit(a),v):_===null||_===32||_===41||p_(_)?t(_):(r.enter(n),r.enter(s),r.enter(o),r.enter("chunkString",{contentType:"string"}),x(_))}function v(_){return _===62?(r.enter(a),r.consume(_),r.exit(a),r.exit(i),r.exit(n),e):(r.enter(o),r.enter("chunkString",{contentType:"string"}),g(_))}function g(_){return _===62?(r.exit("chunkString"),r.exit(o),v(_)):_===null||_===60||St(_)?t(_):(r.consume(_),_===92?m:g)}function m(_){return _===60||_===62||_===92?(r.consume(_),g):g(_)}function x(_){return!h&&(_===null||_===41||Di(_))?(r.exit("chunkString"),r.exit(o),r.exit(s),r.exit(n),e(_)):h999||g===null||g===91||g===93&&!l||g===94&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?t(g):g===93?(r.exit(a),r.enter(i),r.consume(g),r.exit(i),r.exit(n),e):St(g)?(r.enter("lineEnding"),r.consume(g),r.exit("lineEnding"),h):(r.enter("chunkString",{contentType:"string"}),d(g))}function d(g){return g===null||g===91||g===93||St(g)||o++>999?(r.exit("chunkString"),h(g)):(r.consume(g),l||(l=!ar(g)),g===92?v:d)}function v(g){return g===91||g===92||g===93?(r.consume(g),o++,d):d(g)}}function oI(r,e,t,n,i,a){let s;return o;function o(v){return v===34||v===39||v===40?(r.enter(n),r.enter(i),r.consume(v),r.exit(i),s=v===40?41:v,l):t(v)}function l(v){return v===s?(r.enter(i),r.consume(v),r.exit(i),r.exit(n),e):(r.enter(a),c(v))}function c(v){return v===s?(r.exit(a),l(s)):v===null?t(v):St(v)?(r.enter("lineEnding"),r.consume(v),r.exit("lineEnding"),dr(r,c,"linePrefix")):(r.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===s||v===null||St(v)?(r.exit("chunkString"),c(v)):(r.consume(v),v===92?d:h)}function d(v){return v===s||v===92?(r.consume(v),h):h(v)}}function jf(r,e){let t;return n;function n(i){return St(i)?(r.enter("lineEnding"),r.consume(i),r.exit("lineEnding"),t=!0,n):ar(i)?dr(r,n,t?"linePrefix":"lineSuffix")(i):e(i)}}const Cte={name:"definition",tokenize:Mte},Ate={partial:!0,tokenize:Rte};function Mte(r,e,t){const n=this;let i;return a;function a(g){return r.enter("definition"),s(g)}function s(g){return sI.call(n,r,o,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function o(g){return i=Lc(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),g===58?(r.enter("definitionMarker"),r.consume(g),r.exit("definitionMarker"),l):t(g)}function l(g){return Di(g)?jf(r,c)(g):c(g)}function c(g){return aI(r,h,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function h(g){return r.attempt(Ate,d,d)(g)}function d(g){return ar(g)?dr(r,v,"whitespace")(g):v(g)}function v(g){return g===null||St(g)?(r.exit("definition"),n.parser.defined.push(i),e(g)):t(g)}}function Rte(r,e,t){return n;function n(o){return Di(o)?jf(r,i)(o):t(o)}function i(o){return oI(r,a,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function a(o){return ar(o)?dr(r,s,"whitespace")(o):s(o)}function s(o){return o===null||St(o)?e(o):t(o)}}const Ote={name:"hardBreakEscape",tokenize:Dte};function Dte(r,e,t){return n;function n(a){return r.enter("hardBreakEscape"),r.consume(a),i}function i(a){return St(a)?(r.exit("hardBreakEscape"),e(a)):t(a)}}const Pte={name:"headingAtx",resolve:Ite,tokenize:Nte};function Ite(r,e){let t=r.length-2,n=3,i,a;return r[n][1].type==="whitespace"&&(n+=2),t-2>n&&r[t][1].type==="whitespace"&&(t-=2),r[t][1].type==="atxHeadingSequence"&&(n===t-1||t-4>n&&r[t-2][1].type==="whitespace")&&(t-=n+1===t?2:4),t>n&&(i={type:"atxHeadingText",start:r[n][1].start,end:r[t][1].end},a={type:"chunkText",start:r[n][1].start,end:r[t][1].end,contentType:"text"},ss(r,n,t-n+1,[["enter",i,e],["enter",a,e],["exit",a,e],["exit",i,e]])),r}function Nte(r,e,t){let n=0;return i;function i(h){return r.enter("atxHeading"),a(h)}function a(h){return r.enter("atxHeadingSequence"),s(h)}function s(h){return h===35&&n++<6?(r.consume(h),s):h===null||Di(h)?(r.exit("atxHeadingSequence"),o(h)):t(h)}function o(h){return h===35?(r.enter("atxHeadingSequence"),l(h)):h===null||St(h)?(r.exit("atxHeading"),e(h)):ar(h)?dr(r,o,"whitespace")(h):(r.enter("atxHeadingText"),c(h))}function l(h){return h===35?(r.consume(h),l):(r.exit("atxHeadingSequence"),o(h))}function c(h){return h===null||h===35||Di(h)?(r.exit("atxHeadingText"),o(h)):(r.consume(h),c)}}const Lte=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],rM=["pre","script","style","textarea"],kte={concrete:!0,name:"htmlFlow",resolveTo:zte,tokenize:Ute},Bte={partial:!0,tokenize:Hte},Fte={partial:!0,tokenize:Gte};function zte(r){let e=r.length;for(;e--&&!(r[e][0]==="enter"&&r[e][1].type==="htmlFlow"););return e>1&&r[e-2][1].type==="linePrefix"&&(r[e][1].start=r[e-2][1].start,r[e+1][1].start=r[e-2][1].start,r.splice(e-2,2)),r}function Ute(r,e,t){const n=this;let i,a,s,o,l;return c;function c(G){return h(G)}function h(G){return r.enter("htmlFlow"),r.enter("htmlFlowData"),r.consume(G),d}function d(G){return G===33?(r.consume(G),v):G===47?(r.consume(G),a=!0,x):G===63?(r.consume(G),i=3,n.interrupt?e:B):Qa(G)?(r.consume(G),s=String.fromCharCode(G),y):t(G)}function v(G){return G===45?(r.consume(G),i=2,g):G===91?(r.consume(G),i=5,o=0,m):Qa(G)?(r.consume(G),i=4,n.interrupt?e:B):t(G)}function g(G){return G===45?(r.consume(G),n.interrupt?e:B):t(G)}function m(G){const re="CDATA[";return G===re.charCodeAt(o++)?(r.consume(G),o===re.length?n.interrupt?e:U:m):t(G)}function x(G){return Qa(G)?(r.consume(G),s=String.fromCharCode(G),y):t(G)}function y(G){if(G===null||G===47||G===62||Di(G)){const re=G===47,ie=s.toLowerCase();return!re&&!a&&rM.includes(ie)?(i=1,n.interrupt?e(G):U(G)):Lte.includes(s.toLowerCase())?(i=6,re?(r.consume(G),_):n.interrupt?e(G):U(G)):(i=7,n.interrupt&&!n.parser.lazy[n.now().line]?t(G):a?w(G):S(G))}return G===45||Vi(G)?(r.consume(G),s+=String.fromCharCode(G),y):t(G)}function _(G){return G===62?(r.consume(G),n.interrupt?e:U):t(G)}function w(G){return ar(G)?(r.consume(G),w):I(G)}function S(G){return G===47?(r.consume(G),I):G===58||G===95||Qa(G)?(r.consume(G),A):ar(G)?(r.consume(G),S):I(G)}function A(G){return G===45||G===46||G===58||G===95||Vi(G)?(r.consume(G),A):C(G)}function C(G){return G===61?(r.consume(G),M):ar(G)?(r.consume(G),C):S(G)}function M(G){return G===null||G===60||G===61||G===62||G===96?t(G):G===34||G===39?(r.consume(G),l=G,E):ar(G)?(r.consume(G),M):O(G)}function E(G){return G===l?(r.consume(G),l=null,D):G===null||St(G)?t(G):(r.consume(G),E)}function O(G){return G===null||G===34||G===39||G===47||G===60||G===61||G===62||G===96||Di(G)?C(G):(r.consume(G),O)}function D(G){return G===47||G===62||ar(G)?S(G):t(G)}function I(G){return G===62?(r.consume(G),k):t(G)}function k(G){return G===null||St(G)?U(G):ar(G)?(r.consume(G),k):t(G)}function U(G){return G===45&&i===2?(r.consume(G),P):G===60&&i===1?(r.consume(G),H):G===62&&i===4?(r.consume(G),L):G===63&&i===3?(r.consume(G),B):G===93&&i===5?(r.consume(G),$):St(G)&&(i===6||i===7)?(r.exit("htmlFlowData"),r.check(Bte,Y,V)(G)):G===null||St(G)?(r.exit("htmlFlowData"),V(G)):(r.consume(G),U)}function V(G){return r.check(Fte,X,Y)(G)}function X(G){return r.enter("lineEnding"),r.consume(G),r.exit("lineEnding"),W}function W(G){return G===null||St(G)?V(G):(r.enter("htmlFlowData"),U(G))}function P(G){return G===45?(r.consume(G),B):U(G)}function H(G){return G===47?(r.consume(G),s="",z):U(G)}function z(G){if(G===62){const re=s.toLowerCase();return rM.includes(re)?(r.consume(G),L):U(G)}return Qa(G)&&s.length<8?(r.consume(G),s+=String.fromCharCode(G),z):U(G)}function $(G){return G===93?(r.consume(G),B):U(G)}function B(G){return G===62?(r.consume(G),L):G===45&&i===2?(r.consume(G),B):U(G)}function L(G){return G===null||St(G)?(r.exit("htmlFlowData"),Y(G)):(r.consume(G),L)}function Y(G){return r.exit("htmlFlow"),e(G)}}function Gte(r,e,t){const n=this;return i;function i(s){return St(s)?(r.enter("lineEnding"),r.consume(s),r.exit("lineEnding"),a):t(s)}function a(s){return n.parser.lazy[n.now().line]?t(s):e(s)}}function Hte(r,e,t){return n;function n(i){return r.enter("lineEnding"),r.consume(i),r.exit("lineEnding"),r.attempt(Ng,e,t)}}const jte={name:"htmlText",tokenize:Vte};function Vte(r,e,t){const n=this;let i,a,s;return o;function o(B){return r.enter("htmlText"),r.enter("htmlTextData"),r.consume(B),l}function l(B){return B===33?(r.consume(B),c):B===47?(r.consume(B),C):B===63?(r.consume(B),S):Qa(B)?(r.consume(B),O):t(B)}function c(B){return B===45?(r.consume(B),h):B===91?(r.consume(B),a=0,m):Qa(B)?(r.consume(B),w):t(B)}function h(B){return B===45?(r.consume(B),g):t(B)}function d(B){return B===null?t(B):B===45?(r.consume(B),v):St(B)?(s=d,H(B)):(r.consume(B),d)}function v(B){return B===45?(r.consume(B),g):d(B)}function g(B){return B===62?P(B):B===45?v(B):d(B)}function m(B){const L="CDATA[";return B===L.charCodeAt(a++)?(r.consume(B),a===L.length?x:m):t(B)}function x(B){return B===null?t(B):B===93?(r.consume(B),y):St(B)?(s=x,H(B)):(r.consume(B),x)}function y(B){return B===93?(r.consume(B),_):x(B)}function _(B){return B===62?P(B):B===93?(r.consume(B),_):x(B)}function w(B){return B===null||B===62?P(B):St(B)?(s=w,H(B)):(r.consume(B),w)}function S(B){return B===null?t(B):B===63?(r.consume(B),A):St(B)?(s=S,H(B)):(r.consume(B),S)}function A(B){return B===62?P(B):S(B)}function C(B){return Qa(B)?(r.consume(B),M):t(B)}function M(B){return B===45||Vi(B)?(r.consume(B),M):E(B)}function E(B){return St(B)?(s=E,H(B)):ar(B)?(r.consume(B),E):P(B)}function O(B){return B===45||Vi(B)?(r.consume(B),O):B===47||B===62||Di(B)?D(B):t(B)}function D(B){return B===47?(r.consume(B),P):B===58||B===95||Qa(B)?(r.consume(B),I):St(B)?(s=D,H(B)):ar(B)?(r.consume(B),D):P(B)}function I(B){return B===45||B===46||B===58||B===95||Vi(B)?(r.consume(B),I):k(B)}function k(B){return B===61?(r.consume(B),U):St(B)?(s=k,H(B)):ar(B)?(r.consume(B),k):D(B)}function U(B){return B===null||B===60||B===61||B===62||B===96?t(B):B===34||B===39?(r.consume(B),i=B,V):St(B)?(s=U,H(B)):ar(B)?(r.consume(B),U):(r.consume(B),X)}function V(B){return B===i?(r.consume(B),i=void 0,W):B===null?t(B):St(B)?(s=V,H(B)):(r.consume(B),V)}function X(B){return B===null||B===34||B===39||B===60||B===61||B===96?t(B):B===47||B===62||Di(B)?D(B):(r.consume(B),X)}function W(B){return B===47||B===62||Di(B)?D(B):t(B)}function P(B){return B===62?(r.consume(B),r.exit("htmlTextData"),r.exit("htmlText"),e):t(B)}function H(B){return r.exit("htmlTextData"),r.enter("lineEnding"),r.consume(B),r.exit("lineEnding"),z}function z(B){return ar(B)?dr(r,$,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):$(B)}function $(B){return r.enter("htmlTextData"),s(B)}}const C3={name:"labelEnd",resolveAll:Wte,resolveTo:$te,tokenize:Kte},qte={tokenize:Zte},Xte={tokenize:Qte},Yte={tokenize:Jte};function Wte(r){let e=-1;const t=[];for(;++e=3&&(c===null||St(c))?(r.exit("thematicBreak"),e(c)):t(c)}function l(c){return c===i?(r.consume(c),n++,l):(r.exit("thematicBreakSequence"),ar(c)?dr(r,o,"whitespace")(c):o(c))}}const Si={continuation:{tokenize:ure},exit:hre,name:"list",tokenize:lre},sre={partial:!0,tokenize:fre},ore={partial:!0,tokenize:cre};function lre(r,e,t){const n=this,i=n.events[n.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return o;function o(g){const m=n.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!n.containerState.marker||g===n.containerState.marker:g_(g)){if(n.containerState.type||(n.containerState.type=m,r.enter(m,{_container:!0})),m==="listUnordered")return r.enter("listItemPrefix"),g===42||g===45?r.check(bp,t,c)(g):c(g);if(!n.interrupt||g===49)return r.enter("listItemPrefix"),r.enter("listItemValue"),l(g)}return t(g)}function l(g){return g_(g)&&++s<10?(r.consume(g),l):(!n.interrupt||s<2)&&(n.containerState.marker?g===n.containerState.marker:g===41||g===46)?(r.exit("listItemValue"),c(g)):t(g)}function c(g){return r.enter("listItemMarker"),r.consume(g),r.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||g,r.check(Ng,n.interrupt?t:h,r.attempt(sre,v,d))}function h(g){return n.containerState.initialBlankLine=!0,a++,v(g)}function d(g){return ar(g)?(r.enter("listItemPrefixWhitespace"),r.consume(g),r.exit("listItemPrefixWhitespace"),v):t(g)}function v(g){return n.containerState.size=a+n.sliceSerialize(r.exit("listItemPrefix"),!0).length,e(g)}}function ure(r,e,t){const n=this;return n.containerState._closeFlow=void 0,r.check(Ng,i,a);function i(o){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,dr(r,e,"listItemIndent",n.containerState.size+1)(o)}function a(o){return n.containerState.furtherBlankLines||!ar(o)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,s(o)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,r.attempt(ore,e,s)(o))}function s(o){return n.containerState._closeFlow=!0,n.interrupt=void 0,dr(r,r.attempt(Si,e,t),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function cre(r,e,t){const n=this;return dr(r,i,"listItemIndent",n.containerState.size+1);function i(a){const s=n.events[n.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===n.containerState.size?e(a):t(a)}}function hre(r){r.exit(this.containerState.type)}function fre(r,e,t){const n=this;return dr(r,i,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const s=n.events[n.events.length-1];return!ar(a)&&s&&s[1].type==="listItemPrefixWhitespace"?e(a):t(a)}}const nM={name:"setextUnderline",resolveTo:dre,tokenize:vre};function dre(r,e){let t=r.length,n,i,a;for(;t--;)if(r[t][0]==="enter"){if(r[t][1].type==="content"){n=t;break}r[t][1].type==="paragraph"&&(i=t)}else r[t][1].type==="content"&&r.splice(t,1),!a&&r[t][1].type==="definition"&&(a=t);const s={type:"setextHeading",start:{...r[n][1].start},end:{...r[r.length-1][1].end}};return r[i][1].type="setextHeadingText",a?(r.splice(i,0,["enter",s,e]),r.splice(a+1,0,["exit",r[n][1],e]),r[n][1].end={...r[a][1].end}):r[n][1]=s,r.push(["exit",s,e]),r}function vre(r,e,t){const n=this;let i;return a;function a(c){let h=n.events.length,d;for(;h--;)if(n.events[h][1].type!=="lineEnding"&&n.events[h][1].type!=="linePrefix"&&n.events[h][1].type!=="content"){d=n.events[h][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||d)?(r.enter("setextHeadingLine"),i=c,s(c)):t(c)}function s(c){return r.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===i?(r.consume(c),o):(r.exit("setextHeadingLineSequence"),ar(c)?dr(r,l,"lineSuffix")(c):l(c))}function l(c){return c===null||St(c)?(r.exit("setextHeadingLine"),e(c)):t(c)}}const pre={tokenize:gre};function gre(r){const e=this,t=r.attempt(Ng,n,r.attempt(this.parser.constructs.flowInitial,i,dr(r,r.attempt(this.parser.constructs.flow,i,r.attempt(_te,i)),"linePrefix")));return t;function n(a){if(a===null){r.consume(a);return}return r.enter("lineEndingBlank"),r.consume(a),r.exit("lineEndingBlank"),e.currentConstruct=void 0,t}function i(a){if(a===null){r.consume(a);return}return r.enter("lineEnding"),r.consume(a),r.exit("lineEnding"),e.currentConstruct=void 0,t}}const mre={resolveAll:uI()},yre=lI("string"),bre=lI("text");function lI(r){return{resolveAll:uI(r==="text"?xre:void 0),tokenize:e};function e(t){const n=this,i=this.parser.constructs[r],a=t.attempt(i,s,o);return s;function s(h){return c(h)?a(h):o(h)}function o(h){if(h===null){t.consume(h);return}return t.enter("data"),t.consume(h),l}function l(h){return c(h)?(t.exit("data"),a(h)):(t.consume(h),l)}function c(h){if(h===null)return!0;const d=i[h];let v=-1;if(d)for(;++v-1){const o=s[0];typeof o=="string"?s[0]=o.slice(n):s.shift()}a>0&&s.push(r[i].slice(0,a))}return s}function Ire(r,e){let t=-1;const n=[];let i;for(;++t0){const nt=We.tokenStack[We.tokenStack.length-1];(nt[1]||aM).call(We,void 0,nt[0])}for(ke.position={start:Do(Se.length>0?Se[0][1].start:{line:1,column:1,offset:0}),end:Do(Se.length>0?Se[Se.length-2][1].end:{line:1,column:1,offset:0})},rt=-1;++rt0&&(n.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:n,children:[{type:"text",value:t}]};return e.meta&&(a.data={meta:e.meta}),r.patch(e,a),a=r.applyData(e,a),a={type:"element",tagName:"pre",properties:{},children:[a]},r.patch(e,a),a}function Yre(r,e){const t={type:"element",tagName:"del",properties:{},children:r.all(e)};return r.patch(e,t),r.applyData(e,t)}function Wre(r,e){const t={type:"element",tagName:"em",properties:{},children:r.all(e)};return r.patch(e,t),r.applyData(e,t)}function $re(r,e){const t=typeof r.options.clobberPrefix=="string"?r.options.clobberPrefix:"user-content-",n=String(e.identifier).toUpperCase(),i=ch(n.toLowerCase()),a=r.footnoteOrder.indexOf(n);let s,o=r.footnoteCounts.get(n);o===void 0?(o=0,r.footnoteOrder.push(n),s=r.footnoteOrder.length):s=a+1,o+=1,r.footnoteCounts.set(n,o);const l={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+i,id:t+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};r.patch(e,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return r.patch(e,c),r.applyData(e,c)}function Kre(r,e){const t={type:"element",tagName:"h"+e.depth,properties:{},children:r.all(e)};return r.patch(e,t),r.applyData(e,t)}function Zre(r,e){if(r.options.allowDangerousHtml){const t={type:"raw",value:e.value};return r.patch(e,t),r.applyData(e,t)}}function fI(r,e){const t=e.referenceType;let n="]";if(t==="collapsed"?n+="[]":t==="full"&&(n+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+n}];const i=r.all(e),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=n:i.push({type:"text",value:n}),i}function Qre(r,e){const t=String(e.identifier).toUpperCase(),n=r.definitionById.get(t);if(!n)return fI(r,e);const i={src:ch(n.url||""),alt:e.alt};n.title!==null&&n.title!==void 0&&(i.title=n.title);const a={type:"element",tagName:"img",properties:i,children:[]};return r.patch(e,a),r.applyData(e,a)}function Jre(r,e){const t={src:ch(e.url)};e.alt!==null&&e.alt!==void 0&&(t.alt=e.alt),e.title!==null&&e.title!==void 0&&(t.title=e.title);const n={type:"element",tagName:"img",properties:t,children:[]};return r.patch(e,n),r.applyData(e,n)}function ene(r,e){const t={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};r.patch(e,t);const n={type:"element",tagName:"code",properties:{},children:[t]};return r.patch(e,n),r.applyData(e,n)}function tne(r,e){const t=String(e.identifier).toUpperCase(),n=r.definitionById.get(t);if(!n)return fI(r,e);const i={href:ch(n.url||"")};n.title!==null&&n.title!==void 0&&(i.title=n.title);const a={type:"element",tagName:"a",properties:i,children:r.all(e)};return r.patch(e,a),r.applyData(e,a)}function rne(r,e){const t={href:ch(e.url)};e.title!==null&&e.title!==void 0&&(t.title=e.title);const n={type:"element",tagName:"a",properties:t,children:r.all(e)};return r.patch(e,n),r.applyData(e,n)}function nne(r,e,t){const n=r.all(e),i=t?ine(t):dI(e),a={},s=[];if(typeof e.checked=="boolean"){const h=n[0];let d;h&&h.type==="element"&&h.tagName==="p"?d=h:(d={type:"element",tagName:"p",properties:{},children:[]},n.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let o=-1;for(;++o1}function ane(r,e){const t={},n=r.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(t.start=e.start);++i0){const s={type:"element",tagName:"tbody",properties:{},children:r.wrap(t,!0)},o=x3(e.children[1]),l=YP(e.children[e.children.length-1]);o&&l&&(s.position={start:o,end:l}),i.push(s)}const a={type:"element",tagName:"table",properties:{},children:r.wrap(i,!0)};return r.patch(e,a),r.applyData(e,a)}function cne(r,e,t){const n=t?t.children:void 0,a=(n?n.indexOf(e):1)===0?"th":"td",s=t&&t.type==="table"?t.align:void 0,o=s?s.length:e.children.length;let l=-1;const c=[];for(;++l0,!0),n[0]),i=n.index+n[0].length,n=t.exec(e);return a.push(lM(e.slice(i),i>0,!1)),a.join("")}function lM(r,e,t){let n=0,i=r.length;if(e){let a=r.codePointAt(n);for(;a===sM||a===oM;)n++,a=r.codePointAt(n)}if(t){let a=r.codePointAt(i-1);for(;a===sM||a===oM;)i--,a=r.codePointAt(i-1)}return i>n?r.slice(n,i):""}function dne(r,e){const t={type:"text",value:fne(String(e.value))};return r.patch(e,t),r.applyData(e,t)}function vne(r,e){const t={type:"element",tagName:"hr",properties:{},children:[]};return r.patch(e,t),r.applyData(e,t)}const pne={blockquote:Vre,break:qre,code:Xre,delete:Yre,emphasis:Wre,footnoteReference:$re,heading:Kre,html:Zre,imageReference:Qre,image:Jre,inlineCode:ene,linkReference:tne,link:rne,listItem:nne,list:ane,paragraph:sne,root:one,strong:lne,table:une,tableCell:hne,tableRow:cne,text:dne,thematicBreak:vne,toml:Gv,yaml:Gv,definition:Gv,footnoteDefinition:Gv};function Gv(){}const vI=-1,Lg=0,Vf=1,Xp=2,A3=3,M3=4,R3=5,O3=6,pI=7,gI=8,uM=typeof self=="object"?self:globalThis,gne=(r,e)=>{const t=(i,a)=>(r.set(a,i),i),n=i=>{if(r.has(i))return r.get(i);const[a,s]=e[i];switch(a){case Lg:case vI:return t(s,i);case Vf:{const o=t([],i);for(const l of s)o.push(n(l));return o}case Xp:{const o=t({},i);for(const[l,c]of s)o[n(l)]=n(c);return o}case A3:return t(new Date(s),i);case M3:{const{source:o,flags:l}=s;return t(new RegExp(o,l),i)}case R3:{const o=t(new Map,i);for(const[l,c]of s)o.set(n(l),n(c));return o}case O3:{const o=t(new Set,i);for(const l of s)o.add(n(l));return o}case pI:{const{name:o,message:l}=s;return t(new uM[o](l),i)}case gI:return t(BigInt(s),i);case"BigInt":return t(Object(BigInt(s)),i);case"ArrayBuffer":return t(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:o}=new Uint8Array(s);return t(new DataView(o),s)}}return t(new uM[a](s),i)};return n},cM=r=>gne(new Map,r)(0),xc="",{toString:mne}={},{keys:yne}=Object,Cf=r=>{const e=typeof r;if(e!=="object"||!r)return[Lg,e];const t=mne.call(r).slice(8,-1);switch(t){case"Array":return[Vf,xc];case"Object":return[Xp,xc];case"Date":return[A3,xc];case"RegExp":return[M3,xc];case"Map":return[R3,xc];case"Set":return[O3,xc];case"DataView":return[Vf,t]}return t.includes("Array")?[Vf,t]:t.includes("Error")?[pI,t]:[Xp,t]},Hv=([r,e])=>r===Lg&&(e==="function"||e==="symbol"),bne=(r,e,t,n)=>{const i=(s,o)=>{const l=n.push(s)-1;return t.set(o,l),l},a=s=>{if(t.has(s))return t.get(s);let[o,l]=Cf(s);switch(o){case Lg:{let h=s;switch(l){case"bigint":o=gI,h=s.toString();break;case"function":case"symbol":if(r)throw new TypeError("unable to serialize "+l);h=null;break;case"undefined":return i([vI],s)}return i([o,h],s)}case Vf:{if(l){let v=s;return l==="DataView"?v=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(v=new Uint8Array(s)),i([l,[...v]],s)}const h=[],d=i([o,h],s);for(const v of s)h.push(a(v));return d}case Xp:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(e&&"toJSON"in s)return a(s.toJSON());const h=[],d=i([o,h],s);for(const v of yne(s))(r||!Hv(Cf(s[v])))&&h.push([a(v),a(s[v])]);return d}case A3:return i([o,s.toISOString()],s);case M3:{const{source:h,flags:d}=s;return i([o,{source:h,flags:d}],s)}case R3:{const h=[],d=i([o,h],s);for(const[v,g]of s)(r||!(Hv(Cf(v))||Hv(Cf(g))))&&h.push([a(v),a(g)]);return d}case O3:{const h=[],d=i([o,h],s);for(const v of s)(r||!Hv(Cf(v)))&&h.push(a(v));return d}}const{message:c}=s;return i([o,{name:l,message:c}],s)};return a},hM=(r,{json:e,lossy:t}={})=>{const n=[];return bne(!(e||t),!!e,new Map,n)(r),n},Yp=typeof structuredClone=="function"?(r,e)=>e&&("json"in e||"lossy"in e)?cM(hM(r,e)):structuredClone(r):(r,e)=>cM(hM(r,e));function xne(r,e){const t=[{type:"text",value:"↩"}];return e>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),t}function _ne(r,e){return"Back to reference "+(r+1)+(e>1?"-"+e:"")}function wne(r){const e=typeof r.options.clobberPrefix=="string"?r.options.clobberPrefix:"user-content-",t=r.options.footnoteBackContent||xne,n=r.options.footnoteBackLabel||_ne,i=r.options.footnoteLabel||"Footnotes",a=r.options.footnoteLabelTagName||"h2",s=r.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l0&&m.push({type:"text",value:" "});let w=typeof t=="string"?t:t(l,g);typeof w=="string"&&(w={type:"text",value:w}),m.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+v+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof n=="string"?n:n(l,g),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const y=h[h.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const w=y.children[y.children.length-1];w&&w.type==="text"?w.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...m)}else h.push(...m);const _={type:"element",tagName:"li",properties:{id:e+"fn-"+v},children:r.wrap(h,!0)};r.patch(c,_),o.push(_)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Yp(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:r.wrap(o,!0)},{type:"text",value:` `}]}}const D3=(function(r){if(r==null)return Cne;if(typeof r=="function")return kg(r);if(typeof r=="object")return Array.isArray(r)?Sne(r):Ene(r);if(typeof r=="string")return Tne(r);throw new Error("Expected function, string, or object as test")});function Sne(r){const e=[];let t=-1;for(;++t":""))+")"})}return v;function v(){let g=mI,m,x,y;if((!e||a(l,c,h[h.length-1]||void 0))&&(g=Rne(t(l,h)),g[0]===fM))return g;if("children"in l&&l.children){const _=l;if(_.children&&g[0]!==yI)for(x=(n?_.children.length:-1)+s,y=h.concat(_);x>-1&&x<_.children.length;){const w=_.children[x];if(m=o(w,x,y)(),m[0]===fM)return m;x=typeof m[1]=="number"?m[1]:x+s}}return g}}}function Rne(r){return Array.isArray(r)?r:typeof r=="number"?[Mne,r]:r==null?mI:[r]}function xI(r,e,t,n){let i,a,s;typeof e=="function"&&typeof t!="function"?(a=void 0,s=e,i=t):(a=e,s=t,i=n),bI(r,a,o,i);function o(l,c){const h=c[c.length-1],d=h?h.children.indexOf(l):void 0;return s(l,d,h)}}const y_={}.hasOwnProperty,One={};function Dne(r,e){const t=e||One,n=new Map,i=new Map,a=new Map,s={...pne,...t.handlers},o={all:c,applyData:Ine,definitionById:n,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:s,one:l,options:t,patch:Pne,wrap:Lne};return xI(r,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const d=h.type==="definition"?n:i,v=String(h.identifier).toUpperCase();d.has(v)||d.set(v,h)}}),o;function l(h,d){const v=h.type,g=o.handlers[v];if(y_.call(o.handlers,v)&&g)return g(o,h,d);if(o.options.passThrough&&o.options.passThrough.includes(v)){if("children"in h){const{children:x,...y}=h,_=Yp(y);return _.children=o.all(h),_}return Yp(h)}return(o.options.unknownHandler||Nne)(o,h,d)}function c(h){const d=[];if("children"in h){const v=h.children;let g=-1;for(;++g0&&t.push({type:"text",value:` `}),t}function dM(r){let e=0,t=r.charCodeAt(e);for(;t===9||t===32;)e++,t=r.charCodeAt(e);return r.slice(e)}function vM(r,e){const t=Dne(r,e),n=t.one(r,void 0),i=wne(t),a=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return i&&a.children.push({type:"text",value:` `},i),a}function kne(r,e){return r&&"run"in r?async function(t,n){const i=vM(t,{file:n,...e});await r.run(i,n)}:function(t,n){return vM(t,{file:n,...r||e})}}function pM(r){if(r)throw r}var _x,gM;function Bne(){if(gM)return _x;gM=1;var r=Object.prototype.hasOwnProperty,e=Object.prototype.toString,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=function(c){return typeof Array.isArray=="function"?Array.isArray(c):e.call(c)==="[object Array]"},a=function(c){if(!c||e.call(c)!=="[object Object]")return!1;var h=r.call(c,"constructor"),d=c.constructor&&c.constructor.prototype&&r.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!h&&!d)return!1;var v;for(v in c);return typeof v>"u"||r.call(c,v)},s=function(c,h){t&&h.name==="__proto__"?t(c,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):c[h.name]=h.newValue},o=function(c,h){if(h==="__proto__")if(r.call(c,h)){if(n)return n(c,h).value}else return;return c[h]};return _x=function l(){var c,h,d,v,g,m,x=arguments[0],y=1,_=arguments.length,w=!1;for(typeof x=="boolean"&&(w=x,x=arguments[1]||{},y=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});y<_;++y)if(c=arguments[y],c!=null)for(h in c)d=o(x,h),v=o(c,h),x!==v&&(w&&v&&(a(v)||(g=i(v)))?(g?(g=!1,m=d&&i(d)?d:[]):m=d&&a(d)?d:{},s(x,{name:h,newValue:l(w,m,v)})):typeof v<"u"&&s(x,{name:h,newValue:v}));return x},_x}var Fne=Bne();const wx=cl(Fne);function b_(r){if(typeof r!="object"||r===null)return!1;const e=Object.getPrototypeOf(r);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)}function zne(){const r=[],e={run:t,use:n};return e;function t(...i){let a=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);o(null,...i);function o(l,...c){const h=r[++a];let d=-1;if(l){s(l);return}for(;++ds.length;let l;o&&s.push(i);try{l=r.apply(this,s)}catch(c){const h=c;if(o&&t)throw h;return i(h)}o||(l&&l.then&&typeof l.then=="function"?l.then(a,i):l instanceof Error?i(l):a(l))}function i(s,...o){t||(t=!0,e(s,...o))}function a(s){i(null,s)}}const Wa={basename:Gne,dirname:Hne,extname:jne,join:Vne,sep:"/"};function Gne(r,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');zd(r);let t=0,n=-1,i=r.length,a;if(e===void 0||e.length===0||e.length>r.length){for(;i--;)if(r.codePointAt(i)===47){if(a){t=i+1;break}}else n<0&&(a=!0,n=i+1);return n<0?"":r.slice(t,n)}if(e===r)return"";let s=-1,o=e.length-1;for(;i--;)if(r.codePointAt(i)===47){if(a){t=i+1;break}}else s<0&&(a=!0,s=i+1),o>-1&&(r.codePointAt(i)===e.codePointAt(o--)?o<0&&(n=i):(o=-1,n=s));return t===n?n=s:n<0&&(n=r.length),r.slice(t,n)}function Hne(r){if(zd(r),r.length===0)return".";let e=-1,t=r.length,n;for(;--t;)if(r.codePointAt(t)===47){if(n){e=t;break}}else n||(n=!0);return e<0?r.codePointAt(0)===47?"/":".":e===1&&r.codePointAt(0)===47?"//":r.slice(0,e)}function jne(r){zd(r);let e=r.length,t=-1,n=0,i=-1,a=0,s;for(;e--;){const o=r.codePointAt(e);if(o===47){if(s){n=e+1;break}continue}t<0&&(s=!0,t=e+1),o===46?i<0?i=e:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||t<0||a===0||a===1&&i===t-1&&i===n+1?"":r.slice(i,t)}function Vne(...r){let e=-1,t;for(;++e0&&r.codePointAt(r.length-1)===47&&(t+="/"),e?"/"+t:t}function Xne(r,e){let t="",n=0,i=-1,a=0,s=-1,o,l;for(;++s<=r.length;){if(s2){if(l=t.lastIndexOf("/"),l!==t.length-1){l<0?(t="",n=0):(t=t.slice(0,l),n=t.length-1-t.lastIndexOf("/")),i=s,a=0;continue}}else if(t.length>0){t="",n=0,i=s,a=0;continue}}e&&(t=t.length>0?t+"/..":"..",n=2)}else t.length>0?t+="/"+r.slice(i+1,s):t=r.slice(i+1,s),n=s-i-1;i=s,a=0}else o===46&&a>-1?a++:a=-1}return t}function zd(r){if(typeof r!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(r))}const Yne={cwd:Wne};function Wne(){return"/"}function x_(r){return!!(r!==null&&typeof r=="object"&&"href"in r&&r.href&&"protocol"in r&&r.protocol&&r.auth===void 0)}function $ne(r){if(typeof r=="string")r=new URL(r);else if(!x_(r)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+r+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(r.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return Kne(r)}function Kne(r){if(r.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const e=r.pathname;let t=-1;for(;++t0){let[g,...m]=h;const x=n[v][1];b_(x)&&b_(g)&&(g=wx(!0,x,g)),n[v]=[c,g,...m]}}}}const eie=new P3().freeze();function Cx(r,e){if(typeof e!="function")throw new TypeError("Cannot `"+r+"` without `parser`")}function Ax(r,e){if(typeof e!="function")throw new TypeError("Cannot `"+r+"` without `compiler`")}function Mx(r,e){if(e)throw new Error("Cannot call `"+r+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function yM(r){if(!b_(r)||typeof r.type!="string")throw new TypeError("Expected node, got `"+r+"`")}function bM(r,e,t){if(!t)throw new Error("`"+r+"` finished async. Use `"+e+"` instead")}function jv(r){return tie(r)?r:new _I(r)}function tie(r){return!!(r&&typeof r=="object"&&"message"in r&&"messages"in r)}function rie(r){return typeof r=="string"||nie(r)}function nie(r){return!!(r&&typeof r=="object"&&"byteLength"in r&&"byteOffset"in r)}const iie="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",xM=[],_M={allowDangerousHtml:!0},aie=/^(https?|ircs?|mailto|xmpp)$/i,sie=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function oie(r){const e=lie(r),t=uie(r);return cie(e.runSync(e.parse(t),t),r)}function lie(r){const e=r.rehypePlugins||xM,t=r.remarkPlugins||xM,n=r.remarkRehypeOptions?{...r.remarkRehypeOptions,..._M}:_M;return eie().use(jre).use(t).use(kne,n).use(e)}function uie(r){const e=r.children||"",t=new _I;return typeof e=="string"&&(t.value=e),t}function cie(r,e){const t=e.allowedElements,n=e.allowElement,i=e.components,a=e.disallowedElements,s=e.skipHtml,o=e.unwrapDisallowed,l=e.urlTransform||hie;for(const h of sie)Object.hasOwn(e,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+iie+h.id,void 0);return xI(r,c),wee(r,{Fragment:N.Fragment,components:i,ignoreInvalidStyle:!0,jsx:N.jsx,jsxs:N.jsxs,passKeys:!0,passNode:!0});function c(h,d,v){if(h.type==="raw"&&v&&typeof d=="number")return s?v.children.splice(d,1):v.children[d]={type:"text",value:h.value},d;if(h.type==="element"){let g;for(g in yx)if(Object.hasOwn(yx,g)&&Object.hasOwn(h.properties,g)){const m=h.properties[g],x=yx[g];(x===null||x.includes(h.tagName))&&(h.properties[g]=l(String(m||""),g,h))}}if(h.type==="element"){let g=t?!t.includes(h.tagName):a?a.includes(h.tagName):!1;if(!g&&n&&typeof d=="number"&&(g=!n(h,d,v)),g&&v&&typeof d=="number")return o&&h.children?v.children.splice(d,1,...h.children):v.children.splice(d,1),d}}}function hie(r){const e=r.indexOf(":"),t=r.indexOf("?"),n=r.indexOf("#"),i=r.indexOf("/");return e===-1||i!==-1&&e>i||t!==-1&&e>t||n!==-1&&e>n||aie.test(r.slice(0,e))?r:""}const wM=/[#.]/g;function fie(r,e){const t=r||"",n={};let i=0,a,s;for(;ic&&(c=h):h&&(c!==void 0&&c>-1&&l.push(` `.repeat(c)||" "),c=-1,l.push(h))}return l.join("")}function CI(r,e,t){return r.type==="element"?Lie(r,e,t):r.type==="text"?t.whitespace==="normal"?AI(r,t):kie(r):[]}function Lie(r,e,t){const n=MI(r,t),i=r.children||[];let a=-1,s=[];if(Iie(r))return s;let o,l;for(w_(r)||RM(r)&&TM(e,r,RM)?l=` `:Pie(r)?(o=2,l=2):TI(r)&&(o=1,l=1);++a15?c="…"+o.slice(i-15,i):c=o.slice(0,i);var h;a+15r.replace(Gie,"-$1").toLowerCase(),Hie={"&":"&",">":">","<":"<",'"':""","'":"'"},jie=/[&><"']/g,ti=r=>String(r).replace(jie,e=>Hie[e]),xp=r=>r.type==="ordgroup"||r.type==="color"?r.body.length===1?xp(r.body[0]):r:r.type==="font"?xp(r.body):r,Vie=new Set(["mathord","textord","atom"]),Qs=r=>Vie.has(xp(r).type),qie=r=>{var e=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(r);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},S_={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:r=>"#"+r},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(r,e)=>(e.push(r),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:r=>Math.max(0,r),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:r=>Math.max(0,r),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:r=>Math.max(0,r),cli:"-e, --max-expand ",cliProcessor:r=>r==="Infinity"?1/0:parseInt(r)},globalGroup:{type:"boolean",cli:!1}};function Xie(r){if("default"in r)return r.default;var e=r.type,t=Array.isArray(e)?e[0]:e;if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class L3{constructor(e){e===void 0&&(e={}),e=e||{};for(var t of Object.keys(S_)){var n=S_[t],i=e[t];this[t]=i!==void 0?n.processor?n.processor(i):i:Xie(n)}}reportNonstrict(e,t,n){var i=this.strict;if(typeof i=="function"&&(i=i(e,t,n)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new Qe("LaTeX-incompatible input and strict mode is set to 'error': "+(t+" ["+e+"]"),n);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+t+" ["+e+"]"))}}useStrictBehavior(e,t,n){var i=this.strict;if(typeof i=="function")try{i=i(e,t,n)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+t+" ["+e+"]")),!1)}isTrusted(e){if("url"in e&&e.url&&!e.protocol){var t=qie(e.url);if(t==null)return!1;e.protocol=t}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class Po{constructor(e,t,n){this.id=e,this.size=t,this.cramped=n}sup(){return Ka[Yie[this.id]]}sub(){return Ka[Wie[this.id]]}fracNum(){return Ka[$ie[this.id]]}fracDen(){return Ka[Kie[this.id]]}cramp(){return Ka[Zie[this.id]]}text(){return Ka[Qie[this.id]]}isTight(){return this.size>=2}}var k3=0,Wp=1,kc=2,Hs=3,wd=4,ya=5,Xc=6,hi=7,Ka=[new Po(k3,0,!1),new Po(Wp,0,!0),new Po(kc,1,!1),new Po(Hs,1,!0),new Po(wd,2,!1),new Po(ya,2,!0),new Po(Xc,3,!1),new Po(hi,3,!0)],Yie=[wd,ya,wd,ya,Xc,hi,Xc,hi],Wie=[ya,ya,ya,ya,hi,hi,hi,hi],$ie=[kc,Hs,wd,ya,Xc,hi,Xc,hi],Kie=[Hs,Hs,ya,ya,hi,hi,hi,hi],Zie=[Wp,Wp,Hs,Hs,ya,ya,hi,hi],Qie=[k3,Wp,kc,Hs,kc,Hs,kc,Hs],Dt={DISPLAY:Ka[k3],TEXT:Ka[kc],SCRIPT:Ka[wd],SCRIPTSCRIPT:Ka[Xc]},E_=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function Jie(r){for(var e=0;e=i[0]&&r<=i[1])return t.name}return null}var _p=[];E_.forEach(r=>r.blocks.forEach(e=>_p.push(...e)));function RI(r){for(var e=0;e<_p.length;e+=2)if(r>=_p[e]&&r<=_p[e+1])return!0;return!1}var _c=80,eae=function(e,t){return"M95,"+(622+e+t)+` c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 c69,-144,104.5,-217.7,106.5,-221 l`+e/2.075+" -"+e+` c5.3,-9.3,12,-14,20,-14 H400000v`+(40+e)+`H845.2724 s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z M`+(834+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},tae=function(e,t){return"M263,"+(601+e+t)+`c0.7,0,18,39.7,52,119 c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120 c340,-704.7,510.7,-1060.3,512,-1067 l`+e/2.084+" -"+e+` c4.7,-7.3,11,-11,19,-11 H40000v`+(40+e)+`H1012.3 s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232 c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1 s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z M`+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},rae=function(e,t){return"M983 "+(10+e+t)+` l`+e/3.13+" -"+e+` c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+` H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7 s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744 c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30 c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722 c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5 c53.7,-170.3,84.5,-266.8,92.5,-289.5z M`+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},nae=function(e,t){return"M424,"+(2398+e+t)+` c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514 c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20 s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121 s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081 l`+e/4.223+" -"+e+`c4,-6.7,10,-10,18,-10 H400000 v`+(40+e)+`H1014.6 s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185 c-2,6,-10,9,-24,9 c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+t+` h400000v`+(40+e)+"h-400000z"},iae=function(e,t){return"M473,"+(2713+e+t)+` c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+` c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7 s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9 c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200 c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26 s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104, 606zM`+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"},aae=function(e){var t=e/2;return"M400000 "+e+" H0 L"+t+" 0 l65 45 L145 "+(e-80)+" H400000z"},sae=function(e,t,n){var i=n-54-t-e;return"M702 "+(e+t)+"H400000"+(40+e)+` H742v`+i+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1 h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170 c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667 219 661 l218 661zM702 `+t+"H400000v"+(40+e)+"H742z"},oae=function(e,t,n){t=1e3*t;var i="";switch(e){case"sqrtMain":i=eae(t,_c);break;case"sqrtSize1":i=tae(t,_c);break;case"sqrtSize2":i=rae(t,_c);break;case"sqrtSize3":i=nae(t,_c);break;case"sqrtSize4":i=iae(t,_c);break;case"sqrtTall":i=sae(t,_c,n)}return i},lae=function(e,t){switch(e){case"⎜":return"M291 0 H417 V"+t+" H291z M291 0 H417 V"+t+" H291z";case"∣":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z";case"∥":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z"+("M367 0 H410 V"+t+" H367z M367 0 H410 V"+t+" H367z");case"⎟":return"M457 0 H583 V"+t+" H457z M457 0 H583 V"+t+" H457z";case"⎢":return"M319 0 H403 V"+t+" H319z M319 0 H403 V"+t+" H319z";case"⎥":return"M263 0 H347 V"+t+" H263z M263 0 H347 V"+t+" H263z";case"⎪":return"M384 0 H504 V"+t+" H384z M384 0 H504 V"+t+" H384z";case"⏐":return"M312 0 H355 V"+t+" H312z M312 0 H355 V"+t+" H312z";case"‖":return"M257 0 H300 V"+t+" H257z M257 0 H300 V"+t+" H257z"+("M478 0 H521 V"+t+" H478z M478 0 H521 V"+t+" H478z");default:return""}},OM={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`,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`,leftbracketunder:`M0 0 h120 V290 H399995 v120 H0z M0 0 h120 V290 H399995 v120 H0z`,leftbracketover:`M0 440 h120 V150 H399995 v-120 H0z M0 440 h120 V150 H399995 v-120 H0z`,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`,rightbracketunder:`M399995 0 h-120 V290 H0 v120 H400000z M399995 0 h-120 V290 H0 v120 H400000z`,rightbracketover:`M399995 440 h-120 V150 H0 v-120 H399995z M399995 440 h-120 V150 H0 v-120 H399995z`,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`,tilde1:`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`,tilde2:`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`,tilde3:`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`,tilde4:`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`},uae=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v1759 h347 v-84 H403z M403 1759 V0 H319 V1759 v`+t+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v1759 H0 v84 H347z M347 1759 V0 H263 V1759 v`+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15 c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15 c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15 c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15 c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z M367 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15 c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15 c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+` v1715 h263 v84 H319z MM319 602 V0 H403 V602 v`+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+` v1799 H0 v-84 H319z MM319 602 V0 H403 V602 v`+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v602 h84z M403 1759 V0 H319 V1759 v`+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v602 h84z M347 1759 V0 h-84 V1759 v`+t+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1 c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349, -36,557 l0,`+(t+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210, 949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9 c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5, -544.7,-112.5,-882c-2,-104,-3,-167,-3,-189 l0,-`+(t+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3, -210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3, 63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5 c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(t+9)+` c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664 c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11 c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, -470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class hh{constructor(e){this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),t=0;tt.toText();return this.children.map(e).join("")}}var T_={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},cae={ex:!0,em:!0,mu:!0},OI=function(e){return typeof e!="string"&&(e=e.unit),e in T_||e in cae||e==="ex"},Zr=function(e,t){var n;if(e.unit in T_)n=T_[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit==="mu")n=t.fontMetrics().cssEmPerMu;else{var i;if(t.style.isTight()?i=t.havingStyle(t.style.text()):i=t,e.unit==="ex")n=i.fontMetrics().xHeight;else if(e.unit==="em")n=i.fontMetrics().quad;else throw new Qe("Invalid unit: '"+e.unit+"'");i!==t&&(n*=i.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},it=function(e){return+e.toFixed(4)+"em"},al=function(e){return e.filter(t=>t).join(" ")},DI=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push("mtight");var i=t.getColor();i&&(this.style.color=i)}},PI=function(e){var t=document.createElement(e);t.className=al(this.classes);for(var n of Object.keys(this.style))t.style[n]=this.style[n];for(var i of Object.keys(this.attributes))t.setAttribute(i,this.attributes[i]);for(var a=0;a/=\x00-\x1f]/,II=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+ti(al(this.classes))+'"');var n="";for(var i of Object.keys(this.style))n+=N3(i)+":"+this.style[i]+";";n&&(t+=' style="'+ti(n)+'"');for(var a of Object.keys(this.attributes)){if(hae.test(a))throw new Qe("Invalid attribute name '"+a+"'");t+=" "+a+'="'+ti(this.attributes[a])+'"'}t+=">";for(var s=0;s",t};class fh{constructor(e,t,n,i){DI.call(this,e,n,i),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return PI.call(this,"span")}toMarkup(){return II.call(this,"span")}}class Bg{constructor(e,t,n,i){DI.call(this,t,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return PI.call(this,"a")}toMarkup(){return II.call(this,"a")}}class fae{constructor(e,t,n){this.alt=t,this.src=e,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(var t of Object.keys(this.style))e.style[t]=this.style[t];return e}toMarkup(){var e='
'+ti(this.alt)+'0&&(t=document.createElement("span"),t.style.marginRight=it(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=al(this.classes));for(var n of Object.keys(this.style))t=t||document.createElement("span"),t.style[n]=this.style[n];return t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="0&&(n+="margin-right:"+it(this.italic)+";");for(var i of Object.keys(this.style))n+=N3(i)+":"+this.style[i]+";";n&&(e=!0,t+=' style="'+ti(n)+'"');var a=ti(this.text);return e?(t+=">",t+=a,t+="",t):a}}class qs{constructor(e,t){this.children=e||[],this.attributes=t||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");for(var n of Object.keys(this.attributes))t.setAttribute(n,this.attributes[n]);for(var i=0;i':''}}class C_{constructor(e){this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"line");for(var n of Object.keys(this.attributes))t.setAttribute(n,this.attributes[n]);return t}toMarkup(){var e=" but got "+String(r)+".")}var gae=r=>r instanceof fh||r instanceof Bg||r instanceof hh,ts={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],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:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],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:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],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:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],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:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],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:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],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:[0,.44444,0,0,.63889],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:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],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:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],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:[0,.68611,.17208,0,.8961],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:[0,.68611,.17208,0,.8961],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:[0,.69444,.06709,0,.59111],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:[.19444,.44444,.105,0,.53222],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:[.19444,.44444,.105,0,.53222],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:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],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:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],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:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],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:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],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:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],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:[0,.68333,.16389,0,.74333],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:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],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:[0,.68333,.16389,0,.74333],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:[0,.69444,.06646,0,.51111],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:[.19444,.43056,.08847,0,.46],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:[.19444,.43056,.08847,0,.46],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:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],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:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],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:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],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:[0,.43056,0,0,.55556],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:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],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:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],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:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],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:[0,.69444,0,0,.66759],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:[0,.44444,0,0,.58472],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:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],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:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],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:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],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:[0,.68333,.08125,.05556,.83125],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:[0,.68333,.02778,.08334,.76278],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:[0,.43056,0,.05556,.48472],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:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],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:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],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:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],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:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],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:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],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:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],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:[0,.69444,.07816,0,.27778],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:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],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:[0,.69444,0,0,.66667],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:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],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:[0,.69444,.0799,0,.5],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:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],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:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],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:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],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:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],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:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],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:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Vv={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],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:[.25,.25,.25],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],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},DM={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function mae(r,e){ts[r]=e}function B3(r,e,t){if(!ts[e])throw new Error("Font metrics not found for font: "+e+".");var n=r.charCodeAt(0),i=ts[e][n];if(!i&&r[0]in DM&&(n=DM[r[0]].charCodeAt(0),i=ts[e][n]),!i&&t==="text"&&RI(n)&&(i=ts[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var Ox={};function yae(r){var e;if(r>=5?e=0:r>=3?e=1:e=2,!Ox[e]){var t=Ox[e]={cssEmPerMu:Vv.quad[e]/18};for(var n in Vv)Vv.hasOwnProperty(n)&&(t[n]=Vv[n][e])}return Ox[e]}var bae={bin:1,close:1,inner:1,open:1,punct:1,rel:1},xae={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Vr={math:{},text:{}};function F(r,e,t,n,i,a){Vr[r][i]={font:e,group:t,replace:n},a&&n&&(Vr[r][n]=Vr[r][i])}var j="math",qe="text",K="main",ue="ams",Xr="accent-token",dt="bin",pi="close",dh="inner",Tt="mathord",Tn="op-token",Wi="open",Ud="punct",fe="rel",Js="spacing",me="textord";F(j,K,fe,"≡","\\equiv",!0);F(j,K,fe,"≺","\\prec",!0);F(j,K,fe,"≻","\\succ",!0);F(j,K,fe,"∼","\\sim",!0);F(j,K,fe,"⊥","\\perp");F(j,K,fe,"⪯","\\preceq",!0);F(j,K,fe,"⪰","\\succeq",!0);F(j,K,fe,"≃","\\simeq",!0);F(j,K,fe,"∣","\\mid",!0);F(j,K,fe,"≪","\\ll",!0);F(j,K,fe,"≫","\\gg",!0);F(j,K,fe,"≍","\\asymp",!0);F(j,K,fe,"∥","\\parallel");F(j,K,fe,"⋈","\\bowtie",!0);F(j,K,fe,"⌣","\\smile",!0);F(j,K,fe,"⊑","\\sqsubseteq",!0);F(j,K,fe,"⊒","\\sqsupseteq",!0);F(j,K,fe,"≐","\\doteq",!0);F(j,K,fe,"⌢","\\frown",!0);F(j,K,fe,"∋","\\ni",!0);F(j,K,fe,"∝","\\propto",!0);F(j,K,fe,"⊢","\\vdash",!0);F(j,K,fe,"⊣","\\dashv",!0);F(j,K,fe,"∋","\\owns");F(j,K,Ud,".","\\ldotp");F(j,K,Ud,"⋅","\\cdotp");F(j,K,Ud,"⋅","·");F(qe,K,me,"⋅","·");F(j,K,me,"#","\\#");F(qe,K,me,"#","\\#");F(j,K,me,"&","\\&");F(qe,K,me,"&","\\&");F(j,K,me,"ℵ","\\aleph",!0);F(j,K,me,"∀","\\forall",!0);F(j,K,me,"ℏ","\\hbar",!0);F(j,K,me,"∃","\\exists",!0);F(j,K,me,"∇","\\nabla",!0);F(j,K,me,"♭","\\flat",!0);F(j,K,me,"ℓ","\\ell",!0);F(j,K,me,"♮","\\natural",!0);F(j,K,me,"♣","\\clubsuit",!0);F(j,K,me,"℘","\\wp",!0);F(j,K,me,"♯","\\sharp",!0);F(j,K,me,"♢","\\diamondsuit",!0);F(j,K,me,"ℜ","\\Re",!0);F(j,K,me,"♡","\\heartsuit",!0);F(j,K,me,"ℑ","\\Im",!0);F(j,K,me,"♠","\\spadesuit",!0);F(j,K,me,"§","\\S",!0);F(qe,K,me,"§","\\S");F(j,K,me,"¶","\\P",!0);F(qe,K,me,"¶","\\P");F(j,K,me,"†","\\dag");F(qe,K,me,"†","\\dag");F(qe,K,me,"†","\\textdagger");F(j,K,me,"‡","\\ddag");F(qe,K,me,"‡","\\ddag");F(qe,K,me,"‡","\\textdaggerdbl");F(j,K,pi,"⎱","\\rmoustache",!0);F(j,K,Wi,"⎰","\\lmoustache",!0);F(j,K,pi,"⟯","\\rgroup",!0);F(j,K,Wi,"⟮","\\lgroup",!0);F(j,K,dt,"∓","\\mp",!0);F(j,K,dt,"⊖","\\ominus",!0);F(j,K,dt,"⊎","\\uplus",!0);F(j,K,dt,"⊓","\\sqcap",!0);F(j,K,dt,"∗","\\ast");F(j,K,dt,"⊔","\\sqcup",!0);F(j,K,dt,"◯","\\bigcirc",!0);F(j,K,dt,"∙","\\bullet",!0);F(j,K,dt,"‡","\\ddagger");F(j,K,dt,"≀","\\wr",!0);F(j,K,dt,"⨿","\\amalg");F(j,K,dt,"&","\\And");F(j,K,fe,"⟵","\\longleftarrow",!0);F(j,K,fe,"⇐","\\Leftarrow",!0);F(j,K,fe,"⟸","\\Longleftarrow",!0);F(j,K,fe,"⟶","\\longrightarrow",!0);F(j,K,fe,"⇒","\\Rightarrow",!0);F(j,K,fe,"⟹","\\Longrightarrow",!0);F(j,K,fe,"↔","\\leftrightarrow",!0);F(j,K,fe,"⟷","\\longleftrightarrow",!0);F(j,K,fe,"⇔","\\Leftrightarrow",!0);F(j,K,fe,"⟺","\\Longleftrightarrow",!0);F(j,K,fe,"↦","\\mapsto",!0);F(j,K,fe,"⟼","\\longmapsto",!0);F(j,K,fe,"↗","\\nearrow",!0);F(j,K,fe,"↩","\\hookleftarrow",!0);F(j,K,fe,"↪","\\hookrightarrow",!0);F(j,K,fe,"↘","\\searrow",!0);F(j,K,fe,"↼","\\leftharpoonup",!0);F(j,K,fe,"⇀","\\rightharpoonup",!0);F(j,K,fe,"↙","\\swarrow",!0);F(j,K,fe,"↽","\\leftharpoondown",!0);F(j,K,fe,"⇁","\\rightharpoondown",!0);F(j,K,fe,"↖","\\nwarrow",!0);F(j,K,fe,"⇌","\\rightleftharpoons",!0);F(j,ue,fe,"≮","\\nless",!0);F(j,ue,fe,"","\\@nleqslant");F(j,ue,fe,"","\\@nleqq");F(j,ue,fe,"⪇","\\lneq",!0);F(j,ue,fe,"≨","\\lneqq",!0);F(j,ue,fe,"","\\@lvertneqq");F(j,ue,fe,"⋦","\\lnsim",!0);F(j,ue,fe,"⪉","\\lnapprox",!0);F(j,ue,fe,"⊀","\\nprec",!0);F(j,ue,fe,"⋠","\\npreceq",!0);F(j,ue,fe,"⋨","\\precnsim",!0);F(j,ue,fe,"⪹","\\precnapprox",!0);F(j,ue,fe,"≁","\\nsim",!0);F(j,ue,fe,"","\\@nshortmid");F(j,ue,fe,"∤","\\nmid",!0);F(j,ue,fe,"⊬","\\nvdash",!0);F(j,ue,fe,"⊭","\\nvDash",!0);F(j,ue,fe,"⋪","\\ntriangleleft");F(j,ue,fe,"⋬","\\ntrianglelefteq",!0);F(j,ue,fe,"⊊","\\subsetneq",!0);F(j,ue,fe,"","\\@varsubsetneq");F(j,ue,fe,"⫋","\\subsetneqq",!0);F(j,ue,fe,"","\\@varsubsetneqq");F(j,ue,fe,"≯","\\ngtr",!0);F(j,ue,fe,"","\\@ngeqslant");F(j,ue,fe,"","\\@ngeqq");F(j,ue,fe,"⪈","\\gneq",!0);F(j,ue,fe,"≩","\\gneqq",!0);F(j,ue,fe,"","\\@gvertneqq");F(j,ue,fe,"⋧","\\gnsim",!0);F(j,ue,fe,"⪊","\\gnapprox",!0);F(j,ue,fe,"⊁","\\nsucc",!0);F(j,ue,fe,"⋡","\\nsucceq",!0);F(j,ue,fe,"⋩","\\succnsim",!0);F(j,ue,fe,"⪺","\\succnapprox",!0);F(j,ue,fe,"≆","\\ncong",!0);F(j,ue,fe,"","\\@nshortparallel");F(j,ue,fe,"∦","\\nparallel",!0);F(j,ue,fe,"⊯","\\nVDash",!0);F(j,ue,fe,"⋫","\\ntriangleright");F(j,ue,fe,"⋭","\\ntrianglerighteq",!0);F(j,ue,fe,"","\\@nsupseteqq");F(j,ue,fe,"⊋","\\supsetneq",!0);F(j,ue,fe,"","\\@varsupsetneq");F(j,ue,fe,"⫌","\\supsetneqq",!0);F(j,ue,fe,"","\\@varsupsetneqq");F(j,ue,fe,"⊮","\\nVdash",!0);F(j,ue,fe,"⪵","\\precneqq",!0);F(j,ue,fe,"⪶","\\succneqq",!0);F(j,ue,fe,"","\\@nsubseteqq");F(j,ue,dt,"⊴","\\unlhd");F(j,ue,dt,"⊵","\\unrhd");F(j,ue,fe,"↚","\\nleftarrow",!0);F(j,ue,fe,"↛","\\nrightarrow",!0);F(j,ue,fe,"⇍","\\nLeftarrow",!0);F(j,ue,fe,"⇏","\\nRightarrow",!0);F(j,ue,fe,"↮","\\nleftrightarrow",!0);F(j,ue,fe,"⇎","\\nLeftrightarrow",!0);F(j,ue,fe,"△","\\vartriangle");F(j,ue,me,"ℏ","\\hslash");F(j,ue,me,"▽","\\triangledown");F(j,ue,me,"◊","\\lozenge");F(j,ue,me,"Ⓢ","\\circledS");F(j,ue,me,"®","\\circledR");F(qe,ue,me,"®","\\circledR");F(j,ue,me,"∡","\\measuredangle",!0);F(j,ue,me,"∄","\\nexists");F(j,ue,me,"℧","\\mho");F(j,ue,me,"Ⅎ","\\Finv",!0);F(j,ue,me,"⅁","\\Game",!0);F(j,ue,me,"‵","\\backprime");F(j,ue,me,"▲","\\blacktriangle");F(j,ue,me,"▼","\\blacktriangledown");F(j,ue,me,"■","\\blacksquare");F(j,ue,me,"⧫","\\blacklozenge");F(j,ue,me,"★","\\bigstar");F(j,ue,me,"∢","\\sphericalangle",!0);F(j,ue,me,"∁","\\complement",!0);F(j,ue,me,"ð","\\eth",!0);F(qe,K,me,"ð","ð");F(j,ue,me,"╱","\\diagup");F(j,ue,me,"╲","\\diagdown");F(j,ue,me,"□","\\square");F(j,ue,me,"□","\\Box");F(j,ue,me,"◊","\\Diamond");F(j,ue,me,"¥","\\yen",!0);F(qe,ue,me,"¥","\\yen",!0);F(j,ue,me,"✓","\\checkmark",!0);F(qe,ue,me,"✓","\\checkmark");F(j,ue,me,"ℶ","\\beth",!0);F(j,ue,me,"ℸ","\\daleth",!0);F(j,ue,me,"ℷ","\\gimel",!0);F(j,ue,me,"ϝ","\\digamma",!0);F(j,ue,me,"ϰ","\\varkappa");F(j,ue,Wi,"┌","\\@ulcorner",!0);F(j,ue,pi,"┐","\\@urcorner",!0);F(j,ue,Wi,"└","\\@llcorner",!0);F(j,ue,pi,"┘","\\@lrcorner",!0);F(j,ue,fe,"≦","\\leqq",!0);F(j,ue,fe,"⩽","\\leqslant",!0);F(j,ue,fe,"⪕","\\eqslantless",!0);F(j,ue,fe,"≲","\\lesssim",!0);F(j,ue,fe,"⪅","\\lessapprox",!0);F(j,ue,fe,"≊","\\approxeq",!0);F(j,ue,dt,"⋖","\\lessdot");F(j,ue,fe,"⋘","\\lll",!0);F(j,ue,fe,"≶","\\lessgtr",!0);F(j,ue,fe,"⋚","\\lesseqgtr",!0);F(j,ue,fe,"⪋","\\lesseqqgtr",!0);F(j,ue,fe,"≑","\\doteqdot");F(j,ue,fe,"≓","\\risingdotseq",!0);F(j,ue,fe,"≒","\\fallingdotseq",!0);F(j,ue,fe,"∽","\\backsim",!0);F(j,ue,fe,"⋍","\\backsimeq",!0);F(j,ue,fe,"⫅","\\subseteqq",!0);F(j,ue,fe,"⋐","\\Subset",!0);F(j,ue,fe,"⊏","\\sqsubset",!0);F(j,ue,fe,"≼","\\preccurlyeq",!0);F(j,ue,fe,"⋞","\\curlyeqprec",!0);F(j,ue,fe,"≾","\\precsim",!0);F(j,ue,fe,"⪷","\\precapprox",!0);F(j,ue,fe,"⊲","\\vartriangleleft");F(j,ue,fe,"⊴","\\trianglelefteq");F(j,ue,fe,"⊨","\\vDash",!0);F(j,ue,fe,"⊪","\\Vvdash",!0);F(j,ue,fe,"⌣","\\smallsmile");F(j,ue,fe,"⌢","\\smallfrown");F(j,ue,fe,"≏","\\bumpeq",!0);F(j,ue,fe,"≎","\\Bumpeq",!0);F(j,ue,fe,"≧","\\geqq",!0);F(j,ue,fe,"⩾","\\geqslant",!0);F(j,ue,fe,"⪖","\\eqslantgtr",!0);F(j,ue,fe,"≳","\\gtrsim",!0);F(j,ue,fe,"⪆","\\gtrapprox",!0);F(j,ue,dt,"⋗","\\gtrdot");F(j,ue,fe,"⋙","\\ggg",!0);F(j,ue,fe,"≷","\\gtrless",!0);F(j,ue,fe,"⋛","\\gtreqless",!0);F(j,ue,fe,"⪌","\\gtreqqless",!0);F(j,ue,fe,"≖","\\eqcirc",!0);F(j,ue,fe,"≗","\\circeq",!0);F(j,ue,fe,"≜","\\triangleq",!0);F(j,ue,fe,"∼","\\thicksim");F(j,ue,fe,"≈","\\thickapprox");F(j,ue,fe,"⫆","\\supseteqq",!0);F(j,ue,fe,"⋑","\\Supset",!0);F(j,ue,fe,"⊐","\\sqsupset",!0);F(j,ue,fe,"≽","\\succcurlyeq",!0);F(j,ue,fe,"⋟","\\curlyeqsucc",!0);F(j,ue,fe,"≿","\\succsim",!0);F(j,ue,fe,"⪸","\\succapprox",!0);F(j,ue,fe,"⊳","\\vartriangleright");F(j,ue,fe,"⊵","\\trianglerighteq");F(j,ue,fe,"⊩","\\Vdash",!0);F(j,ue,fe,"∣","\\shortmid");F(j,ue,fe,"∥","\\shortparallel");F(j,ue,fe,"≬","\\between",!0);F(j,ue,fe,"⋔","\\pitchfork",!0);F(j,ue,fe,"∝","\\varpropto");F(j,ue,fe,"◀","\\blacktriangleleft");F(j,ue,fe,"∴","\\therefore",!0);F(j,ue,fe,"∍","\\backepsilon");F(j,ue,fe,"▶","\\blacktriangleright");F(j,ue,fe,"∵","\\because",!0);F(j,ue,fe,"⋘","\\llless");F(j,ue,fe,"⋙","\\gggtr");F(j,ue,dt,"⊲","\\lhd");F(j,ue,dt,"⊳","\\rhd");F(j,ue,fe,"≂","\\eqsim",!0);F(j,K,fe,"⋈","\\Join");F(j,ue,fe,"≑","\\Doteq",!0);F(j,ue,dt,"∔","\\dotplus",!0);F(j,ue,dt,"∖","\\smallsetminus");F(j,ue,dt,"⋒","\\Cap",!0);F(j,ue,dt,"⋓","\\Cup",!0);F(j,ue,dt,"⩞","\\doublebarwedge",!0);F(j,ue,dt,"⊟","\\boxminus",!0);F(j,ue,dt,"⊞","\\boxplus",!0);F(j,ue,dt,"⋇","\\divideontimes",!0);F(j,ue,dt,"⋉","\\ltimes",!0);F(j,ue,dt,"⋊","\\rtimes",!0);F(j,ue,dt,"⋋","\\leftthreetimes",!0);F(j,ue,dt,"⋌","\\rightthreetimes",!0);F(j,ue,dt,"⋏","\\curlywedge",!0);F(j,ue,dt,"⋎","\\curlyvee",!0);F(j,ue,dt,"⊝","\\circleddash",!0);F(j,ue,dt,"⊛","\\circledast",!0);F(j,ue,dt,"⋅","\\centerdot");F(j,ue,dt,"⊺","\\intercal",!0);F(j,ue,dt,"⋒","\\doublecap");F(j,ue,dt,"⋓","\\doublecup");F(j,ue,dt,"⊠","\\boxtimes",!0);F(j,ue,fe,"⇢","\\dashrightarrow",!0);F(j,ue,fe,"⇠","\\dashleftarrow",!0);F(j,ue,fe,"⇇","\\leftleftarrows",!0);F(j,ue,fe,"⇆","\\leftrightarrows",!0);F(j,ue,fe,"⇚","\\Lleftarrow",!0);F(j,ue,fe,"↞","\\twoheadleftarrow",!0);F(j,ue,fe,"↢","\\leftarrowtail",!0);F(j,ue,fe,"↫","\\looparrowleft",!0);F(j,ue,fe,"⇋","\\leftrightharpoons",!0);F(j,ue,fe,"↶","\\curvearrowleft",!0);F(j,ue,fe,"↺","\\circlearrowleft",!0);F(j,ue,fe,"↰","\\Lsh",!0);F(j,ue,fe,"⇈","\\upuparrows",!0);F(j,ue,fe,"↿","\\upharpoonleft",!0);F(j,ue,fe,"⇃","\\downharpoonleft",!0);F(j,K,fe,"⊶","\\origof",!0);F(j,K,fe,"⊷","\\imageof",!0);F(j,ue,fe,"⊸","\\multimap",!0);F(j,ue,fe,"↭","\\leftrightsquigarrow",!0);F(j,ue,fe,"⇉","\\rightrightarrows",!0);F(j,ue,fe,"⇄","\\rightleftarrows",!0);F(j,ue,fe,"↠","\\twoheadrightarrow",!0);F(j,ue,fe,"↣","\\rightarrowtail",!0);F(j,ue,fe,"↬","\\looparrowright",!0);F(j,ue,fe,"↷","\\curvearrowright",!0);F(j,ue,fe,"↻","\\circlearrowright",!0);F(j,ue,fe,"↱","\\Rsh",!0);F(j,ue,fe,"⇊","\\downdownarrows",!0);F(j,ue,fe,"↾","\\upharpoonright",!0);F(j,ue,fe,"⇂","\\downharpoonright",!0);F(j,ue,fe,"⇝","\\rightsquigarrow",!0);F(j,ue,fe,"⇝","\\leadsto");F(j,ue,fe,"⇛","\\Rrightarrow",!0);F(j,ue,fe,"↾","\\restriction");F(j,K,me,"‘","`");F(j,K,me,"$","\\$");F(qe,K,me,"$","\\$");F(qe,K,me,"$","\\textdollar");F(j,K,me,"%","\\%");F(qe,K,me,"%","\\%");F(j,K,me,"_","\\_");F(qe,K,me,"_","\\_");F(qe,K,me,"_","\\textunderscore");F(j,K,me,"∠","\\angle",!0);F(j,K,me,"∞","\\infty",!0);F(j,K,me,"′","\\prime");F(j,K,me,"△","\\triangle");F(j,K,me,"Γ","\\Gamma",!0);F(j,K,me,"Δ","\\Delta",!0);F(j,K,me,"Θ","\\Theta",!0);F(j,K,me,"Λ","\\Lambda",!0);F(j,K,me,"Ξ","\\Xi",!0);F(j,K,me,"Π","\\Pi",!0);F(j,K,me,"Σ","\\Sigma",!0);F(j,K,me,"Υ","\\Upsilon",!0);F(j,K,me,"Φ","\\Phi",!0);F(j,K,me,"Ψ","\\Psi",!0);F(j,K,me,"Ω","\\Omega",!0);F(j,K,me,"A","Α");F(j,K,me,"B","Β");F(j,K,me,"E","Ε");F(j,K,me,"Z","Ζ");F(j,K,me,"H","Η");F(j,K,me,"I","Ι");F(j,K,me,"K","Κ");F(j,K,me,"M","Μ");F(j,K,me,"N","Ν");F(j,K,me,"O","Ο");F(j,K,me,"P","Ρ");F(j,K,me,"T","Τ");F(j,K,me,"X","Χ");F(j,K,me,"¬","\\neg",!0);F(j,K,me,"¬","\\lnot");F(j,K,me,"⊤","\\top");F(j,K,me,"⊥","\\bot");F(j,K,me,"∅","\\emptyset");F(j,ue,me,"∅","\\varnothing");F(j,K,Tt,"α","\\alpha",!0);F(j,K,Tt,"β","\\beta",!0);F(j,K,Tt,"γ","\\gamma",!0);F(j,K,Tt,"δ","\\delta",!0);F(j,K,Tt,"ϵ","\\epsilon",!0);F(j,K,Tt,"ζ","\\zeta",!0);F(j,K,Tt,"η","\\eta",!0);F(j,K,Tt,"θ","\\theta",!0);F(j,K,Tt,"ι","\\iota",!0);F(j,K,Tt,"κ","\\kappa",!0);F(j,K,Tt,"λ","\\lambda",!0);F(j,K,Tt,"μ","\\mu",!0);F(j,K,Tt,"ν","\\nu",!0);F(j,K,Tt,"ξ","\\xi",!0);F(j,K,Tt,"ο","\\omicron",!0);F(j,K,Tt,"π","\\pi",!0);F(j,K,Tt,"ρ","\\rho",!0);F(j,K,Tt,"σ","\\sigma",!0);F(j,K,Tt,"τ","\\tau",!0);F(j,K,Tt,"υ","\\upsilon",!0);F(j,K,Tt,"ϕ","\\phi",!0);F(j,K,Tt,"χ","\\chi",!0);F(j,K,Tt,"ψ","\\psi",!0);F(j,K,Tt,"ω","\\omega",!0);F(j,K,Tt,"ε","\\varepsilon",!0);F(j,K,Tt,"ϑ","\\vartheta",!0);F(j,K,Tt,"ϖ","\\varpi",!0);F(j,K,Tt,"ϱ","\\varrho",!0);F(j,K,Tt,"ς","\\varsigma",!0);F(j,K,Tt,"φ","\\varphi",!0);F(j,K,dt,"∗","*",!0);F(j,K,dt,"+","+");F(j,K,dt,"−","-",!0);F(j,K,dt,"⋅","\\cdot",!0);F(j,K,dt,"∘","\\circ",!0);F(j,K,dt,"÷","\\div",!0);F(j,K,dt,"±","\\pm",!0);F(j,K,dt,"×","\\times",!0);F(j,K,dt,"∩","\\cap",!0);F(j,K,dt,"∪","\\cup",!0);F(j,K,dt,"∖","\\setminus",!0);F(j,K,dt,"∧","\\land");F(j,K,dt,"∨","\\lor");F(j,K,dt,"∧","\\wedge",!0);F(j,K,dt,"∨","\\vee",!0);F(j,K,me,"√","\\surd");F(j,K,Wi,"⟨","\\langle",!0);F(j,K,Wi,"∣","\\lvert");F(j,K,Wi,"∥","\\lVert");F(j,K,pi,"?","?");F(j,K,pi,"!","!");F(j,K,pi,"⟩","\\rangle",!0);F(j,K,pi,"∣","\\rvert");F(j,K,pi,"∥","\\rVert");F(j,K,fe,"=","=");F(j,K,fe,":",":");F(j,K,fe,"≈","\\approx",!0);F(j,K,fe,"≅","\\cong",!0);F(j,K,fe,"≥","\\ge");F(j,K,fe,"≥","\\geq",!0);F(j,K,fe,"←","\\gets");F(j,K,fe,">","\\gt",!0);F(j,K,fe,"∈","\\in",!0);F(j,K,fe,"","\\@not");F(j,K,fe,"⊂","\\subset",!0);F(j,K,fe,"⊃","\\supset",!0);F(j,K,fe,"⊆","\\subseteq",!0);F(j,K,fe,"⊇","\\supseteq",!0);F(j,ue,fe,"⊈","\\nsubseteq",!0);F(j,ue,fe,"⊉","\\nsupseteq",!0);F(j,K,fe,"⊨","\\models");F(j,K,fe,"←","\\leftarrow",!0);F(j,K,fe,"≤","\\le");F(j,K,fe,"≤","\\leq",!0);F(j,K,fe,"<","\\lt",!0);F(j,K,fe,"→","\\rightarrow",!0);F(j,K,fe,"→","\\to");F(j,ue,fe,"≱","\\ngeq",!0);F(j,ue,fe,"≰","\\nleq",!0);F(j,K,Js," ","\\ ");F(j,K,Js," ","\\space");F(j,K,Js," ","\\nobreakspace");F(qe,K,Js," ","\\ ");F(qe,K,Js," "," ");F(qe,K,Js," ","\\space");F(qe,K,Js," ","\\nobreakspace");F(j,K,Js,null,"\\nobreak");F(j,K,Js,null,"\\allowbreak");F(j,K,Ud,",",",");F(j,K,Ud,";",";");F(j,ue,dt,"⊼","\\barwedge",!0);F(j,ue,dt,"⊻","\\veebar",!0);F(j,K,dt,"⊙","\\odot",!0);F(j,K,dt,"⊕","\\oplus",!0);F(j,K,dt,"⊗","\\otimes",!0);F(j,K,me,"∂","\\partial",!0);F(j,K,dt,"⊘","\\oslash",!0);F(j,ue,dt,"⊚","\\circledcirc",!0);F(j,ue,dt,"⊡","\\boxdot",!0);F(j,K,dt,"△","\\bigtriangleup");F(j,K,dt,"▽","\\bigtriangledown");F(j,K,dt,"†","\\dagger");F(j,K,dt,"⋄","\\diamond");F(j,K,dt,"⋆","\\star");F(j,K,dt,"◃","\\triangleleft");F(j,K,dt,"▹","\\triangleright");F(j,K,Wi,"{","\\{");F(qe,K,me,"{","\\{");F(qe,K,me,"{","\\textbraceleft");F(j,K,pi,"}","\\}");F(qe,K,me,"}","\\}");F(qe,K,me,"}","\\textbraceright");F(j,K,Wi,"{","\\lbrace");F(j,K,pi,"}","\\rbrace");F(j,K,Wi,"[","\\lbrack",!0);F(qe,K,me,"[","\\lbrack",!0);F(j,K,pi,"]","\\rbrack",!0);F(qe,K,me,"]","\\rbrack",!0);F(j,K,Wi,"(","\\lparen",!0);F(j,K,pi,")","\\rparen",!0);F(qe,K,me,"<","\\textless",!0);F(qe,K,me,">","\\textgreater",!0);F(j,K,Wi,"⌊","\\lfloor",!0);F(j,K,pi,"⌋","\\rfloor",!0);F(j,K,Wi,"⌈","\\lceil",!0);F(j,K,pi,"⌉","\\rceil",!0);F(j,K,me,"\\","\\backslash");F(j,K,me,"∣","|");F(j,K,me,"∣","\\vert");F(qe,K,me,"|","\\textbar",!0);F(j,K,me,"∥","\\|");F(j,K,me,"∥","\\Vert");F(qe,K,me,"∥","\\textbardbl");F(qe,K,me,"~","\\textasciitilde");F(qe,K,me,"\\","\\textbackslash");F(qe,K,me,"^","\\textasciicircum");F(j,K,fe,"↑","\\uparrow",!0);F(j,K,fe,"⇑","\\Uparrow",!0);F(j,K,fe,"↓","\\downarrow",!0);F(j,K,fe,"⇓","\\Downarrow",!0);F(j,K,fe,"↕","\\updownarrow",!0);F(j,K,fe,"⇕","\\Updownarrow",!0);F(j,K,Tn,"∐","\\coprod");F(j,K,Tn,"⋁","\\bigvee");F(j,K,Tn,"⋀","\\bigwedge");F(j,K,Tn,"⨄","\\biguplus");F(j,K,Tn,"⋂","\\bigcap");F(j,K,Tn,"⋃","\\bigcup");F(j,K,Tn,"∫","\\int");F(j,K,Tn,"∫","\\intop");F(j,K,Tn,"∬","\\iint");F(j,K,Tn,"∭","\\iiint");F(j,K,Tn,"∏","\\prod");F(j,K,Tn,"∑","\\sum");F(j,K,Tn,"⨂","\\bigotimes");F(j,K,Tn,"⨁","\\bigoplus");F(j,K,Tn,"⨀","\\bigodot");F(j,K,Tn,"∮","\\oint");F(j,K,Tn,"∯","\\oiint");F(j,K,Tn,"∰","\\oiiint");F(j,K,Tn,"⨆","\\bigsqcup");F(j,K,Tn,"∫","\\smallint");F(qe,K,dh,"…","\\textellipsis");F(j,K,dh,"…","\\mathellipsis");F(qe,K,dh,"…","\\ldots",!0);F(j,K,dh,"…","\\ldots",!0);F(j,K,dh,"⋯","\\@cdots",!0);F(j,K,dh,"⋱","\\ddots",!0);F(j,K,me,"⋮","\\varvdots");F(qe,K,me,"⋮","\\varvdots");F(j,K,Xr,"ˊ","\\acute");F(j,K,Xr,"ˋ","\\grave");F(j,K,Xr,"¨","\\ddot");F(j,K,Xr,"~","\\tilde");F(j,K,Xr,"ˉ","\\bar");F(j,K,Xr,"˘","\\breve");F(j,K,Xr,"ˇ","\\check");F(j,K,Xr,"^","\\hat");F(j,K,Xr,"⃗","\\vec");F(j,K,Xr,"˙","\\dot");F(j,K,Xr,"˚","\\mathring");F(j,K,Tt,"","\\@imath");F(j,K,Tt,"","\\@jmath");F(j,K,me,"ı","ı");F(j,K,me,"ȷ","ȷ");F(qe,K,me,"ı","\\i",!0);F(qe,K,me,"ȷ","\\j",!0);F(qe,K,me,"ß","\\ss",!0);F(qe,K,me,"æ","\\ae",!0);F(qe,K,me,"œ","\\oe",!0);F(qe,K,me,"ø","\\o",!0);F(qe,K,me,"Æ","\\AE",!0);F(qe,K,me,"Œ","\\OE",!0);F(qe,K,me,"Ø","\\O",!0);F(qe,K,Xr,"ˊ","\\'");F(qe,K,Xr,"ˋ","\\`");F(qe,K,Xr,"ˆ","\\^");F(qe,K,Xr,"˜","\\~");F(qe,K,Xr,"ˉ","\\=");F(qe,K,Xr,"˘","\\u");F(qe,K,Xr,"˙","\\.");F(qe,K,Xr,"¸","\\c");F(qe,K,Xr,"˚","\\r");F(qe,K,Xr,"ˇ","\\v");F(qe,K,Xr,"¨",'\\"');F(qe,K,Xr,"˝","\\H");F(qe,K,Xr,"◯","\\textcircled");var NI={"--":!0,"---":!0,"``":!0,"''":!0};F(qe,K,me,"–","--",!0);F(qe,K,me,"–","\\textendash");F(qe,K,me,"—","---",!0);F(qe,K,me,"—","\\textemdash");F(qe,K,me,"‘","`",!0);F(qe,K,me,"‘","\\textquoteleft");F(qe,K,me,"’","'",!0);F(qe,K,me,"’","\\textquoteright");F(qe,K,me,"“","``",!0);F(qe,K,me,"“","\\textquotedblleft");F(qe,K,me,"”","''",!0);F(qe,K,me,"”","\\textquotedblright");F(j,K,me,"°","\\degree",!0);F(qe,K,me,"°","\\degree");F(qe,K,me,"°","\\textdegree",!0);F(j,K,me,"£","\\pounds");F(j,K,me,"£","\\mathsterling",!0);F(qe,K,me,"£","\\pounds");F(qe,K,me,"£","\\textsterling",!0);F(j,ue,me,"✠","\\maltese");F(qe,ue,me,"✠","\\maltese");var PM='0123456789/@."';for(var Dx=0;Dx{var t=r.charCodeAt(0),n=r.charCodeAt(1),i=(t-55296)*1024+(n-56320)+65536,a=e==="math"?0:1;if(119808<=i&&i<120484){var s=Math.floor((i-119808)/26);return[Yv[s][2],Yv[s][a]]}else if(120782<=i&&i<=120831){var o=Math.floor((i-120782)/10);return[kM[o][2],kM[o][a]]}else{if(i===120485||i===120486)return[Yv[0][2],Yv[0][a]];if(1204860)return ci(a,c,i,t,s.concat(h));if(l){var d,v;if(l==="boldsymbol"){var g=wae(a,i,t,s,n);d=g.fontName,v=[g.fontClass]}else o?(d=M_[l].fontName,v=[l]):(d=Wv(l,t.fontWeight,t.fontShape),v=[l,t.fontWeight,t.fontShape]);if(Fg(a,d,i).metrics)return ci(a,d,i,t,s.concat(v));if(NI.hasOwnProperty(a)&&d.slice(0,10)==="Typewriter"){for(var m=[],x=0;x{if(al(r.classes)!==al(e.classes)||r.skew!==e.skew||r.maxFontSize!==e.maxFontSize||r.italic!==0&&r.hasClass("mathnormal"))return!1;if(r.classes.length===1){var t=r.classes[0];if(t==="mbin"||t==="mord")return!1}for(var n of Object.keys(r.style))if(r.style[n]!==e.style[n])return!1;for(var i of Object.keys(e.style))if(r.style[i]!==e.style[i])return!1;return!0},LI=r=>{for(var e=0;et&&(t=s.height),s.depth>n&&(n=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=i},Xe=function(e,t,n,i){var a=new fh(e,t,n,i);return z3(a),a},ol=(r,e,t,n)=>new fh(r,e,t,n),Yc=function(e,t,n){var i=Xe([e],[],t);return i.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),i.style.borderBottomWidth=it(i.height),i.maxFontSize=1,i},Eae=function(e,t,n,i){var a=new Bg(e,t,n,i);return z3(a),a},eo=function(e){var t=new hh(e);return z3(t),t},Wc=function(e,t){return e instanceof hh?Xe([],[e],t):e},Tae=function(e){if(e.positionType==="individualShift"){for(var t=e.children,n=[t[0]],i=-t[0].shift-t[0].elem.depth,a=i,s=1;s{var t=Xe(["mspace"],[],e),n=Zr(r,e);return t.style.marginRight=it(n),t},Wv=function(e,t,n){var i="";switch(e){case"amsrm":i="AMS";break;case"textrm":i="Main";break;case"textsf":i="SansSerif";break;case"texttt":i="Typewriter";break;default:i=e}var a;return t==="textbf"&&n==="textit"?a="BoldItalic":t==="textbf"?a="Bold":t==="textit"?a="Italic":a="Regular",i+"-"+a},M_={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},BI={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},FI=function(e,t){var[n,i,a]=BI[e],s=new sl(n),o=new qs([s],{width:it(i),height:it(a),style:"width:"+it(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),l=ol(["overlay"],[o],t);return l.height=a,l.style.height=it(a),l.style.width=it(i),l},$r={number:3,unit:"mu"},Xl={number:4,unit:"mu"},Ns={number:5,unit:"mu"},Cae={mord:{mop:$r,mbin:Xl,mrel:Ns,minner:$r},mop:{mord:$r,mop:$r,mrel:Ns,minner:$r},mbin:{mord:Xl,mop:Xl,mopen:Xl,minner:Xl},mrel:{mord:Ns,mop:Ns,mopen:Ns,minner:Ns},mopen:{},mclose:{mop:$r,mbin:Xl,mrel:Ns,minner:$r},mpunct:{mord:$r,mop:$r,mrel:Ns,mopen:$r,mclose:$r,mpunct:$r,minner:$r},minner:{mord:$r,mop:$r,mbin:Xl,mrel:Ns,mopen:$r,mpunct:$r,minner:$r}},Aae={mord:{mop:$r},mop:{mord:$r,mop:$r},mbin:{},mrel:{},mopen:{},mclose:{mop:$r},mpunct:{},minner:{mop:$r}},zI={},Kp={},Zp={};function ft(r){for(var{type:e,names:t,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=r,o={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},l=0;l{var y=x.classes[0],_=m.classes[0];y==="mbin"&&Rae.has(_)?x.classes[0]="mord":_==="mbin"&&Mae.has(y)&&(m.classes[0]="mord")},{node:d},v,g),R_(a,(m,x)=>{var y,_,w=D_(x),S=D_(m),A=w&&S?m.hasClass("mtight")?(y=Aae[w])==null?void 0:y[S]:(_=Cae[w])==null?void 0:_[S]:null;if(A)return kI(A,c)},{node:d},v,g),a},R_=function(e,t,n,i,a){i&&e.push(i);for(var s=0;sv=>{e.splice(d+1,0,v),s++})(s)}i&&e.pop()},UI=function(e){return e instanceof hh||e instanceof Bg||e instanceof fh&&e.hasClass("enclosing")?e:null},O_=function(e,t){var n=UI(e);if(n){var i=n.children;if(i.length){if(t==="right")return O_(i[i.length-1],"right");if(t==="left")return O_(i[0],"left")}}return e},D_=function(e,t){if(!e)return null;t&&(e=O_(e,t));var n=e.classes[0];return Dae[n]||null},Sd=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Xe(t.concat(n))},or=function(e,t,n){if(!e)return Xe();if(Kp[e.type]){var i=Kp[e.type](e,t);if(n&&t.size!==n.size){i=Xe(t.sizingClasses(n),[i],t);var a=t.sizeMultiplier/n.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new Qe("Got group of unknown type: '"+e.type+"'")};function $v(r,e){var t=Xe(["base"],r,e),n=Xe(["strut"]);return n.style.height=it(t.height+t.depth),t.depth&&(n.style.verticalAlign=it(-t.depth)),t.children.unshift(n),t}function P_(r,e){var t=null;r.length===1&&r[0].type==="tag"&&(t=r[0].tag,r=r[0].body);var n=Dn(r,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var a=[],s=[],o=0;o0&&(a.push($v(s,e)),s=[]),a.push(n[o]));s.length>0&&a.push($v(s,e));var c;t?(c=$v(Dn(t,e,!0),e),c.classes=["tag"],a.push(c)):i&&a.push(i);var h=Xe(["katex-html"],a);if(h.setAttribute("aria-hidden","true"),c){var d=c.children[0];d.style.height=it(h.height+h.depth),h.depth&&(d.style.verticalAlign=it(-h.depth))}return h}function GI(r){return new hh(r)}class et{constructor(e,t,n){this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=al(this.classes));for(var n=0;n0&&(e+=' class ="'+ti(al(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map(e=>e.toText()).join("")}}class En{constructor(e){this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return ti(this.toText())}toText(){return this.text}}class HI{constructor(e){this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character="  ":e>=-.05556&&e<=-.05555?this.character=" ⁣":e>=-.1667&&e<=-.1666?this.character=" ⁣":e>=-.2223&&e<=-.2222?this.character=" ⁣":e>=-.2778&&e<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",it(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var Pae=new Set(["\\imath","\\jmath"]),Iae=new Set(["mrow","mtable"]),wa=function(e,t,n){return Vr[t][e]&&Vr[t][e].replace&&e.charCodeAt(0)!==55349&&!(NI.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=Vr[t][e].replace),new En(e)},U3=function(e){return e.length===1?e[0]:new et("mrow",e)},G3=function(e,t){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold";var n=t.font;if(!n||n==="mathnormal")return null;var i=e.mode;if(n==="mathit")return"italic";if(n==="boldsymbol")return e.type==="textord"?"bold":"bold-italic";if(n==="mathbf")return"bold";if(n==="mathbb")return"double-struck";if(n==="mathsfit")return"sans-serif-italic";if(n==="mathfrak")return"fraktur";if(n==="mathscr"||n==="mathcal")return"script";if(n==="mathsf")return"sans-serif";if(n==="mathtt")return"monospace";var a=e.text;if(Pae.has(a))return null;if(Vr[i][a]){var s=Vr[i][a].replace;s&&(a=s)}var o=M_[n].fontName;return B3(a,o,i)?M_[n].variant:null};function Lx(r){if(!r)return!1;if(r.type==="mi"&&r.children.length===1){var e=r.children[0];return e instanceof En&&e.text==="."}else if(r.type==="mo"&&r.children.length===1&&r.getAttribute("separator")==="true"&&r.getAttribute("lspace")==="0em"&&r.getAttribute("rspace")==="0em"){var t=r.children[0];return t instanceof En&&t.text===","}else return!1}var $i=function(e,t,n){if(e.length===1){var i=Mr(e[0],t);return n&&i instanceof et&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],s,o=0;o=1&&(s.type==="mn"||Lx(s))){var c=l.children[0];c instanceof et&&c.type==="mn"&&(c.children=[...s.children,...c.children],a.pop())}else if(s.type==="mi"&&s.children.length===1){var h=s.children[0];if(h instanceof En&&h.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof En&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),a.pop())}}}a.push(l),s=l}return a},ll=function(e,t,n){return U3($i(e,t,n))},Mr=function(e,t){if(!e)return new et("mrow");if(Zp[e.type]){var n=Zp[e.type](e,t);return n}else throw new Qe("Got group of unknown type: '"+e.type+"'")};function BM(r,e,t,n,i){var a=$i(r,t),s;a.length===1&&a[0]instanceof et&&Iae.has(a[0].type)?s=a[0]:s=new et("mrow",a);var o=new et("annotation",[new En(e)]);o.setAttribute("encoding","application/x-tex");var l=new et("semantics",[s,o]),c=new et("math",[l]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&c.setAttribute("display","block");var h=i?"katex":"katex-mathml";return Xe([h],[c])}var Nae=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],FM=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],zM=function(e,t){return t.size<2?e:Nae[e-1][t.size-1]};class Bs{constructor(e){this.style=e.style,this.color=e.color,this.size=e.size||Bs.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=FM[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(t,e),new Bs(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:zM(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:FM[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=zM(Bs.BASESIZE,e);return this.size===t&&this.textSize===Bs.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Bs.BASESIZE?["sizing","reset-size"+this.size,"size"+Bs.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=yae(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Bs.BASESIZE=6;var jI=function(e){return new Bs({style:e.displayMode?Dt.DISPLAY:Dt.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},VI=function(e,t){if(t.displayMode){var n=["katex-display"];t.leqno&&n.push("leqno"),t.fleqn&&n.push("fleqn"),e=Xe(n,[e])}return e},Lae=function(e,t,n){var i=jI(n),a;if(n.output==="mathml")return BM(e,t,i,n.displayMode,!0);if(n.output==="html"){var s=P_(e,i);a=Xe(["katex"],[s])}else{var o=BM(e,t,i,n.displayMode,!1),l=P_(e,i);a=Xe(["katex"],[o,l])}return VI(a,n)},kae=function(e,t,n){var i=jI(n),a=P_(e,i),s=Xe(["katex"],[a]);return VI(s,n)},Bae={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},Ug=function(e){var t=new et("mo",[new En(Bae[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},Fae={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"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,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"],"\\cdlongequal":[["longequal"],3,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],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["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],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},zae=new Set(["widehat","widecheck","widetilde","utilde"]),Gg=function(e,t){function n(){var o=4e5,l=e.label.slice(1);if(zae.has(l)){var c=e,h=c.base.type==="ordgroup"?c.base.body.length:1,d,v,g;if(h>5)l==="widehat"||l==="widecheck"?(d=420,o=2364,g=.42,v=l+"4"):(d=312,o=2340,g=.34,v="tilde4");else{var m=[1,1,2,2,3,3][h];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][m],d=[0,239,300,360,420][m],g=[0,.24,.3,.3,.36,.42][m],v=l+m):(o=[0,600,1033,2339,2340][m],d=[0,260,286,306,312][m],g=[0,.26,.286,.3,.306,.34][m],v="tilde"+m)}var x=new sl(v),y=new qs([x],{width:"100%",height:it(g),viewBox:"0 0 "+o+" "+d,preserveAspectRatio:"none"});return{span:ol([],[y],t),minWidth:0,height:g}}else{var _=[],w=Fae[l],[S,A,C]=w,M=C/1e3,E=S.length,O,D;if(E===1){var I=w[3];O=["hide-tail"],D=[I]}else if(E===2)O=["halfarrow-left","halfarrow-right"],D=["xMinYMin","xMaxYMin"];else if(E===3)O=["brace-left","brace-center","brace-right"],D=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support `+E+" children.");for(var k=0;k0&&(i.style.minWidth=it(a)),i},Uae=function(e,t,n,i,a){var s,o=e.height+e.depth+n+i;if(/fbox|color|angl/.test(t)){if(s=Xe(["stretchy",t],[],a),t==="fbox"){var l=a.color&&a.getColor();l&&(s.style.borderColor=l)}}else{var c=[];/^[bx]cancel$/.test(t)&&c.push(new C_({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&c.push(new C_({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new qs(c,{width:"100%",height:it(o)});s=ol([],[h],a)}return s.height=o,s.style.height=it(o),s};function Ft(r,e){if(!r||r.type!==e)throw new Error("Expected node of type "+e+", but got "+(r?"node of type "+r.type:String(r)));return r}function Hg(r){var e=jg(r);if(!e)throw new Error("Expected node of symbol group type, but got "+(r?"node of type "+r.type:String(r)));return e}function jg(r){return r&&(r.type==="atom"||xae.hasOwnProperty(r.type))?r:null}var qI=r=>{if(r instanceof Yi)return r;if(gae(r)&&r.children.length===1)return qI(r.children[0])},H3=(r,e)=>{var t,n,i;r&&r.type==="supsub"?(n=Ft(r.base,"accent"),t=n.base,r.base=t,i=pae(or(r,e)),r.base=n):(n=Ft(r,"accent"),t=n.base);var a=or(t,e.havingCrampedStyle()),s=n.isShifty&&Qs(t),o=0;if(s){var l,c;o=(l=(c=qI(a))==null?void 0:c.skew)!=null?l:0}var h=n.label==="\\c",d=h?a.height+a.depth:Math.min(a.height,e.fontMetrics().xHeight),v;if(n.isStretchy)v=Gg(n,e),v=sr({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:v,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+it(2*o)+")",marginLeft:it(2*o)}:void 0}]});else{var g,m;n.label==="\\vec"?(g=FI("vec",e),m=BI.vec[1]):(g=zg({mode:n.mode,text:n.label},e,"textord"),g=vae(g),g.italic=0,m=g.width,h&&(d+=g.depth)),v=Xe(["accent-body"],[g]);var x=n.label==="\\textcircled";x&&(v.classes.push("accent-full"),d=a.height);var y=o;x||(y-=m/2),v.style.left=it(y),n.label==="\\textcircled"&&(v.style.top=".2em"),v=sr({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-d},{type:"elem",elem:v}]})}var _=Xe(["mord","accent"],[v],e);return i?(i.children[0]=_,i.height=Math.max(_.height,i.height),i.classes[0]="mord",i):_},XI=(r,e)=>{var t=r.isStretchy?Ug(r.label):new et("mo",[wa(r.label,r.mode)]),n=new et("mover",[Mr(r.base,e),t]);return n.setAttribute("accent","true"),n},Gae=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(r=>"\\"+r).join("|"));ft({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(r,e)=>{var t=Qp(e[0]),n=!Gae.test(r.funcName),i=!n||r.funcName==="\\widehat"||r.funcName==="\\widetilde"||r.funcName==="\\widecheck";return{type:"accent",mode:r.parser.mode,label:r.funcName,isStretchy:n,isShifty:i,base:t}},htmlBuilder:H3,mathmlBuilder:XI});ft({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(r,e)=>{var t=e[0],n=r.parser.mode;return n==="math"&&(r.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+r.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:r.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:H3,mathmlBuilder:XI});ft({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0];return{type:"accentUnder",mode:t.mode,label:n,base:i}},htmlBuilder:(r,e)=>{var t=or(r.base,e),n=Gg(r,e),i=r.label==="\\utilde"?.12:0,a=sr({positionType:"top",positionData:t.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:t}]});return Xe(["mord","accentunder"],[a],e)},mathmlBuilder:(r,e)=>{var t=Ug(r.label),n=new et("munder",[Mr(r.base,e),t]);return n.setAttribute("accentunder","true"),n}});var Kv=r=>{var e=new et("mpadded",r?[r]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};ft({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(r,e,t){var{parser:n,funcName:i}=r;return{type:"xArrow",mode:n.mode,label:i,body:e[0],below:t[0]}},htmlBuilder(r,e){var t=e.style,n=e.havingStyle(t.sup()),i=Wc(or(r.body,n,e),e),a=r.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(a+"-arrow-pad");var s;r.below&&(n=e.havingStyle(t.sub()),s=Wc(or(r.below,n,e),e),s.classes.push(a+"-arrow-pad"));var o=Gg(r,e),l=-e.fontMetrics().axisHeight+.5*o.height,c=-e.fontMetrics().axisHeight-.5*o.height-.111;(i.depth>.25||r.label==="\\xleftequilibrium")&&(c-=i.depth);var h;if(s){var d=-e.fontMetrics().axisHeight+s.height+.5*o.height+.111;h=sr({positionType:"individualShift",children:[{type:"elem",elem:i,shift:c},{type:"elem",elem:o,shift:l},{type:"elem",elem:s,shift:d}]})}else h=sr({positionType:"individualShift",children:[{type:"elem",elem:i,shift:c},{type:"elem",elem:o,shift:l}]});return h.children[0].children[0].children[1].classes.push("svg-align"),Xe(["mrel","x-arrow"],[h],e)},mathmlBuilder(r,e){var t=Ug(r.label);t.setAttribute("minsize",r.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(r.body){var i=Kv(Mr(r.body,e));if(r.below){var a=Kv(Mr(r.below,e));n=new et("munderover",[t,a,i])}else n=new et("mover",[t,i])}else if(r.below){var s=Kv(Mr(r.below,e));n=new et("munder",[t,s])}else n=Kv(),n=new et("mover",[t,n]);return n}});function YI(r,e){var t=Dn(r.body,e,!0);return Xe([r.mclass],t,e)}function WI(r,e){var t,n=$i(r.body,e);return r.mclass==="minner"?t=new et("mpadded",n):r.mclass==="mord"?r.isCharacterBox?(t=n[0],t.type="mi"):t=new et("mi",n):(r.isCharacterBox?(t=n[0],t.type="mo"):t=new et("mo",n),r.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):r.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):r.mclass==="mopen"||r.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):r.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}ft({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];return{type:"mclass",mode:t.mode,mclass:"m"+n.slice(5),body:Sn(i),isCharacterBox:Qs(i)}},htmlBuilder:YI,mathmlBuilder:WI});var Vg=r=>{var e=r.type==="ordgroup"&&r.body.length?r.body[0]:r;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};ft({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(r,e){var{parser:t}=r;return{type:"mclass",mode:t.mode,mclass:Vg(e[0]),body:Sn(e[1]),isCharacterBox:Qs(e[1])}}});ft({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(r,e){var{parser:t,funcName:n}=r,i=e[1],a=e[0],s;n!=="\\stackrel"?s=Vg(i):s="mrel";var o={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:Sn(i)},l={type:"supsub",mode:a.mode,base:o,sup:n==="\\underset"?null:a,sub:n==="\\underset"?a:null};return{type:"mclass",mode:t.mode,mclass:s,body:[l],isCharacterBox:Qs(l)}},htmlBuilder:YI,mathmlBuilder:WI});ft({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"pmb",mode:t.mode,mclass:Vg(e[0]),body:Sn(e[0])}},htmlBuilder(r,e){var t=Dn(r.body,e,!0),n=Xe([r.mclass],t,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(r,e){var t=$i(r.body,e),n=new et("mstyle",t);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var Hae={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},UM=()=>({type:"styling",body:[],mode:"math",style:"display"}),GM=r=>r.type==="textord"&&r.text==="@",jae=(r,e)=>(r.type==="mathord"||r.type==="atom")&&r.text===e;function Vae(r,e,t){var n=Hae[r];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=t.callFunction("\\\\cdleft",[e[0]],[]),a={type:"atom",text:n,mode:"math",family:"rel"},s=t.callFunction("\\Big",[a],[]),o=t.callFunction("\\\\cdright",[e[1]],[]),l={type:"ordgroup",mode:"math",body:[i,s,o]};return t.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var c={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[c],[])}default:return{type:"textord",text:" ",mode:"math"}}}function qae(r){var e=[];for(r.gullet.beginGroup(),r.gullet.macros.set("\\cr","\\\\\\relax"),r.gullet.beginGroup();;){e.push(r.parseExpression(!1,"\\\\")),r.gullet.endGroup(),r.gullet.beginGroup();var t=r.fetch().text;if(t==="&"||t==="\\\\")r.consume();else if(t==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new Qe("Expected \\\\ or \\cr or \\end",r.nextToken)}for(var n=[],i=[n],a=0;aAV".includes(c))for(var d=0;d<2;d++){for(var v=!0,g=l+1;gAV=|." after @',s[l]);var m=Vae(c,h,r),x={type:"styling",body:[m],mode:"math",style:"display"};n.push(x),o=UM()}a%2===0?n.push(o):n.shift(),n=[],i.push(n)}r.gullet.endGroup(),r.gullet.endGroup();var y=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:y,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}ft({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:n}=r;return{type:"cdlabel",mode:t.mode,side:n.slice(4),label:e[0]}},htmlBuilder(r,e){var t=e.havingStyle(e.style.sup()),n=Wc(or(r.label,t,e),e);return n.classes.push("cd-label-"+r.side),n.style.bottom=it(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(r,e){var t=new et("mrow",[Mr(r.label,e)]);return t=new et("mpadded",[t]),t.setAttribute("width","0"),r.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new et("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}});ft({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(r,e){var{parser:t}=r;return{type:"cdlabelparent",mode:t.mode,fragment:e[0]}},htmlBuilder(r,e){var t=Wc(or(r.fragment,e),e);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(r,e){return new et("mrow",[Mr(r.fragment,e)])}});ft({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(r,e){for(var{parser:t}=r,n=Ft(e[0],"ordgroup"),i=n.body,a="",s=0;s=1114111)throw new Qe("\\@char with invalid code point "+a);return l<=65535?c=String.fromCharCode(l):(l-=65536,c=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:t.mode,text:c}}});var $I=(r,e)=>{var t=Dn(r.body,e.withColor(r.color),!1);return eo(t)},KI=(r,e)=>{var t=$i(r.body,e.withColor(r.color)),n=new et("mstyle",t);return n.setAttribute("mathcolor",r.color),n};ft({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(r,e){var{parser:t}=r,n=Ft(e[0],"color-token").color,i=e[1];return{type:"color",mode:t.mode,color:n,body:Sn(i)}},htmlBuilder:$I,mathmlBuilder:KI});ft({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(r,e){var{parser:t,breakOnTokenText:n}=r,i=Ft(e[0],"color-token").color;t.gullet.macros.set("\\current@color",i);var a=t.parseExpression(!0,n);return{type:"color",mode:t.mode,color:i,body:a}},htmlBuilder:$I,mathmlBuilder:KI});ft({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(r,e,t){var{parser:n}=r,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,a=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:a,size:i&&Ft(i,"size").value}},htmlBuilder(r,e){var t=Xe(["mspace"],[],e);return r.newLine&&(t.classes.push("newline"),r.size&&(t.style.marginTop=it(Zr(r.size,e)))),t},mathmlBuilder(r,e){var t=new et("mspace");return r.newLine&&(t.setAttribute("linebreak","newline"),r.size&&t.setAttribute("height",it(Zr(r.size,e)))),t}});var I_={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},ZI=r=>{var e=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new Qe("Expected a control sequence",r);return e},Xae=r=>{var e=r.gullet.popToken();return e.text==="="&&(e=r.gullet.popToken(),e.text===" "&&(e=r.gullet.popToken())),e},QI=(r,e,t,n)=>{var i=r.gullet.macros.get(t.text);i==null&&(t.noexpand=!0,i={tokens:[t],numArgs:0,unexpandable:!r.gullet.isExpandable(t.text)}),r.gullet.macros.set(e,i,n)};ft({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(r){var{parser:e,funcName:t}=r;e.consumeSpaces();var n=e.fetch();if(I_[n.text])return(t==="\\global"||t==="\\\\globallong")&&(n.text=I_[n.text]),Ft(e.parseFunction(),"internal");throw new Qe("Invalid token after macro prefix",n)}});ft({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new Qe("Expected a control sequence",n);for(var a=0,s,o=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){s=e.gullet.future(),o[a].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new Qe('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==a+1)throw new Qe('Argument number "'+n.text+'" out of order');a++,o.push([])}else{if(n.text==="EOF")throw new Qe("Expected a macro definition");o[a].push(n.text)}var{tokens:l}=e.gullet.consumeArg();return s&&l.unshift(s),(t==="\\edef"||t==="\\xdef")&&(l=e.gullet.expandTokens(l),l.reverse()),e.gullet.macros.set(i,{tokens:l,numArgs:a,delimiters:o},t===I_[t]),{type:"internal",mode:e.mode}}});ft({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,n=ZI(e.gullet.popToken());e.gullet.consumeSpaces();var i=Xae(e);return QI(e,n,i,t==="\\\\globallet"),{type:"internal",mode:e.mode}}});ft({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,n=ZI(e.gullet.popToken()),i=e.gullet.popToken(),a=e.gullet.popToken();return QI(e,n,a,t==="\\\\globalfuture"),e.gullet.pushToken(a),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var kf=function(e,t,n){var i=Vr.math[e]&&Vr.math[e].replace,a=B3(i||e,t,n);if(!a)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return a},j3=function(e,t,n,i){var a=n.havingBaseStyle(t),s=Xe(i.concat(a.sizingClasses(n)),[e],n),o=a.sizeMultiplier/n.sizeMultiplier;return s.height*=o,s.depth*=o,s.maxFontSize=a.sizeMultiplier,s},JI=function(e,t,n){var i=t.havingBaseStyle(n),a=(1-t.sizeMultiplier/i.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=it(a),e.height-=a,e.depth+=a},Yae=function(e,t,n,i,a,s){var o=ci(e,"Main-Regular",a,i),l=j3(o,t,i,s);return JI(l,i,t),l},Wae=function(e,t,n,i){return ci(e,"Size"+t+"-Regular",n,i)},eN=function(e,t,n,i,a,s){var o=Wae(e,t,a,i),l=j3(Xe(["delimsizing","size"+t],[o],i),Dt.TEXT,i,s);return n&&JI(l,i,Dt.TEXT),l},kx=function(e,t,n){var i;t==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=Xe(["delimsizinginner",i],[Xe([],[ci(e,t,n)])]);return{type:"elem",elem:a}},Bx=function(e,t,n){var i=ts["Size4-Regular"][e.charCodeAt(0)]?ts["Size4-Regular"][e.charCodeAt(0)][4]:ts["Size1-Regular"][e.charCodeAt(0)][4],a=new sl("inner",lae(e,Math.round(1e3*t))),s=new qs([a],{width:it(i),height:it(t),style:"width:"+it(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),o=ol([],[s],n);return o.height=t,o.style.height=it(t),o.style.width=it(i),{type:"elem",elem:o}},N_=.008,Zv={type:"kern",size:-1*N_},$ae=new Set(["|","\\lvert","\\rvert","\\vert"]),Kae=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),tN=function(e,t,n,i,a,s){var o,l,c,h,d="",v=0;o=c=h=e,l=null;var g="Size1-Regular";e==="\\uparrow"?c=h="⏐":e==="\\Uparrow"?c=h="‖":e==="\\downarrow"?o=c="⏐":e==="\\Downarrow"?o=c="‖":e==="\\updownarrow"?(o="\\uparrow",c="⏐",h="\\downarrow"):e==="\\Updownarrow"?(o="\\Uparrow",c="‖",h="\\Downarrow"):$ae.has(e)?(c="∣",d="vert",v=333):Kae.has(e)?(c="∥",d="doublevert",v=556):e==="["||e==="\\lbrack"?(o="⎡",c="⎢",h="⎣",g="Size4-Regular",d="lbrack",v=667):e==="]"||e==="\\rbrack"?(o="⎤",c="⎥",h="⎦",g="Size4-Regular",d="rbrack",v=667):e==="\\lfloor"||e==="⌊"?(c=o="⎢",h="⎣",g="Size4-Regular",d="lfloor",v=667):e==="\\lceil"||e==="⌈"?(o="⎡",c=h="⎢",g="Size4-Regular",d="lceil",v=667):e==="\\rfloor"||e==="⌋"?(c=o="⎥",h="⎦",g="Size4-Regular",d="rfloor",v=667):e==="\\rceil"||e==="⌉"?(o="⎤",c=h="⎥",g="Size4-Regular",d="rceil",v=667):e==="("||e==="\\lparen"?(o="⎛",c="⎜",h="⎝",g="Size4-Regular",d="lparen",v=875):e===")"||e==="\\rparen"?(o="⎞",c="⎟",h="⎠",g="Size4-Regular",d="rparen",v=875):e==="\\{"||e==="\\lbrace"?(o="⎧",l="⎨",h="⎩",c="⎪",g="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(o="⎫",l="⎬",h="⎭",c="⎪",g="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(o="⎧",h="⎩",c="⎪",g="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(o="⎫",h="⎭",c="⎪",g="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(o="⎧",h="⎭",c="⎪",g="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(o="⎫",h="⎩",c="⎪",g="Size4-Regular");var m=kf(o,g,a),x=m.height+m.depth,y=kf(c,g,a),_=y.height+y.depth,w=kf(h,g,a),S=w.height+w.depth,A=0,C=1;if(l!==null){var M=kf(l,g,a);A=M.height+M.depth,C=2}var E=x+S+A,O=Math.max(0,Math.ceil((t-E)/(C*_))),D=E+O*C*_,I=i.fontMetrics().axisHeight;n&&(I*=i.sizeMultiplier);var k=D/2-I,U=[];if(d.length>0){var V=D-x-S,X=Math.round(D*1e3),W=uae(d,Math.round(V*1e3)),P=new sl(d,W),H=it(v/1e3),z=it(X/1e3),$=new qs([P],{width:H,height:z,viewBox:"0 0 "+v+" "+X}),B=ol([],[$],i);B.height=X/1e3,B.style.width=H,B.style.height=z,U.push({type:"elem",elem:B})}else{if(U.push(kx(h,g,a)),U.push(Zv),l===null){var L=D-x-S+2*N_;U.push(Bx(c,L,i))}else{var Y=(D-x-S-A)/2+2*N_;U.push(Bx(c,Y,i)),U.push(Zv),U.push(kx(l,g,a)),U.push(Zv),U.push(Bx(c,Y,i))}U.push(Zv),U.push(kx(o,g,a))}var G=i.havingBaseStyle(Dt.TEXT),re=sr({positionType:"bottom",positionData:k,children:U});return j3(Xe(["delimsizing","mult"],[re],G),Dt.TEXT,i,s)},Fx=80,zx=.08,Ux=function(e,t,n,i,a){var s=oae(e,i,n),o=new sl(e,s),l=new qs([o],{width:"400em",height:it(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return ol(["hide-tail"],[l],a)},Zae=function(e,t){var n=t.havingBaseSizing(),i=sN("\\surd",e*n.sizeMultiplier,aN,n),a=n.sizeMultiplier,s=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,l=0,c=0,h=0,d;return i.type==="small"?(h=1e3+1e3*s+Fx,e<1?a=1:e<1.4&&(a=.7),l=(1+s+zx)/a,c=(1+s)/a,o=Ux("sqrtMain",l,h,s,t),o.style.minWidth="0.853em",d=.833/a):i.type==="large"?(h=(1e3+Fx)*qf[i.size],c=(qf[i.size]+s)/a,l=(qf[i.size]+s+zx)/a,o=Ux("sqrtSize"+i.size,l,h,s,t),o.style.minWidth="1.02em",d=1/a):(l=e+s+zx,c=e+s,h=Math.floor(1e3*e+s)+Fx,o=Ux("sqrtTall",l,h,s,t),o.style.minWidth="0.742em",d=1.056),o.height=c,o.style.height=it(l),{span:o,advanceWidth:d,ruleWidth:(t.fontMetrics().sqrtRuleThickness+s)*a}},rN=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),Qae=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),nN=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),qf=[0,1.2,1.8,2.4,3],iN=function(e,t,n,i,a){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),rN.has(e)||nN.has(e))return eN(e,t,!1,n,i,a);if(Qae.has(e))return tN(e,qf[t],!1,n,i,a);throw new Qe("Illegal delimiter: '"+e+"'")},Jae=[{type:"small",style:Dt.SCRIPTSCRIPT},{type:"small",style:Dt.SCRIPT},{type:"small",style:Dt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],ese=[{type:"small",style:Dt.SCRIPTSCRIPT},{type:"small",style:Dt.SCRIPT},{type:"small",style:Dt.TEXT},{type:"stack"}],aN=[{type:"small",style:Dt.SCRIPTSCRIPT},{type:"small",style:Dt.SCRIPT},{type:"small",style:Dt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],tse=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";var t=e.type;throw new Error("Add support for delim type '"+t+"' here.")},sN=function(e,t,n,i){for(var a=Math.min(2,3-i.style.size),s=a;st)return o}return n[n.length-1]},L_=function(e,t,n,i,a,s){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var o;nN.has(e)?o=Jae:rN.has(e)?o=aN:o=ese;var l=sN(e,t,o,i);return l.type==="small"?Yae(e,l.style,n,i,a,s):l.type==="large"?eN(e,l.size,n,i,a,s):tN(e,t,n,i,a,s)},Gx=function(e,t,n,i,a,s){var o=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,c=5/i.fontMetrics().ptPerEm,h=Math.max(t-o,n+o),d=Math.max(h/500*l,2*h-c);return L_(e,d,!0,i,a,s)},HM={"\\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}},rse=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function qg(r,e){var t=jg(r);if(t&&rse.has(t.text))return t;throw t?new Qe("Invalid delimiter '"+t.text+"' after '"+e.funcName+"'",r):new Qe("Invalid delimiter type '"+r.type+"'",r)}ft({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(r,e)=>{var t=qg(e[0],r);return{type:"delimsizing",mode:r.parser.mode,size:HM[r.funcName].size,mclass:HM[r.funcName].mclass,delim:t.text}},htmlBuilder:(r,e)=>r.delim==="."?Xe([r.mclass]):iN(r.delim,r.size,e,r.mode,[r.mclass]),mathmlBuilder:r=>{var e=[];r.delim!=="."&&e.push(wa(r.delim,r.mode));var t=new et("mo",e);r.mclass==="mopen"||r.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var n=it(qf[r.size]);return t.setAttribute("minsize",n),t.setAttribute("maxsize",n),t}});function jM(r){if(!r.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}ft({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=r.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new Qe("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:r.parser.mode,delim:qg(e[0],r).text,color:t}}});ft({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=qg(e[0],r),n=r.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var a=Ft(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:t.text,right:a.delim,rightColor:a.color}},htmlBuilder:(r,e)=>{jM(r);for(var t=Dn(r.body,e,!0,["mopen","mclose"]),n=0,i=0,a=!1,s=0;s{jM(r);var t=$i(r.body,e);if(r.left!=="."){var n=new et("mo",[wa(r.left,r.mode)]);n.setAttribute("fence","true"),t.unshift(n)}if(r.right!=="."){var i=new et("mo",[wa(r.right,r.mode)]);i.setAttribute("fence","true"),r.rightColor&&i.setAttribute("mathcolor",r.rightColor),t.push(i)}return U3(t)}});ft({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=qg(e[0],r);if(!r.parser.leftrightDepth)throw new Qe("\\middle without preceding \\left",t);return{type:"middle",mode:r.parser.mode,delim:t.text}},htmlBuilder:(r,e)=>{var t;if(r.delim===".")t=Sd(e,[]);else{t=iN(r.delim,1,e,r.mode,[]);var n={delim:r.delim,options:e};t.isMiddle=n}return t},mathmlBuilder:(r,e)=>{var t=r.delim==="\\vert"||r.delim==="|"?wa("|","text"):wa(r.delim,r.mode),n=new et("mo",[t]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var Xg=(r,e)=>{var t=Wc(or(r.body,e),e),n=r.label.slice(1),i=e.sizeMultiplier,a,s=0,o=Qs(r.body);if(n==="sout")a=Xe(["stretchy","sout"]),a.height=e.fontMetrics().defaultRuleThickness/i,s=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=Zr({number:.6,unit:"pt"},e),c=Zr({number:.35,unit:"ex"},e),h=e.havingBaseSizing();i=i/h.sizeMultiplier;var d=t.height+t.depth+l+c;t.style.paddingLeft=it(d/2+l);var v=Math.floor(1e3*d*i),g=aae(v),m=new qs([new sl("phase",g)],{width:"400em",height:it(v/1e3),viewBox:"0 0 400000 "+v,preserveAspectRatio:"xMinYMin slice"});a=ol(["hide-tail"],[m],e),a.style.height=it(d),s=t.depth+l+c}else{/cancel/.test(n)?o||t.classes.push("cancel-pad"):n==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var x=0,y=0,_=0;/box/.test(n)?(_=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),x=e.fontMetrics().fboxsep+(n==="colorbox"?0:_),y=x):n==="angl"?(_=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),x=4*_,y=Math.max(0,.25-t.depth)):(x=o?.2:0,y=x),a=Uae(t,n,x,y,e),/fbox|boxed|fcolorbox/.test(n)?(a.style.borderStyle="solid",a.style.borderWidth=it(_)):n==="angl"&&_!==.049&&(a.style.borderTopWidth=it(_),a.style.borderRightWidth=it(_)),s=t.depth+y,r.backgroundColor&&(a.style.backgroundColor=r.backgroundColor,r.borderColor&&(a.style.borderColor=r.borderColor))}var w;if(r.backgroundColor)w=sr({positionType:"individualShift",children:[{type:"elem",elem:a,shift:s},{type:"elem",elem:t,shift:0}]});else{var S=/cancel|phase/.test(n)?["svg-align"]:[];w=sr({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:a,shift:s,wrapperClasses:S}]})}return/cancel/.test(n)&&(w.height=t.height,w.depth=t.depth),/cancel/.test(n)&&!o?Xe(["mord","cancel-lap"],[w],e):Xe(["mord"],[w],e)},Yg=(r,e)=>{var t=0,n=new et(r.label.includes("colorbox")?"mpadded":"menclose",[Mr(r.body,e)]);switch(r.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(t=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*t+"pt"),n.setAttribute("height","+"+2*t+"pt"),n.setAttribute("lspace",t+"pt"),n.setAttribute("voffset",t+"pt"),r.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+it(i)+" solid "+r.borderColor)}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return r.backgroundColor&&n.setAttribute("mathbackground",r.backgroundColor),n};ft({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(r,e,t){var{parser:n,funcName:i}=r,a=Ft(e[0],"color-token").color,s=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,body:s}},htmlBuilder:Xg,mathmlBuilder:Yg});ft({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(r,e,t){var{parser:n,funcName:i}=r,a=Ft(e[0],"color-token").color,s=Ft(e[1],"color-token").color,o=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,borderColor:a,body:o}},htmlBuilder:Xg,mathmlBuilder:Yg});ft({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"enclose",mode:t.mode,label:"\\fbox",body:e[0]}}});ft({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];return{type:"enclose",mode:t.mode,label:n,body:i}},htmlBuilder:Xg,mathmlBuilder:Yg});ft({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t,funcName:n}=r;t.mode==="math"&&t.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var i=e[0];return{type:"enclose",mode:t.mode,label:n,body:i}},htmlBuilder:Xg,mathmlBuilder:Yg});ft({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(r,e){var{parser:t}=r;return{type:"enclose",mode:t.mode,label:"\\angl",body:e[0]}}});var oN={};function cs(r){for(var{type:e,names:t,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=r,o={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l{var e=r.parser.settings;if(!e.displayMode)throw new Qe("{"+r.envName+"} can be used only in display mode.")},nse=new Set(["gather","gather*"]);function V3(r){if(!r.includes("ed"))return!r.includes("*")}function yl(r,e,t){var{hskipBeforeAndAfter:n,addJot:i,cols:a,arraystretch:s,colSeparationType:o,autoTag:l,singleRow:c,emptySingleRow:h,maxNumCols:d,leqno:v}=e;if(r.gullet.beginGroup(),c||r.gullet.macros.set("\\cr","\\\\\\relax"),!s){var g=r.gullet.expandMacroAsText("\\arraystretch");if(g==null)s=1;else if(s=parseFloat(g),!s||s<0)throw new Qe("Invalid \\arraystretch: "+g)}r.gullet.beginGroup();var m=[],x=[m],y=[],_=[],w=l!=null?[]:void 0;function S(){l&&r.gullet.macros.set("\\@eqnsw","1",!0)}function A(){w&&(r.gullet.macros.get("\\df@tag")?(w.push(r.subparse([new Xi("\\df@tag")])),r.gullet.macros.set("\\df@tag",void 0,!0)):w.push(!!l&&r.gullet.macros.get("\\@eqnsw")==="1"))}for(S(),_.push(VM(r));;){var C=r.parseExpression(!1,c?"\\end":"\\\\");r.gullet.endGroup(),r.gullet.beginGroup();var M={type:"ordgroup",mode:r.mode,body:C};t&&(M={type:"styling",mode:r.mode,style:t,body:[M]}),m.push(M);var E=r.fetch().text;if(E==="&"){if(d&&m.length===d){if(c||o)throw new Qe("Too many tab characters: &",r.nextToken);r.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}r.consume()}else if(E==="\\end"){A(),m.length===1&&M.type==="styling"&&M.body.length===1&&M.body[0].type==="ordgroup"&&M.body[0].body.length===0&&(x.length>1||!h)&&x.pop(),_.length0&&(S+=.25),c.push({pos:S,isDashed:We[Ke]})}for(A(s[0]),n=0;n0&&(k+=w,EWe))for(n=0;n=o)){var pe=void 0;if(i>0||e.hskipBeforeAndAfter){var ae,oe;pe=(ae=(oe=G)==null?void 0:oe.pregap)!=null?ae:v,pe!==0&&(W=Xe(["arraycolsep"],[]),W.style.width=it(pe),X.push(W))}var de=[];for(n=0;n0){for(var tt=Yc("hline",t,h),ot=Yc("hdashline",t,h),ct=[{type:"elem",elem:He,shift:0}];c.length>0;){var Ze=c.pop(),bt=Ze.pos-U;Ze.isDashed?ct.push({type:"elem",elem:ot,shift:bt}):ct.push({type:"elem",elem:tt,shift:bt})}He=sr({positionType:"individualShift",children:ct})}if(H.length===0)return Xe(["mord"],[He],t);var Se=sr({positionType:"individualShift",children:H}),ke=Xe(["tag"],[Se],t);return eo([He,ke])},ise={c:"center ",l:"left ",r:"right "},fs=function(e,t){for(var n=[],i=new et("mtd",[],["mtr-glue"]),a=new et("mtd",[],["mml-eqn-num"]),s=0;s0){var m=e.cols,x="",y=!1,_=0,w=m.length;m[0].type==="separator"&&(v+="top ",_=1),m[m.length-1].type==="separator"&&(v+="bottom ",w-=1);for(var S=_;S0?"left ":"",v+=D[D.length-1].length>0?"right ":"";for(var I=1;I0&&g&&(y=1),n[m]={type:"align",align:x,pregap:y,postgap:0}}return s.colSeparationType=g?"align":"alignat",s};cs({type:"array",names:["array","darray"],props:{numArgs:1},handler(r,e){var t=jg(e[0]),n=t?[e[0]]:Ft(e[0],"ordgroup").body,i=n.map(function(s){var o=Hg(s),l=o.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new Qe("Unknown column alignment: "+l,s)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return yl(r.parser,a,q3(r.envName))},htmlBuilder:hs,mathmlBuilder:fs});cs({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(r){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[r.envName.replace("*","")],t="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(r.envName.charAt(r.envName.length-1)==="*"){var i=r.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),t=i.fetch().text,!"lcr".includes(t))throw new Qe("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:t}]}}var a=yl(r.parser,n,q3(r.envName)),s=Math.max(0,...a.body.map(o=>o.length));return a.cols=new Array(s).fill({type:"align",align:t}),e?{type:"leftright",mode:r.mode,body:[a],left:e[0],right:e[1],rightColor:void 0}:a},htmlBuilder:hs,mathmlBuilder:fs});cs({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(r){var e={arraystretch:.5},t=yl(r.parser,e,"script");return t.colSeparationType="small",t},htmlBuilder:hs,mathmlBuilder:fs});cs({type:"array",names:["subarray"],props:{numArgs:1},handler(r,e){var t=jg(e[0]),n=t?[e[0]]:Ft(e[0],"ordgroup").body,i=n.map(function(o){var l=Hg(o),c=l.text;if("lc".includes(c))return{type:"align",align:c};throw new Qe("Unknown column alignment: "+c,o)});if(i.length>1)throw new Qe("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},s=yl(r.parser,a,"script");if(s.body.length>0&&s.body[0].length>1)throw new Qe("{subarray} can contain only one column");return s},htmlBuilder:hs,mathmlBuilder:fs});cs({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(r){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=yl(r.parser,e,q3(r.envName));return{type:"leftright",mode:r.mode,body:[t],left:r.envName.includes("r")?".":"\\{",right:r.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:hs,mathmlBuilder:fs});cs({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:uN,htmlBuilder:hs,mathmlBuilder:fs});cs({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(r){nse.has(r.envName)&&Wg(r);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:V3(r.envName),emptySingleRow:!0,leqno:r.parser.settings.leqno};return yl(r.parser,e,"display")},htmlBuilder:hs,mathmlBuilder:fs});cs({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:uN,htmlBuilder:hs,mathmlBuilder:fs});cs({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(r){Wg(r);var e={autoTag:V3(r.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:r.parser.settings.leqno};return yl(r.parser,e,"display")},htmlBuilder:hs,mathmlBuilder:fs});cs({type:"array",names:["CD"],props:{numArgs:0},handler(r){return Wg(r),qae(r.parser)},htmlBuilder:hs,mathmlBuilder:fs});te("\\nonumber","\\gdef\\@eqnsw{0}");te("\\notag","\\nonumber");ft({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(r,e){throw new Qe(r.funcName+" valid only within array environment")}});var qM=oN;ft({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];if(i.type!=="ordgroup")throw new Qe("Invalid environment name",i);for(var a="",s=0;s{var t=r.font,n=e.withFont(t);return or(r.body,n)},hN=(r,e)=>{var t=r.font,n=e.withFont(t);return Mr(r.body,n)},XM={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};ft({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=Qp(e[0]),a=n;return a in XM&&(a=XM[a]),{type:"font",mode:t.mode,font:a.slice(1),body:i}},htmlBuilder:cN,mathmlBuilder:hN});ft({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"mclass",mode:t.mode,mclass:Vg(n),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:n}],isCharacterBox:Qs(n)}}});ft({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:n,breakOnTokenText:i}=r,{mode:a}=t,s=t.parseExpression(!0,i),o="math"+n.slice(1);return{type:"font",mode:a,font:o,body:{type:"ordgroup",mode:t.mode,body:s}}},htmlBuilder:cN,mathmlBuilder:hN});var ase=(r,e)=>{var t=e.style,n=t.fracNum(),i=t.fracDen(),a;a=e.havingStyle(n);var s=or(r.numer,a,e);if(r.continued){var o=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;s.height=s.height0?m=3*v:m=7*v,x=e.fontMetrics().denom1):(d>0?(g=e.fontMetrics().num2,m=v):(g=e.fontMetrics().num3,m=3*v),x=e.fontMetrics().denom2);var y;if(h){var w=e.fontMetrics().axisHeight;g-s.depth-(w+.5*d){var t=new et("mfrac",[Mr(r.numer,e),Mr(r.denom,e)]);if(!r.hasBarLine)t.setAttribute("linethickness","0px");else if(r.barSize){var n=Zr(r.barSize,e);t.setAttribute("linethickness",it(n))}if(r.leftDelim!=null||r.rightDelim!=null){var i=[];if(r.leftDelim!=null){var a=new et("mo",[new En(r.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}if(i.push(t),r.rightDelim!=null){var s=new et("mo",[new En(r.rightDelim.replace("\\",""))]);s.setAttribute("fence","true"),i.push(s)}return U3(i)}return t},fN=(r,e)=>{if(!e)return r;var t={type:"styling",mode:r.mode,style:e,body:[r]};return t};ft({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0],a=e[1],s,o=null,l=null;switch(n){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":s=!0;break;case"\\\\atopfrac":s=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s=!1,o="(",l=")";break;case"\\\\bracefrac":s=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":s=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var c=n==="\\cfrac",h=null;return c||n.startsWith("\\d")?h="display":n.startsWith("\\t")&&(h="text"),fN({type:"genfrac",mode:t.mode,numer:i,denom:a,continued:c,hasBarLine:s,leftDelim:o,rightDelim:l,barSize:null},h)},htmlBuilder:ase,mathmlBuilder:sse});ft({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(r){var{parser:e,funcName:t,token:n}=r,i;switch(t){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:n}}});var YM=["display","text","script","scriptscript"],WM=function(e){var t=null;return e.length>0&&(t=e,t=t==="."?null:t),t};ft({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(r,e){var{parser:t}=r,n=e[4],i=e[5],a=Qp(e[0]),s=a.type==="atom"&&a.family==="open"?WM(a.text):null,o=Qp(e[1]),l=o.type==="atom"&&o.family==="close"?WM(o.text):null,c=Ft(e[2],"size"),h,d=null;c.isBlank?h=!0:(d=c.value,h=d.number>0);var v=null,g=e[3];if(g.type==="ordgroup"){if(g.body.length>0){var m=Ft(g.body[0],"textord");v=YM[Number(m.text)]}}else g=Ft(g,"textord"),v=YM[Number(g.text)];return fN({type:"genfrac",mode:t.mode,numer:n,denom:i,continued:!1,hasBarLine:h,barSize:d,leftDelim:s,rightDelim:l},v)}});ft({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(r,e){var{parser:t,funcName:n,token:i}=r;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:Ft(e[0],"size").value,token:i}}});ft({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0],a=Ft(e[1],"infix").size;if(!a)throw new Error("\\\\abovefrac expected size, but got "+String(a));var s=e[2],o=a.number>0;return{type:"genfrac",mode:t.mode,numer:i,denom:s,continued:!1,hasBarLine:o,barSize:a,leftDelim:null,rightDelim:null}}});var dN=(r,e)=>{var t=e.style,n,i;r.type==="supsub"?(n=r.sup?or(r.sup,e.havingStyle(t.sup()),e):or(r.sub,e.havingStyle(t.sub()),e),i=Ft(r.base,"horizBrace")):i=Ft(r,"horizBrace");var a=or(i.base,e.havingBaseStyle(Dt.DISPLAY)),s=Gg(i,e),o;if(i.isOver?(o=sr({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s}]}),o.children[0].children[0].children[1].classes.push("svg-align")):(o=sr({positionType:"bottom",positionData:a.depth+.1+s.height,children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:a}]}),o.children[0].children[0].children[0].classes.push("svg-align")),n){var l=Xe(["minner",i.isOver?"mover":"munder"],[o],e);i.isOver?o=sr({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]}):o=sr({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]})}return Xe(["minner",i.isOver?"mover":"munder"],[o],e)},ose=(r,e)=>{var t=Ug(r.label);return new et(r.isOver?"mover":"munder",[Mr(r.base,e),t])};ft({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:n}=r;return{type:"horizBrace",mode:t.mode,label:n,isOver:n.includes("\\over"),base:e[0]}},htmlBuilder:dN,mathmlBuilder:ose});ft({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[1],i=Ft(e[0],"url").url;return t.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:t.mode,href:i,body:Sn(n)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(r,e)=>{var t=Dn(r.body,e,!1);return Eae(r.href,[],t,e)},mathmlBuilder:(r,e)=>{var t=ll(r.body,e);return t instanceof et||(t=new et("mrow",[t])),t.setAttribute("href",r.href),t}});ft({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=Ft(e[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:n}))return t.formatUnsupportedCmd("\\url");for(var i=[],a=0;a{var{parser:t,funcName:n,token:i}=r,a=Ft(e[0],"raw").string,s=e[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(n){case"\\htmlClass":l.class=a,o={command:"\\htmlClass",class:a};break;case"\\htmlId":l.id=a,o={command:"\\htmlId",id:a};break;case"\\htmlStyle":l.style=a,o={command:"\\htmlStyle",style:a};break;case"\\htmlData":{for(var c=a.split(","),h=0;h{var t=Dn(r.body,e,!1),n=["enclosing"];r.attributes.class&&n.push(...r.attributes.class.trim().split(/\s+/));var i=Xe(n,t,e);for(var a in r.attributes)a!=="class"&&r.attributes.hasOwnProperty(a)&&i.setAttribute(a,r.attributes[a]);return i},mathmlBuilder:(r,e)=>ll(r.body,e)});ft({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r;return{type:"htmlmathml",mode:t.mode,html:Sn(e[0]),mathml:Sn(e[1])}},htmlBuilder:(r,e)=>{var t=Dn(r.html,e,!1);return eo(t)},mathmlBuilder:(r,e)=>ll(r.mathml,e)});var Hx=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new Qe("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!OI(n))throw new Qe("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};ft({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(r,e,t)=>{var{parser:n}=r,i={number:0,unit:"em"},a={number:.9,unit:"em"},s={number:0,unit:"em"},o="";if(t[0])for(var l=Ft(t[0],"raw").string,c=l.split(","),h=0;h{var t=Zr(r.height,e),n=0;r.totalheight.number>0&&(n=Zr(r.totalheight,e)-t);var i=0;r.width.number>0&&(i=Zr(r.width,e));var a={height:it(t+n)};i>0&&(a.width=it(i)),n>0&&(a.verticalAlign=it(-n));var s=new fae(r.src,r.alt,a);return s.height=t,s.depth=n,s},mathmlBuilder:(r,e)=>{var t=new et("mglyph",[]);t.setAttribute("alt",r.alt);var n=Zr(r.height,e),i=0;if(r.totalheight.number>0&&(i=Zr(r.totalheight,e)-n,t.setAttribute("valign",it(-i))),t.setAttribute("height",it(n+i)),r.width.number>0){var a=Zr(r.width,e);t.setAttribute("width",it(a))}return t.setAttribute("src",r.src),t}});ft({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(r,e){var{parser:t,funcName:n}=r,i=Ft(e[0],"size");if(t.settings.strict){var a=n[1]==="m",s=i.value.unit==="mu";a?(s||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+i.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):s&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:i.value}},htmlBuilder(r,e){return kI(r.dimension,e)},mathmlBuilder(r,e){var t=Zr(r.dimension,e);return new HI(t)}});ft({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0];return{type:"lap",mode:t.mode,alignment:n.slice(5),body:i}},htmlBuilder:(r,e)=>{var t;r.alignment==="clap"?(t=Xe([],[or(r.body,e)]),t=Xe(["inner"],[t],e)):t=Xe(["inner"],[or(r.body,e)]);var n=Xe(["fix"],[]),i=Xe([r.alignment],[t,n],e),a=Xe(["strut"]);return a.style.height=it(i.height+i.depth),i.depth&&(a.style.verticalAlign=it(-i.depth)),i.children.unshift(a),i=Xe(["thinbox"],[i],e),Xe(["mord","vbox"],[i],e)},mathmlBuilder:(r,e)=>{var t=new et("mpadded",[Mr(r.body,e)]);if(r.alignment!=="rlap"){var n=r.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",n+"width")}return t.setAttribute("width","0px"),t}});ft({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(r,e){var{funcName:t,parser:n}=r,i=n.mode;n.switchMode("math");var a=t==="\\("?"\\)":"$",s=n.parseExpression(!1,a);return n.expect(a),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",body:s}}});ft({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(r,e){throw new Qe("Mismatched "+r.funcName)}});var $M=(r,e)=>{switch(e.style.size){case Dt.DISPLAY.size:return r.display;case Dt.TEXT.size:return r.text;case Dt.SCRIPT.size:return r.script;case Dt.SCRIPTSCRIPT.size:return r.scriptscript;default:return r.text}};ft({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(r,e)=>{var{parser:t}=r;return{type:"mathchoice",mode:t.mode,display:Sn(e[0]),text:Sn(e[1]),script:Sn(e[2]),scriptscript:Sn(e[3])}},htmlBuilder:(r,e)=>{var t=$M(r,e),n=Dn(t,e,!1);return eo(n)},mathmlBuilder:(r,e)=>{var t=$M(r,e);return ll(t,e)}});var vN=(r,e,t,n,i,a,s)=>{r=Xe([],[r]);var o=t&&Qs(t),l,c;if(e){var h=or(e,n.havingStyle(i.sup()),n);c={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(t){var d=or(t,n.havingStyle(i.sub()),n);l={elem:d,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-d.height)}}var v;if(c&&l){var g=n.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+r.depth+s;v=sr({positionType:"bottom",positionData:g,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:it(-a)},{type:"kern",size:l.kern},{type:"elem",elem:r},{type:"kern",size:c.kern},{type:"elem",elem:c.elem,marginLeft:it(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else if(l){var m=r.height-s;v=sr({positionType:"top",positionData:m,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:it(-a)},{type:"kern",size:l.kern},{type:"elem",elem:r}]})}else if(c){var x=r.depth+s;v=sr({positionType:"bottom",positionData:x,children:[{type:"elem",elem:r},{type:"kern",size:c.kern},{type:"elem",elem:c.elem,marginLeft:it(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else return r;var y=[v];if(l&&a!==0&&!o){var _=Xe(["mspace"],[],n);_.style.marginRight=it(a),y.unshift(_)}return Xe(["mop","op-limits"],y,n)},pN=new Set(["\\smallint"]),vh=(r,e)=>{var t,n,i=!1,a;r.type==="supsub"?(t=r.sup,n=r.sub,a=Ft(r.base,"op"),i=!0):a=Ft(r,"op");var s=e.style,o=!1;s.size===Dt.DISPLAY.size&&a.symbol&&!pN.has(a.name)&&(o=!0);var l;if(a.symbol){var c=o?"Size2-Regular":"Size1-Regular",h="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(h=a.name.slice(1),a.name=h==="oiint"?"\\iint":"\\iiint"),l=ci(a.name,c,"math",e,["mop","op-symbol",o?"large-op":"small-op"]),h.length>0){var d=l.italic,v=FI(h+"Size"+(o?"2":"1"),e);l=sr({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:v,shift:o?.08:0}]}),a.name="\\"+h,l.classes.unshift("mop"),l.italic=d}}else if(a.body){var g=Dn(a.body,e,!0);g.length===1&&g[0]instanceof Yi?(l=g[0],l.classes[0]="mop"):l=Xe(["mop"],g,e)}else{for(var m=[],x=1;x{var t;if(r.symbol)t=new et("mo",[wa(r.name,r.mode)]),pN.has(r.name)&&t.setAttribute("largeop","false");else if(r.body)t=new et("mo",$i(r.body,e));else{t=new et("mi",[new En(r.name.slice(1))]);var n=new et("mo",[wa("⁡","text")]);r.parentIsSupSub?t=new et("mrow",[t,n]):t=GI([t,n])}return t},lse={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};ft({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=n;return i.length===1&&(i=lse[i]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:vh,mathmlBuilder:Gd});ft({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Sn(n)}},htmlBuilder:vh,mathmlBuilder:Gd});var use={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};ft({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:vh,mathmlBuilder:Gd});ft({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:vh,mathmlBuilder:Gd});ft({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(r){var{parser:e,funcName:t}=r,n=t;return n.length===1&&(n=use[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:vh,mathmlBuilder:Gd});var gN=(r,e)=>{var t,n,i=!1,a;r.type==="supsub"?(t=r.sup,n=r.sub,a=Ft(r.base,"operatorname"),i=!0):a=Ft(r,"operatorname");var s;if(a.body.length>0){for(var o=a.body.map(d=>{var v="text"in d?d.text:void 0;return typeof v=="string"?{type:"textord",mode:d.mode,text:v}:d}),l=Dn(o,e.withFont("mathrm"),!0),c=0;c{for(var t=$i(r.body,e.withFont("mathrm")),n=!0,i=0;ih.toText()).join("");t=[new En(o)]}var l=new et("mi",t);l.setAttribute("mathvariant","normal");var c=new et("mo",[wa("⁡","text")]);return r.parentIsSupSub?new et("mrow",[l,c]):GI([l,c])};ft({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0];return{type:"operatorname",mode:t.mode,body:Sn(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:gN,mathmlBuilder:cse});te("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Cu({type:"ordgroup",htmlBuilder(r,e){return r.semisimple?eo(Dn(r.body,e,!1)):Xe(["mord"],Dn(r.body,e,!0),e)},mathmlBuilder(r,e){return ll(r.body,e,!0)}});ft({type:"overline",names:["\\overline"],props:{numArgs:1},handler(r,e){var{parser:t}=r,n=e[0];return{type:"overline",mode:t.mode,body:n}},htmlBuilder(r,e){var t=or(r.body,e.havingCrampedStyle()),n=Yc("overline-line",e),i=e.fontMetrics().defaultRuleThickness,a=sr({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]});return Xe(["mord","overline"],[a],e)},mathmlBuilder(r,e){var t=new et("mo",[new En("‾")]);t.setAttribute("stretchy","true");var n=new et("mover",[Mr(r.body,e),t]);return n.setAttribute("accent","true"),n}});ft({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"phantom",mode:t.mode,body:Sn(n)}},htmlBuilder:(r,e)=>{var t=Dn(r.body,e.withPhantom(),!1);return eo(t)},mathmlBuilder:(r,e)=>{var t=$i(r.body,e);return new et("mphantom",t)}});te("\\hphantom","\\smash{\\phantom{#1}}");ft({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"vphantom",mode:t.mode,body:n}},htmlBuilder:(r,e)=>{var t=Xe(["inner"],[or(r.body,e.withPhantom())]),n=Xe(["fix"],[]);return Xe(["mord","rlap"],[t,n],e)},mathmlBuilder:(r,e)=>{var t=$i(Sn(r.body),e),n=new et("mphantom",t),i=new et("mpadded",[n]);return i.setAttribute("width","0px"),i}});ft({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(r,e){var{parser:t}=r,n=Ft(e[0],"size").value,i=e[1];return{type:"raisebox",mode:t.mode,dy:n,body:i}},htmlBuilder(r,e){var t=or(r.body,e),n=Zr(r.dy,e);return sr({positionType:"shift",positionData:-n,children:[{type:"elem",elem:t}]})},mathmlBuilder(r,e){var t=new et("mpadded",[Mr(r.body,e)]),n=r.dy.number+r.dy.unit;return t.setAttribute("voffset",n),t}});ft({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(r){var{parser:e}=r;return{type:"internal",mode:e.mode}}});ft({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(r,e,t){var{parser:n}=r,i=t[0],a=Ft(e[0],"size"),s=Ft(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&Ft(i,"size").value,width:a.value,height:s.value}},htmlBuilder(r,e){var t=Xe(["mord","rule"],[],e),n=Zr(r.width,e),i=Zr(r.height,e),a=r.shift?Zr(r.shift,e):0;return t.style.borderRightWidth=it(n),t.style.borderTopWidth=it(i),t.style.bottom=it(a),t.width=n,t.height=i+a,t.depth=-a,t.maxFontSize=i*1.125*e.sizeMultiplier,t},mathmlBuilder(r,e){var t=Zr(r.width,e),n=Zr(r.height,e),i=r.shift?Zr(r.shift,e):0,a=e.color&&e.getColor()||"black",s=new et("mspace");s.setAttribute("mathbackground",a),s.setAttribute("width",it(t)),s.setAttribute("height",it(n));var o=new et("mpadded",[s]);return i>=0?o.setAttribute("height",it(i)):(o.setAttribute("height",it(i)),o.setAttribute("depth",it(-i))),o.setAttribute("voffset",it(i)),o}});function mN(r,e,t){for(var n=Dn(r,e,!1),i=e.sizeMultiplier/t.sizeMultiplier,a=0;a{var t=e.havingSize(r.size);return mN(r.body,t,e)};ft({type:"sizing",names:KM,props:{numArgs:0,allowedInText:!0},handler:(r,e)=>{var{breakOnTokenText:t,funcName:n,parser:i}=r,a=i.parseExpression(!1,t);return{type:"sizing",mode:i.mode,size:KM.indexOf(n)+1,body:a}},htmlBuilder:hse,mathmlBuilder:(r,e)=>{var t=e.havingSize(r.size),n=$i(r.body,t),i=new et("mstyle",n);return i.setAttribute("mathsize",it(t.sizeMultiplier)),i}});ft({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(r,e,t)=>{var{parser:n}=r,i=!1,a=!1,s=t[0]&&Ft(t[0],"ordgroup");if(s)for(var o="",l=0;l{var t=Xe([],[or(r.body,e)]);if(!r.smashHeight&&!r.smashDepth)return t;if(r.smashHeight&&(t.height=0),r.smashDepth&&(t.depth=0),r.smashHeight&&r.smashDepth)return Xe(["mord","smash"],[t],e);if(t.children)for(var n=0;n{var t=new et("mpadded",[Mr(r.body,e)]);return r.smashHeight&&t.setAttribute("height","0px"),r.smashDepth&&t.setAttribute("depth","0px"),t}});ft({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(r,e,t){var{parser:n}=r,i=t[0],a=e[0];return{type:"sqrt",mode:n.mode,body:a,index:i}},htmlBuilder(r,e){var t=or(r.body,e.havingCrampedStyle());t.height===0&&(t.height=e.fontMetrics().xHeight),t=Wc(t,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,a=i;e.style.idt.height+t.depth+s&&(s=(s+d-t.height-t.depth)/2);var v=l.height-t.height-s-c;t.style.paddingLeft=it(h);var g=sr({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+v)},{type:"elem",elem:l},{type:"kern",size:c}]});if(r.index){var m=e.havingStyle(Dt.SCRIPTSCRIPT),x=or(r.index,m,e),y=.6*(g.height-g.depth),_=sr({positionType:"shift",positionData:-y,children:[{type:"elem",elem:x}]}),w=Xe(["root"],[_]);return Xe(["mord","sqrt"],[w,g],e)}else return Xe(["mord","sqrt"],[g],e)},mathmlBuilder(r,e){var{body:t,index:n}=r;return n?new et("mroot",[Mr(t,e),Mr(n,e)]):new et("msqrt",[Mr(t,e)])}});var ZM={display:Dt.DISPLAY,text:Dt.TEXT,script:Dt.SCRIPT,scriptscript:Dt.SCRIPTSCRIPT};ft({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r,e){var{breakOnTokenText:t,funcName:n,parser:i}=r,a=i.parseExpression(!0,t),s=n.slice(1,n.length-5);return{type:"styling",mode:i.mode,style:s,body:a}},htmlBuilder(r,e){var t=ZM[r.style],n=e.havingStyle(t).withFont("");return mN(r.body,n,e)},mathmlBuilder(r,e){var t=ZM[r.style],n=e.havingStyle(t),i=$i(r.body,n),a=new et("mstyle",i),s={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=s[r.style];return a.setAttribute("scriptlevel",o[0]),a.setAttribute("displaystyle",o[1]),a}});var fse=function(e,t){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(t.style.size===Dt.DISPLAY.size||n.alwaysHandleSupSub);return i?vh:null}else if(n.type==="operatorname"){var a=n.alwaysHandleSupSub&&(t.style.size===Dt.DISPLAY.size||n.limits);return a?gN:null}else{if(n.type==="accent")return Qs(n.base)?H3:null;if(n.type==="horizBrace"){var s=!e.sub;return s===n.isOver?dN:null}else return null}else return null};Cu({type:"supsub",htmlBuilder(r,e){var t=fse(r,e);if(t)return t(r,e);var{base:n,sup:i,sub:a}=r,s=or(n,e),o,l,c=e.fontMetrics(),h=0,d=0,v=n&&Qs(n);if(i){var g=e.havingStyle(e.style.sup());o=or(i,g,e),v||(h=s.height-g.fontMetrics().supDrop*g.sizeMultiplier/e.sizeMultiplier)}if(a){var m=e.havingStyle(e.style.sub());l=or(a,m,e),v||(d=s.depth+m.fontMetrics().subDrop*m.sizeMultiplier/e.sizeMultiplier)}var x;e.style===Dt.DISPLAY?x=c.sup1:e.style.cramped?x=c.sup3:x=c.sup2;var y=e.sizeMultiplier,_=it(.5/c.ptPerEm/y),w=null;if(l){var S=r.base&&r.base.type==="op"&&r.base.name&&(r.base.name==="\\oiint"||r.base.name==="\\oiiint");(s instanceof Yi||S)&&(w=it(-s.italic))}var A;if(o&&l){h=Math.max(h,x,o.depth+.25*c.xHeight),d=Math.max(d,c.sub2);var C=c.defaultRuleThickness,M=4*C;if(h-o.depth-(l.height-d)0&&(h+=E,d-=E)}var O=[{type:"elem",elem:l,shift:d,marginRight:_,marginLeft:w},{type:"elem",elem:o,shift:-h,marginRight:_}];A=sr({positionType:"individualShift",children:O})}else if(l){d=Math.max(d,c.sub1,l.height-.8*c.xHeight);var D=[{type:"elem",elem:l,marginLeft:w,marginRight:_}];A=sr({positionType:"shift",positionData:d,children:D})}else if(o)h=Math.max(h,x,o.depth+.25*c.xHeight),A=sr({positionType:"shift",positionData:-h,children:[{type:"elem",elem:o,marginRight:_}]});else throw new Error("supsub must have either sup or sub.");var I=D_(s,"right")||"mord";return Xe([I],[s,Xe(["msupsub"],[A])],e)},mathmlBuilder(r,e){var t=!1,n,i;r.base&&r.base.type==="horizBrace"&&(i=!!r.sup,i===r.base.isOver&&(t=!0,n=r.base.isOver)),r.base&&(r.base.type==="op"||r.base.type==="operatorname")&&(r.base.parentIsSupSub=!0);var a=[Mr(r.base,e)];r.sub&&a.push(Mr(r.sub,e)),r.sup&&a.push(Mr(r.sup,e));var s;if(t)s=n?"mover":"munder";else if(r.sub)if(r.sup){var c=r.base;c&&c.type==="op"&&c.limits&&e.style===Dt.DISPLAY||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(e.style===Dt.DISPLAY||c.limits)?s="munderover":s="msubsup"}else{var l=r.base;l&&l.type==="op"&&l.limits&&(e.style===Dt.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===Dt.DISPLAY)?s="munder":s="msub"}else{var o=r.base;o&&o.type==="op"&&o.limits&&(e.style===Dt.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||e.style===Dt.DISPLAY)?s="mover":s="msup"}return new et(s,a)}});Cu({type:"atom",htmlBuilder(r,e){return F3(r.text,r.mode,e,["m"+r.family])},mathmlBuilder(r,e){var t=new et("mo",[wa(r.text,r.mode)]);if(r.family==="bin"){var n=G3(r,e);n==="bold-italic"&&t.setAttribute("mathvariant",n)}else r.family==="punct"?t.setAttribute("separator","true"):(r.family==="open"||r.family==="close")&&t.setAttribute("stretchy","false");return t}});var yN={mi:"italic",mn:"normal",mtext:"normal"};Cu({type:"mathord",htmlBuilder(r,e){return zg(r,e,"mathord")},mathmlBuilder(r,e){var t=new et("mi",[wa(r.text,r.mode,e)]),n=G3(r,e)||"italic";return n!==yN[t.type]&&t.setAttribute("mathvariant",n),t}});Cu({type:"textord",htmlBuilder(r,e){return zg(r,e,"textord")},mathmlBuilder(r,e){var t=wa(r.text,r.mode,e),n=G3(r,e)||"normal",i;return r.mode==="text"?i=new et("mtext",[t]):/[0-9]/.test(r.text)?i=new et("mn",[t]):r.text==="\\prime"?i=new et("mo",[t]):i=new et("mi",[t]),n!==yN[i.type]&&i.setAttribute("mathvariant",n),i}});var jx={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Vx={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Cu({type:"spacing",htmlBuilder(r,e){if(Vx.hasOwnProperty(r.text)){var t=Vx[r.text].className||"";if(r.mode==="text"){var n=zg(r,e,"textord");return n.classes.push(t),n}else return Xe(["mspace",t],[F3(r.text,r.mode,e)],e)}else{if(jx.hasOwnProperty(r.text))return Xe(["mspace",jx[r.text]],[],e);throw new Qe('Unknown type of space "'+r.text+'"')}},mathmlBuilder(r,e){var t;if(Vx.hasOwnProperty(r.text))t=new et("mtext",[new En(" ")]);else{if(jx.hasOwnProperty(r.text))return new et("mspace");throw new Qe('Unknown type of space "'+r.text+'"')}return t}});var QM=()=>{var r=new et("mtd",[]);return r.setAttribute("width","50%"),r};Cu({type:"tag",mathmlBuilder(r,e){var t=new et("mtable",[new et("mtr",[QM(),new et("mtd",[ll(r.body,e)]),QM(),new et("mtd",[ll(r.tag,e)])])]);return t.setAttribute("width","100%"),t}});var JM={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},e9={"\\textbf":"textbf","\\textmd":"textmd"},dse={"\\textit":"textit","\\textup":"textup"},t9=(r,e)=>{var t=r.font;if(t){if(JM[t])return e.withTextFontFamily(JM[t]);if(e9[t])return e.withTextFontWeight(e9[t]);if(t==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(dse[t])};ft({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];return{type:"text",mode:t.mode,body:Sn(i),font:n}},htmlBuilder(r,e){var t=t9(r,e),n=Dn(r.body,t,!0);return Xe(["mord","text"],n,t)},mathmlBuilder(r,e){var t=t9(r,e);return ll(r.body,t)}});ft({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"underline",mode:t.mode,body:e[0]}},htmlBuilder(r,e){var t=or(r.body,e),n=Yc("underline-line",e),i=e.fontMetrics().defaultRuleThickness,a=sr({positionType:"top",positionData:t.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:t}]});return Xe(["mord","underline"],[a],e)},mathmlBuilder(r,e){var t=new et("mo",[new En("‾")]);t.setAttribute("stretchy","true");var n=new et("munder",[Mr(r.body,e),t]);return n.setAttribute("accentunder","true"),n}});ft({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(r,e){var{parser:t}=r;return{type:"vcenter",mode:t.mode,body:e[0]}},htmlBuilder(r,e){var t=or(r.body,e),n=e.fontMetrics().axisHeight,i=.5*(t.height-n-(t.depth+n));return sr({positionType:"shift",positionData:i,children:[{type:"elem",elem:t}]})},mathmlBuilder(r,e){return new et("mpadded",[Mr(r.body,e)],["vcenter"])}});ft({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(r,e,t){throw new Qe("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(r,e){for(var t=r9(r),n=[],i=e.havingStyle(e.style.text()),a=0;ar.body.replace(/ /g,r.star?"␣":" "),Ho=zI,bN=`[ \r ]`,vse="\\\\[a-zA-Z@]+",pse="\\\\[^\uD800-\uDFFF]",gse="("+vse+")"+bN+"*",mse=`\\\\( |[ \r ]+ ?)[ \r ]*`,k_="[̀-ͯ]",yse=new RegExp(k_+"+$"),bse="("+bN+"+)|"+(mse+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(k_+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(k_+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+gse)+("|"+pse+")");class n9{constructor(e,t){this.input=e,this.settings=t,this.tokenRegex=new RegExp(bse,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new Xi("EOF",new Ci(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new Qe("Unexpected character: '"+e[t]+"'",new Xi(e[t],new Ci(this,t,t+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[i]===14){var a=e.indexOf(` `,this.tokenRegex.lastIndex);return a===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=a+1,this.lex()}return new Xi(i,new Ci(this,t,this.tokenRegex.lastIndex))}}class xse{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Qe("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){for(var i=0;i0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(e)&&(a[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}}var _se=lN;te("\\noexpand",function(r){var e=r.popToken();return r.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});te("\\expandafter",function(r){var e=r.popToken();return r.expandOnce(!0),{tokens:[e],numArgs:0}});te("\\@firstoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[0],numArgs:0}});te("\\@secondoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[1],numArgs:0}});te("\\@ifnextchar",function(r){var e=r.consumeArgs(3);r.consumeSpaces();var t=r.future();return e[0].length===1&&e[0][0].text===t.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});te("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");te("\\TextOrMath",function(r){var e=r.consumeArgs(2);return r.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var i9={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};te("\\char",function(r){var e=r.popToken(),t,n=0;if(e.text==="'")t=8,e=r.popToken();else if(e.text==='"')t=16,e=r.popToken();else if(e.text==="`")if(e=r.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new Qe("\\char` missing argument");n=e.text.charCodeAt(0)}else t=10;if(t){if(n=i9[e.text],n==null||n>=t)throw new Qe("Invalid base-"+t+" digit "+e.text);for(var i;(i=i9[r.future().text])!=null&&i{var i=r.consumeArg().tokens;if(i.length!==1)throw new Qe("\\newcommand's first argument must be a macro name");var a=i[0].text,s=r.isDefined(a);if(s&&!e)throw new Qe("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!s&&!t)throw new Qe("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var o=0;if(i=r.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",c=r.expandNextToken();c.text!=="]"&&c.text!=="EOF";)l+=c.text,c=r.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Qe("Invalid number of arguments: "+l);o=parseInt(l),i=r.consumeArg().tokens}return s&&n||r.macros.set(a,{tokens:i,numArgs:o}),""};te("\\newcommand",r=>X3(r,!1,!0,!1));te("\\renewcommand",r=>X3(r,!0,!1,!1));te("\\providecommand",r=>X3(r,!0,!0,!0));te("\\message",r=>{var e=r.consumeArgs(1)[0];return console.log(e.reverse().map(t=>t.text).join("")),""});te("\\errmessage",r=>{var e=r.consumeArgs(1)[0];return console.error(e.reverse().map(t=>t.text).join("")),""});te("\\show",r=>{var e=r.popToken(),t=e.text;return console.log(e,r.macros.get(t),Ho[t],Vr.math[t],Vr.text[t]),""});te("\\bgroup","{");te("\\egroup","}");te("~","\\nobreakspace");te("\\lq","`");te("\\rq","'");te("\\aa","\\r a");te("\\AA","\\r A");te("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");te("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");te("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");te("ℬ","\\mathscr{B}");te("ℰ","\\mathscr{E}");te("ℱ","\\mathscr{F}");te("ℋ","\\mathscr{H}");te("ℐ","\\mathscr{I}");te("ℒ","\\mathscr{L}");te("ℳ","\\mathscr{M}");te("ℛ","\\mathscr{R}");te("ℭ","\\mathfrak{C}");te("ℌ","\\mathfrak{H}");te("ℨ","\\mathfrak{Z}");te("\\Bbbk","\\Bbb{k}");te("\\llap","\\mathllap{\\textrm{#1}}");te("\\rlap","\\mathrlap{\\textrm{#1}}");te("\\clap","\\mathclap{\\textrm{#1}}");te("\\mathstrut","\\vphantom{(}");te("\\underbar","\\underline{\\text{#1}}");te("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');te("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");te("\\ne","\\neq");te("≠","\\neq");te("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");te("∉","\\notin");te("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");te("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");te("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");te("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");te("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");te("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");te("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");te("⟂","\\perp");te("‼","\\mathclose{!\\mkern-0.8mu!}");te("∌","\\notni");te("⌜","\\ulcorner");te("⌝","\\urcorner");te("⌞","\\llcorner");te("⌟","\\lrcorner");te("©","\\copyright");te("®","\\textregistered");te("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');te("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');te("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');te("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');te("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");te("⋮","\\vdots");te("\\varGamma","\\mathit{\\Gamma}");te("\\varDelta","\\mathit{\\Delta}");te("\\varTheta","\\mathit{\\Theta}");te("\\varLambda","\\mathit{\\Lambda}");te("\\varXi","\\mathit{\\Xi}");te("\\varPi","\\mathit{\\Pi}");te("\\varSigma","\\mathit{\\Sigma}");te("\\varUpsilon","\\mathit{\\Upsilon}");te("\\varPhi","\\mathit{\\Phi}");te("\\varPsi","\\mathit{\\Psi}");te("\\varOmega","\\mathit{\\Omega}");te("\\substack","\\begin{subarray}{c}#1\\end{subarray}");te("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");te("\\boxed","\\fbox{$\\displaystyle{#1}$}");te("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");te("\\implies","\\DOTSB\\;\\Longrightarrow\\;");te("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");te("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");te("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var a9={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},wse=new Set(["bin","rel"]);te("\\dots",function(r){var e="\\dotso",t=r.expandAfterFuture().text;return t in a9?e=a9[t]:(t.slice(0,4)==="\\not"||t in Vr.math&&wse.has(Vr.math[t].group))&&(e="\\dotsb"),e});var Y3={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};te("\\dotso",function(r){var e=r.future().text;return e in Y3?"\\ldots\\,":"\\ldots"});te("\\dotsc",function(r){var e=r.future().text;return e in Y3&&e!==","?"\\ldots\\,":"\\ldots"});te("\\cdots",function(r){var e=r.future().text;return e in Y3?"\\@cdots\\,":"\\@cdots"});te("\\dotsb","\\cdots");te("\\dotsm","\\cdots");te("\\dotsi","\\!\\cdots");te("\\dotsx","\\ldots\\,");te("\\DOTSI","\\relax");te("\\DOTSB","\\relax");te("\\DOTSX","\\relax");te("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");te("\\,","\\tmspace+{3mu}{.1667em}");te("\\thinspace","\\,");te("\\>","\\mskip{4mu}");te("\\:","\\tmspace+{4mu}{.2222em}");te("\\medspace","\\:");te("\\;","\\tmspace+{5mu}{.2777em}");te("\\thickspace","\\;");te("\\!","\\tmspace-{3mu}{.1667em}");te("\\negthinspace","\\!");te("\\negmedspace","\\tmspace-{4mu}{.2222em}");te("\\negthickspace","\\tmspace-{5mu}{.277em}");te("\\enspace","\\kern.5em ");te("\\enskip","\\hskip.5em\\relax");te("\\quad","\\hskip1em\\relax");te("\\qquad","\\hskip2em\\relax");te("\\tag","\\@ifstar\\tag@literal\\tag@paren");te("\\tag@paren","\\tag@literal{({#1})}");te("\\tag@literal",r=>{if(r.macros.get("\\df@tag"))throw new Qe("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});te("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");te("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");te("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");te("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");te("\\newline","\\\\\\relax");te("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var xN=it(ts["Main-Regular"][84][1]-.7*ts["Main-Regular"][65][1]);te("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+xN+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");te("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+xN+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");te("\\hspace","\\@ifstar\\@hspacer\\@hspace");te("\\@hspace","\\hskip #1\\relax");te("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");te("\\ordinarycolon",":");te("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");te("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');te("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');te("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');te("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');te("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');te("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');te("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');te("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');te("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');te("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');te("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');te("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');te("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');te("∷","\\dblcolon");te("∹","\\eqcolon");te("≔","\\coloneqq");te("≕","\\eqqcolon");te("⩴","\\Coloneqq");te("\\ratio","\\vcentcolon");te("\\coloncolon","\\dblcolon");te("\\colonequals","\\coloneqq");te("\\coloncolonequals","\\Coloneqq");te("\\equalscolon","\\eqqcolon");te("\\equalscoloncolon","\\Eqqcolon");te("\\colonminus","\\coloneq");te("\\coloncolonminus","\\Coloneq");te("\\minuscolon","\\eqcolon");te("\\minuscoloncolon","\\Eqcolon");te("\\coloncolonapprox","\\Colonapprox");te("\\coloncolonsim","\\Colonsim");te("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");te("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");te("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");te("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");te("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");te("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");te("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");te("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");te("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");te("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");te("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");te("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");te("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");te("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");te("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");te("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");te("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");te("\\nleqq","\\html@mathml{\\@nleqq}{≰}");te("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");te("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");te("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");te("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");te("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");te("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");te("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");te("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");te("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");te("\\imath","\\html@mathml{\\@imath}{ı}");te("\\jmath","\\html@mathml{\\@jmath}{ȷ}");te("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");te("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");te("⟦","\\llbracket");te("⟧","\\rrbracket");te("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");te("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");te("⦃","\\lBrace");te("⦄","\\rBrace");te("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");te("⦵","\\minuso");te("\\darr","\\downarrow");te("\\dArr","\\Downarrow");te("\\Darr","\\Downarrow");te("\\lang","\\langle");te("\\rang","\\rangle");te("\\uarr","\\uparrow");te("\\uArr","\\Uparrow");te("\\Uarr","\\Uparrow");te("\\N","\\mathbb{N}");te("\\R","\\mathbb{R}");te("\\Z","\\mathbb{Z}");te("\\alef","\\aleph");te("\\alefsym","\\aleph");te("\\Alpha","\\mathrm{A}");te("\\Beta","\\mathrm{B}");te("\\bull","\\bullet");te("\\Chi","\\mathrm{X}");te("\\clubs","\\clubsuit");te("\\cnums","\\mathbb{C}");te("\\Complex","\\mathbb{C}");te("\\Dagger","\\ddagger");te("\\diamonds","\\diamondsuit");te("\\empty","\\emptyset");te("\\Epsilon","\\mathrm{E}");te("\\Eta","\\mathrm{H}");te("\\exist","\\exists");te("\\harr","\\leftrightarrow");te("\\hArr","\\Leftrightarrow");te("\\Harr","\\Leftrightarrow");te("\\hearts","\\heartsuit");te("\\image","\\Im");te("\\infin","\\infty");te("\\Iota","\\mathrm{I}");te("\\isin","\\in");te("\\Kappa","\\mathrm{K}");te("\\larr","\\leftarrow");te("\\lArr","\\Leftarrow");te("\\Larr","\\Leftarrow");te("\\lrarr","\\leftrightarrow");te("\\lrArr","\\Leftrightarrow");te("\\Lrarr","\\Leftrightarrow");te("\\Mu","\\mathrm{M}");te("\\natnums","\\mathbb{N}");te("\\Nu","\\mathrm{N}");te("\\Omicron","\\mathrm{O}");te("\\plusmn","\\pm");te("\\rarr","\\rightarrow");te("\\rArr","\\Rightarrow");te("\\Rarr","\\Rightarrow");te("\\real","\\Re");te("\\reals","\\mathbb{R}");te("\\Reals","\\mathbb{R}");te("\\Rho","\\mathrm{P}");te("\\sdot","\\cdot");te("\\sect","\\S");te("\\spades","\\spadesuit");te("\\sub","\\subset");te("\\sube","\\subseteq");te("\\supe","\\supseteq");te("\\Tau","\\mathrm{T}");te("\\thetasym","\\vartheta");te("\\weierp","\\wp");te("\\Zeta","\\mathrm{Z}");te("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");te("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");te("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");te("\\bra","\\mathinner{\\langle{#1}|}");te("\\ket","\\mathinner{|{#1}\\rangle}");te("\\braket","\\mathinner{\\langle{#1}\\rangle}");te("\\Bra","\\left\\langle#1\\right|");te("\\Ket","\\left|#1\\right\\rangle");var _N=r=>e=>{var t=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,a=e.consumeArg().tokens,s=e.macros.get("|"),o=e.macros.get("\\|");e.macros.beginGroup();var l=d=>v=>{r&&(v.macros.set("|",s),i.length&&v.macros.set("\\|",o));var g=d;if(!d&&i.length){var m=v.future();m.text==="|"&&(v.popToken(),g=!0)}return{tokens:g?i:n,numArgs:0}};e.macros.set("|",l(!1)),i.length&&e.macros.set("\\|",l(!0));var c=e.consumeArg().tokens,h=e.expandTokens([...a,...c,...t]);return e.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};te("\\bra@ket",_N(!1));te("\\bra@set",_N(!0));te("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");te("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");te("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");te("\\angln","{\\angl n}");te("\\blue","\\textcolor{##6495ed}{#1}");te("\\orange","\\textcolor{##ffa500}{#1}");te("\\pink","\\textcolor{##ff00af}{#1}");te("\\red","\\textcolor{##df0030}{#1}");te("\\green","\\textcolor{##28ae7b}{#1}");te("\\gray","\\textcolor{gray}{#1}");te("\\purple","\\textcolor{##9d38bd}{#1}");te("\\blueA","\\textcolor{##ccfaff}{#1}");te("\\blueB","\\textcolor{##80f6ff}{#1}");te("\\blueC","\\textcolor{##63d9ea}{#1}");te("\\blueD","\\textcolor{##11accd}{#1}");te("\\blueE","\\textcolor{##0c7f99}{#1}");te("\\tealA","\\textcolor{##94fff5}{#1}");te("\\tealB","\\textcolor{##26edd5}{#1}");te("\\tealC","\\textcolor{##01d1c1}{#1}");te("\\tealD","\\textcolor{##01a995}{#1}");te("\\tealE","\\textcolor{##208170}{#1}");te("\\greenA","\\textcolor{##b6ffb0}{#1}");te("\\greenB","\\textcolor{##8af281}{#1}");te("\\greenC","\\textcolor{##74cf70}{#1}");te("\\greenD","\\textcolor{##1fab54}{#1}");te("\\greenE","\\textcolor{##0d923f}{#1}");te("\\goldA","\\textcolor{##ffd0a9}{#1}");te("\\goldB","\\textcolor{##ffbb71}{#1}");te("\\goldC","\\textcolor{##ff9c39}{#1}");te("\\goldD","\\textcolor{##e07d10}{#1}");te("\\goldE","\\textcolor{##a75a05}{#1}");te("\\redA","\\textcolor{##fca9a9}{#1}");te("\\redB","\\textcolor{##ff8482}{#1}");te("\\redC","\\textcolor{##f9685d}{#1}");te("\\redD","\\textcolor{##e84d39}{#1}");te("\\redE","\\textcolor{##bc2612}{#1}");te("\\maroonA","\\textcolor{##ffbde0}{#1}");te("\\maroonB","\\textcolor{##ff92c6}{#1}");te("\\maroonC","\\textcolor{##ed5fa6}{#1}");te("\\maroonD","\\textcolor{##ca337c}{#1}");te("\\maroonE","\\textcolor{##9e034e}{#1}");te("\\purpleA","\\textcolor{##ddd7ff}{#1}");te("\\purpleB","\\textcolor{##c6b9fc}{#1}");te("\\purpleC","\\textcolor{##aa87ff}{#1}");te("\\purpleD","\\textcolor{##7854ab}{#1}");te("\\purpleE","\\textcolor{##543b78}{#1}");te("\\mintA","\\textcolor{##f5f9e8}{#1}");te("\\mintB","\\textcolor{##edf2df}{#1}");te("\\mintC","\\textcolor{##e0e5cc}{#1}");te("\\grayA","\\textcolor{##f6f7f7}{#1}");te("\\grayB","\\textcolor{##f0f1f2}{#1}");te("\\grayC","\\textcolor{##e3e5e6}{#1}");te("\\grayD","\\textcolor{##d6d8da}{#1}");te("\\grayE","\\textcolor{##babec2}{#1}");te("\\grayF","\\textcolor{##888d93}{#1}");te("\\grayG","\\textcolor{##626569}{#1}");te("\\grayH","\\textcolor{##3b3e40}{#1}");te("\\grayI","\\textcolor{##21242c}{#1}");te("\\kaBlue","\\textcolor{##314453}{#1}");te("\\kaGreen","\\textcolor{##71B307}{#1}");var wN={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Sse{constructor(e,t,n){this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new xse(_se,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new n9(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;t=this.popToken(),{tokens:i,end:n}=this.consumeArg(["]"])}else({tokens:i,start:t,end:n}=this.consumeArg());return this.pushToken(new Xi("EOF",n.loc)),this.pushTokens(i),new Xi("",Ci.range(t,n))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var i=this.future(),a,s=0,o=0;do{if(a=this.popToken(),t.push(a),a.text==="{")++s;else if(a.text==="}"){if(--s,s===-1)throw new Qe("Extra }",a)}else if(a.text==="EOF")throw new Qe("Unexpected end of input in a macro argument, expected '"+(e&&n?e[o]:"}")+"'",a);if(e&&n)if((s===0||s===1&&e[o]==="{")&&a.text===e[o]){if(++o,o===e.length){t.splice(-o,o);break}}else o=0}while(s!==0||n);return i.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:i,end:a}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new Qe("The length of delimiters doesn't match the number of args!");for(var n=t[0],i=0;ithis.settings.maxExpand)throw new Qe("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var t=this.popToken(),n=t.text,i=t.noexpand?null:this._getExpansion(n);if(i==null||e&&i.unexpandable){if(e&&i==null&&n[0]==="\\"&&!this.isDefined(n))throw new Qe("Undefined control sequence: "+n);return this.pushToken(t),!1}this.countExpansion(1);var a=i.tokens,s=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(var o=a.length-1;o>=0;--o){var l=a[o];if(l.text==="#"){if(o===0)throw new Qe("Incomplete placeholder at end of macro body",l);if(l=a[--o],l.text==="#")a.splice(o+1,1);else if(/^[1-9]$/.test(l.text))a.splice(o,2,...s[+l.text-1]);else throw new Qe("Not a valid argument number",l)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Xi(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),t.push(i)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(n=>n.text).join("")}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var i=typeof t=="function"?t(this):t;if(typeof i=="string"){var a=0;if(i.includes("#"))for(var s=i.replace(/##/g,"");s.includes("#"+(a+1));)++a;for(var o=new n9(i,this.settings),l=[],c=o.lex();c.text!=="EOF";)l.push(c),c=o.lex();l.reverse();var h={tokens:l,numArgs:a};return h}return i}isDefined(e){return this.macros.has(e)||Ho.hasOwnProperty(e)||Vr.math.hasOwnProperty(e)||Vr.text.hasOwnProperty(e)||wN.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:Ho.hasOwnProperty(e)&&!Ho[e].primitive}}var s9=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Qv=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),qx={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},o9={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class $g{constructor(e,t){this.mode="math",this.gullet=new Sse(e,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new Qe("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Xi("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,n}parseExpression(e,t){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if($g.endOfExpression.has(i.text)||t&&i.text===t||e&&Ho[i.text]&&Ho[i.text].infix)break;var a=this.parseAtom(t);if(a){if(a.type==="internal")continue}else break;n.push(a)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var t=-1,n,i=0;i=128)this.settings.strict&&(RI(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),e)),s={type:"textord",mode:"text",loc:Ci.range(e),text:t};else return null;if(this.consume(),a)for(var d=0;ds&&(s=a):a=1,i=n+e.length,n=t.indexOf(e,i);return s}function Ise(){return{enter:{mathFlow:r,mathFlowFenceMeta:e,mathText:a},exit:{mathFlow:i,mathFlowFence:n,mathFlowFenceMeta:t,mathFlowValue:o,mathText:s,mathTextData:o}};function r(l){const c={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[c]}},l)}function e(){this.buffer()}function t(){const l=this.resume(),c=this.stack[this.stack.length-1];c.type,c.meta=l}function n(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(l){const c=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),h=this.stack[this.stack.length-1];h.type,this.exit(l),h.value=c;const d=h.data.hChildren[0];d.type,d.tagName,d.children.push({type:"text",value:c}),this.data.mathFlowInside=void 0}function a(l){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},l),this.buffer()}function s(l){const c=this.resume(),h=this.stack[this.stack.length-1];h.type,this.exit(l),h.value=c,h.data.hChildren.push({type:"text",value:c})}function o(l){this.config.enter.data.call(this,l),this.config.exit.data.call(this,l)}}function Nse(r){let e=(r||{}).singleDollarTextMath;return e==null&&(e=!0),n.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` `,inConstruct:"mathFlowMeta"},{character:"$",after:e?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:t,inlineMath:n}};function t(a,s,o,l){const c=a.value||"",h=o.createTracker(l),d="$".repeat(Math.max(Pse(c,"$")+1,2)),v=o.enter("mathFlow");let g=h.move(d);if(a.meta){const m=o.enter("mathFlowMeta");g+=h.move(o.safe(a.meta,{after:` `,before:g,encode:["$"],...h.current()})),m()}return g+=h.move(` `),c&&(g+=h.move(c+` `)),g+=h.move(d),v(),g}function n(a,s,o){let l=a.value||"",c=1;for(e||c++;new RegExp("(^|[^$])"+"\\$".repeat(c)+"([^$]|$)").test(l);)c++;const h="$".repeat(c);/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^\$|\$$/.test(l))&&(l=" "+l+" ");let d=-1;for(;++dr.modelPath).filter(Boolean),Yx="kmb_teacher_model_options",Wx="kmb_teacher_avatar_options",Yl="系统默认",Jp="asset::";function qse(r){try{const e=localStorage.getItem(r);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function c9(r,e){localStorage.setItem(r,JSON.stringify(e))}function K3(r){const e=r.trim().toLowerCase();return e==="deepseek"||e==="openai"||e==="qwen"||e==="builtin"||e==="custom"?e:"custom"}function qa(r){return`${r.provider}|${r.label}|${r.modelId||""}`}function Xse(r){const[e="custom",t="",n=""]=r.split("|");return{provider:K3(e),label:t,modelId:n||void 0}}function Yse(r){try{const e=localStorage.getItem(r);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.every(n=>typeof n=="string")?t.map(n=>({label:n,provider:n.toLowerCase().includes("deepseek")?"deepseek":"custom"})).filter(n=>n.label.trim().length>0):t.map(n=>({label:typeof(n==null?void 0:n.label)=="string"?n.label.trim():"",provider:K3(typeof(n==null?void 0:n.provider)=="string"?n.provider:"custom"),modelId:typeof(n==null?void 0:n.modelId)=="string"&&n.modelId.trim()||void 0})).filter(n=>n.label.length>0):[]}catch{return[]}}function h9(r,e){localStorage.setItem(r,JSON.stringify(e))}function f9(r){return`${Jp}${r}`}function Jv(r){return r.startsWith(Jp)}function d9(r){return r.startsWith(Jp)?r.slice(Jp.length):""}function Wse(r){let e=r.replace(/\r\n/g,` `).replace(/\u00a0/g," ");const t=e.trim();return t.startsWith("```")?e=t.replace(/^```(?:latex|tex|math)?\s*\n?/i,"").replace(/\n```\s*$/m,""):e=t,e=e.replace(/\\n/g,` `),e=e.replace(/\n{4,}/g,` `),e=e.replace(/\\\[([\s\S]*?)\\\]/g,(n,i)=>` $$ ${i.trim()} $$ `),e=e.replace(/\$\$([\s\S]*?)\$\$/g,(n,i)=>` $$ ${i.trim()} $$ `),e=e.replace(/\\\(([\s\S]*?)\\\)/g,(n,i)=>`$${i.trim()}$`),e.trim()}function $se({text:r}){const e=he.useMemo(()=>Wse(r),[r]);return N.jsx("div",{className:"assistant-math-md",style:{wordBreak:"break-word",lineHeight:1.55,fontSize:14},children:N.jsx(oie,{remarkPlugins:[jse],rehypePlugins:[Dse],components:{p:({children:t})=>N.jsx("p",{style:{margin:"0.45em 0"},children:t}),ul:({children:t})=>N.jsx("ul",{style:{margin:"0.35em 0",paddingLeft:22},children:t}),ol:({children:t})=>N.jsx("ol",{style:{margin:"0.35em 0",paddingLeft:22},children:t}),li:({children:t})=>N.jsx("li",{style:{margin:"0.2em 0"},children:t}),h1:({children:t})=>N.jsx("h3",{style:{margin:"0.5em 0 0.25em",fontSize:"1.08em"},children:t}),h2:({children:t})=>N.jsx("h3",{style:{margin:"0.5em 0 0.25em",fontSize:"1.06em"},children:t}),h3:({children:t})=>N.jsx("h4",{style:{margin:"0.45em 0 0.2em",fontSize:"1.02em"},children:t}),code:({className:t,children:n,...i})=>t!=null&&t.includes("math")||t!=null&&t.includes("katex")?N.jsx("code",{className:t,...i,children:n}):N.jsx("code",{style:{background:"#e5e7eb",padding:"1px 6px",borderRadius:4,fontSize:"0.92em"},...i,children:n})},children:e})})}function Kse(){var Lr,cn,Ur,Wr;const e=Object.keys(Uo)[0]||"",n=Object.keys(Uo[e]||{})[0]||"",i=((Ur=(cn=(Lr=Uo[e])==null?void 0:Lr[n])==null?void 0:cn[0])==null?void 0:Ur.code)||"",[a,s]=he.useState(Uo),o=Object.keys(a||{}),[l,c]=he.useState(e),[h,d]=he.useState(n),[v,g]=he.useState(i),m=he.useRef(null),x=he.useRef(null),y=he.useRef(null),_=he.useRef(null),w=he.useRef(null),S=he.useRef(null),[A,C]=he.useState(i||"J7-EQ-001"),[M,E]=he.useState("什么是一元一次方程?给我一个例题并讲解。"),[O,D]=he.useState(null),[I,k]=he.useState(null),[U,V]=he.useState(null),[X,W]=he.useState(!1),[P,H]=he.useState([]),{role:z}=bu(),[$,B]=he.useState([]),[L,Y]=he.useState([]),G=[...Xx,...$],re=[...Ec.map(xe=>xe.name),...L],[ie,le]=he.useState(qa(Xx[0])),[ce,_e]=he.useState(Ec[0].name),[pe,ae]=he.useState([]),[oe,de]=he.useState(Yl),[ye,Ee]=he.useState(!0),[Re,Ne]=he.useState([]),[Be,$e]=he.useState(Ec[0].modelPath),[Ye,He]=he.useState("未检测"),[tt,ot]=he.useState([]),[ct,Ze]=he.useState(0),[bt,Se]=he.useState(0),[ke,We]=he.useState(!1),[Ke,rt]=he.useState(!1),[nt,De]=he.useState(null),[Q,ne]=he.useState("未加载预览"),[be,ee]=he.useState(null),[se,Pe]=he.useState(""),[Ae,Ge]=he.useState("deepseek"),[J,Oe]=he.useState(""),[Ve,Ue]=he.useState(""),je=z==="teacher",yt=he.useMemo(()=>typeof window<"u"&&"speechSynthesis"in window,[]);he.useEffect(()=>{B(Yse(Yx)),Y(qse(Wx)),vF().then(xe=>{Ne(xe)}).catch(()=>Ne([])),H_().then(xe=>{xe&&Object.keys(xe).length&&s(xe)}).catch(()=>{})},[]),he.useEffect(()=>{G.some(xe=>qa(xe)===ie)||le(qa(G[0]||Xx[0])),re.includes(ce)||_e(re[0]||Ec[0].name)},[$,L]),he.useEffect(()=>{const xe=Object.keys(a||{});!xe.includes(l)&&xe[0]&&c(xe[0])},[a,l]),he.useEffect(()=>{const xe=Object.keys((a==null?void 0:a[l])||{});xe.includes(h)||d(xe[0]||"")},[a,l,h]),he.useEffect(()=>{var st,lt;const xe=((st=a==null?void 0:a[l])==null?void 0:st[h])||[];xe.some(Ut=>Ut.code===v)||g(((lt=xe[0])==null?void 0:lt.code)||"")},[a,l,h,v]),he.useEffect(()=>{var st;const xe=(((st=a==null?void 0:a[l])==null?void 0:st[h])||[]).find(lt=>lt.code===v);xe&&C(xe.code)},[a,l,h,v]),he.useEffect(()=>{const xe=Ec.find(st=>st.name===ce);if(xe){if(!xe.modelPath){rt(!0);return}rt(!1),$e(xe.modelPath)}},[ce]),he.useEffect(()=>{if(!yt)return;const xe=()=>{const st=window.speechSynthesis.getVoices();ae(st),!Jv(oe)&&oe!==Yl&&!st.some(lt=>lt.name===oe)&&de(Yl)};return xe(),window.speechSynthesis.onvoiceschanged=xe,()=>{window.speechSynthesis.onvoiceschanged=null}},[yt,oe]);function vt(){const xe=y.current;if(xe){xe.pause(),xe.currentTime=0;try{xe.removeAttribute("src"),xe.load()}catch{}y.current=null}}function Ot(xe){if(!ye||!yt||Jv(oe))return;vt();const st=new SpeechSynthesisUtterance(xe);if(st.lang="zh-CN",oe!==Yl){const lt=pe.find(Ut=>Ut.name===oe);lt&&(st.voice=lt)}window.speechSynthesis.cancel(),window.speechSynthesis.speak(st)}function jt(xe,st){vt();const lt=new Audio(`data:${st||"audio/wav"};base64,${xe}`);y.current=lt;const Ut=()=>{y.current===lt&&(y.current=null)};return lt.addEventListener("ended",Ut),lt.addEventListener("error",Ut),lt.play().catch(br=>{throw Ut(),br})}function Nr(){const xe=d9(oe);if(!xe)return;vt();const st=new Audio(xe);y.current=st;const lt=()=>{y.current===st&&(y.current=null)};st.addEventListener("ended",lt),st.addEventListener("error",lt),st.play().catch(()=>{lt(),k("语音文件播放失败")})}he.useEffect(()=>{m.current&&(m.current.scrollTop=m.current.scrollHeight)},[P]),he.useEffect(()=>()=>{const xe=y.current;xe&&(xe.pause(),y.current=null),typeof window<"u"&&"speechSynthesis"in window&&window.speechSynthesis.cancel()},[]);async function Vt(){k(null),W(!0);const xe=new AbortController;x.current=xe;try{const st=Xse(ie),lt=await dF(M,A||void 0,O||void 0,st.label,st.provider,st.modelId,xe.signal);if(D(lt.session_id),V(lt.tts_status??null),H(Ut=>[...Ut,{role:"user",content:M},{role:"assistant",content:lt.answer}]),ye)if(Jv(oe))Nr();else if(lt.audio_base64)try{await jt(lt.audio_base64,lt.audio_mime)}catch{Ot(lt.answer)}else Ot(lt.answer);E("")}catch(st){st instanceof Error&&st.name==="AbortError"?k("已终止当前对话请求"):k(st instanceof Error?st.message:"请求失败")}finally{x.current=null,W(!1)}}function Qt(){x.current&&x.current.abort(),vt(),typeof window<"u"&&"speechSynthesis"in window&&window.speechSynthesis.cancel(),D(null),V(null),k("已终止当前对话,会话已重置")}function rr(){const xe=se.trim(),st=J.trim();if(!xe)return;const lt={label:xe,provider:Ae,modelId:st||void 0};if(G.some(br=>qa(br)===qa(lt)))return;const Ut=[...$,lt];B(Ut),h9(Yx,Ut),Pe(""),Oe("")}function ur(xe){const st=$.filter(lt=>qa(lt)!==qa(xe));B(st),h9(Yx,st)}function In(){const xe=Ve.trim();if(!xe||re.includes(xe))return;const st=[...L,xe];Y(st),c9(Wx,st),Ue("")}function vr(xe){const st=L.filter(lt=>lt!==xe);Y(st),c9(Wx,st)}async function Gn(xe){if(!(!xe||xe.length===0)){k(null);try{const st=await pF(xe[0]),lt=[st,...Re.filter(Ut=>Ut.name!==st.name)];Ne(lt),de(f9(st.url))}catch(st){k(st instanceof Error?st.message:"语音文件上传失败")}}}async function Yr(xe){k(null);try{await gF(xe);const st=Re.filter(lt=>lt.name!==xe);if(Ne(st),Jv(oe)){const lt=d9(oe);st.some(Ut=>Ut.url===lt)||de(Yl)}}catch(st){k(st instanceof Error?st.message:"语音文件删除失败")}}async function nr(){He("检测中..."),ot([]),Ze(0),Se(0),We(!0);try{const xe=async(nn,Qn=5e3)=>{const Ba=new AbortController,bl=window.setTimeout(()=>Ba.abort(),Qn);try{return await fetch(nn,{signal:Ba.signal})}finally{clearTimeout(bl)}},st=await xe(Be);if(!st.ok){He(`model3.json 不可访问(HTTP ${st.status})`),We(!1);return}const lt=await st.text();if(lt.trimStart().startsWith("nn.File).filter(Boolean),Zn=Object.values(br.Motions||{}).flatMap(nn=>nn.map(Qn=>Qn.File)).filter(Boolean),cr=[br.Moc,br.Physics,br.Pose,br.DisplayInfo,...br.Textures||[],...Ii,...Zn].filter(Boolean);Se(cr.length);const ds=[];let to=0;for(const nn of cr){const Qn=`${hn}${nn}`;(await xe(Qn)).ok?to+=1:ds.push(nn)}Ze(to),ds.length?(ot(ds),He(`模型不完整:共 ${cr.length} 个依赖,成功 ${to},缺失 ${ds.length}`)):He(`模型文件完整:共 ${cr.length} 个依赖,全部可访问`)}catch{He("检测失败,请检查路径或 JSON 格式")}finally{We(!1)}}return he.useEffect(()=>{nr()},[Be]),he.useEffect(()=>{async function xe(){var st,lt;if(Ke||!Be){De(null),ne("占位模式");return}ne("加载预览中..."),De(null);try{const Ut=await fetch(Be);if(!Ut.ok){ne(`预览加载失败(HTTP ${Ut.status})`);return}const hn=(lt=(st=(await Ut.json()).FileReferences)==null?void 0:st.Textures)==null?void 0:lt[0];if(!hn){ne("模型未提供贴图路径");return}const Zn=`${Be.slice(0,Be.lastIndexOf("/")+1)}${hn}`,cr=await fetch(Zn);if(!cr.ok){ne(`贴图不可访问(HTTP ${cr.status})`);return}De(Zn),ne("预览加载成功(当前为静态贴图预览)")}catch{ne("预览加载失败")}}xe()},[Be,Ke]),he.useEffect(()=>{let xe=!1;async function st(){if(Ke||!Be||!_.current||!w.current){ee(null),S.current&&(S.current.destroy(!0,{children:!0,texture:!1,baseTexture:!1}),S.current=null),w.current&&(w.current.innerHTML="");return}try{ee(null);const lt=_.current,Ut=w.current;if(!lt||!Ut)return;Ut.innerHTML="",window.PIXI=TQ;const br=new s3({autoStart:!0,resizeTo:lt,antialias:!0,backgroundAlpha:0});S.current=br,Ut.appendChild(br.view);const hn=await BP.from(Be);if(xe)return;br.stage.addChild(hn);const Ii=lt.clientWidth||640,Zn=lt.clientHeight||220,cr=Math.min(Ii*.95/hn.width,Zn*1.12/hn.height);hn.scale.set(cr),hn.anchor.set(.5,1),hn.x=Ii/2,hn.y=Zn+18}catch(lt){const Ut=lt instanceof Error?lt.message:"Live2D 加载失败";ee(Ut)}}return st(),()=>{xe=!0}},[Be,Ke,ce]),N.jsxs("div",{className:"grid",children:[N.jsx("div",{className:"col-6",children:N.jsxs("div",{className:"card",style:{height:"100%"},children:[N.jsx("div",{className:"card-header",children:N.jsx("div",{style:{fontSize:16,fontWeight:800},children:"学习交流区"})}),N.jsxs("div",{className:"card-body",style:{display:"flex",flexDirection:"column",gap:10,minHeight:640},children:[N.jsx("div",{ref:m,style:{flex:1,maxHeight:360,border:"1px solid #e5e7eb",borderRadius:12,padding:10,overflowY:"auto",background:"#fafafa"},children:P.length===0?N.jsx("div",{className:"muted",style:{fontSize:13},children:"开始提问后,这里会显示你和 AI 的对话记录。"}):P.map((xe,st)=>N.jsxs("div",{style:{marginBottom:8,padding:"8px 10px",borderRadius:10,background:xe.role==="assistant"?"#eef2ff":"#ffffff",border:"1px solid #e5e7eb"},children:[N.jsx("div",{style:{fontSize:12,color:"#6b7280",marginBottom:4},children:xe.role==="assistant"?"AI":"我"}),N.jsx("div",{style:{wordBreak:"break-word"},children:xe.role==="assistant"?N.jsx($se,{text:xe.content}):N.jsx("span",{style:{whiteSpace:"pre-wrap",lineHeight:1.45},children:xe.content})})]},`${xe.role}-${st}`))}),N.jsxs("div",{style:{borderTop:"1px solid #e5e7eb",paddingTop:10},children:[N.jsxs("div",{className:"row",style:{marginBottom:8},children:[N.jsx("div",{style:{flex:1},children:N.jsxs("div",{className:"row",style:{gap:8,flexWrap:"nowrap"},children:[N.jsxs("div",{style:{flex:1},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"年级"}),N.jsx("select",{className:"select",value:l,onChange:xe=>c(xe.target.value),children:o.map(xe=>N.jsx("option",{value:xe,children:xe},xe))})]}),N.jsxs("div",{style:{flex:1},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"类别"}),N.jsx("select",{className:"select",value:h,onChange:xe=>d(xe.target.value),children:Object.keys((a==null?void 0:a[l])||{}).map(xe=>N.jsx("option",{value:xe,children:xe},xe))})]}),N.jsxs("div",{style:{flex:1.2},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"具体知识点"}),N.jsx("select",{className:"select",value:v,onChange:xe=>g(xe.target.value),children:(((Wr=a==null?void 0:a[l])==null?void 0:Wr[h])||[]).map(xe=>N.jsx("option",{value:xe.code,children:xe.name},xe.code))})]})]})}),N.jsxs("label",{className:"row",style:{gap:6,marginTop:20},children:[N.jsx("input",{type:"checkbox",checked:ye,onChange:xe=>Ee(xe.target.checked)}),N.jsx("span",{className:"muted",style:{fontSize:12},children:"语音回复"})]})]}),N.jsxs("div",{className:"muted",style:{fontSize:12,marginBottom:8},children:["知识点编码:",A]}),N.jsx("textarea",{className:"textarea",value:M,onChange:xe=>E(xe.target.value),placeholder:"输入你想问的问题..."}),N.jsxs("div",{className:"row",style:{marginTop:8,justifyContent:"space-between",flexWrap:"nowrap",alignItems:"center",gap:8},children:[N.jsxs("span",{className:"mono",style:{fontSize:12,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:["session_id: ",O??"(新会话)"]}),N.jsxs("div",{className:"row",style:{gap:8,marginLeft:"auto",flexShrink:0},children:[N.jsx("button",{className:"btn",onClick:Qt,disabled:!X&&!O,children:"终止对话"}),N.jsx("button",{className:"btn primary",onClick:Vt,disabled:X||!M.trim(),children:X?"思考中...":"发送"})]})]}),U?N.jsxs("div",{className:"muted",style:{marginTop:8,fontSize:12},children:["本地语音状态:",U]}):null,I?N.jsx("div",{className:"error",style:{marginTop:8},children:I}):null]})]})]})}),N.jsx("div",{className:"col-6",children:N.jsxs("div",{className:"card",style:{height:"100%"},children:[N.jsxs("div",{className:"card-header",children:[N.jsx("div",{style:{fontSize:16,fontWeight:800},children:"数字人形象与模型配置"}),N.jsx("div",{className:"muted",style:{marginTop:6},children:"大模型切换、形象切换、Live2D 展示"})]}),N.jsxs("div",{className:"card-body",style:{display:"flex",flexDirection:"column",gap:12,minHeight:640},children:[N.jsxs("div",{className:"row",style:{gap:10},children:[N.jsxs("div",{style:{flex:1},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"大语言模型"}),N.jsx("select",{className:"select",value:ie,onChange:xe=>le(xe.target.value),children:G.map(xe=>N.jsx("option",{value:qa(xe),children:xe.label},qa(xe)))})]}),N.jsxs("div",{style:{flex:1},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"数字人形象(Live2D)"}),N.jsx("select",{className:"select",value:ce,onChange:xe=>_e(xe.target.value),children:re.map(xe=>N.jsx("option",{value:xe,children:xe},xe))})]}),N.jsxs("div",{style:{flex:1},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"语音选择"}),N.jsxs("select",{className:"select",value:oe,onChange:xe=>de(xe.target.value),children:[N.jsx("option",{value:Yl,children:Yl}),Re.map(xe=>N.jsxs("option",{value:f9(xe.url),children:["文件:",xe.name]},`asset-${xe.name}`)),pe.map(xe=>N.jsxs("option",{value:xe.name,children:["系统:",xe.name,"(",xe.lang,")"]},`${xe.name}-${xe.lang}`))]})]})]}),N.jsxs("div",{ref:_,style:{border:"1px solid #e5e7eb",borderRadius:12,minHeight:520,position:"relative",overflow:"hidden",background:"linear-gradient(180deg, #f9fafb, #eef2ff)"},children:[N.jsx("div",{ref:w,style:{position:"absolute",inset:0}}),N.jsx("div",{style:{position:"absolute",left:10,bottom:10,right:10,textAlign:"center",pointerEvents:"none"},children:!Ke&&!be&&nt?null:N.jsxs(N.Fragment,{children:[nt&&!Ke?N.jsx("img",{src:nt,alt:ce,style:{maxHeight:420,maxWidth:"100%",objectFit:"contain",borderRadius:10}}):N.jsx("div",{style:{fontSize:50},children:Ke?"🤖":"🧩"}),N.jsx("div",{style:{fontWeight:700,marginTop:6},children:ce}),N.jsx("div",{className:"muted",style:{fontSize:12,marginTop:4},children:Ke?"当前为占位模式":`当前模型:${Be}`}),N.jsx("div",{className:"muted",style:{fontSize:12,marginTop:2},children:Q}),be?N.jsx("div",{className:"error",style:{marginTop:8,pointerEvents:"auto"},children:be}):null]})})]}),je?N.jsxs("div",{style:{border:"1px dashed #c7d2fe",borderRadius:10,padding:10,background:"#f8faff"},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:8},children:"教师端:模型/形象管理与测试加载器"}),N.jsxs("div",{className:"row",style:{alignItems:"flex-end",gap:8},children:[N.jsxs("div",{style:{flex:1},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:4},children:"新增大语言模型名称"}),N.jsx("input",{className:"input",value:se,onChange:xe=>Pe(xe.target.value),placeholder:"如:DeepSeek Chat 教学版"})]}),N.jsxs("div",{style:{width:120},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:4},children:"Provider"}),N.jsxs("select",{className:"select",value:Ae,onChange:xe=>Ge(K3(xe.target.value)),children:[N.jsx("option",{value:"deepseek",children:"deepseek"}),N.jsx("option",{value:"openai",children:"openai"}),N.jsx("option",{value:"qwen",children:"qwen"}),N.jsx("option",{value:"custom",children:"custom"})]})]}),N.jsxs("div",{style:{flex:1},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:4},children:"Model ID"}),N.jsx("input",{className:"input",value:J,onChange:xe=>Oe(xe.target.value),placeholder:"如:deepseek-chat"})]}),N.jsx("button",{className:"btn",onClick:rr,children:"上传/添加模型"})]}),N.jsx("div",{className:"row",style:{marginTop:6,gap:6},children:$.map(xe=>N.jsxs("button",{className:"btn danger",onClick:()=>ur(xe),children:["删除模型:",xe.label,"(",xe.provider,xe.modelId?`/${xe.modelId}`:"",")"]},qa(xe)))}),N.jsxs("div",{className:"row",style:{alignItems:"flex-end",gap:8,marginTop:8},children:[N.jsxs("div",{style:{flex:1},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:4},children:"新增数字人形象名称"}),N.jsx("input",{className:"input",value:Ve,onChange:xe=>Ue(xe.target.value),placeholder:"如:Live2D 校园助手C"})]}),N.jsx("button",{className:"btn",onClick:In,children:"上传/添加形象"})]}),N.jsx("div",{className:"row",style:{marginTop:6,gap:6},children:L.map(xe=>N.jsxs("button",{className:"btn danger",onClick:()=>vr(xe),children:["删除形象:",xe]},xe))}),N.jsxs("div",{style:{marginTop:10,borderTop:"1px solid #dbe2ff",paddingTop:10},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"语音文件管理(教师端)"}),N.jsx("input",{className:"input",type:"file",accept:".wav,.mp3,.m4a,.ogg",onChange:xe=>Gn(xe.target.files)}),N.jsx("div",{className:"row",style:{marginTop:6,gap:6},children:Re.map(xe=>N.jsxs("button",{className:"btn danger",onClick:()=>Yr(xe.name),children:["删除语音:",xe.name]},xe.name))})]}),N.jsxs("div",{style:{marginTop:10,borderTop:"1px solid #dbe2ff",paddingTop:10},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"Live2D 测试加载器(教师端)"}),N.jsx("select",{className:"select",value:Be,onChange:xe=>$e(xe.target.value),style:{marginBottom:8},children:Vse.map(xe=>N.jsx("option",{value:xe,children:xe},xe))}),N.jsxs("div",{className:"row",style:{marginTop:8,justifyContent:"space-between"},children:[N.jsxs("label",{className:"row",style:{gap:6},children:[N.jsx("input",{type:"checkbox",checked:Ke,onChange:xe=>rt(xe.target.checked)}),N.jsx("span",{className:"muted",style:{fontSize:12},children:"占位模式"})]}),N.jsx("button",{className:"btn",onClick:nr,disabled:ke,children:ke?"检测中...":"检测模型文件"})]}),N.jsx("div",{className:"muted",style:{fontSize:12,marginTop:6},children:Ye}),N.jsxs("div",{className:"muted",style:{fontSize:12,marginTop:4},children:["已验证依赖:",ct,"/",bt]}),tt.length?N.jsxs("div",{className:"error",style:{marginTop:8},children:["缺失文件:",tt.join(",")]}):null]})]}):null]})]})})]})}const Zse={选择:"选择题",填空:"填空题",计算:"计算题",判断:"判断题"};function Qse(r){const e=(r||"").trim();return e?Zse[e]||e:"未标注"}function Jse(r,e){const t=Object.fromEntries(e.map(i=>[i.id,i])),n=[...r].sort((i,a)=>Date.parse(a.created_at)-Date.parse(i.created_at)).slice(0,50).map(i=>{var o;const a=((o=t[i.exercise_id])==null?void 0:o.title)||`题目 ${String(i.exercise_id).slice(0,8)}…`,s=i.is_correct===!0?"正确":i.is_correct===!1?"错误":"待判定";return`${a} — ${s}`});return n.length?n.join(` `):"暂无作答记录"}function eoe(){var Q;const{role:r}=bu(),e=r==="teacher",t=Object.keys(Uo)[0]||"",n=Object.keys(Uo[t]||{})[0]||"",[i,a]=he.useState(Uo),s=Object.keys(i||{}),[o,l]=he.useState(t),c=Object.keys((i==null?void 0:i[o])||{}),[h,d]=he.useState(n),v=((Q=i==null?void 0:i[o])==null?void 0:Q[h])||[],[g,m]=he.useState([]),[x,y]=he.useState(""),[_,w]=he.useState("解一元一次方程"),[S,A]=he.useState("解方程:2x + 3 = 11。"),[C,M]=he.useState("选择"),[E,O]=he.useState(""),[D,I]=he.useState(""),[k,U]=he.useState(2),[V,X]=he.useState([]),[W,P]=he.useState(""),[H,z]=he.useState({}),[$,B]=he.useState(null),[L,Y]=he.useState(""),[G,re]=he.useState({}),[ie,le]=he.useState(!1),[ce,_e]=he.useState(!1),[pe,ae]=he.useState(null),[oe,de]=he.useState(null),[ye,Ee]=he.useState(null),[Re,Ne]=he.useState(!1),[Be,$e]=he.useState({}),[Ye,He]=he.useState(10),tt=he.useMemo(()=>{var be;const ne={};for(const ee of Object.keys(i||{}))for(const se of Object.keys((i==null?void 0:i[ee])||{}))for(const Pe of((be=i==null?void 0:i[ee])==null?void 0:be[se])||[])ne[Pe.code]=Pe.name;return ne},[i]);function ot(ne){m(be=>be.includes(ne)?be.filter(ee=>ee!==ne):be)}async function ct(){ae(null);try{const ne=await bF(x||void 0);X(ne),ne.length&&!W&&P(ne[0].id),$e({}),re({}),le(!1),_e(!1)}catch(ne){ae(ne instanceof Error?ne.message:"加载题目失败")}}function Ze(ne,be){const ee=new Set(ne.map(J=>J.id)),se=be.filter(J=>ee.has(J.exercise_id)),Pe=[...se].sort((J,Oe)=>Date.parse(J.created_at)-Date.parse(Oe.created_at)),Ae={};for(const J of Pe)Ae[J.exercise_id]=J;re(Ae);const Ge=new Set(se.map(J=>J.exercise_id)).size;le(ne.length>0&&Ge>=ne.length)}he.useEffect(()=>{const ne=Object.keys((i==null?void 0:i[o])||{});!ne.includes(h)&&ne[0]&&d(ne[0])},[i,o,h]),he.useEffect(()=>{y(g.length?g.join(","):"")},[g]),he.useEffect(()=>{ct()},[]),he.useEffect(()=>{H_().then(ne=>{ne&&Object.keys(ne).length&&a(ne)}).catch(()=>{})},[]),he.useEffect(()=>{r==="student"&&z(ne=>{const be={};for(const ee of V)be[ee.id]=ne[ee.id]??"";return be})},[V,r]);async function bt(ne,be,ee){var se;ae(null),de(null),Ne(!0);try{const Pe=await mF(ne,be,ee,ee==="topic_weight"?{knowledge_grade:o,knowledge_category:h}:void 0),Ae={},Ge=[],J=new Set;for(const Ue of Pe.items){const je=Ue.item_ref;J.has(je)||(J.add(je),Ae[je]=Ue.reason||"",Ge.push(je))}const Oe=await xF(Ge);if(Oe.length!==Ge.length)throw new Error(`组卷成功但仅加载 ${Oe.length}/${Ge.length} 道题目,请刷新后重试`);X(Oe),Oe.length&&P(Oe[0].id),z(Object.fromEntries(Oe.map(Ue=>[Ue.id,""]))),re({}),le(!1),_e(!1);const Ve=(se=Oe[0])==null?void 0:se.knowledge_code;Ve&&y(Ve),$e(Ae),B(null),Y("")}catch(Pe){ae(Pe instanceof Error?Pe.message:"获取推荐失败")}finally{Ne(!1)}}function Se(){if(g.length)return g.join(",")}function ke(){const Pe=`title,body,knowledge_code,difficulty,question_type,correct_answer,resolution "解方程","解下列方程:2x+3=9","J7-EQ-001",1,"计算","x=3","" "应用题","某数加4后等于10,求该数","J7-EQ-001",2,"填空","6","" "判断","下列说法是否正确:0 是正数。","J7-EQ-001",1,"判断","错","" `,Ae=new Blob([Pe],{type:"text/csv;charset=utf-8;"}),Ge=URL.createObjectURL(Ae),J=document.createElement("a");J.href=Ge,J.download="exercise_import_template.csv",J.click(),URL.revokeObjectURL(Ge)}async function We(){if(ae(null),de(null),!ye){ae("请先选择 CSV 或 JSON 文件");return}Ne(!0);try{const ne=await hF(ye,x||void 0);await ct(),de(`导入完成:成功 ${ne.created} 条,跳过 ${ne.skipped} 条`)}catch(ne){ae(ne instanceof Error?ne.message:"上传失败(需要 teacher 权限)")}finally{Ne(!1)}}async function Ke(){if(ae(null),de(null),!ye){ae("请先选择 CSV 或 JSON 文件");return}Ne(!0);try{const ne=await fF(ye,x||void 0);de(`预览完成:可导入 ${ne.valid} 条,不合格 ${ne.invalid} 条`)}catch(ne){ae(ne instanceof Error?ne.message:"预览失败(需要 teacher 权限)")}finally{Ne(!1)}}async function rt(){ae(null),de(null),Ne(!0);try{await yF({title:_,body:S,knowledge_code:x,difficulty:k,question_type:C,correct_answer:E,resolution:D}),await ct()}catch(ne){ae(ne instanceof Error?ne.message:"创建失败(需要teacher权限)")}finally{Ne(!1)}}async function nt(){if(V.length){ae(null),B(null),Ne(!0);try{for(const J of V)await _F(J.id,H[J.id]??"");const ne=await JT();Ze(V,ne),_e(!0);const be=new Set(V.map(J=>J.id)),ee=[...ne].filter(J=>be.has(J.exercise_id)).sort((J,Oe)=>Date.parse(J.created_at)-Date.parse(Oe.created_at)),se={};for(const J of ee)se[J.exercise_id]=J;let Pe=0,Ae=0,Ge=0;for(const J of V){const Oe=se[J.id];Oe?Oe.is_correct===!0?Pe+=1:Oe.is_correct===!1?Ae+=1:Ge+=1:Ge+=1}B({kind:"batch",correct:Pe,wrong:Ae,pending:Ge,total:V.length})}catch(ne){ae(ne instanceof Error?ne.message:"提交失败")}finally{Ne(!1)}}}async function De(){ae(null),Ne(!0);try{const ne=await JT();Ze(V,ne),Y(Jse(ne,V))}catch(ne){ae(ne instanceof Error?ne.message:"加载失败")}finally{Ne(!1)}}return N.jsxs("div",{className:"grid",children:[N.jsx("div",{className:e?"col-12":"col-5",children:N.jsxs("div",{className:"card",children:[N.jsxs("div",{className:"card-header",children:[N.jsx("div",{style:{fontSize:16,fontWeight:800},children:"试卷规划"}),N.jsx("div",{className:"muted",style:{marginTop:6},children:e?"题目创建(教师)":null})]}),N.jsxs("div",{className:"card-body",children:[N.jsxs("div",{className:"grid",children:[N.jsxs("div",{className:"col-12",children:[N.jsxs("div",{className:"row",style:{gap:8,alignItems:"flex-start"},children:[N.jsxs("div",{style:{flex:1,minWidth:0},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"年级"}),N.jsx("select",{className:"select",value:o,onChange:ne=>l(ne.target.value),children:s.map(ne=>N.jsx("option",{value:ne,children:ne},ne))})]}),N.jsxs("div",{style:{flex:1,minWidth:0},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"类别"}),N.jsx("select",{className:"select",value:h,onChange:ne=>d(ne.target.value),children:c.map(ne=>N.jsx("option",{value:ne,children:ne},ne))})]})]}),N.jsxs("div",{style:{border:"1px solid #e5e7eb",borderRadius:12,padding:12,background:"#fff",marginTop:12},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"具体知识点(多选,作为题目内容)"}),N.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr",gap:8},children:v.map(ne=>{const be=g.includes(ne.code);return N.jsxs("label",{style:{display:"flex",flexDirection:"row",alignItems:"flex-start",gap:10,cursor:"pointer",width:"100%",flexWrap:"nowrap"},children:[N.jsx("input",{type:"checkbox",checked:be,style:{flexShrink:0,width:16,height:16,marginTop:2},onChange:ee=>{if(ee.target.checked){m(Pe=>Pe.includes(ne.code)?Pe:[...Pe,ne.code]);return}m(Pe=>Pe.includes(ne.code)?Pe.filter(Ae=>Ae!==ne.code):Pe)}}),N.jsxs("span",{className:"muted",style:{fontSize:12,flex:1,minWidth:0,lineHeight:1.45,wordBreak:"break-word",overflowWrap:"anywhere"},children:[ne.name,"(",ne.code,")"]})]},ne.code)})})]}),N.jsxs("div",{style:{border:"1px solid #e5e7eb",borderRadius:12,padding:12,background:"#fff",marginTop:12},children:[N.jsxs("div",{className:"row",style:{justifyContent:"space-between",alignItems:"center",gap:10},children:[N.jsx("div",{className:"muted",style:{fontSize:12},children:"已选择知识点"}),g.length?N.jsxs("div",{className:"muted",style:{fontSize:12},children:[g.length," 个"]}):null]}),g.length?N.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:8,marginTop:10},children:g.map(ne=>N.jsxs("button",{className:"btn",type:"button",style:{padding:"6px 10px",lineHeight:"20px",borderRadius:999},onClick:()=>ot(ne),title:"点击移除该知识点",children:[tt[ne]?`${tt[ne]}(${ne})`:ne," ×"]},ne))}):N.jsx("div",{className:"muted",style:{fontSize:12,marginTop:10},children:"暂无"})]})]}),r==="student"?N.jsx("div",{className:"col-12",style:{marginTop:10},children:N.jsxs("div",{className:"row",style:{alignItems:"center",gap:8,flexWrap:"nowrap"},children:[N.jsx("span",{className:"muted",style:{fontSize:12},children:"试卷题数"}),N.jsx("input",{className:"input",style:{width:120},type:"number",min:1,max:50,value:Ye,onChange:ne=>He(Number(ne.target.value))}),N.jsx("button",{className:"btn primary",onClick:()=>bt(Se(),Ye,"topic_weight"),disabled:Re||!g.length,children:"开始组卷"}),N.jsx("button",{className:"btn",onClick:()=>bt(void 0,Ye,"personalized"),disabled:Re,children:"个性推荐组卷"})]})}):null,e?N.jsxs(N.Fragment,{children:[N.jsxs("div",{className:"col-12",children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"题目类型"}),N.jsxs("select",{className:"select",value:C,onChange:ne=>M(ne.target.value),children:[N.jsx("option",{value:"选择",children:"选择题"}),N.jsx("option",{value:"填空",children:"填空题"}),N.jsx("option",{value:"计算",children:"计算题"}),N.jsx("option",{value:"判断",children:"判断题"})]})]}),N.jsxs("div",{className:"col-12",children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"题目标题"}),N.jsx("input",{className:"input",value:_,onChange:ne=>w(ne.target.value)})]}),N.jsxs("div",{className:"col-12",children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"题干"}),N.jsx("textarea",{className:"textarea",value:S,onChange:ne=>A(ne.target.value)})]}),N.jsxs("div",{className:"col-12",children:[N.jsxs("div",{className:"muted",style:{fontSize:12,marginBottom:6,display:"flex",alignItems:"baseline",gap:8,flexWrap:"wrap"},children:[N.jsx("span",{children:"正确答案"}),N.jsx("span",{style:{fontWeight:400},children:"如果有多个答案可用 / 分割"})]}),N.jsx("textarea",{className:"textarea",value:E,onChange:ne=>O(ne.target.value),placeholder:"用于判分与错题解析(可输入多个备选,用 / 或换行、| 分隔)"})]}),N.jsxs("div",{className:"col-12",children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"题目解析"}),N.jsx("textarea",{className:"textarea",value:D,onChange:ne=>I(ne.target.value),placeholder:"学生答错后,在“全部作答完”后显示解析"})]}),N.jsxs("div",{className:"col-12",children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"难度(1-5)"}),N.jsx("input",{className:"input",type:"number",min:1,max:5,value:k,onChange:ne=>U(Number(ne.target.value))})]})]}):null,N.jsx("div",{className:"col-12 row",children:e?N.jsxs(N.Fragment,{children:[N.jsx("button",{className:"btn primary",onClick:rt,disabled:Re,children:"创建题目(teacher)"}),N.jsx("button",{className:"btn",onClick:ct,disabled:Re,style:{marginLeft:8},children:"刷新题目列表"})]}):null})]}),pe?N.jsx("div",{className:"error",style:{marginTop:12},children:pe}):null,oe?N.jsx("div",{className:"success",style:{marginTop:12},children:oe}):null]})]})}),e?N.jsx("div",{className:"col-12",children:N.jsxs("div",{className:"card",children:[N.jsxs("div",{className:"card-header",children:[N.jsx("div",{style:{fontSize:16,fontWeight:800},children:"题目上传导入"}),N.jsx("div",{className:"muted",style:{marginTop:6},children:"支持模板下载、预览校验、批量导入到题库"})]}),N.jsxs("div",{className:"card-body",style:{display:"flex",flexDirection:"column",gap:10},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"上传文件(CSV/JSON)"}),N.jsx("input",{className:"input",type:"file",accept:".csv,.json,application/json,text/csv",onChange:ne=>{var be;return Ee(((be=ne.target.files)==null?void 0:be[0])??null)}}),N.jsx("div",{className:"muted",style:{fontSize:12},children:"CSV 列名:title, body, knowledge_code, difficulty;可选 question_type(选择/填空/计算/判断), correct_answer, resolution。若文件缺少 knowledge_code,会使用上方勾选知识点对应的编码(多选时为逗号拼接)。"}),N.jsx("div",{style:{marginTop:8,display:"flex",justifyContent:"flex-end"},children:N.jsxs("div",{className:"row",style:{gap:8,alignItems:"center",flexWrap:"wrap"},children:[N.jsx("button",{className:"btn",type:"button",onClick:ke,disabled:Re,children:"下载CSV模板"}),N.jsx("button",{className:"btn",type:"button",onClick:Ke,disabled:Re,children:"预览校验"}),N.jsx("button",{className:"btn primary",type:"button",onClick:We,disabled:Re,children:"上传并导入题目"})]})})]})]})}):null,r==="student"?N.jsx("div",{className:"col-7",children:N.jsxs("div",{className:"card",children:[N.jsxs("div",{className:"card-header",children:[N.jsx("div",{style:{fontSize:16,fontWeight:800},children:"作答"}),null]}),N.jsxs("div",{className:"card-body",children:[V.length?N.jsx("div",{style:{maxHeight:"min(70vh, 780px)",overflowY:"auto",paddingRight:6,marginBottom:12},children:V.map((ne,be)=>{const ee=G[ne.id],se=ce&&ie&&ee&&ee.is_correct===!1,Pe=ce&&ie&&ee&&ee.is_correct===!0,Ae=ce&&ie&&ee&&ee.is_correct!==!0&&ee.is_correct!==!1;return N.jsxs("div",{className:"card",style:{padding:12,borderRadius:12,marginBottom:12,border:"1px solid #e5e7eb"},children:[N.jsxs("div",{className:"muted",style:{fontSize:11,marginBottom:6},children:["第 ",be+1," 题 / 共 ",V.length," 题"]}),N.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:8,flexWrap:"wrap"},children:[N.jsx("span",{style:{fontWeight:700},children:ne.title}),N.jsx("span",{className:"pill",style:{fontSize:12,fontWeight:600},children:Qse(ne.question_type)})]}),N.jsx("div",{className:"muted",style:{marginTop:8,whiteSpace:"pre-wrap"},children:ne.body}),Be[ne.id]?N.jsxs("div",{className:"muted",style:{marginTop:8,fontSize:12},children:["推荐原因:",Be[ne.id]]}):null,N.jsxs("div",{style:{marginTop:10},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"你的答案"}),N.jsx("input",{className:"input",value:H[ne.id]??"",onChange:Ge=>z(J=>({...J,[ne.id]:Ge.target.value})),disabled:Re})]}),Ae?N.jsx("div",{className:"muted",style:{marginTop:8,fontSize:12,fontWeight:600},children:"本题:待判定"}):null,Pe?N.jsxs("div",{style:{marginTop:10,padding:12,borderRadius:10,border:"1px solid #bbf7d0",background:"#f0fdf4",boxSizing:"border-box"},children:[N.jsx("div",{style:{fontSize:12,fontWeight:700,color:"#166534",marginBottom:6},children:"作答正确"}),N.jsx("div",{style:{fontSize:13,color:"#1f2937",lineHeight:1.45},children:"本题回答正确。"})]}):null,se?N.jsxs("div",{style:{marginTop:10,padding:12,borderRadius:10,border:"1px solid #fecaca",background:"#fef2f2",boxSizing:"border-box"},children:[N.jsx("div",{style:{fontSize:12,fontWeight:700,color:"#b91c1c",marginBottom:8},children:"本题有误 · 参考答案与解析"}),N.jsxs("div",{style:{fontSize:13,whiteSpace:"pre-wrap",color:"#1f2937",lineHeight:1.45},children:[N.jsxs("div",{children:[N.jsx("span",{style:{color:"#991b1b",fontWeight:600},children:"正确答案:"}),(ne.correct_answer||"").trim()||"(未单独录入,请见题干)"]}),N.jsxs("div",{style:{marginTop:8},children:[N.jsx("span",{style:{color:"#991b1b",fontWeight:600},children:"解析:"}),(ne.resolution||"").trim()||"暂无"]})]})]}):null]},ne.id)})}):N.jsx("div",{className:"muted",style:{marginBottom:10},children:"请先在左侧组卷(开始组卷 / 个性推荐组卷)。"}),N.jsxs("div",{className:"row",style:{flexWrap:"wrap",gap:8},children:[N.jsx("button",{className:"btn primary",onClick:nt,disabled:Re||!V.length,children:"提交整卷作答"}),N.jsx("button",{className:"btn",onClick:De,disabled:Re,children:"查看我的作答记录"})]}),$?N.jsx("div",{style:{marginTop:12},children:$.kind==="batch"?N.jsxs("div",{className:"success",style:{padding:12,borderRadius:10},children:["已提交整卷共 ",$.total," 题:答对 ",$.correct,",答错 ",$.wrong,$.pending?`,待判定 ${$.pending}`:"","。错题解析已在各题下方显示。"]}):N.jsx("div",{className:"muted",style:{fontSize:13},children:$.message})}):null,L?N.jsxs("div",{style:{marginTop:12},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"作答记录(最近 50 条)"}),N.jsx("pre",{style:{margin:0,whiteSpace:"pre-wrap",fontSize:13,fontFamily:"inherit"},children:L})]}):null]})]})}):null]})}function toe(){const r=yu(),{role:e,loading:t}=bu();return he.useEffect(()=>{t||r(e==="teacher"?"/analytics/teacher":"/analytics/student",{replace:!0})},[t,e,r]),N.jsx("div",{className:"grid",children:N.jsx("div",{className:"col-12",children:N.jsxs("div",{className:"card",children:[N.jsxs("div",{className:"card-header",children:[N.jsx("div",{style:{fontSize:16,fontWeight:800},children:"学情统计"}),N.jsx("div",{className:"muted",style:{marginTop:6},children:"跳转中..."})]}),N.jsx("div",{className:"card-body",children:N.jsx("div",{className:"muted",children:"根据当前角色自动跳转到学生/教师页面。"})})]})})})}const ul=["#3b82f6","#60a5fa","#2563eb","#93c5fd","#1d4ed8","#38bdf8","#0ea5e9"];function Hd(r){return`${(r*100).toFixed(1)}%`}function Kg(r,e){return r.length>e?`${r.slice(0,e)}…`:r}function roe({rows:r,kind:e}){return r.length?e==="pie"?N.jsx(TN,{rows:r,mode:"attempts"}):e==="line"?N.jsx(ioe,{rows:r}):N.jsx(noe,{rows:r}):N.jsx("div",{className:"muted",children:"暂无统计数据。"})}function noe({rows:r}){const a=Math.min(48,Math.max(24,516/r.length-12)),s=Math.max(320,44+r.length*(a+12)+24);return N.jsxs("div",{children:[N.jsx("div",{style:{overflowX:"auto"},children:N.jsxs("svg",{width:s,height:288,style:{display:"block",minWidth:"100%"},children:[[0,25,50,75,100].map(l=>{const c=216-l/100*200;return N.jsxs("g",{children:[N.jsx("line",{x1:44,y1:c,x2:s-12,y2:c,stroke:"#e5e7eb",strokeWidth:1}),N.jsxs("text",{x:38,y:c+4,textAnchor:"end",fontSize:10,fill:"#6b7280",children:[l,"%"]})]},l)}),r.map((l,c)=>{const h=44+c*(a+12),d=Math.max(0,Math.min(1,l.accuracy))*200,v=216-d;return N.jsxs("g",{children:[N.jsx("rect",{x:h,y:v,width:a,height:d,rx:4,fill:ul[c%ul.length]}),N.jsx("text",{x:h+a/2,y:v-4,textAnchor:"middle",fontSize:10,fill:"#374151",children:Hd(l.accuracy)}),N.jsx("text",{x:h+a/2,y:230,textAnchor:"middle",fontSize:11,fill:"#374151",children:Kg(l.label,8)})]},`${l.label}-${c}`)}),N.jsx("text",{x:44,y:12,fontSize:11,fill:"#6b7280",children:"正确率"})]})}),N.jsx(CN,{rows:r})]})}function ioe({rows:r}){const a=Math.max(40,516/Math.max(1,r.length-1)),s=Math.max(320,44+(r.length-1)*a+40),o=288,l=r.map((h,d)=>{const v=44+d*a,g=216-Math.max(0,Math.min(1,h.accuracy))*200;return{x:v,y:g,row:h}}),c=l.map(h=>`${h.x},${h.y}`).join(" ");return N.jsxs("div",{children:[N.jsx("div",{style:{overflowX:"auto"},children:N.jsxs("svg",{width:s,height:o,style:{display:"block"},children:[[0,25,50,75,100].map(h=>{const d=216-h/100*200;return N.jsxs("g",{children:[N.jsx("line",{x1:44,y1:d,x2:s-12,y2:d,stroke:"#e5e7eb",strokeWidth:1}),N.jsxs("text",{x:38,y:d+4,textAnchor:"end",fontSize:10,fill:"#6b7280",children:[h,"%"]})]},h)}),N.jsx("polyline",{points:c,fill:"none",stroke:"#3b82f6",strokeWidth:2.5,strokeLinejoin:"round",strokeLinecap:"round"}),l.map((h,d)=>N.jsxs("g",{children:[N.jsx("circle",{cx:h.x,cy:h.y,r:5,fill:"#3b82f6",stroke:"#fff",strokeWidth:2}),N.jsx("text",{x:h.x,y:h.y-10,textAnchor:"middle",fontSize:10,fill:"#374151",children:Hd(h.row.accuracy)}),N.jsx("text",{x:h.x,y:230,textAnchor:"middle",fontSize:11,fill:"#374151",children:Kg(h.row.label,8)})]},d))]})}),N.jsx(CN,{rows:r})]})}function aoe({rows:r,valueLabel:e="错题次数"}){if(!r.length)return N.jsx("div",{className:"muted",children:"暂无统计数据。"});const t=r.map(v=>v.wrong||v.attempts),n=Math.max(1,...t),i=44,a=72,s=16,o=200,l=Math.min(48,Math.max(24,(560-i)/r.length-12)),c=Math.max(320,i+r.length*(l+12)+24),h=s+o+a,d=[0,Math.round(n*.25),Math.round(n*.5),Math.round(n*.75),n].filter((v,g,m)=>m.indexOf(v)===g);return N.jsxs("div",{children:[N.jsx("div",{style:{overflowX:"auto"},children:N.jsxs("svg",{width:c,height:h,style:{display:"block",minWidth:"100%"},children:[d.map(v=>{const g=s+o-v/n*o;return N.jsxs("g",{children:[N.jsx("line",{x1:i,y1:g,x2:c-12,y2:g,stroke:"#e5e7eb",strokeWidth:1}),N.jsx("text",{x:i-6,y:g+4,textAnchor:"end",fontSize:10,fill:"#6b7280",children:v})]},v)}),r.map((v,g)=>{const m=v.wrong||v.attempts,x=i+g*(l+12),y=m/n*o,_=s+o-y;return N.jsxs("g",{children:[N.jsx("rect",{x,y:_,width:l,height:y,rx:4,fill:ul[g%ul.length]}),N.jsx("text",{x:x+l/2,y:_-4,textAnchor:"middle",fontSize:10,fill:"#374151",children:m}),N.jsx("text",{x:x+l/2,y:s+o+14,textAnchor:"middle",fontSize:11,fill:"#374151",children:Kg(v.label,10)})]},`${v.label}-${g}`)}),N.jsx("text",{x:i,y:12,fontSize:11,fill:"#6b7280",children:e})]})}),N.jsx("div",{style:{marginTop:12,fontSize:12,color:"#6b7280"},children:r.map((v,g)=>N.jsxs("div",{style:{marginBottom:6},children:[N.jsx("span",{style:{fontWeight:600,color:"#374151"},children:v.label}),N.jsxs("span",{children:[" — 错题 ",v.wrong||v.attempts," 次"]})]},`${v.label}-${g}`))})]})}function soe({rows:r}){if(!r.length)return N.jsx("div",{className:"muted",children:"暂无统计数据。"});const e=[...r].sort((l,c)=>c.accuracy-l.accuracy||c.attempts-l.attempts),t=108,n=420,i=40,s=t+n+52,o=e.length*i+8;return N.jsx("div",{style:{overflowY:"auto",maxHeight:520},children:N.jsx("svg",{width:s,height:o,style:{display:"block",minWidth:"100%"},children:e.map((l,c)=>{const h=c*i+8,d=Math.max(0,Math.min(1,l.accuracy)),v=d*n,g=l.attempts>0;return N.jsxs("g",{children:[N.jsx("text",{x:t-8,y:h+22,textAnchor:"end",fontSize:12,fill:"#374151",fontWeight:600,children:Kg(l.label,12)}),N.jsx("rect",{x:t,y:h+12,width:n,height:16,rx:8,fill:"#e5e7eb"}),N.jsx("rect",{x:t,y:h+12,width:g?Math.max(4,v):0,height:16,rx:8,fill:g?ul[c%ul.length]:"#d1d5db"}),N.jsx("text",{x:t+n+8,y:h+24,fontSize:11,fill:"#374151",children:g?Hd(d):"暂无作答"}),g?N.jsxs("text",{x:t,y:h+8,fontSize:10,fill:"#6b7280",children:["作答 ",l.attempts," · 对 ",l.correct]}):null]},`${l.label}-${c}`)})})})}function ooe({rows:r}){return N.jsx(TN,{rows:r,mode:"wrongCount"})}function TN({rows:r,mode:e="attempts"}){const t=r.reduce((d,v)=>d+v.attempts,0)||1,n=e==="wrongCount",i=220,a=i/2,s=i/2,o=88,l=he.useMemo(()=>{let d=-Math.PI/2;return r.map((v,g)=>{const m=v.attempts/t,x=m*Math.PI*2,y=d+x,_=a+o*Math.cos(d),w=s+o*Math.sin(d),S=a+o*Math.cos(y),A=s+o*Math.sin(y),C=x>Math.PI?1:0,E={d:m>=.999?`M ${a-o} ${s} A ${o} ${o} 0 1 1 ${a+o} ${s} A ${o} ${o} 0 1 1 ${a-o} ${s}`:`M ${a} ${s} L ${_} ${w} A ${o} ${o} 0 ${C} 1 ${S} ${A} Z`,color:ul[g%ul.length],row:v,frac:m};return d=y,E})},[r,t,a,s,o]),c=n?"错题分布":"作答分布",h=n?`共 ${t} 次错题`:`共 ${t} 次作答`;return N.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:24,alignItems:"flex-start"},children:[N.jsxs("div",{style:{flexShrink:0,textAlign:"center"},children:[N.jsx("svg",{width:i,height:i,style:{display:"block"},children:l.map((d,v)=>N.jsx("path",{d:d.d,fill:d.color,stroke:"#fff",strokeWidth:2},v))}),N.jsx("div",{style:{fontSize:13,fontWeight:600,color:"#374151",marginTop:8},children:c}),N.jsx("div",{className:"muted",style:{fontSize:12,marginTop:4},children:h})]}),N.jsxs("div",{style:{flex:"1 1 200px",minWidth:0},children:[l.map((d,v)=>N.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:8,marginBottom:10,fontSize:13},children:[N.jsx("span",{style:{width:12,height:12,borderRadius:2,background:d.color,flexShrink:0,marginTop:3}}),N.jsxs("div",{children:[N.jsx("div",{style:{fontWeight:600},children:d.row.label}),d.row.sub?N.jsx("div",{className:"muted",style:{fontSize:11},children:d.row.sub}):null,N.jsx("div",{className:"muted",style:{fontSize:12,marginTop:2},children:n?`占比 ${(d.frac*100).toFixed(1)}% · 错题 ${d.row.attempts} 次`:`占比 ${(d.frac*100).toFixed(1)}% · 正确率 ${Hd(d.row.accuracy)} · 共 ${d.row.attempts} 次`})]})]},v)),N.jsx("div",{className:"muted",style:{fontSize:11,marginTop:8},children:n?"饼图按各知识点错题次数占比展示。":"饼图按各维度作答次数占比展示;正确率见图例说明。"})]})]})}function CN({rows:r}){return N.jsx("div",{style:{marginTop:12,fontSize:12,color:"#6b7280"},children:r.map((e,t)=>N.jsxs("div",{style:{marginBottom:6},children:[N.jsx("span",{style:{fontWeight:600,color:"#374151"},children:e.label}),e.sub?N.jsxs("span",{className:"muted",children:[" · ",e.sub]}):null,N.jsxs("span",{children:[" ","— 正确率 ",Hd(e.accuracy),",对 ",e.correct," / 错 ",e.wrong,",共 ",e.attempts," 次"]})]},`${e.label}-${t}`))})}const loe={选择:"选择题",填空:"填空题",计算:"计算题",判断:"判断题"};function uoe(r){const e=(r||"").trim();return e?loe[e]||e:"未标注"}function coe(r){return`${(r*100).toFixed(1)}%`}function hoe(r,e){return e==="grade"?r.by_grade.map(t=>({label:t.grade,attempts:t.attempts,correct:t.correct,wrong:t.wrong,accuracy:t.accuracy})):e==="category"?r.by_category.map(t=>({label:t.category,sub:`年级:${t.grade}`,attempts:t.attempts,correct:t.correct,wrong:t.wrong,accuracy:t.accuracy})):r.by_topic.map(t=>({label:t.knowledge_point_name||t.knowledge_code,sub:`${t.knowledge_grade||"未标注"} · ${t.knowledge_category||"未标注"} · ${t.knowledge_code}`,attempts:t.attempts,correct:t.correct,wrong:t.wrong,accuracy:t.accuracy}))}const foe={bar:"条形图",line:"折线图",pie:"饼图"};function doe(){const r=yu(),{user:e,role:t,loading:n}=bu(),[i,a]=he.useState(null),[s,o]=he.useState(null),[l,c]=he.useState(null),[h,d]=he.useState("grade"),[v,g]=he.useState("bar"),[m,x]=he.useState(null),[y,_]=he.useState(null),[w,S]=he.useState(!1);he.useEffect(()=>{n||t&&t!=="student"&&r("/analytics/teacher",{replace:!0})},[n,t,r]);async function A(){_(null),x(null),S(!0);try{const O=await wF();a(O);try{const D=await SF();o(D),x(null)}catch(D){o(null);const I=D instanceof Error?D.message:"图表加载失败";x(I.includes("404")||/not\s*found/i.test(I)?`${I} — 多为后端未重启,请重启后再试(需包含接口 /learning-analytics/me/knowledge-breakdown)。`:I)}}catch(O){_(O instanceof Error?O.message:"加载失败")}finally{S(!1)}}const C=he.useMemo(()=>s?hoe(s,h):[],[s,h]),M=h==="grade"?"暂无按年级统计的数据(需有作答记录且题目绑定了知识点年级)。":h==="category"?"暂无按类别统计的数据。":"暂无按知识点统计的数据。";async function E(){_(null),S(!0);try{const O=await TF();c(O)}catch(O){_(O instanceof Error?O.message:"加载错题本失败")}finally{S(!1)}}return N.jsx("div",{className:"grid",children:N.jsx("div",{className:"col-12",children:N.jsxs("div",{className:"card",children:[N.jsx("div",{className:"card-header",children:N.jsx("div",{style:{fontSize:16,fontWeight:800},children:"学情统计(学生)"})}),N.jsxs("div",{className:"card-body",children:[N.jsxs("div",{className:"row",children:[N.jsx("button",{className:"btn primary",onClick:A,disabled:w,children:w?"加载中...":"加载我的学情"}),N.jsx("button",{className:"btn",onClick:E,disabled:w,style:{marginLeft:8},children:w?"加载中...":"加载我的错题本"}),e?N.jsxs(N.Fragment,{children:[N.jsx("span",{className:"pill",children:"当前用户"}),N.jsx("span",{className:"mono",children:e.username})]}):null]}),y?N.jsx("div",{className:"error",style:{marginTop:12},children:y}):null,i?N.jsxs("div",{className:"row",style:{marginTop:16,gap:12,flexWrap:"wrap"},children:[N.jsxs("div",{className:"card",style:{padding:14,minWidth:140,flex:"1 1 140px"},children:[N.jsx("div",{className:"muted",style:{fontSize:12},children:"总作答次数"}),N.jsx("div",{style:{fontSize:22,fontWeight:800,marginTop:4},children:i.attempts_total})]}),N.jsxs("div",{className:"card",style:{padding:14,minWidth:140,flex:"1 1 140px"},children:[N.jsx("div",{className:"muted",style:{fontSize:12},children:"答对次数"}),N.jsx("div",{style:{fontSize:22,fontWeight:800,marginTop:4},children:i.correct_total})]}),N.jsxs("div",{className:"card",style:{padding:14,minWidth:140,flex:"1 1 140px"},children:[N.jsx("div",{className:"muted",style:{fontSize:12},children:"总正确率"}),N.jsx("div",{style:{fontSize:22,fontWeight:800,marginTop:4},children:coe(i.accuracy)})]})]}):N.jsx("div",{className:"muted",style:{marginTop:12},children:"(点击「加载我的学情」查看总览与图表)"}),m?N.jsx("div",{className:"muted",style:{marginTop:12,fontSize:13,padding:10,background:"#fffbeb",borderRadius:8},children:m}):null,s?N.jsxs("div",{style:{marginTop:20},children:[N.jsx("div",{style:{fontWeight:800,marginBottom:10},children:"练习情况可视化"}),N.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:10,marginBottom:12},children:[N.jsxs("div",{className:"row",style:{gap:8,flexWrap:"wrap",margin:0},children:[N.jsx("button",{type:"button",className:h==="grade"?"btn primary":"btn",onClick:()=>d("grade"),children:"按年级"}),N.jsx("button",{type:"button",className:h==="category"?"btn primary":"btn",onClick:()=>d("category"),children:"按类别"}),N.jsx("button",{type:"button",className:h==="topic"?"btn primary":"btn",onClick:()=>d("topic"),children:"按具体知识点"})]}),N.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[N.jsx("span",{className:"muted",style:{fontSize:12,marginRight:2},children:"图表类型"}),["bar","line","pie"].map(O=>N.jsx("button",{type:"button",className:v===O?"btn primary":"btn",style:{padding:"6px 12px",fontSize:13},onClick:()=>g(O),children:foe[O]},O))]})]}),N.jsx("div",{style:{padding:12,border:"1px solid #e5e7eb",borderRadius:12,background:"#fafafa",maxHeight:h==="topic"?520:void 0,overflowY:h==="topic"?"auto":void 0},children:C.length?N.jsx(roe,{rows:C,kind:v}):N.jsx("div",{className:"muted",children:M})})]}):null,l?N.jsxs("div",{style:{marginTop:20},children:[N.jsx("div",{style:{fontWeight:800,marginBottom:10},children:"我的错题本"}),l.length?l.map(O=>{var D,I;return N.jsxs("div",{className:"card",style:{padding:14,marginBottom:12,borderRadius:12,border:"1px solid #e5e7eb"},children:[N.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:8,flexWrap:"wrap"},children:[N.jsx("div",{style:{fontWeight:800,fontSize:15},children:((D=O.title)==null?void 0:D.trim())||((I=O.body)!=null&&I.trim()?`${O.body.trim().slice(0,48)}${O.body.trim().length>48?"…":""}`:`错题记录(${O.knowledge_code})`)}),N.jsx("span",{className:"pill",style:{fontSize:12,fontWeight:600},children:uoe(O.question_type)})]}),N.jsxs("div",{className:"muted",style:{fontSize:12,marginTop:6},children:[O.knowledge_grade||"未标注"," · ",O.knowledge_category||"未标注"," · ",O.knowledge_point_name||"—","(",N.jsx("span",{className:"mono",children:O.knowledge_code}),")"]}),O.body?N.jsx("div",{className:"muted",style:{marginTop:10,whiteSpace:"pre-wrap",fontSize:14},children:O.body}):null,N.jsxs("div",{style:{marginTop:12,fontSize:14},children:[N.jsx("span",{style:{fontWeight:600},children:"你的错误答案:"}),O.wrong_answer||"(空)"]}),N.jsxs("div",{style:{marginTop:8,fontSize:14,whiteSpace:"pre-wrap"},children:[N.jsx("span",{style:{fontWeight:600},children:"正确答案:"}),O.correct_answer||"(未录入,请见题干)"]}),N.jsxs("div",{style:{marginTop:8,fontSize:14,whiteSpace:"pre-wrap"},children:[N.jsx("span",{style:{fontWeight:600},children:"解析:"}),(O.resolution||"").trim()||"暂无"]}),N.jsxs("div",{className:"muted",style:{fontSize:11,marginTop:10},children:["记录时间:",new Date(O.created_at).toLocaleString()]})]},O.id)}):N.jsx("div",{className:"muted",children:"暂无错题记录。"})]}):null]})]})})})}function voe(r){return r.map(e=>({label:e.username,sub:void 0,attempts:e.attempts_total,correct:e.correct_total,wrong:Math.max(0,e.attempts_total-e.correct_total),accuracy:e.accuracy}))}function poe(r){return r.map(e=>({label:e.knowledge_code,attempts:e.wrong_count,correct:0,wrong:e.wrong_count,accuracy:0}))}function v9({label:r,options:e,value:t,onChange:n}){return N.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[N.jsx("span",{className:"muted",style:{fontSize:12,marginRight:2},children:r}),e.map(i=>N.jsx("button",{type:"button",className:t===i.id?"btn primary":"btn",style:{padding:"6px 12px",fontSize:13},onClick:()=>n(i.id),children:i.label},i.id))]})}function goe(){const r=yu(),{user:e,role:t,loading:n}=bu(),[i,a]=he.useState(null),[s,o]=he.useState(null),[l,c]=he.useState("hbar"),[h,d]=he.useState("pie"),[v,g]=he.useState(null),[m,x]=he.useState(!1),y=he.useMemo(()=>i?voe(i):[],[i]),_=he.useMemo(()=>s?poe(s):[],[s]);he.useEffect(()=>{n||t&&t!=="teacher"&&r("/analytics/student",{replace:!0})},[n,t,r]);async function w(){g(null),x(!0);try{const A=await EF();a(A)}catch(A){g(A instanceof Error?A.message:"加载失败")}finally{x(!1)}}async function S(){g(null),x(!0);try{const A=await CF();o(A)}catch(A){g(A instanceof Error?A.message:"加载错题本统计失败")}finally{x(!1)}}return N.jsx("div",{className:"grid",children:N.jsx("div",{className:"col-12",children:N.jsxs("div",{className:"card",children:[N.jsxs("div",{className:"card-header",children:[N.jsx("div",{style:{fontSize:16,fontWeight:800},children:"学情统计(教师)"}),N.jsx("div",{className:"muted",style:{marginTop:6},children:"查看全体学生统计与班级错题分布。"})]}),N.jsxs("div",{className:"card-body",children:[N.jsxs("div",{className:"row",style:{alignItems:"center",flexWrap:"wrap",gap:8},children:[N.jsx("button",{className:"btn primary",onClick:w,disabled:m,children:m?"加载中...":"加载所有学生学情"}),N.jsx("button",{className:"btn",onClick:S,disabled:m,children:m?"加载中...":"加载错题本统计"}),e?N.jsxs(N.Fragment,{children:[N.jsx("span",{className:"pill",children:"当前用户"}),N.jsx("span",{className:"mono",children:e.username})]}):null]}),v?N.jsx("div",{className:"error",style:{marginTop:12},children:v}):null,i?N.jsxs("div",{style:{marginTop:20},children:[N.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:10,marginBottom:10},children:[N.jsxs("div",{style:{fontWeight:700},children:["全体学生学情",N.jsxs("span",{className:"muted",style:{fontSize:12,fontWeight:400,marginLeft:8},children:["共 ",i.length," 人"]})]}),N.jsx(v9,{label:"展示方式",value:l,onChange:c,options:[{id:"hbar",label:"横向条形图"},{id:"table",label:"表格"}]})]}),N.jsx("div",{style:{padding:12,border:"1px solid #e5e7eb",borderRadius:12,background:"#fafafa"},children:i.length?l==="table"?N.jsxs("table",{className:"table",children:[N.jsx("thead",{children:N.jsxs("tr",{children:[N.jsx("th",{children:"学生"}),N.jsx("th",{children:"作答总数"}),N.jsx("th",{children:"正确数"}),N.jsx("th",{children:"正确率"})]})}),N.jsx("tbody",{children:i.map(A=>N.jsxs("tr",{children:[N.jsx("td",{className:"mono",children:A.username}),N.jsx("td",{children:A.attempts_total}),N.jsx("td",{children:A.correct_total}),N.jsxs("td",{children:[(A.accuracy*100).toFixed(1),"%"]})]},A.user_id))})]}):N.jsx(soe,{rows:y}):N.jsx("div",{className:"muted",children:"(暂无学生或尚无作答)"})})]}):N.jsx("div",{style:{marginTop:12},className:"muted",children:"(点击「加载所有学生学情」查看)"}),s?N.jsxs("div",{style:{marginTop:20},children:[N.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:10,marginBottom:10},children:[N.jsx("div",{style:{fontWeight:700},children:"错题本(按知识点)"}),N.jsx(v9,{label:"展示方式",value:h,onChange:d,options:[{id:"pie",label:"饼图"},{id:"bar",label:"条形图"},{id:"table",label:"表格"}]})]}),N.jsx("div",{style:{padding:12,border:"1px solid #e5e7eb",borderRadius:12,background:"#fafafa"},children:s.length?h==="table"?N.jsxs("table",{className:"table",children:[N.jsx("thead",{children:N.jsxs("tr",{children:[N.jsx("th",{children:"知识点编码"}),N.jsx("th",{children:"错题次数"})]})}),N.jsx("tbody",{children:s.map(A=>N.jsxs("tr",{children:[N.jsx("td",{className:"mono",children:A.knowledge_code}),N.jsx("td",{children:A.wrong_count})]},A.knowledge_code))})]}):h==="bar"?N.jsx(aoe,{rows:_}):N.jsx(ooe,{rows:_}):N.jsx("div",{className:"muted",children:"(暂无错题记录)"})})]}):N.jsx("div",{style:{marginTop:12},className:"muted",children:"(点击「加载错题本统计」查看)"})]})]})})})}function moe(){const[r,e]=he.useState([]),[t,n]=he.useState("knowledge-graph"),[i,a]=he.useState("http://localhost:9001"),[s,o]=he.useState(!0),[l,c]=he.useState(null),[h,d]=he.useState(null),[v,g]=he.useState(!1);async function m(){c(null);try{e(await AF())}catch(y){c(y instanceof Error?y.message:"加载失败")}}he.useEffect(()=>{m()},[]);async function x(){c(null),d(null),g(!0);try{await MF(t,i,s),d("已注册/更新模块(需要教师权限)。"),await m()}catch(y){c(y instanceof Error?y.message:"注册失败(需要教师权限)")}finally{g(!1)}}return N.jsxs("div",{className:"grid",children:[N.jsx("div",{className:"col-6",children:N.jsxs("div",{className:"card",children:[N.jsxs("div",{className:"card-header",children:[N.jsx("div",{style:{fontSize:16,fontWeight:800},children:"模块管理"}),N.jsx("div",{className:"muted",style:{marginTop:6},children:"用于登记外部模块服务地址(后续可做“中台转发/熔断/鉴权透传”)"})]}),N.jsxs("div",{className:"card-body",children:[N.jsxs("div",{style:{marginBottom:10},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"name"}),N.jsx("input",{className:"input",value:t,onChange:y=>n(y.target.value)})]}),N.jsxs("div",{style:{marginBottom:10},children:[N.jsx("div",{className:"muted",style:{fontSize:12,marginBottom:6},children:"base_url"}),N.jsx("input",{className:"input",value:i,onChange:y=>a(y.target.value)})]}),N.jsx("div",{className:"row",style:{marginBottom:10},children:N.jsxs("label",{className:"row",style:{gap:8},children:[N.jsx("input",{type:"checkbox",checked:s,onChange:y=>o(y.target.checked)}),N.jsx("span",{className:"muted",children:"启用"})]})}),N.jsxs("div",{className:"row",children:[N.jsx("button",{className:"btn primary",onClick:x,disabled:v,children:"注册/更新(teacher)"}),N.jsx("button",{className:"btn",onClick:m,disabled:v,children:"刷新"})]}),l?N.jsx("div",{className:"error",style:{marginTop:12},children:l}):null,h?N.jsx("div",{className:"success",style:{marginTop:12},children:h}):null]})]})}),N.jsx("div",{className:"col-6",children:N.jsxs("div",{className:"card",children:[N.jsxs("div",{className:"card-header",children:[N.jsx("div",{style:{fontSize:16,fontWeight:800},children:"已登记模块"}),N.jsx("div",{className:"muted",style:{marginTop:6},children:"这是“接口对接”的基础:把每个模块当作可替换的服务端点"})]}),N.jsx("div",{className:"card-body",children:N.jsxs("table",{className:"table",children:[N.jsx("thead",{children:N.jsxs("tr",{children:[N.jsx("th",{children:"name"}),N.jsx("th",{children:"base_url"}),N.jsx("th",{children:"enabled"})]})}),N.jsxs("tbody",{children:[r.map(y=>N.jsxs("tr",{children:[N.jsx("td",{className:"mono",children:y.name}),N.jsx("td",{className:"mono",children:y.base_url}),N.jsx("td",{children:y.is_enabled?"Y":"N"})]},y.id)),r.length?null:N.jsx("tr",{children:N.jsx("td",{colSpan:3,className:"muted",children:"(暂无)"})})]})]})})]})})]})}function yoe({children:r}){return M9()?N.jsx(N.Fragment,{children:r}):N.jsx(Zx,{to:"/login",replace:!0})}function boe(){return N.jsxs(FB,{children:[N.jsx(Gi,{path:"/login",element:N.jsx(NF,{})}),N.jsxs(Gi,{path:"/",element:N.jsx(yoe,{children:N.jsx(IF,{})}),children:[N.jsx(Gi,{index:!0,element:N.jsx(Zx,{to:"/knowledge",replace:!0})}),N.jsx(Gi,{path:"knowledge",element:N.jsx(Tq,{})}),N.jsx(Gi,{path:"digital-human",element:N.jsx(Kse,{})}),N.jsx(Gi,{path:"assessment",element:N.jsx(eoe,{})}),N.jsxs(Gi,{path:"analytics",children:[N.jsx(Gi,{index:!0,element:N.jsx(toe,{})}),N.jsx(Gi,{path:"student",element:N.jsx(doe,{})}),N.jsx(Gi,{path:"teacher",element:N.jsx(goe,{})})]}),N.jsx(Gi,{path:"modules",element:N.jsx(moe,{})})]}),N.jsx(Gi,{path:"*",element:N.jsx(Zx,{to:"/",replace:!0})})]})}qk.createRoot(document.getElementById("root")).render(N.jsx(p9.StrictMode,{children:N.jsx(XB,{children:N.jsx(boe,{})})}));