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

3202 lines
1.6 MiB

This file contains ambiguous Unicode characters!

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

!(function(){var Ss=Math.pow;var qs=(Ht,at,q)=>new Promise((me,ge)=>{var le=V=>{try{B(q.next(V))}catch(K){ge(K)}},G=V=>{try{B(q.throw(V))}catch(K){ge(K)}},B=V=>V.done?me(V.value):Promise.resolve(V.value).then(le,G);B((q=q.apply(Ht,at)).next())});(self.webpackChunk=self.webpackChunk||[]).push([[205],{98280:function(Ht,at,q){"use strict";q.d(at,{Z:function(){return sr}});function me(Y){"@babel/helpers - typeof";return me=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(re){return typeof re}:function(re){return re&&typeof Symbol=="function"&&re.constructor===Symbol&&re!==Symbol.prototype?"symbol":typeof re},me(Y)}function ge(Y,re){if(me(Y)!="object"||!Y)return Y;var ee=Y[Symbol.toPrimitive];if(ee!==void 0){var ye=ee.call(Y,re||"default");if(me(ye)!="object")return ye;throw new TypeError("@@toPrimitive must return a primitive value.")}return(re==="string"?String:Number)(Y)}function le(Y){var re=ge(Y,"string");return me(re)=="symbol"?re:re+""}function G(Y,re,ee){return(re=le(re))in Y?Object.defineProperty(Y,re,{value:ee,enumerable:!0,configurable:!0,writable:!0}):Y[re]=ee,Y}function B(Y,re){var ee=Object.keys(Y);if(Object.getOwnPropertySymbols){var ye=Object.getOwnPropertySymbols(Y);re&&(ye=ye.filter(function(Fe){return Object.getOwnPropertyDescriptor(Y,Fe).enumerable})),ee.push.apply(ee,ye)}return ee}function V(Y){for(var re=1;re<arguments.length;re++){var ee=arguments[re]!=null?arguments[re]:{};re%2?B(Object(ee),!0).forEach(function(ye){G(Y,ye,ee[ye])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Y,Object.getOwnPropertyDescriptors(ee)):B(Object(ee)).forEach(function(ye){Object.defineProperty(Y,ye,Object.getOwnPropertyDescriptor(ee,ye))})}return Y}function K(Y){if(Array.isArray(Y))return Y}function F(Y,re){var ee=Y==null?null:typeof Symbol!="undefined"&&Y[Symbol.iterator]||Y["@@iterator"];if(ee!=null){var ye,Fe,et,ct,Ft=[],Ot=!0,It=!1;try{if(et=(ee=ee.call(Y)).next,re===0){if(Object(ee)!==ee)return;Ot=!1}else for(;!(Ot=(ye=et.call(ee)).done)&&(Ft.push(ye.value),Ft.length!==re);Ot=!0);}catch(or){It=!0,Fe=or}finally{try{if(!Ot&&ee.return!=null&&(ct=ee.return(),Object(ct)!==ct))return}finally{if(It)throw Fe}}return Ft}}function i(Y,re){(re==null||re>Y.length)&&(re=Y.length);for(var ee=0,ye=Array(re);ee<re;ee++)ye[ee]=Y[ee];return ye}function U(Y,re){if(Y){if(typeof Y=="string")return i(Y,re);var ee={}.toString.call(Y).slice(8,-1);return ee==="Object"&&Y.constructor&&(ee=Y.constructor.name),ee==="Map"||ee==="Set"?Array.from(Y):ee==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ee)?i(Y,re):void 0}}function L(){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 v(Y,re){return K(Y)||F(Y,re)||U(Y,re)||L()}function E(Y,re){if(Y==null)return{};var ee={};for(var ye in Y)if({}.hasOwnProperty.call(Y,ye)){if(re.indexOf(ye)!==-1)continue;ee[ye]=Y[ye]}return ee}function b(Y,re){if(Y==null)return{};var ee,ye,Fe=E(Y,re);if(Object.getOwnPropertySymbols){var et=Object.getOwnPropertySymbols(Y);for(ye=0;ye<et.length;ye++)ee=et[ye],re.indexOf(ee)===-1&&{}.propertyIsEnumerable.call(Y,ee)&&(Fe[ee]=Y[ee])}return Fe}function w(Y){if(Array.isArray(Y))return Y}function p(Y,re){var ee=Y==null?null:typeof Symbol!="undefined"&&Y[Symbol.iterator]||Y["@@iterator"];if(ee!=null){var ye,Fe,et,ct,Ft=[],Ot=!0,It=!1;try{if(et=(ee=ee.call(Y)).next,re===0){if(Object(ee)!==ee)return;Ot=!1}else for(;!(Ot=(ye=et.call(ee)).done)&&(Ft.push(ye.value),Ft.length!==re);Ot=!0);}catch(or){It=!0,Fe=or}finally{try{if(!Ot&&ee.return!=null&&(ct=ee.return(),Object(ct)!==ct))return}finally{if(It)throw Fe}}return Ft}}function y(Y,re){(re==null||re>Y.length)&&(re=Y.length);for(var ee=0,ye=new Array(re);ee<re;ee++)ye[ee]=Y[ee];return ye}function M(Y,re){if(Y){if(typeof Y=="string")return y(Y,re);var ee=Object.prototype.toString.call(Y).slice(8,-1);if(ee==="Object"&&Y.constructor&&(ee=Y.constructor.name),ee==="Map"||ee==="Set")return Array.from(Y);if(ee==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ee))return y(Y,re)}}function d(){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 f(Y,re){return w(Y)||p(Y,re)||M(Y,re)||d()}var u=q(67294),h=q.t(u,2),S=q(73935);function k(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var m={};function A(Y,re){}function I(Y,re){}function C(){m={}}function P(Y,re,ee){!re&&!m[ee]&&(Y(!1,ee),m[ee]=!0)}function l(Y,re){P(A,Y,re)}function c(Y,re){P(I,Y,re)}var s=null;function g(Y){"@babel/helpers - typeof";return g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(re){return typeof re}:function(re){return re&&typeof Symbol=="function"&&re.constructor===Symbol&&re!==Symbol.prototype?"symbol":typeof re},g(Y)}var R=q(81640);function D(Y,re,ee){var ye=u.useRef({});return(!("value"in ye.current)||ee(ye.current.condition,re))&&(ye.current.value=Y(),ye.current.condition=re),ye.current.value}function x(Y,re){typeof Y=="function"?Y(re):g(Y)==="object"&&Y&&"current"in Y&&(Y.current=re)}function T(){for(var Y=arguments.length,re=new Array(Y),ee=0;ee<Y;ee++)re[ee]=arguments[ee];var ye=re.filter(function(Fe){return Fe});return ye.length<=1?ye[0]:function(Fe){re.forEach(function(et){x(et,Fe)})}}function O(){for(var Y=arguments.length,re=new Array(Y),ee=0;ee<Y;ee++)re[ee]=arguments[ee];return D(function(){return T.apply(void 0,re)},re,function(ye,Fe){return ye.length===Fe.length&&ye.every(function(et,ct){return et===Fe[ct]})})}function $(Y){var re,ee,ye=(0,R.isMemo)(Y)?Y.type.type:Y.type;return!(typeof ye=="function"&&!((re=ye.prototype)!==null&&re!==void 0&&re.render)||typeof Y=="function"&&!((ee=Y.prototype)!==null&&ee!==void 0&&ee.render))}var H=u.createContext(null),Z=H;function te(Y){if(Array.isArray(Y))return y(Y)}function J(Y){if(typeof Symbol!="undefined"&&Y[Symbol.iterator]!=null||Y["@@iterator"]!=null)return Array.from(Y)}function ie(){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 oe(Y){return te(Y)||J(Y)||M(Y)||ie()}var ue=k()?u.useLayoutEffect:u.useEffect,Pe=ue,Ne=function(re,ee){var ye=React.useRef(!0);ue(function(){if(!ye.current)return re()},ee),ue(function(){return ye.current=!1,function(){ye.current=!0}},[])},Ve=[];function ot(Y,re){var ee=u.useState(function(){if(!k())return null;var _r=document.createElement("div");return _r}),ye=f(ee,1),Fe=ye[0],et=u.useRef(!1),ct=u.useContext(Z),Ft=u.useState(Ve),Ot=f(Ft,2),It=Ot[0],or=Ot[1],nr=ct||(et.current?void 0:function(_r){or(function(Or){var Lr=[_r].concat(oe(Or));return Lr})});function vr(){Fe.parentElement||document.body.appendChild(Fe),et.current=!0}function rr(){var _r;(_r=Fe.parentElement)===null||_r===void 0||_r.removeChild(Fe),et.current=!1}return Pe(function(){return Y?ct?ct(vr):vr():rr(),rr},[Y]),Pe(function(){It.length&&(It.forEach(function(_r){return _r()}),or(Ve))},[It]),[Fe,nr]}function Et(Y,re){if(!Y)return!1;if(Y.contains)return Y.contains(re);for(var ee=re;ee;){if(ee===Y)return!0;ee=ee.parentNode}return!1}var it="data-rc-order",Ie="rc-util-key",He=new Map;function ht(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},re=Y.mark;return re?re.startsWith("data-")?re:"data-".concat(re):Ie}function ft(Y){if(Y.attachTo)return Y.attachTo;var re=document.querySelector("head");return re||document.body}function dt(Y){return Y==="queue"?"prependQueue":Y?"prepend":"append"}function se(Y){return Array.from((He.get(Y)||Y).children).filter(function(re){return re.tagName==="STYLE"})}function De(Y){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!k())return null;var ee=re.csp,ye=re.prepend,Fe=document.createElement("style");Fe.setAttribute(it,dt(ye)),ee!=null&&ee.nonce&&(Fe.nonce=ee==null?void 0:ee.nonce),Fe.innerHTML=Y;var et=ft(re),ct=et.firstChild;if(ye){if(ye==="queue"){var Ft=se(et).filter(function(Ot){return["prepend","prependQueue"].includes(Ot.getAttribute(it))});if(Ft.length)return et.insertBefore(Fe,Ft[Ft.length-1].nextSibling),Fe}et.insertBefore(Fe,ct)}else et.appendChild(Fe);return Fe}function ze(Y){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ee=ft(re);return se(ee).find(function(ye){return ye.getAttribute(ht(re))===Y})}function Ge(Y){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ee=ze(Y,re);if(ee){var ye=ft(re);ye.removeChild(ee)}}function qe(Y,re){var ee=He.get(Y);if(!ee||!Et(document,ee)){var ye=De("",re),Fe=ye.parentNode;He.set(Y,Fe),Y.removeChild(ye)}}function vt(){He.clear()}function Ut(Y,re){var ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ye=ft(ee);qe(ye,ee);var Fe=ze(re,ee);if(Fe){var et,ct;if((et=ee.csp)!==null&&et!==void 0&&et.nonce&&Fe.nonce!==((ct=ee.csp)===null||ct===void 0?void 0:ct.nonce)){var Ft;Fe.nonce=(Ft=ee.csp)===null||Ft===void 0?void 0:Ft.nonce}return Fe.innerHTML!==Y&&(Fe.innerHTML=Y),Fe}var Ot=De(Y,ee);return Ot.setAttribute(ht(ee),re),Ot}var bt;function ke(Y){if(typeof document=="undefined")return 0;if(Y||bt===void 0){var re=document.createElement("div");re.style.width="100%",re.style.height="200px";var ee=document.createElement("div"),ye=ee.style;ye.position="absolute",ye.top="0",ye.left="0",ye.pointerEvents="none",ye.visibility="hidden",ye.width="200px",ye.height="150px",ye.overflow="hidden",ee.appendChild(re),document.body.appendChild(ee);var Fe=re.offsetWidth;ee.style.overflow="scroll";var et=re.offsetWidth;Fe===et&&(et=ee.clientWidth),document.body.removeChild(ee),bt=Fe-et}return bt}function lt(Y){var re=Y.match(/^(.*)px$/),ee=Number(re==null?void 0:re[1]);return Number.isNaN(ee)?ke():ee}function $t(Y){if(typeof document=="undefined"||!Y||!(Y instanceof Element))return{width:0,height:0};var re=getComputedStyle(Y,"::-webkit-scrollbar"),ee=re.width,ye=re.height;return{width:lt(ee),height:lt(ye)}}function tt(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var Ze="rc-util-locker-".concat(Date.now()),Je=0;function pt(Y){var re=!!Y,ee=u.useState(function(){return Je+=1,"".concat(Ze,"_").concat(Je)}),ye=f(ee,1),Fe=ye[0];Pe(function(){if(re){var et=$t(document.body).width,ct=tt();Ut(`
html body {
overflow-y: hidden;
`.concat(ct?"width: calc(100% - ".concat(et,"px);"):"",`
}`),Fe)}else Ge(Fe);return function(){Ge(Fe)}},[re,Fe])}var je=!1;function _t(Y){return typeof Y=="boolean"&&(je=Y),je}var xt=function(re){return re===!1?!1:!k()||!re?null:typeof re=="string"?document.querySelector(re):typeof re=="function"?re():re},Kt=u.forwardRef(function(Y,re){var ee=Y.open,ye=Y.autoLock,Fe=Y.getContainer,et=Y.debug,ct=Y.autoDestroy,Ft=ct===void 0?!0:ct,Ot=Y.children,It=u.useState(ee),or=f(It,2),nr=or[0],vr=or[1],rr=nr||ee;u.useEffect(function(){(Ft||ee)&&vr(ee)},[ee,Ft]);var _r=u.useState(function(){return xt(Fe)}),Or=f(_r,2),Lr=Or[0],Vr=Or[1];u.useEffect(function(){var On=xt(Fe);Vr(On!=null?On:null)});var zr=ot(rr&&!Lr,et),Fr=f(zr,2),tn=Fr[0],xr=Fr[1],dr=Lr!=null?Lr:tn;pt(ye&&ee&&k()&&(dr===tn||dr===document.body));var rn=null;if(Ot&&$(Ot)&&re){var Xr=Ot;rn=Xr.ref}var pn=O(rn,re);if(!rr||!k()||Lr===void 0)return null;var Gn=dr===!1||_t(),In=Ot;return re&&(In=u.cloneElement(Ot,{ref:pn})),u.createElement(Z.Provider,{value:xr},Gn?In:(0,S.createPortal)(In,dr))}),Bt=Kt,Rt=Bt,Se=q(94184),fe=q.n(Se),Ce=q(48555);function de(Y){return Y instanceof HTMLElement||Y instanceof SVGElement}function pe(Y){return Y&&_typeof(Y)==="object"&&de(Y.nativeElement)?Y.nativeElement:de(Y)?Y:null}function xe(Y){var re=pe(Y);if(re)return re;if(Y instanceof React.Component){var ee;return(ee=ReactDOM.findDOMNode)===null||ee===void 0?void 0:ee.call(ReactDOM,Y)}return null}function Q(Y){var re;return Y==null||(re=Y.getRootNode)===null||re===void 0?void 0:re.call(Y)}function ne(Y){return Q(Y)instanceof ShadowRoot}function ce(Y){return ne(Y)?Q(Y):null}function Ae(Y){var re=u.useRef();re.current=Y;var ee=u.useCallback(function(){for(var ye,Fe=arguments.length,et=new Array(Fe),ct=0;ct<Fe;ct++)et[ct]=arguments[ct];return(ye=re.current)===null||ye===void 0?void 0:ye.call.apply(ye,[re].concat(et))},[]);return ee}function be(Y){if(Array.isArray(Y))return Y}function Oe(Y,re){var ee=Y==null?null:typeof Symbol!="undefined"&&Y[Symbol.iterator]||Y["@@iterator"];if(ee!=null){var ye,Fe,et,ct,Ft=[],Ot=!0,It=!1;try{if(et=(ee=ee.call(Y)).next,re===0){if(Object(ee)!==ee)return;Ot=!1}else for(;!(Ot=(ye=et.call(ee)).done)&&(Ft.push(ye.value),Ft.length!==re);Ot=!0);}catch(or){It=!0,Fe=or}finally{try{if(!Ot&&ee.return!=null&&(ct=ee.return(),Object(ct)!==ct))return}finally{if(It)throw Fe}}return Ft}}function $e(Y,re){(re==null||re>Y.length)&&(re=Y.length);for(var ee=0,ye=new Array(re);ee<re;ee++)ye[ee]=Y[ee];return ye}function mt(Y,re){if(Y){if(typeof Y=="string")return $e(Y,re);var ee=Object.prototype.toString.call(Y).slice(8,-1);if(ee==="Object"&&Y.constructor&&(ee=Y.constructor.name),ee==="Map"||ee==="Set")return Array.from(Y);if(ee==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ee))return $e(Y,re)}}function Mt(){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 Jt(Y,re){return be(Y)||Oe(Y,re)||mt(Y,re)||Mt()}function jt(Y){"@babel/helpers - typeof";return jt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(re){return typeof re}:function(re){return re&&typeof Symbol=="function"&&re.constructor===Symbol&&re!==Symbol.prototype?"symbol":typeof re},jt(Y)}function rt(Y,re){if(jt(Y)!=="object"||Y===null)return Y;var ee=Y[Symbol.toPrimitive];if(ee!==void 0){var ye=ee.call(Y,re||"default");if(jt(ye)!=="object")return ye;throw new TypeError("@@toPrimitive must return a primitive value.")}return(re==="string"?String:Number)(Y)}function Tt(Y){var re=rt(Y,"string");return jt(re)==="symbol"?re:String(re)}function ur(Y,re,ee){return re=Tt(re),re in Y?Object.defineProperty(Y,re,{value:ee,enumerable:!0,configurable:!0,writable:!0}):Y[re]=ee,Y}function ir(Y,re){var ee=Object.keys(Y);if(Object.getOwnPropertySymbols){var ye=Object.getOwnPropertySymbols(Y);re&&(ye=ye.filter(function(Fe){return Object.getOwnPropertyDescriptor(Y,Fe).enumerable})),ee.push.apply(ee,ye)}return ee}function cr(Y){for(var re=1;re<arguments.length;re++){var ee=arguments[re]!=null?arguments[re]:{};re%2?ir(Object(ee),!0).forEach(function(ye){ur(Y,ye,ee[ye])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Y,Object.getOwnPropertyDescriptors(ee)):ir(Object(ee)).forEach(function(ye){Object.defineProperty(Y,ye,Object.getOwnPropertyDescriptor(ee,ye))})}return Y}function Ur(){var Y=cr({},h);return Y.useId}var ar=0;function Er(){}var Yr=Ur(),Hn=Yr?function(re){var ee=Yr();return re||ee}:function(re){var ee=u.useState("ssr-id"),ye=Jt(ee,2),Fe=ye[0],et=ye[1];return u.useEffect(function(){var ct=ar;ar+=1,et("rc_unique_".concat(ct))},[]),re||Fe};function Mn(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var ei=Mn()?u.useLayoutEffect:u.useEffect,mi=function(re,ee){var ye=u.useRef(!0);ei(function(){return re(ye.current)},ee),ei(function(){return ye.current=!1,function(){ye.current=!0}},[])},ti=function(re,ee){mi(function(ye){if(!ye)return re()},ee)},en=mi,Fi=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Y=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Y)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Y==null?void 0:Y.substr(0,4))};function Bi(){return Bi=Object.assign?Object.assign.bind():function(Y){for(var re=1;re<arguments.length;re++){var ee=arguments[re];for(var ye in ee)({}).hasOwnProperty.call(ee,ye)&&(Y[ye]=ee[ye])}return Y},Bi.apply(null,arguments)}var Vi=q(62874),vi=q(52481);function Ia(Y,re,ee){var ye=u.useRef({});return(!("value"in ye.current)||ee(ye.current.condition,re))&&(ye.current.value=Y(),ye.current.condition=re),ye.current.value}var ki=Symbol.for("react.element"),qi=Symbol.for("react.transitional.element"),Ui=Symbol.for("react.fragment");function Si(Y){return Y&&jt(Y)==="object"&&(Y.$$typeof===ki||Y.$$typeof===qi)&&Y.type===Ui}var gi=Number(u.version.split(".")[0]),zi=function(re,ee){typeof re=="function"?re(ee):jt(re)==="object"&&re&&"current"in re&&(re.current=ee)},hn=function(){for(var re=arguments.length,ee=new Array(re),ye=0;ye<re;ye++)ee[ye]=arguments[ye];var Fe=ee.filter(Boolean);return Fe.length<=1?Fe[0]:function(et){ee.forEach(function(ct){zi(ct,et)})}},dn=function(){for(var re=arguments.length,ee=new Array(re),ye=0;ye<re;ye++)ee[ye]=arguments[ye];return Ia(function(){return hn.apply(void 0,ee)},ee,function(Fe,et){return Fe.length!==et.length||Fe.every(function(ct,Ft){return ct!==et[Ft]})})},Sr=function(re){var ee,ye;if(!re)return!1;if(_i(re)&&gi>=19)return!0;var Fe=(0,vi.isMemo)(re)?re.type.type:re.type;return!(typeof Fe=="function"&&!((ee=Fe.prototype)!==null&&ee!==void 0&&ee.render)&&Fe.$$typeof!==vi.ForwardRef||typeof re=="function"&&!((ye=re.prototype)!==null&&ye!==void 0&&ye.render)&&re.$$typeof!==vi.ForwardRef)};function _i(Y){return(0,u.isValidElement)(Y)&&!Si(Y)}var is=function(re){return _i(re)&&Sr(re)},Oa=function(re){if(re&&_i(re)){var ee=re;return ee.props.propertyIsEnumerable("ref")?ee.props.ref:ee.ref}return null};function jn(Y){var re=Y.prefixCls,ee=Y.align,ye=Y.arrow,Fe=Y.arrowPos,et=ye||{},ct=et.className,Ft=et.content,Ot=Fe.x,It=Ot===void 0?0:Ot,or=Fe.y,nr=or===void 0?0:or,vr=u.useRef();if(!ee||!ee.points)return null;var rr={position:"absolute"};if(ee.autoArrow!==!1){var _r=ee.points[0],Or=ee.points[1],Lr=_r[0],Vr=_r[1],zr=Or[0],Fr=Or[1];Lr===zr||!["t","b"].includes(Lr)?rr.top=nr:Lr==="t"?rr.top=0:rr.bottom=0,Vr===Fr||!["l","r"].includes(Vr)?rr.left=It:Vr==="l"?rr.left=0:rr.right=0}return u.createElement("div",{ref:vr,className:fe()("".concat(re,"-arrow"),ct),style:rr},Ft)}function ya(Y){var re=Y.prefixCls,ee=Y.open,ye=Y.zIndex,Fe=Y.mask,et=Y.motion;return Fe?u.createElement(Vi.Z,Bi({},et,{motionAppear:!0,visible:ee,removeOnLeave:!0}),function(ct){var Ft=ct.className;return u.createElement("div",{style:{zIndex:ye},className:fe()("".concat(re,"-mask"),Ft)})}):null}var Ha=u.memo(function(Y){var re=Y.children;return re},function(Y,re){return re.cache}),Ms=Ha,Fa=u.forwardRef(function(Y,re){var ee=Y.popup,ye=Y.className,Fe=Y.prefixCls,et=Y.style,ct=Y.target,Ft=Y.onVisibleChanged,Ot=Y.open,It=Y.keepDom,or=Y.fresh,nr=Y.onClick,vr=Y.mask,rr=Y.arrow,_r=Y.arrowPos,Or=Y.align,Lr=Y.motion,Vr=Y.maskMotion,zr=Y.forceRender,Fr=Y.getPopupContainer,tn=Y.autoDestroy,xr=Y.portal,dr=Y.zIndex,rn=Y.onMouseEnter,Xr=Y.onMouseLeave,pn=Y.onPointerEnter,Gn=Y.onPointerDownCapture,In=Y.ready,On=Y.offsetX,on=Y.offsetY,Tn=Y.offsetR,Dn=Y.offsetB,cn=Y.onAlign,Zn=Y.onPrepare,$r=Y.stretch,fn=Y.targetWidth,Br=Y.targetHeight,Yn=typeof ee=="function"?ee():ee,li=Ot||It,mn=(Fr==null?void 0:Fr.length)>0,Tr=u.useState(!Fr||!mn),An=v(Tr,2),nn=An[0],ui=An[1];if(en(function(){!nn&&mn&&ct&&ui(!0)},[nn,mn,ct]),!nn)return null;var kn="auto",ln={left:"-1000vw",top:"-1000vh",right:kn,bottom:kn};if(In||!Ot){var Kn,ci=Or.points,Zr=Or.dynamicInset||((Kn=Or._experimental)===null||Kn===void 0?void 0:Kn.dynamicInset),Un=Zr&&ci[0][1]==="r",Fn=Zr&&ci[0][0]==="b";Un?(ln.right=Tn,ln.left=kn):(ln.left=On,ln.right=kn),Fn?(ln.bottom=Dn,ln.top=kn):(ln.top=on,ln.bottom=kn)}var Cn={};return $r&&($r.includes("height")&&Br?Cn.height=Br:$r.includes("minHeight")&&Br&&(Cn.minHeight=Br),$r.includes("width")&&fn?Cn.width=fn:$r.includes("minWidth")&&fn&&(Cn.minWidth=fn)),Ot||(Cn.pointerEvents="none"),u.createElement(xr,{open:zr||li,getContainer:Fr&&function(){return Fr(ct)},autoDestroy:tn},u.createElement(ya,{prefixCls:Fe,open:Ot,zIndex:dr,mask:vr,motion:Vr}),u.createElement(Ce.Z,{onResize:cn,disabled:!Ot},function(Qn){return u.createElement(Vi.Z,Bi({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:zr,leavedClassName:"".concat(Fe,"-hidden")},Lr,{onAppearPrepare:Zn,onEnterPrepare:Zn,visible:Ot,onVisibleChanged:function(zn){var qr;Lr==null||(qr=Lr.onVisibleChanged)===null||qr===void 0||qr.call(Lr,zn),Ft(zn)}}),function(Mi,zn){var qr=Mi.className,$n=Mi.style,bn=fe()(Fe,qr,ye);return u.createElement("div",{ref:hn(Qn,re,zn),className:bn,style:V(V(V(V({"--arrow-x":"".concat(_r.x||0,"px"),"--arrow-y":"".concat(_r.y||0,"px")},ln),Cn),$n),{},{boxSizing:"border-box",zIndex:dr},et),onMouseEnter:rn,onMouseLeave:Xr,onPointerEnter:pn,onClick:nr,onPointerDownCapture:Gn},rr&&u.createElement(jn,{prefixCls:Fe,arrow:rr,arrowPos:_r,align:Or}),u.createElement(Ms,{cache:!Ot&&!or},Yn))})}))}),Ee=Fa,we=u.forwardRef(function(Y,re){var ee=Y.children,ye=Y.getTriggerDOMNode,Fe=Sr(ee),et=u.useCallback(function(Ft){zi(re,ye?ye(Ft):Ft)},[ye]),ct=dn(et,Oa(ee));return Fe?u.cloneElement(ee,{ref:ct}):ee}),We=we,Ye=u.createContext(null),ut=Ye;function At(Y){return Y?Array.isArray(Y)?Y:[Y]:[]}function Ct(Y,re,ee,ye){return u.useMemo(function(){var Fe=At(ee!=null?ee:re),et=At(ye!=null?ye:re),ct=new Set(Fe),Ft=new Set(et);return Y&&(ct.has("hover")&&(ct.delete("hover"),ct.add("click")),Ft.has("hover")&&(Ft.delete("hover"),Ft.add("click"))),[ct,Ft]},[Y,re,ee,ye])}var Pt=function(Y){if(!Y)return!1;if(Y instanceof Element){if(Y.offsetParent)return!0;if(Y.getBBox){var re=Y.getBBox(),ee=re.width,ye=re.height;if(ee||ye)return!0}if(Y.getBoundingClientRect){var Fe=Y.getBoundingClientRect(),et=Fe.width,ct=Fe.height;if(et||ct)return!0}}return!1};function Nt(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],ee=arguments.length>2?arguments[2]:void 0;return ee?Y[0]===re[0]:Y[0]===re[0]&&Y[1]===re[1]}function er(Y,re,ee,ye){for(var Fe=ee.points,et=Object.keys(Y),ct=0;ct<et.length;ct+=1){var Ft,Ot=et[ct];if(Nt((Ft=Y[Ot])===null||Ft===void 0?void 0:Ft.points,Fe,ye))return"".concat(re,"-placement-").concat(Ot)}return""}function mr(Y,re,ee,ye){return re||(ee?{motionName:"".concat(Y,"-").concat(ee)}:ye?{motionName:ye}:null)}function Zt(Y){return Y.ownerDocument.defaultView}function yr(Y){for(var re=[],ee=Y==null?void 0:Y.parentElement,ye=["hidden","scroll","clip","auto"];ee;){var Fe=Zt(ee).getComputedStyle(ee),et=Fe.overflowX,ct=Fe.overflowY,Ft=Fe.overflow;[et,ct,Ft].some(function(Ot){return ye.includes(Ot)})&&re.push(ee),ee=ee.parentElement}return re}function Mr(Y){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(Y)?re:Y}function jr(Y){return Mr(parseFloat(Y),0)}function Pr(Y,re){var ee=V({},Y);return(re||[]).forEach(function(ye){if(!(ye instanceof HTMLBodyElement||ye instanceof HTMLHtmlElement)){var Fe=Zt(ye).getComputedStyle(ye),et=Fe.overflow,ct=Fe.overflowClipMargin,Ft=Fe.borderTopWidth,Ot=Fe.borderBottomWidth,It=Fe.borderLeftWidth,or=Fe.borderRightWidth,nr=ye.getBoundingClientRect(),vr=ye.offsetHeight,rr=ye.clientHeight,_r=ye.offsetWidth,Or=ye.clientWidth,Lr=jr(Ft),Vr=jr(Ot),zr=jr(It),Fr=jr(or),tn=Mr(Math.round(nr.width/_r*1e3)/1e3),xr=Mr(Math.round(nr.height/vr*1e3)/1e3),dr=(_r-Or-zr-Fr)*tn,rn=(vr-rr-Lr-Vr)*xr,Xr=Lr*xr,pn=Vr*xr,Gn=zr*tn,In=Fr*tn,On=0,on=0;if(et==="clip"){var Tn=jr(ct);On=Tn*tn,on=Tn*xr}var Dn=nr.x+Gn-On,cn=nr.y+Xr-on,Zn=Dn+nr.width+2*On-Gn-In-dr,$r=cn+nr.height+2*on-Xr-pn-rn;ee.left=Math.max(ee.left,Dn),ee.top=Math.max(ee.top,cn),ee.right=Math.min(ee.right,Zn),ee.bottom=Math.min(ee.bottom,$r)}}),ee}function Gr(Y){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,ee="".concat(re),ye=ee.match(/^(.*)\%$/);return ye?Y*(parseFloat(ye[1])/100):parseFloat(ee)}function Dr(Y,re){var ee=re||[],ye=v(ee,2),Fe=ye[0],et=ye[1];return[Gr(Y.width,Fe),Gr(Y.height,et)]}function Ar(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[Y[0],Y[1]]}function fr(Y,re){var ee=re[0],ye=re[1],Fe,et;return ee==="t"?et=Y.y:ee==="b"?et=Y.y+Y.height:et=Y.y+Y.height/2,ye==="l"?Fe=Y.x:ye==="r"?Fe=Y.x+Y.width:Fe=Y.x+Y.width/2,{x:Fe,y:et}}function kr(Y,re){var ee={t:"b",b:"t",l:"r",r:"l"};return Y.map(function(ye,Fe){return Fe===re?ee[ye]||"c":ye}).join("")}function Pn(Y,re,ee,ye,Fe,et,ct){var Ft=u.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:Fe[ye]||{}}),Ot=v(Ft,2),It=Ot[0],or=Ot[1],nr=u.useRef(0),vr=u.useMemo(function(){return re?yr(re):[]},[re]),rr=u.useRef({}),_r=function(){rr.current={}};Y||_r();var Or=Ae(function(){if(re&&ee&&Y){let la=function(qa,Ja){var Qa=arguments.length>2&&arguments[2]!==void 0?arguments[2]:yi,Ns=Tr.x+qa,ao=Tr.y+Ja,Bo=Ns+Un,us=ao+Zr,cs=Math.max(Ns,Qa.left),Yt=Math.max(ao,Qa.top),wr=Math.min(Bo,Qa.right),Xn=Math.min(us,Qa.bottom);return Math.max(0,(wr-cs)*(Xn-Yt))},io=function(){ma=Tr.y+En,aa=ma+Zr,va=Tr.x+xn,Na=va+Un};var zr,Fr,tn,xr,dr=re,rn=dr.ownerDocument,Xr=Zt(dr),pn=Xr.getComputedStyle(dr),Gn=pn.width,In=pn.height,On=pn.position,on=dr.style.left,Tn=dr.style.top,Dn=dr.style.right,cn=dr.style.bottom,Zn=dr.style.overflow,$r=V(V({},Fe[ye]),et),fn=rn.createElement("div");(zr=dr.parentElement)===null||zr===void 0||zr.appendChild(fn),fn.style.left="".concat(dr.offsetLeft,"px"),fn.style.top="".concat(dr.offsetTop,"px"),fn.style.position=On,fn.style.height="".concat(dr.offsetHeight,"px"),fn.style.width="".concat(dr.offsetWidth,"px"),dr.style.left="0",dr.style.top="0",dr.style.right="auto",dr.style.bottom="auto",dr.style.overflow="hidden";var Br;if(Array.isArray(ee))Br={x:ee[0],y:ee[1],width:0,height:0};else{var Yn,li,mn=ee.getBoundingClientRect();mn.x=(Yn=mn.x)!==null&&Yn!==void 0?Yn:mn.left,mn.y=(li=mn.y)!==null&&li!==void 0?li:mn.top,Br={x:mn.x,y:mn.y,width:mn.width,height:mn.height}}var Tr=dr.getBoundingClientRect();Tr.x=(Fr=Tr.x)!==null&&Fr!==void 0?Fr:Tr.left,Tr.y=(tn=Tr.y)!==null&&tn!==void 0?tn:Tr.top;var An=rn.documentElement,nn=An.clientWidth,ui=An.clientHeight,kn=An.scrollWidth,ln=An.scrollHeight,Kn=An.scrollTop,ci=An.scrollLeft,Zr=Tr.height,Un=Tr.width,Fn=Br.height,Cn=Br.width,Qn={left:0,top:0,right:nn,bottom:ui},Mi={left:-ci,top:-Kn,right:kn-ci,bottom:ln-Kn},zn=$r.htmlRegion,qr="visible",$n="visibleFirst";zn!=="scroll"&&zn!==$n&&(zn=qr);var bn=zn===$n,ba=Pr(Mi,vr),an=Pr(Qn,vr),yi=zn===qr?an:ba,$i=bn?an:yi;dr.style.left="auto",dr.style.top="auto",dr.style.right="0",dr.style.bottom="0";var Ln=dr.getBoundingClientRect();dr.style.left=on,dr.style.top=Tn,dr.style.right=Dn,dr.style.bottom=cn,dr.style.overflow=Zn,(xr=dr.parentElement)===null||xr===void 0||xr.removeChild(fn);var Ci=Mr(Math.round(Un/parseFloat(Gn)*1e3)/1e3),bi=Mr(Math.round(Zr/parseFloat(In)*1e3)/1e3);if(Ci===0||bi===0||de(ee)&&!Pt(ee))return;var Rr=$r.offset,kt=$r.targetOffset,Qt=Dr(Tr,Rr),pr=v(Qt,2),Ir=pr[0],Nr=pr[1],Hi=Dr(Br,kt),ri=v(Hi,2),fi=ri[0],Li=ri[1];Br.x-=fi,Br.y-=Li;var Ba=$r.points||[],ja=v(Ba,2),Ga=ja[0],xa=ja[1],ji=Ar(xa),pi=Ar(Ga),Ji=fr(Br,ji),Ti=fr(Tr,pi),da=V({},$r),xn=Ji.x-Ti.x+Ir,En=Ji.y-Ti.y+Nr,Qi=la(xn,En),Ea=la(xn,En,an),wa=fr(Br,["t","l"]),Gi=fr(Tr,["t","l"]),Ts=fr(Br,["b","r"]),as=fr(Tr,["b","r"]),pa=$r.overflow||{},Sa=pa.adjustX,ni=pa.adjustY,Zi=pa.shiftX,Yi=pa.shiftY,ss=function(Ja){return typeof Ja=="boolean"?Ja:Ja>=0},ma,aa,va,Na;io();var Ka=ss(ni),os=pi[0]===ji[0];if(Ka&&pi[0]==="t"&&(aa>$i.bottom||rr.current.bt)){var xi=En;os?xi-=Zr-Fn:xi=wa.y-as.y-Nr;var Za=la(xn,xi),Fs=la(xn,xi,an);Za>Qi||Za===Qi&&(!bn||Fs>=Ea)?(rr.current.bt=!0,En=xi,Nr=-Nr,da.points=[kr(pi,0),kr(ji,0)]):rr.current.bt=!1}if(Ka&&pi[0]==="b"&&(ma<$i.top||rr.current.tb)){var Ua=En;os?Ua+=Zr-Fn:Ua=Ts.y-Gi.y-Nr;var ls=la(xn,Ua),Rn=la(xn,Ua,an);ls>Qi||ls===Qi&&(!bn||Rn>=Ea)?(rr.current.tb=!0,En=Ua,Nr=-Nr,da.points=[kr(pi,0),kr(ji,0)]):rr.current.tb=!1}var Kr=ss(Sa),vn=pi[1]===ji[1];if(Kr&&pi[1]==="l"&&(Na>$i.right||rr.current.rl)){var ii=xn;vn?ii-=Un-Cn:ii=wa.x-as.x-Ir;var Di=la(ii,En),ga=la(ii,En,an);Di>Qi||Di===Qi&&(!bn||ga>=Ea)?(rr.current.rl=!0,xn=ii,Ir=-Ir,da.points=[kr(pi,1),kr(ji,1)]):rr.current.rl=!1}if(Kr&&pi[1]==="r"&&(va<$i.left||rr.current.lr)){var ea=xn;vn?ea+=Un-Cn:ea=Ts.x-Gi.x-Ir;var Ds=la(ea,En),Ya=la(ea,En,an);Ds>Qi||Ds===Qi&&(!bn||Ya>=Ea)?(rr.current.lr=!0,xn=ea,Ir=-Ir,da.points=[kr(pi,1),kr(ji,1)]):rr.current.lr=!1}io();var ta=Zi===!0?0:Zi;typeof ta=="number"&&(va<an.left&&(xn-=va-an.left-Ir,Br.x+Cn<an.left+ta&&(xn+=Br.x-an.left+Cn-ta)),Na>an.right&&(xn-=Na-an.right-Ir,Br.x>an.right-ta&&(xn+=Br.x-an.right+ta)));var Ri=Yi===!0?0:Yi;typeof Ri=="number"&&(ma<an.top&&(En-=ma-an.top-Nr,Br.y+Fn<an.top+Ri&&(En+=Br.y-an.top+Fn-Ri)),aa>an.bottom&&(En-=aa-an.bottom-Nr,Br.y>an.bottom-Ri&&(En+=Br.y-an.bottom+Ri)));var Ma=Tr.x+xn,Xa=Ma+Un,Ta=Tr.y+En,Lo=Ta+Zr,sa=Br.x,Js=sa+Cn,oa=Br.y,Ro=oa+Fn,Qs=Math.max(Ma,sa),eo=Math.min(Xa,Js),to=(Qs+eo)/2,ro=to-Ma,Po=Math.max(Ta,oa),no=Math.min(Lo,Ro),Io=(Po+no)/2,Oo=Io-Ta;ct==null||ct(re,da);var Bs=Ln.right-Tr.x-(xn+Tr.width),Da=Ln.bottom-Tr.y-(En+Tr.height);Ci===1&&(xn=Math.round(xn),Bs=Math.round(Bs)),bi===1&&(En=Math.round(En),Da=Math.round(Da));var Fo={ready:!0,offsetX:xn/Ci,offsetY:En/bi,offsetR:Bs/Ci,offsetB:Da/bi,arrowX:ro/Ci,arrowY:Oo/bi,scaleX:Ci,scaleY:bi,align:da};or(Fo)}}),Lr=function(){nr.current+=1;var Fr=nr.current;Promise.resolve().then(function(){nr.current===Fr&&Or()})},Vr=function(){or(function(Fr){return V(V({},Fr),{},{ready:!1})})};return en(Vr,[ye]),en(function(){Y||Vr()},[Y]),[It.ready,It.offsetX,It.offsetY,It.offsetR,It.offsetB,It.arrowX,It.arrowY,It.scaleX,It.scaleY,It.align,Lr]}function yn(Y){if(Array.isArray(Y))return i(Y)}function Nn(Y){if(typeof Symbol!="undefined"&&Y[Symbol.iterator]!=null||Y["@@iterator"]!=null)return Array.from(Y)}function ve(){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 Te(Y){return yn(Y)||Nn(Y)||U(Y)||ve()}function Le(Y,re,ee,ye,Fe){en(function(){if(Y&&re&&ee){let nr=function(){ye(),Fe()};var et=re,ct=ee,Ft=yr(et),Ot=yr(ct),It=Zt(ct),or=new Set([It].concat(Te(Ft),Te(Ot)));return or.forEach(function(vr){vr.addEventListener("scroll",nr,{passive:!0})}),It.addEventListener("resize",nr,{passive:!0}),ye(),function(){or.forEach(function(vr){vr.removeEventListener("scroll",nr),It.removeEventListener("resize",nr)})}}},[Y,re,ee])}var Me={},Re=[],Ke=function(re){Re.push(re)};function Xe(Y,re){if(0)var ee}function Dt(Y,re){if(0)var ee}function Xt(){Me={}}function Wt(Y,re,ee){!re&&!Me[ee]&&(Y(!1,ee),Me[ee]=!0)}function gr(Y,re){Wt(Xe,Y,re)}function hr(Y,re){Wt(Dt,Y,re)}gr.preMessage=Ke,gr.resetWarned=Xt,gr.noteOnce=hr;var br=null;function Cr(Y,re,ee,ye,Fe,et,ct,Ft){var Ot=u.useRef(Y);Ot.current=Y;var It=u.useRef(!1);u.useEffect(function(){if(re&&ye&&(!Fe||et)){var nr=function(){It.current=!1},vr=function(tn){var xr;Ot.current&&!ct(((xr=tn.composedPath)===null||xr===void 0||(xr=xr.call(tn))===null||xr===void 0?void 0:xr[0])||tn.target)&&!It.current&&Ft(!1)},rr=Zt(ye);rr.addEventListener("pointerdown",nr,!0),rr.addEventListener("mousedown",vr,!0),rr.addEventListener("contextmenu",vr,!0);var _r=ce(ee);if(_r&&(_r.addEventListener("mousedown",vr,!0),_r.addEventListener("contextmenu",vr,!0)),0)var Or,Lr,Vr,zr;return function(){rr.removeEventListener("pointerdown",nr,!0),rr.removeEventListener("mousedown",vr,!0),rr.removeEventListener("contextmenu",vr,!0),_r&&(_r.removeEventListener("mousedown",vr,!0),_r.removeEventListener("contextmenu",vr,!0))}}},[re,ee,ye,Fe,et]);function or(){It.current=!0}return or}var lr=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function tr(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Rt,re=u.forwardRef(function(ee,ye){var Fe=ee.prefixCls,et=Fe===void 0?"rc-trigger-popup":Fe,ct=ee.children,Ft=ee.action,Ot=Ft===void 0?"hover":Ft,It=ee.showAction,or=ee.hideAction,nr=ee.popupVisible,vr=ee.defaultPopupVisible,rr=ee.onPopupVisibleChange,_r=ee.afterPopupVisibleChange,Or=ee.mouseEnterDelay,Lr=ee.mouseLeaveDelay,Vr=Lr===void 0?.1:Lr,zr=ee.focusDelay,Fr=ee.blurDelay,tn=ee.mask,xr=ee.maskClosable,dr=xr===void 0?!0:xr,rn=ee.getPopupContainer,Xr=ee.forceRender,pn=ee.autoDestroy,Gn=ee.destroyPopupOnHide,In=ee.popup,On=ee.popupClassName,on=ee.popupStyle,Tn=ee.popupPlacement,Dn=ee.builtinPlacements,cn=Dn===void 0?{}:Dn,Zn=ee.popupAlign,$r=ee.zIndex,fn=ee.stretch,Br=ee.getPopupClassNameFromAlign,Yn=ee.fresh,li=ee.alignPoint,mn=ee.onPopupClick,Tr=ee.onPopupAlign,An=ee.arrow,nn=ee.popupMotion,ui=ee.maskMotion,kn=ee.popupTransitionName,ln=ee.popupAnimation,Kn=ee.maskTransitionName,ci=ee.maskAnimation,Zr=ee.className,Un=ee.getTriggerDOMNode,Fn=b(ee,lr),Cn=pn||Gn||!1,Qn=u.useState(!1),Mi=v(Qn,2),zn=Mi[0],qr=Mi[1];en(function(){qr(Fi())},[]);var $n=u.useRef({}),bn=u.useContext(ut),ba=u.useMemo(function(){return{registerSubPopup:function(wr,Xn){$n.current[wr]=Xn,bn==null||bn.registerSubPopup(wr,Xn)}}},[bn]),an=Hn(),yi=u.useState(null),$i=v(yi,2),Ln=$i[0],Ci=$i[1],bi=u.useRef(null),Rr=Ae(function(Yt){bi.current=Yt,de(Yt)&&Ln!==Yt&&Ci(Yt),bn==null||bn.registerSubPopup(an,Yt)}),kt=u.useState(null),Qt=v(kt,2),pr=Qt[0],Ir=Qt[1],Nr=u.useRef(null),Hi=Ae(function(Yt){de(Yt)&&pr!==Yt&&(Ir(Yt),Nr.current=Yt)}),ri=u.Children.only(ct),fi=(ri==null?void 0:ri.props)||{},Li={},Ba=Ae(function(Yt){var wr,Xn,Ei=pr;return(Ei==null?void 0:Ei.contains(Yt))||((wr=ce(Ei))===null||wr===void 0?void 0:wr.host)===Yt||Yt===Ei||(Ln==null?void 0:Ln.contains(Yt))||((Xn=ce(Ln))===null||Xn===void 0?void 0:Xn.host)===Yt||Yt===Ln||Object.values($n.current).some(function(ai){return(ai==null?void 0:ai.contains(Yt))||Yt===ai})}),ja=mr(et,nn,ln,kn),Ga=mr(et,ui,ci,Kn),xa=u.useState(vr||!1),ji=v(xa,2),pi=ji[0],Ji=ji[1],Ti=nr!=null?nr:pi,da=Ae(function(Yt){nr===void 0&&Ji(Yt)});en(function(){Ji(nr||!1)},[nr]);var xn=u.useRef(Ti);xn.current=Ti;var En=u.useRef([]);En.current=[];var Qi=Ae(function(Yt){var wr;da(Yt),((wr=En.current[En.current.length-1])!==null&&wr!==void 0?wr:Ti)!==Yt&&(En.current.push(Yt),rr==null||rr(Yt))}),Ea=u.useRef(),wa=function(){clearTimeout(Ea.current)},Gi=function(wr){var Xn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;wa(),Xn===0?Qi(wr):Ea.current=setTimeout(function(){Qi(wr)},Xn*1e3)};u.useEffect(function(){return wa},[]);var Ts=u.useState(!1),as=v(Ts,2),pa=as[0],Sa=as[1];en(function(Yt){(!Yt||Ti)&&Sa(!0)},[Ti]);var ni=u.useState(null),Zi=v(ni,2),Yi=Zi[0],ss=Zi[1],ma=u.useState(null),aa=v(ma,2),va=aa[0],Na=aa[1],Ka=function(wr){Na([wr.clientX,wr.clientY])},os=Pn(Ti,Ln,li&&va!==null?va:pr,Tn,cn,Zn,Tr),xi=v(os,11),Za=xi[0],Fs=xi[1],Ua=xi[2],ls=xi[3],Rn=xi[4],Kr=xi[5],vn=xi[6],ii=xi[7],Di=xi[8],ga=xi[9],ea=xi[10],Ds=Ct(zn,Ot,It,or),Ya=v(Ds,2),ta=Ya[0],Ri=Ya[1],Ma=ta.has("click"),Xa=Ri.has("click")||Ri.has("contextMenu"),Ta=Ae(function(){pa||ea()}),Lo=function(){xn.current&&li&&Xa&&Gi(!1)};Le(Ti,pr,Ln,Ta,Lo),en(function(){Ta()},[va,Tn]),en(function(){Ti&&!(cn!=null&&cn[Tn])&&Ta()},[JSON.stringify(Zn)]);var sa=u.useMemo(function(){var Yt=er(cn,et,ga,li);return fe()(Yt,Br==null?void 0:Br(ga))},[ga,Br,cn,et,li]);u.useImperativeHandle(ye,function(){return{nativeElement:Nr.current,popupElement:bi.current,forceAlign:Ta}});var Js=u.useState(0),oa=v(Js,2),Ro=oa[0],Qs=oa[1],eo=u.useState(0),to=v(eo,2),ro=to[0],Po=to[1],no=function(){if(fn&&pr){var wr=pr.getBoundingClientRect();Qs(wr.width),Po(wr.height)}},Io=function(){no(),Ta()},Oo=function(wr){Sa(!1),ea(),_r==null||_r(wr)},Bs=function(){return new Promise(function(wr){no(),ss(function(){return wr})})};en(function(){Yi&&(ea(),Yi(),ss(null))},[Yi]);function Da(Yt,wr,Xn,Ei){Li[Yt]=function(ai){var As;Ei==null||Ei(ai),Gi(wr,Xn);for(var No=arguments.length,fl=new Array(No>1?No-1:0),so=1;so<No;so++)fl[so-1]=arguments[so];(As=fi[Yt])===null||As===void 0||As.call.apply(As,[fi,ai].concat(fl))}}(Ma||Xa)&&(Li.onClick=function(Yt){var wr;xn.current&&Xa?Gi(!1):!xn.current&&Ma&&(Ka(Yt),Gi(!0));for(var Xn=arguments.length,Ei=new Array(Xn>1?Xn-1:0),ai=1;ai<Xn;ai++)Ei[ai-1]=arguments[ai];(wr=fi.onClick)===null||wr===void 0||wr.call.apply(wr,[fi,Yt].concat(Ei))});var Fo=Cr(Ti,Xa,pr,Ln,tn,dr,Ba,Gi),la=ta.has("hover"),io=Ri.has("hover"),qa,Ja;la&&(Da("onMouseEnter",!0,Or,function(Yt){Ka(Yt)}),Da("onPointerEnter",!0,Or,function(Yt){Ka(Yt)}),qa=function(wr){(Ti||pa)&&Ln!==null&&Ln!==void 0&&Ln.contains(wr.target)&&Gi(!0,Or)},li&&(Li.onMouseMove=function(Yt){var wr;(wr=fi.onMouseMove)===null||wr===void 0||wr.call(fi,Yt)})),io&&(Da("onMouseLeave",!1,Vr),Da("onPointerLeave",!1,Vr),Ja=function(){Gi(!1,Vr)}),ta.has("focus")&&Da("onFocus",!0,zr),Ri.has("focus")&&Da("onBlur",!1,Fr),ta.has("contextMenu")&&(Li.onContextMenu=function(Yt){var wr;xn.current&&Ri.has("contextMenu")?Gi(!1):(Ka(Yt),Gi(!0)),Yt.preventDefault();for(var Xn=arguments.length,Ei=new Array(Xn>1?Xn-1:0),ai=1;ai<Xn;ai++)Ei[ai-1]=arguments[ai];(wr=fi.onContextMenu)===null||wr===void 0||wr.call.apply(wr,[fi,Yt].concat(Ei))}),Zr&&(Li.className=fe()(fi.className,Zr));var Qa=V(V({},fi),Li),Ns={},ao=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];ao.forEach(function(Yt){Fn[Yt]&&(Ns[Yt]=function(){for(var wr,Xn=arguments.length,Ei=new Array(Xn),ai=0;ai<Xn;ai++)Ei[ai]=arguments[ai];(wr=Qa[Yt])===null||wr===void 0||wr.call.apply(wr,[Qa].concat(Ei)),Fn[Yt].apply(Fn,Ei)})});var Bo=u.cloneElement(ri,V(V({},Qa),Ns)),us={x:Kr,y:vn},cs=An?V({},An!==!0?An:{}):null;return u.createElement(u.Fragment,null,u.createElement(Ce.Z,{disabled:!Ti,ref:Hi,onResize:Io},u.createElement(We,{getTriggerDOMNode:Un},Bo)),u.createElement(ut.Provider,{value:ba},u.createElement(Ee,{portal:Y,ref:Rr,prefixCls:et,popup:In,className:fe()(On,sa),style:on,target:pr,onMouseEnter:qa,onMouseLeave:Ja,onPointerEnter:qa,zIndex:$r,open:Ti,keepDom:pa,fresh:Yn,onClick:mn,onPointerDownCapture:Fo,mask:tn,motion:ja,maskMotion:Ga,onVisibleChanged:Oo,onPrepare:Bs,forceRender:Xr,autoDestroy:Cn,getPopupContainer:rn,align:ga,arrow:cs,arrowPos:us,ready:Za,offsetX:Fs,offsetY:Ua,offsetR:ls,offsetB:Rn,onAlign:Ta,stretch:fn,targetWidth:Ro/ii,targetHeight:ro/Di})))});return re}var sr=tr(Rt)},31632:function(Ht,at){"use strict";var q;var me=typeof Symbol=="function"&&Symbol.for,ge=me?Symbol.for("react.element"):60103,le=me?Symbol.for("react.portal"):60106,G=me?Symbol.for("react.fragment"):60107,B=me?Symbol.for("react.strict_mode"):60108,V=me?Symbol.for("react.profiler"):60114,K=me?Symbol.for("react.provider"):60109,F=me?Symbol.for("react.context"):60110,i=me?Symbol.for("react.async_mode"):60111,U=me?Symbol.for("react.concurrent_mode"):60111,L=me?Symbol.for("react.forward_ref"):60112,v=me?Symbol.for("react.suspense"):60113,E=me?Symbol.for("react.suspense_list"):60120,b=me?Symbol.for("react.memo"):60115,w=me?Symbol.for("react.lazy"):60116,p=me?Symbol.for("react.block"):60121,y=me?Symbol.for("react.fundamental"):60117,M=me?Symbol.for("react.responder"):60118,d=me?Symbol.for("react.scope"):60119;function f(h){if(typeof h=="object"&&h!==null){var S=h.$$typeof;switch(S){case ge:switch(h=h.type,h){case i:case U:case G:case V:case B:case v:return h;default:switch(h=h&&h.$$typeof,h){case F:case L:case w:case b:case K:return h;default:return S}}case le:return S}}}function u(h){return f(h)===U}q=i,q=U,q=F,q=K,q=ge,q=L,q=G,q=w,q=b,q=le,q=V,q=B,q=v,q=function(h){return u(h)||f(h)===i},q=u,q=function(h){return f(h)===F},q=function(h){return f(h)===K},q=function(h){return typeof h=="object"&&h!==null&&h.$$typeof===ge},q=function(h){return f(h)===L},q=function(h){return f(h)===G},q=function(h){return f(h)===w},at.isMemo=function(h){return f(h)===b},q=function(h){return f(h)===le},q=function(h){return f(h)===V},q=function(h){return f(h)===B},q=function(h){return f(h)===v},q=function(h){return typeof h=="string"||typeof h=="function"||h===G||h===U||h===V||h===B||h===v||h===E||typeof h=="object"&&h!==null&&(h.$$typeof===w||h.$$typeof===b||h.$$typeof===K||h.$$typeof===F||h.$$typeof===L||h.$$typeof===y||h.$$typeof===M||h.$$typeof===d||h.$$typeof===p)},q=f},81640:function(Ht,at,q){"use strict";Ht.exports=q(31632)},48482:function(Ht,at){"use strict";var q;var me=Symbol.for("react.element"),ge=Symbol.for("react.portal"),le=Symbol.for("react.fragment"),G=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),V=Symbol.for("react.provider"),K=Symbol.for("react.context"),F=Symbol.for("react.server_context"),i=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),v=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),w;w=Symbol.for("react.module.reference");function p(y){if(typeof y=="object"&&y!==null){var M=y.$$typeof;switch(M){case me:switch(y=y.type,y){case le:case B:case G:case U:case L:return y;default:switch(y=y&&y.$$typeof,y){case F:case K:case i:case E:case v:case V:return y;default:return M}}case ge:return M}}}q=K,q=V,q=me,at.ForwardRef=i,q=le,q=E,q=v,q=ge,q=B,q=G,q=U,q=L,q=function(){return!1},q=function(){return!1},q=function(y){return p(y)===K},q=function(y){return p(y)===V},q=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===me},q=function(y){return p(y)===i},q=function(y){return p(y)===le},q=function(y){return p(y)===E},at.isMemo=function(y){return p(y)===v},q=function(y){return p(y)===ge},q=function(y){return p(y)===B},q=function(y){return p(y)===G},q=function(y){return p(y)===U},q=function(y){return p(y)===L},q=function(y){return typeof y=="string"||typeof y=="function"||y===le||y===B||y===G||y===U||y===L||y===b||typeof y=="object"&&y!==null&&(y.$$typeof===E||y.$$typeof===v||y.$$typeof===V||y.$$typeof===K||y.$$typeof===i||y.$$typeof===w||y.getModuleId!==void 0)},q=p},52481:function(Ht,at,q){"use strict";Ht.exports=q(48482)},11771:function(){var Ht,at,q,me=!1,ge,le;window.PR_SHOULD_USE_CONTINUATION=!0;var G,B;(function(){var V=window,K=["break,continue,do,else,for,if,return,while"],F=[K,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],i=[F,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],U=[i,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],L=[i,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],v=[i,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],E="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",b=[i,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],w="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",p=[K,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],y=[K,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],M=[K,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],d=[U,v,L,b,w,p,y,M],f=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,u="str",h="kwd",S="com",k="typ",m="lit",A="pun",I="pln",C="tag",P="dec",l="src",c="atn",s="atv",g="nocode",R="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function D(Ie){for(var He=0,ht=!1,ft=!1,dt=0,se=Ie.length;dt<se;++dt){var De=Ie[dt];if(De.ignoreCase)ft=!0;else if(/[a-z]/i.test(De.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){ht=!0,ft=!1;break}}var ze={b:8,t:9,n:10,v:11,f:12,r:13};function Ge(ke){var lt=ke.charCodeAt(0);if(lt!==92)return lt;var $t=ke.charAt(1);return lt=ze[$t],lt||("0"<=$t&&$t<="7"?parseInt(ke.substring(1),8):$t==="u"||$t==="x"?parseInt(ke.substring(2),16):ke.charCodeAt(1))}function qe(ke){if(ke<32)return(ke<16?"\\x0":"\\x")+ke.toString(16);var lt=String.fromCharCode(ke);return lt==="\\"||lt==="-"||lt==="]"||lt==="^"?"\\"+lt:lt}function vt(ke){var lt=ke.substring(1,ke.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),$t=[],tt=lt[0]==="^",Ze=["["];tt&&Ze.push("^");for(var Je=tt?1:0,pt=lt.length;Je<pt;++Je){var je=lt[Je];if(/\\[bdsw]/i.test(je))Ze.push(je);else{var _t=Ge(je),xt;Je+2<pt&&lt[Je+1]==="-"?(xt=Ge(lt[Je+2]),Je+=2):xt=_t,$t.push([_t,xt]),xt<65||_t>122||(xt<65||_t>90||$t.push([Math.max(65,_t)|32,Math.min(xt,90)|32]),xt<97||_t>122||$t.push([Math.max(97,_t)&-33,Math.min(xt,122)&-33]))}}$t.sort(function(Se,fe){return Se[0]-fe[0]||fe[1]-Se[1]});for(var Kt=[],Bt=[],Je=0;Je<$t.length;++Je){var Rt=$t[Je];Rt[0]<=Bt[1]+1?Bt[1]=Math.max(Bt[1],Rt[1]):Kt.push(Bt=Rt)}for(var Je=0;Je<Kt.length;++Je){var Rt=Kt[Je];Ze.push(qe(Rt[0])),Rt[1]>Rt[0]&&(Rt[1]+1>Rt[0]&&Ze.push("-"),Ze.push(qe(Rt[1])))}return Ze.push("]"),Ze.join("")}function Ut(ke){for(var lt=ke.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),$t=lt.length,tt=[],Ze=0,Je=0;Ze<$t;++Ze){var pt=lt[Ze];if(pt==="(")++Je;else if(pt.charAt(0)==="\\"){var je=+pt.substring(1);je&&(je<=Je?tt[je]=-1:lt[Ze]=qe(je))}}for(var Ze=1;Ze<tt.length;++Ze)tt[Ze]===-1&&(tt[Ze]=++He);for(var Ze=0,Je=0;Ze<$t;++Ze){var pt=lt[Ze];if(pt==="(")++Je,tt[Je]||(lt[Ze]="(?:");else if(pt.charAt(0)==="\\"){var je=+pt.substring(1);je&&je<=Je&&(lt[Ze]="\\"+tt[je])}}for(var Ze=0;Ze<$t;++Ze)lt[Ze]==="^"&&lt[Ze+1]!=="^"&&(lt[Ze]="");if(ke.ignoreCase&&ht)for(var Ze=0;Ze<$t;++Ze){var pt=lt[Ze],_t=pt.charAt(0);pt.length>=2&&_t==="["?lt[Ze]=vt(pt):_t!=="\\"&&(lt[Ze]=pt.replace(/[a-zA-Z]/g,function(Bt){var Rt=Bt.charCodeAt(0);return"["+String.fromCharCode(Rt&-33,Rt|32)+"]"}))}return lt.join("")}for(var bt=[],dt=0,se=Ie.length;dt<se;++dt){var De=Ie[dt];if(De.global||De.multiline)throw new Error(""+De);bt.push("(?:"+Ut(De)+")")}return new RegExp(bt.join("|"),ft?"gi":"g")}function x(Ie,He){var ht=/(?:^|\s)nocode(?:\s|$)/,ft=[],dt=0,se=[],De=0;function ze(Ge){var qe=Ge.nodeType;if(qe==1){if(ht.test(Ge.className))return;for(var vt=Ge.firstChild;vt;vt=vt.nextSibling)ze(vt);var Ut=Ge.nodeName.toLowerCase();(Ut==="br"||Ut==="li")&&(ft[De]=`
`,se[De<<1]=dt++,se[De++<<1|1]=Ge)}else if(qe==3||qe==4){var bt=Ge.nodeValue;bt.length&&(He?bt=bt.replace(/\r\n?/g,`
`):bt=bt.replace(/[ \t\r\n]+/g," "),ft[De]=bt,se[De<<1]=dt,dt+=bt.length,se[De++<<1|1]=Ge)}}return ze(Ie),{sourceCode:ft.join("").replace(/\n$/,""),spans:se}}function T(Ie,He,ht,ft,dt){if(ht){var se={sourceNode:Ie,pre:1,langExtension:null,numberLines:null,sourceCode:ht,spans:null,basePos:He,decorations:null};ft(se),dt.push.apply(dt,se.decorations)}}var O=/\S/;function $(Ie){for(var He=void 0,ht=Ie.firstChild;ht;ht=ht.nextSibling){var ft=ht.nodeType;He=ft===1?He?Ie:ht:ft===3&&O.test(ht.nodeValue)?Ie:He}return He===Ie?void 0:He}function H(Ie,He){var ht={},ft;(function(){for(var De=Ie.concat(He),ze=[],Ge={},qe=0,vt=De.length;qe<vt;++qe){var Ut=De[qe],bt=Ut[3];if(bt)for(var ke=bt.length;--ke>=0;)ht[bt.charAt(ke)]=Ut;var lt=Ut[1],$t=""+lt;Ge.hasOwnProperty($t)||(ze.push(lt),Ge[$t]=null)}ze.push(/[\0-\uffff]/),ft=D(ze)})();var dt=He.length,se=function(De){for(var ze=De.sourceCode,Ge=De.basePos,qe=De.sourceNode,vt=[Ge,I],Ut=0,bt=ze.match(ft)||[],ke={},lt=0,$t=bt.length;lt<$t;++lt){var tt=bt[lt],Ze=ke[tt],Je=void 0,pt;if(typeof Ze=="string")pt=!1;else{var je=ht[tt.charAt(0)];if(je)Je=tt.match(je[1]),Ze=je[0];else{for(var _t=0;_t<dt;++_t)if(je=He[_t],Je=tt.match(je[1]),Je){Ze=je[0];break}Je||(Ze=I)}pt=Ze.length>=5&&Ze.substring(0,5)==="lang-",pt&&!(Je&&typeof Je[1]=="string")&&(pt=!1,Ze=l),pt||(ke[tt]=Ze)}var xt=Ut;if(Ut+=tt.length,!pt)vt.push(Ge+xt,Ze);else{var Kt=Je[1],Bt=tt.indexOf(Kt),Rt=Bt+Kt.length;Je[2]&&(Rt=tt.length-Je[2].length,Bt=Rt-Kt.length);var Se=Ze.substring(5);T(qe,Ge+xt,tt.substring(0,Bt),se,vt),T(qe,Ge+xt+Bt,Kt,Pe(Se,Kt),vt),T(qe,Ge+xt+Rt,tt.substring(Rt),se,vt)}}De.decorations=vt};return se}function Z(Ie){var He=[],ht=[];Ie.tripleQuotedStrings?He.push([u,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Ie.multiLineStrings?He.push([u,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):He.push([u,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Ie.verbatimStrings&&ht.push([u,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var ft=Ie.hashComments;ft&&(Ie.cStyleComments?(ft>1?He.push([S,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):He.push([S,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),ht.push([u,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):He.push([S,/^#[^\r\n]*/,null,"#"])),Ie.cStyleComments&&(ht.push([S,/^\/\/[^\r\n]*/,null]),ht.push([S,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var dt=Ie.regexLiterals;if(dt){var se=dt>1?"":`
\r`,De=se?".":"[\\S\\s]",ze="/(?=[^/*"+se+"])(?:[^/\\x5B\\x5C"+se+"]|\\x5C"+De+"|\\x5B(?:[^\\x5C\\x5D"+se+"]|\\x5C"+De+")*(?:\\x5D|$))+/";ht.push(["lang-regex",RegExp("^"+R+"("+ze+")")])}var Ge=Ie.types;Ge&&ht.push([k,Ge]);var qe=(""+Ie.keywords).replace(/^ | $/g,"");qe.length&&ht.push([h,new RegExp("^(?:"+qe.replace(/[\s,]+/g,"|")+")\\b"),null]),He.push([I,/^\s+/,null,` \r
\xA0`]);var vt="^.[^\\s\\w.$@'\"`/\\\\]*";return Ie.regexLiterals&&(vt+="(?!s*/)"),ht.push([m,/^@[a-z_$][a-z_$@0-9]*/i,null],[k,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[I,/^[a-z_$][a-z_$@0-9]*/i,null],[m,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[I,/^\\[\s\S]?/,null],[A,new RegExp(vt),null]),H(He,ht)}var te=Z({keywords:d,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function J(Ie,He,ht){for(var ft=/(?:^|\s)nocode(?:\s|$)/,dt=/\r\n?|\n/,se=Ie.ownerDocument,De=se.createElement("li");Ie.firstChild;)De.appendChild(Ie.firstChild);var ze=[De];function Ge(lt){var $t=lt.nodeType;if($t==1&&!ft.test(lt.className))if(lt.nodeName==="br")qe(lt),lt.parentNode&&lt.parentNode.removeChild(lt);else for(var tt=lt.firstChild;tt;tt=tt.nextSibling)Ge(tt);else if(($t==3||$t==4)&&ht){var Ze=lt.nodeValue,Je=Ze.match(dt);if(Je){var pt=Ze.substring(0,Je.index);lt.nodeValue=pt;var je=Ze.substring(Je.index+Je[0].length);if(je){var _t=lt.parentNode;_t.insertBefore(se.createTextNode(je),lt.nextSibling)}qe(lt),pt||lt.parentNode.removeChild(lt)}}}function qe(lt){for(;!lt.nextSibling;)if(lt=lt.parentNode,!lt)return;function $t(Je,pt){var je=pt?Je.cloneNode(!1):Je,_t=Je.parentNode;if(_t){var xt=$t(_t,1),Kt=Je.nextSibling;xt.appendChild(je);for(var Bt=Kt;Bt;Bt=Kt)Kt=Bt.nextSibling,xt.appendChild(Bt)}return je}for(var tt=$t(lt.nextSibling,0),Ze;(Ze=tt.parentNode)&&Ze.nodeType===1;)tt=Ze;ze.push(tt)}for(var vt=0;vt<ze.length;++vt)Ge(ze[vt]);He===(He|0)&&ze[0].setAttribute("value",He);var Ut=se.createElement("ol");Ut.className="linenums";for(var bt=Math.max(0,He-1|0)||0,vt=0,ke=ze.length;vt<ke;++vt)De=ze[vt],De.className="L"+(vt+bt)%10,De.firstChild||De.appendChild(se.createTextNode("\xA0")),Ut.appendChild(De);Ie.appendChild(Ut)}function ie(Ie){var He=/\bMSIE\s(\d+)/.exec(navigator.userAgent);He=He&&+He[1]<=8;var ht=/\n/g,ft=Ie.sourceCode,dt=ft.length,se=0,De=Ie.spans,ze=De.length,Ge=0,qe=Ie.decorations,vt=qe.length,Ut=0;qe[vt]=dt;var bt,ke;for(ke=bt=0;ke<vt;)qe[ke]!==qe[ke+2]?(qe[bt++]=qe[ke++],qe[bt++]=qe[ke++]):ke+=2;for(vt=bt,ke=bt=0;ke<vt;){for(var lt=qe[ke],$t=qe[ke+1],tt=ke+2;tt+2<=vt&&qe[tt+1]===$t;)tt+=2;qe[bt++]=lt,qe[bt++]=$t,ke=tt}vt=qe.length=bt;var Ze=Ie.sourceNode,Je="";Ze&&(Je=Ze.style.display,Ze.style.display="none");try{for(var pt=null;Ge<ze;){var je=De[Ge],_t=De[Ge+2]||dt,xt=qe[Ut+2]||dt,tt=Math.min(_t,xt),Kt=De[Ge+1],Bt;if(Kt.nodeType!==1&&(Bt=ft.substring(se,tt))){He&&(Bt=Bt.replace(ht,"\r")),Kt.nodeValue=Bt;var Rt=Kt.ownerDocument,Se=Rt.createElement("span");Se.className=qe[Ut+1];var fe=Kt.parentNode;fe.replaceChild(Se,Kt),Se.appendChild(Kt),se<_t&&(De[Ge+1]=Kt=Rt.createTextNode(ft.substring(tt,_t)),fe.insertBefore(Kt,Se.nextSibling))}se=tt,se>=_t&&(Ge+=2),se>=xt&&(Ut+=2)}}finally{Ze&&(Ze.style.display=Je)}}var oe={};function ue(Ie,He){for(var ht=He.length;--ht>=0;){var ft=He[ht];oe.hasOwnProperty(ft)?V.console&&console.warn("cannot override language handler %s",ft):oe[ft]=Ie}}function Pe(Ie,He){return Ie&&oe.hasOwnProperty(Ie)||(Ie=/^\s*</.test(He)?"default-markup":"default-code"),oe[Ie]}ue(te,["default-code"]),ue(H([],[[I,/^[^<?]+/],[P,/^<!\w[^>]*(?:>|$)/],[S,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[A,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),ue(H([[I,/^[\s]+/,null,` \r
`],[s,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[C,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[c,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[A,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),ue(H([],[[s,/^[\s\S]+/]]),["uq.val"]),ue(Z({keywords:U,hashComments:!0,cStyleComments:!0,types:f}),["c","cc","cpp","cxx","cyc","m"]),ue(Z({keywords:"null,true,false"}),["json"]),ue(Z({keywords:v,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:f}),["cs"]),ue(Z({keywords:L,cStyleComments:!0}),["java"]),ue(Z({keywords:M,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ue(Z({keywords:p,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ue(Z({keywords:w,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ue(Z({keywords:y,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ue(Z({keywords:b,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ue(Z({keywords:E,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ue(H([],[[u,/^[\s\S]+/]]),["regex"]);function Ne(Ie){var He=Ie.langExtension;try{var ht=x(Ie.sourceNode,Ie.pre),ft=ht.sourceCode;Ie.sourceCode=ft,Ie.spans=ht.spans,Ie.basePos=0,Pe(He,ft)(Ie),ie(Ie)}catch(dt){V.console&&console.log(dt&&dt.stack||dt)}}function Ve(Ie,He,ht){var ft=ht||!1,dt=He||null,se=document.createElement("div");se.innerHTML="<pre>"+Ie+"</pre>",se=se.firstChild,ft&&J(se,ft,!0);var De={langExtension:dt,numberLines:ft,sourceNode:se,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Ne(De),se.innerHTML}function ot(Ie,He){var ht=He||document.body,ft=ht.ownerDocument||document;function dt(je){return ht.getElementsByTagName(je)}for(var se=[dt("pre"),dt("code"),dt("xmp")],De=[],ze=0;ze<se.length;++ze)for(var Ge=0,qe=se[ze].length;Ge<qe;++Ge)De.push(se[ze][Ge]);se=null;var vt=Date;vt.now||(vt={now:function(){return+new Date}});var Ut=0,bt=/\blang(?:uage)?-([\w.]+)(?!\S)/,ke=/\bprettyprint\b/,lt=/\bprettyprinted\b/,$t=/pre|xmp/i,tt=/^code$/i,Ze=/^(?:pre|code|xmp)$/i,Je={};function pt(){for(var je=V.PR_SHOULD_USE_CONTINUATION?vt.now()+250:1/0;Ut<De.length&&vt.now()<je;Ut++){for(var _t=De[Ut],xt=Je,Kt=_t;Kt=Kt.previousSibling;){var Bt=Kt.nodeType,Rt=(Bt===7||Bt===8)&&Kt.nodeValue;if(Rt?!/^\??prettify\b/.test(Rt):Bt!==3||/\S/.test(Kt.nodeValue))break;if(Rt){xt={},Rt.replace(/\b(\w+)=([\w:.%+-]+)/g,function($e,mt,Mt){xt[mt]=Mt});break}}var Se=_t.className;if((xt!==Je||ke.test(Se))&&!lt.test(Se)){for(var fe=!1,Ce=_t.parentNode;Ce;Ce=Ce.parentNode){var de=Ce.tagName;if(Ze.test(de)&&Ce.className&&ke.test(Ce.className)){fe=!0;break}}if(!fe){_t.className+=" prettyprinted";var pe=xt.lang;if(!pe){pe=Se.match(bt);var xe;!pe&&(xe=$(_t))&&tt.test(xe.tagName)&&(pe=xe.className.match(bt)),pe&&(pe=pe[1])}var Q;if($t.test(_t.tagName))Q=1;else{var ne=_t.currentStyle,ce=ft.defaultView,Ae=ne?ne.whiteSpace:ce&&ce.getComputedStyle?ce.getComputedStyle(_t,null).getPropertyValue("white-space"):0;Q=Ae&&Ae.substring(0,3)==="pre"}var be=xt.linenums;(be=be==="true"||+be)||(be=Se.match(/\blinenums\b(?::(\d+))?/),be=be?be[1]&&be[1].length?+be[1]:!0:!1),be&&J(_t,be,Q);var Oe={langExtension:pe,sourceNode:_t,numberLines:be,pre:Q,sourceCode:null,basePos:null,spans:null,decorations:null};Ne(Oe)}}}Ut<De.length?V.setTimeout(pt,250):typeof Ie=="function"&&Ie()}pt()}var Et=V.PR={createSimpleLexer:H,registerLangHandler:ue,sourceDecorator:Z,PR_ATTRIB_NAME:c,PR_ATTRIB_VALUE:s,PR_COMMENT:S,PR_DECLARATION:P,PR_KEYWORD:h,PR_LITERAL:m,PR_NOCODE:g,PR_PLAIN:I,PR_PUNCTUATION:A,PR_SOURCE:l,PR_STRING:u,PR_TAG:C,PR_TYPE:k,prettyPrintOne:me?V.prettyPrintOne=Ve:G=Ve,prettyPrint:B=me?V.prettyPrint=ot:B=ot},it=V.define;typeof it=="function"&&it.amd&&it("google-code-prettify",[],function(){return Et})})()},20640:function(Ht,at,q){"use strict";var me=q(11742),ge={"text/plain":"Text","text/html":"Url",default:"Text"},le="Copy to clipboard: #{key}, Enter";function G(V){var K=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return V.replace(/#{\s*key\s*}/g,K)}function B(V,K){var F,i,U,L,v,E,b=!1;K||(K={}),F=K.debug||!1;try{U=me(),L=document.createRange(),v=document.getSelection(),E=document.createElement("span"),E.textContent=V,E.ariaHidden="true",E.style.all="unset",E.style.position="fixed",E.style.top=0,E.style.clip="rect(0, 0, 0, 0)",E.style.whiteSpace="pre",E.style.webkitUserSelect="text",E.style.MozUserSelect="text",E.style.msUserSelect="text",E.style.userSelect="text",E.addEventListener("copy",function(p){if(p.stopPropagation(),K.format)if(p.preventDefault(),typeof p.clipboardData=="undefined"){F&&console.warn("unable to use e.clipboardData"),F&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var y=ge[K.format]||ge.default;window.clipboardData.setData(y,V)}else p.clipboardData.clearData(),p.clipboardData.setData(K.format,V);K.onCopy&&(p.preventDefault(),K.onCopy(p.clipboardData))}),document.body.appendChild(E),L.selectNodeContents(E),v.addRange(L);var w=document.execCommand("copy");if(!w)throw new Error("copy command was unsuccessful");b=!0}catch(p){F&&console.error("unable to copy using execCommand: ",p),F&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(K.format||"text",V),K.onCopy&&K.onCopy(window.clipboardData),b=!0}catch(y){F&&console.error("unable to copy using clipboardData: ",y),F&&console.error("falling back to prompt"),i=G("message"in K?K.message:le),window.prompt(i,V)}}finally{v&&(typeof v.removeRange=="function"?v.removeRange(L):v.removeAllRanges()),E&&document.body.removeChild(E),U()}return b}Ht.exports=B},67631:function(Ht){typeof window!="undefined"&&function(q,me){Ht.exports=me()}(this,()=>(()=>{var at={"./src/config.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{enableStreamingMode:()=>c,hlsDefaultConfig:()=>C,mergeConfig:()=>l});var V=B("./src/controller/abr-controller.ts"),K=B("./src/controller/audio-stream-controller.ts"),F=B("./src/controller/audio-track-controller.ts"),i=B("./src/controller/subtitle-stream-controller.ts"),U=B("./src/controller/subtitle-track-controller.ts"),L=B("./src/controller/buffer-controller.ts"),v=B("./src/controller/timeline-controller.ts"),E=B("./src/controller/cap-level-controller.ts"),b=B("./src/controller/fps-controller.ts"),w=B("./src/controller/eme-controller.ts"),p=B("./src/controller/cmcd-controller.ts"),y=B("./src/utils/xhr-loader.ts"),M=B("./src/utils/fetch-loader.ts"),d=B("./src/utils/cues.ts"),f=B("./src/utils/mediakeys-helper.ts"),u=B("./src/utils/logger.ts");function h(){return h=Object.assign?Object.assign.bind():function(s){for(var g=1;g<arguments.length;g++){var R=arguments[g];for(var D in R)Object.prototype.hasOwnProperty.call(R,D)&&(s[D]=R[D])}return s},h.apply(this,arguments)}function S(s,g){var R=Object.keys(s);if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(s);g&&(D=D.filter(function(x){return Object.getOwnPropertyDescriptor(s,x).enumerable})),R.push.apply(R,D)}return R}function k(s){for(var g=1;g<arguments.length;g++){var R=arguments[g]!=null?arguments[g]:{};g%2?S(Object(R),!0).forEach(function(D){m(s,D,R[D])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(R)):S(Object(R)).forEach(function(D){Object.defineProperty(s,D,Object.getOwnPropertyDescriptor(R,D))})}return s}function m(s,g,R){return g=A(g),g in s?Object.defineProperty(s,g,{value:R,enumerable:!0,configurable:!0,writable:!0}):s[g]=R,s}function A(s){var g=I(s,"string");return typeof g=="symbol"?g:String(g)}function I(s,g){if(typeof s!="object"||s===null)return s;var R=s[Symbol.toPrimitive];if(R!==void 0){var D=R.call(s,g||"default");if(typeof D!="object")return D;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(s)}var C=k(k({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:y.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:V.default,bufferController:L.default,capLevelController:E.default,fpsController:b.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:f.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0},P()),{},{subtitleStreamController:i.SubtitleStreamController,subtitleTrackController:U.default,timelineController:v.TimelineController,audioStreamController:K.default,audioTrackController:F.default,emeController:w.default,cmcdController:p.default});function P(){return{cueHandler:d.default,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function l(s,g){if((g.liveSyncDurationCount||g.liveMaxLatencyDurationCount)&&(g.liveSyncDuration||g.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(g.liveMaxLatencyDurationCount!==void 0&&(g.liveSyncDurationCount===void 0||g.liveMaxLatencyDurationCount<=g.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(g.liveMaxLatencyDuration!==void 0&&(g.liveSyncDuration===void 0||g.liveMaxLatencyDuration<=g.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return h({},s,g)}function c(s){var g=s.loader;if(g!==M.default&&g!==y.default)u.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),s.progressive=!1;else{var R=(0,M.fetchSupported)();R&&(s.loader=M.default,s.progressive=!0,s.enableSoftwareAES=!0,u.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>y});var V=B("./src/polyfills/number.ts"),K=B("./src/utils/ewma-bandwidth-estimator.ts"),F=B("./src/events.ts"),i=B("./src/errors.ts"),U=B("./src/types/loader.ts"),L=B("./src/utils/logger.ts");function v(M,d){for(var f=0;f<d.length;f++){var u=d[f];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(M,b(u.key),u)}}function E(M,d,f){return d&&v(M.prototype,d),f&&v(M,f),Object.defineProperty(M,"prototype",{writable:!1}),M}function b(M){var d=w(M,"string");return typeof d=="symbol"?d:String(d)}function w(M,d){if(typeof M!="object"||M===null)return M;var f=M[Symbol.toPrimitive];if(f!==void 0){var u=f.call(M,d||"default");if(typeof u!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(M)}var p=function(){function M(f){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=f;var u=f.config;this.bwEstimator=new K.default(u.abrEwmaSlowVoD,u.abrEwmaFastVoD,u.abrEwmaDefaultEstimate),this.registerListeners()}var d=M.prototype;return d.registerListeners=function(){var u=this.hls;u.on(F.Events.FRAG_LOADING,this.onFragLoading,this),u.on(F.Events.FRAG_LOADED,this.onFragLoaded,this),u.on(F.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.on(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.on(F.Events.ERROR,this.onError,this)},d.unregisterListeners=function(){var u=this.hls;u.off(F.Events.FRAG_LOADING,this.onFragLoading,this),u.off(F.Events.FRAG_LOADED,this.onFragLoaded,this),u.off(F.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.off(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.off(F.Events.ERROR,this.onError,this)},d.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},d.onFragLoading=function(u,h){var S=h.frag;if(S.type===U.PlaylistLevelType.MAIN&&!this.timer){var k;this.fragCurrent=S,this.partCurrent=(k=h.part)!=null?k:null,this.timer=self.setInterval(this.onCheck,100)}},d.onLevelLoaded=function(u,h){var S=this.hls.config;h.details.live?this.bwEstimator.update(S.abrEwmaSlowLive,S.abrEwmaFastLive):this.bwEstimator.update(S.abrEwmaSlowVoD,S.abrEwmaFastVoD)},d._abandonRulesCheck=function(){var u=this.fragCurrent,h=this.partCurrent,S=this.hls,k=S.autoLevelEnabled,m=S.media;if(!(!u||!m)){var A=h?h.stats:u.stats,I=h?h.duration:u.duration;if(A.aborted||A.loaded&&A.loaded===A.total||u.level===0){this.clearTimer(),this._nextAutoLevel=-1;return}if(!(!k||m.paused||!m.playbackRate||!m.readyState)){var C=S.mainForwardBufferInfo;if(C!==null){var P=performance.now()-A.loading.start,l=Math.abs(m.playbackRate);if(!(P<=500*I/l)){var c=A.loaded&&A.loading.first,s=this.bwEstimator.getEstimate(),g=S.levels,R=S.minAutoLevel,D=g[u.level],x=A.total||Math.max(A.loaded,Math.round(I*D.maxBitrate/8)),T=c?A.loaded*1e3/P:0,O=T?(x-A.loaded)/T:x*8/s,$=C.len/l;if(!(O<=$)){var H=Number.POSITIVE_INFINITY,Z;for(Z=u.level-1;Z>R;Z--){var te=g[Z].maxBitrate;if(H=T?I*te/(8*.8*T):I*te/s,H<$)break}H>=O||(L.logger.warn("Fragment "+u.sn+(h?" part "+h.index:"")+" of level "+u.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+Z+`
Current BW estimate: `+((0,V.isFiniteNumber)(s)?(s/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+O.toFixed(3)+` s
Estimated load time for the next fragment: `+H.toFixed(3)+` s
Time to underbuffer: `+$.toFixed(3)+" s"),S.nextLoadLevel=Z,c&&this.bwEstimator.sample(P,A.loaded),this.clearTimer(),(u.loader||u.keyLoader)&&(this.fragCurrent=this.partCurrent=null,u.abortRequests()),S.trigger(F.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:u,part:h,stats:A}))}}}}}},d.onFragLoaded=function(u,h){var S=h.frag,k=h.part;if(S.type===U.PlaylistLevelType.MAIN&&(0,V.isFiniteNumber)(S.sn)){var m=k?k.stats:S.stats,A=k?k.duration:S.duration;if(this.clearTimer(),this.lastLoadedFragLevel=S.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var I=this.hls.levels[S.level],C=(I.loaded?I.loaded.bytes:0)+m.loaded,P=(I.loaded?I.loaded.duration:0)+A;I.loaded={bytes:C,duration:P},I.realBitrate=Math.round(8*C/P)}if(S.bitrateTest){var l={stats:m,frag:S,part:k,id:S.type};this.onFragBuffered(F.Events.FRAG_BUFFERED,l)}}},d.onFragBuffered=function(u,h){var S=h.frag,k=h.part,m=k?k.stats:S.stats;if(!m.aborted&&!(S.type!==U.PlaylistLevelType.MAIN||S.sn==="initSegment")){var A=m.parsing.end-m.loading.start;this.bwEstimator.sample(A,m.loaded),m.bwEstimate=this.bwEstimator.getEstimate(),S.bitrateTest?this.bitrateTestDelay=A/1e3:this.bitrateTestDelay=0}},d.onError=function(u,h){var S;if(((S=h.frag)===null||S===void 0?void 0:S.type)===U.PlaylistLevelType.MAIN){if(h.type===i.ErrorTypes.KEY_SYSTEM_ERROR){this.clearTimer();return}switch(h.details){case i.ErrorDetails.FRAG_LOAD_ERROR:case i.ErrorDetails.FRAG_LOAD_TIMEOUT:case i.ErrorDetails.KEY_LOAD_ERROR:case i.ErrorDetails.KEY_LOAD_TIMEOUT:this.clearTimer();break;default:break}}},d.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},d.getNextABRAutoLevel=function(){var u=this.fragCurrent,h=this.partCurrent,S=this.hls,k=S.maxAutoLevel,m=S.config,A=S.minAutoLevel,I=S.media,C=h?h.duration:u?u.duration:0,P=I&&I.playbackRate!==0?Math.abs(I.playbackRate):1,l=this.bwEstimator?this.bwEstimator.getEstimate():m.abrEwmaDefaultEstimate,c=S.mainForwardBufferInfo,s=(c?c.len:0)/P,g=this.findBestLevel(l,A,k,s,m.abrBandWidthFactor,m.abrBandWidthUpFactor);if(g>=0)return g;L.logger.trace((s?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var R=C?Math.min(C,m.maxStarvationDelay):m.maxStarvationDelay,D=m.abrBandWidthFactor,x=m.abrBandWidthUpFactor;if(!s){var T=this.bitrateTestDelay;if(T){var O=C?Math.min(C,m.maxLoadingDelay):m.maxLoadingDelay;R=O-T,L.logger.trace("bitrate test took "+Math.round(1e3*T)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*R)+" ms"),D=x=1}}return g=this.findBestLevel(l,A,k,s+R,D,x),Math.max(g,0)},d.findBestLevel=function(u,h,S,k,m,A){for(var I,C=this.fragCurrent,P=this.partCurrent,l=this.lastLoadedFragLevel,c=this.hls.levels,s=c[l],g=!!(s!=null&&(I=s.details)!==null&&I!==void 0&&I.live),R=s==null?void 0:s.codecSet,D=P?P.duration:C?C.duration:0,x=S;x>=h;x--){var T=c[x];if(!(!T||R&&T.codecSet!==R)){var O=T.details,$=(P?O==null?void 0:O.partTarget:O==null?void 0:O.averagetargetduration)||D,H=void 0;x<=l?H=m*u:H=A*u;var Z=c[x].maxBitrate,te=Z*$/H;if(L.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+x+"/"+Math.round(H)+"/"+Z+"/"+$+"/"+k+"/"+te),H>Z&&(te===0||!(0,V.isFiniteNumber)(te)||g&&!this.bitrateTestDelay||te<k))return x}}return-1},E(M,[{key:"nextAutoLevel",get:function(){var u=this._nextAutoLevel,h=this.bwEstimator;if(u!==-1&&!h.canEstimate())return u;var S=this.getNextABRAutoLevel();return u!==-1&&this.hls.levels[S].loadError?u:(u!==-1&&(S=Math.min(u,S)),S)},set:function(u){this._nextAutoLevel=u}}]),M}();const y=p},"./src/controller/audio-stream-controller.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>m});var V=B("./src/polyfills/number.ts"),K=B("./src/controller/base-stream-controller.ts"),F=B("./src/events.ts"),i=B("./src/utils/buffer-helper.ts"),U=B("./src/controller/fragment-tracker.ts"),L=B("./src/types/level.ts"),v=B("./src/types/loader.ts"),E=B("./src/loader/fragment.ts"),b=B("./src/demux/chunk-cache.ts"),w=B("./src/demux/transmuxer-interface.ts"),p=B("./src/types/transmuxer.ts"),y=B("./src/controller/fragment-finders.ts"),M=B("./src/utils/discontinuities.ts"),d=B("./src/errors.ts");function f(){return f=Object.assign?Object.assign.bind():function(A){for(var I=1;I<arguments.length;I++){var C=arguments[I];for(var P in C)Object.prototype.hasOwnProperty.call(C,P)&&(A[P]=C[P])}return A},f.apply(this,arguments)}function u(A,I){A.prototype=Object.create(I.prototype),A.prototype.constructor=A,h(A,I)}function h(A,I){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(P,l){return P.__proto__=l,P},h(A,I)}var S=100,k=function(A){u(I,A);function I(P,l,c){var s;return s=A.call(this,P,l,c,"[audio-stream-controller]")||this,s.videoBuffer=null,s.videoTrackCC=-1,s.waitingVideoCC=-1,s.audioSwitch=!1,s.trackId=-1,s.waitingData=null,s.mainDetails=null,s.bufferFlushed=!1,s.cachedTrackLoadedData=null,s._registerListeners(),s}var C=I.prototype;return C.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},C._registerListeners=function(){var l=this.hls;l.on(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.on(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.on(F.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),l.on(F.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),l.on(F.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.on(F.Events.ERROR,this.onError,this),l.on(F.Events.BUFFER_RESET,this.onBufferReset,this),l.on(F.Events.BUFFER_CREATED,this.onBufferCreated,this),l.on(F.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),l.on(F.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),l.on(F.Events.FRAG_BUFFERED,this.onFragBuffered,this)},C._unregisterListeners=function(){var l=this.hls;l.off(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.off(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.off(F.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),l.off(F.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),l.off(F.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.off(F.Events.ERROR,this.onError,this),l.off(F.Events.BUFFER_RESET,this.onBufferReset,this),l.off(F.Events.BUFFER_CREATED,this.onBufferCreated,this),l.off(F.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),l.off(F.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),l.off(F.Events.FRAG_BUFFERED,this.onFragBuffered,this)},C.onInitPtsFound=function(l,c){var s=c.frag,g=c.id,R=c.initPTS;if(g==="main"){var D=s.cc;this.initPTS[s.cc]=R,this.log("InitPTS for cc: "+D+" found from main: "+R),this.videoTrackCC=D,this.state===K.State.WAITING_INIT_PTS&&this.tick()}},C.startLoad=function(l){if(!this.levels){this.startPosition=l,this.state=K.State.STOPPED;return}var c=this.lastCurrentTime;this.stopLoad(),this.setInterval(S),this.fragLoadError=0,c>0&&l===-1?(this.log("Override startPosition with lastCurrentTime @"+c.toFixed(3)),l=c,this.state=K.State.IDLE):(this.loadedmetadata=!1,this.state=K.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=l,this.tick()},C.doTick=function(){switch(this.state){case K.State.IDLE:this.doTickIdle();break;case K.State.WAITING_TRACK:{var l,c=this.levels,s=this.trackId,g=c==null||(l=c[s])===null||l===void 0?void 0:l.details;if(g){if(this.waitForCdnTuneIn(g))break;this.state=K.State.WAITING_INIT_PTS}break}case K.State.FRAG_LOADING_WAITING_RETRY:{var R,D=performance.now(),x=this.retryDate;(!x||D>=x||(R=this.media)!==null&&R!==void 0&&R.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.trackId),this.state=K.State.IDLE);break}case K.State.WAITING_INIT_PTS:{var T=this.waitingData;if(T){var O=T.frag,$=T.part,H=T.cache,Z=T.complete;if(this.initPTS[O.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=K.State.FRAG_LOADING;var te=H.flush(),J={frag:O,part:$,payload:te,networkDetails:null};this._handleFragmentLoadProgress(J),Z&&A.prototype._handleFragmentLoadComplete.call(this,J)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log("Waiting fragment cc ("+O.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ie=this.getLoadPosition(),oe=i.BufferHelper.bufferInfo(this.mediaBuffer,ie,this.config.maxBufferHole),ue=(0,y.fragmentWithinToleranceTest)(oe.end,this.config.maxFragLookUpTolerance,O);ue<0&&(this.log("Waiting fragment cc ("+O.cc+") @ "+O.start+" cancelled because another fragment at "+oe.end+" is needed"),this.clearWaitingFragment())}}else this.state=K.State.IDLE}}this.onTickEnd()},C.clearWaitingFragment=function(){var l=this.waitingData;l&&(this.fragmentTracker.removeFragment(l.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=K.State.IDLE)},C.resetLoadingState=function(){this.clearWaitingFragment(),A.prototype.resetLoadingState.call(this)},C.onTickEnd=function(){var l=this.media;!l||!l.readyState||(this.lastCurrentTime=l.currentTime)},C.doTickIdle=function(){var l=this.hls,c=this.levels,s=this.media,g=this.trackId,R=l.config;if(!(!c||!c[g])&&!(!s&&(this.startFragRequested||!R.startFragPrefetch))){var D=c[g],x=D.details;if(!x||x.live&&this.levelLastLoaded!==g||this.waitForCdnTuneIn(x)){this.state=K.State.WAITING_TRACK;return}var T=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&T&&(this.bufferFlushed=!1,this.afterBufferFlushed(T,E.ElementaryStreamTypes.AUDIO,v.PlaylistLevelType.AUDIO));var O=this.getFwdBufferInfo(T,v.PlaylistLevelType.AUDIO);if(O!==null){var $=this.audioSwitch;if(!$&&this._streamEnded(O,x)){l.trigger(F.Events.BUFFER_EOS,{type:"audio"}),this.state=K.State.ENDED;return}var H=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,v.PlaylistLevelType.MAIN),Z=O.len,te=this.getMaxBufferLength(H==null?void 0:H.len);if(!(Z>=te&&!$)){var J=x.fragments,ie=J[0].start,oe=O.end;if($&&s){var ue=this.getLoadPosition();oe=ue,x.PTSKnown&&ue<ie&&(O.end>ie||O.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),s.currentTime=ie+.05)}if(!(H&&oe>H.end+x.targetduration)&&!((!H||!H.len)&&O.len)){var Pe=this.getNextFragment(oe,x);if(!Pe){this.bufferFlushed=!0;return}this.loadFragment(Pe,x,oe)}}}}},C.getMaxBufferLength=function(l){var c=A.prototype.getMaxBufferLength.call(this);return l?Math.max(c,l):c},C.onMediaDetaching=function(){this.videoBuffer=null,A.prototype.onMediaDetaching.call(this)},C.onAudioTracksUpdated=function(l,c){var s=c.audioTracks;this.resetTransmuxer(),this.levels=s.map(function(g){return new L.Level(g)})},C.onAudioTrackSwitching=function(l,c){var s=!!c.url;this.trackId=c.id;var g=this.fragCurrent;g&&g.abortRequests(),this.fragCurrent=null,this.clearWaitingFragment(),s?this.setInterval(S):this.resetTransmuxer(),s?(this.audioSwitch=!0,this.state=K.State.IDLE):this.state=K.State.STOPPED,this.tick()},C.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},C.onLevelLoaded=function(l,c){this.mainDetails=c.details,this.cachedTrackLoadedData!==null&&(this.hls.trigger(F.Events.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)},C.onAudioTrackLoaded=function(l,c){var s;if(this.mainDetails==null){this.cachedTrackLoadedData=c;return}var g=this.levels,R=c.details,D=c.id;if(!g){this.warn("Audio tracks were reset while loading level "+D);return}this.log("Track "+D+" loaded ["+R.startSN+","+R.endSN+"],duration:"+R.totalduration);var x=g[D],T=0;if(R.live||(s=x.details)!==null&&s!==void 0&&s.live){var O=this.mainDetails;if(R.fragments[0]||(R.deltaUpdateFailed=!0),R.deltaUpdateFailed||!O)return;!x.details&&R.hasProgramDateTime&&O.hasProgramDateTime?((0,M.alignMediaPlaylistByPDT)(R,O),T=R.fragments[0].start):T=this.alignPlaylists(R,x.details)}x.details=R,this.levelLastLoaded=D,!this.startFragRequested&&(this.mainDetails||!R.live)&&this.setStartPosition(x.details,T),this.state===K.State.WAITING_TRACK&&!this.waitForCdnTuneIn(R)&&(this.state=K.State.IDLE),this.tick()},C._handleFragmentLoadProgress=function(l){var c,s=l.frag,g=l.part,R=l.payload,D=this.config,x=this.trackId,T=this.levels;if(!T){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+s.sn+" of level "+s.level+" will not be buffered");return}var O=T[x];console.assert(O,"Audio track is defined on fragment load progress");var $=O.details;console.assert($,"Audio track details are defined on fragment load progress");var H=D.defaultAudioCodec||O.audioCodec||"mp4a.40.2",Z=this.transmuxer;Z||(Z=this.transmuxer=new w.default(this.hls,v.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var te=this.initPTS[s.cc],J=(c=s.initSegment)===null||c===void 0?void 0:c.data;if(te!==void 0){var ie=!1,oe=g?g.index:-1,ue=oe!==-1,Pe=new p.ChunkMetadata(s.level,s.sn,s.stats.chunkCount,R.byteLength,oe,ue);Z.push(R,J,H,"",s,g,$.totalduration,ie,Pe,te)}else{this.log("Unknown video PTS for cc "+s.cc+", waiting for video PTS before demuxing audio frag "+s.sn+" of ["+$.startSN+" ,"+$.endSN+"],track "+x);var Ne=this.waitingData=this.waitingData||{frag:s,part:g,cache:new b.default,complete:!1},Ve=Ne.cache;Ve.push(new Uint8Array(R)),this.waitingVideoCC=this.videoTrackCC,this.state=K.State.WAITING_INIT_PTS}},C._handleFragmentLoadComplete=function(l){if(this.waitingData){this.waitingData.complete=!0;return}A.prototype._handleFragmentLoadComplete.call(this,l)},C.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},C.onBufferCreated=function(l,c){var s=c.tracks.audio;s&&(this.mediaBuffer=s.buffer||null),c.tracks.video&&(this.videoBuffer=c.tracks.video.buffer||null)},C.onFragBuffered=function(l,c){var s=c.frag,g=c.part;if(s.type!==v.PlaylistLevelType.AUDIO){if(!this.loadedmetadata&&s.type===v.PlaylistLevelType.MAIN){var R;(R=this.videoBuffer||this.media)!==null&&R!==void 0&&R.buffered.length&&(this.loadedmetadata=!0)}return}if(this.fragContextChanged(s)){this.warn("Fragment "+s.sn+(g?" p: "+g.index:"")+" of level "+s.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}s.sn!=="initSegment"&&(this.fragPrevious=s,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(F.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(s,g)},C.onError=function(l,c){if(c.type===d.ErrorTypes.KEY_SYSTEM_ERROR){this.onFragmentOrKeyLoadError(v.PlaylistLevelType.AUDIO,c);return}switch(c.details){case d.ErrorDetails.FRAG_LOAD_ERROR:case d.ErrorDetails.FRAG_LOAD_TIMEOUT:case d.ErrorDetails.FRAG_PARSING_ERROR:case d.ErrorDetails.KEY_LOAD_ERROR:case d.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(v.PlaylistLevelType.AUDIO,c);break;case d.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case d.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==K.State.ERROR&&this.state!==K.State.STOPPED&&(this.state=c.fatal?K.State.ERROR:K.State.IDLE,this.warn(c.details+" while loading frag, switching to "+this.state+" state"));break;case d.ErrorDetails.BUFFER_FULL_ERROR:if(c.parent==="audio"&&(this.state===K.State.PARSING||this.state===K.State.PARSED)){var s=!0,g=this.getFwdBufferInfo(this.mediaBuffer,v.PlaylistLevelType.AUDIO);g&&g.len>.5&&(s=!this.reduceMaxBufferLength(g.len)),s&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,A.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},C.onBufferFlushed=function(l,c){var s=c.type;s===E.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0,this.state===K.State.ENDED&&(this.state=K.State.IDLE))},C._handleTransmuxComplete=function(l){var c,s="audio",g=this.hls,R=l.remuxResult,D=l.chunkMeta,x=this.getCurrentContext(D);if(!x){this.warn("The loading context changed while buffering fragment "+D.sn+" of level "+D.level+". This chunk will not be buffered."),this.resetStartWhenNotLoaded(D.level);return}var T=x.frag,O=x.part,$=x.level.details,H=R.audio,Z=R.text,te=R.id3,J=R.initSegment;if(!(this.fragContextChanged(T)||!$)){if(this.state=K.State.PARSING,this.audioSwitch&&H&&this.completeAudioSwitch(),J!=null&&J.tracks&&(this._bufferInitSegment(J.tracks,T,D),g.trigger(F.Events.FRAG_PARSING_INIT_SEGMENT,{frag:T,id:s,tracks:J.tracks})),H){var ie=H.startPTS,oe=H.endPTS,ue=H.startDTS,Pe=H.endDTS;O&&(O.elementaryStreams[E.ElementaryStreamTypes.AUDIO]={startPTS:ie,endPTS:oe,startDTS:ue,endDTS:Pe}),T.setElementaryStreamInfo(E.ElementaryStreamTypes.AUDIO,ie,oe,ue,Pe),this.bufferFragmentData(H,T,O,D)}if(te!=null&&(c=te.samples)!==null&&c!==void 0&&c.length){var Ne=f({id:s,frag:T,details:$},te);g.trigger(F.Events.FRAG_PARSING_METADATA,Ne)}if(Z){var Ve=f({id:s,frag:T,details:$},Z);g.trigger(F.Events.FRAG_PARSING_USERDATA,Ve)}}},C._bufferInitSegment=function(l,c,s){if(this.state===K.State.PARSING){l.video&&delete l.video;var g=l.audio;if(g){g.levelCodec=g.codec,g.id="audio",this.log("Init audio buffer, container:"+g.container+", codecs[parsed]=["+g.codec+"]"),this.hls.trigger(F.Events.BUFFER_CODECS,l);var R=g.initSegment;if(R!=null&&R.byteLength){var D={type:"audio",frag:c,part:null,chunkMeta:s,parent:c.type,data:R};this.hls.trigger(F.Events.BUFFER_APPENDING,D)}this.tick()}}},C.loadFragment=function(l,c,s){var g=this.fragmentTracker.getState(l);this.fragCurrent=l,(this.audioSwitch||g===U.FragmentState.NOT_LOADED||g===U.FragmentState.PARTIAL)&&(l.sn==="initSegment"?this._loadInitSegment(l,c):c.live&&!(0,V.isFiniteNumber)(this.initPTS[l.cc])?(this.log("Waiting for video PTS in continuity counter "+l.cc+" of live stream before loading audio fragment "+l.sn+" of level "+this.trackId),this.state=K.State.WAITING_INIT_PTS):(this.startFragRequested=!0,A.prototype.loadFragment.call(this,l,c,s)))},C.completeAudioSwitch=function(){var l=this.hls,c=this.media,s=this.trackId;c&&(this.log("Switching audio track : flushing all audio"),A.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,l.trigger(F.Events.AUDIO_TRACK_SWITCHED,{id:s})},I}(K.default);const m=k},"./src/controller/audio-track-controller.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>y});var V=B("./src/events.ts"),K=B("./src/errors.ts"),F=B("./src/controller/base-playlist-controller.ts"),i=B("./src/types/loader.ts");function U(M,d){for(var f=0;f<d.length;f++){var u=d[f];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(M,v(u.key),u)}}function L(M,d,f){return d&&U(M.prototype,d),f&&U(M,f),Object.defineProperty(M,"prototype",{writable:!1}),M}function v(M){var d=E(M,"string");return typeof d=="symbol"?d:String(d)}function E(M,d){if(typeof M!="object"||M===null)return M;var f=M[Symbol.toPrimitive];if(f!==void 0){var u=f.call(M,d||"default");if(typeof u!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(M)}function b(M,d){M.prototype=Object.create(d.prototype),M.prototype.constructor=M,w(M,d)}function w(M,d){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(u,h){return u.__proto__=h,u},w(M,d)}var p=function(M){b(d,M);function d(u){var h;return h=M.call(this,u,"[audio-track-controller]")||this,h.tracks=[],h.groupId=null,h.tracksInGroup=[],h.trackId=-1,h.trackName="",h.selectDefaultTrack=!0,h.registerListeners(),h}var f=d.prototype;return f.registerListeners=function(){var h=this.hls;h.on(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.on(V.Events.LEVEL_LOADING,this.onLevelLoading,this),h.on(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),h.on(V.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),h.on(V.Events.ERROR,this.onError,this)},f.unregisterListeners=function(){var h=this.hls;h.off(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.off(V.Events.LEVEL_LOADING,this.onLevelLoading,this),h.off(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),h.off(V.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),h.off(V.Events.ERROR,this.onError,this)},f.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,M.prototype.destroy.call(this)},f.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},f.onManifestParsed=function(h,S){this.tracks=S.audioTracks||[]},f.onAudioTrackLoaded=function(h,S){var k=S.id,m=S.details,A=this.tracksInGroup[k];if(!A){this.warn("Invalid audio track id "+k);return}var I=A.details;A.details=S.details,this.log("audioTrack "+k+" loaded ["+m.startSN+"-"+m.endSN+"]"),k===this.trackId&&(this.retryCount=0,this.playlistLoaded(k,S,I))},f.onLevelLoading=function(h,S){this.switchLevel(S.level)},f.onLevelSwitching=function(h,S){this.switchLevel(S.level)},f.switchLevel=function(h){var S=this.hls.levels[h];if(S!=null&&S.audioGroupIds){var k=S.audioGroupIds[S.urlId];if(this.groupId!==k){this.groupId=k;var m=this.tracks.filter(function(I){return!k||I.groupId===k});this.selectDefaultTrack&&!m.some(function(I){return I.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=m;var A={audioTracks:m};this.log("Updating audio tracks, "+m.length+' track(s) found in "'+k+'" group-id'),this.hls.trigger(V.Events.AUDIO_TRACKS_UPDATED,A),this.selectInitialTrack()}}},f.onError=function(h,S){M.prototype.onError.call(this,h,S),!(S.fatal||!S.context)&&S.context.type===i.PlaylistContextType.AUDIO_TRACK&&S.context.id===this.trackId&&S.context.groupId===this.groupId&&this.retryLoadingOrFail(S)},f.setAudioTrack=function(h){var S=this.tracksInGroup;if(h<0||h>=S.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var k=S[this.trackId];this.log("Now switching to audio-track index "+h);var m=S[h],A=m.id,I=m.groupId,C=I===void 0?"":I,P=m.name,l=m.type,c=m.url;if(this.trackId=h,this.trackName=P,this.selectDefaultTrack=!1,this.hls.trigger(V.Events.AUDIO_TRACK_SWITCHING,{id:A,groupId:C,name:P,type:l,url:c}),!(m.details&&!m.details.live)){var s=this.switchParams(m.url,k==null?void 0:k.details);this.loadPlaylist(s)}},f.selectInitialTrack=function(){var h=this.tracksInGroup;console.assert(h.length,"Initial audio track should be selected when tracks are known");var S=this.trackName,k=this.findTrackId(S)||this.findTrackId();k!==-1?this.setAudioTrack(k):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(V.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},f.findTrackId=function(h){for(var S=this.tracksInGroup,k=0;k<S.length;k++){var m=S[k];if((!this.selectDefaultTrack||m.default)&&(!h||h===m.name))return m.id}return-1},f.loadPlaylist=function(h){M.prototype.loadPlaylist.call(this);var S=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(S)){var k=S.id,m=S.groupId,A=S.url;if(h)try{A=h.addDirectives(A)}catch(I){this.warn("Could not construct new URL with HLS Delivery Directives: "+I)}this.log("loading audio-track playlist for id: "+k),this.clearTimer(),this.hls.trigger(V.Events.AUDIO_TRACK_LOADING,{url:A,id:k,groupId:m,deliveryDirectives:h||null})}},L(d,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(h){this.selectDefaultTrack=!1,this.setAudioTrack(h)}}]),d}(F.default);const y=p},"./src/controller/base-playlist-controller.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>U});var V=B("./src/types/level.ts"),K=B("./src/controller/level-helper.ts"),F=B("./src/utils/logger.ts"),i=B("./src/errors.ts"),U=function(){function L(E,b){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=F.logger.log.bind(F.logger,b+":"),this.warn=F.logger.warn.bind(F.logger,b+":"),this.hls=E}var v=L.prototype;return v.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},v.onError=function(b,w){w.fatal&&(w.type===i.ErrorTypes.NETWORK_ERROR||w.type===i.ErrorTypes.KEY_SYSTEM_ERROR)&&this.stopLoad()},v.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},v.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.requestScheduled=-1,this.loadPlaylist()},v.stopLoad=function(){this.canLoad=!1,this.clearTimer()},v.switchParams=function(b,w){var p=w==null?void 0:w.renditionReports;if(p)for(var y=0;y<p.length;y++){var M=p[y],d=void 0;try{d=new self.URL(M.URI,w.url).href}catch(S){F.logger.warn("Could not construct new URL for Rendition Report: "+S),d=M.URI||""}if(d===b.slice(-d.length)){var f=parseInt(M["LAST-MSN"])||(w==null?void 0:w.lastPartSn),u=parseInt(M["LAST-PART"])||(w==null?void 0:w.lastPartIndex);if(this.hls.config.lowLatencyMode){var h=Math.min(w.age-w.partTarget,w.targetduration);u>=0&&h>w.partTarget&&(u+=1)}return new V.HlsUrlParameters(f,u>=0?u:void 0,V.HlsSkip.No)}}},v.loadPlaylist=function(b){this.requestScheduled===-1&&(this.requestScheduled=self.performance.now())},v.shouldLoadTrack=function(b){return this.canLoad&&b&&!!b.url&&(!b.details||b.details.live)},v.playlistLoaded=function(b,w,p){var y=this,M=w.details,d=w.stats,f=self.performance.now(),u=d.loading.first?Math.max(0,f-d.loading.first):0;if(M.advancedDateTime=Date.now()-u,M.live||p!=null&&p.live){if(M.reloaded(p),p&&this.log("live playlist "+b+" "+(M.advanced?"REFRESHED "+M.lastPartSn+"-"+M.lastPartIndex:"MISSED")),p&&M.fragments.length>0&&(0,K.mergeDetails)(p,M),!this.canLoad||!M.live)return;var h,S=void 0,k=void 0;if(M.canBlockReload&&M.endSN&&M.advanced){var m=this.hls.config.lowLatencyMode,A=M.lastPartSn,I=M.endSN,C=M.lastPartIndex,P=C!==-1,l=A===I,c=m?0:C;P?(S=l?I+1:A,k=l?c:C+1):S=I+1;var s=M.age,g=s+M.ageHeader,R=Math.min(g-M.partTarget,M.targetduration*1.5);if(R>0){if(p&&R>p.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+p.tuneInGoal+" to: "+R+" with playlist age: "+M.age),R=0;else{var D=Math.floor(R/M.targetduration);if(S+=D,k!==void 0){var x=Math.round(R%M.targetduration/M.partTarget);k+=x}this.log("CDN Tune-in age: "+M.ageHeader+"s last advanced "+s.toFixed(2)+"s goal: "+R+" skip sn "+D+" to part "+k)}M.tuneInGoal=R}if(h=this.getDeliveryDirectives(M,w.deliveryDirectives,S,k),m||!l){this.loadPlaylist(h);return}}else h=this.getDeliveryDirectives(M,w.deliveryDirectives,S,k);var T=this.hls.mainForwardBufferInfo,O=T?T.end-T.len:0,$=(M.edge-O)*1e3,H=(0,K.computeReloadInterval)(M,$);M.updated?f>this.requestScheduled+H&&(this.requestScheduled=d.loading.start):this.requestScheduled=-1,S!==void 0&&M.canBlockReload?this.requestScheduled=d.loading.first+H-(M.partTarget*1e3||1e3):this.requestScheduled=(this.requestScheduled===-1?f:this.requestScheduled)+H;var Z=this.requestScheduled-f;Z=Math.max(0,Z),this.log("reload live playlist "+b+" in "+Math.round(Z)+" ms"),this.timer=self.setTimeout(function(){return y.loadPlaylist(h)},Z)}else this.clearTimer()},v.getDeliveryDirectives=function(b,w,p,y){var M=(0,V.getSkipValue)(b,p);return w!=null&&w.skip&&b.deltaUpdateFailed&&(p=w.msn,y=w.part,M=V.HlsSkip.No),new V.HlsUrlParameters(p,y,M)},v.retryLoadingOrFail=function(b){var w=this,p=this.hls.config,y=this.retryCount<p.levelLoadingMaxRetry;if(y){var M;if(this.requestScheduled=-1,this.retryCount++,b.details.indexOf("LoadTimeOut")>-1&&(M=b.context)!==null&&M!==void 0&&M.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+b.details+'"'),this.loadPlaylist();else{var d=Math.min(Math.pow(2,this.retryCount)*p.levelLoadingRetryDelay,p.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return w.loadPlaylist()},d),this.warn("retry playlist loading #"+this.retryCount+" in "+d+' ms after "'+b.details+'"')}}else this.warn('cannot recover from error "'+b.details+'"'),this.clearTimer(),b.fatal=!0;return y},L}()},"./src/controller/base-stream-controller.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{State:()=>P,default:()=>l});var V=B("./src/polyfills/number.ts"),K=B("./src/task-loop.ts"),F=B("./src/controller/fragment-tracker.ts"),i=B("./src/utils/buffer-helper.ts"),U=B("./src/utils/logger.ts"),L=B("./src/events.ts"),v=B("./src/errors.ts"),E=B("./src/types/transmuxer.ts"),b=B("./src/utils/mp4-tools.ts"),w=B("./src/utils/discontinuities.ts"),p=B("./src/controller/fragment-finders.ts"),y=B("./src/controller/level-helper.ts"),M=B("./src/loader/fragment-loader.ts"),d=B("./src/crypt/decrypter.ts"),f=B("./src/utils/time-ranges.ts"),u=B("./src/types/loader.ts");function h(c,s){for(var g=0;g<s.length;g++){var R=s[g];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(c,k(R.key),R)}}function S(c,s,g){return s&&h(c.prototype,s),g&&h(c,g),Object.defineProperty(c,"prototype",{writable:!1}),c}function k(c){var s=m(c,"string");return typeof s=="symbol"?s:String(s)}function m(c,s){if(typeof c!="object"||c===null)return c;var g=c[Symbol.toPrimitive];if(g!==void 0){var R=g.call(c,s||"default");if(typeof R!="object")return R;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(c)}function A(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function I(c,s){c.prototype=Object.create(s.prototype),c.prototype.constructor=c,C(c,s)}function C(c,s){return C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(R,D){return R.__proto__=D,R},C(c,s)}var P={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},l=function(c){I(s,c);function s(R,D,x,T){var O;return O=c.call(this)||this,O.hls=void 0,O.fragPrevious=null,O.fragCurrent=null,O.fragmentTracker=void 0,O.transmuxer=null,O._state=P.STOPPED,O.media=null,O.mediaBuffer=null,O.config=void 0,O.bitrateTest=!1,O.lastCurrentTime=0,O.nextLoadPosition=0,O.startPosition=0,O.loadedmetadata=!1,O.fragLoadError=0,O.retryDate=0,O.levels=null,O.fragmentLoader=void 0,O.keyLoader=void 0,O.levelLastLoaded=null,O.startFragRequested=!1,O.decrypter=void 0,O.initPTS=[],O.onvseeking=null,O.onvended=null,O.logPrefix="",O.log=void 0,O.warn=void 0,O.logPrefix=T,O.log=U.logger.log.bind(U.logger,T+":"),O.warn=U.logger.warn.bind(U.logger,T+":"),O.hls=R,O.fragmentLoader=new M.default(R.config),O.keyLoader=x,O.fragmentTracker=D,O.config=R.config,O.decrypter=new d.default(R.config),R.on(L.Events.LEVEL_SWITCHING,O.onLevelSwitching,A(O)),O}var g=s.prototype;return g.doTick=function(){this.onTickEnd()},g.onTickEnd=function(){},g.startLoad=function(D){},g.stopLoad=function(){this.fragmentLoader.abort(),this.keyLoader.abort();var D=this.fragCurrent;D&&(D.abortRequests(),this.fragmentTracker.removeFragment(D)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=P.STOPPED},g._streamEnded=function(D,x){if(x.live||D.nextStart||!D.end||!this.media)return!1;var T=x.partList;if(T!=null&&T.length){var O=T[T.length-1],$=i.BufferHelper.isBuffered(this.media,O.start+O.duration/2);return $}var H=x.fragments[x.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(H)},g.getLevelDetails=function(){if(this.levels&&this.levelLastLoaded!==null){var D;return(D=this.levels[this.levelLastLoaded])===null||D===void 0?void 0:D.details}},g.onMediaAttached=function(D,x){var T=this.media=this.mediaBuffer=x.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),T.addEventListener("seeking",this.onvseeking),T.addEventListener("ended",this.onvended);var O=this.config;this.levels&&O.autoStartLoad&&this.state===P.STOPPED&&this.startLoad(O.startPosition)},g.onMediaDetaching=function(){var D=this.media;D!=null&&D.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),D&&this.onvseeking&&this.onvended&&(D.removeEventListener("seeking",this.onvseeking),D.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.keyLoader&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},g.onMediaSeeking=function(){var D=this.config,x=this.fragCurrent,T=this.media,O=this.mediaBuffer,$=this.state,H=T?T.currentTime:0,Z=i.BufferHelper.bufferInfo(O||T,H,D.maxBufferHole);if(this.log("media seeking to "+((0,V.isFiniteNumber)(H)?H.toFixed(3):H)+", state: "+$),this.state===P.ENDED)this.resetLoadingState();else if(x){var te=D.maxFragLookUpTolerance,J=x.start-te,ie=x.start+x.duration+te;if(!Z.len||ie<Z.start||J>Z.end){var oe=H>ie;(H<J||oe)&&(oe&&x.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),x.abortRequests()),this.resetLoadingState())}}T&&(this.lastCurrentTime=H),!this.loadedmetadata&&!Z.len&&(this.nextLoadPosition=this.startPosition=H),this.tickImmediate()},g.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},g.onLevelSwitching=function(D,x){this.fragLoadError=0},g.onHandlerDestroying=function(){this.stopLoad(),c.prototype.onHandlerDestroying.call(this)},g.onHandlerDestroyed=function(){this.state=P.STOPPED,this.hls.off(L.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,c.prototype.onHandlerDestroyed.call(this)},g.loadFragment=function(D,x,T){this._loadFragForPlayback(D,x,T)},g._loadFragForPlayback=function(D,x,T){var O=this,$=function(Z){if(O.fragContextChanged(D)){O.warn("Fragment "+D.sn+(Z.part?" p: "+Z.part.index:"")+" of level "+D.level+" was dropped during download."),O.fragmentTracker.removeFragment(D);return}D.stats.chunkCount++,O._handleFragmentLoadProgress(Z)};this._doFragLoad(D,x,T,$).then(function(H){if(H){O.fragLoadError=0;var Z=O.state;if(O.fragContextChanged(D)){(Z===P.FRAG_LOADING||!O.fragCurrent&&Z===P.PARSING)&&(O.fragmentTracker.removeFragment(D),O.state=P.IDLE);return}"payload"in H&&(O.log("Loaded fragment "+D.sn+" of level "+D.level),O.hls.trigger(L.Events.FRAG_LOADED,H)),O._handleFragmentLoadComplete(H)}}).catch(function(H){O.state===P.STOPPED||O.state===P.ERROR||(O.warn(H),O.resetFragmentLoading(D))})},g.flushMainBuffer=function(D,x,T){if(T===void 0&&(T=null),!!(D-x)){var O={startOffset:D,endOffset:x,type:T};this.fragLoadError=0,this.hls.trigger(L.Events.BUFFER_FLUSHING,O)}},g._loadInitSegment=function(D,x){var T=this;this._doFragLoad(D,x).then(function(O){if(!O||T.fragContextChanged(D)||!T.levels)throw new Error("init load aborted");return O}).then(function(O){var $=T.hls,H=O.payload,Z=D.decryptdata;if(H&&H.byteLength>0&&Z&&Z.key&&Z.iv&&Z.method==="AES-128"){var te=self.performance.now();return T.decrypter.decrypt(new Uint8Array(H),Z.key.buffer,Z.iv.buffer).then(function(J){var ie=self.performance.now();return $.trigger(L.Events.FRAG_DECRYPTED,{frag:D,payload:J,stats:{tstart:te,tdecrypt:ie}}),O.payload=J,O})}return O}).then(function(O){var $=T.fragCurrent,H=T.hls,Z=T.levels;if(!Z)throw new Error("init load aborted, missing levels");var te=Z[D.level].details;console.assert(te,"Level details are defined when init segment is loaded");var J=D.stats;T.state=P.IDLE,T.fragLoadError=0,D.data=new Uint8Array(O.payload),J.parsing.start=J.buffering.start=self.performance.now(),J.parsing.end=J.buffering.end=self.performance.now(),O.frag===$&&H.trigger(L.Events.FRAG_BUFFERED,{stats:J,frag:$,part:null,id:D.type}),T.tick()}).catch(function(O){T.state===P.STOPPED||T.state===P.ERROR||(T.warn(O),T.resetFragmentLoading(D))})},g.fragContextChanged=function(D){var x=this.fragCurrent;return!D||!x||D.level!==x.level||D.sn!==x.sn||D.urlId!==x.urlId},g.fragBufferedComplete=function(D,x){var T,O,$,H,Z=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+D.type+" sn: "+D.sn+(x?" part: "+x.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+D.level+" (frag:["+((T=D.startPTS)!=null?T:NaN).toFixed(3)+"-"+((O=D.endPTS)!=null?O:NaN).toFixed(3)+"] > buffer:"+(Z?f.default.toString(i.BufferHelper.getBuffered(Z)):"(detached)")+")"),this.state=P.IDLE,Z&&(!this.loadedmetadata&&D.type==u.PlaylistLevelType.MAIN&&Z.buffered.length&&(($=this.fragCurrent)===null||$===void 0?void 0:$.sn)===((H=this.fragPrevious)===null||H===void 0?void 0:H.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())},g.seekToStartPos=function(){},g._handleFragmentLoadComplete=function(D){var x=this.transmuxer;if(x){var T=D.frag,O=D.part,$=D.partsLoaded,H=!$||$.length===0||$.some(function(te){return!te}),Z=new E.ChunkMetadata(T.level,T.sn,T.stats.chunkCount+1,0,O?O.index:-1,!H);x.flush(Z)}},g._handleFragmentLoadProgress=function(D){},g._doFragLoad=function(D,x,T,O){var $,H=this;if(T===void 0&&(T=null),!this.levels)throw new Error("frag load aborted, missing levels");var Z=null;if(D.encrypted&&!(($=D.decryptdata)!==null&&$!==void 0&&$.key)?(this.log("Loading key for "+D.sn+" of ["+x.startSN+"-"+x.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+D.level),this.state=P.KEY_LOADING,this.fragCurrent=D,Z=this.keyLoader.load(D).then(function(ue){if(!H.fragContextChanged(ue.frag))return H.hls.trigger(L.Events.KEY_LOADED,ue),H.state===P.KEY_LOADING&&(H.state=P.IDLE),ue}),this.hls.trigger(L.Events.KEY_LOADING,{frag:D}),this.throwIfFragContextChanged("KEY_LOADING")):!D.encrypted&&x.encryptedFragments.length&&this.keyLoader.loadClear(D,x.encryptedFragments),T=Math.max(D.start,T||0),this.config.lowLatencyMode&&x){var te=x.partList;if(te&&O){T>D.end&&x.fragmentHint&&(D=x.fragmentHint);var J=this.getNextPart(te,D,T);if(J>-1){var ie=te[J];return this.log("Loading part sn: "+D.sn+" p: "+ie.index+" cc: "+D.cc+" of playlist ["+x.startSN+"-"+x.endSN+"] parts [0-"+J+"-"+(te.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+D.level+", target: "+parseFloat(T.toFixed(3))),this.nextLoadPosition=ie.start+ie.duration,this.state=P.FRAG_LOADING,this.hls.trigger(L.Events.FRAG_LOADING,{frag:D,part:te[J],targetBufferTime:T}),this.throwIfFragContextChanged("FRAG_LOADING parts"),Z?Z.then(function(ue){return!ue||H.fragContextChanged(ue.frag)?null:H.doFragPartsLoad(D,te,J,O)}).catch(function(ue){return H.handleFragLoadError(ue)}):this.doFragPartsLoad(D,te,J,O).catch(function(ue){return H.handleFragLoadError(ue)})}else if(!D.url||this.loadedEndOfParts(te,T))return Promise.resolve(null)}}this.log("Loading fragment "+D.sn+" cc: "+D.cc+" "+(x?"of ["+x.startSN+"-"+x.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+D.level+", target: "+parseFloat(T.toFixed(3))),(0,V.isFiniteNumber)(D.sn)&&!this.bitrateTest&&(this.nextLoadPosition=D.start+D.duration),this.state=P.FRAG_LOADING,this.hls.trigger(L.Events.FRAG_LOADING,{frag:D,targetBufferTime:T}),this.throwIfFragContextChanged("FRAG_LOADING");var oe=this.config.progressive;return oe&&Z?Z.then(function(ue){return!ue||H.fragContextChanged(ue==null?void 0:ue.frag)?null:H.fragmentLoader.load(D,O)}).catch(function(ue){return H.handleFragLoadError(ue)}):Promise.all([this.fragmentLoader.load(D,oe?O:void 0),Z]).then(function(ue){var Pe=ue[0];return!oe&&Pe&&O&&O(Pe),Pe}).catch(function(ue){return H.handleFragLoadError(ue)})},g.throwIfFragContextChanged=function(D){if(this.fragCurrent===null)throw new Error("frag load aborted, context changed in "+D)},g.doFragPartsLoad=function(D,x,T,O){var $=this;return new Promise(function(H,Z){var te=[],J=function ie(oe){var ue=x[oe];$.fragmentLoader.loadPart(D,ue,O).then(function(Pe){te[ue.index]=Pe;var Ne=Pe.part;$.hls.trigger(L.Events.FRAG_LOADED,Pe);var Ve=x[oe+1];if(Ve&&Ve.fragment===D)ie(oe+1);else return H({frag:D,part:Ne,partsLoaded:te})}).catch(Z)};J(T)})},g.handleFragLoadError=function(D){if("data"in D){var x=D.data;D.data&&x.details===v.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(x.frag,x.part):this.hls.trigger(L.Events.ERROR,x)}else this.hls.trigger(L.Events.ERROR,{type:v.ErrorTypes.OTHER_ERROR,details:v.ErrorDetails.INTERNAL_EXCEPTION,err:D,fatal:!0});return null},g._handleTransmuxerFlush=function(D){var x=this.getCurrentContext(D);if(!x||this.state!==P.PARSING){!this.fragCurrent&&this.state!==P.STOPPED&&this.state!==P.ERROR&&(this.state=P.IDLE);return}var T=x.frag,O=x.part,$=x.level,H=self.performance.now();T.stats.parsing.end=H,O&&(O.stats.parsing.end=H),this.updateLevelTiming(T,O,$,D.partial)},g.getCurrentContext=function(D){var x=this.levels,T=D.level,O=D.sn,$=D.part;if(!x||!x[T])return this.warn("Levels object was unset while buffering fragment "+O+" of level "+T+". The current chunk will not be buffered."),null;var H=x[T],Z=$>-1?(0,y.getPartWith)(H,O,$):null,te=Z?Z.fragment:(0,y.getFragmentWithSN)(H,O,this.fragCurrent);return te?{frag:te,part:Z,level:H}:null},g.bufferFragmentData=function(D,x,T,O){if(!(!D||this.state!==P.PARSING)){var $=D.data1,H=D.data2,Z=$;if($&&H&&(Z=(0,b.appendUint8Array)($,H)),!(!Z||!Z.length)){var te={type:D.type,frag:x,part:T,chunkMeta:O,parent:x.type,data:Z};this.hls.trigger(L.Events.BUFFER_APPENDING,te),D.dropped&&D.independent&&!T&&this.flushBufferGap(x)}}},g.flushBufferGap=function(D){var x=this.media;if(x){if(!i.BufferHelper.isBuffered(x,x.currentTime)){this.flushMainBuffer(0,D.start);return}var T=x.currentTime,O=i.BufferHelper.bufferInfo(x,T,0),$=D.duration,H=Math.min(this.config.maxFragLookUpTolerance*2,$*.25),Z=Math.max(Math.min(D.start-H,O.end-H),T+H);D.start-Z>H&&this.flushMainBuffer(Z,D.start)}},g.getFwdBufferInfo=function(D,x){var T=this.config,O=this.getLoadPosition();if(!(0,V.isFiniteNumber)(O))return null;var $=i.BufferHelper.bufferInfo(D,O,T.maxBufferHole);if($.len===0&&$.nextStart!==void 0){var H=this.fragmentTracker.getBufferedFrag(O,x);if(H&&$.nextStart<H.end)return i.BufferHelper.bufferInfo(D,O,Math.max($.nextStart,T.maxBufferHole))}return $},g.getMaxBufferLength=function(D){var x=this.config,T;return D?T=Math.max(8*x.maxBufferSize/D,x.maxBufferLength):T=x.maxBufferLength,Math.min(T,x.maxMaxBufferLength)},g.reduceMaxBufferLength=function(D){var x=this.config,T=D||x.maxBufferLength;return x.maxMaxBufferLength>=T?(x.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+x.maxMaxBufferLength+"s"),!0):!1},g.getNextFragment=function(D,x){var T=x.fragments,O=T.length;if(!O)return null;var $=this.config,H=T[0].start,Z;if(x.live){var te=$.initialLiveManifestSize;if(O<te)return this.warn("Not enough fragments to start playback (have: "+O+", need: "+te+")"),null;!x.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(Z=this.getInitialLiveFragment(x,T),this.startPosition=Z?this.hls.liveSyncPosition||Z.start:D)}else D<=H&&(Z=T[0]);if(!Z){var J=$.lowLatencyMode?x.partEnd:x.fragmentEnd;Z=this.getFragmentAtPosition(D,J,x)}return this.mapToInitFragWhenRequired(Z)},g.mapToInitFragWhenRequired=function(D){return D!=null&&D.initSegment&&!(D!=null&&D.initSegment.data)&&!this.bitrateTest?D.initSegment:D},g.getNextPart=function(D,x,T){for(var O=-1,$=!1,H=!0,Z=0,te=D.length;Z<te;Z++){var J=D[Z];if(H=H&&!J.independent,O>-1&&T<J.start)break;var ie=J.loaded;ie?O=-1:($||J.independent||H)&&J.fragment===x&&(O=Z),$=ie}return O},g.loadedEndOfParts=function(D,x){var T=D[D.length-1];return T&&x>T.start&&T.loaded},g.getInitialLiveFragment=function(D,x){var T=this.fragPrevious,O=null;if(T){if(D.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+T.programDateTime),O=(0,p.findFragmentByPDT)(x,T.endProgramDateTime,this.config.maxFragLookUpTolerance)),!O){var $=T.sn+1;if($>=D.startSN&&$<=D.endSN){var H=x[$-D.startSN];T.cc===H.cc&&(O=H,this.log("Live playlist, switching playlist, load frag with next SN: "+O.sn))}O||(O=(0,p.findFragWithCC)(x,T.cc),O&&this.log("Live playlist, switching playlist, load frag with same CC: "+O.sn))}}else{var Z=this.hls.liveSyncPosition;Z!==null&&(O=this.getFragmentAtPosition(Z,this.bitrateTest?D.fragmentEnd:D.edge,D))}return O},g.getFragmentAtPosition=function(D,x,T){var O=this.config,$=this.fragPrevious,H=T.fragments,Z=T.endSN,te=T.fragmentHint,J=O.maxFragLookUpTolerance,ie=!!(O.lowLatencyMode&&T.partList&&te);ie&&te&&!this.bitrateTest&&(H=H.concat(te),Z=te.sn);var oe;if(D<x){var ue=D>x-J?0:J;oe=(0,p.findFragmentByPTS)($,H,D,ue)}else oe=H[H.length-1];if(oe){var Pe=oe.sn-T.startSN;if(this.fragmentTracker.getState(oe)===F.FragmentState.OK&&($=oe),$&&oe.sn===$.sn&&!ie){var Ne=$&&oe.level===$.level;if(Ne){var Ve=H[Pe+1];oe.sn<Z&&this.fragmentTracker.getState(Ve)!==F.FragmentState.OK?(this.log("SN "+oe.sn+" just loaded, load next one: "+Ve.sn),oe=Ve):oe=null}}}return oe},g.synchronizeToLiveEdge=function(D){var x=this.config,T=this.media;if(T){var O=this.hls.liveSyncPosition,$=T.currentTime,H=D.fragments[0].start,Z=D.edge,te=$>=H-x.maxFragLookUpTolerance&&$<=Z;if(O!==null&&T.duration>O&&($<O||!te)){var J=x.liveMaxLatencyDuration!==void 0?x.liveMaxLatencyDuration:x.liveMaxLatencyDurationCount*D.targetduration;(!te&&T.readyState<4||$<Z-J)&&(this.loadedmetadata||(this.nextLoadPosition=O),T.readyState&&(this.warn("Playback: "+$.toFixed(3)+" is located too far from the end of live sliding playlist: "+Z+", reset currentTime to : "+O.toFixed(3)),T.currentTime=O))}}},g.alignPlaylists=function(D,x){var T=this.levels,O=this.levelLastLoaded,$=this.fragPrevious,H=O!==null?T[O]:null,Z=D.fragments.length;if(!Z)return this.warn("No fragments in live playlist"),0;var te=D.fragments[0].start,J=!x,ie=D.alignedSliding&&(0,V.isFiniteNumber)(te);if(J||!ie&&!te){(0,w.alignStream)($,H,D);var oe=D.fragments[0].start;return this.log("Live playlist sliding: "+oe.toFixed(2)+" start-sn: "+(x?x.startSN:"na")+"->"+D.startSN+" prev-sn: "+($?$.sn:"na")+" fragments: "+Z),oe}return te},g.waitForCdnTuneIn=function(D){var x=3;return D.live&&D.canBlockReload&&D.partTarget&&D.tuneInGoal>Math.max(D.partHoldBack,D.partTarget*x)},g.setStartPosition=function(D,x){var T=this.startPosition;if(T<x&&(T=-1),T===-1||this.lastCurrentTime===-1){var O=D.startTimeOffset;(0,V.isFiniteNumber)(O)?(T=x+O,O<0&&(T+=D.totalduration),T=Math.min(Math.max(x,T),x+D.totalduration),this.log("Start time offset "+O+" found in playlist, adjust startPosition to "+T),this.startPosition=T):D.live?T=this.hls.liveSyncPosition||x:this.startPosition=T=0,this.lastCurrentTime=T}this.nextLoadPosition=T},g.getLoadPosition=function(){var D=this.media,x=0;return this.loadedmetadata&&D?x=D.currentTime:this.nextLoadPosition&&(x=this.nextLoadPosition),x},g.handleFragLoadAborted=function(D,x){this.transmuxer&&D.sn!=="initSegment"&&D.stats.aborted&&(this.warn("Fragment "+D.sn+(x?" part"+x.index:"")+" of level "+D.level+" was aborted"),this.resetFragmentLoading(D))},g.resetFragmentLoading=function(D){(!this.fragCurrent||!this.fragContextChanged(D)&&this.state!==P.FRAG_LOADING_WAITING_RETRY)&&(this.state=P.IDLE)},g.onFragmentOrKeyLoadError=function(D,x){if(x.fatal){this.stopLoad(),this.state=P.ERROR;return}var T=this.config;if(x.chunkMeta){var O=this.getCurrentContext(x.chunkMeta);O&&(x.frag=O.frag,x.levelRetry=!0,this.fragLoadError=T.fragLoadingMaxRetry)}var $=x.frag;if(!(!$||$.type!==D)){var H=this.fragCurrent;if(console.assert(H&&$.sn===H.sn&&$.level===H.level&&$.urlId===H.urlId,"Frag load error must match current frag to retry"),this.fragLoadError+1<=T.fragLoadingMaxRetry){this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition);var Z=Math.min(Math.pow(2,this.fragLoadError)*T.fragLoadingRetryDelay,T.fragLoadingMaxRetryTimeout);this.warn("Fragment "+$.sn+" of "+D+" "+$.level+" failed to load, retrying in "+Z+"ms"),this.retryDate=self.performance.now()+Z,this.fragLoadError++,this.state=P.FRAG_LOADING_WAITING_RETRY}else x.levelRetry?(D===u.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=P.IDLE):(U.logger.error(x.details+" reaches max retry, redispatch as fatal ..."),x.fatal=!0,this.hls.stopLoad(),this.state=P.ERROR)}},g.afterBufferFlushed=function(D,x,T){if(D){var O=i.BufferHelper.getBuffered(D);this.fragmentTracker.detectEvictedFragments(x,O,T),this.state===P.ENDED&&this.resetLoadingState()}},g.resetLoadingState=function(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=P.IDLE},g.resetStartWhenNotLoaded=function(D){if(!this.loadedmetadata){this.startFragRequested=!1;var x=this.levels?this.levels[D].details:null;x!=null&&x.live?(this.startPosition=-1,this.setStartPosition(x,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}},g.updateLevelTiming=function(D,x,T,O){var $=this,H=T.details;console.assert(!!H,"level.details must be defined");var Z=Object.keys(D.elementaryStreams).reduce(function(te,J){var ie=D.elementaryStreams[J];if(ie){var oe=ie.endPTS-ie.startPTS;if(oe<=0)return $.warn("Could not parse fragment "+D.sn+" "+J+" duration reliably ("+oe+")"),te||!1;var ue=O?0:(0,y.updateFragPTSDTS)(H,D,ie.startPTS,ie.endPTS,ie.startDTS,ie.endDTS);return $.hls.trigger(L.Events.LEVEL_PTS_UPDATED,{details:H,level:T,drift:ue,type:J,frag:D,start:ie.startPTS,end:ie.endPTS}),!0}return te},!1);Z||(this.warn("Found no media in fragment "+D.sn+" of level "+T.id+" resetting transmuxer to fallback to playlist timing"),this.resetTransmuxer()),this.state=P.PARSED,this.hls.trigger(L.Events.FRAG_PARSED,{frag:D,part:x})},g.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},S(s,[{key:"state",get:function(){return this._state},set:function(D){var x=this._state;x!==D&&(this._state=D,this.log(x+"->"+D))}}]),s}(K.default)},"./src/controller/buffer-controller.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>p});var V=B("./src/polyfills/number.ts"),K=B("./src/events.ts"),F=B("./src/utils/logger.ts"),i=B("./src/errors.ts"),U=B("./src/utils/buffer-helper.ts"),L=B("./src/utils/mediasource-helper.ts"),v=B("./src/loader/fragment.ts"),E=B("./src/controller/buffer-operation-queue.ts"),b=(0,L.getMediaSource)(),w=/([ha]vc.)(?:\.[^.,]+)+/,p=function(){function y(d){var f=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var u=f.media,h=f.mediaSource;F.logger.log("[buffer-controller]: Media source opened"),u&&(u.removeEventListener("emptied",f._onMediaEmptied),f.updateMediaElementDuration(),f.hls.trigger(K.Events.MEDIA_ATTACHED,{media:u})),h&&h.removeEventListener("sourceopen",f._onMediaSourceOpen),f.checkPendingTracks()},this._onMediaSourceClose=function(){F.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){F.logger.log("[buffer-controller]: Media source ended")},this._onMediaEmptied=function(){var u=f.media,h=f._objectUrl;u&&u.src!==h&&F.logger.error("Media element src was set while attaching MediaSource ("+h+" > "+u.src+")")},this.hls=d,this._initSourceBuffer(),this.registerListeners()}var M=y.prototype;return M.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},M.destroy=function(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null},M.registerListeners=function(){var f=this.hls;f.on(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),f.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),f.on(K.Events.BUFFER_RESET,this.onBufferReset,this),f.on(K.Events.BUFFER_APPENDING,this.onBufferAppending,this),f.on(K.Events.BUFFER_CODECS,this.onBufferCodecs,this),f.on(K.Events.BUFFER_EOS,this.onBufferEos,this),f.on(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),f.on(K.Events.LEVEL_UPDATED,this.onLevelUpdated,this),f.on(K.Events.FRAG_PARSED,this.onFragParsed,this),f.on(K.Events.FRAG_CHANGED,this.onFragChanged,this)},M.unregisterListeners=function(){var f=this.hls;f.off(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),f.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),f.off(K.Events.BUFFER_RESET,this.onBufferReset,this),f.off(K.Events.BUFFER_APPENDING,this.onBufferAppending,this),f.off(K.Events.BUFFER_CODECS,this.onBufferCodecs,this),f.off(K.Events.BUFFER_EOS,this.onBufferEos,this),f.off(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),f.off(K.Events.LEVEL_UPDATED,this.onLevelUpdated,this),f.off(K.Events.FRAG_PARSED,this.onFragParsed,this),f.off(K.Events.FRAG_CHANGED,this.onFragChanged,this)},M._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new E.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.lastMpegAudioChunk=null},M.onManifestParsed=function(f,u){var h=2;(u.audio&&!u.video||!u.altAudio)&&(h=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=h,this.details=null,F.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},M.onMediaAttaching=function(f,u){var h=this.media=u.media;if(h&&b){var S=this.mediaSource=new b;S.addEventListener("sourceopen",this._onMediaSourceOpen),S.addEventListener("sourceended",this._onMediaSourceEnded),S.addEventListener("sourceclose",this._onMediaSourceClose),h.src=self.URL.createObjectURL(S),this._objectUrl=h.src,h.addEventListener("emptied",this._onMediaEmptied)}},M.onMediaDetaching=function(){var f=this.media,u=this.mediaSource,h=this._objectUrl;if(u){if(F.logger.log("[buffer-controller]: media source detaching"),u.readyState==="open")try{u.endOfStream()}catch(S){F.logger.warn("[buffer-controller]: onMediaDetaching: "+S.message+" while calling endOfStream")}this.onBufferReset(),u.removeEventListener("sourceopen",this._onMediaSourceOpen),u.removeEventListener("sourceended",this._onMediaSourceEnded),u.removeEventListener("sourceclose",this._onMediaSourceClose),f&&(f.removeEventListener("emptied",this._onMediaEmptied),h&&self.URL.revokeObjectURL(h),f.src===h?(f.removeAttribute("src"),f.load()):F.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(K.Events.MEDIA_DETACHED,void 0)},M.onBufferReset=function(){var f=this;this.getSourceBufferTypes().forEach(function(u){var h=f.sourceBuffer[u];try{h&&(f.removeBufferListeners(u),f.mediaSource&&f.mediaSource.removeSourceBuffer(h),f.sourceBuffer[u]=void 0)}catch(S){F.logger.warn("[buffer-controller]: Failed to reset the "+u+" buffer",S)}}),this._initSourceBuffer()},M.onBufferCodecs=function(f,u){var h=this,S=this.getSourceBufferTypes().length;Object.keys(u).forEach(function(k){if(S){var m=h.tracks[k];if(m&&typeof m.buffer.changeType=="function"){var A=u[k],I=A.id,C=A.codec,P=A.levelCodec,l=A.container,c=A.metadata,s=(m.levelCodec||m.codec).replace(w,"$1"),g=(P||C).replace(w,"$1");if(s!==g){var R=l+";codecs="+(P||C);h.appendChangeType(k,R),F.logger.log("[buffer-controller]: switching codec "+s+" to "+g),h.tracks[k]={buffer:m.buffer,codec:C,container:l,levelCodec:P,metadata:c,id:I}}}}else h.pendingTracks[k]=u[k]}),!S&&(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks())},M.appendChangeType=function(f,u){var h=this,S=this.operationQueue,k={execute:function(){var A=h.sourceBuffer[f];A&&(F.logger.log("[buffer-controller]: changing "+f+" sourceBuffer type to "+u),A.changeType(u)),S.shiftAndExecuteNext(f)},onStart:function(){},onComplete:function(){},onError:function(A){F.logger.warn("[buffer-controller]: Failed to change "+f+" SourceBuffer type",A)}};S.append(k,f)},M.onBufferAppending=function(f,u){var h=this,S=this.hls,k=this.operationQueue,m=this.tracks,A=u.data,I=u.type,C=u.frag,P=u.part,l=u.chunkMeta,c=l.buffering[I],s=self.performance.now();c.start=s;var g=C.stats.buffering,R=P?P.stats.buffering:null;g.start===0&&(g.start=s),R&&R.start===0&&(R.start=s);var D=m.audio,x=!1;I==="audio"&&(D==null?void 0:D.container)==="audio/mpeg"&&(x=!this.lastMpegAudioChunk||l.id===1||this.lastMpegAudioChunk.sn!==l.sn,this.lastMpegAudioChunk=l);var T=C.start,O={execute:function(){if(c.executeStart=self.performance.now(),x){var H=h.sourceBuffer[I];if(H){var Z=T-H.timestampOffset;Math.abs(Z)>=.1&&(F.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+T+" (delta: "+Z+") sn: "+C.sn+")"),H.timestampOffset=T)}}h.appendExecutor(A,I)},onStart:function(){},onComplete:function(){var H=self.performance.now();c.executeEnd=c.end=H,g.first===0&&(g.first=H),R&&R.first===0&&(R.first=H);var Z=h.sourceBuffer,te={};for(var J in Z)te[J]=U.BufferHelper.getBuffered(Z[J]);h.appendError=0,h.hls.trigger(K.Events.BUFFER_APPENDED,{type:I,frag:C,part:P,chunkMeta:l,parent:C.type,timeRanges:te})},onError:function(H){F.logger.error("[buffer-controller]: Error encountered while trying to append to the "+I+" SourceBuffer",H);var Z={type:i.ErrorTypes.MEDIA_ERROR,parent:C.type,details:i.ErrorDetails.BUFFER_APPEND_ERROR,err:H,fatal:!1};H.code===DOMException.QUOTA_EXCEEDED_ERR?Z.details=i.ErrorDetails.BUFFER_FULL_ERROR:(h.appendError++,Z.details=i.ErrorDetails.BUFFER_APPEND_ERROR,h.appendError>S.config.appendErrorMaxRetry&&(F.logger.error("[buffer-controller]: Failed "+S.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),Z.fatal=!0,S.stopLoad())),S.trigger(K.Events.ERROR,Z)}};k.append(O,I)},M.onBufferFlushing=function(f,u){var h=this,S=this.operationQueue,k=function(A){return{execute:h.removeExecutor.bind(h,A,u.startOffset,u.endOffset),onStart:function(){},onComplete:function(){h.hls.trigger(K.Events.BUFFER_FLUSHED,{type:A})},onError:function(C){F.logger.warn("[buffer-controller]: Failed to remove from "+A+" SourceBuffer",C)}}};u.type?S.append(k(u.type),u.type):this.getSourceBufferTypes().forEach(function(m){S.append(k(m),m)})},M.onFragParsed=function(f,u){var h=this,S=u.frag,k=u.part,m=[],A=k?k.elementaryStreams:S.elementaryStreams;A[v.ElementaryStreamTypes.AUDIOVIDEO]?m.push("audiovideo"):(A[v.ElementaryStreamTypes.AUDIO]&&m.push("audio"),A[v.ElementaryStreamTypes.VIDEO]&&m.push("video"));var I=function(){var P=self.performance.now();S.stats.buffering.end=P,k&&(k.stats.buffering.end=P);var l=k?k.stats:S.stats;h.hls.trigger(K.Events.FRAG_BUFFERED,{frag:S,part:k,stats:l,id:S.type})};m.length===0&&F.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+S.type+" level: "+S.level+" sn: "+S.sn),this.blockBuffers(I,m)},M.onFragChanged=function(f,u){this.flushBackBuffer()},M.onBufferEos=function(f,u){var h=this,S=this.getSourceBufferTypes().reduce(function(k,m){var A=h.sourceBuffer[m];return A&&(!u.type||u.type===m)&&(A.ending=!0,A.ended||(A.ended=!0,F.logger.log("[buffer-controller]: "+m+" sourceBuffer now EOS"))),k&&!!(!A||A.ended)},!0);S&&(F.logger.log("[buffer-controller]: Queueing mediaSource.endOfStream()"),this.blockBuffers(function(){h.getSourceBufferTypes().forEach(function(m){var A=h.sourceBuffer[m];A&&(A.ending=!1)});var k=h.mediaSource;if(!k||k.readyState!=="open"){k&&F.logger.info("[buffer-controller]: Could not call mediaSource.endOfStream(). mediaSource.readyState: "+k.readyState);return}F.logger.log("[buffer-controller]: Calling mediaSource.endOfStream()"),k.endOfStream()}))},M.onLevelUpdated=function(f,u){var h=u.details;h.fragments.length&&(this.details=h,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())},M.flushBackBuffer=function(){var f=this.hls,u=this.details,h=this.media,S=this.sourceBuffer;if(!(!h||u===null)){var k=this.getSourceBufferTypes();if(k.length){var m=u.live&&f.config.liveBackBufferLength!==null?f.config.liveBackBufferLength:f.config.backBufferLength;if(!(!(0,V.isFiniteNumber)(m)||m<0)){var A=h.currentTime,I=u.levelTargetDuration,C=Math.max(m,I),P=Math.floor(A/I)*I-C;k.forEach(function(l){var c=S[l];if(c){var s=U.BufferHelper.getBuffered(c);if(s.length>0&&P>s.start(0)){if(f.trigger(K.Events.BACK_BUFFER_REACHED,{bufferEnd:P}),u.live)f.trigger(K.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:P});else if(c.ended&&s.end(s.length-1)-A<I*2){F.logger.info("[buffer-controller]: Cannot flush "+l+" back buffer while SourceBuffer is in ended state");return}f.trigger(K.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:P,type:l})}}})}}}},M.updateMediaElementDuration=function(){if(!(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")){var f=this.details,u=this.hls,h=this.media,S=this.mediaSource,k=f.fragments[0].start+f.totalduration,m=h.duration,A=(0,V.isFiniteNumber)(S.duration)?S.duration:0;f.live&&u.config.liveDurationInfinity?(F.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),S.duration=1/0,this.updateSeekableRange(f)):(k>A&&k>m||!(0,V.isFiniteNumber)(m))&&(F.logger.log("[buffer-controller]: Updating Media Source duration to "+k.toFixed(3)),S.duration=k)}},M.updateSeekableRange=function(f){var u=this.mediaSource,h=f.fragments,S=h.length;if(S&&f.live&&u!==null&&u!==void 0&&u.setLiveSeekableRange){var k=Math.max(0,h[0].start),m=Math.max(k,k+f.totalduration);u.setLiveSeekableRange(k,m)}},M.checkPendingTracks=function(){var f=this.bufferCodecEventsExpected,u=this.operationQueue,h=this.pendingTracks,S=Object.keys(h).length;if(S&&!f||S===2){this.createSourceBuffers(h),this.pendingTracks={};var k=this.getSourceBufferTypes();if(k.length===0){this.hls.trigger(K.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}k.forEach(function(m){u.executeNext(m)})}},M.createSourceBuffers=function(f){var u=this.sourceBuffer,h=this.mediaSource;if(!h)throw Error("createSourceBuffers called when mediaSource was null");var S=0;for(var k in f)if(!u[k]){var m=f[k];if(!m)throw Error("source buffer exists for track "+k+", however track does not");var A=m.levelCodec||m.codec,I=m.container+";codecs="+A;F.logger.log("[buffer-controller]: creating sourceBuffer("+I+")");try{var C=u[k]=h.addSourceBuffer(I),P=k;this.addBufferListener(P,"updatestart",this._onSBUpdateStart),this.addBufferListener(P,"updateend",this._onSBUpdateEnd),this.addBufferListener(P,"error",this._onSBUpdateError),this.tracks[k]={buffer:C,codec:A,container:m.container,levelCodec:m.levelCodec,metadata:m.metadata,id:m.id},S++}catch(l){F.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+l.message),this.hls.trigger(K.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:l,mimeType:I})}}S&&this.hls.trigger(K.Events.BUFFER_CREATED,{tracks:this.tracks})},M._onSBUpdateStart=function(f){var u=this.operationQueue,h=u.current(f);h.onStart()},M._onSBUpdateEnd=function(f){var u=this.operationQueue,h=u.current(f);h.onComplete(),u.shiftAndExecuteNext(f)},M._onSBUpdateError=function(f,u){F.logger.error("[buffer-controller]: "+f+" SourceBuffer error",u),this.hls.trigger(K.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var h=this.operationQueue.current(f);h&&h.onError(u)},M.removeExecutor=function(f,u,h){var S=this.media,k=this.mediaSource,m=this.operationQueue,A=this.sourceBuffer,I=A[f];if(!S||!k||!I){F.logger.warn("[buffer-controller]: Attempting to remove from the "+f+" SourceBuffer, but it does not exist"),m.shiftAndExecuteNext(f);return}var C=(0,V.isFiniteNumber)(S.duration)?S.duration:1/0,P=(0,V.isFiniteNumber)(k.duration)?k.duration:1/0,l=Math.max(0,u),c=Math.min(h,C,P);c>l&&!I.ending?(I.ended=!1,F.logger.log("[buffer-controller]: Removing ["+l+","+c+"] from the "+f+" SourceBuffer"),console.assert(!I.updating,f+" sourceBuffer must not be updating"),I.remove(l,c)):m.shiftAndExecuteNext(f)},M.appendExecutor=function(f,u){var h=this.operationQueue,S=this.sourceBuffer,k=S[u];if(!k){F.logger.warn("[buffer-controller]: Attempting to append to the "+u+" SourceBuffer, but it does not exist"),h.shiftAndExecuteNext(u);return}k.ended=!1,console.assert(!k.updating,u+" sourceBuffer must not be updating"),k.appendBuffer(f)},M.blockBuffers=function(f,u){var h=this;if(u===void 0&&(u=this.getSourceBufferTypes()),!u.length){F.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(f);return}var S=this.operationQueue,k=u.map(function(m){return S.appendBlocker(m)});Promise.all(k).then(function(){f(),u.forEach(function(m){var A=h.sourceBuffer[m];(!A||!A.updating)&&S.shiftAndExecuteNext(m)})})},M.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},M.addBufferListener=function(f,u,h){var S=this.sourceBuffer[f];if(S){var k=h.bind(this,f);this.listeners[f].push({event:u,listener:k}),S.addEventListener(u,k)}},M.removeBufferListeners=function(f){var u=this.sourceBuffer[f];u&&this.listeners[f].forEach(function(h){u.removeEventListener(h.event,h.listener)})},y}()},"./src/controller/buffer-operation-queue.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>K});var V=B("./src/utils/logger.ts"),K=function(){function F(U){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=U}var i=F.prototype;return i.append=function(L,v){var E=this.queues[v];E.push(L),E.length===1&&this.buffers[v]&&this.executeNext(v)},i.insertAbort=function(L,v){var E=this.queues[v];E.unshift(L),this.executeNext(v)},i.appendBlocker=function(L){var v,E=new Promise(function(w){v=w}),b={execute:v,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(b,L),E},i.executeNext=function(L){var v=this.buffers,E=this.queues,b=v[L],w=E[L];if(w.length){var p=w[0];try{p.execute()}catch(y){V.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),p.onError(y),(!b||!b.updating)&&(w.shift(),this.executeNext(L))}}},i.shiftAndExecuteNext=function(L){this.queues[L].shift(),this.executeNext(L)},i.current=function(L){return this.queues[L][0]},F}()},"./src/controller/cap-level-controller.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>v});var V=B("./src/events.ts");function K(E,b){for(var w=0;w<b.length;w++){var p=b[w];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(E,i(p.key),p)}}function F(E,b,w){return b&&K(E.prototype,b),w&&K(E,w),Object.defineProperty(E,"prototype",{writable:!1}),E}function i(E){var b=U(E,"string");return typeof b=="symbol"?b:String(b)}function U(E,b){if(typeof E!="object"||E===null)return E;var w=E[Symbol.toPrimitive];if(w!==void 0){var p=w.call(E,b||"default");if(typeof p!="object")return p;throw new TypeError("@@toPrimitive must return a primitive value.")}return(b==="string"?String:Number)(E)}var L=function(){function E(w){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=w,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var b=E.prototype;return b.setStreamController=function(p){this.streamController=p},b.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},b.registerListeners=function(){var p=this.hls;p.on(V.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),p.on(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),p.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),p.on(V.Events.BUFFER_CODECS,this.onBufferCodecs,this),p.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},b.unregisterListener=function(){var p=this.hls;p.off(V.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),p.off(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),p.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),p.off(V.Events.BUFFER_CODECS,this.onBufferCodecs,this),p.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},b.onFpsDropLevelCapping=function(p,y){E.isLevelAllowed(y.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(y.droppedLevel)},b.onMediaAttaching=function(p,y){this.media=y.media instanceof HTMLVideoElement?y.media:null,this.clientRect=null},b.onManifestParsed=function(p,y){var M=this.hls;this.restrictedLevels=[],this.firstLevel=y.firstLevel,M.config.capLevelToPlayerSize&&y.video&&this.startCapping()},b.onBufferCodecs=function(p,y){var M=this.hls;M.config.capLevelToPlayerSize&&y.video&&this.startCapping()},b.onMediaDetaching=function(){this.stopCapping()},b.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var p=this.hls.levels;if(p.length){var y=this.hls;y.autoLevelCapping=this.getMaxLevel(p.length-1),y.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=y.autoLevelCapping}}},b.getMaxLevel=function(p){var y=this,M=this.hls.levels;if(!M.length)return-1;var d=M.filter(function(f,u){return E.isLevelAllowed(u,y.restrictedLevels)&&u<=p});return this.clientRect=null,E.getMaxLevelByMediaSize(d,this.mediaWidth,this.mediaHeight)},b.startCapping=function(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())},b.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},b.getDimensions=function(){if(this.clientRect)return this.clientRect;var p=this.media,y={width:0,height:0};if(p){var M=p.getBoundingClientRect();y.width=M.width,y.height=M.height,!y.width&&!y.height&&(y.width=M.right-M.left||p.width||0,y.height=M.bottom-M.top||p.height||0)}return this.clientRect=y,y},E.isLevelAllowed=function(p,y){return y===void 0&&(y=[]),y.indexOf(p)===-1},E.getMaxLevelByMediaSize=function(p,y,M){if(!p||!p.length)return-1;for(var d=function(k,m){return m?k.width!==m.width||k.height!==m.height:!0},f=p.length-1,u=0;u<p.length;u+=1){var h=p[u];if((h.width>=y||h.height>=M)&&d(h,p[u+1])){f=u;break}}return f},F(E,[{key:"mediaWidth",get:function(){return this.getDimensions().width*this.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*this.contentScaleFactor}},{key:"contentScaleFactor",get:function(){var p=1;if(!this.hls.config.ignoreDevicePixelRatio)try{p=self.devicePixelRatio}catch(y){}return p}}]),E}();const v=L},"./src/controller/cmcd-controller.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>M});var V=B("./src/events.ts"),K=B("./src/types/cmcd.ts"),F=B("./src/utils/buffer-helper.ts"),i=B("./src/utils/logger.ts");function U(d,f){for(var u=0;u<f.length;u++){var h=f[u];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,v(h.key),h)}}function L(d,f,u){return f&&U(d.prototype,f),u&&U(d,u),Object.defineProperty(d,"prototype",{writable:!1}),d}function v(d){var f=E(d,"string");return typeof f=="symbol"?f:String(f)}function E(d,f){if(typeof d!="object"||d===null)return d;var u=d[Symbol.toPrimitive];if(u!==void 0){var h=u.call(d,f||"default");if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(d)}function b(d,f){var u=typeof Symbol!="undefined"&&d[Symbol.iterator]||d["@@iterator"];if(u)return(u=u.call(d)).next.bind(u);if(Array.isArray(d)||(u=w(d))||f&&d&&typeof d.length=="number"){u&&(d=u);var h=0;return function(){return h>=d.length?{done:!0}:{done:!1,value:d[h++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function w(d,f){if(d){if(typeof d=="string")return p(d,f);var u=Object.prototype.toString.call(d).slice(8,-1);if(u==="Object"&&d.constructor&&(u=d.constructor.name),u==="Map"||u==="Set")return Array.from(d);if(u==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u))return p(d,f)}}function p(d,f){(f==null||f>d.length)&&(f=d.length);for(var u=0,h=new Array(f);u<f;u++)h[u]=d[u];return h}function y(){return y=Object.assign?Object.assign.bind():function(d){for(var f=1;f<arguments.length;f++){var u=arguments[f];for(var h in u)Object.prototype.hasOwnProperty.call(u,h)&&(d[h]=u[h])}return d},y.apply(this,arguments)}var M=function(){function d(u){var h=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){h.initialized&&(h.starved=!0),h.buffering=!0},this.onPlaying=function(){h.initialized||(h.initialized=!0),h.buffering=!1},this.applyPlaylistData=function(m){try{h.apply(m,{ot:K.CMCDObjectType.MANIFEST,su:!h.initialized})}catch(A){i.logger.warn("Could not generate manifest CMCD data.",A)}},this.applyFragmentData=function(m){try{var A=m.frag,I=h.hls.levels[A.level],C=h.getObjectType(A),P={d:A.duration*1e3,ot:C};(C===K.CMCDObjectType.VIDEO||C===K.CMCDObjectType.AUDIO||C==K.CMCDObjectType.MUXED)&&(P.br=I.bitrate/1e3,P.tb=h.getTopBandwidth(C)/1e3,P.bl=h.getBufferLength(C)),h.apply(m,P)}catch(l){i.logger.warn("Could not generate segment CMCD data.",l)}},this.hls=u;var S=this.config=u.config,k=S.cmcd;k!=null&&(S.pLoader=this.createPlaylistLoader(),S.fLoader=this.createFragmentLoader(),this.sid=k.sessionId||d.uuid(),this.cid=k.contentId,this.useHeaders=k.useHeaders===!0,this.registerListeners())}var f=d.prototype;return f.registerListeners=function(){var h=this.hls;h.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(V.Events.MEDIA_DETACHED,this.onMediaDetached,this),h.on(V.Events.BUFFER_CREATED,this.onBufferCreated,this)},f.unregisterListeners=function(){var h=this.hls;h.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(V.Events.MEDIA_DETACHED,this.onMediaDetached,this),h.off(V.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},f.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},f.onMediaAttached=function(h,S){this.media=S.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},f.onMediaDetached=function(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)},f.onBufferCreated=function(h,S){var k,m;this.audioBuffer=(k=S.tracks.audio)===null||k===void 0?void 0:k.buffer,this.videoBuffer=(m=S.tracks.video)===null||m===void 0?void 0:m.buffer},f.createData=function(){var h;return{v:K.CMCDVersion,sf:K.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(h=this.media)===null||h===void 0?void 0:h.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},f.apply=function(h,S){S===void 0&&(S={}),y(S,this.createData());var k=S.ot===K.CMCDObjectType.INIT||S.ot===K.CMCDObjectType.VIDEO||S.ot===K.CMCDObjectType.MUXED;if(this.starved&&k&&(S.bs=!0,S.su=!0,this.starved=!1),S.su==null&&(S.su=this.buffering),this.useHeaders){var m=d.toHeaders(S);if(!Object.keys(m).length)return;h.headers||(h.headers={}),y(h.headers,m)}else{var A=d.toQuery(S);if(!A)return;h.url=d.appendQueryToUri(h.url,A)}},f.getObjectType=function(h){var S=h.type;if(S==="subtitle")return K.CMCDObjectType.TIMED_TEXT;if(h.sn==="initSegment")return K.CMCDObjectType.INIT;if(S==="audio")return K.CMCDObjectType.AUDIO;if(S==="main")return this.hls.audioTracks.length?K.CMCDObjectType.VIDEO:K.CMCDObjectType.MUXED},f.getTopBandwidth=function(h){var S=0,k,m=this.hls;if(h===K.CMCDObjectType.AUDIO)k=m.audioTracks;else{var A=m.maxAutoLevel,I=A>-1?A+1:m.levels.length;k=m.levels.slice(0,I)}for(var C=b(k),P;!(P=C()).done;){var l=P.value;l.bitrate>S&&(S=l.bitrate)}return S>0?S:NaN},f.getBufferLength=function(h){var S=this.hls.media,k=h===K.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!k||!S)return NaN;var m=F.BufferHelper.bufferInfo(k,S.currentTime,this.config.maxBufferHole);return m.len*1e3},f.createPlaylistLoader=function(){var h=this.config.pLoader,S=this.applyPlaylistData,k=h||this.config.loader;return function(){function m(I){this.loader=void 0,this.loader=new k(I)}var A=m.prototype;return A.destroy=function(){this.loader.destroy()},A.abort=function(){this.loader.abort()},A.load=function(C,P,l){S(C),this.loader.load(C,P,l)},L(m,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),m}()},f.createFragmentLoader=function(){var h=this.config.fLoader,S=this.applyFragmentData,k=h||this.config.loader;return function(){function m(I){this.loader=void 0,this.loader=new k(I)}var A=m.prototype;return A.destroy=function(){this.loader.destroy()},A.abort=function(){this.loader.abort()},A.load=function(C,P,l){S(C),this.loader.load(C,P,l)},L(m,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),m}()},d.uuid=function(){var h=URL.createObjectURL(new Blob),S=h.toString();return URL.revokeObjectURL(h),S.slice(S.lastIndexOf("/")+1)},d.serialize=function(h){for(var S=[],k=function(O){return!Number.isNaN(O)&&O!=null&&O!==""&&O!==!1},m=function(O){return Math.round(O)},A=function(O){return m(O/100)*100},I=function(O){return encodeURIComponent(O)},C={br:m,d:m,bl:A,dl:A,mtp:A,nor:I,rtp:A,tb:m},P=Object.keys(h||{}).sort(),l=b(P),c;!(c=l()).done;){var s=c.value,g=h[s];if(k(g)&&!(s==="v"&&g===1)&&!(s=="pr"&&g===1)){var R=C[s];R&&(g=R(g));var D=typeof g,x=void 0;s==="ot"||s==="sf"||s==="st"?x=s+"="+g:D==="boolean"?x=s:D==="number"?x=s+"="+g:x=s+"="+JSON.stringify(g),S.push(x)}}return S.join(",")},d.toHeaders=function(h){for(var S=Object.keys(h),k={},m=["Object","Request","Session","Status"],A=[{},{},{},{}],I={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},C=0,P=S;C<P.length;C++){var l=P[C],c=I[l]!=null?I[l]:1;A[c][l]=h[l]}for(var s=0;s<A.length;s++){var g=d.serialize(A[s]);g&&(k["CMCD-"+m[s]]=g)}return k},d.toQuery=function(h){return"CMCD="+encodeURIComponent(d.serialize(h))},d.appendQueryToUri=function(h,S){if(!S)return h;var k=h.includes("?")?"&":"?";return""+h+k+S},d}()},"./src/controller/eme-controller.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>C});var V=B("./src/events.ts"),K=B("./src/errors.ts"),F=B("./src/utils/logger.ts"),i=B("./src/utils/mediakeys-helper.ts"),U=B("./src/utils/keysystem-util.ts"),L=B("./src/utils/numeric-encoding-utils.ts"),v=B("./src/loader/level-key.ts"),E=B("./src/utils/hex.ts"),b=B("./src/utils/mp4-tools.ts"),w=B("./node_modules/eventemitter3/index.js"),p=B.n(w);function y(P,l){P.prototype=Object.create(l.prototype),P.prototype.constructor=P,h(P,l)}function M(P){var l=typeof Map=="function"?new Map:void 0;return M=function(s){if(s===null||!u(s))return s;if(typeof s!="function")throw new TypeError("Super expression must either be null or a function");if(typeof l!="undefined"){if(l.has(s))return l.get(s);l.set(s,g)}function g(){return d(s,arguments,S(this).constructor)}return g.prototype=Object.create(s.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),h(g,s)},M(P)}function d(P,l,c){return f()?d=Reflect.construct.bind():d=function(g,R,D){var x=[null];x.push.apply(x,R);var T=Function.bind.apply(g,x),O=new T;return D&&h(O,D.prototype),O},d.apply(null,arguments)}function f(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(P){return!1}}function u(P){return Function.toString.call(P).indexOf("[native code]")!==-1}function h(P,l){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,g){return s.__proto__=g,s},h(P,l)}function S(P){return S=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(c){return c.__proto__||Object.getPrototypeOf(c)},S(P)}var k=3,m="[eme]",A=function(){function P(c){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=P.CDMCleanupPromise?[P.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=F.logger.debug.bind(F.logger,m),this.log=F.logger.log.bind(F.logger,m),this.warn=F.logger.warn.bind(F.logger,m),this.error=F.logger.error.bind(F.logger,m),this.hls=c,this.config=c.config,this.registerListeners()}var l=P.prototype;return l.destroy=function(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null},l.registerListeners=function(){this.hls.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(V.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(V.Events.MANIFEST_LOADED,this.onManifestLoaded,this)},l.unregisterListeners=function(){this.hls.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(V.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(V.Events.MANIFEST_LOADED,this.onManifestLoaded,this)},l.getLicenseServerUrl=function(s){var g=this.config,R=g.drmSystems,D=g.widevineLicenseUrl,x=R[s];if(x)return x.licenseUrl;if(s===i.KeySystems.WIDEVINE&&D)return D;throw new Error('no license server URL configured for key-system "'+s+'"')},l.getServerCertificateUrl=function(s){var g=this.config.drmSystems,R=g[s];if(R)return R.serverCertificateUrl;this.log('No Server Certificate in config.drmSystems["'+s+'"]')},l.attemptKeySystemAccess=function(s){var g=this,R=this.hls.levels,D=function($,H,Z){return!!$&&Z.indexOf($)===H},x=R.map(function(O){return O.audioCodec}).filter(D),T=R.map(function(O){return O.videoCodec}).filter(D);return x.length+T.length===0&&T.push("avc1.42e01e"),new Promise(function(O,$){var H=function Z(te){var J=te.shift();g.getMediaKeysPromise(J,x,T).then(function(ie){return O({keySystem:J,mediaKeys:ie})}).catch(function(ie){te.length?Z(te):ie instanceof I?$(ie):$(new I({type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_NO_ACCESS,error:ie,fatal:!0},ie.message))})};H(s)})},l.requestMediaKeySystemAccess=function(s,g){var R=this.config.requestMediaKeySystemAccessFunc;if(typeof R!="function"){var D="Configured requestMediaKeySystemAccess is not a function "+R;return i.requestMediaKeySystemAccess===null&&self.location.protocol==="http:"&&(D="navigator.requestMediaKeySystemAccess is not available over insecure protocol "+location.protocol),Promise.reject(new Error(D))}return R(s,g)},l.getMediaKeysPromise=function(s,g,R){var D=this,x=(0,i.getSupportedMediaKeySystemConfigurations)(s,g,R,this.config.drmSystemOptions),T=this.keySystemAccessPromises[s],O=T==null?void 0:T.keySystemAccess;if(!O){this.log('Requesting encrypted media "'+s+'" key-system access with config: '+JSON.stringify(x)),O=this.requestMediaKeySystemAccess(s,x);var $=this.keySystemAccessPromises[s]={keySystemAccess:O};return O.catch(function(H){D.log('Failed to obtain access to key-system "'+s+'": '+H)}),O.then(function(H){D.log('Access for key-system "'+H.keySystem+'" obtained');var Z=D.fetchServerCertificate(s);return D.log('Create media-keys for "'+s+'"'),$.mediaKeys=H.createMediaKeys().then(function(te){return D.log('Media-keys created for "'+s+'"'),Z.then(function(J){return J?D.setMediaKeysServerCertificate(te,s,J):te})}),$.mediaKeys.catch(function(te){D.error('Failed to create media-keys for "'+s+'"}: '+te)}),$.mediaKeys})}return O.then(function(){return T.mediaKeys})},l.createMediaKeySessionContext=function(s){var g=s.decryptdata,R=s.keySystem,D=s.mediaKeys;console.assert(!!D,"mediaKeys is defined"),this.log('Creating key-system session "'+R+'" keyId: '+E.default.hexDump(g.keyId||[]));var x=D.createSession(),T={decryptdata:g,keySystem:R,mediaKeys:D,mediaKeysSession:x,keyStatus:"status-pending"};return this.mediaKeySessions.push(T),T},l.renewKeySession=function(s){var g=s.decryptdata;if(g.pssh){var R=this.createMediaKeySessionContext(s),D=this.getKeyIdString(g),x="cenc";this.keyIdToKeySessionPromise[D]=this.generateRequestWithPreferredKeySession(R,x,g.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(s)},l.getKeyIdString=function(s){if(!s)throw new Error("Could not read keyId of undefined decryptdata");if(s.keyId===null)throw new Error("keyId is null");return E.default.hexDump(s.keyId)},l.updateKeySession=function(s,g){var R,D=s.mediaKeysSession;return this.log('Updating key-session "'+D.sessionId+'" for keyID '+E.default.hexDump(((R=s.decryptdata)===null||R===void 0?void 0:R.keyId)||[])+`
} (data length: `+(g&&g.byteLength)+")"),D.update(g)},l.selectKeySystemFormat=function(s){var g=Object.keys(s.levelkeys||{});return this.keyFormatPromise||(this.log("Selecting key-system from fragment (sn: "+s.sn+" "+s.type+": "+s.level+") key formats "+g.join(", ")),this.keyFormatPromise=this.getKeyFormatPromise(g)),this.keyFormatPromise},l.getKeyFormatPromise=function(s){var g=this;return new Promise(function(R,D){var x=(0,i.getKeySystemsForConfig)(g.config),T=s.map(i.keySystemFormatToKeySystemDomain).filter(function(O){return!!O&&x.indexOf(O)!==-1});return g.getKeySystemSelectionPromise(T).then(function(O){var $=O.keySystem,H=(0,i.keySystemDomainToKeySystemFormat)($);H?R(H):D(new Error('Unable to find format for key-system "'+$+'"'))}).catch(D)})},l.loadKey=function(s){var g=this,R=s.keyInfo.decryptdata,D=this.getKeyIdString(R),x="(keyId: "+D+' format: "'+R.keyFormat+'" method: '+R.method+" uri: "+R.uri+")";this.log("Starting session for key "+x);var T=this.keyIdToKeySessionPromise[D];return T||(T=this.keyIdToKeySessionPromise[D]=this.getKeySystemForKeyPromise(R).then(function(O){var $=O.keySystem,H=O.mediaKeys;return g.throwIfDestroyed(),g.log("Handle encrypted media sn: "+s.frag.sn+" "+s.frag.type+": "+s.frag.level+" using key "+x),g.attemptSetMediaKeys($,H).then(function(){g.throwIfDestroyed();var Z=g.createMediaKeySessionContext({keySystem:$,mediaKeys:H,decryptdata:R}),te="cenc";return g.generateRequestWithPreferredKeySession(Z,te,R.pssh,"playlist-key")})}),T.catch(function(O){return g.handleError(O)})),T},l.throwIfDestroyed=function(s){if(s===void 0&&(s="Invalid state"),!this.hls)throw new Error("invalid state")},l.handleError=function(s){this.hls&&(this.error(s.message),s instanceof I?this.hls.trigger(V.Events.ERROR,s.data):this.hls.trigger(V.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_NO_KEYS,error:s,fatal:!0}))},l.getKeySystemForKeyPromise=function(s){var g=this.getKeyIdString(s),R=this.keyIdToKeySessionPromise[g];if(!R){var D=(0,i.keySystemFormatToKeySystemDomain)(s.keyFormat),x=D?[D]:(0,i.getKeySystemsForConfig)(this.config);return this.attemptKeySystemAccess(x)}return R},l.getKeySystemSelectionPromise=function(s){if(s.length||(s=(0,i.getKeySystemsForConfig)(this.config)),s.length===0)throw new I({type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},"Missing key-system license configuration options "+JSON.stringify({drmSystems:this.config.drmSystems}));return this.attemptKeySystemAccess(s)},l._onMediaEncrypted=function(s){var g=this,R=s.initDataType,D=s.initData;if(this.debug('"'+s.type+'" event: init data type: "'+R+'"'),D!==null){var x,T;if(R==="sinf"&&this.config.drmSystems[i.KeySystems.FAIRPLAY]){var O=(0,b.bin2str)(new Uint8Array(D));try{var $=(0,L.base64Decode)(JSON.parse(O).sinf),H=(0,b.parseSinf)(new Uint8Array($));if(!H)return;x=H.subarray(8,24),T=i.KeySystems.FAIRPLAY}catch(Ve){this.warn('Failed to parse sinf "encrypted" event message initData');return}}else{var Z=(0,b.parsePssh)(D);if(Z===null)return;Z.version===0&&Z.systemId===i.KeySystemIds.WIDEVINE&&Z.data&&(x=Z.data.subarray(8,24)),T=(0,i.keySystemIdToKeySystemDomain)(Z.systemId)}if(!(!T||!x)){for(var te=E.default.hexDump(x),J=this.keyIdToKeySessionPromise,ie=this.mediaKeySessions,oe=J[te],ue=function(ot){var Et=ie[ot],it=Et.decryptdata;if(it.pssh||!it.keyId)return"continue";var Ie=E.default.hexDump(it.keyId);if(te===Ie||it.uri.replace(/-/g,"").indexOf(te)!==-1)return oe=J[Ie],delete J[Ie],it.pssh=new Uint8Array(D),it.keyId=x,oe=J[te]=oe.then(function(){return g.generateRequestWithPreferredKeySession(Et,R,D,"encrypted-event-key-match")}),"break"},Pe=0;Pe<ie.length;Pe++){var Ne=ue(Pe);if(Ne!=="continue"&&Ne==="break")break}oe||(oe=J[te]=this.getKeySystemSelectionPromise([T]).then(function(Ve){var ot,Et=Ve.keySystem,it=Ve.mediaKeys;g.throwIfDestroyed();var Ie=new v.LevelKey("ISO-23001-7",te,(ot=(0,i.keySystemDomainToKeySystemFormat)(Et))!=null?ot:"");return Ie.pssh=new Uint8Array(D),Ie.keyId=x,g.attemptSetMediaKeys(Et,it).then(function(){g.throwIfDestroyed();var He=g.createMediaKeySessionContext({decryptdata:Ie,keySystem:Et,mediaKeys:it});return g.generateRequestWithPreferredKeySession(He,R,D,"encrypted-event-no-match")})})),oe.catch(function(Ve){return g.handleError(Ve)})}}},l._onWaitingForKey=function(s){this.log('"'+s.type+'" event')},l.attemptSetMediaKeys=function(s,g){var R=this,D=this.setMediaKeysQueue.slice();this.log('Setting media-keys for "'+s+'"');var x=Promise.all(D).then(function(){if(!R.media)throw new Error("Attempted to set mediaKeys without media element attached");return R.media.setMediaKeys(g)});return this.setMediaKeysQueue.push(x),x.then(function(){R.log('Media-keys set for "'+s+'"'),D.push(x),R.setMediaKeysQueue=R.setMediaKeysQueue.filter(function(T){return D.indexOf(T)===-1})})},l.generateRequestWithPreferredKeySession=function(s,g,R,D){var x,T,O=this,$=(x=this.config.drmSystems)===null||x===void 0||(T=x[s.keySystem])===null||T===void 0?void 0:T.generateRequest;if($)try{var H=$.call(this.hls,g,R,s);if(!H)throw new Error("Invalid response from configured generateRequest filter");g=H.initDataType,R=s.decryptdata.pssh=H.initData?new Uint8Array(H.initData):null}catch(oe){var Z;if(this.warn(oe.message),(Z=this.hls)!==null&&Z!==void 0&&Z.config.debug)throw oe}if(R===null)return this.log('Skipping key-session request for "'+D+'" (no initData)'),Promise.resolve(s);var te=this.getKeyIdString(s.decryptdata);this.log('Generating key-session request for "'+D+'": '+te+" (init data type: "+g+" length: "+(R?R.byteLength:null)+")");var J=new(p());s.mediaKeysSession.onmessage=function(oe){var ue=s.mediaKeysSession;if(!ue){J.emit("error",new Error("invalid state"));return}var Pe=oe.messageType,Ne=oe.message;O.log('"'+Pe+'" message event for session "'+ue.sessionId+'" message size: '+Ne.byteLength),Pe==="license-request"||Pe==="license-renewal"?O.renewLicense(s,Ne).catch(function(Ve){O.handleError(Ve),J.emit("error",Ve)}):Pe==="license-release"?s.keySystem===i.KeySystems.FAIRPLAY&&(O.updateKeySession(s,(0,U.strToUtf8array)("acknowledged")),O.removeSession(s)):O.warn('unhandled media key message type "'+Pe+'"')},s.mediaKeysSession.onkeystatuseschange=function(oe){var ue=s.mediaKeysSession;if(!ue){J.emit("error",new Error("invalid state"));return}O.onKeyStatusChange(s);var Pe=s.keyStatus;J.emit("keyStatus",Pe),Pe==="expired"&&(O.warn(s.keySystem+" expired for key "+te),O.renewKeySession(s))};var ie=new Promise(function(oe,ue){J.on("error",ue),J.on("keyStatus",function(Pe){Pe.startsWith("usable")?oe():Pe==="output-restricted"?ue(new I({type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):Pe==="internal-error"?ue(new I({type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},'key status changed to "'+Pe+'"')):Pe==="expired"?ue(new Error("key expired while generating request")):O.warn('unhandled key status change "'+Pe+'"')})});return s.mediaKeysSession.generateRequest(g,R).then(function(){var oe;O.log('Request generated for key-session "'+((oe=s.mediaKeysSession)===null||oe===void 0?void 0:oe.sessionId)+'" keyId: '+te)}).catch(function(oe){throw new I({type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_NO_SESSION,error:oe,fatal:!1},"Error generating key-session request: "+oe)}).then(function(){return ie}).catch(function(oe){throw J.removeAllListeners(),O.removeSession(s),oe}).then(function(){return J.removeAllListeners(),s})},l.onKeyStatusChange=function(s){var g=this;s.mediaKeysSession.keyStatuses.forEach(function(R,D){g.log('key status change "'+R+'" for keyStatuses keyId: '+E.default.hexDump("buffer"in D?new Uint8Array(D.buffer,D.byteOffset,D.byteLength):new Uint8Array(D))+" session keyId: "+E.default.hexDump(new Uint8Array(s.decryptdata.keyId||[]))+" uri: "+s.decryptdata.uri),s.keyStatus=R})},l.fetchServerCertificate=function(s){var g=this;return new Promise(function(R,D){var x=g.getServerCertificateUrl(s);if(!x)return R();g.log('Fetching serverCertificate for "'+s+'"');var T=new XMLHttpRequest;T.open("GET",x,!0),T.responseType="arraybuffer",T.onreadystatechange=function(){T.readyState===XMLHttpRequest.DONE&&(T.status===200?R(T.response):D(new I({type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:T},'"'+s+'" certificate request XHR failed ('+x+"). Status: "+T.status+" ("+T.statusText+")")))},T.send()})},l.setMediaKeysServerCertificate=function(s,g,R){var D=this;return new Promise(function(x,T){s.setServerCertificate(R).then(function(O){D.log("setServerCertificate "+(O?"success":"not supported by CDM")+" ("+(R==null?void 0:R.byteLength)+') on "'+g+'"'),x(s)}).catch(function(O){T(new I({type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:O,fatal:!0},O.message))})})},l.renewLicense=function(s,g){var R=this;return this.requestLicense(s,new Uint8Array(g)).then(function(D){return R.updateKeySession(s,new Uint8Array(D)).catch(function(x){throw new I({type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:x,fatal:!0},x.message)})})},l.setupLicenseXHR=function(s,g,R,D){var x=this,T=this.config.licenseXhrSetup;return T?Promise.resolve().then(function(){if(!R.decryptdata)throw new Error("Key removed");return T.call(x.hls,s,g,R,D)}).catch(function(O){if(!R.decryptdata)throw O;return s.open("POST",g,!0),T.call(x.hls,s,g,R,D)}).then(function(O){s.readyState||s.open("POST",g,!0);var $=O||D;return{xhr:s,licenseChallenge:$}}):(s.open("POST",g,!0),Promise.resolve({xhr:s,licenseChallenge:D}))},l.requestLicense=function(s,g){var R=this;return new Promise(function(D,x){var T=R.getLicenseServerUrl(s.keySystem);R.log("Sending license request to URL: "+T);var O=new XMLHttpRequest;O.responseType="arraybuffer",O.onreadystatechange=function(){if(!R.hls||!s.mediaKeysSession)return x(new Error("invalid state"));if(O.readyState===4)if(O.status===200){R._requestLicenseFailureCount=0;var $=O.response;R.log("License received "+($ instanceof ArrayBuffer?$.byteLength:$));var H=R.config.licenseResponseCallback;if(H)try{$=H.call(R.hls,O,T,s)}catch(te){R.error(te)}D($)}else if(R._requestLicenseFailureCount++,R._requestLicenseFailureCount>k||O.status>=400&&O.status<500)x(new I({type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:O},"License Request XHR failed ("+T+"). Status: "+O.status+" ("+O.statusText+")"));else{var Z=k-R._requestLicenseFailureCount+1;R.warn("Retrying license request, "+Z+" attempts left"),R.requestLicense(s,g).then(D,x)}},s.licenseXhr&&s.licenseXhr.readyState!==XMLHttpRequest.DONE&&s.licenseXhr.abort(),s.licenseXhr=O,R.setupLicenseXHR(O,T,s,g).then(function($){var H=$.xhr,Z=$.licenseChallenge;H.send(Z)})})},l.onMediaAttached=function(s,g){if(this.config.emeEnabled){var R=g.media;this.media=R,R.addEventListener("encrypted",this.onMediaEncrypted),R.addEventListener("waitingforkey",this.onWaitingForKey)}},l.onMediaDetached=function(){var s=this,g=this.media,R=this.mediaKeySessions;g&&(g.removeEventListener("encrypted",this.onMediaEncrypted),g.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},v.LevelKey.clearKeyUriToKeyIdMap();var D=R.length;P.CDMCleanupPromise=Promise.all(R.map(function(x){return s.removeSession(x)}).concat(g==null?void 0:g.setMediaKeys(null).catch(function(x){s.log("Could not clear media keys: "+x+". media.src: "+(g==null?void 0:g.src))}))).then(function(){D&&(s.log("finished closing key sessions and clearing media keys"),R.length=0)}).catch(function(x){s.log("Could not close sessions and clear media keys: "+x+". media.src: "+(g==null?void 0:g.src))})},l.onManifestLoaded=function(s,g){var R=g.sessionKeys;if(!(!R||!this.config.emeEnabled)&&!this.keyFormatPromise){var D=R.reduce(function(x,T){return x.indexOf(T.keyFormat)===-1&&x.push(T.keyFormat),x},[]);this.log("Selecting key-system from session-keys "+D.join(", ")),this.keyFormatPromise=this.getKeyFormatPromise(D)}},l.removeSession=function(s){var g=this,R=s.mediaKeysSession,D=s.licenseXhr;if(R){this.log("Remove licenses and keys and close session "+R.sessionId),R.onmessage=null,R.onkeystatuseschange=null,D&&D.readyState!==XMLHttpRequest.DONE&&D.abort(),s.mediaKeysSession=s.decryptdata=s.licenseXhr=void 0;var x=this.mediaKeySessions.indexOf(s);return x>-1&&this.mediaKeySessions.splice(x,1),R.remove().catch(function(T){g.log("Could not remove session: "+T)}).then(function(){return R.close()}).catch(function(T){g.log("Could not close session: "+T)})}},P}();A.CDMCleanupPromise=void 0;var I=function(P){y(l,P);function l(c,s){var g;return g=P.call(this,s)||this,g.data=void 0,g.data=c,c.err=c.error,g}return l}(M(Error));const C=A},"./src/controller/fps-controller.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>i});var V=B("./src/events.ts"),K=B("./src/utils/logger.ts"),F=function(){function U(v){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=v,this.registerListeners()}var L=U.prototype;return L.setStreamController=function(E){this.streamController=E},L.registerListeners=function(){this.hls.on(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},L.unregisterListeners=function(){this.hls.off(V.Events.MEDIA_ATTACHING,this.onMediaAttaching)},L.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},L.onMediaAttaching=function(E,b){var w=this.hls.config;if(w.capLevelOnFPSDrop){var p=b.media instanceof self.HTMLVideoElement?b.media:null;this.media=p,p&&typeof p.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),w.fpsDroppedMonitoringPeriod)}},L.checkFPS=function(E,b,w){var p=performance.now();if(b){if(this.lastTime){var y=p-this.lastTime,M=w-this.lastDroppedFrames,d=b-this.lastDecodedFrames,f=1e3*M/y,u=this.hls;if(u.trigger(V.Events.FPS_DROP,{currentDropped:M,currentDecoded:d,totalDroppedFrames:w}),f>0&&M>u.config.fpsDroppedMonitoringThreshold*d){var h=u.currentLevel;K.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+h),h>0&&(u.autoLevelCapping===-1||u.autoLevelCapping>=h)&&(h=h-1,u.trigger(V.Events.FPS_DROP_LEVEL_CAPPING,{level:h,droppedLevel:u.currentLevel}),u.autoLevelCapping=h,this.streamController.nextLevelSwitch())}}this.lastTime=p,this.lastDroppedFrames=w,this.lastDecodedFrames=b}},L.checkFPSInterval=function(){var E=this.media;if(E)if(this.isVideoPlaybackQualityAvailable){var b=E.getVideoPlaybackQuality();this.checkFPS(E,b.totalVideoFrames,b.droppedVideoFrames)}else this.checkFPS(E,E.webkitDecodedFrameCount,E.webkitDroppedFrameCount)},U}();const i=F},"./src/controller/fragment-finders.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{findFragWithCC:()=>v,findFragmentByPDT:()=>F,findFragmentByPTS:()=>i,fragmentWithinToleranceTest:()=>U,pdtWithinToleranceTest:()=>L});var V=B("./src/polyfills/number.ts"),K=B("./src/utils/binary-search.ts");function F(E,b,w){if(b===null||!Array.isArray(E)||!E.length||!(0,V.isFiniteNumber)(b))return null;var p=E[0].programDateTime;if(b<(p||0))return null;var y=E[E.length-1].endProgramDateTime;if(b>=(y||0))return null;w=w||0;for(var M=0;M<E.length;++M){var d=E[M];if(L(b,w,d))return d}return null}function i(E,b,w,p){w===void 0&&(w=0),p===void 0&&(p=0);var y=null;if(E?y=b[E.sn-b[0].sn+1]||null:w===0&&b[0].start===0&&(y=b[0]),y&&U(w,p,y)===0)return y;var M=K.default.search(b,U.bind(null,w,p));return M&&(M!==E||!y)?M:y}function U(E,b,w){if(E===void 0&&(E=0),b===void 0&&(b=0),w.start<=E&&w.start+w.duration>E)return 0;var p=Math.min(b,w.duration+(w.deltaPTS?w.deltaPTS:0));return w.start+w.duration-p<=E?1:w.start-p>E&&w.start?-1:0}function L(E,b,w){var p=Math.min(b,w.duration+(w.deltaPTS?w.deltaPTS:0))*1e3,y=w.endProgramDateTime||0;return y-p>E}function v(E,b){return K.default.search(E,function(w){return w.cc<b?1:w.cc>b?-1:0})}},"./src/controller/fragment-tracker.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{FragmentState:()=>F,FragmentTracker:()=>i});var V=B("./src/events.ts"),K=B("./src/types/loader.ts"),F;(function(v){v.NOT_LOADED="NOT_LOADED",v.APPENDING="APPENDING",v.PARTIAL="PARTIAL",v.OK="OK"})(F||(F={}));var i=function(){function v(b){this.activeFragment=null,this.activeParts=null,this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=b,this._registerListeners()}var E=v.prototype;return E._registerListeners=function(){var w=this.hls;w.on(V.Events.BUFFER_APPENDED,this.onBufferAppended,this),w.on(V.Events.FRAG_BUFFERED,this.onFragBuffered,this),w.on(V.Events.FRAG_LOADED,this.onFragLoaded,this)},E._unregisterListeners=function(){var w=this.hls;w.off(V.Events.BUFFER_APPENDED,this.onBufferAppended,this),w.off(V.Events.FRAG_BUFFERED,this.onFragBuffered,this),w.off(V.Events.FRAG_LOADED,this.onFragLoaded,this)},E.destroy=function(){this._unregisterListeners(),this.fragments=this.endListFragments=this.timeRanges=this.activeFragment=this.activeParts=null},E.getAppendedFrag=function(w,p){if(p===K.PlaylistLevelType.MAIN){var y=this.activeFragment,M=this.activeParts;if(!y)return null;if(M)for(var d=M.length;d--;){var f=M[d],u=f?f.end:y.appendedPTS;if(f.start<=w&&u!==void 0&&w<=u)return d>9&&(this.activeParts=M.slice(d-9)),f}else if(y.start<=w&&y.appendedPTS!==void 0&&w<=y.appendedPTS)return y}return this.getBufferedFrag(w,p)},E.getBufferedFrag=function(w,p){for(var y=this.fragments,M=Object.keys(y),d=M.length;d--;){var f=y[M[d]];if((f==null?void 0:f.body.type)===p&&f.buffered){var u=f.body;if(u.start<=w&&w<=u.end)return u}}return null},E.detectEvictedFragments=function(w,p,y){var M=this;this.timeRanges&&(this.timeRanges[w]=p),Object.keys(this.fragments).forEach(function(d){var f=M.fragments[d];if(f){if(!f.buffered&&!f.loaded){f.body.type===y&&M.removeFragment(f.body);return}var u=f.range[w];u&&u.time.some(function(h){var S=!M.isTimeBuffered(h.startPTS,h.endPTS,p);return S&&M.removeFragment(f.body),S})}})},E.detectPartialFragments=function(w){var p=this,y=this.timeRanges,M=w.frag,d=w.part;if(!(!y||M.sn==="initSegment")){var f=L(M),u=this.fragments[f];u&&(Object.keys(y).forEach(function(h){var S=M.elementaryStreams[h];if(S){var k=y[h],m=d!==null||S.partial===!0;u.range[h]=p.getBufferedTimes(M,d,m,k)}}),u.loaded=null,Object.keys(u.range).length?(u.buffered=!0,u.body.endList&&(this.endListFragments[u.body.type]=u)):this.removeFragment(u.body))}},E.fragBuffered=function(w){var p=L(w),y=this.fragments[p];y&&(y.loaded=null,y.buffered=!0)},E.getBufferedTimes=function(w,p,y,M){for(var d={time:[],partial:y},f=p?p.start:w.start,u=p?p.end:w.end,h=w.minEndPTS||u,S=w.maxStartPTS||f,k=0;k<M.length;k++){var m=M.start(k)-this.bufferPadding,A=M.end(k)+this.bufferPadding;if(S>=m&&h<=A){d.time.push({startPTS:Math.max(f,M.start(k)),endPTS:Math.min(u,M.end(k))});break}else if(f<A&&u>m)d.partial=!0,d.time.push({startPTS:Math.max(f,M.start(k)),endPTS:Math.min(u,M.end(k))});else if(u<=m)break}return d},E.getPartialFragment=function(w){var p=null,y,M,d,f=0,u=this.bufferPadding,h=this.fragments;return Object.keys(h).forEach(function(S){var k=h[S];k&&U(k)&&(M=k.body.start-u,d=k.body.end+u,w>=M&&w<=d&&(y=Math.min(w-M,d-w),f<=y&&(p=k.body,f=y)))}),p},E.isEndListAppended=function(w){var p=this.endListFragments[w];return p!==void 0&&(p.buffered||U(p))},E.getState=function(w){var p=L(w),y=this.fragments[p];return y?y.buffered?U(y)?F.PARTIAL:F.OK:F.APPENDING:F.NOT_LOADED},E.isTimeBuffered=function(w,p,y){for(var M,d,f=0;f<y.length;f++){if(M=y.start(f)-this.bufferPadding,d=y.end(f)+this.bufferPadding,w>=M&&p<=d)return!0;if(p<=M)return!1}return!1},E.onFragLoaded=function(w,p){var y=p.frag,M=p.part;if(!(y.sn==="initSegment"||y.bitrateTest||M)){var d=L(y);this.fragments[d]={body:y,loaded:p,buffered:!1,range:Object.create(null)}}},E.onBufferAppended=function(w,p){var y=this,M=p.frag,d=p.part,f=p.timeRanges;if(M.type===K.PlaylistLevelType.MAIN)if(this.activeFragment!==M&&(this.activeFragment=M,M.appendedPTS=void 0),d){var u=this.activeParts;u||(this.activeParts=u=[]),u.push(d)}else this.activeParts=null;this.timeRanges=f,Object.keys(f).forEach(function(h){var S=f[h];if(y.detectEvictedFragments(h,S),!d&&M.type===K.PlaylistLevelType.MAIN){var k=M.elementaryStreams[h];if(!k)return;for(var m=0;m<S.length;m++){var A=S.end(m);A<=k.endPTS&&A>k.startPTS?M.appendedPTS=Math.max(A,M.appendedPTS||0):M.appendedPTS=k.endPTS}}})},E.onFragBuffered=function(w,p){this.detectPartialFragments(p)},E.hasFragment=function(w){var p=L(w);return!!this.fragments[p]},E.removeFragmentsInRange=function(w,p,y){var M=this;Object.keys(this.fragments).forEach(function(d){var f=M.fragments[d];if(f&&f.buffered){var u=f.body;u.type===y&&u.start<p&&u.end>w&&M.removeFragment(u)}})},E.removeFragment=function(w){var p=L(w);w.stats.loaded=0,w.clearElementaryStreamInfo(),w.appendedPTS=void 0,delete this.fragments[p],w.endList&&delete this.endListFragments[w.type]},E.removeAllFragments=function(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activeFragment=null,this.activeParts=null},v}();function U(v){var E,b;return v.buffered&&(((E=v.range.video)===null||E===void 0?void 0:E.partial)||((b=v.range.audio)===null||b===void 0?void 0:b.partial))}function L(v){return v.type+"_"+v.level+"_"+v.urlId+"_"+v.sn}},"./src/controller/gap-controller.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{MAX_START_GAP_JUMP:()=>L,SKIP_BUFFER_HOLE_STEP_SECONDS:()=>v,SKIP_BUFFER_RANGE_START:()=>E,STALL_MINIMUM_DURATION_MS:()=>U,default:()=>b});var V=B("./src/utils/buffer-helper.ts"),K=B("./src/errors.ts"),F=B("./src/events.ts"),i=B("./src/utils/logger.ts"),U=250,L=2,v=.1,E=.05,b=function(){function w(y,M,d,f){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=y,this.media=M,this.fragmentTracker=d,this.hls=f}var p=w.prototype;return p.destroy=function(){this.media=null,this.hls=this.fragmentTracker=null},p.poll=function(M,d){var f=this.config,u=this.media,h=this.stalled;if(u!==null){var S=u.currentTime,k=u.seeking,m=this.seeking&&!k,A=!this.seeking&&k;if(this.seeking=k,S!==M){if(this.moved=!0,h!==null){if(this.stallReported){var I=self.performance.now()-h;i.logger.warn("playback not stuck anymore @"+S+", after "+Math.round(I)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((A||m)&&(this.stalled=null),!(u.paused&&!k||u.ended||u.playbackRate===0||!V.BufferHelper.getBuffered(u).length)){var C=V.BufferHelper.bufferInfo(u,S,0),P=C.len>0,l=C.nextStart||0;if(!(!P&&!l)){if(k){var c=C.len>L,s=!l||d&&d.start<=S||l-S>L&&!this.fragmentTracker.getPartialFragment(S);if(c||s)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var g,R=Math.max(l,C.start||0)-S,D=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,x=D==null||(g=D.details)===null||g===void 0?void 0:g.live,T=x?D.details.targetduration*2:L;if(R>0&&R<=T){this._trySkipBufferHole(null);return}}var O=self.performance.now();if(h===null){this.stalled=O;return}var $=O-h;if(!(!k&&$>=U&&(this._reportStall(C),!this.media))){var H=V.BufferHelper.bufferInfo(u,S,f.maxBufferHole);this._tryFixBufferStall(H,$)}}}}},p._tryFixBufferStall=function(M,d){var f=this.config,u=this.fragmentTracker,h=this.media;if(h!==null){var S=h.currentTime,k=u.getPartialFragment(S);if(k){var m=this._trySkipBufferHole(k);if(m||!this.media)return}M.len>f.maxBufferHole&&d>f.highBufferWatchdogPeriod*1e3&&(i.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}},p._reportStall=function(M){var d=this.hls,f=this.media,u=this.stallReported;!u&&f&&(this.stallReported=!0,i.logger.warn("Playback stalling at @"+f.currentTime+" due to low buffer ("+JSON.stringify(M)+")"),d.trigger(F.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:M.len}))},p._trySkipBufferHole=function(M){var d=this.config,f=this.hls,u=this.media;if(u===null)return 0;for(var h=u.currentTime,S=0,k=V.BufferHelper.getBuffered(u),m=0;m<k.length;m++){var A=k.start(m);if(h+d.maxBufferHole>=S&&h<A){var I=Math.max(A+E,u.currentTime+v);return i.logger.warn("skipping hole, adjusting currentTime from "+h+" to "+I),this.moved=!0,this.stalled=null,u.currentTime=I,M&&f.trigger(F.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+h+" to "+I,frag:M}),I}S=k.end(m)}return 0},p._tryNudgeBuffer=function(){var M=this.config,d=this.hls,f=this.media,u=this.nudgeRetry;if(f!==null){var h=f.currentTime;if(this.nudgeRetry++,u<M.nudgeMaxRetry){var S=h+(u+1)*M.nudgeOffset;i.logger.warn("Nudging 'currentTime' from "+h+" to "+S),f.currentTime=S,d.trigger(F.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else i.logger.error("Playhead still not moving while enough data buffered @"+h+" after "+M.nudgeMaxRetry+" nudges"),d.trigger(F.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})}},w}()},"./src/controller/id3-track-controller.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>M});var V=B("./src/polyfills/number.ts"),K=B("./src/events.ts"),F=B("./src/utils/texttrack-utils.ts"),i=B("./src/demux/id3.ts"),U=B("./src/loader/date-range.ts"),L=B("./src/types/demuxer.ts"),v=.25;function E(){return self.WebKitDataCue||self.VTTCue||self.TextTrackCue}var b=function(){var d=E();try{new d(0,Number.POSITIVE_INFINITY,"")}catch(f){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY}();function w(d,f){return d.getTime()/1e3-f}function p(d){return Uint8Array.from(d.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}var y=function(){function d(u){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=u,this._registerListeners()}var f=d.prototype;return f.destroy=function(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null},f._registerListeners=function(){var h=this.hls;h.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(K.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),h.on(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),h.on(K.Events.LEVEL_UPDATED,this.onLevelUpdated,this)},f._unregisterListeners=function(){var h=this.hls;h.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(K.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),h.off(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),h.off(K.Events.LEVEL_UPDATED,this.onLevelUpdated,this)},f.onMediaAttached=function(h,S){this.media=S.media},f.onMediaDetaching=function(){this.id3Track&&((0,F.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})},f.onManifestLoading=function(){this.dateRangeCuesAppended={}},f.createTrack=function(h){var S=this.getID3Track(h.textTracks);return S.mode="hidden",S},f.getID3Track=function(h){if(this.media){for(var S=0;S<h.length;S++){var k=h[S];if(k.kind==="metadata"&&k.label==="id3")return(0,F.sendAddTrackEvent)(k,this.media),k}return this.media.addTextTrack("metadata","id3")}},f.onFragParsingMetadata=function(h,S){if(this.media){var k=this.hls.config,m=k.enableEmsgMetadataCues,A=k.enableID3MetadataCues;if(!(!m&&!A)){var I=S.samples;this.id3Track||(this.id3Track=this.createTrack(this.media));for(var C=E(),P=0;P<I.length;P++){var l=I[P].type;if(!(l===L.MetadataSchema.emsg&&!m||!A)){var c=i.getID3Frames(I[P].data);if(c){var s=I[P].pts,g=s+I[P].duration;g>b&&(g=b);var R=g-s;R<=0&&(g=s+v);for(var D=0;D<c.length;D++){var x=c[D];if(!i.isTimeStampFrame(x)){this.updateId3CueEnds(s);var T=new C(s,g,"");T.value=x,l&&(T.type=l),this.id3Track.addCue(T)}}}}}}}},f.updateId3CueEnds=function(h){var S,k=(S=this.id3Track)===null||S===void 0?void 0:S.cues;if(k)for(var m=k.length;m--;){var A=k[m];A.startTime<h&&A.endTime===b&&(A.endTime=h)}},f.onBufferFlushing=function(h,S){var k=S.startOffset,m=S.endOffset,A=S.type,I=this.id3Track,C=this.hls;if(C){var P=C.config,l=P.enableEmsgMetadataCues,c=P.enableID3MetadataCues;if(I&&(l||c)){var s;A==="audio"?s=function(R){return R.type===L.MetadataSchema.audioId3&&c}:A==="video"?s=function(R){return R.type===L.MetadataSchema.emsg&&l}:s=function(R){return R.type===L.MetadataSchema.audioId3&&c||R.type===L.MetadataSchema.emsg&&l},(0,F.removeCuesInRange)(I,k,m,s)}}},f.onLevelUpdated=function(h,S){var k=this,m=S.details;if(!(!this.media||!m.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)){var A=this.dateRangeCuesAppended,I=this.id3Track,C=m.dateRanges,P=Object.keys(C);if(I)for(var l=Object.keys(A).filter(function(O){return!P.includes(O)}),c=function($){var H=l[$];Object.keys(A[H].cues).forEach(function(Z){I.removeCue(A[H].cues[Z])}),delete A[H]},s=l.length;s--;)c(s);var g=m.fragments[m.fragments.length-1];if(!(P.length===0||!(0,V.isFiniteNumber)(g==null?void 0:g.programDateTime))){this.id3Track||(this.id3Track=this.createTrack(this.media));for(var R=g.programDateTime/1e3-g.start,D=E(),x=function($){var H=P[$],Z=C[H],te=A[H],J=(te==null?void 0:te.cues)||{},ie=(te==null?void 0:te.durationKnown)||!1,oe=w(Z.startDate,R),ue=b,Pe=Z.endDate;if(Pe)ue=w(Pe,R),ie=!0;else if(Z.endOnNext&&!ie){var Ne=P.reduce(function(He,ht){var ft=C[ht];return ft.class===Z.class&&ft.id!==ht&&ft.startDate>Z.startDate&&He.push(ft),He},[]).sort(function(He,ht){return He.startDate.getTime()-ht.startDate.getTime()})[0];Ne&&(ue=w(Ne.startDate,R),ie=!0)}for(var Ve=Object.keys(Z.attr),ot=0;ot<Ve.length;ot++){var Et=Ve[ot];if(!(Et===U.DateRangeAttribute.ID||Et===U.DateRangeAttribute.CLASS||Et===U.DateRangeAttribute.START_DATE||Et===U.DateRangeAttribute.DURATION||Et===U.DateRangeAttribute.END_DATE||Et===U.DateRangeAttribute.END_ON_NEXT)){var it=J[Et];if(it)ie&&!te.durationKnown&&(it.endTime=ue);else{var Ie=Z.attr[Et];it=new D(oe,ue,""),(Et===U.DateRangeAttribute.SCTE35_OUT||Et===U.DateRangeAttribute.SCTE35_IN)&&(Ie=p(Ie)),it.value={key:Et,data:Ie},it.type=L.MetadataSchema.dateRange,k.id3Track.addCue(it),J[Et]=it}}}A[H]={cues:J,dateRange:Z,durationKnown:ie}},T=0;T<P.length;T++)x(T)}}},d}();const M=y},"./src/controller/latency-controller.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>E});var V=B("./src/errors.ts"),K=B("./src/events.ts"),F=B("./src/utils/logger.ts");function i(b,w){for(var p=0;p<w.length;p++){var y=w[p];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(b,L(y.key),y)}}function U(b,w,p){return w&&i(b.prototype,w),p&&i(b,p),Object.defineProperty(b,"prototype",{writable:!1}),b}function L(b){var w=v(b,"string");return typeof w=="symbol"?w:String(w)}function v(b,w){if(typeof b!="object"||b===null)return b;var p=b[Symbol.toPrimitive];if(p!==void 0){var y=p.call(b,w||"default");if(typeof y!="object")return y;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(b)}var E=function(){function b(p){var y=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return y.timeupdate()},this.hls=p,this.config=p.config,this.registerListeners()}var w=b.prototype;return w.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},w.registerListeners=function(){this.hls.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(K.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(K.Events.ERROR,this.onError,this)},w.unregisterListeners=function(){this.hls.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(K.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(K.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(K.Events.ERROR,this.onError)},w.onMediaAttached=function(y,M){this.media=M.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},w.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},w.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},w.onLevelUpdated=function(y,M){var d=M.details;this.levelDetails=d,d.advanced&&this.timeupdate(),!d.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},w.onError=function(y,M){M.details===V.ErrorDetails.BUFFER_STALLED_ERROR&&(this.stallCount++,F.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))},w.timeupdate=function(){var y=this.media,M=this.levelDetails;if(!(!y||!M)){this.currentTime=y.currentTime;var d=this.computeLatency();if(d!==null){this._latency=d;var f=this.config,u=f.lowLatencyMode,h=f.maxLiveSyncPlaybackRate;if(!(!u||h===1)){var S=this.targetLatency;if(S!==null){var k=d-S,m=Math.min(this.maxLatency,S+M.targetduration),A=k<m;if(M.live&&A&&k>.05&&this.forwardBufferLength>1){var I=Math.min(2,Math.max(1,h)),C=Math.round(2/(1+Math.exp(-.75*k-this.edgeStalled))*20)/20;y.playbackRate=Math.min(I,Math.max(1,C))}else y.playbackRate!==1&&y.playbackRate!==0&&(y.playbackRate=1)}}}}},w.estimateLiveEdge=function(){var y=this.levelDetails;return y===null?null:y.edge+y.age},w.computeLatency=function(){var y=this.estimateLiveEdge();return y===null?null:y-this.currentTime},U(b,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var y=this.config,M=this.levelDetails;return y.liveMaxLatencyDuration!==void 0?y.liveMaxLatencyDuration:M?y.liveMaxLatencyDurationCount*M.targetduration:0}},{key:"targetLatency",get:function(){var y=this.levelDetails;if(y===null)return null;var M=y.holdBack,d=y.partHoldBack,f=y.targetduration,u=this.config,h=u.liveSyncDuration,S=u.liveSyncDurationCount,k=u.lowLatencyMode,m=this.hls.userConfig,A=k&&d||M;(m.liveSyncDuration||m.liveSyncDurationCount||A===0)&&(A=h!==void 0?h:S*f);var I=f,C=1;return A+Math.min(this.stallCount*C,I)}},{key:"liveSyncPosition",get:function(){var y=this.estimateLiveEdge(),M=this.targetLatency,d=this.levelDetails;if(y===null||M===null||d===null)return null;var f=d.edge,u=y-M-this.edgeStalled,h=f-d.totalduration,S=f-(this.config.lowLatencyMode&&d.partTarget||d.targetduration);return Math.min(Math.max(h,u),S)}},{key:"drift",get:function(){var y=this.levelDetails;return y===null?1:y.drift}},{key:"edgeStalled",get:function(){var y=this.levelDetails;if(y===null)return 0;var M=(this.config.lowLatencyMode&&y.partTarget||y.targetduration)*3;return Math.max(y.age-M,0)}},{key:"forwardBufferLength",get:function(){var y=this.media,M=this.levelDetails;if(!y||!M)return 0;var d=y.buffered.length;return(d?y.buffered.end(d-1):M.edge)-this.currentTime}}]),b}()},"./src/controller/level-controller.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>u});var V=B("./src/types/level.ts"),K=B("./src/events.ts"),F=B("./src/errors.ts"),i=B("./src/utils/codecs.ts"),U=B("./src/controller/level-helper.ts"),L=B("./src/controller/base-playlist-controller.ts"),v=B("./src/types/loader.ts");function E(){return E=Object.assign?Object.assign.bind():function(h){for(var S=1;S<arguments.length;S++){var k=arguments[S];for(var m in k)Object.prototype.hasOwnProperty.call(k,m)&&(h[m]=k[m])}return h},E.apply(this,arguments)}function b(h,S){for(var k=0;k<S.length;k++){var m=S[k];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(h,p(m.key),m)}}function w(h,S,k){return S&&b(h.prototype,S),k&&b(h,k),Object.defineProperty(h,"prototype",{writable:!1}),h}function p(h){var S=y(h,"string");return typeof S=="symbol"?S:String(S)}function y(h,S){if(typeof h!="object"||h===null)return h;var k=h[Symbol.toPrimitive];if(k!==void 0){var m=k.call(h,S||"default");if(typeof m!="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(h)}function M(h,S){h.prototype=Object.create(S.prototype),h.prototype.constructor=h,d(h,S)}function d(h,S){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(m,A){return m.__proto__=A,m},d(h,S)}var f=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),u=function(h){M(S,h);function S(m){var A;return A=h.call(this,m,"[level-controller]")||this,A._levels=[],A._firstLevel=-1,A._startLevel=void 0,A.currentLevelIndex=-1,A.manualLevelIndex=-1,A.onParsedComplete=void 0,A._registerListeners(),A}var k=S.prototype;return k._registerListeners=function(){var A=this.hls;A.on(K.Events.MANIFEST_LOADED,this.onManifestLoaded,this),A.on(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.on(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),A.on(K.Events.FRAG_LOADED,this.onFragLoaded,this),A.on(K.Events.ERROR,this.onError,this)},k._unregisterListeners=function(){var A=this.hls;A.off(K.Events.MANIFEST_LOADED,this.onManifestLoaded,this),A.off(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.off(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),A.off(K.Events.FRAG_LOADED,this.onFragLoaded,this),A.off(K.Events.ERROR,this.onError,this)},k.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,h.prototype.destroy.call(this)},k.startLoad=function(){var A=this._levels;A.forEach(function(I){I.loadError=0}),h.prototype.startLoad.call(this)},k.onManifestLoaded=function(A,I){var C=[],P=[],l=[],c,s={},g,R=!1,D=!1,x=!1;if(I.levels.forEach(function(H){var Z=H.attrs;R=R||!!(H.width&&H.height),D=D||!!H.videoCodec,x=x||!!H.audioCodec,f&&H.audioCodec&&H.audioCodec.indexOf("mp4a.40.34")!==-1&&(H.audioCodec=void 0);var te=H.bitrate+"-"+H.attrs.RESOLUTION+"-"+H.attrs.CODECS;g=s[te],g?g.url.push(H.url):(g=new V.Level(H),s[te]=g,C.push(g)),Z&&(Z.AUDIO&&(0,U.addGroupId)(g,"audio",Z.AUDIO),Z.SUBTITLES&&(0,U.addGroupId)(g,"text",Z.SUBTITLES))}),(R||D)&&x&&(C=C.filter(function(H){var Z=H.videoCodec,te=H.width,J=H.height;return!!Z||!!(te&&J)})),C=C.filter(function(H){var Z=H.audioCodec,te=H.videoCodec;return(!Z||(0,i.isCodecSupportedInMp4)(Z,"audio"))&&(!te||(0,i.isCodecSupportedInMp4)(te,"video"))}),I.audioTracks&&(P=I.audioTracks.filter(function(H){return!H.audioCodec||(0,i.isCodecSupportedInMp4)(H.audioCodec,"audio")}),(0,U.assignTrackIdsByGroup)(P)),I.subtitles&&(l=I.subtitles,(0,U.assignTrackIdsByGroup)(l)),C.length>0){c=C[0].bitrate,C.sort(function(H,Z){return H.attrs["HDCP-LEVEL"]!==Z.attrs["HDCP-LEVEL"]?(H.attrs["HDCP-LEVEL"]||"")>(Z.attrs["HDCP-LEVEL"]||"")?1:-1:H.bitrate!==Z.bitrate?H.bitrate-Z.bitrate:H.attrs.SCORE!==Z.attrs.SCORE?H.attrs.decimalFloatingPoint("SCORE")-Z.attrs.decimalFloatingPoint("SCORE"):R&&H.height!==Z.height?H.height-Z.height:0}),this._levels=C;for(var T=0;T<C.length;T++)if(C[T].bitrate===c){this._firstLevel=T,this.log("manifest loaded, "+C.length+" level(s) found, first bitrate: "+c);break}var O=x&&!D,$={levels:C,audioTracks:P,subtitleTracks:l,sessionData:I.sessionData,sessionKeys:I.sessionKeys,firstLevel:this._firstLevel,stats:I.stats,audio:x,video:D,altAudio:!O&&P.some(function(H){return!!H.url})};this.hls.trigger(K.Events.MANIFEST_PARSED,$),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(K.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:I.url,reason:"no level with compatible codecs found in manifest"})},k.onError=function(A,I){var C,P;if(h.prototype.onError.call(this,A,I),!I.fatal){var l=I.context,c=this._levels[this.currentLevelIndex];if(l&&(l.type===v.PlaylistContextType.AUDIO_TRACK&&c.audioGroupIds&&l.groupId===c.audioGroupIds[c.urlId]||l.type===v.PlaylistContextType.SUBTITLE_TRACK&&c.textGroupIds&&l.groupId===c.textGroupIds[c.urlId])){this.redundantFailover(this.currentLevelIndex);return}var s=!1,g=!0,R;switch(I.details){case F.ErrorDetails.FRAG_LOAD_ERROR:case F.ErrorDetails.FRAG_LOAD_TIMEOUT:case F.ErrorDetails.KEY_LOAD_ERROR:case F.ErrorDetails.KEY_LOAD_TIMEOUT:if(I.frag){var D=I.frag.type===v.PlaylistLevelType.MAIN?I.frag.level:this.currentLevelIndex,x=this._levels[D];x?(x.fragmentError++,x.fragmentError>this.hls.config.fragLoadingMaxRetry&&(R=D)):R=D}break;case F.ErrorDetails.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{var T=c.attrs["HDCP-LEVEL"];T&&(this.hls.maxHdcpLevel=V.HdcpLevels[V.HdcpLevels.indexOf(T)-1],this.warn('Restricting playback to HDCP-LEVEL of "'+this.hls.maxHdcpLevel+'" or lower'))}case F.ErrorDetails.FRAG_PARSING_ERROR:case F.ErrorDetails.KEY_SYSTEM_NO_SESSION:R=((C=I.frag)===null||C===void 0?void 0:C.type)===v.PlaylistLevelType.MAIN?I.frag.level:this.currentLevelIndex,I.levelRetry=!1;break;case F.ErrorDetails.LEVEL_LOAD_ERROR:case F.ErrorDetails.LEVEL_LOAD_TIMEOUT:l&&(l.deliveryDirectives&&(g=!1),R=l.level),s=!0;break;case F.ErrorDetails.REMUX_ALLOC_ERROR:R=(P=I.level)!=null?P:this.currentLevelIndex,s=!0;break}R!==void 0&&this.recoverLevel(I,R,s,g)}},k.recoverLevel=function(A,I,C,P){var l=A.details,c=this._levels[I];if(c.loadError++,C){var s=this.retryLoadingOrFail(A);if(s)A.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(P){var g=c.url.length;if(g>1&&c.loadError<g)A.levelRetry=!0,this.redundantFailover(I);else if(this.manualLevelIndex===-1){for(var R=-1,D=this._levels,x=D.length;x--;){var T=(x+this.currentLevelIndex)%D.length;if(T!==this.currentLevelIndex&&D[T].loadError===0){R=T;break}}R>-1&&this.currentLevelIndex!==R?(this.warn(l+": switch to "+R),A.levelRetry=!0,this.hls.nextAutoLevel=R):A.levelRetry===!1&&(A.fatal=!0)}}},k.redundantFailover=function(A){var I=this._levels[A],C=I.url.length;if(C>1){var P=(I.urlId+1)%C;this.warn("Switching to redundant URL-id "+P),this._levels.forEach(function(l){l.urlId=P}),this.level=A}},k.onFragLoaded=function(A,I){var C=I.frag;if(C!==void 0&&C.type===v.PlaylistLevelType.MAIN){var P=this._levels[C.level];P!==void 0&&(P.fragmentError=0,P.loadError=0)}},k.onLevelLoaded=function(A,I){var C,P=I.level,l=I.details,c=this._levels[P];if(!c){var s;this.warn("Invalid level index "+P),(s=I.deliveryDirectives)!==null&&s!==void 0&&s.skip&&(l.deltaUpdateFailed=!0);return}P===this.currentLevelIndex?(c.fragmentError===0&&(c.loadError=0,this.retryCount=0),this.playlistLoaded(P,I,c.details)):(C=I.deliveryDirectives)!==null&&C!==void 0&&C.skip&&(l.deltaUpdateFailed=!0)},k.onAudioTrackSwitched=function(A,I){var C=this.hls.levels[this.currentLevelIndex];if(C&&C.audioGroupIds){for(var P=-1,l=this.hls.audioTracks[I.id].groupId,c=0;c<C.audioGroupIds.length;c++)if(C.audioGroupIds[c]===l){P=c;break}P!==C.urlId&&(C.urlId=P,this.startLoad())}},k.loadPlaylist=function(A){h.prototype.loadPlaylist.call(this);var I=this.currentLevelIndex,C=this._levels[I];if(this.canLoad&&C&&C.url.length>0){var P=C.urlId,l=C.url[P];if(A)try{l=A.addDirectives(l)}catch(c){this.warn("Could not construct new URL with HLS Delivery Directives: "+c)}this.log("Attempt loading level index "+I+((A==null?void 0:A.msn)!==void 0?" at sn "+A.msn+" part "+A.part:"")+" with URL-id "+P+" "+l),this.clearTimer(),this.hls.trigger(K.Events.LEVEL_LOADING,{url:l,level:I,id:P,deliveryDirectives:A||null})}},k.removeLevel=function(A,I){var C=function(c,s){return s!==I},P=this._levels.filter(function(l,c){return c!==A?!0:l.url.length>1&&I!==void 0?(l.url=l.url.filter(C),l.audioGroupIds&&(l.audioGroupIds=l.audioGroupIds.filter(C)),l.textGroupIds&&(l.textGroupIds=l.textGroupIds.filter(C)),l.urlId=0,!0):!1}).map(function(l,c){var s=l.details;return s!=null&&s.fragments&&s.fragments.forEach(function(g){g.level=c}),l});this._levels=P,this.hls.trigger(K.Events.LEVELS_UPDATED,{levels:P})},w(S,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(A){var I,C=this._levels;if(C.length!==0&&!(this.currentLevelIndex===A&&(I=C[A])!==null&&I!==void 0&&I.details)){if(A<0||A>=C.length){var P=A<0;if(this.hls.trigger(K.Events.ERROR,{type:F.ErrorTypes.OTHER_ERROR,details:F.ErrorDetails.LEVEL_SWITCH_ERROR,level:A,fatal:P,reason:"invalid level idx"}),P)return;A=Math.min(A,C.length-1)}this.clearTimer();var l=this.currentLevelIndex,c=C[l],s=C[A];this.log("switching to level "+A+" from "+l),this.currentLevelIndex=A;var g=E({},s,{level:A,maxBitrate:s.maxBitrate,uri:s.uri,urlId:s.urlId});delete g._urlId,this.hls.trigger(K.Events.LEVEL_SWITCHING,g);var R=s.details;if(!R||R.live){var D=this.switchParams(s.uri,c==null?void 0:c.details);this.loadPlaylist(D)}}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(A){this.manualLevelIndex=A,this._startLevel===void 0&&(this._startLevel=A),A!==-1&&(this.level=A)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(A){this._firstLevel=A}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var A=this.hls.config.startLevel;return A!==void 0?A:this._firstLevel}else return this._startLevel},set:function(A){this._startLevel=A}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(A){this.level=A,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=A)}}]),S}(L.default)},"./src/controller/level-helper.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{addGroupId:()=>U,addSliding:()=>f,adjustSliding:()=>d,assignTrackIdsByGroup:()=>L,computeReloadInterval:()=>u,getFragmentWithSN:()=>h,getPartWith:()=>S,mapFragmentIntersection:()=>M,mapPartIntersection:()=>y,mergeDetails:()=>w,updateFragPTSDTS:()=>b,updatePTS:()=>v});var V=B("./src/polyfills/number.ts"),K=B("./src/utils/logger.ts"),F=B("./src/loader/date-range.ts");function i(){return i=Object.assign?Object.assign.bind():function(k){for(var m=1;m<arguments.length;m++){var A=arguments[m];for(var I in A)Object.prototype.hasOwnProperty.call(A,I)&&(k[I]=A[I])}return k},i.apply(this,arguments)}function U(k,m,A){switch(m){case"audio":k.audioGroupIds||(k.audioGroupIds=[]),k.audioGroupIds.push(A);break;case"text":k.textGroupIds||(k.textGroupIds=[]),k.textGroupIds.push(A);break}}function L(k){var m={};k.forEach(function(A){var I=A.groupId||"";A.id=m[I]=m[I]||0,m[I]++})}function v(k,m,A){var I=k[m],C=k[A];E(I,C)}function E(k,m){var A=m.startPTS;if((0,V.isFiniteNumber)(A)){var I=0,C;m.sn>k.sn?(I=A-k.start,C=k):(I=k.start-A,C=m),C.duration!==I&&(C.duration=I)}else if(m.sn>k.sn){var P=k.cc===m.cc;P&&k.minEndPTS?m.start=k.start+(k.minEndPTS-k.start):m.start=k.start+k.duration}else m.start=Math.max(k.start-m.duration,0)}function b(k,m,A,I,C,P){var l=I-A;l<=0&&(K.logger.warn("Fragment should have a positive duration",m),I=A+m.duration,P=C+m.duration);var c=A,s=I,g=m.startPTS,R=m.endPTS;if((0,V.isFiniteNumber)(g)){var D=Math.abs(g-A);(0,V.isFiniteNumber)(m.deltaPTS)?m.deltaPTS=Math.max(D,m.deltaPTS):m.deltaPTS=D,c=Math.max(A,g),A=Math.min(A,g),C=Math.min(C,m.startDTS),s=Math.min(I,R),I=Math.max(I,R),P=Math.max(P,m.endDTS)}m.duration=I-A;var x=A-m.start;m.start=m.startPTS=A,m.maxStartPTS=c,m.startDTS=C,m.endPTS=I,m.minEndPTS=s,m.endDTS=P;var T=m.sn;if(!k||T<k.startSN||T>k.endSN)return 0;var O,$=T-k.startSN,H=k.fragments;for(H[$]=m,O=$;O>0;O--)E(H[O],H[O-1]);for(O=$;O<H.length-1;O++)E(H[O],H[O+1]);return k.fragmentHint&&E(H[H.length-1],k.fragmentHint),k.PTSKnown=k.alignedSliding=!0,x}function w(k,m){for(var A=null,I=k.fragments,C=I.length-1;C>=0;C--){var P=I[C].initSegment;if(P){A=P;break}}k.fragmentHint&&delete k.fragmentHint.endPTS;var l=0,c;if(M(k,m,function(O,$){O.relurl&&(l=O.cc-$.cc),(0,V.isFiniteNumber)(O.startPTS)&&(0,V.isFiniteNumber)(O.endPTS)&&($.start=$.startPTS=O.startPTS,$.startDTS=O.startDTS,$.appendedPTS=O.appendedPTS,$.maxStartPTS=O.maxStartPTS,$.endPTS=O.endPTS,$.endDTS=O.endDTS,$.minEndPTS=O.minEndPTS,$.duration=O.endPTS-O.startPTS,$.duration&&(c=$),m.PTSKnown=m.alignedSliding=!0),$.elementaryStreams=O.elementaryStreams,$.loader=O.loader,$.stats=O.stats,$.urlId=O.urlId,O.initSegment&&($.initSegment=O.initSegment,A=O.initSegment)}),A){var s=m.fragmentHint?m.fragments.concat(m.fragmentHint):m.fragments;s.forEach(function(O){var $;(!O.initSegment||O.initSegment.relurl===(($=A)===null||$===void 0?void 0:$.relurl))&&(O.initSegment=A)})}if(m.skippedSegments)if(m.deltaUpdateFailed=m.fragments.some(function(O){return!O}),m.deltaUpdateFailed){K.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var g=m.skippedSegments;g--;)m.fragments.shift();m.startSN=m.fragments[0].sn,m.startCC=m.fragments[0].cc}else m.canSkipDateRanges&&(m.dateRanges=p(k.dateRanges,m.dateRanges,m.recentlyRemovedDateranges));var R=m.fragments;if(l){K.logger.warn("discontinuity sliding from playlist, take drift into account");for(var D=0;D<R.length;D++)R[D].cc+=l}m.skippedSegments&&(m.startCC=m.fragments[0].cc),y(k.partList,m.partList,function(O,$){$.elementaryStreams=O.elementaryStreams,$.stats=O.stats}),c?b(m,c,c.startPTS,c.endPTS,c.startDTS,c.endDTS):d(k,m),R.length&&(m.totalduration=m.edge-R[0].start),m.driftStartTime=k.driftStartTime,m.driftStart=k.driftStart;var x=m.advancedDateTime;if(m.advanced&&x){var T=m.edge;m.driftStart||(m.driftStartTime=x,m.driftStart=T),m.driftEndTime=x,m.driftEnd=T}else m.driftEndTime=k.driftEndTime,m.driftEnd=k.driftEnd,m.advancedDateTime=k.advancedDateTime}function p(k,m,A){var I=i({},k);return A&&A.forEach(function(C){delete I[C]}),Object.keys(m).forEach(function(C){var P=new F.DateRange(m[C].attr,I[C]);P.isValid?I[C]=P:K.logger.warn('Ignoring invalid Playlist Delta Update DATERANGE tag: "'+JSON.stringify(m[C].attr)+'"')}),I}function y(k,m,A){if(k&&m)for(var I=0,C=0,P=k.length;C<=P;C++){var l=k[C],c=m[C+I];l&&c&&l.index===c.index&&l.fragment.sn===c.fragment.sn?A(l,c):I--}}function M(k,m,A){for(var I=m.skippedSegments,C=Math.max(k.startSN,m.startSN)-m.startSN,P=(k.fragmentHint?1:0)+(I?m.endSN:Math.min(k.endSN,m.endSN))-m.startSN,l=m.startSN-k.startSN,c=m.fragmentHint?m.fragments.concat(m.fragmentHint):m.fragments,s=k.fragmentHint?k.fragments.concat(k.fragmentHint):k.fragments,g=C;g<=P;g++){var R=s[l+g],D=c[g];I&&!D&&g<I&&(D=m.fragments[g]=R),R&&D&&A(R,D)}}function d(k,m){var A=m.startSN+m.skippedSegments-k.startSN,I=k.fragments;A<0||A>=I.length||f(m,I[A].start)}function f(k,m){if(m){for(var A=k.fragments,I=k.skippedSegments;I<A.length;I++)A[I].start+=m;k.fragmentHint&&(k.fragmentHint.start+=m)}}function u(k,m){m===void 0&&(m=1/0);var A=1e3*k.targetduration;if(k.updated){var I=k.fragments,C=4;if(I.length&&A*C>m){var P=I[I.length-1].duration*1e3;P<A&&(A=P)}}else A/=2;return Math.round(A)}function h(k,m,A){if(!k||!k.details)return null;var I=k.details,C=I.fragments[m-I.startSN];return C||(C=I.fragmentHint,C&&C.sn===m)?C:m<I.startSN&&A&&A.sn===m?A:null}function S(k,m,A){if(!k||!k.details)return null;var I=k.details.partList;if(I)for(var C=I.length;C--;){var P=I[C];if(P.index===A&&P.fragment.sn===m)return P}return null}},"./src/controller/stream-controller.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>m});var V=B("./src/polyfills/number.ts"),K=B("./src/controller/base-stream-controller.ts"),F=B("./src/is-supported.ts"),i=B("./src/events.ts"),U=B("./src/utils/buffer-helper.ts"),L=B("./src/controller/fragment-tracker.ts"),v=B("./src/types/loader.ts"),E=B("./src/loader/fragment.ts"),b=B("./src/demux/transmuxer-interface.ts"),w=B("./src/types/transmuxer.ts"),p=B("./src/controller/gap-controller.ts"),y=B("./src/errors.ts");function M(A,I){for(var C=0;C<I.length;C++){var P=I[C];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(A,f(P.key),P)}}function d(A,I,C){return I&&M(A.prototype,I),C&&M(A,C),Object.defineProperty(A,"prototype",{writable:!1}),A}function f(A){var I=u(A,"string");return typeof I=="symbol"?I:String(I)}function u(A,I){if(typeof A!="object"||A===null)return A;var C=A[Symbol.toPrimitive];if(C!==void 0){var P=C.call(A,I||"default");if(typeof P!="object")return P;throw new TypeError("@@toPrimitive must return a primitive value.")}return(I==="string"?String:Number)(A)}function h(A,I){A.prototype=Object.create(I.prototype),A.prototype.constructor=A,S(A,I)}function S(A,I){return S=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(P,l){return P.__proto__=l,P},S(A,I)}var k=100,m=function(A){h(I,A);function I(P,l,c){var s;return s=A.call(this,P,l,c,"[stream-controller]")||this,s.audioCodecSwap=!1,s.gapController=null,s.level=-1,s._forceStartLoad=!1,s.altAudio=!1,s.audioOnly=!1,s.fragPlaying=null,s.onvplaying=null,s.onvseeked=null,s.fragLastKbps=0,s.couldBacktrack=!1,s.backtrackFragment=null,s.audioCodecSwitch=!1,s.videoBuffer=null,s._registerListeners(),s}var C=I.prototype;return C._registerListeners=function(){var l=this.hls;l.on(i.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.on(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.on(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(i.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.on(i.Events.LEVEL_LOADING,this.onLevelLoading,this),l.on(i.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.on(i.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),l.on(i.Events.ERROR,this.onError,this),l.on(i.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),l.on(i.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),l.on(i.Events.BUFFER_CREATED,this.onBufferCreated,this),l.on(i.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),l.on(i.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),l.on(i.Events.FRAG_BUFFERED,this.onFragBuffered,this)},C._unregisterListeners=function(){var l=this.hls;l.off(i.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.off(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.off(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(i.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.off(i.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.off(i.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),l.off(i.Events.ERROR,this.onError,this),l.off(i.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),l.off(i.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),l.off(i.Events.BUFFER_CREATED,this.onBufferCreated,this),l.off(i.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),l.off(i.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),l.off(i.Events.FRAG_BUFFERED,this.onFragBuffered,this)},C.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},C.startLoad=function(l){if(this.levels){var c=this.lastCurrentTime,s=this.hls;if(this.stopLoad(),this.setInterval(k),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var g=s.startLevel;g===-1&&(s.config.testBandwidth&&this.levels.length>1?(g=0,this.bitrateTest=!0):g=s.nextAutoLevel),this.level=s.nextLoadLevel=g,this.loadedmetadata=!1}c>0&&l===-1&&(this.log("Override startPosition with lastCurrentTime @"+c.toFixed(3)),l=c),this.state=K.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=l,this.tick()}else this._forceStartLoad=!0,this.state=K.State.STOPPED},C.stopLoad=function(){this._forceStartLoad=!1,A.prototype.stopLoad.call(this)},C.doTick=function(){switch(this.state){case K.State.IDLE:this.doTickIdle();break;case K.State.WAITING_LEVEL:{var l,c=this.levels,s=this.level,g=c==null||(l=c[s])===null||l===void 0?void 0:l.details;if(g&&(!g.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(g))break;this.state=K.State.IDLE;break}break}case K.State.FRAG_LOADING_WAITING_RETRY:{var R,D=self.performance.now(),x=this.retryDate;(!x||D>=x||(R=this.media)!==null&&R!==void 0&&R.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.level),this.state=K.State.IDLE)}break;default:break}this.onTickEnd()},C.onTickEnd=function(){A.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},C.doTickIdle=function(){var l=this.hls,c=this.levelLastLoaded,s=this.levels,g=this.media,R=l.config,D=l.nextLoadLevel;if(!(c===null||!g&&(this.startFragRequested||!R.startFragPrefetch))&&!(this.altAudio&&this.audioOnly)&&!(!s||!s[D])){var x=s[D],T=this.getMainFwdBufferInfo();if(T!==null){var O=this.getLevelDetails();if(O&&this._streamEnded(T,O)){var $={};this.altAudio&&($.type="video"),this.hls.trigger(i.Events.BUFFER_EOS,$),this.state=K.State.ENDED;return}this.level=l.nextLoadLevel=D;var H=x.details;if(!H||this.state===K.State.WAITING_LEVEL||H.live&&this.levelLastLoaded!==D){this.level=D,this.state=K.State.WAITING_LEVEL;return}var Z=T.len,te=this.getMaxBufferLength(x.maxBitrate);if(!(Z>=te)){this.backtrackFragment&&this.backtrackFragment.start>T.end&&(this.backtrackFragment=null);var J=this.backtrackFragment?this.backtrackFragment.start:T.end,ie=this.getNextFragment(J,H);if(this.couldBacktrack&&!this.fragPrevious&&ie&&ie.sn!=="initSegment"&&this.fragmentTracker.getState(ie)!==L.FragmentState.OK){var oe,ue=((oe=this.backtrackFragment)!=null?oe:ie).sn,Pe=ue-H.startSN,Ne=H.fragments[Pe-1];Ne&&ie.cc===Ne.cc&&(ie=Ne,this.fragmentTracker.removeFragment(Ne))}else this.backtrackFragment&&T.len&&(this.backtrackFragment=null);if(ie&&this.fragmentTracker.getState(ie)===L.FragmentState.OK&&this.nextLoadPosition>J){var Ve=this.audioOnly&&!this.altAudio?E.ElementaryStreamTypes.AUDIO:E.ElementaryStreamTypes.VIDEO,ot=(Ve===E.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;ot&&this.afterBufferFlushed(ot,Ve,v.PlaylistLevelType.MAIN),ie=this.getNextFragment(this.nextLoadPosition,H)}ie&&(ie.initSegment&&!ie.initSegment.data&&!this.bitrateTest&&(ie=ie.initSegment),this.loadFragment(ie,H,J))}}}},C.loadFragment=function(l,c,s){var g,R=this.fragmentTracker.getState(l);this.fragCurrent=l,R===L.FragmentState.NOT_LOADED?l.sn==="initSegment"?this._loadInitSegment(l,c):this.bitrateTest?(this.log("Fragment "+l.sn+" of level "+l.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(l,c)):(this.startFragRequested=!0,A.prototype.loadFragment.call(this,l,c,s)):R===L.FragmentState.APPENDING?this.reduceMaxBufferLength(l.duration)&&this.fragmentTracker.removeFragment(l):((g=this.media)===null||g===void 0?void 0:g.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},C.getAppendedFrag=function(l){var c=this.fragmentTracker.getAppendedFrag(l,v.PlaylistLevelType.MAIN);return c&&"fragment"in c?c.fragment:c},C.getBufferedFrag=function(l){return this.fragmentTracker.getBufferedFrag(l,v.PlaylistLevelType.MAIN)},C.followingBufferedFrag=function(l){return l?this.getBufferedFrag(l.end+.5):null},C.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},C.nextLevelSwitch=function(){var l=this.levels,c=this.media;if(c!=null&&c.readyState){var s,g=this.getAppendedFrag(c.currentTime);if(g&&g.start>1&&this.flushMainBuffer(0,g.start-1),!c.paused&&l){var R=this.hls.nextLoadLevel,D=l[R],x=this.fragLastKbps;x&&this.fragCurrent?s=this.fragCurrent.duration*D.maxBitrate/(1e3*x)+1:s=0}else s=0;var T=this.getBufferedFrag(c.currentTime+s);if(T){var O=this.followingBufferedFrag(T);if(O){this.abortCurrentFrag();var $=O.maxStartPTS?O.maxStartPTS:O.start,H=O.duration,Z=Math.max(T.end,$+Math.min(Math.max(H-this.config.maxFragLookUpTolerance,H*.5),H*.75));this.flushMainBuffer(Z,Number.POSITIVE_INFINITY)}}}},C.abortCurrentFrag=function(){var l=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,l&&l.abortRequests(),this.state){case K.State.KEY_LOADING:case K.State.FRAG_LOADING:case K.State.FRAG_LOADING_WAITING_RETRY:case K.State.PARSING:case K.State.PARSED:this.state=K.State.IDLE;break}this.nextLoadPosition=this.getLoadPosition()},C.flushMainBuffer=function(l,c){A.prototype.flushMainBuffer.call(this,l,c,this.altAudio?"video":null)},C.onMediaAttached=function(l,c){A.prototype.onMediaAttached.call(this,l,c);var s=c.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),s.addEventListener("playing",this.onvplaying),s.addEventListener("seeked",this.onvseeked),this.gapController=new p.default(this.config,s,this.fragmentTracker,this.hls)},C.onMediaDetaching=function(){var l=this.media;l&&this.onvplaying&&this.onvseeked&&(l.removeEventListener("playing",this.onvplaying),l.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),A.prototype.onMediaDetaching.call(this)},C.onMediaPlaying=function(){this.tick()},C.onMediaSeeked=function(){var l=this.media,c=l?l.currentTime:null;(0,V.isFiniteNumber)(c)&&this.log("Media seeked to "+c.toFixed(3)),this.tick()},C.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(i.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null,this.backtrackFragment=null},C.onManifestParsed=function(l,c){var s=!1,g=!1,R;c.levels.forEach(function(D){R=D.audioCodec,R&&(R.indexOf("mp4a.40.2")!==-1&&(s=!0),R.indexOf("mp4a.40.5")!==-1&&(g=!0))}),this.audioCodecSwitch=s&&g&&!(0,F.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=c.levels,this.startFragRequested=!1},C.onLevelLoading=function(l,c){var s=this.levels;if(!(!s||this.state!==K.State.IDLE)){var g=s[c.level];(!g.details||g.details.live&&this.levelLastLoaded!==c.level||this.waitForCdnTuneIn(g.details))&&(this.state=K.State.WAITING_LEVEL)}},C.onLevelLoaded=function(l,c){var s,g=this.levels,R=c.level,D=c.details,x=D.totalduration;if(!g){this.warn("Levels were reset while loading level "+R);return}this.log("Level "+R+" loaded ["+D.startSN+","+D.endSN+"], cc ["+D.startCC+", "+D.endCC+"] duration:"+x);var T=this.fragCurrent;T&&(this.state===K.State.FRAG_LOADING||this.state===K.State.FRAG_LOADING_WAITING_RETRY)&&T.level!==c.level&&T.loader&&(this.state=K.State.IDLE,this.backtrackFragment=null,T.abortRequests());var O=g[R],$=0;if(D.live||(s=O.details)!==null&&s!==void 0&&s.live){if(D.fragments[0]||(D.deltaUpdateFailed=!0),D.deltaUpdateFailed)return;$=this.alignPlaylists(D,O.details)}if(O.details=D,this.levelLastLoaded=R,this.hls.trigger(i.Events.LEVEL_UPDATED,{details:D,level:R}),this.state===K.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(D))return;this.state=K.State.IDLE}this.startFragRequested?D.live&&this.synchronizeToLiveEdge(D):this.setStartPosition(D,$),this.tick()},C._handleFragmentLoadProgress=function(l){var c,s=l.frag,g=l.part,R=l.payload,D=this.levels;if(!D){this.warn("Levels were reset while fragment load was in progress. Fragment "+s.sn+" of level "+s.level+" will not be buffered");return}var x=D[s.level],T=x.details;if(!T){this.warn("Dropping fragment "+s.sn+" of level "+s.level+" after level details were reset");return}var O=x.videoCodec,$=T.PTSKnown||!T.live,H=(c=s.initSegment)===null||c===void 0?void 0:c.data,Z=this._getAudioCodec(x),te=this.transmuxer=this.transmuxer||new b.default(this.hls,v.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),J=g?g.index:-1,ie=J!==-1,oe=new w.ChunkMetadata(s.level,s.sn,s.stats.chunkCount,R.byteLength,J,ie),ue=this.initPTS[s.cc];te.push(R,H,Z,O,s,g,T.totalduration,$,oe,ue)},C.onAudioTrackSwitching=function(l,c){var s=this.altAudio,g=!!c.url,R=c.id;if(!g){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var D=this.fragCurrent;D&&(this.log("Switching to main audio track, cancel main fragment load"),D.abortRequests()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var x=this.hls;s&&x.trigger(i.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),x.trigger(i.Events.AUDIO_TRACK_SWITCHED,{id:R})}},C.onAudioTrackSwitched=function(l,c){var s=c.id,g=!!this.hls.audioTracks[s].url;if(g){var R=this.videoBuffer;R&&this.mediaBuffer!==R&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=R)}this.altAudio=g,this.tick()},C.onBufferCreated=function(l,c){var s=c.tracks,g,R,D=!1;for(var x in s){var T=s[x];if(T.id==="main"){if(R=x,g=T,x==="video"){var O=s[x];O&&(this.videoBuffer=O.buffer)}}else D=!0}D&&g?(this.log("Alternate track found, use "+R+".buffered to schedule main fragment loading"),this.mediaBuffer=g.buffer):this.mediaBuffer=this.media},C.onFragBuffered=function(l,c){var s=c.frag,g=c.part;if(!(s&&s.type!==v.PlaylistLevelType.MAIN)){if(this.fragContextChanged(s)){this.warn("Fragment "+s.sn+(g?" p: "+g.index:"")+" of level "+s.level+" finished buffering, but was aborted. state: "+this.state),this.state===K.State.PARSED&&(this.state=K.State.IDLE);return}var R=g?g.stats:s.stats;this.fragLastKbps=Math.round(8*R.total/(R.buffering.end-R.loading.first)),s.sn!=="initSegment"&&(this.fragPrevious=s),this.fragBufferedComplete(s,g)}},C.onError=function(l,c){if(c.type===y.ErrorTypes.KEY_SYSTEM_ERROR){this.onFragmentOrKeyLoadError(v.PlaylistLevelType.MAIN,c);return}switch(c.details){case y.ErrorDetails.FRAG_LOAD_ERROR:case y.ErrorDetails.FRAG_LOAD_TIMEOUT:case y.ErrorDetails.FRAG_PARSING_ERROR:case y.ErrorDetails.KEY_LOAD_ERROR:case y.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(v.PlaylistLevelType.MAIN,c);break;case y.ErrorDetails.LEVEL_LOAD_ERROR:case y.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==K.State.ERROR&&(c.fatal?(this.warn(""+c.details),this.state=K.State.ERROR):!c.levelRetry&&this.state===K.State.WAITING_LEVEL&&(this.state=K.State.IDLE));break;case y.ErrorDetails.BUFFER_FULL_ERROR:if(c.parent==="main"&&(this.state===K.State.PARSING||this.state===K.State.PARSED)){var s=!0,g=this.getFwdBufferInfo(this.media,v.PlaylistLevelType.MAIN);g&&g.len>.5&&(s=!this.reduceMaxBufferLength(g.len)),s&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},C.checkBuffer=function(){var l=this.media,c=this.gapController;if(!(!l||!c||!l.readyState)){if(this.loadedmetadata||!U.BufferHelper.getBuffered(l).length){var s=this.state!==K.State.IDLE?this.fragCurrent:null;c.poll(this.lastCurrentTime,s)}this.lastCurrentTime=l.currentTime}},C.onFragLoadEmergencyAborted=function(){this.state=K.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},C.onBufferFlushed=function(l,c){var s=c.type;if(s!==E.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var g=(s===E.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(g,s,v.PlaylistLevelType.MAIN)}},C.onLevelsUpdated=function(l,c){this.levels=c.levels},C.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},C.seekToStartPos=function(){var l=this.media;if(l){var c=l.currentTime,s=this.startPosition;if(s>=0&&c<s){if(l.seeking){this.log("could not seek to "+s+", already seeking at "+c);return}var g=U.BufferHelper.getBuffered(l),R=g.length?g.start(0):0,D=R-s;D>0&&(D<this.config.maxBufferHole||D<this.config.maxFragLookUpTolerance)&&(this.log("adjusting start position by "+D+" to match buffer start"),s+=D,this.startPosition=s),this.log("seek to target start position "+s+" from current time "+c),l.currentTime=s}}},C._getAudioCodec=function(l){var c=this.config.defaultAudioCodec||l.audioCodec;return this.audioCodecSwap&&c&&(this.log("Swapping audio codec"),c.indexOf("mp4a.40.5")!==-1?c="mp4a.40.2":c="mp4a.40.5"),c},C._loadBitrateTestFrag=function(l,c){var s=this;l.bitrateTest=!0,this._doFragLoad(l,c).then(function(g){var R=s.hls;if(!(!g||s.fragContextChanged(l))){s.fragLoadError=0,s.state=K.State.IDLE,s.startFragRequested=!1,s.bitrateTest=!1;var D=l.stats;D.parsing.start=D.parsing.end=D.buffering.start=D.buffering.end=self.performance.now(),R.trigger(i.Events.FRAG_LOADED,g),l.bitrateTest=!1}})},C._handleTransmuxComplete=function(l){var c,s="main",g=this.hls,R=l.remuxResult,D=l.chunkMeta,x=this.getCurrentContext(D);if(!x){this.warn("The loading context changed while buffering fragment "+D.sn+" of level "+D.level+". This chunk will not be buffered."),this.resetStartWhenNotLoaded(D.level);return}var T=x.frag,O=x.part,$=x.level,H=R.video,Z=R.text,te=R.id3,J=R.initSegment,ie=$.details,oe=this.altAudio?void 0:R.audio;if(!this.fragContextChanged(T)){if(this.state=K.State.PARSING,J){J.tracks&&(this._bufferInitSegment($,J.tracks,T,D),g.trigger(i.Events.FRAG_PARSING_INIT_SEGMENT,{frag:T,id:s,tracks:J.tracks}));var ue=J.initPTS,Pe=J.timescale;(0,V.isFiniteNumber)(ue)&&(this.initPTS[T.cc]=ue,g.trigger(i.Events.INIT_PTS_FOUND,{frag:T,id:s,initPTS:ue,timescale:Pe}))}if(H&&R.independent!==!1){if(ie){var Ne=H.startPTS,Ve=H.endPTS,ot=H.startDTS,Et=H.endDTS;if(O)O.elementaryStreams[H.type]={startPTS:Ne,endPTS:Ve,startDTS:ot,endDTS:Et};else if(H.firstKeyFrame&&H.independent&&D.id===1&&(this.couldBacktrack=!0),H.dropped&&H.independent){var it=this.getMainFwdBufferInfo(),Ie=(it?it.end:this.getLoadPosition())+this.config.maxBufferHole,He=H.firstKeyFramePTS?H.firstKeyFramePTS:Ne;if(Ie<He-this.config.maxBufferHole){this.backtrack(T);return}T.setElementaryStreamInfo(H.type,T.start,Ve,T.start,Et,!0)}T.setElementaryStreamInfo(H.type,Ne,Ve,ot,Et),this.backtrackFragment&&(this.backtrackFragment=T),this.bufferFragmentData(H,T,O,D)}}else if(R.independent===!1){this.backtrack(T);return}if(oe){var ht=oe.startPTS,ft=oe.endPTS,dt=oe.startDTS,se=oe.endDTS;O&&(O.elementaryStreams[E.ElementaryStreamTypes.AUDIO]={startPTS:ht,endPTS:ft,startDTS:dt,endDTS:se}),T.setElementaryStreamInfo(E.ElementaryStreamTypes.AUDIO,ht,ft,dt,se),this.bufferFragmentData(oe,T,O,D)}if(ie&&te!==null&&te!==void 0&&(c=te.samples)!==null&&c!==void 0&&c.length){var De={id:s,frag:T,details:ie,samples:te.samples};g.trigger(i.Events.FRAG_PARSING_METADATA,De)}if(ie&&Z){var ze={id:s,frag:T,details:ie,samples:Z.samples};g.trigger(i.Events.FRAG_PARSING_USERDATA,ze)}}},C._bufferInitSegment=function(l,c,s,g){var R=this;if(this.state===K.State.PARSING){this.audioOnly=!!c.audio&&!c.video,this.altAudio&&!this.audioOnly&&delete c.audio;var D=c.audio,x=c.video,T=c.audiovideo;if(D){var O=l.audioCodec,$=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(O&&(O.indexOf("mp4a.40.5")!==-1?O="mp4a.40.2":O="mp4a.40.5"),D.metadata.channelCount!==1&&$.indexOf("firefox")===-1&&(O="mp4a.40.5")),$.indexOf("android")!==-1&&D.container!=="audio/mpeg"&&(O="mp4a.40.2",this.log("Android: force audio codec to "+O)),l.audioCodec&&l.audioCodec!==O&&this.log('Swapping manifest audio codec "'+l.audioCodec+'" for "'+O+'"'),D.levelCodec=O,D.id="main",this.log("Init audio buffer, container:"+D.container+", codecs[selected/level/parsed]=["+(O||"")+"/"+(l.audioCodec||"")+"/"+D.codec+"]")}x&&(x.levelCodec=l.videoCodec,x.id="main",this.log("Init video buffer, container:"+x.container+", codecs[level/parsed]=["+(l.videoCodec||"")+"/"+x.codec+"]")),T&&this.log("Init audiovideo buffer, container:"+T.container+", codecs[level/parsed]=["+(l.attrs.CODECS||"")+"/"+T.codec+"]"),this.hls.trigger(i.Events.BUFFER_CODECS,c),Object.keys(c).forEach(function(H){var Z=c[H],te=Z.initSegment;te!=null&&te.byteLength&&R.hls.trigger(i.Events.BUFFER_APPENDING,{type:H,data:te,frag:s,part:null,chunkMeta:g,parent:s.type})}),this.tick()}},C.getMainFwdBufferInfo=function(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,v.PlaylistLevelType.MAIN)},C.backtrack=function(l){this.couldBacktrack=!0,this.backtrackFragment=l,this.resetTransmuxer(),this.flushBufferGap(l),this.fragmentTracker.removeFragment(l),this.fragPrevious=null,this.nextLoadPosition=l.start,this.state=K.State.IDLE},C.checkFragmentChanged=function(){var l=this.media,c=null;if(l&&l.readyState>1&&l.seeking===!1){var s=l.currentTime;if(U.BufferHelper.isBuffered(l,s)?c=this.getAppendedFrag(s):U.BufferHelper.isBuffered(l,s+.1)&&(c=this.getAppendedFrag(s+.1)),c){this.backtrackFragment=null;var g=this.fragPlaying,R=c.level;(!g||c.sn!==g.sn||g.level!==R||c.urlId!==g.urlId)&&(this.fragPlaying=c,this.hls.trigger(i.Events.FRAG_CHANGED,{frag:c}),(!g||g.level!==R)&&this.hls.trigger(i.Events.LEVEL_SWITCHED,{level:R}))}}},d(I,[{key:"nextLevel",get:function(){var l=this.nextBufferedFrag;return l?l.level:-1}},{key:"currentFrag",get:function(){var l=this.media;return l?this.fragPlaying||this.getAppendedFrag(l.currentTime):null}},{key:"currentProgramDateTime",get:function(){var l=this.media;if(l){var c=l.currentTime,s=this.currentFrag;if(s&&(0,V.isFiniteNumber)(c)&&(0,V.isFiniteNumber)(s.programDateTime)){var g=s.programDateTime+(c-s.start)*1e3;return new Date(g)}}return null}},{key:"currentLevel",get:function(){var l=this.currentFrag;return l?l.level:-1}},{key:"nextBufferedFrag",get:function(){var l=this.currentFrag;return l?this.followingBufferedFrag(l):null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),I}(K.default)},"./src/controller/subtitle-stream-controller.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{SubtitleStreamController:()=>h});var V=B("./src/events.ts"),K=B("./src/utils/buffer-helper.ts"),F=B("./src/controller/fragment-finders.ts"),i=B("./src/utils/discontinuities.ts"),U=B("./src/controller/level-helper.ts"),L=B("./src/controller/fragment-tracker.ts"),v=B("./src/controller/base-stream-controller.ts"),E=B("./src/types/loader.ts"),b=B("./src/types/level.ts");function w(k,m){for(var A=0;A<m.length;A++){var I=m[A];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(k,y(I.key),I)}}function p(k,m,A){return m&&w(k.prototype,m),A&&w(k,A),Object.defineProperty(k,"prototype",{writable:!1}),k}function y(k){var m=M(k,"string");return typeof m=="symbol"?m:String(m)}function M(k,m){if(typeof k!="object"||k===null)return k;var A=k[Symbol.toPrimitive];if(A!==void 0){var I=A.call(k,m||"default");if(typeof I!="object")return I;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(k)}function d(k,m){k.prototype=Object.create(m.prototype),k.prototype.constructor=k,f(k,m)}function f(k,m){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(I,C){return I.__proto__=C,I},f(k,m)}var u=500,h=function(k){d(m,k);function m(I,C,P){var l;return l=k.call(this,I,C,P,"[subtitle-stream-controller]")||this,l.levels=[],l.currentTrackId=-1,l.tracksBuffered=[],l.mainDetails=null,l._registerListeners(),l}var A=m.prototype;return A.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},A._registerListeners=function(){var C=this.hls;C.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.on(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),C.on(V.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.on(V.Events.ERROR,this.onError,this),C.on(V.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),C.on(V.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),C.on(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),C.on(V.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),C.on(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),C.on(V.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A._unregisterListeners=function(){var C=this.hls;C.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.off(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),C.off(V.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.off(V.Events.ERROR,this.onError,this),C.off(V.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),C.off(V.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),C.off(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),C.off(V.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),C.off(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),C.off(V.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A.startLoad=function(C){this.stopLoad(),this.state=v.State.IDLE,this.setInterval(u),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=C,this.tick()},A.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},A.onLevelLoaded=function(C,P){this.mainDetails=P.details},A.onSubtitleFragProcessed=function(C,P){var l=P.frag,c=P.success;if(this.fragPrevious=l,this.state=v.State.IDLE,!!c){var s=this.tracksBuffered[this.currentTrackId];if(s){for(var g,R=l.start,D=0;D<s.length;D++)if(R>=s[D].start&&R<=s[D].end){g=s[D];break}var x=l.start+l.duration;g?g.end=x:(g={start:R,end:x},s.push(g)),this.fragmentTracker.fragBuffered(l)}}},A.onBufferFlushing=function(C,P){var l=P.startOffset,c=P.endOffset;if(l===0&&c!==Number.POSITIVE_INFINITY){var s=this.currentTrackId,g=this.levels;if(!g.length||!g[s]||!g[s].details)return;var R=g[s].details,D=R.targetduration,x=c-D;if(x<=0)return;P.endOffsetSubtitles=Math.max(0,x),this.tracksBuffered.forEach(function(T){for(var O=0;O<T.length;){if(T[O].end<=x){T.shift();continue}else if(T[O].start<x)T[O].start=x;else break;O++}}),this.fragmentTracker.removeFragmentsInRange(l,x,E.PlaylistLevelType.SUBTITLE)}},A.onFragBuffered=function(C,P){if(!this.loadedmetadata&&P.frag.type===E.PlaylistLevelType.MAIN){var l;(l=this.media)!==null&&l!==void 0&&l.buffered.length&&(this.loadedmetadata=!0)}},A.onError=function(C,P){var l=P.frag;!l||l.type!==E.PlaylistLevelType.SUBTITLE||(this.fragCurrent&&this.fragCurrent.abortRequests(),this.state=v.State.IDLE)},A.onSubtitleTracksUpdated=function(C,P){var l=this,c=P.subtitleTracks;this.tracksBuffered=[],this.levels=c.map(function(s){return new b.Level(s)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(s){l.tracksBuffered[s.id]=[]}),this.mediaBuffer=null},A.onSubtitleTrackSwitch=function(C,P){if(this.currentTrackId=P.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var l=this.levels[this.currentTrackId];l!=null&&l.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,l&&this.setInterval(u)},A.onSubtitleTrackLoaded=function(C,P){var l,c=P.details,s=P.id,g=this.currentTrackId,R=this.levels;if(R.length){var D=R[g];if(!(s>=R.length||s!==g||!D)){this.mediaBuffer=this.mediaBufferTimeRanges;var x=0;if(c.live||(l=D.details)!==null&&l!==void 0&&l.live){var T=this.mainDetails;if(c.deltaUpdateFailed||!T)return;var O=T.fragments[0];D.details?(x=this.alignPlaylists(c,D.details),x===0&&O&&(x=O.start,(0,U.addSliding)(c,x))):c.hasProgramDateTime&&T.hasProgramDateTime?((0,i.alignMediaPlaylistByPDT)(c,T),x=c.fragments[0].start):O&&(x=O.start,(0,U.addSliding)(c,x))}if(D.details=c,this.levelLastLoaded=s,!this.startFragRequested&&(this.mainDetails||!c.live)&&this.setStartPosition(D.details,x),this.tick(),c.live&&!this.fragCurrent&&this.media&&this.state===v.State.IDLE){var $=(0,F.findFragmentByPTS)(null,c.fragments,this.media.currentTime,0);$||(this.warn("Subtitle playlist not aligned with playback"),D.details=void 0)}}}},A._handleFragmentLoadComplete=function(C){var P=this,l=C.frag,c=C.payload,s=l.decryptdata,g=this.hls;if(!this.fragContextChanged(l)&&c&&c.byteLength>0&&s&&s.key&&s.iv&&s.method==="AES-128"){var R=performance.now();this.decrypter.decrypt(new Uint8Array(c),s.key.buffer,s.iv.buffer).then(function(D){var x=performance.now();g.trigger(V.Events.FRAG_DECRYPTED,{frag:l,payload:D,stats:{tstart:R,tdecrypt:x}})}).catch(function(D){P.warn(D.name+": "+D.message),P.state=v.State.IDLE})}},A.doTick=function(){if(!this.media){this.state=v.State.IDLE;return}if(this.state===v.State.IDLE){var C=this.currentTrackId,P=this.levels;if(!P.length||!P[C]||!P[C].details)return;var l=P[C].details,c=l.targetduration,s=this.config,g=this.getLoadPosition(),R=K.BufferHelper.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],g-c,s.maxBufferHole),D=R.end,x=R.len,T=this.getFwdBufferInfo(this.media,E.PlaylistLevelType.MAIN),O=this.getMaxBufferLength(T==null?void 0:T.len)+c;if(x>O)return;console.assert(l,"Subtitle track details are defined on idle subtitle stream controller tick");var $=l.fragments,H=$.length,Z=l.edge,te=null,J=this.fragPrevious;if(D<Z){var ie=s.maxFragLookUpTolerance;te=(0,F.findFragmentByPTS)(J,$,Math.max($[0].start,D),ie),!te&&J&&J.start<$[0].start&&(te=$[0])}else te=$[H-1];if(!te)return;te=this.mapToInitFragWhenRequired(te),this.fragmentTracker.getState(te)===L.FragmentState.NOT_LOADED&&this.loadFragment(te,l,D)}},A.getMaxBufferLength=function(C){var P=k.prototype.getMaxBufferLength.call(this);return C?Math.max(P,C):P},A.loadFragment=function(C,P,l){this.fragCurrent=C,C.sn==="initSegment"?this._loadInitSegment(C,P):(this.startFragRequested=!0,k.prototype.loadFragment.call(this,C,P,l))},p(m,[{key:"mediaBufferTimeRanges",get:function(){return new S(this.tracksBuffered[this.currentTrackId]||[])}}]),m}(v.default),S=function(m){this.buffered=void 0;var A=function(C,P,l){if(P=P>>>0,P>l-1)throw new DOMException("Failed to execute '"+C+"' on 'TimeRanges': The index provided ("+P+") is greater than the maximum bound ("+l+")");return m[P][C]};this.buffered={get length(){return m.length},end:function(C){return A("end",C,m.length)},start:function(C){return A("start",C,m.length)}}}},"./src/controller/subtitle-track-controller.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>M});var V=B("./src/events.ts"),K=B("./src/utils/texttrack-utils.ts"),F=B("./src/controller/base-playlist-controller.ts"),i=B("./src/types/loader.ts");function U(d,f){for(var u=0;u<f.length;u++){var h=f[u];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,v(h.key),h)}}function L(d,f,u){return f&&U(d.prototype,f),u&&U(d,u),Object.defineProperty(d,"prototype",{writable:!1}),d}function v(d){var f=E(d,"string");return typeof f=="symbol"?f:String(f)}function E(d,f){if(typeof d!="object"||d===null)return d;var u=d[Symbol.toPrimitive];if(u!==void 0){var h=u.call(d,f||"default");if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(d)}function b(d,f){d.prototype=Object.create(f.prototype),d.prototype.constructor=d,w(d,f)}function w(d,f){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(h,S){return h.__proto__=S,h},w(d,f)}var p=function(d){b(f,d);function f(h){var S;return S=d.call(this,h,"[subtitle-track-controller]")||this,S.media=null,S.tracks=[],S.groupId=null,S.tracksInGroup=[],S.trackId=-1,S.selectDefaultTrack=!0,S.queuedDefaultTrack=-1,S.trackChangeListener=function(){return S.onTextTracksChanged()},S.asyncPollTrackChange=function(){return S.pollTrackChange(0)},S.useTextTrackPolling=!1,S.subtitlePollingInterval=-1,S._subtitleDisplay=!0,S.registerListeners(),S}var u=f.prototype;return u.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,d.prototype.destroy.call(this)},u.registerListeners=function(){var S=this.hls;S.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),S.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),S.on(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),S.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),S.on(V.Events.LEVEL_LOADING,this.onLevelLoading,this),S.on(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),S.on(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),S.on(V.Events.ERROR,this.onError,this)},u.unregisterListeners=function(){var S=this.hls;S.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),S.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),S.off(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),S.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),S.off(V.Events.LEVEL_LOADING,this.onLevelLoading,this),S.off(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),S.off(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),S.off(V.Events.ERROR,this.onError,this)},u.onMediaAttached=function(S,k){this.media=k.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))},u.pollTrackChange=function(S){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,S)},u.onMediaDetaching=function(){if(this.media){self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var S=y(this.media.textTracks);S.forEach(function(k){(0,K.clearCurrentCues)(k)}),this.subtitleTrack=-1,this.media=null}},u.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},u.onManifestParsed=function(S,k){this.tracks=k.subtitleTracks},u.onSubtitleTrackLoaded=function(S,k){var m=k.id,A=k.details,I=this.trackId,C=this.tracksInGroup[I];if(!C){this.warn("Invalid subtitle track id "+m);return}var P=C.details;C.details=k.details,this.log("subtitle track "+m+" loaded ["+A.startSN+"-"+A.endSN+"]"),m===this.trackId&&(this.retryCount=0,this.playlistLoaded(m,k,P))},u.onLevelLoading=function(S,k){this.switchLevel(k.level)},u.onLevelSwitching=function(S,k){this.switchLevel(k.level)},u.switchLevel=function(S){var k=this.hls.levels[S];if(k!=null&&k.textGroupIds){var m=k.textGroupIds[k.urlId];if(this.groupId!==m){var A=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,I=this.tracks.filter(function(l){return!m||l.groupId===m});this.tracksInGroup=I;var C=this.findTrackId(A==null?void 0:A.name)||this.findTrackId();this.groupId=m;var P={subtitleTracks:I};this.log("Updating subtitle tracks, "+I.length+' track(s) found in "'+m+'" group-id'),this.hls.trigger(V.Events.SUBTITLE_TRACKS_UPDATED,P),C!==-1&&this.setSubtitleTrack(C,A)}}},u.findTrackId=function(S){for(var k=this.tracksInGroup,m=0;m<k.length;m++){var A=k[m];if((!this.selectDefaultTrack||A.default)&&(!S||S===A.name))return A.id}return-1},u.onError=function(S,k){d.prototype.onError.call(this,S,k),!(k.fatal||!k.context)&&k.context.type===i.PlaylistContextType.SUBTITLE_TRACK&&k.context.id===this.trackId&&k.context.groupId===this.groupId&&this.retryLoadingOrFail(k)},u.loadPlaylist=function(S){d.prototype.loadPlaylist.call(this);var k=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(k)){var m=k.id,A=k.groupId,I=k.url;if(S)try{I=S.addDirectives(I)}catch(C){this.warn("Could not construct new URL with HLS Delivery Directives: "+C)}this.log("Loading subtitle playlist for id "+m),this.hls.trigger(V.Events.SUBTITLE_TRACK_LOADING,{url:I,id:m,groupId:A,deliveryDirectives:S||null})}},u.toggleTrackModes=function(S){var k=this,m=this.media,A=this.trackId;if(m){var I=y(m.textTracks),C=I.filter(function(c){return c.groupId===k.groupId});if(S===-1)[].slice.call(I).forEach(function(c){c.mode="disabled"});else{var P=C[A];P&&(P.mode="disabled")}var l=C[S];l&&(l.mode=this.subtitleDisplay?"showing":"hidden")}},u.setSubtitleTrack=function(S,k){var m,A=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=S;return}if(this.trackId!==S&&this.toggleTrackModes(S),!(this.trackId===S&&(S===-1||(m=A[S])!==null&&m!==void 0&&m.details)||S<-1||S>=A.length)){this.clearTimer();var I=A[S];if(this.log("Switching to subtitle track "+S),this.trackId=S,I){var C=I.id,P=I.groupId,l=P===void 0?"":P,c=I.name,s=I.type,g=I.url;this.hls.trigger(V.Events.SUBTITLE_TRACK_SWITCH,{id:C,groupId:l,name:c,type:s,url:g});var R=this.switchParams(I.url,k==null?void 0:k.details);this.loadPlaylist(R)}else this.hls.trigger(V.Events.SUBTITLE_TRACK_SWITCH,{id:S})}},u.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!(!this.media||!this.hls.config.renderTextTracksNatively)){for(var S=-1,k=y(this.media.textTracks),m=0;m<k.length;m++)if(k[m].mode==="hidden")S=m;else if(k[m].mode==="showing"){S=m;break}this.subtitleTrack!==S&&(this.subtitleTrack=S)}},L(f,[{key:"subtitleDisplay",get:function(){return this._subtitleDisplay},set:function(S){this._subtitleDisplay=S,this.trackId>-1&&this.toggleTrackModes(this.trackId)}},{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(S){this.selectDefaultTrack=!1;var k=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(S,k)}}]),f}(F.default);function y(d){for(var f=[],u=0;u<d.length;u++){var h=d[u];(h.kind==="subtitles"||h.kind==="captions")&&h.label&&f.push(d[u])}return f}const M=p},"./src/controller/timeline-controller.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{TimelineController:()=>p});var V=B("./src/polyfills/number.ts"),K=B("./src/events.ts"),F=B("./src/utils/cea-608-parser.ts"),i=B("./src/utils/output-filter.ts"),U=B("./src/utils/webvtt-parser.ts"),L=B("./src/utils/texttrack-utils.ts"),v=B("./src/utils/imsc1-ttml-parser.ts"),E=B("./src/utils/mp4-tools.ts"),b=B("./src/types/loader.ts"),w=B("./src/utils/logger.ts"),p=function(){function f(h){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=d(),this.captionsProperties=void 0,this.hls=h,this.config=h.config,this.Cues=h.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var S=new i.default(this,"textTrack1"),k=new i.default(this,"textTrack2"),m=new i.default(this,"textTrack3"),A=new i.default(this,"textTrack4");this.cea608Parser1=new F.default(1,S,k),this.cea608Parser2=new F.default(3,m,A)}h.on(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),h.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(K.Events.MANIFEST_LOADED,this.onManifestLoaded,this),h.on(K.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),h.on(K.Events.FRAG_LOADING,this.onFragLoading,this),h.on(K.Events.FRAG_LOADED,this.onFragLoaded,this),h.on(K.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),h.on(K.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),h.on(K.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),h.on(K.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),h.on(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var u=f.prototype;return u.destroy=function(){var S=this.hls;S.off(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),S.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),S.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),S.off(K.Events.MANIFEST_LOADED,this.onManifestLoaded,this),S.off(K.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),S.off(K.Events.FRAG_LOADING,this.onFragLoading,this),S.off(K.Events.FRAG_LOADED,this.onFragLoaded,this),S.off(K.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),S.off(K.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),S.off(K.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),S.off(K.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),S.off(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},u.addCues=function(S,k,m,A,I){for(var C=!1,P=I.length;P--;){var l=I[P],c=M(l[0],l[1],k,m);if(c>=0&&(l[0]=Math.min(l[0],k),l[1]=Math.max(l[1],m),C=!0,c/(m-k)>.5))return}if(C||I.push([k,m]),this.config.renderTextTracksNatively){var s=this.captionsTracks[S];this.Cues.newCue(s,k,m,A)}else{var g=this.Cues.newCue(null,k,m,A);this.hls.trigger(K.Events.CUES_PARSED,{type:"captions",cues:g,track:S})}},u.onInitPtsFound=function(S,k){var m=this,A=k.frag,I=k.id,C=k.initPTS,P=k.timescale,l=this.unparsedVttFrags;I==="main"&&(this.initPTS[A.cc]=C,this.timescale[A.cc]=P),l.length&&(this.unparsedVttFrags=[],l.forEach(function(c){m.onFragLoaded(K.Events.FRAG_LOADED,c)}))},u.getExistingTrack=function(S){var k=this.media;if(k)for(var m=0;m<k.textTracks.length;m++){var A=k.textTracks[m];if(A[S])return A}return null},u.createCaptionsTrack=function(S){this.config.renderTextTracksNatively?this.createNativeTrack(S):this.createNonNativeTrack(S)},u.createNativeTrack=function(S){if(!this.captionsTracks[S]){var k=this.captionsProperties,m=this.captionsTracks,A=this.media,I=k[S],C=I.label,P=I.languageCode,l=this.getExistingTrack(S);if(l)m[S]=l,(0,L.clearCurrentCues)(m[S]),(0,L.sendAddTrackEvent)(m[S],A);else{var c=this.createTextTrack("captions",C,P);c&&(c[S]=!0,m[S]=c)}}},u.createNonNativeTrack=function(S){if(!this.nonNativeCaptionsTracks[S]){var k=this.captionsProperties[S];if(k){var m=k.label,A={_id:S,label:m,kind:"captions",default:k.media?!!k.media.default:!1,closedCaptions:k.media};this.nonNativeCaptionsTracks[S]=A,this.hls.trigger(K.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[A]})}}},u.createTextTrack=function(S,k,m){var A=this.media;if(A)return A.addTextTrack(S,k,m)},u.onMediaAttaching=function(S,k){this.media=k.media,this._cleanTracks()},u.onMediaDetaching=function(){var S=this.captionsTracks;Object.keys(S).forEach(function(k){(0,L.clearCurrentCues)(S[k]),delete S[k]}),this.nonNativeCaptionsTracks={}},u.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=d(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},u._cleanTracks=function(){var S=this.media;if(S){var k=S.textTracks;if(k)for(var m=0;m<k.length;m++)(0,L.clearCurrentCues)(k[m])}},u.onSubtitleTracksUpdated=function(S,k){var m=this;this.textTracks=[];var A=k.subtitleTracks||[],I=A.some(function(c){return c.textCodec===v.IMSC1_CODEC});if(this.config.enableWebVTT||I&&this.config.enableIMSC1){var C=this.tracks&&A&&this.tracks.length===A.length;if(this.tracks=A||[],this.config.renderTextTracksNatively){var P=this.media?this.media.textTracks:[];this.tracks.forEach(function(c,s){var g;if(s<P.length){for(var R=null,D=0;D<P.length;D++)if(y(P[D],c)){R=P[D];break}R&&(g=R)}if(g)(0,L.clearCurrentCues)(g);else{var x=m._captionsOrSubtitlesFromCharacteristics(c);g=m.createTextTrack(x,c.name,c.lang),g&&(g.mode="disabled")}g&&(g.groupId=c.groupId,m.textTracks.push(g))})}else if(!C&&this.tracks&&this.tracks.length){var l=this.tracks.map(function(c){return{label:c.name,kind:c.type.toLowerCase(),default:c.default,subtitleTrack:c}});this.hls.trigger(K.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:l})}}},u._captionsOrSubtitlesFromCharacteristics=function(S){var k;if((k=S.attrs)!==null&&k!==void 0&&k.CHARACTERISTICS){var m=/transcribes-spoken-dialog/gi.test(S.attrs.CHARACTERISTICS),A=/describes-music-and-sound/gi.test(S.attrs.CHARACTERISTICS);if(m&&A)return"captions"}return"subtitles"},u.onManifestLoaded=function(S,k){var m=this;this.config.enableCEA708Captions&&k.captions&&k.captions.forEach(function(A){var I=/(?:CC|SERVICE)([1-4])/.exec(A.instreamId);if(I){var C="textTrack"+I[1],P=m.captionsProperties[C];P&&(P.label=A.name,A.lang&&(P.languageCode=A.lang),P.media=A)}})},u.closedCaptionsForLevel=function(S){var k=this.hls.levels[S.level];return k==null?void 0:k.attrs["CLOSED-CAPTIONS"]},u.onFragLoading=function(S,k){var m=this.cea608Parser1,A=this.cea608Parser2,I=this.lastSn,C=this.lastPartIndex;if(!(!this.enabled||!(m&&A))&&k.frag.type===b.PlaylistLevelType.MAIN){var P,l,c=k.frag.sn,s=(P=k==null||(l=k.part)===null||l===void 0?void 0:l.index)!=null?P:-1;c===I+1||c===I&&s===C+1||(m.reset(),A.reset()),this.lastSn=c,this.lastPartIndex=s}},u.onFragLoaded=function(S,k){var m=k.frag,A=k.payload,I=this.initPTS,C=this.unparsedVttFrags;if(m.type===b.PlaylistLevelType.SUBTITLE)if(A.byteLength){if(!(0,V.isFiniteNumber)(I[m.cc])){C.push(k),I.length&&this.hls.trigger(K.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:m,error:new Error("Missing initial subtitle PTS")});return}var P=m.decryptdata,l="stats"in k;if(P==null||!P.encrypted||l){var c=this.tracks[m.level],s=this.vttCCs;s[m.cc]||(s[m.cc]={start:m.start,prevCC:this.prevCC,new:!0},this.prevCC=m.cc),c&&c.textCodec===v.IMSC1_CODEC?this._parseIMSC1(m,A):this._parseVTTs(m,A,s)}}else this.hls.trigger(K.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:m,error:new Error("Empty subtitle payload")})},u._parseIMSC1=function(S,k){var m=this,A=this.hls;(0,v.parseIMSC1)(k,this.initPTS[S.cc],this.timescale[S.cc],function(I){m._appendCues(I,S.level),A.trigger(K.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:S})},function(I){w.logger.log("Failed to parse IMSC1: "+I),A.trigger(K.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:S,error:I})})},u._parseVTTs=function(S,k,m){var A,I=this,C=this.hls,P=(A=S.initSegment)!==null&&A!==void 0&&A.data?(0,E.appendUint8Array)(S.initSegment.data,new Uint8Array(k)):k;(0,U.parseWebVTT)(P,this.initPTS[S.cc],this.timescale[S.cc],m,S.cc,S.start,function(l){I._appendCues(l,S.level),C.trigger(K.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:S})},function(l){I._fallbackToIMSC1(S,k),w.logger.log("Failed to parse VTT cue: "+l),C.trigger(K.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:S,error:l})})},u._fallbackToIMSC1=function(S,k){var m=this,A=this.tracks[S.level];A.textCodec||(0,v.parseIMSC1)(k,this.initPTS[S.cc],this.timescale[S.cc],function(){A.textCodec=v.IMSC1_CODEC,m._parseIMSC1(S,k)},function(){A.textCodec="wvtt"})},u._appendCues=function(S,k){var m=this.hls;if(this.config.renderTextTracksNatively){var A=this.textTracks[k];if(!A||A.mode==="disabled")return;S.forEach(function(P){return(0,L.addCueToTrack)(A,P)})}else{var I=this.tracks[k];if(!I)return;var C=I.default?"default":"subtitles"+k;m.trigger(K.Events.CUES_PARSED,{type:"subtitles",cues:S,track:C})}},u.onFragDecrypted=function(S,k){var m=k.frag;if(m.type===b.PlaylistLevelType.SUBTITLE){if(!(0,V.isFiniteNumber)(this.initPTS[m.cc])){this.unparsedVttFrags.push(k);return}this.onFragLoaded(K.Events.FRAG_LOADED,k)}},u.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},u.onFragParsingUserdata=function(S,k){var m=this.cea608Parser1,A=this.cea608Parser2;if(!(!this.enabled||!(m&&A))){var I=k.frag,C=k.samples;if(!(I.type===b.PlaylistLevelType.MAIN&&this.closedCaptionsForLevel(I)==="NONE"))for(var P=0;P<C.length;P++){var l=C[P].bytes;if(l){var c=this.extractCea608Data(l);m.addData(C[P].pts,c[0]),A.addData(C[P].pts,c[1])}}}},u.onBufferFlushing=function(S,k){var m=k.startOffset,A=k.endOffset,I=k.endOffsetSubtitles,C=k.type,P=this.media;if(!(!P||P.currentTime<A)){if(!C||C==="video"){var l=this.captionsTracks;Object.keys(l).forEach(function(s){return(0,L.removeCuesInRange)(l[s],m,A)})}if(this.config.renderTextTracksNatively&&m===0&&I!==void 0){var c=this.textTracks;Object.keys(c).forEach(function(s){return(0,L.removeCuesInRange)(c[s],m,I)})}}},u.extractCea608Data=function(S){for(var k=[[],[]],m=S[0]&31,A=2,I=0;I<m;I++){var C=S[A++],P=127&S[A++],l=127&S[A++];if(!(P===0&&l===0)){var c=(4&C)!==0;if(c){var s=3&C;(s===0||s===1)&&(k[s].push(P),k[s].push(l))}}}return k},f}();function y(f,u){return f&&f.label===u.name&&!(f.textTrack1||f.textTrack2)}function M(f,u,h,S){return Math.min(u,S)-Math.max(f,h)}function d(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}},"./src/crypt/aes-crypto.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>V});var V=function(){function K(i,U){this.subtle=void 0,this.aesIV=void 0,this.subtle=i,this.aesIV=U}var F=K.prototype;return F.decrypt=function(U,L){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},L,U)},K}()},"./src/crypt/aes-decryptor.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>F,removePadding:()=>K});var V=B("./src/utils/typed-array.ts");function K(i){var U=i.byteLength,L=U&&new DataView(i.buffer).getUint8(U-1);return L?(0,V.sliceUint8)(i,0,U-L):i}var F=function(){function i(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var U=i.prototype;return U.uint8ArrayToUint32Array_=function(v){for(var E=new DataView(v),b=new Uint32Array(4),w=0;w<4;w++)b[w]=E.getUint32(w*4);return b},U.initTable=function(){var v=this.sBox,E=this.invSBox,b=this.subMix,w=b[0],p=b[1],y=b[2],M=b[3],d=this.invSubMix,f=d[0],u=d[1],h=d[2],S=d[3],k=new Uint32Array(256),m=0,A=0,I=0;for(I=0;I<256;I++)I<128?k[I]=I<<1:k[I]=I<<1^283;for(I=0;I<256;I++){var C=A^A<<1^A<<2^A<<3^A<<4;C=C>>>8^C&255^99,v[m]=C,E[C]=m;var P=k[m],l=k[P],c=k[l],s=k[C]*257^C*16843008;w[m]=s<<24|s>>>8,p[m]=s<<16|s>>>16,y[m]=s<<8|s>>>24,M[m]=s,s=c*16843009^l*65537^P*257^m*16843008,f[C]=s<<24|s>>>8,u[C]=s<<16|s>>>16,h[C]=s<<8|s>>>24,S[C]=s,m?(m=P^k[k[k[c^P]]],A^=k[k[A]]):m=A=1}},U.expandKey=function(v){for(var E=this.uint8ArrayToUint32Array_(v),b=!0,w=0;w<E.length&&b;)b=E[w]===this.key[w],w++;if(!b){this.key=E;var p=this.keySize=E.length;if(p!==4&&p!==6&&p!==8)throw new Error("Invalid aes key size="+p);var y=this.ksRows=(p+6+1)*4,M,d,f=this.keySchedule=new Uint32Array(y),u=this.invKeySchedule=new Uint32Array(y),h=this.sBox,S=this.rcon,k=this.invSubMix,m=k[0],A=k[1],I=k[2],C=k[3],P,l;for(M=0;M<y;M++){if(M<p){P=f[M]=E[M];continue}l=P,M%p===0?(l=l<<8|l>>>24,l=h[l>>>24]<<24|h[l>>>16&255]<<16|h[l>>>8&255]<<8|h[l&255],l^=S[M/p|0]<<24):p>6&&M%p===4&&(l=h[l>>>24]<<24|h[l>>>16&255]<<16|h[l>>>8&255]<<8|h[l&255]),f[M]=P=(f[M-p]^l)>>>0}for(d=0;d<y;d++)M=y-d,d&3?l=f[M]:l=f[M-4],d<4||M<=4?u[d]=l:u[d]=m[h[l>>>24]]^A[h[l>>>16&255]]^I[h[l>>>8&255]]^C[h[l&255]],u[d]=u[d]>>>0}},U.networkToHostOrderSwap=function(v){return v<<24|(v&65280)<<8|(v&16711680)>>8|v>>>24},U.decrypt=function(v,E,b){for(var w=this.keySize+6,p=this.invKeySchedule,y=this.invSBox,M=this.invSubMix,d=M[0],f=M[1],u=M[2],h=M[3],S=this.uint8ArrayToUint32Array_(b),k=S[0],m=S[1],A=S[2],I=S[3],C=new Int32Array(v),P=new Int32Array(C.length),l,c,s,g,R,D,x,T,O,$,H,Z,te,J,ie=this.networkToHostOrderSwap;E<C.length;){for(O=ie(C[E]),$=ie(C[E+1]),H=ie(C[E+2]),Z=ie(C[E+3]),R=O^p[0],D=Z^p[1],x=H^p[2],T=$^p[3],te=4,J=1;J<w;J++)l=d[R>>>24]^f[D>>16&255]^u[x>>8&255]^h[T&255]^p[te],c=d[D>>>24]^f[x>>16&255]^u[T>>8&255]^h[R&255]^p[te+1],s=d[x>>>24]^f[T>>16&255]^u[R>>8&255]^h[D&255]^p[te+2],g=d[T>>>24]^f[R>>16&255]^u[D>>8&255]^h[x&255]^p[te+3],R=l,D=c,x=s,T=g,te=te+4;l=y[R>>>24]<<24^y[D>>16&255]<<16^y[x>>8&255]<<8^y[T&255]^p[te],c=y[D>>>24]<<24^y[x>>16&255]<<16^y[T>>8&255]<<8^y[R&255]^p[te+1],s=y[x>>>24]<<24^y[T>>16&255]<<16^y[R>>8&255]<<8^y[D&255]^p[te+2],g=y[T>>>24]<<24^y[R>>16&255]<<16^y[D>>8&255]<<8^y[x&255]^p[te+3],P[E]=ie(l^k),P[E+1]=ie(g^m),P[E+2]=ie(s^A),P[E+3]=ie(c^I),k=O,m=$,A=H,I=Z,E=E+4}return P.buffer},i}()},"./src/crypt/decrypter.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>E});var V=B("./src/crypt/aes-crypto.ts"),K=B("./src/crypt/fast-aes-key.ts"),F=B("./src/crypt/aes-decryptor.ts"),i=B("./src/utils/logger.ts"),U=B("./src/utils/mp4-tools.ts"),L=B("./src/utils/typed-array.ts"),v=16,E=function(){function b(p,y){var M=y===void 0?{}:y,d=M.removePKCS7Padding,f=d===void 0?!0:d;if(this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.useSoftware=void 0,this.useSoftware=p.enableSoftwareAES,this.removePKCS7Padding=f,f)try{var u=self.crypto;u&&(this.subtle=u.subtle||u.webkitSubtle)}catch(h){}this.subtle===null&&(this.useSoftware=!0)}var w=b.prototype;return w.destroy=function(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null},w.isSync=function(){return this.useSoftware},w.flush=function(){var y=this.currentResult,M=this.remainderData;if(!y||M)return this.reset(),null;var d=new Uint8Array(y);return this.reset(),this.removePKCS7Padding?(0,F.removePadding)(d):d},w.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},w.decrypt=function(y,M,d){var f=this;return this.useSoftware?new Promise(function(u,h){f.softwareDecrypt(new Uint8Array(y),M,d);var S=f.flush();S?u(S.buffer):h(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(y),M,d)},w.softwareDecrypt=function(y,M,d){var f=this.currentIV,u=this.currentResult,h=this.remainderData;this.logOnce("JS AES decrypt"),h&&(y=(0,U.appendUint8Array)(h,y),this.remainderData=null);var S=this.getValidChunk(y);if(!S.length)return null;f&&(d=f);var k=this.softwareDecrypter;k||(k=this.softwareDecrypter=new F.default),k.expandKey(M);var m=u;return this.currentResult=k.decrypt(S.buffer,0,d),this.currentIV=(0,L.sliceUint8)(S,-16).buffer,m||null},w.webCryptoDecrypt=function(y,M,d){var f=this,u=this.subtle;return(this.key!==M||!this.fastAesKey)&&(this.key=M,this.fastAesKey=new K.default(u,M)),this.fastAesKey.expandKey().then(function(h){if(!u)return Promise.reject(new Error("web crypto not initialized"));f.logOnce("WebCrypto AES decrypt");var S=new V.default(u,new Uint8Array(d));return S.decrypt(y.buffer,h)}).catch(function(h){return i.logger.warn("[decrypter]: WebCrypto Error, disable WebCrypto API, "+h.name+": "+h.message),f.onWebCryptoError(y,M,d)})},w.onWebCryptoError=function(y,M,d){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(y,M,d);var f=this.flush();if(f)return f.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")},w.getValidChunk=function(y){var M=y,d=y.length-y.length%v;return d!==y.length&&(M=(0,L.sliceUint8)(y,0,d),this.remainderData=(0,L.sliceUint8)(y,d)),M},w.logOnce=function(y){this.logEnabled&&(i.logger.log("[decrypter]: "+y),this.logEnabled=!1)},b}()},"./src/crypt/fast-aes-key.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>V});var V=function(){function K(i,U){this.subtle=void 0,this.key=void 0,this.subtle=i,this.key=U}var F=K.prototype;return F.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},K}()},"./src/demux/aacdemuxer.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>E});var V=B("./src/demux/base-audio-demuxer.ts"),K=B("./src/demux/adts.ts"),F=B("./src/utils/logger.ts"),i=B("./src/demux/id3.ts");function U(b,w){b.prototype=Object.create(w.prototype),b.prototype.constructor=b,L(b,w)}function L(b,w){return L=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(y,M){return y.__proto__=M,y},L(b,w)}var v=function(b){U(w,b);function w(y,M){var d;return d=b.call(this)||this,d.observer=void 0,d.config=void 0,d.observer=y,d.config=M,d}var p=w.prototype;return p.resetInitSegment=function(M,d,f,u){b.prototype.resetInitSegment.call(this,M,d,f,u),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:d,duration:u,inputTimeScale:9e4,dropped:0}},w.probe=function(M){if(!M)return!1;for(var d=i.getID3Data(M,0)||[],f=d.length,u=M.length;f<u;f++)if(K.probe(M,f))return F.logger.log("ADTS sync word found !"),!0;return!1},p.canParse=function(M,d){return K.canParse(M,d)},p.appendFrame=function(M,d,f){K.initTrackConfig(M,this.observer,d,f,M.manifestCodec);var u=K.appendFrame(M,d,f,this.basePTS,this.frameIndex);if(u&&u.missing===0)return u},w}(V.default);const E=v},"./src/demux/adts.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{appendFrame:()=>f,canGetFrameLength:()=>E,canParse:()=>w,getAudioConfig:()=>i,getFrameDuration:()=>M,getFullFrameLength:()=>v,getHeaderLength:()=>L,initTrackConfig:()=>y,isHeader:()=>b,isHeaderPattern:()=>U,parseFrameHeader:()=>d,probe:()=>p});var V=B("./src/utils/logger.ts"),K=B("./src/errors.ts"),F=B("./src/events.ts");function i(u,h,S,k){var m,A,I,C,P=navigator.userAgent.toLowerCase(),l=k,c=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];m=((h[S+2]&192)>>>6)+1;var s=(h[S+2]&60)>>>2;if(s>c.length-1){u.trigger(F.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+s});return}return I=(h[S+2]&1)<<2,I|=(h[S+3]&192)>>>6,V.logger.log("manifest codec:"+k+", ADTS type:"+m+", samplingIndex:"+s),/firefox/i.test(P)?s>=6?(m=5,C=new Array(4),A=s-3):(m=2,C=new Array(2),A=s):P.indexOf("android")!==-1?(m=2,C=new Array(2),A=s):(m=5,C=new Array(4),k&&(k.indexOf("mp4a.40.29")!==-1||k.indexOf("mp4a.40.5")!==-1)||!k&&s>=6?A=s-3:((k&&k.indexOf("mp4a.40.2")!==-1&&(s>=6&&I===1||/vivaldi/i.test(P))||!k&&I===1)&&(m=2,C=new Array(2)),A=s)),C[0]=m<<3,C[0]|=(s&14)>>1,C[1]|=(s&1)<<7,C[1]|=I<<3,m===5&&(C[1]|=(A&14)>>1,C[2]=(A&1)<<7,C[2]|=8,C[3]=0),{config:C,samplerate:c[s],channelCount:I,codec:"mp4a.40."+m,manifestCodec:l}}function U(u,h){return u[h]===255&&(u[h+1]&246)===240}function L(u,h){return u[h+1]&1?7:9}function v(u,h){return(u[h+3]&3)<<11|u[h+4]<<3|(u[h+5]&224)>>>5}function E(u,h){return h+5<u.length}function b(u,h){return h+1<u.length&&U(u,h)}function w(u,h){return E(u,h)&&U(u,h)&&v(u,h)<=u.length-h}function p(u,h){if(b(u,h)){var S=L(u,h);if(h+S>=u.length)return!1;var k=v(u,h);if(k<=S)return!1;var m=h+k;return m===u.length||b(u,m)}return!1}function y(u,h,S,k,m){if(!u.samplerate){var A=i(h,S,k,m);if(!A)return;u.config=A.config,u.samplerate=A.samplerate,u.channelCount=A.channelCount,u.codec=A.codec,u.manifestCodec=A.manifestCodec,V.logger.log("parsed codec:"+u.codec+", rate:"+A.samplerate+", channels:"+A.channelCount)}}function M(u){return 9216e4/u}function d(u,h){var S=L(u,h);if(h+S<=u.length){var k=v(u,h)-S;if(k>0)return{headerLength:S,frameLength:k}}}function f(u,h,S,k,m){var A=M(u.samplerate),I=k+m*A,C=d(h,S),P;if(C){var l=C.frameLength,c=C.headerLength,s=c+l,g=Math.max(0,S+s-h.length);g?(P=new Uint8Array(s-c),P.set(h.subarray(S+c,h.length),0)):P=h.subarray(S+c,S+s);var R={unit:P,pts:I};return g||u.samples.push(R),{sample:R,length:s,missing:g}}var D=h.length-S;P=new Uint8Array(D),P.set(h.subarray(S,h.length),0);var x={unit:P,pts:I};return{sample:x,length:D,missing:-1}}},"./src/demux/base-audio-demuxer.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>b,initPTSFn:()=>E});var V=B("./src/polyfills/number.ts"),K=B("./src/demux/id3.ts"),F=B("./src/types/demuxer.ts"),i=B("./src/demux/dummy-demuxed-track.ts"),U=B("./src/utils/mp4-tools.ts"),L=B("./src/utils/typed-array.ts"),v=function(){function w(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}var p=w.prototype;return p.resetInitSegment=function(M,d,f,u){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},p.resetTimeStamp=function(M){this.initPTS=M,this.resetContiguity()},p.resetContiguity=function(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0},p.canParse=function(M,d){return!1},p.appendFrame=function(M,d,f){},p.demux=function(M,d){this.cachedData&&(M=(0,U.appendUint8Array)(this.cachedData,M),this.cachedData=null);var f=K.getID3Data(M,0),u=f?f.length:0,h,S=this._audioTrack,k=this._id3Track,m=f?K.getTimeStamp(f):void 0,A=M.length;for((this.basePTS===null||this.frameIndex===0&&(0,V.isFiniteNumber)(m))&&(this.basePTS=E(m,d,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),f&&f.length>0&&k.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:f,type:F.MetadataSchema.audioId3,duration:Number.POSITIVE_INFINITY});u<A;){if(this.canParse(M,u)){var I=this.appendFrame(S,M,u);I?(this.frameIndex++,this.lastPTS=I.sample.pts,u+=I.length,h=u):u=A}else K.canParse(M,u)?(f=K.getID3Data(M,u),k.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:f,type:F.MetadataSchema.audioId3,duration:Number.POSITIVE_INFINITY}),u+=f.length,h=u):u++;if(u===A&&h!==A){var C=(0,L.sliceUint8)(M,h);this.cachedData?this.cachedData=(0,U.appendUint8Array)(this.cachedData,C):this.cachedData=C}}return{audioTrack:S,videoTrack:(0,i.dummyTrack)(),id3Track:k,textTrack:(0,i.dummyTrack)()}},p.demuxSampleAes=function(M,d,f){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},p.flush=function(M){var d=this.cachedData;return d&&(this.cachedData=null,this.demux(d,0)),{audioTrack:this._audioTrack,videoTrack:(0,i.dummyTrack)(),id3Track:this._id3Track,textTrack:(0,i.dummyTrack)()}},p.destroy=function(){},w}(),E=function(p,y,M){return(0,V.isFiniteNumber)(p)?p*90:y*9e4+(M||0)};const b=v},"./src/demux/chunk-cache.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>V});var V=function(){function F(){this.chunks=[],this.dataLength=0}var i=F.prototype;return i.push=function(L){this.chunks.push(L),this.dataLength+=L.length},i.flush=function(){var L=this.chunks,v=this.dataLength,E;if(L.length)L.length===1?E=L[0]:E=K(L,v);else return new Uint8Array(0);return this.reset(),E},i.reset=function(){this.chunks.length=0,this.dataLength=0},F}();function K(F,i){for(var U=new Uint8Array(i),L=0,v=0;v<F.length;v++){var E=F[v];U.set(E,L),L+=E.length}return U}},"./src/demux/dummy-demuxed-track.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{dummyTrack:()=>V});function V(K,F){return K===void 0&&(K=""),F===void 0&&(F=9e4),{type:K,id:-1,pid:-1,inputTimeScale:F,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>F});var V=B("./src/utils/logger.ts"),K=function(){function i(L){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=L,this.bytesAvailable=L.byteLength,this.word=0,this.bitsAvailable=0}var U=i.prototype;return U.loadWord=function(){var v=this.data,E=this.bytesAvailable,b=v.byteLength-E,w=new Uint8Array(4),p=Math.min(4,E);if(p===0)throw new Error("no bytes available");w.set(v.subarray(b,b+p)),this.word=new DataView(w.buffer).getUint32(0),this.bitsAvailable=p*8,this.bytesAvailable-=p},U.skipBits=function(v){var E;v=Math.min(v,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>v?(this.word<<=v,this.bitsAvailable-=v):(v-=this.bitsAvailable,E=v>>3,v-=E<<3,this.bytesAvailable-=E,this.loadWord(),this.word<<=v,this.bitsAvailable-=v)},U.readBits=function(v){var E=Math.min(this.bitsAvailable,v),b=this.word>>>32-E;if(v>32&&V.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=E,this.bitsAvailable>0)this.word<<=E;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return E=v-E,E>0&&this.bitsAvailable?b<<E|this.readBits(E):b},U.skipLZ=function(){var v;for(v=0;v<this.bitsAvailable;++v)if(this.word&2147483648>>>v)return this.word<<=v,this.bitsAvailable-=v,v;return this.loadWord(),v+this.skipLZ()},U.skipUEG=function(){this.skipBits(1+this.skipLZ())},U.skipEG=function(){this.skipBits(1+this.skipLZ())},U.readUEG=function(){var v=this.skipLZ();return this.readBits(v+1)-1},U.readEG=function(){var v=this.readUEG();return 1&v?1+v>>>1:-1*(v>>>1)},U.readBoolean=function(){return this.readBits(1)===1},U.readUByte=function(){return this.readBits(8)},U.readUShort=function(){return this.readBits(16)},U.readUInt=function(){return this.readBits(32)},U.skipScalingList=function(v){for(var E=8,b=8,w,p=0;p<v;p++)b!==0&&(w=this.readEG(),b=(E+w+256)%256),E=b===0?E:b},U.readSPS=function(){var v=0,E=0,b=0,w=0,p,y,M,d=this.readUByte.bind(this),f=this.readBits.bind(this),u=this.readUEG.bind(this),h=this.readBoolean.bind(this),S=this.skipBits.bind(this),k=this.skipEG.bind(this),m=this.skipUEG.bind(this),A=this.skipScalingList.bind(this);d();var I=d();if(f(5),S(3),d(),m(),I===100||I===110||I===122||I===244||I===44||I===83||I===86||I===118||I===128){var C=u();if(C===3&&S(1),m(),m(),S(1),h())for(y=C!==3?8:12,M=0;M<y;M++)h()&&(M<6?A(16):A(64))}m();var P=u();if(P===0)u();else if(P===1)for(S(1),k(),k(),p=u(),M=0;M<p;M++)k();m(),S(1);var l=u(),c=u(),s=f(1);s===0&&S(1),S(1),h()&&(v=u(),E=u(),b=u(),w=u());var g=[1,1];if(h()&&h()){var R=d();switch(R){case 1:g=[1,1];break;case 2:g=[12,11];break;case 3:g=[10,11];break;case 4:g=[16,11];break;case 5:g=[40,33];break;case 6:g=[24,11];break;case 7:g=[20,11];break;case 8:g=[32,11];break;case 9:g=[80,33];break;case 10:g=[18,11];break;case 11:g=[15,11];break;case 12:g=[64,33];break;case 13:g=[160,99];break;case 14:g=[4,3];break;case 15:g=[3,2];break;case 16:g=[2,1];break;case 255:{g=[d()<<8|d(),d()<<8|d()];break}}}return{width:Math.ceil((l+1)*16-v*2-E*2),height:(2-s)*(c+1)*16-(s?2:4)*(b+w),pixelRatio:g}},U.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},i}();const F=K},"./src/demux/id3.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{canParse:()=>U,decodeFrame:()=>w,getID3Data:()=>F,getID3Frames:()=>b,getTimeStamp:()=>L,isFooter:()=>K,isHeader:()=>V,isTimeStampFrame:()=>v,testables:()=>u,utf8ArrayToStr:()=>f});var V=function(m,A){return A+10<=m.length&&m[A]===73&&m[A+1]===68&&m[A+2]===51&&m[A+3]<255&&m[A+4]<255&&m[A+6]<128&&m[A+7]<128&&m[A+8]<128&&m[A+9]<128},K=function(m,A){return A+10<=m.length&&m[A]===51&&m[A+1]===68&&m[A+2]===73&&m[A+3]<255&&m[A+4]<255&&m[A+6]<128&&m[A+7]<128&&m[A+8]<128&&m[A+9]<128},F=function(m,A){for(var I=A,C=0;V(m,A);){C+=10;var P=i(m,A+6);C+=P,K(m,A+10)&&(C+=10),A+=C}if(C>0)return m.subarray(I,I+C)},i=function(m,A){var I=0;return I=(m[A]&127)<<21,I|=(m[A+1]&127)<<14,I|=(m[A+2]&127)<<7,I|=m[A+3]&127,I},U=function(m,A){return V(m,A)&&i(m,A+6)+10<=m.length-A},L=function(m){for(var A=b(m),I=0;I<A.length;I++){var C=A[I];if(v(C))return d(C)}},v=function(m){return m&&m.key==="PRIV"&&m.info==="com.apple.streaming.transportStreamTimestamp"},E=function(m){var A=String.fromCharCode(m[0],m[1],m[2],m[3]),I=i(m,4),C=10;return{type:A,size:I,data:m.subarray(C,C+I)}},b=function(m){for(var A=0,I=[];V(m,A);){var C=i(m,A+6);A+=10;for(var P=A+C;A+8<P;){var l=E(m.subarray(A)),c=w(l);c&&I.push(c),A+=l.size+10}K(m,A)&&(A+=10)}return I},w=function(m){return m.type==="PRIV"?p(m):m.type[0]==="W"?M(m):y(m)},p=function(m){if(!(m.size<2)){var A=f(m.data,!0),I=new Uint8Array(m.data.subarray(A.length+1));return{key:m.type,info:A,data:I.buffer}}},y=function(m){if(!(m.size<2)){if(m.type==="TXXX"){var A=1,I=f(m.data.subarray(A),!0);A+=I.length+1;var C=f(m.data.subarray(A));return{key:m.type,info:I,data:C}}var P=f(m.data.subarray(1));return{key:m.type,data:P}}},M=function(m){if(m.type==="WXXX"){if(m.size<2)return;var A=1,I=f(m.data.subarray(A),!0);A+=I.length+1;var C=f(m.data.subarray(A));return{key:m.type,info:I,data:C}}var P=f(m.data);return{key:m.type,data:P}},d=function(m){if(m.data.byteLength===8){var A=new Uint8Array(m.data),I=A[3]&1,C=(A[4]<<23)+(A[5]<<15)+(A[6]<<7)+A[7];return C/=45,I&&(C+=4772185884e-2),Math.round(C)}},f=function(m,A){A===void 0&&(A=!1);var I=S();if(I){var C=I.decode(m);if(A){var P=C.indexOf("\0");return P!==-1?C.substring(0,P):C}return C.replace(/\0/g,"")}for(var l=m.length,c,s,g,R="",D=0;D<l;){if(c=m[D++],c===0&&A)return R;if(c===0||c===3)continue;switch(c>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:R+=String.fromCharCode(c);break;case 12:case 13:s=m[D++],R+=String.fromCharCode((c&31)<<6|s&63);break;case 14:s=m[D++],g=m[D++],R+=String.fromCharCode((c&15)<<12|(s&63)<<6|(g&63)<<0);break;default:}}return R},u={decodeTextFrame:y},h;function S(){return!h&&typeof self.TextDecoder!="undefined"&&(h=new self.TextDecoder("utf-8")),h}},"./src/demux/mp3demuxer.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>E});var V=B("./src/demux/base-audio-demuxer.ts"),K=B("./src/demux/id3.ts"),F=B("./src/utils/logger.ts"),i=B("./src/demux/mpegaudio.ts");function U(b,w){b.prototype=Object.create(w.prototype),b.prototype.constructor=b,L(b,w)}function L(b,w){return L=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(y,M){return y.__proto__=M,y},L(b,w)}var v=function(b){U(w,b);function w(){return b.apply(this,arguments)||this}var p=w.prototype;return p.resetInitSegment=function(M,d,f,u){b.prototype.resetInitSegment.call(this,M,d,f,u),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:d,duration:u,inputTimeScale:9e4,dropped:0}},w.probe=function(M){if(!M)return!1;for(var d=K.getID3Data(M,0)||[],f=d.length,u=M.length;f<u;f++)if(i.probe(M,f))return F.logger.log("MPEG Audio sync word found !"),!0;return!1},p.canParse=function(M,d){return i.canParse(M,d)},p.appendFrame=function(M,d,f){if(this.basePTS!==null)return i.appendFrame(M,d,f,this.basePTS,this.frameIndex)},w}(V.default);const E=v},"./src/demux/mp4demuxer.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>v});var V=B("./src/polyfills/number.ts"),K=B("./src/types/demuxer.ts"),F=B("./src/utils/mp4-tools.ts"),i=B("./src/demux/dummy-demuxed-track.ts"),U=/\/emsg[-/]ID3/i,L=function(){function E(w,p){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=p}var b=E.prototype;return b.resetTimeStamp=function(){},b.resetInitSegment=function(p,y,M,d){var f=this.videoTrack=(0,i.dummyTrack)("video",1),u=this.audioTrack=(0,i.dummyTrack)("audio",1),h=this.txtTrack=(0,i.dummyTrack)("text",1);if(this.id3Track=(0,i.dummyTrack)("id3",1),this.timeOffset=0,!(!p||!p.byteLength)){var S=(0,F.parseInitSegment)(p);if(S.video){var k=S.video,m=k.id,A=k.timescale,I=k.codec;f.id=m,f.timescale=h.timescale=A,f.codec=I}if(S.audio){var C=S.audio,P=C.id,l=C.timescale,c=C.codec;u.id=P,u.timescale=l,u.codec=c}h.id=F.RemuxerTrackIdConfig.text,f.sampleDuration=0,f.duration=u.duration=d}},b.resetContiguity=function(){},E.probe=function(p){return p=p.length>16384?p.subarray(0,16384):p,(0,F.findBox)(p,["moof"]).length>0},b.demux=function(p,y){this.timeOffset=y;var M=p,d=this.videoTrack,f=this.txtTrack;if(this.config.progressive){this.remainderData&&(M=(0,F.appendUint8Array)(this.remainderData,p));var u=(0,F.segmentValidRange)(M);this.remainderData=u.remainder,d.samples=u.valid||new Uint8Array}else d.samples=M;var h=this.extractID3Track(d,y);return f.samples=(0,F.parseSamples)(y,d),{videoTrack:d,audioTrack:this.audioTrack,id3Track:h,textTrack:this.txtTrack}},b.flush=function(){var p=this.timeOffset,y=this.videoTrack,M=this.txtTrack;y.samples=this.remainderData||new Uint8Array,this.remainderData=null;var d=this.extractID3Track(y,this.timeOffset);return M.samples=(0,F.parseSamples)(p,y),{videoTrack:y,audioTrack:(0,i.dummyTrack)(),id3Track:d,textTrack:(0,i.dummyTrack)()}},b.extractID3Track=function(p,y){var M=this.id3Track;if(p.samples.length){var d=(0,F.findBox)(p.samples,["emsg"]);d&&d.forEach(function(f){var u=(0,F.parseEmsg)(f);if(U.test(u.schemeIdUri)){var h=(0,V.isFiniteNumber)(u.presentationTime)?u.presentationTime/u.timeScale:y+u.presentationTimeDelta/u.timeScale,S=u.eventDuration===4294967295?Number.POSITIVE_INFINITY:u.eventDuration/u.timeScale;S<=.001&&(S=Number.POSITIVE_INFINITY);var k=u.payload;M.samples.push({data:k,len:k.byteLength,dts:h,pts:h,type:K.MetadataSchema.emsg,duration:S})}})}return M},b.demuxSampleAes=function(p,y,M){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},b.destroy=function(){},E}();const v=L},"./src/demux/mpegaudio.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{appendFrame:()=>L,canParse:()=>w,isHeader:()=>b,isHeaderPattern:()=>E,parseHeader:()=>v,probe:()=>p});var V=null,K=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],F=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],i=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],U=[0,1,1,4];function L(y,M,d,f,u){if(!(d+24>M.length)){var h=v(M,d);if(h&&d+h.frameLength<=M.length){var S=h.samplesPerFrame*9e4/h.sampleRate,k=f+u*S,m={unit:M.subarray(d,d+h.frameLength),pts:k,dts:k};return y.config=[],y.channelCount=h.channelCount,y.samplerate=h.sampleRate,y.samples.push(m),{sample:m,length:h.frameLength,missing:0}}}}function v(y,M){var d=y[M+1]>>3&3,f=y[M+1]>>1&3,u=y[M+2]>>4&15,h=y[M+2]>>2&3;if(d!==1&&u!==0&&u!==15&&h!==3){var S=y[M+2]>>1&1,k=y[M+3]>>6,m=d===3?3-f:f===3?3:4,A=K[m*14+u-1]*1e3,I=d===3?0:d===2?1:2,C=F[I*3+h],P=k===3?1:2,l=i[d][f],c=U[f],s=l*8*c,g=Math.floor(l*A/C+S)*c;if(V===null){var R=navigator.userAgent||"",D=R.match(/Chrome\/(\d+)/i);V=D?parseInt(D[1]):0}var x=!!V&&V<=87;return x&&f===2&&A>=224e3&&k===0&&(y[M+3]=y[M+3]|128),{sampleRate:C,channelCount:P,frameLength:g,samplesPerFrame:s}}}function E(y,M){return y[M]===255&&(y[M+1]&224)===224&&(y[M+1]&6)!==0}function b(y,M){return M+1<y.length&&E(y,M)}function w(y,M){var d=4;return E(y,M)&&d<=y.length-M}function p(y,M){if(M+1<y.length&&E(y,M)){var d=4,f=v(y,M),u=d;f!=null&&f.frameLength&&(u=f.frameLength);var h=M+u;return h===y.length||b(y,h)}return!1}},"./src/demux/sample-aes.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>i});var V=B("./src/crypt/decrypter.ts"),K=B("./src/utils/mp4-tools.ts"),F=function(){function U(v,E,b){this.keyData=void 0,this.decrypter=void 0,this.keyData=b,this.decrypter=new V.default(E,{removePKCS7Padding:!1})}var L=U.prototype;return L.decryptBuffer=function(E){return this.decrypter.decrypt(E,this.keyData.key.buffer,this.keyData.iv.buffer)},L.decryptAacSample=function(E,b,w){var p=this,y=E[b].unit;if(!(y.length<=16)){var M=y.subarray(16,y.length-y.length%16),d=M.buffer.slice(M.byteOffset,M.byteOffset+M.length);this.decryptBuffer(d).then(function(f){var u=new Uint8Array(f);y.set(u,16),p.decrypter.isSync()||p.decryptAacSamples(E,b+1,w)})}},L.decryptAacSamples=function(E,b,w){for(;;b++){if(b>=E.length){w();return}if(!(E[b].unit.length<32)&&(this.decryptAacSample(E,b,w),!this.decrypter.isSync()))return}},L.getAvcEncryptedData=function(E){for(var b=Math.floor((E.length-48)/160)*16+16,w=new Int8Array(b),p=0,y=32;y<E.length-16;y+=160,p+=16)w.set(E.subarray(y,y+16),p);return w},L.getAvcDecryptedUnit=function(E,b){for(var w=new Uint8Array(b),p=0,y=32;y<E.length-16;y+=160,p+=16)E.set(w.subarray(p,p+16),y);return E},L.decryptAvcSample=function(E,b,w,p,y){var M=this,d=(0,K.discardEPB)(y.data),f=this.getAvcEncryptedData(d);this.decryptBuffer(f.buffer).then(function(u){y.data=M.getAvcDecryptedUnit(d,u),M.decrypter.isSync()||M.decryptAvcSamples(E,b,w+1,p)})},L.decryptAvcSamples=function(E,b,w,p){if(E instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;b++,w=0){if(b>=E.length){p();return}for(var y=E[b].units;!(w>=y.length);w++){var M=y[w];if(!(M.data.length<=48||M.type!==1&&M.type!==5)&&(this.decryptAvcSample(E,b,w,p,M),!this.decrypter.isSync()))return}}},U}();const i=F},"./src/demux/transmuxer-interface.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>w});var V=B("./src/demux/webworkify-webpack.js"),K=B("./src/events.ts"),F=B("./src/demux/transmuxer.ts"),i=B("./src/utils/logger.ts"),U=B("./src/errors.ts"),L=B("./src/utils/mediasource-helper.ts"),v=B("./node_modules/eventemitter3/index.js"),E=B.n(v),b=(0,L.getMediaSource)()||{isTypeSupported:function(){return!1}},w=function(){function p(M,d,f,u){var h=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0;var S=M.config;this.hls=M,this.id=d,this.useWorker=!!S.enableWorker,this.onTransmuxComplete=f,this.onFlush=u;var k=function(P,l){l=l||{},l.frag=h.frag,l.id=h.id,h.hls.trigger(P,l)};this.observer=new v.EventEmitter,this.observer.on(K.Events.FRAG_DECRYPTED,k),this.observer.on(K.Events.ERROR,k);var m={mp4:b.isTypeSupported("video/mp4"),mpeg:b.isTypeSupported("audio/mpeg"),mp3:b.isTypeSupported('audio/mp4; codecs="mp3"')},A=navigator.vendor;if(this.useWorker&&typeof Worker!="undefined"){i.logger.log("demuxing in webworker");var I;try{I=this.worker=(0,V.default)("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),I.addEventListener("message",this.onwmsg),I.onerror=function(C){h.useWorker=!1,i.logger.warn("Exception in webworker, fallback to inline"),h.hls.trigger(K.Events.ERROR,{type:U.ErrorTypes.OTHER_ERROR,details:U.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:new Error(C.message+" ("+C.filename+":"+C.lineno+")")})},I.postMessage({cmd:"init",typeSupported:m,vendor:A,id:d,config:JSON.stringify(S)})}catch(C){i.logger.warn("Error in worker:",C),i.logger.error("Error while initializing DemuxerWorker, fallback to inline"),I&&self.URL.revokeObjectURL(I.objectURL),this.transmuxer=new F.default(this.observer,m,S,A,d),this.worker=null}}else this.transmuxer=new F.default(this.observer,m,S,A,d)}var y=p.prototype;return y.destroy=function(){var d=this.worker;if(d)d.removeEventListener("message",this.onwmsg),d.terminate(),this.worker=null,this.onwmsg=void 0;else{var f=this.transmuxer;f&&(f.destroy(),this.transmuxer=null)}var u=this.observer;u&&u.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null},y.push=function(d,f,u,h,S,k,m,A,I,C){var P,l,c=this;I.transmuxing.start=self.performance.now();var s=this.transmuxer,g=this.worker,R=k?k.start:S.start,D=S.decryptdata,x=this.frag,T=!(x&&S.cc===x.cc),O=!(x&&I.level===x.level),$=x?I.sn-x.sn:-1,H=this.part?I.part-this.part.index:-1,Z=$===0&&I.id>1&&I.id===(x==null?void 0:x.stats.chunkCount),te=!O&&($===1||$===0&&(H===1||Z&&H<=0)),J=self.performance.now();(O||$||S.stats.parsing.start===0)&&(S.stats.parsing.start=J),k&&(H||!te)&&(k.stats.parsing.start=J);var ie=!(x&&((P=S.initSegment)===null||P===void 0?void 0:P.url)===((l=x.initSegment)===null||l===void 0?void 0:l.url)),oe=new F.TransmuxState(T,te,A,O,R,ie);if(!te||T||ie){i.logger.log("[transmuxer-interface, "+S.type+"]: Starting new transmux session for sn: "+I.sn+" p: "+I.part+" level: "+I.level+" id: "+I.id+`
discontinuity: `+T+`
trackSwitch: `+O+`
contiguous: `+te+`
accurateTimeOffset: `+A+`
timeOffset: `+R+`
initSegmentChange: `+ie);var ue=new F.TransmuxConfig(u,h,f,m,C);this.configureTransmuxer(ue)}if(this.frag=S,this.part=k,g)g.postMessage({cmd:"demux",data:d,decryptdata:D,chunkMeta:I,state:oe},d instanceof ArrayBuffer?[d]:[]);else if(s){var Pe=s.push(d,D,I,oe);(0,F.isPromise)(Pe)?(s.async=!0,Pe.then(function(Ne){c.handleTransmuxComplete(Ne)}).catch(function(Ne){c.transmuxerError(Ne,I,"transmuxer-interface push error")})):(s.async=!1,this.handleTransmuxComplete(Pe))}},y.flush=function(d){var f=this;d.transmuxing.start=self.performance.now();var u=this.transmuxer,h=this.worker;if(h)h.postMessage({cmd:"flush",chunkMeta:d});else if(u){var S=u.flush(d),k=(0,F.isPromise)(S);k||u.async?((0,F.isPromise)(S)||(S=Promise.resolve(S)),S.then(function(m){f.handleFlushResult(m,d)}).catch(function(m){f.transmuxerError(m,d,"transmuxer-interface flush error")})):this.handleFlushResult(S,d)}},y.transmuxerError=function(d,f,u){this.hls&&this.hls.trigger(K.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.FRAG_PARSING_ERROR,chunkMeta:f,fatal:!1,error:d,err:d,reason:u})},y.handleFlushResult=function(d,f){var u=this;d.forEach(function(h){u.handleTransmuxComplete(h)}),this.onFlush(f)},y.onWorkerMessage=function(d){var f=d.data,u=this.hls;switch(f.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(f.data);break}case"flush":{this.onFlush(f.data);break}case"workerLog":i.logger[f.data.logType]&&i.logger[f.data.logType](f.data.message);break;default:{f.data=f.data||{},f.data.frag=this.frag,f.data.id=this.id,u.trigger(f.event,f.data);break}}},y.configureTransmuxer=function(d){var f=this.worker,u=this.transmuxer;f?f.postMessage({cmd:"configure",config:d}):u&&u.configure(d)},y.handleTransmuxComplete=function(d){d.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(d)},p}()},"./src/demux/transmuxer-worker.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>v});var V=B("./src/demux/transmuxer.ts"),K=B("./src/events.ts"),F=B("./src/utils/logger.ts"),i=B("./node_modules/eventemitter3/index.js"),U=B.n(i),L=B("./src/errors.ts");function v(y){var M=new i.EventEmitter,d=function(h,S){y.postMessage({event:h,data:S})};M.on(K.Events.FRAG_DECRYPTED,d),M.on(K.Events.ERROR,d);var f=function(){var h=function(m){var A=function(C){d("workerLog",{logType:m,message:C})};F.logger[m]=A};for(var S in F.logger)h(S)};y.addEventListener("message",function(u){var h=u.data;switch(h.cmd){case"init":{var S=JSON.parse(h.config);y.transmuxer=new V.default(M,h.typeSupported,S,h.vendor,h.id),(0,F.enableLogs)(S.debug,h.id),f(),d("init",null);break}case"configure":{y.transmuxer.configure(h.config);break}case"demux":{var k=y.transmuxer.push(h.data,h.decryptdata,h.chunkMeta,h.state);(0,V.isPromise)(k)?(y.transmuxer.async=!0,k.then(function(C){E(y,C)}).catch(function(C){d(K.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.FRAG_PARSING_ERROR,chunkMeta:h.chunkMeta,fatal:!1,error:C,err:C,reason:"transmuxer-worker push error"})})):(y.transmuxer.async=!1,E(y,k));break}case"flush":{var m=h.chunkMeta,A=y.transmuxer.flush(m),I=(0,V.isPromise)(A);I||y.transmuxer.async?((0,V.isPromise)(A)||(A=Promise.resolve(A)),A.then(function(C){w(y,C,m)}).catch(function(C){d(K.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.FRAG_PARSING_ERROR,chunkMeta:h.chunkMeta,fatal:!1,error:C,err:C,reason:"transmuxer-worker flush error"})})):w(y,A,m);break}default:break}})}function E(y,M){if(p(M.remuxResult))return!1;var d=[],f=M.remuxResult,u=f.audio,h=f.video;return u&&b(d,u),h&&b(d,h),y.postMessage({event:"transmuxComplete",data:M},d),!0}function b(y,M){M.data1&&y.push(M.data1.buffer),M.data2&&y.push(M.data2.buffer)}function w(y,M,d){var f=M.reduce(function(u,h){return E(y,h)||u},!1);f||y.postMessage({event:"transmuxComplete",data:M[0]}),y.postMessage({event:"flush",data:d})}function p(y){return!y.audio&&!y.video&&!y.text&&!y.id3&&!y.initSegment}},"./src/demux/transmuxer.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{TransmuxConfig:()=>h,TransmuxState:()=>S,default:()=>M,isPromise:()=>u});var V=B("./src/events.ts"),K=B("./src/errors.ts"),F=B("./src/crypt/decrypter.ts"),i=B("./src/demux/aacdemuxer.ts"),U=B("./src/demux/mp4demuxer.ts"),L=B("./src/demux/tsdemuxer.ts"),v=B("./src/demux/mp3demuxer.ts"),E=B("./src/remux/mp4-remuxer.ts"),b=B("./src/remux/passthrough-remuxer.ts"),w=B("./src/utils/logger.ts"),p;try{p=self.performance.now.bind(self.performance)}catch(k){w.logger.debug("Unable to use Performance API on this environment"),p=self.Date.now}var y=[{demux:U.default,remux:b.default},{demux:L.default,remux:E.default},{demux:i.default,remux:E.default},{demux:v.default,remux:E.default}],M=function(){function k(A,I,C,P,l){this.async=!1,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=A,this.typeSupported=I,this.config=C,this.vendor=P,this.id=l}var m=k.prototype;return m.configure=function(I){this.transmuxConfig=I,this.decrypter&&this.decrypter.reset()},m.push=function(I,C,P,l){var c=this,s=P.transmuxing;s.executeStart=p();var g=new Uint8Array(I),R=this.currentTransmuxState,D=this.transmuxConfig;l&&(this.currentTransmuxState=l);var x=l||R,T=x.contiguous,O=x.discontinuity,$=x.trackSwitch,H=x.accurateTimeOffset,Z=x.timeOffset,te=x.initSegmentChange,J=D.audioCodec,ie=D.videoCodec,oe=D.defaultInitPts,ue=D.duration,Pe=D.initSegmentData,Ne=d(g,C);if(Ne&&Ne.method==="AES-128"){var Ve=this.getDecrypter();if(Ve.isSync()){var ot=Ve.softwareDecrypt(g,Ne.key.buffer,Ne.iv.buffer),Et=P.part>-1;if(Et&&(ot=Ve.flush()),!ot)return s.executeEnd=p(),f(P);g=new Uint8Array(ot)}else return this.decryptionPromise=Ve.webCryptoDecrypt(g,Ne.key.buffer,Ne.iv.buffer).then(function(ht){var ft=c.push(ht,null,P);return c.decryptionPromise=null,ft}),this.decryptionPromise}var it=this.needsProbing(O,$);it&&this.configureTransmuxer(g),(O||$||te||it)&&this.resetInitSegment(Pe,J,ie,ue,C),(O||te||it)&&this.resetInitialTimestamp(oe),T||this.resetContiguity();var Ie=this.transmux(g,Ne,Z,H,P),He=this.currentTransmuxState;return He.contiguous=!0,He.discontinuity=!1,He.trackSwitch=!1,s.executeEnd=p(),Ie},m.flush=function(I){var C=this,P=I.transmuxing;P.executeStart=p();var l=this.decrypter,c=this.currentTransmuxState,s=this.decryptionPromise;if(s)return s.then(function(){return C.flush(I)});var g=[],R=c.timeOffset;if(l){var D=l.flush();D&&g.push(this.push(D,null,I))}var x=this.demuxer,T=this.remuxer;if(!x||!T)return this.observer.emit(V.Events.ERROR,V.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),P.executeEnd=p(),[f(I)];var O=x.flush(R);return u(O)?O.then(function($){return C.flushRemux(g,$,I),g}):(this.flushRemux(g,O,I),g)},m.flushRemux=function(I,C,P){var l=C.audioTrack,c=C.videoTrack,s=C.id3Track,g=C.textTrack,R=this.currentTransmuxState,D=R.accurateTimeOffset,x=R.timeOffset;w.logger.log("[transmuxer.ts]: Flushed fragment "+P.sn+(P.part>-1?" p: "+P.part:"")+" of level "+P.level);var T=this.remuxer.remux(l,c,s,g,x,D,!0,this.id);I.push({remuxResult:T,chunkMeta:P}),P.transmuxing.executeEnd=p()},m.resetInitialTimestamp=function(I){var C=this.demuxer,P=this.remuxer;!C||!P||(C.resetTimeStamp(I),P.resetTimeStamp(I))},m.resetContiguity=function(){var I=this.demuxer,C=this.remuxer;!I||!C||(I.resetContiguity(),C.resetNextTimestamp())},m.resetInitSegment=function(I,C,P,l,c){var s=this.demuxer,g=this.remuxer;!s||!g||(s.resetInitSegment(I,C,P,l),g.resetInitSegment(I,C,P,c))},m.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},m.transmux=function(I,C,P,l,c){var s;return C&&C.method==="SAMPLE-AES"?s=this.transmuxSampleAes(I,C,P,l,c):s=this.transmuxUnencrypted(I,P,l,c),s},m.transmuxUnencrypted=function(I,C,P,l){var c=this.demuxer.demux(I,C,!1,!this.config.progressive),s=c.audioTrack,g=c.videoTrack,R=c.id3Track,D=c.textTrack,x=this.remuxer.remux(s,g,R,D,C,P,!1,this.id);return{remuxResult:x,chunkMeta:l}},m.transmuxSampleAes=function(I,C,P,l,c){var s=this;return this.demuxer.demuxSampleAes(I,C,P).then(function(g){var R=s.remuxer.remux(g.audioTrack,g.videoTrack,g.id3Track,g.textTrack,P,l,!1,s.id);return{remuxResult:R,chunkMeta:c}})},m.configureTransmuxer=function(I){for(var C=this.config,P=this.observer,l=this.typeSupported,c=this.vendor,s,g=0,R=y.length;g<R;g++)if(y[g].demux.probe(I)){s=y[g];break}s||(w.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),s={demux:U.default,remux:b.default});var D=this.demuxer,x=this.remuxer,T=s.remux,O=s.demux;(!x||!(x instanceof T))&&(this.remuxer=new T(P,C,l,c)),(!D||!(D instanceof O))&&(this.demuxer=new O(P,C,l),this.probe=O.probe)},m.needsProbing=function(I,C){return!this.demuxer||!this.remuxer||I||C},m.getDecrypter=function(){var I=this.decrypter;return I||(I=this.decrypter=new F.default(this.config)),I},k}();function d(k,m){var A=null;return k.byteLength>0&&m!=null&&m.key!=null&&m.iv!==null&&m.method!=null&&(A=m),A}var f=function(m){return{remuxResult:{},chunkMeta:m}};function u(k){return"then"in k&&k.then instanceof Function}var h=function(m,A,I,C,P){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=m,this.videoCodec=A,this.initSegmentData=I,this.duration=C,this.defaultInitPts=P},S=function(m,A,I,C,P,l){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=m,this.contiguous=A,this.accurateTimeOffset=I,this.trackSwitch=C,this.timeOffset=P,this.initSegmentChange=l}},"./src/demux/tsdemuxer.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>k});var V=B("./src/demux/adts.ts"),K=B("./src/demux/mpegaudio.ts"),F=B("./src/demux/exp-golomb.ts"),i=B("./src/demux/sample-aes.ts"),U=B("./src/events.ts"),L=B("./src/utils/mp4-tools.ts"),v=B("./src/utils/logger.ts"),E=B("./src/errors.ts"),b=B("./src/types/demuxer.ts");function w(){return w=Object.assign?Object.assign.bind():function(m){for(var A=1;A<arguments.length;A++){var I=arguments[A];for(var C in I)Object.prototype.hasOwnProperty.call(I,C)&&(m[C]=I[C])}return m},w.apply(this,arguments)}var p=188,y=function(){function m(I,C,P){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=I,this.config=C,this.typeSupported=P}m.probe=function(C){var P=m.syncOffset(C);return P>0&&v.logger.warn("MPEG2-TS detected but first sync word found @ offset "+P),P!==-1},m.syncOffset=function(C){for(var P=C.length,l=Math.min(p*5,C.length-p)+1,c=0;c<l;){for(var s=!1,g=c;g<P&&C[g]===71;g+=p)if(!s&&d(C,g)===0&&(s=!0),s&&g+p>l)return c;c++}return-1},m.createTrack=function(C,P){return{container:C==="video"||C==="audio"?"video/mp2t":void 0,type:C,id:L.RemuxerTrackIdConfig[C],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:C==="audio"?P:void 0}};var A=m.prototype;return A.resetInitSegment=function(C,P,l,c){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=m.createTrack("video"),this._audioTrack=m.createTrack("audio",c),this._id3Track=m.createTrack("id3"),this._txtTrack=m.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.audioCodec=P,this.videoCodec=l,this._duration=c},A.resetTimeStamp=function(){},A.resetContiguity=function(){var C=this._audioTrack,P=this._avcTrack,l=this._id3Track;C&&(C.pesData=null),P&&(P.pesData=null),l&&(l.pesData=null),this.aacOverFlow=null,this.avcSample=null,this.remainderData=null},A.demux=function(C,P,l,c){l===void 0&&(l=!1),c===void 0&&(c=!1),l||(this.sampleAes=null);var s,g=this._avcTrack,R=this._audioTrack,D=this._id3Track,x=this._txtTrack,T=g.pid,O=g.pesData,$=R.pid,H=D.pid,Z=R.pesData,te=D.pesData,J=null,ie=this.pmtParsed,oe=this._pmtId,ue=C.length;if(this.remainderData&&(C=(0,L.appendUint8Array)(this.remainderData,C),ue=C.length,this.remainderData=null),ue<p&&!c)return this.remainderData=C,{audioTrack:R,videoTrack:g,id3Track:D,textTrack:x};var Pe=Math.max(0,m.syncOffset(C));ue-=(ue-Pe)%p,ue<C.byteLength&&!c&&(this.remainderData=new Uint8Array(C.buffer,ue,C.buffer.byteLength-ue));for(var Ne=0,Ve=Pe;Ve<ue;Ve+=p)if(C[Ve]===71){var ot=!!(C[Ve+1]&64),Et=d(C,Ve),it=(C[Ve+3]&48)>>4,Ie=void 0;if(it>1){if(Ie=Ve+5+C[Ve+4],Ie===Ve+p)continue}else Ie=Ve+4;switch(Et){case T:ot&&(O&&(s=h(O))&&this.parseAVCPES(g,x,s,!1),O={data:[],size:0}),O&&(O.data.push(C.subarray(Ie,Ve+p)),O.size+=Ve+p-Ie);break;case $:if(ot){if(Z&&(s=h(Z)))switch(R.segmentCodec){case"aac":this.parseAACPES(R,s);break;case"mp3":this.parseMPEGPES(R,s);break}Z={data:[],size:0}}Z&&(Z.data.push(C.subarray(Ie,Ve+p)),Z.size+=Ve+p-Ie);break;case H:ot&&(te&&(s=h(te))&&this.parseID3PES(D,s),te={data:[],size:0}),te&&(te.data.push(C.subarray(Ie,Ve+p)),te.size+=Ve+p-Ie);break;case 0:ot&&(Ie+=C[Ie]+1),oe=this._pmtId=f(C,Ie);break;case oe:{ot&&(Ie+=C[Ie]+1);var He=u(C,Ie,this.typeSupported,l);T=He.avc,T>0&&(g.pid=T),$=He.audio,$>0&&(R.pid=$,R.segmentCodec=He.segmentCodec),H=He.id3,H>0&&(D.pid=H),J!==null&&!ie&&(v.logger.warn("MPEG-TS PMT found at "+Ve+" after unknown PID '"+J+"'. Backtracking to sync byte @"+Pe+" to parse all TS packets."),J=null,Ve=Pe-188),ie=this.pmtParsed=!0;break}case 17:case 8191:break;default:J=Et;break}}else Ne++;Ne>0&&this.observer.emit(U.Events.ERROR,U.Events.ERROR,{type:E.ErrorTypes.MEDIA_ERROR,details:E.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"Found "+Ne+" TS packet/s that do not start with 0x47"}),g.pesData=O,R.pesData=Z,D.pesData=te;var ht={audioTrack:R,videoTrack:g,id3Track:D,textTrack:x};return c&&this.extractRemainingSamples(ht),ht},A.flush=function(){var C=this.remainderData;this.remainderData=null;var P;return C?P=this.demux(C,-1,!1,!0):P={videoTrack:this._avcTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(P),this.sampleAes?this.decrypt(P,this.sampleAes):P},A.extractRemainingSamples=function(C){var P=C.audioTrack,l=C.videoTrack,c=C.id3Track,s=C.textTrack,g=l.pesData,R=P.pesData,D=c.pesData,x;if(g&&(x=h(g))?(this.parseAVCPES(l,s,x,!0),l.pesData=null):l.pesData=g,R&&(x=h(R))){switch(P.segmentCodec){case"aac":this.parseAACPES(P,x);break;case"mp3":this.parseMPEGPES(P,x);break}P.pesData=null}else R!=null&&R.size&&v.logger.log("last AAC PES packet truncated,might overlap between fragments"),P.pesData=R;D&&(x=h(D))?(this.parseID3PES(c,x),c.pesData=null):c.pesData=D},A.demuxSampleAes=function(C,P,l){var c=this.demux(C,l,!0,!this.config.progressive),s=this.sampleAes=new i.default(this.observer,this.config,P);return this.decrypt(c,s)},A.decrypt=function(C,P){return new Promise(function(l){var c=C.audioTrack,s=C.videoTrack;c.samples&&c.segmentCodec==="aac"?P.decryptAacSamples(c.samples,0,function(){s.samples?P.decryptAvcSamples(s.samples,0,0,function(){l(C)}):l(C)}):s.samples&&P.decryptAvcSamples(s.samples,0,0,function(){l(C)})})},A.destroy=function(){this._duration=0},A.parseAVCPES=function(C,P,l,c){var s=this,g=this.parseAVCNALu(C,l.data),R=!1,D=this.avcSample,x,T=!1;l.data=null,D&&g.length&&!C.audFound&&(S(D,C),D=this.avcSample=M(!1,l.pts,l.dts,"")),g.forEach(function(O){switch(O.type){case 1:{x=!0,D||(D=s.avcSample=M(!0,l.pts,l.dts,"")),R&&(D.debug+="NDR "),D.frame=!0;var $=O.data;if(T&&$.length>4){var H=new F.default($).readSliceType();(H===2||H===4||H===7||H===9)&&(D.key=!0)}break}case 5:x=!0,D||(D=s.avcSample=M(!0,l.pts,l.dts,"")),R&&(D.debug+="IDR "),D.key=!0,D.frame=!0;break;case 6:{x=!0,R&&D&&(D.debug+="SEI "),(0,L.parseSEIMessageFromNALu)(O.data,1,l.pts,P.samples);break}case 7:if(x=!0,T=!0,R&&D&&(D.debug+="SPS "),!C.sps){var Z=new F.default(O.data),te=Z.readSPS();C.width=te.width,C.height=te.height,C.pixelRatio=te.pixelRatio,C.sps=[O.data],C.duration=s._duration;for(var J=O.data.subarray(1,4),ie="avc1.",oe=0;oe<3;oe++){var ue=J[oe].toString(16);ue.length<2&&(ue="0"+ue),ie+=ue}C.codec=ie}break;case 8:x=!0,R&&D&&(D.debug+="PPS "),C.pps||(C.pps=[O.data]);break;case 9:x=!1,C.audFound=!0,D&&S(D,C),D=s.avcSample=M(!1,l.pts,l.dts,R?"AUD ":"");break;case 12:x=!0;break;default:x=!1,D&&(D.debug+="unknown NAL "+O.type+" ");break}if(D&&x){var Pe=D.units;Pe.push(O)}}),c&&D&&(S(D,C),this.avcSample=null)},A.getLastNalUnit=function(C){var P,l=this.avcSample,c;if((!l||l.units.length===0)&&(l=C[C.length-1]),(P=l)!==null&&P!==void 0&&P.units){var s=l.units;c=s[s.length-1]}return c},A.parseAVCNALu=function(C,P){var l=P.byteLength,c=C.naluState||0,s=c,g=[],R=0,D,x,T,O=-1,$=0;for(c===-1&&(O=0,$=P[0]&31,c=0,R=1);R<l;){if(D=P[R++],!c){c=D?0:1;continue}if(c===1){c=D?0:2;continue}if(!D)c=3;else if(D===1){if(O>=0){var H={data:P.subarray(O,R-c-1),type:$};g.push(H)}else{var Z=this.getLastNalUnit(C.samples);if(Z&&(s&&R<=4-s&&Z.state&&(Z.data=Z.data.subarray(0,Z.data.byteLength-s)),x=R-c-1,x>0)){var te=new Uint8Array(Z.data.byteLength+x);te.set(Z.data,0),te.set(P.subarray(0,x),Z.data.byteLength),Z.data=te,Z.state=0}}R<l?(T=P[R]&31,O=R,$=T,c=0):c=-1}else c=0}if(O>=0&&c>=0){var J={data:P.subarray(O,l),type:$,state:c};g.push(J)}if(g.length===0){var ie=this.getLastNalUnit(C.samples);if(ie){var oe=new Uint8Array(ie.data.byteLength+P.byteLength);oe.set(ie.data,0),oe.set(P,ie.data.byteLength),ie.data=oe}}return C.naluState=c,g},A.parseAACPES=function(C,P){var l=0,c=this.aacOverFlow,s=P.data;if(c){this.aacOverFlow=null;var g=c.missing,R=c.sample.unit.byteLength;if(g===-1){var D=new Uint8Array(R+s.byteLength);D.set(c.sample.unit,0),D.set(s,R),s=D}else{var x=R-g;c.sample.unit.set(s.subarray(0,g),x),C.samples.push(c.sample),l=c.missing}}var T,O;for(T=l,O=s.length;T<O-1&&!V.isHeader(s,T);T++);if(T!==l){var $,H;if(T<O-1?($="AAC PES did not start with ADTS header,offset:"+T,H=!1):($="no ADTS header found in AAC PES",H=!0),v.logger.warn("parsing error:"+$),this.observer.emit(U.Events.ERROR,U.Events.ERROR,{type:E.ErrorTypes.MEDIA_ERROR,details:E.ErrorDetails.FRAG_PARSING_ERROR,fatal:H,reason:$}),H)return}V.initTrackConfig(C,this.observer,s,T,this.audioCodec);var Z;if(P.pts!==void 0)Z=P.pts;else if(c){var te=V.getFrameDuration(C.samplerate);Z=c.sample.pts+te}else{v.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var J=0,ie;T<O;)if(ie=V.appendFrame(C,s,T,Z,J),T+=ie.length,ie.missing){this.aacOverFlow=ie;break}else for(J++;T<O-1&&!V.isHeader(s,T);T++);},A.parseMPEGPES=function(C,P){var l=P.data,c=l.length,s=0,g=0,R=P.pts;if(R===void 0){v.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;g<c;)if(K.isHeader(l,g)){var D=K.appendFrame(C,l,g,R,s);if(D)g+=D.length,s++;else break}else g++},A.parseID3PES=function(C,P){if(P.pts===void 0){v.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}var l=w({},P,{type:this._avcTrack?b.MetadataSchema.emsg:b.MetadataSchema.audioId3,duration:Number.POSITIVE_INFINITY});C.samples.push(l)},m}();function M(m,A,I,C){return{key:m,frame:!1,pts:A,dts:I,units:[],debug:C,length:0}}function d(m,A){return((m[A+1]&31)<<8)+m[A+2]}function f(m,A){return(m[A+10]&31)<<8|m[A+11]}function u(m,A,I,C){var P={audio:-1,avc:-1,id3:-1,segmentCodec:"aac"},l=(m[A+1]&15)<<8|m[A+2],c=A+3+l-4,s=(m[A+10]&15)<<8|m[A+11];for(A+=12+s;A<c;){var g=d(m,A);switch(m[A]){case 207:if(!C){v.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:P.audio===-1&&(P.audio=g);break;case 21:P.id3===-1&&(P.id3=g);break;case 219:if(!C){v.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:P.avc===-1&&(P.avc=g);break;case 3:case 4:I.mpeg!==!0&&I.mp3!==!0?v.logger.log("MPEG audio found, not supported in this browser"):P.audio===-1&&(P.audio=g,P.segmentCodec="mp3");break;case 36:v.logger.warn("Unsupported HEVC stream type found");break;default:break}A+=((m[A+3]&15)<<8|m[A+4])+5}return P}function h(m){var A=0,I,C,P,l,c,s=m.data;if(!m||m.size===0)return null;for(;s[0].length<19&&s.length>1;){var g=new Uint8Array(s[0].length+s[1].length);g.set(s[0]),g.set(s[1],s[0].length),s[0]=g,s.splice(1,1)}I=s[0];var R=(I[0]<<16)+(I[1]<<8)+I[2];if(R===1){if(C=(I[4]<<8)+I[5],C&&C>m.size-6)return null;var D=I[7];D&192&&(l=(I[9]&14)*536870912+(I[10]&255)*4194304+(I[11]&254)*16384+(I[12]&255)*128+(I[13]&254)/2,D&64?(c=(I[14]&14)*536870912+(I[15]&255)*4194304+(I[16]&254)*16384+(I[17]&255)*128+(I[18]&254)/2,l-c>54e5&&(v.logger.warn(Math.round((l-c)/9e4)+"s delta between PTS and DTS, align them"),l=c)):c=l),P=I[8];var x=P+9;if(m.size<=x)return null;m.size-=x;for(var T=new Uint8Array(m.size),O=0,$=s.length;O<$;O++){I=s[O];var H=I.byteLength;if(x)if(x>H){x-=H;continue}else I=I.subarray(x),H-=x,x=0;T.set(I,A),A+=H}return C&&(C-=P+3),{data:T,pts:l,dts:c,len:C}}return null}function S(m,A){if(m.units.length&&m.frame){if(m.pts===void 0){var I=A.samples,C=I.length;if(C){var P=I[C-1];m.pts=P.pts,m.dts=P.dts}else{A.dropped++;return}}A.samples.push(m)}m.debug.length&&v.logger.log(m.pts+"/"+m.dts+":"+m.debug)}const k=y},"./src/demux/webworkify-webpack.js":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>p});var V=function(){var M=ENTRY_MODULE,d={},f=function h(S){var k=d[S];if(k!==void 0)return k.exports;var m=d[S]={exports:{}};return M[S].call(m.exports,m,m.exports,h),m.exports};f.m=M,function(){f.n=function(h){var S=h&&h.__esModule?function(){return h.default}:function(){return h};return f.d(S,{a:S}),S}}(),function(){f.d=function(h,S){for(var k in S)f.o(S,k)&&!f.o(h,k)&&Object.defineProperty(h,k,{enumerable:!0,get:S[k]})}}(),function(){f.o=function(h,S){return Object.prototype.hasOwnProperty.call(h,S)}}(),function(){f.r=function(h){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(h,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(h,"__esModule",{value:!0})}}();var u=f(ENTRY_MODULE);return u.default||u},K=V.toString().split("ENTRY_MODULE"),F="[\\.|\\-|\\+|\\w|/|@]+",i="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+F+").*?\\)";function U(y){return(y+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function L(y){return!isNaN(1*y)}function v(y,M,d){var f={};f[d]=[];var u=M.toString().replace(/^"[^"]+"/,"function"),h=u.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/)||u.match(/^\(\w+,\s*\w+,\s*(\w+)\)\s?\=\s?\>/);if(!h)return f;for(var S=h[1],k=new RegExp("(\\\\n|\\W)"+U(S)+i,"g"),m;m=k.exec(u);)m[3]!=="dll-reference"&&f[d].push(m[3]);for(k=new RegExp("\\("+U(S)+'\\("(dll-reference\\s('+F+'))"\\)\\)'+i,"g");m=k.exec(u);)y[m[2]]||(f[d].push(m[1]),y[m[2]]=B(m[1]).m),f[m[2]]=f[m[2]]||[],f[m[2]].push(m[4]);for(var A=Object.keys(f),I=0;I<A.length;I++)for(var C=0;C<f[A[I]].length;C++)L(f[A[I]][C])&&(f[A[I]][C]=1*f[A[I]][C]);return f}function E(y){var M=Object.keys(y);return M.reduce(function(d,f){return d||y[f].length>0},!1)}function b(y,M){for(var d={main:[M]},f={main:[]},u={main:{}};E(d);)for(var h=Object.keys(d),S=0;S<h.length;S++){var k=h[S],m=d[k],A=m.pop();if(u[k]=u[k]||{},!(u[k][A]||!y[k][A])){u[k][A]=!0,f[k]=f[k]||[],f[k].push(A);for(var I=v(y,y[k][A],k),C=Object.keys(I),P=0;P<C.length;P++)d[C[P]]=d[C[P]]||[],d[C[P]]=d[C[P]].concat(I[C[P]])}}return f}function w(y,M,d,f){var u=y[f].map(function(h){return'"'+h+'": '+M[f][h].toString().replace(/^"[^"]+"/,"function")}).join(",");return K[0]+"{"+u+"}"+K[1]+'"'+d+'"'+K[2]}function p(y,M){M=M||{};var d={main:B.m},f=M.all?{main:Object.keys(d.main)}:b(d,y),u="";Object.keys(f).filter(function(A){return A!=="main"}).forEach(function(A){for(var I=0;f[A][I];)I++;f[A].push(I),d[A][I]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",u=u+("var "+A+" = ("+w(f,d,I,modules)+`)();
`)}),u=u+("new (("+w(f,d,y,"main")+")())(self);");var h=new window.Blob([u],{type:"text/javascript"}),S=window.URL||window.webkitURL||window.mozURL||window.msURL,k=S.createObjectURL(h),m=new window.Worker(k);return m.objectURL=k,m}},"./src/errors.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{ErrorDetails:()=>K,ErrorTypes:()=>V});var V;(function(F){F.NETWORK_ERROR="networkError",F.MEDIA_ERROR="mediaError",F.KEY_SYSTEM_ERROR="keySystemError",F.MUX_ERROR="muxError",F.OTHER_ERROR="otherError"})(V||(V={}));var K;(function(F){F.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",F.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",F.KEY_SYSTEM_NO_SESSION="keySystemNoSession",F.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",F.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",F.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",F.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",F.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",F.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",F.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",F.MANIFEST_LOAD_ERROR="manifestLoadError",F.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",F.MANIFEST_PARSING_ERROR="manifestParsingError",F.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",F.LEVEL_EMPTY_ERROR="levelEmptyError",F.LEVEL_LOAD_ERROR="levelLoadError",F.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",F.LEVEL_SWITCH_ERROR="levelSwitchError",F.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",F.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",F.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",F.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",F.FRAG_LOAD_ERROR="fragLoadError",F.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",F.FRAG_DECRYPT_ERROR="fragDecryptError",F.FRAG_PARSING_ERROR="fragParsingError",F.REMUX_ALLOC_ERROR="remuxAllocError",F.KEY_LOAD_ERROR="keyLoadError",F.KEY_LOAD_TIMEOUT="keyLoadTimeOut",F.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",F.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",F.BUFFER_APPEND_ERROR="bufferAppendError",F.BUFFER_APPENDING_ERROR="bufferAppendingError",F.BUFFER_STALLED_ERROR="bufferStalledError",F.BUFFER_FULL_ERROR="bufferFullError",F.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",F.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",F.INTERNAL_EXCEPTION="internalException",F.INTERNAL_ABORTED="aborted",F.UNKNOWN="unknown"})(K||(K={}))},"./src/events.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{Events:()=>V});var V;(function(K){K.MEDIA_ATTACHING="hlsMediaAttaching",K.MEDIA_ATTACHED="hlsMediaAttached",K.MEDIA_DETACHING="hlsMediaDetaching",K.MEDIA_DETACHED="hlsMediaDetached",K.BUFFER_RESET="hlsBufferReset",K.BUFFER_CODECS="hlsBufferCodecs",K.BUFFER_CREATED="hlsBufferCreated",K.BUFFER_APPENDING="hlsBufferAppending",K.BUFFER_APPENDED="hlsBufferAppended",K.BUFFER_EOS="hlsBufferEos",K.BUFFER_FLUSHING="hlsBufferFlushing",K.BUFFER_FLUSHED="hlsBufferFlushed",K.MANIFEST_LOADING="hlsManifestLoading",K.MANIFEST_LOADED="hlsManifestLoaded",K.MANIFEST_PARSED="hlsManifestParsed",K.LEVEL_SWITCHING="hlsLevelSwitching",K.LEVEL_SWITCHED="hlsLevelSwitched",K.LEVEL_LOADING="hlsLevelLoading",K.LEVEL_LOADED="hlsLevelLoaded",K.LEVEL_UPDATED="hlsLevelUpdated",K.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",K.LEVELS_UPDATED="hlsLevelsUpdated",K.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",K.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",K.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",K.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",K.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",K.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",K.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",K.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",K.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",K.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",K.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",K.CUES_PARSED="hlsCuesParsed",K.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",K.INIT_PTS_FOUND="hlsInitPtsFound",K.FRAG_LOADING="hlsFragLoading",K.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",K.FRAG_LOADED="hlsFragLoaded",K.FRAG_DECRYPTED="hlsFragDecrypted",K.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",K.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",K.FRAG_PARSING_METADATA="hlsFragParsingMetadata",K.FRAG_PARSED="hlsFragParsed",K.FRAG_BUFFERED="hlsFragBuffered",K.FRAG_CHANGED="hlsFragChanged",K.FPS_DROP="hlsFpsDrop",K.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",K.ERROR="hlsError",K.DESTROYING="hlsDestroying",K.KEY_LOADING="hlsKeyLoading",K.KEY_LOADED="hlsKeyLoaded",K.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",K.BACK_BUFFER_REACHED="hlsBackBufferReached"})(V||(V={}))},"./src/hls.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>I});var V=B("./node_modules/url-toolkit/src/url-toolkit.js"),K=B.n(V),F=B("./src/loader/playlist-loader.ts"),i=B("./src/controller/id3-track-controller.ts"),U=B("./src/controller/latency-controller.ts"),L=B("./src/controller/level-controller.ts"),v=B("./src/controller/fragment-tracker.ts"),E=B("./src/loader/key-loader.ts"),b=B("./src/controller/stream-controller.ts"),w=B("./src/is-supported.ts"),p=B("./src/utils/logger.ts"),y=B("./src/config.ts"),M=B("./node_modules/eventemitter3/index.js"),d=B.n(M),f=B("./src/events.ts"),u=B("./src/errors.ts"),h=B("./src/types/level.ts");function S(C,P){for(var l=0;l<P.length;l++){var c=P[l];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(C,m(c.key),c)}}function k(C,P,l){return P&&S(C.prototype,P),l&&S(C,l),Object.defineProperty(C,"prototype",{writable:!1}),C}function m(C){var P=A(C,"string");return typeof P=="symbol"?P:String(P)}function A(C,P){if(typeof C!="object"||C===null)return C;var l=C[Symbol.toPrimitive];if(l!==void 0){var c=l.call(C,P||"default");if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(P==="string"?String:Number)(C)}var I=function(){C.isSupported=function(){return(0,w.isSupported)()};function C(l){l===void 0&&(l={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new M.EventEmitter,this._autoLevelCapping=void 0,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var c=this.config=(0,y.mergeConfig)(C.DefaultConfig,l);this.userConfig=l,(0,p.enableLogs)(c.debug,"Hls instance"),this._autoLevelCapping=-1,c.progressive&&(0,y.enableStreamingMode)(c);var s=c.abrController,g=c.bufferController,R=c.capLevelController,D=c.fpsController,x=this.abrController=new s(this),T=this.bufferController=new g(this),O=this.capLevelController=new R(this),$=new D(this),H=new F.default(this),Z=new i.default(this),te=this.levelController=new L.default(this),J=new v.FragmentTracker(this),ie=new E.default(this.config),oe=this.streamController=new b.default(this,J,ie);O.setStreamController(oe),$.setStreamController(oe);var ue=[H,te,oe];this.networkControllers=ue;var Pe=[x,T,O,$,Z,J];this.audioTrackController=this.createController(c.audioTrackController,ue);var Ne=c.audioStreamController;Ne&&ue.push(new Ne(this,J,ie)),this.subtitleTrackController=this.createController(c.subtitleTrackController,ue);var Ve=c.subtitleStreamController;Ve&&ue.push(new Ve(this,J,ie)),this.createController(c.timelineController,Pe),ie.emeController=this.emeController=this.createController(c.emeController,Pe),this.cmcdController=this.createController(c.cmcdController,Pe),this.latencyController=this.createController(U.default,Pe),this.coreComponents=Pe}var P=C.prototype;return P.createController=function(c,s){if(c){var g=new c(this);return s&&s.push(g),g}return null},P.on=function(c,s,g){g===void 0&&(g=this),this._emitter.on(c,s,g)},P.once=function(c,s,g){g===void 0&&(g=this),this._emitter.once(c,s,g)},P.removeAllListeners=function(c){this._emitter.removeAllListeners(c)},P.off=function(c,s,g,R){g===void 0&&(g=this),this._emitter.off(c,s,g,R)},P.listeners=function(c){return this._emitter.listeners(c)},P.emit=function(c,s,g){return this._emitter.emit(c,s,g)},P.trigger=function(c,s){if(this.config.debug)return this.emit(c,c,s);try{return this.emit(c,c,s)}catch(g){p.logger.error("An internal error happened while handling event "+c+'. Error message: "'+g.message+'". Here is a stacktrace:',g),this.trigger(f.Events.ERROR,{type:u.ErrorTypes.OTHER_ERROR,details:u.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:c,error:g})}return!1},P.listenerCount=function(c){return this._emitter.listenerCount(c)},P.destroy=function(){p.logger.log("destroy"),this.trigger(f.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(c){return c.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(c){return c.destroy()}),this.coreComponents.length=0},P.attachMedia=function(c){p.logger.log("attachMedia"),this._media=c,this.trigger(f.Events.MEDIA_ATTACHING,{media:c})},P.detachMedia=function(){p.logger.log("detachMedia"),this.trigger(f.Events.MEDIA_DETACHING,void 0),this._media=null},P.loadSource=function(c){this.stopLoad();var s=this.media,g=this.url,R=this.url=V.buildAbsoluteURL(self.location.href,c,{alwaysNormalize:!0});p.logger.log("loadSource:"+R),s&&g&&g!==R&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(s)),this.trigger(f.Events.MANIFEST_LOADING,{url:c})},P.startLoad=function(c){c===void 0&&(c=-1),p.logger.log("startLoad("+c+")"),this.networkControllers.forEach(function(s){s.startLoad(c)})},P.stopLoad=function(){p.logger.log("stopLoad"),this.networkControllers.forEach(function(c){c.stopLoad()})},P.swapAudioCodec=function(){p.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},P.recoverMediaError=function(){p.logger.log("recoverMediaError");var c=this._media;this.detachMedia(),c&&this.attachMedia(c)},P.removeLevel=function(c,s){s===void 0&&(s=0),this.levelController.removeLevel(c,s)},k(C,[{key:"levels",get:function(){var c=this.levelController.levels;return c||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(c){p.logger.log("set currentLevel:"+c),this.loadLevel=c,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(c){p.logger.log("set nextLevel:"+c),this.levelController.manualLevel=c,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(c){p.logger.log("set loadLevel:"+c),this.levelController.manualLevel=c}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(c){this.levelController.nextLoadLevel=c}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(c){p.logger.log("set firstLevel:"+c),this.levelController.firstLevel=c}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(c){p.logger.log("set startLevel:"+c),c!==-1&&(c=Math.max(c,this.minAutoLevel)),this.levelController.startLevel=c}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(c){var s=!!c;s!==this.config.capLevelToPlayerSize&&(s?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=s)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(c){this._autoLevelCapping!==c&&(p.logger.log("set autoLevelCapping:"+c),this._autoLevelCapping=c)}},{key:"bandwidthEstimate",get:function(){var c=this.abrController.bwEstimator;return c?c.getEstimate():NaN}},{key:"maxHdcpLevel",get:function(){return this._maxHdcpLevel},set:function(c){h.HdcpLevels.indexOf(c)>-1&&(this._maxHdcpLevel=c)}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var c=this.levels,s=this.config.minAutoBitrate;if(!c)return 0;for(var g=c.length,R=0;R<g;R++)if(c[R].maxBitrate>=s)return R;return 0}},{key:"maxAutoLevel",get:function(){var c=this.levels,s=this.autoLevelCapping,g=this.maxHdcpLevel,R;if(s===-1&&c&&c.length?R=c.length-1:R=s,g)for(var D=R;D--;){var x=c[D].attrs["HDCP-LEVEL"];if(x&&x<=g)return D}return R}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(c){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,c)}},{key:"playingDate",get:function(){return this.streamController.currentProgramDateTime}},{key:"mainForwardBufferInfo",get:function(){return this.streamController.getMainFwdBufferInfo()}},{key:"audioTracks",get:function(){var c=this.audioTrackController;return c?c.audioTracks:[]}},{key:"audioTrack",get:function(){var c=this.audioTrackController;return c?c.audioTrack:-1},set:function(c){var s=this.audioTrackController;s&&(s.audioTrack=c)}},{key:"subtitleTracks",get:function(){var c=this.subtitleTrackController;return c?c.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var c=this.subtitleTrackController;return c?c.subtitleTrack:-1},set:function(c){var s=this.subtitleTrackController;s&&(s.subtitleTrack=c)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var c=this.subtitleTrackController;return c?c.subtitleDisplay:!1},set:function(c){var s=this.subtitleTrackController;s&&(s.subtitleDisplay=c)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(c){this.config.lowLatencyMode=c}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.3.5"}},{key:"Events",get:function(){return f.Events}},{key:"ErrorTypes",get:function(){return u.ErrorTypes}},{key:"ErrorDetails",get:function(){return u.ErrorDetails}},{key:"DefaultConfig",get:function(){return C.defaultConfig?C.defaultConfig:y.hlsDefaultConfig},set:function(c){C.defaultConfig=c}}]),C}();I.defaultConfig=void 0},"./src/is-supported.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{changeTypeSupported:()=>i,isSupported:()=>F});var V=B("./src/utils/mediasource-helper.ts");function K(){return self.SourceBuffer||self.WebKitSourceBuffer}function F(){var U=(0,V.getMediaSource)();if(!U)return!1;var L=K(),v=U&&typeof U.isTypeSupported=="function"&&U.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),E=!L||L.prototype&&typeof L.prototype.appendBuffer=="function"&&typeof L.prototype.remove=="function";return!!v&&!!E}function i(){var U,L=K();return typeof(L==null||(U=L.prototype)===null||U===void 0?void 0:U.changeType)=="function"}},"./src/loader/date-range.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{DateRange:()=>w,DateRangeAttribute:()=>b});var V=B("./src/polyfills/number.ts"),K=B("./src/utils/attr-list.ts"),F=B("./src/utils/logger.ts");function i(){return i=Object.assign?Object.assign.bind():function(p){for(var y=1;y<arguments.length;y++){var M=arguments[y];for(var d in M)Object.prototype.hasOwnProperty.call(M,d)&&(p[d]=M[d])}return p},i.apply(this,arguments)}function U(p,y){for(var M=0;M<y.length;M++){var d=y[M];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(p,v(d.key),d)}}function L(p,y,M){return y&&U(p.prototype,y),M&&U(p,M),Object.defineProperty(p,"prototype",{writable:!1}),p}function v(p){var y=E(p,"string");return typeof y=="symbol"?y:String(y)}function E(p,y){if(typeof p!="object"||p===null)return p;var M=p[Symbol.toPrimitive];if(M!==void 0){var d=M.call(p,y||"default");if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(y==="string"?String:Number)(p)}var b;(function(p){p.ID="ID",p.CLASS="CLASS",p.START_DATE="START-DATE",p.DURATION="DURATION",p.END_DATE="END-DATE",p.END_ON_NEXT="END-ON-NEXT",p.PLANNED_DURATION="PLANNED-DURATION",p.SCTE35_OUT="SCTE35-OUT",p.SCTE35_IN="SCTE35-IN"})(b||(b={}));var w=function(){function p(y,M){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,M){var d=M.attr;for(var f in d)if(Object.prototype.hasOwnProperty.call(y,f)&&y[f]!==d[f]){F.logger.warn('DATERANGE tag attribute: "'+f+'" does not match for tags with ID: "'+y.ID+'"'),this._badValueForSameId=f;break}y=i(new K.AttrList({}),d,y)}if(this.attr=y,this._startDate=new Date(y[b.START_DATE]),b.END_DATE in this.attr){var u=new Date(this.attr[b.END_DATE]);(0,V.isFiniteNumber)(u.getTime())&&(this._endDate=u)}}return L(p,[{key:"id",get:function(){return this.attr.ID}},{key:"class",get:function(){return this.attr.CLASS}},{key:"startDate",get:function(){return this._startDate}},{key:"endDate",get:function(){if(this._endDate)return this._endDate;var M=this.duration;return M!==null?new Date(this._startDate.getTime()+M*1e3):null}},{key:"duration",get:function(){if(b.DURATION in this.attr){var M=this.attr.decimalFloatingPoint(b.DURATION);if((0,V.isFiniteNumber)(M))return M}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}},{key:"plannedDuration",get:function(){return b.PLANNED_DURATION in this.attr?this.attr.decimalFloatingPoint(b.PLANNED_DURATION):null}},{key:"endOnNext",get:function(){return this.attr.bool(b.END_ON_NEXT)}},{key:"isValid",get:function(){return!!this.id&&!this._badValueForSameId&&(0,V.isFiniteNumber)(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)}}]),p}()},"./src/loader/fragment-loader.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{LoadError:()=>M,default:()=>p});var V=B("./src/polyfills/number.ts"),K=B("./src/errors.ts");function F(d,f){d.prototype=Object.create(f.prototype),d.prototype.constructor=d,E(d,f)}function i(d){var f=typeof Map=="function"?new Map:void 0;return i=function(h){if(h===null||!v(h))return h;if(typeof h!="function")throw new TypeError("Super expression must either be null or a function");if(typeof f!="undefined"){if(f.has(h))return f.get(h);f.set(h,S)}function S(){return U(h,arguments,b(this).constructor)}return S.prototype=Object.create(h.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),E(S,h)},i(d)}function U(d,f,u){return L()?U=Reflect.construct.bind():U=function(S,k,m){var A=[null];A.push.apply(A,k);var I=Function.bind.apply(S,A),C=new I;return m&&E(C,m.prototype),C},U.apply(null,arguments)}function L(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(d){return!1}}function v(d){return Function.toString.call(d).indexOf("[native code]")!==-1}function E(d,f){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(h,S){return h.__proto__=S,h},E(d,f)}function b(d){return b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(u){return u.__proto__||Object.getPrototypeOf(u)},b(d)}var w=Math.pow(2,17),p=function(){function d(u){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=u}var f=d.prototype;return f.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},f.abort=function(){this.loader&&this.loader.abort()},f.load=function(h,S){var k=this,m=h.url;if(!m)return Promise.reject(new M({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,networkDetails:null},"Fragment does not have a "+(m?"part list":"url")));this.abort();var A=this.config,I=A.fLoader,C=A.loader;return new Promise(function(P,l){k.loader&&k.loader.destroy();var c=k.loader=h.loader=I?new I(A):new C(A),s=y(h),g={timeout:A.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:A.fragLoadingMaxRetryTimeout,highWaterMark:h.sn==="initSegment"?1/0:w};h.stats=c.stats,c.load(s,g,{onSuccess:function(D,x,T,O){k.resetLoader(h,c);var $=D.data;T.resetIV&&h.decryptdata&&(h.decryptdata.iv=new Uint8Array($.slice(0,16)),$=$.slice(16)),P({frag:h,part:null,payload:$,networkDetails:O})},onError:function(D,x,T){k.resetLoader(h,c),l(new M({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,response:D,networkDetails:T}))},onAbort:function(D,x,T){k.resetLoader(h,c),l(new M({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:h,networkDetails:T}))},onTimeout:function(D,x,T){k.resetLoader(h,c),l(new M({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:h,networkDetails:T}))},onProgress:function(D,x,T,O){S&&S({frag:h,part:null,payload:T,networkDetails:O})}})})},f.loadPart=function(h,S,k){var m=this;this.abort();var A=this.config,I=A.fLoader,C=A.loader;return new Promise(function(P,l){m.loader&&m.loader.destroy();var c=m.loader=h.loader=I?new I(A):new C(A),s=y(h,S),g={timeout:A.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:A.fragLoadingMaxRetryTimeout,highWaterMark:w};S.stats=c.stats,c.load(s,g,{onSuccess:function(D,x,T,O){m.resetLoader(h,c),m.updateStatsFromPart(h,S);var $={frag:h,part:S,payload:D.data,networkDetails:O};k($),P($)},onError:function(D,x,T){m.resetLoader(h,c),l(new M({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,part:S,response:D,networkDetails:T}))},onAbort:function(D,x,T){h.stats.aborted=S.stats.aborted,m.resetLoader(h,c),l(new M({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:h,part:S,networkDetails:T}))},onTimeout:function(D,x,T){m.resetLoader(h,c),l(new M({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:h,part:S,networkDetails:T}))}})})},f.updateStatsFromPart=function(h,S){var k=h.stats,m=S.stats,A=m.total;if(k.loaded+=m.loaded,A){var I=Math.round(h.duration/S.duration),C=Math.min(Math.round(k.loaded/A),I),P=I-C,l=P*Math.round(k.loaded/C);k.total=k.loaded+l}else k.total=Math.max(k.loaded,k.total);var c=k.loading,s=m.loading;c.start?c.first+=s.first-s.start:(c.start=s.start,c.first=s.first),c.end=s.end},f.resetLoader=function(h,S){h.loader=null,this.loader===S&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),S.destroy()},d}();function y(d,f){f===void 0&&(f=null);var u=f||d,h={frag:d,part:f,responseType:"arraybuffer",url:u.url,headers:{},rangeStart:0,rangeEnd:0},S=u.byteRangeStartOffset,k=u.byteRangeEndOffset;if((0,V.isFiniteNumber)(S)&&(0,V.isFiniteNumber)(k)){var m,A=S,I=k;if(d.sn==="initSegment"&&((m=d.decryptdata)===null||m===void 0?void 0:m.method)==="AES-128"){var C=k-S;C%16&&(I=k+(16-C%16)),S!==0&&(h.resetIV=!0,A=S-16)}h.rangeStart=A,h.rangeEnd=I}return h}var M=function(d){F(f,d);function f(u){for(var h,S=arguments.length,k=new Array(S>1?S-1:0),m=1;m<S;m++)k[m-1]=arguments[m];return h=d.call.apply(d,[this].concat(k))||this,h.data=void 0,h.data=u,h}return f}(i(Error))},"./src/loader/fragment.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{BaseSegment:()=>y,ElementaryStreamTypes:()=>p,Fragment:()=>M,Part:()=>d});var V=B("./src/polyfills/number.ts"),K=B("./node_modules/url-toolkit/src/url-toolkit.js"),F=B.n(K),i=B("./src/loader/load-stats.ts");function U(f,u){f.prototype=Object.create(u.prototype),f.prototype.constructor=f,L(f,u)}function L(f,u){return L=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(S,k){return S.__proto__=k,S},L(f,u)}function v(f,u){for(var h=0;h<u.length;h++){var S=u[h];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(f,b(S.key),S)}}function E(f,u,h){return u&&v(f.prototype,u),h&&v(f,h),Object.defineProperty(f,"prototype",{writable:!1}),f}function b(f){var u=w(f,"string");return typeof u=="symbol"?u:String(u)}function w(f,u){if(typeof f!="object"||f===null)return f;var h=f[Symbol.toPrimitive];if(h!==void 0){var S=h.call(f,u||"default");if(typeof S!="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return(u==="string"?String:Number)(f)}var p;(function(f){f.AUDIO="audio",f.VIDEO="video",f.AUDIOVIDEO="audiovideo"})(p||(p={}));var y=function(){function f(h){var S;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(S={},S[p.AUDIO]=null,S[p.VIDEO]=null,S[p.AUDIOVIDEO]=null,S),this.baseurl=h}var u=f.prototype;return u.setByteRange=function(S,k){var m=S.split("@",2),A=[];m.length===1?A[0]=k?k.byteRangeEndOffset:0:A[0]=parseInt(m[1]),A[1]=parseInt(m[0])+A[0],this._byteRange=A},E(f,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=(0,K.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(S){this._url=S}}]),f}(),M=function(f){U(u,f);function u(S,k){var m;return m=f.call(this,k)||this,m._decryptdata=null,m.rawProgramDateTime=null,m.programDateTime=null,m.tagList=[],m.duration=0,m.sn=0,m.levelkeys=void 0,m.type=void 0,m.loader=null,m.keyLoader=null,m.level=-1,m.cc=0,m.startPTS=void 0,m.endPTS=void 0,m.appendedPTS=void 0,m.startDTS=void 0,m.endDTS=void 0,m.start=0,m.deltaPTS=void 0,m.maxStartPTS=void 0,m.minEndPTS=void 0,m.stats=new i.LoadStats,m.urlId=0,m.data=void 0,m.bitrateTest=!1,m.title=null,m.initSegment=null,m.endList=void 0,m.type=S,m}var h=u.prototype;return h.setKeyFormat=function(k){if(this.levelkeys){var m=this.levelkeys[k];m&&!this._decryptdata&&(this._decryptdata=m.getDecryptData(this.sn))}},h.abortRequests=function(){var k,m;(k=this.loader)===null||k===void 0||k.abort(),(m=this.keyLoader)===null||m===void 0||m.abort()},h.setElementaryStreamInfo=function(k,m,A,I,C,P){P===void 0&&(P=!1);var l=this.elementaryStreams,c=l[k];if(!c){l[k]={startPTS:m,endPTS:A,startDTS:I,endDTS:C,partial:P};return}c.startPTS=Math.min(c.startPTS,m),c.endPTS=Math.max(c.endPTS,A),c.startDTS=Math.min(c.startDTS,I),c.endDTS=Math.max(c.endDTS,C)},h.clearElementaryStreamInfo=function(){var k=this.elementaryStreams;k[p.AUDIO]=null,k[p.VIDEO]=null,k[p.AUDIOVIDEO]=null},E(u,[{key:"decryptdata",get:function(){var k=this.levelkeys;if(!k&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){var m=this.levelkeys.identity;if(m)this._decryptdata=m.getDecryptData(this.sn);else{var A=Object.keys(this.levelkeys);if(A.length===1)return this._decryptdata=this.levelkeys[A[0]].getDecryptData(this.sn)}}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null||!(0,V.isFiniteNumber)(this.programDateTime))return null;var k=(0,V.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+k*1e3}},{key:"encrypted",get:function(){var k;if((k=this._decryptdata)!==null&&k!==void 0&&k.encrypted)return!0;if(this.levelkeys){var m=Object.keys(this.levelkeys),A=m.length;if(A>1||A===1&&this.levelkeys[m[0]].encrypted)return!0}return!1}}]),u}(y),d=function(f){U(u,f);function u(h,S,k,m,A){var I;I=f.call(this,k)||this,I.fragOffset=0,I.duration=0,I.gap=!1,I.independent=!1,I.relurl=void 0,I.fragment=void 0,I.index=void 0,I.stats=new i.LoadStats,I.duration=h.decimalFloatingPoint("DURATION"),I.gap=h.bool("GAP"),I.independent=h.bool("INDEPENDENT"),I.relurl=h.enumeratedString("URI"),I.fragment=S,I.index=m;var C=h.enumeratedString("BYTERANGE");return C&&I.setByteRange(C,A),A&&(I.fragOffset=A.fragOffset+A.duration),I}return E(u,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var S=this.elementaryStreams;return!!(S.audio||S.video||S.audiovideo)}}]),u}(y)},"./src/loader/key-loader.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>F});var V=B("./src/errors.ts"),K=B("./src/loader/fragment-loader.ts"),F=function(){function i(L){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=L}var U=i.prototype;return U.abort=function(){for(var v in this.keyUriToKeyInfo){var E=this.keyUriToKeyInfo[v].loader;E&&E.abort()}},U.detach=function(){for(var v in this.keyUriToKeyInfo){var E=this.keyUriToKeyInfo[v];(E.mediaKeySessionContext||E.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[v]}},U.destroy=function(){this.detach();for(var v in this.keyUriToKeyInfo){var E=this.keyUriToKeyInfo[v].loader;E&&E.destroy()}this.keyUriToKeyInfo={}},U.createKeyLoadError=function(v,E,b,w){return E===void 0&&(E=V.ErrorDetails.KEY_LOAD_ERROR),new K.LoadError({type:V.ErrorTypes.NETWORK_ERROR,details:E,fatal:!1,frag:v,networkDetails:b})},U.loadClear=function(v,E){var b=this;if(this.emeController&&this.config.emeEnabled)for(var w=v.sn,p=v.cc,y=function(u){var h=E[u];if(p<=h.cc&&(w==="initSegment"||w<h.sn))return b.emeController.selectKeySystemFormat(h).then(function(S){h.setKeyFormat(S)}),"break"},M=0;M<E.length;M++){var d=y(M);if(d==="break")break}},U.load=function(v){var E=this;return!v.decryptdata&&v.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(v).then(function(b){return E.loadInternal(v,b)}):this.loadInternal(v)},U.loadInternal=function(v,E){var b,w;E&&v.setKeyFormat(E);var p=v.decryptdata;if(!p){var y=E?"Expected frag.decryptdata to be defined after setting format "+E:"Missing decryption data on fragment in onKeyLoading";return Promise.reject(this.createKeyLoadError(v,V.ErrorDetails.KEY_LOAD_ERROR,null,y))}var M=p.uri;if(!M)return Promise.reject(this.createKeyLoadError(v,V.ErrorDetails.KEY_LOAD_ERROR,null,'Invalid key URI: "'+M+'"'));var d=this.keyUriToKeyInfo[M];if((b=d)!==null&&b!==void 0&&b.decryptdata.key)return p.key=d.decryptdata.key,Promise.resolve({frag:v,keyInfo:d});if((w=d)!==null&&w!==void 0&&w.keyLoadPromise){var f;switch((f=d.mediaKeySessionContext)===null||f===void 0?void 0:f.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return d.keyLoadPromise.then(function(u){return p.key=u.keyInfo.decryptdata.key,{frag:v,keyInfo:d}})}}switch(d=this.keyUriToKeyInfo[M]={decryptdata:p,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},p.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return p.keyFormat==="identity"?this.loadKeyHTTP(d,v):this.loadKeyEME(d,v);case"AES-128":return this.loadKeyHTTP(d,v);default:return Promise.reject(this.createKeyLoadError(v,V.ErrorDetails.KEY_LOAD_ERROR,null,'Key supplied with unsupported METHOD: "'+p.method+'"'))}},U.loadKeyEME=function(v,E){var b={frag:E,keyInfo:v};if(this.emeController&&this.config.emeEnabled){var w=this.emeController.loadKey(b);if(w)return(v.keyLoadPromise=w.then(function(p){return v.mediaKeySessionContext=p,b})).catch(function(p){throw v.keyLoadPromise=null,p})}return Promise.resolve(b)},U.loadKeyHTTP=function(v,E){var b=this,w=this.config,p=w.loader,y=new p(w);return E.keyLoader=v.loader=y,v.keyLoadPromise=new Promise(function(M,d){var f={keyInfo:v,frag:E,responseType:"arraybuffer",url:v.decryptdata.uri},u={timeout:w.fragLoadingTimeOut,maxRetry:0,retryDelay:w.fragLoadingRetryDelay,maxRetryDelay:w.fragLoadingMaxRetryTimeout,highWaterMark:0},h={onSuccess:function(k,m,A,I){var C=A.frag,P=A.keyInfo,l=A.url;if(!C.decryptdata||P!==b.keyUriToKeyInfo[l])return d(b.createKeyLoadError(C,V.ErrorDetails.KEY_LOAD_ERROR,I,"after key load, decryptdata unset or changed"));P.decryptdata.key=C.decryptdata.key=new Uint8Array(k.data),C.keyLoader=null,P.loader=null,M({frag:C,keyInfo:P})},onError:function(k,m,A){b.resetLoader(m),d(b.createKeyLoadError(E,V.ErrorDetails.KEY_LOAD_ERROR,A))},onTimeout:function(k,m,A){b.resetLoader(m),d(b.createKeyLoadError(E,V.ErrorDetails.KEY_LOAD_TIMEOUT,A))},onAbort:function(k,m,A){b.resetLoader(m),d(b.createKeyLoadError(E,V.ErrorDetails.INTERNAL_ABORTED,A))}};y.load(f,u,h)})},U.resetLoader=function(v){var E=v.frag,b=v.keyInfo,w=v.url,p=b.loader;E.keyLoader===p&&(E.keyLoader=null,b.loader=null),delete this.keyUriToKeyInfo[w],p&&p.destroy()},i}()},"./src/loader/level-details.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{LevelDetails:()=>v});var V=B("./src/polyfills/number.ts");function K(E,b){for(var w=0;w<b.length;w++){var p=b[w];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(E,i(p.key),p)}}function F(E,b,w){return b&&K(E.prototype,b),w&&K(E,w),Object.defineProperty(E,"prototype",{writable:!1}),E}function i(E){var b=U(E,"string");return typeof b=="symbol"?b:String(b)}function U(E,b){if(typeof E!="object"||E===null)return E;var w=E[Symbol.toPrimitive];if(w!==void 0){var p=w.call(E,b||"default");if(typeof p!="object")return p;throw new TypeError("@@toPrimitive must return a primitive value.")}return(b==="string"?String:Number)(E)}var L=10,v=function(){function E(w){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=w}var b=E.prototype;return b.reloaded=function(p){if(!p){this.advanced=!0,this.updated=!0;return}var y=this.lastPartSn-p.lastPartSn,M=this.lastPartIndex-p.lastPartIndex;this.updated=this.endSN!==p.endSN||!!M||!!y,this.advanced=this.endSN>p.endSN||y>0||y===0&&M>0,this.updated||this.advanced?this.misses=Math.floor(p.misses*.6):this.misses=p.misses+1,this.availabilityDelay=p.availabilityDelay},F(E,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?(0,V.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||L}},{key:"drift",get:function(){var p=this.driftEndTime-this.driftStartTime;if(p>0){var y=this.driftEnd-this.driftStart;return y*1e3/p}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var p;return(p=this.fragments)!==null&&p!==void 0&&p.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),E}()},"./src/loader/level-key.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{LevelKey:()=>v});var V=B("./src/utils/keysystem-util.ts"),K=B("./src/utils/mediakeys-helper.ts"),F=B("./src/utils/mp4-tools.ts"),i=B("./src/utils/logger.ts"),U=B("./src/utils/numeric-encoding-utils.ts"),L={},v=function(){b.clearKeyUriToKeyIdMap=function(){L={}};function b(p,y,M,d,f){d===void 0&&(d=[1]),f===void 0&&(f=null),this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=p,this.uri=y,this.keyFormat=M,this.keyFormatVersions=d,this.iv=f,this.encrypted=p?p!=="NONE":!1,this.isCommonEncryption=this.encrypted&&p!=="AES-128"}var w=b.prototype;return w.isSupported=function(){if(this.method){if(this.method==="AES-128"||this.method==="NONE")return!0;switch(this.keyFormat){case"identity":return this.method==="SAMPLE-AES";case K.KeySystemFormats.FAIRPLAY:case K.KeySystemFormats.WIDEVINE:case K.KeySystemFormats.PLAYREADY:case K.KeySystemFormats.CLEARKEY:return["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1},w.getDecryptData=function(y){if(!this.encrypted||!this.uri)return null;if(this.method==="AES-128"&&this.uri&&!this.iv){typeof y!="number"&&(this.method==="AES-128"&&!this.iv&&i.logger.warn('missing IV for initialization segment with method="'+this.method+'" - compliance issue'),y=0);var M=E(y),d=new b(this.method,this.uri,"identity",this.keyFormatVersions,M);return d}var f=(0,V.convertDataUriToArrayBytes)(this.uri);if(f)switch(this.keyFormat){case K.KeySystemFormats.WIDEVINE:this.pssh=f,f.length>=22&&(this.keyId=f.subarray(f.length-22,f.length-6));break;case K.KeySystemFormats.PLAYREADY:{var u=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=(0,F.mp4pssh)(u,null,f);var h=new Uint16Array(f.buffer,f.byteOffset,f.byteLength/2),S=String.fromCharCode.apply(null,Array.from(h)),k=S.substring(S.indexOf("<"),S.length),m=new DOMParser,A=m.parseFromString(k,"text/xml"),I=A.getElementsByTagName("KID")[0];if(I){var C=I.childNodes[0]?I.childNodes[0].nodeValue:I.getAttribute("VALUE");if(C){var P=(0,U.base64Decode)(C).subarray(0,16);(0,V.changeEndianness)(P),this.keyId=P}}break}default:{var l=f.subarray(0,16);if(l.length!==16){var c=new Uint8Array(16);c.set(l,16-l.length),l=c}this.keyId=l;break}}if(!this.keyId||this.keyId.byteLength!==16){var s=L[this.uri];if(!s){var g=Object.keys(L).length%Number.MAX_SAFE_INTEGER;s=new Uint8Array(16);var R=new DataView(s.buffer,12,4);R.setUint32(0,g),L[this.uri]=s}this.keyId=s}return this},b}();function E(b){for(var w=new Uint8Array(16),p=12;p<16;p++)w[p]=b>>8*(15-p)&255;return w}},"./src/loader/load-stats.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{LoadStats:()=>V});var V=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>u});var V=B("./src/polyfills/number.ts"),K=B("./node_modules/url-toolkit/src/url-toolkit.js"),F=B.n(K),i=B("./src/loader/date-range.ts"),U=B("./src/loader/fragment.ts"),L=B("./src/loader/level-details.ts"),v=B("./src/loader/level-key.ts"),E=B("./src/utils/attr-list.ts"),b=B("./src/utils/logger.ts"),w=B("./src/utils/codecs.ts");function p(){return p=Object.assign?Object.assign.bind():function(P){for(var l=1;l<arguments.length;l++){var c=arguments[l];for(var s in c)Object.prototype.hasOwnProperty.call(c,s)&&(P[s]=c[s])}return P},p.apply(this,arguments)}var y=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+|#EXT-X-SESSION-KEY:([^\n\r]*)[\r\n]+/g,M=/#EXT-X-MEDIA:(.*)/g,d=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),f=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),u=function(){function P(){}return P.findGroup=function(c,s){for(var g=0;g<c.length;g++){var R=c[g];if(R.id===s)return R}},P.convertAVC1ToAVCOTI=function(c){var s=c.split(".");if(s.length>2){var g=s.shift()+".";return g+=parseInt(s.shift()).toString(16),g+=("000"+parseInt(s.shift()).toString(16)).slice(-4),g}return c},P.resolve=function(c,s){return(0,K.buildAbsoluteURL)(s,c,{alwaysNormalize:!0})},P.parseMasterPlaylist=function(c,s){var g=[],R=[],D={},x=[],T=!1;y.lastIndex=0;for(var O;(O=y.exec(c))!=null;)if(O[1]){var $,H=new E.AttrList(O[1]),Z={attrs:H,bitrate:H.decimalInteger("AVERAGE-BANDWIDTH")||H.decimalInteger("BANDWIDTH"),name:H.NAME,url:P.resolve(O[2],s)},te=H.decimalResolution("RESOLUTION");te&&(Z.width=te.width,Z.height=te.height),S((H.CODECS||"").split(/[ ,]+/).filter(function(Pe){return Pe}),Z),Z.videoCodec&&Z.videoCodec.indexOf("avc1")!==-1&&(Z.videoCodec=P.convertAVC1ToAVCOTI(Z.videoCodec)),($=Z.unknownCodecs)!==null&&$!==void 0&&$.length||R.push(Z),g.push(Z)}else if(O[3]){var J=new E.AttrList(O[3]);J["DATA-ID"]&&(T=!0,D[J["DATA-ID"]]=J)}else if(O[4]){var ie=O[4],oe=h(ie,s);oe.encrypted&&oe.isSupported()?x.push(oe):b.logger.warn('[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "'+ie+'"')}var ue=R.length>0&&R.length<g.length;return{levels:ue?R:g,sessionData:T?D:null,sessionKeys:x.length?x:null}},P.parseMasterPlaylistMedia=function(c,s,g,R){R===void 0&&(R=[]);var D,x=[],T=0;for(M.lastIndex=0;(D=M.exec(c))!==null;){var O=new E.AttrList(D[1]);if(O.TYPE===g){var $={attrs:O,bitrate:0,id:T++,groupId:O["GROUP-ID"],instreamId:O["INSTREAM-ID"],name:O.NAME||O.LANGUAGE||"",type:g,default:O.bool("DEFAULT"),autoselect:O.bool("AUTOSELECT"),forced:O.bool("FORCED"),lang:O.LANGUAGE,url:O.URI?P.resolve(O.URI,s):""};if(R.length){var H=P.findGroup(R,$.groupId)||R[0];k($,H,"audioCodec"),k($,H,"textCodec")}x.push($)}}return x},P.parseLevelPlaylist=function(c,s,g,R,D){var x=new L.LevelDetails(s),T=x.fragments,O=null,$=0,H=0,Z=0,te=0,J=null,ie=new U.Fragment(R,s),oe,ue,Pe,Ne=-1,Ve=!1;for(d.lastIndex=0,x.m3u8=c;(oe=d.exec(c))!==null;){Ve&&(Ve=!1,ie=new U.Fragment(R,s),ie.start=Z,ie.sn=$,ie.cc=te,ie.level=g,O&&(ie.initSegment=O,ie.rawProgramDateTime=O.rawProgramDateTime,O.rawProgramDateTime=null));var ot=oe[1];if(ot){ie.duration=parseFloat(ot);var Et=(" "+oe[2]).slice(1);ie.title=Et||null,ie.tagList.push(Et?["INF",ot,Et]:["INF",ot])}else if(oe[3])(0,V.isFiniteNumber)(ie.duration)&&(ie.start=Z,Pe&&C(ie,Pe,x),ie.sn=$,ie.level=g,ie.cc=te,ie.urlId=D,T.push(ie),ie.relurl=(" "+oe[3]).slice(1),A(ie,J),J=ie,Z+=ie.duration,$++,H=0,Ve=!0);else if(oe[4]){var it=(" "+oe[4]).slice(1);J?ie.setByteRange(it,J):ie.setByteRange(it)}else if(oe[5])ie.rawProgramDateTime=(" "+oe[5]).slice(1),ie.tagList.push(["PROGRAM-DATE-TIME",ie.rawProgramDateTime]),Ne===-1&&(Ne=T.length);else{if(oe=oe[0].match(f),!oe){b.logger.warn("No matches on slow regex match for level playlist!");continue}for(ue=1;ue<oe.length&&typeof oe[ue]=="undefined";ue++);var Ie=(" "+oe[ue]).slice(1),He=(" "+oe[ue+1]).slice(1),ht=oe[ue+2]?(" "+oe[ue+2]).slice(1):"";switch(Ie){case"PLAYLIST-TYPE":x.type=He.toUpperCase();break;case"MEDIA-SEQUENCE":$=x.startSN=parseInt(He);break;case"SKIP":{var ft=new E.AttrList(He),dt=ft.decimalInteger("SKIPPED-SEGMENTS");if((0,V.isFiniteNumber)(dt)){x.skippedSegments=dt;for(var se=dt;se--;)T.unshift(null);$+=dt}var De=ft.enumeratedString("RECENTLY-REMOVED-DATERANGES");De&&(x.recentlyRemovedDateranges=De.split(" "));break}case"TARGETDURATION":x.targetduration=parseFloat(He);break;case"VERSION":x.version=parseInt(He);break;case"EXTM3U":break;case"ENDLIST":x.live=!1;break;case"#":(He||ht)&&ie.tagList.push(ht?[He,ht]:[He]);break;case"DISCONTINUITY":te++,ie.tagList.push(["DIS"]);break;case"GAP":ie.tagList.push([Ie]);break;case"BITRATE":ie.tagList.push([Ie,He]);break;case"DATERANGE":{var ze=new E.AttrList(He),Ge=new i.DateRange(ze,x.dateRanges[ze.ID]);Ge.isValid||x.skippedSegments?x.dateRanges[Ge.id]=Ge:b.logger.warn('Ignoring invalid DATERANGE tag: "'+He+'"'),ie.tagList.push(["EXT-X-DATERANGE",He]);break}case"DISCONTINUITY-SEQUENCE":te=parseInt(He);break;case"KEY":{var qe=h(He,s);if(qe.isSupported()){if(qe.method==="NONE"){Pe=void 0;break}Pe||(Pe={}),Pe[qe.keyFormat]&&(Pe=p({},Pe)),Pe[qe.keyFormat]=qe}else b.logger.warn('[Keys] Ignoring invalid EXT-X-KEY tag: "'+He+'"');break}case"START":{var vt=new E.AttrList(He),Ut=vt.decimalFloatingPoint("TIME-OFFSET");(0,V.isFiniteNumber)(Ut)&&(x.startTimeOffset=Ut);break}case"MAP":{var bt=new E.AttrList(He);if(ie.duration){var ke=new U.Fragment(R,s);I(ke,bt,g,Pe),O=ke,ie.initSegment=O,O.rawProgramDateTime&&!ie.rawProgramDateTime&&(ie.rawProgramDateTime=O.rawProgramDateTime)}else I(ie,bt,g,Pe),O=ie,Ve=!0;break}case"SERVER-CONTROL":{var lt=new E.AttrList(He);x.canBlockReload=lt.bool("CAN-BLOCK-RELOAD"),x.canSkipUntil=lt.optionalFloat("CAN-SKIP-UNTIL",0),x.canSkipDateRanges=x.canSkipUntil>0&&lt.bool("CAN-SKIP-DATERANGES"),x.partHoldBack=lt.optionalFloat("PART-HOLD-BACK",0),x.holdBack=lt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var $t=new E.AttrList(He);x.partTarget=$t.decimalFloatingPoint("PART-TARGET");break}case"PART":{var tt=x.partList;tt||(tt=x.partList=[]);var Ze=H>0?tt[tt.length-1]:void 0,Je=H++,pt=new U.Part(new E.AttrList(He),ie,s,Je,Ze);tt.push(pt),ie.duration+=pt.duration;break}case"PRELOAD-HINT":{var je=new E.AttrList(He);x.preloadHint=je;break}case"RENDITION-REPORT":{var _t=new E.AttrList(He);x.renditionReports=x.renditionReports||[],x.renditionReports.push(_t);break}default:b.logger.warn("line parsed but not handled: "+oe);break}}}J&&!J.relurl?(T.pop(),Z-=J.duration,x.partList&&(x.fragmentHint=J)):x.partList&&(A(ie,J),ie.cc=te,x.fragmentHint=ie,Pe&&C(ie,Pe,x));var xt=T.length,Kt=T[0],Bt=T[xt-1];if(Z+=x.skippedSegments*x.targetduration,Z>0&&xt&&Bt){x.averagetargetduration=Z/xt;var Rt=Bt.sn;x.endSN=Rt!=="initSegment"?Rt:0,x.live||(Bt.endList=!0),Kt&&(x.startCC=Kt.cc)}else x.endSN=0,x.startCC=0;return x.fragmentHint&&(Z+=x.fragmentHint.duration),x.totalduration=Z,x.endCC=te,Ne>0&&m(T,Ne),x},P}();function h(P,l){var c,s,g=new E.AttrList(P),R=(c=g.enumeratedString("METHOD"))!=null?c:"",D=g.URI,x=g.hexadecimalInteger("IV"),T=g.enumeratedString("KEYFORMATVERSIONS"),O=(s=g.enumeratedString("KEYFORMAT"))!=null?s:"identity";D&&g.IV&&!x&&b.logger.error("Invalid IV: "+g.IV);var $=D?u.resolve(D,l):"",H=(T||"1").split("/").map(Number).filter(Number.isFinite);return new v.LevelKey(R,$,O,H,x)}function S(P,l){["video","audio","text"].forEach(function(c){var s=P.filter(function(R){return(0,w.isCodecType)(R,c)});if(s.length){var g=s.filter(function(R){return R.lastIndexOf("avc1",0)===0||R.lastIndexOf("mp4a",0)===0});l[c+"Codec"]=g.length>0?g[0]:s[0],P=P.filter(function(R){return s.indexOf(R)===-1})}}),l.unknownCodecs=P}function k(P,l,c){var s=l[c];s&&(P[c]=s)}function m(P,l){for(var c=P[l],s=l;s--;){var g=P[s];if(!g)return;g.programDateTime=c.programDateTime-g.duration*1e3,c=g}}function A(P,l){P.rawProgramDateTime?P.programDateTime=Date.parse(P.rawProgramDateTime):l!=null&&l.programDateTime&&(P.programDateTime=l.endProgramDateTime),(0,V.isFiniteNumber)(P.programDateTime)||(P.programDateTime=null,P.rawProgramDateTime=null)}function I(P,l,c,s){P.relurl=l.URI,l.BYTERANGE&&P.setByteRange(l.BYTERANGE),P.level=c,P.sn="initSegment",s&&(P.levelkeys=s),P.initSegment=null}function C(P,l,c){P.levelkeys=l;var s=c.encryptedFragments;(!s.length||s[s.length-1].levelkeys!==l)&&Object.keys(l).some(function(g){return l[g].isCommonEncryption})&&s.push(P)}},"./src/loader/playlist-loader.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>p});var V=B("./src/polyfills/number.ts"),K=B("./src/events.ts"),F=B("./src/errors.ts"),i=B("./src/utils/logger.ts"),U=B("./src/loader/m3u8-parser.ts"),L=B("./src/types/loader.ts"),v=B("./src/utils/attr-list.ts");function E(y){var M=y.type;switch(M){case L.PlaylistContextType.AUDIO_TRACK:return L.PlaylistLevelType.AUDIO;case L.PlaylistContextType.SUBTITLE_TRACK:return L.PlaylistLevelType.SUBTITLE;default:return L.PlaylistLevelType.MAIN}}function b(y,M){var d=y.url;return(d===void 0||d.indexOf("data:")===0)&&(d=M.url),d}var w=function(){function y(d){this.hls=void 0,this.loaders=Object.create(null),this.hls=d,this.registerListeners()}var M=y.prototype;return M.startLoad=function(f){},M.stopLoad=function(){this.destroyInternalLoaders()},M.registerListeners=function(){var f=this.hls;f.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),f.on(K.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),f.on(K.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},M.unregisterListeners=function(){var f=this.hls;f.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.off(K.Events.LEVEL_LOADING,this.onLevelLoading,this),f.off(K.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),f.off(K.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},M.createInternalLoader=function(f){var u=this.hls.config,h=u.pLoader,S=u.loader,k=h||S,m=new k(u);return f.loader=m,this.loaders[f.type]=m,m},M.getInternalLoader=function(f){return this.loaders[f.type]},M.resetInternalLoader=function(f){this.loaders[f]&&delete this.loaders[f]},M.destroyInternalLoaders=function(){for(var f in this.loaders){var u=this.loaders[f];u&&u.destroy(),this.resetInternalLoader(f)}},M.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},M.onManifestLoading=function(f,u){var h=u.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:L.PlaylistContextType.MANIFEST,url:h,deliveryDirectives:null})},M.onLevelLoading=function(f,u){var h=u.id,S=u.level,k=u.url,m=u.deliveryDirectives;this.load({id:h,groupId:null,level:S,responseType:"text",type:L.PlaylistContextType.LEVEL,url:k,deliveryDirectives:m})},M.onAudioTrackLoading=function(f,u){var h=u.id,S=u.groupId,k=u.url,m=u.deliveryDirectives;this.load({id:h,groupId:S,level:null,responseType:"text",type:L.PlaylistContextType.AUDIO_TRACK,url:k,deliveryDirectives:m})},M.onSubtitleTrackLoading=function(f,u){var h=u.id,S=u.groupId,k=u.url,m=u.deliveryDirectives;this.load({id:h,groupId:S,level:null,responseType:"text",type:L.PlaylistContextType.SUBTITLE_TRACK,url:k,deliveryDirectives:m})},M.load=function(f){var u,h=this.hls.config,S=this.getInternalLoader(f);if(S){var k=S.context;if(k&&k.url===f.url){i.logger.trace("[playlist-loader]: playlist request ongoing");return}i.logger.log("[playlist-loader]: aborting previous loader for type: "+f.type),S.abort()}var m,A,I,C;switch(f.type){case L.PlaylistContextType.MANIFEST:m=h.manifestLoadingMaxRetry,A=h.manifestLoadingTimeOut,I=h.manifestLoadingRetryDelay,C=h.manifestLoadingMaxRetryTimeout;break;case L.PlaylistContextType.LEVEL:case L.PlaylistContextType.AUDIO_TRACK:case L.PlaylistContextType.SUBTITLE_TRACK:m=0,A=h.levelLoadingTimeOut;break;default:m=h.levelLoadingMaxRetry,A=h.levelLoadingTimeOut,I=h.levelLoadingRetryDelay,C=h.levelLoadingMaxRetryTimeout;break}if(S=this.createInternalLoader(f),(u=f.deliveryDirectives)!==null&&u!==void 0&&u.part){var P;if(f.type===L.PlaylistContextType.LEVEL&&f.level!==null?P=this.hls.levels[f.level].details:f.type===L.PlaylistContextType.AUDIO_TRACK&&f.id!==null?P=this.hls.audioTracks[f.id].details:f.type===L.PlaylistContextType.SUBTITLE_TRACK&&f.id!==null&&(P=this.hls.subtitleTracks[f.id].details),P){var l=P.partTarget,c=P.targetduration;l&&c&&(A=Math.min(Math.max(l*3,c*.8)*1e3,A))}}var s={timeout:A,maxRetry:m,retryDelay:I,maxRetryDelay:C,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};S.load(f,s,g)},M.loadsuccess=function(f,u,h,S){S===void 0&&(S=null),this.resetInternalLoader(h.type);var k=f.data;if(k.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(f,h,"no EXTM3U delimiter",S);return}u.parsing.start=performance.now(),k.indexOf("#EXTINF:")>0||k.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(f,u,h,S):this.handleMasterPlaylist(f,u,h,S)},M.loaderror=function(f,u,h){h===void 0&&(h=null),this.handleNetworkError(u,h,!1,f)},M.loadtimeout=function(f,u,h){h===void 0&&(h=null),this.handleNetworkError(u,h,!0)},M.handleMasterPlaylist=function(f,u,h,S){var k=this.hls,m=f.data,A=b(f,h),I=U.default.parseMasterPlaylist(m,A),C=I.levels,P=I.sessionData,l=I.sessionKeys;if(!C.length){this.handleManifestParsingError(f,h,"no level found in manifest",S);return}var c=C.map(function(T){return{id:T.attrs.AUDIO,audioCodec:T.audioCodec}}),s=C.map(function(T){return{id:T.attrs.SUBTITLES,textCodec:T.textCodec}}),g=U.default.parseMasterPlaylistMedia(m,A,"AUDIO",c),R=U.default.parseMasterPlaylistMedia(m,A,"SUBTITLES",s),D=U.default.parseMasterPlaylistMedia(m,A,"CLOSED-CAPTIONS");if(g.length){var x=g.some(function(T){return!T.url});!x&&C[0].audioCodec&&!C[0].attrs.AUDIO&&(i.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),g.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new v.AttrList({}),bitrate:0,url:""}))}k.trigger(K.Events.MANIFEST_LOADED,{levels:C,audioTracks:g,subtitles:R,captions:D,url:A,stats:u,networkDetails:S,sessionData:P,sessionKeys:l})},M.handleTrackOrLevelPlaylist=function(f,u,h,S){var k=this.hls,m=h.id,A=h.level,I=h.type,C=b(f,h),P=(0,V.isFiniteNumber)(m)?m:0,l=(0,V.isFiniteNumber)(A)?A:P,c=E(h),s=U.default.parseLevelPlaylist(f.data,C,l,c,P);if(!s.fragments.length){k.trigger(K.Events.ERROR,{type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:C,reason:"no fragments found in level",level:typeof h.level=="number"?h.level:void 0});return}if(I===L.PlaylistContextType.MANIFEST){var g={attrs:new v.AttrList({}),bitrate:0,details:s,name:"",url:C};k.trigger(K.Events.MANIFEST_LOADED,{levels:[g],audioTracks:[],url:C,stats:u,networkDetails:S,sessionData:null,sessionKeys:null})}u.parsing.end=performance.now(),h.levelDetails=s,this.handlePlaylistLoaded(f,u,h,S)},M.handleManifestParsingError=function(f,u,h,S){this.hls.trigger(K.Events.ERROR,{type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:u.type===L.PlaylistContextType.MANIFEST,url:f.url,reason:h,response:f,context:u,networkDetails:S})},M.handleNetworkError=function(f,u,h,S){h===void 0&&(h=!1),i.logger.warn("[playlist-loader]: A network "+(h?"timeout":"error")+" occurred while loading "+f.type+" level: "+f.level+" id: "+f.id+' group-id: "'+f.groupId+'"');var k=F.ErrorDetails.UNKNOWN,m=!1,A=this.getInternalLoader(f);switch(f.type){case L.PlaylistContextType.MANIFEST:k=h?F.ErrorDetails.MANIFEST_LOAD_TIMEOUT:F.ErrorDetails.MANIFEST_LOAD_ERROR,m=!0;break;case L.PlaylistContextType.LEVEL:k=h?F.ErrorDetails.LEVEL_LOAD_TIMEOUT:F.ErrorDetails.LEVEL_LOAD_ERROR,m=!1;break;case L.PlaylistContextType.AUDIO_TRACK:k=h?F.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:F.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,m=!1;break;case L.PlaylistContextType.SUBTITLE_TRACK:k=h?F.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:F.ErrorDetails.SUBTITLE_LOAD_ERROR,m=!1;break}A&&this.resetInternalLoader(f.type);var I={type:F.ErrorTypes.NETWORK_ERROR,details:k,fatal:m,url:f.url,loader:A,context:f,networkDetails:u};S&&(I.response=S),this.hls.trigger(K.Events.ERROR,I)},M.handlePlaylistLoaded=function(f,u,h,S){var k=h.type,m=h.level,A=h.id,I=h.groupId,C=h.loader,P=h.levelDetails,l=h.deliveryDirectives;if(!(P!=null&&P.targetduration)){this.handleManifestParsingError(f,h,"invalid target duration",S);return}if(C)switch(P.live&&(C.getCacheAge&&(P.ageHeader=C.getCacheAge()||0),(!C.getCacheAge||isNaN(P.ageHeader))&&(P.ageHeader=0)),k){case L.PlaylistContextType.MANIFEST:case L.PlaylistContextType.LEVEL:this.hls.trigger(K.Events.LEVEL_LOADED,{details:P,level:m||0,id:A||0,stats:u,networkDetails:S,deliveryDirectives:l});break;case L.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(K.Events.AUDIO_TRACK_LOADED,{details:P,id:A||0,groupId:I||"",stats:u,networkDetails:S,deliveryDirectives:l});break;case L.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(K.Events.SUBTITLE_TRACK_LOADED,{details:P,id:A||0,groupId:I||"",stats:u,networkDetails:S,deliveryDirectives:l});break}},y}();const p=w},"./src/polyfills/number.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{MAX_SAFE_INTEGER:()=>K,isFiniteNumber:()=>V});var V=Number.isFinite||function(F){return typeof F=="number"&&isFinite(F)},K=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>K});var V=function(){function F(){}return F.getSilentFrame=function(U,L){switch(U){case"mp4a.40.2":if(L===1)return new Uint8Array([0,200,0,128,35,128]);if(L===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(L===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(L===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(L===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(L===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(L===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(L===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(L===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}},F}();const K=V},"./src/remux/mp4-generator.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>F});var V=Math.pow(2,32)-1,K=function(){function i(){}return i.init=function(){i.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var L;for(L in i.types)i.types.hasOwnProperty(L)&&(i.types[L]=[L.charCodeAt(0),L.charCodeAt(1),L.charCodeAt(2),L.charCodeAt(3)]);var v=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),E=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);i.HDLR_TYPES={video:v,audio:E};var b=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),w=new Uint8Array([0,0,0,0,0,0,0,0]);i.STTS=i.STSC=i.STCO=w,i.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),i.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),i.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),i.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var p=new Uint8Array([105,115,111,109]),y=new Uint8Array([97,118,99,49]),M=new Uint8Array([0,0,0,1]);i.FTYP=i.box(i.types.ftyp,p,M,p,y),i.DINF=i.box(i.types.dinf,i.box(i.types.dref,b))},i.box=function(L){for(var v=8,E=arguments.length,b=new Array(E>1?E-1:0),w=1;w<E;w++)b[w-1]=arguments[w];for(var p=b.length,y=p;p--;)v+=b[p].byteLength;var M=new Uint8Array(v);for(M[0]=v>>24&255,M[1]=v>>16&255,M[2]=v>>8&255,M[3]=v&255,M.set(L,4),p=0,v=8;p<y;p++)M.set(b[p],v),v+=b[p].byteLength;return M},i.hdlr=function(L){return i.box(i.types.hdlr,i.HDLR_TYPES[L])},i.mdat=function(L){return i.box(i.types.mdat,L)},i.mdhd=function(L,v){v*=L;var E=Math.floor(v/(V+1)),b=Math.floor(v%(V+1));return i.box(i.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,L>>24&255,L>>16&255,L>>8&255,L&255,E>>24,E>>16&255,E>>8&255,E&255,b>>24,b>>16&255,b>>8&255,b&255,85,196,0,0]))},i.mdia=function(L){return i.box(i.types.mdia,i.mdhd(L.timescale,L.duration),i.hdlr(L.type),i.minf(L))},i.mfhd=function(L){return i.box(i.types.mfhd,new Uint8Array([0,0,0,0,L>>24,L>>16&255,L>>8&255,L&255]))},i.minf=function(L){return L.type==="audio"?i.box(i.types.minf,i.box(i.types.smhd,i.SMHD),i.DINF,i.stbl(L)):i.box(i.types.minf,i.box(i.types.vmhd,i.VMHD),i.DINF,i.stbl(L))},i.moof=function(L,v,E){return i.box(i.types.moof,i.mfhd(L),i.traf(E,v))},i.moov=function(L){for(var v=L.length,E=[];v--;)E[v]=i.trak(L[v]);return i.box.apply(null,[i.types.moov,i.mvhd(L[0].timescale,L[0].duration)].concat(E).concat(i.mvex(L)))},i.mvex=function(L){for(var v=L.length,E=[];v--;)E[v]=i.trex(L[v]);return i.box.apply(null,[i.types.mvex].concat(E))},i.mvhd=function(L,v){v*=L;var E=Math.floor(v/(V+1)),b=Math.floor(v%(V+1)),w=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,L>>24&255,L>>16&255,L>>8&255,L&255,E>>24,E>>16&255,E>>8&255,E&255,b>>24,b>>16&255,b>>8&255,b&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return i.box(i.types.mvhd,w)},i.sdtp=function(L){var v=L.samples||[],E=new Uint8Array(4+v.length),b,w;for(b=0;b<v.length;b++)w=v[b].flags,E[b+4]=w.dependsOn<<4|w.isDependedOn<<2|w.hasRedundancy;return i.box(i.types.sdtp,E)},i.stbl=function(L){return i.box(i.types.stbl,i.stsd(L),i.box(i.types.stts,i.STTS),i.box(i.types.stsc,i.STSC),i.box(i.types.stsz,i.STSZ),i.box(i.types.stco,i.STCO))},i.avc1=function(L){var v=[],E=[],b,w,p;for(b=0;b<L.sps.length;b++)w=L.sps[b],p=w.byteLength,v.push(p>>>8&255),v.push(p&255),v=v.concat(Array.prototype.slice.call(w));for(b=0;b<L.pps.length;b++)w=L.pps[b],p=w.byteLength,E.push(p>>>8&255),E.push(p&255),E=E.concat(Array.prototype.slice.call(w));var y=i.box(i.types.avcC,new Uint8Array([1,v[3],v[4],v[5],255,224|L.sps.length].concat(v).concat([L.pps.length]).concat(E))),M=L.width,d=L.height,f=L.pixelRatio[0],u=L.pixelRatio[1];return i.box(i.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,M>>8&255,M&255,d>>8&255,d&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),y,i.box(i.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),i.box(i.types.pasp,new Uint8Array([f>>24,f>>16&255,f>>8&255,f&255,u>>24,u>>16&255,u>>8&255,u&255])))},i.esds=function(L){var v=L.config.length;return new Uint8Array([0,0,0,0,3,23+v,0,1,0,4,15+v,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([v]).concat(L.config).concat([6,1,2]))},i.mp4a=function(L){var v=L.samplerate;return i.box(i.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,L.channelCount,0,16,0,0,0,0,v>>8&255,v&255,0,0]),i.box(i.types.esds,i.esds(L)))},i.mp3=function(L){var v=L.samplerate;return i.box(i.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,L.channelCount,0,16,0,0,0,0,v>>8&255,v&255,0,0]))},i.stsd=function(L){return L.type==="audio"?L.segmentCodec==="mp3"&&L.codec==="mp3"?i.box(i.types.stsd,i.STSD,i.mp3(L)):i.box(i.types.stsd,i.STSD,i.mp4a(L)):i.box(i.types.stsd,i.STSD,i.avc1(L))},i.tkhd=function(L){var v=L.id,E=L.duration*L.timescale,b=L.width,w=L.height,p=Math.floor(E/(V+1)),y=Math.floor(E%(V+1));return i.box(i.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,v>>24&255,v>>16&255,v>>8&255,v&255,0,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,y>>24,y>>16&255,y>>8&255,y&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,b>>8&255,b&255,0,0,w>>8&255,w&255,0,0]))},i.traf=function(L,v){var E=i.sdtp(L),b=L.id,w=Math.floor(v/(V+1)),p=Math.floor(v%(V+1));return i.box(i.types.traf,i.box(i.types.tfhd,new Uint8Array([0,0,0,0,b>>24,b>>16&255,b>>8&255,b&255])),i.box(i.types.tfdt,new Uint8Array([1,0,0,0,w>>24,w>>16&255,w>>8&255,w&255,p>>24,p>>16&255,p>>8&255,p&255])),i.trun(L,E.length+16+20+8+16+8+8),E)},i.trak=function(L){return L.duration=L.duration||4294967295,i.box(i.types.trak,i.tkhd(L),i.mdia(L))},i.trex=function(L){var v=L.id;return i.box(i.types.trex,new Uint8Array([0,0,0,0,v>>24,v>>16&255,v>>8&255,v&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},i.trun=function(L,v){var E=L.samples||[],b=E.length,w=12+16*b,p=new Uint8Array(w),y,M,d,f,u,h;for(v+=8+w,p.set([L.type==="video"?1:0,0,15,1,b>>>24&255,b>>>16&255,b>>>8&255,b&255,v>>>24&255,v>>>16&255,v>>>8&255,v&255],0),y=0;y<b;y++)M=E[y],d=M.duration,f=M.size,u=M.flags,h=M.cts,p.set([d>>>24&255,d>>>16&255,d>>>8&255,d&255,f>>>24&255,f>>>16&255,f>>>8&255,f&255,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.paddingValue<<1|u.isNonSync,u.degradPrio&61440,u.degradPrio&15,h>>>24&255,h>>>16&255,h>>>8&255,h&255],12+16*y);return i.box(i.types.trun,p)},i.initSegment=function(L){i.types||i.init();var v=i.moov(L),E=new Uint8Array(i.FTYP.byteLength+v.byteLength);return E.set(i.FTYP),E.set(v,i.FTYP.byteLength),E},i}();K.types=void 0,K.HDLR_TYPES=void 0,K.STTS=void 0,K.STSC=void 0,K.STCO=void 0,K.STSZ=void 0,K.VMHD=void 0,K.SMHD=void 0,K.STSD=void 0,K.FTYP=void 0,K.DINF=void 0;const F=K},"./src/remux/mp4-remuxer.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>f,flushTextTrackMetadataCueSamples:()=>S,flushTextTrackUserdataCueSamples:()=>k,normalizePts:()=>u});var V=B("./src/polyfills/number.ts"),K=B("./src/remux/aac-helper.ts"),F=B("./src/remux/mp4-generator.ts"),i=B("./src/events.ts"),U=B("./src/errors.ts"),L=B("./src/utils/logger.ts"),v=B("./src/types/loader.ts"),E=B("./src/utils/timescale-conversion.ts");function b(){return b=Object.assign?Object.assign.bind():function(I){for(var C=1;C<arguments.length;C++){var P=arguments[C];for(var l in P)Object.prototype.hasOwnProperty.call(P,l)&&(I[l]=P[l])}return I},b.apply(this,arguments)}var w=10*1e3,p=1024,y=1152,M=null,d=null,f=function(){function I(P,l,c,s){if(s===void 0&&(s=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=P,this.config=l,this.typeSupported=c,this.ISGenerated=!1,M===null){var g=navigator.userAgent||"",R=g.match(/Chrome\/(\d+)/i);M=R?parseInt(R[1]):0}if(d===null){var D=navigator.userAgent.match(/Safari\/(\d+)/i);d=D?parseInt(D[1]):0}}var C=I.prototype;return C.destroy=function(){},C.resetTimeStamp=function(l){L.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=l},C.resetNextTimestamp=function(){L.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},C.resetInitSegment=function(){L.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},C.getVideoStartPts=function(l){var c=!1,s=l.reduce(function(g,R){var D=R.pts-g;return D<-4294967296?(c=!0,u(g,R.pts)):D>0?g:R.pts},l[0].pts);return c&&L.logger.debug("PTS rollover detected"),s},C.remux=function(l,c,s,g,R,D,x,T){var O,$,H,Z,te,J,ie=R,oe=R,ue=l.pid>-1,Pe=c.pid>-1,Ne=c.samples.length,Ve=l.samples.length>0,ot=x&&Ne>0||Ne>1,Et=(!ue||Ve)&&(!Pe||ot)||this.ISGenerated||x;if(Et){this.ISGenerated||(H=this.generateIS(l,c,R));var it=this.isVideoContiguous,Ie=-1,He;if(ot&&(Ie=h(c.samples),!it&&this.config.forceKeyFrameOnDiscontinuity))if(J=!0,Ie>0){L.logger.warn("[mp4-remuxer]: Dropped "+Ie+" out of "+Ne+" video samples due to a missing keyframe");var ht=this.getVideoStartPts(c.samples);c.samples=c.samples.slice(Ie),c.dropped+=Ie,oe+=(c.samples[0].pts-ht)/c.inputTimeScale,He=oe}else Ie===-1&&(L.logger.warn("[mp4-remuxer]: No keyframe found out of "+Ne+" video samples"),J=!1);if(this.ISGenerated){if(Ve&&ot){var ft=this.getVideoStartPts(c.samples),dt=u(l.samples[0].pts,ft)-ft,se=dt/c.inputTimeScale;ie+=Math.max(0,se),oe+=Math.max(0,-se)}if(Ve){if(l.samplerate||(L.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),H=this.generateIS(l,c,R)),$=this.remuxAudio(l,ie,this.isAudioContiguous,D,Pe||ot||T===v.PlaylistLevelType.AUDIO?oe:void 0),ot){var De=$?$.endPTS-$.startPTS:0;c.inputTimeScale||(L.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),H=this.generateIS(l,c,R)),O=this.remuxVideo(c,oe,it,De)}}else ot&&(O=this.remuxVideo(c,oe,it,0));O&&(O.firstKeyFrame=Ie,O.independent=Ie!==-1,O.firstKeyFramePTS=He)}}return this.ISGenerated&&(s.samples.length&&(te=S(s,R,this._initPTS,this._initDTS)),g.samples.length&&(Z=k(g,R,this._initPTS))),{audio:$,video:O,initSegment:H,independent:J,text:Z,id3:te}},C.generateIS=function(l,c,s){var g=l.samples,R=c.samples,D=this.typeSupported,x={},T=!(0,V.isFiniteNumber)(this._initPTS),O="audio/mp4",$,H,Z;if(T&&($=H=1/0),l.config&&g.length){switch(l.timescale=l.samplerate,l.segmentCodec){case"mp3":D.mpeg?(O="audio/mpeg",l.codec=""):D.mp3&&(l.codec="mp3");break}x.audio={id:"audio",container:O,codec:l.codec,initSegment:l.segmentCodec==="mp3"&&D.mpeg?new Uint8Array(0):F.default.initSegment([l]),metadata:{channelCount:l.channelCount}},T&&(Z=l.inputTimeScale,$=H=g[0].pts-Math.round(Z*s))}if(c.sps&&c.pps&&R.length&&(c.timescale=c.inputTimeScale,x.video={id:"main",container:"video/mp4",codec:c.codec,initSegment:F.default.initSegment([c]),metadata:{width:c.width,height:c.height}},T)){Z=c.inputTimeScale;var te=this.getVideoStartPts(R),J=Math.round(Z*s);H=Math.min(H,u(R[0].dts,te)-J),$=Math.min($,te-J)}if(Object.keys(x).length)return this.ISGenerated=!0,T&&(this._initPTS=$,this._initDTS=H),{tracks:x,initPTS:$,timescale:Z}},C.remuxVideo=function(l,c,s,g){var R=l.inputTimeScale,D=l.samples,x=[],T=D.length,O=this._initPTS,$=this.nextAvcDts,H=8,Z=this.videoSampleDuration,te,J,ie=Number.POSITIVE_INFINITY,oe=Number.NEGATIVE_INFINITY,ue=!1;if(!s||$===null){var Pe=c*R,Ne=D[0].pts-u(D[0].dts,D[0].pts);$=Pe-Ne}for(var Ve=0;Ve<T;Ve++){var ot=D[Ve];ot.pts=u(ot.pts-O,$),ot.dts=u(ot.dts-O,$),ot.dts<D[Ve>0?Ve-1:Ve].dts&&(ue=!0)}ue&&D.sort(function(ur,ir){var cr=ur.dts-ir.dts,Ur=ur.pts-ir.pts;return cr||Ur}),te=D[0].dts,J=D[D.length-1].dts;var Et=J-te,it=Et?Math.round(Et/(T-1)):Z||l.inputTimeScale/30;if(s){var Ie=te-$,He=Ie>it,ht=Ie<-1;if((He||ht)&&(He?L.logger.warn("AVC: "+(0,E.toMsFromMpegTsClock)(Ie,!0)+" ms ("+Ie+"dts) hole between fragments detected, filling it"):L.logger.warn("AVC: "+(0,E.toMsFromMpegTsClock)(-Ie,!0)+" ms ("+Ie+"dts) overlapping between fragments detected"),!ht||$>D[0].pts)){te=$;var ft=D[0].pts-Ie;D[0].dts=te,D[0].pts=ft,L.logger.log("Video: First PTS/DTS adjusted: "+(0,E.toMsFromMpegTsClock)(ft,!0)+"/"+(0,E.toMsFromMpegTsClock)(te,!0)+", delta: "+(0,E.toMsFromMpegTsClock)(Ie,!0)+" ms")}}te=Math.max(0,te);for(var dt=0,se=0,De=0;De<T;De++){for(var ze=D[De],Ge=ze.units,qe=Ge.length,vt=0,Ut=0;Ut<qe;Ut++)vt+=Ge[Ut].data.length;se+=vt,dt+=qe,ze.length=vt,ze.dts=Math.max(ze.dts,te),ie=Math.min(ze.pts,ie),oe=Math.max(ze.pts,oe)}J=D[T-1].dts;var bt=se+4*dt+8,ke;try{ke=new Uint8Array(bt)}catch(ur){this.observer.emit(i.Events.ERROR,i.Events.ERROR,{type:U.ErrorTypes.MUX_ERROR,details:U.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:bt,reason:"fail allocating video mdat "+bt});return}var lt=new DataView(ke.buffer);lt.setUint32(0,bt),ke.set(F.default.types.mdat,4);for(var $t=!1,tt=Number.POSITIVE_INFINITY,Ze=Number.POSITIVE_INFINITY,Je=Number.NEGATIVE_INFINITY,pt=Number.NEGATIVE_INFINITY,je=0;je<T;je++){for(var _t=D[je],xt=_t.units,Kt=0,Bt=0,Rt=xt.length;Bt<Rt;Bt++){var Se=xt[Bt],fe=Se.data,Ce=Se.data.byteLength;lt.setUint32(H,Ce),H+=4,ke.set(fe,H),H+=Ce,Kt+=4+Ce}var de=void 0;if(je<T-1)Z=D[je+1].dts-_t.dts,de=D[je+1].pts-_t.pts;else{var pe=this.config,xe=je>0?_t.dts-D[je-1].dts:it;if(de=je>0?_t.pts-D[je-1].pts:it,pe.stretchShortVideoTrack&&this.nextAudioPts!==null){var Q=Math.floor(pe.maxBufferHole*R),ne=(g?ie+g*R:this.nextAudioPts)-_t.pts;ne>Q?(Z=ne-xe,Z<0?Z=xe:$t=!0,L.logger.log("[mp4-remuxer]: It is approximately "+ne/90+" ms to the next segment; using duration "+Z/90+" ms for the last video frame.")):Z=xe}else Z=xe}var ce=Math.round(_t.pts-_t.dts);tt=Math.min(tt,Z),Je=Math.max(Je,Z),Ze=Math.min(Ze,de),pt=Math.max(pt,de),x.push(new m(_t.key,Z,Kt,ce))}if(x.length){if(M){if(M<70){var Ae=x[0].flags;Ae.dependsOn=2,Ae.isNonSync=0}}else if(d&&pt-Ze<Je-tt&&it/Je<.025&&x[0].cts===0){L.logger.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");for(var be=te,Oe=0,$e=x.length;Oe<$e;Oe++){var mt=be+x[Oe].duration,Mt=be+x[Oe].cts;if(Oe<$e-1){var Jt=mt+x[Oe+1].cts;x[Oe].duration=Jt-Mt}else x[Oe].duration=Oe?x[Oe-1].duration:it;x[Oe].cts=0,be=mt}}}console.assert(Z!==null,"mp4SampleDuration must be computed"),Z=$t||!Z?it:Z,this.nextAvcDts=$=J+Z,this.videoSampleDuration=Z,this.isVideoContiguous=!0;var jt=F.default.moof(l.sequenceNumber++,te,b({},l,{samples:x})),rt="video",Tt={data1:jt,data2:ke,startPTS:ie/R,endPTS:(oe+Z)/R,startDTS:te/R,endDTS:$/R,type:rt,hasAudio:!1,hasVideo:!0,nb:x.length,dropped:l.dropped};return l.samples=[],l.dropped=0,console.assert(ke.length,"MDAT length must not be zero"),Tt},C.remuxAudio=function(l,c,s,g,R){var D=l.inputTimeScale,x=l.samplerate?l.samplerate:D,T=D/x,O=l.segmentCodec==="aac"?p:y,$=O*T,H=this._initPTS,Z=l.segmentCodec==="mp3"&&this.typeSupported.mpeg,te=[],J=R!==void 0,ie=l.samples,oe=Z?0:8,ue=this.nextAudioPts||-1,Pe=c*D;if(this.isAudioContiguous=s=s||ie.length&&ue>0&&(g&&Math.abs(Pe-ue)<9e3||Math.abs(u(ie[0].pts-H,Pe)-ue)<20*$),ie.forEach(function(Se){Se.pts=u(Se.pts-H,Pe)}),!s||ue<0){if(ie=ie.filter(function(Se){return Se.pts>=0}),!ie.length)return;R===0?ue=0:g&&!J?ue=Math.max(0,Pe):ue=ie[0].pts}if(l.segmentCodec==="aac")for(var Ne=this.config.maxAudioFramesDrift,Ve=0,ot=ue;Ve<ie.length;Ve++){var Et=ie[Ve],it=Et.pts,Ie=it-ot,He=Math.abs(1e3*Ie/D);if(Ie<=-Ne*$&&J)Ve===0&&(L.logger.warn("Audio frame @ "+(it/D).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Ie/D)+" ms."),this.nextAudioPts=ue=ot=it);else if(Ie>=Ne*$&&He<w&&J){var ht=Math.round(Ie/$);ot=it-ht*$,ot<0&&(ht--,ot+=$),Ve===0&&(this.nextAudioPts=ue=ot),L.logger.warn("[mp4-remuxer]: Injecting "+ht+" audio frame @ "+(ot/D).toFixed(3)+"s due to "+Math.round(1e3*Ie/D)+" ms gap.");for(var ft=0;ft<ht;ft++){var dt=Math.max(ot,0),se=K.default.getSilentFrame(l.manifestCodec||l.codec,l.channelCount);se||(L.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),se=Et.unit.subarray()),ie.splice(Ve,0,{unit:se,pts:dt}),ot+=$,Ve++}}Et.pts=ot,ot+=$}for(var De=null,ze=null,Ge,qe=0,vt=ie.length;vt--;)qe+=ie[vt].unit.byteLength;for(var Ut=0,bt=ie.length;Ut<bt;Ut++){var ke=ie[Ut],lt=ke.unit,$t=ke.pts;if(ze!==null){var tt=te[Ut-1];tt.duration=Math.round(($t-ze)/T)}else if(s&&l.segmentCodec==="aac"&&($t=ue),De=$t,qe>0){qe+=oe;try{Ge=new Uint8Array(qe)}catch(Se){this.observer.emit(i.Events.ERROR,i.Events.ERROR,{type:U.ErrorTypes.MUX_ERROR,details:U.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:qe,reason:"fail allocating audio mdat "+qe});return}if(!Z){var Ze=new DataView(Ge.buffer);Ze.setUint32(0,qe),Ge.set(F.default.types.mdat,4)}}else return;Ge.set(lt,oe);var Je=lt.byteLength;oe+=Je,te.push(new m(!0,O,Je,0)),ze=$t}var pt=te.length;if(pt){var je=te[te.length-1];this.nextAudioPts=ue=ze+T*je.duration;var _t=Z?new Uint8Array(0):F.default.moof(l.sequenceNumber++,De/T,b({},l,{samples:te}));l.samples=[];var xt=De/D,Kt=ue/D,Bt="audio",Rt={data1:_t,data2:Ge,startPTS:xt,endPTS:Kt,startDTS:xt,endDTS:Kt,type:Bt,hasAudio:!0,hasVideo:!1,nb:pt};return this.isAudioContiguous=!0,console.assert(Ge.length,"MDAT length must not be zero"),Rt}},C.remuxEmptyAudio=function(l,c,s,g){var R=l.inputTimeScale,D=l.samplerate?l.samplerate:R,x=R/D,T=this.nextAudioPts,O=(T!==null?T:g.startDTS*R)+this._initDTS,$=g.endDTS*R+this._initDTS,H=x*p,Z=Math.ceil(($-O)/H),te=K.default.getSilentFrame(l.manifestCodec||l.codec,l.channelCount);if(L.logger.warn("[mp4-remuxer]: remux empty Audio"),!te){L.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var J=[],ie=0;ie<Z;ie++){var oe=O+ie*H;J.push({unit:te,pts:oe,dts:oe})}return l.samples=J,this.remuxAudio(l,c,s,!1)},I}();function u(I,C){var P;if(C===null)return I;for(C<I?P=-8589934592:P=8589934592;Math.abs(I-C)>4294967296;)I+=P;return I}function h(I){for(var C=0;C<I.length;C++)if(I[C].key)return C;return-1}function S(I,C,P,l){var c=I.samples.length;if(c){for(var s=I.inputTimeScale,g=0;g<c;g++){var R=I.samples[g];R.pts=u(R.pts-P,C*s)/s,R.dts=u(R.dts-l,C*s)/s}var D=I.samples;return I.samples=[],{samples:D}}}function k(I,C,P){var l=I.samples.length;if(l){for(var c=I.inputTimeScale,s=0;s<l;s++){var g=I.samples[s];g.pts=u(g.pts-P,C*c)/c}I.samples.sort(function(D,x){return D.pts-x.pts});var R=I.samples;return I.samples=[],{samples:R}}}var m=function(C,P,l,c){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=P,this.size=l,this.cts=c,this.flags=new A(C)},A=function(C){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=C?2:1,this.isNonSync=C?0:1}},"./src/remux/passthrough-remuxer.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>E});var V=B("./src/polyfills/number.ts"),K=B("./src/remux/mp4-remuxer.ts"),F=B("./src/utils/mp4-tools.ts"),i=B("./src/loader/fragment.ts"),U=B("./src/utils/logger.ts"),L=function(){function b(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndTime=null}var w=b.prototype;return w.destroy=function(){},w.resetTimeStamp=function(y){this.initPTS=y,this.lastEndTime=null},w.resetNextTimestamp=function(){this.lastEndTime=null},w.resetInitSegment=function(y,M,d,f){this.audioCodec=M,this.videoCodec=d,this.generateInitSegment((0,F.patchEncyptionData)(y,f)),this.emitInitSegment=!0},w.generateInitSegment=function(y){var M=this.audioCodec,d=this.videoCodec;if(!y||!y.byteLength){this.initTracks=void 0,this.initData=void 0;return}var f=this.initData=(0,F.parseInitSegment)(y);M||(M=v(f.audio,i.ElementaryStreamTypes.AUDIO)),d||(d=v(f.video,i.ElementaryStreamTypes.VIDEO));var u={};f.audio&&f.video?u.audiovideo={container:"video/mp4",codec:M+","+d,initSegment:y,id:"main"}:f.audio?u.audio={container:"audio/mp4",codec:M,initSegment:y,id:"audio"}:f.video?u.video={container:"video/mp4",codec:d,initSegment:y,id:"main"}:U.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=u},w.remux=function(y,M,d,f,u){var h,S=this.initPTS,k=this.lastEndTime,m={audio:void 0,video:void 0,text:f,id3:d,initSegment:void 0};(0,V.isFiniteNumber)(k)||(k=this.lastEndTime=u||0);var A=M.samples;if(!A||!A.length)return m;var I={initPTS:void 0,timescale:1},C=this.initData;if((!C||!C.length)&&(this.generateInitSegment(A),C=this.initData),!C||!C.length)return U.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),m;this.emitInitSegment&&(I.tracks=this.initTracks,this.emitInitSegment=!1);var P=(0,F.getStartDTS)(C,A);(0,V.isFiniteNumber)(S)||(this.initPTS=I.initPTS=S=P-u);var l=(0,F.getDuration)(A,C),c=y?P-S:k,s=c+l;(0,F.offsetStartDTS)(C,A,S),l>0?this.lastEndTime=s:(U.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var g=!!C.audio,R=!!C.video,D="";g&&(D+="audio"),R&&(D+="video");var x={data1:A,startPTS:c,startDTS:c,endPTS:s,endDTS:s,type:D,hasAudio:g,hasVideo:R,nb:1,dropped:0};m.audio=x.type==="audio"?x:void 0,m.video=x.type!=="audio"?x:void 0,m.initSegment=I;var T=(h=this.initPTS)!=null?h:0;return m.id3=(0,K.flushTextTrackMetadataCueSamples)(d,u,T,T),f.samples.length&&(m.text=(0,K.flushTextTrackUserdataCueSamples)(f,u,T)),m},b}();function v(b,w){var p=b==null?void 0:b.codec;return p&&p.length>4?p:p==="hvc1"||p==="hev1"?"hvc1.1.c.L120.90":p==="av01"?"av01.0.04M.08":p==="avc1"||w===i.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}const E=L},"./src/task-loop.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>V});var V=function(){function K(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var F=K.prototype;return F.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},F.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},F.onHandlerDestroyed=function(){},F.hasInterval=function(){return!!this._tickInterval},F.hasNextTick=function(){return!!this._tickTimer},F.setInterval=function(U){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,U),!0)},F.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},F.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},F.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},F.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},F.doTick=function(){},K}()},"./src/types/cmcd.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{CMCDObjectType:()=>K,CMCDStreamType:()=>i,CMCDStreamingFormat:()=>F,CMCDVersion:()=>V});var V=1,K;(function(U){U.MANIFEST="m",U.AUDIO="a",U.VIDEO="v",U.MUXED="av",U.INIT="i",U.CAPTION="c",U.TIMED_TEXT="tt",U.KEY="k",U.OTHER="o"})(K||(K={}));var F;(function(U){U.DASH="d",U.HLS="h",U.SMOOTH="s",U.OTHER="o"})(F||(F={}));var i;(function(U){U.VOD="v",U.LIVE="l"})(i||(i={}))},"./src/types/demuxer.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{MetadataSchema:()=>V});var V;(function(K){K.audioId3="org.id3",K.dateRange="com.apple.quicktime.HLS",K.emsg="https://aomedia.org/emsg/ID3"})(V||(V={}))},"./src/types/level.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{HdcpLevels:()=>U,HlsSkip:()=>L,HlsUrlParameters:()=>E,Level:()=>b,getSkipValue:()=>v});function V(w,p){for(var y=0;y<p.length;y++){var M=p[y];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(w,F(M.key),M)}}function K(w,p,y){return p&&V(w.prototype,p),y&&V(w,y),Object.defineProperty(w,"prototype",{writable:!1}),w}function F(w){var p=i(w,"string");return typeof p=="symbol"?p:String(p)}function i(w,p){if(typeof w!="object"||w===null)return w;var y=w[Symbol.toPrimitive];if(y!==void 0){var M=y.call(w,p||"default");if(typeof M!="object")return M;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(w)}var U=["NONE","TYPE-0","TYPE-1","TYPE-2",null],L;(function(w){w.No="",w.Yes="YES",w.v2="v2"})(L||(L={}));function v(w,p){var y=w.canSkipUntil,M=w.canSkipDateRanges,d=w.endSN,f=p!==void 0?p-d:0;return y&&f<y?M?L.v2:L.Yes:L.No}var E=function(){function w(y,M,d){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=y,this.part=M,this.skip=d}var p=w.prototype;return p.addDirectives=function(M){var d=new self.URL(M);return this.msn!==void 0&&d.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&d.searchParams.set("_HLS_part",this.part.toString()),this.skip&&d.searchParams.set("_HLS_skip",this.skip),d.href},w}(),b=function(){function w(p){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[p.url],this.attrs=p.attrs,this.bitrate=p.bitrate,p.details&&(this.details=p.details),this.id=p.id||0,this.name=p.name,this.width=p.width||0,this.height=p.height||0,this.audioCodec=p.audioCodec,this.videoCodec=p.videoCodec,this.unknownCodecs=p.unknownCodecs,this.codecSet=[p.videoCodec,p.audioCodec].filter(function(y){return y}).join(",").replace(/\.[^.,]+/g,"")}return K(w,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(y){var M=y%this.url.length;this._urlId!==M&&(this.details=void 0,this._urlId=M)}}]),w}()},"./src/types/loader.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{PlaylistContextType:()=>V,PlaylistLevelType:()=>K});var V;(function(F){F.MANIFEST="manifest",F.LEVEL="level",F.AUDIO_TRACK="audioTrack",F.SUBTITLE_TRACK="subtitleTrack"})(V||(V={}));var K;(function(F){F.MAIN="main",F.AUDIO="audio",F.SUBTITLE="subtitle"})(K||(K={}))},"./src/types/transmuxer.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{ChunkMetadata:()=>V});var V=function(i,U,L,v,E,b){v===void 0&&(v=0),E===void 0&&(E=-1),b===void 0&&(b=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=K(),this.buffering={audio:K(),video:K(),audiovideo:K()},this.level=i,this.sn=U,this.id=L,this.size=v,this.part=E,this.partial=b};function K(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{AttrList:()=>F});var V=/^(\d+)x(\d+)$/,K=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,F=function(){function i(L){typeof L=="string"&&(L=i.parseAttrList(L));for(var v in L)L.hasOwnProperty(v)&&(this[v]=L[v])}var U=i.prototype;return U.decimalInteger=function(v){var E=parseInt(this[v],10);return E>Number.MAX_SAFE_INTEGER?1/0:E},U.hexadecimalInteger=function(v){if(this[v]){var E=(this[v]||"0x").slice(2);E=(E.length&1?"0":"")+E;for(var b=new Uint8Array(E.length/2),w=0;w<E.length/2;w++)b[w]=parseInt(E.slice(w*2,w*2+2),16);return b}else return null},U.hexadecimalIntegerAsNumber=function(v){var E=parseInt(this[v],16);return E>Number.MAX_SAFE_INTEGER?1/0:E},U.decimalFloatingPoint=function(v){return parseFloat(this[v])},U.optionalFloat=function(v,E){var b=this[v];return b?parseFloat(b):E},U.enumeratedString=function(v){return this[v]},U.bool=function(v){return this[v]==="YES"},U.decimalResolution=function(v){var E=V.exec(this[v]);if(E!==null)return{width:parseInt(E[1],10),height:parseInt(E[2],10)}},i.parseAttrList=function(v){var E,b={},w='"';for(K.lastIndex=0;(E=K.exec(v))!==null;){var p=E[2];p.indexOf(w)===0&&p.lastIndexOf(w)===p.length-1&&(p=p.slice(1,-1)),b[E[1]]=p}return b},i}()},"./src/utils/binary-search.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>K});var V={search:function(i,U){for(var L=0,v=i.length-1,E=null,b=null;L<=v;){E=(L+v)/2|0,b=i[E];var w=U(b);if(w>0)L=E+1;else if(w<0)v=E-1;else return b}return null}};const K=V},"./src/utils/buffer-helper.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{BufferHelper:()=>F});var V=B("./src/utils/logger.ts"),K={length:0,start:function(){return 0},end:function(){return 0}},F=function(){function i(){}return i.isBuffered=function(L,v){try{if(L){for(var E=i.getBuffered(L),b=0;b<E.length;b++)if(v>=E.start(b)&&v<=E.end(b))return!0}}catch(w){}return!1},i.bufferInfo=function(L,v,E){try{if(L){var b=i.getBuffered(L),w=[],p;for(p=0;p<b.length;p++)w.push({start:b.start(p),end:b.end(p)});return this.bufferedInfo(w,v,E)}}catch(y){}return{len:0,start:v,end:v,nextStart:void 0}},i.bufferedInfo=function(L,v,E){v=Math.max(0,v),L.sort(function(m,A){var I=m.start-A.start;return I||A.end-m.end});var b=[];if(E)for(var w=0;w<L.length;w++){var p=b.length;if(p){var y=b[p-1].end;L[w].start-y<E?L[w].end>y&&(b[p-1].end=L[w].end):b.push(L[w])}else b.push(L[w])}else b=L;for(var M=0,d,f=v,u=v,h=0;h<b.length;h++){var S=b[h].start,k=b[h].end;if(v+E>=S&&v<k)f=S,u=k,M=u-v;else if(v+E<S){d=S;break}}return{len:M,start:f||0,end:u||0,nextStart:d}},i.getBuffered=function(L){try{return L.buffered}catch(v){return V.logger.log("failed to get media.buffered",v),K}},i}()},"./src/utils/cea-608-parser.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{CaptionScreen:()=>h,Row:()=>u,default:()=>C});var V=B("./src/utils/logger.ts"),K={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},F=function(l){var c=l;return K.hasOwnProperty(l)&&(c=K[l]),String.fromCharCode(c)},i=15,U=100,L={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},v={17:2,18:4,21:6,22:8,23:10,19:13,20:15},E={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},b={25:2,26:4,29:6,30:8,31:10,27:13,28:15},w=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],p;(function(P){P[P.ERROR=0]="ERROR",P[P.TEXT=1]="TEXT",P[P.WARNING=2]="WARNING",P[P.INFO=2]="INFO",P[P.DEBUG=3]="DEBUG",P[P.DATA=3]="DATA"})(p||(p={}));var y=function(){function P(){this.time=null,this.verboseLevel=p.ERROR}var l=P.prototype;return l.log=function(s,g){if(this.verboseLevel>=s){var R=typeof g=="function"?g():g;V.logger.log(this.time+" ["+s+"] "+R)}},P}(),M=function(l){for(var c=[],s=0;s<l.length;s++)c.push(l[s].toString(16));return c},d=function(){function P(c,s,g,R,D){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=c||"white",this.underline=s||!1,this.italics=g||!1,this.background=R||"black",this.flash=D||!1}var l=P.prototype;return l.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},l.setStyles=function(s){for(var g=["foreground","underline","italics","background","flash"],R=0;R<g.length;R++){var D=g[R];s.hasOwnProperty(D)&&(this[D]=s[D])}},l.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},l.equals=function(s){return this.foreground===s.foreground&&this.underline===s.underline&&this.italics===s.italics&&this.background===s.background&&this.flash===s.flash},l.copy=function(s){this.foreground=s.foreground,this.underline=s.underline,this.italics=s.italics,this.background=s.background,this.flash=s.flash},l.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},P}(),f=function(){function P(c,s,g,R,D,x){this.uchar=void 0,this.penState=void 0,this.uchar=c||" ",this.penState=new d(s,g,R,D,x)}var l=P.prototype;return l.reset=function(){this.uchar=" ",this.penState.reset()},l.setChar=function(s,g){this.uchar=s,this.penState.copy(g)},l.setPenState=function(s){this.penState.copy(s)},l.equals=function(s){return this.uchar===s.uchar&&this.penState.equals(s.penState)},l.copy=function(s){this.uchar=s.uchar,this.penState.copy(s.penState)},l.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},P}(),u=function(){function P(c){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var s=0;s<U;s++)this.chars.push(new f);this.logger=c,this.pos=0,this.currPenState=new d}var l=P.prototype;return l.equals=function(s){for(var g=!0,R=0;R<U;R++)if(!this.chars[R].equals(s.chars[R])){g=!1;break}return g},l.copy=function(s){for(var g=0;g<U;g++)this.chars[g].copy(s.chars[g])},l.isEmpty=function(){for(var s=!0,g=0;g<U;g++)if(!this.chars[g].isEmpty()){s=!1;break}return s},l.setCursor=function(s){this.pos!==s&&(this.pos=s),this.pos<0?(this.logger.log(p.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>U&&(this.logger.log(p.DEBUG,"Too large cursor position "+this.pos),this.pos=U)},l.moveCursor=function(s){var g=this.pos+s;if(s>1)for(var R=this.pos+1;R<g+1;R++)this.chars[R].setPenState(this.currPenState);this.setCursor(g)},l.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},l.insertChar=function(s){var g=this;s>=144&&this.backSpace();var R=F(s);if(this.pos>=U){this.logger.log(p.ERROR,function(){return"Cannot insert "+s.toString(16)+" ("+R+") at position "+g.pos+". Skipping it!"});return}this.chars[this.pos].setChar(R,this.currPenState),this.moveCursor(1)},l.clearFromPos=function(s){var g;for(g=s;g<U;g++)this.chars[g].reset()},l.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},l.clearToEndOfRow=function(){this.clearFromPos(this.pos)},l.getTextString=function(){for(var s=[],g=!0,R=0;R<U;R++){var D=this.chars[R].uchar;D!==" "&&(g=!1),s.push(D)}return g?"":s.join("")},l.setPenStyles=function(s){this.currPenState.setStyles(s);var g=this.chars[this.pos];g.setPenState(this.currPenState)},P}(),h=function(){function P(c){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var s=0;s<i;s++)this.rows.push(new u(c));this.logger=c,this.currRow=i-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var l=P.prototype;return l.reset=function(){for(var s=0;s<i;s++)this.rows[s].clear();this.currRow=i-1},l.equals=function(s){for(var g=!0,R=0;R<i;R++)if(!this.rows[R].equals(s.rows[R])){g=!1;break}return g},l.copy=function(s){for(var g=0;g<i;g++)this.rows[g].copy(s.rows[g])},l.isEmpty=function(){for(var s=!0,g=0;g<i;g++)if(!this.rows[g].isEmpty()){s=!1;break}return s},l.backSpace=function(){var s=this.rows[this.currRow];s.backSpace()},l.clearToEndOfRow=function(){var s=this.rows[this.currRow];s.clearToEndOfRow()},l.insertChar=function(s){var g=this.rows[this.currRow];g.insertChar(s)},l.setPen=function(s){var g=this.rows[this.currRow];g.setPenStyles(s)},l.moveCursor=function(s){var g=this.rows[this.currRow];g.moveCursor(s)},l.setCursor=function(s){this.logger.log(p.INFO,"setCursor: "+s);var g=this.rows[this.currRow];g.setCursor(s)},l.setPAC=function(s){this.logger.log(p.INFO,function(){return"pacData = "+JSON.stringify(s)});var g=s.row-1;if(this.nrRollUpRows&&g<this.nrRollUpRows-1&&(g=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==g){for(var R=0;R<i;R++)this.rows[R].clear();var D=this.currRow+1-this.nrRollUpRows,x=this.lastOutputScreen;if(x){var T=x.rows[D].cueStartTime,O=this.logger.time;if(T&&O!==null&&T<O)for(var $=0;$<this.nrRollUpRows;$++)this.rows[g-this.nrRollUpRows+$+1].copy(x.rows[D+$])}}this.currRow=g;var H=this.rows[this.currRow];if(s.indent!==null){var Z=s.indent,te=Math.max(Z-1,0);H.setCursor(s.indent),s.color=H.chars[te].penState.foreground}var J={foreground:s.color,underline:s.underline,italics:s.italics,background:"black",flash:!1};this.setPen(J)},l.setBkgData=function(s){this.logger.log(p.INFO,function(){return"bkgData = "+JSON.stringify(s)}),this.backSpace(),this.setPen(s),this.insertChar(32)},l.setRollUpRows=function(s){this.nrRollUpRows=s},l.rollUp=function(){var s=this;if(this.nrRollUpRows===null){this.logger.log(p.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(p.TEXT,function(){return s.getDisplayText()});var g=this.currRow+1-this.nrRollUpRows,R=this.rows.splice(g,1)[0];R.clear(),this.rows.splice(this.currRow,0,R),this.logger.log(p.INFO,"Rolling up")},l.getDisplayText=function(s){s=s||!1;for(var g=[],R="",D=-1,x=0;x<i;x++){var T=this.rows[x].getTextString();T&&(D=x+1,s?g.push("Row "+D+": '"+T+"'"):g.push(T.trim()))}return g.length>0&&(s?R="["+g.join(" | ")+"]":R=g.join(`
`)),R},l.getTextAndFormat=function(){return this.rows},P}(),S=function(){function P(c,s,g){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=c,this.outputFilter=s,this.mode=null,this.verbose=0,this.displayedMemory=new h(g),this.nonDisplayedMemory=new h(g),this.lastOutputScreen=new h(g),this.currRollUpRow=this.displayedMemory.rows[i-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=g}var l=P.prototype;return l.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[i-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},l.getHandler=function(){return this.outputFilter},l.setHandler=function(s){this.outputFilter=s},l.setPAC=function(s){this.writeScreen.setPAC(s)},l.setBkgData=function(s){this.writeScreen.setBkgData(s)},l.setMode=function(s){s!==this.mode&&(this.mode=s,this.logger.log(p.INFO,function(){return"MODE="+s}),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=s)},l.insertChars=function(s){for(var g=this,R=0;R<s.length;R++)this.writeScreen.insertChar(s[R]);var D=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(p.INFO,function(){return D+": "+g.writeScreen.getDisplayText(!0)}),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(p.TEXT,function(){return"DISPLAYED: "+g.displayedMemory.getDisplayText(!0)}),this.outputDataUpdate())},l.ccRCL=function(){this.logger.log(p.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},l.ccBS=function(){this.logger.log(p.INFO,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},l.ccAOF=function(){},l.ccAON=function(){},l.ccDER=function(){this.logger.log(p.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},l.ccRU=function(s){this.logger.log(p.INFO,"RU("+s+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(s)},l.ccFON=function(){this.logger.log(p.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},l.ccRDC=function(){this.logger.log(p.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},l.ccTR=function(){this.logger.log(p.INFO,"TR"),this.setMode("MODE_TEXT")},l.ccRTD=function(){this.logger.log(p.INFO,"RTD"),this.setMode("MODE_TEXT")},l.ccEDM=function(){this.logger.log(p.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},l.ccCR=function(){this.logger.log(p.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},l.ccENM=function(){this.logger.log(p.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},l.ccEOC=function(){var s=this;if(this.logger.log(p.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var g=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=g,this.writeScreen=this.nonDisplayedMemory,this.logger.log(p.TEXT,function(){return"DISP: "+s.displayedMemory.getDisplayText()})}this.outputDataUpdate(!0)},l.ccTO=function(s){this.logger.log(p.INFO,"TO("+s+") - Tab Offset"),this.writeScreen.moveCursor(s)},l.ccMIDROW=function(s){var g={flash:!1};if(g.underline=s%2===1,g.italics=s>=46,g.italics)g.foreground="white";else{var R=Math.floor(s/2)-16,D=["white","green","blue","cyan","red","yellow","magenta"];g.foreground=D[R]}this.logger.log(p.INFO,"MIDROW: "+JSON.stringify(g)),this.writeScreen.setPen(g)},l.outputDataUpdate=function(s){s===void 0&&(s=!1);var g=this.logger.time;g!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=g:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,g,this.lastOutputScreen),s&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:g),this.lastOutputScreen.copy(this.displayedMemory))},l.cueSplitAtTime=function(s){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,s,this.displayedMemory),this.cueStartTime=s))},P}(),k=function(){function P(c,s,g){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var R=new y;this.channels=[null,new S(c,s,R),new S(c+1,g,R)],this.cmdHistory=I(),this.logger=R}var l=P.prototype;return l.getHandler=function(s){return this.channels[s].getHandler()},l.setHandler=function(s,g){this.channels[s].setHandler(g)},l.addData=function(s,g){var R,D,x,T=!1;this.logger.time=s;for(var O=0;O<g.length;O+=2)if(D=g[O]&127,x=g[O+1]&127,!(D===0&&x===0)){if(this.logger.log(p.DATA,"["+M([g[O],g[O+1]])+"] -> ("+M([D,x])+")"),R=this.parseCmd(D,x),R||(R=this.parseMidrow(D,x)),R||(R=this.parsePAC(D,x)),R||(R=this.parseBackgroundAttributes(D,x)),!R&&(T=this.parseChars(D,x),T)){var $=this.currentChannel;if($&&$>0){var H=this.channels[$];H.insertChars(T)}else this.logger.log(p.WARNING,"No channel found yet. TEXT-MODE?")}!R&&!T&&this.logger.log(p.WARNING,"Couldn't parse cleaned data "+M([D,x])+" orig: "+M([g[O],g[O+1]]))}},l.parseCmd=function(s,g){var R=this.cmdHistory,D=(s===20||s===28||s===21||s===29)&&g>=32&&g<=47,x=(s===23||s===31)&&g>=33&&g<=35;if(!(D||x))return!1;if(A(s,g,R))return m(null,null,R),this.logger.log(p.DEBUG,"Repeated command ("+M([s,g])+") is dropped"),!0;var T=s===20||s===21||s===23?1:2,O=this.channels[T];return s===20||s===21||s===28||s===29?g===32?O.ccRCL():g===33?O.ccBS():g===34?O.ccAOF():g===35?O.ccAON():g===36?O.ccDER():g===37?O.ccRU(2):g===38?O.ccRU(3):g===39?O.ccRU(4):g===40?O.ccFON():g===41?O.ccRDC():g===42?O.ccTR():g===43?O.ccRTD():g===44?O.ccEDM():g===45?O.ccCR():g===46?O.ccENM():g===47&&O.ccEOC():O.ccTO(g-32),m(s,g,R),this.currentChannel=T,!0},l.parseMidrow=function(s,g){var R=0;if((s===17||s===25)&&g>=32&&g<=47){if(s===17?R=1:R=2,R!==this.currentChannel)return this.logger.log(p.ERROR,"Mismatch channel in midrow parsing"),!1;var D=this.channels[R];return D?(D.ccMIDROW(g),this.logger.log(p.DEBUG,"MIDROW ("+M([s,g])+")"),!0):!1}return!1},l.parsePAC=function(s,g){var R,D=this.cmdHistory,x=(s>=17&&s<=23||s>=25&&s<=31)&&g>=64&&g<=127,T=(s===16||s===24)&&g>=64&&g<=95;if(!(x||T))return!1;if(A(s,g,D))return m(null,null,D),!0;var O=s<=23?1:2;g>=64&&g<=95?R=O===1?L[s]:E[s]:R=O===1?v[s]:b[s];var $=this.channels[O];return $?($.setPAC(this.interpretPAC(R,g)),m(s,g,D),this.currentChannel=O,!0):!1},l.interpretPAC=function(s,g){var R,D={color:null,italics:!1,indent:null,underline:!1,row:s};return g>95?R=g-96:R=g-64,D.underline=(R&1)===1,R<=13?D.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(R/2)]:R<=15?(D.italics=!0,D.color="white"):D.indent=Math.floor((R-16)/2)*4,D},l.parseChars=function(s,g){var R,D=null,x=null;if(s>=25?(R=2,x=s-8):(R=1,x=s),x>=17&&x<=19){var T;x===17?T=g+80:x===18?T=g+112:T=g+144,this.logger.log(p.INFO,"Special char '"+F(T)+"' in channel "+R),D=[T]}else s>=32&&s<=127&&(D=g===0?[s]:[s,g]);if(D){var O=M(D);this.logger.log(p.DEBUG,"Char codes = "+O.join(",")),m(s,g,this.cmdHistory)}return D},l.parseBackgroundAttributes=function(s,g){var R=(s===16||s===24)&&g>=32&&g<=47,D=(s===23||s===31)&&g>=45&&g<=47;if(!(R||D))return!1;var x,T={};s===16||s===24?(x=Math.floor((g-32)/2),T.background=w[x],g%2===1&&(T.background=T.background+"_semi")):g===45?T.background="transparent":(T.foreground="black",g===47&&(T.underline=!0));var O=s<=23?1:2,$=this.channels[O];return $.setBkgData(T),m(s,g,this.cmdHistory),!0},l.reset=function(){for(var s=0;s<Object.keys(this.channels).length;s++){var g=this.channels[s];g&&g.reset()}this.cmdHistory=I()},l.cueSplitAtTime=function(s){for(var g=0;g<this.channels.length;g++){var R=this.channels[g];R&&R.cueSplitAtTime(s)}},P}();function m(P,l,c){c.a=P,c.b=l}function A(P,l,c){return c.a===P&&c.b===l}function I(){return{a:null,b:null}}const C=k},"./src/utils/codecs.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{isCodecSupportedInMp4:()=>F,isCodecType:()=>K});var V={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dva1:!0,dvav:!0,dvh1:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function K(i,U){var L=V[U];return!!L&&L[i.slice(0,4)]===!0}function F(i,U){return MediaSource.isTypeSupported((U||"video")+'/mp4;codecs="'+i+'"')}},"./src/utils/cues.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>L});var V=B("./src/utils/vttparser.ts"),K=B("./src/utils/webvtt-parser.ts"),F=B("./src/utils/texttrack-utils.ts"),i=/\s/,U={newCue:function(E,b,w,p){for(var y=[],M,d,f,u,h,S=self.VTTCue||self.TextTrackCue,k=0;k<p.rows.length;k++)if(M=p.rows[k],f=!0,u=0,h="",!M.isEmpty()){for(var m=0;m<M.chars.length;m++)i.test(M.chars[m].uchar)&&f?u++:(h+=M.chars[m].uchar,f=!1);M.cueStartTime=b,b===w&&(w+=1e-4),u>=16?u--:u++;var A=(0,V.fixLineBreaks)(h.trim()),I=(0,K.generateCueId)(b,w,A);(!E||!E.cues||!E.cues.getCueById(I))&&(d=new S(b,w,A),d.id=I,d.line=k+1,d.align="left",d.position=10+Math.min(80,Math.floor(u*8/32)*10),y.push(d))}return E&&y.length&&(y.sort(function(C,P){return C.line==="auto"||P.line==="auto"?0:C.line>8&&P.line>8?P.line-C.line:C.line-P.line}),y.forEach(function(C){return(0,F.addCueToTrack)(E,C)})),y}};const L=U},"./src/utils/discontinuities.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{adjustSlidingStart:()=>E,alignMediaPlaylistByPDT:()=>y,alignPDT:()=>p,alignStream:()=>b,findDiscontinuousReferenceFrag:()=>L,findFirstFragWithCC:()=>i,shouldAlignOnDiscontinuities:()=>U});var V=B("./src/polyfills/number.ts"),K=B("./src/utils/logger.ts"),F=B("./src/controller/level-helper.ts");function i(M,d){for(var f=null,u=0,h=M.length;u<h;u++){var S=M[u];if(S&&S.cc===d){f=S;break}}return f}function U(M,d,f){return!!(d.details&&(f.endCC>f.startCC||M&&M.cc<f.startCC))}function L(M,d,f){f===void 0&&(f=0);var u=M.fragments,h=d.fragments;if(!h.length||!u.length){K.logger.log("No fragments to align");return}var S=i(u,h[0].cc);if(!S||S&&!S.startPTS){K.logger.log("No frag in previous level to align on");return}return S}function v(M,d){if(M){var f=M.start+d;M.start=M.startPTS=f,M.endPTS=f+M.duration}}function E(M,d){for(var f=d.fragments,u=0,h=f.length;u<h;u++)v(f[u],M);d.fragmentHint&&v(d.fragmentHint,M),d.alignedSliding=!0}function b(M,d,f){d&&(w(M,f,d),!f.alignedSliding&&d.details&&p(f,d.details),!f.alignedSliding&&d.details&&!f.skippedSegments&&(0,F.adjustSliding)(d.details,f))}function w(M,d,f){if(U(M,f,d)){var u=L(f.details,d);u&&(0,V.isFiniteNumber)(u.start)&&(K.logger.log("Adjusting PTS using last level due to CC increase within current level "+d.url),E(u.start,d))}}function p(M,d){if(!(!d.fragments.length||!M.hasProgramDateTime||!d.hasProgramDateTime)){var f=d.fragments[0].programDateTime,u=M.fragments[0].programDateTime,h=(u-f)/1e3+d.fragments[0].start;h&&(0,V.isFiniteNumber)(h)&&(K.logger.log("Adjusting PTS using programDateTime delta "+(u-f)+"ms, sliding:"+h.toFixed(3)+" "+M.url+" "),E(h,M))}}function y(M,d){if(!(!M.hasProgramDateTime||!d.hasProgramDateTime)){var f=M.fragments,u=d.fragments;if(!(!f.length||!u.length)){var h=Math.round(u.length/2)-1,S=u[h],k=i(f,S.cc)||f[Math.round(f.length/2)-1],m=S.programDateTime,A=k.programDateTime;if(!(m===null||A===null)){var I=(A-m)/1e3-(k.start-S.start);E(I,M)}}}}},"./src/utils/ewma-bandwidth-estimator.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>F});var V=B("./src/utils/ewma.ts"),K=function(){function i(L,v,E){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=E,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new V.default(L),this.fast_=new V.default(v)}var U=i.prototype;return U.update=function(v,E){var b=this.slow_,w=this.fast_;this.slow_.halfLife!==v&&(this.slow_=new V.default(v,b.getEstimate(),b.getTotalWeight())),this.fast_.halfLife!==E&&(this.fast_=new V.default(E,w.getEstimate(),w.getTotalWeight()))},U.sample=function(v,E){v=Math.max(v,this.minDelayMs_);var b=8*E,w=v/1e3,p=b/w;this.fast_.sample(w,p),this.slow_.sample(w,p)},U.canEstimate=function(){var v=this.fast_;return v&&v.getTotalWeight()>=this.minWeight_},U.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},U.destroy=function(){},i}();const F=K},"./src/utils/ewma.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>K});var V=function(){function F(U,L,v){L===void 0&&(L=0),v===void 0&&(v=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=U,this.alpha_=U?Math.exp(Math.log(.5)/U):0,this.estimate_=L,this.totalWeight_=v}var i=F.prototype;return i.sample=function(L,v){var E=Math.pow(this.alpha_,L);this.estimate_=v*(1-E)+E*this.estimate_,this.totalWeight_+=L},i.getTotalWeight=function(){return this.totalWeight_},i.getEstimate=function(){if(this.alpha_){var L=1-Math.pow(this.alpha_,this.totalWeight_);if(L)return this.estimate_/L}return this.estimate_},F}();const K=V},"./src/utils/fetch-loader.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>h,fetchSupported:()=>y});var V=B("./src/polyfills/number.ts"),K=B("./src/loader/load-stats.ts"),F=B("./src/demux/chunk-cache.ts");function i(S,k){S.prototype=Object.create(k.prototype),S.prototype.constructor=S,b(S,k)}function U(S){var k=typeof Map=="function"?new Map:void 0;return U=function(A){if(A===null||!E(A))return A;if(typeof A!="function")throw new TypeError("Super expression must either be null or a function");if(typeof k!="undefined"){if(k.has(A))return k.get(A);k.set(A,I)}function I(){return L(A,arguments,w(this).constructor)}return I.prototype=Object.create(A.prototype,{constructor:{value:I,enumerable:!1,writable:!0,configurable:!0}}),b(I,A)},U(S)}function L(S,k,m){return v()?L=Reflect.construct.bind():L=function(I,C,P){var l=[null];l.push.apply(l,C);var c=Function.bind.apply(I,l),s=new c;return P&&b(s,P.prototype),s},L.apply(null,arguments)}function v(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(S){return!1}}function E(S){return Function.toString.call(S).indexOf("[native code]")!==-1}function b(S,k){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,I){return A.__proto__=I,A},b(S,k)}function w(S){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(m){return m.__proto__||Object.getPrototypeOf(m)},w(S)}function p(){return p=Object.assign?Object.assign.bind():function(S){for(var k=1;k<arguments.length;k++){var m=arguments[k];for(var A in m)Object.prototype.hasOwnProperty.call(m,A)&&(S[A]=m[A])}return S},p.apply(this,arguments)}function y(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(S){}return!1}var M=function(){function S(m){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=m.fetchSetup||f,this.controller=new self.AbortController,this.stats=new K.LoadStats}var k=S.prototype;return k.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},k.abortInternal=function(){var A=this.response;(!A||!A.ok)&&(this.stats.aborted=!0,this.controller.abort())},k.abort=function(){var A;this.abortInternal(),(A=this.callbacks)!==null&&A!==void 0&&A.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},k.load=function(A,I,C){var P=this,l=this.stats;if(l.loading.start)throw new Error("Loader can only be used once.");l.loading.start=self.performance.now();var c=d(A,this.controller.signal),s=C.onProgress,g=A.responseType==="arraybuffer",R=g?"byteLength":"length";this.context=A,this.config=I,this.callbacks=C,this.request=this.fetchSetup(A,c),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){P.abortInternal(),C.onTimeout(l,A,P.response)},I.timeout),self.fetch(this.request).then(function(D){if(P.response=P.loader=D,!D.ok){var x=D.status,T=D.statusText;throw new u(T||"fetch, bad network response",x,D)}return l.loading.first=Math.max(self.performance.now(),l.loading.start),l.total=parseInt(D.headers.get("Content-Length")||"0"),s&&(0,V.isFiniteNumber)(I.highWaterMark)?P.loadProgressively(D,l,A,I.highWaterMark,s):g?D.arrayBuffer():D.text()}).then(function(D){var x=P.response;self.clearTimeout(P.requestTimeout),l.loading.end=Math.max(self.performance.now(),l.loading.first);var T=D[R];T&&(l.loaded=l.total=T);var O={url:x.url,data:D};s&&!(0,V.isFiniteNumber)(I.highWaterMark)&&s(l,A,D,x),C.onSuccess(O,l,A,x)}).catch(function(D){if(self.clearTimeout(P.requestTimeout),!l.aborted){var x=D&&D.code||0,T=D?D.message:null;C.onError({code:x,text:T},A,D?D.details:null)}})},k.getCacheAge=function(){var A=null;if(this.response){var I=this.response.headers.get("age");A=I?parseFloat(I):null}return A},k.loadProgressively=function(A,I,C,P,l){P===void 0&&(P=0);var c=new F.default,s=A.body.getReader(),g=function R(){return s.read().then(function(D){if(D.done)return c.dataLength&&l(I,C,c.flush(),A),Promise.resolve(new ArrayBuffer(0));var x=D.value,T=x.length;return I.loaded+=T,T<P||c.dataLength?(c.push(x),c.dataLength>=P&&l(I,C,c.flush(),A)):l(I,C,x,A),R()}).catch(function(){return Promise.reject()})};return g()},S}();function d(S,k){var m={method:"GET",mode:"cors",credentials:"same-origin",signal:k,headers:new self.Headers(p({},S.headers))};return S.rangeEnd&&m.headers.set("Range","bytes="+S.rangeStart+"-"+String(S.rangeEnd-1)),m}function f(S,k){return new self.Request(S.url,k)}var u=function(S){i(k,S);function k(m,A,I){var C;return C=S.call(this,m)||this,C.code=void 0,C.details=void 0,C.code=A,C.details=I,C}return k}(U(Error));const h=M},"./src/utils/hex.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>K});var V={hexDump:function(i){for(var U="",L=0;L<i.length;L++){var v=i[L].toString(16);v.length<2&&(v="0"+v),U+=v}return U}};const K=V},"./src/utils/imsc1-ttml-parser.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{IMSC1_CODEC:()=>E,parseIMSC1:()=>y});var V=B("./src/utils/mp4-tools.ts"),K=B("./src/utils/vttparser.ts"),F=B("./src/utils/vttcue.ts"),i=B("./src/demux/id3.ts"),U=B("./src/utils/timescale-conversion.ts"),L=B("./src/utils/webvtt-parser.ts");function v(){return v=Object.assign?Object.assign.bind():function(C){for(var P=1;P<arguments.length;P++){var l=arguments[P];for(var c in l)Object.prototype.hasOwnProperty.call(l,c)&&(C[c]=l[c])}return C},v.apply(this,arguments)}var E="stpp.ttml.im1t",b=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,w=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,p={left:"start",center:"center",right:"end",start:"start",end:"end"};function y(C,P,l,c,s){var g=(0,V.findBox)(new Uint8Array(C),["mdat"]);if(g.length===0){s(new Error("Could not parse IMSC1 mdat"));return}var R=g.map(function(x){return(0,i.utf8ArrayToStr)(x)}),D=(0,U.toTimescaleFromScale)(P,1,l);try{R.forEach(function(x){return c(M(x,D))})}catch(x){s(x)}}function M(C,P){var l=new DOMParser,c=l.parseFromString(C,"text/xml"),s=c.getElementsByTagName("tt")[0];if(!s)throw new Error("Invalid ttml");var g={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},R=Object.keys(g).reduce(function($,H){return $[H]=s.getAttribute("ttp:"+H)||g[H],$},{}),D=s.getAttribute("xml:space")!=="preserve",x=f(d(s,"styling","style")),T=f(d(s,"layout","region")),O=d(s,"body","[begin]");return[].map.call(O,function($){var H=u($,D);if(!H||!$.hasAttribute("begin"))return null;var Z=m($.getAttribute("begin"),R),te=m($.getAttribute("dur"),R),J=m($.getAttribute("end"),R);if(Z===null)throw k($);if(J===null){if(te===null)throw k($);J=Z+te}var ie=new F.default(Z-P,J-P,H);ie.id=(0,L.generateCueId)(ie.startTime,ie.endTime,ie.text);var oe=T[$.getAttribute("region")],ue=x[$.getAttribute("style")],Pe=h(oe,ue,x),Ne=Pe.textAlign;if(Ne){var Ve=p[Ne];Ve&&(ie.lineAlign=Ve),ie.align=Ne}return v(ie,Pe),ie}).filter(function($){return $!==null})}function d(C,P,l){var c=C.getElementsByTagName(P)[0];return c?[].slice.call(c.querySelectorAll(l)):[]}function f(C){return C.reduce(function(P,l){var c=l.getAttribute("xml:id");return c&&(P[c]=l),P},{})}function u(C,P){return[].slice.call(C.childNodes).reduce(function(l,c,s){var g;return c.nodeName==="br"&&s?l+`
`:(g=c.childNodes)!==null&&g!==void 0&&g.length?u(c,P):P?l+c.textContent.trim().replace(/\s+/g," "):l+c.textContent},"")}function h(C,P,l){var c="http://www.w3.org/ns/ttml#styling",s=null,g=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],R=C!=null&&C.hasAttribute("style")?C.getAttribute("style"):null;return R&&l.hasOwnProperty(R)&&(s=l[R]),g.reduce(function(D,x){var T=S(P,c,x)||S(C,c,x)||S(s,c,x);return T&&(D[x]=T),D},{})}function S(C,P,l){return C&&C.hasAttributeNS(P,l)?C.getAttributeNS(P,l):null}function k(C){return new Error("Could not parse ttml timestamp "+C)}function m(C,P){if(!C)return null;var l=(0,K.parseTimeStamp)(C);return l===null&&(b.test(C)?l=A(C,P):w.test(C)&&(l=I(C,P))),l}function A(C,P){var l=b.exec(C),c=(l[4]|0)+(l[5]|0)/P.subFrameRate;return(l[1]|0)*3600+(l[2]|0)*60+(l[3]|0)+c/P.frameRate}function I(C,P){var l=w.exec(C),c=Number(l[1]),s=l[2];switch(s){case"h":return c*3600;case"m":return c*60;case"ms":return c*1e3;case"f":return c/P.frameRate;case"t":return c/P.tickRate}return c}},"./src/utils/keysystem-util.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{changeEndianness:()=>F,convertDataUriToArrayBytes:()=>i,strToUtf8array:()=>U});var V=B("./src/utils/numeric-encoding-utils.ts");function K(L){var v=U(L).subarray(0,16),E=new Uint8Array(16);return E.set(v,16-v.length),E}function F(L){var v=function(b,w,p){var y=b[w];b[w]=b[p],b[p]=y};v(L,0,3),v(L,1,2),v(L,4,5),v(L,6,7)}function i(L){var v=L.split(":"),E=null;if(v[0]==="data"&&v.length===2){var b=v[1].split(";"),w=b[b.length-1].split(",");if(w.length===2){var p=w[0]==="base64",y=w[1];p?(b.splice(-1,1),E=(0,V.base64Decode)(y)):E=K(y)}}return E}function U(L){return Uint8Array.from(unescape(encodeURIComponent(L)),function(v){return v.charCodeAt(0)})}},"./src/utils/logger.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{enableLogs:()=>L,logger:()=>v});var V=function(){},K={trace:V,debug:V,log:V,warn:V,info:V,error:V},F=K;function i(E){var b=self.console[E];return b?b.bind(self.console,"["+E+"] >"):V}function U(E){for(var b=arguments.length,w=new Array(b>1?b-1:0),p=1;p<b;p++)w[p-1]=arguments[p];w.forEach(function(y){F[y]=E[y]?E[y].bind(E):i(y)})}function L(E,b){if(self.console&&E===!0||typeof E=="object"){U(E,"debug","log","info","warn","error");try{F.log('Debug logs enabled for "'+b+'"')}catch(w){F=K}}else F=K}var v=F},"./src/utils/mediakeys-helper.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{KeySystemFormats:()=>K,KeySystemIds:()=>i,KeySystems:()=>V,getKeySystemsForConfig:()=>v,getSupportedMediaKeySystemConfigurations:()=>b,keySystemDomainToKeySystemFormat:()=>L,keySystemFormatToKeySystemDomain:()=>F,keySystemIdToKeySystemDomain:()=>U,requestMediaKeySystemAccess:()=>E});var V;(function(p){p.CLEARKEY="org.w3.clearkey",p.FAIRPLAY="com.apple.fps",p.PLAYREADY="com.microsoft.playready",p.WIDEVINE="com.widevine.alpha"})(V||(V={}));var K;(function(p){p.CLEARKEY="org.w3.clearkey",p.FAIRPLAY="com.apple.streamingkeydelivery",p.PLAYREADY="com.microsoft.playready",p.WIDEVINE="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"})(K||(K={}));function F(p){switch(p){case K.FAIRPLAY:return V.FAIRPLAY;case K.PLAYREADY:return V.PLAYREADY;case K.WIDEVINE:return V.WIDEVINE;case K.CLEARKEY:return V.CLEARKEY}}var i;(function(p){p.WIDEVINE="edef8ba979d64acea3c827dcd51d21ed"})(i||(i={}));function U(p){if(p===i.WIDEVINE)return V.WIDEVINE}function L(p){switch(p){case V.FAIRPLAY:return K.FAIRPLAY;case V.PLAYREADY:return K.PLAYREADY;case V.WIDEVINE:return K.WIDEVINE;case V.CLEARKEY:return K.CLEARKEY}}function v(p){var y=p.drmSystems,M=p.widevineLicenseUrl,d=y?[V.FAIRPLAY,V.WIDEVINE,V.PLAYREADY,V.CLEARKEY].filter(function(f){return!!y[f]}):[];return!d[V.WIDEVINE]&&M&&d.push(V.WIDEVINE),d}var E=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function b(p,y,M,d){var f;switch(p){case V.FAIRPLAY:f=["cenc","sinf"];break;case V.WIDEVINE:case V.PLAYREADY:f=["cenc"];break;case V.CLEARKEY:f=["cenc","keyids"];break;default:throw new Error("Unknown key-system: "+p)}return w(f,y,M,d)}function w(p,y,M,d){var f={initDataTypes:p,persistentState:d.persistentState||"not-allowed",distinctiveIdentifier:d.distinctiveIdentifier||"not-allowed",sessionTypes:d.sessionTypes||[d.sessionType||"temporary"],audioCapabilities:y.map(function(u){return{contentType:'audio/mp4; codecs="'+u+'"',robustness:d.audioRobustness||"",encryptionScheme:d.audioEncryptionScheme||null}}),videoCapabilities:M.map(function(u){return{contentType:'video/mp4; codecs="'+u+'"',robustness:d.videoRobustness||"",encryptionScheme:d.videoEncryptionScheme||null}})};return[f]}},"./src/utils/mediasource-helper.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{getMediaSource:()=>V});function V(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{RemuxerTrackIdConfig:()=>E,appendUint8Array:()=>P,bin2str:()=>b,computeRawDurationFromSamples:()=>A,discardEPB:()=>R,findBox:()=>d,getDuration:()=>m,getStartDTS:()=>k,mp4Box:()=>x,mp4pssh:()=>T,offsetStartDTS:()=>I,parseEmsg:()=>D,parseInitSegment:()=>u,parsePssh:()=>O,parseSEIMessageFromNALu:()=>g,parseSamples:()=>l,parseSegmentIndex:()=>f,parseSinf:()=>S,patchEncyptionData:()=>h,readSint32:()=>y,readUint16:()=>w,readUint32:()=>p,segmentValidRange:()=>C,writeUint32:()=>M});var V=B("./src/loader/fragment.ts"),K=B("./src/utils/typed-array.ts"),F=B("./src/demux/id3.ts"),i=B("./src/utils/logger.ts"),U=B("./src/utils/hex.ts"),L=Math.pow(2,32)-1,v=[].push,E={video:1,audio:2,id3:3,text:4};function b($){return String.fromCharCode.apply(null,$)}function w($,H){var Z=$[H]<<8|$[H+1];return Z<0?65536+Z:Z}function p($,H){var Z=y($,H);return Z<0?4294967296+Z:Z}function y($,H){return $[H]<<24|$[H+1]<<16|$[H+2]<<8|$[H+3]}function M($,H,Z){$[H]=Z>>24,$[H+1]=Z>>16&255,$[H+2]=Z>>8&255,$[H+3]=Z&255}function d($,H){var Z=[];if(!H.length)return Z;for(var te=$.byteLength,J=0;J<te;){var ie=p($,J),oe=b($.subarray(J+4,J+8)),ue=ie>1?J+ie:te;if(oe===H[0])if(H.length===1)Z.push($.subarray(J+8,ue));else{var Pe=d($.subarray(J+8,ue),H.slice(1));Pe.length&&v.apply(Z,Pe)}J=ue}return Z}function f($){var H=[],Z=$[0],te=8,J=p($,te);te+=4;var ie=0,oe=0;Z===0?te+=8:te+=16,te+=2;var ue=$.length+oe,Pe=w($,te);te+=2;for(var Ne=0;Ne<Pe;Ne++){var Ve=te,ot=p($,Ve);Ve+=4;var Et=ot&2147483647,it=(ot&2147483648)>>>31;if(it===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Ie=p($,Ve);Ve+=4,H.push({referenceSize:Et,subsegmentDuration:Ie,info:{duration:Ie/J,start:ue,end:ue+Et-1}}),ue+=Et,Ve+=4,te=Ve}return{earliestPresentationTime:ie,timescale:J,version:Z,referencesCount:Pe,references:H}}function u($){for(var H=[],Z=d($,["moov","trak"]),te=0;te<Z.length;te++){var J=Z[te],ie=d(J,["tkhd"])[0];if(ie){var oe=ie[0],ue=oe===0?12:20,Pe=p(ie,ue),Ne=d(J,["mdia","mdhd"])[0];if(Ne){oe=Ne[0],ue=oe===0?12:20;var Ve=p(Ne,ue),ot=d(J,["mdia","hdlr"])[0];if(ot){var Et=b(ot.subarray(8,12)),it={soun:V.ElementaryStreamTypes.AUDIO,vide:V.ElementaryStreamTypes.VIDEO}[Et];if(it){var Ie=d(J,["mdia","minf","stbl","stsd"])[0],He=void 0;Ie&&(He=b(Ie.subarray(12,16))),H[Pe]={timescale:Ve,type:it},H[it]={timescale:Ve,id:Pe,codec:He}}}}}}var ht=d($,["moov","mvex","trex"]);return ht.forEach(function(ft){var dt=p(ft,4),se=H[dt];se&&(se.default={duration:p(ft,12),flags:p(ft,20)})}),H}function h($,H){if(!$||!H)return $;var Z=H.keyId;if(Z&&H.isCommonEncryption){var te=d($,["moov","trak"]);te.forEach(function(J){var ie=d(J,["mdia","minf","stbl","stsd"])[0],oe=ie.subarray(8),ue=d(oe,["enca"]),Pe=ue.length>0;Pe||(ue=d(oe,["encv"])),ue.forEach(function(Ne){var Ve=Pe?Ne.subarray(28):Ne.subarray(78),ot=d(Ve,["sinf"]);ot.forEach(function(Et){var it=S(Et);if(it){var Ie=it.subarray(8,24);Ie.some(function(He){return He!==0})||(i.logger.log("[eme] Patching keyId in 'enc"+(Pe?"a":"v")+">sinf>>tenc' box: "+U.default.hexDump(Ie)+" -> "+U.default.hexDump(Z)),it.set(Z,8))}})})})}return $}function S($){var H=d($,["schm"])[0];if(H){var Z=b(H.subarray(4,8));if(Z==="cbcs"||Z==="cenc")return d($,["schi","tenc"])[0]}return i.logger.error("[eme] missing 'schm' box"),null}function k($,H){return d(H,["moof","traf"]).reduce(function(Z,te){var J=d(te,["tfdt"])[0],ie=J[0],oe=d(te,["tfhd"]).reduce(function(ue,Pe){var Ne=p(Pe,4),Ve=$[Ne];if(Ve){var ot=p(J,4);ie===1&&(ot*=Math.pow(2,32),ot+=p(J,8));var Et=Ve.timescale||9e4,it=ot/Et;if(isFinite(it)&&(ue===null||it<ue))return it}return ue},null);return oe!==null&&isFinite(oe)&&(Z===null||oe<Z)?oe:Z},null)||0}function m($,H){for(var Z=0,te=0,J=0,ie=d($,["moof","traf"]),oe=0;oe<ie.length;oe++){var ue=ie[oe],Pe=d(ue,["tfhd"])[0],Ne=p(Pe,4),Ve=H[Ne];if(Ve){var ot=Ve.default,Et=p(Pe,0)|(ot==null?void 0:ot.flags),it=ot==null?void 0:ot.duration;Et&8&&(Et&2?it=p(Pe,12):it=p(Pe,8));for(var Ie=Ve.timescale||9e4,He=d(ue,["trun"]),ht=0;ht<He.length;ht++){if(Z=A(He[ht]),!Z&&it){var ft=p(He[ht],4);Z=it*ft}Ve.type===V.ElementaryStreamTypes.VIDEO?te+=Z/Ie:Ve.type===V.ElementaryStreamTypes.AUDIO&&(J+=Z/Ie)}}}if(te===0&&J===0){for(var dt=0,se=d($,["sidx"]),De=0;De<se.length;De++){var ze=f(se[De]);ze!=null&&ze.references&&(dt+=ze.references.reduce(function(Ge,qe){return Ge+qe.info.duration||0},0))}return dt}return te||J}function A($){var H=p($,0),Z=8;H&1&&(Z+=4),H&4&&(Z+=4);for(var te=0,J=p($,4),ie=0;ie<J;ie++){if(H&256){var oe=p($,Z);te+=oe,Z+=4}H&512&&(Z+=4),H&1024&&(Z+=4),H&2048&&(Z+=4)}return te}function I($,H,Z){d(H,["moof","traf"]).forEach(function(te){d(te,["tfhd"]).forEach(function(J){var ie=p(J,4),oe=$[ie];if(oe){var ue=oe.timescale||9e4;d(te,["tfdt"]).forEach(function(Pe){var Ne=Pe[0],Ve=p(Pe,4);if(Ne===0)Ve-=Z*ue,Ve=Math.max(Ve,0),M(Pe,4,Ve);else{Ve*=Math.pow(2,32),Ve+=p(Pe,8),Ve-=Z*ue,Ve=Math.max(Ve,0);var ot=Math.floor(Ve/(L+1)),Et=Math.floor(Ve%(L+1));M(Pe,4,ot),M(Pe,8,Et)}})}})})}function C($){var H={valid:null,remainder:null},Z=d($,["moof"]);if(Z){if(Z.length<2)return H.remainder=$,H}else return H;var te=Z[Z.length-1];return H.valid=(0,K.sliceUint8)($,0,te.byteOffset-8),H.remainder=(0,K.sliceUint8)($,te.byteOffset-8),H}function P($,H){var Z=new Uint8Array($.length+H.length);return Z.set($),Z.set(H,$.length),Z}function l($,H){var Z=[],te=H.samples,J=H.timescale,ie=H.id,oe=!1,ue=d(te,["moof"]);return ue.map(function(Pe){var Ne=Pe.byteOffset-8,Ve=d(Pe,["traf"]);Ve.map(function(ot){var Et=d(ot,["tfdt"]).map(function(it){var Ie=it[0],He=p(it,4);return Ie===1&&(He*=Math.pow(2,32),He+=p(it,8)),He/J})[0];return Et!==void 0&&($=Et),d(ot,["tfhd"]).map(function(it){var Ie=p(it,4),He=p(it,0)&16777215,ht=(He&1)!==0,ft=(He&2)!==0,dt=(He&8)!==0,se=0,De=(He&16)!==0,ze=0,Ge=(He&32)!==0,qe=8;Ie===ie&&(ht&&(qe+=8),ft&&(qe+=4),dt&&(se=p(it,qe),qe+=4),De&&(ze=p(it,qe),qe+=4),Ge&&(qe+=4),H.type==="video"&&(oe=c(H.codec)),d(ot,["trun"]).map(function(vt){var Ut=vt[0],bt=p(vt,0)&16777215,ke=(bt&1)!==0,lt=0,$t=(bt&4)!==0,tt=(bt&256)!==0,Ze=0,Je=(bt&512)!==0,pt=0,je=(bt&1024)!==0,_t=(bt&2048)!==0,xt=0,Kt=p(vt,4),Bt=8;ke&&(lt=p(vt,Bt),Bt+=4),$t&&(Bt+=4);for(var Rt=lt+Ne,Se=0;Se<Kt;Se++){if(tt?(Ze=p(vt,Bt),Bt+=4):Ze=se,Je?(pt=p(vt,Bt),Bt+=4):pt=ze,je&&(Bt+=4),_t&&(Ut===0?xt=p(vt,Bt):xt=y(vt,Bt),Bt+=4),H.type===V.ElementaryStreamTypes.VIDEO)for(var fe=0;fe<pt;){var Ce=p(te,Rt);if(Rt+=4,s(oe,te[Rt])){var de=te.subarray(Rt,Rt+Ce);g(de,oe?2:1,$+xt/J,Z)}Rt+=Ce,fe+=Ce+4}$+=Ze/J}}))})})}),Z}function c($){if(!$)return!1;var H=$.indexOf("."),Z=H<0?$:$.substring(0,H);return Z==="hvc1"||Z==="hev1"||Z==="dvh1"||Z==="dvhe"}function s($,H){if($){var Z=H>>1&63;return Z===39||Z===40}else{var te=H&31;return te===6}}function g($,H,Z,te){var J=R($),ie=0;ie+=H;for(var oe=0,ue=0,Pe=!1,Ne=0;ie<J.length;){oe=0;do{if(ie>=J.length)break;Ne=J[ie++],oe+=Ne}while(Ne===255);ue=0;do{if(ie>=J.length)break;Ne=J[ie++],ue+=Ne}while(Ne===255);var Ve=J.length-ie;if(!Pe&&oe===4&&ie<J.length){Pe=!0;var ot=J[ie++];if(ot===181){var Et=w(J,ie);if(ie+=2,Et===49){var it=p(J,ie);if(ie+=4,it===1195456820){var Ie=J[ie++];if(Ie===3){var He=J[ie++],ht=31&He,ft=64&He,dt=ft?2+ht*3:0,se=new Uint8Array(dt);if(ft){se[0]=He;for(var De=1;De<dt;De++)se[De]=J[ie++]}te.push({type:Ie,payloadType:oe,pts:Z,bytes:se})}}}}}else if(oe===5&&ue<Ve){if(Pe=!0,ue>16){for(var ze=[],Ge=0;Ge<16;Ge++){var qe=J[ie++].toString(16);ze.push(qe.length==1?"0"+qe:qe),(Ge===3||Ge===5||Ge===7||Ge===9)&&ze.push("-")}for(var vt=ue-16,Ut=new Uint8Array(vt),bt=0;bt<vt;bt++)Ut[bt]=J[ie++];te.push({payloadType:oe,pts:Z,uuid:ze.join(""),userData:(0,F.utf8ArrayToStr)(Ut),userDataBytes:Ut})}}else if(ue<Ve)ie+=ue;else if(ue>Ve)break}}function R($){for(var H=$.byteLength,Z=[],te=1;te<H-2;)$[te]===0&&$[te+1]===0&&$[te+2]===3?(Z.push(te+2),te+=2):te++;if(Z.length===0)return $;var J=H-Z.length,ie=new Uint8Array(J),oe=0;for(te=0;te<J;oe++,te++)oe===Z[0]&&(oe++,Z.shift()),ie[te]=$[oe];return ie}function D($){var H=$[0],Z="",te="",J=0,ie=0,oe=0,ue=0,Pe=0,Ne=0;if(H===0){for(;b($.subarray(Ne,Ne+1))!=="\0";)Z+=b($.subarray(Ne,Ne+1)),Ne+=1;for(Z+=b($.subarray(Ne,Ne+1)),Ne+=1;b($.subarray(Ne,Ne+1))!=="\0";)te+=b($.subarray(Ne,Ne+1)),Ne+=1;te+=b($.subarray(Ne,Ne+1)),Ne+=1,J=p($,12),ie=p($,16),ue=p($,20),Pe=p($,24),Ne=28}else if(H===1){Ne+=4,J=p($,Ne),Ne+=4;var Ve=p($,Ne);Ne+=4;var ot=p($,Ne);for(Ne+=4,oe=Math.pow(2,32)*Ve+ot,Number.isSafeInteger(oe)||(oe=Number.MAX_SAFE_INTEGER,console.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),ue=p($,Ne),Ne+=4,Pe=p($,Ne),Ne+=4;b($.subarray(Ne,Ne+1))!=="\0";)Z+=b($.subarray(Ne,Ne+1)),Ne+=1;for(Z+=b($.subarray(Ne,Ne+1)),Ne+=1;b($.subarray(Ne,Ne+1))!=="\0";)te+=b($.subarray(Ne,Ne+1)),Ne+=1;te+=b($.subarray(Ne,Ne+1)),Ne+=1}var Et=$.subarray(Ne,$.byteLength);return{schemeIdUri:Z,value:te,timeScale:J,presentationTime:oe,presentationTimeDelta:ie,eventDuration:ue,id:Pe,payload:Et}}function x($){for(var H=arguments.length,Z=new Array(H>1?H-1:0),te=1;te<H;te++)Z[te-1]=arguments[te];for(var J=Z.length,ie=8,oe=J;oe--;)ie+=Z[oe].byteLength;var ue=new Uint8Array(ie);for(ue[0]=ie>>24&255,ue[1]=ie>>16&255,ue[2]=ie>>8&255,ue[3]=ie&255,ue.set($,4),oe=0,ie=8;oe<J;oe++)ue.set(Z[oe],ie),ie+=Z[oe].byteLength;return ue}function T($,H,Z){if($.byteLength!==16)throw new RangeError("Invalid system id");var te,J;if(H){te=1,J=new Uint8Array(H.length*16);for(var ie=0;ie<H.length;ie++){var oe=H[ie];if(oe.byteLength!==16)throw new RangeError("Invalid key");J.set(oe,ie*16)}}else te=0,J=new Uint8Array;var ue;te>0?(ue=new Uint8Array(4),H.length>0&&new DataView(ue.buffer).setUint32(0,H.length,!1)):ue=new Uint8Array;var Pe=new Uint8Array(4);return Z&&Z.byteLength>0&&new DataView(Pe.buffer).setUint32(0,Z.byteLength,!1),x([112,115,115,104],new Uint8Array([te,0,0,0]),$,ue,J,Pe,Z||new Uint8Array)}function O($){if(!($ instanceof ArrayBuffer)||$.byteLength<32)return null;var H={version:0,systemId:"",kids:null,data:null},Z=new DataView($),te=Z.getUint32(0);if($.byteLength!==te&&te>44)return null;var J=Z.getUint32(4);if(J!==1886614376||(H.version=Z.getUint32(8)>>>24,H.version>1))return null;H.systemId=U.default.hexDump(new Uint8Array($,12,16));var ie=Z.getUint32(28);if(H.version===0){if(te-32<ie)return null;H.data=new Uint8Array($,32,ie)}else if(H.version===1){H.kids=[];for(var oe=0;oe<ie;oe++)H.kids.push(new Uint8Array($,32+oe*16,16))}return H}},"./src/utils/numeric-encoding-utils.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{base64Decode:()=>L,base64DecodeToStr:()=>F,base64Encode:()=>i,base64ToBase64Url:()=>V,base64UrlEncode:()=>U,strToBase64Encode:()=>K});function V(v){return v.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function K(v){return btoa(v)}function F(v){return atob(v)}function i(v){return btoa(String.fromCharCode.apply(String,v))}function U(v){return V(i(v))}function L(v){return Uint8Array.from(atob(v),function(E){return E.charCodeAt(0)})}},"./src/utils/output-filter.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>V});var V=function(){function K(i,U){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=i,this.trackName=U}var F=K.prototype;return F.dispatchCue=function(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)},F.newCue=function(U,L,v){(this.startTime===null||this.startTime>U)&&(this.startTime=U),this.endTime=L,this.screen=v,this.timelineController.createCaptionsTrack(this.trackName)},F.reset=function(){this.cueRanges=[],this.startTime=null},K}()},"./src/utils/texttrack-utils.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{addCueToTrack:()=>F,clearCurrentCues:()=>i,getCuesInRange:()=>v,removeCuesInRange:()=>U,sendAddTrackEvent:()=>K});var V=B("./src/utils/logger.ts");function K(E,b){var w;try{w=new Event("addtrack")}catch(p){w=document.createEvent("Event"),w.initEvent("addtrack",!1,!1)}w.track=E,b.dispatchEvent(w)}function F(E,b){var w=E.mode;if(w==="disabled"&&(E.mode="hidden"),E.cues&&!E.cues.getCueById(b.id))try{if(E.addCue(b),!E.cues.getCueById(b.id))throw new Error("addCue is failed for: "+b)}catch(y){V.logger.debug("[texttrack-utils]: "+y);var p=new self.TextTrackCue(b.startTime,b.endTime,b.text);p.id=b.id,E.addCue(p)}w==="disabled"&&(E.mode=w)}function i(E){var b=E.mode;if(b==="disabled"&&(E.mode="hidden"),E.cues)for(var w=E.cues.length;w--;)E.removeCue(E.cues[w]);b==="disabled"&&(E.mode=b)}function U(E,b,w,p){var y=E.mode;if(y==="disabled"&&(E.mode="hidden"),E.cues&&E.cues.length>0)for(var M=v(E.cues,b,w),d=0;d<M.length;d++)(!p||p(M[d]))&&E.removeCue(M[d]);y==="disabled"&&(E.mode=y)}function L(E,b){if(b<E[0].startTime)return 0;var w=E.length-1;if(b>E[w].endTime)return-1;for(var p=0,y=w;p<=y;){var M=Math.floor((y+p)/2);if(b<E[M].startTime)y=M-1;else if(b>E[M].startTime&&p<w)p=M+1;else return M}return E[p].startTime-b<b-E[y].startTime?p:y}function v(E,b,w){var p=[],y=L(E,b);if(y>-1)for(var M=y,d=E.length;M<d;M++){var f=E[M];if(f.startTime>=b&&f.endTime<=w)p.push(f);else if(f.startTime>w)return p}return p}},"./src/utils/time-ranges.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>K});var V={toString:function(i){for(var U="",L=i.length,v=0;v<L;v++)U+="["+i.start(v).toFixed(3)+"-"+i.end(v).toFixed(3)+"]";return U}};const K=V},"./src/utils/timescale-conversion.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{toMpegTsClockFromTimescale:()=>U,toMsFromMpegTsClock:()=>i,toTimescaleFromBase:()=>K,toTimescaleFromScale:()=>F});var V=9e4;function K(L,v,E,b){E===void 0&&(E=1),b===void 0&&(b=!1);var w=L*v*E;return b?Math.round(w):w}function F(L,v,E,b){return E===void 0&&(E=1),b===void 0&&(b=!1),K(L,v,1/E,b)}function i(L,v){return v===void 0&&(v=!1),K(L,1e3,1/V,v)}function U(L,v){return v===void 0&&(v=1),K(L,V,1/v)}},"./src/utils/typed-array.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{sliceUint8:()=>V});function V(K,F,i){return Uint8Array.prototype.slice?K.slice(F,i):new Uint8Array(Array.prototype.slice.call(K,F,i))}},"./src/utils/vttcue.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>V});const V=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var K=["","lr","rl"],F=["start","middle","end","left","right"];function i(b,w){if(typeof w!="string"||!Array.isArray(b))return!1;var p=w.toLowerCase();return~b.indexOf(p)?p:!1}function U(b){return i(K,b)}function L(b){return i(F,b)}function v(b){for(var w=arguments.length,p=new Array(w>1?w-1:0),y=1;y<w;y++)p[y-1]=arguments[y];for(var M=1;M<arguments.length;M++){var d=arguments[M];for(var f in d)b[f]=d[f]}return b}function E(b,w,p){var y=this,M={enumerable:!0};y.hasBeenReset=!1;var d="",f=!1,u=b,h=w,S=p,k=null,m="",A=!0,I="auto",C="start",P=50,l="middle",c=50,s="middle";Object.defineProperty(y,"id",v({},M,{get:function(){return d},set:function(R){d=""+R}})),Object.defineProperty(y,"pauseOnExit",v({},M,{get:function(){return f},set:function(R){f=!!R}})),Object.defineProperty(y,"startTime",v({},M,{get:function(){return u},set:function(R){if(typeof R!="number")throw new TypeError("Start time must be set to a number.");u=R,this.hasBeenReset=!0}})),Object.defineProperty(y,"endTime",v({},M,{get:function(){return h},set:function(R){if(typeof R!="number")throw new TypeError("End time must be set to a number.");h=R,this.hasBeenReset=!0}})),Object.defineProperty(y,"text",v({},M,{get:function(){return S},set:function(R){S=""+R,this.hasBeenReset=!0}})),Object.defineProperty(y,"region",v({},M,{get:function(){return k},set:function(R){k=R,this.hasBeenReset=!0}})),Object.defineProperty(y,"vertical",v({},M,{get:function(){return m},set:function(R){var D=U(R);if(D===!1)throw new SyntaxError("An invalid or illegal string was specified.");m=D,this.hasBeenReset=!0}})),Object.defineProperty(y,"snapToLines",v({},M,{get:function(){return A},set:function(R){A=!!R,this.hasBeenReset=!0}})),Object.defineProperty(y,"line",v({},M,{get:function(){return I},set:function(R){if(typeof R!="number"&&R!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");I=R,this.hasBeenReset=!0}})),Object.defineProperty(y,"lineAlign",v({},M,{get:function(){return C},set:function(R){var D=L(R);if(!D)throw new SyntaxError("An invalid or illegal string was specified.");C=D,this.hasBeenReset=!0}})),Object.defineProperty(y,"position",v({},M,{get:function(){return P},set:function(R){if(R<0||R>100)throw new Error("Position must be between 0 and 100.");P=R,this.hasBeenReset=!0}})),Object.defineProperty(y,"positionAlign",v({},M,{get:function(){return l},set:function(R){var D=L(R);if(!D)throw new SyntaxError("An invalid or illegal string was specified.");l=D,this.hasBeenReset=!0}})),Object.defineProperty(y,"size",v({},M,{get:function(){return c},set:function(R){if(R<0||R>100)throw new Error("Size must be between 0 and 100.");c=R,this.hasBeenReset=!0}})),Object.defineProperty(y,"align",v({},M,{get:function(){return s},set:function(R){var D=L(R);if(!D)throw new SyntaxError("An invalid or illegal string was specified.");s=D,this.hasBeenReset=!0}})),y.displayState=void 0}return E.prototype.getCueAsHTML=function(){var b=self.WebVTT;return b.convertCueToDOMTree(self,this.text)},E}()},"./src/utils/vttparser.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{VTTParser:()=>w,fixLineBreaks:()=>b,parseTimeStamp:()=>F});var V=B("./src/utils/vttcue.ts"),K=function(){function p(){}var y=p.prototype;return y.decode=function(d,f){if(!d)return"";if(typeof d!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(d))},p}();function F(p){function y(d,f,u,h){return(d|0)*3600+(f|0)*60+(u|0)+parseFloat(h||0)}var M=p.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return M?parseFloat(M[2])>59?y(M[2],M[3],0,M[4]):y(M[1],M[2],M[3],M[4]):null}var i=function(){function p(){this.values=Object.create(null)}var y=p.prototype;return y.set=function(d,f){!this.get(d)&&f!==""&&(this.values[d]=f)},y.get=function(d,f,u){return u?this.has(d)?this.values[d]:f[u]:this.has(d)?this.values[d]:f},y.has=function(d){return d in this.values},y.alt=function(d,f,u){for(var h=0;h<u.length;++h)if(f===u[h]){this.set(d,f);break}},y.integer=function(d,f){/^-?\d+$/.test(f)&&this.set(d,parseInt(f,10))},y.percent=function(d,f){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(f)){var u=parseFloat(f);if(u>=0&&u<=100)return this.set(d,u),!0}return!1},p}();function U(p,y,M,d){var f=d?p.split(d):[p];for(var u in f)if(typeof f[u]=="string"){var h=f[u].split(M);if(h.length===2){var S=h[0],k=h[1];y(S,k)}}}var L=new V.default(0,0,""),v=L.align==="middle"?"middle":"center";function E(p,y,M){var d=p;function f(){var S=F(p);if(S===null)throw new Error("Malformed timestamp: "+d);return p=p.replace(/^[^\sa-zA-Z-]+/,""),S}function u(S,k){var m=new i;U(S,function(C,P){var l;switch(C){case"region":for(var c=M.length-1;c>=0;c--)if(M[c].id===P){m.set(C,M[c].region);break}break;case"vertical":m.alt(C,P,["rl","lr"]);break;case"line":l=P.split(","),m.integer(C,l[0]),m.percent(C,l[0])&&m.set("snapToLines",!1),m.alt(C,l[0],["auto"]),l.length===2&&m.alt("lineAlign",l[1],["start",v,"end"]);break;case"position":l=P.split(","),m.percent(C,l[0]),l.length===2&&m.alt("positionAlign",l[1],["start",v,"end","line-left","line-right","auto"]);break;case"size":m.percent(C,P);break;case"align":m.alt(C,P,["start",v,"end","left","right"]);break}},/:/,/\s/),k.region=m.get("region",null),k.vertical=m.get("vertical","");var A=m.get("line","auto");A==="auto"&&L.line===-1&&(A=-1),k.line=A,k.lineAlign=m.get("lineAlign","start"),k.snapToLines=m.get("snapToLines",!0),k.size=m.get("size",100),k.align=m.get("align",v);var I=m.get("position","auto");I==="auto"&&L.position===50&&(I=k.align==="start"||k.align==="left"?0:k.align==="end"||k.align==="right"?100:50),k.position=I}function h(){p=p.replace(/^\s+/,"")}if(h(),y.startTime=f(),h(),p.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+d);p=p.slice(3),h(),y.endTime=f(),h(),u(p,y)}function b(p){return p.replace(/<br(?: \/)?>/gi,`
`)}var w=function(){function p(){this.state="INITIAL",this.buffer="",this.decoder=new K,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var y=p.prototype;return y.parse=function(d){var f=this;d&&(f.buffer+=f.decoder.decode(d,{stream:!0}));function u(){var I=f.buffer,C=0;for(I=b(I);C<I.length&&I[C]!=="\r"&&I[C]!==`
`;)++C;var P=I.slice(0,C);return I[C]==="\r"&&++C,I[C]===`
`&&++C,f.buffer=I.slice(C),P}function h(I){U(I,function(C,P){},/:/)}try{var S="";if(f.state==="INITIAL"){if(!/\r\n|\n/.test(f.buffer))return this;S=u();var k=S.match(/^()?WEBVTT([ \t].*)?$/);if(!k||!k[0])throw new Error("Malformed WebVTT signature.");f.state="HEADER"}for(var m=!1;f.buffer;){if(!/\r\n|\n/.test(f.buffer))return this;switch(m?m=!1:S=u(),f.state){case"HEADER":/:/.test(S)?h(S):S||(f.state="ID");continue;case"NOTE":S||(f.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(S)){f.state="NOTE";break}if(!S)continue;if(f.cue=new V.default(0,0,""),f.state="CUE",S.indexOf("-->")===-1){f.cue.id=S;continue}case"CUE":if(!f.cue){f.state="BADCUE";continue}try{E(S,f.cue,f.regionList)}catch(I){f.cue=null,f.state="BADCUE";continue}f.state="CUETEXT";continue;case"CUETEXT":{var A=S.indexOf("-->")!==-1;if(!S||A&&(m=!0)){f.oncue&&f.cue&&f.oncue(f.cue),f.cue=null,f.state="ID";continue}if(f.cue===null)continue;f.cue.text&&(f.cue.text+=`
`),f.cue.text+=S}continue;case"BADCUE":S||(f.state="ID")}}}catch(I){f.state==="CUETEXT"&&f.cue&&f.oncue&&f.oncue(f.cue),f.cue=null,f.state=f.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},y.flush=function(){var d=this;try{if((d.cue||d.state==="HEADER")&&(d.buffer+=`
`,d.parse()),d.state==="INITIAL"||d.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(f){d.onparsingerror&&d.onparsingerror(f)}return d.onflush&&d.onflush(),this},p}()},"./src/utils/webvtt-parser.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{generateCueId:()=>w,parseWebVTT:()=>y});var V=B("./src/polyfills/number.ts"),K=B("./src/utils/vttparser.ts"),F=B("./src/demux/id3.ts"),i=B("./src/utils/timescale-conversion.ts"),U=B("./src/remux/mp4-remuxer.ts"),L=/\r\n|\n\r|\n|\r/g,v=function(d,f,u){return u===void 0&&(u=0),d.slice(u,u+f.length)===f},E=function(d){var f=parseInt(d.slice(-3)),u=parseInt(d.slice(-6,-4)),h=parseInt(d.slice(-9,-7)),S=d.length>9?parseInt(d.substring(0,d.indexOf(":"))):0;if(!(0,V.isFiniteNumber)(f)||!(0,V.isFiniteNumber)(u)||!(0,V.isFiniteNumber)(h)||!(0,V.isFiniteNumber)(S))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+d);return f+=1e3*u,f+=60*1e3*h,f+=60*60*1e3*S,f},b=function(d){for(var f=5381,u=d.length;u;)f=f*33^d.charCodeAt(--u);return(f>>>0).toString()};function w(M,d,f){return b(M.toString())+b(d.toString())+b(f)}var p=function(d,f,u){var h=d[f],S=d[h.prevCC];if(!S||!S.new&&h.new){d.ccOffset=d.presentationOffset=h.start,h.new=!1;return}for(;(k=S)!==null&&k!==void 0&&k.new;){var k;d.ccOffset+=h.start-S.start,h.new=!1,h=S,S=d[h.prevCC]}d.presentationOffset=u};function y(M,d,f,u,h,S,k,m){var A=new K.VTTParser,I=(0,F.utf8ArrayToStr)(new Uint8Array(M)).trim().replace(L,`
`).split(`
`),C=[],P=(0,i.toMpegTsClockFromTimescale)(d,f),l="00:00.000",c=0,s=0,g,R=!0;A.oncue=function(D){var x=u[h],T=u.ccOffset,O=(c-P)/9e4;x!=null&&x.new&&(s!==void 0?T=u.ccOffset=x.start:p(u,h,O)),O&&(T=O-u.presentationOffset);var $=D.endTime-D.startTime,H=(0,U.normalizePts)((D.startTime+T-s)*9e4,S*9e4)/9e4;D.startTime=Math.max(H,0),D.endTime=Math.max(H+$,0);var Z=D.text.trim();D.text=decodeURIComponent(encodeURIComponent(Z)),D.id||(D.id=w(D.startTime,D.endTime,Z)),D.endTime>0&&C.push(D)},A.onparsingerror=function(D){g=D},A.onflush=function(){if(g){m(g);return}k(C)},I.forEach(function(D){if(R)if(v(D,"X-TIMESTAMP-MAP=")){R=!1,D.slice(16).split(",").forEach(function(x){v(x,"LOCAL:")?l=x.slice(6):v(x,"MPEGTS:")&&(c=parseInt(x.slice(7)))});try{s=E(l)/1e3}catch(x){g=x}return}else D===""&&(R=!1);A.parse(D+`
`)}),A.flush()}},"./src/utils/xhr-loader.ts":(le,G,B)=>{"use strict";B.r(G),B.d(G,{default:()=>U});var V=B("./src/utils/logger.ts"),K=B("./src/loader/load-stats.ts"),F=/^age:\s*[\d.]+\s*$/m,i=function(){function L(E){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=E?E.xhrSetup:null,this.stats=new K.LoadStats,this.retryDelay=0}var v=L.prototype;return v.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},v.abortInternal=function(){var b=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),b&&(b.onreadystatechange=null,b.onprogress=null,b.readyState!==4&&(this.stats.aborted=!0,b.abort()))},v.abort=function(){var b;this.abortInternal(),(b=this.callbacks)!==null&&b!==void 0&&b.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},v.load=function(b,w,p){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=b,this.config=w,this.callbacks=p,this.retryDelay=w.retryDelay,this.loadInternal()},v.loadInternal=function(){var b=this.config,w=this.context;if(b){var p=this.loader=new self.XMLHttpRequest,y=this.stats;y.loading.first=0,y.loaded=0;var M=this.xhrSetup;try{if(M)try{M(p,w.url)}catch(u){p.open("GET",w.url,!0),M(p,w.url)}p.readyState||p.open("GET",w.url,!0);var d=this.context.headers;if(d)for(var f in d)p.setRequestHeader(f,d[f])}catch(u){this.callbacks.onError({code:p.status,text:u.message},w,p);return}w.rangeEnd&&p.setRequestHeader("Range","bytes="+w.rangeStart+"-"+(w.rangeEnd-1)),p.onreadystatechange=this.readystatechange.bind(this),p.onprogress=this.loadprogress.bind(this),p.responseType=w.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),b.timeout),p.send()}},v.readystatechange=function(){var b=this.context,w=this.loader,p=this.stats;if(!(!b||!w)){var y=w.readyState,M=this.config;if(!p.aborted&&y>=2)if(self.clearTimeout(this.requestTimeout),p.loading.first===0&&(p.loading.first=Math.max(self.performance.now(),p.loading.start)),y===4){w.onreadystatechange=null,w.onprogress=null;var d=w.status,f=w.responseType==="arraybuffer";if(d>=200&&d<300&&(f&&w.response||w.responseText!==null)){p.loading.end=Math.max(self.performance.now(),p.loading.first);var u,h;if(f?(u=w.response,h=u.byteLength):(u=w.responseText,h=u.length),p.loaded=p.total=h,!this.callbacks)return;var S=this.callbacks.onProgress;if(S&&S(p,b,u,w),!this.callbacks)return;var k={url:w.responseURL,data:u};this.callbacks.onSuccess(k,p,b,w)}else p.retry>=M.maxRetry||d>=400&&d<499?(V.logger.error(d+" while loading "+b.url),this.callbacks.onError({code:d,text:w.statusText},b,w)):(V.logger.warn(d+" while loading "+b.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,M.maxRetryDelay),p.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),M.timeout)}},v.loadtimeout=function(){V.logger.warn("timeout while loading "+this.context.url);var b=this.callbacks;b&&(this.abortInternal(),b.onTimeout(this.stats,this.context,this.loader))},v.loadprogress=function(b){var w=this.stats;w.loaded=b.loaded,b.lengthComputable&&(w.total=b.total)},v.getCacheAge=function(){var b=null;if(this.loader&&F.test(this.loader.getAllResponseHeaders())){var w=this.loader.getResponseHeader("age");b=w?parseFloat(w):null}return b},L}();const U=i},"./node_modules/eventemitter3/index.js":le=>{"use strict";var G=Object.prototype.hasOwnProperty,B="~";function V(){}Object.create&&(V.prototype=Object.create(null),new V().__proto__||(B=!1));function K(L,v,E){this.fn=L,this.context=v,this.once=E||!1}function F(L,v,E,b,w){if(typeof E!="function")throw new TypeError("The listener must be a function");var p=new K(E,b||L,w),y=B?B+v:v;return L._events[y]?L._events[y].fn?L._events[y]=[L._events[y],p]:L._events[y].push(p):(L._events[y]=p,L._eventsCount++),L}function i(L,v){--L._eventsCount===0?L._events=new V:delete L._events[v]}function U(){this._events=new V,this._eventsCount=0}U.prototype.eventNames=function(){var v=[],E,b;if(this._eventsCount===0)return v;for(b in E=this._events)G.call(E,b)&&v.push(B?b.slice(1):b);return Object.getOwnPropertySymbols?v.concat(Object.getOwnPropertySymbols(E)):v},U.prototype.listeners=function(v){var E=B?B+v:v,b=this._events[E];if(!b)return[];if(b.fn)return[b.fn];for(var w=0,p=b.length,y=new Array(p);w<p;w++)y[w]=b[w].fn;return y},U.prototype.listenerCount=function(v){var E=B?B+v:v,b=this._events[E];return b?b.fn?1:b.length:0},U.prototype.emit=function(v,E,b,w,p,y){var M=B?B+v:v;if(!this._events[M])return!1;var d=this._events[M],f=arguments.length,u,h;if(d.fn){switch(d.once&&this.removeListener(v,d.fn,void 0,!0),f){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,E),!0;case 3:return d.fn.call(d.context,E,b),!0;case 4:return d.fn.call(d.context,E,b,w),!0;case 5:return d.fn.call(d.context,E,b,w,p),!0;case 6:return d.fn.call(d.context,E,b,w,p,y),!0}for(h=1,u=new Array(f-1);h<f;h++)u[h-1]=arguments[h];d.fn.apply(d.context,u)}else{var S=d.length,k;for(h=0;h<S;h++)switch(d[h].once&&this.removeListener(v,d[h].fn,void 0,!0),f){case 1:d[h].fn.call(d[h].context);break;case 2:d[h].fn.call(d[h].context,E);break;case 3:d[h].fn.call(d[h].context,E,b);break;case 4:d[h].fn.call(d[h].context,E,b,w);break;default:if(!u)for(k=1,u=new Array(f-1);k<f;k++)u[k-1]=arguments[k];d[h].fn.apply(d[h].context,u)}}return!0},U.prototype.on=function(v,E,b){return F(this,v,E,b,!1)},U.prototype.once=function(v,E,b){return F(this,v,E,b,!0)},U.prototype.removeListener=function(v,E,b,w){var p=B?B+v:v;if(!this._events[p])return this;if(!E)return i(this,p),this;var y=this._events[p];if(y.fn)y.fn===E&&(!w||y.once)&&(!b||y.context===b)&&i(this,p);else{for(var M=0,d=[],f=y.length;M<f;M++)(y[M].fn!==E||w&&!y[M].once||b&&y[M].context!==b)&&d.push(y[M]);d.length?this._events[p]=d.length===1?d[0]:d:i(this,p)}return this},U.prototype.removeAllListeners=function(v){var E;return v?(E=B?B+v:v,this._events[E]&&i(this,E)):(this._events=new V,this._eventsCount=0),this},U.prototype.off=U.prototype.removeListener,U.prototype.addListener=U.prototype.on,U.prefixed=B,U.EventEmitter=U,le.exports=U},"./node_modules/url-toolkit/src/url-toolkit.js":function(le){(function(G){var B=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,V=/^(?=([^\/?#]*))\1([^]*)$/,K=/(?:\/|^)\.(?=\/)/g,F=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,i={buildAbsoluteURL:function(U,L,v){if(v=v||{},U=U.trim(),L=L.trim(),!L){if(!v.alwaysNormalize)return U;var E=i.parseURL(U);if(!E)throw new Error("Error trying to parse base URL.");return E.path=i.normalizePath(E.path),i.buildURLFromParts(E)}var b=i.parseURL(L);if(!b)throw new Error("Error trying to parse relative URL.");if(b.scheme)return v.alwaysNormalize?(b.path=i.normalizePath(b.path),i.buildURLFromParts(b)):L;var w=i.parseURL(U);if(!w)throw new Error("Error trying to parse base URL.");if(!w.netLoc&&w.path&&w.path[0]!=="/"){var p=V.exec(w.path);w.netLoc=p[1],w.path=p[2]}w.netLoc&&!w.path&&(w.path="/");var y={scheme:w.scheme,netLoc:b.netLoc,path:null,params:b.params,query:b.query,fragment:b.fragment};if(!b.netLoc&&(y.netLoc=w.netLoc,b.path[0]!=="/"))if(!b.path)y.path=w.path,b.params||(y.params=w.params,b.query||(y.query=w.query));else{var M=w.path,d=M.substring(0,M.lastIndexOf("/")+1)+b.path;y.path=i.normalizePath(d)}return y.path===null&&(y.path=v.alwaysNormalize?i.normalizePath(b.path):b.path),i.buildURLFromParts(y)},parseURL:function(U){var L=B.exec(U);return L?{scheme:L[1]||"",netLoc:L[2]||"",path:L[3]||"",params:L[4]||"",query:L[5]||"",fragment:L[6]||""}:null},normalizePath:function(U){for(U=U.split("").reverse().join("").replace(K,"");U.length!==(U=U.replace(F,"")).length;);return U.split("").reverse().join("")},buildURLFromParts:function(U){return U.scheme+U.netLoc+U.path+U.params+U.query+U.fragment}};le.exports=i})(this)}},q={};function me(le){var G=q[le];if(G!==void 0)return G.exports;var B=q[le]={exports:{}};return at[le].call(B.exports,B,B.exports,me),B.exports}me.m=at,me.n=le=>{var G=le&&le.__esModule?()=>le.default:()=>le;return me.d(G,{a:G}),G},me.d=(le,G)=>{for(var B in G)me.o(G,B)&&!me.o(le,B)&&Object.defineProperty(le,B,{enumerable:!0,get:G[B]})},me.o=(le,G)=>Object.prototype.hasOwnProperty.call(le,G),me.r=le=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(le,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(le,"__esModule",{value:!0})};var ge=me("./src/hls.ts");return ge=ge.default,ge})())},84204:function(Ht,at,q){"use strict";var me,ge;function le(G,B,V){var K=function(F,i){return G.js_beautify(F,i)};return K.js=G.js_beautify,K.css=B.css_beautify,K.html=V.html_beautify,K.js_beautify=G.js_beautify,K.css_beautify=B.css_beautify,K.html_beautify=V.html_beautify,K}me=[q(77937),q(85040),q(3566)],ge=function(G,B,V){return le(G,B,V)}.apply(at,me),ge!==void 0&&(Ht.exports=ge)},85040:function(Ht,at){var q,me;(function(){var ge;(function(){"use strict";var G=[,,function(F){function i(v){this.__parent=v,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}i.prototype.clone_empty=function(){var v=new i(this.__parent);return v.set_indent(this.__indent_count,this.__alignment_count),v},i.prototype.item=function(v){return v<0?this.__items[this.__items.length+v]:this.__items[v]},i.prototype.has_match=function(v){for(var E=this.__items.length-1;E>=0;E--)if(this.__items[E].match(v))return!0;return!1},i.prototype.set_indent=function(v,E){this.is_empty()&&(this.__indent_count=v||0,this.__alignment_count=E||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},i.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},i.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},i.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var v=this.__parent.current_line;return v.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),v.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),v.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,v.__items[0]===" "&&(v.__items.splice(0,1),v.__character_count-=1),!0}return!1},i.prototype.is_empty=function(){return this.__items.length===0},i.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},i.prototype.push=function(v){this.__items.push(v);var E=v.lastIndexOf(`
`);E!==-1?this.__character_count=v.length-E:this.__character_count+=v.length},i.prototype.pop=function(){var v=null;return this.is_empty()||(v=this.__items.pop(),this.__character_count-=v.length),v},i.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},i.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},i.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},i.prototype.toString=function(){var v="";return this.is_empty()?this.__parent.indent_empty_lines&&(v=this.__parent.get_indent_string(this.__indent_count)):(v=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),v+=this.__items.join("")),v};function U(v,E){this.__cache=[""],this.__indent_size=v.indent_size,this.__indent_string=v.indent_char,v.indent_with_tabs||(this.__indent_string=new Array(v.indent_size+1).join(v.indent_char)),E=E||"",v.indent_level>0&&(E=new Array(v.indent_level+1).join(this.__indent_string)),this.__base_string=E,this.__base_string_length=E.length}U.prototype.get_indent_size=function(v,E){var b=this.__base_string_length;return E=E||0,v<0&&(b=0),b+=v*this.__indent_size,b+=E,b},U.prototype.get_indent_string=function(v,E){var b=this.__base_string;return E=E||0,v<0&&(v=0,b=""),E+=v*this.__indent_size,this.__ensure_cache(E),b+=this.__cache[E],b},U.prototype.__ensure_cache=function(v){for(;v>=this.__cache.length;)this.__add_column()},U.prototype.__add_column=function(){var v=this.__cache.length,E=0,b="";this.__indent_size&&v>=this.__indent_size&&(E=Math.floor(v/this.__indent_size),v-=E*this.__indent_size,b=new Array(E+1).join(this.__indent_string)),v&&(b+=new Array(v+1).join(" ")),this.__cache.push(b)};function L(v,E){this.__indent_cache=new U(v,E),this.raw=!1,this._end_with_newline=v.end_with_newline,this.indent_size=v.indent_size,this.wrap_line_length=v.wrap_line_length,this.indent_empty_lines=v.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new i(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}L.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},L.prototype.get_line_number=function(){return this.__lines.length},L.prototype.get_indent_string=function(v,E){return this.__indent_cache.get_indent_string(v,E)},L.prototype.get_indent_size=function(v,E){return this.__indent_cache.get_indent_size(v,E)},L.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},L.prototype.add_new_line=function(v){return this.is_empty()||!v&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},L.prototype.get_code=function(v){this.trim(!0);var E=this.current_line.pop();E&&(E[E.length-1]===`
`&&(E=E.replace(/\n+$/g,"")),this.current_line.push(E)),this._end_with_newline&&this.__add_outputline();var b=this.__lines.join(`
`);return v!==`
`&&(b=b.replace(/[\n]/g,v)),b},L.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},L.prototype.set_indent=function(v,E){return v=v||0,E=E||0,this.next_line.set_indent(v,E),this.__lines.length>1?(this.current_line.set_indent(v,E),!0):(this.current_line.set_indent(),!1)},L.prototype.add_raw_token=function(v){for(var E=0;E<v.newlines;E++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(v.whitespace_before),this.current_line.push(v.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},L.prototype.add_token=function(v){this.__add_space_before_token(),this.current_line.push(v),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},L.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},L.prototype.remove_indent=function(v){for(var E=this.__lines.length;v<E;)this.__lines[v]._remove_indent(),v++;this.current_line._remove_wrap_indent()},L.prototype.trim=function(v){for(v=v===void 0?!1:v,this.current_line.trim();v&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},L.prototype.just_added_newline=function(){return this.current_line.is_empty()},L.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},L.prototype.ensure_empty_line_above=function(v,E){for(var b=this.__lines.length-2;b>=0;){var w=this.__lines[b];if(w.is_empty())break;if(w.item(0).indexOf(v)!==0&&w.item(-1)!==E){this.__lines.splice(b+1,0,new i(this)),this.previous_line=this.__lines[this.__lines.length-2];break}b--}},F.exports.Output=L},,,,function(F){function i(v,E){this.raw_options=U(v,E),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}i.prototype._get_array=function(v,E){var b=this.raw_options[v],w=E||[];return typeof b=="object"?b!==null&&typeof b.concat=="function"&&(w=b.concat()):typeof b=="string"&&(w=b.split(/[^a-zA-Z0-9_\/\-]+/)),w},i.prototype._get_boolean=function(v,E){var b=this.raw_options[v],w=b===void 0?!!E:!!b;return w},i.prototype._get_characters=function(v,E){var b=this.raw_options[v],w=E||"";return typeof b=="string"&&(w=b.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),w},i.prototype._get_number=function(v,E){var b=this.raw_options[v];E=parseInt(E,10),isNaN(E)&&(E=0);var w=parseInt(b,10);return isNaN(w)&&(w=E),w},i.prototype._get_selection=function(v,E,b){var w=this._get_selection_list(v,E,b);if(w.length!==1)throw new Error("Invalid Option Value: The option '"+v+`' can only be one of the following values:
`+E+`
You passed in: '`+this.raw_options[v]+"'");return w[0]},i.prototype._get_selection_list=function(v,E,b){if(!E||E.length===0)throw new Error("Selection list cannot be empty.");if(b=b||[E[0]],!this._is_valid_selection(b,E))throw new Error("Invalid Default Value!");var w=this._get_array(v,b);if(!this._is_valid_selection(w,E))throw new Error("Invalid Option Value: The option '"+v+`' can contain only the following values:
`+E+`
You passed in: '`+this.raw_options[v]+"'");return w},i.prototype._is_valid_selection=function(v,E){return v.length&&E.length&&!v.some(function(b){return E.indexOf(b)===-1})};function U(v,E){var b={};v=L(v);var w;for(w in v)w!==E&&(b[w]=v[w]);if(E&&v[E])for(w in v[E])b[w]=v[E][w];return b}function L(v){var E={},b;for(b in v){var w=b.replace(/-/g,"_");E[w]=v[b]}return E}F.exports.Options=i,F.exports.normalizeOpts=L,F.exports.mergeOpts=U},,function(F){var i=RegExp.prototype.hasOwnProperty("sticky");function U(L){this.__input=L||"",this.__input_length=this.__input.length,this.__position=0}U.prototype.restart=function(){this.__position=0},U.prototype.back=function(){this.__position>0&&(this.__position-=1)},U.prototype.hasNext=function(){return this.__position<this.__input_length},U.prototype.next=function(){var L=null;return this.hasNext()&&(L=this.__input.charAt(this.__position),this.__position+=1),L},U.prototype.peek=function(L){var v=null;return L=L||0,L+=this.__position,L>=0&&L<this.__input_length&&(v=this.__input.charAt(L)),v},U.prototype.__match=function(L,v){L.lastIndex=v;var E=L.exec(this.__input);return E&&!(i&&L.sticky)&&E.index!==v&&(E=null),E},U.prototype.test=function(L,v){return v=v||0,v+=this.__position,v>=0&&v<this.__input_length?!!this.__match(L,v):!1},U.prototype.testChar=function(L,v){var E=this.peek(v);return L.lastIndex=0,E!==null&&L.test(E)},U.prototype.match=function(L){var v=this.__match(L,this.__position);return v?this.__position+=v[0].length:v=null,v},U.prototype.read=function(L,v,E){var b="",w;return L&&(w=this.match(L),w&&(b+=w[0])),v&&(w||!L)&&(b+=this.readUntil(v,E)),b},U.prototype.readUntil=function(L,v){var E="",b=this.__position;L.lastIndex=this.__position;var w=L.exec(this.__input);return w?(b=w.index,v&&(b+=w[0].length)):b=this.__input_length,E=this.__input.substring(this.__position,b),this.__position=b,E},U.prototype.readUntilAfter=function(L){return this.readUntil(L,!0)},U.prototype.get_regexp=function(L,v){var E=null,b="g";return v&&i&&(b="y"),typeof L=="string"&&L!==""?E=new RegExp(L,b):L&&(E=new RegExp(L.source,b)),E},U.prototype.get_literal_regexp=function(L){return RegExp(L.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},U.prototype.peekUntilAfter=function(L){var v=this.__position,E=this.readUntilAfter(L);return this.__position=v,E},U.prototype.lookBack=function(L){var v=this.__position-1;return v>=L.length&&this.__input.substring(v-L.length,v).toLowerCase()===L},F.exports.InputScanner=U},,,,,function(F){function i(U,L){U=typeof U=="string"?U:U.source,L=typeof L=="string"?L:L.source,this.__directives_block_pattern=new RegExp(U+/ beautify( \w+[:]\w+)+ /.source+L,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(U+/\sbeautify\signore:end\s/.source+L,"g")}i.prototype.get_directives=function(U){if(!U.match(this.__directives_block_pattern))return null;var L={};this.__directive_pattern.lastIndex=0;for(var v=this.__directive_pattern.exec(U);v;)L[v[1]]=v[2],v=this.__directive_pattern.exec(U);return L},i.prototype.readIgnored=function(U){return U.readUntilAfter(this.__directives_end_ignore_pattern)},F.exports.Directives=i},,function(F,i,U){var L=U(16).Beautifier,v=U(17).Options;function E(b,w){var p=new L(b,w);return p.beautify()}F.exports=E,F.exports.defaultOptions=function(){return new v}},function(F,i,U){var L=U(17).Options,v=U(2).Output,E=U(8).InputScanner,b=U(13).Directives,w=new b(/\/\*/,/\*\//),p=/\r\n|[\r\n]/,y=/\r\n|[\r\n]/g,M=/\s/,d=/(?:\s|\n)+/g,f=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,u=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function h(S,k){this._source_text=S||"",this._options=new L(k),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}h.prototype.eatString=function(S){var k="";for(this._ch=this._input.next();this._ch;){if(k+=this._ch,this._ch==="\\")k+=this._input.next();else if(S.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return k},h.prototype.eatWhitespace=function(S){for(var k=M.test(this._input.peek()),m=0;M.test(this._input.peek());)this._ch=this._input.next(),S&&this._ch===`
`&&(m===0||m<this._options.max_preserve_newlines)&&(m++,this._output.add_new_line(!0));return k},h.prototype.foundNestedPseudoClass=function(){for(var S=0,k=1,m=this._input.peek(k);m;){if(m==="{")return!0;if(m==="(")S+=1;else if(m===")"){if(S===0)return!1;S-=1}else if(m===";"||m==="}")return!1;k++,m=this._input.peek(k)}return!1},h.prototype.print_string=function(S){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(S)},h.prototype.preserveSingleSpace=function(S){S&&(this._output.space_before_token=!0)},h.prototype.indent=function(){this._indentLevel++},h.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},h.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var S=this._source_text,k=this._options.eol;k==="auto"&&(k=`
`,S&&p.test(S||"")&&(k=S.match(p)[0])),S=S.replace(y,`
`);var m=S.match(/^[\t ]*/)[0];this._output=new v(this._options,m),this._input=new E(S),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var A=0,I=!1,C=!1,P=!1,l=!1,c=!1,s=!1,g=this._ch,R=!1,D,x,T;D=this._input.read(d),x=D!=="",T=g,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),g=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var O=this._input.read(f),$=w.get_directives(O);$&&$.ignore==="start"&&(O+=w.readIgnored(this._input)),this.print_string(O),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(u)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(x),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var H=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);H.match(/[ :]$/)&&(H=this.eatString(": ").replace(/\s$/,""),this.print_string(H),this._output.space_before_token=!0),H=H.replace(/\s$/,""),H==="extend"?l=!0:H==="import"&&(c=!0),H in this.NESTED_AT_RULE?(this._nestedLevel+=1,H in this.CONDITIONAL_GROUP_RULE&&(P=!0)):!I&&A===0&&H.indexOf(":")!==-1&&(C=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(x),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")C&&(C=!1,this.outdent()),P?(P=!1,I=this._indentLevel>=this._nestedLevel):I=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&I&&this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(T==="("?this._output.space_before_token=!1:T!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),T==="{"&&this._output.trim(!0),c=!1,l=!1,C&&(this.outdent(),C=!1),this.print_string(this._ch),I=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&this._input.peek()!=="}"&&this._output.add_new_line(!0),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var Z=0;Z<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;Z++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[Z])){R=!0;break}(I||P)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!l&&A===0?(this.print_string(":"),C||(C=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var te=T==='"'||T==="'";this.preserveSingleSpace(te||x),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")R=!1,A===0?(C&&(this.outdent(),C=!1),l=!1,c=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),A++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),A&&(A--,this.outdent()));else{var J=!1;this._input.lookBack("with")&&(J=!0),this.preserveSingleSpace(x||J),this.print_string(this._ch),C&&T==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),s=!0):(this.eatWhitespace(),A++,this.indent())}else if(this._ch===")")A&&(A--,this.outdent()),s&&this._input.peek()===";"&&this._options.selector_separator_newline&&(s=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!C||s)&&A===0&&!c&&!l?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!C&&A===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&M.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(x),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),M.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var ie=T==='"'||T==="'";this.preserveSingleSpace(ie||x),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&R&&this._output.add_new_line()}var oe=this._output.get_code(k);return oe},F.exports.Beautifier=h},function(F,i,U){var L=U(6).Options;function v(E){L.call(this,E,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var b=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||b;var w=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var p=0;p<w.length;p++)w[p]!=="expand"?this.brace_style="collapse":this.brace_style=w[p]}v.prototype=new L,F.exports.Options=v}],B={};function V(F){var i=B[F];if(i!==void 0)return i.exports;var U=B[F]={exports:{}};return G[F](U,U.exports,V),U.exports}var K=V(15);ge=K})();var le=ge;q=[],me=function(){return{css_beautify:le}}.apply(at,q),me!==void 0&&(Ht.exports=me)})()},3566:function(Ht,at,q){var me,ge;(function(){var le;(function(){"use strict";var K=[,,function(L){function v(w){this.__parent=w,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}v.prototype.clone_empty=function(){var w=new v(this.__parent);return w.set_indent(this.__indent_count,this.__alignment_count),w},v.prototype.item=function(w){return w<0?this.__items[this.__items.length+w]:this.__items[w]},v.prototype.has_match=function(w){for(var p=this.__items.length-1;p>=0;p--)if(this.__items[p].match(w))return!0;return!1},v.prototype.set_indent=function(w,p){this.is_empty()&&(this.__indent_count=w||0,this.__alignment_count=p||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},v.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},v.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},v.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var w=this.__parent.current_line;return w.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),w.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),w.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,w.__items[0]===" "&&(w.__items.splice(0,1),w.__character_count-=1),!0}return!1},v.prototype.is_empty=function(){return this.__items.length===0},v.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},v.prototype.push=function(w){this.__items.push(w);var p=w.lastIndexOf(`
`);p!==-1?this.__character_count=w.length-p:this.__character_count+=w.length},v.prototype.pop=function(){var w=null;return this.is_empty()||(w=this.__items.pop(),this.__character_count-=w.length),w},v.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},v.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},v.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},v.prototype.toString=function(){var w="";return this.is_empty()?this.__parent.indent_empty_lines&&(w=this.__parent.get_indent_string(this.__indent_count)):(w=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),w+=this.__items.join("")),w};function E(w,p){this.__cache=[""],this.__indent_size=w.indent_size,this.__indent_string=w.indent_char,w.indent_with_tabs||(this.__indent_string=new Array(w.indent_size+1).join(w.indent_char)),p=p||"",w.indent_level>0&&(p=new Array(w.indent_level+1).join(this.__indent_string)),this.__base_string=p,this.__base_string_length=p.length}E.prototype.get_indent_size=function(w,p){var y=this.__base_string_length;return p=p||0,w<0&&(y=0),y+=w*this.__indent_size,y+=p,y},E.prototype.get_indent_string=function(w,p){var y=this.__base_string;return p=p||0,w<0&&(w=0,y=""),p+=w*this.__indent_size,this.__ensure_cache(p),y+=this.__cache[p],y},E.prototype.__ensure_cache=function(w){for(;w>=this.__cache.length;)this.__add_column()},E.prototype.__add_column=function(){var w=this.__cache.length,p=0,y="";this.__indent_size&&w>=this.__indent_size&&(p=Math.floor(w/this.__indent_size),w-=p*this.__indent_size,y=new Array(p+1).join(this.__indent_string)),w&&(y+=new Array(w+1).join(" ")),this.__cache.push(y)};function b(w,p){this.__indent_cache=new E(w,p),this.raw=!1,this._end_with_newline=w.end_with_newline,this.indent_size=w.indent_size,this.wrap_line_length=w.wrap_line_length,this.indent_empty_lines=w.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new v(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}b.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},b.prototype.get_line_number=function(){return this.__lines.length},b.prototype.get_indent_string=function(w,p){return this.__indent_cache.get_indent_string(w,p)},b.prototype.get_indent_size=function(w,p){return this.__indent_cache.get_indent_size(w,p)},b.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},b.prototype.add_new_line=function(w){return this.is_empty()||!w&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},b.prototype.get_code=function(w){this.trim(!0);var p=this.current_line.pop();p&&(p[p.length-1]===`
`&&(p=p.replace(/\n+$/g,"")),this.current_line.push(p)),this._end_with_newline&&this.__add_outputline();var y=this.__lines.join(`
`);return w!==`
`&&(y=y.replace(/[\n]/g,w)),y},b.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},b.prototype.set_indent=function(w,p){return w=w||0,p=p||0,this.next_line.set_indent(w,p),this.__lines.length>1?(this.current_line.set_indent(w,p),!0):(this.current_line.set_indent(),!1)},b.prototype.add_raw_token=function(w){for(var p=0;p<w.newlines;p++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(w.whitespace_before),this.current_line.push(w.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},b.prototype.add_token=function(w){this.__add_space_before_token(),this.current_line.push(w),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},b.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},b.prototype.remove_indent=function(w){for(var p=this.__lines.length;w<p;)this.__lines[w]._remove_indent(),w++;this.current_line._remove_wrap_indent()},b.prototype.trim=function(w){for(w=w===void 0?!1:w,this.current_line.trim();w&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},b.prototype.just_added_newline=function(){return this.current_line.is_empty()},b.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},b.prototype.ensure_empty_line_above=function(w,p){for(var y=this.__lines.length-2;y>=0;){var M=this.__lines[y];if(M.is_empty())break;if(M.item(0).indexOf(w)!==0&&M.item(-1)!==p){this.__lines.splice(y+1,0,new v(this)),this.previous_line=this.__lines[this.__lines.length-2];break}y--}},L.exports.Output=b},function(L){function v(E,b,w,p){this.type=E,this.text=b,this.comments_before=null,this.newlines=w||0,this.whitespace_before=p||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}L.exports.Token=v},,,function(L){function v(w,p){this.raw_options=E(w,p),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}v.prototype._get_array=function(w,p){var y=this.raw_options[w],M=p||[];return typeof y=="object"?y!==null&&typeof y.concat=="function"&&(M=y.concat()):typeof y=="string"&&(M=y.split(/[^a-zA-Z0-9_\/\-]+/)),M},v.prototype._get_boolean=function(w,p){var y=this.raw_options[w],M=y===void 0?!!p:!!y;return M},v.prototype._get_characters=function(w,p){var y=this.raw_options[w],M=p||"";return typeof y=="string"&&(M=y.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),M},v.prototype._get_number=function(w,p){var y=this.raw_options[w];p=parseInt(p,10),isNaN(p)&&(p=0);var M=parseInt(y,10);return isNaN(M)&&(M=p),M},v.prototype._get_selection=function(w,p,y){var M=this._get_selection_list(w,p,y);if(M.length!==1)throw new Error("Invalid Option Value: The option '"+w+`' can only be one of the following values:
`+p+`
You passed in: '`+this.raw_options[w]+"'");return M[0]},v.prototype._get_selection_list=function(w,p,y){if(!p||p.length===0)throw new Error("Selection list cannot be empty.");if(y=y||[p[0]],!this._is_valid_selection(y,p))throw new Error("Invalid Default Value!");var M=this._get_array(w,y);if(!this._is_valid_selection(M,p))throw new Error("Invalid Option Value: The option '"+w+`' can contain only the following values:
`+p+`
You passed in: '`+this.raw_options[w]+"'");return M},v.prototype._is_valid_selection=function(w,p){return w.length&&p.length&&!w.some(function(y){return p.indexOf(y)===-1})};function E(w,p){var y={};w=b(w);var M;for(M in w)M!==p&&(y[M]=w[M]);if(p&&w[p])for(M in w[p])y[M]=w[p][M];return y}function b(w){var p={},y;for(y in w){var M=y.replace(/-/g,"_");p[M]=w[y]}return p}L.exports.Options=v,L.exports.normalizeOpts=b,L.exports.mergeOpts=E},,function(L){var v=RegExp.prototype.hasOwnProperty("sticky");function E(b){this.__input=b||"",this.__input_length=this.__input.length,this.__position=0}E.prototype.restart=function(){this.__position=0},E.prototype.back=function(){this.__position>0&&(this.__position-=1)},E.prototype.hasNext=function(){return this.__position<this.__input_length},E.prototype.next=function(){var b=null;return this.hasNext()&&(b=this.__input.charAt(this.__position),this.__position+=1),b},E.prototype.peek=function(b){var w=null;return b=b||0,b+=this.__position,b>=0&&b<this.__input_length&&(w=this.__input.charAt(b)),w},E.prototype.__match=function(b,w){b.lastIndex=w;var p=b.exec(this.__input);return p&&!(v&&b.sticky)&&p.index!==w&&(p=null),p},E.prototype.test=function(b,w){return w=w||0,w+=this.__position,w>=0&&w<this.__input_length?!!this.__match(b,w):!1},E.prototype.testChar=function(b,w){var p=this.peek(w);return b.lastIndex=0,p!==null&&b.test(p)},E.prototype.match=function(b){var w=this.__match(b,this.__position);return w?this.__position+=w[0].length:w=null,w},E.prototype.read=function(b,w,p){var y="",M;return b&&(M=this.match(b),M&&(y+=M[0])),w&&(M||!b)&&(y+=this.readUntil(w,p)),y},E.prototype.readUntil=function(b,w){var p="",y=this.__position;b.lastIndex=this.__position;var M=b.exec(this.__input);return M?(y=M.index,w&&(y+=M[0].length)):y=this.__input_length,p=this.__input.substring(this.__position,y),this.__position=y,p},E.prototype.readUntilAfter=function(b){return this.readUntil(b,!0)},E.prototype.get_regexp=function(b,w){var p=null,y="g";return w&&v&&(y="y"),typeof b=="string"&&b!==""?p=new RegExp(b,y):b&&(p=new RegExp(b.source,y)),p},E.prototype.get_literal_regexp=function(b){return RegExp(b.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},E.prototype.peekUntilAfter=function(b){var w=this.__position,p=this.readUntilAfter(b);return this.__position=w,p},E.prototype.lookBack=function(b){var w=this.__position-1;return w>=b.length&&this.__input.substring(w-b.length,w).toLowerCase()===b},L.exports.InputScanner=E},function(L,v,E){var b=E(8).InputScanner,w=E(3).Token,p=E(10).TokenStream,y=E(11).WhitespacePattern,M={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},d=function(f,u){this._input=new b(f),this._options=u||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new y(this._input)};d.prototype.tokenize=function(){this._input.restart(),this.__tokens=new p,this._reset();for(var f,u=new w(M.START,""),h=null,S=[],k=new p;u.type!==M.EOF;){for(f=this._get_next_token(u,h);this._is_comment(f);)k.add(f),f=this._get_next_token(u,h);k.isEmpty()||(f.comments_before=k,k=new p),f.parent=h,this._is_opening(f)?(S.push(h),h=f):h&&this._is_closing(f,h)&&(f.opened=h,h.closed=f,h=S.pop(),f.parent=h),f.previous=u,u.next=f,this.__tokens.add(f),u=f}return this.__tokens},d.prototype._is_first_token=function(){return this.__tokens.isEmpty()},d.prototype._reset=function(){},d.prototype._get_next_token=function(f,u){this._readWhitespace();var h=this._input.read(/.+/g);return h?this._create_token(M.RAW,h):this._create_token(M.EOF,"")},d.prototype._is_comment=function(f){return!1},d.prototype._is_opening=function(f){return!1},d.prototype._is_closing=function(f,u){return!1},d.prototype._create_token=function(f,u){var h=new w(f,u,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return h},d.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},L.exports.Tokenizer=d,L.exports.TOKEN=M},function(L){function v(E){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=E}v.prototype.restart=function(){this.__position=0},v.prototype.isEmpty=function(){return this.__tokens_length===0},v.prototype.hasNext=function(){return this.__position<this.__tokens_length},v.prototype.next=function(){var E=null;return this.hasNext()&&(E=this.__tokens[this.__position],this.__position+=1),E},v.prototype.peek=function(E){var b=null;return E=E||0,E+=this.__position,E>=0&&E<this.__tokens_length&&(b=this.__tokens[E]),b},v.prototype.add=function(E){this.__parent_token&&(E.parent=this.__parent_token),this.__tokens.push(E),this.__tokens_length+=1},L.exports.TokenStream=v},function(L,v,E){var b=E(12).Pattern;function w(p,y){b.call(this,p,y),y?this._line_regexp=this._input.get_regexp(y._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}w.prototype=new b,w.prototype.__set_whitespace_patterns=function(p,y){p+="\\t ",y+="\\n\\r",this._match_pattern=this._input.get_regexp("["+p+y+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+y+"]")},w.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var p=this._input.read(this._match_pattern);if(p===" ")this.whitespace_before_token=" ";else if(p){var y=this.__split(this._newline_regexp,p);this.newline_count=y.length-1,this.whitespace_before_token=y[this.newline_count]}return p},w.prototype.matching=function(p,y){var M=this._create();return M.__set_whitespace_patterns(p,y),M._update(),M},w.prototype._create=function(){return new w(this._input,this)},w.prototype.__split=function(p,y){p.lastIndex=0;for(var M=0,d=[],f=p.exec(y);f;)d.push(y.substring(M,f.index)),M=f.index+f[0].length,f=p.exec(y);return M<y.length?d.push(y.substring(M,y.length)):d.push(""),d},L.exports.WhitespacePattern=w},function(L){function v(E,b){this._input=E,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,b&&(this._starting_pattern=this._input.get_regexp(b._starting_pattern,!0),this._match_pattern=this._input.get_regexp(b._match_pattern,!0),this._until_pattern=this._input.get_regexp(b._until_pattern),this._until_after=b._until_after)}v.prototype.read=function(){var E=this._input.read(this._starting_pattern);return(!this._starting_pattern||E)&&(E+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),E},v.prototype.read_match=function(){return this._input.match(this._match_pattern)},v.prototype.until_after=function(E){var b=this._create();return b._until_after=!0,b._until_pattern=this._input.get_regexp(E),b._update(),b},v.prototype.until=function(E){var b=this._create();return b._until_after=!1,b._until_pattern=this._input.get_regexp(E),b._update(),b},v.prototype.starting_with=function(E){var b=this._create();return b._starting_pattern=this._input.get_regexp(E,!0),b._update(),b},v.prototype.matching=function(E){var b=this._create();return b._match_pattern=this._input.get_regexp(E,!0),b._update(),b},v.prototype._create=function(){return new v(this._input,this)},v.prototype._update=function(){},L.exports.Pattern=v},function(L){function v(E,b){E=typeof E=="string"?E:E.source,b=typeof b=="string"?b:b.source,this.__directives_block_pattern=new RegExp(E+/ beautify( \w+[:]\w+)+ /.source+b,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(E+/\sbeautify\signore:end\s/.source+b,"g")}v.prototype.get_directives=function(E){if(!E.match(this.__directives_block_pattern))return null;var b={};this.__directive_pattern.lastIndex=0;for(var w=this.__directive_pattern.exec(E);w;)b[w[1]]=w[2],w=this.__directive_pattern.exec(E);return b},v.prototype.readIgnored=function(E){return E.readUntilAfter(this.__directives_end_ignore_pattern)},L.exports.Directives=v},function(L,v,E){var b=E(12).Pattern,w={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function p(y,M){b.call(this,y,M),this.__template_pattern=null,this._disabled=Object.assign({},w),this._excluded=Object.assign({},w),M&&(this.__template_pattern=this._input.get_regexp(M.__template_pattern),this._excluded=Object.assign(this._excluded,M._excluded),this._disabled=Object.assign(this._disabled,M._disabled));var d=new b(y);this.__patterns={handlebars_comment:d.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:d.starting_with(/{{{/).until_after(/}}}/),handlebars:d.starting_with(/{{/).until_after(/}}/),php:d.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:d.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:d.starting_with(/{%/).until_after(/%}/),django_value:d.starting_with(/{{/).until_after(/}}/),django_comment:d.starting_with(/{#/).until_after(/#}/),smarty:d.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:d.starting_with(/{\*/).until_after(/\*}/),smarty_literal:d.starting_with(/{literal}/).until_after(/{\/literal}/)}}p.prototype=new b,p.prototype._create=function(){return new p(this._input,this)},p.prototype._update=function(){this.__set_templated_pattern()},p.prototype.disable=function(y){var M=this._create();return M._disabled[y]=!0,M._update(),M},p.prototype.read_options=function(y){var M=this._create();for(var d in w)M._disabled[d]=y.templating.indexOf(d)===-1;return M._update(),M},p.prototype.exclude=function(y){var M=this._create();return M._excluded[y]=!0,M._update(),M},p.prototype.read=function(){var y="";this._match_pattern?y=this._input.read(this._starting_pattern):y=this._input.read(this._starting_pattern,this.__template_pattern);for(var M=this._read_template();M;)this._match_pattern?M+=this._input.read(this._match_pattern):M+=this._input.readUntil(this.__template_pattern),y+=M,M=this._read_template();return this._until_after&&(y+=this._input.readUntilAfter(this._until_pattern)),y},p.prototype.__set_templated_pattern=function(){var y=[];this._disabled.php||y.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||y.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||y.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(y.push(this.__patterns.django._starting_pattern.source),y.push(this.__patterns.django_value._starting_pattern.source),y.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||y.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&y.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+y.join("|")+")")},p.prototype._read_template=function(){var y="",M=this._input.peek();if(M==="<"){var d=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&d==="?"&&(y=y||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&d==="%"&&(y=y||this.__patterns.erb.read())}else M==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(y=y||this.__patterns.handlebars_comment.read(),y=y||this.__patterns.handlebars_unescaped.read(),y=y||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(y=y||this.__patterns.django_value.read()),this._excluded.django||(y=y||this.__patterns.django_comment.read(),y=y||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(y=y||this.__patterns.smarty_comment.read(),y=y||this.__patterns.smarty_literal.read(),y=y||this.__patterns.smarty.read()));return y},L.exports.TemplatablePattern=p},,,,function(L,v,E){var b=E(19).Beautifier,w=E(20).Options;function p(y,M,d,f){var u=new b(y,M,d,f);return u.beautify()}L.exports=p,L.exports.defaultOptions=function(){return new w}},function(L,v,E){var b=E(20).Options,w=E(2).Output,p=E(21).Tokenizer,y=E(21).TOKEN,M=/\r\n|[\r\n]/,d=/\r\n|[\r\n]/g,f=function(l,c){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=l.max_preserve_newlines,this.preserve_newlines=l.preserve_newlines,this._output=new w(l,c)};f.prototype.current_line_has_match=function(l){return this._output.current_line.has_match(l)},f.prototype.set_space_before_token=function(l,c){this._output.space_before_token=l,this._output.non_breaking_space=c},f.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},f.prototype.add_raw_token=function(l){this._output.add_raw_token(l)},f.prototype.print_preserved_newlines=function(l){var c=0;l.type!==y.TEXT&&l.previous.type!==y.TEXT&&(c=l.newlines?1:0),this.preserve_newlines&&(c=l.newlines<this.max_preserve_newlines+1?l.newlines:this.max_preserve_newlines+1);for(var s=0;s<c;s++)this.print_newline(s>0);return c!==0},f.prototype.traverse_whitespace=function(l){return l.whitespace_before||l.newlines?(this.print_preserved_newlines(l)||(this._output.space_before_token=!0),!0):!1},f.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},f.prototype.print_newline=function(l){this._output.add_new_line(l)},f.prototype.print_token=function(l){l.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(l.text))},f.prototype.indent=function(){this.indent_level++},f.prototype.get_full_indent=function(l){return l=this.indent_level+(l||0),l<1?"":this._output.get_indent_string(l)};var u=function(l){for(var c=null,s=l.next;s.type!==y.EOF&&l.closed!==s;){if(s.type===y.ATTRIBUTE&&s.text==="type"){s.next&&s.next.type===y.EQUALS&&s.next.next&&s.next.next.type===y.VALUE&&(c=s.next.next.text);break}s=s.next}return c},h=function(l,c){var s=null,g=null;return c.closed?(l==="script"?s="text/javascript":l==="style"&&(s="text/css"),s=u(c)||s,s.search("text/css")>-1?g="css":s.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?g="javascript":s.search(/(text|application|dojo)\/(x-)?(html)/)>-1?g="html":s.search(/test\/null/)>-1&&(g="null"),g):null};function S(l,c){return c.indexOf(l)!==-1}function k(l,c,s){this.parent=l||null,this.tag=c?c.tag_name:"",this.indent_level=s||0,this.parser_token=c||null}function m(l){this._printer=l,this._current_frame=null}m.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},m.prototype.record_tag=function(l){var c=new k(this._current_frame,l,this._printer.indent_level);this._current_frame=c},m.prototype._try_pop_frame=function(l){var c=null;return l&&(c=l.parser_token,this._printer.indent_level=l.indent_level,this._current_frame=l.parent),c},m.prototype._get_frame=function(l,c){for(var s=this._current_frame;s&&l.indexOf(s.tag)===-1;){if(c&&c.indexOf(s.tag)!==-1){s=null;break}s=s.parent}return s},m.prototype.try_pop=function(l,c){var s=this._get_frame([l],c);return this._try_pop_frame(s)},m.prototype.indent_to_tag=function(l){var c=this._get_frame(l);c&&(this._printer.indent_level=c.indent_level)};function A(l,c,s,g){this._source_text=l||"",c=c||{},this._js_beautify=s,this._css_beautify=g,this._tag_stack=null;var R=new b(c,"html");this._options=R,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,5)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,8)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}A.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var l=this._source_text,c=this._options.eol;this._options.eol==="auto"&&(c=`
`,l&&M.test(l)&&(c=l.match(M)[0])),l=l.replace(d,`
`);var s=l.match(/^[\t ]*/)[0],g={text:"",type:""},R=new I,D=new f(this._options,s),x=new p(l,this._options).tokenize();this._tag_stack=new m(D);for(var T=null,O=x.next();O.type!==y.EOF;)O.type===y.TAG_OPEN||O.type===y.COMMENT?(T=this._handle_tag_open(D,O,R,g),R=T):O.type===y.ATTRIBUTE||O.type===y.EQUALS||O.type===y.VALUE||O.type===y.TEXT&&!R.tag_complete?T=this._handle_inside_tag(D,O,R,x):O.type===y.TAG_CLOSE?T=this._handle_tag_close(D,O,R):O.type===y.TEXT?T=this._handle_text(D,O,R):D.add_raw_token(O),g=T,O=x.next();var $=D._output.get_code(c);return $},A.prototype._handle_tag_close=function(l,c,s){var g={text:c.text,type:c.type};return l.alignment_size=0,s.tag_complete=!0,l.set_space_before_token(c.newlines||c.whitespace_before!=="",!0),s.is_unformatted?l.add_raw_token(c):(s.tag_start_char==="<"&&(l.set_space_before_token(c.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&s.has_wrapped_attrs&&l.print_newline(!1)),l.print_token(c)),s.indent_content&&!(s.is_unformatted||s.is_content_unformatted)&&(l.indent(),s.indent_content=!1),!s.is_inline_element&&!(s.is_unformatted||s.is_content_unformatted)&&l.set_wrap_point(),g},A.prototype._handle_inside_tag=function(l,c,s,g){var R=s.has_wrapped_attrs,D={text:c.text,type:c.type};if(l.set_space_before_token(c.newlines||c.whitespace_before!=="",!0),s.is_unformatted)l.add_raw_token(c);else if(s.tag_start_char==="{"&&c.type===y.TEXT)l.print_preserved_newlines(c)?(c.newlines=0,l.add_raw_token(c)):l.print_token(c);else{if(c.type===y.ATTRIBUTE?(l.set_space_before_token(!0),s.attr_count+=1):(c.type===y.EQUALS||c.type===y.VALUE&&c.previous.type===y.EQUALS)&&l.set_space_before_token(!1),c.type===y.ATTRIBUTE&&s.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(l.traverse_whitespace(c),R=R||c.newlines!==0),this._is_wrap_attributes_force)){var x=s.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&s.attr_count===1){var T=!0,O=0,$;do{if($=g.peek(O),$.type===y.ATTRIBUTE){T=!1;break}O+=1}while(O<4&&$.type!==y.EOF&&$.type!==y.TAG_CLOSE);x=!T}x&&(l.print_newline(!1),R=!0)}l.print_token(c),R=R||l.previous_token_wrapped(),s.has_wrapped_attrs=R}return D},A.prototype._handle_text=function(l,c,s){var g={text:c.text,type:"TK_CONTENT"};return s.custom_beautifier_name?this._print_custom_beatifier_text(l,c,s):s.is_unformatted||s.is_content_unformatted?l.add_raw_token(c):(l.traverse_whitespace(c),l.print_token(c)),g},A.prototype._print_custom_beatifier_text=function(l,c,s){var g=this;if(c.text!==""){var R=c.text,D,x=1,T="",O="";s.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?D=this._js_beautify:s.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?D=this._css_beautify:s.custom_beautifier_name==="html"&&(D=function(ie,oe){var ue=new A(ie,oe,g._js_beautify,g._css_beautify);return ue.beautify()}),this._options.indent_scripts==="keep"?x=0:this._options.indent_scripts==="separate"&&(x=-l.indent_level);var $=l.get_full_indent(x);if(R=R.replace(/\n[ \t]*$/,""),s.custom_beautifier_name!=="html"&&R[0]==="<"&&R.match(/^(<!--|<!\[CDATA\[)/)){var H=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(R);if(!H){l.add_raw_token(c);return}T=$+H[1]+`
`,R=H[4],H[5]&&(O=$+H[5]),R=R.replace(/\n[ \t]*$/,""),(H[2]||H[3].indexOf(`
`)!==-1)&&(H=H[3].match(/[ \t]+$/),H&&(c.whitespace_before=H[0]))}if(R)if(D){var Z=function(){this.eol=`
`};Z.prototype=this._options.raw_options;var te=new Z;R=D($+R,te)}else{var J=c.whitespace_before;J&&(R=R.replace(new RegExp(`
(`+J+")?","g"),`
`)),R=$+R.replace(/\n/g,`
`+$)}T&&(R?R=T+R+`
`+O:R=T+O),l.print_newline(!1),R&&(c.text=R,c.whitespace_before="",c.newlines=0,l.add_raw_token(c),l.print_newline(!0))}},A.prototype._handle_tag_open=function(l,c,s,g){var R=this._get_tag_open_token(c);return(s.is_unformatted||s.is_content_unformatted)&&!s.is_empty_element&&c.type===y.TAG_OPEN&&c.text.indexOf("</")===0?(l.add_raw_token(c),R.start_tag_token=this._tag_stack.try_pop(R.tag_name)):(l.traverse_whitespace(c),this._set_tag_position(l,c,R,s,g),R.is_inline_element||l.set_wrap_point(),l.print_token(c)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(R.alignment_size=c.text.length+1),!R.tag_complete&&!R.is_unformatted&&(l.alignment_size=R.alignment_size),R};var I=function(l,c){if(this.parent=l||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!c)this.tag_complete=!0;else{var s;this.tag_start_char=c.text[0],this.text=c.text,this.tag_start_char==="<"?(s=c.text.match(/^<([^\s>]*)/),this.tag_check=s?s[1]:""):(s=c.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=s?s[1]:"",(c.text.startsWith("{{#>")||c.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&c.next!==null?this.tag_check=c.next.text.split(" ")[0]:this.tag_check=c.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),c.type===y.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||c.closed&&c.closed.text==="/>";var g=2;this.tag_start_char==="{"&&this.text.length>=3&&this.text.charAt(2)==="~"&&(g=3),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(g)))}};A.prototype._get_tag_open_token=function(l){var c=new I(this._tag_stack.get_parser_token(),l);return c.alignment_size=this._options.wrap_attributes_indent_size,c.is_end_tag=c.is_end_tag||S(c.tag_check,this._options.void_elements),c.is_empty_element=c.tag_complete||c.is_start_tag&&c.is_end_tag,c.is_unformatted=!c.tag_complete&&S(c.tag_check,this._options.unformatted),c.is_content_unformatted=!c.is_empty_element&&S(c.tag_check,this._options.content_unformatted),c.is_inline_element=S(c.tag_name,this._options.inline)||c.tag_name.includes("-")||c.tag_start_char==="{",c},A.prototype._set_tag_position=function(l,c,s,g,R){if(s.is_empty_element||(s.is_end_tag?s.start_tag_token=this._tag_stack.try_pop(s.tag_name):(this._do_optional_end_element(s)&&(s.is_inline_element||l.print_newline(!1)),this._tag_stack.record_tag(s),(s.tag_name==="script"||s.tag_name==="style")&&!(s.is_unformatted||s.is_content_unformatted)&&(s.custom_beautifier_name=h(s.tag_check,c)))),S(s.tag_check,this._options.extra_liners)&&(l.print_newline(!1),l._output.just_added_blankline()||l.print_newline(!0)),s.is_empty_element){if(s.tag_start_char==="{"&&s.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),s.indent_content=!0;var D=l.current_line_has_match(/{{#if/);D||l.print_newline(!1)}s.tag_name==="!--"&&R.type===y.TAG_CLOSE&&g.is_end_tag&&s.text.indexOf(`
`)===-1||(s.is_inline_element||s.is_unformatted||l.print_newline(!1),this._calcluate_parent_multiline(l,s))}else if(s.is_end_tag){var x=!1;x=s.start_tag_token&&s.start_tag_token.multiline_content,x=x||!s.is_inline_element&&!(g.is_inline_element||g.is_unformatted)&&!(R.type===y.TAG_CLOSE&&s.start_tag_token===g)&&R.type!=="TK_CONTENT",(s.is_content_unformatted||s.is_unformatted)&&(x=!1),x&&l.print_newline(!1)}else s.indent_content=!s.custom_beautifier_name,s.tag_start_char==="<"&&(s.tag_name==="html"?s.indent_content=this._options.indent_inner_html:s.tag_name==="head"?s.indent_content=this._options.indent_head_inner_html:s.tag_name==="body"&&(s.indent_content=this._options.indent_body_inner_html)),!(s.is_inline_element||s.is_unformatted)&&(R.type!=="TK_CONTENT"||s.is_content_unformatted)&&l.print_newline(!1),this._calcluate_parent_multiline(l,s)},A.prototype._calcluate_parent_multiline=function(l,c){c.parent&&l._output.just_added_newline()&&!((c.is_inline_element||c.is_unformatted)&&c.parent.is_inline_element)&&(c.parent.multiline_content=!0)};var C=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],P=["a","audio","del","ins","map","noscript","video"];A.prototype._do_optional_end_element=function(l){var c=null;if(!(l.is_empty_element||!l.is_start_tag||!l.parent)){if(l.tag_name==="body")c=c||this._tag_stack.try_pop("head");else if(l.tag_name==="li")c=c||this._tag_stack.try_pop("li",["ol","ul"]);else if(l.tag_name==="dd"||l.tag_name==="dt")c=c||this._tag_stack.try_pop("dt",["dl"]),c=c||this._tag_stack.try_pop("dd",["dl"]);else if(l.parent.tag_name==="p"&&C.indexOf(l.tag_name)!==-1){var s=l.parent.parent;(!s||P.indexOf(s.tag_name)===-1)&&(c=c||this._tag_stack.try_pop("p"))}else l.tag_name==="rp"||l.tag_name==="rt"?(c=c||this._tag_stack.try_pop("rt",["ruby","rtc"]),c=c||this._tag_stack.try_pop("rp",["ruby","rtc"])):l.tag_name==="optgroup"?c=c||this._tag_stack.try_pop("optgroup",["select"]):l.tag_name==="option"?c=c||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):l.tag_name==="colgroup"?c=c||this._tag_stack.try_pop("caption",["table"]):l.tag_name==="thead"?(c=c||this._tag_stack.try_pop("caption",["table"]),c=c||this._tag_stack.try_pop("colgroup",["table"])):l.tag_name==="tbody"||l.tag_name==="tfoot"?(c=c||this._tag_stack.try_pop("caption",["table"]),c=c||this._tag_stack.try_pop("colgroup",["table"]),c=c||this._tag_stack.try_pop("thead",["table"]),c=c||this._tag_stack.try_pop("tbody",["table"])):l.tag_name==="tr"?(c=c||this._tag_stack.try_pop("caption",["table"]),c=c||this._tag_stack.try_pop("colgroup",["table"]),c=c||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(l.tag_name==="th"||l.tag_name==="td")&&(c=c||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),c=c||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return l.parent=this._tag_stack.get_parser_token(),c}},L.exports.Beautifier=A},function(L,v,E){var b=E(6).Options;function w(p){b.call(this,p,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}w.prototype=new b,L.exports.Options=w},function(L,v,E){var b=E(9).Tokenizer,w=E(9).TOKEN,p=E(13).Directives,y=E(14).TemplatablePattern,M=E(12).Pattern,d={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:w.START,RAW:w.RAW,EOF:w.EOF},f=new p(/<\!--/,/-->/),u=function(h,S){b.call(this,h,S),this._current_tag_name="";var k=new y(this._input).read_options(this._options),m=new M(this._input);if(this.__patterns={word:k.until(/[\n\r\t <]/),single_quote:k.until_after(/'/),double_quote:k.until_after(/"/),attribute:k.until(/[\n\r\t =>]|\/>/),element_name:k.until(/[\n\r\t >\/]/),handlebars_comment:m.starting_with(/{{!--/).until_after(/--}}/),handlebars:m.starting_with(/{{/).until_after(/}}/),handlebars_open:m.until(/[\n\r\t }]/),handlebars_raw_close:m.until(/}}/),comment:m.starting_with(/<!--/).until_after(/-->/),cdata:m.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:m.starting_with(/<!\[/).until_after(/]>/),processing:m.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var A=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=m.matching(A).until_after(A)}};u.prototype=new b,u.prototype._is_comment=function(h){return!1},u.prototype._is_opening=function(h){return h.type===d.TAG_OPEN},u.prototype._is_closing=function(h,S){return h.type===d.TAG_CLOSE&&S&&((h.text===">"||h.text==="/>")&&S.text[0]==="<"||h.text==="}}"&&S.text[0]==="{"&&S.text[1]==="{")},u.prototype._reset=function(){this._current_tag_name=""},u.prototype._get_next_token=function(h,S){var k=null;this._readWhitespace();var m=this._input.peek();return m===null?this._create_token(d.EOF,""):(k=k||this._read_open_handlebars(m,S),k=k||this._read_attribute(m,h,S),k=k||this._read_close(m,S),k=k||this._read_raw_content(m,h,S),k=k||this._read_content_word(m),k=k||this._read_comment_or_cdata(m),k=k||this._read_processing(m),k=k||this._read_open(m,S),k=k||this._create_token(d.UNKNOWN,this._input.next()),k)},u.prototype._read_comment_or_cdata=function(h){var S=null,k=null,m=null;if(h==="<"){var A=this._input.peek(1);A==="!"&&(k=this.__patterns.comment.read(),k?(m=f.get_directives(k),m&&m.ignore==="start"&&(k+=f.readIgnored(this._input))):k=this.__patterns.cdata.read()),k&&(S=this._create_token(d.COMMENT,k),S.directives=m)}return S},u.prototype._read_processing=function(h){var S=null,k=null,m=null;if(h==="<"){var A=this._input.peek(1);(A==="!"||A==="?")&&(k=this.__patterns.conditional_comment.read(),k=k||this.__patterns.processing.read()),k&&(S=this._create_token(d.COMMENT,k),S.directives=m)}return S},u.prototype._read_open=function(h,S){var k=null,m=null;return S||h==="<"&&(k=this._input.next(),this._input.peek()==="/"&&(k+=this._input.next()),k+=this.__patterns.element_name.read(),m=this._create_token(d.TAG_OPEN,k)),m},u.prototype._read_open_handlebars=function(h,S){var k=null,m=null;return S||this._options.indent_handlebars&&h==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(k=this.__patterns.handlebars_comment.read(),k=k||this.__patterns.handlebars.read(),m=this._create_token(d.COMMENT,k)):(k=this.__patterns.handlebars_open.read(),m=this._create_token(d.TAG_OPEN,k))),m},u.prototype._read_close=function(h,S){var k=null,m=null;return S&&(S.text[0]==="<"&&(h===">"||h==="/"&&this._input.peek(1)===">")?(k=this._input.next(),h==="/"&&(k+=this._input.next()),m=this._create_token(d.TAG_CLOSE,k)):S.text[0]==="{"&&h==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),m=this._create_token(d.TAG_CLOSE,"}}"))),m},u.prototype._read_attribute=function(h,S,k){var m=null,A="";if(k&&k.text[0]==="<")if(h==="=")m=this._create_token(d.EQUALS,this._input.next());else if(h==='"'||h==="'"){var I=this._input.next();h==='"'?I+=this.__patterns.double_quote.read():I+=this.__patterns.single_quote.read(),m=this._create_token(d.VALUE,I)}else A=this.__patterns.attribute.read(),A&&(S.type===d.EQUALS?m=this._create_token(d.VALUE,A):m=this._create_token(d.ATTRIBUTE,A));return m},u.prototype._is_content_unformatted=function(h){return this._options.void_elements.indexOf(h)===-1&&(this._options.content_unformatted.indexOf(h)!==-1||this._options.unformatted.indexOf(h)!==-1)},u.prototype._read_raw_content=function(h,S,k){var m="";if(k&&k.text[0]==="{")m=this.__patterns.handlebars_raw_close.read();else if(S.type===d.TAG_CLOSE&&S.opened.text[0]==="<"&&S.text[0]!=="/"){var A=S.opened.text.substr(1).toLowerCase();if(A==="script"||A==="style"){var I=this._read_comment_or_cdata(h);if(I)return I.type=d.TEXT,I;m=this._input.readUntil(new RegExp("</"+A+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(A)&&(m=this._input.readUntil(new RegExp("</"+A+"[\\n\\r\\t ]*?>","ig")))}return m?this._create_token(d.TEXT,m):null},u.prototype._read_content_word=function(h){var S="";if(this._options.unformatted_content_delimiter&&h===this._options.unformatted_content_delimiter[0]&&(S=this.__patterns.unformatted_content_delimiter.read()),S||(S=this.__patterns.word.read()),S)return this._create_token(d.TEXT,S)},L.exports.Tokenizer=u,L.exports.TOKEN=d}],F={};function i(L){var v=F[L];if(v!==void 0)return v.exports;var E=F[L]={exports:{}};return K[L](E,E.exports,i),E.exports}var U=i(18);le=U})();var G=le;if(1)me=[q,q(77937),q(85040)],ge=function(K){var F=q(77937),i=q(85040);return{html_beautify:function(U,L){return G(U,L,F.js_beautify,i.css_beautify)}}}.apply(at,me),ge!==void 0&&(Ht.exports=ge);else var B,V})()},77937:function(Ht,at){var q,me;(function(){var ge;(function(){"use strict";var G=[function(F,i,U){var L=U(1).Beautifier,v=U(5).Options;function E(b,w){var p=new L(b,w);return p.beautify()}F.exports=E,F.exports.defaultOptions=function(){return new v}},function(F,i,U){var L=U(2).Output,v=U(3).Token,E=U(4),b=U(5).Options,w=U(7).Tokenizer,p=U(7).line_starters,y=U(7).positionable_operators,M=U(7).TOKEN;function d(T,O){return O.indexOf(T)!==-1}function f(T){return T.replace(/^\s+/g,"")}function u(T){for(var O={},$=0;$<T.length;$++)O[T[$].replace(/-/g,"_")]=T[$];return O}function h(T,O){return T&&T.type===M.RESERVED&&T.text===O}function S(T,O){return T&&T.type===M.RESERVED&&d(T.text,O)}var k=["case","return","do","if","throw","else","await","break","continue","async"],m=["before-newline","after-newline","preserve-newline"],A=u(m),I=[A.before_newline,A.preserve_newline],C={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function P(T,O){O.multiline_frame||O.mode===C.ForInitializer||O.mode===C.Conditional||T.remove_indent(O.start_line_index)}function l(T){T=T.replace(E.allLineBreaks,`
`);for(var O=[],$=T.indexOf(`
`);$!==-1;)O.push(T.substring(0,$)),T=T.substring($+1),$=T.indexOf(`
`);return T.length&&O.push(T),O}function c(T){return T===C.ArrayLiteral}function s(T){return d(T,[C.Expression,C.ForInitializer,C.Conditional])}function g(T,O){for(var $=0;$<T.length;$++){var H=T[$].trim();if(H.charAt(0)!==O)return!1}return!0}function R(T,O){for(var $=0,H=T.length,Z;$<H;$++)if(Z=T[$],Z&&Z.indexOf(O)!==0)return!1;return!0}function D(T,O){O=O||{},this._source_text=T||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new b(O)}D.prototype.create_flags=function(T,O){var $=0;T&&($=T.indentation_level,!this._output.just_added_newline()&&T.line_indent_level>$&&($=T.line_indent_level));var H={mode:O,parent:T,last_token:T?T.last_token:new v(M.START_BLOCK,""),last_word:T?T.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:$,alignment:0,line_indent_level:T?T.line_indent_level:$,start_line_index:this._output.get_line_number(),ternary_depth:0};return H},D.prototype._reset=function(T){var O=T.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new L(this._options,O),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(C.BlockStatement);var $=new w(T,this._options);return this._tokens=$.tokenize(),T},D.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var T,O=this._reset(this._source_text),$=this._options.eol;this._options.eol==="auto"&&($=`
`,O&&E.lineBreak.test(O||"")&&($=O.match(E.lineBreak)[0]));for(var H=this._tokens.next();H;)this.handle_token(H),this._last_last_text=this._flags.last_token.text,this._flags.last_token=H,H=this._tokens.next();return T=this._output.get_code($),T},D.prototype.handle_token=function(T,O){T.type===M.START_EXPR?this.handle_start_expr(T):T.type===M.END_EXPR?this.handle_end_expr(T):T.type===M.START_BLOCK?this.handle_start_block(T):T.type===M.END_BLOCK?this.handle_end_block(T):T.type===M.WORD?this.handle_word(T):T.type===M.RESERVED?this.handle_word(T):T.type===M.SEMICOLON?this.handle_semicolon(T):T.type===M.STRING?this.handle_string(T):T.type===M.EQUALS?this.handle_equals(T):T.type===M.OPERATOR?this.handle_operator(T):T.type===M.COMMA?this.handle_comma(T):T.type===M.BLOCK_COMMENT?this.handle_block_comment(T,O):T.type===M.COMMENT?this.handle_comment(T,O):T.type===M.DOT?this.handle_dot(T):T.type===M.EOF?this.handle_eof(T):T.type===M.UNKNOWN?this.handle_unknown(T,O):this.handle_unknown(T,O)},D.prototype.handle_whitespace_and_comments=function(T,O){var $=T.newlines,H=this._options.keep_array_indentation&&c(this._flags.mode);if(T.comments_before)for(var Z=T.comments_before.next();Z;)this.handle_whitespace_and_comments(Z,O),this.handle_token(Z,O),Z=T.comments_before.next();if(H)for(var te=0;te<$;te+=1)this.print_newline(te>0,O);else if(this._options.max_preserve_newlines&&$>this._options.max_preserve_newlines&&($=this._options.max_preserve_newlines),this._options.preserve_newlines&&$>1){this.print_newline(!1,O);for(var J=1;J<$;J+=1)this.print_newline(!0,O)}};var x=["async","break","continue","return","throw","yield"];D.prototype.allow_wrap_or_preserved_newline=function(T,O){if(O=O===void 0?!1:O,!this._output.just_added_newline()){var $=this._options.preserve_newlines&&T.newlines||O,H=d(this._flags.last_token.text,y)||d(T.text,y);if(H){var Z=d(this._flags.last_token.text,y)&&d(this._options.operator_position,I)||d(T.text,y);$=$&&Z}if($)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(S(this._flags.last_token,x))return;this._output.set_wrap_point()}}},D.prototype.print_newline=function(T,O){if(!O&&this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==M.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++"))for(var $=this._tokens.peek();this._flags.mode===C.Statement&&!(this._flags.if_block&&h($,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(T)&&(this._flags.multiline_frame=!0)},D.prototype.print_token_line_indentation=function(T){this._output.just_added_newline()&&(this._options.keep_array_indentation&&T.newlines&&(T.text==="["||c(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(T.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},D.prototype.print_token=function(T){if(this._output.raw){this._output.add_raw_token(T);return}if(this._options.comma_first&&T.previous&&T.previous.type===M.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var O=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(O),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(T),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(T),this._output.non_breaking_space=!0,this._output.add_token(T.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},D.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},D.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},D.prototype.set_mode=function(T){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,T),this._flags=this.create_flags(this._previous_flags,T),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},D.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===C.Statement&&P(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},D.prototype.start_of_object_property=function(){return this._flags.parent.mode===C.ObjectLiteral&&this._flags.mode===C.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||S(this._flags.last_token,["get","set"]))},D.prototype.start_of_statement=function(T){var O=!1;return O=O||S(this._flags.last_token,["var","let","const"])&&T.type===M.WORD,O=O||h(this._flags.last_token,"do"),O=O||!(this._flags.parent.mode===C.ObjectLiteral&&this._flags.mode===C.Statement)&&S(this._flags.last_token,x)&&!T.newlines,O=O||h(this._flags.last_token,"else")&&!(h(T,"if")&&!T.comments_before),O=O||this._flags.last_token.type===M.END_EXPR&&(this._previous_flags.mode===C.ForInitializer||this._previous_flags.mode===C.Conditional),O=O||this._flags.last_token.type===M.WORD&&this._flags.mode===C.BlockStatement&&!this._flags.in_case&&!(T.text==="--"||T.text==="++")&&this._last_last_text!=="function"&&T.type!==M.WORD&&T.type!==M.RESERVED,O=O||this._flags.mode===C.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||S(this._flags.last_token,["get","set"])),O?(this.set_mode(C.Statement),this.indent(),this.handle_whitespace_and_comments(T,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(T,S(T,["do","for","if","while"])),!0):!1},D.prototype.handle_start_expr=function(T){this.start_of_statement(T)||this.handle_whitespace_and_comments(T);var O=C.Expression;if(T.text==="["){if(this._flags.last_token.type===M.WORD||this._flags.last_token.text===")"){S(this._flags.last_token,p)&&(this._output.space_before_token=!0),this.print_token(T),this.set_mode(O),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}O=C.ArrayLiteral,c(this._flags.mode)&&(this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline()),d(this._flags.last_token.type,[M.START_EXPR,M.END_EXPR,M.WORD,M.OPERATOR,M.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===M.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,O=C.ForInitializer):d(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,O=C.Conditional):d(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&T.whitespace_before===""?this._output.space_before_token=!1:(d(this._flags.last_token.text,p)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===M.EQUALS||this._flags.last_token.type===M.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(T);else if(this._flags.last_token.type===M.WORD){this._output.space_before_token=!1;var $=this._tokens.peek(-3);if(this._options.space_after_named_function&&$){var H=this._tokens.peek(-4);S($,["async","function"])||$.text==="*"&&S(H,["async","function"])?this._output.space_before_token=!0:this._flags.mode===C.ObjectLiteral?($.text==="{"||$.text===","||$.text==="*"&&(H.text==="{"||H.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(T);(this._flags.last_token.type===M.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(d(this._last_last_text,["function","yield"])||this._flags.mode===C.ObjectLiteral&&d(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===M.START_BLOCK?this.print_newline():(this._flags.last_token.type===M.END_EXPR||this._flags.last_token.type===M.START_EXPR||this._flags.last_token.type===M.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===M.COMMA)&&this.allow_wrap_or_preserved_newline(T,T.newlines),this.print_token(T),this.set_mode(O),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},D.prototype.handle_end_expr=function(T){for(;this._flags.mode===C.Statement;)this.restore_mode();this.handle_whitespace_and_comments(T),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(T,T.text==="]"&&c(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===M.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(T),this.restore_mode(),P(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===C.Conditional&&(this._previous_flags.mode=C.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},D.prototype.handle_start_block=function(T){this.handle_whitespace_and_comments(T);var O=this._tokens.peek(),$=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===M.END_EXPR?(this.set_mode(C.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(C.BlockStatement):$&&(d($.text,[":",","])&&d(O.type,[M.STRING,M.WORD,M.RESERVED])||d(O.text,["get","set","..."])&&d($.type,[M.WORD,M.RESERVED]))?d(this._last_last_text,["class","interface"])&&!d($.text,[":",","])?this.set_mode(C.BlockStatement):this.set_mode(C.ObjectLiteral):this._flags.last_token.type===M.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(C.BlockStatement):d(this._flags.last_token.type,[M.EQUALS,M.START_EXPR,M.COMMA,M.OPERATOR])||S(this._flags.last_token,["return","throw","import","default"])?this.set_mode(C.ObjectLiteral):this.set_mode(C.BlockStatement),this._flags.last_token&&S(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var H=!O.comments_before&&O.text==="}",Z=H&&this._flags.last_word==="function"&&this._flags.last_token.type===M.END_EXPR;if(this._options.brace_preserve_inline){var te=0,J=null;this._flags.inline_frame=!0;do if(te+=1,J=this._tokens.peek(te-1),J.newlines){this._flags.inline_frame=!1;break}while(J.type!==M.EOF&&!(J.type===M.END_BLOCK&&J.opened===T))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&T.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==M.OPERATOR&&(Z||this._flags.last_token.type===M.EQUALS||S(this._flags.last_token,k)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(c(this._previous_flags.mode)&&(this._flags.last_token.type===M.START_EXPR||this._flags.last_token.type===M.COMMA)&&((this._flags.last_token.type===M.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===M.COMMA||this._flags.last_token.type===M.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(T),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==M.OPERATOR&&this._flags.last_token.type!==M.START_EXPR&&(this._flags.last_token.type===M.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(T),this.indent(),!H&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},D.prototype.handle_end_block=function(T){for(this.handle_whitespace_and_comments(T);this._flags.mode===C.Statement;)this.restore_mode();var O=this._flags.last_token.type===M.START_BLOCK;this._flags.inline_frame&&!O?this._output.space_before_token=!0:this._options.brace_style==="expand"?O||this.print_newline():O||(c(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(T)},D.prototype.handle_word=function(T){if(T.type===M.RESERVED){if(d(T.text,["set","get"])&&this._flags.mode!==C.ObjectLiteral)T.type=M.WORD;else if(T.text==="import"&&d(this._tokens.peek().text,["(","."]))T.type=M.WORD;else if(d(T.text,["as","from"])&&!this._flags.import_block)T.type=M.WORD;else if(this._flags.mode===C.ObjectLiteral){var O=this._tokens.peek();O.text===":"&&(T.type=M.WORD)}}if(this.start_of_statement(T)?S(this._flags.last_token,["var","let","const"])&&T.type===M.WORD&&(this._flags.declaration_statement=!0):T.newlines&&!s(this._flags.mode)&&(this._flags.last_token.type!==M.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==M.EQUALS&&(this._options.preserve_newlines||!S(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(T),this.print_newline()):this.handle_whitespace_and_comments(T),this._flags.do_block&&!this._flags.do_while)if(h(T,"while")){this._output.space_before_token=!0,this.print_token(T),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&h(T,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===C.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&S(T,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(T),this._flags.in_case=!0;return}if((this._flags.last_token.type===M.COMMA||this._flags.last_token.type===M.START_EXPR||this._flags.last_token.type===M.EQUALS||this._flags.last_token.type===M.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(T)),h(T,"function")){(d(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(d(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===M.OPERATOR))&&!this._output.just_added_blankline()&&!T.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===M.RESERVED||this._flags.last_token.type===M.WORD?S(this._flags.last_token,["get","set","new","export"])||S(this._flags.last_token,x)?this._output.space_before_token=!0:h(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===M.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(s(this._flags.mode)||c(this._flags.mode))||this.print_newline(),this.print_token(T),this._flags.last_word=T.text;return}var $="NONE";if(this._flags.last_token.type===M.END_BLOCK?this._previous_flags.inline_frame?$="SPACE":S(T,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&T.newlines?$="NEWLINE":($="SPACE",this._output.space_before_token=!0):$="NEWLINE":this._flags.last_token.type===M.SEMICOLON&&this._flags.mode===C.BlockStatement?$="NEWLINE":this._flags.last_token.type===M.SEMICOLON&&s(this._flags.mode)?$="SPACE":this._flags.last_token.type===M.STRING?$="NEWLINE":this._flags.last_token.type===M.RESERVED||this._flags.last_token.type===M.WORD||this._flags.last_token.text==="*"&&(d(this._last_last_text,["function","yield"])||this._flags.mode===C.ObjectLiteral&&d(this._last_last_text,["{",","]))?$="SPACE":this._flags.last_token.type===M.START_BLOCK?this._flags.inline_frame?$="SPACE":$="NEWLINE":this._flags.last_token.type===M.END_EXPR&&(this._output.space_before_token=!0,$="NEWLINE"),S(T,p)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?$="SPACE":$="NEWLINE"),S(T,["else","catch","finally"]))if((!(this._flags.last_token.type===M.END_BLOCK&&this._previous_flags.mode===C.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&T.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var H=this._output.current_line;H.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else $==="NEWLINE"?S(this._flags.last_token,k)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&S(T,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==M.END_EXPR?(this._flags.last_token.type!==M.START_EXPR||!S(T,["var","let","const"]))&&this._flags.last_token.text!==":"&&(h(T,"if")&&h(T.previous,"else")?this._output.space_before_token=!0:this.print_newline()):S(T,p)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&c(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():$==="SPACE"&&(this._output.space_before_token=!0);T.previous&&(T.previous.type===M.WORD||T.previous.type===M.RESERVED)&&(this._output.space_before_token=!0),this.print_token(T),this._flags.last_word=T.text,T.type===M.RESERVED&&(T.text==="do"?this._flags.do_block=!0:T.text==="if"?this._flags.if_block=!0:T.text==="import"?this._flags.import_block=!0:this._flags.import_block&&h(T,"from")&&(this._flags.import_block=!1))},D.prototype.handle_semicolon=function(T){this.start_of_statement(T)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(T);for(var O=this._tokens.peek();this._flags.mode===C.Statement&&!(this._flags.if_block&&h(O,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(T)},D.prototype.handle_string=function(T){T.text.startsWith("`")&&T.newlines===0&&T.whitespace_before===""&&(T.previous.text===")"||this._flags.last_token.type===M.WORD)||(this.start_of_statement(T)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(T),this._flags.last_token.type===M.RESERVED||this._flags.last_token.type===M.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===M.COMMA||this._flags.last_token.type===M.START_EXPR||this._flags.last_token.type===M.EQUALS||this._flags.last_token.type===M.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(T):T.text.startsWith("`")&&this._flags.last_token.type===M.END_EXPR&&(T.previous.text==="]"||T.previous.text===")")&&T.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(T)},D.prototype.handle_equals=function(T){this.start_of_statement(T)||this.handle_whitespace_and_comments(T),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(T),this._output.space_before_token=!0},D.prototype.handle_comma=function(T){this.handle_whitespace_and_comments(T,!0),this.print_token(T),this._output.space_before_token=!0,this._flags.declaration_statement?(s(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(T)):this._flags.mode===C.ObjectLiteral||this._flags.mode===C.Statement&&this._flags.parent.mode===C.ObjectLiteral?(this._flags.mode===C.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(T)},D.prototype.handle_operator=function(T){var O=T.text==="*"&&(S(this._flags.last_token,["function","yield"])||d(this._flags.last_token.type,[M.START_BLOCK,M.COMMA,M.END_BLOCK,M.SEMICOLON])),$=d(T.text,["-","+"])&&(d(this._flags.last_token.type,[M.START_BLOCK,M.START_EXPR,M.EQUALS,M.OPERATOR])||d(this._flags.last_token.text,p)||this._flags.last_token.text===",");if(!this.start_of_statement(T)){var H=!O;this.handle_whitespace_and_comments(T,H)}if(T.text==="*"&&this._flags.last_token.type===M.DOT){this.print_token(T);return}if(T.text==="::"){this.print_token(T);return}if(this._flags.last_token.type===M.OPERATOR&&d(this._options.operator_position,I)&&this.allow_wrap_or_preserved_newline(T),T.text===":"&&this._flags.in_case){this.print_token(T),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==M.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var Z=!0,te=!0,J=!1;if(T.text===":"?this._flags.ternary_depth===0?Z=!1:(this._flags.ternary_depth-=1,J=!0):T.text==="?"&&(this._flags.ternary_depth+=1),!$&&!O&&this._options.preserve_newlines&&d(T.text,y)){var ie=T.text===":",oe=ie&&J,ue=ie&&!J;switch(this._options.operator_position){case A.before_newline:this._output.space_before_token=!ue,this.print_token(T),(!ie||oe)&&this.allow_wrap_or_preserved_newline(T),this._output.space_before_token=!0;return;case A.after_newline:this._output.space_before_token=!0,!ie||oe?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(T):this._output.space_before_token=!1,this.print_token(T),this._output.space_before_token=!0;return;case A.preserve_newline:ue||this.allow_wrap_or_preserved_newline(T),Z=!(this._output.just_added_newline()||ue),this._output.space_before_token=Z,this.print_token(T),this._output.space_before_token=!0;return}}if(O){this.allow_wrap_or_preserved_newline(T),Z=!1;var Pe=this._tokens.peek();te=Pe&&d(Pe.type,[M.WORD,M.RESERVED])}else if(T.text==="...")this.allow_wrap_or_preserved_newline(T),Z=this._flags.last_token.type===M.START_BLOCK,te=!1;else if(d(T.text,["--","++","!","~"])||$){if((this._flags.last_token.type===M.COMMA||this._flags.last_token.type===M.START_EXPR)&&this.allow_wrap_or_preserved_newline(T),Z=!1,te=!1,T.newlines&&(T.text==="--"||T.text==="++"||T.text==="~")){var Ne=S(this._flags.last_token,k)&&T.newlines;Ne&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(Ne,!0)}this._flags.last_token.text===";"&&s(this._flags.mode)&&(Z=!0),this._flags.last_token.type===M.RESERVED?Z=!0:this._flags.last_token.type===M.END_EXPR?Z=!(this._flags.last_token.text==="]"&&(T.text==="--"||T.text==="++")):this._flags.last_token.type===M.OPERATOR&&(Z=d(T.text,["--","-","++","+"])&&d(this._flags.last_token.text,["--","-","++","+"]),d(T.text,["+","-"])&&d(this._flags.last_token.text,["--","++"])&&(te=!0)),(this._flags.mode===C.BlockStatement&&!this._flags.inline_frame||this._flags.mode===C.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||Z,this.print_token(T),this._output.space_before_token=te},D.prototype.handle_block_comment=function(T,O){if(this._output.raw){this._output.add_raw_token(T),T.directives&&T.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(T.directives){this.print_newline(!1,O),this.print_token(T),T.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!E.newline.test(T.text)&&!T.newlines){this._output.space_before_token=!0,this.print_token(T),this._output.space_before_token=!0;return}else this.print_block_commment(T,O)},D.prototype.print_block_commment=function(T,O){var $=l(T.text),H,Z=!1,te=!1,J=T.whitespace_before,ie=J.length;if(this.print_newline(!1,O),this.print_token_line_indentation(T),this._output.add_token($[0]),this.print_newline(!1,O),$.length>1){for($=$.slice(1),Z=g($,"*"),te=R($,J),Z&&(this._flags.alignment=1),H=0;H<$.length;H++)Z?(this.print_token_line_indentation(T),this._output.add_token(f($[H]))):te&&$[H]?(this.print_token_line_indentation(T),this._output.add_token($[H].substring(ie))):(this._output.current_line.set_indent(-1),this._output.add_token($[H])),this.print_newline(!1,O);this._flags.alignment=0}},D.prototype.handle_comment=function(T,O){T.newlines?this.print_newline(!1,O):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(T),this.print_newline(!1,O)},D.prototype.handle_dot=function(T){this.start_of_statement(T)||this.handle_whitespace_and_comments(T,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),S(this._flags.last_token,k)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(T,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(T)},D.prototype.handle_unknown=function(T,O){this.print_token(T),T.text[T.text.length-1]===`
`&&this.print_newline(!1,O)},D.prototype.handle_eof=function(T){for(;this._flags.mode===C.Statement;)this.restore_mode();this.handle_whitespace_and_comments(T)},F.exports.Beautifier=D},function(F){function i(v){this.__parent=v,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}i.prototype.clone_empty=function(){var v=new i(this.__parent);return v.set_indent(this.__indent_count,this.__alignment_count),v},i.prototype.item=function(v){return v<0?this.__items[this.__items.length+v]:this.__items[v]},i.prototype.has_match=function(v){for(var E=this.__items.length-1;E>=0;E--)if(this.__items[E].match(v))return!0;return!1},i.prototype.set_indent=function(v,E){this.is_empty()&&(this.__indent_count=v||0,this.__alignment_count=E||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},i.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},i.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},i.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var v=this.__parent.current_line;return v.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),v.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),v.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,v.__items[0]===" "&&(v.__items.splice(0,1),v.__character_count-=1),!0}return!1},i.prototype.is_empty=function(){return this.__items.length===0},i.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},i.prototype.push=function(v){this.__items.push(v);var E=v.lastIndexOf(`
`);E!==-1?this.__character_count=v.length-E:this.__character_count+=v.length},i.prototype.pop=function(){var v=null;return this.is_empty()||(v=this.__items.pop(),this.__character_count-=v.length),v},i.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},i.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},i.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},i.prototype.toString=function(){var v="";return this.is_empty()?this.__parent.indent_empty_lines&&(v=this.__parent.get_indent_string(this.__indent_count)):(v=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),v+=this.__items.join("")),v};function U(v,E){this.__cache=[""],this.__indent_size=v.indent_size,this.__indent_string=v.indent_char,v.indent_with_tabs||(this.__indent_string=new Array(v.indent_size+1).join(v.indent_char)),E=E||"",v.indent_level>0&&(E=new Array(v.indent_level+1).join(this.__indent_string)),this.__base_string=E,this.__base_string_length=E.length}U.prototype.get_indent_size=function(v,E){var b=this.__base_string_length;return E=E||0,v<0&&(b=0),b+=v*this.__indent_size,b+=E,b},U.prototype.get_indent_string=function(v,E){var b=this.__base_string;return E=E||0,v<0&&(v=0,b=""),E+=v*this.__indent_size,this.__ensure_cache(E),b+=this.__cache[E],b},U.prototype.__ensure_cache=function(v){for(;v>=this.__cache.length;)this.__add_column()},U.prototype.__add_column=function(){var v=this.__cache.length,E=0,b="";this.__indent_size&&v>=this.__indent_size&&(E=Math.floor(v/this.__indent_size),v-=E*this.__indent_size,b=new Array(E+1).join(this.__indent_string)),v&&(b+=new Array(v+1).join(" ")),this.__cache.push(b)};function L(v,E){this.__indent_cache=new U(v,E),this.raw=!1,this._end_with_newline=v.end_with_newline,this.indent_size=v.indent_size,this.wrap_line_length=v.wrap_line_length,this.indent_empty_lines=v.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new i(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}L.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},L.prototype.get_line_number=function(){return this.__lines.length},L.prototype.get_indent_string=function(v,E){return this.__indent_cache.get_indent_string(v,E)},L.prototype.get_indent_size=function(v,E){return this.__indent_cache.get_indent_size(v,E)},L.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},L.prototype.add_new_line=function(v){return this.is_empty()||!v&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},L.prototype.get_code=function(v){this.trim(!0);var E=this.current_line.pop();E&&(E[E.length-1]===`
`&&(E=E.replace(/\n+$/g,"")),this.current_line.push(E)),this._end_with_newline&&this.__add_outputline();var b=this.__lines.join(`
`);return v!==`
`&&(b=b.replace(/[\n]/g,v)),b},L.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},L.prototype.set_indent=function(v,E){return v=v||0,E=E||0,this.next_line.set_indent(v,E),this.__lines.length>1?(this.current_line.set_indent(v,E),!0):(this.current_line.set_indent(),!1)},L.prototype.add_raw_token=function(v){for(var E=0;E<v.newlines;E++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(v.whitespace_before),this.current_line.push(v.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},L.prototype.add_token=function(v){this.__add_space_before_token(),this.current_line.push(v),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},L.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},L.prototype.remove_indent=function(v){for(var E=this.__lines.length;v<E;)this.__lines[v]._remove_indent(),v++;this.current_line._remove_wrap_indent()},L.prototype.trim=function(v){for(v=v===void 0?!1:v,this.current_line.trim();v&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},L.prototype.just_added_newline=function(){return this.current_line.is_empty()},L.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},L.prototype.ensure_empty_line_above=function(v,E){for(var b=this.__lines.length-2;b>=0;){var w=this.__lines[b];if(w.is_empty())break;if(w.item(0).indexOf(v)!==0&&w.item(-1)!==E){this.__lines.splice(b+1,0,new i(this)),this.previous_line=this.__lines[this.__lines.length-2];break}b--}},F.exports.Output=L},function(F){function i(U,L,v,E){this.type=U,this.text=L,this.comments_before=null,this.newlines=v||0,this.whitespace_before=E||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}F.exports.Token=i},function(F,i){var U="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",L="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",v="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",E="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",b="(?:\\\\u[0-9a-fA-F]{4}|["+U+v+"])",w="(?:\\\\u[0-9a-fA-F]{4}|["+L+v+E+"])*";i.identifier=new RegExp(b+w,"g"),i.identifierStart=new RegExp(b),i.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+L+v+E+"])+");var p=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;i.newline=/[\n\r\u2028\u2029]/,i.lineBreak=new RegExp(`\r
|`+i.newline.source),i.allLineBreaks=new RegExp(i.lineBreak.source,"g")},function(F,i,U){var L=U(6).Options,v=["before-newline","after-newline","preserve-newline"];function E(b){L.call(this,b,"js");var w=this.raw_options.brace_style||null;w==="expand-strict"?this.raw_options.brace_style="expand":w==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var p=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var y=0;y<p.length;y++)p[y]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=p[y];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",v),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}E.prototype=new L,F.exports.Options=E},function(F){function i(v,E){this.raw_options=U(v,E),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}i.prototype._get_array=function(v,E){var b=this.raw_options[v],w=E||[];return typeof b=="object"?b!==null&&typeof b.concat=="function"&&(w=b.concat()):typeof b=="string"&&(w=b.split(/[^a-zA-Z0-9_\/\-]+/)),w},i.prototype._get_boolean=function(v,E){var b=this.raw_options[v],w=b===void 0?!!E:!!b;return w},i.prototype._get_characters=function(v,E){var b=this.raw_options[v],w=E||"";return typeof b=="string"&&(w=b.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),w},i.prototype._get_number=function(v,E){var b=this.raw_options[v];E=parseInt(E,10),isNaN(E)&&(E=0);var w=parseInt(b,10);return isNaN(w)&&(w=E),w},i.prototype._get_selection=function(v,E,b){var w=this._get_selection_list(v,E,b);if(w.length!==1)throw new Error("Invalid Option Value: The option '"+v+`' can only be one of the following values:
`+E+`
You passed in: '`+this.raw_options[v]+"'");return w[0]},i.prototype._get_selection_list=function(v,E,b){if(!E||E.length===0)throw new Error("Selection list cannot be empty.");if(b=b||[E[0]],!this._is_valid_selection(b,E))throw new Error("Invalid Default Value!");var w=this._get_array(v,b);if(!this._is_valid_selection(w,E))throw new Error("Invalid Option Value: The option '"+v+`' can contain only the following values:
`+E+`
You passed in: '`+this.raw_options[v]+"'");return w},i.prototype._is_valid_selection=function(v,E){return v.length&&E.length&&!v.some(function(b){return E.indexOf(b)===-1})};function U(v,E){var b={};v=L(v);var w;for(w in v)w!==E&&(b[w]=v[w]);if(E&&v[E])for(w in v[E])b[w]=v[E][w];return b}function L(v){var E={},b;for(b in v){var w=b.replace(/-/g,"_");E[w]=v[b]}return E}F.exports.Options=i,F.exports.normalizeOpts=L,F.exports.mergeOpts=U},function(F,i,U){var L=U(8).InputScanner,v=U(9).Tokenizer,E=U(9).TOKEN,b=U(13).Directives,w=U(4),p=U(12).Pattern,y=U(14).TemplatablePattern;function M(g,R){return R.indexOf(g)!==-1}var d={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:E.START,RAW:E.RAW,EOF:E.EOF},f=new b(/\/\*/,/\*\//),u=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,h=/[0-9]/,S=/[^\d\.]/,k=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),m=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";m=m.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),m="\\?\\.(?!\\d) "+m,m=m.replace(/ /g,"|");var A=new RegExp(m),I="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),C=I.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),P=new RegExp("^(?:"+C.join("|")+")$"),l,c=function(g,R){v.call(this,g,R),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var D=new p(this._input),x=new y(this._input).read_options(this._options);this.__patterns={template:x,identifier:x.starting_with(w.identifier).matching(w.identifierMatch),number:D.matching(u),punct:D.matching(A),comment:D.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:D.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:D.matching(/<!--/),html_comment_end:D.matching(/-->/),include:D.starting_with(/#include/).until_after(w.lineBreak),shebang:D.starting_with(/#!/).until_after(w.lineBreak),xml:D.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:x.until(/['\\\n\r\u2028\u2029]/),double_quote:x.until(/["\\\n\r\u2028\u2029]/),template_text:x.until(/[`\\$]/),template_expression:x.until(/[`}\\]/)}};c.prototype=new v,c.prototype._is_comment=function(g){return g.type===d.COMMENT||g.type===d.BLOCK_COMMENT||g.type===d.UNKNOWN},c.prototype._is_opening=function(g){return g.type===d.START_BLOCK||g.type===d.START_EXPR},c.prototype._is_closing=function(g,R){return(g.type===d.END_BLOCK||g.type===d.END_EXPR)&&R&&(g.text==="]"&&R.text==="["||g.text===")"&&R.text==="("||g.text==="}"&&R.text==="{")},c.prototype._reset=function(){l=!1},c.prototype._get_next_token=function(g,R){var D=null;this._readWhitespace();var x=this._input.peek();return x===null?this._create_token(d.EOF,""):(D=D||this._read_non_javascript(x),D=D||this._read_string(x),D=D||this._read_word(g),D=D||this._read_singles(x),D=D||this._read_comment(x),D=D||this._read_regexp(x,g),D=D||this._read_xml(x,g),D=D||this._read_punctuation(),D=D||this._create_token(d.UNKNOWN,this._input.next()),D)},c.prototype._read_word=function(g){var R;if(R=this.__patterns.identifier.read(),R!=="")return R=R.replace(w.allLineBreaks,`
`),!(g.type===d.DOT||g.type===d.RESERVED&&(g.text==="set"||g.text==="get"))&&P.test(R)?(R==="in"||R==="of")&&(g.type===d.WORD||g.type===d.STRING)?this._create_token(d.OPERATOR,R):this._create_token(d.RESERVED,R):this._create_token(d.WORD,R);if(R=this.__patterns.number.read(),R!=="")return this._create_token(d.WORD,R)},c.prototype._read_singles=function(g){var R=null;return g==="("||g==="["?R=this._create_token(d.START_EXPR,g):g===")"||g==="]"?R=this._create_token(d.END_EXPR,g):g==="{"?R=this._create_token(d.START_BLOCK,g):g==="}"?R=this._create_token(d.END_BLOCK,g):g===";"?R=this._create_token(d.SEMICOLON,g):g==="."&&S.test(this._input.peek(1))?R=this._create_token(d.DOT,g):g===","&&(R=this._create_token(d.COMMA,g)),R&&this._input.next(),R},c.prototype._read_punctuation=function(){var g=this.__patterns.punct.read();if(g!=="")return g==="="?this._create_token(d.EQUALS,g):g==="?."?this._create_token(d.DOT,g):this._create_token(d.OPERATOR,g)},c.prototype._read_non_javascript=function(g){var R="";if(g==="#"){if(this._is_first_token()&&(R=this.__patterns.shebang.read(),R))return this._create_token(d.UNKNOWN,R.trim()+`
`);if(R=this.__patterns.include.read(),R)return this._create_token(d.UNKNOWN,R.trim()+`
`);g=this._input.next();var D="#";if(this._input.hasNext()&&this._input.testChar(h)){do g=this._input.next(),D+=g;while(this._input.hasNext()&&g!=="#"&&g!=="=");return g==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(D+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(D+="{}",this._input.next(),this._input.next())),this._create_token(d.WORD,D)}this._input.back()}else if(g==="<"&&this._is_first_token()){if(R=this.__patterns.html_comment_start.read(),R){for(;this._input.hasNext()&&!this._input.testChar(w.newline);)R+=this._input.next();return l=!0,this._create_token(d.COMMENT,R)}}else if(l&&g==="-"&&(R=this.__patterns.html_comment_end.read(),R))return l=!1,this._create_token(d.COMMENT,R);return null},c.prototype._read_comment=function(g){var R=null;if(g==="/"){var D="";if(this._input.peek(1)==="*"){D=this.__patterns.block_comment.read();var x=f.get_directives(D);x&&x.ignore==="start"&&(D+=f.readIgnored(this._input)),D=D.replace(w.allLineBreaks,`
`),R=this._create_token(d.BLOCK_COMMENT,D),R.directives=x}else this._input.peek(1)==="/"&&(D=this.__patterns.comment.read(),R=this._create_token(d.COMMENT,D))}return R},c.prototype._read_string=function(g){if(g==="`"||g==="'"||g==='"'){var R=this._input.next();return this.has_char_escapes=!1,g==="`"?R+=this._read_string_recursive("`",!0,"${"):R+=this._read_string_recursive(g),this.has_char_escapes&&this._options.unescape_strings&&(R=s(R)),this._input.peek()===g&&(R+=this._input.next()),R=R.replace(w.allLineBreaks,`
`),this._create_token(d.STRING,R)}return null},c.prototype._allow_regexp_or_xml=function(g){return g.type===d.RESERVED&&M(g.text,["return","case","throw","else","do","typeof","yield"])||g.type===d.END_EXPR&&g.text===")"&&g.opened.previous.type===d.RESERVED&&M(g.opened.previous.text,["if","while","for"])||M(g.type,[d.COMMENT,d.START_EXPR,d.START_BLOCK,d.START,d.END_BLOCK,d.OPERATOR,d.EQUALS,d.EOF,d.SEMICOLON,d.COMMA])},c.prototype._read_regexp=function(g,R){if(g==="/"&&this._allow_regexp_or_xml(R)){for(var D=this._input.next(),x=!1,T=!1;this._input.hasNext()&&(x||T||this._input.peek()!==g)&&!this._input.testChar(w.newline);)D+=this._input.peek(),x?x=!1:(x=this._input.peek()==="\\",this._input.peek()==="["?T=!0:this._input.peek()==="]"&&(T=!1)),this._input.next();return this._input.peek()===g&&(D+=this._input.next(),D+=this._input.read(w.identifier)),this._create_token(d.STRING,D)}return null},c.prototype._read_xml=function(g,R){if(this._options.e4x&&g==="<"&&this._allow_regexp_or_xml(R)){var D="",x=this.__patterns.xml.read_match();if(x){for(var T=x[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),O=T.indexOf("{")===0,$=0;x;){var H=!!x[1],Z=x[2],te=!!x[x.length-1]||Z.slice(0,8)==="![CDATA[";if(!te&&(Z===T||O&&Z.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(H?--$:++$),D+=x[0],$<=0)break;x=this.__patterns.xml.read_match()}return x||(D+=this._input.match(/[\s\S]*/g)[0]),D=D.replace(w.allLineBreaks,`
`),this._create_token(d.STRING,D)}}return null};function s(g){for(var R="",D=0,x=new L(g),T=null;x.hasNext();)if(T=x.match(/([\s]|[^\\]|\\\\)+/g),T&&(R+=T[0]),x.peek()==="\\"){if(x.next(),x.peek()==="x")T=x.match(/x([0-9A-Fa-f]{2})/g);else if(x.peek()==="u")T=x.match(/u([0-9A-Fa-f]{4})/g);else{R+="\\",x.hasNext()&&(R+=x.next());continue}if(!T||(D=parseInt(T[1],16),D>126&&D<=255&&T[0].indexOf("x")===0))return g;if(D>=0&&D<32){R+="\\"+T[0];continue}else D===34||D===39||D===92?R+="\\"+String.fromCharCode(D):R+=String.fromCharCode(D)}return R}c.prototype._read_string_recursive=function(g,R,D){var x,T;g==="'"?T=this.__patterns.single_quote:g==='"'?T=this.__patterns.double_quote:g==="`"?T=this.__patterns.template_text:g==="}"&&(T=this.__patterns.template_expression);for(var O=T.read(),$="";this._input.hasNext();){if($=this._input.next(),$===g||!R&&w.newline.test($)){this._input.back();break}else $==="\\"&&this._input.hasNext()?(x=this._input.peek(),x==="x"||x==="u"?this.has_char_escapes=!0:x==="\r"&&this._input.peek(1)===`
`&&this._input.next(),$+=this._input.next()):D&&(D==="${"&&$==="$"&&this._input.peek()==="{"&&($+=this._input.next()),D===$&&(g==="`"?$+=this._read_string_recursive("}",R,"`"):$+=this._read_string_recursive("`",R,"${"),this._input.hasNext()&&($+=this._input.next())));$+=T.read(),O+=$}return O},F.exports.Tokenizer=c,F.exports.TOKEN=d,F.exports.positionable_operators=k.slice(),F.exports.line_starters=I.slice()},function(F){var i=RegExp.prototype.hasOwnProperty("sticky");function U(L){this.__input=L||"",this.__input_length=this.__input.length,this.__position=0}U.prototype.restart=function(){this.__position=0},U.prototype.back=function(){this.__position>0&&(this.__position-=1)},U.prototype.hasNext=function(){return this.__position<this.__input_length},U.prototype.next=function(){var L=null;return this.hasNext()&&(L=this.__input.charAt(this.__position),this.__position+=1),L},U.prototype.peek=function(L){var v=null;return L=L||0,L+=this.__position,L>=0&&L<this.__input_length&&(v=this.__input.charAt(L)),v},U.prototype.__match=function(L,v){L.lastIndex=v;var E=L.exec(this.__input);return E&&!(i&&L.sticky)&&E.index!==v&&(E=null),E},U.prototype.test=function(L,v){return v=v||0,v+=this.__position,v>=0&&v<this.__input_length?!!this.__match(L,v):!1},U.prototype.testChar=function(L,v){var E=this.peek(v);return L.lastIndex=0,E!==null&&L.test(E)},U.prototype.match=function(L){var v=this.__match(L,this.__position);return v?this.__position+=v[0].length:v=null,v},U.prototype.read=function(L,v,E){var b="",w;return L&&(w=this.match(L),w&&(b+=w[0])),v&&(w||!L)&&(b+=this.readUntil(v,E)),b},U.prototype.readUntil=function(L,v){var E="",b=this.__position;L.lastIndex=this.__position;var w=L.exec(this.__input);return w?(b=w.index,v&&(b+=w[0].length)):b=this.__input_length,E=this.__input.substring(this.__position,b),this.__position=b,E},U.prototype.readUntilAfter=function(L){return this.readUntil(L,!0)},U.prototype.get_regexp=function(L,v){var E=null,b="g";return v&&i&&(b="y"),typeof L=="string"&&L!==""?E=new RegExp(L,b):L&&(E=new RegExp(L.source,b)),E},U.prototype.get_literal_regexp=function(L){return RegExp(L.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},U.prototype.peekUntilAfter=function(L){var v=this.__position,E=this.readUntilAfter(L);return this.__position=v,E},U.prototype.lookBack=function(L){var v=this.__position-1;return v>=L.length&&this.__input.substring(v-L.length,v).toLowerCase()===L},F.exports.InputScanner=U},function(F,i,U){var L=U(8).InputScanner,v=U(3).Token,E=U(10).TokenStream,b=U(11).WhitespacePattern,w={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},p=function(y,M){this._input=new L(y),this._options=M||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new b(this._input)};p.prototype.tokenize=function(){this._input.restart(),this.__tokens=new E,this._reset();for(var y,M=new v(w.START,""),d=null,f=[],u=new E;M.type!==w.EOF;){for(y=this._get_next_token(M,d);this._is_comment(y);)u.add(y),y=this._get_next_token(M,d);u.isEmpty()||(y.comments_before=u,u=new E),y.parent=d,this._is_opening(y)?(f.push(d),d=y):d&&this._is_closing(y,d)&&(y.opened=d,d.closed=y,d=f.pop(),y.parent=d),y.previous=M,M.next=y,this.__tokens.add(y),M=y}return this.__tokens},p.prototype._is_first_token=function(){return this.__tokens.isEmpty()},p.prototype._reset=function(){},p.prototype._get_next_token=function(y,M){this._readWhitespace();var d=this._input.read(/.+/g);return d?this._create_token(w.RAW,d):this._create_token(w.EOF,"")},p.prototype._is_comment=function(y){return!1},p.prototype._is_opening=function(y){return!1},p.prototype._is_closing=function(y,M){return!1},p.prototype._create_token=function(y,M){var d=new v(y,M,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return d},p.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},F.exports.Tokenizer=p,F.exports.TOKEN=w},function(F){function i(U){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=U}i.prototype.restart=function(){this.__position=0},i.prototype.isEmpty=function(){return this.__tokens_length===0},i.prototype.hasNext=function(){return this.__position<this.__tokens_length},i.prototype.next=function(){var U=null;return this.hasNext()&&(U=this.__tokens[this.__position],this.__position+=1),U},i.prototype.peek=function(U){var L=null;return U=U||0,U+=this.__position,U>=0&&U<this.__tokens_length&&(L=this.__tokens[U]),L},i.prototype.add=function(U){this.__parent_token&&(U.parent=this.__parent_token),this.__tokens.push(U),this.__tokens_length+=1},F.exports.TokenStream=i},function(F,i,U){var L=U(12).Pattern;function v(E,b){L.call(this,E,b),b?this._line_regexp=this._input.get_regexp(b._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}v.prototype=new L,v.prototype.__set_whitespace_patterns=function(E,b){E+="\\t ",b+="\\n\\r",this._match_pattern=this._input.get_regexp("["+E+b+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+b+"]")},v.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var E=this._input.read(this._match_pattern);if(E===" ")this.whitespace_before_token=" ";else if(E){var b=this.__split(this._newline_regexp,E);this.newline_count=b.length-1,this.whitespace_before_token=b[this.newline_count]}return E},v.prototype.matching=function(E,b){var w=this._create();return w.__set_whitespace_patterns(E,b),w._update(),w},v.prototype._create=function(){return new v(this._input,this)},v.prototype.__split=function(E,b){E.lastIndex=0;for(var w=0,p=[],y=E.exec(b);y;)p.push(b.substring(w,y.index)),w=y.index+y[0].length,y=E.exec(b);return w<b.length?p.push(b.substring(w,b.length)):p.push(""),p},F.exports.WhitespacePattern=v},function(F){function i(U,L){this._input=U,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,L&&(this._starting_pattern=this._input.get_regexp(L._starting_pattern,!0),this._match_pattern=this._input.get_regexp(L._match_pattern,!0),this._until_pattern=this._input.get_regexp(L._until_pattern),this._until_after=L._until_after)}i.prototype.read=function(){var U=this._input.read(this._starting_pattern);return(!this._starting_pattern||U)&&(U+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),U},i.prototype.read_match=function(){return this._input.match(this._match_pattern)},i.prototype.until_after=function(U){var L=this._create();return L._until_after=!0,L._until_pattern=this._input.get_regexp(U),L._update(),L},i.prototype.until=function(U){var L=this._create();return L._until_after=!1,L._until_pattern=this._input.get_regexp(U),L._update(),L},i.prototype.starting_with=function(U){var L=this._create();return L._starting_pattern=this._input.get_regexp(U,!0),L._update(),L},i.prototype.matching=function(U){var L=this._create();return L._match_pattern=this._input.get_regexp(U,!0),L._update(),L},i.prototype._create=function(){return new i(this._input,this)},i.prototype._update=function(){},F.exports.Pattern=i},function(F){function i(U,L){U=typeof U=="string"?U:U.source,L=typeof L=="string"?L:L.source,this.__directives_block_pattern=new RegExp(U+/ beautify( \w+[:]\w+)+ /.source+L,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(U+/\sbeautify\signore:end\s/.source+L,"g")}i.prototype.get_directives=function(U){if(!U.match(this.__directives_block_pattern))return null;var L={};this.__directive_pattern.lastIndex=0;for(var v=this.__directive_pattern.exec(U);v;)L[v[1]]=v[2],v=this.__directive_pattern.exec(U);return L},i.prototype.readIgnored=function(U){return U.readUntilAfter(this.__directives_end_ignore_pattern)},F.exports.Directives=i},function(F,i,U){var L=U(12).Pattern,v={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function E(b,w){L.call(this,b,w),this.__template_pattern=null,this._disabled=Object.assign({},v),this._excluded=Object.assign({},v),w&&(this.__template_pattern=this._input.get_regexp(w.__template_pattern),this._excluded=Object.assign(this._excluded,w._excluded),this._disabled=Object.assign(this._disabled,w._disabled));var p=new L(b);this.__patterns={handlebars_comment:p.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:p.starting_with(/{{{/).until_after(/}}}/),handlebars:p.starting_with(/{{/).until_after(/}}/),php:p.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:p.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:p.starting_with(/{%/).until_after(/%}/),django_value:p.starting_with(/{{/).until_after(/}}/),django_comment:p.starting_with(/{#/).until_after(/#}/),smarty:p.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:p.starting_with(/{\*/).until_after(/\*}/),smarty_literal:p.starting_with(/{literal}/).until_after(/{\/literal}/)}}E.prototype=new L,E.prototype._create=function(){return new E(this._input,this)},E.prototype._update=function(){this.__set_templated_pattern()},E.prototype.disable=function(b){var w=this._create();return w._disabled[b]=!0,w._update(),w},E.prototype.read_options=function(b){var w=this._create();for(var p in v)w._disabled[p]=b.templating.indexOf(p)===-1;return w._update(),w},E.prototype.exclude=function(b){var w=this._create();return w._excluded[b]=!0,w._update(),w},E.prototype.read=function(){var b="";this._match_pattern?b=this._input.read(this._starting_pattern):b=this._input.read(this._starting_pattern,this.__template_pattern);for(var w=this._read_template();w;)this._match_pattern?w+=this._input.read(this._match_pattern):w+=this._input.readUntil(this.__template_pattern),b+=w,w=this._read_template();return this._until_after&&(b+=this._input.readUntilAfter(this._until_pattern)),b},E.prototype.__set_templated_pattern=function(){var b=[];this._disabled.php||b.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||b.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||b.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(b.push(this.__patterns.django._starting_pattern.source),b.push(this.__patterns.django_value._starting_pattern.source),b.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||b.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&b.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+b.join("|")+")")},E.prototype._read_template=function(){var b="",w=this._input.peek();if(w==="<"){var p=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&p==="?"&&(b=b||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&p==="%"&&(b=b||this.__patterns.erb.read())}else w==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(b=b||this.__patterns.handlebars_comment.read(),b=b||this.__patterns.handlebars_unescaped.read(),b=b||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(b=b||this.__patterns.django_value.read()),this._excluded.django||(b=b||this.__patterns.django_comment.read(),b=b||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(b=b||this.__patterns.smarty_comment.read(),b=b||this.__patterns.smarty_literal.read(),b=b||this.__patterns.smarty.read()));return b},F.exports.TemplatablePattern=E}],B={};function V(F){var i=B[F];if(i!==void 0)return i.exports;var U=B[F]={exports:{}};return G[F](U,U.exports,V),U.exports}var K=V(0);ge=K})();var le=ge;q=[],me=function(){return{js_beautify:le}}.apply(at,q),me!==void 0&&(Ht.exports=me)})()},47084:function(Ht){(function(at,q){Ht.exports=q()})(this,function(){"use strict";function at(de,pe){for(var xe=0;xe<pe.length;xe++){var Q=pe[xe];Q.enumerable=Q.enumerable||!1,Q.configurable=!0,"value"in Q&&(Q.writable=!0),Object.defineProperty(de,Q.key,Q)}}function q(de,pe,xe){return pe&&at(de.prototype,pe),xe&&at(de,xe),de}function me(de,pe){if(de){if(typeof de=="string")return ge(de,pe);var xe=Object.prototype.toString.call(de).slice(8,-1);if(xe==="Object"&&de.constructor&&(xe=de.constructor.name),xe==="Map"||xe==="Set")return Array.from(de);if(xe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(xe))return ge(de,pe)}}function ge(de,pe){(pe==null||pe>de.length)&&(pe=de.length);for(var xe=0,Q=new Array(pe);xe<pe;xe++)Q[xe]=de[xe];return Q}function le(de,pe){var xe=typeof Symbol!="undefined"&&de[Symbol.iterator]||de["@@iterator"];if(xe)return(xe=xe.call(de)).next.bind(xe);if(Array.isArray(de)||(xe=me(de))||pe&&de&&typeof de.length=="number"){xe&&(de=xe);var Q=0;return function(){return Q>=de.length?{done:!0}:{done:!1,value:de[Q++]}}}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 G={exports:{}};function B(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function V(de){G.exports.defaults=de}G.exports={defaults:B(),getDefaults:B,changeDefaults:V};var K=/[&<>"']/,F=/[&<>"']/g,i=/[<>"']|&(?!#?\w+;)/,U=/[<>"']|&(?!#?\w+;)/g,L={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},v=function(pe){return L[pe]};function E(de,pe){if(pe){if(K.test(de))return de.replace(F,v)}else if(i.test(de))return de.replace(U,v);return de}var b=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function w(de){return de.replace(b,function(pe,xe){return xe=xe.toLowerCase(),xe==="colon"?":":xe.charAt(0)==="#"?xe.charAt(1)==="x"?String.fromCharCode(parseInt(xe.substring(2),16)):String.fromCharCode(+xe.substring(1)):""})}var p=/(^|[^\[])\^/g;function y(de,pe){de=de.source||de,pe=pe||"";var xe={replace:function(ne,ce){return ce=ce.source||ce,ce=ce.replace(p,"$1"),de=de.replace(ne,ce),xe},getRegex:function(){return new RegExp(de,pe)}};return xe}var M=/[^\w:]/g,d=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function f(de,pe,xe){if(de){var Q;try{Q=decodeURIComponent(w(xe)).replace(M,"").toLowerCase()}catch(ne){return null}if(Q.indexOf("javascript:")===0||Q.indexOf("vbscript:")===0||Q.indexOf("data:")===0)return null}pe&&!d.test(xe)&&(xe=m(pe,xe));try{xe=encodeURI(xe).replace(/%25/g,"%")}catch(ne){return null}return xe}var u={},h=/^[^:]+:\/*[^/]*$/,S=/^([^:]+:)[\s\S]*$/,k=/^([^:]+:\/*[^/]*)[\s\S]*$/;function m(de,pe){u[" "+de]||(h.test(de)?u[" "+de]=de+"/":u[" "+de]=P(de,"/",!0)),de=u[" "+de];var xe=de.indexOf(":")===-1;return pe.substring(0,2)==="//"?xe?pe:de.replace(S,"$1")+pe:pe.charAt(0)==="/"?xe?pe:de.replace(k,"$1")+pe:de+pe}var A={exec:function(){}};function I(de){for(var pe=1,xe,Q;pe<arguments.length;pe++){xe=arguments[pe];for(Q in xe)Object.prototype.hasOwnProperty.call(xe,Q)&&(de[Q]=xe[Q])}return de}function C(de,pe){var xe=de.replace(/\|/g,function(ce,Ae,be){for(var Oe=!1,$e=Ae;--$e>=0&&be[$e]==="\\";)Oe=!Oe;return Oe?"|":" |"}),Q=xe.split(/ \|/),ne=0;if(Q.length>pe)Q.splice(pe);else for(;Q.length<pe;)Q.push("");for(;ne<Q.length;ne++)Q[ne]=Q[ne].trim().replace(/\\\|/g,"|");return Q}function P(de,pe,xe){var Q=de.length;if(Q===0)return"";for(var ne=0;ne<Q;){var ce=de.charAt(Q-ne-1);if(ce===pe&&!xe)ne++;else if(ce!==pe&&xe)ne++;else break}return de.substr(0,Q-ne)}function l(de,pe){if(de.indexOf(pe[1])===-1)return-1;for(var xe=de.length,Q=0,ne=0;ne<xe;ne++)if(de[ne]==="\\")ne++;else if(de[ne]===pe[0])Q++;else if(de[ne]===pe[1]&&(Q--,Q<0))return ne;return-1}function c(de){de&&de.sanitize&&!de.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function s(de,pe){if(pe<1)return"";for(var xe="";pe>1;)pe&1&&(xe+=de),pe>>=1,de+=de;return xe+de}var g={escape:E,unescape:w,edit:y,cleanUrl:f,resolveUrl:m,noopTest:A,merge:I,splitCells:C,rtrim:P,findClosingBracket:l,checkSanitizeDeprecation:c,repeatString:s},R=G.exports.defaults,D=g.rtrim,x=g.splitCells,T=g.escape,O=g.findClosingBracket;function $(de,pe,xe){var Q=pe.href,ne=pe.title?T(pe.title):null,ce=de[1].replace(/\\([\[\]])/g,"$1");return de[0].charAt(0)!=="!"?{type:"link",raw:xe,href:Q,title:ne,text:ce}:{type:"image",raw:xe,href:Q,title:ne,text:T(ce)}}function H(de,pe){var xe=de.match(/^(\s+)(?:```)/);if(xe===null)return pe;var Q=xe[1];return pe.split(`
`).map(function(ne){var ce=ne.match(/^\s+/);if(ce===null)return ne;var Ae=ce[0];return Ae.length>=Q.length?ne.slice(Q.length):ne}).join(`
`)}var Z=function(){function de(xe){this.options=xe||R}var pe=de.prototype;return pe.space=function(Q){var ne=this.rules.block.newline.exec(Q);if(ne)return ne[0].length>1?{type:"space",raw:ne[0]}:{raw:`
`}},pe.code=function(Q){var ne=this.rules.block.code.exec(Q);if(ne){var ce=ne[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:ne[0],codeBlockStyle:"indented",text:this.options.pedantic?ce:D(ce,`
`)}}},pe.fences=function(Q){var ne=this.rules.block.fences.exec(Q);if(ne){var ce=ne[0],Ae=H(ce,ne[3]||"");return{type:"code",raw:ce,lang:ne[2]?ne[2].trim():ne[2],text:Ae}}},pe.heading=function(Q){var ne=this.rules.block.heading.exec(Q);if(ne){var ce=ne[2].trim();if(/#$/.test(ce)){var Ae=D(ce,"#");(this.options.pedantic||!Ae||/ $/.test(Ae))&&(ce=Ae.trim())}return{type:"heading",raw:ne[0],depth:ne[1].length,text:ce}}},pe.nptable=function(Q){var ne=this.rules.block.nptable.exec(Q);if(ne){var ce={type:"table",header:x(ne[1].replace(/^ *| *\| *$/g,"")),align:ne[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ne[3]?ne[3].replace(/\n$/,"").split(`
`):[],raw:ne[0]};if(ce.header.length===ce.align.length){var Ae=ce.align.length,be;for(be=0;be<Ae;be++)/^ *-+: *$/.test(ce.align[be])?ce.align[be]="right":/^ *:-+: *$/.test(ce.align[be])?ce.align[be]="center":/^ *:-+ *$/.test(ce.align[be])?ce.align[be]="left":ce.align[be]=null;for(Ae=ce.cells.length,be=0;be<Ae;be++)ce.cells[be]=x(ce.cells[be],ce.header.length);return ce}}},pe.hr=function(Q){var ne=this.rules.block.hr.exec(Q);if(ne)return{type:"hr",raw:ne[0]}},pe.blockquote=function(Q){var ne=this.rules.block.blockquote.exec(Q);if(ne){var ce=ne[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ne[0],text:ce}}},pe.list=function(Q){var ne=this.rules.block.list.exec(Q);if(ne){var ce=ne[0],Ae=ne[2],be=Ae.length>1,Oe={type:"list",raw:ce,ordered:be,start:be?+Ae.slice(0,-1):"",loose:!1,items:[]},$e=ne[0].match(this.rules.block.item),mt=!1,Mt,Jt,jt,rt,Tt,ur,ir,cr,Ur,ar=$e.length;jt=this.rules.block.listItemStart.exec($e[0]);for(var Er=0;Er<ar;Er++){if(Mt=$e[Er],ce=Mt,this.options.pedantic||(Ur=Mt.match(new RegExp("\\n\\s*\\n {0,"+(jt[0].length-1)+"}\\S")),Ur&&(Tt=Mt.length-Ur.index+$e.slice(Er+1).join(`
`).length,Oe.raw=Oe.raw.substring(0,Oe.raw.length-Tt),Mt=Mt.substring(0,Ur.index),ce=Mt,ar=Er+1)),Er!==ar-1){if(rt=this.rules.block.listItemStart.exec($e[Er+1]),this.options.pedantic?rt[1].length>jt[1].length:rt[1].length>=jt[0].length||rt[1].length>3){$e.splice(Er,2,$e[Er]+(!this.options.pedantic&&rt[1].length<jt[0].length&&!$e[Er].match(/\n$/)?"":`
`)+$e[Er+1]),Er--,ar--;continue}else(!this.options.pedantic||this.options.smartLists?rt[2][rt[2].length-1]!==Ae[Ae.length-1]:be===(rt[2].length===1))&&(Tt=$e.slice(Er+1).join(`
`).length,Oe.raw=Oe.raw.substring(0,Oe.raw.length-Tt),Er=ar-1);jt=rt}Jt=Mt.length,Mt=Mt.replace(/^ *([*+-]|\d+[.)]) ?/,""),~Mt.indexOf(`
`)&&(Jt-=Mt.length,Mt=this.options.pedantic?Mt.replace(/^ {1,4}/gm,""):Mt.replace(new RegExp("^ {1,"+Jt+"}","gm"),"")),Mt=D(Mt,`
`),Er!==ar-1&&(ce=ce+`
`),ur=mt||/\n\n(?!\s*$)/.test(ce),Er!==ar-1&&(mt=ce.slice(-2)===`
`,ur||(ur=mt)),ur&&(Oe.loose=!0),this.options.gfm&&(ir=/^\[[ xX]\] /.test(Mt),cr=void 0,ir&&(cr=Mt[1]!==" ",Mt=Mt.replace(/^\[[ xX]\] +/,""))),Oe.items.push({type:"list_item",raw:ce,task:ir,checked:cr,loose:ur,text:Mt})}return Oe}},pe.html=function(Q){var ne=this.rules.block.html.exec(Q);if(ne)return{type:this.options.sanitize?"paragraph":"html",raw:ne[0],pre:!this.options.sanitizer&&(ne[1]==="pre"||ne[1]==="script"||ne[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ne[0]):T(ne[0]):ne[0]}},pe.def=function(Q){var ne=this.rules.block.def.exec(Q);if(ne){ne[3]&&(ne[3]=ne[3].substring(1,ne[3].length-1));var ce=ne[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:ce,raw:ne[0],href:ne[2],title:ne[3]}}},pe.table=function(Q){var ne=this.rules.block.table.exec(Q);if(ne){var ce={type:"table",header:x(ne[1].replace(/^ *| *\| *$/g,"")),align:ne[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ne[3]?ne[3].replace(/\n$/,"").split(`
`):[]};if(ce.header.length===ce.align.length){ce.raw=ne[0];var Ae=ce.align.length,be;for(be=0;be<Ae;be++)/^ *-+: *$/.test(ce.align[be])?ce.align[be]="right":/^ *:-+: *$/.test(ce.align[be])?ce.align[be]="center":/^ *:-+ *$/.test(ce.align[be])?ce.align[be]="left":ce.align[be]=null;for(Ae=ce.cells.length,be=0;be<Ae;be++)ce.cells[be]=x(ce.cells[be].replace(/^ *\| *| *\| *$/g,""),ce.header.length);return ce}}},pe.lheading=function(Q){var ne=this.rules.block.lheading.exec(Q);if(ne)return{type:"heading",raw:ne[0],depth:ne[2].charAt(0)==="="?1:2,text:ne[1]}},pe.paragraph=function(Q){var ne=this.rules.block.paragraph.exec(Q);if(ne)return{type:"paragraph",raw:ne[0],text:ne[1].charAt(ne[1].length-1)===`
`?ne[1].slice(0,-1):ne[1]}},pe.text=function(Q){var ne=this.rules.block.text.exec(Q);if(ne)return{type:"text",raw:ne[0],text:ne[0]}},pe.escape=function(Q){var ne=this.rules.inline.escape.exec(Q);if(ne)return{type:"escape",raw:ne[0],text:T(ne[1])}},pe.tag=function(Q,ne,ce){var Ae=this.rules.inline.tag.exec(Q);if(Ae)return!ne&&/^<a /i.test(Ae[0])?ne=!0:ne&&/^<\/a>/i.test(Ae[0])&&(ne=!1),!ce&&/^<(pre|code|kbd|script)(\s|>)/i.test(Ae[0])?ce=!0:ce&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Ae[0])&&(ce=!1),{type:this.options.sanitize?"text":"html",raw:Ae[0],inLink:ne,inRawBlock:ce,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ae[0]):T(Ae[0]):Ae[0]}},pe.link=function(Q){var ne=this.rules.inline.link.exec(Q);if(ne){var ce=ne[2].trim();if(!this.options.pedantic&&/^</.test(ce)){if(!/>$/.test(ce))return;var Ae=D(ce.slice(0,-1),"\\");if((ce.length-Ae.length)%2===0)return}else{var be=O(ne[2],"()");if(be>-1){var Oe=ne[0].indexOf("!")===0?5:4,$e=Oe+ne[1].length+be;ne[2]=ne[2].substring(0,be),ne[0]=ne[0].substring(0,$e).trim(),ne[3]=""}}var mt=ne[2],Mt="";if(this.options.pedantic){var Jt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(mt);Jt&&(mt=Jt[1],Mt=Jt[3])}else Mt=ne[3]?ne[3].slice(1,-1):"";return mt=mt.trim(),/^</.test(mt)&&(this.options.pedantic&&!/>$/.test(ce)?mt=mt.slice(1):mt=mt.slice(1,-1)),$(ne,{href:mt&&mt.replace(this.rules.inline._escapes,"$1"),title:Mt&&Mt.replace(this.rules.inline._escapes,"$1")},ne[0])}},pe.reflink=function(Q,ne){var ce;if((ce=this.rules.inline.reflink.exec(Q))||(ce=this.rules.inline.nolink.exec(Q))){var Ae=(ce[2]||ce[1]).replace(/\s+/g," ");if(Ae=ne[Ae.toLowerCase()],!Ae||!Ae.href){var be=ce[0].charAt(0);return{type:"text",raw:be,text:be}}return $(ce,Ae,ce[0])}},pe.emStrong=function(Q,ne,ce){ce===void 0&&(ce="");var Ae=this.rules.inline.emStrong.lDelim.exec(Q);if(Ae&&!(Ae[3]&&ce.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var be=Ae[1]||Ae[2]||"";if(!be||be&&(ce===""||this.rules.inline.punctuation.exec(ce))){var Oe=Ae[0].length-1,$e,mt,Mt=Oe,Jt=0,jt=Ae[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(jt.lastIndex=0,ne=ne.slice(-1*Q.length+Oe);(Ae=jt.exec(ne))!=null;)if($e=Ae[1]||Ae[2]||Ae[3]||Ae[4]||Ae[5]||Ae[6],!!$e){if(mt=$e.length,Ae[3]||Ae[4]){Mt+=mt;continue}else if((Ae[5]||Ae[6])&&Oe%3&&!((Oe+mt)%3)){Jt+=mt;continue}if(Mt-=mt,!(Mt>0))return mt=Math.min(mt,mt+Mt+Jt),Math.min(Oe,mt)%2?{type:"em",raw:Q.slice(0,Oe+Ae.index+mt+1),text:Q.slice(1,Oe+Ae.index+mt)}:{type:"strong",raw:Q.slice(0,Oe+Ae.index+mt+1),text:Q.slice(2,Oe+Ae.index+mt-1)}}}}},pe.codespan=function(Q){var ne=this.rules.inline.code.exec(Q);if(ne){var ce=ne[2].replace(/\n/g," "),Ae=/[^ ]/.test(ce),be=/^ /.test(ce)&&/ $/.test(ce);return Ae&&be&&(ce=ce.substring(1,ce.length-1)),ce=T(ce,!0),{type:"codespan",raw:ne[0],text:ce}}},pe.br=function(Q){var ne=this.rules.inline.br.exec(Q);if(ne)return{type:"br",raw:ne[0]}},pe.del=function(Q){var ne=this.rules.inline.del.exec(Q);if(ne)return{type:"del",raw:ne[0],text:ne[2]}},pe.autolink=function(Q,ne){var ce=this.rules.inline.autolink.exec(Q);if(ce){var Ae,be;return ce[2]==="@"?(Ae=T(this.options.mangle?ne(ce[1]):ce[1]),be="mailto:"+Ae):(Ae=T(ce[1]),be=Ae),{type:"link",raw:ce[0],text:Ae,href:be,tokens:[{type:"text",raw:Ae,text:Ae}]}}},pe.url=function(Q,ne){var ce;if(ce=this.rules.inline.url.exec(Q)){var Ae,be;if(ce[2]==="@")Ae=T(this.options.mangle?ne(ce[0]):ce[0]),be="mailto:"+Ae;else{var Oe;do Oe=ce[0],ce[0]=this.rules.inline._backpedal.exec(ce[0])[0];while(Oe!==ce[0]);Ae=T(ce[0]),ce[1]==="www."?be="http://"+Ae:be=Ae}return{type:"link",raw:ce[0],text:Ae,href:be,tokens:[{type:"text",raw:Ae,text:Ae}]}}},pe.inlineText=function(Q,ne,ce){var Ae=this.rules.inline.text.exec(Q);if(Ae){var be;return ne?be=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ae[0]):T(Ae[0]):Ae[0]:be=T(this.options.smartypants?ce(Ae[0]):Ae[0]),{type:"text",raw:Ae[0],text:be}}},de}(),te=g.noopTest,J=g.edit,ie=g.merge,oe={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:te,table:te,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/};oe._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,oe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,oe.def=J(oe.def).replace("label",oe._label).replace("title",oe._title).getRegex(),oe.bullet=/(?:[*+-]|\d{1,9}[.)])/,oe.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,oe.item=J(oe.item,"gm").replace(/bull/g,oe.bullet).getRegex(),oe.listItemStart=J(/^( *)(bull) */).replace("bull",oe.bullet).getRegex(),oe.list=J(oe.list).replace(/bull/g,oe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+oe.def.source+")").getRegex(),oe._tag="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",oe._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,oe.html=J(oe.html,"i").replace("comment",oe._comment).replace("tag",oe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),oe.paragraph=J(oe._paragraph).replace("hr",oe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",oe._tag).getRegex(),oe.blockquote=J(oe.blockquote).replace("paragraph",oe.paragraph).getRegex(),oe.normal=ie({},oe),oe.gfm=ie({},oe.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),oe.gfm.nptable=J(oe.gfm.nptable).replace("hr",oe.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",oe._tag).getRegex(),oe.gfm.table=J(oe.gfm.table).replace("hr",oe.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",oe._tag).getRegex(),oe.pedantic=ie({},oe.normal,{html:J(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",oe._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:te,paragraph:J(oe.normal._paragraph).replace("hr",oe.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",oe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ue={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:te,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:te,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};ue._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ue.punctuation=J(ue.punctuation).replace(/punctuation/g,ue._punctuation).getRegex(),ue.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,ue.escapedEmSt=/\\\*|\\_/g,ue._comment=J(oe._comment).replace("(?:-->|$)","-->").getRegex(),ue.emStrong.lDelim=J(ue.emStrong.lDelim).replace(/punct/g,ue._punctuation).getRegex(),ue.emStrong.rDelimAst=J(ue.emStrong.rDelimAst,"g").replace(/punct/g,ue._punctuation).getRegex(),ue.emStrong.rDelimUnd=J(ue.emStrong.rDelimUnd,"g").replace(/punct/g,ue._punctuation).getRegex(),ue._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ue._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ue._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,ue.autolink=J(ue.autolink).replace("scheme",ue._scheme).replace("email",ue._email).getRegex(),ue._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ue.tag=J(ue.tag).replace("comment",ue._comment).replace("attribute",ue._attribute).getRegex(),ue._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ue._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,ue._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ue.link=J(ue.link).replace("label",ue._label).replace("href",ue._href).replace("title",ue._title).getRegex(),ue.reflink=J(ue.reflink).replace("label",ue._label).getRegex(),ue.reflinkSearch=J(ue.reflinkSearch,"g").replace("reflink",ue.reflink).replace("nolink",ue.nolink).getRegex(),ue.normal=ie({},ue),ue.pedantic=ie({},ue.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:J(/^!?\[(label)\]\((.*?)\)/).replace("label",ue._label).getRegex(),reflink:J(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ue._label).getRegex()}),ue.gfm=ie({},ue.normal,{escape:J(ue.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),ue.gfm.url=J(ue.gfm.url,"i").replace("email",ue.gfm._extended_email).getRegex(),ue.breaks=ie({},ue.gfm,{br:J(ue.br).replace("{2,}","*").getRegex(),text:J(ue.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Pe={block:oe,inline:ue},Ne=Z,Ve=G.exports.defaults,ot=Pe.block,Et=Pe.inline,it=g.repeatString;function Ie(de){return de.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function He(de){var pe="",xe,Q,ne=de.length;for(xe=0;xe<ne;xe++)Q=de.charCodeAt(xe),Math.random()>.5&&(Q="x"+Q.toString(16)),pe+="&#"+Q+";";return pe}var ht=function(){function de(xe){this.tokens=[],this.tokens.links=Object.create(null),this.options=xe||Ve,this.options.tokenizer=this.options.tokenizer||new Ne,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var Q={block:ot.normal,inline:Et.normal};this.options.pedantic?(Q.block=ot.pedantic,Q.inline=Et.pedantic):this.options.gfm&&(Q.block=ot.gfm,this.options.breaks?Q.inline=Et.breaks:Q.inline=Et.gfm),this.tokenizer.rules=Q}de.lex=function(Q,ne){var ce=new de(ne);return ce.lex(Q)},de.lexInline=function(Q,ne){var ce=new de(ne);return ce.inlineTokens(Q)};var pe=de.prototype;return pe.lex=function(Q){return Q=Q.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(Q,this.tokens,!0),this.inline(this.tokens),this.tokens},pe.blockTokens=function(Q,ne,ce){var Ae=this;ne===void 0&&(ne=[]),ce===void 0&&(ce=!0),this.options.pedantic&&(Q=Q.replace(/^ +$/gm,""));for(var be,Oe,$e,mt,Mt,Jt;Q;){var jt,rt,Tt;if(!((jt=this.options)!=null&&(rt=jt.extensions)!=null&&rt.block&&this.options.extensions.block.some(function(ir){return(be=ir.call(Ae,Q,ne))?(Q=Q.substring(be.raw.length),ne.push(be),!0):!1}))){if(be=this.tokenizer.space(Q)){Q=Q.substring(be.raw.length),be.type&&ne.push(be);continue}if(be=this.tokenizer.code(Q)){Q=Q.substring(be.raw.length),mt=ne[ne.length-1],mt&&mt.type==="paragraph"?(mt.raw+=`
`+be.raw,mt.text+=`
`+be.text):ne.push(be);continue}if(be=this.tokenizer.fences(Q)){Q=Q.substring(be.raw.length),ne.push(be);continue}if(be=this.tokenizer.heading(Q)){Q=Q.substring(be.raw.length),ne.push(be);continue}if(be=this.tokenizer.nptable(Q)){Q=Q.substring(be.raw.length),ne.push(be);continue}if(be=this.tokenizer.hr(Q)){Q=Q.substring(be.raw.length),ne.push(be);continue}if(be=this.tokenizer.blockquote(Q)){Q=Q.substring(be.raw.length),be.tokens=this.blockTokens(be.text,[],ce),ne.push(be);continue}if(be=this.tokenizer.list(Q)){for(Q=Q.substring(be.raw.length),$e=be.items.length,Oe=0;Oe<$e;Oe++)be.items[Oe].tokens=this.blockTokens(be.items[Oe].text,[],!1);ne.push(be);continue}if(be=this.tokenizer.html(Q)){Q=Q.substring(be.raw.length),ne.push(be);continue}if(ce&&(be=this.tokenizer.def(Q))){Q=Q.substring(be.raw.length),this.tokens.links[be.tag]||(this.tokens.links[be.tag]={href:be.href,title:be.title});continue}if(be=this.tokenizer.table(Q)){Q=Q.substring(be.raw.length),ne.push(be);continue}if(be=this.tokenizer.lheading(Q)){Q=Q.substring(be.raw.length),ne.push(be);continue}if(Mt=Q,(Tt=this.options.extensions)!=null&&Tt.startBlock&&function(){var ir=1/0,cr=Q.slice(1),Ur=void 0;Ae.options.extensions.startBlock.forEach(function(ar){Ur=ar.call(this,cr),typeof Ur=="number"&&Ur>=0&&(ir=Math.min(ir,Ur))}),ir<1/0&&ir>=0&&(Mt=Q.substring(0,ir+1))}(),ce&&(be=this.tokenizer.paragraph(Mt))){mt=ne[ne.length-1],Jt&&mt.type==="paragraph"?(mt.raw+=`
`+be.raw,mt.text+=`
`+be.text):ne.push(be),Jt=Mt.length!==Q.length,Q=Q.substring(be.raw.length);continue}if(be=this.tokenizer.text(Q)){Q=Q.substring(be.raw.length),mt=ne[ne.length-1],mt&&mt.type==="text"?(mt.raw+=`
`+be.raw,mt.text+=`
`+be.text):ne.push(be);continue}if(Q){var ur="Infinite loop on byte: "+Q.charCodeAt(0);if(this.options.silent){console.error(ur);break}else throw new Error(ur)}}}return ne},pe.inline=function(Q){var ne,ce,Ae,be,Oe,$e,mt=Q.length;for(ne=0;ne<mt;ne++)switch($e=Q[ne],$e.type){case"paragraph":case"text":case"heading":{$e.tokens=[],this.inlineTokens($e.text,$e.tokens);break}case"table":{for($e.tokens={header:[],cells:[]},be=$e.header.length,ce=0;ce<be;ce++)$e.tokens.header[ce]=[],this.inlineTokens($e.header[ce],$e.tokens.header[ce]);for(be=$e.cells.length,ce=0;ce<be;ce++)for(Oe=$e.cells[ce],$e.tokens.cells[ce]=[],Ae=0;Ae<Oe.length;Ae++)$e.tokens.cells[ce][Ae]=[],this.inlineTokens(Oe[Ae],$e.tokens.cells[ce][Ae]);break}case"blockquote":{this.inline($e.tokens);break}case"list":{for(be=$e.items.length,ce=0;ce<be;ce++)this.inline($e.items[ce].tokens);break}}return Q},pe.inlineTokens=function(Q,ne,ce,Ae){var be=this;ne===void 0&&(ne=[]),ce===void 0&&(ce=!1),Ae===void 0&&(Ae=!1);var Oe,$e,mt,Mt=Q,Jt,jt,rt;if(this.tokens.links){var Tt=Object.keys(this.tokens.links);if(Tt.length>0)for(;(Jt=this.tokenizer.rules.inline.reflinkSearch.exec(Mt))!=null;)Tt.includes(Jt[0].slice(Jt[0].lastIndexOf("[")+1,-1))&&(Mt=Mt.slice(0,Jt.index)+"["+it("a",Jt[0].length-2)+"]"+Mt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Jt=this.tokenizer.rules.inline.blockSkip.exec(Mt))!=null;)Mt=Mt.slice(0,Jt.index)+"["+it("a",Jt[0].length-2)+"]"+Mt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(Jt=this.tokenizer.rules.inline.escapedEmSt.exec(Mt))!=null;)Mt=Mt.slice(0,Jt.index)+"++"+Mt.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;Q;){var ur,ir,cr;if(jt||(rt=""),jt=!1,!((ur=this.options)!=null&&(ir=ur.extensions)!=null&&ir.inline&&this.options.extensions.inline.some(function(ar){return(Oe=ar.call(be,Q,ne))?(Q=Q.substring(Oe.raw.length),ne.push(Oe),!0):!1}))){if(Oe=this.tokenizer.escape(Q)){Q=Q.substring(Oe.raw.length),ne.push(Oe);continue}if(Oe=this.tokenizer.tag(Q,ce,Ae)){Q=Q.substring(Oe.raw.length),ce=Oe.inLink,Ae=Oe.inRawBlock,$e=ne[ne.length-1],$e&&Oe.type==="text"&&$e.type==="text"?($e.raw+=Oe.raw,$e.text+=Oe.text):ne.push(Oe);continue}if(Oe=this.tokenizer.link(Q)){Q=Q.substring(Oe.raw.length),Oe.type==="link"&&(Oe.tokens=this.inlineTokens(Oe.text,[],!0,Ae)),ne.push(Oe);continue}if(Oe=this.tokenizer.reflink(Q,this.tokens.links)){Q=Q.substring(Oe.raw.length),$e=ne[ne.length-1],Oe.type==="link"?(Oe.tokens=this.inlineTokens(Oe.text,[],!0,Ae),ne.push(Oe)):$e&&Oe.type==="text"&&$e.type==="text"?($e.raw+=Oe.raw,$e.text+=Oe.text):ne.push(Oe);continue}if(Oe=this.tokenizer.emStrong(Q,Mt,rt)){Q=Q.substring(Oe.raw.length),Oe.tokens=this.inlineTokens(Oe.text,[],ce,Ae),ne.push(Oe);continue}if(Oe=this.tokenizer.codespan(Q)){Q=Q.substring(Oe.raw.length),ne.push(Oe);continue}if(Oe=this.tokenizer.br(Q)){Q=Q.substring(Oe.raw.length),ne.push(Oe);continue}if(Oe=this.tokenizer.del(Q)){Q=Q.substring(Oe.raw.length),Oe.tokens=this.inlineTokens(Oe.text,[],ce,Ae),ne.push(Oe);continue}if(Oe=this.tokenizer.autolink(Q,He)){Q=Q.substring(Oe.raw.length),ne.push(Oe);continue}if(!ce&&(Oe=this.tokenizer.url(Q,He))){Q=Q.substring(Oe.raw.length),ne.push(Oe);continue}if(mt=Q,(cr=this.options.extensions)!=null&&cr.startInline&&function(){var ar=1/0,Er=Q.slice(1),Yr=void 0;be.options.extensions.startInline.forEach(function(Hn){Yr=Hn.call(this,Er),typeof Yr=="number"&&Yr>=0&&(ar=Math.min(ar,Yr))}),ar<1/0&&ar>=0&&(mt=Q.substring(0,ar+1))}(),Oe=this.tokenizer.inlineText(mt,Ae,Ie)){Q=Q.substring(Oe.raw.length),Oe.raw.slice(-1)!=="_"&&(rt=Oe.raw.slice(-1)),jt=!0,$e=ne[ne.length-1],$e&&$e.type==="text"?($e.raw+=Oe.raw,$e.text+=Oe.text):ne.push(Oe);continue}if(Q){var Ur="Infinite loop on byte: "+Q.charCodeAt(0);if(this.options.silent){console.error(Ur);break}else throw new Error(Ur)}}}return ne},q(de,null,[{key:"rules",get:function(){return{block:ot,inline:Et}}}]),de}(),ft=G.exports.defaults,dt=g.cleanUrl,se=g.escape,De=function(){function de(xe){this.options=xe||ft}var pe=de.prototype;return pe.code=function(Q,ne,ce){var Ae=(ne||"").match(/\S*/)[0];if(this.options.highlight){var be=this.options.highlight(Q,Ae);be!=null&&be!==Q&&(ce=!0,Q=be)}return Q=Q.replace(/\n$/,"")+`
`,Ae?'<pre><code class="'+this.options.langPrefix+se(Ae,!0)+'">'+(ce?Q:se(Q,!0))+`</code></pre>
`:"<pre><code>"+(ce?Q:se(Q,!0))+`</code></pre>
`},pe.blockquote=function(Q){return`<blockquote>
`+Q+`</blockquote>
`},pe.html=function(Q){return Q},pe.heading=function(Q,ne,ce,Ae){return this.options.headerIds?"<h"+ne+' id="'+this.options.headerPrefix+Ae.slug(ce)+'">'+Q+"</h"+ne+`>
`:"<h"+ne+">"+Q+"</h"+ne+`>
`},pe.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},pe.list=function(Q,ne,ce){var Ae=ne?"ol":"ul",be=ne&&ce!==1?' start="'+ce+'"':"";return"<"+Ae+be+`>
`+Q+"</"+Ae+`>
`},pe.listitem=function(Q){return"<li>"+Q+`</li>
`},pe.checkbox=function(Q){return"<input "+(Q?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},pe.paragraph=function(Q){return"<p>"+Q+`</p>
`},pe.table=function(Q,ne){return ne&&(ne="<tbody>"+ne+"</tbody>"),`<table>
<thead>
`+Q+`</thead>
`+ne+`</table>
`},pe.tablerow=function(Q){return`<tr>
`+Q+`</tr>
`},pe.tablecell=function(Q,ne){var ce=ne.header?"th":"td",Ae=ne.align?"<"+ce+' align="'+ne.align+'">':"<"+ce+">";return Ae+Q+"</"+ce+`>
`},pe.strong=function(Q){return"<strong>"+Q+"</strong>"},pe.em=function(Q){return"<em>"+Q+"</em>"},pe.codespan=function(Q){return"<code>"+Q+"</code>"},pe.br=function(){return this.options.xhtml?"<br/>":"<br>"},pe.del=function(Q){return"<del>"+Q+"</del>"},pe.link=function(Q,ne,ce){if(Q=dt(this.options.sanitize,this.options.baseUrl,Q),Q===null)return ce;var Ae='<a href="'+se(Q)+'"';return ne&&(Ae+=' title="'+ne+'"'),Ae+=">"+ce+"</a>",Ae},pe.image=function(Q,ne,ce){if(Q=dt(this.options.sanitize,this.options.baseUrl,Q),Q===null)return ce;var Ae='<img src="'+Q+'" alt="'+ce+'"';return ne&&(Ae+=' title="'+ne+'"'),Ae+=this.options.xhtml?"/>":">",Ae},pe.text=function(Q){return Q},de}(),ze=function(){function de(){}var pe=de.prototype;return pe.strong=function(Q){return Q},pe.em=function(Q){return Q},pe.codespan=function(Q){return Q},pe.del=function(Q){return Q},pe.html=function(Q){return Q},pe.text=function(Q){return Q},pe.link=function(Q,ne,ce){return""+ce},pe.image=function(Q,ne,ce){return""+ce},pe.br=function(){return""},de}(),Ge=function(){function de(){this.seen={}}var pe=de.prototype;return pe.serialize=function(Q){return Q.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},pe.getNextSafeSlug=function(Q,ne){var ce=Q,Ae=0;if(this.seen.hasOwnProperty(ce)){Ae=this.seen[Q];do Ae++,ce=Q+"-"+Ae;while(this.seen.hasOwnProperty(ce))}return ne||(this.seen[Q]=Ae,this.seen[ce]=0),ce},pe.slug=function(Q,ne){ne===void 0&&(ne={});var ce=this.serialize(Q);return this.getNextSafeSlug(ce,ne.dryrun)},de}(),qe=De,vt=ze,Ut=Ge,bt=G.exports.defaults,ke=g.unescape,lt=function(){function de(xe){this.options=xe||bt,this.options.renderer=this.options.renderer||new qe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new vt,this.slugger=new Ut}de.parse=function(Q,ne){var ce=new de(ne);return ce.parse(Q)},de.parseInline=function(Q,ne){var ce=new de(ne);return ce.parseInline(Q)};var pe=de.prototype;return pe.parse=function(Q,ne){ne===void 0&&(ne=!0);var ce="",Ae,be,Oe,$e,mt,Mt,Jt,jt,rt,Tt,ur,ir,cr,Ur,ar,Er,Yr,Hn,Mn,ei=Q.length;for(Ae=0;Ae<ei;Ae++){var mi,ti;if(Tt=Q[Ae],(mi=this.options.extensions)!=null&&(ti=mi.renderers)!=null&&ti[Tt.type]&&(Mn=this.options.extensions.renderers[Tt.type].call(this,Tt),Mn!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(Tt.type))){ce+=Mn||"";continue}switch(Tt.type){case"space":continue;case"hr":{ce+=this.renderer.hr();continue}case"heading":{ce+=this.renderer.heading(this.parseInline(Tt.tokens),Tt.depth,ke(this.parseInline(Tt.tokens,this.textRenderer)),this.slugger);continue}case"code":{ce+=this.renderer.code(Tt.text,Tt.lang,Tt.escaped);continue}case"table":{for(jt="",Jt="",$e=Tt.header.length,be=0;be<$e;be++)Jt+=this.renderer.tablecell(this.parseInline(Tt.tokens.header[be]),{header:!0,align:Tt.align[be]});for(jt+=this.renderer.tablerow(Jt),rt="",$e=Tt.cells.length,be=0;be<$e;be++){for(Mt=Tt.tokens.cells[be],Jt="",mt=Mt.length,Oe=0;Oe<mt;Oe++)Jt+=this.renderer.tablecell(this.parseInline(Mt[Oe]),{header:!1,align:Tt.align[Oe]});rt+=this.renderer.tablerow(Jt)}ce+=this.renderer.table(jt,rt);continue}case"blockquote":{rt=this.parse(Tt.tokens),ce+=this.renderer.blockquote(rt);continue}case"list":{for(ur=Tt.ordered,ir=Tt.start,cr=Tt.loose,$e=Tt.items.length,rt="",be=0;be<$e;be++)ar=Tt.items[be],Er=ar.checked,Yr=ar.task,Ur="",ar.task&&(Hn=this.renderer.checkbox(Er),cr?ar.tokens.length>0&&ar.tokens[0].type==="text"?(ar.tokens[0].text=Hn+" "+ar.tokens[0].text,ar.tokens[0].tokens&&ar.tokens[0].tokens.length>0&&ar.tokens[0].tokens[0].type==="text"&&(ar.tokens[0].tokens[0].text=Hn+" "+ar.tokens[0].tokens[0].text)):ar.tokens.unshift({type:"text",text:Hn}):Ur+=Hn),Ur+=this.parse(ar.tokens,cr),rt+=this.renderer.listitem(Ur,Yr,Er);ce+=this.renderer.list(rt,ur,ir);continue}case"html":{ce+=this.renderer.html(Tt.text);continue}case"paragraph":{ce+=this.renderer.paragraph(this.parseInline(Tt.tokens));continue}case"text":{for(rt=Tt.tokens?this.parseInline(Tt.tokens):Tt.text;Ae+1<ei&&Q[Ae+1].type==="text";)Tt=Q[++Ae],rt+=`
`+(Tt.tokens?this.parseInline(Tt.tokens):Tt.text);ce+=ne?this.renderer.paragraph(rt):rt;continue}default:{var en='Token with "'+Tt.type+'" type was not found.';if(this.options.silent){console.error(en);return}else throw new Error(en)}}}return ce},pe.parseInline=function(Q,ne){ne=ne||this.renderer;var ce="",Ae,be,Oe,$e=Q.length;for(Ae=0;Ae<$e;Ae++){var mt,Mt;if(be=Q[Ae],(mt=this.options.extensions)!=null&&(Mt=mt.renderers)!=null&&Mt[be.type]&&(Oe=this.options.extensions.renderers[be.type].call(this,be),Oe!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(be.type))){ce+=Oe||"";continue}switch(be.type){case"escape":{ce+=ne.text(be.text);break}case"html":{ce+=ne.html(be.text);break}case"link":{ce+=ne.link(be.href,be.title,this.parseInline(be.tokens,ne));break}case"image":{ce+=ne.image(be.href,be.title,be.text);break}case"strong":{ce+=ne.strong(this.parseInline(be.tokens,ne));break}case"em":{ce+=ne.em(this.parseInline(be.tokens,ne));break}case"codespan":{ce+=ne.codespan(be.text);break}case"br":{ce+=ne.br();break}case"del":{ce+=ne.del(this.parseInline(be.tokens,ne));break}case"text":{ce+=ne.text(be.text);break}default:{var Jt='Token with "'+be.type+'" type was not found.';if(this.options.silent){console.error(Jt);return}else throw new Error(Jt)}}}return ce},de}(),$t=ht,tt=lt,Ze=Z,Je=De,pt=ze,je=Ge,_t=g.merge,xt=g.checkSanitizeDeprecation,Kt=g.escape,Bt=G.exports.getDefaults,Rt=G.exports.changeDefaults,Se=G.exports.defaults;function fe(de,pe,xe){if(typeof de=="undefined"||de===null)throw new Error("marked(): input parameter is undefined or null");if(typeof de!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(de)+", string expected");if(typeof pe=="function"&&(xe=pe,pe=null),pe=_t({},fe.defaults,pe||{}),xt(pe),xe){var Q=pe.highlight,ne;try{ne=$t.lex(de,pe)}catch(Oe){return xe(Oe)}var ce=function($e){var mt;if(!$e)try{pe.walkTokens&&fe.walkTokens(ne,pe.walkTokens),mt=tt.parse(ne,pe)}catch(Mt){$e=Mt}return pe.highlight=Q,$e?xe($e):xe(null,mt)};if(!Q||Q.length<3||(delete pe.highlight,!ne.length))return ce();var Ae=0;fe.walkTokens(ne,function(Oe){Oe.type==="code"&&(Ae++,setTimeout(function(){Q(Oe.text,Oe.lang,function($e,mt){if($e)return ce($e);mt!=null&&mt!==Oe.text&&(Oe.text=mt,Oe.escaped=!0),Ae--,Ae===0&&ce()})},0))}),Ae===0&&ce();return}try{var be=$t.lex(de,pe);return pe.walkTokens&&fe.walkTokens(be,pe.walkTokens),tt.parse(be,pe)}catch(Oe){if(Oe.message+=`
Please report this to https://github.com/markedjs/marked.`,pe.silent)return"<p>An error occurred:</p><pre>"+Kt(Oe.message+"",!0)+"</pre>";throw Oe}}fe.options=fe.setOptions=function(de){return _t(fe.defaults,de),Rt(fe.defaults),fe},fe.getDefaults=Bt,fe.defaults=Se,fe.use=function(){for(var de=this,pe=arguments.length,xe=new Array(pe),Q=0;Q<pe;Q++)xe[Q]=arguments[Q];var ne=_t.apply(void 0,[{}].concat(xe)),ce=fe.defaults.extensions||{renderers:{},childTokens:{}},Ae;xe.forEach(function(be){if(be.extensions&&(Ae=!0,be.extensions.forEach(function($e){if(!$e.name)throw new Error("extension name required");if($e.renderer){var mt,Mt=(mt=ce.renderers)==null?void 0:mt[$e.name];Mt?ce.renderers[$e.name]=function(){for(var Jt=arguments.length,jt=new Array(Jt),rt=0;rt<Jt;rt++)jt[rt]=arguments[rt];var Tt=$e.renderer.apply(this,jt);return Tt===!1&&(Tt=Mt.apply(this,jt)),Tt}:ce.renderers[$e.name]=$e.renderer}if($e.tokenizer){if(!$e.level||$e.level!=="block"&&$e.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");ce[$e.level]?ce[$e.level].unshift($e.tokenizer):ce[$e.level]=[$e.tokenizer],$e.start&&($e.level==="block"?ce.startBlock?ce.startBlock.push($e.start):ce.startBlock=[$e.start]:$e.level==="inline"&&(ce.startInline?ce.startInline.push($e.start):ce.startInline=[$e.start]))}$e.childTokens&&(ce.childTokens[$e.name]=$e.childTokens)})),be.renderer&&function(){var $e=fe.defaults.renderer||new Je,mt=function(jt){var rt=$e[jt];$e[jt]=function(){for(var Tt=arguments.length,ur=new Array(Tt),ir=0;ir<Tt;ir++)ur[ir]=arguments[ir];var cr=be.renderer[jt].apply($e,ur);return cr===!1&&(cr=rt.apply($e,ur)),cr}};for(var Mt in be.renderer)mt(Mt);ne.renderer=$e}(),be.tokenizer&&function(){var $e=fe.defaults.tokenizer||new Ze,mt=function(jt){var rt=$e[jt];$e[jt]=function(){for(var Tt=arguments.length,ur=new Array(Tt),ir=0;ir<Tt;ir++)ur[ir]=arguments[ir];var cr=be.tokenizer[jt].apply($e,ur);return cr===!1&&(cr=rt.apply($e,ur)),cr}};for(var Mt in be.tokenizer)mt(Mt);ne.tokenizer=$e}(),be.walkTokens){var Oe=fe.defaults.walkTokens;ne.walkTokens=function($e){be.walkTokens.call(de,$e),Oe&&Oe($e)}}Ae&&(ne.extensions=ce),fe.setOptions(ne)})},fe.walkTokens=function(de,pe){for(var xe=function(){var Ae=ne.value;switch(pe(Ae),Ae.type){case"table":{for(var be=le(Ae.tokens.header),Oe;!(Oe=be()).done;){var $e=Oe.value;fe.walkTokens($e,pe)}for(var mt=le(Ae.tokens.cells),Mt;!(Mt=mt()).done;)for(var Jt=Mt.value,jt=le(Jt),rt;!(rt=jt()).done;){var Tt=rt.value;fe.walkTokens(Tt,pe)}break}case"list":{fe.walkTokens(Ae.items,pe);break}default:{var ur,ir,cr,Ur,ar;if((ur=fe.defaults)!=null&&(ir=ur.extensions)!=null&&(cr=ir.childTokens)!=null&&cr[Ae.type]){var Er;(Er=fe.defaults)==null||Er.extensions.childTokens[Ae.type].forEach(function(Yr){fe.walkTokens(Ae[Yr],pe)})}Ae.tokens&&!((Ur=fe.defaults)!=null&&(ar=Ur.extensions)!=null&&ar.childTokens[Ae.type])&&fe.walkTokens(Ae.tokens,pe)}}},Q=le(de),ne;!(ne=Q()).done;)xe()},fe.parseInline=function(de,pe){if(typeof de=="undefined"||de===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof de!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(de)+", string expected");pe=_t({},fe.defaults,pe||{}),xt(pe);try{var xe=$t.lexInline(de,pe);return pe.walkTokens&&fe.walkTokens(xe,pe.walkTokens),tt.parseInline(xe,pe)}catch(Q){if(Q.message+=`
Please report this to https://github.com/markedjs/marked.`,pe.silent)return"<p>An error occurred:</p><pre>"+Kt(Q.message+"",!0)+"</pre>";throw Q}},fe.Parser=tt,fe.parser=tt.parse,fe.Renderer=Je,fe.TextRenderer=pt,fe.Lexer=$t,fe.lexer=$t.lex,fe.Tokenizer=Ze,fe.Slugger=je,fe.parse=fe;var Ce=fe;return Ce})},90621:function(Ht){const at=/[&<>"']/,q=/[&<>"']/g,me=/[<>"']|&(?!#?\w+;)/,ge=/[<>"']|&(?!#?\w+;)/g,le={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},G=m=>le[m];function B(m,A){if(A){if(at.test(m))return m.replace(q,G)}else if(me.test(m))return m.replace(ge,G);return m}const V=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function K(m){return m.replace(V,(A,I)=>(I=I.toLowerCase(),I==="colon"?":":I.charAt(0)==="#"?I.charAt(1)==="x"?String.fromCharCode(parseInt(I.substring(2),16)):String.fromCharCode(+I.substring(1)):""))}const F=/(^|[^\[])\^/g;function i(m,A){m=m.source||m,A=A||"";const I={replace:(C,P)=>(P=P.source||P,P=P.replace(F,"$1"),m=m.replace(C,P),I),getRegex:()=>new RegExp(m,A)};return I}const U=/[^\w:]/g,L=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function v(m,A,I){if(m){let C;try{C=decodeURIComponent(K(I)).replace(U,"").toLowerCase()}catch(P){return null}if(C.indexOf("javascript:")===0||C.indexOf("vbscript:")===0||C.indexOf("data:")===0)return null}A&&!L.test(I)&&(I=y(A,I));try{I=encodeURI(I).replace(/%25/g,"%")}catch(C){return null}return I}const E={},b=/^[^:]+:\/*[^/]*$/,w=/^([^:]+:)[\s\S]*$/,p=/^([^:]+:\/*[^/]*)[\s\S]*$/;function y(m,A){E[" "+m]||(b.test(m)?E[" "+m]=m+"/":E[" "+m]=u(m,"/",!0)),m=E[" "+m];const I=m.indexOf(":")===-1;return A.substring(0,2)==="//"?I?A:m.replace(w,"$1")+A:A.charAt(0)==="/"?I?A:m.replace(p,"$1")+A:m+A}const M={exec:function(){}};function d(m){let A=1,I,C;for(;A<arguments.length;A++){I=arguments[A];for(C in I)Object.prototype.hasOwnProperty.call(I,C)&&(m[C]=I[C])}return m}function f(m,A){const I=m.replace(/\|/g,(l,c,s)=>{let g=!1,R=c;for(;--R>=0&&s[R]==="\\";)g=!g;return g?"|":" |"}),C=I.split(/ \|/);let P=0;if(C.length>A)C.splice(A);else for(;C.length<A;)C.push("");for(;P<C.length;P++)C[P]=C[P].trim().replace(/\\\|/g,"|");return C}function u(m,A,I){const C=m.length;if(C===0)return"";let P=0;for(;P<C;){const l=m.charAt(C-P-1);if(l===A&&!I)P++;else if(l!==A&&I)P++;else break}return m.substr(0,C-P)}function h(m,A){if(m.indexOf(A[1])===-1)return-1;const I=m.length;let C=0,P=0;for(;P<I;P++)if(m[P]==="\\")P++;else if(m[P]===A[0])C++;else if(m[P]===A[1]&&(C--,C<0))return P;return-1}function S(m){m&&m.sanitize&&!m.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function k(m,A){if(A<1)return"";let I="";for(;A>1;)A&1&&(I+=m),A>>=1,m+=m;return I+m}Ht.exports={escape:B,unescape:K,edit:i,cleanUrl:v,resolveUrl:y,noopTest:M,merge:d,splitCells:f,rtrim:u,findClosingBracket:h,checkSanitizeDeprecation:S,repeatString:k}},74741:function(Ht,at,q){"use strict";q.d(at,{Wi:function(){return V},Z0:function(){return K},aU:function(){return B},eZ:function(){return i},wY:function(){return F}});var me=q(4669),ge=q(9917),le=q(63580),G=function(U,L,v,E){function b(w){return w instanceof v?w:new v(function(p){p(w)})}return new(v||(v=Promise))(function(w,p){function y(f){try{d(E.next(f))}catch(u){p(u)}}function M(f){try{d(E.throw(f))}catch(u){p(u)}}function d(f){f.done?w(f.value):b(f.value).then(y,M)}d((E=E.apply(U,L||[])).next())})};class B extends ge.JT{constructor(L,v="",E="",b=!0,w){super(),this._onDidChange=this._register(new me.Q5),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=L,this._label=v,this._cssClass=E,this._enabled=b,this._actionCallback=w}get id(){return this._id}get label(){return this._label}set label(L){this._setLabel(L)}_setLabel(L){this._label!==L&&(this._label=L,this._onDidChange.fire({label:L}))}get tooltip(){return this._tooltip||""}set tooltip(L){this._setTooltip(L)}_setTooltip(L){this._tooltip!==L&&(this._tooltip=L,this._onDidChange.fire({tooltip:L}))}get class(){return this._cssClass}set class(L){this._setClass(L)}_setClass(L){this._cssClass!==L&&(this._cssClass=L,this._onDidChange.fire({class:L}))}get enabled(){return this._enabled}set enabled(L){this._setEnabled(L)}_setEnabled(L){this._enabled!==L&&(this._enabled=L,this._onDidChange.fire({enabled:L}))}get checked(){return this._checked}set checked(L){this._setChecked(L)}_setChecked(L){this._checked!==L&&(this._checked=L,this._onDidChange.fire({checked:L}))}run(L,v){return G(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(L))})}}class V extends ge.JT{constructor(){super(...arguments),this._onBeforeRun=this._register(new me.Q5),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new me.Q5),this.onDidRun=this._onDidRun.event}run(L,v){return G(this,void 0,void 0,function*(){if(!L.enabled)return;this._onBeforeRun.fire({action:L});let E;try{yield this.runAction(L,v)}catch(b){E=b}this._onDidRun.fire({action:L,error:E})})}runAction(L,v){return G(this,void 0,void 0,function*(){yield L.run(v)})}}class K extends B{constructor(L){super(K.ID,L,L?"separator text":"separator"),this.checked=!1,this.enabled=!1}}K.ID="vs.actions.separator";class F{constructor(L,v,E,b){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=L,this.label=v,this.class=b,this._actions=E}get actions(){return this._actions}dispose(){}run(){return G(this,void 0,void 0,function*(){})}}class i extends B{constructor(){super(i.ID,le.N("submenu.empty","(empty)"),void 0,!1)}}i.ID="vs.actions.empty"},35146:function(Ht,at,q){"use strict";q.d(at,{ok:function(){return me}});function me(ge,le){if(!ge)throw new Error(le?`Assertion failed (${le})`:"Assertion Failed")}},73046:function(Ht,at,q){"use strict";q.d(at,{CM:function(){return B},JL:function(){return V},dT:function(){return F},fK:function(){return G},lA:function(){return K}});var me=q(4669);class ge{constructor(){this._icons=new Map,this._onDidRegister=new me.Q5}add(U){const L=this._icons.get(U.id);L?U.description?L.description=U.description:console.error(`Duplicate registration of codicon ${U.id}`):(this._icons.set(U.id,U),this._onDidRegister.fire(U))}get(U){return this._icons.get(U)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const le=new ge,G=le;function B(i,U){return new K(i,U)}function V(i){return i?i.replace(/\$\((.*?)\)/g,(U,L)=>` ${L} `).trim():""}class K{constructor(U,L,v){this.id=U,this.definition=L,this.description=v,le.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var F;(function(i){i.iconNameSegment="[A-Za-z0-9]+",i.iconNameExpression="[A-Za-z0-9\\-]+",i.iconModifierExpression="~[A-Za-z]+";const U=new RegExp(`^(${i.iconNameExpression})(${i.iconModifierExpression})?$`);function L(b){if(b instanceof K)return["codicon","codicon-"+b.id];const w=U.exec(b.id);if(!w)return L(K.error);let[,p,y]=w;const M=["codicon","codicon-"+p];return y&&M.push("codicon-modifier-"+y.substr(1)),M}i.asClassNameArray=L;function v(b){return L(b).join(" ")}i.asClassName=v;function E(b){return"."+L(b).join(".")}i.asCSSSelector=E})(F||(F={})),function(i){i.add=new i("add",{fontCharacter:"\\ea60"}),i.plus=new i("plus",i.add.definition),i.gistNew=new i("gist-new",i.add.definition),i.repoCreate=new i("repo-create",i.add.definition),i.lightbulb=new i("lightbulb",{fontCharacter:"\\ea61"}),i.lightBulb=new i("light-bulb",{fontCharacter:"\\ea61"}),i.repo=new i("repo",{fontCharacter:"\\ea62"}),i.repoDelete=new i("repo-delete",{fontCharacter:"\\ea62"}),i.gistFork=new i("gist-fork",{fontCharacter:"\\ea63"}),i.repoForked=new i("repo-forked",{fontCharacter:"\\ea63"}),i.gitPullRequest=new i("git-pull-request",{fontCharacter:"\\ea64"}),i.gitPullRequestAbandoned=new i("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),i.recordKeys=new i("record-keys",{fontCharacter:"\\ea65"}),i.keyboard=new i("keyboard",{fontCharacter:"\\ea65"}),i.tag=new i("tag",{fontCharacter:"\\ea66"}),i.tagAdd=new i("tag-add",{fontCharacter:"\\ea66"}),i.tagRemove=new i("tag-remove",{fontCharacter:"\\ea66"}),i.person=new i("person",{fontCharacter:"\\ea67"}),i.personFollow=new i("person-follow",{fontCharacter:"\\ea67"}),i.personOutline=new i("person-outline",{fontCharacter:"\\ea67"}),i.personFilled=new i("person-filled",{fontCharacter:"\\ea67"}),i.gitBranch=new i("git-branch",{fontCharacter:"\\ea68"}),i.gitBranchCreate=new i("git-branch-create",{fontCharacter:"\\ea68"}),i.gitBranchDelete=new i("git-branch-delete",{fontCharacter:"\\ea68"}),i.sourceControl=new i("source-control",{fontCharacter:"\\ea68"}),i.mirror=new i("mirror",{fontCharacter:"\\ea69"}),i.mirrorPublic=new i("mirror-public",{fontCharacter:"\\ea69"}),i.star=new i("star",{fontCharacter:"\\ea6a"}),i.starAdd=new i("star-add",{fontCharacter:"\\ea6a"}),i.starDelete=new i("star-delete",{fontCharacter:"\\ea6a"}),i.starEmpty=new i("star-empty",{fontCharacter:"\\ea6a"}),i.comment=new i("comment",{fontCharacter:"\\ea6b"}),i.commentAdd=new i("comment-add",{fontCharacter:"\\ea6b"}),i.alert=new i("alert",{fontCharacter:"\\ea6c"}),i.warning=new i("warning",{fontCharacter:"\\ea6c"}),i.search=new i("search",{fontCharacter:"\\ea6d"}),i.searchSave=new i("search-save",{fontCharacter:"\\ea6d"}),i.logOut=new i("log-out",{fontCharacter:"\\ea6e"}),i.signOut=new i("sign-out",{fontCharacter:"\\ea6e"}),i.logIn=new i("log-in",{fontCharacter:"\\ea6f"}),i.signIn=new i("sign-in",{fontCharacter:"\\ea6f"}),i.eye=new i("eye",{fontCharacter:"\\ea70"}),i.eyeUnwatch=new i("eye-unwatch",{fontCharacter:"\\ea70"}),i.eyeWatch=new i("eye-watch",{fontCharacter:"\\ea70"}),i.circleFilled=new i("circle-filled",{fontCharacter:"\\ea71"}),i.primitiveDot=new i("primitive-dot",{fontCharacter:"\\ea71"}),i.closeDirty=new i("close-dirty",{fontCharacter:"\\ea71"}),i.debugBreakpoint=new i("debug-breakpoint",{fontCharacter:"\\ea71"}),i.debugBreakpointDisabled=new i("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),i.debugHint=new i("debug-hint",{fontCharacter:"\\ea71"}),i.primitiveSquare=new i("primitive-square",{fontCharacter:"\\ea72"}),i.edit=new i("edit",{fontCharacter:"\\ea73"}),i.pencil=new i("pencil",{fontCharacter:"\\ea73"}),i.info=new i("info",{fontCharacter:"\\ea74"}),i.issueOpened=new i("issue-opened",{fontCharacter:"\\ea74"}),i.gistPrivate=new i("gist-private",{fontCharacter:"\\ea75"}),i.gitForkPrivate=new i("git-fork-private",{fontCharacter:"\\ea75"}),i.lock=new i("lock",{fontCharacter:"\\ea75"}),i.mirrorPrivate=new i("mirror-private",{fontCharacter:"\\ea75"}),i.close=new i("close",{fontCharacter:"\\ea76"}),i.removeClose=new i("remove-close",{fontCharacter:"\\ea76"}),i.x=new i("x",{fontCharacter:"\\ea76"}),i.repoSync=new i("repo-sync",{fontCharacter:"\\ea77"}),i.sync=new i("sync",{fontCharacter:"\\ea77"}),i.clone=new i("clone",{fontCharacter:"\\ea78"}),i.desktopDownload=new i("desktop-download",{fontCharacter:"\\ea78"}),i.beaker=new i("beaker",{fontCharacter:"\\ea79"}),i.microscope=new i("microscope",{fontCharacter:"\\ea79"}),i.vm=new i("vm",{fontCharacter:"\\ea7a"}),i.deviceDesktop=new i("device-desktop",{fontCharacter:"\\ea7a"}),i.file=new i("file",{fontCharacter:"\\ea7b"}),i.fileText=new i("file-text",{fontCharacter:"\\ea7b"}),i.more=new i("more",{fontCharacter:"\\ea7c"}),i.ellipsis=new i("ellipsis",{fontCharacter:"\\ea7c"}),i.kebabHorizontal=new i("kebab-horizontal",{fontCharacter:"\\ea7c"}),i.mailReply=new i("mail-reply",{fontCharacter:"\\ea7d"}),i.reply=new i("reply",{fontCharacter:"\\ea7d"}),i.organization=new i("organization",{fontCharacter:"\\ea7e"}),i.organizationFilled=new i("organization-filled",{fontCharacter:"\\ea7e"}),i.organizationOutline=new i("organization-outline",{fontCharacter:"\\ea7e"}),i.newFile=new i("new-file",{fontCharacter:"\\ea7f"}),i.fileAdd=new i("file-add",{fontCharacter:"\\ea7f"}),i.newFolder=new i("new-folder",{fontCharacter:"\\ea80"}),i.fileDirectoryCreate=new i("file-directory-create",{fontCharacter:"\\ea80"}),i.trash=new i("trash",{fontCharacter:"\\ea81"}),i.trashcan=new i("trashcan",{fontCharacter:"\\ea81"}),i.history=new i("history",{fontCharacter:"\\ea82"}),i.clock=new i("clock",{fontCharacter:"\\ea82"}),i.folder=new i("folder",{fontCharacter:"\\ea83"}),i.fileDirectory=new i("file-directory",{fontCharacter:"\\ea83"}),i.symbolFolder=new i("symbol-folder",{fontCharacter:"\\ea83"}),i.logoGithub=new i("logo-github",{fontCharacter:"\\ea84"}),i.markGithub=new i("mark-github",{fontCharacter:"\\ea84"}),i.github=new i("github",{fontCharacter:"\\ea84"}),i.terminal=new i("terminal",{fontCharacter:"\\ea85"}),i.console=new i("console",{fontCharacter:"\\ea85"}),i.repl=new i("repl",{fontCharacter:"\\ea85"}),i.zap=new i("zap",{fontCharacter:"\\ea86"}),i.symbolEvent=new i("symbol-event",{fontCharacter:"\\ea86"}),i.error=new i("error",{fontCharacter:"\\ea87"}),i.stop=new i("stop",{fontCharacter:"\\ea87"}),i.variable=new i("variable",{fontCharacter:"\\ea88"}),i.symbolVariable=new i("symbol-variable",{fontCharacter:"\\ea88"}),i.array=new i("array",{fontCharacter:"\\ea8a"}),i.symbolArray=new i("symbol-array",{fontCharacter:"\\ea8a"}),i.symbolModule=new i("symbol-module",{fontCharacter:"\\ea8b"}),i.symbolPackage=new i("symbol-package",{fontCharacter:"\\ea8b"}),i.symbolNamespace=new i("symbol-namespace",{fontCharacter:"\\ea8b"}),i.symbolObject=new i("symbol-object",{fontCharacter:"\\ea8b"}),i.symbolMethod=new i("symbol-method",{fontCharacter:"\\ea8c"}),i.symbolFunction=new i("symbol-function",{fontCharacter:"\\ea8c"}),i.symbolConstructor=new i("symbol-constructor",{fontCharacter:"\\ea8c"}),i.symbolBoolean=new i("symbol-boolean",{fontCharacter:"\\ea8f"}),i.symbolNull=new i("symbol-null",{fontCharacter:"\\ea8f"}),i.symbolNumeric=new i("symbol-numeric",{fontCharacter:"\\ea90"}),i.symbolNumber=new i("symbol-number",{fontCharacter:"\\ea90"}),i.symbolStructure=new i("symbol-structure",{fontCharacter:"\\ea91"}),i.symbolStruct=new i("symbol-struct",{fontCharacter:"\\ea91"}),i.symbolParameter=new i("symbol-parameter",{fontCharacter:"\\ea92"}),i.symbolTypeParameter=new i("symbol-type-parameter",{fontCharacter:"\\ea92"}),i.symbolKey=new i("symbol-key",{fontCharacter:"\\ea93"}),i.symbolText=new i("symbol-text",{fontCharacter:"\\ea93"}),i.symbolReference=new i("symbol-reference",{fontCharacter:"\\ea94"}),i.goToFile=new i("go-to-file",{fontCharacter:"\\ea94"}),i.symbolEnum=new i("symbol-enum",{fontCharacter:"\\ea95"}),i.symbolValue=new i("symbol-value",{fontCharacter:"\\ea95"}),i.symbolRuler=new i("symbol-ruler",{fontCharacter:"\\ea96"}),i.symbolUnit=new i("symbol-unit",{fontCharacter:"\\ea96"}),i.activateBreakpoints=new i("activate-breakpoints",{fontCharacter:"\\ea97"}),i.archive=new i("archive",{fontCharacter:"\\ea98"}),i.arrowBoth=new i("arrow-both",{fontCharacter:"\\ea99"}),i.arrowDown=new i("arrow-down",{fontCharacter:"\\ea9a"}),i.arrowLeft=new i("arrow-left",{fontCharacter:"\\ea9b"}),i.arrowRight=new i("arrow-right",{fontCharacter:"\\ea9c"}),i.arrowSmallDown=new i("arrow-small-down",{fontCharacter:"\\ea9d"}),i.arrowSmallLeft=new i("arrow-small-left",{fontCharacter:"\\ea9e"}),i.arrowSmallRight=new i("arrow-small-right",{fontCharacter:"\\ea9f"}),i.arrowSmallUp=new i("arrow-small-up",{fontCharacter:"\\eaa0"}),i.arrowUp=new i("arrow-up",{fontCharacter:"\\eaa1"}),i.bell=new i("bell",{fontCharacter:"\\eaa2"}),i.bold=new i("bold",{fontCharacter:"\\eaa3"}),i.book=new i("book",{fontCharacter:"\\eaa4"}),i.bookmark=new i("bookmark",{fontCharacter:"\\eaa5"}),i.debugBreakpointConditionalUnverified=new i("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),i.debugBreakpointConditional=new i("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),i.debugBreakpointConditionalDisabled=new i("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),i.debugBreakpointDataUnverified=new i("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),i.debugBreakpointData=new i("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),i.debugBreakpointDataDisabled=new i("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),i.debugBreakpointLogUnverified=new i("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),i.debugBreakpointLog=new i("debug-breakpoint-log",{fontCharacter:"\\eaab"}),i.debugBreakpointLogDisabled=new i("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),i.briefcase=new i("briefcase",{fontCharacter:"\\eaac"}),i.broadcast=new i("broadcast",{fontCharacter:"\\eaad"}),i.browser=new i("browser",{fontCharacter:"\\eaae"}),i.bug=new i("bug",{fontCharacter:"\\eaaf"}),i.calendar=new i("calendar",{fontCharacter:"\\eab0"}),i.caseSensitive=new i("case-sensitive",{fontCharacter:"\\eab1"}),i.check=new i("check",{fontCharacter:"\\eab2"}),i.checklist=new i("checklist",{fontCharacter:"\\eab3"}),i.chevronDown=new i("chevron-down",{fontCharacter:"\\eab4"}),i.dropDownButton=new i("drop-down-button",i.chevronDown.definition),i.chevronLeft=new i("chevron-left",{fontCharacter:"\\eab5"}),i.chevronRight=new i("chevron-right",{fontCharacter:"\\eab6"}),i.chevronUp=new i("chevron-up",{fontCharacter:"\\eab7"}),i.chromeClose=new i("chrome-close",{fontCharacter:"\\eab8"}),i.chromeMaximize=new i("chrome-maximize",{fontCharacter:"\\eab9"}),i.chromeMinimize=new i("chrome-minimize",{fontCharacter:"\\eaba"}),i.chromeRestore=new i("chrome-restore",{fontCharacter:"\\eabb"}),i.circleOutline=new i("circle-outline",{fontCharacter:"\\eabc"}),i.debugBreakpointUnverified=new i("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),i.circleSlash=new i("circle-slash",{fontCharacter:"\\eabd"}),i.circuitBoard=new i("circuit-board",{fontCharacter:"\\eabe"}),i.clearAll=new i("clear-all",{fontCharacter:"\\eabf"}),i.clippy=new i("clippy",{fontCharacter:"\\eac0"}),i.closeAll=new i("close-all",{fontCharacter:"\\eac1"}),i.cloudDownload=new i("cloud-download",{fontCharacter:"\\eac2"}),i.cloudUpload=new i("cloud-upload",{fontCharacter:"\\eac3"}),i.code=new i("code",{fontCharacter:"\\eac4"}),i.collapseAll=new i("collapse-all",{fontCharacter:"\\eac5"}),i.colorMode=new i("color-mode",{fontCharacter:"\\eac6"}),i.commentDiscussion=new i("comment-discussion",{fontCharacter:"\\eac7"}),i.compareChanges=new i("compare-changes",{fontCharacter:"\\eafd"}),i.creditCard=new i("credit-card",{fontCharacter:"\\eac9"}),i.dash=new i("dash",{fontCharacter:"\\eacc"}),i.dashboard=new i("dashboard",{fontCharacter:"\\eacd"}),i.database=new i("database",{fontCharacter:"\\eace"}),i.debugContinue=new i("debug-continue",{fontCharacter:"\\eacf"}),i.debugDisconnect=new i("debug-disconnect",{fontCharacter:"\\ead0"}),i.debugPause=new i("debug-pause",{fontCharacter:"\\ead1"}),i.debugRestart=new i("debug-restart",{fontCharacter:"\\ead2"}),i.debugStart=new i("debug-start",{fontCharacter:"\\ead3"}),i.debugStepInto=new i("debug-step-into",{fontCharacter:"\\ead4"}),i.debugStepOut=new i("debug-step-out",{fontCharacter:"\\ead5"}),i.debugStepOver=new i("debug-step-over",{fontCharacter:"\\ead6"}),i.debugStop=new i("debug-stop",{fontCharacter:"\\ead7"}),i.debug=new i("debug",{fontCharacter:"\\ead8"}),i.deviceCameraVideo=new i("device-camera-video",{fontCharacter:"\\ead9"}),i.deviceCamera=new i("device-camera",{fontCharacter:"\\eada"}),i.deviceMobile=new i("device-mobile",{fontCharacter:"\\eadb"}),i.diffAdded=new i("diff-added",{fontCharacter:"\\eadc"}),i.diffIgnored=new i("diff-ignored",{fontCharacter:"\\eadd"}),i.diffModified=new i("diff-modified",{fontCharacter:"\\eade"}),i.diffRemoved=new i("diff-removed",{fontCharacter:"\\eadf"}),i.diffRenamed=new i("diff-renamed",{fontCharacter:"\\eae0"}),i.diff=new i("diff",{fontCharacter:"\\eae1"}),i.discard=new i("discard",{fontCharacter:"\\eae2"}),i.editorLayout=new i("editor-layout",{fontCharacter:"\\eae3"}),i.emptyWindow=new i("empty-window",{fontCharacter:"\\eae4"}),i.exclude=new i("exclude",{fontCharacter:"\\eae5"}),i.extensions=new i("extensions",{fontCharacter:"\\eae6"}),i.eyeClosed=new i("eye-closed",{fontCharacter:"\\eae7"}),i.fileBinary=new i("file-binary",{fontCharacter:"\\eae8"}),i.fileCode=new i("file-code",{fontCharacter:"\\eae9"}),i.fileMedia=new i("file-media",{fontCharacter:"\\eaea"}),i.filePdf=new i("file-pdf",{fontCharacter:"\\eaeb"}),i.fileSubmodule=new i("file-submodule",{fontCharacter:"\\eaec"}),i.fileSymlinkDirectory=new i("file-symlink-directory",{fontCharacter:"\\eaed"}),i.fileSymlinkFile=new i("file-symlink-file",{fontCharacter:"\\eaee"}),i.fileZip=new i("file-zip",{fontCharacter:"\\eaef"}),i.files=new i("files",{fontCharacter:"\\eaf0"}),i.filter=new i("filter",{fontCharacter:"\\eaf1"}),i.flame=new i("flame",{fontCharacter:"\\eaf2"}),i.foldDown=new i("fold-down",{fontCharacter:"\\eaf3"}),i.foldUp=new i("fold-up",{fontCharacter:"\\eaf4"}),i.fold=new i("fold",{fontCharacter:"\\eaf5"}),i.folderActive=new i("folder-active",{fontCharacter:"\\eaf6"}),i.folderOpened=new i("folder-opened",{fontCharacter:"\\eaf7"}),i.gear=new i("gear",{fontCharacter:"\\eaf8"}),i.gift=new i("gift",{fontCharacter:"\\eaf9"}),i.gistSecret=new i("gist-secret",{fontCharacter:"\\eafa"}),i.gist=new i("gist",{fontCharacter:"\\eafb"}),i.gitCommit=new i("git-commit",{fontCharacter:"\\eafc"}),i.gitCompare=new i("git-compare",{fontCharacter:"\\eafd"}),i.gitMerge=new i("git-merge",{fontCharacter:"\\eafe"}),i.githubAction=new i("github-action",{fontCharacter:"\\eaff"}),i.githubAlt=new i("github-alt",{fontCharacter:"\\eb00"}),i.globe=new i("globe",{fontCharacter:"\\eb01"}),i.grabber=new i("grabber",{fontCharacter:"\\eb02"}),i.graph=new i("graph",{fontCharacter:"\\eb03"}),i.gripper=new i("gripper",{fontCharacter:"\\eb04"}),i.heart=new i("heart",{fontCharacter:"\\eb05"}),i.home=new i("home",{fontCharacter:"\\eb06"}),i.horizontalRule=new i("horizontal-rule",{fontCharacter:"\\eb07"}),i.hubot=new i("hubot",{fontCharacter:"\\eb08"}),i.inbox=new i("inbox",{fontCharacter:"\\eb09"}),i.issueClosed=new i("issue-closed",{fontCharacter:"\\eba4"}),i.issueReopened=new i("issue-reopened",{fontCharacter:"\\eb0b"}),i.issues=new i("issues",{fontCharacter:"\\eb0c"}),i.italic=new i("italic",{fontCharacter:"\\eb0d"}),i.jersey=new i("jersey",{fontCharacter:"\\eb0e"}),i.json=new i("json",{fontCharacter:"\\eb0f"}),i.kebabVertical=new i("kebab-vertical",{fontCharacter:"\\eb10"}),i.key=new i("key",{fontCharacter:"\\eb11"}),i.law=new i("law",{fontCharacter:"\\eb12"}),i.lightbulbAutofix=new i("lightbulb-autofix",{fontCharacter:"\\eb13"}),i.linkExternal=new i("link-external",{fontCharacter:"\\eb14"}),i.link=new i("link",{fontCharacter:"\\eb15"}),i.listOrdered=new i("list-ordered",{fontCharacter:"\\eb16"}),i.listUnordered=new i("list-unordered",{fontCharacter:"\\eb17"}),i.liveShare=new i("live-share",{fontCharacter:"\\eb18"}),i.loading=new i("loading",{fontCharacter:"\\eb19"}),i.location=new i("location",{fontCharacter:"\\eb1a"}),i.mailRead=new i("mail-read",{fontCharacter:"\\eb1b"}),i.mail=new i("mail",{fontCharacter:"\\eb1c"}),i.markdown=new i("markdown",{fontCharacter:"\\eb1d"}),i.megaphone=new i("megaphone",{fontCharacter:"\\eb1e"}),i.mention=new i("mention",{fontCharacter:"\\eb1f"}),i.milestone=new i("milestone",{fontCharacter:"\\eb20"}),i.mortarBoard=new i("mortar-board",{fontCharacter:"\\eb21"}),i.move=new i("move",{fontCharacter:"\\eb22"}),i.multipleWindows=new i("multiple-windows",{fontCharacter:"\\eb23"}),i.mute=new i("mute",{fontCharacter:"\\eb24"}),i.noNewline=new i("no-newline",{fontCharacter:"\\eb25"}),i.note=new i("note",{fontCharacter:"\\eb26"}),i.octoface=new i("octoface",{fontCharacter:"\\eb27"}),i.openPreview=new i("open-preview",{fontCharacter:"\\eb28"}),i.package_=new i("package",{fontCharacter:"\\eb29"}),i.paintcan=new i("paintcan",{fontCharacter:"\\eb2a"}),i.pin=new i("pin",{fontCharacter:"\\eb2b"}),i.play=new i("play",{fontCharacter:"\\eb2c"}),i.run=new i("run",{fontCharacter:"\\eb2c"}),i.plug=new i("plug",{fontCharacter:"\\eb2d"}),i.preserveCase=new i("preserve-case",{fontCharacter:"\\eb2e"}),i.preview=new i("preview",{fontCharacter:"\\eb2f"}),i.project=new i("project",{fontCharacter:"\\eb30"}),i.pulse=new i("pulse",{fontCharacter:"\\eb31"}),i.question=new i("question",{fontCharacter:"\\eb32"}),i.quote=new i("quote",{fontCharacter:"\\eb33"}),i.radioTower=new i("radio-tower",{fontCharacter:"\\eb34"}),i.reactions=new i("reactions",{fontCharacter:"\\eb35"}),i.references=new i("references",{fontCharacter:"\\eb36"}),i.refresh=new i("refresh",{fontCharacter:"\\eb37"}),i.regex=new i("regex",{fontCharacter:"\\eb38"}),i.remoteExplorer=new i("remote-explorer",{fontCharacter:"\\eb39"}),i.remote=new i("remote",{fontCharacter:"\\eb3a"}),i.remove=new i("remove",{fontCharacter:"\\eb3b"}),i.replaceAll=new i("replace-all",{fontCharacter:"\\eb3c"}),i.replace=new i("replace",{fontCharacter:"\\eb3d"}),i.repoClone=new i("repo-clone",{fontCharacter:"\\eb3e"}),i.repoForcePush=new i("repo-force-push",{fontCharacter:"\\eb3f"}),i.repoPull=new i("repo-pull",{fontCharacter:"\\eb40"}),i.repoPush=new i("repo-push",{fontCharacter:"\\eb41"}),i.report=new i("report",{fontCharacter:"\\eb42"}),i.requestChanges=new i("request-changes",{fontCharacter:"\\eb43"}),i.rocket=new i("rocket",{fontCharacter:"\\eb44"}),i.rootFolderOpened=new i("root-folder-opened",{fontCharacter:"\\eb45"}),i.rootFolder=new i("root-folder",{fontCharacter:"\\eb46"}),i.rss=new i("rss",{fontCharacter:"\\eb47"}),i.ruby=new i("ruby",{fontCharacter:"\\eb48"}),i.saveAll=new i("save-all",{fontCharacter:"\\eb49"}),i.saveAs=new i("save-as",{fontCharacter:"\\eb4a"}),i.save=new i("save",{fontCharacter:"\\eb4b"}),i.screenFull=new i("screen-full",{fontCharacter:"\\eb4c"}),i.screenNormal=new i("screen-normal",{fontCharacter:"\\eb4d"}),i.searchStop=new i("search-stop",{fontCharacter:"\\eb4e"}),i.server=new i("server",{fontCharacter:"\\eb50"}),i.settingsGear=new i("settings-gear",{fontCharacter:"\\eb51"}),i.settings=new i("settings",{fontCharacter:"\\eb52"}),i.shield=new i("shield",{fontCharacter:"\\eb53"}),i.smiley=new i("smiley",{fontCharacter:"\\eb54"}),i.sortPrecedence=new i("sort-precedence",{fontCharacter:"\\eb55"}),i.splitHorizontal=new i("split-horizontal",{fontCharacter:"\\eb56"}),i.splitVertical=new i("split-vertical",{fontCharacter:"\\eb57"}),i.squirrel=new i("squirrel",{fontCharacter:"\\eb58"}),i.starFull=new i("star-full",{fontCharacter:"\\eb59"}),i.starHalf=new i("star-half",{fontCharacter:"\\eb5a"}),i.symbolClass=new i("symbol-class",{fontCharacter:"\\eb5b"}),i.symbolColor=new i("symbol-color",{fontCharacter:"\\eb5c"}),i.symbolConstant=new i("symbol-constant",{fontCharacter:"\\eb5d"}),i.symbolEnumMember=new i("symbol-enum-member",{fontCharacter:"\\eb5e"}),i.symbolField=new i("symbol-field",{fontCharacter:"\\eb5f"}),i.symbolFile=new i("symbol-file",{fontCharacter:"\\eb60"}),i.symbolInterface=new i("symbol-interface",{fontCharacter:"\\eb61"}),i.symbolKeyword=new i("symbol-keyword",{fontCharacter:"\\eb62"}),i.symbolMisc=new i("symbol-misc",{fontCharacter:"\\eb63"}),i.symbolOperator=new i("symbol-operator",{fontCharacter:"\\eb64"}),i.symbolProperty=new i("symbol-property",{fontCharacter:"\\eb65"}),i.wrench=new i("wrench",{fontCharacter:"\\eb65"}),i.wrenchSubaction=new i("wrench-subaction",{fontCharacter:"\\eb65"}),i.symbolSnippet=new i("symbol-snippet",{fontCharacter:"\\eb66"}),i.tasklist=new i("tasklist",{fontCharacter:"\\eb67"}),i.telescope=new i("telescope",{fontCharacter:"\\eb68"}),i.textSize=new i("text-size",{fontCharacter:"\\eb69"}),i.threeBars=new i("three-bars",{fontCharacter:"\\eb6a"}),i.thumbsdown=new i("thumbsdown",{fontCharacter:"\\eb6b"}),i.thumbsup=new i("thumbsup",{fontCharacter:"\\eb6c"}),i.tools=new i("tools",{fontCharacter:"\\eb6d"}),i.triangleDown=new i("triangle-down",{fontCharacter:"\\eb6e"}),i.triangleLeft=new i("triangle-left",{fontCharacter:"\\eb6f"}),i.triangleRight=new i("triangle-right",{fontCharacter:"\\eb70"}),i.triangleUp=new i("triangle-up",{fontCharacter:"\\eb71"}),i.twitter=new i("twitter",{fontCharacter:"\\eb72"}),i.unfold=new i("unfold",{fontCharacter:"\\eb73"}),i.unlock=new i("unlock",{fontCharacter:"\\eb74"}),i.unmute=new i("unmute",{fontCharacter:"\\eb75"}),i.unverified=new i("unverified",{fontCharacter:"\\eb76"}),i.verified=new i("verified",{fontCharacter:"\\eb77"}),i.versions=new i("versions",{fontCharacter:"\\eb78"}),i.vmActive=new i("vm-active",{fontCharacter:"\\eb79"}),i.vmOutline=new i("vm-outline",{fontCharacter:"\\eb7a"}),i.vmRunning=new i("vm-running",{fontCharacter:"\\eb7b"}),i.watch=new i("watch",{fontCharacter:"\\eb7c"}),i.whitespace=new i("whitespace",{fontCharacter:"\\eb7d"}),i.wholeWord=new i("whole-word",{fontCharacter:"\\eb7e"}),i.window=new i("window",{fontCharacter:"\\eb7f"}),i.wordWrap=new i("word-wrap",{fontCharacter:"\\eb80"}),i.zoomIn=new i("zoom-in",{fontCharacter:"\\eb81"}),i.zoomOut=new i("zoom-out",{fontCharacter:"\\eb82"}),i.listFilter=new i("list-filter",{fontCharacter:"\\eb83"}),i.listFlat=new i("list-flat",{fontCharacter:"\\eb84"}),i.listSelection=new i("list-selection",{fontCharacter:"\\eb85"}),i.selection=new i("selection",{fontCharacter:"\\eb85"}),i.listTree=new i("list-tree",{fontCharacter:"\\eb86"}),i.debugBreakpointFunctionUnverified=new i("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),i.debugBreakpointFunction=new i("debug-breakpoint-function",{fontCharacter:"\\eb88"}),i.debugBreakpointFunctionDisabled=new i("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),i.debugStackframeActive=new i("debug-stackframe-active",{fontCharacter:"\\eb89"}),i.debugStackframeDot=new i("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),i.debugStackframe=new i("debug-stackframe",{fontCharacter:"\\eb8b"}),i.debugStackframeFocused=new i("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),i.debugBreakpointUnsupported=new i("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),i.symbolString=new i("symbol-string",{fontCharacter:"\\eb8d"}),i.debugReverseContinue=new i("debug-reverse-continue",{fontCharacter:"\\eb8e"}),i.debugStepBack=new i("debug-step-back",{fontCharacter:"\\eb8f"}),i.debugRestartFrame=new i("debug-restart-frame",{fontCharacter:"\\eb90"}),i.callIncoming=new i("call-incoming",{fontCharacter:"\\eb92"}),i.callOutgoing=new i("call-outgoing",{fontCharacter:"\\eb93"}),i.menu=new i("menu",{fontCharacter:"\\eb94"}),i.expandAll=new i("expand-all",{fontCharacter:"\\eb95"}),i.feedback=new i("feedback",{fontCharacter:"\\eb96"}),i.groupByRefType=new i("group-by-ref-type",{fontCharacter:"\\eb97"}),i.ungroupByRefType=new i("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),i.account=new i("account",{fontCharacter:"\\eb99"}),i.bellDot=new i("bell-dot",{fontCharacter:"\\eb9a"}),i.debugConsole=new i("debug-console",{fontCharacter:"\\eb9b"}),i.library=new i("library",{fontCharacter:"\\eb9c"}),i.output=new i("output",{fontCharacter:"\\eb9d"}),i.runAll=new i("run-all",{fontCharacter:"\\eb9e"}),i.syncIgnored=new i("sync-ignored",{fontCharacter:"\\eb9f"}),i.pinned=new i("pinned",{fontCharacter:"\\eba0"}),i.githubInverted=new i("github-inverted",{fontCharacter:"\\eba1"}),i.debugAlt=new i("debug-alt",{fontCharacter:"\\eb91"}),i.serverProcess=new i("server-process",{fontCharacter:"\\eba2"}),i.serverEnvironment=new i("server-environment",{fontCharacter:"\\eba3"}),i.pass=new i("pass",{fontCharacter:"\\eba4"}),i.stopCircle=new i("stop-circle",{fontCharacter:"\\eba5"}),i.playCircle=new i("play-circle",{fontCharacter:"\\eba6"}),i.record=new i("record",{fontCharacter:"\\eba7"}),i.debugAltSmall=new i("debug-alt-small",{fontCharacter:"\\eba8"}),i.vmConnect=new i("vm-connect",{fontCharacter:"\\eba9"}),i.cloud=new i("cloud",{fontCharacter:"\\ebaa"}),i.merge=new i("merge",{fontCharacter:"\\ebab"}),i.exportIcon=new i("export",{fontCharacter:"\\ebac"}),i.graphLeft=new i("graph-left",{fontCharacter:"\\ebad"}),i.magnet=new i("magnet",{fontCharacter:"\\ebae"}),i.notebook=new i("notebook",{fontCharacter:"\\ebaf"}),i.redo=new i("redo",{fontCharacter:"\\ebb0"}),i.checkAll=new i("check-all",{fontCharacter:"\\ebb1"}),i.pinnedDirty=new i("pinned-dirty",{fontCharacter:"\\ebb2"}),i.passFilled=new i("pass-filled",{fontCharacter:"\\ebb3"}),i.circleLargeFilled=new i("circle-large-filled",{fontCharacter:"\\ebb4"}),i.circleLargeOutline=new i("circle-large-outline",{fontCharacter:"\\ebb5"}),i.combine=new i("combine",{fontCharacter:"\\ebb6"}),i.gather=new i("gather",{fontCharacter:"\\ebb6"}),i.table=new i("table",{fontCharacter:"\\ebb7"}),i.variableGroup=new i("variable-group",{fontCharacter:"\\ebb8"}),i.typeHierarchy=new i("type-hierarchy",{fontCharacter:"\\ebb9"}),i.typeHierarchySub=new i("type-hierarchy-sub",{fontCharacter:"\\ebba"}),i.typeHierarchySuper=new i("type-hierarchy-super",{fontCharacter:"\\ebbb"}),i.gitPullRequestCreate=new i("git-pull-request-create",{fontCharacter:"\\ebbc"}),i.runAbove=new i("run-above",{fontCharacter:"\\ebbd"}),i.runBelow=new i("run-below",{fontCharacter:"\\ebbe"}),i.notebookTemplate=new i("notebook-template",{fontCharacter:"\\ebbf"}),i.debugRerun=new i("debug-rerun",{fontCharacter:"\\ebc0"}),i.workspaceTrusted=new i("workspace-trusted",{fontCharacter:"\\ebc1"}),i.workspaceUntrusted=new i("workspace-untrusted",{fontCharacter:"\\ebc2"}),i.workspaceUnspecified=new i("workspace-unspecified",{fontCharacter:"\\ebc3"}),i.terminalCmd=new i("terminal-cmd",{fontCharacter:"\\ebc4"}),i.terminalDebian=new i("terminal-debian",{fontCharacter:"\\ebc5"}),i.terminalLinux=new i("terminal-linux",{fontCharacter:"\\ebc6"}),i.terminalPowershell=new i("terminal-powershell",{fontCharacter:"\\ebc7"}),i.terminalTmux=new i("terminal-tmux",{fontCharacter:"\\ebc8"}),i.terminalUbuntu=new i("terminal-ubuntu",{fontCharacter:"\\ebc9"}),i.terminalBash=new i("terminal-bash",{fontCharacter:"\\ebca"}),i.arrowSwap=new i("arrow-swap",{fontCharacter:"\\ebcb"}),i.copy=new i("copy",{fontCharacter:"\\ebcc"}),i.personAdd=new i("person-add",{fontCharacter:"\\ebcd"}),i.filterFilled=new i("filter-filled",{fontCharacter:"\\ebce"}),i.wand=new i("wand",{fontCharacter:"\\ebcf"}),i.debugLineByLine=new i("debug-line-by-line",{fontCharacter:"\\ebd0"}),i.inspect=new i("inspect",{fontCharacter:"\\ebd1"}),i.layers=new i("layers",{fontCharacter:"\\ebd2"}),i.layersDot=new i("layers-dot",{fontCharacter:"\\ebd3"}),i.layersActive=new i("layers-active",{fontCharacter:"\\ebd4"}),i.compass=new i("compass",{fontCharacter:"\\ebd5"}),i.compassDot=new i("compass-dot",{fontCharacter:"\\ebd6"}),i.compassActive=new i("compass-active",{fontCharacter:"\\ebd7"}),i.azure=new i("azure",{fontCharacter:"\\ebd8"}),i.issueDraft=new i("issue-draft",{fontCharacter:"\\ebd9"}),i.gitPullRequestClosed=new i("git-pull-request-closed",{fontCharacter:"\\ebda"}),i.gitPullRequestDraft=new i("git-pull-request-draft",{fontCharacter:"\\ebdb"}),i.debugAll=new i("debug-all",{fontCharacter:"\\ebdc"}),i.debugCoverage=new i("debug-coverage",{fontCharacter:"\\ebdd"}),i.runErrors=new i("run-errors",{fontCharacter:"\\ebde"}),i.folderLibrary=new i("folder-library",{fontCharacter:"\\ebdf"}),i.debugContinueSmall=new i("debug-continue-small",{fontCharacter:"\\ebe0"}),i.beakerStop=new i("beaker-stop",{fontCharacter:"\\ebe1"}),i.graphLine=new i("graph-line",{fontCharacter:"\\ebe2"}),i.graphScatter=new i("graph-scatter",{fontCharacter:"\\ebe3"}),i.pieChart=new i("pie-chart",{fontCharacter:"\\ebe4"}),i.bracket=new i("bracket",i.json.definition),i.bracketDot=new i("bracket-dot",{fontCharacter:"\\ebe5"}),i.bracketError=new i("bracket-error",{fontCharacter:"\\ebe6"}),i.lockSmall=new i("lock-small",{fontCharacter:"\\ebe7"}),i.azureDevops=new i("azure-devops",{fontCharacter:"\\ebe8"}),i.verifiedFilled=new i("verified-filled",{fontCharacter:"\\ebe9"})}(K||(K={}))},17301:function(Ht,at,q){"use strict";q.d(at,{B8:function(){return L},Cp:function(){return G},F0:function(){return F},L6:function(){return U},VV:function(){return K},b1:function(){return i},dL:function(){return le},ri:function(){return B}});class me{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(E){setTimeout(()=>{throw E.stack?new Error(E.message+`
`+E.stack):E},0)}}emit(E){this.listeners.forEach(b=>{b(E)})}onUnexpectedError(E){this.unexpectedErrorHandler(E),this.emit(E)}onUnexpectedExternalError(E){this.unexpectedErrorHandler(E)}}const ge=new me;function le(v){K(v)||ge.onUnexpectedError(v)}function G(v){K(v)||ge.onUnexpectedExternalError(v)}function B(v){if(v instanceof Error){let{name:E,message:b}=v;const w=v.stacktrace||v.stack;return{$isError:!0,name:E,message:b,stack:w}}return v}const V="Canceled";function K(v){return v instanceof Error&&v.name===V&&v.message===V}function F(){const v=new Error(V);return v.name=v.message,v}function i(v){return v?new Error(`Illegal argument: ${v}`):new Error("Illegal argument")}function U(v){return v?new Error(`Illegal state: ${v}`):new Error("Illegal state")}class L extends Error{constructor(E){super("NotSupported"),E&&(this.message=E)}}},4669:function(Ht,at,q){"use strict";q.d(at,{D0:function(){return L},E7:function(){return v},K3:function(){return U},Q5:function(){return i},ZD:function(){return E},ju:function(){return B}});var me=q(17301),ge=q(9917),le=q(91741),G=q(84013),B;(function(b){b.None=()=>ge.JT.None;function w(s){return(g,R=null,D)=>{let x=!1,T;return T=s(O=>{if(!x)return T?T.dispose():x=!0,g.call(R,O)},null,D),x&&T.dispose(),T}}b.once=w;function p(s,g){return h((R,D=null,x)=>s(T=>R.call(D,g(T)),null,x))}b.map=p;function y(s,g){return h((R,D=null,x)=>s(T=>{g(T),R.call(D,T)},null,x))}b.forEach=y;function M(s,g){return h((R,D=null,x)=>s(T=>g(T)&&R.call(D,T),null,x))}b.filter=M;function d(s){return s}b.signal=d;function f(...s){return(g,R=null,D)=>(0,ge.F8)(...s.map(x=>x(T=>g.call(R,T),null,D)))}b.any=f;function u(s,g,R){let D=R;return p(s,x=>(D=g(D,x),D))}b.reduce=u;function h(s){let g;const R=new i({onFirstListenerAdd(){g=s(R.fire,R)},onLastListenerRemove(){g.dispose()}});return R.event}function S(s,g,R=100,D=!1,x){let T,O,$,H=0;const Z=new i({leakWarningThreshold:x,onFirstListenerAdd(){T=s(te=>{H++,O=g(O,te),D&&!$&&(Z.fire(O),O=void 0),clearTimeout($),$=setTimeout(()=>{const J=O;O=void 0,$=void 0,(!D||H>1)&&Z.fire(J),H=0},R)})},onLastListenerRemove(){T.dispose()}});return Z.event}b.debounce=S;function k(s,g=(R,D)=>R===D){let R=!0,D;return M(s,x=>{const T=R||!g(x,D);return R=!1,D=x,T})}b.latch=k;function m(s,g){return[b.filter(s,g),b.filter(s,R=>!g(R))]}b.split=m;function A(s,g=!1,R=[]){let D=R.slice(),x=s($=>{D?D.push($):O.fire($)});const T=()=>{D&&D.forEach($=>O.fire($)),D=null},O=new i({onFirstListenerAdd(){x||(x=s($=>O.fire($)))},onFirstListenerDidAdd(){D&&(g?setTimeout(T):T())},onLastListenerRemove(){x&&x.dispose(),x=null}});return O.event}b.buffer=A;class I{constructor(g){this.event=g}map(g){return new I(p(this.event,g))}forEach(g){return new I(y(this.event,g))}filter(g){return new I(M(this.event,g))}reduce(g,R){return new I(u(this.event,g,R))}latch(){return new I(k(this.event))}debounce(g,R=100,D=!1,x){return new I(S(this.event,g,R,D,x))}on(g,R,D){return this.event(g,R,D)}once(g,R,D){return w(this.event)(g,R,D)}}function C(s){return new I(s)}b.chain=C;function P(s,g,R=D=>D){const D=(...$)=>O.fire(R(...$)),x=()=>s.on(g,D),T=()=>s.removeListener(g,D),O=new i({onFirstListenerAdd:x,onLastListenerRemove:T});return O.event}b.fromNodeEventEmitter=P;function l(s,g,R=D=>D){const D=(...$)=>O.fire(R(...$)),x=()=>s.addEventListener(g,D),T=()=>s.removeEventListener(g,D),O=new i({onFirstListenerAdd:x,onLastListenerRemove:T});return O.event}b.fromDOMEventEmitter=l;function c(s){return new Promise(g=>w(s)(g))}b.toPromise=c})(B||(B={}));class V{constructor(w){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${w}_${V._idPool++}`}start(w){this._stopWatch=new G.G(!0),this._listenerCount=w}stop(){if(this._stopWatch){const w=this._stopWatch.elapsed();this._elapsedOverall+=w,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${w.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}V._idPool=0;let K=-1;class F{constructor(w,p=Math.random().toString(18).slice(2,5)){this.customThreshold=w,this.name=p,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(w){let p=K;if(typeof this.customThreshold=="number"&&(p=this.customThreshold),p<=0||w<p)return;this._stacks||(this._stacks=new Map);const y=new Error().stack.split(`
`).slice(3).join(`
`),M=this._stacks.get(y)||0;if(this._stacks.set(y,M+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=p*.5;let d,f=0;for(const[u,h]of this._stacks)(!d||f<h)&&(d=u,f=h);console.warn(`[${this.name}] potential listener LEAK detected, having ${w} listeners already. MOST frequent listener (${f}):`),console.warn(d)}return()=>{const d=this._stacks.get(y)||0;this._stacks.set(y,d-1)}}}class i{constructor(w){var p;this._disposed=!1,this._options=w,this._leakageMon=K>0?new F(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=!((p=this._options)===null||p===void 0)&&p._profName?new V(this._options._profName):void 0}get event(){return this._event||(this._event=(w,p,y)=>{var M;this._listeners||(this._listeners=new le.S);const d=this._listeners.isEmpty();d&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const f=this._listeners.push(p?[w,p]:w);d&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,w,p);const u=(M=this._leakageMon)===null||M===void 0?void 0:M.check(this._listeners.size),h=(0,ge.OF)(()=>{u&&u(),this._disposed||(f(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return y instanceof ge.SL?y.add(h):Array.isArray(y)&&y.push(h),h}),this._event}fire(w){var p,y;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new le.S);for(let M of this._listeners)this._deliveryQueue.push([M,w]);for((p=this._perfMon)===null||p===void 0||p.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[M,d]=this._deliveryQueue.shift();try{typeof M=="function"?M.call(void 0,d):M[0].call(M[1],d)}catch(f){(0,me.dL)(f)}}(y=this._perfMon)===null||y===void 0||y.stop()}}dispose(){var w,p,y,M,d;this._disposed||(this._disposed=!0,(w=this._listeners)===null||w===void 0||w.clear(),(p=this._deliveryQueue)===null||p===void 0||p.clear(),(M=(y=this._options)===null||y===void 0?void 0:y.onLastListenerRemove)===null||M===void 0||M.call(y),(d=this._leakageMon)===null||d===void 0||d.dispose())}}class U extends i{constructor(w){super(w),this._isPaused=0,this._eventQueue=new le.S,this._mergeFn=w==null?void 0:w.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const w=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(w))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(w){this._listeners&&(this._isPaused!==0?this._eventQueue.push(w):super.fire(w))}}class L extends U{constructor(w){var p;super(w),this._delay=(p=w.delay)!==null&&p!==void 0?p:100}fire(w){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(w)}}class v{constructor(){this.buffers=[]}wrapEvent(w){return(p,y,M)=>w(d=>{const f=this.buffers[this.buffers.length-1];f?f.push(()=>p.call(y,d)):p.call(y,d)},void 0,M)}bufferEvents(w){const p=[];this.buffers.push(p);const y=w();return this.buffers.pop(),p.forEach(M=>M()),y}}class E{constructor(){this.listening=!1,this.inputEvent=B.None,this.inputEventListener=ge.JT.None,this.emitter=new i({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(w){this.inputEvent=w,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=w(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},88289:function(Ht,at,q){"use strict";q.d(at,{I:function(){return me}});function me(ge){const le=this;let G=!1,B;return function(){return G||(G=!0,B=ge.apply(le,arguments)),B}}},53725:function(Ht,at,q){"use strict";q.d(at,{$:function(){return me}});var me;(function(ge){function le(f){return f&&typeof f=="object"&&typeof f[Symbol.iterator]=="function"}ge.is=le;const G=Object.freeze([]);function B(){return G}ge.empty=B;function*V(f){yield f}ge.single=V;function K(f){return f||G}ge.from=K;function F(f){return!f||f[Symbol.iterator]().next().done===!0}ge.isEmpty=F;function i(f){return f[Symbol.iterator]().next().value}ge.first=i;function U(f,u){for(const h of f)if(u(h))return!0;return!1}ge.some=U;function L(f,u){for(const h of f)if(u(h))return h}ge.find=L;function*v(f,u){for(const h of f)u(h)&&(yield h)}ge.filter=v;function*E(f,u){let h=0;for(const S of f)yield u(S,h++)}ge.map=E;function*b(...f){for(const u of f)for(const h of u)yield h}ge.concat=b;function*w(f){for(const u of f)for(const h of u)yield h}ge.concatNested=w;function p(f,u,h){let S=h;for(const k of f)S=u(S,k);return S}ge.reduce=p;function*y(f,u,h=f.length){for(u<0&&(u+=f.length),h<0?h+=f.length:h>f.length&&(h=f.length);u<h;u++)yield f[u]}ge.slice=y;function M(f,u=Number.POSITIVE_INFINITY){const h=[];if(u===0)return[h,f];const S=f[Symbol.iterator]();for(let k=0;k<u;k++){const m=S.next();if(m.done)return[h,ge.empty()];h.push(m.value)}return[h,{[Symbol.iterator](){return S}}]}ge.consume=M;function d(f,u,h=(S,k)=>S===k){const S=f[Symbol.iterator](),k=u[Symbol.iterator]();for(;;){const m=S.next(),A=k.next();if(m.done!==A.done)return!1;if(m.done)return!0;if(!h(m.value,A.value))return!1}}ge.equals=d})(me||(me={}))},9917:function(Ht,at,q){"use strict";q.d(at,{B9:function(){return E},F8:function(){return b},JT:function(){return y},Jz:function(){return d},OF:function(){return w},SL:function(){return p},Wf:function(){return v},XK:function(){return M},dk:function(){return U}});var me=q(88289),ge=q(53725);const le=!1;let G=null;function B(f){G=f}if(le){const f="__is_disposable_tracked__";B(new class{trackDisposable(u){const h=new Error("Potentially leaked disposable").stack;setTimeout(()=>{u[f]||console.log(h)},3e3)}setParent(u,h){if(u&&u!==y.None)try{u[f]=!0}catch(S){}}markAsDisposed(u){if(u&&u!==y.None)try{u[f]=!0}catch(h){}}markAsSingleton(u){}})}function V(f){return G==null||G.trackDisposable(f),f}function K(f){G==null||G.markAsDisposed(f)}function F(f,u){G==null||G.setParent(f,u)}function i(f,u){if(G)for(const h of f)G.setParent(h,u)}function U(f){return G==null||G.markAsSingleton(f),f}class L extends Error{constructor(u){super(`Encountered errors while disposing of store. Errors: [${u.join(", ")}]`),this.errors=u}}function v(f){return typeof f.dispose=="function"&&f.dispose.length===0}function E(f){if(ge.$.is(f)){let u=[];for(const h of f)if(h)try{h.dispose()}catch(S){u.push(S)}if(u.length===1)throw u[0];if(u.length>1)throw new L(u);return Array.isArray(f)?[]:f}else if(f)return f.dispose(),f}function b(...f){const u=w(()=>E(f));return i(f,u),u}function w(f){const u=V({dispose:(0,me.I)(()=>{K(u),f()})});return u}class p{constructor(){this._toDispose=new Set,this._isDisposed=!1,V(this)}dispose(){this._isDisposed||(K(this),this._isDisposed=!0,this.clear())}clear(){try{E(this._toDispose.values())}finally{this._toDispose.clear()}}add(u){if(!u)return u;if(u===this)throw new Error("Cannot register a disposable on itself!");return F(u,this),this._isDisposed?p.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(u),u}}p.DISABLE_DISPOSED_WARNING=!1;class y{constructor(){this._store=new p,V(this),F(this._store,this)}dispose(){K(this),this._store.dispose()}_register(u){if(u===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(u)}}y.None=Object.freeze({dispose(){}});class M{constructor(){this._isDisposed=!1,V(this)}get value(){return this._isDisposed?void 0:this._value}set value(u){var h;this._isDisposed||u===this._value||((h=this._value)===null||h===void 0||h.dispose(),u&&F(u,this),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,K(this),(u=this._value)===null||u===void 0||u.dispose(),this._value=void 0}clearAndLeak(){const u=this._value;return this._value=void 0,u&&F(u,null),u}}class d{constructor(u){this.object=u}dispose(){}}},91741:function(Ht,at,q){"use strict";q.d(at,{S:function(){return ge}});class me{constructor(G){this.element=G,this.next=me.Undefined,this.prev=me.Undefined}}me.Undefined=new me(void 0);class ge{constructor(){this._first=me.Undefined,this._last=me.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===me.Undefined}clear(){let G=this._first;for(;G!==me.Undefined;){const B=G.next;G.prev=me.Undefined,G.next=me.Undefined,G=B}this._first=me.Undefined,this._last=me.Undefined,this._size=0}unshift(G){return this._insert(G,!1)}push(G){return this._insert(G,!0)}_insert(G,B){const V=new me(G);if(this._first===me.Undefined)this._first=V,this._last=V;else if(B){const F=this._last;this._last=V,V.prev=F,F.next=V}else{const F=this._first;this._first=V,V.next=F,F.prev=V}this._size+=1;let K=!1;return()=>{K||(K=!0,this._remove(V))}}shift(){if(this._first!==me.Undefined){const G=this._first.element;return this._remove(this._first),G}}pop(){if(this._last!==me.Undefined){const G=this._last.element;return this._remove(this._last),G}}_remove(G){if(G.prev!==me.Undefined&&G.next!==me.Undefined){const B=G.prev;B.next=G.next,G.next.prev=B}else G.prev===me.Undefined&&G.next===me.Undefined?(this._first=me.Undefined,this._last=me.Undefined):G.next===me.Undefined?(this._last=this._last.prev,this._last.next=me.Undefined):G.prev===me.Undefined&&(this._first=this._first.next,this._first.prev=me.Undefined);this._size-=1}*[Symbol.iterator](){let G=this._first;for(;G!==me.Undefined;)yield G.element,G=G.next}}},1432:function(Ht,at,q){"use strict";q.d(at,{$L:function(){return S},ED:function(){return d},IJ:function(){return u},OS:function(){return I},WE:function(){return m},dz:function(){return f},gn:function(){return k},li:function(){return w},r:function(){return l},tY:function(){return h},xS:function(){return A}});var me=q(34155),ge;const le="en";let G=!1,B=!1,V=!1,K=!1,F=!1,i=!1,U=!1,L,v=null,E=null,b;const w=typeof self=="object"?self:typeof q.g=="object"?q.g:{};let p;typeof w.vscode!="undefined"&&typeof w.vscode.process!="undefined"?p=w.vscode.process:typeof me!="undefined"&&(p=me);const y=typeof((ge=p==null?void 0:p.versions)===null||ge===void 0?void 0:ge.electron)=="string"&&p.type==="renderer";if(typeof navigator=="object"&&!y)b=navigator.userAgent,G=b.indexOf("Windows")>=0,B=b.indexOf("Macintosh")>=0,U=(b.indexOf("Macintosh")>=0||b.indexOf("iPad")>=0||b.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,V=b.indexOf("Linux")>=0,i=!0,L=navigator.language,v=L;else if(typeof p=="object"){G=p.platform==="win32",B=p.platform==="darwin",V=p.platform==="linux",K=V&&!!p.env.SNAP&&!!p.env.SNAP_REVISION,L=le,v=le;const c=p.env.VSCODE_NLS_CONFIG;if(c)try{const s=JSON.parse(c),g=s.availableLanguages["*"];L=s.locale,v=g||le,E=s._translationsConfigFile}catch(s){}F=!0}else console.error("Unable to resolve platform.");let M=0;B?M=1:G?M=3:V&&(M=2);const d=G,f=B,u=V,h=F,S=i,k=U,m=b,A=function(){if(w.setImmediate)return w.setImmediate.bind(w);if(typeof w.postMessage=="function"&&!w.importScripts){let g=[];w.addEventListener("message",D=>{if(D.data&&D.data.vscodeSetImmediateId)for(let x=0,T=g.length;x<T;x++){const O=g[x];if(O.id===D.data.vscodeSetImmediateId){g.splice(x,1),O.callback();return}}});let R=0;return D=>{const x=++R;g.push({id:x,callback:D}),w.postMessage({vscodeSetImmediateId:x},"*")}}if(typeof(p==null?void 0:p.nextTick)=="function")return p.nextTick.bind(p);const s=Promise.resolve();return g=>s.then(g)}(),I=B||U?2:G?1:3;let C=!0,P=!1;function l(){if(!P){P=!0;const c=new Uint8Array(2);c[0]=1,c[1]=2,C=new Uint16Array(c.buffer)[0]===513}return C}},84013:function(Ht,at,q){"use strict";q.d(at,{G:function(){return le}});var me=q(1432);const ge=me.li.performance&&typeof me.li.performance.now=="function";class le{constructor(B){this._highResolution=ge&&B,this._startTime=this._now(),this._stopTime=-1}static create(B=!0){return new le(B)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?me.li.performance.now():Date.now()}}},97295:function(Ht,at,q){"use strict";q.d(at,{$i:function(){return H},C8:function(){return oe},GF:function(){return L},HO:function(){return R},IO:function(){return v},K7:function(){return ie},Kw:function(){return Ne},LC:function(){return w},Mh:function(){return A},P1:function(){return I},PJ:function(){return Ve},Qe:function(){return Z},R1:function(){return U},RP:function(){return O},S6:function(){return ot},TT:function(){return d},Ut:function(){return x},V8:function(){return p},WU:function(){return le},YK:function(){return P},YU:function(){return G},ZG:function(){return C},ZH:function(){return c},ab:function(){return te},c1:function(){return ue},df:function(){return S},ec:function(){return B},fi:function(){return Et},fy:function(){return V},j3:function(){return K},j_:function(){return u},m5:function(){return me},mK:function(){return h},mr:function(){return E},oH:function(){return He},oL:function(){return F},ok:function(){return m},ow:function(){return y},qq:function(){return k},qu:function(){return M},rL:function(){return l},uS:function(){return Pe},un:function(){return i},uq:function(){return b},vH:function(){return g},xe:function(){return J},zY:function(){return f}});function me(se){return!se||typeof se!="string"?!0:se.trim().length===0}const ge=/{(\d+)}/g;function le(se,...De){return De.length===0?se:se.replace(ge,function(ze,Ge){const qe=parseInt(Ge,10);return isNaN(qe)||qe<0||qe>=De.length?ze:De[qe]})}function G(se){return se.replace(/[<>&]/g,function(De){switch(De){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return De}})}function B(se){return se.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function V(se,De=" "){const ze=K(se,De);return F(ze,De)}function K(se,De){if(!se||!De)return se;const ze=De.length;if(ze===0||se.length===0)return se;let Ge=0;for(;se.indexOf(De,Ge)===Ge;)Ge=Ge+ze;return se.substring(Ge)}function F(se,De){if(!se||!De)return se;const ze=De.length,Ge=se.length;if(ze===0||Ge===0)return se;let qe=Ge,vt=-1;for(;vt=se.lastIndexOf(De,qe-1),!(vt===-1||vt+ze!==qe);){if(vt===0)return"";qe=vt}return se.substring(0,qe)}function i(se){return se.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function U(se){return se.replace(/\*/g,"")}function L(se,De,ze={}){if(!se)throw new Error("Cannot create regex from empty string");De||(se=B(se)),ze.wholeWord&&(/\B/.test(se.charAt(0))||(se="\\b"+se),/\B/.test(se.charAt(se.length-1))||(se=se+"\\b"));let Ge="";return ze.global&&(Ge+="g"),ze.matchCase||(Ge+="i"),ze.multiline&&(Ge+="m"),ze.unicode&&(Ge+="u"),new RegExp(se,Ge)}function v(se){return se.source==="^"||se.source==="^$"||se.source==="$"||se.source==="^\\s*$"?!1:!!(se.exec("")&&se.lastIndex===0)}function E(se){return(se.global?"g":"")+(se.ignoreCase?"i":"")+(se.multiline?"m":"")+(se.unicode?"u":"")}function b(se){return se.split(/\r\n|\r|\n/)}function w(se){for(let De=0,ze=se.length;De<ze;De++){const Ge=se.charCodeAt(De);if(Ge!==32&&Ge!==9)return De}return-1}function p(se,De=0,ze=se.length){for(let Ge=De;Ge<ze;Ge++){const qe=se.charCodeAt(Ge);if(qe!==32&&qe!==9)return se.substring(De,Ge)}return se.substring(De,ze)}function y(se,De=se.length-1){for(let ze=De;ze>=0;ze--){const Ge=se.charCodeAt(ze);if(Ge!==32&&Ge!==9)return ze}return-1}function M(se,De){return se<De?-1:se>De?1:0}function d(se,De,ze=0,Ge=se.length,qe=0,vt=De.length){for(;ze<Ge&&qe<vt;ze++,qe++){let ke=se.charCodeAt(ze),lt=De.charCodeAt(qe);if(ke<lt)return-1;if(ke>lt)return 1}const Ut=Ge-ze,bt=vt-qe;return Ut<bt?-1:Ut>bt?1:0}function f(se,De){return u(se,De,0,se.length,0,De.length)}function u(se,De,ze=0,Ge=se.length,qe=0,vt=De.length){for(;ze<Ge&&qe<vt;ze++,qe++){let ke=se.charCodeAt(ze),lt=De.charCodeAt(qe);if(ke===lt)continue;if(ke>=128||lt>=128)return d(se.toLowerCase(),De.toLowerCase(),ze,Ge,qe,vt);h(ke)&&(ke-=32),h(lt)&&(lt-=32);const $t=ke-lt;if($t!==0)return $t}const Ut=Ge-ze,bt=vt-qe;return Ut<bt?-1:Ut>bt?1:0}function h(se){return se>=97&&se<=122}function S(se){return se>=65&&se<=90}function k(se,De){return se.length===De.length&&u(se,De)===0}function m(se,De){const ze=De.length;return De.length>se.length?!1:u(se,De,0,ze)===0}function A(se,De){let ze,Ge=Math.min(se.length,De.length);for(ze=0;ze<Ge;ze++)if(se.charCodeAt(ze)!==De.charCodeAt(ze))return ze;return Ge}function I(se,De){let ze,Ge=Math.min(se.length,De.length);const qe=se.length-1,vt=De.length-1;for(ze=0;ze<Ge;ze++)if(se.charCodeAt(qe-ze)!==De.charCodeAt(vt-ze))return ze;return Ge}function C(se){return 55296<=se&&se<=56319}function P(se){return 56320<=se&&se<=57343}function l(se,De){return(se-55296<<10)+(De-56320)+65536}function c(se,De,ze){const Ge=se.charCodeAt(ze);if(C(Ge)&&ze+1<De){const qe=se.charCodeAt(ze+1);if(P(qe))return l(Ge,qe)}return Ge}function s(se,De){const ze=se.charCodeAt(De-1);if(P(ze)&&De>1){const Ge=se.charCodeAt(De-2);if(C(Ge))return l(Ge,ze)}return ze}function g(se,De){const ze=it.getInstance(),Ge=De,qe=se.length,vt=c(se,qe,De);De+=vt>=65536?2:1;let Ut=ze.getGraphemeBreakType(vt);for(;De<qe;){const bt=c(se,qe,De),ke=ze.getGraphemeBreakType(bt);if(Et(Ut,ke))break;De+=bt>=65536?2:1,Ut=ke}return De-Ge}function R(se,De){const ze=it.getInstance(),Ge=De,qe=s(se,De);De-=qe>=65536?2:1;let vt=ze.getGraphemeBreakType(qe);for(;De>0;){const Ut=s(se,De),bt=ze.getGraphemeBreakType(Ut);if(Et(bt,vt))break;De-=Ut>=65536?2:1,vt=bt}return Ge-De}const D=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function x(se){return D.test(se)}const T=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function O(se){return T.test(se)}const $=/^[\t\n\r\x20-\x7E]*$/;function H(se){return $.test(se)}const Z=/[\u2028\u2029]/;function te(se){return Z.test(se)}function J(se){for(let De=0,ze=se.length;De<ze;De++)if(ie(se.charCodeAt(De)))return!0;return!1}function ie(se){return se=+se,se>=11904&&se<=55215||se>=63744&&se<=64255||se>=65281&&se<=65374}function oe(se){return se>=127462&&se<=127487||se===8986||se===8987||se===9200||se===9203||se>=9728&&se<=10175||se===11088||se===11093||se>=127744&&se<=128591||se>=128640&&se<=128764||se>=128992&&se<=129003||se>=129280&&se<=129535||se>=129648&&se<=129750}const ue="\uFEFF";function Pe(se){return!!(se&&se.length>0&&se.charCodeAt(0)===65279)}function Ne(se,De=!1){return se?(De&&(se=se.replace(/\\./g,"")),se.toLowerCase()!==se):!1}function Ve(se){return se=se%(2*26),se<26?String.fromCharCode(97+se):String.fromCharCode(65+se-26)}function ot(se){return it.getInstance().getGraphemeBreakType(se)}function Et(se,De){return se===0?De!==5&&De!==7:se===2&&De===3?!1:se===4||se===2||se===3||De===4||De===2||De===3?!0:!(se===8&&(De===8||De===9||De===11||De===12)||(se===11||se===9)&&(De===9||De===10)||(se===12||se===10)&&De===10||De===5||De===13||De===7||se===1||se===13&&De===14||se===6&&De===6)}class it{constructor(){this._data=Ie()}static getInstance(){return it._INSTANCE||(it._INSTANCE=new it),it._INSTANCE}getGraphemeBreakType(De){if(De<32)return De===10?3:De===13?2:4;if(De<127)return 0;const ze=this._data,Ge=ze.length/3;let qe=1;for(;qe<=Ge;)if(De<ze[3*qe])qe=2*qe;else if(De>ze[3*qe+1])qe=2*qe+1;else return ze[3*qe+2];return 0}}it._INSTANCE=null;function Ie(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function He(se,De){if(se===0)return 0;const ze=ht(se,De);if(ze!==void 0)return ze;const Ge=s(De,se);return se-=ft(Ge),se}function ht(se,De){let ze=s(De,se);for(se-=ft(ze);dt(ze)||ze===65039||ze===8419;){if(se===0)return;ze=s(De,se),se-=ft(ze)}if(oe(ze)){if(se>=0){const Ge=s(De,se);Ge===8205&&(se-=ft(Ge))}return se}}function ft(se){return se>=65536?2:1}function dt(se){return 127995<=se&&se<=127999}},98401:function(Ht,at,q){"use strict";q.d(at,{$E:function(){return w},$K:function(){return K},D8:function(){return v},HD:function(){return ge},IU:function(){return p},Jp:function(){return F},Kn:function(){return le},cW:function(){return U},f6:function(){return y},hj:function(){return G},jn:function(){return B},kJ:function(){return me},mf:function(){return L},o8:function(){return V},p_:function(){return i},vE:function(){return M}});function me(d){return Array.isArray(d)}function ge(d){return typeof d=="string"}function le(d){return typeof d=="object"&&d!==null&&!Array.isArray(d)&&!(d instanceof RegExp)&&!(d instanceof Date)}function G(d){return typeof d=="number"&&!isNaN(d)}function B(d){return d===!0||d===!1}function V(d){return typeof d=="undefined"}function K(d){return!F(d)}function F(d){return V(d)||d===null}function i(d,f){if(!d)throw new Error(f?`Unexpected type, expected '${f}'`:"Unexpected type")}function U(d){if(F(d))throw new Error("Assertion Failed: argument is undefined or null");return d}function L(d){return typeof d=="function"}function v(d,f){const u=Math.min(d.length,f.length);for(let h=0;h<u;h++)E(d[h],f[h])}function E(d,f){if(ge(f)){if(typeof d!==f)throw new Error(`argument does not match constraint: typeof ${f}`)}else if(L(f)){try{if(d instanceof f)return}catch(u){}if(!F(d)&&d.constructor===f||f.length===1&&f.call(void 0,d)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function b(d){let f=[],u=Object.getPrototypeOf(d);for(;Object.prototype!==u;)f=f.concat(Object.getOwnPropertyNames(u)),u=Object.getPrototypeOf(u);return f}function w(d){const f=[];for(const u of b(d))typeof d[u]=="function"&&f.push(u);return f}function p(d,f){const u=S=>function(){const k=Array.prototype.slice.call(arguments,0);return f(S,k)};let h={};for(const S of d)h[S]=u(S);return h}function y(d){return d===null?void 0:d}function M(d,f="Unreachable"){throw new Error(f)}},63580:function(Ht,at,q){"use strict";q.d(at,{N:function(){return ge}});function me(le,G){let B;return G.length===0?B=le:B=le.replace(/\{(\d+)\}/g,function(V,K){const F=K[0];return typeof G[F]!="undefined"?G[F]:V}),B}function ge(le,G,...B){return me(G,B)}},84144:function(Ht,at,q){"use strict";q.d(at,{BH:function(){return p},NZ:function(){return y},U8:function(){return M},co:function(){return w},eH:function(){return b},vr:function(){return E}});var me=q(74741),ge=q(73046),le=q(4669),G=q(53725),B=q(9917),V=q(91741),K=q(94565),F=q(38819),i=q(72065),U=q(97781),L=function(d,f,u,h){var S=arguments.length,k=S<3?f:h===null?h=Object.getOwnPropertyDescriptor(f,u):h,m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(d,f,u,h);else for(var A=d.length-1;A>=0;A--)(m=d[A])&&(k=(S<3?m(k):S>3?m(f,u,k):m(f,u))||k);return S>3&&k&&Object.defineProperty(f,u,k),k},v=function(d,f){return function(u,h){f(u,h,d)}};function E(d){return d.command!==void 0}class b{constructor(f){this.id=b._idPool++,this._debugName=f}}b._idPool=0,b.CommandPalette=new b("CommandPalette"),b.EditorContext=new b("EditorContext"),b.SimpleEditorContext=new b("SimpleEditorContext"),b.EditorContextCopy=new b("EditorContextCopy"),b.EditorContextPeek=new b("EditorContextPeek"),b.MenubarEditMenu=new b("MenubarEditMenu"),b.MenubarCopy=new b("MenubarCopy"),b.MenubarGoMenu=new b("MenubarGoMenu"),b.MenubarSelectionMenu=new b("MenubarSelectionMenu"),b.InlineCompletionsActions=new b("InlineCompletionsActions");const w=(0,i.yh)("menuService"),p=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new le.Q5,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:d=>d===b.CommandPalette}}addCommand(d){return this.addCommands(G.$.single(d))}addCommands(d){for(const f of d)this._commands.set(f.id,f);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),(0,B.OF)(()=>{let f=!1;for(const u of d)f=this._commands.delete(u.id)||f;f&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(d){return this._commands.get(d)}getCommands(){const d=new Map;return this._commands.forEach((f,u)=>d.set(u,f)),d}appendMenuItem(d,f){return this.appendMenuItems(G.$.single({id:d,item:f}))}appendMenuItems(d){const f=new Set,u=new V.S;for(const{id:h,item:S}of d){let k=this._menuItems.get(h);k||(k=new V.S,this._menuItems.set(h,k)),u.push(k.push(S)),f.add(h)}return this._onDidChangeMenu.fire(f),(0,B.OF)(()=>{if(u.size>0){for(let h of u)h();this._onDidChangeMenu.fire(f),u.clear()}})}getMenuItems(d){let f;return this._menuItems.has(d)?f=[...this._menuItems.get(d)]:f=[],d===b.CommandPalette&&this._appendImplicitItems(f),f}_appendImplicitItems(d){const f=new Set;for(const u of d)E(u)&&(f.add(u.command.id),u.alt&&f.add(u.alt.id));this._commands.forEach((u,h)=>{f.has(h)||d.push({command:u})})}};class y extends me.wY{constructor(f,u,h,S){super(`submenuitem.${f.submenu.id}`,typeof f.title=="string"?f.title:f.title.value,[],"submenu"),this.item=f,this._menuService=u,this._contextKeyService=h,this._options=S}get actions(){const f=[],u=this._menuService.createMenu(this.item.submenu,this._contextKeyService),h=u.getActions(this._options);u.dispose();for(const[,S]of h)S.length>0&&(f.push(...S),f.push(new me.Z0));return f.length&&f.pop(),f}}let M=class Td{constructor(f,u,h,S,k){var m,A;if(this._commandService=k,this.id=f.id,this.label=h!=null&&h.renderShortTitle&&f.shortTitle?typeof f.shortTitle=="string"?f.shortTitle:f.shortTitle.value:typeof f.title=="string"?f.title:f.title.value,this.tooltip=(A=typeof f.tooltip=="string"?f.tooltip:(m=f.tooltip)===null||m===void 0?void 0:m.value)!==null&&A!==void 0?A:"",this.enabled=!f.precondition||S.contextMatchesRules(f.precondition),this.checked=void 0,f.toggled){const I=f.toggled.condition?f.toggled:{condition:f.toggled};this.checked=S.contextMatchesRules(I.condition),this.checked&&I.tooltip&&(this.tooltip=typeof I.tooltip=="string"?I.tooltip:I.tooltip.value),I.title&&(this.label=typeof I.title=="string"?I.title:I.title.value)}this.item=f,this.alt=u?new Td(u,void 0,h,S,k):void 0,this._options=h,U.kS.isThemeIcon(f.icon)&&(this.class=ge.dT.asClassName(f.icon))}dispose(){}run(...f){var u,h;let S=[];return!((u=this._options)===null||u===void 0)&&u.arg&&(S=[...S,this._options.arg]),!((h=this._options)===null||h===void 0)&&h.shouldForwardArgs&&(S=[...S,...f]),this._commandService.executeCommand(this.id,...S)}};M=L([v(3,F.i6),v(4,K.H)],M)},94565:function(Ht,at,q){"use strict";q.d(at,{H:function(){return K},P:function(){return F}});var me=q(4669),ge=q(53725),le=q(9917),G=q(91741),B=q(98401),V=q(72065);const K=(0,V.yh)("commandService"),F=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new me.Q5,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(i,U){if(!i)throw new Error("invalid command");if(typeof i=="string"){if(!U)throw new Error("invalid command");return this.registerCommand({id:i,handler:U})}if(i.description){const w=[];for(let y of i.description.args)w.push(y.constraint);const p=i.handler;i.handler=function(y,...M){return(0,B.D8)(M,w),p(y,...M)}}const{id:L}=i;let v=this._commands.get(L);v||(v=new G.S,this._commands.set(L,v));let E=v.unshift(i),b=(0,le.OF)(()=>{E();const w=this._commands.get(L);w!=null&&w.isEmpty()&&this._commands.delete(L)});return this._onDidRegisterCommand.fire(L),b}registerCommandAlias(i,U){return F.registerCommand(i,(L,...v)=>L.get(K).executeCommand(U,...v))}getCommand(i){const U=this._commands.get(i);if(!(!U||U.isEmpty()))return ge.$.first(U)}getCommands(){const i=new Map;for(const U of this._commands.keys()){const L=this.getCommand(U);L&&i.set(U,L)}return i}};F.registerCommand("noop",()=>{})},38819:function(Ht,at,q){"use strict";q.d(at,{Ao:function(){return K},Eq:function(){return l},Fb:function(){return F},K8:function(){return g},i6:function(){return P},uy:function(){return C}});var me=q(1432),ge=q(97295),le=q(72065);let G=me.WE||"";const B=new Map;B.set("false",!1),B.set("true",!0),B.set("isMac",me.dz),B.set("isLinux",me.IJ),B.set("isWindows",me.ED),B.set("isWeb",me.$L),B.set("isMacNative",me.dz&&!me.$L),B.set("isEdge",G.indexOf("Edg/")>=0),B.set("isFirefox",G.indexOf("Firefox")>=0),B.set("isChrome",G.indexOf("Chrome")>=0),B.set("isSafari",G.indexOf("Safari")>=0);const V=Object.prototype.hasOwnProperty;class K{static has(x){return v.create(x)}static equals(x,T){return E.create(x,T)}static regex(x,T){return S.create(x,T)}static not(x){return y.create(x)}static and(...x){return A.create(x,null)}static or(...x){return I.create(x,null,!0)}static deserialize(x,T=!1){if(x)return this._deserializeOrExpression(x,T)}static _deserializeOrExpression(x,T){let O=x.split("||");return I.create(O.map($=>this._deserializeAndExpression($,T)),null,!0)}static _deserializeAndExpression(x,T){let O=x.split("&&");return A.create(O.map($=>this._deserializeOne($,T)),null)}static _deserializeOne(x,T){if(x=x.trim(),x.indexOf("!=")>=0){let O=x.split("!=");return p.create(O[0].trim(),this._deserializeValue(O[1],T))}if(x.indexOf("==")>=0){let O=x.split("==");return E.create(O[0].trim(),this._deserializeValue(O[1],T))}if(x.indexOf("=~")>=0){let O=x.split("=~");return S.create(O[0].trim(),this._deserializeRegexValue(O[1],T))}if(x.indexOf(" in ")>=0){let O=x.split(" in ");return b.create(O[0].trim(),O[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(x)){const O=x.split(">=");return f.create(O[0].trim(),O[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(x)){const O=x.split(">");return d.create(O[0].trim(),O[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(x)){const O=x.split("<=");return h.create(O[0].trim(),O[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(x)){const O=x.split("<");return u.create(O[0].trim(),O[1].trim())}return/^\!\s*/.test(x)?y.create(x.substr(1).trim()):v.create(x)}static _deserializeValue(x,T){if(x=x.trim(),x==="true")return!0;if(x==="false")return!1;let O=/^'([^']*)'$/.exec(x);return O?O[1].trim():x}static _deserializeRegexValue(x,T){if((0,ge.m5)(x)){if(T)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let O=x.indexOf("/"),$=x.lastIndexOf("/");if(O===$||O<0){if(T)throw new Error(`bad regexp-value '${x}', missing /-enclosure`);return console.warn(`bad regexp-value '${x}', missing /-enclosure`),null}let H=x.slice(O+1,$),Z=x[$+1]==="i"?"i":"";try{return new RegExp(H,Z)}catch(te){if(T)throw new Error(`bad regexp-value '${x}', parse error: ${te}`);return console.warn(`bad regexp-value '${x}', parse error: ${te}`),null}}}function F(D,x){const T=D?D.substituteConstants():void 0,O=x?x.substituteConstants():void 0;return!T&&!O?!0:!T||!O?!1:T.equals(O)}function i(D,x){return D.cmp(x)}class U{constructor(){this.type=0}cmp(x){return this.type-x.type}equals(x){return x.type===this.type}substituteConstants(){return this}evaluate(x){return!1}serialize(){return"false"}keys(){return[]}negate(){return L.INSTANCE}}U.INSTANCE=new U;class L{constructor(){this.type=1}cmp(x){return this.type-x.type}equals(x){return x.type===this.type}substituteConstants(){return this}evaluate(x){return!0}serialize(){return"true"}keys(){return[]}negate(){return U.INSTANCE}}L.INSTANCE=new L;class v{constructor(x,T){this.key=x,this.negated=T,this.type=2}static create(x,T=null){const O=B.get(x);return typeof O=="boolean"?O?L.INSTANCE:U.INSTANCE:new v(x,T)}cmp(x){return x.type!==this.type?this.type-x.type:c(this.key,x.key)}equals(x){return x.type===this.type?this.key===x.key:!1}substituteConstants(){const x=B.get(this.key);return typeof x=="boolean"?x?L.INSTANCE:U.INSTANCE:this}evaluate(x){return!!x.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=y.create(this.key,this)),this.negated}}class E{constructor(x,T,O){this.key=x,this.value=T,this.negated=O,this.type=4}static create(x,T,O=null){if(typeof T=="boolean")return T?v.create(x,O):y.create(x,O);const $=B.get(x);return typeof $=="boolean"?T===($?"true":"false")?L.INSTANCE:U.INSTANCE:new E(x,T,O)}cmp(x){return x.type!==this.type?this.type-x.type:s(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){const x=B.get(this.key);if(typeof x=="boolean"){const T=x?"true":"false";return this.value===T?L.INSTANCE:U.INSTANCE}return this}evaluate(x){return x.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=p.create(this.key,this.value,this)),this.negated}}class b{constructor(x,T){this.key=x,this.valueKey=T,this.type=10,this.negated=null}static create(x,T){return new b(x,T)}cmp(x){return x.type!==this.type?this.type-x.type:s(this.key,this.valueKey,x.key,x.valueKey)}equals(x){return x.type===this.type?this.key===x.key&&this.valueKey===x.valueKey:!1}substituteConstants(){return this}evaluate(x){const T=x.getValue(this.valueKey),O=x.getValue(this.key);return Array.isArray(T)?T.indexOf(O)>=0:typeof O=="string"&&typeof T=="object"&&T!==null?V.call(T,O):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=w.create(this)),this.negated}}class w{constructor(x){this._actual=x,this.type=11}static create(x){return new w(x)}cmp(x){return x.type!==this.type?this.type-x.type:this._actual.cmp(x._actual)}equals(x){return x.type===this.type?this._actual.equals(x._actual):!1}substituteConstants(){return this}evaluate(x){return!this._actual.evaluate(x)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class p{constructor(x,T,O){this.key=x,this.value=T,this.negated=O,this.type=5}static create(x,T,O=null){if(typeof T=="boolean")return T?y.create(x,O):v.create(x,O);const $=B.get(x);return typeof $=="boolean"?T===($?"true":"false")?U.INSTANCE:L.INSTANCE:new p(x,T,O)}cmp(x){return x.type!==this.type?this.type-x.type:s(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){const x=B.get(this.key);if(typeof x=="boolean"){const T=x?"true":"false";return this.value===T?U.INSTANCE:L.INSTANCE}return this}evaluate(x){return x.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=E.create(this.key,this.value,this)),this.negated}}class y{constructor(x,T){this.key=x,this.negated=T,this.type=3}static create(x,T=null){const O=B.get(x);return typeof O=="boolean"?O?U.INSTANCE:L.INSTANCE:new y(x,T)}cmp(x){return x.type!==this.type?this.type-x.type:c(this.key,x.key)}equals(x){return x.type===this.type?this.key===x.key:!1}substituteConstants(){const x=B.get(this.key);return typeof x=="boolean"?x?U.INSTANCE:L.INSTANCE:this}evaluate(x){return!x.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=v.create(this.key,this)),this.negated}}function M(D,x){if(typeof D=="string"){const T=parseFloat(D);isNaN(T)||(D=T)}return typeof D=="string"||typeof D=="number"?x(D):U.INSTANCE}class d{constructor(x,T,O){this.key=x,this.value=T,this.negated=O,this.type=12}static create(x,T,O=null){return M(T,$=>new d(x,$,O))}cmp(x){return x.type!==this.type?this.type-x.type:s(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){return this}evaluate(x){return typeof this.value=="string"?!1:parseFloat(x.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=h.create(this.key,this.value,this)),this.negated}}class f{constructor(x,T,O){this.key=x,this.value=T,this.negated=O,this.type=13}static create(x,T,O=null){return M(T,$=>new f(x,$,O))}cmp(x){return x.type!==this.type?this.type-x.type:s(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){return this}evaluate(x){return typeof this.value=="string"?!1:parseFloat(x.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=u.create(this.key,this.value,this)),this.negated}}class u{constructor(x,T,O){this.key=x,this.value=T,this.negated=O,this.type=14}static create(x,T,O=null){return M(T,$=>new u(x,$,O))}cmp(x){return x.type!==this.type?this.type-x.type:s(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){return this}evaluate(x){return typeof this.value=="string"?!1:parseFloat(x.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=f.create(this.key,this.value,this)),this.negated}}class h{constructor(x,T,O){this.key=x,this.value=T,this.negated=O,this.type=15}static create(x,T,O=null){return M(T,$=>new h(x,$,O))}cmp(x){return x.type!==this.type?this.type-x.type:s(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){return this}evaluate(x){return typeof this.value=="string"?!1:parseFloat(x.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=d.create(this.key,this.value,this)),this.negated}}class S{constructor(x,T){this.key=x,this.regexp=T,this.type=7,this.negated=null}static create(x,T){return new S(x,T)}cmp(x){if(x.type!==this.type)return this.type-x.type;if(this.key<x.key)return-1;if(this.key>x.key)return 1;const T=this.regexp?this.regexp.source:"",O=x.regexp?x.regexp.source:"";return T<O?-1:T>O?1:0}equals(x){if(x.type===this.type){const T=this.regexp?this.regexp.source:"",O=x.regexp?x.regexp.source:"";return this.key===x.key&&T===O}return!1}substituteConstants(){return this}evaluate(x){let T=x.getValue(this.key);return this.regexp?this.regexp.test(T):!1}serialize(){const x=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${x}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=k.create(this)),this.negated}}class k{constructor(x){this._actual=x,this.type=8}static create(x){return new k(x)}cmp(x){return x.type!==this.type?this.type-x.type:this._actual.cmp(x._actual)}equals(x){return x.type===this.type?this._actual.equals(x._actual):!1}substituteConstants(){return this}evaluate(x){return!this._actual.evaluate(x)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function m(D){let x=null;for(let T=0,O=D.length;T<O;T++){const $=D[T].substituteConstants();if(D[T]!==$&&x===null){x=[];for(let H=0;H<T;H++)x[H]=D[H]}x!==null&&(x[T]=$)}return x===null?D:x}class A{constructor(x,T){this.expr=x,this.negated=T,this.type=6}static create(x,T){return A._normalizeArr(x,T)}cmp(x){if(x.type!==this.type)return this.type-x.type;if(this.expr.length<x.expr.length)return-1;if(this.expr.length>x.expr.length)return 1;for(let T=0,O=this.expr.length;T<O;T++){const $=i(this.expr[T],x.expr[T]);if($!==0)return $}return 0}equals(x){if(x.type===this.type){if(this.expr.length!==x.expr.length)return!1;for(let T=0,O=this.expr.length;T<O;T++)if(!this.expr[T].equals(x.expr[T]))return!1;return!0}return!1}substituteConstants(){const x=m(this.expr);return x===this.expr?this:A.create(x,this.negated)}evaluate(x){for(let T=0,O=this.expr.length;T<O;T++)if(!this.expr[T].evaluate(x))return!1;return!0}static _normalizeArr(x,T){const O=[];let $=!1;for(const H of x)if(H){if(H.type===1){$=!0;continue}if(H.type===0)return U.INSTANCE;if(H.type===6){O.push(...H.expr);continue}O.push(H)}if(O.length===0&&$)return L.INSTANCE;if(O.length!==0){if(O.length===1)return O[0];O.sort(i);for(let H=1;H<O.length;H++)O[H-1].equals(O[H])&&(O.splice(H,1),H--);if(O.length===1)return O[0];for(;O.length>1;){const H=O[O.length-1];if(H.type!==9)break;O.pop();const Z=O.pop(),te=O.length===0,J=I.create(H.expr.map(ie=>A.create([ie,Z],null)),null,te);J&&(O.push(J),O.sort(i))}return O.length===1?O[0]:new A(O,T)}}serialize(){return this.expr.map(x=>x.serialize()).join(" && ")}keys(){const x=[];for(let T of this.expr)x.push(...T.keys());return x}negate(){if(!this.negated){const x=[];for(let T of this.expr)x.push(T.negate());this.negated=I.create(x,this,!0)}return this.negated}}class I{constructor(x,T){this.expr=x,this.negated=T,this.type=9}static create(x,T,O){return I._normalizeArr(x,T,O)}cmp(x){if(x.type!==this.type)return this.type-x.type;if(this.expr.length<x.expr.length)return-1;if(this.expr.length>x.expr.length)return 1;for(let T=0,O=this.expr.length;T<O;T++){const $=i(this.expr[T],x.expr[T]);if($!==0)return $}return 0}equals(x){if(x.type===this.type){if(this.expr.length!==x.expr.length)return!1;for(let T=0,O=this.expr.length;T<O;T++)if(!this.expr[T].equals(x.expr[T]))return!1;return!0}return!1}substituteConstants(){const x=m(this.expr);return x===this.expr?this:I.create(x,this.negated,!1)}evaluate(x){for(let T=0,O=this.expr.length;T<O;T++)if(this.expr[T].evaluate(x))return!0;return!1}static _normalizeArr(x,T,O){let $=[],H=!1;if(x){for(let Z=0,te=x.length;Z<te;Z++){const J=x[Z];if(J){if(J.type===0){H=!0;continue}if(J.type===1)return L.INSTANCE;if(J.type===9){$=$.concat(J.expr);continue}$.push(J)}}if($.length===0&&H)return U.INSTANCE;$.sort(i)}if($.length!==0){if($.length===1)return $[0];for(let Z=1;Z<$.length;Z++)$[Z-1].equals($[Z])&&($.splice(Z,1),Z--);if($.length===1)return $[0];if(O){for(let Z=0;Z<$.length;Z++)for(let te=Z+1;te<$.length;te++)g($[Z],$[te])&&($.splice(te,1),te--);if($.length===1)return $[0]}return new I($,T)}}serialize(){return this.expr.map(x=>x.serialize()).join(" || ")}keys(){const x=[];for(let T of this.expr)x.push(...T.keys());return x}negate(){if(!this.negated){let x=[];for(let T of this.expr)x.push(T.negate());for(;x.length>1;){const T=x.shift(),O=x.shift(),$=[];for(const Z of R(T))for(const te of R(O))$.push(A.create([Z,te],null));const H=x.length===0;x.unshift(I.create($,null,H))}this.negated=x[0]}return this.negated}}class C extends v{constructor(x,T,O){super(x,null),this._defaultValue=T,typeof O=="object"?C._info.push(Object.assign(Object.assign({},O),{key:x})):O!==!0&&C._info.push({key:x,description:O,type:T!=null?typeof T:void 0})}static all(){return C._info.values()}bindTo(x){return x.createKey(this.key,this._defaultValue)}getValue(x){return x.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(x){return E.create(this.key,x)}}C._info=[];const P=(0,le.yh)("contextKeyService"),l="setContext";function c(D,x){return D<x?-1:D>x?1:0}function s(D,x,T,O){return D<T?-1:D>T?1:x<O?-1:x>O?1:0}function g(D,x){if(x.type===6&&D.type!==9&&D.type!==6){for(const $ of x.expr)if(D.equals($))return!0}const T=D.negate(),O=R(T).concat(R(x));O.sort(i);for(let $=0;$<O.length;$++){const Z=O[$].negate();for(let te=$+1;te<O.length;te++){const J=O[te];if(Z.equals(J))return!0}}return!1}function R(D){return D.type===9?D.expr:[D]}},72065:function(Ht,at,q){"use strict";q.d(at,{I8:function(){return me},TG:function(){return ge},jt:function(){return B},yh:function(){return G}});var me;(function(V){V.serviceIds=new Map,V.DI_TARGET="$di$target",V.DI_DEPENDENCIES="$di$dependencies";function K(F){return F[V.DI_DEPENDENCIES]||[]}V.getServiceDependencies=K})(me||(me={}));const ge=G("instantiationService");function le(V,K,F,i){K[me.DI_TARGET]===K?K[me.DI_DEPENDENCIES].push({id:V,index:F,optional:i}):(K[me.DI_DEPENDENCIES]=[{id:V,index:F,optional:i}],K[me.DI_TARGET]=K)}function G(V){if(me.serviceIds.has(V))return me.serviceIds.get(V);const K=function(F,i,U){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");le(K,F,U,!1)};return K.toString=()=>V,me.serviceIds.set(V,K),K}function B(V){return function(K,F,i){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");le(V,K,i,!0)}}},89872:function(Ht,at,q){"use strict";q.d(at,{B:function(){return G}});var me=q(35146),ge=q(98401);class le{constructor(){this.data=new Map}add(V,K){me.ok(ge.HD(V)),me.ok(ge.Kn(K)),me.ok(!this.data.has(V),"There is already an extension with this id"),this.data.set(V,K)}as(V){return this.data.get(V)||null}}const G=new le},92321:function(Ht,at,q){"use strict";q.d(at,{e:function(){return me}});var me;(function(ge){ge.DARK="dark",ge.LIGHT="light",ge.HIGH_CONTRAST="hc"})(me||(me={}))},97781:function(Ht,at,q){"use strict";q.d(at,{EN:function(){return i},IP:function(){return v},Ic:function(){return w},XE:function(){return K},bB:function(){return p},kS:function(){return U},m6:function(){return L}});var me=q(73046),ge=q(4669),le=q(9917),G=q(72065),B=q(89872),V=q(92321);const K=(0,G.yh)("themeService");var F;(function(y){function M(d){return d&&typeof d=="object"&&typeof d.id=="string"}y.isThemeColor=M})(F||(F={}));function i(y){return{id:y}}var U;(function(y){function M(k){return k&&typeof k=="object"&&typeof k.id=="string"&&(typeof k.color=="undefined"||F.isThemeColor(k.color))}y.isThemeIcon=M;const d=new RegExp(`^\\$\\((${me.dT.iconNameExpression}(?:${me.dT.iconModifierExpression})?)\\)$`);function f(k){const m=d.exec(k);if(!m)return;let[,A]=m;return{id:A}}y.fromString=f;function u(k,m){let A=k.id;const I=A.lastIndexOf("~");return I!==-1&&(A=A.substring(0,I)),m&&(A=`${A}~${m}`),{id:A}}y.modify=u;function h(k,m){var A,I;return k.id===m.id&&((A=k.color)===null||A===void 0?void 0:A.id)===((I=m.color)===null||I===void 0?void 0:I.id)}y.isEqual=h;function S(k,m){return{id:k.id,color:m?i(m):void 0}}y.asThemeIcon=S,y.asClassNameArray=me.dT.asClassNameArray,y.asClassName=me.dT.asClassName,y.asCSSSelector=me.dT.asCSSSelector})(U||(U={}));function L(y){switch(y){case V.e.DARK:return"vs-dark";case V.e.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const v={ThemingContribution:"base.contributions.theming"};class E{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new ge.Q5}onColorThemeChange(M){return this.themingParticipants.push(M),this.onThemingParticipantAddedEmitter.fire(M),(0,le.OF)(()=>{const d=this.themingParticipants.indexOf(M);this.themingParticipants.splice(d,1)})}getThemingParticipants(){return this.themingParticipants}}let b=new E;B.B.add(v.ThemingContribution,b);function w(y){return b.onColorThemeChange(y)}class p extends le.JT{constructor(M){super(),this.themeService=M,this.theme=M.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(d=>this.onThemeChange(d)))}onThemeChange(M){this.theme=M,this.updateStyles()}updateStyles(){}}},95860:function(Ht,at,q){"use strict";q.d(at,{Z:function(){return f}});var me=q(87462),ge=q(1413),le=q(4942),G=q(97685),B=q(45987),V=q(94184),K=q.n(V),F=q(67294);function i(u){var h=F.useRef();h.current=u;var S=F.useCallback(function(){for(var k,m=arguments.length,A=new Array(m),I=0;I<m;I++)A[I]=arguments[I];return(k=h.current)===null||k===void 0?void 0:k.call.apply(k,[h].concat(A))},[]);return S}function U(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var L=U()?F.useLayoutEffect:F.useEffect,v=function(h,S){var k=F.useRef(!0);L(function(){return h(k.current)},S),L(function(){return k.current=!1,function(){k.current=!0}},[])},E=function(h,S){v(function(k){if(!k)return h()},S)},b=null;function w(u){var h=F.useRef(!1),S=F.useState(u),k=(0,G.Z)(S,2),m=k[0],A=k[1];F.useEffect(function(){return h.current=!1,function(){h.current=!0}},[]);function I(C,P){P&&h.current||A(C)}return[m,I]}function p(u){return u!==void 0}function y(u,h){var S=h||{},k=S.defaultValue,m=S.value,A=S.onChange,I=S.postState,C=w(function(){return p(m)?m:p(k)?typeof k=="function"?k():k:typeof u=="function"?u():u}),P=(0,G.Z)(C,2),l=P[0],c=P[1],s=m!==void 0?m:l,g=I?I(s):s,R=i(A),D=w([s]),x=(0,G.Z)(D,2),T=x[0],O=x[1];E(function(){var H=T[0];l!==H&&R(l,H)},[T]),E(function(){p(m)||c(m)},[m]);var $=i(function(H,Z){c(H,Z),O([s],Z)});return[g,$]}var M=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],d=(0,F.forwardRef)(function(u,h){var S=u.prefixCls,k=S===void 0?"rc-checkbox":S,m=u.className,A=u.style,I=u.checked,C=u.disabled,P=u.defaultChecked,l=P===void 0?!1:P,c=u.type,s=c===void 0?"checkbox":c,g=u.title,R=u.onChange,D=(0,B.Z)(u,M),x=(0,F.useRef)(null),T=(0,F.useRef)(null),O=y(l,{value:I}),$=(0,G.Z)(O,2),H=$[0],Z=$[1];(0,F.useImperativeHandle)(h,function(){return{focus:function(oe){var ue;(ue=x.current)===null||ue===void 0||ue.focus(oe)},blur:function(){var oe;(oe=x.current)===null||oe===void 0||oe.blur()},input:x.current,nativeElement:T.current}});var te=K()(k,m,(0,le.Z)((0,le.Z)({},"".concat(k,"-checked"),H),"".concat(k,"-disabled"),C)),J=function(oe){C||("checked"in u||Z(oe.target.checked),R==null||R({target:(0,ge.Z)((0,ge.Z)({},u),{},{type:s,checked:oe.target.checked}),stopPropagation:function(){oe.stopPropagation()},preventDefault:function(){oe.preventDefault()},nativeEvent:oe.nativeEvent}))};return F.createElement("span",{className:te,title:g,style:A,ref:T},F.createElement("input",(0,me.Z)({},D,{className:"".concat(k,"-input"),ref:x,onChange:J,disabled:C,checked:!!H,type:s})),F.createElement("span",{className:"".concat(k,"-inner")}))}),f=d},1671:function(Ht,at,q){"use strict";q.d(at,{Z:function(){return Rt}});var me=q(87462),ge=q(4942),le=q(71002),G=q(97685),B=q(45987),V=q(15671),K=q(43144);function F(){return typeof BigInt=="function"}function i(Se){return!Se&&Se!==0&&!Number.isNaN(Se)||!String(Se).trim()}function U(Se){var fe=Se.trim(),Ce=fe.startsWith("-");Ce&&(fe=fe.slice(1)),fe=fe.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,""),fe.startsWith(".")&&(fe="0".concat(fe));var de=fe||"0",pe=de.split("."),xe=pe[0]||"0",Q=pe[1]||"0";xe==="0"&&Q==="0"&&(Ce=!1);var ne=Ce?"-":"";return{negative:Ce,negativeStr:ne,trimStr:de,integerStr:xe,decimalStr:Q,fullStr:"".concat(ne).concat(de)}}function L(Se){var fe=String(Se);return!Number.isNaN(Number(fe))&&fe.includes("e")}function v(Se){var fe=String(Se);if(L(Se)){var Ce=Number(fe.slice(fe.indexOf("e-")+2)),de=fe.match(/\.(\d+)/);return de!=null&&de[1]&&(Ce+=de[1].length),Ce}return fe.includes(".")&&b(fe)?fe.length-fe.indexOf(".")-1:0}function E(Se){var fe=String(Se);if(L(Se)){if(Se>Number.MAX_SAFE_INTEGER)return String(F()?BigInt(Se).toString():Number.MAX_SAFE_INTEGER);if(Se<Number.MIN_SAFE_INTEGER)return String(F()?BigInt(Se).toString():Number.MIN_SAFE_INTEGER);fe=Se.toFixed(v(fe))}return U(fe).fullStr}function b(Se){return typeof Se=="number"?!Number.isNaN(Se):Se?/^\s*-?\d+(\.\d+)?\s*$/.test(Se)||/^\s*-?\d+\.\s*$/.test(Se)||/^\s*-?\.\d+\s*$/.test(Se):!1}var w=function(){function Se(fe){if((0,V.Z)(this,Se),(0,ge.Z)(this,"origin",""),(0,ge.Z)(this,"negative",void 0),(0,ge.Z)(this,"integer",void 0),(0,ge.Z)(this,"decimal",void 0),(0,ge.Z)(this,"decimalLen",void 0),(0,ge.Z)(this,"empty",void 0),(0,ge.Z)(this,"nan",void 0),i(fe)){this.empty=!0;return}if(this.origin=String(fe),fe==="-"||Number.isNaN(fe)){this.nan=!0;return}var Ce=fe;if(L(Ce)&&(Ce=Number(Ce)),Ce=typeof Ce=="string"?Ce:E(Ce),b(Ce)){var de=U(Ce);this.negative=de.negative;var pe=de.trimStr.split(".");this.integer=BigInt(pe[0]);var xe=pe[1]||"0";this.decimal=BigInt(xe),this.decimalLen=xe.length}else this.nan=!0}return(0,K.Z)(Se,[{key:"getMark",value:function(){return this.negative?"-":""}},{key:"getIntegerStr",value:function(){return this.integer.toString()}},{key:"getDecimalStr",value:function(){return this.decimal.toString().padStart(this.decimalLen,"0")}},{key:"alignDecimal",value:function(Ce){var de="".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(Ce,"0"));return BigInt(de)}},{key:"negate",value:function(){var Ce=new Se(this.toString());return Ce.negative=!Ce.negative,Ce}},{key:"cal",value:function(Ce,de,pe){var xe=Math.max(this.getDecimalStr().length,Ce.getDecimalStr().length),Q=this.alignDecimal(xe),ne=Ce.alignDecimal(xe),ce=de(Q,ne).toString(),Ae=pe(xe),be=U(ce),Oe=be.negativeStr,$e=be.trimStr,mt="".concat(Oe).concat($e.padStart(Ae+1,"0"));return new Se("".concat(mt.slice(0,-Ae),".").concat(mt.slice(-Ae)))}},{key:"add",value:function(Ce){if(this.isInvalidate())return new Se(Ce);var de=new Se(Ce);return de.isInvalidate()?this:this.cal(de,function(pe,xe){return pe+xe},function(pe){return pe})}},{key:"multi",value:function(Ce){var de=new Se(Ce);return this.isInvalidate()||de.isInvalidate()?new Se(NaN):this.cal(de,function(pe,xe){return pe*xe},function(pe){return pe*2})}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return this.nan}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(Ce){return this.toString()===(Ce==null?void 0:Ce.toString())}},{key:"lessEquals",value:function(Ce){return this.add(Ce.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return Ce?this.isInvalidate()?"":U("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),Se}(),p=function(){function Se(fe){if((0,V.Z)(this,Se),(0,ge.Z)(this,"origin",""),(0,ge.Z)(this,"number",void 0),(0,ge.Z)(this,"empty",void 0),i(fe)){this.empty=!0;return}this.origin=String(fe),this.number=Number(fe)}return(0,K.Z)(Se,[{key:"negate",value:function(){return new Se(-this.toNumber())}},{key:"add",value:function(Ce){if(this.isInvalidate())return new Se(Ce);var de=Number(Ce);if(Number.isNaN(de))return this;var pe=this.number+de;if(pe>Number.MAX_SAFE_INTEGER)return new Se(Number.MAX_SAFE_INTEGER);if(pe<Number.MIN_SAFE_INTEGER)return new Se(Number.MIN_SAFE_INTEGER);var xe=Math.max(v(this.number),v(de));return new Se(pe.toFixed(xe))}},{key:"multi",value:function(Ce){var de=Number(Ce);if(this.isInvalidate()||Number.isNaN(de))return new Se(NaN);var pe=this.number*de;if(pe>Number.MAX_SAFE_INTEGER)return new Se(Number.MAX_SAFE_INTEGER);if(pe<Number.MIN_SAFE_INTEGER)return new Se(Number.MIN_SAFE_INTEGER);var xe=Math.max(v(this.number),v(de));return new Se(pe.toFixed(xe))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return Number.isNaN(this.number)}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(Ce){return this.toNumber()===(Ce==null?void 0:Ce.toNumber())}},{key:"lessEquals",value:function(Ce){return this.add(Ce.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.number}},{key:"toString",value:function(){var Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return Ce?this.isInvalidate()?"":E(this.number):this.origin}}]),Se}();function y(Se){return F()?new w(Se):new p(Se)}function M(Se,fe,Ce){var de=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(Se==="")return"";var pe=U(Se),xe=pe.negativeStr,Q=pe.integerStr,ne=pe.decimalStr,ce="".concat(fe).concat(ne),Ae="".concat(xe).concat(Q);if(Ce>=0){var be=Number(ne[Ce]);if(be>=5&&!de){var Oe=y(Se).add("".concat(xe,"0.").concat("0".repeat(Ce)).concat(10-be));return M(Oe.toString(),fe,Ce,de)}return Ce===0?Ae:"".concat(Ae).concat(fe).concat(ne.padEnd(Ce,"0").slice(0,Ce))}return ce===".0"?Ae:"".concat(Ae).concat(ce)}var d=y,f=q(94184),u=q.n(f),h=q(67656),S=q(67294);function k(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var m=k()?S.useLayoutEffect:S.useEffect,A=function(fe,Ce){var de=S.useRef(!0);m(function(){return fe(de.current)},Ce),m(function(){return de.current=!1,function(){de.current=!0}},[])},I=function(fe,Ce){A(function(de){if(!de)return fe()},Ce)},C=A;function P(Se,fe){return typeof Proxy!="undefined"&&Se?new Proxy(Se,{get:function(de,pe){if(fe[pe])return fe[pe];var xe=de[pe];return typeof xe=="function"?xe.bind(de):xe}}):Se}var l=q(27183);function c(Se,fe,Ce){var de=React.useRef({});return(!("value"in de.current)||Ce(de.current.condition,fe))&&(de.current.value=Se(),de.current.condition=fe),de.current.value}var s=Symbol.for("react.element"),g=Symbol.for("react.transitional.element"),R=Symbol.for("react.fragment");function D(Se){return Se&&_typeof(Se)==="object"&&(Se.$$typeof===s||Se.$$typeof===g)&&Se.type===R}var x=Number(S.version.split(".")[0]),T=function(fe,Ce){typeof fe=="function"?fe(Ce):(0,le.Z)(fe)==="object"&&fe&&"current"in fe&&(fe.current=Ce)},O=function(){for(var fe=arguments.length,Ce=new Array(fe),de=0;de<fe;de++)Ce[de]=arguments[de];var pe=Ce.filter(Boolean);return pe.length<=1?pe[0]:function(xe){Ce.forEach(function(Q){T(Q,xe)})}},$=function(){for(var fe=arguments.length,Ce=new Array(fe),de=0;de<fe;de++)Ce[de]=arguments[de];return useMemo(function(){return O.apply(void 0,Ce)},Ce,function(pe,xe){return pe.length!==xe.length||pe.every(function(Q,ne){return Q!==xe[ne]})})},H=function(fe){var Ce,de;if(!fe)return!1;if(Z(fe)&&x>=19)return!0;var pe=isMemo(fe)?fe.type.type:fe.type;return!(typeof pe=="function"&&!((Ce=pe.prototype)!==null&&Ce!==void 0&&Ce.render)&&pe.$$typeof!==ForwardRef||typeof fe=="function"&&!((de=fe.prototype)!==null&&de!==void 0&&de.render)&&fe.$$typeof!==ForwardRef)};function Z(Se){return isValidElement(Se)&&!isFragment(Se)}var te=function(fe){return Z(fe)&&H(fe)},J=function(fe){if(fe&&Z(fe)){var Ce=fe;return Ce.props.propertyIsEnumerable("ref")?Ce.props.ref:Ce.ref}return null},ie={},oe=[],ue=function(fe){oe.push(fe)};function Pe(Se,fe){if(0)var Ce}function Ne(Se,fe){if(0)var Ce}function Ve(){ie={}}function ot(Se,fe,Ce){!fe&&!ie[Ce]&&(Se(!1,Ce),ie[Ce]=!0)}function Et(Se,fe){ot(Pe,Se,fe)}function it(Se,fe){ot(Ne,Se,fe)}Et.preMessage=ue,Et.resetWarned=Ve,Et.noteOnce=it;var Ie=Et;function He(Se,fe){var Ce=(0,S.useRef)(null);function de(){try{var xe=Se.selectionStart,Q=Se.selectionEnd,ne=Se.value,ce=ne.substring(0,xe),Ae=ne.substring(Q);Ce.current={start:xe,end:Q,value:ne,beforeTxt:ce,afterTxt:Ae}}catch(be){}}function pe(){if(Se&&Ce.current&&fe)try{var xe=Se.value,Q=Ce.current,ne=Q.beforeTxt,ce=Q.afterTxt,Ae=Q.start,be=xe.length;if(xe.startsWith(ne))be=ne.length;else if(xe.endsWith(ce))be=xe.length-Ce.current.afterTxt.length;else{var Oe=ne[Ae-1],$e=xe.indexOf(Oe,Ae-1);$e!==-1&&(be=$e+1)}Se.setSelectionRange(be,be)}catch(mt){Ie(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(mt.message))}}return[de,pe]}var ht=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Se=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Se)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Se==null?void 0:Se.substr(0,4))},ft=function(){var fe=(0,S.useState)(!1),Ce=(0,G.Z)(fe,2),de=Ce[0],pe=Ce[1];return C(function(){pe(ht())},[]),de},dt=ft,se=function(fe){return+setTimeout(fe,16)},De=function(fe){return clearTimeout(fe)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(se=function(fe){return window.requestAnimationFrame(fe)},De=function(fe){return window.cancelAnimationFrame(fe)});var ze=0,Ge=new Map;function qe(Se){Ge.delete(Se)}var vt=function(fe){var Ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;ze+=1;var de=ze;function pe(xe){if(xe===0)qe(de),fe();else{var Q=se(function(){pe(xe-1)});Ge.set(de,Q)}}return pe(Ce),de};vt.cancel=function(Se){var fe=Ge.get(Se);return qe(Se),De(fe)};var Ut=vt,bt=200,ke=600;function lt(Se){var fe=Se.prefixCls,Ce=Se.upNode,de=Se.downNode,pe=Se.upDisabled,xe=Se.downDisabled,Q=Se.onStep,ne=S.useRef(),ce=S.useRef([]),Ae=S.useRef();Ae.current=Q;var be=function(){clearTimeout(ne.current)},Oe=function(ur,ir){ur.preventDefault(),be(),Ae.current(ir);function cr(){Ae.current(ir),ne.current=setTimeout(cr,bt)}ne.current=setTimeout(cr,ke)};S.useEffect(function(){return function(){be(),ce.current.forEach(function(Tt){return Ut.cancel(Tt)})}},[]);var $e=dt();if($e)return null;var mt="".concat(fe,"-handler"),Mt=u()(mt,"".concat(mt,"-up"),(0,ge.Z)({},"".concat(mt,"-up-disabled"),pe)),Jt=u()(mt,"".concat(mt,"-down"),(0,ge.Z)({},"".concat(mt,"-down-disabled"),xe)),jt=function(){return ce.current.push(Ut(be))},rt={unselectable:"on",role:"button",onMouseUp:jt,onMouseLeave:jt};return S.createElement("div",{className:"".concat(mt,"-wrap")},S.createElement("span",(0,me.Z)({},rt,{onMouseDown:function(ur){Oe(ur,!0)},"aria-label":"Increase Value","aria-disabled":pe,className:Mt}),Ce||S.createElement("span",{unselectable:"on",className:"".concat(fe,"-handler-up-inner")})),S.createElement("span",(0,me.Z)({},rt,{onMouseDown:function(ur){Oe(ur,!1)},"aria-label":"Decrease Value","aria-disabled":xe,className:Jt}),de||S.createElement("span",{unselectable:"on",className:"".concat(fe,"-handler-down-inner")})))}function $t(Se){var fe=typeof Se=="number"?E(Se):U(Se).fullStr,Ce=fe.includes(".");return Ce?U(fe.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:Se+"0"}var tt=q(87887),Ze=function(){var Se=(0,S.useRef)(0),fe=function(){Ut.cancel(Se.current)};return(0,S.useEffect)(function(){return fe},[]),function(Ce){fe(),Se.current=Ut(function(){Ce()})}},Je=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","changeOnWheel","controls","classNames","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep","changeOnBlur","domRef"],pt=["disabled","style","prefixCls","value","prefix","suffix","addonBefore","addonAfter","className","classNames"],je=function(fe,Ce){return fe||Ce.isEmpty()?Ce.toString():Ce.toNumber()},_t=function(fe){var Ce=d(fe);return Ce.isInvalidate()?null:Ce},xt=S.forwardRef(function(Se,fe){var Ce=Se.prefixCls,de=Se.className,pe=Se.style,xe=Se.min,Q=Se.max,ne=Se.step,ce=ne===void 0?1:ne,Ae=Se.defaultValue,be=Se.value,Oe=Se.disabled,$e=Se.readOnly,mt=Se.upHandler,Mt=Se.downHandler,Jt=Se.keyboard,jt=Se.changeOnWheel,rt=jt===void 0?!1:jt,Tt=Se.controls,ur=Tt===void 0?!0:Tt,ir=Se.classNames,cr=Se.stringMode,Ur=Se.parser,ar=Se.formatter,Er=Se.precision,Yr=Se.decimalSeparator,Hn=Se.onChange,Mn=Se.onInput,ei=Se.onPressEnter,mi=Se.onStep,ti=Se.changeOnBlur,en=ti===void 0?!0:ti,Fi=Se.domRef,Bi=(0,B.Z)(Se,Je),Vi="".concat(Ce,"-input"),vi=S.useRef(null),Ia=S.useState(!1),ki=(0,G.Z)(Ia,2),qi=ki[0],Ui=ki[1],Si=S.useRef(!1),gi=S.useRef(!1),zi=S.useRef(!1),hn=S.useState(function(){return d(be!=null?be:Ae)}),dn=(0,G.Z)(hn,2),Sr=dn[0],_i=dn[1];function is(Te){be===void 0&&_i(Te)}var Oa=S.useCallback(function(Te,Le){if(!Le)return Er>=0?Er:Math.max(v(Te),v(ce))},[Er,ce]),jn=S.useCallback(function(Te){var Le=String(Te);if(Ur)return Ur(Le);var Me=Le;return Yr&&(Me=Me.replace(Yr,".")),Me.replace(/[^\w.-]+/g,"")},[Ur,Yr]),ya=S.useRef(""),Ha=S.useCallback(function(Te,Le){if(ar)return ar(Te,{userTyping:Le,input:String(ya.current)});var Me=typeof Te=="number"?E(Te):Te;if(!Le){var Re=Oa(Me,Le);if(b(Me)&&(Yr||Re>=0)){var Ke=Yr||".";Me=M(Me,Ke,Re)}}return Me},[ar,Oa,Yr]),Ms=S.useState(function(){var Te=Ae!=null?Ae:be;return Sr.isInvalidate()&&["string","number"].includes((0,le.Z)(Te))?Number.isNaN(Te)?"":Te:Ha(Sr.toString(),!1)}),Fa=(0,G.Z)(Ms,2),Ee=Fa[0],we=Fa[1];ya.current=Ee;function We(Te,Le){we(Ha(Te.isInvalidate()?Te.toString(!1):Te.toString(!Le),Le))}var Ye=S.useMemo(function(){return _t(Q)},[Q,Er]),ut=S.useMemo(function(){return _t(xe)},[xe,Er]),At=S.useMemo(function(){return!Ye||!Sr||Sr.isInvalidate()?!1:Ye.lessEquals(Sr)},[Ye,Sr]),Ct=S.useMemo(function(){return!ut||!Sr||Sr.isInvalidate()?!1:Sr.lessEquals(ut)},[ut,Sr]),Pt=He(vi.current,qi),Nt=(0,G.Z)(Pt,2),er=Nt[0],mr=Nt[1],Zt=function(Le){return Ye&&!Le.lessEquals(Ye)?Ye:ut&&!ut.lessEquals(Le)?ut:null},yr=function(Le){return!Zt(Le)},Mr=function(Le,Me){var Re=Le,Ke=yr(Re)||Re.isEmpty();if(!Re.isEmpty()&&!Me&&(Re=Zt(Re)||Re,Ke=!0),!$e&&!Oe&&Ke){var Xe=Re.toString(),Dt=Oa(Xe,Me);return Dt>=0&&(Re=d(M(Xe,".",Dt)),yr(Re)||(Re=d(M(Xe,".",Dt,!0)))),Re.equals(Sr)||(is(Re),Hn==null||Hn(Re.isEmpty()?null:je(cr,Re)),be===void 0&&We(Re,Me)),Re}return Sr},jr=Ze(),Pr=function Te(Le){if(er(),ya.current=Le,we(Le),!gi.current){var Me=jn(Le),Re=d(Me);Re.isNaN()||Mr(Re,!0)}Mn==null||Mn(Le),jr(function(){var Ke=Le;Ur||(Ke=Le.replace(/。/g,".")),Ke!==Le&&Te(Ke)})},Gr=function(){gi.current=!0},Dr=function(){gi.current=!1,Pr(vi.current.value)},Ar=function(Le){Pr(Le.target.value)},fr=function(Le){var Me;if(!(Le&&At||!Le&&Ct)){Si.current=!1;var Re=d(zi.current?$t(ce):ce);Le||(Re=Re.negate());var Ke=(Sr||d(0)).add(Re.toString()),Xe=Mr(Ke,!1);mi==null||mi(je(cr,Xe),{offset:zi.current?$t(ce):ce,type:Le?"up":"down"}),(Me=vi.current)===null||Me===void 0||Me.focus()}},kr=function(Le){var Me=d(jn(Ee)),Re;Me.isNaN()?Re=Mr(Sr,Le):Re=Mr(Me,Le),be!==void 0?We(Sr,!1):Re.isNaN()||We(Re,!1)},Pn=function(){Si.current=!0},yn=function(Le){var Me=Le.key,Re=Le.shiftKey;Si.current=!0,zi.current=Re,Me==="Enter"&&(gi.current||(Si.current=!1),kr(!1),ei==null||ei(Le)),Jt!==!1&&!gi.current&&["Up","ArrowUp","Down","ArrowDown"].includes(Me)&&(fr(Me==="Up"||Me==="ArrowUp"),Le.preventDefault())},Nn=function(){Si.current=!1,zi.current=!1};S.useEffect(function(){if(rt&&qi){var Te=function(Re){fr(Re.deltaY<0),Re.preventDefault()},Le=vi.current;if(Le)return Le.addEventListener("wheel",Te,{passive:!1}),function(){return Le.removeEventListener("wheel",Te)}}});var ve=function(){en&&kr(!1),Ui(!1),Si.current=!1};return I(function(){Sr.isInvalidate()||We(Sr,!1)},[Er,ar]),I(function(){var Te=d(be);_i(Te);var Le=d(jn(Ee));(!Te.equals(Le)||!Si.current||ar)&&We(Te,Si.current)},[be]),I(function(){ar&&mr()},[Ee]),S.createElement("div",{ref:Fi,className:u()(Ce,de,(0,ge.Z)((0,ge.Z)((0,ge.Z)((0,ge.Z)((0,ge.Z)({},"".concat(Ce,"-focused"),qi),"".concat(Ce,"-disabled"),Oe),"".concat(Ce,"-readonly"),$e),"".concat(Ce,"-not-a-number"),Sr.isNaN()),"".concat(Ce,"-out-of-range"),!Sr.isInvalidate()&&!yr(Sr))),style:pe,onFocus:function(){Ui(!0)},onBlur:ve,onKeyDown:yn,onKeyUp:Nn,onCompositionStart:Gr,onCompositionEnd:Dr,onBeforeInput:Pn},ur&&S.createElement(lt,{prefixCls:Ce,upNode:mt,downNode:Mt,upDisabled:At,downDisabled:Ct,onStep:fr}),S.createElement("div",{className:"".concat(Vi,"-wrap")},S.createElement("input",(0,me.Z)({autoComplete:"off",role:"spinbutton","aria-valuemin":xe,"aria-valuemax":Q,"aria-valuenow":Sr.isInvalidate()?null:Sr.toString(),step:ce},Bi,{ref:O(vi,fe),className:Vi,value:Ee,onChange:Ar,disabled:Oe,readOnly:$e}))))}),Kt=S.forwardRef(function(Se,fe){var Ce=Se.disabled,de=Se.style,pe=Se.prefixCls,xe=pe===void 0?"rc-input-number":pe,Q=Se.value,ne=Se.prefix,ce=Se.suffix,Ae=Se.addonBefore,be=Se.addonAfter,Oe=Se.className,$e=Se.classNames,mt=(0,B.Z)(Se,pt),Mt=S.useRef(null),Jt=S.useRef(null),jt=S.useRef(null),rt=function(ur){jt.current&&(0,tt.nH)(jt.current,ur)};return S.useImperativeHandle(fe,function(){return P(jt.current,{focus:rt,nativeElement:Mt.current.nativeElement||Jt.current})}),S.createElement(h.BaseInput,{className:Oe,triggerFocus:rt,prefixCls:xe,value:Q,disabled:Ce,style:de,prefix:ne,suffix:ce,addonAfter:be,addonBefore:Ae,classNames:$e,components:{affixWrapper:"div",groupWrapper:"div",wrapper:"div",groupAddon:"div"},ref:Mt},S.createElement(xt,(0,me.Z)({prefixCls:xe,disabled:Ce,ref:jt,domRef:Jt,className:$e==null?void 0:$e.input},mt)))}),Bt=Kt,Rt=Bt},82523:function(Ht,at){"use strict";var q;var me=Symbol.for("react.element"),ge=Symbol.for("react.portal"),le=Symbol.for("react.fragment"),G=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),V=Symbol.for("react.provider"),K=Symbol.for("react.context"),F=Symbol.for("react.server_context"),i=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),v=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),w;w=Symbol.for("react.module.reference");function p(y){if(typeof y=="object"&&y!==null){var M=y.$$typeof;switch(M){case me:switch(y=y.type,y){case le:case B:case G:case U:case L:return y;default:switch(y=y&&y.$$typeof,y){case F:case K:case i:case E:case v:case V:return y;default:return M}}case ge:return M}}}q=K,q=V,q=me,q=i,q=le,q=E,q=v,q=ge,q=B,q=G,q=U,q=L,q=function(){return!1},q=function(){return!1},q=function(y){return p(y)===K},q=function(y){return p(y)===V},q=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===me},q=function(y){return p(y)===i},q=function(y){return p(y)===le},q=function(y){return p(y)===E},q=function(y){return p(y)===v},q=function(y){return p(y)===ge},q=function(y){return p(y)===B},q=function(y){return p(y)===G},q=function(y){return p(y)===U},q=function(y){return p(y)===L},q=function(y){return typeof y=="string"||typeof y=="function"||y===le||y===B||y===G||y===U||y===L||y===b||typeof y=="object"&&y!==null&&(y.$$typeof===E||y.$$typeof===v||y.$$typeof===V||y.$$typeof===K||y.$$typeof===i||y.$$typeof===w||y.getModuleId!==void 0)},q=p},27183:function(Ht,at,q){"use strict";q(82523)},82234:function(Ht,at,q){"use strict";q.d(at,{Z:function(){return K}});var me=q(45987),ge=q(1413),le=q(71002),G=q(67294),B=["show"];function V(F,i){if(!i.max)return!0;var U=i.strategy(F);return U<=i.max}function K(F,i){return G.useMemo(function(){var U={};i&&(U.show=(0,le.Z)(i)==="object"&&i.formatter?i.formatter:!!i),U=(0,ge.Z)((0,ge.Z)({},U),F);var L=U,v=L.show,E=(0,me.Z)(L,B);return(0,ge.Z)((0,ge.Z)({},E),{},{show:!!v,showFormatter:typeof v=="function"?v:void 0,strategy:E.strategy||function(b){return b.length}})},[F,i])}},67656:function(Ht,at,q){"use strict";q.r(at),q.d(at,{BaseInput:function(){return U},default:function(){return f}});var me=q(1413),ge=q(87462),le=q(4942),G=q(71002),B=q(94184),V=q.n(B),K=q(67294),F=q(87887),i=K.forwardRef(function(u,h){var S,k,m,A=u.inputElement,I=u.children,C=u.prefixCls,P=u.prefix,l=u.suffix,c=u.addonBefore,s=u.addonAfter,g=u.className,R=u.style,D=u.disabled,x=u.readOnly,T=u.focused,O=u.triggerFocus,$=u.allowClear,H=u.value,Z=u.handleReset,te=u.hidden,J=u.classes,ie=u.classNames,oe=u.dataAttrs,ue=u.styles,Pe=u.components,Ne=u.onClear,Ve=I!=null?I:A,ot=(Pe==null?void 0:Pe.affixWrapper)||"span",Et=(Pe==null?void 0:Pe.groupWrapper)||"span",it=(Pe==null?void 0:Pe.wrapper)||"span",Ie=(Pe==null?void 0:Pe.groupAddon)||"span",He=(0,K.useRef)(null),ht=function(pt){var je;(je=He.current)!==null&&je!==void 0&&je.contains(pt.target)&&(O==null||O())},ft=(0,F.X3)(u),dt=(0,K.cloneElement)(Ve,{value:H,className:V()((S=Ve.props)===null||S===void 0?void 0:S.className,!ft&&(ie==null?void 0:ie.variant))||null}),se=(0,K.useRef)(null);if(K.useImperativeHandle(h,function(){return{nativeElement:se.current||He.current}}),ft){var De=null;if($){var ze=!D&&!x&&H,Ge="".concat(C,"-clear-icon"),qe=(0,G.Z)($)==="object"&&$!==null&&$!==void 0&&$.clearIcon?$.clearIcon:"\u2716";De=K.createElement("button",{type:"button",tabIndex:-1,onClick:function(pt){Z==null||Z(pt),Ne==null||Ne()},onMouseDown:function(pt){return pt.preventDefault()},className:V()(Ge,(0,le.Z)((0,le.Z)({},"".concat(Ge,"-hidden"),!ze),"".concat(Ge,"-has-suffix"),!!l))},qe)}var vt="".concat(C,"-affix-wrapper"),Ut=V()(vt,(0,le.Z)((0,le.Z)((0,le.Z)((0,le.Z)((0,le.Z)({},"".concat(C,"-disabled"),D),"".concat(vt,"-disabled"),D),"".concat(vt,"-focused"),T),"".concat(vt,"-readonly"),x),"".concat(vt,"-input-with-clear-btn"),l&&$&&H),J==null?void 0:J.affixWrapper,ie==null?void 0:ie.affixWrapper,ie==null?void 0:ie.variant),bt=(l||$)&&K.createElement("span",{className:V()("".concat(C,"-suffix"),ie==null?void 0:ie.suffix),style:ue==null?void 0:ue.suffix},De,l);dt=K.createElement(ot,(0,ge.Z)({className:Ut,style:ue==null?void 0:ue.affixWrapper,onClick:ht},oe==null?void 0:oe.affixWrapper,{ref:He}),P&&K.createElement("span",{className:V()("".concat(C,"-prefix"),ie==null?void 0:ie.prefix),style:ue==null?void 0:ue.prefix},P),dt,bt)}if((0,F.He)(u)){var ke="".concat(C,"-group"),lt="".concat(ke,"-addon"),$t="".concat(ke,"-wrapper"),tt=V()("".concat(C,"-wrapper"),ke,J==null?void 0:J.wrapper,ie==null?void 0:ie.wrapper),Ze=V()($t,(0,le.Z)({},"".concat($t,"-disabled"),D),J==null?void 0:J.group,ie==null?void 0:ie.groupWrapper);dt=K.createElement(Et,{className:Ze,ref:se},K.createElement(it,{className:tt},c&&K.createElement(Ie,{className:lt},c),dt,s&&K.createElement(Ie,{className:lt},s)))}return K.cloneElement(dt,{className:V()((k=dt.props)===null||k===void 0?void 0:k.className,g)||null,style:(0,me.Z)((0,me.Z)({},(m=dt.props)===null||m===void 0?void 0:m.style),R),hidden:te})}),U=i,L=q(74902),v=q(97685),E=q(45987),b=q(21770),w=q(98423),p=q(82234),y=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","onKeyUp","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],M=(0,K.forwardRef)(function(u,h){var S=u.autoComplete,k=u.onChange,m=u.onFocus,A=u.onBlur,I=u.onPressEnter,C=u.onKeyDown,P=u.onKeyUp,l=u.prefixCls,c=l===void 0?"rc-input":l,s=u.disabled,g=u.htmlSize,R=u.className,D=u.maxLength,x=u.suffix,T=u.showCount,O=u.count,$=u.type,H=$===void 0?"text":$,Z=u.classes,te=u.classNames,J=u.styles,ie=u.onCompositionStart,oe=u.onCompositionEnd,ue=(0,E.Z)(u,y),Pe=(0,K.useState)(!1),Ne=(0,v.Z)(Pe,2),Ve=Ne[0],ot=Ne[1],Et=(0,K.useRef)(!1),it=(0,K.useRef)(!1),Ie=(0,K.useRef)(null),He=(0,K.useRef)(null),ht=function(Ce){Ie.current&&(0,F.nH)(Ie.current,Ce)},ft=(0,b.Z)(u.defaultValue,{value:u.value}),dt=(0,v.Z)(ft,2),se=dt[0],De=dt[1],ze=se==null?"":String(se),Ge=(0,K.useState)(null),qe=(0,v.Z)(Ge,2),vt=qe[0],Ut=qe[1],bt=(0,p.Z)(O,T),ke=bt.max||D,lt=bt.strategy(ze),$t=!!ke&&lt>ke;(0,K.useImperativeHandle)(h,function(){var fe;return{focus:ht,blur:function(){var de;(de=Ie.current)===null||de===void 0||de.blur()},setSelectionRange:function(de,pe,xe){var Q;(Q=Ie.current)===null||Q===void 0||Q.setSelectionRange(de,pe,xe)},select:function(){var de;(de=Ie.current)===null||de===void 0||de.select()},input:Ie.current,nativeElement:((fe=He.current)===null||fe===void 0?void 0:fe.nativeElement)||Ie.current}}),(0,K.useEffect)(function(){it.current&&(it.current=!1),ot(function(fe){return fe&&s?!1:fe})},[s]);var tt=function(Ce,de,pe){var xe=de;if(!Et.current&&bt.exceedFormatter&&bt.max&&bt.strategy(de)>bt.max){if(xe=bt.exceedFormatter(de,{max:bt.max}),de!==xe){var Q,ne;Ut([((Q=Ie.current)===null||Q===void 0?void 0:Q.selectionStart)||0,((ne=Ie.current)===null||ne===void 0?void 0:ne.selectionEnd)||0])}}else if(pe.source==="compositionEnd")return;De(xe),Ie.current&&(0,F.rJ)(Ie.current,Ce,k,xe)};(0,K.useEffect)(function(){if(vt){var fe;(fe=Ie.current)===null||fe===void 0||fe.setSelectionRange.apply(fe,(0,L.Z)(vt))}},[vt]);var Ze=function(Ce){tt(Ce,Ce.target.value,{source:"change"})},Je=function(Ce){Et.current=!1,tt(Ce,Ce.currentTarget.value,{source:"compositionEnd"}),oe==null||oe(Ce)},pt=function(Ce){I&&Ce.key==="Enter"&&!it.current&&(it.current=!0,I(Ce)),C==null||C(Ce)},je=function(Ce){Ce.key==="Enter"&&(it.current=!1),P==null||P(Ce)},_t=function(Ce){ot(!0),m==null||m(Ce)},xt=function(Ce){it.current&&(it.current=!1),ot(!1),A==null||A(Ce)},Kt=function(Ce){De(""),ht(),Ie.current&&(0,F.rJ)(Ie.current,Ce,k)},Bt=$t&&"".concat(c,"-out-of-range"),Rt=function(){var Ce=(0,w.Z)(u,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames","onClear"]);return K.createElement("input",(0,ge.Z)({autoComplete:S},Ce,{onChange:Ze,onFocus:_t,onBlur:xt,onKeyDown:pt,onKeyUp:je,className:V()(c,(0,le.Z)({},"".concat(c,"-disabled"),s),te==null?void 0:te.input),style:J==null?void 0:J.input,ref:Ie,size:g,type:H,onCompositionStart:function(pe){Et.current=!0,ie==null||ie(pe)},onCompositionEnd:Je}))},Se=function(){var Ce=Number(ke)>0;if(x||bt.show){var de=bt.showFormatter?bt.showFormatter({value:ze,count:lt,maxLength:ke}):"".concat(lt).concat(Ce?" / ".concat(ke):"");return K.createElement(K.Fragment,null,bt.show&&K.createElement("span",{className:V()("".concat(c,"-show-count-suffix"),(0,le.Z)({},"".concat(c,"-show-count-has-suffix"),!!x),te==null?void 0:te.count),style:(0,me.Z)({},J==null?void 0:J.count)},de),x)}return null};return K.createElement(U,(0,ge.Z)({},ue,{prefixCls:c,className:V()(R,Bt),handleReset:Kt,value:ze,focused:Ve,triggerFocus:ht,suffix:Se(),disabled:s,classes:Z,classNames:te,styles:J}),Rt())}),d=M,f=d},87887:function(Ht,at,q){"use strict";q.d(at,{He:function(){return me},X3:function(){return ge},nH:function(){return B},rJ:function(){return G}});function me(V){return!!(V.addonBefore||V.addonAfter)}function ge(V){return!!(V.prefix||V.suffix||V.allowClear)}function le(V,K,F){var i=K.cloneNode(!0),U=Object.create(V,{target:{value:i},currentTarget:{value:i}});return i.value=F,typeof K.selectionStart=="number"&&typeof K.selectionEnd=="number"&&(i.selectionStart=K.selectionStart,i.selectionEnd=K.selectionEnd),i.setSelectionRange=function(){K.setSelectionRange.apply(K,arguments)},U}function G(V,K,F,i){if(F){var U=K;if(K.type==="click"){U=le(K,V,""),F(U);return}if(V.type!=="file"&&i!==void 0){U=le(K,V,i),F(U);return}F(U)}}function B(V,K){if(V){V.focus(K);var F=K||{},i=F.cursor;if(i){var U=V.value.length;switch(i){case"start":V.setSelectionRange(0,0);break;case"end":V.setSelectionRange(U,U);break;default:V.setSelectionRange(0,U)}}}}},78595:function(Ht,at,q){"use strict";q.d(at,{iz:function(){return mr},ck:function(){return gi},BW:function(){return jr},sN:function(){return gi},Wd:function(){return Nt},ZP:function(){return Nn},Xl:function(){return vt}});var me=q(87462),ge=q(4942),le=q(1413),G=q(74902),B=q(97685),V=q(45987),K=q(94184),F=q.n(K),i=q(67294),U=q(48555);function L(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var v=L()?i.useLayoutEffect:i.useEffect,E=function(Te,Le){var Me=i.useRef(!0);v(function(){return Te(Me.current)},Le),v(function(){return Me.current=!1,function(){Me.current=!0}},[])},b=function(Te,Le){E(function(Me){if(!Me)return Te()},Le)},w=E,p=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],y=void 0;function M(ve,Te){var Le=ve.prefixCls,Me=ve.invalidate,Re=ve.item,Ke=ve.renderItem,Xe=ve.responsive,Dt=ve.responsiveDisabled,Xt=ve.registerSize,Wt=ve.itemKey,gr=ve.className,hr=ve.style,br=ve.children,Cr=ve.display,lr=ve.order,tr=ve.component,sr=tr===void 0?"div":tr,Y=(0,V.Z)(ve,p),re=Xe&&!Cr;function ee(Ft){Xt(Wt,Ft)}i.useEffect(function(){return function(){ee(null)}},[]);var ye=Ke&&Re!==y?Ke(Re):br,Fe;Me||(Fe={opacity:re?0:1,height:re?0:y,overflowY:re?"hidden":y,order:Xe?lr:y,pointerEvents:re?"none":y,position:re?"absolute":y});var et={};re&&(et["aria-hidden"]=!0);var ct=i.createElement(sr,(0,me.Z)({className:F()(!Me&&Le,gr),style:(0,le.Z)((0,le.Z)({},Fe),hr)},et,Y,{ref:Te}),ye);return Xe&&(ct=i.createElement(U.Z,{onResize:function(Ot){var It=Ot.offsetWidth;ee(It)},disabled:Dt},ct)),ct}var d=i.forwardRef(M);d.displayName="Item";var f=d;function u(ve){var Te=i.useRef();Te.current=ve;var Le=i.useCallback(function(){for(var Me,Re=arguments.length,Ke=new Array(Re),Xe=0;Xe<Re;Xe++)Ke[Xe]=arguments[Xe];return(Me=Te.current)===null||Me===void 0?void 0:Me.call.apply(Me,[Te].concat(Ke))},[]);return Le}var h=q(73935),S=function(Te){return+setTimeout(Te,16)},k=function(Te){return clearTimeout(Te)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(S=function(Te){return window.requestAnimationFrame(Te)},k=function(Te){return window.cancelAnimationFrame(Te)});var m=0,A=new Map;function I(ve){A.delete(ve)}var C=function(Te){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;m+=1;var Me=m;function Re(Ke){if(Ke===0)I(Me),Te();else{var Xe=S(function(){Re(Ke-1)});A.set(Me,Xe)}}return Re(Le),Me};C.cancel=function(ve){var Te=A.get(ve);return I(Te),k(Te)};var P=C;function l(ve){if(typeof MessageChannel=="undefined")P(ve);else{var Te=new MessageChannel;Te.port1.onmessage=function(){return ve()},Te.port2.postMessage(void 0)}}function c(){var ve=i.useRef(null),Te=function(Me){ve.current||(ve.current=[],l(function(){(0,h.unstable_batchedUpdates)(function(){ve.current.forEach(function(Re){Re()}),ve.current=null})})),ve.current.push(Me)};return Te}function s(ve,Te){var Le=i.useState(Te),Me=(0,B.Z)(Le,2),Re=Me[0],Ke=Me[1],Xe=u(function(Dt){ve(function(){Ke(Dt)})});return[Re,Xe]}var g=i.createContext(null),R=["component"],D=["className"],x=["className"],T=function(Te,Le){var Me=i.useContext(g);if(!Me){var Re=Te.component,Ke=Re===void 0?"div":Re,Xe=(0,V.Z)(Te,R);return i.createElement(Ke,(0,me.Z)({},Xe,{ref:Le}))}var Dt=Me.className,Xt=(0,V.Z)(Me,D),Wt=Te.className,gr=(0,V.Z)(Te,x);return i.createElement(g.Provider,{value:null},i.createElement(f,(0,me.Z)({ref:Le,className:F()(Dt,Wt)},Xt,gr)))},O=i.forwardRef(T);O.displayName="RawItem";var $=O,H=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],Z="responsive",te="invalidate";function J(ve){return"+ ".concat(ve.length," ...")}function ie(ve,Te){var Le=ve.prefixCls,Me=Le===void 0?"rc-overflow":Le,Re=ve.data,Ke=Re===void 0?[]:Re,Xe=ve.renderItem,Dt=ve.renderRawItem,Xt=ve.itemKey,Wt=ve.itemWidth,gr=Wt===void 0?10:Wt,hr=ve.ssr,br=ve.style,Cr=ve.className,lr=ve.maxCount,tr=ve.renderRest,sr=ve.renderRawRest,Y=ve.suffix,re=ve.component,ee=re===void 0?"div":re,ye=ve.itemComponent,Fe=ve.onVisibleChange,et=(0,V.Z)(ve,H),ct=hr==="full",Ft=c(),Ot=s(Ft,null),It=(0,B.Z)(Ot,2),or=It[0],nr=It[1],vr=or||0,rr=s(Ft,new Map),_r=(0,B.Z)(rr,2),Or=_r[0],Lr=_r[1],Vr=s(Ft,0),zr=(0,B.Z)(Vr,2),Fr=zr[0],tn=zr[1],xr=s(Ft,0),dr=(0,B.Z)(xr,2),rn=dr[0],Xr=dr[1],pn=s(Ft,0),Gn=(0,B.Z)(pn,2),In=Gn[0],On=Gn[1],on=(0,i.useState)(null),Tn=(0,B.Z)(on,2),Dn=Tn[0],cn=Tn[1],Zn=(0,i.useState)(null),$r=(0,B.Z)(Zn,2),fn=$r[0],Br=$r[1],Yn=i.useMemo(function(){return fn===null&&ct?Number.MAX_SAFE_INTEGER:fn||0},[fn,or]),li=(0,i.useState)(!1),mn=(0,B.Z)(li,2),Tr=mn[0],An=mn[1],nn="".concat(Me,"-item"),ui=Math.max(Fr,rn),kn=lr===Z,ln=Ke.length&&kn,Kn=lr===te,ci=ln||typeof lr=="number"&&Ke.length>lr,Zr=(0,i.useMemo)(function(){var kt=Ke;return ln?or===null&&ct?kt=Ke:kt=Ke.slice(0,Math.min(Ke.length,vr/gr)):typeof lr=="number"&&(kt=Ke.slice(0,lr)),kt},[Ke,gr,or,lr,ln]),Un=(0,i.useMemo)(function(){return ln?Ke.slice(Yn+1):Ke.slice(Zr.length)},[Ke,Zr,ln,Yn]),Fn=(0,i.useCallback)(function(kt,Qt){var pr;return typeof Xt=="function"?Xt(kt):(pr=Xt&&(kt==null?void 0:kt[Xt]))!==null&&pr!==void 0?pr:Qt},[Xt]),Cn=(0,i.useCallback)(Xe||function(kt){return kt},[Xe]);function Qn(kt,Qt,pr){fn===kt&&(Qt===void 0||Qt===Dn)||(Br(kt),pr||(An(kt<Ke.length-1),Fe==null||Fe(kt)),Qt!==void 0&&cn(Qt))}function Mi(kt,Qt){nr(Qt.clientWidth)}function zn(kt,Qt){Lr(function(pr){var Ir=new Map(pr);return Qt===null?Ir.delete(kt):Ir.set(kt,Qt),Ir})}function qr(kt,Qt){Xr(Qt),tn(rn)}function $n(kt,Qt){On(Qt)}function bn(kt){return Or.get(Fn(Zr[kt],kt))}w(function(){if(vr&&typeof ui=="number"&&Zr){var kt=In,Qt=Zr.length,pr=Qt-1;if(!Qt){Qn(0,null);return}for(var Ir=0;Ir<Qt;Ir+=1){var Nr=bn(Ir);if(ct&&(Nr=Nr||0),Nr===void 0){Qn(Ir-1,void 0,!0);break}if(kt+=Nr,pr===0&&kt<=vr||Ir===pr-1&&kt+bn(pr)<=vr){Qn(pr,null);break}else if(kt+ui>vr){Qn(Ir-1,kt-Nr-In+rn);break}}Y&&bn(0)+In>vr&&cn(null)}},[vr,Or,rn,In,Fn,Zr]);var ba=Tr&&!!Un.length,an={};Dn!==null&&ln&&(an={position:"absolute",left:Dn,top:0});var yi={prefixCls:nn,responsive:ln,component:ye,invalidate:Kn},$i=Dt?function(kt,Qt){var pr=Fn(kt,Qt);return i.createElement(g.Provider,{key:pr,value:(0,le.Z)((0,le.Z)({},yi),{},{order:Qt,item:kt,itemKey:pr,registerSize:zn,display:Qt<=Yn})},Dt(kt,Qt))}:function(kt,Qt){var pr=Fn(kt,Qt);return i.createElement(f,(0,me.Z)({},yi,{order:Qt,key:pr,item:kt,renderItem:Cn,itemKey:pr,registerSize:zn,display:Qt<=Yn}))},Ln,Ci={order:ba?Yn:Number.MAX_SAFE_INTEGER,className:"".concat(nn,"-rest"),registerSize:qr,display:ba};if(sr)sr&&(Ln=i.createElement(g.Provider,{value:(0,le.Z)((0,le.Z)({},yi),Ci)},sr(Un)));else{var bi=tr||J;Ln=i.createElement(f,(0,me.Z)({},yi,Ci),typeof bi=="function"?bi(Un):bi)}var Rr=i.createElement(ee,(0,me.Z)({className:F()(!Kn&&Me,Cr),style:br,ref:Te},et),Zr.map($i),ci?Ln:null,Y&&i.createElement(f,(0,me.Z)({},yi,{responsive:kn,responsiveDisabled:!ln,order:Yn,className:"".concat(nn,"-suffix"),registerSize:$n,display:!0,style:an}),Y));return kn&&(Rr=i.createElement(U.Z,{onResize:Mi,disabled:!ln},Rr)),Rr}var oe=i.forwardRef(ie);oe.displayName="Overflow",oe.Item=$,oe.RESPONSIVE=Z,oe.INVALIDATE=te;var ue=oe,Pe=ue,Ne=q(21770),Ve=q(91881),ot=q(80334),Et=i.createContext(null);function it(ve,Te){return ve===void 0?null:"".concat(ve,"-").concat(Te)}function Ie(ve){var Te=i.useContext(Et);return it(Te,ve)}var He=q(56982),ht=["children","locked"],ft=i.createContext(null);function dt(ve,Te){var Le=(0,le.Z)({},ve);return Object.keys(Te).forEach(function(Me){var Re=Te[Me];Re!==void 0&&(Le[Me]=Re)}),Le}function se(ve){var Te=ve.children,Le=ve.locked,Me=(0,V.Z)(ve,ht),Re=i.useContext(ft),Ke=(0,He.Z)(function(){return dt(Re,Me)},[Re,Me],function(Xe,Dt){return!Le&&(Xe[0]!==Dt[0]||!(0,Ve.Z)(Xe[1],Dt[1],!0))});return i.createElement(ft.Provider,{value:Ke},Te)}var De=[],ze=i.createContext(null);function Ge(){return i.useContext(ze)}var qe=i.createContext(De);function vt(ve){var Te=i.useContext(qe);return i.useMemo(function(){return ve!==void 0?[].concat((0,G.Z)(Te),[ve]):Te},[Te,ve])}var Ut=i.createContext(null),bt=i.createContext({}),ke=bt,lt=function(ve){if(!ve)return!1;if(ve instanceof Element){if(ve.offsetParent)return!0;if(ve.getBBox){var Te=ve.getBBox(),Le=Te.width,Me=Te.height;if(Le||Me)return!0}if(ve.getBoundingClientRect){var Re=ve.getBoundingClientRect(),Ke=Re.width,Xe=Re.height;if(Ke||Xe)return!0}}return!1};function $t(ve){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(lt(ve)){var Le=ve.nodeName.toLowerCase(),Me=["input","select","textarea","button"].includes(Le)||ve.isContentEditable||Le==="a"&&!!ve.getAttribute("href"),Re=ve.getAttribute("tabindex"),Ke=Number(Re),Xe=null;return Re&&!Number.isNaN(Ke)?Xe=Ke:Me&&Xe===null&&(Xe=0),Me&&ve.disabled&&(Xe=null),Xe!==null&&(Xe>=0||Te&&Xe<0)}return!1}function tt(ve){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Le=(0,G.Z)(ve.querySelectorAll("*")).filter(function(Me){return $t(Me,Te)});return $t(ve,Te)&&Le.unshift(ve),Le}var Ze=null;function Je(){Ze=document.activeElement}function pt(){Ze=null}function je(){if(Ze)try{Ze.focus()}catch(ve){}}function _t(ve,Te){if(Te.keyCode===9){var Le=tt(ve),Me=Le[Te.shiftKey?0:Le.length-1],Re=Me===document.activeElement||ve===document.activeElement;if(Re){var Ke=Le[Te.shiftKey?Le.length-1:0];Ke.focus(),Te.preventDefault()}}}var xt=q(15105),Kt=q(75164),Bt=xt.Z.LEFT,Rt=xt.Z.RIGHT,Se=xt.Z.UP,fe=xt.Z.DOWN,Ce=xt.Z.ENTER,de=xt.Z.ESC,pe=xt.Z.HOME,xe=xt.Z.END,Q=[Se,fe,Bt,Rt];function ne(ve,Te,Le,Me){var Re,Ke="prev",Xe="next",Dt="children",Xt="parent";if(ve==="inline"&&Me===Ce)return{inlineTrigger:!0};var Wt=(0,ge.Z)((0,ge.Z)({},Se,Ke),fe,Xe),gr=(0,ge.Z)((0,ge.Z)((0,ge.Z)((0,ge.Z)({},Bt,Le?Xe:Ke),Rt,Le?Ke:Xe),fe,Dt),Ce,Dt),hr=(0,ge.Z)((0,ge.Z)((0,ge.Z)((0,ge.Z)((0,ge.Z)((0,ge.Z)({},Se,Ke),fe,Xe),Ce,Dt),de,Xt),Bt,Le?Dt:Xt),Rt,Le?Xt:Dt),br={inline:Wt,horizontal:gr,vertical:hr,inlineSub:Wt,horizontalSub:hr,verticalSub:hr},Cr=(Re=br["".concat(ve).concat(Te?"":"Sub")])===null||Re===void 0?void 0:Re[Me];switch(Cr){case Ke:return{offset:-1,sibling:!0};case Xe:return{offset:1,sibling:!0};case Xt:return{offset:-1,sibling:!1};case Dt:return{offset:1,sibling:!1};default:return null}}function ce(ve){for(var Te=ve;Te;){if(Te.getAttribute("data-menu-list"))return Te;Te=Te.parentElement}return null}function Ae(ve,Te){for(var Le=ve||document.activeElement;Le;){if(Te.has(Le))return Le;Le=Le.parentElement}return null}function be(ve,Te){var Le=tt(ve,!0);return Le.filter(function(Me){return Te.has(Me)})}function Oe(ve,Te,Le){var Me=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!ve)return null;var Re=be(ve,Te),Ke=Re.length,Xe=Re.findIndex(function(Dt){return Le===Dt});return Me<0?Xe===-1?Xe=Ke-1:Xe-=1:Me>0&&(Xe+=1),Xe=(Xe+Ke)%Ke,Re[Xe]}var $e=function(Te,Le){var Me=new Set,Re=new Map,Ke=new Map;return Te.forEach(function(Xe){var Dt=document.querySelector("[data-menu-id='".concat(it(Le,Xe),"']"));Dt&&(Me.add(Dt),Ke.set(Dt,Xe),Re.set(Xe,Dt))}),{elements:Me,key2element:Re,element2key:Ke}};function mt(ve,Te,Le,Me,Re,Ke,Xe,Dt,Xt,Wt){var gr=i.useRef(),hr=i.useRef();hr.current=Te;var br=function(){Kt.Z.cancel(gr.current)};return i.useEffect(function(){return function(){br()}},[]),function(Cr){var lr=Cr.which;if([].concat(Q,[Ce,de,pe,xe]).includes(lr)){var tr=Ke(),sr=$e(tr,Me),Y=sr,re=Y.elements,ee=Y.key2element,ye=Y.element2key,Fe=ee.get(Te),et=Ae(Fe,re),ct=ye.get(et),Ft=ne(ve,Xe(ct,!0).length===1,Le,lr);if(!Ft&&lr!==pe&&lr!==xe)return;(Q.includes(lr)||[pe,xe].includes(lr))&&Cr.preventDefault();var Ot=function(Lr){if(Lr){var Vr=Lr,zr=Lr.querySelector("a");zr!=null&&zr.getAttribute("href")&&(Vr=zr);var Fr=ye.get(Lr);Dt(Fr),br(),gr.current=(0,Kt.Z)(function(){hr.current===Fr&&Vr.focus()})}};if([pe,xe].includes(lr)||Ft.sibling||!et){var It;!et||ve==="inline"?It=Re.current:It=ce(et);var or,nr=be(It,re);lr===pe?or=nr[0]:lr===xe?or=nr[nr.length-1]:or=Oe(It,re,et,Ft.offset),Ot(or)}else if(Ft.inlineTrigger)Xt(ct);else if(Ft.offset>0)Xt(ct,!0),br(),gr.current=(0,Kt.Z)(function(){sr=$e(tr,Me);var Or=et.getAttribute("aria-controls"),Lr=document.getElementById(Or),Vr=Oe(Lr,sr.elements);Ot(Vr)},5);else if(Ft.offset<0){var vr=Xe(ct,!0),rr=vr[vr.length-2],_r=ee.get(rr);Xt(rr,!1),Ot(_r)}}Wt==null||Wt(Cr)}}function Mt(ve){Promise.resolve().then(ve)}var Jt="__RC_UTIL_PATH_SPLIT__",jt=function(Te){return Te.join(Jt)},rt=function(Te){return Te.split(Jt)},Tt="rc-menu-more";function ur(){var ve=i.useState({}),Te=(0,B.Z)(ve,2),Le=Te[1],Me=(0,i.useRef)(new Map),Re=(0,i.useRef)(new Map),Ke=i.useState([]),Xe=(0,B.Z)(Ke,2),Dt=Xe[0],Xt=Xe[1],Wt=(0,i.useRef)(0),gr=(0,i.useRef)(!1),hr=function(){gr.current||Le({})},br=(0,i.useCallback)(function(ee,ye){var Fe=jt(ye);Re.current.set(Fe,ee),Me.current.set(ee,Fe),Wt.current+=1;var et=Wt.current;Mt(function(){et===Wt.current&&hr()})},[]),Cr=(0,i.useCallback)(function(ee,ye){var Fe=jt(ye);Re.current.delete(Fe),Me.current.delete(ee)},[]),lr=(0,i.useCallback)(function(ee){Xt(ee)},[]),tr=(0,i.useCallback)(function(ee,ye){var Fe=Me.current.get(ee)||"",et=rt(Fe);return ye&&Dt.includes(et[0])&&et.unshift(Tt),et},[Dt]),sr=(0,i.useCallback)(function(ee,ye){return ee.filter(function(Fe){return Fe!==void 0}).some(function(Fe){var et=tr(Fe,!0);return et.includes(ye)})},[tr]),Y=function(){var ye=(0,G.Z)(Me.current.keys());return Dt.length&&ye.push(Tt),ye},re=(0,i.useCallback)(function(ee){var ye="".concat(Me.current.get(ee)).concat(Jt),Fe=new Set;return(0,G.Z)(Re.current.keys()).forEach(function(et){et.startsWith(ye)&&Fe.add(Re.current.get(et))}),Fe},[]);return i.useEffect(function(){return function(){gr.current=!0}},[]),{registerPath:br,unregisterPath:Cr,refreshOverflowKeys:lr,isSubPathKey:sr,getKeyPath:tr,getKeys:Y,getSubPathKeys:re}}function ir(ve){var Te=i.useRef(ve);Te.current=ve;var Le=i.useCallback(function(){for(var Me,Re=arguments.length,Ke=new Array(Re),Xe=0;Xe<Re;Xe++)Ke[Xe]=arguments[Xe];return(Me=Te.current)===null||Me===void 0?void 0:Me.call.apply(Me,[Te].concat(Ke))},[]);return ve?Le:void 0}var cr=Math.random().toFixed(5).toString().slice(2),Ur=0;function ar(ve){var Te=(0,Ne.Z)(ve,{value:ve}),Le=(0,B.Z)(Te,2),Me=Le[0],Re=Le[1];return i.useEffect(function(){Ur+=1;var Ke="".concat(cr,"-").concat(Ur);Re("rc-menu-uuid-".concat(Ke))},[]),Me}var Er=q(15671),Yr=q(43144),Hn=q(60136),Mn=q(29388),ei=q(98423),mi=q(42550);function ti(ve,Te,Le,Me){var Re=i.useContext(ft),Ke=Re.activeKey,Xe=Re.onActive,Dt=Re.onInactive,Xt={active:Ke===ve};return Te||(Xt.onMouseEnter=function(Wt){Le==null||Le({key:ve,domEvent:Wt}),Xe(ve)},Xt.onMouseLeave=function(Wt){Me==null||Me({key:ve,domEvent:Wt}),Dt(ve)}),Xt}function en(ve){var Te=i.useContext(ft),Le=Te.mode,Me=Te.rtl,Re=Te.inlineIndent;if(Le!=="inline")return null;var Ke=ve;return Me?{paddingRight:Ke*Re}:{paddingLeft:Ke*Re}}function Fi(ve){var Te=ve.icon,Le=ve.props,Me=ve.children,Re;return Te===null||Te===!1?null:(typeof Te=="function"?Re=i.createElement(Te,(0,le.Z)({},Le)):typeof Te!="boolean"&&(Re=Te),Re||Me||null)}var Bi=["item"];function Vi(ve){var Te=ve.item,Le=(0,V.Z)(ve,Bi);return Object.defineProperty(Le,"item",{get:function(){return(0,ot.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),Te}}),Le}var vi=["title","attribute","elementRef"],Ia=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],ki=["active"],qi=function(ve){(0,Hn.Z)(Le,ve);var Te=(0,Mn.Z)(Le);function Le(){return(0,Er.Z)(this,Le),Te.apply(this,arguments)}return(0,Yr.Z)(Le,[{key:"render",value:function(){var Re=this.props,Ke=Re.title,Xe=Re.attribute,Dt=Re.elementRef,Xt=(0,V.Z)(Re,vi),Wt=(0,ei.Z)(Xt,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,ot.ZP)(!Xe,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),i.createElement(Pe.Item,(0,me.Z)({},Xe,{title:typeof Ke=="string"?Ke:void 0},Wt,{ref:Dt}))}}]),Le}(i.Component),Ui=i.forwardRef(function(ve,Te){var Le=ve.style,Me=ve.className,Re=ve.eventKey,Ke=ve.warnKey,Xe=ve.disabled,Dt=ve.itemIcon,Xt=ve.children,Wt=ve.role,gr=ve.onMouseEnter,hr=ve.onMouseLeave,br=ve.onClick,Cr=ve.onKeyDown,lr=ve.onFocus,tr=(0,V.Z)(ve,Ia),sr=Ie(Re),Y=i.useContext(ft),re=Y.prefixCls,ee=Y.onItemClick,ye=Y.disabled,Fe=Y.overflowDisabled,et=Y.itemIcon,ct=Y.selectedKeys,Ft=Y.onActive,Ot=i.useContext(ke),It=Ot._internalRenderMenuItem,or="".concat(re,"-item"),nr=i.useRef(),vr=i.useRef(),rr=ye||Xe,_r=(0,mi.x1)(Te,vr),Or=vt(Re),Lr=function(on){return{key:Re,keyPath:(0,G.Z)(Or).reverse(),item:nr.current,domEvent:on}},Vr=Dt||et,zr=ti(Re,rr,gr,hr),Fr=zr.active,tn=(0,V.Z)(zr,ki),xr=ct.includes(Re),dr=en(Or.length),rn=function(on){if(!rr){var Tn=Lr(on);br==null||br(Vi(Tn)),ee(Tn)}},Xr=function(on){if(Cr==null||Cr(on),on.which===xt.Z.ENTER){var Tn=Lr(on);br==null||br(Vi(Tn)),ee(Tn)}},pn=function(on){Ft(Re),lr==null||lr(on)},Gn={};ve.role==="option"&&(Gn["aria-selected"]=xr);var In=i.createElement(qi,(0,me.Z)({ref:nr,elementRef:_r,role:Wt===null?"none":Wt||"menuitem",tabIndex:Xe?null:-1,"data-menu-id":Fe&&sr?null:sr},(0,ei.Z)(tr,["extra"]),tn,Gn,{component:"li","aria-disabled":Xe,style:(0,le.Z)((0,le.Z)({},dr),Le),className:F()(or,(0,ge.Z)((0,ge.Z)((0,ge.Z)({},"".concat(or,"-active"),Fr),"".concat(or,"-selected"),xr),"".concat(or,"-disabled"),rr),Me),onClick:rn,onKeyDown:Xr,onFocus:pn}),Xt,i.createElement(Fi,{props:(0,le.Z)((0,le.Z)({},ve),{},{isSelected:xr}),icon:Vr}));return It&&(In=It(In,ve,{selected:xr})),In});function Si(ve,Te){var Le=ve.eventKey,Me=Ge(),Re=vt(Le);return i.useEffect(function(){if(Me)return Me.registerPath(Le,Re),function(){Me.unregisterPath(Le,Re)}},[Re]),Me?null:i.createElement(Ui,(0,me.Z)({},ve,{ref:Te}))}var gi=i.forwardRef(Si),zi=["className","children"],hn=function(Te,Le){var Me=Te.className,Re=Te.children,Ke=(0,V.Z)(Te,zi),Xe=i.useContext(ft),Dt=Xe.prefixCls,Xt=Xe.mode,Wt=Xe.rtl;return i.createElement("ul",(0,me.Z)({className:F()(Dt,Wt&&"".concat(Dt,"-rtl"),"".concat(Dt,"-sub"),"".concat(Dt,"-").concat(Xt==="inline"?"inline":"vertical"),Me),role:"menu"},Ke,{"data-menu-list":!0,ref:Le}),Re)},dn=i.forwardRef(hn);dn.displayName="SubMenuList";var Sr=dn,_i=q(50344);function is(ve,Te){return(0,_i.Z)(ve).map(function(Le,Me){if(i.isValidElement(Le)){var Re,Ke,Xe=Le.key,Dt=(Re=(Ke=Le.props)===null||Ke===void 0?void 0:Ke.eventKey)!==null&&Re!==void 0?Re:Xe,Xt=Dt==null;Xt&&(Dt="tmp_key-".concat([].concat((0,G.Z)(Te),[Me]).join("-")));var Wt={key:Dt,eventKey:Dt};return i.cloneElement(Le,Wt)}return Le})}var Oa=q(98280),jn={adjustX:1,adjustY:1},ya={topLeft:{points:["bl","tl"],overflow:jn},topRight:{points:["br","tr"],overflow:jn},bottomLeft:{points:["tl","bl"],overflow:jn},bottomRight:{points:["tr","br"],overflow:jn},leftTop:{points:["tr","tl"],overflow:jn},leftBottom:{points:["br","bl"],overflow:jn},rightTop:{points:["tl","tr"],overflow:jn},rightBottom:{points:["bl","br"],overflow:jn}},Ha={topLeft:{points:["bl","tl"],overflow:jn},topRight:{points:["br","tr"],overflow:jn},bottomLeft:{points:["tl","bl"],overflow:jn},bottomRight:{points:["tr","br"],overflow:jn},rightTop:{points:["tr","tl"],overflow:jn},rightBottom:{points:["br","bl"],overflow:jn},leftTop:{points:["tl","tr"],overflow:jn},leftBottom:{points:["bl","br"],overflow:jn}},Ms=null;function Fa(ve,Te,Le){if(Te)return Te;if(Le)return Le[ve]||Le.other}var Ee={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function we(ve){var Te=ve.prefixCls,Le=ve.visible,Me=ve.children,Re=ve.popup,Ke=ve.popupStyle,Xe=ve.popupClassName,Dt=ve.popupOffset,Xt=ve.disabled,Wt=ve.mode,gr=ve.onVisibleChange,hr=i.useContext(ft),br=hr.getPopupContainer,Cr=hr.rtl,lr=hr.subMenuOpenDelay,tr=hr.subMenuCloseDelay,sr=hr.builtinPlacements,Y=hr.triggerSubMenuAction,re=hr.forceSubMenuRender,ee=hr.rootClassName,ye=hr.motion,Fe=hr.defaultMotions,et=i.useState(!1),ct=(0,B.Z)(et,2),Ft=ct[0],Ot=ct[1],It=Cr?(0,le.Z)((0,le.Z)({},Ha),sr):(0,le.Z)((0,le.Z)({},ya),sr),or=Ee[Wt],nr=Fa(Wt,ye,Fe),vr=i.useRef(nr);Wt!=="inline"&&(vr.current=nr);var rr=(0,le.Z)((0,le.Z)({},vr.current),{},{leavedClassName:"".concat(Te,"-hidden"),removeOnLeave:!1,motionAppear:!0}),_r=i.useRef();return i.useEffect(function(){return _r.current=(0,Kt.Z)(function(){Ot(Le)}),function(){Kt.Z.cancel(_r.current)}},[Le]),i.createElement(Oa.Z,{prefixCls:Te,popupClassName:F()("".concat(Te,"-popup"),(0,ge.Z)({},"".concat(Te,"-rtl"),Cr),Xe,ee),stretch:Wt==="horizontal"?"minWidth":null,getPopupContainer:br,builtinPlacements:It,popupPlacement:or,popupVisible:Ft,popup:Re,popupStyle:Ke,popupAlign:Dt&&{offset:Dt},action:Xt?[]:[Y],mouseEnterDelay:lr,mouseLeaveDelay:tr,onPopupVisibleChange:gr,forceRender:re,popupMotion:rr,fresh:!0},Me)}var We=q(62874);function Ye(ve){var Te=ve.id,Le=ve.open,Me=ve.keyPath,Re=ve.children,Ke="inline",Xe=i.useContext(ft),Dt=Xe.prefixCls,Xt=Xe.forceSubMenuRender,Wt=Xe.motion,gr=Xe.defaultMotions,hr=Xe.mode,br=i.useRef(!1);br.current=hr===Ke;var Cr=i.useState(!br.current),lr=(0,B.Z)(Cr,2),tr=lr[0],sr=lr[1],Y=br.current?Le:!1;i.useEffect(function(){br.current&&sr(!1)},[hr]);var re=(0,le.Z)({},Fa(Ke,Wt,gr));Me.length>1&&(re.motionAppear=!1);var ee=re.onVisibleChanged;return re.onVisibleChanged=function(ye){return!br.current&&!ye&&sr(!0),ee==null?void 0:ee(ye)},tr?null:i.createElement(se,{mode:Ke,locked:!br.current},i.createElement(We.Z,(0,me.Z)({visible:Y},re,{forceRender:Xt,removeOnLeave:!1,leavedClassName:"".concat(Dt,"-hidden")}),function(ye){var Fe=ye.className,et=ye.style;return i.createElement(Sr,{id:Te,className:Fe,style:et},Re)}))}var ut=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],At=["active"],Ct=i.forwardRef(function(ve,Te){var Le=ve.style,Me=ve.className,Re=ve.title,Ke=ve.eventKey,Xe=ve.warnKey,Dt=ve.disabled,Xt=ve.internalPopupClose,Wt=ve.children,gr=ve.itemIcon,hr=ve.expandIcon,br=ve.popupClassName,Cr=ve.popupOffset,lr=ve.popupStyle,tr=ve.onClick,sr=ve.onMouseEnter,Y=ve.onMouseLeave,re=ve.onTitleClick,ee=ve.onTitleMouseEnter,ye=ve.onTitleMouseLeave,Fe=(0,V.Z)(ve,ut),et=Ie(Ke),ct=i.useContext(ft),Ft=ct.prefixCls,Ot=ct.mode,It=ct.openKeys,or=ct.disabled,nr=ct.overflowDisabled,vr=ct.activeKey,rr=ct.selectedKeys,_r=ct.itemIcon,Or=ct.expandIcon,Lr=ct.onItemClick,Vr=ct.onOpenChange,zr=ct.onActive,Fr=i.useContext(ke),tn=Fr._internalRenderSubMenuItem,xr=i.useContext(Ut),dr=xr.isSubPathKey,rn=vt(),Xr="".concat(Ft,"-submenu"),pn=or||Dt,Gn=i.useRef(),In=i.useRef(),On=gr!=null?gr:_r,on=hr!=null?hr:Or,Tn=It.includes(Ke),Dn=!nr&&Tn,cn=dr(rr,Ke),Zn=ti(Ke,pn,ee,ye),$r=Zn.active,fn=(0,V.Z)(Zn,At),Br=i.useState(!1),Yn=(0,B.Z)(Br,2),li=Yn[0],mn=Yn[1],Tr=function($n){pn||mn($n)},An=function($n){Tr(!0),sr==null||sr({key:Ke,domEvent:$n})},nn=function($n){Tr(!1),Y==null||Y({key:Ke,domEvent:$n})},ui=i.useMemo(function(){return $r||(Ot!=="inline"?li||dr([vr],Ke):!1)},[Ot,$r,vr,li,Ke,dr]),kn=en(rn.length),ln=function($n){pn||(re==null||re({key:Ke,domEvent:$n}),Ot==="inline"&&Vr(Ke,!Tn))},Kn=ir(function(qr){tr==null||tr(Vi(qr)),Lr(qr)}),ci=function($n){Ot!=="inline"&&Vr(Ke,$n)},Zr=function(){zr(Ke)},Un=et&&"".concat(et,"-popup"),Fn=i.useMemo(function(){return i.createElement(Fi,{icon:Ot!=="horizontal"?on:void 0,props:(0,le.Z)((0,le.Z)({},ve),{},{isOpen:Dn,isSubMenu:!0})},i.createElement("i",{className:"".concat(Xr,"-arrow")}))},[Ot,on,ve,Dn,Xr]),Cn=i.createElement("div",(0,me.Z)({role:"menuitem",style:kn,className:"".concat(Xr,"-title"),tabIndex:pn?null:-1,ref:Gn,title:typeof Re=="string"?Re:null,"data-menu-id":nr&&et?null:et,"aria-expanded":Dn,"aria-haspopup":!0,"aria-controls":Un,"aria-disabled":pn,onClick:ln,onFocus:Zr},fn),Re,Fn),Qn=i.useRef(Ot);if(Ot!=="inline"&&rn.length>1?Qn.current="vertical":Qn.current=Ot,!nr){var Mi=Qn.current;Cn=i.createElement(we,{mode:Mi,prefixCls:Xr,visible:!Xt&&Dn&&Ot!=="inline",popupClassName:br,popupOffset:Cr,popupStyle:lr,popup:i.createElement(se,{mode:Mi==="horizontal"?"vertical":Mi},i.createElement(Sr,{id:Un,ref:In},Wt)),disabled:pn,onVisibleChange:ci},Cn)}var zn=i.createElement(Pe.Item,(0,me.Z)({ref:Te,role:"none"},Fe,{component:"li",style:Le,className:F()(Xr,"".concat(Xr,"-").concat(Ot),Me,(0,ge.Z)((0,ge.Z)((0,ge.Z)((0,ge.Z)({},"".concat(Xr,"-open"),Dn),"".concat(Xr,"-active"),ui),"".concat(Xr,"-selected"),cn),"".concat(Xr,"-disabled"),pn)),onMouseEnter:An,onMouseLeave:nn}),Cn,!nr&&i.createElement(Ye,{id:Un,open:Dn,keyPath:rn},Wt));return tn&&(zn=tn(zn,ve,{selected:cn,active:ui,open:Dn,disabled:pn})),i.createElement(se,{onItemClick:Kn,mode:Ot==="horizontal"?"vertical":Ot,itemIcon:On,expandIcon:on},zn)}),Pt=i.forwardRef(function(ve,Te){var Le=ve.eventKey,Me=ve.children,Re=vt(Le),Ke=is(Me,Re),Xe=Ge();i.useEffect(function(){if(Xe)return Xe.registerPath(Le,Re),function(){Xe.unregisterPath(Le,Re)}},[Re]);var Dt;return Xe?Dt=Ke:Dt=i.createElement(Ct,(0,me.Z)({ref:Te},ve),Ke),i.createElement(qe.Provider,{value:Re},Dt)}),Nt=Pt,er=q(71002);function mr(ve){var Te=ve.className,Le=ve.style,Me=i.useContext(ft),Re=Me.prefixCls,Ke=Ge();return Ke?null:i.createElement("li",{role:"separator",className:F()("".concat(Re,"-item-divider"),Te),style:Le})}var Zt=["className","title","eventKey","children"],yr=i.forwardRef(function(ve,Te){var Le=ve.className,Me=ve.title,Re=ve.eventKey,Ke=ve.children,Xe=(0,V.Z)(ve,Zt),Dt=i.useContext(ft),Xt=Dt.prefixCls,Wt="".concat(Xt,"-item-group");return i.createElement("li",(0,me.Z)({ref:Te,role:"presentation"},Xe,{onClick:function(hr){return hr.stopPropagation()},className:F()(Wt,Le)}),i.createElement("div",{role:"presentation",className:"".concat(Wt,"-title"),title:typeof Me=="string"?Me:void 0},Me),i.createElement("ul",{role:"group",className:"".concat(Wt,"-list")},Ke))}),Mr=i.forwardRef(function(ve,Te){var Le=ve.eventKey,Me=ve.children,Re=vt(Le),Ke=is(Me,Re),Xe=Ge();return Xe?Ke:i.createElement(yr,(0,me.Z)({ref:Te},(0,ei.Z)(ve,["warnKey"])),Ke)}),jr=Mr,Pr=["label","children","key","type","extra"];function Gr(ve,Te,Le){var Me=Te.item,Re=Te.group,Ke=Te.submenu,Xe=Te.divider;return(ve||[]).map(function(Dt,Xt){if(Dt&&(0,er.Z)(Dt)==="object"){var Wt=Dt,gr=Wt.label,hr=Wt.children,br=Wt.key,Cr=Wt.type,lr=Wt.extra,tr=(0,V.Z)(Wt,Pr),sr=br!=null?br:"tmp-".concat(Xt);return hr||Cr==="group"?Cr==="group"?i.createElement(Re,(0,me.Z)({key:sr},tr,{title:gr}),Gr(hr,Te,Le)):i.createElement(Ke,(0,me.Z)({key:sr},tr,{title:gr}),Gr(hr,Te,Le)):Cr==="divider"?i.createElement(Xe,(0,me.Z)({key:sr},tr)):i.createElement(Me,(0,me.Z)({key:sr},tr,{extra:lr}),gr,(!!lr||lr===0)&&i.createElement("span",{className:"".concat(Le,"-item-extra")},lr))}return null}).filter(function(Dt){return Dt})}function Dr(ve,Te,Le,Me,Re){var Ke=ve,Xe=(0,le.Z)({divider:mr,item:gi,group:jr,submenu:Nt},Me);return Te&&(Ke=Gr(Te,Xe,Re)),is(Ke,Le)}var Ar=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem","_internalComponents"],fr=[],kr=i.forwardRef(function(ve,Te){var Le,Me=ve,Re=Me.prefixCls,Ke=Re===void 0?"rc-menu":Re,Xe=Me.rootClassName,Dt=Me.style,Xt=Me.className,Wt=Me.tabIndex,gr=Wt===void 0?0:Wt,hr=Me.items,br=Me.children,Cr=Me.direction,lr=Me.id,tr=Me.mode,sr=tr===void 0?"vertical":tr,Y=Me.inlineCollapsed,re=Me.disabled,ee=Me.disabledOverflow,ye=Me.subMenuOpenDelay,Fe=ye===void 0?.1:ye,et=Me.subMenuCloseDelay,ct=et===void 0?.1:et,Ft=Me.forceSubMenuRender,Ot=Me.defaultOpenKeys,It=Me.openKeys,or=Me.activeKey,nr=Me.defaultActiveFirst,vr=Me.selectable,rr=vr===void 0?!0:vr,_r=Me.multiple,Or=_r===void 0?!1:_r,Lr=Me.defaultSelectedKeys,Vr=Me.selectedKeys,zr=Me.onSelect,Fr=Me.onDeselect,tn=Me.inlineIndent,xr=tn===void 0?24:tn,dr=Me.motion,rn=Me.defaultMotions,Xr=Me.triggerSubMenuAction,pn=Xr===void 0?"hover":Xr,Gn=Me.builtinPlacements,In=Me.itemIcon,On=Me.expandIcon,on=Me.overflowedIndicator,Tn=on===void 0?"...":on,Dn=Me.overflowedIndicatorPopupClassName,cn=Me.getPopupContainer,Zn=Me.onClick,$r=Me.onOpenChange,fn=Me.onKeyDown,Br=Me.openAnimation,Yn=Me.openTransitionName,li=Me._internalRenderMenuItem,mn=Me._internalRenderSubMenuItem,Tr=Me._internalComponents,An=(0,V.Z)(Me,Ar),nn=i.useMemo(function(){return[Dr(br,hr,fr,Tr,Ke),Dr(br,hr,fr,{},Ke)]},[br,hr,Tr]),ui=(0,B.Z)(nn,2),kn=ui[0],ln=ui[1],Kn=i.useState(!1),ci=(0,B.Z)(Kn,2),Zr=ci[0],Un=ci[1],Fn=i.useRef(),Cn=ar(lr),Qn=Cr==="rtl",Mi=(0,Ne.Z)(Ot,{value:It,postState:function(Kr){return Kr||fr}}),zn=(0,B.Z)(Mi,2),qr=zn[0],$n=zn[1],bn=function(Kr){var vn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function ii(){$n(Kr),$r==null||$r(Kr)}vn?(0,h.flushSync)(ii):ii()},ba=i.useState(qr),an=(0,B.Z)(ba,2),yi=an[0],$i=an[1],Ln=i.useRef(!1),Ci=i.useMemo(function(){return(sr==="inline"||sr==="vertical")&&Y?["vertical",Y]:[sr,!1]},[sr,Y]),bi=(0,B.Z)(Ci,2),Rr=bi[0],kt=bi[1],Qt=Rr==="inline",pr=i.useState(Rr),Ir=(0,B.Z)(pr,2),Nr=Ir[0],Hi=Ir[1],ri=i.useState(kt),fi=(0,B.Z)(ri,2),Li=fi[0],Ba=fi[1];i.useEffect(function(){Hi(Rr),Ba(kt),Ln.current&&(Qt?$n(yi):bn(fr))},[Rr,kt]);var ja=i.useState(0),Ga=(0,B.Z)(ja,2),xa=Ga[0],ji=Ga[1],pi=xa>=kn.length-1||Nr!=="horizontal"||ee;i.useEffect(function(){Qt&&$i(qr)},[qr]),i.useEffect(function(){return Ln.current=!0,function(){Ln.current=!1}},[]);var Ji=ur(),Ti=Ji.registerPath,da=Ji.unregisterPath,xn=Ji.refreshOverflowKeys,En=Ji.isSubPathKey,Qi=Ji.getKeyPath,Ea=Ji.getKeys,wa=Ji.getSubPathKeys,Gi=i.useMemo(function(){return{registerPath:Ti,unregisterPath:da}},[Ti,da]),Ts=i.useMemo(function(){return{isSubPathKey:En}},[En]);i.useEffect(function(){xn(pi?fr:kn.slice(xa+1).map(function(Rn){return Rn.key}))},[xa,pi]);var as=(0,Ne.Z)(or||nr&&((Le=kn[0])===null||Le===void 0?void 0:Le.key),{value:or}),pa=(0,B.Z)(as,2),Sa=pa[0],ni=pa[1],Zi=ir(function(Rn){ni(Rn)}),Yi=ir(function(){ni(void 0)});(0,i.useImperativeHandle)(Te,function(){return{list:Fn.current,focus:function(Kr){var vn,ii=Ea(),Di=$e(ii,Cn),ga=Di.elements,ea=Di.key2element,Ds=Di.element2key,Ya=be(Fn.current,ga),ta=Sa!=null?Sa:Ya[0]?Ds.get(Ya[0]):(vn=kn.find(function(Xa){return!Xa.props.disabled}))===null||vn===void 0?void 0:vn.key,Ri=ea.get(ta);if(ta&&Ri){var Ma;Ri==null||(Ma=Ri.focus)===null||Ma===void 0||Ma.call(Ri,Kr)}}}});var ss=(0,Ne.Z)(Lr||[],{value:Vr,postState:function(Kr){return Array.isArray(Kr)?Kr:Kr==null?fr:[Kr]}}),ma=(0,B.Z)(ss,2),aa=ma[0],va=ma[1],Na=function(Kr){if(rr){var vn=Kr.key,ii=aa.includes(vn),Di;Or?ii?Di=aa.filter(function(ea){return ea!==vn}):Di=[].concat((0,G.Z)(aa),[vn]):Di=[vn],va(Di);var ga=(0,le.Z)((0,le.Z)({},Kr),{},{selectedKeys:Di});ii?Fr==null||Fr(ga):zr==null||zr(ga)}!Or&&qr.length&&Nr!=="inline"&&bn(fr)},Ka=ir(function(Rn){Zn==null||Zn(Vi(Rn)),Na(Rn)}),os=ir(function(Rn,Kr){var vn=qr.filter(function(Di){return Di!==Rn});if(Kr)vn.push(Rn);else if(Nr!=="inline"){var ii=wa(Rn);vn=vn.filter(function(Di){return!ii.has(Di)})}(0,Ve.Z)(qr,vn,!0)||bn(vn,!0)}),xi=function(Kr,vn){var ii=vn!=null?vn:!qr.includes(Kr);os(Kr,ii)},Za=mt(Nr,Sa,Qn,Cn,Fn,Ea,Qi,ni,xi,fn);i.useEffect(function(){Un(!0)},[]);var Fs=i.useMemo(function(){return{_internalRenderMenuItem:li,_internalRenderSubMenuItem:mn}},[li,mn]),Ua=Nr!=="horizontal"||ee?kn:kn.map(function(Rn,Kr){return i.createElement(se,{key:Rn.key,overflowDisabled:Kr>xa},Rn)}),ls=i.createElement(Pe,(0,me.Z)({id:lr,ref:Fn,prefixCls:"".concat(Ke,"-overflow"),component:"ul",itemComponent:gi,className:F()(Ke,"".concat(Ke,"-root"),"".concat(Ke,"-").concat(Nr),Xt,(0,ge.Z)((0,ge.Z)({},"".concat(Ke,"-inline-collapsed"),Li),"".concat(Ke,"-rtl"),Qn),Xe),dir:Cr,style:Dt,role:"menu",tabIndex:gr,data:Ua,renderRawItem:function(Kr){return Kr},renderRawRest:function(Kr){var vn=Kr.length,ii=vn?kn.slice(-vn):null;return i.createElement(Nt,{eventKey:Tt,title:Tn,disabled:pi,internalPopupClose:vn===0,popupClassName:Dn},ii)},maxCount:Nr!=="horizontal"||ee?Pe.INVALIDATE:Pe.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(Kr){ji(Kr)},onKeyDown:Za},An));return i.createElement(ke.Provider,{value:Fs},i.createElement(Et.Provider,{value:Cn},i.createElement(se,{prefixCls:Ke,rootClassName:Xe,mode:Nr,openKeys:qr,rtl:Qn,disabled:re,motion:Zr?dr:null,defaultMotions:Zr?rn:null,activeKey:Sa,onActive:Zi,onInactive:Yi,selectedKeys:aa,inlineIndent:xr,subMenuOpenDelay:Fe,subMenuCloseDelay:ct,forceSubMenuRender:Ft,builtinPlacements:Gn,triggerSubMenuAction:pn,getPopupContainer:cn,itemIcon:In,expandIcon:On,onItemClick:Ka,onOpenChange:os},i.createElement(Ut.Provider,{value:Ts},ls),i.createElement("div",{style:{display:"none"},"aria-hidden":!0},i.createElement(ze.Provider,{value:Gi},ln)))))}),Pn=kr,yn=Pn;yn.Item=gi,yn.SubMenu=Nt,yn.ItemGroup=jr,yn.Divider=mr;var Nn=yn},62874:function(Ht,at,q){"use strict";q.d(at,{Z:function(){return $t}});var me=q(4942),ge=q(1413),le=q(97685),G=q(71002),B=q(67294),V=q(34203),K=q(42550),F=q(94184),i=q.n(F),U=q(98924);function L(tt,Ze){var Je={};return Je[tt.toLowerCase()]=Ze.toLowerCase(),Je["Webkit".concat(tt)]="webkit".concat(Ze),Je["Moz".concat(tt)]="moz".concat(Ze),Je["ms".concat(tt)]="MS".concat(Ze),Je["O".concat(tt)]="o".concat(Ze.toLowerCase()),Je}function v(tt,Ze){var Je={animationend:L("Animation","AnimationEnd"),transitionend:L("Transition","TransitionEnd")};return tt&&("AnimationEvent"in Ze||delete Je.animationend.animation,"TransitionEvent"in Ze||delete Je.transitionend.transition),Je}var E=v((0,U.Z)(),typeof window!="undefined"?window:{}),b={};if((0,U.Z)()){var w=document.createElement("div");b=w.style}var p={};function y(tt){if(p[tt])return p[tt];var Ze=E[tt];if(Ze)for(var Je=Object.keys(Ze),pt=Je.length,je=0;je<pt;je+=1){var _t=Je[je];if(Object.prototype.hasOwnProperty.call(Ze,_t)&&_t in b)return p[tt]=Ze[_t],p[tt]}return""}var M=y("animationend"),d=y("transitionend"),f=!!(M&&d),u=M||"animationend",h=d||"transitionend";function S(tt,Ze){if(!tt)return null;if((0,G.Z)(tt)==="object"){var Je=Ze.replace(/-\w/g,function(pt){return pt[1].toUpperCase()});return tt[Je]}return"".concat(tt,"-").concat(Ze)}var k="none",m="appear",A="enter",I="leave",C="none",P="prepare",l="start",c="active",s="end",g=q(63896),R=q(75164),D=function(){var tt=B.useRef(null);function Ze(){R.Z.cancel(tt.current)}function Je(pt){var je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;Ze();var _t=(0,R.Z)(function(){je<=1?pt({isCanceled:function(){return _t!==tt.current}}):Je(pt,je-1)});tt.current=_t}return B.useEffect(function(){return function(){Ze()}},[]),[Je,Ze]},x=(0,U.Z)()?B.useLayoutEffect:B.useEffect,T=x,O=[P,l,c,s],$=!1,H=!0;function Z(tt){return tt===c||tt===s}var te=function(tt,Ze){var Je=(0,g.Z)(C),pt=(0,le.Z)(Je,2),je=pt[0],_t=pt[1],xt=D(),Kt=(0,le.Z)(xt,2),Bt=Kt[0],Rt=Kt[1];function Se(){_t(P,!0)}return T(function(){if(je!==C&&je!==s){var fe=O.indexOf(je),Ce=O[fe+1],de=Ze(je);de===$?_t(Ce,!0):Bt(function(pe){function xe(){pe.isCanceled()||_t(Ce,!0)}de===!0?xe():Promise.resolve(de).then(xe)})}},[tt,je]),B.useEffect(function(){return function(){Rt()}},[]),[Se,je]},J=function(tt){var Ze=(0,B.useRef)(),Je=(0,B.useRef)(tt);Je.current=tt;var pt=B.useCallback(function(xt){Je.current(xt)},[]);function je(xt){xt&&(xt.removeEventListener(h,pt),xt.removeEventListener(u,pt))}function _t(xt){Ze.current&&Ze.current!==xt&&je(Ze.current),xt&&xt!==Ze.current&&(xt.addEventListener(h,pt),xt.addEventListener(u,pt),Ze.current=xt)}return B.useEffect(function(){return function(){je(Ze.current)}},[]),[_t,je]};function ie(tt,Ze,Je,pt){var je=pt.motionEnter,_t=je===void 0?!0:je,xt=pt.motionAppear,Kt=xt===void 0?!0:xt,Bt=pt.motionLeave,Rt=Bt===void 0?!0:Bt,Se=pt.motionDeadline,fe=pt.motionLeaveImmediately,Ce=pt.onAppearPrepare,de=pt.onEnterPrepare,pe=pt.onLeavePrepare,xe=pt.onAppearStart,Q=pt.onEnterStart,ne=pt.onLeaveStart,ce=pt.onAppearActive,Ae=pt.onEnterActive,be=pt.onLeaveActive,Oe=pt.onAppearEnd,$e=pt.onEnterEnd,mt=pt.onLeaveEnd,Mt=pt.onVisibleChanged,Jt=(0,g.Z)(),jt=(0,le.Z)(Jt,2),rt=jt[0],Tt=jt[1],ur=(0,g.Z)(k),ir=(0,le.Z)(ur,2),cr=ir[0],Ur=ir[1],ar=(0,g.Z)(null),Er=(0,le.Z)(ar,2),Yr=Er[0],Hn=Er[1],Mn=(0,B.useRef)(!1),ei=(0,B.useRef)(null);function mi(){return Je()}var ti=(0,B.useRef)(!1);function en(hn){var dn=mi();if(!(hn&&!hn.deadline&&hn.target!==dn)){var Sr=ti.current,_i;cr===m&&Sr?_i=Oe==null?void 0:Oe(dn,hn):cr===A&&Sr?_i=$e==null?void 0:$e(dn,hn):cr===I&&Sr&&(_i=mt==null?void 0:mt(dn,hn)),cr!==k&&Sr&&_i!==!1&&(Ur(k,!0),Hn(null,!0))}}var Fi=J(en),Bi=(0,le.Z)(Fi,1),Vi=Bi[0],vi=B.useMemo(function(){var hn,dn,Sr;switch(cr){case m:return hn={},(0,me.Z)(hn,P,Ce),(0,me.Z)(hn,l,xe),(0,me.Z)(hn,c,ce),hn;case A:return dn={},(0,me.Z)(dn,P,de),(0,me.Z)(dn,l,Q),(0,me.Z)(dn,c,Ae),dn;case I:return Sr={},(0,me.Z)(Sr,P,pe),(0,me.Z)(Sr,l,ne),(0,me.Z)(Sr,c,be),Sr;default:return{}}},[cr]),Ia=te(cr,function(hn){if(hn===P){var dn=vi[P];return dn?dn(mi()):$}if(Ui in vi){var Sr;Hn(((Sr=vi[Ui])===null||Sr===void 0?void 0:Sr.call(vi,mi(),null))||null)}return Ui===c&&(Vi(mi()),Se>0&&(clearTimeout(ei.current),ei.current=setTimeout(function(){en({deadline:!0})},Se))),H}),ki=(0,le.Z)(Ia,2),qi=ki[0],Ui=ki[1],Si=Z(Ui);ti.current=Si,T(function(){Tt(Ze);var hn=Mn.current;if(Mn.current=!0,!!tt){var dn;!hn&&Ze&&Kt&&(dn=m),hn&&Ze&&_t&&(dn=A),(hn&&!Ze&&Rt||!hn&&fe&&!Ze&&Rt)&&(dn=I),dn&&(Ur(dn),qi())}},[Ze]),(0,B.useEffect)(function(){(cr===m&&!Kt||cr===A&&!_t||cr===I&&!Rt)&&Ur(k)},[Kt,_t,Rt]),(0,B.useEffect)(function(){return function(){Mn.current=!1,clearTimeout(ei.current)}},[]);var gi=B.useRef(!1);(0,B.useEffect)(function(){rt&&(gi.current=!0),rt!==void 0&&cr===k&&((gi.current||rt)&&(Mt==null||Mt(rt)),gi.current=!0)},[rt,cr]);var zi=Yr;return vi[P]&&Ui===l&&(zi=(0,ge.Z)({transition:"none"},zi)),[cr,Ui,zi,rt!=null?rt:Ze]}var oe=q(15671),ue=q(43144),Pe=q(60136),Ne=q(29388),Ve=function(tt){(0,Pe.Z)(Je,tt);var Ze=(0,Ne.Z)(Je);function Je(){return(0,oe.Z)(this,Je),Ze.apply(this,arguments)}return(0,ue.Z)(Je,[{key:"render",value:function(){return this.props.children}}]),Je}(B.Component),ot=Ve;function Et(tt){var Ze=tt;(0,G.Z)(tt)==="object"&&(Ze=tt.transitionSupport);function Je(je){return!!(je.motionName&&Ze)}var pt=B.forwardRef(function(je,_t){var xt=je.visible,Kt=xt===void 0?!0:xt,Bt=je.removeOnLeave,Rt=Bt===void 0?!0:Bt,Se=je.forceRender,fe=je.children,Ce=je.motionName,de=je.leavedClassName,pe=je.eventProps,xe=Je(je),Q=(0,B.useRef)(),ne=(0,B.useRef)();function ce(){try{return Q.current instanceof HTMLElement?Q.current:(0,V.Z)(ne.current)}catch(ar){return null}}var Ae=ie(xe,Kt,ce,je),be=(0,le.Z)(Ae,4),Oe=be[0],$e=be[1],mt=be[2],Mt=be[3],Jt=B.useRef(Mt);Mt&&(Jt.current=!0);var jt=B.useCallback(function(ar){Q.current=ar,(0,K.mH)(_t,ar)},[_t]),rt,Tt=(0,ge.Z)((0,ge.Z)({},pe),{},{visible:Kt});if(!fe)rt=null;else if(Oe===k||!Je(je))Mt?rt=fe((0,ge.Z)({},Tt),jt):!Rt&&Jt.current&&de?rt=fe((0,ge.Z)((0,ge.Z)({},Tt),{},{className:de}),jt):Se||!Rt&&!de?rt=fe((0,ge.Z)((0,ge.Z)({},Tt),{},{style:{display:"none"}}),jt):rt=null;else{var ur,ir;$e===P?ir="prepare":Z($e)?ir="active":$e===l&&(ir="start"),rt=fe((0,ge.Z)((0,ge.Z)({},Tt),{},{className:i()(S(Ce,Oe),(ur={},(0,me.Z)(ur,S(Ce,"".concat(Oe,"-").concat(ir)),ir),(0,me.Z)(ur,Ce,typeof Ce=="string"),ur)),style:mt}),jt)}if(B.isValidElement(rt)&&(0,K.Yr)(rt)){var cr=rt,Ur=cr.ref;Ur||(rt=B.cloneElement(rt,{ref:jt}))}return B.createElement(ot,{ref:ne},rt)});return pt.displayName="CSSMotion",pt}var it=Et(f),Ie=q(87462),He=q(45987),ht=q(97326),ft="add",dt="keep",se="remove",De="removed";function ze(tt){var Ze;return tt&&(0,G.Z)(tt)==="object"&&"key"in tt?Ze=tt:Ze={key:tt},(0,ge.Z)((0,ge.Z)({},Ze),{},{key:String(Ze.key)})}function Ge(){var tt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return tt.map(ze)}function qe(){var tt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Je=[],pt=0,je=Ze.length,_t=Ge(tt),xt=Ge(Ze);_t.forEach(function(Rt){for(var Se=!1,fe=pt;fe<je;fe+=1){var Ce=xt[fe];if(Ce.key===Rt.key){pt<fe&&(Je=Je.concat(xt.slice(pt,fe).map(function(de){return(0,ge.Z)((0,ge.Z)({},de),{},{status:ft})})),pt=fe),Je.push((0,ge.Z)((0,ge.Z)({},Ce),{},{status:dt})),pt+=1,Se=!0;break}}Se||Je.push((0,ge.Z)((0,ge.Z)({},Rt),{},{status:se}))}),pt<je&&(Je=Je.concat(xt.slice(pt).map(function(Rt){return(0,ge.Z)((0,ge.Z)({},Rt),{},{status:ft})})));var Kt={};Je.forEach(function(Rt){var Se=Rt.key;Kt[Se]=(Kt[Se]||0)+1});var Bt=Object.keys(Kt).filter(function(Rt){return Kt[Rt]>1});return Bt.forEach(function(Rt){Je=Je.filter(function(Se){var fe=Se.key,Ce=Se.status;return fe!==Rt||Ce!==se}),Je.forEach(function(Se){Se.key===Rt&&(Se.status=dt)})}),Je}var vt=["component","children","onVisibleChanged","onAllRemoved"],Ut=["status"],bt=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function ke(tt){var Ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:it,Je=function(pt){(0,Pe.Z)(_t,pt);var je=(0,Ne.Z)(_t);function _t(){var xt;(0,oe.Z)(this,_t);for(var Kt=arguments.length,Bt=new Array(Kt),Rt=0;Rt<Kt;Rt++)Bt[Rt]=arguments[Rt];return xt=je.call.apply(je,[this].concat(Bt)),(0,me.Z)((0,ht.Z)(xt),"state",{keyEntities:[]}),(0,me.Z)((0,ht.Z)(xt),"removeKey",function(Se){var fe=xt.state.keyEntities,Ce=fe.map(function(de){return de.key!==Se?de:(0,ge.Z)((0,ge.Z)({},de),{},{status:De})});return xt.setState({keyEntities:Ce}),Ce.filter(function(de){var pe=de.status;return pe!==De}).length}),xt}return(0,ue.Z)(_t,[{key:"render",value:function(){var Kt=this,Bt=this.state.keyEntities,Rt=this.props,Se=Rt.component,fe=Rt.children,Ce=Rt.onVisibleChanged,de=Rt.onAllRemoved,pe=(0,He.Z)(Rt,vt),xe=Se||B.Fragment,Q={};return bt.forEach(function(ne){Q[ne]=pe[ne],delete pe[ne]}),delete pe.keys,B.createElement(xe,pe,Bt.map(function(ne){var ce=ne.status,Ae=(0,He.Z)(ne,Ut),be=ce===ft||ce===dt;return B.createElement(Ze,(0,Ie.Z)({},Q,{key:Ae.key,visible:be,eventProps:Ae,onVisibleChanged:function($e){if(Ce==null||Ce($e,{key:Ae.key}),!$e){var mt=Kt.removeKey(Ae.key);mt===0&&de&&de()}}}),fe)}))}}],[{key:"getDerivedStateFromProps",value:function(Kt,Bt){var Rt=Kt.keys,Se=Bt.keyEntities,fe=Ge(Rt),Ce=qe(Se,fe);return{keyEntities:Ce.filter(function(de){var pe=Se.find(function(xe){var Q=xe.key;return de.key===Q});return!(pe&&pe.status===De&&de.status===se)})}}}]),_t}(B.Component);return(0,me.Z)(Je,"defaultProps",{component:"div"}),Je}var lt=ke(f),$t=it},48555:function(Ht,at,q){"use strict";q.d(at,{Z:function(){return P}});var me=q(87462),ge=q(67294),le=q(50344),G=q(80334),B=q(1413),V=q(42550),K=q(34203),F=q(91033),i=new Map;function U(l){l.forEach(function(c){var s,g=c.target;(s=i.get(g))===null||s===void 0||s.forEach(function(R){return R(g)})})}var L=new F.Z(U),v=null,E=null;function b(l,c){i.has(l)||(i.set(l,new Set),L.observe(l)),i.get(l).add(c)}function w(l,c){i.has(l)&&(i.get(l).delete(c),i.get(l).size||(L.unobserve(l),i.delete(l)))}var p=q(15671),y=q(43144),M=q(60136),d=q(29388),f=function(l){(0,M.Z)(s,l);var c=(0,d.Z)(s);function s(){return(0,p.Z)(this,s),c.apply(this,arguments)}return(0,y.Z)(s,[{key:"render",value:function(){return this.props.children}}]),s}(ge.Component),u=ge.createContext(null);function h(l){var c=l.children,s=l.onBatchResize,g=ge.useRef(0),R=ge.useRef([]),D=ge.useContext(u),x=ge.useCallback(function(T,O,$){g.current+=1;var H=g.current;R.current.push({size:T,element:O,data:$}),Promise.resolve().then(function(){H===g.current&&(s==null||s(R.current),R.current=[])}),D==null||D(T,O,$)},[s,D]);return ge.createElement(u.Provider,{value:x},c)}function S(l,c){var s=l.children,g=l.disabled,R=ge.useRef(null),D=ge.useRef(null),x=ge.useContext(u),T=typeof s=="function",O=T?s(R):s,$=ge.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),H=!T&&ge.isValidElement(O)&&(0,V.Yr)(O),Z=H?O.ref:null,te=ge.useMemo(function(){return(0,V.sQ)(Z,R)},[Z,R]),J=function(){return(0,K.Z)(R.current)||(0,K.Z)(D.current)};ge.useImperativeHandle(c,function(){return J()});var ie=ge.useRef(l);ie.current=l;var oe=ge.useCallback(function(ue){var Pe=ie.current,Ne=Pe.onResize,Ve=Pe.data,ot=ue.getBoundingClientRect(),Et=ot.width,it=ot.height,Ie=ue.offsetWidth,He=ue.offsetHeight,ht=Math.floor(Et),ft=Math.floor(it);if($.current.width!==ht||$.current.height!==ft||$.current.offsetWidth!==Ie||$.current.offsetHeight!==He){var dt={width:ht,height:ft,offsetWidth:Ie,offsetHeight:He};$.current=dt;var se=Ie===Math.round(Et)?Et:Ie,De=He===Math.round(it)?it:He,ze=(0,B.Z)((0,B.Z)({},dt),{},{offsetWidth:se,offsetHeight:De});x==null||x(ze,ue,Ve),Ne&&Promise.resolve().then(function(){Ne(ze,ue)})}},[]);return ge.useEffect(function(){var ue=J();return ue&&!g&&b(ue,oe),function(){return w(ue,oe)}},[R.current,g]),ge.createElement(f,{ref:D},H?ge.cloneElement(O,{ref:te}):O)}var k=ge.forwardRef(S),m=k,A="rc-observer-key";function I(l,c){var s=l.children,g=typeof s=="function"?[s]:(0,le.Z)(s);return g.map(function(R,D){var x=(R==null?void 0:R.key)||"".concat(A,"-").concat(D);return ge.createElement(m,(0,me.Z)({},l,{key:x,ref:D===0?c:void 0}),R)})}var C=ge.forwardRef(I);C.Collection=h;var P=C},88068:function(Ht,at,q){"use strict";q.d(at,{Z:function(){return Fa}});var me=q(87462),ge=q(4942),le=q(1413),G=q(97685),B=q(71002),V=q(45987),K=q(94184),F=q.n(K),i=q(67294);function U(Ee){var we=i.useRef();we.current=Ee;var We=i.useCallback(function(){for(var Ye,ut=arguments.length,At=new Array(ut),Ct=0;Ct<ut;Ct++)At[Ct]=arguments[Ct];return(Ye=we.current)===null||Ye===void 0?void 0:Ye.call.apply(Ye,[we].concat(At))},[]);return We}function L(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var v=L()?i.useLayoutEffect:i.useEffect,E=function(we,We){var Ye=i.useRef(!0);v(function(){return we(Ye.current)},We),v(function(){return Ye.current=!1,function(){Ye.current=!0}},[])},b=function(we,We){E(function(Ye){if(!Ye)return we()},We)},w=null;function p(Ee){var we=i.useRef(!1),We=i.useState(Ee),Ye=(0,G.Z)(We,2),ut=Ye[0],At=Ye[1];i.useEffect(function(){return we.current=!1,function(){we.current=!0}},[]);function Ct(Pt,Nt){Nt&&we.current||At(Pt)}return[ut,Ct]}function y(Ee){return Ee!==void 0}function M(Ee,we){var We=we||{},Ye=We.defaultValue,ut=We.value,At=We.onChange,Ct=We.postState,Pt=p(function(){return y(ut)?ut:y(Ye)?typeof Ye=="function"?Ye():Ye:typeof Ee=="function"?Ee():Ee}),Nt=(0,G.Z)(Pt,2),er=Nt[0],mr=Nt[1],Zt=ut!==void 0?ut:er,yr=Ct?Ct(Zt):Zt,Mr=U(At),jr=p([Zt]),Pr=(0,G.Z)(jr,2),Gr=Pr[0],Dr=Pr[1];b(function(){var fr=Gr[0];er!==fr&&Mr(er,fr)},[Gr]),b(function(){y(ut)||mr(ut)},[ut]);var Ar=U(function(fr,kr){mr(fr,kr),Dr([Zt],kr)});return[yr,Ar]}var d=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Ee=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Ee)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Ee==null?void 0:Ee.substr(0,4))},f=(0,i.createContext)(null),u=q(74902),h=q(48555),S=q(59864);function k(Ee,we,We){var Ye=i.useRef({});return(!("value"in Ye.current)||We(Ye.current.condition,we))&&(Ye.current.value=Ee(),Ye.current.condition=we),Ye.current.value}function m(Ee,we){typeof Ee=="function"?Ee(we):(0,B.Z)(Ee)==="object"&&Ee&&"current"in Ee&&(Ee.current=we)}function A(){for(var Ee=arguments.length,we=new Array(Ee),We=0;We<Ee;We++)we[We]=arguments[We];var Ye=we.filter(function(ut){return ut});return Ye.length<=1?Ye[0]:function(ut){we.forEach(function(At){m(At,ut)})}}function I(){for(var Ee=arguments.length,we=new Array(Ee),We=0;We<Ee;We++)we[We]=arguments[We];return k(function(){return A.apply(void 0,we)},we,function(Ye,ut){return Ye.length===ut.length&&Ye.every(function(At,Ct){return At===ut[Ct]})})}function C(Ee){var we,We,Ye=isMemo(Ee)?Ee.type.type:Ee.type;return!(typeof Ye=="function"&&!((we=Ye.prototype)!==null&&we!==void 0&&we.render)||typeof Ee=="function"&&!((We=Ee.prototype)!==null&&We!==void 0&&We.render))}var P=function(we){return+setTimeout(we,16)},l=function(we){return clearTimeout(we)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(P=function(we){return window.requestAnimationFrame(we)},l=function(we){return window.cancelAnimationFrame(we)});var c=0,s=new Map;function g(Ee){s.delete(Ee)}var R=function(we){var We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;c+=1;var Ye=c;function ut(At){if(At===0)g(Ye),we();else{var Ct=P(function(){ut(At-1)});s.set(Ye,Ct)}}return ut(We),Ye};R.cancel=function(Ee){var we=s.get(Ee);return g(we),l(we)};var D=R,x=function(we){var We=we.activeTabOffset,Ye=we.horizontal,ut=we.rtl,At=we.indicator,Ct=At===void 0?{}:At,Pt=Ct.size,Nt=Ct.align,er=Nt===void 0?"center":Nt,mr=(0,i.useState)(),Zt=(0,G.Z)(mr,2),yr=Zt[0],Mr=Zt[1],jr=(0,i.useRef)(),Pr=i.useCallback(function(Dr){return typeof Pt=="function"?Pt(Dr):typeof Pt=="number"?Pt:Dr},[Pt]);function Gr(){D.cancel(jr.current)}return(0,i.useEffect)(function(){var Dr={};if(We)if(Ye){Dr.width=Pr(We.width);var Ar=ut?"right":"left";er==="start"&&(Dr[Ar]=We[Ar]),er==="center"&&(Dr[Ar]=We[Ar]+We.width/2,Dr.transform=ut?"translateX(50%)":"translateX(-50%)"),er==="end"&&(Dr[Ar]=We[Ar]+We.width,Dr.transform="translateX(-100%)")}else Dr.height=Pr(We.height),er==="start"&&(Dr.top=We.top),er==="center"&&(Dr.top=We.top+We.height/2,Dr.transform="translateY(-50%)"),er==="end"&&(Dr.top=We.top+We.height,Dr.transform="translateY(-100%)");return Gr(),jr.current=D(function(){Mr(Dr)}),Gr},[We,Ye,ut,er,Pr]),{style:yr}},T=x,O={width:0,height:0,left:0,top:0};function $(Ee,we,We){return(0,i.useMemo)(function(){for(var Ye,ut=new Map,At=we.get((Ye=Ee[0])===null||Ye===void 0?void 0:Ye.key)||O,Ct=At.left+At.width,Pt=0;Pt<Ee.length;Pt+=1){var Nt=Ee[Pt].key,er=we.get(Nt);if(!er){var mr;er=we.get((mr=Ee[Pt-1])===null||mr===void 0?void 0:mr.key)||O}var Zt=ut.get(Nt)||(0,le.Z)({},er);Zt.right=Ct-Zt.left-Zt.width,ut.set(Nt,Zt)}return ut},[Ee.map(function(Ye){return Ye.key}).join("_"),we,We])}function H(Ee,we){var We=i.useRef(Ee),Ye=i.useState({}),ut=(0,G.Z)(Ye,2),At=ut[1];function Ct(Pt){var Nt=typeof Pt=="function"?Pt(We.current):Pt;Nt!==We.current&&we(Nt,We.current),We.current=Nt,At({})}return[We.current,Ct]}var Z=.1,te=.01,J=20,ie=Math.pow(.995,J);function oe(Ee,we){var We=(0,i.useState)(),Ye=(0,G.Z)(We,2),ut=Ye[0],At=Ye[1],Ct=(0,i.useState)(0),Pt=(0,G.Z)(Ct,2),Nt=Pt[0],er=Pt[1],mr=(0,i.useState)(0),Zt=(0,G.Z)(mr,2),yr=Zt[0],Mr=Zt[1],jr=(0,i.useState)(),Pr=(0,G.Z)(jr,2),Gr=Pr[0],Dr=Pr[1],Ar=(0,i.useRef)();function fr(Te){var Le=Te.touches[0],Me=Le.screenX,Re=Le.screenY;At({x:Me,y:Re}),window.clearInterval(Ar.current)}function kr(Te){if(ut){var Le=Te.touches[0],Me=Le.screenX,Re=Le.screenY;At({x:Me,y:Re});var Ke=Me-ut.x,Xe=Re-ut.y;we(Ke,Xe);var Dt=Date.now();er(Dt),Mr(Dt-Nt),Dr({x:Ke,y:Xe})}}function Pn(){if(ut&&(At(null),Dr(null),Gr)){var Te=Gr.x/yr,Le=Gr.y/yr,Me=Math.abs(Te),Re=Math.abs(Le);if(Math.max(Me,Re)<Z)return;var Ke=Te,Xe=Le;Ar.current=window.setInterval(function(){if(Math.abs(Ke)<te&&Math.abs(Xe)<te){window.clearInterval(Ar.current);return}Ke*=ie,Xe*=ie,we(Ke*J,Xe*J)},J)}}var yn=(0,i.useRef)();function Nn(Te){var Le=Te.deltaX,Me=Te.deltaY,Re=0,Ke=Math.abs(Le),Xe=Math.abs(Me);Ke===Xe?Re=yn.current==="x"?Le:Me:Ke>Xe?(Re=Le,yn.current="x"):(Re=Me,yn.current="y"),we(-Re,-Re)&&Te.preventDefault()}var ve=(0,i.useRef)(null);ve.current={onTouchStart:fr,onTouchMove:kr,onTouchEnd:Pn,onWheel:Nn},i.useEffect(function(){function Te(Ke){ve.current.onTouchStart(Ke)}function Le(Ke){ve.current.onTouchMove(Ke)}function Me(Ke){ve.current.onTouchEnd(Ke)}function Re(Ke){ve.current.onWheel(Ke)}return document.addEventListener("touchmove",Le,{passive:!1}),document.addEventListener("touchend",Me,{passive:!0}),Ee.current.addEventListener("touchstart",Te,{passive:!0}),Ee.current.addEventListener("wheel",Re,{passive:!1}),function(){document.removeEventListener("touchmove",Le),document.removeEventListener("touchend",Me)}},[])}function ue(Ee){var we=(0,i.useState)(0),We=(0,G.Z)(we,2),Ye=We[0],ut=We[1],At=(0,i.useRef)(0),Ct=(0,i.useRef)();return Ct.current=Ee,b(function(){var Pt;(Pt=Ct.current)===null||Pt===void 0||Pt.call(Ct)},[Ye]),function(){At.current===Ye&&(At.current+=1,ut(At.current))}}function Pe(Ee){var we=(0,i.useRef)([]),We=(0,i.useState)({}),Ye=(0,G.Z)(We,2),ut=Ye[1],At=(0,i.useRef)(typeof Ee=="function"?Ee():Ee),Ct=ue(function(){var Nt=At.current;we.current.forEach(function(er){Nt=er(Nt)}),we.current=[],At.current=Nt,ut({})});function Pt(Nt){we.current.push(Nt),Ct()}return[At.current,Pt]}var Ne={width:0,height:0,left:0,top:0,right:0};function Ve(Ee,we,We,Ye,ut,At,Ct){var Pt=Ct.tabs,Nt=Ct.tabPosition,er=Ct.rtl,mr,Zt,yr;return["top","bottom"].includes(Nt)?(mr="width",Zt=er?"right":"left",yr=Math.abs(We)):(mr="height",Zt="top",yr=-We),(0,i.useMemo)(function(){if(!Pt.length)return[0,0];for(var Mr=Pt.length,jr=Mr,Pr=0;Pr<Mr;Pr+=1){var Gr=Ee.get(Pt[Pr].key)||Ne;if(Math.floor(Gr[Zt]+Gr[mr])>Math.floor(yr+we)){jr=Pr-1;break}}for(var Dr=0,Ar=Mr-1;Ar>=0;Ar-=1){var fr=Ee.get(Pt[Ar].key)||Ne;if(fr[Zt]<yr){Dr=Ar+1;break}}return Dr>=jr?[0,0]:[Dr,jr]},[Ee,we,Ye,ut,At,yr,Nt,Pt.map(function(Mr){return Mr.key}).join("_"),er])}function ot(Ee){var we;return Ee instanceof Map?(we={},Ee.forEach(function(We,Ye){we[Ye]=We})):we=Ee,JSON.stringify(we)}var Et="TABS_DQ";function it(Ee){return String(Ee).replace(/"/g,Et)}function Ie(Ee,we,We,Ye){return!(!We||Ye||Ee===!1||Ee===void 0&&(we===!1||we===null))}var He=i.forwardRef(function(Ee,we){var We=Ee.prefixCls,Ye=Ee.editable,ut=Ee.locale,At=Ee.style;return!Ye||Ye.showAdd===!1?null:i.createElement("button",{ref:we,type:"button",className:"".concat(We,"-nav-add"),style:At,"aria-label":(ut==null?void 0:ut.addAriaLabel)||"Add tab",onClick:function(Pt){Ye.onEdit("add",{event:Pt})}},Ye.addIcon||"+")}),ht=He,ft=i.forwardRef(function(Ee,we){var We=Ee.position,Ye=Ee.prefixCls,ut=Ee.extra;if(!ut)return null;var At,Ct={};return(0,B.Z)(ut)==="object"&&!i.isValidElement(ut)?Ct=ut:Ct.right=ut,We==="right"&&(At=Ct.right),We==="left"&&(At=Ct.left),At?i.createElement("div",{className:"".concat(Ye,"-extra-content"),ref:we},At):null}),dt=ft,se=q(98280),De=q(39607);function ze(Ee,we,We){var Ye=React.useRef({});return(!("value"in Ye.current)||We(Ye.current.condition,we))&&(Ye.current.value=Ee(),Ye.current.condition=we),Ye.current.value}var Ge=Symbol.for("react.element"),qe=Symbol.for("react.transitional.element"),vt=Symbol.for("react.fragment");function Ut(Ee){return Ee&&(0,B.Z)(Ee)==="object"&&(Ee.$$typeof===Ge||Ee.$$typeof===qe)&&Ee.type===vt}var bt=Number(i.version.split(".")[0]),ke=function(we,We){typeof we=="function"?we(We):(0,B.Z)(we)==="object"&&we&&"current"in we&&(we.current=We)},lt=function(){for(var we=arguments.length,We=new Array(we),Ye=0;Ye<we;Ye++)We[Ye]=arguments[Ye];var ut=We.filter(Boolean);return ut.length<=1?ut[0]:function(At){We.forEach(function(Ct){ke(Ct,At)})}},$t=function(){for(var we=arguments.length,We=new Array(we),Ye=0;Ye<we;Ye++)We[Ye]=arguments[Ye];return useMemo(function(){return lt.apply(void 0,We)},We,function(ut,At){return ut.length!==At.length||ut.every(function(Ct,Pt){return Ct!==At[Pt]})})},tt=function(we){var We,Ye;if(!we)return!1;if(Ze(we)&&bt>=19)return!0;var ut=(0,De.isMemo)(we)?we.type.type:we.type;return!(typeof ut=="function"&&!((We=ut.prototype)!==null&&We!==void 0&&We.render)&&ut.$$typeof!==De.ForwardRef||typeof we=="function"&&!((Ye=we.prototype)!==null&&Ye!==void 0&&Ye.render)&&we.$$typeof!==De.ForwardRef)};function Ze(Ee){return(0,i.isValidElement)(Ee)&&!Ut(Ee)}var Je=function(we){return Ze(we)&&tt(we)},pt=function(we){if(we&&Ze(we)){var We=we;return We.props.propertyIsEnumerable("ref")?We.props.ref:We.ref}return null},je={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(we){var We=we.keyCode;if(we.altKey&&!we.ctrlKey||we.metaKey||We>=je.F1&&We<=je.F12)return!1;switch(We){case je.ALT:case je.CAPS_LOCK:case je.CONTEXT_MENU:case je.CTRL:case je.DOWN:case je.END:case je.ESC:case je.HOME:case je.INSERT:case je.LEFT:case je.MAC_FF_META:case je.META:case je.NUMLOCK:case je.NUM_CENTER:case je.PAGE_DOWN:case je.PAGE_UP:case je.PAUSE:case je.PRINT_SCREEN:case je.RIGHT:case je.SHIFT:case je.UP:case je.WIN_KEY:case je.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(we){if(we>=je.ZERO&&we<=je.NINE||we>=je.NUM_ZERO&&we<=je.NUM_MULTIPLY||we>=je.A&&we<=je.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&we===0)return!0;switch(we){case je.SPACE:case je.QUESTION_MARK:case je.NUM_PLUS:case je.NUM_MINUS:case je.NUM_PERIOD:case je.NUM_DIVISION:case je.SEMICOLON:case je.DASH:case je.EQUALS:case je.COMMA:case je.PERIOD:case je.SLASH:case je.APOSTROPHE:case je.SINGLE_QUOTE:case je.OPEN_SQUARE_BRACKET:case je.BACKSLASH:case je.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},_t=je,xt=function(we){return+setTimeout(we,16)},Kt=function(we){return clearTimeout(we)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(xt=function(we){return window.requestAnimationFrame(we)},Kt=function(we){return window.cancelAnimationFrame(we)});var Bt=0,Rt=new Map;function Se(Ee){Rt.delete(Ee)}var fe=function(we){var We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Bt+=1;var Ye=Bt;function ut(At){if(At===0)Se(Ye),we();else{var Ct=xt(function(){ut(At-1)});Rt.set(Ye,Ct)}}return ut(We),Ye};fe.cancel=function(Ee){var we=Rt.get(Ee);return Se(Ee),Kt(we)};var Ce=fe,de=_t.ESC,pe=_t.TAB;function xe(Ee){var we=Ee.visible,We=Ee.triggerRef,Ye=Ee.onVisibleChange,ut=Ee.autoFocus,At=Ee.overlayRef,Ct=i.useRef(!1),Pt=function(){if(we){var Zt,yr;(Zt=We.current)===null||Zt===void 0||(yr=Zt.focus)===null||yr===void 0||yr.call(Zt),Ye==null||Ye(!1)}},Nt=function(){var Zt;return(Zt=At.current)!==null&&Zt!==void 0&&Zt.focus?(At.current.focus(),Ct.current=!0,!0):!1},er=function(Zt){switch(Zt.keyCode){case de:Pt();break;case pe:{var yr=!1;Ct.current||(yr=Nt()),yr?Zt.preventDefault():Pt();break}}};i.useEffect(function(){return we?(window.addEventListener("keydown",er),ut&&Ce(Nt,3),function(){window.removeEventListener("keydown",er),Ct.current=!1}):function(){Ct.current=!1}},[we])}var Q=(0,i.forwardRef)(function(Ee,we){var We=Ee.overlay,Ye=Ee.arrow,ut=Ee.prefixCls,At=(0,i.useMemo)(function(){var Pt;return typeof We=="function"?Pt=We():Pt=We,Pt},[We]),Ct=lt(we,pt(At));return i.createElement(i.Fragment,null,Ye&&i.createElement("div",{className:"".concat(ut,"-arrow")}),i.cloneElement(At,{ref:tt(At)?Ct:void 0}))}),ne=Q,ce={adjustX:1,adjustY:1},Ae=[0,0],be={topLeft:{points:["bl","tl"],overflow:ce,offset:[0,-4],targetOffset:Ae},top:{points:["bc","tc"],overflow:ce,offset:[0,-4],targetOffset:Ae},topRight:{points:["br","tr"],overflow:ce,offset:[0,-4],targetOffset:Ae},bottomLeft:{points:["tl","bl"],overflow:ce,offset:[0,4],targetOffset:Ae},bottom:{points:["tc","bc"],overflow:ce,offset:[0,4],targetOffset:Ae},bottomRight:{points:["tr","br"],overflow:ce,offset:[0,4],targetOffset:Ae}},Oe=be,$e=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function mt(Ee,we){var We,Ye=Ee.arrow,ut=Ye===void 0?!1:Ye,At=Ee.prefixCls,Ct=At===void 0?"rc-dropdown":At,Pt=Ee.transitionName,Nt=Ee.animation,er=Ee.align,mr=Ee.placement,Zt=mr===void 0?"bottomLeft":mr,yr=Ee.placements,Mr=yr===void 0?Oe:yr,jr=Ee.getPopupContainer,Pr=Ee.showAction,Gr=Ee.hideAction,Dr=Ee.overlayClassName,Ar=Ee.overlayStyle,fr=Ee.visible,kr=Ee.trigger,Pn=kr===void 0?["hover"]:kr,yn=Ee.autoFocus,Nn=Ee.overlay,ve=Ee.children,Te=Ee.onVisibleChange,Le=(0,V.Z)(Ee,$e),Me=i.useState(),Re=(0,G.Z)(Me,2),Ke=Re[0],Xe=Re[1],Dt="visible"in Ee?fr:Ke,Xt=i.useRef(null),Wt=i.useRef(null),gr=i.useRef(null);i.useImperativeHandle(we,function(){return Xt.current});var hr=function(ye){Xe(ye),Te==null||Te(ye)};xe({visible:Dt,triggerRef:gr,onVisibleChange:hr,autoFocus:yn,overlayRef:Wt});var br=function(ye){var Fe=Ee.onOverlayClick;Xe(!1),Fe&&Fe(ye)},Cr=function(){return i.createElement(ne,{ref:Wt,overlay:Nn,prefixCls:Ct,arrow:ut})},lr=function(){return typeof Nn=="function"?Cr:Cr()},tr=function(){var ye=Ee.minOverlayWidthMatchTrigger,Fe=Ee.alignPoint;return"minOverlayWidthMatchTrigger"in Ee?ye:!Fe},sr=function(){var ye=Ee.openClassName;return ye!==void 0?ye:"".concat(Ct,"-open")},Y=i.cloneElement(ve,{className:F()((We=ve.props)===null||We===void 0?void 0:We.className,Dt&&sr()),ref:tt(ve)?lt(gr,pt(ve)):void 0}),re=Gr;return!re&&Pn.indexOf("contextMenu")!==-1&&(re=["click"]),i.createElement(se.Z,(0,me.Z)({builtinPlacements:Mr},Le,{prefixCls:Ct,ref:Xt,popupClassName:F()(Dr,(0,ge.Z)({},"".concat(Ct,"-show-arrow"),ut)),popupStyle:Ar,action:Pn,showAction:Pr,hideAction:re,popupPlacement:Zt,popupAlign:er,popupTransitionName:Pt,popupAnimation:Nt,popupVisible:Dt,stretch:tr()?"minWidth":"",popup:lr(),onPopupVisibleChange:hr,onPopupClick:br,getPopupContainer:jr}),Y)}var Mt=i.forwardRef(mt),Jt=Mt,jt=q(78595),rt={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(we){var We=we.keyCode;if(we.altKey&&!we.ctrlKey||we.metaKey||We>=rt.F1&&We<=rt.F12)return!1;switch(We){case rt.ALT:case rt.CAPS_LOCK:case rt.CONTEXT_MENU:case rt.CTRL:case rt.DOWN:case rt.END:case rt.ESC:case rt.HOME:case rt.INSERT:case rt.LEFT:case rt.MAC_FF_META:case rt.META:case rt.NUMLOCK:case rt.NUM_CENTER:case rt.PAGE_DOWN:case rt.PAGE_UP:case rt.PAUSE:case rt.PRINT_SCREEN:case rt.RIGHT:case rt.SHIFT:case rt.UP:case rt.WIN_KEY:case rt.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(we){if(we>=rt.ZERO&&we<=rt.NINE||we>=rt.NUM_ZERO&&we<=rt.NUM_MULTIPLY||we>=rt.A&&we<=rt.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&we===0)return!0;switch(we){case rt.SPACE:case rt.QUESTION_MARK:case rt.NUM_PLUS:case rt.NUM_MINUS:case rt.NUM_PERIOD:case rt.NUM_DIVISION:case rt.SEMICOLON:case rt.DASH:case rt.EQUALS:case rt.COMMA:case rt.PERIOD:case rt.SLASH:case rt.APOSTROPHE:case rt.SINGLE_QUOTE:case rt.OPEN_SQUARE_BRACKET:case rt.BACKSLASH:case rt.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},Tt=rt,ur=i.forwardRef(function(Ee,we){var We=Ee.prefixCls,Ye=Ee.id,ut=Ee.tabs,At=Ee.locale,Ct=Ee.mobile,Pt=Ee.more,Nt=Pt===void 0?{}:Pt,er=Ee.style,mr=Ee.className,Zt=Ee.editable,yr=Ee.tabBarGutter,Mr=Ee.rtl,jr=Ee.removeAriaLabel,Pr=Ee.onTabClick,Gr=Ee.getPopupContainer,Dr=Ee.popupClassName,Ar=(0,i.useState)(!1),fr=(0,G.Z)(Ar,2),kr=fr[0],Pn=fr[1],yn=(0,i.useState)(null),Nn=(0,G.Z)(yn,2),ve=Nn[0],Te=Nn[1],Le=Nt.icon,Me=Le===void 0?"More":Le,Re="".concat(Ye,"-more-popup"),Ke="".concat(We,"-dropdown"),Xe=ve!==null?"".concat(Re,"-").concat(ve):null,Dt=At==null?void 0:At.dropdownAriaLabel;function Xt(tr,sr){tr.preventDefault(),tr.stopPropagation(),Zt.onEdit("remove",{key:sr,event:tr})}var Wt=i.createElement(jt.ZP,{onClick:function(sr){var Y=sr.key,re=sr.domEvent;Pr(Y,re),Pn(!1)},prefixCls:"".concat(Ke,"-menu"),id:Re,tabIndex:-1,role:"listbox","aria-activedescendant":Xe,selectedKeys:[ve],"aria-label":Dt!==void 0?Dt:"expanded dropdown"},ut.map(function(tr){var sr=tr.closable,Y=tr.disabled,re=tr.closeIcon,ee=tr.key,ye=tr.label,Fe=Ie(sr,re,Zt,Y);return i.createElement(jt.sN,{key:ee,id:"".concat(Re,"-").concat(ee),role:"option","aria-controls":Ye&&"".concat(Ye,"-panel-").concat(ee),disabled:Y},i.createElement("span",null,ye),Fe&&i.createElement("button",{type:"button","aria-label":jr||"remove",tabIndex:0,className:"".concat(Ke,"-menu-item-remove"),onClick:function(ct){ct.stopPropagation(),Xt(ct,ee)}},re||Zt.removeIcon||"\xD7"))}));function gr(tr){for(var sr=ut.filter(function(Fe){return!Fe.disabled}),Y=sr.findIndex(function(Fe){return Fe.key===ve})||0,re=sr.length,ee=0;ee<re;ee+=1){Y=(Y+tr+re)%re;var ye=sr[Y];if(!ye.disabled){Te(ye.key);return}}}function hr(tr){var sr=tr.which;if(!kr){[Tt.DOWN,Tt.SPACE,Tt.ENTER].includes(sr)&&(Pn(!0),tr.preventDefault());return}switch(sr){case Tt.UP:gr(-1),tr.preventDefault();break;case Tt.DOWN:gr(1),tr.preventDefault();break;case Tt.ESC:Pn(!1);break;case Tt.SPACE:case Tt.ENTER:ve!==null&&Pr(ve,tr);break}}(0,i.useEffect)(function(){var tr=document.getElementById(Xe);tr&&tr.scrollIntoView&&tr.scrollIntoView(!1)},[ve]),(0,i.useEffect)(function(){kr||Te(null)},[kr]);var br=(0,ge.Z)({},Mr?"marginRight":"marginLeft",yr);ut.length||(br.visibility="hidden",br.order=1);var Cr=F()((0,ge.Z)({},"".concat(Ke,"-rtl"),Mr)),lr=Ct?null:i.createElement(Jt,(0,me.Z)({prefixCls:Ke,overlay:Wt,visible:ut.length?kr:!1,onVisibleChange:Pn,overlayClassName:F()(Cr,Dr),mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:Gr},Nt),i.createElement("button",{type:"button",className:"".concat(We,"-nav-more"),style:br,"aria-haspopup":"listbox","aria-controls":Re,id:"".concat(Ye,"-more"),"aria-expanded":kr,onKeyDown:hr},Me));return i.createElement("div",{className:F()("".concat(We,"-nav-operations"),mr),style:er,ref:we},lr,i.createElement(ht,{prefixCls:We,locale:At,editable:Zt}))}),ir=i.memo(ur,function(Ee,we){return we.tabMoving}),cr=function(we){var We=we.prefixCls,Ye=we.id,ut=we.active,At=we.focus,Ct=we.tab,Pt=Ct.key,Nt=Ct.label,er=Ct.disabled,mr=Ct.closeIcon,Zt=Ct.icon,yr=we.closable,Mr=we.renderWrapper,jr=we.removeAriaLabel,Pr=we.editable,Gr=we.onClick,Dr=we.onFocus,Ar=we.onBlur,fr=we.onKeyDown,kr=we.onMouseDown,Pn=we.onMouseUp,yn=we.style,Nn=we.tabCount,ve=we.currentPosition,Te="".concat(We,"-tab"),Le=Ie(yr,mr,Pr,er);function Me(Xt){er||Gr(Xt)}function Re(Xt){Xt.preventDefault(),Xt.stopPropagation(),Pr.onEdit("remove",{key:Pt,event:Xt})}var Ke=i.useMemo(function(){return Zt&&typeof Nt=="string"?i.createElement("span",null,Nt):Nt},[Nt,Zt]),Xe=i.useRef(null);i.useEffect(function(){At&&Xe.current&&Xe.current.focus()},[At]);var Dt=i.createElement("div",{key:Pt,"data-node-key":it(Pt),className:F()(Te,(0,ge.Z)((0,ge.Z)((0,ge.Z)((0,ge.Z)({},"".concat(Te,"-with-remove"),Le),"".concat(Te,"-active"),ut),"".concat(Te,"-disabled"),er),"".concat(Te,"-focus"),At)),style:yn,onClick:Me},i.createElement("div",{ref:Xe,role:"tab","aria-selected":ut,id:Ye&&"".concat(Ye,"-tab-").concat(Pt),className:"".concat(Te,"-btn"),"aria-controls":Ye&&"".concat(Ye,"-panel-").concat(Pt),"aria-disabled":er,tabIndex:er?null:ut?0:-1,onClick:function(Wt){Wt.stopPropagation(),Me(Wt)},onKeyDown:fr,onMouseDown:kr,onMouseUp:Pn,onFocus:Dr,onBlur:Ar},At&&i.createElement("div",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"Tab ".concat(ve," of ").concat(Nn)),Zt&&i.createElement("span",{className:"".concat(Te,"-icon")},Zt),Nt&&Ke),Le&&i.createElement("button",{type:"button",role:"tab","aria-label":jr||"remove",tabIndex:ut?0:-1,className:"".concat(Te,"-remove"),onClick:function(Wt){Wt.stopPropagation(),Re(Wt)}},mr||Pr.removeIcon||"\xD7"));return Mr?Mr(Dt):Dt},Ur=cr,ar=function(we,We){var Ye=we.offsetWidth,ut=we.offsetHeight,At=we.offsetTop,Ct=we.offsetLeft,Pt=we.getBoundingClientRect(),Nt=Pt.width,er=Pt.height,mr=Pt.left,Zt=Pt.top;return Math.abs(Nt-Ye)<1?[Nt,er,mr-We.left,Zt-We.top]:[Ye,ut,Ct,At]},Er=function(we){var We=we.current||{},Ye=We.offsetWidth,ut=Ye===void 0?0:Ye,At=We.offsetHeight,Ct=At===void 0?0:At;if(we.current){var Pt=we.current.getBoundingClientRect(),Nt=Pt.width,er=Pt.height;if(Math.abs(Nt-ut)<1)return[Nt,er]}return[ut,Ct]},Yr=function(we,We){return we[We?0:1]},Hn=i.forwardRef(function(Ee,we){var We=Ee.className,Ye=Ee.style,ut=Ee.id,At=Ee.animated,Ct=Ee.activeKey,Pt=Ee.rtl,Nt=Ee.extra,er=Ee.editable,mr=Ee.locale,Zt=Ee.tabPosition,yr=Ee.tabBarGutter,Mr=Ee.children,jr=Ee.onTabClick,Pr=Ee.onTabScroll,Gr=Ee.indicator,Dr=i.useContext(f),Ar=Dr.prefixCls,fr=Dr.tabs,kr=(0,i.useRef)(null),Pn=(0,i.useRef)(null),yn=(0,i.useRef)(null),Nn=(0,i.useRef)(null),ve=(0,i.useRef)(null),Te=(0,i.useRef)(null),Le=(0,i.useRef)(null),Me=Zt==="top"||Zt==="bottom",Re=H(0,function(Rr,kt){Me&&Pr&&Pr({direction:Rr>kt?"left":"right"})}),Ke=(0,G.Z)(Re,2),Xe=Ke[0],Dt=Ke[1],Xt=H(0,function(Rr,kt){!Me&&Pr&&Pr({direction:Rr>kt?"top":"bottom"})}),Wt=(0,G.Z)(Xt,2),gr=Wt[0],hr=Wt[1],br=(0,i.useState)([0,0]),Cr=(0,G.Z)(br,2),lr=Cr[0],tr=Cr[1],sr=(0,i.useState)([0,0]),Y=(0,G.Z)(sr,2),re=Y[0],ee=Y[1],ye=(0,i.useState)([0,0]),Fe=(0,G.Z)(ye,2),et=Fe[0],ct=Fe[1],Ft=(0,i.useState)([0,0]),Ot=(0,G.Z)(Ft,2),It=Ot[0],or=Ot[1],nr=Pe(new Map),vr=(0,G.Z)(nr,2),rr=vr[0],_r=vr[1],Or=$(fr,rr,re[0]),Lr=Yr(lr,Me),Vr=Yr(re,Me),zr=Yr(et,Me),Fr=Yr(It,Me),tn=Math.floor(Lr)<Math.floor(Vr+zr),xr=tn?Lr-Fr:Lr-zr,dr="".concat(Ar,"-nav-operations-hidden"),rn=0,Xr=0;Me&&Pt?(rn=0,Xr=Math.max(0,Vr-xr)):(rn=Math.min(0,xr-Vr),Xr=0);function pn(Rr){return Rr<rn?rn:Rr>Xr?Xr:Rr}var Gn=(0,i.useRef)(null),In=(0,i.useState)(),On=(0,G.Z)(In,2),on=On[0],Tn=On[1];function Dn(){Tn(Date.now())}function cn(){Gn.current&&clearTimeout(Gn.current)}oe(Nn,function(Rr,kt){function Qt(pr,Ir){pr(function(Nr){var Hi=pn(Nr+Ir);return Hi})}return tn?(Me?Qt(Dt,Rr):Qt(hr,kt),cn(),Dn(),!0):!1}),(0,i.useEffect)(function(){return cn(),on&&(Gn.current=setTimeout(function(){Tn(0)},100)),cn},[on]);var Zn=Ve(Or,xr,Me?Xe:gr,Vr,zr,Fr,(0,le.Z)((0,le.Z)({},Ee),{},{tabs:fr})),$r=(0,G.Z)(Zn,2),fn=$r[0],Br=$r[1],Yn=U(function(){var Rr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ct,kt=Or.get(Rr)||{width:0,height:0,left:0,right:0,top:0};if(Me){var Qt=Xe;Pt?kt.right<Xe?Qt=kt.right:kt.right+kt.width>Xe+xr&&(Qt=kt.right+kt.width-xr):kt.left<-Xe?Qt=-kt.left:kt.left+kt.width>-Xe+xr&&(Qt=-(kt.left+kt.width-xr)),hr(0),Dt(pn(Qt))}else{var pr=gr;kt.top<-gr?pr=-kt.top:kt.top+kt.height>-gr+xr&&(pr=-(kt.top+kt.height-xr)),Dt(0),hr(pn(pr))}}),li=(0,i.useState)(),mn=(0,G.Z)(li,2),Tr=mn[0],An=mn[1],nn=(0,i.useState)(!1),ui=(0,G.Z)(nn,2),kn=ui[0],ln=ui[1],Kn=fr.filter(function(Rr){return!Rr.disabled}).map(function(Rr){return Rr.key}),ci=function(kt){var Qt=Kn.indexOf(Tr||Ct),pr=Kn.length,Ir=(Qt+kt+pr)%pr,Nr=Kn[Ir];An(Nr)},Zr=function(kt){var Qt=kt.code,pr=Pt&&Me,Ir=Kn[0],Nr=Kn[Kn.length-1];switch(Qt){case"ArrowLeft":{Me&&ci(pr?1:-1);break}case"ArrowRight":{Me&&ci(pr?-1:1);break}case"ArrowUp":{kt.preventDefault(),Me||ci(-1);break}case"ArrowDown":{kt.preventDefault(),Me||ci(1);break}case"Home":{kt.preventDefault(),An(Ir);break}case"End":{kt.preventDefault(),An(Nr);break}case"Enter":case"Space":{kt.preventDefault(),jr(Ct,kt);break}case"Backspace":case"Delete":{var Hi=Kn.indexOf(Tr),ri=fr.find(function(Li){return Li.key===Tr}),fi=Ie(ri==null?void 0:ri.closable,ri==null?void 0:ri.closeIcon,er,ri==null?void 0:ri.disabled);fi&&(kt.preventDefault(),kt.stopPropagation(),er.onEdit("remove",{key:Tr,event:kt}),Hi===Kn.length-1?ci(-1):ci(1));break}}},Un={};Me?Un[Pt?"marginRight":"marginLeft"]=yr:Un.marginTop=yr;var Fn=fr.map(function(Rr,kt){var Qt=Rr.key;return i.createElement(Ur,{id:ut,prefixCls:Ar,key:Qt,tab:Rr,style:kt===0?void 0:Un,closable:Rr.closable,editable:er,active:Qt===Ct,focus:Qt===Tr,renderWrapper:Mr,removeAriaLabel:mr==null?void 0:mr.removeAriaLabel,tabCount:Kn.length,currentPosition:kt+1,onClick:function(Ir){jr(Qt,Ir)},onKeyDown:Zr,onFocus:function(){kn||An(Qt),Yn(Qt),Dn(),Nn.current&&(Pt||(Nn.current.scrollLeft=0),Nn.current.scrollTop=0)},onBlur:function(){An(void 0)},onMouseDown:function(){ln(!0)},onMouseUp:function(){ln(!1)}})}),Cn=function(){return _r(function(){var kt,Qt=new Map,pr=(kt=ve.current)===null||kt===void 0?void 0:kt.getBoundingClientRect();return fr.forEach(function(Ir){var Nr,Hi=Ir.key,ri=(Nr=ve.current)===null||Nr===void 0?void 0:Nr.querySelector('[data-node-key="'.concat(it(Hi),'"]'));if(ri){var fi=ar(ri,pr),Li=(0,G.Z)(fi,4),Ba=Li[0],ja=Li[1],Ga=Li[2],xa=Li[3];Qt.set(Hi,{width:Ba,height:ja,left:Ga,top:xa})}}),Qt})};(0,i.useEffect)(function(){Cn()},[fr.map(function(Rr){return Rr.key}).join("_")]);var Qn=ue(function(){var Rr=Er(kr),kt=Er(Pn),Qt=Er(yn);tr([Rr[0]-kt[0]-Qt[0],Rr[1]-kt[1]-Qt[1]]);var pr=Er(Le);ct(pr);var Ir=Er(Te);or(Ir);var Nr=Er(ve);ee([Nr[0]-pr[0],Nr[1]-pr[1]]),Cn()}),Mi=fr.slice(0,fn),zn=fr.slice(Br+1),qr=[].concat((0,u.Z)(Mi),(0,u.Z)(zn)),$n=Or.get(Ct),bn=T({activeTabOffset:$n,horizontal:Me,indicator:Gr,rtl:Pt}),ba=bn.style;(0,i.useEffect)(function(){Yn()},[Ct,rn,Xr,ot($n),ot(Or),Me]),(0,i.useEffect)(function(){Qn()},[Pt]);var an=!!qr.length,yi="".concat(Ar,"-nav-wrap"),$i,Ln,Ci,bi;return Me?Pt?(Ln=Xe>0,$i=Xe!==Xr):($i=Xe<0,Ln=Xe!==rn):(Ci=gr<0,bi=gr!==rn),i.createElement(h.Z,{onResize:Qn},i.createElement("div",{ref:I(we,kr),role:"tablist","aria-orientation":Me?"horizontal":"vertical",className:F()("".concat(Ar,"-nav"),We),style:Ye,onKeyDown:function(){Dn()}},i.createElement(dt,{ref:Pn,position:"left",extra:Nt,prefixCls:Ar}),i.createElement(h.Z,{onResize:Qn},i.createElement("div",{className:F()(yi,(0,ge.Z)((0,ge.Z)((0,ge.Z)((0,ge.Z)({},"".concat(yi,"-ping-left"),$i),"".concat(yi,"-ping-right"),Ln),"".concat(yi,"-ping-top"),Ci),"".concat(yi,"-ping-bottom"),bi)),ref:Nn},i.createElement(h.Z,{onResize:Qn},i.createElement("div",{ref:ve,className:"".concat(Ar,"-nav-list"),style:{transform:"translate(".concat(Xe,"px, ").concat(gr,"px)"),transition:on?"none":void 0}},Fn,i.createElement(ht,{ref:Le,prefixCls:Ar,locale:mr,editable:er,style:(0,le.Z)((0,le.Z)({},Fn.length===0?void 0:Un),{},{visibility:an?"hidden":null})}),i.createElement("div",{className:F()("".concat(Ar,"-ink-bar"),(0,ge.Z)({},"".concat(Ar,"-ink-bar-animated"),At.inkBar)),style:ba}))))),i.createElement(ir,(0,me.Z)({},Ee,{removeAriaLabel:mr==null?void 0:mr.removeAriaLabel,ref:Te,prefixCls:Ar,tabs:qr,className:!an&&dr,tabMoving:!!on})),i.createElement(dt,{ref:yn,position:"right",extra:Nt,prefixCls:Ar})))}),Mn=Hn,ei=i.forwardRef(function(Ee,we){var We=Ee.prefixCls,Ye=Ee.className,ut=Ee.style,At=Ee.id,Ct=Ee.active,Pt=Ee.tabKey,Nt=Ee.children;return i.createElement("div",{id:At&&"".concat(At,"-panel-").concat(Pt),role:"tabpanel",tabIndex:Ct?0:-1,"aria-labelledby":At&&"".concat(At,"-tab-").concat(Pt),"aria-hidden":!Ct,style:ut,className:F()(We,Ct&&"".concat(We,"-active"),Ye),ref:we},Nt)}),mi=ei,ti=["renderTabBar"],en=["label","key"],Fi=function(we){var We=we.renderTabBar,Ye=(0,V.Z)(we,ti),ut=i.useContext(f),At=ut.tabs;if(We){var Ct=(0,le.Z)((0,le.Z)({},Ye),{},{panes:At.map(function(Pt){var Nt=Pt.label,er=Pt.key,mr=(0,V.Z)(Pt,en);return i.createElement(mi,(0,me.Z)({tab:Nt,key:er,tabKey:er},mr))})});return We(Ct,Mn)}return i.createElement(Mn,Ye)},Bi=Fi,Vi=q(62874),vi=["key","forceRender","style","className","destroyInactiveTabPane"],Ia=function(we){var We=we.id,Ye=we.activeKey,ut=we.animated,At=we.tabPosition,Ct=we.destroyInactiveTabPane,Pt=i.useContext(f),Nt=Pt.prefixCls,er=Pt.tabs,mr=ut.tabPane,Zt="".concat(Nt,"-tabpane");return i.createElement("div",{className:F()("".concat(Nt,"-content-holder"))},i.createElement("div",{className:F()("".concat(Nt,"-content"),"".concat(Nt,"-content-").concat(At),(0,ge.Z)({},"".concat(Nt,"-content-animated"),mr))},er.map(function(yr){var Mr=yr.key,jr=yr.forceRender,Pr=yr.style,Gr=yr.className,Dr=yr.destroyInactiveTabPane,Ar=(0,V.Z)(yr,vi),fr=Mr===Ye;return i.createElement(Vi.Z,(0,me.Z)({key:Mr,visible:fr,forceRender:jr,removeOnLeave:!!(Ct||Dr),leavedClassName:"".concat(Zt,"-hidden")},ut.tabPaneMotion),function(kr,Pn){var yn=kr.style,Nn=kr.className;return i.createElement(mi,(0,me.Z)({},Ar,{prefixCls:Zt,id:We,tabKey:Mr,animated:mr,active:fr,style:(0,le.Z)((0,le.Z)({},Pr),yn),className:F()(Gr,Nn),ref:Pn}))})})))},ki=Ia,qi={},Ui=[],Si=function(we){Ui.push(we)};function gi(Ee,we){if(0)var We}function zi(Ee,we){if(0)var We}function hn(){qi={}}function dn(Ee,we,We){!we&&!qi[We]&&(Ee(!1,We),qi[We]=!0)}function Sr(Ee,we){dn(gi,Ee,we)}function _i(Ee,we){dn(zi,Ee,we)}Sr.preMessage=Si,Sr.resetWarned=hn,Sr.noteOnce=_i;var is=null;function Oa(){var Ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},we;return Ee===!1?we={inkBar:!1,tabPane:!1}:Ee===!0?we={inkBar:!0,tabPane:!1}:we=(0,le.Z)({inkBar:!0},(0,B.Z)(Ee)==="object"?Ee:{}),we.tabPaneMotion&&we.tabPane===void 0&&(we.tabPane=!0),!we.tabPaneMotion&&we.tabPane&&(we.tabPane=!1),we}var jn=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","more","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicator"],ya=0,Ha=i.forwardRef(function(Ee,we){var We=Ee.id,Ye=Ee.prefixCls,ut=Ye===void 0?"rc-tabs":Ye,At=Ee.className,Ct=Ee.items,Pt=Ee.direction,Nt=Ee.activeKey,er=Ee.defaultActiveKey,mr=Ee.editable,Zt=Ee.animated,yr=Ee.tabPosition,Mr=yr===void 0?"top":yr,jr=Ee.tabBarGutter,Pr=Ee.tabBarStyle,Gr=Ee.tabBarExtraContent,Dr=Ee.locale,Ar=Ee.more,fr=Ee.destroyInactiveTabPane,kr=Ee.renderTabBar,Pn=Ee.onChange,yn=Ee.onTabClick,Nn=Ee.onTabScroll,ve=Ee.getPopupContainer,Te=Ee.popupClassName,Le=Ee.indicator,Me=(0,V.Z)(Ee,jn),Re=i.useMemo(function(){return(Ct||[]).filter(function(It){return It&&(0,B.Z)(It)==="object"&&"key"in It})},[Ct]),Ke=Pt==="rtl",Xe=Oa(Zt),Dt=(0,i.useState)(!1),Xt=(0,G.Z)(Dt,2),Wt=Xt[0],gr=Xt[1];(0,i.useEffect)(function(){gr(d())},[]);var hr=M(function(){var It;return(It=Re[0])===null||It===void 0?void 0:It.key},{value:Nt,defaultValue:er}),br=(0,G.Z)(hr,2),Cr=br[0],lr=br[1],tr=(0,i.useState)(function(){return Re.findIndex(function(It){return It.key===Cr})}),sr=(0,G.Z)(tr,2),Y=sr[0],re=sr[1];(0,i.useEffect)(function(){var It=Re.findIndex(function(nr){return nr.key===Cr});if(It===-1){var or;It=Math.max(0,Math.min(Y,Re.length-1)),lr((or=Re[It])===null||or===void 0?void 0:or.key)}re(It)},[Re.map(function(It){return It.key}).join("_"),Cr,Y]);var ee=M(null,{value:We}),ye=(0,G.Z)(ee,2),Fe=ye[0],et=ye[1];(0,i.useEffect)(function(){We||(et("rc-tabs-".concat(ya)),ya+=1)},[]);function ct(It,or){yn==null||yn(It,or);var nr=It!==Cr;lr(It),nr&&(Pn==null||Pn(It))}var Ft={id:Fe,activeKey:Cr,animated:Xe,tabPosition:Mr,rtl:Ke,mobile:Wt},Ot=(0,le.Z)((0,le.Z)({},Ft),{},{editable:mr,locale:Dr,more:Ar,tabBarGutter:jr,onTabClick:ct,onTabScroll:Nn,extra:Gr,style:Pr,panes:null,getPopupContainer:ve,popupClassName:Te,indicator:Le});return i.createElement(f.Provider,{value:{tabs:Re,prefixCls:ut}},i.createElement("div",(0,me.Z)({ref:we,id:We,className:F()(ut,"".concat(ut,"-").concat(Mr),(0,ge.Z)((0,ge.Z)((0,ge.Z)({},"".concat(ut,"-mobile"),Wt),"".concat(ut,"-editable"),mr),"".concat(ut,"-rtl"),Ke),At)},Me),i.createElement(Bi,(0,me.Z)({},Ot,{renderTabBar:kr})),i.createElement(ki,(0,me.Z)({destroyInactiveTabPane:fr},Ft,{animated:Xe}))))}),Ms=Ha,Fa=Ms},64681:function(Ht,at){"use strict";var q;var me=Symbol.for("react.element"),ge=Symbol.for("react.portal"),le=Symbol.for("react.fragment"),G=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),V=Symbol.for("react.provider"),K=Symbol.for("react.context"),F=Symbol.for("react.server_context"),i=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),v=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),w;w=Symbol.for("react.module.reference");function p(y){if(typeof y=="object"&&y!==null){var M=y.$$typeof;switch(M){case me:switch(y=y.type,y){case le:case B:case G:case U:case L:return y;default:switch(y=y&&y.$$typeof,y){case F:case K:case i:case E:case v:case V:return y;default:return M}}case ge:return M}}}q=K,q=V,q=me,at.ForwardRef=i,q=le,q=E,q=v,q=ge,q=B,q=G,q=U,q=L,q=function(){return!1},q=function(){return!1},q=function(y){return p(y)===K},q=function(y){return p(y)===V},q=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===me},q=function(y){return p(y)===i},q=function(y){return p(y)===le},q=function(y){return p(y)===E},at.isMemo=function(y){return p(y)===v},q=function(y){return p(y)===ge},q=function(y){return p(y)===B},q=function(y){return p(y)===G},q=function(y){return p(y)===U},q=function(y){return p(y)===L},q=function(y){return typeof y=="string"||typeof y=="function"||y===le||y===B||y===G||y===U||y===L||y===b||typeof y=="object"&&y!==null&&(y.$$typeof===E||y.$$typeof===v||y.$$typeof===V||y.$$typeof===K||y.$$typeof===i||y.$$typeof===w||y.getModuleId!==void 0)},q=p},39607:function(Ht,at,q){"use strict";Ht.exports=q(64681)},36697:function(Ht,at,q){"use strict";q.d(at,{G:function(){return B},Z:function(){return k}});var me=q(94184),ge=q.n(me),le=q(67294),G=q.t(le,2);function B(m){var A=m.children,I=m.prefixCls,C=m.id,P=m.overlayInnerStyle,l=m.bodyClassName,c=m.className,s=m.style;return le.createElement("div",{className:ge()("".concat(I,"-content"),c),style:s},le.createElement("div",{className:ge()("".concat(I,"-inner"),l),id:C,role:"tooltip",style:P},typeof A=="function"?A():A))}var V=q(87462),K=q(1413),F=q(45987),i=q(98280),U={shiftX:64,adjustY:1},L={adjustX:1,shiftY:!0},v=[0,0],E={left:{points:["cr","cl"],overflow:L,offset:[-4,0],targetOffset:v},right:{points:["cl","cr"],overflow:L,offset:[4,0],targetOffset:v},top:{points:["bc","tc"],overflow:U,offset:[0,-4],targetOffset:v},bottom:{points:["tc","bc"],overflow:U,offset:[0,4],targetOffset:v},topLeft:{points:["bl","tl"],overflow:U,offset:[0,-4],targetOffset:v},leftTop:{points:["tr","tl"],overflow:L,offset:[-4,0],targetOffset:v},topRight:{points:["br","tr"],overflow:U,offset:[0,-4],targetOffset:v},rightTop:{points:["tl","tr"],overflow:L,offset:[4,0],targetOffset:v},bottomRight:{points:["tr","br"],overflow:U,offset:[0,4],targetOffset:v},rightBottom:{points:["bl","br"],overflow:L,offset:[4,0],targetOffset:v},bottomLeft:{points:["tl","bl"],overflow:U,offset:[0,4],targetOffset:v},leftBottom:{points:["br","bl"],overflow:L,offset:[-4,0],targetOffset:v}},b=null,w=q(97685);function p(){var m=(0,K.Z)({},G);return m.useId}var y=0;function M(){}var d=p(),f=d?function(A){var I=d();return A||I}:function(A){var I=le.useState("ssr-id"),C=(0,w.Z)(I,2),P=C[0],l=C[1];return le.useEffect(function(){var c=y;y+=1,l("rc_unique_".concat(c))},[]),A||P},u=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],h=function(A,I){var C=A.overlayClassName,P=A.trigger,l=P===void 0?["hover"]:P,c=A.mouseEnterDelay,s=c===void 0?0:c,g=A.mouseLeaveDelay,R=g===void 0?.1:g,D=A.overlayStyle,x=A.prefixCls,T=x===void 0?"rc-tooltip":x,O=A.children,$=A.onVisibleChange,H=A.afterVisibleChange,Z=A.transitionName,te=A.animation,J=A.motion,ie=A.placement,oe=ie===void 0?"right":ie,ue=A.align,Pe=ue===void 0?{}:ue,Ne=A.destroyTooltipOnHide,Ve=Ne===void 0?!1:Ne,ot=A.defaultVisible,Et=A.getTooltipContainer,it=A.overlayInnerStyle,Ie=A.arrowContent,He=A.overlay,ht=A.id,ft=A.showArrow,dt=ft===void 0?!0:ft,se=A.classNames,De=A.styles,ze=(0,F.Z)(A,u),Ge=f(ht),qe=(0,le.useRef)(null);(0,le.useImperativeHandle)(I,function(){return qe.current});var vt=(0,K.Z)({},ze);"visible"in A&&(vt.popupVisible=A.visible);var Ut=function(){return le.createElement(B,{key:"content",prefixCls:T,id:Ge,bodyClassName:se==null?void 0:se.body,overlayInnerStyle:(0,K.Z)((0,K.Z)({},it),De==null?void 0:De.body)},He)},bt=function(){var lt=le.Children.only(O),$t=(lt==null?void 0:lt.props)||{},tt=(0,K.Z)((0,K.Z)({},$t),{},{"aria-describedby":He?Ge:null});return le.cloneElement(O,tt)};return le.createElement(i.Z,(0,V.Z)({popupClassName:ge()(C,se==null?void 0:se.root),prefixCls:T,popup:Ut,action:l,builtinPlacements:E,popupPlacement:oe,ref:qe,popupAlign:Pe,getPopupContainer:Et,onPopupVisibleChange:$,afterPopupVisibleChange:H,popupTransitionName:Z,popupAnimation:te,popupMotion:J,defaultPopupVisible:ot,autoDestroy:Ve,mouseLeaveDelay:R,popupStyle:(0,K.Z)((0,K.Z)({},D),De==null?void 0:De.root),mouseEnterDelay:s,arrow:dt},vt),bt())},S=(0,le.forwardRef)(h),k=S},50344:function(Ht,at,q){"use strict";q.d(at,{Z:function(){return le}});var me=q(67294),ge=q(59864);function le(G){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},V=[];return me.Children.forEach(G,function(K){K==null&&!B.keepEmpty||(Array.isArray(K)?V=V.concat(le(K)):(0,ge.isFragment)(K)&&K.props?V=V.concat(le(K.props.children,B)):V.push(K))}),V}},66680:function(Ht,at,q){"use strict";q.d(at,{Z:function(){return ge}});var me=q(67294);function ge(le){var G=me.useRef();G.current=le;var B=me.useCallback(function(){for(var V,K=arguments.length,F=new Array(K),i=0;i<K;i++)F[i]=arguments[i];return(V=G.current)===null||V===void 0?void 0:V.call.apply(V,[G].concat(F))},[]);return B}},21770:function(Ht,at,q){"use strict";q.d(at,{Z:function(){return V}});var me=q(97685),ge=q(66680),le=q(8410),G=q(63896);function B(K){return K!==void 0}function V(K,F){var i=F||{},U=i.defaultValue,L=i.value,v=i.onChange,E=i.postState,b=(0,G.Z)(function(){return B(L)?L:B(U)?typeof U=="function"?U():U:typeof K=="function"?K():K}),w=(0,me.Z)(b,2),p=w[0],y=w[1],M=L!==void 0?L:p,d=E?E(M):M,f=(0,ge.Z)(v),u=(0,G.Z)([M]),h=(0,me.Z)(u,2),S=h[0],k=h[1];(0,le.o)(function(){var A=S[0];p!==A&&f(p,A)},[S]),(0,le.o)(function(){B(L)||y(L)},[L]);var m=(0,ge.Z)(function(A,I){y(A,I),k([M],I)});return[d,m]}},91881:function(Ht,at,q){"use strict";var me=q(71002),ge=q(80334);function le(G,B){var V=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,K=new Set;function F(i,U){var L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,v=K.has(i);if((0,ge.ZP)(!v,"Warning: There may be circular references"),v)return!1;if(i===U)return!0;if(V&&L>1)return!1;K.add(i);var E=L+1;if(Array.isArray(i)){if(!Array.isArray(U)||i.length!==U.length)return!1;for(var b=0;b<i.length;b++)if(!F(i[b],U[b],E))return!1;return!0}if(i&&U&&(0,me.Z)(i)==="object"&&(0,me.Z)(U)==="object"){var w=Object.keys(i);return w.length!==Object.keys(U).length?!1:w.every(function(p){return F(i[p],U[p],E)})}return!1}return F(G,B)}at.Z=le},98423:function(Ht,at,q){"use strict";q.d(at,{Z:function(){return ge}});var me=q(1413);function ge(le,G){var B=(0,me.Z)({},le);return Array.isArray(G)&&G.forEach(function(V){delete B[V]}),B}},80334:function(Ht,at,q){"use strict";var me={};function ge(F,i){}function le(F,i){}function G(){me={}}function B(F,i,U){!i&&!me[U]&&(F(!1,U),me[U]=!0)}function V(F,i){B(ge,F,i)}function K(F,i){B(le,F,i)}at.ZP=V},74300:function(Ht,at,q){"use strict";Object.defineProperty(at,"__esModule",{value:!0}),at.CopyToClipboard=void 0;var me=le(q(67294)),ge=le(q(20640));function le(d){return d&&d.__esModule?d:{default:d}}function G(d){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(u){return typeof u}:G=function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},G(d)}function B(d,f){var u=Object.keys(d);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(d);f&&(h=h.filter(function(S){return Object.getOwnPropertyDescriptor(d,S).enumerable})),u.push.apply(u,h)}return u}function V(d){for(var f=1;f<arguments.length;f++){var u=arguments[f]!=null?arguments[f]:{};f%2?B(u,!0).forEach(function(h){y(d,h,u[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(u)):B(u).forEach(function(h){Object.defineProperty(d,h,Object.getOwnPropertyDescriptor(u,h))})}return d}function K(d,f){if(d==null)return{};var u=F(d,f),h,S;if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(d);for(S=0;S<k.length;S++)h=k[S],!(f.indexOf(h)>=0)&&Object.prototype.propertyIsEnumerable.call(d,h)&&(u[h]=d[h])}return u}function F(d,f){if(d==null)return{};var u={},h=Object.keys(d),S,k;for(k=0;k<h.length;k++)S=h[k],!(f.indexOf(S)>=0)&&(u[S]=d[S]);return u}function i(d,f){if(!(d instanceof f))throw new TypeError("Cannot call a class as a function")}function U(d,f){for(var u=0;u<f.length;u++){var h=f[u];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}function L(d,f,u){return f&&U(d.prototype,f),u&&U(d,u),d}function v(d,f){return f&&(G(f)==="object"||typeof f=="function")?f:b(d)}function E(d){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},E(d)}function b(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d}function w(d,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(f&&f.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),f&&p(d,f)}function p(d,f){return p=Object.setPrototypeOf||function(h,S){return h.__proto__=S,h},p(d,f)}function y(d,f,u){return f in d?Object.defineProperty(d,f,{value:u,enumerable:!0,configurable:!0,writable:!0}):d[f]=u,d}var M=function(d){w(f,d);function f(){var u,h;i(this,f);for(var S=arguments.length,k=new Array(S),m=0;m<S;m++)k[m]=arguments[m];return h=v(this,(u=E(f)).call.apply(u,[this].concat(k))),y(b(h),"onClick",function(A){var I=h.props,C=I.text,P=I.onCopy,l=I.children,c=I.options,s=me.default.Children.only(l),g=(0,ge.default)(C,c);P&&P(C,g),s&&s.props&&typeof s.props.onClick=="function"&&s.props.onClick(A)}),h}return L(f,[{key:"render",value:function(){var h=this.props,S=h.text,k=h.onCopy,m=h.options,A=h.children,I=K(h,["text","onCopy","options","children"]),C=me.default.Children.only(A);return me.default.cloneElement(C,V({},I,{onClick:this.onClick}))}}]),f}(me.default.PureComponent);at.CopyToClipboard=M,y(M,"defaultProps",{onCopy:void 0,options:void 0})},74855:function(Ht,at,q){"use strict";var me=q(74300),ge=me.CopyToClipboard;ge.CopyToClipboard=ge,Ht.exports=ge},91033:function(Ht,at,q){"use strict";var me=function(){if(typeof Map!="undefined")return Map;function l(c,s){var g=-1;return c.some(function(R,D){return R[0]===s?(g=D,!0):!1}),g}return function(){function c(){this.__entries__=[]}return Object.defineProperty(c.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),c.prototype.get=function(s){var g=l(this.__entries__,s),R=this.__entries__[g];return R&&R[1]},c.prototype.set=function(s,g){var R=l(this.__entries__,s);~R?this.__entries__[R][1]=g:this.__entries__.push([s,g])},c.prototype.delete=function(s){var g=this.__entries__,R=l(g,s);~R&&g.splice(R,1)},c.prototype.has=function(s){return!!~l(this.__entries__,s)},c.prototype.clear=function(){this.__entries__.splice(0)},c.prototype.forEach=function(s,g){g===void 0&&(g=null);for(var R=0,D=this.__entries__;R<D.length;R++){var x=D[R];s.call(g,x[1],x[0])}},c}()}(),ge=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,le=function(){return typeof q.g!="undefined"&&q.g.Math===Math?q.g:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),G=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(le):function(l){return setTimeout(function(){return l(Date.now())},1e3/60)}}(),B=2;function V(l,c){var s=!1,g=!1,R=0;function D(){s&&(s=!1,l()),g&&T()}function x(){G(D)}function T(){var O=Date.now();if(s){if(O-R<B)return;g=!0}else s=!0,g=!1,setTimeout(x,c);R=O}return T}var K=20,F=["top","right","bottom","left","width","height","size","weight"],i=typeof MutationObserver!="undefined",U=function(){function l(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=V(this.refresh.bind(this),K)}return l.prototype.addObserver=function(c){~this.observers_.indexOf(c)||this.observers_.push(c),this.connected_||this.connect_()},l.prototype.removeObserver=function(c){var s=this.observers_,g=s.indexOf(c);~g&&s.splice(g,1),!s.length&&this.connected_&&this.disconnect_()},l.prototype.refresh=function(){var c=this.updateObservers_();c&&this.refresh()},l.prototype.updateObservers_=function(){var c=this.observers_.filter(function(s){return s.gatherActive(),s.hasActive()});return c.forEach(function(s){return s.broadcastActive()}),c.length>0},l.prototype.connect_=function(){!ge||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),i?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},l.prototype.disconnect_=function(){!ge||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},l.prototype.onTransitionEnd_=function(c){var s=c.propertyName,g=s===void 0?"":s,R=F.some(function(D){return!!~g.indexOf(D)});R&&this.refresh()},l.getInstance=function(){return this.instance_||(this.instance_=new l),this.instance_},l.instance_=null,l}(),L=function(l,c){for(var s=0,g=Object.keys(c);s<g.length;s++){var R=g[s];Object.defineProperty(l,R,{value:c[R],enumerable:!1,writable:!1,configurable:!0})}return l},v=function(l){var c=l&&l.ownerDocument&&l.ownerDocument.defaultView;return c||le},E=S(0,0,0,0);function b(l){return parseFloat(l)||0}function w(l){for(var c=[],s=1;s<arguments.length;s++)c[s-1]=arguments[s];return c.reduce(function(g,R){var D=l["border-"+R+"-width"];return g+b(D)},0)}function p(l){for(var c=["top","right","bottom","left"],s={},g=0,R=c;g<R.length;g++){var D=R[g],x=l["padding-"+D];s[D]=b(x)}return s}function y(l){var c=l.getBBox();return S(0,0,c.width,c.height)}function M(l){var c=l.clientWidth,s=l.clientHeight;if(!c&&!s)return E;var g=v(l).getComputedStyle(l),R=p(g),D=R.left+R.right,x=R.top+R.bottom,T=b(g.width),O=b(g.height);if(g.boxSizing==="border-box"&&(Math.round(T+D)!==c&&(T-=w(g,"left","right")+D),Math.round(O+x)!==s&&(O-=w(g,"top","bottom")+x)),!f(l)){var $=Math.round(T+D)-c,H=Math.round(O+x)-s;Math.abs($)!==1&&(T-=$),Math.abs(H)!==1&&(O-=H)}return S(R.left,R.top,T,O)}var d=function(){return typeof SVGGraphicsElement!="undefined"?function(l){return l instanceof v(l).SVGGraphicsElement}:function(l){return l instanceof v(l).SVGElement&&typeof l.getBBox=="function"}}();function f(l){return l===v(l).document.documentElement}function u(l){return ge?d(l)?y(l):M(l):E}function h(l){var c=l.x,s=l.y,g=l.width,R=l.height,D=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,x=Object.create(D.prototype);return L(x,{x:c,y:s,width:g,height:R,top:s,right:c+g,bottom:R+s,left:c}),x}function S(l,c,s,g){return{x:l,y:c,width:s,height:g}}var k=function(){function l(c){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=S(0,0,0,0),this.target=c}return l.prototype.isActive=function(){var c=u(this.target);return this.contentRect_=c,c.width!==this.broadcastWidth||c.height!==this.broadcastHeight},l.prototype.broadcastRect=function(){var c=this.contentRect_;return this.broadcastWidth=c.width,this.broadcastHeight=c.height,c},l}(),m=function(){function l(c,s){var g=h(s);L(this,{target:c,contentRect:g})}return l}(),A=function(){function l(c,s,g){if(this.activeObservations_=[],this.observations_=new me,typeof c!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=c,this.controller_=s,this.callbackCtx_=g}return l.prototype.observe=function(c){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(c instanceof v(c).Element))throw new TypeError('parameter 1 is not of type "Element".');var s=this.observations_;s.has(c)||(s.set(c,new k(c)),this.controller_.addObserver(this),this.controller_.refresh())}},l.prototype.unobserve=function(c){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(c instanceof v(c).Element))throw new TypeError('parameter 1 is not of type "Element".');var s=this.observations_;s.has(c)&&(s.delete(c),s.size||this.controller_.removeObserver(this))}},l.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},l.prototype.gatherActive=function(){var c=this;this.clearActive(),this.observations_.forEach(function(s){s.isActive()&&c.activeObservations_.push(s)})},l.prototype.broadcastActive=function(){if(this.hasActive()){var c=this.callbackCtx_,s=this.activeObservations_.map(function(g){return new m(g.target,g.broadcastRect())});this.callback_.call(c,s,c),this.clearActive()}},l.prototype.clearActive=function(){this.activeObservations_.splice(0)},l.prototype.hasActive=function(){return this.activeObservations_.length>0},l}(),I=typeof WeakMap!="undefined"?new WeakMap:new me,C=function(){function l(c){if(!(this instanceof l))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var s=U.getInstance(),g=new A(c,s,this);I.set(this,g)}return l}();["observe","unobserve","disconnect"].forEach(function(l){C.prototype[l]=function(){var c;return(c=I.get(this))[l].apply(c,arguments)}});var P=function(){return typeof le.ResizeObserver!="undefined"?le.ResizeObserver:C}();at.Z=P},11742:function(Ht){Ht.exports=function(){var at=document.getSelection();if(!at.rangeCount)return function(){};for(var q=document.activeElement,me=[],ge=0;ge<at.rangeCount;ge++)me.push(at.getRangeAt(ge));switch(q.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":q.blur();break;default:q=null;break}return at.removeAllRanges(),function(){at.type==="Caret"&&at.removeAllRanges(),at.rangeCount||me.forEach(function(le){at.addRange(le)}),q&&q.focus()}}},84279:function(Ht,at,q){"use strict";var me=Object.defineProperty,ge=Object.defineProperties,le=Object.getOwnPropertyDescriptors,G=Object.getOwnPropertySymbols,B=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable,K=(e,t,r)=>t in e?me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,F=(e,t)=>{for(var r in t||(t={}))B.call(t,r)&&K(e,r,t[r]);if(G)for(var r of G(t))V.call(t,r)&&K(e,r,t[r]);return e},i=(e,t)=>ge(e,le(t)),U=e=>typeof e=="symbol"?e:e+"",L=(e,t)=>{var r={};for(var n in e)B.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&G)for(var n of G(e))t.indexOf(n)<0&&V.call(e,n)&&(r[n]=e[n]);return r};function v(e){return Array.isArray(e)}var E={en:{"keyboard.tooltip.symbols":"\u7B26\u53F7","keyboard.tooltip.greek":"\u5E0C\u814A\u5B57\u6BCD","keyboard.tooltip.numeric":"\u6570\u5B57","keyboard.tooltip.alphabetic":"\u7F57\u9A6C\u5B57\u6BCD","tooltip.cut to clipboard":"\u526A\u5207\u5230\u526A\u8D34\u677F","tooltip.copy to clipboard":"\u590D\u5236\u5230\u526A\u8D34\u677F","tooltip.paste from clipboard":"\u7C98\u8D34","tooltip.redo":"\u91CD\u505A","tooltip.toggle virtual keyboard":"\u5207\u6362\u865A\u62DF\u952E\u76D8","tooltip.undo":"\u64A4\u6D88","menu.insert matrix":"\u63D2\u5165\u77E9\u9635","menu.borders":"\u77E9\u9635\u5206\u9694\u7B26","menu.array.add row above":"\u5728\u540E\u9762\u6DFB\u52A0\u884C","menu.array.add row below":"\u5728\u524D\u9762\u6DFB\u52A0\u884C","menu.array.add column after":"\u5728\u540E\u9762\u6DFB\u52A0\u5217r","menu.array.add column before":"\u5728\u524D\u9762\u6DFB\u52A0\u5217","menu.array.delete row":"\u5220\u9664\u884C","menu.array.delete rows":"\u5220\u9664\u9009\u5B9A\u884C","menu.array.delete column":"\u5220\u9664\u5217","menu.array.delete columns":"\u5220\u9664\u9009\u5B9A\u7684\u5217","menu.mode":"\u6A21\u5F0F","menu.mode-math":"\u6570\u5B66","menu.mode-text":"\u6587\u672C","menu.mode-latex":"LaTeX","tooltip.blackboard":"\u9ED1\u677F","tooltip.bold":"\u7C97\u4F53","tooltip.italic":"\u659C\u4F53","tooltip.fraktur":"Fraktur","tooltip.script":"\u811A\u672C","tooltip.caligraphic":"\u8349\u4E66","tooltip.typewriter":"\u6253\u5B57\u673A","tooltip.roman-upright":"\u7F57\u9A6C\u76F4\u7ACB","tooltip.row-by-col":"%@ \xD7 %@","menu.font-style":"\u5B57\u4F53\u6837\u5F0F","menu.accent":"\u91CD\u97F3","menu.decoration":"\u88C5\u9970","menu.color":"\u989C\u8272","menu.background-color":"\u80CC\u666F","menu.evaluate":"\u8BA1\u7B97","menu.simplify":"\u7B80\u5316","menu.solve":"\u6C42\u89E3","menu.solve-for":"\u6C42\u89E3 %@","menu.cut":"\u526A\u5207","menu.copy":"\u590D\u5236","menu.copy-as-latex":"\u590D\u5236\u4E3A LaTeX","menu.copy-as-ascii-math":"\u590D\u5236\u4E3A ASCII Math","menu.copy-as-mathml":"\u590D\u5236\u4E3A MathML","menu.paste":"\u7C98\u8D34","menu.select-all":"\u5168\u9009","color.red":"\u7EA2\u8272","color.orange":"\u6A59\u8272","color.yellow":"\u9EC4\u8272","color.lime":"\u7EFF\u9EC4\u8272","color.green":"\u7EFF\u8272","color.teal":"\u9752\u8272","color.cyan":"\u84DD\u7EFF\u8272","color.blue":"\u84DD\u8272","color.indigo":"\u975B\u84DD\u8272","color.purple":"\u7D2B\u8272","color.magenta":"\u6D0B\u7EA2\u8272","color.black":"\u9ED1\u8272","color.dark-grey":"\u6DF1\u7070\u8272","color.grey":"\u7070\u8272","color.light-grey":"\u6D45\u7070\u8272","color.white":"\u767D\u8272"}};function b(){return"window"in globalThis&&"document"in globalThis}function w(){return"matchMedia"in window?window.matchMedia("(pointer: coarse)").matches:"ontouchstart"in window||navigator.maxTouchPoints>0}function p(){return typeof navigator.vibrate=="function"}function y(){var e,t;if(!b())return"other";const r=(t=(e=navigator.userAgentData)==null?void 0:e.platform)!=null?t:navigator.platform;return/^mac/i.test(r)?navigator.maxTouchPoints===5?"ios":"macos":/^win/i.test(r)?"windows":/android/i.test(navigator.userAgent)?"android":/iphone|ipod|ipad/i.test(navigator.userAgent)?"ios":/\bcros\b/i.test(navigator.userAgent)?"chromeos":"other"}function M(){if(!b())return!0;if(/firefox/i.test(navigator.userAgent)){const e=navigator.userAgent.match(/firefox\/(\d+)/i);return e?parseInt(e[1])>=78:!1}if(/trident/i.test(navigator.userAgent))return!1;if(/edge/i.test(navigator.userAgent)){const e=navigator.userAgent.match(/edg\/(\d+)/i);return e?parseInt(e[1])>=79:!1}return!0}function d(){return HTMLElement.prototype.hasOwnProperty("popover")}var f={strings:E,_locale:"",_dirty:!1,_subscribers:[],_numberFormatter:void 0,get locale(){return f._locale||(f._locale=b()?navigator.language.slice(0,5):"en-US"),f._locale},set locale(e){f._locale=e,f._numberFormatter=void 0,f.dirty=!0},get numberFormatter(){return f._numberFormatter||(f._numberFormatter=new Intl.NumberFormat(f.locale)),f._numberFormatter},merge(e,t){if(typeof e=="string"&&t)f.strings[e]=F(F({},f.strings[e]),t),f.dirty=!0;else for(const r of Object.keys(e))f.merge(r,e[r])},get dirty(){return f._dirty},set dirty(e){f._dirty||f._dirty===e||(f._dirty=!0,setTimeout(()=>{f._dirty=!1,this._subscribers.forEach(t=>t==null?void 0:t())},0))},subscribe(e){return f._subscribers.push(e),f._subscribers.length-1},unsubscribe(e){e<0||e>=f._subscribers.length||(f._subscribers[e]=void 0)},update(e){let t=e.querySelectorAll("[data-l10n-tooltip]");for(const r of t){const n=r.getAttribute("data-l10n-tooltip");if(n){const a=u(n);a&&r.setAttribute("data-tooltip",a)}}t=e.querySelectorAll("[data-l10n-arial-label]");for(const r of t){const n=r.getAttribute("data-l10n-arial-label");if(n){const a=u(n);a&&r.setAttribute("aria-label",a)}}}};function u(e,...t){if(e===void 0)return;let r="";const n=f.locale;f.strings[n]&&(r=f.strings[n][e]);const a=n.slice(0,2);if(!r&&f.strings[a]&&(r=f.strings[a][e]),r||(r=f.strings.en[e]),!r)return;const o=/(%@|%([0-9]+)\$@)/g;let _=o.exec(r),N=0;for(;_;){if(t[N++]){const W=_[2]?parseInt(_[2],10)-1:N-1;let j=t[W];typeof j=="number"&&(j=f.numberFormatter.format(j)),r=r.replace(_[1],j)}_=o.exec(r)}return r=r.replace(/%%/g,"%"),r}var h={m0:"#3F3D99",m1:"#993D71",m2:"#998B3D",m3:"#3D9956",m4:"#3D5A99",m5:"#993D90",m6:"#996D3D",m7:"#43993D",m8:"#3D7999",m9:"#843D99"},S={blue:"#0072BD",orange:"#D95319",yellow:"#EDB120",purple:"#7E2F8E",green:"#77AC30",cyan:"#4DBEEE",red:"#A2142F"},k={red:"#fbbbb6",orange:"#ffe0c2",yellow:"#fff1c2",lime:"#d0e8b9",green:"#bceac4",teal:"#b9f1f1",cyan:"#b8e5c9",blue:"#b6d9fb",indigo:"#d1c2f0",purple:"#e3baf8",magenta:"#f9c8e0",black:"#353535","dark-grey":"#8C8C8C",grey:"#D0D0D0","light-grey":"#F0F0F0",white:"#ffffff"},m={red:"#d7170b",orange:"#fe8a2b",yellow:"#ffc02b",lime:"#63b215",green:"#21ba3a",teal:"#17cfcf",cyan:"#13a7ec",blue:"#0d80f2",indigo:"#63c",purple:"#a219e6",magenta:"#eb4799",black:"#000","dark-grey":"#666",grey:"#A6A6A6","light-grey":"#d4d5d2",white:"#ffffff"},A={Red:"red",Orange:"orange",Yellow:"yellow",LimeGreen:"lime",Green:"green",TealBlue:"teal",Blue:"blue",Violet:"indigo",Purple:"purple",Magenta:"magenta",Black:"black",Gray:"grey",White:"white"},I={Apricot:"#FBB982",Aquamarine:"#00B5BE",Bittersweet:"#C04F17",Black:"#221E1F",Blue:"#2D2F92",BlueGreen:"#00B3B8",BlueViolet:"#473992",BrickRed:"#B6321C",Brown:"#792500",BurntOrange:"#F7921D",CadetBlue:"#74729A",CarnationPink:"#F282B4",Cerulean:"#00A2E3",CornflowerBlue:"#41B0E4",Cyan:"#00AEEF",Dandelion:"#FDBC42",DarkOrchid:"#A4538A",Emerald:"#00A99D",ForestGreen:"#009B55",Fuchsia:"#8C368C",Goldenrod:"#FFDF42",Gray:"#949698",Green:"#00A64F",GreenYellow:"#DFE674",JungleGreen:"#00A99A",Lavender:"#F49EC4",Limegreen:"#8DC73E",Magenta:"#EC008C",Mahogany:"#A9341F",Maroon:"#AF3235",Melon:"#F89E7B",MidnightBlue:"#006795",Mulberry:"#A93C93",NavyBlue:"#006EB8",OliveGreen:"#3C8031",Orange:"#F58137",OrangeRed:"#ED135A",Orchid:"#AF72B0",Peach:"#F7965A",Periwinkle:"#7977B8",PineGreen:"#008B72",Plum:"#92268F",ProcessBlue:"#00B0F0",Purple:"#99479B",RawSienna:"#974006",Red:"#ED1B23",RedOrange:"#F26035",RedViolet:"#A1246B",Rhodamine:"#EF559F",RoyalBlue:"#0071BC",RoyalPurple:"#613F99",RubineRed:"#ED017D",Salmon:"#F69289",SeaGreen:"#3FBC9D",Sepia:"#671800",SkyBlue:"#46C5DD",SpringGreen:"#C6DC67",Tan:"#DA9D76",TealBlue:"#00AEB3",Thistle:"#D883B7",Turquoise:"#00B4CE",Violet:"#58429B",VioletRed:"#EF58A0",White:"#FFFFFF",WildStrawberry:"#EE2967",Yellow:"#FFF200",YellowGreen:"#98CC70",YellowOrange:"#FAA21A"};function C(e){var t,r,n,a,o,_;const N=e.split("!");let z,W,j,X=255,ae=255,he=255,_e=-1;const Ue=N.length>0&&N[0].startsWith("-");Ue&&(N[0]=N[0].slice(1));for(let yt=0;yt<N.length;yt++){z=X,W=ae,j=he;const Be=(t=N[yt].trim().match(/^([A-Za-z\d-]+)/))==null?void 0:t[1],nt=Be==null?void 0:Be.toLowerCase(),wt=Be&&(_=(o=(a=(n=(r=m[nt])!=null?r:m[A[Be]])!=null?n:S[Be])!=null?a:I[Be])!=null?o:h[Be])!=null?_:N[yt].trim();let st=wt.match(/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i);if(st!=null&&st[1]&&st[2]&&st[3])X=Math.max(0,Math.min(255,Number.parseInt(st[1],16))),ae=Math.max(0,Math.min(255,Number.parseInt(st[2],16))),he=Math.max(0,Math.min(255,Number.parseInt(st[3],16)));else if(st=wt.match(/^#([\da-f]{3})$/i),st!=null&&st[1]){const zt=Number.parseInt(st[1][0],16),qt=Number.parseInt(st[1][1],16),Gt=Number.parseInt(st[1][2],16);X=Math.max(0,Math.min(255,zt*16+zt)),ae=Math.max(0,Math.min(255,qt*16+qt)),he=Math.max(0,Math.min(255,Gt*16+Gt))}else if(st=wt.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i),st!=null&&st[1]&&st[2]&&st[3])X=Math.max(0,Math.min(255,Number.parseInt(st[1]))),ae=Math.max(0,Math.min(255,Number.parseInt(st[2]))),he=Math.max(0,Math.min(255,Number.parseInt(st[3])));else return;_e>=0&&(X=(1-_e)*X+_e*z,ae=(1-_e)*ae+_e*W,he=(1-_e)*he+_e*j,_e=-1),yt+1<N.length&&(_e=Math.max(0,Math.min(100,Number.parseInt(N[++yt])))/100)}return _e>=0&&(X=_e*X+(1-_e)*z,ae=_e*ae+(1-_e)*W,he=_e*he+(1-_e)*j),Ue&&(X=255-X,ae=255-ae,he=255-he),"#"+("00"+Math.round(X).toString(16)).slice(-2)+("00"+Math.round(ae).toString(16)).slice(-2)+("00"+Math.round(he).toString(16)).slice(-2)}function P(e){var t,r;return e=e.trim(),(r=(t=k[e.toLowerCase()])!=null?t:k[A[e]])!=null?r:C(e)}function l(e){if(!e||e[0]!=="#")return;e=e.slice(1);let t;return e.length<=4?(t={r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16)},e.length===4&&(t.a=parseInt(e[3]+e[3],16)/255)):(t={r:parseInt(e[0]+e[1],16),g:parseInt(e[2]+e[3],16),b:parseInt(e[4]+e[5],16)},e.length===8&&(t.a=parseInt(e[6]+e[7],16)/255)),t&&t.a===void 0&&(t.a=1),t}function c(e,t,r){return r<0&&(r+=6),r>=6&&(r-=6),r<1?(t-e)*r+e:r<3?t:r<4?(t-e)*(4-r)+e:e}function s(e){let[t,r,n]=[e.h,e.s,e.l];t=(t+360)%360/60,n=Math.max(0,Math.min(n,1)),r=Math.max(0,Math.min(r,1));const a=n<=.5?n*(r+1):n+r-n*r,o=n*2-a;return{r:Math.round(255*c(o,a,t+2)),g:Math.round(255*c(o,a,t)),b:Math.round(255*c(o,a,t-2))}}function g(e){return e<0?0:e>255?255:Math.round(e)}function R(e){const{r:t,g:r,b:n}=e;let a=((1<<24)+(g(t)<<16)+(g(r)<<8)+g(n)).toString(16).slice(1);return a[0]===a[1]&&a[2]===a[3]&&a[4]===a[5]&&a[6]===a[7]&&(a=a[0]+a[2]+a[4]),"#"+a}function D(e){let{r:t,g:r,b:n}=e;t=t/255,r=r/255,n=n/255;const a=Math.min(t,r,n),o=Math.max(t,r,n),_=o-a;let N,z;o===a?N=0:t===o?N=(r-n)/_:r===o?N=2+(n-t)/_:n===o&&(N=4+(t-r)/_),N=Math.min(N*60,360),N<0&&(N+=360);const W=(a+o)/2;return o===a?z=0:W<=.5?z=_/(o+a):z=_/(2-o-a),{h:N,s:z,l:W}}function x(e){let t=l(e);if(!t)return e;let{h:r,s:n,l:a}=D(t);return n+=.1,a-=.1,R(s({h:r,s:n,l:a}))}var T={60:"\\lt",62:"\\gt",111:"o",38:"\\&",123:"\\lbrace",125:"\\rbrace",91:"\\lbrack",93:"\\rbrack",58:"\\colon",160:"~",172:"\\neg",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8224:"\\dagger",8225:"\\ddagger",8230:"\\ldots",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",39:"\\prime",8592:"\\gets",8594:"\\to",9651:"\\triangle",9661:"\\triangledown",8715:"\\owns",8727:"\\ast",8739:"\\vert",8741:"\\Vert",8743:"\\land",8744:"\\lor",8901:"\\cdot",8904:"\\bowtie",8800:"\\ne",8804:"\\le",8805:"\\ge",8869:"\\bot",10231:"\\biconditional",10232:"\\impliedby",10233:"\\implies",10234:"\\iff",8450:"\\mathbb{C}",8469:"\\mathbb{N}",8473:"\\mathbb{P}",8474:"\\mathbb{Q}",8477:"\\mathbb{R}",8484:"\\mathbb{Z}",8461:"\\mathbb{H}",8476:"\\Re",8465:"\\Im",42:"\\ast",11036:"\\square",9633:"\\square",8720:"\\coprod",8716:"\\not\\ni",9671:"\\diamond",8846:"\\uplus",8851:"\\sqcap",8852:"\\sqcup",8768:"\\wr",8750:"\\oint",8226:"\\textbullet",8722:"-",978:"\\Upsilon"},O={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},$=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"main",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function H(e,t,r){if(!/[A-Za-z\d]/.test(e)||(r==="up"&&(r=void 0),!t&&!r))return e;const n=e.codePointAt(0);if(n===void 0)return e;for(const a of $)if((!t||a.variant===t)&&(!r||a.style===r)&&n>=a.offset&&n<a.offset+a.len){const o=a.start+n-a.offset;return String.fromCodePoint(O[o]||o)}return e}function Z(e){var t;if((e<119808||e>120831)&&(e<8448||e>8527))return{char:String.fromCodePoint(e)};for(const r in O)if(O[r]===e){e=(t=r.codePointAt(0))!=null?t:0;break}for(const r of $)if(e>=r.start&&e<r.start+r.len)return{char:String.fromCodePoint(e-r.start+r.offset),variant:r.variant,style:r.style};return{char:String.fromCodePoint(e)}}function te(e){var t;let r="";for(const n of e){if("{}<>[]$&#^_%:'\u02DC".includes(n)){r+=n;continue}const a=(t=n.codePointAt(0))!=null?t:0;let o=T[a];if(o)o.startsWith("\\")?r+=o+" ":r+=o;else{const{char:_,variant:N,style:z}=Z(a);switch(o=_,N){case"double-struck":o=`\\mathbb{${o}}`;break;case"fraktur":o=`\\mathfrak{${o}}`;break;case"script":o=`\\mathscr{${o}}`;break;case"sans-serif":o=`\\mathsf{${o}}`;break;case"monospace":o=`\\mathtt{${o}}`;break;case"calligraphic":o=`\\mathcal{${o}}`;break}switch(z){case"bold":o=`\\mathbf{${o}}`;break;case"italic":o=`\\mathit{${o}}`;break;case"bolditalic":o=`\\mathbfit{${o}}`;break}r+=o}}return r}function J(e){return e?Array.isArray(e)?e:typeof e=="object"&&"group"in e?e.group:[]:[]}var ie={},oe=F({},T),ue={},Pe={},Ne={darr:"\\downarrow",dArr:"\\Downarrow",Darr:"\\Downarrow",lang:"\\langle",rang:"\\rangle",uarr:"\\uparrow",uArr:"\\Uparrow",Uarr:"\\Uparrow",N:"\\mathbb{N}",R:"\\mathbb{R}",Z:"\\mathbb{Z}",alef:"\\aleph",alefsym:"\\aleph",Alpha:"\\mathrm{A}",Beta:"\\mathrm{B}",bull:"\\bullet",Chi:"\\mathrm{X}",clubs:"\\clubsuit",cnums:"\\mathbb{C}",Complex:"\\mathbb{C}",Dagger:"\\ddagger",diamonds:"\\diamondsuit",empty:"\\emptyset",Epsilon:"\\mathrm{E}",Eta:"\\mathrm{H}",exist:"\\exists",harr:"\\leftrightarrow",hArr:"\\Leftrightarrow",Harr:"\\Leftrightarrow",hearts:"\\heartsuit",image:"\\Im",infin:"\\infty",Iota:"\\mathrm{I}",isin:"\\in",Kappa:"\\mathrm{K}",larr:"\\leftarrow",lArr:"\\Leftarrow",Larr:"\\Leftarrow",lrarr:"\\leftrightarrow",lrArr:"\\Leftrightarrow",Lrarr:"\\Leftrightarrow",Mu:"\\mathrm{M}",natnums:"\\mathbb{N}",Nu:"\\mathrm{N}",Omicron:"\\mathrm{O}",plusmn:"\\pm",rarr:"\\rightarrow",rArr:"\\Rightarrow",Rarr:"\\Rightarrow",real:"\\Re",reals:"\\mathbb{R}",Reals:"\\mathbb{R}",Rho:"\\mathrm{P}",sdot:"\\cdot",sect:"\\S",spades:"\\spadesuit",sub:"\\subset",sube:"\\subseteq",supe:"\\supseteq",Tau:"\\mathrm{T}",thetasym:"\\vartheta",weierp:"\\wp",Zeta:"\\mathrm{Z}"},Ve={varGamma:"\\mathit{\\Gamma}",varDelta:"\\mathit{\\Delta}",varTheta:"\\mathit{\\Theta}",varLambda:"\\mathit{\\Lambda}",varXi:"\\mathit{\\Xi}",varPi:"\\mathit{\\Pi}",varSigma:"\\mathit{\\Sigma}",varUpsilon:"\\mathit{\\Upsilon}",varPhi:"\\mathit{\\Phi}",varPsi:"\\mathit{\\Psi}",varOmega:"\\mathit{\\Omega}",pmod:{def:"\\quad(\\operatorname{mod}\\ #1)",args:1,expand:!1,captureSelection:!1},mod:{def:"\\quad\\operatorname{mod}\\,\\,#1",args:1,expand:!1},bmod:{def:"\\;\\mathbin{\\operatorname{mod }}",expand:!1}},ot={bra:{def:"\\mathinner{\\langle{#1}|}",args:1,captureSelection:!1},ket:{def:"\\mathinner{|{#1}\\rangle}",args:1,captureSelection:!1},braket:{def:"\\mathinner{\\langle{#1}\\rangle}",args:1,captureSelection:!1},set:{def:"\\mathinner{\\lbrace #1 \\rbrace}",args:1,captureSelection:!1},Bra:{def:"\\left\\langle #1\\right|",args:1,captureSelection:!1},Ket:{def:"\\left|#1\\right\\rangle",args:1,captureSelection:!1},Braket:{def:"\\left\\langle{#1}\\right\\rangle",args:1,captureSelection:!1},Set:{def:"\\left\\lbrace #1 \\right\\rbrace",args:1,captureSelection:!1}},Et={iff:{primitive:!0,captureSelection:!0,def:"\\;\u27FA\\;"},nicefrac:"^{#1}\\!\\!/\\!_{#2}",phase:{def:"\\enclose{phasorangle}{#1}",args:1,captureSelection:!1},rd:"\\mathrm{d}",rD:"\\mathrm{D}",doubleStruckCapitalN:"\\mathbb{N}",doubleStruckCapitalR:"\\mathbb{R}",doubleStruckCapitalQ:"\\mathbb{Q}",doubleStruckCapitalZ:"\\mathbb{Z}",doubleStruckCapitalP:"\\mathbb{P}",scriptCapitalE:"\\mathscr{E}",scriptCapitalH:"\\mathscr{H}",scriptCapitalL:"\\mathscr{L}",gothicCapitalC:"\\mathfrak{C}",gothicCapitalH:"\\mathfrak{H}",gothicCapitalI:"\\mathfrak{I}",gothicCapitalR:"\\mathfrak{R}",imaginaryI:"\\mathrm{i}",imaginaryJ:"\\mathrm{j}",exponentialE:"\\mathrm{e}",differentialD:"\\mathrm{d}",capitalDifferentialD:"\\mathrm{D}",mathstrut:{def:"\\vphantom{(}",primitive:!0},angl:"\\enclose{actuarial}{#1}",angln:"\\enclose{actuarial}{n}",anglr:"\\enclose{actuarial}{r}",anglk:"\\enclose{actuarial}{k}",mathtools:{primitive:!0,package:{ordinarycolon:":",vcentcolon:"\\mathrel{\\mathop\\ordinarycolon}",dblcolon:'{\\mathop{\\char"2237}}',coloneqq:'{\\mathop{\\char"2254}}',Coloneqq:'{\\mathop{\\char"2237\\char"3D}}',coloneq:'{\\mathop{\\char"3A\\char"2212}}',Coloneq:'{\\mathop{\\char"2237\\char"2212}}',eqqcolon:'{\\mathop{\\char"2255}}',Eqqcolon:'{\\mathop{\\char"3D\\char"2237}}',eqcolon:'{\\mathop{\\char"2239}}',Eqcolon:'{\\mathop{\\char"2212\\char"2237}}',colonapprox:'{\\mathop{\\char"003A\\char"2248}}',Colonapprox:'{\\mathop{\\char"2237\\char"2248}}',colonsim:'{\\mathop{\\char"3A\\char"223C}}',Colonsim:'{\\mathop{\\char"2237\\char"223C}}',colondash:"\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}",Colondash:"\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}",dashcolon:"\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Dashcolon:"\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}"}},ratio:"\\vcentcolon",coloncolon:"\\dblcolon",colonequals:"\\coloneq",coloncolonequals:"\\Coloneq",equalscolon:"\\eqcolon",equalscoloncolon:"\\Eqcolon",colonminus:"\\colondash",coloncolonminus:"\\Colondash",minuscolon:"\\dashcolon",minuscoloncolon:"\\Dashcolon",coloncolonapprox:"\\Colonapprox",coloncolonsim:"\\Colonsim",simcolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Simcolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}",simcoloncolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}",approxcolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Approxcolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}",approxcoloncolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}",notni:"\\mathrel{\\char`\u220C}",limsup:"\\operatorname*{lim\\,sup}",liminf:"\\operatorname*{lim\\,inf}",injlim:"\\operatorname*{inj\\,lim}",projlim:"\\operatorname*{proj\\,lim}",varlimsup:"\\operatorname*{\\overline{lim}}",varliminf:"\\operatorname*{\\underline{lim}}",varinjlim:"\\operatorname*{\\underrightarrow{lim}}",varprojlim:"\\operatorname*{\\underleftarrow{lim}}",argmin:"\\operatorname*{arg\\,min}",argmax:"\\operatorname*{arg\\,max}",plim:"\\mathop{\\operatorname{plim}}\\limits",tripledash:{def:"\\vphantom{-}\\raise{4mu}{\\mkern1.5mu\\rule{2mu}{1.5mu}\\mkern{2.25mu}\\rule{2mu}{1.5mu}\\mkern{2.25mu}\\rule{2mu}{1.5mu}\\mkern{2mu}}",expand:!0},"braket.sty":{package:ot},"amsmath.sty":{package:Ve,primitive:!0},"texvc.sty":{package:Ne,primitive:!1}},it={" ":32,"\\!":33,"\\#":35,"\\$":36,"\\%":37,"\\&":38,"-":45,"\\textunderscore":95,"\\euro":8364,"\\maltese":10016,"\\{":123,"\\}":125,"\\textbraceleft":123,"\\textbraceright":125,"\\lbrace":123,"\\rbrace":125,"\\lbrack":91,"\\rbrack":93,"\\nobreakspace":160,"\\ldots":8230,"\\textellipsis":8230,"\\backslash":92,"`":8216,"'":8217,"``":8220,"''":8221,"\\degree":176,"\\textasciicircum":94,"\\textasciitilde":126,"\\textasteriskcentered":42,"\\textbackslash":92,"\\textbullet":8226,"\\textdollar":36,"\\textsterling":163,"\\textdagger":8224,"\\textdaggerdbl":8225,"\u2013":8211,"\u2014":8212,"\u2018":8216,"\u2019":8217,"\u201C":8220,"\u201D":8221,'"':8221,"\\ss":223,"\\ae":230,"\\oe":339,"\\AE":198,"\\OE":338,"\\O":216,"\\i":305,"\\j":567,"\\aa":229,"\\AA":197},Ie=/[\w!@*()-=+{}\[\]\\';:?/.,~<>`|$%#&^" ]/,He,ht;M()?(He=new RegExp("\\p{Letter}","u"),ht=new RegExp("[0-9\\p{Letter}]","u")):(He=/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/,ht=/[\da-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/);function ft(e,t,r="mord",n){t!==void 0&&(ie[e]={definitionType:"symbol",type:r,variant:n,codepoint:t},oe[t]||(oe[t]=e))}function dt(e,t,r){if(typeof e=="string"){for(let n=0;n<e.length;n++){const a=e.charAt(n);ft(a,a.codePointAt(0))}return}for(const[n,a,o,_]of e)ft(n,a,o!=null?o:t,_!=null?_:r)}function se(e,t){for(let r=e;r<=t;r++)ft(String.fromCodePoint(r),r)}function De(e){var t;return(t=Pe[e])!=null?t:null}function ze(e,t){var r,n;if(t.length===0||t==="\\"||!t.startsWith("\\"))return[];const a=[];for(const _ in ue)_.startsWith(t)&&!ue[_].infix&&a.push({match:_,frequency:(r=ue[_].frequency)!=null?r:0});for(const _ in ie)_.startsWith(t)&&a.push({match:_,frequency:(n=ie[_].frequency)!=null?n:0});const o=t.substring(1);for(const _ of Object.keys(e.options.macros))_.startsWith(o)&&a.push({match:"\\"+_,frequency:0});return a.sort((_,N)=>{var z,W;return _.frequency===N.frequency?_.match.length===N.match.length?_.match<N.match?-1:1:_.match.length-N.match.length:((z=N.frequency)!=null?z:0)-((W=_.frequency)!=null?W:0)}),a.map(_=>_.match)}function Ge(e){let t="auto";const r=e.match(/:([^=]+)/);return r&&(t=r[1].trim()),t}function qe(e){if(!e)return[];const t=[];let r=e.split("]");if(r[0].startsWith("[")){t.push({isOptional:!0,type:Ge(r[0].slice(1))});for(let n=1;n<=r.length;n++)t.push(...qe(r[n]))}else if(r=e.split("}"),r[0].startsWith("{")){t.push({isOptional:!1,type:Ge(r[0].slice(1))});for(let n=1;n<=r.length;n++)t.push(...qe(r[n]))}return t}function vt(e){if(!e)return"";let t="",r=!0;for(const n of e)typeof n.value=="string"?t+=n.value:r=!1;return r?t:""}function Ut(e,t){typeof e=="string"&&(e=[e]);const r={tabular:!1,params:[],createAtom:t};for(const n of e)Pe[n]=r}function bt(e,t,r){typeof e=="string"&&(e=[e]);const a={tabular:!0,params:qe(t),createAtom:r};for(const o of e)Pe[o]=a}function ke(e,t,r){var n,a;r||(r={});const o={definitionType:"function",params:qe(t),ifMode:r.ifMode,isFunction:(n=r.isFunction)!=null?n:!1,applyMode:r.applyMode,infix:(a=r.infix)!=null?a:!1,parse:r.parse,createAtom:r.createAtom,applyStyle:r.applyStyle,serialize:r.serialize,render:r.render};if(typeof e=="string")ue["\\"+e]=o;else for(const _ of e)ue["\\"+_]=o}var lt;function $t(e){return lt||(lt=Ze(Et)),e?Ze(F(F({},lt),e)):lt}function tt(e,t){var r,n,a,o;if(typeof e=="string"){let _=0;const N=e;return/(^|[^\\])#1/.test(N)&&(_=1),/(^|[^\\])#2/.test(N)&&(_=2),/(^|[^\\])#3/.test(N)&&(_=3),/(^|[^\\])#4/.test(N)&&(_=4),/(^|[^\\])#5/.test(N)&&(_=5),/(^|[^\\])#6/.test(N)&&(_=6),/(^|[^\\])#7/.test(N)&&(_=7),/(^|[^\\])#8/.test(N)&&(_=8),/(^|[^\\])#9/.test(N)&&(_=9),{expand:(r=t==null?void 0:t.expand)!=null?r:!0,captureSelection:(n=t==null?void 0:t.captureSelection)!=null?n:!0,args:_,def:N}}return F({expand:(a=t==null?void 0:t.expand)!=null?a:!0,captureSelection:(o=t==null?void 0:t.captureSelection)!=null?o:!0,args:0},e)}function Ze(e){if(!e)return{};const t={};for(const r of Object.keys(e)){const n=e[r];if(n==null)delete t[r];else if(typeof n=="object"&&"package"in n)for(const a of Object.keys(n.package))t[a]=tt(n.package[a],{expand:!n.primitive,captureSelection:n.captureSelection});else t[r]=tt(n)}return t}function Je(e,t="math"){if(!e||e.length===0)return null;let r=null;if(e.startsWith("\\")){if(r=ue[e],r)return!r.ifMode||r.ifMode===t?r:null;t==="math"?r=ie[e]:it[e]&&(r={definitionType:"symbol",type:"mord",codepoint:it[e]})}else if(t==="math"){if(r=ie[e],!r&&e.length===1){const n=je("math",e.codePointAt(0));return n.startsWith("\\")?i(F({},Je(n,"math")),{command:n}):null}}else it[e]?r={definitionType:"symbol",type:"mord",codepoint:it[e]}:t==="text"&&(r={definitionType:"symbol",type:"mord",codepoint:e.codePointAt(0)});return r!=null?r:null}function pt(e,t){if(!e.startsWith("\\"))return null;const r=e.slice(1);return t[r]}function je(e,t){if(t===void 0)return"";if(e==="math"&&oe[t])return oe[t];if(e==="text"){const r=Object.keys(it).find(n=>it[n]===t);return r||String.fromCodePoint(t)}return String.fromCodePoint(t)}var _t=[0,.68889,0,0,.72222],xt=[0,.68889,0,0,.66667],Kt=[0,.68889,0,0,.77778],Bt=[0,.68889,0,0,.61111],Rt=[.16667,.68889,0,0,.77778],Se=[0,.68889,0,0,.55556],fe=[0,0,0,0,.25],Ce=[0,.825,0,0,2.33334],de=[0,.9,0,0,2.33334],pe=[0,.68889,0,0,.54028],xe=[-.03598,.46402,0,0,.5],Q=[-.13313,.36687,0,0,1],ne=[.01354,.52239,0,0,1],ce=[.01354,.52239,0,0,1.11111],Ae=[0,.54986,0,0,1],be=[0,.69224,0,0,.5],Oe=[0,.43056,0,0,1],$e=[.08198,.58198,0,0,.77778],mt=[.19444,.69224,0,0,.41667],Mt=[.1808,.675,0,0,1],Jt=[.19444,.69224,0,0,.83334],jt=[.13667,.63667,0,0,1],rt=[-.064,.437,0,0,1.334],Tt=[.08167,.58167,0,0,.77778],ur=[0,.69224,0,0,.72222],ir=[0,.69224,0,0,.66667],cr=[-.13313,.36687,0,0,.77778],Ur=[.06062,.54986,0,0,.77778],ar=[0,.69224,0,0,.77778],Er=[.25583,.75583,0,0,.77778],Yr=[.25142,.75726,0,0,.77778],Hn=[.20576,.70576,0,0,.77778],Mn=[.30274,.79383,0,0,.77778],ei=[.22958,.72958,0,0,.77778],mi=[.1808,.675,0,0,.77778],ti=[.13667,.63667,0,0,.77778],en=[.13597,.63597,0,0,.77778],Fi=[.03517,.54986,0,0,.77778],Bi=[0,.675,0,0,.77778],Vi=[.19444,.69224,0,0,.61111],vi=[0,.54986,0,0,.76042],Ia=[0,.54986,0,0,.66667],ki=[.0391,.5391,0,0,.77778],qi=[.03517,.54986,0,0,1.33334],Ui=[.38569,.88569,0,0,.77778],Si=[.23222,.74111,0,0,.77778],gi=[.19444,.69224,0,0,.77778],zi=[0,.37788,0,0,.5],hn=[0,.54986,0,0,.72222],dn=[0,.69224,0,0,.83334],Sr=[.11111,.69224,0,0,.66667],_i=[.26167,.75726,0,0,.77778],is=[.48256,.98256,0,0,.77778],Oa=[.28481,.79383,0,0,.77778],jn=[.08167,.58167,0,0,.22222],ya=[.08167,.58167,0,0,.38889],Ha=[0,.43056,.04028,0,.66667],Ms=[.41951,.91951,0,0,.77778],Fa=[.24982,.74947,0,0,.38865],Ee=[.08319,.58283,0,0,.75623],we=[0,.10803,0,0,.27764],We=[0,.47534,0,0,.50181],Ye=[.18906,.47534,0,0,.50181],ut=[0,.69141,0,0,.50181],At=[.24982,.74947,0,0,.27764],Ct=[0,.69141,0,0,.21471],Pt=[.25,.75,0,0,.44722],Nt=[0,.64444,0,0,.575],er=[.08556,.58556,0,0,.89444],mr=[0,.69444,0,0,.89444],Zt=[0,.68611,0,0,.9],yr=[0,.68611,0,0,.86944],Mr=[.25,.75,0,0,.575],jr=[.25,.75,0,0,.31944],Pr=[0,.69444,0,0,.63889],Gr=[0,.69444,0,0,.31944],Dr=[0,.44444,0,0,.63889],Ar=[0,.44444,0,0,.51111],fr=[0,.69444,0,0,.575],kr=[.13333,.63333,0,0,.89444],Pn=[0,.44444,0,0,.31944],yn=[0,.69444,0,0,.86944],Nn=[0,.68611,0,0,.69166],ve=[0,.68611,0,0,.83055],Te=[0,.68611,0,0,.89444],Le=[0,.69444,0,0,.60278],Me=[.19444,.69444,0,0,.51111],Re=[0,.69444,0,0,.83055],Ke=[-.10889,.39111,0,0,1.14999],Xe=[.19444,.69444,0,0,.575],Dt=[.19444,.69444,0,0,1.14999],Xt=[.19444,.69444,0,0,.70277],Wt=[.05556,.75,0,0,.575],gr=[0,.68611,0,0,.95833],hr=[.08556,.58556,0,0,.76666],br=[-.02639,.47361,0,0,.575],Cr=[0,.44444,0,0,.89444],lr=[0,.55556,0,0,.76666],tr=[-.10889,.39111,0,0,.89444],sr=[.00222,.50222,0,0,.89444],Y=[.19667,.69667,0,0,.89444],re=[.08556,.58556,0,0,1.14999],ee=[0,.69444,0,0,.70277],ye=[-.02778,.47222,0,0,.575],Fe=[.25,.75,0,0,.51111],et=[-.13889,.36111,0,0,1.14999],ct=[.19444,.69444,0,0,1.02222],Ft=[.12963,.69444,0,0,.89444],Ot=[.19444,.69444,0,0,.44722],It=[0,.64444,.13167,0,.59111],or=[.19444,.64444,.13167,0,.59111],nr=[0,.68611,.17208,0,.8961],vr=[.19444,.44444,.105,0,.53222],rr=[0,.44444,.085,0,.82666],_r=[0,.69444,.06709,0,.59111],Or=[0,.69444,.12945,0,.35555],Lr=[0,.69444,0,0,.94888],Vr=[0,.69444,.11472,0,.59111],zr=[0,.68611,.10778,0,.88555],Fr=[0,.69444,.07939,0,.62055],tn=[0,.69444,.12417,0,.30667],xr=[0,.64444,.13556,0,.51111],dr=[.19444,.64444,.13556,0,.51111],rn=[0,.68333,.16389,0,.74333],Xr=[.19444,.43056,.08847,0,.46],pn=[0,.43056,.07514,0,.71555],Gn=[0,.69444,.06646,0,.51111],In=[0,.69444,0,0,.83129],On=[0,.69444,.1225,0,.51111],on=[0,.68333,.09403,0,.76666],Tn=[0,.68333,.11111,0,.76666],Dn=[0,.69444,.06961,0,.51444],cn=[0,.69444,0,0,.27778],Zn=[.25,.75,0,0,.38889],$r=[0,.64444,0,0,.5],fn=[0,.69444,0,0,.77778],Br=[0,.68333,0,0,.75],Yn=[0,.68333,0,0,.77778],li=[0,.68333,0,0,.68056],mn=[0,.68333,0,0,.72222],Tr=[.25,.75,0,0,.5],An=[.25,.75,0,0,.27778],nn=[0,.69444,0,0,.5],ui=[0,.69444,0,0,.55556],kn=[0,.43056,0,0,.44445],ln=[0,.43056,0,0,.5],Kn=[.19444,.43056,0,0,.55556],ci=[0,.43056,0,0,.55556],Zr=[.08333,.58333,0,0,.77778],Un=[0,.43056,0,0,.27778],Fn=[0,.66786,0,0,.27778],Cn=[0,.69444,0,0,.75],Qn=[0,.66786,0,0,.5],Mi=[0,.68333,0,0,.625],zn=[.19444,.69444,0,0,.44445],qr=[0,.69444,0,0,.72222],$n=[.19444,.69444,0,0,.5],bn=[.19444,.69444,0,0,1],ba=[.011,.511,0,0,1.126],an=[.19444,.69444,0,0,.61111],yi=[.05556,.75,0,0,.5],$i=[0,.68333,0,0,.83334],Ln=[.0391,.5391,0,0,.66667],Ci=[-.05555,.44445,0,0,.5],bi=[0,.43056,0,0,.77778],Rr=[0,.55556,0,0,.66667],kt=[-.03625,.46375,0,0,.77778],Qt=[-.01688,.48312,0,0,.77778],pr=[.0391,.5391,0,0,1],Ir=[0,.69444,0,0,.61111],Nr=[-.03472,.46528,0,0,.5],Hi=[.25,.75,0,0,.44445],ri=[-.14236,.35764,0,0,1],fi=[.244,.744,0,0,.412],Li=[.19444,.69444,0,0,.88889],Ba=[.12963,.69444,0,0,.77778],ja=[.19444,.69444,0,0,.38889],Ga=[.011,.511,0,0,1.638],xa=[.19444,.69444,0,0,0],ji=[0,.44444,0,0,.575],pi=[.19444,.44444,0,0,.575],Ji=[0,.68611,0,0,.75555],Ti=[0,.69444,0,0,.66759],da=[0,.68611,0,0,.80555],xn=[0,.68611,.08229,0,.98229],En=[0,.68611,0,0,.76666],Qi=[0,.44444,0,0,.58472],Ea=[.19444,.44444,0,0,.6118],wa=[.19444,.43056,0,0,.5],Gi=[0,.68333,.02778,.08334,.76278],Ts=[0,.68333,.08125,.05556,.83125],as=[0,.43056,0,.05556,.48472],pa=[.19444,.43056,0,.08334,.51702],Sa=[.25,.75,0,0,.42778],ni=[0,.69444,0,0,.55],Zi=[0,.69444,0,0,.73334],Yi=[0,.69444,0,0,.79445],ss=[0,.69444,0,0,.51945],ma=[0,.69444,0,0,.70278],aa=[0,.69444,0,0,.76389],va=[.25,.75,0,0,.34306],Na=[0,.69444,0,0,.56111],Ka=[0,.69444,0,0,.25556],os=[.19444,.45833,0,0,.56111],xi=[0,.45833,0,0,.56111],Za=[0,.69444,0,0,.30556],Fs=[0,.69444,0,0,.58056],Ua=[0,.69444,0,0,.67223],ls=[0,.69444,0,0,.85556],Rn=[0,.69444,0,0,.55834],Kr=[0,.65556,.11156,0,.5],vn=[0,.69444,.08094,0,.70834],ii=[.17014,0,0,0,.44445],Di=[0,.69444,.0799,0,.5],ga=[0,.69444,0,0,.73752],ea=[0,.69444,.09205,0,.5],Ds=[0,.69444,.09031,0,.77778],Ya=[0,.69444,.07816,0,.27778],ta=[0,.69444,.00316,0,.5],Ri=[.19444,.69444,0,0,.83334],Ma=[.05556,.75,0,0,.83334],Xa=[0,.75,0,0,.5],Ta=[.125,.08333,0,0,.27778],Lo=[0,.08333,0,0,.27778],sa=[0,.65556,0,0,.5],Js=[0,.69444,0,0,.47222],oa=[0,.69444,0,0,.66667],Ro=[0,.69444,0,0,.59722],Qs=[0,.69444,0,0,.54167],eo=[0,.69444,0,0,.70834],to=[.25,.75,0,0,.28889],ro=[0,.69444,0,0,.51667],Po=[0,.44444,0,0,.44445],no=[.19444,.44444,0,0,.51667],Io=[0,.44444,0,0,.38333],Oo=[0,.44444,0,0,.51667],Bs=[0,.69444,0,0,.83334],Da=[.35001,.85,0,0,.45834],Fo=[.35001,.85,0,0,.57778],la=[.35001,.85,0,0,.41667],io=[.35001,.85,0,0,.58334],qa=[0,.72222,0,0,.55556],Ja=[1e-5,.6,0,0,.66667],Qa=[1e-5,.6,0,0,.77778],Ns=[.25001,.75,0,0,.94445],ao=[.306,.805,.19445,0,.47222],Bo=[.30612,.805,.19445,0,.47222],us=[.25001,.75,0,0,.83334],cs=[.35001,.85,0,0,.47222],Yt=[.25001,.75,0,0,1.11111],wr=[.65002,1.15,0,0,.59722],Xn=[.65002,1.15,0,0,.81111],Ei=[.65002,1.15,0,0,.47222],ai=[.65002,1.15,0,0,.66667],As=[0,.75,0,0,1],No=[.55001,1.05,0,0,1.27778],fl=[.862,1.36,.44445,0,.55556],so=[.86225,1.36,.44445,0,.55556],Ko=[.55001,1.05,0,0,1.11111],jl=[.65002,1.15,0,0,.52778],lf=[.65002,1.15,0,0,.61111],nc=[.55001,1.05,0,0,1.51112],uf=[.95003,1.45,0,0,.73611],cf=[.95003,1.45,0,0,1.04445],ff=[.95003,1.45,0,0,.52778],Gl=[.95003,1.45,0,0,.75],Zl=[0,.75,0,0,1.44445],Yl=[.95003,1.45,0,0,.58334],hf=[1.25003,1.75,0,0,.79167],df=[1.25003,1.75,0,0,1.27778],pf=[1.25003,1.75,0,0,.58334],Xl=[1.25003,1.75,0,0,.80556],ql=[0,.825,0,0,1.8889],Jl=[1.25003,1.75,0,0,.63889],Ql=[.64502,1.155,0,0,.875],mf=[1e-5,.6,0,0,.875],ic=[-99e-5,.601,0,0,.66667],eu=[.64502,1.155,0,0,.66667],vf=[1e-5,.9,0,0,.88889],gf=[.65002,1.15,0,0,.88889],_f=[.90001,0,0,0,.88889],yf=[-.00499,.605,0,0,1.05556],tu=[0,.12,0,0,.45],Vt=[0,.61111,0,0,.525],es=[.08333,.69444,0,0,.525],bf=[-.08056,.53055,0,0,.525],xf=[-.05556,.55556,0,0,.525],ua=[0,.43056,0,0,.525],hl=[.22222,.43056,0,0,.525],Ef=[0,0,0,0,.525],o0={"AMS-Regular":{32:fe,65:_t,66:xt,67:_t,68:_t,69:xt,70:Bt,71:Kt,72:Kt,73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:Kt,76:xt,77:[0,.68889,0,0,.94445],78:_t,79:Rt,80:Bt,81:Rt,82:_t,83:Se,84:xt,85:_t,86:_t,87:[0,.68889,0,0,1],88:_t,89:_t,90:xt,107:Se,160:fe,165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:Se,295:pe,710:Ce,732:de,770:Ce,771:de,989:Tt,1008:Ha,8245:[0,.54986,0,0,.275],8463:pe,8487:_t,8498:Se,8502:xt,8503:[0,.68889,0,0,.44445],8504:xt,8513:[0,.68889,0,0,.63889],8592:xe,8594:xe,8602:Q,8603:Q,8606:ne,8608:ne,8610:ce,8611:ce,8619:Ae,8620:Ae,8621:[-.13313,.37788,0,0,1.38889],8622:Q,8624:be,8625:be,8630:Oe,8631:Oe,8634:$e,8635:$e,8638:mt,8639:mt,8642:mt,8643:mt,8644:Mt,8646:Mt,8647:Mt,8648:Jt,8649:Mt,8650:Jt,8651:ne,8652:ne,8653:Q,8654:Q,8655:Q,8666:jt,8667:jt,8669:[-.13313,.37788,0,0,1],8672:rt,8674:rt,8705:[0,.825,0,0,.5],8708:Se,8709:Tt,8717:[0,.43056,0,0,.42917],8722:xe,8724:[.08198,.69224,0,0,.77778],8726:Tt,8733:ar,8736:ur,8737:ur,8738:[.03517,.52239,0,0,.72222],8739:jn,8740:[.25142,.74111,0,0,.27778],8741:ya,8742:[.25142,.74111,0,0,.5],8756:ir,8757:ir,8764:cr,8765:[-.13313,.37788,0,0,.77778],8769:cr,8770:kt,8774:Mn,8776:Qt,8778:Tt,8782:Ur,8783:Ur,8785:$e,8786:$e,8787:$e,8790:ar,8791:ei,8796:[.08198,.91667,0,0,.77778],8806:Er,8807:Er,8808:Yr,8809:Yr,8812:[.25583,.75583,0,0,.5],8814:Hn,8815:Hn,8816:Mn,8817:Mn,8818:ei,8819:ei,8822:mi,8823:mi,8828:ti,8829:ti,8830:ei,8831:ei,8832:Hn,8833:Hn,8840:Mn,8841:Mn,8842:en,8843:en,8847:Fi,8848:Fi,8858:$e,8859:$e,8861:$e,8862:Bi,8863:Bi,8864:Bi,8865:Bi,8872:[0,.69224,0,0,.61111],8873:ur,8874:[0,.69224,0,0,.88889],8876:Bt,8877:Bt,8878:_t,8879:_t,8882:Fi,8883:Fi,8884:ti,8885:ti,8888:[0,.54986,0,0,1.11111],8890:Kn,8891:Vi,8892:Vi,8901:[0,.54986,0,0,.27778],8903:Tt,8905:Tt,8906:Tt,8907:ar,8908:ar,8909:[-.03598,.46402,0,0,.77778],8910:vi,8911:vi,8912:Fi,8913:Fi,8914:Ia,8915:Ia,8916:ir,8918:ki,8919:ki,8920:qi,8921:qi,8922:Ui,8923:Ui,8926:ti,8927:ti,8928:Mn,8929:Mn,8934:Si,8935:Si,8936:Si,8937:Si,8938:Hn,8939:Hn,8940:Mn,8941:Mn,8994:gi,8995:gi,9416:[.15559,.69224,0,0,.90222],9484:be,9488:be,9492:zi,9496:zi,9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:Bi,9633:Bi,9650:hn,9651:hn,9654:Fi,9660:hn,9661:hn,9664:Fi,9674:Sr,9733:[.19444,.69224,0,0,.94445],10003:dn,10016:dn,10731:Sr,10846:[.19444,.75583,0,0,.61111],10877:ti,10878:ti,10885:Er,10886:Er,10887:en,10888:en,10889:_i,10890:_i,10891:is,10892:is,10901:ti,10902:ti,10933:Yr,10934:Yr,10935:_i,10936:_i,10937:_i,10938:_i,10949:Er,10950:Er,10955:Oa,10956:Oa,57350:jn,57351:ya,57352:Tt,57353:Ha,57356:Yr,57357:Yr,57358:Ms,57359:Mn,57360:Mn,57361:Ms,57366:Yr,57367:Yr,57368:Yr,57369:Yr,57370:en,57371:en},"Caligraphic-Regular":{32:fe,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:fe},"Fraktur-Regular":{32:fe,33:[0,.69141,0,0,.29574],34:Ct,38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:Fa,41:Fa,42:[0,.62119,0,0,.27764],43:Ee,44:we,45:Ee,46:we,47:[.24982,.74947,0,0,.50181],48:We,49:We,50:We,51:Ye,52:Ye,53:Ye,54:ut,55:Ye,56:ut,57:Ye,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:At,93:At,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:fe,8216:Ct,8217:Ct,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:fe,33:[0,.69444,0,0,.35],34:Le,35:[.19444,.69444,0,0,.95833],36:Wt,37:[.05556,.75,0,0,.95833],38:mr,39:Gr,40:Pt,41:Pt,42:[0,.75,0,0,.575],43:kr,44:[.19444,.15556,0,0,.31944],45:Io,46:[0,.15556,0,0,.31944],47:Mr,48:Nt,49:Nt,50:Nt,51:Nt,52:Nt,53:Nt,54:Nt,55:Nt,56:Nt,57:Nt,58:Pn,59:[.19444,.44444,0,0,.31944],60:er,61:tr,62:er,63:[0,.69444,0,0,.54305],64:mr,65:yr,66:[0,.68611,0,0,.81805],67:ve,68:[0,.68611,0,0,.88194],69:Ji,70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:Zt,73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:Nn,77:[0,.68611,0,0,1.09166],78:Zt,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:yr,89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:jr,92:Mr,93:jr,94:fr,95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:Pr,99:Ar,100:Pr,101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:Pr,105:Gr,106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:Gr,109:[0,.44444,0,0,.95833],110:Dr,111:ji,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:Dr,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:Ar,123:Mr,124:jr,125:Mr,126:[.35,.34444,0,0,.575],160:fe,163:[0,.69444,0,0,.86853],168:fr,172:[0,.44444,0,0,.76666],176:yn,177:kr,184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:kr,216:[.04861,.73472,0,0,.89444],223:Ro,230:[0,.44444,0,0,.83055],247:kr,248:[.09722,.54167,0,0,.575],305:Pn,338:[0,.68611,0,0,1.16944],339:Cr,567:[.19444,.44444,0,0,.35139],710:fr,711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:fr,715:fr,728:fr,729:Gr,730:yn,732:fr,733:fr,915:Nn,916:gr,920:Te,923:da,926:En,928:Zt,931:ve,933:Te,934:ve,936:Te,937:ve,8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:Gr,8217:Gr,8220:Le,8221:Le,8224:Me,8225:Me,8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:Ti,8465:Re,8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:Re,8501:ee,8592:Ke,8593:Xe,8594:Ke,8595:Xe,8596:Ke,8597:Mr,8598:Dt,8599:Dt,8600:Dt,8601:Dt,8636:Ke,8637:Ke,8640:Ke,8641:Ke,8656:Ke,8657:Xt,8658:Ke,8659:Xt,8660:Ke,8661:[.25,.75,0,0,.70277],8704:Pr,8706:[0,.69444,.06389,0,.62847],8707:Pr,8709:Wt,8711:gr,8712:hr,8715:hr,8722:kr,8723:kr,8725:Mr,8726:Mr,8727:ye,8728:br,8729:br,8730:[.18,.82,0,0,.95833],8733:Cr,8734:[0,.44444,0,0,1.14999],8736:ur,8739:jr,8741:Mr,8743:lr,8744:lr,8745:lr,8746:lr,8747:[.19444,.69444,.12778,0,.56875],8764:tr,8768:[.19444,.69444,0,0,.31944],8771:sr,8776:[.02444,.52444,0,0,.89444],8781:sr,8801:sr,8804:Y,8805:Y,8810:re,8811:re,8826:er,8827:er,8834:er,8835:er,8838:Y,8839:Y,8846:lr,8849:Y,8850:Y,8851:lr,8852:lr,8853:kr,8854:kr,8855:kr,8856:kr,8857:kr,8866:ee,8867:ee,8868:mr,8869:mr,8900:br,8901:[-.02639,.47361,0,0,.31944],8902:ye,8968:Fe,8969:Fe,8970:Fe,8971:Fe,8994:et,8995:et,9651:ct,9657:ye,9661:ct,9667:ye,9711:Dt,9824:Ft,9825:Ft,9826:Ft,9827:Ft,9837:[0,.75,0,0,.44722],9838:Ot,9839:Ot,10216:Pt,10217:Pt,10815:Zt,10927:Y,10928:Y,57376:xa},"Main-BoldItalic":{32:fe,33:[0,.69444,.11417,0,.38611],34:Fr,35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:Or,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:It,49:It,50:It,51:It,52:or,53:It,54:It,55:or,56:It,57:It,58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:Vr,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:nr,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:nr,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:_r,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:vr,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:vr,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:fe,168:[0,.69444,.11473,0,.59111],176:Lr,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:rr,248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:rr,567:[.19444,.44444,.04611,0,.385],710:_r,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:Or,730:Lr,732:Vr,733:Vr,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:nr,931:[0,.68611,.11431,0,.82666],933:zr,934:[0,.68611,.05632,0,.82666],936:zr,937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:Or,8217:Or,8220:[0,.69444,.16772,0,.62055],8221:Fr},"Main-Italic":{32:fe,33:tn,34:Dn,35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:tn,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:xr,49:xr,50:xr,51:xr,52:dr,53:xr,54:xr,55:dr,56:xr,57:xr,58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:On,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:rn,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:rn,79:on,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:rn,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:Gn,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:Xr,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:Xr,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:fe,168:[0,.66786,.10474,0,.51111],176:In,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:pn,248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:pn,710:Gn,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:In,732:[0,.66786,.11585,0,.51111],733:On,915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:on,923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:rn,931:[0,.68333,.12028,0,.71555],933:Tn,934:[0,.68333,.05986,0,.71555],936:Tn,937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:tn,8217:tn,8220:[0,.69444,.1685,0,.51444],8221:Dn,8463:pe},"Main-Regular":{32:fe,33:cn,34:nn,35:Ri,36:yi,37:Ma,38:fn,39:cn,40:Zn,41:Zn,42:Xa,43:Zr,44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:Tr,48:$r,49:$r,50:$r,51:$r,52:$r,53:$r,54:$r,55:$r,56:$r,57:$r,58:Un,59:[.19444,.43056,0,0,.27778],60:ki,61:cr,62:ki,63:Js,64:fn,65:Br,66:[0,.68333,0,0,.70834],67:mn,68:[0,.68333,0,0,.76389],69:li,70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:Br,73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:Yn,76:Mi,77:[0,.68333,0,0,.91667],78:Br,79:Yn,80:li,81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:mn,85:Br,86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:Br,89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:An,92:Tr,93:An,94:nn,95:[.31,.12056,.02778,0,.5],97:ln,98:ui,99:kn,100:ui,101:kn,102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:ui,105:Fn,106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:cn,109:[0,.43056,0,0,.83334],110:ci,111:ln,112:Kn,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:ci,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:kn,123:Tr,124:An,125:Tr,126:[.35,.31786,0,0,.5],160:fe,163:[0,.69444,0,0,.76909],167:zn,168:Qn,172:[0,.43056,0,0,.66667],176:Cn,177:Zr,182:an,184:ii,198:[0,.68333,0,0,.90278],215:Zr,216:[.04861,.73194,0,0,.77778],223:nn,230:[0,.43056,0,0,.72222],247:Zr,248:[.09722,.52778,0,0,.5],305:Un,338:[0,.68333,0,0,1.01389],339:bi,567:[.19444,.43056,0,0,.30556],710:nn,711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:nn,715:nn,728:nn,729:Fn,730:Cn,732:Qn,733:nn,915:Mi,916:$i,920:Yn,923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:Br,931:mn,933:Yn,934:mn,936:Yn,937:mn,8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:cn,8217:cn,8220:nn,8221:nn,8224:zn,8225:zn,8230:[0,.12,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:pe,8465:qr,8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:qr,8501:Ir,8592:Q,8593:$n,8594:Q,8595:$n,8596:Q,8597:Tr,8598:bn,8599:bn,8600:bn,8601:bn,8614:[.011,.511,0,0,1],8617:ba,8618:ba,8636:Q,8637:Q,8640:Q,8641:Q,8652:[.011,.671,0,0,1],8656:Q,8657:an,8658:Q,8659:an,8660:Q,8661:[.25,.75,0,0,.61111],8704:ui,8706:[0,.69444,.05556,.08334,.5309],8707:ui,8709:yi,8711:$i,8712:Ln,8715:Ln,8722:Zr,8723:Zr,8725:Tr,8726:Tr,8727:Nr,8728:Ci,8729:Ci,8730:[.2,.8,0,0,.83334],8733:bi,8734:Oe,8736:ur,8739:An,8741:Tr,8743:Rr,8744:Rr,8745:Rr,8746:Rr,8747:[.19444,.69444,.11111,0,.41667],8764:cr,8768:[.19444,.69444,0,0,.27778],8771:kt,8773:[-.022,.589,0,0,1],8776:Qt,8781:kt,8784:[-.133,.67,0,0,.778],8801:kt,8804:en,8805:en,8810:pr,8811:pr,8826:ki,8827:ki,8834:ki,8835:ki,8838:en,8839:en,8846:Rr,8849:en,8850:en,8851:Rr,8852:Rr,8853:Zr,8854:Zr,8855:Zr,8856:Zr,8857:Zr,8866:Ir,8867:Ir,8868:fn,8869:fn,8872:[.249,.75,0,0,.867],8900:Ci,8901:[-.05555,.44445,0,0,.27778],8902:Nr,8904:[.005,.505,0,0,.9],8942:[.03,.9,0,0,.278],8943:[-.19,.31,0,0,1.172],8945:[-.1,.82,0,0,1.282],8968:Hi,8969:Hi,8970:Hi,8971:Hi,8994:ri,8995:ri,9136:fi,9137:fi,9651:Li,9657:Nr,9661:Li,9667:Nr,9711:bn,9824:Ba,9825:Ba,9826:Ba,9827:Ba,9837:[0,.75,0,0,.38889],9838:ja,9839:ja,10216:Zn,10217:Zn,10222:fi,10223:fi,10229:[.011,.511,0,0,1.609],10230:Ga,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:Ga,10815:Br,10927:en,10928:en,57376:xa},"Math-BoldItalic":{32:fe,48:ji,49:ji,50:ji,51:pi,52:pi,53:pi,54:Nt,55:pi,56:Nt,57:pi,65:yr,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:xn,73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:Ji,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:Ti,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:Qi,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:fe,915:[0,.68611,.15972,0,.65694],916:gr,920:[0,.68611,.03194,0,.86722],923:da,926:[0,.68611,.07458,0,.84125],928:xn,931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:En,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:Qi,960:[0,.44444,.03704,0,.68241],961:Ea,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:Ea,1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:fe,48:ln,49:ln,50:ln,51:wa,52:wa,53:wa,54:$r,55:wa,56:$r,57:wa,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:Ts,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:Gi,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:as,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:fe,915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:Gi,923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:Ts,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:as,960:[0,.43056,.03588,0,.57003],961:pa,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:pa,1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:fe,33:[0,.69444,0,0,.36667],34:Rn,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:Za,40:Sa,41:Sa,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:ni,49:ni,50:ni,51:ni,52:ni,53:ni,54:ni,55:ni,56:ni,57:ni,58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:ss,64:Zi,65:Zi,66:Zi,67:ma,68:Yi,69:[0,.69444,0,0,.64167],70:Ir,71:Zi,72:Yi,73:[0,.69444,0,0,.33056],74:ss,75:aa,76:Fs,77:[0,.69444,0,0,.97778],78:Yi,79:Yi,80:ma,81:[.10556,.69444,0,0,.79445],82:ma,83:Ir,84:Zi,85:aa,86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:Zi,89:[0,.69444,.0275,0,.73334],90:Ua,91:va,93:va,94:ni,95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:Na,99:[0,.45833,0,0,.48889],100:Na,101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:Na,105:Ka,106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:Ka,109:[0,.45833,0,0,.86667],110:xi,111:[0,.45833,0,0,.55],112:os,113:os,114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:xi,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:fe,168:ni,176:Zi,180:ni,184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:ni,711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:ni,729:Za,730:Zi,732:ni,733:ni,915:Fs,916:[0,.69444,0,0,.91667],920:ls,923:Ua,926:Zi,928:Yi,931:Yi,933:ls,934:Yi,936:ls,937:Yi,8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:Za,8217:Za,8220:Rn,8221:Rn},"SansSerif-Italic":{32:fe,33:[0,.69444,.05733,0,.31945],34:ta,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:Ya,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:Ta,45:[0,.44444,.01946,0,.33333],46:Lo,47:[.25,.75,.13164,0,.5],48:Kr,49:Kr,50:Kr,51:Kr,52:Kr,53:Kr,54:Kr,55:Kr,56:Kr,57:Kr,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:oa,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:vn,73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:Qs,77:[0,.69444,.08094,0,.875],78:vn,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:Di,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:fe,168:[0,.67937,.06385,0,.5],176:ga,184:ii,305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:Di,711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:ea,715:nn,728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:ga,732:[0,.67659,.08826,0,.5],733:ea,915:[0,.69444,.13372,0,.54167],916:Bs,920:[0,.69444,.07555,0,.77778],923:Ir,926:[0,.69444,.12816,0,.66667],928:vn,931:[0,.69444,.11983,0,.72222],933:Ds,934:[0,.69444,.04603,0,.72222],936:Ds,937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:Ya,8217:Ya,8220:[0,.69444,.14205,0,.5],8221:ta},"SansSerif-Regular":{32:fe,33:[0,.69444,0,0,.31945],34:nn,35:Ri,36:yi,37:Ma,38:[0,.69444,0,0,.75834],39:cn,40:Zn,41:Zn,42:Xa,43:Zr,44:Ta,45:[0,.44444,0,0,.33333],46:Lo,47:Tr,48:sa,49:sa,50:sa,51:sa,52:sa,53:sa,54:sa,55:sa,56:sa,57:sa,58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:Js,64:oa,65:oa,66:oa,67:Pr,68:[0,.69444,0,0,.72223],69:Ro,70:[0,.69444,0,0,.56945],71:oa,72:eo,73:cn,74:Js,75:[0,.69444,0,0,.69445],76:Qs,77:[0,.69444,0,0,.875],78:eo,79:[0,.69444,0,0,.73611],80:Pr,81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:ui,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:oa,89:[0,.69444,.025,0,.66667],90:Ir,91:to,93:to,94:nn,95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:ro,99:Po,100:ro,101:Po,102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:ro,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:Oo,111:[0,.44444,0,0,.5],112:no,113:no,114:[0,.44444,.01389,0,.34167],115:Io,116:[0,.57143,0,0,.36111],117:Oo,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:fe,168:[0,.67937,0,0,.5],176:oa,184:ii,305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:nn,711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:nn,715:nn,728:nn,729:[0,.67937,0,0,.27778],730:oa,732:[0,.67659,0,0,.5],733:nn,915:Qs,916:Bs,920:fn,923:Ir,926:oa,928:eo,931:qr,933:fn,934:qr,936:fn,937:qr,8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:cn,8217:cn,8220:nn,8221:nn},"Script-Regular":{32:fe,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:fe},"Size1-Regular":{32:fe,40:Da,41:Da,47:Fo,91:la,92:Fo,93:la,123:io,125:io,160:fe,710:qa,732:qa,770:qa,771:qa,8214:[-99e-5,.601,0,0,.77778],8593:Ja,8595:Ja,8657:Qa,8659:Qa,8719:Ns,8720:Ns,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:Bo,8748:ao,8749:ao,8750:Bo,8896:us,8897:us,8898:us,8899:us,8968:cs,8969:cs,8970:cs,8971:cs,9168:ic,10216:cs,10217:cs,10752:Yt,10753:Yt,10754:Yt,10756:us,10758:us},"Size2-Regular":{32:fe,40:wr,41:wr,47:Xn,91:Ei,92:Xn,93:Ei,123:ai,125:ai,160:fe,710:As,732:As,770:As,771:As,8719:No,8720:No,8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:so,8748:fl,8749:fl,8750:so,8896:Ko,8897:Ko,8898:Ko,8899:Ko,8968:jl,8969:jl,8970:jl,8971:jl,10216:lf,10217:lf,10752:nc,10753:nc,10754:nc,10756:Ko,10758:Ko},"Size3-Regular":{32:fe,40:uf,41:uf,47:cf,91:ff,92:cf,93:ff,123:Gl,125:Gl,160:fe,710:Zl,732:Zl,770:Zl,771:Zl,8730:[.95003,1.45,0,0,1],8968:Yl,8969:Yl,8970:Yl,8971:Yl,10216:Gl,10217:Gl},"Size4-Regular":{32:fe,40:hf,41:hf,47:df,91:pf,92:df,93:pf,123:Xl,125:Xl,160:fe,710:ql,732:ql,770:ql,771:ql,8730:[1.25003,1.75,0,0,1],8968:Jl,8969:Jl,8970:Jl,8971:Jl,9115:Ql,9116:mf,9117:Ql,9118:Ql,9119:mf,9120:Ql,9121:eu,9122:ic,9123:eu,9124:eu,9125:ic,9126:eu,9127:vf,9128:gf,9129:_f,9130:[0,.3,0,0,.88889],9131:vf,9132:gf,9133:_f,9143:[.88502,.915,0,0,1.05556],10216:Xl,10217:Xl,57344:yf,57345:yf,57680:tu,57681:tu,57682:tu,57683:tu},"Typewriter-Regular":{32:Ef,33:Vt,34:Vt,35:Vt,36:es,37:es,38:Vt,39:Vt,40:es,41:es,42:[0,.52083,0,0,.525],43:bf,44:[.13889,.125,0,0,.525],45:bf,46:[0,.125,0,0,.525],47:es,48:Vt,49:Vt,50:Vt,51:Vt,52:Vt,53:Vt,54:Vt,55:Vt,56:Vt,57:Vt,58:ua,59:[.13889,.43056,0,0,.525],60:xf,61:[-.19549,.41562,0,0,.525],62:xf,63:Vt,64:Vt,65:Vt,66:Vt,67:Vt,68:Vt,69:Vt,70:Vt,71:Vt,72:Vt,73:Vt,74:Vt,75:Vt,76:Vt,77:Vt,78:Vt,79:Vt,80:Vt,81:[.13889,.61111,0,0,.525],82:Vt,83:Vt,84:Vt,85:Vt,86:Vt,87:Vt,88:Vt,89:Vt,90:Vt,91:es,92:es,93:es,94:Vt,95:[.09514,0,0,0,.525],96:Vt,97:ua,98:Vt,99:ua,100:Vt,101:ua,102:Vt,103:hl,104:Vt,105:Vt,106:[.22222,.61111,0,0,.525],107:Vt,108:Vt,109:ua,110:ua,111:ua,112:hl,113:hl,114:ua,115:ua,116:[0,.55358,0,0,.525],117:ua,118:ua,119:ua,120:ua,121:hl,122:ua,123:es,124:es,125:es,126:Vt,127:Vt,160:Ef,176:Vt,184:[.19445,0,0,0,.525],305:ua,567:hl,711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:Vt,715:Vt,728:Vt,730:Vt,770:Vt,771:Vt,776:Vt,915:Vt,916:Vt,920:Vt,923:Vt,926:Vt,928:Vt,931:Vt,933:Vt,934:Vt,936:Vt,937:Vt,8216:Vt,8217:Vt,8242:Vt,9251:[.11111,.21944,0,0,.525]}},l0=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,Uo=10,ts=.25,u0=1.2,Ks=.431,wf={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[Ks,Ks,Ks],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.5,.732,.925],num2:[.394,.384,.5],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[ts,ts,ts],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]},ac=[0,.5,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],sc=5,Sf={"\xA0":" ","\u200B":" ",\u00C5:"A",\u00C7:"C",\u00D0:"D",\u00DE:"o",\u00E5:"a",\u00E7:"c",\u00F0:"d",\u00FE:"o",\u0410:"A",\u0411:"B",\u0412:"B",\u0413:"F",\u0414:"A",\u0415:"E",\u0416:"K",\u0417:"3",\u0418:"N",\u0419:"N",\u041A:"K",\u041B:"N",\u041C:"M",\u041D:"H",\u041E:"O",\u041F:"N",\u0420:"P",\u0421:"C",\u0422:"T",\u0423:"y",\u0424:"O",\u0425:"X",\u0426:"U",\u0427:"h",\u0428:"W",\u0429:"W",\u042A:"B",\u042B:"X",\u042C:"B",\u042D:"3",\u042E:"X",\u042F:"R",\u0430:"a",\u0431:"b",\u0432:"a",\u0433:"r",\u0434:"y",\u0435:"e",\u0436:"m",\u0437:"e",\u0438:"n",\u0439:"n",\u043A:"n",\u043B:"n",\u043C:"m",\u043D:"n",\u043E:"o",\u043F:"n",\u0440:"p",\u0441:"c",\u0442:"o",\u0443:"y",\u0444:"b",\u0445:"x",\u0446:"n",\u0447:"n",\u0448:"w",\u0449:"w",\u044A:"a",\u044B:"m",\u044C:"a",\u044D:"e",\u044E:"m",\u044F:"r"};function zo(e,t){e===void 0&&(e=77);const r=o0[t][e];if(r)return{defaultMetrics:!1,depth:r[0],height:r[1],italic:r[2],skew:r[3],width:r[4]};if(e===11034)return{defaultMetrics:!0,depth:.2,height:.8,italic:0,skew:0,width:.8};const n=String.fromCodePoint(e);if(n in Sf)e=Sf[n].codePointAt(0);else if(l0.test(n))return e=77,{defaultMetrics:!0,depth:.2,height:.9,italic:0,skew:0,width:1};return{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0,width:.8}}var oc={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],longrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],longleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],longleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],longrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],longleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xleftrightarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],longleftrightarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xRightleftharpoons:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],longRightleftharpoons:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xLeftrightharpoons:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716],longLeftrightharpoons:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},lc={widehat1:[1062,239,.24],widehat2:[2364,300,.3],widehat3:[2364,360,.36],widehat4:[2364,420,.42],widecheck1:[1062,239,.24],widecheck2:[2364,300,.3],widecheck3:[2364,360,.36],widecheck4:[2364,420,.42],widetilde1:[600,260,.26],widetilde2:[1033,286,.286],widetilde3:[2339,306,.306],widetilde4:[2340,312,.34],overarc:[1061,159,.3],underarc:[1061,159,.3]},Mf={doubleleftarrow:`M262 157
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,overarc:"M529 0c179 0 524 115 524 115 5 1 9 5 9 10 0 1-1 2-1 3l-4 22c-1 5-5 9-11 9h-2s-338-93-512-92c-174 0-513 92-513 92h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13 0 0 342-115 520-115z",underarc:`m 529 160
c -179 0 -524 -115 -524 -115
c -5 -1 -9 -5 -9 -10
c 0 -1 1 -2 1 -3
l 4 -22
c 1 -5 5 -9 11 -9
h 2
s 338 93 512 92
c 174 0 513 -92 513 -92
h 2
c 5 0 9 4 11 9
l 5 22
c 1 6 -2 12 -8 13
c 0 0 -342 115 -520 115
z
`,leftgroup:`M400000 80
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
435 0h399565z`,leftgroupunder:`M400000 262
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,widetilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
-68.267.847-113-73.952-191-73.952z`,widetilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,widetilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
-338 0-409-156.573-744-156.573z`,widetilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`};function c0(e){if(lc[e]){const[W,j,X]=lc[e],ae=`<span class="stretchy" style="height:${X}em"><svg width="100%" height="${X}em" viewBox="0 0 ${W} ${j}" preserveAspectRatio="none" ><path fill="currentcolor" d="${Mf[e]}"></path></svg></span>`;return`<span style="display:inline-block;height:${Math.floor(100*X/2)/100}em;min-width:0">${ae}</span>`}const[t,r,n,a]=oc[e];let o,_;const N=n/1e3;t.length===3?(o=["slice-1-of-3","slice-2-of-3","slice-3-of-3"],_=["xMinYMin","xMidYMin","xMaxYMin"]):t.length===2?(o=["slice-1-of-2","slice-2-of-2"],_=["xMinYMin","xMaxYMin"]):(o=["slice-1-of-1"],_=[a]);const z=t.map((W,j)=>`<span class="${o[j]}" style=height:${N}em><svg width=400em height=${N}em viewBox="0 0 400000 ${n}" preserveAspectRatio="${_[j]} slice"><path fill="currentcolor" d="${Mf[W]}"></path></svg></span>`).join("");return`<span style="display:inline-block;height:${N}em;min-width:${r}em;">${z}</span>`}function f0(e){return oc[e]?oc[e][2]/1e3:lc[e][2]}function h0(e){const t=[];for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if(n===13&&e.charCodeAt(r+1)===10&&(n=10,r++),(n===13||n===12)&&(n=10),n===0&&(n=65533),n>=55296&&n<=56319){const a=e.charCodeAt(r+1);if(a>=56320&&a<=57343){const o=n-55296,_=a-56320;n=Ss(2,16)+o*Ss(2,10)+_,r++}}t.push(n)}return t}var ru=8205,d0=[[ru,1],[65038,2],[127995,5],[129456,4],[917536,96]],nu,Tf=[127462,127487];function Df(e){var t;if(nu===void 0){nu={};for(const r of d0)for(let n=r[0];n<=r[0]+r[1]-1;n++)nu[n]=!0}return(t=nu[e])!=null?t:!1}function p0(e){return e>=Tf[0]&&e<=Tf[1]}function Af(e){if(/^[\u0020-\u00FF]*$/.test(e))return e;const t=[],r=h0(e);let n=0;for(;n<r.length;){const a=r[n++],o=r[n];if(o===ru){const _=n-1;for(n+=2;r[n]===ru;)n+=2;t.push(String.fromCodePoint(...r.slice(_,n-_+1)))}else if(Df(o)){const _=n-1;for(;Df(r[n]);)n+=r[n]===ru?2:1;t.push(String.fromCodePoint(...r.slice(_,2*n-_-1)))}else p0(a)?(n+=1,t.push(String.fromCodePoint(...r.slice(n-2,2)))):t.push(String.fromCodePoint(a))}return t}var m0=class{constructor(e){this.obeyspaces=!1,this.pos=0,this.s=Af(e)}end(){return this.pos>=this.s.length}get(){return this.pos<this.s.length?this.s[this.pos++]:""}peek(){return this.s[this.pos]}match(e){const t=typeof this.s=="string"?e.exec(this.s.slice(this.pos)):e.exec(this.s.slice(this.pos).join(""));return t!=null&&t[0]?(this.pos+=t[0].length,t[0]):""}next(){if(this.end())return null;if(!this.obeyspaces&&this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]+/)||this.obeyspaces&&this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]/))return"<space>";const e=this.get();if(e==="\\"){if(!this.end()){let t=this.match(/^[a-zA-Z\*]+/);return t?this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]*/):t=this.get(),"\\"+t}}else{if(e==="{")return"<{>";if(e==="}")return"<}>";if(e==="^"){if(this.peek()==="^"){this.get();const t=this.match(/^(\^(\^(\^(\^[\da-f])?[\da-f])?[\da-f])?[\da-f])?[\da-f]{2}/);if(t)return String.fromCodePoint(Number.parseInt(t.slice(t.lastIndexOf("^")+1),16))}return e}else if(e==="#"){if(!this.end()){let t=!1;if(/[\d?@]/.test(this.peek())&&(t=!0,this.pos+1<this.s.length)){const r=this.s[this.pos+1];t=/[^\dA-Za-z]/.test(r)}return t?"#"+this.get():"#"}}else if(e==="$")return this.peek()==="$"?(this.get(),"<$$>"):"<$>"}return e}};function v0(e,t){var r,n,a,o;const _=[];let N=e.next();if(N&&N!=="\\relax"){if(N==="\\noexpand")N=e.next(),N&&_.push(N);else if(N==="\\obeyspaces")e.obeyspaces=!0;else if(N==="\\bgroup")_.push("<{>");else if(N==="\\egroup")_.push("<}>");else if(N==="\\string"){if(N=e.next(),N)if(N.startsWith("\\"))for(const z of N)_.push(z==="\\"?"\\backslash":z);else N==="<{>"?_.push("\\{"):N==="<space>"?_.push("~"):N==="<}>"&&_.push("\\}")}else if(N==="\\csname"){for(;e.peek()==="<space>";)e.next();let z="",W=!1,j=[];do{if(j.length===0)if(/^#[\d?@]$/.test(e.peek())){const X=e.get().slice(1);j=iu((n=(r=t==null?void 0:t(X))!=null?r:t==null?void 0:t("?"))!=null?n:"\\placeholder{}",t),N=j[0]}else N=e.next(),j=N?[N]:[];W=j.length===0,!W&&N==="\\endcsname"&&(W=!0,j.shift()),W||(W=N==="<$>"||N==="<$$>"||N==="<{>"||N==="<}>"||typeof N=="string"&&N.length>1&&N.startsWith("\\")),W||(z+=j.shift())}while(!W);z&&_.push("\\"+z),_.push(...j)}else if(N!=="\\endcsname")if(N.length>1&&N.startsWith("#")){const z=N.slice(1);_.push(...iu((o=(a=t==null?void 0:t(z))!=null?a:t==null?void 0:t("?"))!=null?o:"\\placeholder{}",t))}else _.push(N)}return _}function iu(e,t=null){const r=[];let n="";for(const _ of e.toString().split(/\r?\n/)){n&&r.push(n),n=" ";const N=_.match(/((?:\\%)|[^%])*/);N!==null&&r.push(N[0])}const a=new m0(te(r.join(""))),o=[];do o.push(...v0(a,t));while(!a.end());return o}function Jr(e){let t="";const r=[];for(const n of e)n&&(t&&/^[a-zA-Z\*]/.test(n)&&r.push(t),r.push(n),/^\\[a-zA-Z]+\*?[\"\'][^\ ]+$/.test(n)&&r.push(" "),t=/\\[a-zA-Z]+\*?$/.test(n)?" ":"");return r.join("")}function qn(e,...t){return console.assert(e.startsWith("\\")),t.length===0?e:Jr([e,...t.map(r=>`{${r}}`)])}function oo(e){return Jr(e.map(t=>{var r;return(r={"<space>":" ","<$$>":"$$","<$>":"$","<{>":"{","<}>":"}"}[t])!=null?r:t}))}var kf=class Hl{constructor(t){Hl._registry[t]=this}static createAtom(t,r,n){return Hl._registry[t].createAtom(r,Je(r,t),n)}static serialize(t,r){var n;if(!t||t.length===0)return"";if((n=r.skipStyles)!=null&&n){const a=[];for(const o of Cf(t)){const _=Hl._registry[o[0].mode];a.push(..._.serialize(o,r))}return Jr(a)}return Jr(_0(t,r))}static getFont(t,r,n){return Hl._registry[t].getFont(r,n)}};kf._registry={};var Aa=kf;function Cf(e){const t=[];let r=[],n="NONE";for(const a of e)a.type!=="first"&&(a.mode!==n?(r.length>0&&t.push(r),r=[a],n=a.mode):r.push(a));return r.length>0&&t.push(r),t}function Us(e,t){const r=[];let n=[],a;for(const o of e)if(o.type!=="first"&&o.style){let _;t==="variant"?(_=o.style.variant,o.style.variantStyle&&o.style.variantStyle!=="up"&&(_+="-"+o.style.variantStyle)):_=o.style[t],_===a?n.push(o):(n.length>0&&r.push(n),n=[o],a=_)}return n.length>0&&r.push(n),r}function Lf(e,t){var r;const{parent:n}=e[0],a=n==null?void 0:n.computedStyle.color,o=[];for(const _ of Cf(e)){const N=t.defaultMode;for(const z of Us(_,"color")){const W=z[0].computedStyle,j=Aa._registry[z[0].mode].serialize(z,i(F({},t),{defaultMode:N==="text"?"text":"math"}));!t.skipStyles&&W.color&&W.color!=="none"&&(!n||a!==W.color)?o.push(qn("\\textcolor",(r=W.verbatimColor)!=null?r:W.color,Jr(j))):o.push(Jr(j))}}return o}function g0(e,t){const{parent:r}=e[0],n=r==null?void 0:r.computedStyle.backgroundColor;return Us(e,"backgroundColor").map(a=>{var o;if(a.length>0||a[0].type!=="box"){const _=a[0].computedStyle;if(_.backgroundColor&&_.backgroundColor!=="none"&&(!r||n!==_.backgroundColor))return qn("\\colorbox",(o=_.verbatimBackgroundColor)!=null?o:_.backgroundColor,Jr(Lf(a,i(F({},t),{defaultMode:"text"}))))}return Jr(Lf(a,t))})}function _0(e,t){if(e.length===0)return[];const{parent:r}=e[0],n=r==null?void 0:r.computedStyle.fontSize,a=[];for(const o of Us(e,"fontSize")){const _=o[0].computedStyle.fontSize,N=g0(o,t);N&&(_&&_!=="auto"&&(!r||n!==_)?a.push(["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][_],...N):a.push(...N))}return a}function uc(e){return e?{mord:"ord",mbin:"bin",mop:"op",mrel:"rel",mopen:"open",mclose:"close",mpunct:"punct",minner:"inner",spacing:"ignore",latex:"latex",composition:"inner",error:"inner",placeholder:"ord",supsub:"ignore"}[e]:void 0}function dl(e){if(e.length===0)return"ord";const t=uc(e[0].type),r=uc(e[e.length-1].type);return t&&t===r?t:"ord"}function pl(e,t){if(typeof e=="string")return e;if(typeof e=="number"){console.assert(Number.isFinite(e));const r=Math.ceil(100*e)/100;return r===0?"0":r.toString()+(t!=null?t:"")}return""}var St=class Dd{constructor(t,r){var n,a,o,_,N;if(typeof t=="number"?this.value=String.fromCodePoint(t):typeof t=="string"?this.value=t:v(t)?this.children=t.filter(W=>W!==null):t&&t instanceof Dd&&(this.children=[t]),this.children)for(const W of this.children)W.parent=this;this.type=(n=r==null?void 0:r.type)!=null?n:"ignore",this.isSelected=(r==null?void 0:r.isSelected)===!0,r!=null&&r.caret&&(this.caret=r.caret),this.classes=(a=r==null?void 0:r.classes)!=null?a:"",this.isTight=(o=r==null?void 0:r.isTight)!=null?o:!1,r!=null&&r.attributes&&(this.attributes=r.attributes);let z=r==null?void 0:r.fontFamily;r!=null&&r.style&&this.value&&(z=(N=Aa.getFont((_=r.mode)!=null?_:"math",this,i(F({variant:"normal"},r.style),{letterShapeStyle:r.letterShapeStyle})))!=null?N:void 0),z||(z="Main-Regular"),this._height=0,this._depth=0,this._width=0,this.hasExplicitWidth=!1,this.skew=0,this.italic=0,this.maxFontSize=0,this.scale=1,(r==null?void 0:r.maxFontSize)!==void 0&&(this.maxFontSize=r.maxFontSize),y0(this,z)}set atomID(t){t===void 0||t.length===0||(this.id=t)}selected(t){if(this.isSelected!==t&&(this.isSelected=t,this.children))for(const r of this.children)r.selected(t)}setStyle(t,r,n){if(r===void 0)return;const a=pl(r,n);a.length>0&&(this.cssProperties||(this.cssProperties={}),this.cssProperties[t]=a)}setTop(t){Number.isFinite(t)&&Math.abs(t)>.01&&(this.cssProperties||(this.cssProperties={}),this.cssProperties.top=pl(t,"em"),this.height-=t,this.depth+=t)}get left(){var t;return(t=this.cssProperties)!=null&&t["margin-left"]?Number.parseFloat(this.cssProperties["margin-left"]):0}set left(t){Number.isFinite(t)&&(t===0?this.cssProperties&&delete this.cssProperties["margin-left"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-left"]=pl(t,"em")))}set right(t){Number.isFinite(t)&&(t===0?this.cssProperties&&delete this.cssProperties["margin-right"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-right"]=pl(t,"em")))}set bottom(t){Number.isFinite(t)&&(t===0?this.cssProperties&&delete this.cssProperties["margin-bottom"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-bottom"]=pl(t,"em")))}get width(){return this._width*this.scale}set width(t){this._width=t,this.hasExplicitWidth=!0}set softWidth(t){}get height(){return this._height*this.scale}set height(t){this._height=t}get depth(){return this._depth*this.scale}set depth(t){this._depth=t}wrap(t){const r=t.parent;if(!r)return this;t.isPhantom&&this.setStyle("opacity",0);const n=t.color;n&&n!==r.color&&this.setStyle("color",n);let a=t.backgroundColor;this.isSelected&&(a=x(a)),a&&a!==r.backgroundColor&&(this.setStyle("background-color",a),this.setStyle("display","inline-block"));const o=t.scalingFactor;return this.scale=o,this.skew*=o,this.italic*=o,this}toMarkup(){var t,r,n,a;let o=(t=this.value)!=null?t:"";if(this.children)for(const he of this.children)o+=he.toMarkup();let _="";if(this.svgBody)_=c0(this.svgBody);else if(this.svgOverlay){_='<span style="',_+="display: inline-block;",_+=`height:${Math.floor(100*(this.height+this.depth))/100}em;`,_+=`vertical-align:${Math.floor(100*this.depth)/100}em;`,_+='">',_+=o,_+="</span>",_+='<svg style="position:absolute;overflow:visible;',_+=`height:${Math.floor(100*(this.height+this.depth))/100}em;`;const he=(r=this.cssProperties)==null?void 0:r.padding;he?(_+=`top:${he};`,_+=`left:${he};`,_+=`width:calc(100% - 2 * ${he} );`):_+="top:0;left:0;width:100%;",_+="z-index:2;",_+='"',this.svgStyle&&(_+=this.svgStyle),_+=` viewBox="0 0 ${Math.floor(100*this.width)/100} ${Math.floor(100*(this.height+this.depth))/100}"`,_+=`>${this.svgOverlay}</svg>`}let N="";const z=this.classes.split(" ");z.push((n={latex:"ML__raw-latex",placeholder:"ML__placeholder",error:"ML__error"}[this.type])!=null?n:""),this.caret==="latex"&&z.push("ML__latex-caret"),this.isSelected&&z.push("ML__selected");const W=z.length===1?z[0]:z.filter((he,_e,Ue)=>he.length>0&&Ue.indexOf(he)===_e).join(" ");if(W.length>0&&(N+=` class="${W}"`),this.id&&(N+=` data-atom-id=${this.id}`),this.cssId&&(N+=` id="${this.cssId.replace(/ /g,"-")}" `),this.attributes&&(N+=" "+Object.keys(this.attributes).map(he=>`${he}="${this.attributes[he]}"`).join(" ")),this.htmlData){const he=this.htmlData.split(",");for(const _e of he){const Ue=_e.match(/([^=]+)=(.+$)/);if(Ue){const yt=Ue[1].trim().replace(/ /g,"-");yt&&(N+=` data-${yt}="${Ue[2]}" `)}else{const yt=_e.trim().replace(/ /g,"-");yt&&(N+=` data-${yt} `)}}}const j=(a=this.cssProperties)!=null?a:{};this.hasExplicitWidth&&j.width===void 0&&(j.width=`${Math.ceil(this._width*100)/100}em`);const X=Object.keys(j).map(he=>`${he}:${j[he]}`);if(this.scale!==void 0&&this.scale!==1&&(o.length>0||_.length>0)&&X.push(`font-size: ${Math.ceil(this.scale*1e4)/100}%`),this.htmlStyle){const he=this.htmlStyle.split(";");let _e="";for(const Ue of he){const yt=Ue.match(/([^=]+):(.+$)/);if(yt){const Be=yt[1].trim().replace(/ /g,"-");Be&&(_e+=`${Be}:${yt[2]};`)}}_e&&(N+=` style="${_e}"`)}X.length>0&&(N+=` style="${X.join(";")}"`);let ae="";return N.length>0||_.length>0?ae=`<span${N}>${o}${_}</span>`:ae=o,this.caret==="text"?ae+='<span class="ML__text-caret"></span>':this.caret==="math"&&(ae+='<span class="ML__caret"></span>'),ae}tryCoalesceWith(t){if(this.svgBody||!this.value||t.svgBody||!t.value)return!1;const r=this.children&&this.children.length>0,n=t.children&&t.children.length>0;if(r||n)return!1;if(t.cssProperties||this.cssProperties){for(const z of["border","border-left","border-right","border-right-width","left","margin","margin-left","margin-right","padding","position","width"])if(t.cssProperties&&z in t.cssProperties||this.cssProperties&&z in this.cssProperties)return!1}const a=this.cssProperties?Object.keys(this.cssProperties).length:0,o=t.cssProperties?Object.keys(t.cssProperties).length:0;if(a!==o)return!1;if(a>0){for(const z of Object.keys(this.cssProperties))if(this.cssProperties[z]!==t.cssProperties[z])return!1}const _=this.classes.trim().replace(/\s+/g," ").split(" "),N=t.classes.trim().replace(/\s+/g," ").split(" ");if(_.length!==N.length)return!1;_.sort(),N.sort();for(const[z,W]of _.entries())if(W==="vertical-separator"||W!==N[z])return!1;return this.value+=t.value,this.height=Math.max(this.height,t.height),this.depth=Math.max(this.depth,t.depth),this._width=this._width+t._width,this.maxFontSize=Math.max(this.maxFontSize,t.maxFontSize),this.italic=t.italic,!0}};function cc(e){if(!e||e.length===0)return[];e[0].children=cc(e[0].children);const t=[e[0]];for(let r=1;r<e.length;r++)t[t.length-1].tryCoalesceWith(e[r])||(e[r].children=cc(e[r].children),t.push(e[r]));return t}function au(e){return e.children&&(e.children=cc(e.children)),e}function su(e,t){if(!e)return new St(null,t);const r=new St(null,{classes:"ML__strut",type:"ignore"});r.setStyle("height",Math.max(0,e.height),"em");const n=[r];if(e.depth!==0){const a=new St(null,{classes:"ML__strut--bottom",type:"ignore"});a.setStyle("height",e.height+e.depth,"em"),a.setStyle("vertical-align",-e.depth,"em"),n.push(a)}return n.push(e),new St(n,i(F({},t),{type:"lift"}))}function ou(e){const t=f0(e)/2,r=new St(null,{maxFontSize:0});return r.height=t+.166,r.depth=t-.166,r.svgBody=e,r}function y0(e,t){var r;if(e.type==="latex"){e.height=.9,e.depth=.2,e._width=1;return}if(e.value){e.height=-1/0,e.depth=-1/0,e._width=0,e.skew=-1/0,e.italic=-1/0;for(let n=0;n<e.value.length;n++){const a=zo(e.value.codePointAt(n),t);e.height=Math.max(e.height,a.height),e.depth=Math.max(e.depth,a.depth),e._width+=a.width,e.skew=a.skew,e.italic=a.italic}return}if(e.children&&e.children.length>0){let n=-1/0,a=-1/0,o=0;for(const _ of e.children)_.height>n&&(n=_.height),_.depth>a&&(a=_.depth),o=Math.max(o,(r=_.maxFontSize)!=null?r:0);e.height=n,e.depth=a,e._width=e.children.reduce((_,N)=>_+N.width,0),e.maxFontSize=o}}function b0(e){if("individualShift"in e){const t=e.individualShift;let r=t[0];const n=[r],a=-r.shift-r.box.depth;let o=a;for(let _=1;_<t.length;_++){const N=t[_],z=-N.shift-o-N.box.depth,W=z-(r.box.height+r.box.depth);o=o+z,n.push(W),n.push(N),r=N}return[n,a]}if("top"in e){let t=e.top;for(const r of e.children)t-=typeof r=="number"?r:r.box.height+r.box.depth;return[e.children,t]}else{if("bottom"in e)return[e.children,-e.bottom];if("firstBaseline"in e){const t=e.firstBaseline[0];if(typeof t=="number")throw new Error("First child must be an element.");return[e.firstBaseline,-t.box.depth]}else if("shift"in e){const t=e.children[0];if(typeof t=="number")throw new Error("First child must be an element.");return[e.children,-t.box.depth-e.shift]}}return[null,0]}function x0(e){var t;const[r,n]=b0(e);if(!r)return[[],0,0];const a=new St(null,{classes:"pstrut"});let o=0;for(const _e of r)if(typeof _e!="number"){const Ue=_e.box;o=Math.max(o,Ue.maxFontSize,Ue.height)}o+=2,a.height=o,a.setStyle("height",o,"em");const _=[];let N=n,z=n,W=n,j=0;for(const _e of r){if(typeof _e=="number")W+=_e;else{const Ue=_e.box,yt=(t=_e.classes)!=null?t:[],Be=new St([a,Ue],{classes:yt.join(" "),style:_e.style});Ue.setStyle("height",Ue.height+Ue.depth,"em"),Ue.setStyle("display","inline-block"),Be.setStyle("top",-o-W-Ue.depth,"em"),_e.marginLeft&&Be.setStyle("margin-left",_e.marginLeft,"em"),_e.marginRight&&Be.setStyle("margin-right",_e.marginRight,"em"),_.push(Be),W+=Ue.height+Ue.depth,j=Math.max(j,Be.width)}N=Math.min(N,W),z=Math.max(z,W)}_.forEach(_e=>{_e.softWidth=j});const X=new St(_,{classes:"vlist"});if(X.softWidth=j,X.height=z,X.setStyle("height",z,"em"),N>=0)return[[new St(X,{classes:"vlist-r"})],z,-N];const ae=new St(new St(null),{classes:"vlist"});ae.height=-N,ae.setStyle("height",-N,"em");const he=new St(8203,{classes:"vlist-s",maxFontSize:0});return he.softWidth=0,he.height=0,he.depth=0,[[new St([X,he],{classes:"vlist-r"}),new St(ae,{classes:"vlist-r"})],z,-N]}var Ai=class extends St{constructor(e,t){var r;const[n,a,o]=x0(e);super(n.length===1?n[0]:n,{type:t==null?void 0:t.type,classes:((r=t==null?void 0:t.classes)!=null?r:"")+" vlist-t"+(n.length===2?" vlist-t2":"")}),this.height=a,this.depth=o,this.softWidth=n.reduce((_,N)=>Math.max(_,N.width),0)}};function E0(e,t){var r,n,a,o,_;const N=e.metrics,z=new St(t.base),W=(r=t.baseShift)!=null?r:0,j=(n=t.slant)!=null?n:0;let X=0,ae=0;t.above&&(X=(a=t.aboveShift)!=null?a:Math.max(N.bigOpSpacing1,N.bigOpSpacing3-t.above.depth)),t.below&&(ae=(o=t.belowShift)!=null?o:Math.max(N.bigOpSpacing2,N.bigOpSpacing4-t.below.height));let he=null;if(t.below&&t.above){const _e=N.bigOpSpacing5+t.below.height+t.below.depth+ae+z.depth+W;he=new Ai({bottom:_e,children:[N.bigOpSpacing5,{box:t.below,marginLeft:-j,classes:["ML__center"]},ae,{box:z,classes:["ML__center"]},X,{box:t.above,marginLeft:j,classes:["ML__center"]},N.bigOpSpacing5]}).wrap(e)}else if(t.below&&!t.above)he=new Ai({top:z.height-W,children:[N.bigOpSpacing5,{box:t.below,marginLeft:-j,classes:["ML__center"]},ae,{box:z,classes:["ML__center"]}]}).wrap(e);else if(!t.below&&t.above){const _e=z.depth+W;he=new Ai({bottom:_e,children:[{box:z,classes:["ML__center"]},X,{box:t.above,marginLeft:j,classes:["ML__center"]},N.bigOpSpacing5]}).wrap(e)}else{const _e=z.depth+W;he=new Ai({bottom:_e,children:[{box:z},N.bigOpSpacing5]}).wrap(e)}return new St(he,{type:(_=t.type)!=null?_:"op"})}var fc=7,lu=6,uu=5,lo=4,$o=3,ka=2,uo=1,ra=0,zs=class{constructor(e,t,r){this.id=e,this.sizeDelta=t,this.cramped=r;const n={"-4":2,"-3":1,0:0}[t];this.metrics=Object.keys(wf).reduce((a,o)=>i(F({},a),{[o]:wf[o][n]}),{})}getFontSize(e){return Math.max(1,e+this.sizeDelta)}get sup(){return fs[[ra,uo,ra,uo,ka,$o,ka,$o][this.id]]}get sub(){return fs[[ra,ra,ra,ra,ka,ka,ka,ka][this.id]]}get fracNum(){return fs[[ra,uo,ra,uo,ka,$o,lo,uu][this.id]]}get fracDen(){return fs[[ra,ra,ra,ra,ka,ka,lo,lo][this.id]]}get cramp(){return fs[[ra,ra,ka,ka,lo,lo,lu,lu][this.id]]}get isTight(){return this.sizeDelta<0}},ml={7:new zs(fc,0,!1),6:new zs(lu,0,!0),5:new zs(uu,0,!1),4:new zs(lo,0,!0),3:new zs($o,-3,!1),2:new zs(ka,-3,!0),1:new zs(uo,-4,!1),0:new zs(ra,-4,!0)},fs=i(F({},ml),{displaystyle:ml[fc],textstyle:ml[uu],scriptstyle:ml[$o],scriptscriptstyle:ml[uo]});function Rf(e,t){var r;if(!e)return 0;const n={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:3/4,em:Uo,bp:803/800,dd:1238/1157,pc:12,in:72.27,mu:10/18}[(r=e.unit)!=null?r:"pt"];if(Number.isFinite(t)){const a=Ss(10,t);return Math.round(e.dimension/Uo*n*a)/a}return e.dimension*n}function Pf(e,t){if(e===null)return 0;const r=Rf(e)/Uo;if(Number.isFinite(t)){const n=Ss(10,t);return Math.round(r*n)/n}return r}function hc(e){var t;return`${e.dimension}${(t=e.unit)!=null?t:"pt"}`}function w0(e){let t=hc(e.glue);return e.grow&&e.grow.dimension!==0&&(t+=` plus ${hc(e.grow)}`),e.shrink&&e.shrink.dimension!==0&&(t+=` minus ${hc(e.shrink)}`),t}function Wi(e){var t,r;if(e==null)return null;let n="";if("dimension"in e&&(n=`${e.dimension}${(t=e.unit)!=null?t:"pt"}`),"glue"in e&&(n=w0(e)),"number"in e)if(!("base"in e)||e.base==="decimal")n=Number(e.number).toString();else if(e.base==="alpha")n=`\`${String.fromCodePoint(e.number)}`;else{const a=Math.round(e.number)>>>0;e.base==="hexadecimal"?(n=Number(a).toString(16).toUpperCase(),a<=255?n=n.padStart(2,"0"):a<=65535?n=n.padStart(4,"0"):a<=16777215?n=n.padStart(6,"0"):n=n.padStart(8,"0"),n=`"${n}`):e.base==="octal"&&(n=Number(a).toString(8),a<=63?n=n.padStart(2,"0"):a<=30583?n=n.padStart(4,"0"):n=n.padStart(8,"0"),n=`'${n}`)}return"register"in e&&("factor"in e&&(e.factor===-1?n="-":e.factor!==1&&(n=Number(e.factor).toString())),"global"in e&&e.global&&(n+="\\global"),n+=`\\${e.register}`),"string"in e&&(n=e.string),(r=e.relax)!=null&&r&&(n+="\\relax"),n}function hs(e,t){return e==null?null:"number"in e?i(F({},e),{number:e.number*t}):"register"in e?"factor"in e&&e.factor?i(F({},e),{factor:e.factor*t}):i(F({},e),{factor:t}):"dimension"in e?i(F({},e),{dimension:e.dimension*t}):"glue"in e?e.shrink&&e.grow?{glue:hs(e.glue,t),shrink:hs(e.shrink,t),grow:hs(e.grow,t)}:e.shrink?{glue:hs(e.glue,t),shrink:hs(e.shrink,t)}:e.grow?{glue:hs(e.glue,t),grow:hs(e.grow,t)}:{glue:hs(e.glue,t)}:null}var S0={"p@":{dimension:1},"z@":{dimension:0},maxdimen:{dimension:16383.99999},hfuzz:{dimension:.1},vfuzz:{dimension:.1},overfullrule:{dimension:5},hsize:{dimension:6.5,unit:"in"},vsize:{dimension:8.9,unit:"in"},parindent:{dimension:20},maxdepth:{dimension:4},splitmaxdepth:{register:"maxdimen"},boxmaxdepth:{register:"maxdimen"},delimitershortfall:{dimension:5},nulldelimiterspace:{dimension:1.2,unit:"pt"},scriptspace:{dimension:.5},topskip:{dimension:10},splittopskip:{dimension:10},normalbaselineskip:{dimension:12},normallineskip:{dimension:1},normallineskiplimit:{dimension:0},jot:{dimension:3},doublerulesep:{dimension:2},arrayrulewidth:{dimension:.4},arraycolsep:{dimension:5},fboxsep:{dimension:3},fboxrule:{dimension:.4},"z@skip":{glue:{dimension:0},shrink:{dimension:0},grow:{dimension:0}},hideskip:{glue:{dimension:-1e3},grow:{dimension:1,unit:"fill"}},"@flushglue":{glue:{dimension:0},grow:{dimension:1,unit:"fill"}},parskip:{glue:{dimension:0},grow:{dimension:1}},abovedisplayskip:{glue:{dimension:12},grow:{dimension:3},shrink:{dimension:9}},abovedisplayshortskip:{glue:{dimension:0},grow:{dimension:3}},belowdisplayskip:{glue:{dimension:12},grow:{dimension:3},shrink:{dimension:9}},belowdisplayshortskip:{glue:{dimension:7},grow:{dimension:3},shrink:{dimension:4}},parfillskip:{glue:{dimension:0},grow:{dimension:1,unit:"fil"}},thinmuskip:{glue:{dimension:3,unit:"mu"}},medmuskip:{glue:{dimension:4,unit:"mu"},grow:{dimension:2,unit:"mu"},shrink:{dimension:4,unit:"mu"}},thickmuskip:{glue:{dimension:5,unit:"mu"},grow:{dimension:5,unit:"mu"}},smallskipamount:{glue:{dimension:3},grow:{dimension:1},shrink:{dimension:1}},medskipamount:{glue:{dimension:6},grow:{dimension:2},shrink:{dimension:3}},bigskipamount:{glue:{dimension:12},grow:{dimension:2},shrink:{dimension:4}},pretolerance:100,tolerance:200,hbadness:1e3,vbadness:1e3,linepenalty:10,hyphenpenalty:50,exhyphenpenalty:50,binoppenalty:700,relpenalty:500,clubpenalty:150,widowpenalty:150,displaywidowpenalty:50,brokenpenalty:100,predisplaypenalty:1e4,doublehyphendemerits:1e4,finalhyphendemerits:5e3,adjdemerits:1e4,tracinglostchars:1,uchyph:1,delimiterfactor:901,defaulthyphenchar:"\\-",defaultskewchar:-1,newlinechar:-1,showboxbreadth:5,showboxdepth:3,errorcontextlines:5,interdisplaylinepenalty:100,interfootnotelinepenalty:100,baselineSkip:1.2,arraystretch:1,month:new Date().getMonth()+1,day:new Date().getDate(),year:new Date().getFullYear()};function If(){return F({},S0)}function dc(){return{registers:If(),smartFence:!1,renderPlaceholder:void 0,placeholderSymbol:"\u25A2",letterShapeStyle:f.locale.startsWith("fr")?"french":"tex",minFontScale:0,colorMap:C,backgroundColorMap:P,getMacro:e=>pt(e,$t())}}var Qr=class Ad{constructor(t,r){var n,a,o,_,N,z,W,j,X,ae,he,_e,Ue,yt,Be;let nt;t!=null&&t.parent?(this.parent=t.parent,nt=t.parent,this.registers={}):(nt=F(F({},dc()),(n=t==null?void 0:t.from)!=null?n:{}),this.registers=nt.registers),nt.atomIdsSettings&&(this.atomIdsSettings=F({},nt.atomIdsSettings)),this.renderPlaceholder=nt.renderPlaceholder,this.isPhantom=(_=(o=t==null?void 0:t.isPhantom)!=null?o:(a=this.parent)==null?void 0:a.isPhantom)!=null?_:!1,this.letterShapeStyle=nt.letterShapeStyle,this.minFontScale=nt.minFontScale,r!=null&&r.color&&r.color!=="none"?this.color=r.color:this.color=(z=(N=this.parent)==null?void 0:N.color)!=null?z:"",r!=null&&r.backgroundColor&&r.backgroundColor!=="none"?this.backgroundColor=r.backgroundColor:this.backgroundColor=(j=(W=this.parent)==null?void 0:W.backgroundColor)!=null?j:"",r!=null&&r.fontSize&&r.fontSize!=="auto"&&r.fontSize!==((X=this.parent)==null?void 0:X.size)?this.size=r.fontSize:this.size=(he=(ae=this.parent)==null?void 0:ae.size)!=null?he:sc;let wt=(Ue=(_e=this.parent)==null?void 0:_e.mathstyle)!=null?Ue:fs.displaystyle;if(typeof(t==null?void 0:t.mathstyle)=="string"){if(nt instanceof Ad)switch(t.mathstyle){case"cramp":wt=wt.cramp;break;case"superscript":wt=wt.sup;break;case"subscript":wt=wt.sub;break;case"numerator":wt=wt.fracNum;break;case"denominator":wt=wt.fracDen;break}switch(t.mathstyle){case"textstyle":wt=fs.textstyle;break;case"displaystyle":wt=fs.displaystyle;break;case"scriptstyle":wt=fs.scriptstyle;break;case"scriptscriptstyle":wt=fs.scriptscriptstyle;break;case"":case"auto":break}}this.mathstyle=wt,this.smartFence=nt.smartFence,this.placeholderSymbol=nt.placeholderSymbol,this.colorMap=(yt=nt.colorMap)!=null?yt:st=>st,this.backgroundColorMap=(Be=nt.backgroundColorMap)!=null?Be:st=>st,this.getMacro=nt.getMacro,console.assert(this.parent!==void 0||this.registers!==void 0)}makeID(){if(!this.atomIdsSettings)return;if(this.atomIdsSettings.overrideID)return this.atomIdsSettings.overrideID;if(typeof this.atomIdsSettings.seed!="number")return`${Date.now().toString(36).slice(-2)}${Math.floor(Math.random()*1e5).toString(36)}`;const t=this.atomIdsSettings.seed.toString(36);return this.atomIdsSettings.seed+=1,t}scale(t){return t*this.effectiveFontSize}get scalingFactor(){return this.parent?this.effectiveFontSize/this.parent.effectiveFontSize:1}get isDisplayStyle(){return this.mathstyle.id===fc||this.mathstyle.id===lu}get isCramped(){return this.mathstyle.cramped}get isTight(){return this.mathstyle.isTight}get metrics(){return this.mathstyle.metrics}get effectiveFontSize(){return Math.max(ac[Math.max(1,this.size+this.mathstyle.sizeDelta)],this.minFontScale)}getRegister(t){var r;if((r=this.registers)!=null&&r[t])return this.registers[t];if(this.parent)return this.parent.getRegister(t)}getRegisterAsNumber(t){const r=this.getRegister(t);if(typeof r=="number")return r;if(typeof r=="string")return Number(r)}getRegisterAsGlue(t){var r;if((r=this.registers)!=null&&r[t]){const n=this.registers[t];return typeof n=="object"&&"glue"in n?n:typeof n=="object"&&"dimension"in n?{glue:{dimension:n.dimension}}:typeof n=="number"?{glue:{dimension:n}}:void 0}if(this.parent)return this.parent.getRegisterAsGlue(t)}getRegisterAsEm(t,r){return Pf(this.getRegisterAsDimension(t),r)}getRegisterAsDimension(t){var r;if((r=this.registers)!=null&&r[t]){const n=this.registers[t];return typeof n=="object"&&"glue"in n?n.glue:typeof n=="object"&&"dimension"in n?n:typeof n=="number"?{dimension:n}:void 0}if(this.parent)return this.parent.getRegisterAsDimension(t)}setRegister(t,r){if(r===void 0){delete this.registers[t];return}this.registers[t]=r}evaluate(t){if(!t||!("register"in t))return t;let r=this;if("global"in t&&t.global)for(;r.parent;)r=r.parent;let n=1;"factor"in t&&t.factor!==1&&t.factor!==void 0&&(n=t.factor);const a=r.getRegister(t.register);if(a===void 0)return;if(typeof a=="string")return{string:Number(a).toString()+a};if(typeof a=="number")return{number:n*a};const o=r.evaluate(a);if(o!==void 0)return"string"in o?{string:Number(a).toString()+o.string}:"number"in o?{number:n*o.number}:"dimension"in o?i(F({},o),{dimension:n*o.dimension}):"glue"in o?i(F({},o),{glue:i(F({},o.glue),{dimension:n*o.glue.dimension}),shrink:o.shrink?i(F({},o.shrink),{dimension:n*o.shrink.dimension}):void 0,grow:o.grow?i(F({},o.grow),{dimension:n*o.grow.dimension}):void 0}):t}toDimension(t){const r=this.evaluate(t);return r===void 0?null:"dimension"in r?r:"glue"in r?r.glue:"number"in r?{dimension:r.number}:null}toEm(t,r){if(t===null)return 0;const n=this.toDimension(t);return n===null?0:Rf(n,r)/Uo}toNumber(t){if(t===null)return null;const r=this.evaluate(t);return r===void 0?null:"number"in r?r.number:"dimension"in r?r.dimension:"glue"in r?r.glue.dimension:"string"in r?Number(r.string):null}toColor(t){var r,n;if(t===null)return null;const a=this.evaluate(t);return a===void 0?null:"string"in a?(n=(r=this.colorMap)==null?void 0:r.call(this,a.string))!=null?n:a.string:null}toBackgroundColor(t){var r,n;if(t===null)return null;const a=this.evaluate(t);return a===void 0?null:"string"in a?(n=(r=this.backgroundColorMap)==null?void 0:r.call(this,a.string))!=null?n:a.string:null}},Wo=["body","above","below","superscript","subscript"];function co(e){return typeof e=="string"&&Wo.includes(e)}function cu(e){return e!==void 0&&Array.isArray(e)&&e.length===2}var Qe=class Is{constructor(t){var r,n,a,o,_,N;this.type=t.type,typeof t.value=="string"&&(this.value=t.value),this.command=(n=(r=t.command)!=null?r:this.value)!=null?n:"",this.mode=(a=t.mode)!=null?a:"math",t.isFunction&&(this.isFunction=!0),t.limits&&(this.subsupPlacement=t.limits),this.style=F({},t.style),this.displayContainsHighlight=(o=t.displayContainsHighlight)!=null?o:!1,this.captureSelection=(_=t.captureSelection)!=null?_:!1,this.skipBoundary=(N=t.skipBoundary)!=null?N:!1,t.verbatimLatex!==void 0&&t.verbatimLatex!==null&&(this.verbatimLatex=t.verbatimLatex),t.args&&(this.args=t.args),t.body&&(this.body=t.body),this._changeCounter=0}static createBox(t,r,n){var a;if(!r)return null;const o=M0(r),_=[];for(const z of o){const W=z[0].style,j=T0(t,z,{style:{color:W.color,backgroundColor:W.backgroundColor,fontSize:W.fontSize}});j&&_.push(j)}if(_.length===0)return null;const N=((a=n==null?void 0:n.classes)!=null?a:"").trim();return _.length===1&&!N&&!(n!=null&&n.type)?_[0].wrap(t):new St(_,{classes:N,type:n==null?void 0:n.type}).wrap(t)}static serialize(t,r){return Aa.serialize(t,r)}static commonAncestor(t,r){if(t===r||t.parent===r.parent)return t.parent;const n=new WeakSet;let{parent:a}=t;for(;a;)n.add(a),a=a.parent;for(a=r.parent;a;){if(n.has(a))return a;a=a.parent}console.assert(!!a)}static fromJson(t){return typeof t=="string"?new Is({type:"mord",value:t,mode:"math"}):new Is(t)}get latexMode(){return this.mode==="math"?"math":"text"}toJson(){const t={};if(this.type&&(t.type=this.type),this.mode!=="math"&&(t.mode=this.mode),this.command&&this.command!==this.value&&(t.command=this.command),this.value!==void 0&&(t.value=this.value),this.style&&Object.keys(this.style).length>0&&(t.style=F({},this.style)),this.verbatimLatex!==void 0&&(t.verbatimLatex=this.verbatimLatex),this.subsupPlacement&&(t.subsupPlacement=this.subsupPlacement),this.explicitSubsupPlacement&&(t.explicitSubsupPlacement=!0),this.isFunction&&(t.isFunction=!0),this.displayContainsHighlight&&(t.displayContainsHighlight=!0),this.isExtensibleSymbol&&(t.isExtensibleSymbol=!0),this.skipBoundary&&(t.skipBoundary=!0),this.captureSelection&&(t.captureSelection=!0),this.args&&(t.args=D0(this.args)),this._branches)for(const r of Object.keys(this._branches))this._branches[r]&&(t[r]=this._branches[r].filter(n=>n.type!=="first").map(n=>n.toJson()));return t.type==="mord"&&Object.keys(t).length===2&&"value"in t?t.value:t}get changeCounter(){return this.parent?this.parent.changeCounter:this._changeCounter}set isDirty(t){if(t){this.parent||this._changeCounter++,"verbatimLatex"in this&&(this.verbatimLatex=void 0),this._children=void 0;let{parent:r}=this;for(;r;)r.parent||r._changeCounter++,"verbatimLatex"in r&&(r.verbatimLatex=void 0),r._children=void 0,r=r.parent}}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const r=Je(this.command,this.mode);return r!=null&&r.serialize?r.serialize(this,t):this.body&&this.command?Jr([qn(this.command,this.bodyToLatex(t)),this.supsubToLatex(t)]):this.body?Jr([this.bodyToLatex(t),this.supsubToLatex(t)]):!this.value||this.value==="\u200B"?"":this.command}bodyToLatex(t){var r;return Aa.serialize(this.body,i(F({},t),{defaultMode:(r=t.defaultMode)!=null?r:this.latexMode}))}aboveToLatex(t){return Aa.serialize(this.above,t)}belowToLatex(t){return Aa.serialize(this.below,t)}supsubToLatex(t){let r="";if(t=i(F({},t),{defaultMode:"math"}),this.branch("subscript")!==void 0){const n=Aa.serialize(this.subscript,t);n.length===0?r+="_{}":n.length===1?/^[0-9]$/.test(n)?r+=`_${n}`:r+=`_{${n}}`:r+=`_{${n}}`}if(this.branch("superscript")!==void 0){const n=Aa.serialize(this.superscript,t);n.length===0?r+="^{}":n.length===1?n==="\u2032"?r+="^\\prime ":n==="\u2033"?r+="^\\doubleprime ":/^[0-9]$/.test(n)?r+=`^${n}`:r+=`^{${n}}`:r+=`^{${n}}`}return r}get treeDepth(){let t=1,r=this.parent;for(;r;)r=r.parent,t+=1;return t}get inCaptureSelection(){let t=this;for(;t;){if(t.captureSelection)return!0;t=t.parent}return!1}get parentPrompt(){let t=this.parent;for(;t;){if(t.type==="prompt"&&!t.captureSelection)return t;t=t.parent}return null}branch(t){if(co(t)&&this._branches)return this._branches[t]}get branches(){if(!this._branches)return[];const t=[];for(const r of Wo)this._branches[r]&&t.push(r);return t}createBranch(t){return console.assert(co(t)),co(t)?(this._branches?this._branches[t]||(this._branches[t]=[this.makeFirstAtom(t)]):this._branches={[t]:[this.makeFirstAtom(t)]},this.isDirty=!0,this._branches[t]):[]}get row(){return cu(this.parentBranch)?this.parentBranch[0]:-1}get col(){return cu(this.parentBranch)?this.parentBranch[1]:-1}get body(){var t;return(t=this._branches)==null?void 0:t.body}set body(t){this.setChildren(t,"body")}get superscript(){var t;return(t=this._branches)==null?void 0:t.superscript}set superscript(t){this.setChildren(t,"superscript")}get subscript(){var t;return(t=this._branches)==null?void 0:t.subscript}set subscript(t){this.setChildren(t,"subscript")}get above(){var t;return(t=this._branches)==null?void 0:t.above}set above(t){this.setChildren(t,"above")}get below(){var t;return(t=this._branches)==null?void 0:t.below}set below(t){this.setChildren(t,"below")}get computedStyle(){var t,r;const n=typeof this.style.verbatimColor=="string",a=typeof this.style.verbatimBackgroundColor=="string",o=F(F({},(r=(t=this.parent)==null?void 0:t.computedStyle)!=null?r:{}),this.style);return delete o.variant,delete o.variantStyle,a||delete o.verbatimBackgroundColor,n||delete o.verbatimColor,o}applyStyle(t){this.isDirty=!0,this.style=F(F({},this.style),t),this.style.fontFamily==="none"&&delete this.style.fontFamily,this.style.fontShape==="auto"&&delete this.style.fontShape,this.style.fontSeries==="auto"&&delete this.style.fontSeries,this.style.color==="none"&&(delete this.style.color,delete this.style.verbatimColor),this.style.backgroundColor==="none"&&(delete this.style.backgroundColor,delete this.style.verbatimBackgroundColor),this.style.fontSize==="auto"&&delete this.style.fontSize;for(const r of this.children)r.applyStyle(t)}getInitialBaseElement(){var t,r,n;return this.hasEmptyBranch("body")?this:(console.assert(((t=this.body)==null?void 0:t[0].type)==="first"),(n=(r=this.body[1])==null?void 0:r.getInitialBaseElement())!=null?n:this)}getFinalBaseElement(){return this.hasEmptyBranch("body")?this:this.body[this.body.length-1].getFinalBaseElement()}isCharacterBox(){return this.type==="leftright"||this.type==="genfrac"||this.type==="subsup"||this.type==="delim"||this.type==="array"||this.type==="surd"?!1:this.getFinalBaseElement().type==="mord"}hasEmptyBranch(t){const r=this.branch(t);return r?(console.assert(r.length>0),console.assert(r[0].type==="first"),r.length===1):!0}setChildren(t,r){var n;if(!t||(console.assert(co(r)),!co(r)))return;console.assert(((n=t[0])==null?void 0:n.type)!=="first");const a=[this.makeFirstAtom(r),...t];this._branches?this._branches[r]=a:this._branches={[r]:a};for(const o of t)o.parent=this,o.parentBranch=r;this.isDirty=!0}makeFirstAtom(t){const r=new Is({type:"first",mode:this.mode});return r.parent=this,r.parentBranch=t,r}addChild(t,r){console.assert(t.type!=="first"),this.createBranch(r).push(t),this.isDirty=!0,t.parent=this,t.parentBranch=r}addChildBefore(t,r){console.assert(r.parentBranch!==void 0);const n=this.createBranch(r.parentBranch);n.splice(n.indexOf(r),0,t),this.isDirty=!0,t.parent=this,t.parentBranch=r.parentBranch}addChildAfter(t,r){console.assert(r.parentBranch!==void 0);const n=this.createBranch(r.parentBranch);n.splice(n.indexOf(r)+1,0,t),this.isDirty=!0,t.parent=this,t.parentBranch=r.parentBranch}addChildren(t,r){const n=this.createBranch(r);for(const a of t)a.parent=this,a.parentBranch=r,n.push(a);this.isDirty=!0}addChildrenAfter(t,r){console.assert(t.length===0||t[0].type!=="first"),console.assert(r.parentBranch!==void 0);const n=this.createBranch(r.parentBranch);n.splice(n.indexOf(r)+1,0,...t),this.isDirty=!0;for(const a of t)a.parent=this,a.parentBranch=r.parentBranch;return t[t.length-1]}removeBranch(t){const r=this.branch(t);if(co(t)&&(this._branches[t]=void 0),!r)return[];for(const n of r)n.parent=void 0,n.parentBranch=void 0;return console.assert(r[0].type==="first"),r.shift(),this.isDirty=!0,r}removeChild(t){if(console.assert(t.parent===this),t.type==="first")return;const r=this.branch(t.parentBranch),n=r.indexOf(t);console.assert(n>=0),r.splice(n,1),this.isDirty=!0,t.parent=void 0,t.parentBranch=void 0}get siblings(){return this.parent?this.parent.branch(this.parentBranch):[]}get firstSibling(){return this.siblings[0]}get lastSibling(){const{siblings:t}=this;return t[t.length-1]}get isFirstSibling(){return this===this.firstSibling}get isLastSibling(){return this===this.lastSibling}get hasNoSiblings(){return this.siblings.length===1}get leftSibling(){console.assert(this.parent!==void 0);const t=this.parent.branch(this.parentBranch);return t[t.indexOf(this)-1]}get rightSibling(){console.assert(this.parent!==void 0);const t=this.parent.branch(this.parentBranch);return t[t.indexOf(this)+1]}get hasChildren(){return!!(this._branches&&this.children.length>0)}get firstChild(){return console.assert(this.hasChildren),this.children[0]}get lastChild(){console.assert(this.hasChildren);const{children:t}=this;return t[t.length-1]}get children(){if(this._children)return this._children;if(!this._branches)return[];const t=[];for(const r of Wo)if(this._branches[r])for(const n of this._branches[r])t.push(...n.children),t.push(n);return this._children=t,t}render(t){if(this.type==="first"&&!t.atomIdsSettings)return null;const r=Je(this.command,this.mode);if(r!=null&&r.render)return r.render(this,t);const n=new Qr({parent:t},this.style);let a=this.createBox(n,{classes:this.parent?"":"ML__base"});return a?(!this.subsupPlacement&&(this.superscript||this.subscript)&&(a=this.attachSupsub(n,{base:a})),a.wrap(n)):null}attachSupsub(t,r){var n;const a=r.base,o=this.superscript,_=this.subscript;if(!o&&!_)return a;let N=null,z=null;const W=(n=r.isCharacterBox)!=null?n:this.isCharacterBox();let j=0;if(o){const Ue=new Qr({parent:t,mathstyle:"superscript"});N=Is.createBox(Ue,o),W||(j=a.height-t.metrics.supDrop*Ue.scalingFactor)}let X=0;if(_){const Ue=new Qr({parent:t,mathstyle:"subscript"});z=Is.createBox(Ue,_),W||(X=a.depth+t.metrics.subDrop*Ue.scalingFactor)}let ae;t.isDisplayStyle?ae=t.metrics.sup1:t.isCramped?ae=t.metrics.sup3:ae=t.metrics.sup2;const he=.5/Uo/t.scalingFactor;let _e=null;if(z&&N){j=Math.max(j,ae,N.depth+.25*t.metrics.xHeight),X=Math.max(X,t.metrics.sub2);const Ue=t.metrics.defaultRuleThickness;if(j-N.depth-(z.height-X)<4*Ue){X=4*Ue-(j-N.depth)+z.height;const Be=.8*t.metrics.xHeight-(j-N.depth);Be>0&&(j+=Be,X-=Be)}const yt=this.isExtensibleSymbol&&a.italic?-a.italic:0;_e=new Ai({individualShift:[{box:z,shift:X,marginLeft:yt},{box:N,shift:-j}]}).wrap(t)}else z&&!N?(X=Math.max(X,t.metrics.sub1,z.height-.8*Ks),_e=new Ai({shift:X,children:[{box:z,marginRight:he,marginLeft:this.isCharacterBox()?-a.italic:0}]})):!z&&N&&(j=Math.max(j,ae,N.depth+.25*Ks),_e=new Ai({shift:-j,children:[{box:N,marginRight:he}]}));return new St([a,new St(_e,{caret:this.caret,isSelected:this.isSelected,classes:"msubsup"})],{type:r.type})}attachLimits(t,r){const n=this.superscript?Is.createBox(new Qr({parent:t,mathstyle:"superscript"},this.style),this.superscript):null,a=this.subscript?Is.createBox(new Qr({parent:t,mathstyle:"subscript"},this.style),this.subscript):null;return!n&&!a?r.base.wrap(t):E0(t,i(F({},r),{above:n,below:a}))}bind(t,r){if(!r||t.isPhantom||this.value==="\u200B")return r;let n=this.parent;for(;n&&!n.captureSelection;)n=n.parent;return n!=null&&n.captureSelection||(this.id||(this.id=t.makeID()),r.atomID=this.id),r}createBox(t,r){var n,a,o,_;const N=(n=this.value)!=null?n:this.body,z=(a=r==null?void 0:r.boxType)!=null?a:uc(this.type);let W=(o=r==null?void 0:r.classes)!=null?o:"";this.mode==="text"&&(W+=" ML__text");const j=typeof N=="string"||N===void 0?new St(N!=null?N:null,{type:z,isSelected:this.isSelected,mode:this.mode,maxFontSize:t.scalingFactor,style:i(F({variant:"normal"},this.style),{fontSize:Math.max(1,t.size+t.mathstyle.sizeDelta)}),letterShapeStyle:t.letterShapeStyle,classes:W}):(_=Is.createBox(t,N,{type:z,classes:W}))!=null?_:new St(null);return t.isTight&&(j.isTight=!0),(this.mode!=="math"||this.style.variant==="main")&&(j.italic=0),j.right=j.italic,this.bind(t,j),this.caret&&!this.superscript&&!this.subscript&&(j.caret=this.caret),j}isDigit(){var t;return this.type==="mord"&&this.value?/^[\d,\.]$/.test(this.value):this.type==="group"&&((t=this.body)==null?void 0:t.length)===2?this.body[0].type==="first"&&this.body[1].value===",":!1}asDigit(){var t;return this.type==="mord"&&this.value&&/^[\d,\.]$/.test(this.value)?this.value:this.type==="group"&&((t=this.body)==null?void 0:t.length)===2&&this.body[0].type==="first"&&this.body[1].value===","?".":""}};function M0(e){let t;const r=[];let n=[];for(const a of e)if(!t&&!a.style)n.push(a);else{const o=a.computedStyle;t&&o.color===t.color&&o.backgroundColor===t.backgroundColor&&o.fontSize===t.fontSize?n.push(a):(n.length>0&&r.push(n),n=[a],t=o)}return n.length>0&&r.push(n),r}function T0(e,t,r){var n,a,o,_,N;if(!t||t.length===0)return null;const z=new Qr({parent:e},r.style),W=!((n=z.atomIdsSettings)!=null&&n.groupNumbers);let j=[];if(t.length===1){const ae=t[0],he=ae.render(z);he&&(W&&ae.isSelected&&he.selected(!0),j=[he])}else{let ae="",he=!0;for(const _e of t){(a=z.atomIdsSettings)!=null&&a.groupNumbers&&ae&&(he&&_e.isDigit()||!he&&pc(_e))&&(z.atomIdsSettings.overrideID=ae);const Ue=_e.render(z);z.atomIdsSettings&&(z.atomIdsSettings.overrideID=void 0),Ue&&((o=z.atomIdsSettings)!=null&&o.groupNumbers&&((_e.isDigit()||pc(_e))&&(!ae||he!==_e.isDigit())&&(he=_e.isDigit(),ae=(_=_e.id)!=null?_:""),ae&&(!(_e.isDigit()||pc(_e))||!_e.hasEmptyBranch("superscript")||!_e.hasEmptyBranch("subscript"))&&(ae="")),W&&_e.isSelected&&Ue.selected(!0),j.push(Ue))}}if(j.length===0)return null;const X=new St(j,i(F({isTight:z.isTight},r),{type:(N=r.type)!=null?N:"lift"}));return X.isSelected=j.every(ae=>ae.isSelected),X.wrap(z)}function pc(e){return e.mode==="text"}function D0(e){return e.map(t=>t===null?"<null>":Array.isArray(t)&&t[0]instanceof Qe?{atoms:t.map(r=>r.toJson())}:typeof t=="object"&&"group"in t?{group:t.group.map(r=>r.toJson())}:t)}var vl=class kd extends Qe{constructor(t,r,n){super({type:"text",command:t,mode:"text",displayContainsHighlight:!0}),this.value=r,this.verbatimLatex=r,this.applyStyle(n)}static fromJson(t){return new kd(t.command,t.value,t.style)}render(t){const r=this.createBox(t);return this.caret&&(r.caret=this.caret),r}_serialize(t){var r;return(r=this.verbatimLatex)!=null?r:je("text",this.value.codePointAt(0))}};function A0(e,t){if(e.direction===t.direction){const r=e.ranges.length;if(t.ranges.length===r){let n=0;for(;n<r&&k0(e.ranges[n],t.ranges[n])==="equal";)n++;return n===r?"equal":"different"}}return"different"}function k0(e,t){return e[0]===t[0]&&e[1]===t[1]?"equal":"different"}function Xi(e){let t=1/0,r=-1/0;for(const n of e.ranges)t=Math.min(t,n[0],n[1]),r=Math.max(r,n[0],n[1]);return[t,r]}function $s(e){return typeof e=="number"&&!Number.isNaN(e)}function fu(e){return Array.isArray(e)&&e.length===2}function hu(e){return e!=null&&typeof e=="object"&&"ranges"in e&&Array.isArray(e.ranges)}function C0(e,t){const r=e.at(t);let n;if(r){n=r.mode;let a=r.parent;for(;!n&&a;)a&&(n=a.mode),a=a.parent}return n}function L0(e,t){if(!t)return"";if(typeof t=="string")return t;if(!e||t.after===void 0)return t.value;let r=!1,n=!1,a=!1,o=!1,_=!1,N=!1,z=!1,W=!1,j=!1,X=!1,ae=!1,he=!1,_e=!1,Ue=!1,yt=!1,Be=e[0],nt=0;for(;Be!=null&&Be.type&&/^(subsup|placeholder)$/.test(Be.type);)nt+=1,Be=e[nt];return r=!Be||Be.type==="first",Be&&(Ue=Be.mode==="text",n=!Ue&&Be.type==="mord"&&He.test(Be.value),a=!Ue&&Be.type==="mord"&&/\d+$/.test(Be.value),o=!Ue&&Be.isFunction,_=Be.type==="genfrac",N=Be.type==="surd",z=Be.type==="mbin",W=Be.type==="mrel",j=Be.type==="mop"||Be.type==="operator"||Be.type==="extensible-symbol",X=Be.type==="mpunct"||Be.type==="minner",ae=Be.type==="array",he=Be.type==="mopen",_e=Be.type==="mclose"||Be.type==="leftright",yt=Be.type==="space"),t.after.includes("nothing")&&r||t.after.includes("letter")&&n||t.after.includes("digit")&&a||t.after.includes("function")&&o||t.after.includes("frac")&&_||t.after.includes("surd")&&N||t.after.includes("binop")&&z||t.after.includes("relop")&&W||t.after.includes("operator")&&j||t.after.includes("punct")&&X||t.after.includes("array")&&ae||t.after.includes("openfence")&&he||t.after.includes("closefence")&&_e||t.after.includes("text")&&Ue||t.after.includes("space")&&yt?t.value:""}function mc(e,t,r){return r?L0(e,r[t]):""}var Of={"&":"\\&","%":"\\%",$:"\\$","''":"^{\\doubleprime}","'''":"^{\\prime\\prime\\prime}","''''":"^{\\prime\\prime\\prime\\prime}",alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:"\\pi",Pi:"\\Pi",theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:"\\nabla",grad:"\\nabla",del:"\\partial",deg:{after:"digit+space",value:"\\degree"},infty:"\\infty","\u221E":"\\infty",oo:{after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"\u2211":"\\sum",sum:"\\sum_{#?}^{#?}",int:"\\int_{#?}^{#?}",prod:"\\prod_{#?}^{#?}",sqrt:"\\sqrt{#?}","\u2206":"\\differentialD","\u2202":"\\differentialD",arcsin:"\\arcsin",arccos:"\\arccos",arctan:"\\arctan",arcsec:"\\arcsec",arccsc:"\\arccsc",arsinh:"\\arsinh",arcosh:"\\arcosh",artanh:"\\artanh",arcsech:"\\arcsech",arccsch:"\\arccsch",arg:"\\arg",ch:"\\ch",cosec:"\\cosec",cosh:"\\cosh",cot:"\\cot",cotg:"\\cotg",coth:"\\coth",csc:"\\csc",ctg:"\\ctg",cth:"\\cth",sec:"\\sec",sinh:"\\sinh",sh:"\\sh",tanh:"\\tanh",tg:"\\tg",th:"\\th",sin:"\\sin",cos:"\\cos",tan:"\\tan",lg:"\\lg",lb:"\\lb",log:"\\log",ln:"\\ln",exp:"\\exp",lim:"\\lim_{#?}",dx:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD x"},dy:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD y"},dt:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD t"},AA:"\\forall",EE:"\\exists","!EE":"\\nexists","&&":"\\land",xin:{after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},sint:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\sin t"},in:{after:"nothing+letter+closefence",value:"\\in"},"!in":"\\notin",NN:"\\mathbb{N}",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",xx:"\\times","+-":"\\pm","\u2260":"\\ne","!=":"\\ne","\u2265":"\\ge",">=":"\\ge","\u2264":"\\le","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","\u2248":"\\approx","?=":"\\questeq","\xF7":"\\div","\xAC":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},nu:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},\u00B5:"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega",\u03A9:"\\omega",forall:"\\forall",exists:"\\exists","!exists":"\\nexists",":.":"\\therefore",liminf:"\\liminf_{#?}",limsup:"\\limsup_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:"\\bmod{#?}","(mod":"\\pmod{#?}",max:"\\max",min:"\\min",erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:"\\operatorname{bessel}",mean:"\\operatorname{mean}",median:"\\operatorname{median}",fft:"\\operatorname{fft}",lcm:"\\operatorname{lcm}",gcd:"\\operatorname{gcd}",randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:"\\operatorname{Re}",Im:"\\operatorname{Im}",mm:{after:"nothing+digit+operator",value:"\\operatorname{mm}"},cm:{after:"nothing+digit+operator",value:"\\operatorname{cm}"},km:{after:"nothing+digit+operator",value:"\\operatorname{km}"},kg:{after:"nothing+digit+operator",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","-->...":"\\longrightarrow\\cdots","->":"\\to","|->":"\\mapsto","-->":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","*":"\\cdot","**":"\\star","***":"\\ast","//":"\\slash","\\\\":"\\backslash",setminus:"\\backslash","|><":"\\ltimes","><|":"\\rtimes","|><|":"\\bowtie","-:":"\\div",divide:"\\div","@":"\\circ","^^":"\\wedge","^^^":"\\bigwedge",vv:"\\vee",vvv:"\\bigvee",nn:"\\cap",nnn:"\\bigcap",uu:"\\cup",uuu:"\\bigcup","-=":"\\equiv","~=":"\\cong",lt:"<","lt=":"\\leq",gt:">","gt=":"\\geq","-<":"\\prec","-lt":"\\prec","-<=":"\\preceq",">-=":"\\succeq",prop:"\\propto",diamond:"\\diamond",square:"\\square",iff:"\\iff",sub:"\\subset",sup:"\\supset",sube:"\\subseteq",supe:"\\supseteq",uarr:"\\uparrow",darr:"\\downarrow",rarr:"\\rightarrow",rArr:"\\Rightarrow",larr:"\\leftarrow",lArr:"\\Leftarrow",harr:"\\leftrightarrow",hArr:"\\Leftrightarrow",aleph:"\\aleph",and:"\\land",or:"\\lor",not:"\\neg","_|_":"\\bot",TT:"\\top","|--":"\\vdash","|==":"\\models","|__":"\\lfloor","__|":"\\rfloor","|~":"\\lceil","~|":"\\rceil",">->":"\\rightarrowtail","->>":"\\twoheadrightarrow",">->>":"\\twoheadrightarrowtail",frac:"\\frac{#?}{#?}",cbrt:"\\sqrt[3]{#?}",nthroot:"\\sqrt[#?]{#?}"};function du(e,t){var r;let n=(r=t==null?void 0:t.format)!=null?r:"auto";return n==="auto"&&([n,e]=R0(e)),n==="ascii-math"?(e=e.replace(/\u2061/gu,""),e=e.replace(/\u3016/gu,"{"),e=e.replace(/\u3017/gu,"}"),e=e.replace(/([^\\])sinx/g,"$1\\sin x"),e=e.replace(/([^\\])cosx/g,"$1\\cos x "),e=e.replace(/\u2013/g,"-"),["ascii-math",ca(e,{inlineShortcuts:t==null?void 0:t.inlineShortcuts})]):["latex",e]}function ca(e,t){var r,n,a;if(!e)return"";let o=!1,_;const N=(r=t.inlineShortcuts)!=null?r:Of;if(!o&&(e.startsWith("^")||e.startsWith("_"))&&(_=fo(e.slice(1),{inlineShortcuts:N,noWrap:!0}),e=e[0]+"{"+_.match+"}",e+=ca(_.rest,t),o=!0),o||(_=e.match(/^(sqrt|\u221A)(.*)/),_&&(_=fo(_[2],{inlineShortcuts:N,noWrap:!0}),e="\\sqrt{"+((n=_.match)!=null?n:"\\placeholder{}")+"}",e+=ca(_.rest,t),o=!0)),o||(_=e.match(/^(\\cbrt|\u221B)(.*)/),_&&(_=fo(_[2],{inlineShortcuts:N,noWrap:!0}),e="\\sqrt[3]{"+((a=_.match)!=null?a:"\\placeholder{}")+"}",e+=ca(_.rest,t),o=!0)),o||(_=e.match(/^abs(.*)/),_&&(_=fo(_[1],{inlineShortcuts:N,noWrap:!0}),e="\\left|"+_.match+"\\right|",e+=ca(_.rest,t),o=!0)),o||(_=e.match(/^["”“](.*?)["”“](.*)/),_&&(e="\\text{"+_[1]+"}",e+=ca(_[2],t),o=!0)),o||(_=e.match(/^([^a-zA-Z\(\{\[\_\^\\\s"]+)(.*)/),_&&(e=Ff(_[1],N),e+=ca(_[2],t),o=!0)),!o&&/^([fgh])[^a-zA-Z]/.test(e)&&(_=fo(e.slice(1),{inlineShortcuts:N,noWrap:!0}),e=e[1]==="("?e[0]+"\\left("+_.match+"\\right)":e[0]+_.match,e+=ca(_.rest,t),o=!0),o||(_=e.match(/^([a-zA-Z]+)(.*)/),_&&(e=Ff(_[1],N),e+=ca(_[2],t),o=!0)),!o)if(_=fo(e,{inlineShortcuts:N,noWrap:!0}),_.match&&_.rest[0]==="/"){const z=fo(_.rest.slice(1),{inlineShortcuts:N,noWrap:!0});z.match&&(e="\\frac{"+_.match+"}{"+z.match+"}"+ca(z.rest,t)),o=!0}else _.match&&(e=e.startsWith("(")?"\\left("+_.match+"\\right)"+ca(_.rest,t):_.match+ca(_.rest,t),o=!0);return o||(_=e.match(/^(\s+)(.*)$/),_&&(e=" "+ca(_[2],t),o=!0)),e}function fo(e,t){let r="";e=e.trim();let n=e,a=e.charAt(0),o={"(":")","{":"}","[":"]"}[a];if(o){let _=1,N=1;for(;N<e.length&&_>0;)e[N]===a&&_++,e[N]===o&&_--,N++;_===0?(t.noWrap&&a==="("?r=ca(e.substring(1,N-1),t):(a==="{"&&o==="}"&&(a="\\{",o="\\}"),r="\\left"+a+ca(e.substring(1,N-1),t)+"\\right"+o),n=e.slice(Math.max(0,N))):(r=e.substring(1,N),n="")}else{let _=e.match(/^([a-zA-Z]+)/);if(_){let N=mc(null,e,t.inlineShortcuts);if(N)return N=N.replace("_{#?}",""),N=N.replace("^{#?}",""),{match:N,rest:e.slice(N.length)}}if(_=e.match(/^([a-zA-Z])/),_)return{match:_[1],rest:e.slice(1)};if(_=e.match(/^(-)?\d+(\.\d*)?/),_)return{match:_[0],rest:e.slice(_[0].length)};/^\\(left|right)/.test(e)||(_=e.match(/^(\\[a-zA-Z]+)/),_&&(n=e.slice(_[1].length),r=_[1]))}return{match:r,rest:n}}function Ff(e,t){let r=mc(null,e,t);return r?(r=r.replace("_{#?}",""),r=r.replace("^{#?}",""),r+=" "):r=e,r}var Bf=[["\\[","\\]"],["\\(","\\)"],["$$","$$"],["$","$"],["\\begin{math}","\\end{math}"],["\\begin{displaymath}","\\end{displaymath}"],["\\begin{equation}","\\end{equation}"],["\\begin{equation*}","\\end{equation*}"]];function vc(e){const t=e.trim();for(const r of Bf)if(t.startsWith(r[0])&&t.endsWith(r[1]))return[!0,t.substring(r[0].length,t.length-r[1].length)];return[!1,e]}function R0(e){if(e=e.trim(),e.length<=1)return["latex",e];let t;return[t,e]=vc(e),t?["latex",e]:e.startsWith("`")&&e.endsWith("`")?(e=e.substring(1,e.length-1),["ascii-math",e]):e.includes("\\")?["latex",e]:/\$.+\$/.test(e)?["latex",`\\text{${e}}`]:[void 0,e]}var P0="$$",I0="$$",O0=(e,t,r)=>(Bf.some(n=>t.startsWith(n[0])&&t.endsWith(n[1]))||(t=`${P0} ${t} ${I0}`),t),Nf=class rc{constructor(t){rc._modes[t]=this}static onPaste(t,r,n){var a;if(!r.contentEditable&&r.userSelect==="none")return r.model.announce("plonk"),!1;if(typeof n=="string"){const _=new DataTransfer;_.setData("text/plain",n),n=_}const o=new ClipboardEvent("paste",{clipboardData:n,cancelable:!0});return(a=r.host)!=null&&a.dispatchEvent(o)?rc._modes[t].onPaste(r,n):!1}static copyToClipboard(t,r){if(!t.contentEditable&&t.userSelect==="none"){t.model.announce("plonk");return}const n=t.model,a=n.selectionIsCollapsed?[0,n.lastOffset]:Xi(n.selection),o=n.getValue(a,r);navigator.clipboard.writeText(o).then(()=>{},()=>t.model.announce("plonk"))}static onCopy(t,r){var n;if(!r.clipboardData)return;if(!t.contentEditable&&t.userSelect==="none"){t.model.announce("plonk");return}const a=t.model,o=a.selectionIsCollapsed?[0,a.lastOffset]:Xi(a.selection);let _=a.getAtoms(o);if(_.every(N=>N.mode==="text"||!N.mode))r.clipboardData.setData("text/plain",_.filter(N=>N instanceof vl).map(N=>N.value).join(""));else if(_.every(N=>N.mode==="latex"))r.clipboardData.setData("text/plain",a.getAtoms(o,{includeChildren:!0}).map(N=>{var z;return(z=N.value)!=null?z:""}).join(""));else{let N;_.length===1&&_[0].verbatimLatex!==void 0?N=_[0].verbatimLatex:N=a.getValue(o,"latex-expanded"),r.clipboardData.setData("application/x-latex",N);try{r.clipboardData.setData("text/plain",t.options.onExport(t,N,o))}catch(z){}if(_.length===1){const z=_[0];(z.type==="root"||z.type==="group")&&(_=z.body.filter(W=>W.type!=="first"))}try{r.clipboardData.setData("application/json+mathlive",JSON.stringify(_.map(z=>z.toJson())))}catch(z){}if((n=window[Symbol.for("io.cortexjs.compute-engine")])!=null&&n.ComputeEngine){const z=window.MathfieldElement.computeEngine;if(z)try{const W=z.jsonSerializationOptions;z.jsonSerializationOptions={metadata:["latex"]};const j=z.parse(a.getValue(o,"latex-unstyled"));z.jsonSerializationOptions=W;const X=JSON.stringify(j.json);X&&r.clipboardData.setData("application/json",X)}catch(W){}}}r.preventDefault()}static insert(t,r,n={}){var a;const o=n.mode==="auto"?t.mode:(a=n.mode)!=null?a:t.mode;return rc._modes[o].insert(t,r,n)}onPaste(t,r){return!1}insert(t,r,n){return!1}};Nf._modes={};var Wn=Nf,F0=[{key:"left",command:"moveToPreviousChar"},{key:"right",command:"moveToNextChar"},{key:"up",command:"moveUp"},{key:"down",command:"moveDown"},{key:"shift+[ArrowLeft]",command:"extendSelectionBackward"},{key:"shift+[ArrowRight]",command:"extendSelectionForward"},{key:"shift+[ArrowUp]",command:"extendSelectionUpward"},{key:"shift+[ArrowDown]",command:"extendSelectionDownward"},{key:"[Backspace]",command:"deleteBackward"},{key:"alt+[Delete]",command:"deleteBackward"},{key:"[Delete]",command:"deleteForward"},{key:"alt+[Backspace]",command:"deleteForward"},{key:"alt+[ArrowLeft]",command:"moveToPreviousWord"},{key:"alt+[ArrowRight]",command:"moveToNextWord"},{key:"shift+alt+[ArrowLeft]",command:"extendToPreviousWord"},{key:"shift+alt+[ArrowRight]",command:"extendToNextWord"},{key:"ctrl+[ArrowLeft]",command:"moveToGroupStart"},{key:"ctrl+[ArrowRight]",command:"moveToGroupEnd"},{key:"shift+ctrl+[ArrowLeft]",command:"extendToGroupStart"},{key:"shift+ctrl+[ArrowRight]",command:"extendToGroupEnd"},{key:"[Home]",command:"moveToMathfieldStart"},{key:"cmd+[ArrowLeft]",command:"moveToMathfieldStart"},{key:"shift+[Home]",command:"extendToMathFieldStart"},{key:"shift+cmd+[ArrowLeft]",command:"extendToMathFieldStart"},{key:"[End]",command:"moveToMathfieldEnd"},{key:"cmd+[ArrowRight]",command:"moveToMathfieldEnd"},{key:"shift+[End]",command:"extendToMathFieldEnd"},{key:"shift+cmd+[ArrowRight]",command:"extendToMathFieldEnd"},{key:"[Pageup]",command:"moveToGroupStart"},{key:"[Pagedown]",command:"moveToGroupEnd"},{key:"[Tab]",command:"moveToNextGroup"},{key:"shift+[Tab]",command:"moveToPreviousGroup"},{key:"[Escape]",ifMode:"math",command:["switchMode","latex"]},{key:"[Escape]",ifMode:"text",command:["switchMode","latex"]},{key:"[Escape]",ifMode:"latex",command:["complete","complete",{selectItem:"true"}]},{key:"\\",ifMode:"math",command:["switchMode","latex","\\"]},{key:"[IntlBackslash]",ifMode:"math",command:["switchMode","latex","\\"]},{key:"[Tab]",ifMode:"latex",command:["complete","accept-suggestion"]},{key:"[Return]",ifMode:"latex",command:"complete"},{key:"[Enter]",ifMode:"latex",command:"complete"},{key:"shift+[Escape]",ifMode:"latex",command:["complete","reject"]},{key:"[ArrowDown]",ifMode:"latex",command:"nextSuggestion"},{key:"[ArrowUp]",ifMode:"latex",command:"previousSuggestion"},{key:"ctrl+a",ifPlatform:"!macos",command:"selectAll"},{key:"cmd+a",command:"selectAll"},{key:"[Cut]",command:"cutToClipboard"},{key:"[Copy]",command:"copyToClipboard"},{key:"[Paste]",command:"pasteFromClipboard"},{key:"[Clear]",command:"deleteBackward"},{key:"[Undo]",command:"undo"},{key:"[Redo]",command:"redo"},{key:"[EraseEof]",command:"deleteToGroupEnd"},{key:"ctrl+x",ifPlatform:"ios",command:"cutToClipboard"},{key:"cmd+x",ifPlatform:"ios",command:"cutToClipboard"},{key:"ctrl+c",ifPlatform:"ios",command:"copyToClipboard"},{key:"cmd+c",ifPlatform:"ios",command:"copyToClipboard"},{key:"ctrl+v",ifPlatform:"ios",command:"pasteFromClipboard"},{key:"cmd+v",ifPlatform:"ios",command:"pasteFromClipboard"},{key:"ctrl+z",ifPlatform:"!macos",command:"undo"},{key:"cmd+z",command:"undo"},{key:"ctrl+y",ifPlatform:"!macos",command:"redo"},{key:"shift+cmd+y",command:"redo"},{key:"shift+ctrl+z",ifPlatform:"!macos",command:"redo"},{key:"shift+cmd+z",command:"redo"},{key:"ctrl+b",ifPlatform:"macos",command:"moveToPreviousChar"},{key:"ctrl+f",ifPlatform:"macos",command:"moveToNextChar"},{key:"ctrl+p",ifPlatform:"macos",command:"moveUp"},{key:"ctrl+n",ifPlatform:"macos",command:"moveDown"},{key:"ctrl+a",ifPlatform:"macos",command:"moveToMathfieldStart"},{key:"ctrl+e",ifPlatform:"macos",command:"moveToMathfieldEnd"},{key:"shift+ctrl+b",ifPlatform:"macos",command:"extendSelectionBackward"},{key:"shift+ctrl+f",ifPlatform:"macos",command:"extendSelectionForward"},{key:"shift+ctrl+p",ifPlatform:"macos",command:"extendSelectionUpward"},{key:"shift+ctrl+n",ifPlatform:"macos",command:"extendSelectionDownward"},{key:"shift+ctrl+a",ifPlatform:"macos",command:"extendToMathFieldStart"},{key:"shift+ctrl+e",ifPlatform:"macos",command:"extendToMathFieldEnd"},{key:"alt+ctrl+b",ifPlatform:"macos",command:"moveToPreviousWord"},{key:"alt+ctrl+f",ifPlatform:"macos",command:"moveToNextWord"},{key:"shift+alt+ctrl+b",ifPlatform:"macos",command:"extendToPreviousWord"},{key:"shift+alt+ctrl+f",ifPlatform:"macos",command:"extendToNextWord"},{key:"ctrl+h",ifPlatform:"macos",command:"deleteBackward"},{key:"ctrl+d",ifPlatform:"macos",command:"deleteForward"},{key:"ctrl+l",ifPlatform:"macos",command:"scrollIntoView"},{key:"ctrl+[Digit2]",ifMode:"math",command:["insert","\\sqrt{#0}"]},{key:"ctrl+[Digit5]",ifMode:"math",command:"moveToOpposite"},{key:"ctrl+[Digit6]",ifMode:"math",command:"moveToSuperscript"},{key:"ctrl+[Return]",ifMode:"math",command:"addRowAfter"},{key:"ctrl+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"cmd+[Return]",ifMode:"math",command:"addRowAfter"},{key:"cmd+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"alt+p",ifMode:"math",command:["insert","\\pi"]},{key:"alt+v",ifMode:"math",command:["insert","\\sqrt{#0}"]},{key:"alt+o",ifMode:"math",command:["insert","\\emptyset"]},{key:"alt+d",ifMode:"math",command:["insert","\\differentialD"]},{key:"shift+alt+o",ifMode:"math",command:["insert","\\varnothing"]},{key:"shift+alt+d",ifMode:"math",command:["insert","\\partial"]},{key:"alt+[Backslash]",ifMode:"math",command:["insert","\\backslash"]},{key:"[NumpadDivide]",ifMode:"math",command:["insert","\\frac{#@}{#?}"]},{key:"alt+[NumpadDivide]",ifMode:"math",command:["insert","\\frac{#?}{#@}"]},{key:"shift+alt+k",command:"toggleKeystrokeCaption"},{key:"alt+[Space]",command:"toggleContextMenu"},{key:"alt+shift+[Space]",command:"toggleVirtualKeyboard"},{key:"alt+ctrl+[ArrowUp]",command:["speak","all",{withHighlighting:!1}]},{key:"alt+ctrl+[ArrowDown]",command:["speak","selection",{withHighlighting:!1}]},{key:"shift+[Quote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["switchMode","text","",""]},{key:"shift+alt+[KeyT]",ifMode:"math",command:["switchMode","text","",""]},{key:"shift+[Quote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"text",command:["switchMode","math","",""]},{key:"shift+alt+[KeyT]",ifMode:"text",command:["switchMode","math","",""]},{key:"/",ifMode:"math",command:["insert","\\frac{#@}{#?}"]},{key:"alt+/",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","/"]},{key:"alt+shift+/",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","/"]},{key:"alt+[BracketLeft]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\left\\lbrack #0 \\right\\rbrack"]},{key:"ctrl+[Minus]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"moveToSubscript"},{key:"shift+alt+[BracketLeft]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\left\\lbrace #0 \\right\\rbrace"]},{key:"ctrl+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowAfter"},{key:"cmd+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowAfter"},{key:"shift+ctrl+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowBefore"},{key:"shift+cmd+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowBefore"},{key:"ctrl+[Backspace]",ifMode:"math",command:"removeRow"},{key:"cmd+[Backspace]",ifMode:"math",command:"removeRow"},{key:"alt+[Tab]",ifMode:"math",command:"addColumnAfter"},{key:"shift+alt+[Tab]",ifMode:"math",command:"addColumnBefore"},{key:"alt+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"shift+alt+[Enter]",ifMode:"math",command:"addRowBefore"},{key:"alt+[Return]",ifMode:"math",command:"addRowAfter"},{key:"shift+alt+[Return]",ifMode:"math",command:"addRowBefore"},{key:"shift+[Backspace]",ifMode:"math",command:"removeColumn"},{key:"alt+[Digit5]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","$\\infty"]},{key:"alt+[Digit9]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","("]},{key:"alt+[Digit0]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert",")"]},{key:"alt+|",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","|"]},{key:"shift+[Backquote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\~"]},{key:"[Backquote]",ifLayout:["windows.french","linux.french"],ifMode:"math",command:["insert","^2"]},{key:"[Backquote]",ifLayout:["windows.german","linux.german"],ifMode:"math",command:["insert","^"]},{key:"[IntlBackslash]",ifLayout:["apple.german"],ifMode:"math",command:["insert","^"]}],B0={"\\sqrt":["alt+v","ctrl+[Digit2]"],"\\pi":"alt+p","\\infty":"alt+[Digit5]","\\differentialD":"alt+d","\\partial":"shift+alt+d","\\frac":"Slash","\\emptyset":"alt+o","\\varnothing":"shift+alt+o","\\~":"~"};function ho(e){var t;return((t=e.element)==null?void 0:t.mathfield)===e}function N0(e){var t,r;return(r=(t=e.querySelector(".ML__caret"))!=null?t:e.querySelector(".ML__text-caret"))!=null?r:e.querySelector(".ML__latex-caret")}function gl(e){const t=N0(e);if(!t)return null;const r=t.getBoundingClientRect();return{x:r.right,y:r.bottom,height:r.height}}function K0(e){var t;if(!e.parent)return"root";let r=(t=e.parent.id)!=null?t:"";return r+=typeof e.parentBranch=="string"?"-"+e.parentBranch:`-${e.parentBranch[0]}/${e.parentBranch[0]}`,r}function Kf(e,t,r){if(!t)return null;const n=e.field.getBoundingClientRect(),a=t.right-t.left,o=t.bottom-t.top,_=Math.ceil(t.left-n.left+e.field.scrollLeft*r),N=Math.ceil(t.top-n.top);return{left:_,right:_+a,top:N,bottom:N+o}}function Uf(e){const t=e.getBoundingClientRect(),r=parseInt(getComputedStyle(e).marginRight),n={top:t.top-1,bottom:t.bottom,left:t.left,right:t.right-1+r};if(e.children.length===0||e.tagName.toUpperCase()==="SVG")return n;for(const a of e.children)if(a.nodeType===1&&"atomId"in a.dataset&&!a.classList.contains("pstrut")){const o=Uf(a);n.left=Math.min(n.left,o.left),n.right=Math.max(n.right,o.right),n.top=Math.min(n.top,o.top),n.bottom=Math.max(n.bottom,o.bottom)}return n}function _l(e,t){var r,n;if(!t.id)return null;let a=(n=(r=e.atomBoundsCache)==null?void 0:r.get(t.id))!=null?n:null;if(a!==null)return a;const o=e.field.querySelector(`[data-atom-id="${t.id}"]`);return a=o?Uf(o):null,e.atomBoundsCache&&(a?e.atomBoundsCache.set(t.id,a):e.atomBoundsCache.delete(t.id)),a!=null?a:null}function U0(e,t,r){const n=new Map;for(const a of e.model.getAtoms(t,{includeChildren:!0})){if(r!=null&&r.excludeAtomsWithBackground&&a.style.backgroundColor)continue;const o=e.field,_=o.offsetWidth;let z=Math.floor(o.getBoundingClientRect().width)/_;z=isNaN(z)?1:z;const W=Kf(e,_l(e,a),z);if(W){const j=K0(a);if(n.has(j)){const X=n.get(j);n.set(j,{left:Math.min(X.left,W.left),right:Math.max(X.right,W.right),top:Math.min(X.top,W.top),bottom:Math.max(X.bottom,W.bottom)})}else n.set(j,W)}}return[...n.values()]}function zf(e,t){return e.model.selection.ranges.reduce((r,n)=>r.concat(...U0(e,n,t)),[])}function gc(e,t){return e==="*"||t==="none"?!0:t==="same-origin"?!window.origin||e===window.origin:typeof t=="function"?t(e):!1}function $f(e){let t=0,r=0;const n=e.offsetWidth,a=e.offsetHeight;for(;e instanceof HTMLElement;)t+=e.offsetTop,r+=e.offsetLeft,e=e.offsetParent;return new DOMRect(r,t,n,a)}var z0=`@keyframes ML__caret-blink {
0%,
100% {
opacity: 1;
}
50% {
opacity: 0;
}
}
.ML__container {
display: inline-flex;
flex-flow: row;
justify-content: space-between;
align-items: flex-end;
min-height: 39px;
/* Need some room for the virtual keyboard toggle */
width: 100%;
/* Encourage browsers to consider allocating a hardware accelerated
layer for this element. */
isolation: isolate;
/* Prevent the browser from trying to interpret touch gestures in the field */
/* "Disabling double-tap to zoom removes the need for browsers to
delay the generation of click events when the user taps the screen." */
touch-action: none;
--_caret-color: var(--caret-color, hsl(var(--_hue), 40%, 49%));
--_selection-color: var(--selection-color, #000);
--_selection-background-color: var(--selection-background-color, hsl(var(--_hue), 70%, 85%));
--_text-highlight-background-color: var(--highlight-text, hsla(var(--_hue), 40%, 50%, 0.1));
--_contains-highlight-background-color: var(--contains-highlight-background-color, hsl(var(--_hue), 40%, 95%));
--_smart-fence-color: var(--smart-fence-color, currentColor);
--_smart-fence-opacity: var(--smart-fence-opacity, 0.5);
--_latex-color: var(--latex-color, hsl(var(--_hue), 80%, 40%));
--_correct-color: var(--correct-color, #10a000);
--_incorrect-color: var(--incorrect-color, #a01b00);
--_composition-background-color: var(--composition-background-color, #fff1c2);
--_composition-text-color: var(--composition-text-color, black);
--_composition-underline-color: var(--composition-underline-color, transparent);
}
/* This is the actual field content (formula) */
.ML__content {
display: flex;
align-items: center;
align-self: center;
position: relative;
overflow: hidden;
padding: 2px 3px 2px 1px;
width: 100%;
}
.ML__virtual-keyboard-toggle,
.ML__menu-toggle {
box-sizing: border-box;
display: flex;
align-self: center;
align-items: center;
flex-shrink: 0;
flex-direction: column;
justify-content: center;
width: 34px;
height: 34px;
padding: 0;
margin-right: 4px;
cursor: pointer;
/* Avoid some weird blinking with :hover */
border-radius: 8px;
border: 1px solid transparent;
transition: background 0.2s cubic-bezier(0.64, 0.09, 0.08, 1);
color: hsl(var(--_hue), 40%, 50%);
fill: currentColor;
background: transparent;
}
.ML__virtual-keyboard-toggle:hover,
.ML__menu-toggle:hover {
background: hsla(0, 0%, 70%, 0.3);
color: #333;
fill: currentColor;
}
.ML__virtual-keyboard-toggle > span,
.ML__menu-toggle > span {
display: flex;
align-self: center;
align-items: center;
}
/* The invisible element used to capture keyboard events. We're just trying
really hard to make sure it doesn't show. */
.ML__keyboard-sink {
display: inline-block;
resize: none;
outline: none;
border: none;
/* Need these for Microsoft Edge */
position: fixed;
clip: rect(0 0 0 0);
/* Need this to prevent iOS Safari from auto-zooming */
font-size: 1em;
font-family: KaTeX_Main;
line-height: 0.5;
/* On Chromium, if this is 0, no keyboard events are received */
}
[part="placeholder"] {
color: var(--neutral-400);
}
.ML__composition {
background: var(--_composition-background-color);
color: var(--_composition-text-color);
text-decoration: underline var(--_composition-underline-color);
}
.ML__caret::after {
content: '';
visibility: hidden;
width: 0;
display: inline-block;
height: 0.76em;
--_caret-width: clamp(2px, 0.08em, 10px);
border: none;
border-radius: calc(var(--_caret-width) / 2);
border-right: var(--_caret-width) solid var(--_caret-color);
margin-right: calc(-1 * var(--_caret-width));
position: relative;
left: -0.045em;
bottom: -0.05em;
animation: ML__caret-blink 1.05s step-end forwards infinite;
}
.ML__text-caret::after {
content: '';
visibility: hidden;
width: 0;
display: inline-block;
height: 0.76em;
--_caret-width: clamp(2px, 0.08em, 10px);
border: none;
border-radius: calc(var(--_caret-width) / 2);
border-right: var(--_caret-width) solid var(--_caret-color);
margin-right: calc(-1 * var(--_caret-width));
position: relative;
left: -0.045em;
bottom: -0.05em;
animation: ML__caret-blink 1.05s step-end forwards infinite;
}
.ML__latex-caret::after {
content: '';
visibility: hidden;
--_caret-width: clamp(2px, 0.08em, 10px);
border: none;
border-radius: calc(var(--_caret-width) / 2);
border-right: var(--_caret-width) solid var(--_latex-color);
margin-right: calc(-1 * var(--_caret-width));
position: relative;
left: -0.019em;
animation: ML__caret-blink 1.05s step-end forwards infinite;
}
.ML__focused .ML__latex-caret::after,
.ML__focused .ML__text-caret::after,
.ML__focused .ML__caret::after {
visibility: visible;
}
.ML__focused .ML__text {
background: var(--_text-highlight-background-color);
}
/* When using smartFence, the anticipated closing fence is displayed
with this style */
.ML__smart-fence__close {
opacity: var(--_smart-fence-opacity);
color: var(--_smart-fence-color);
}
.ML__selected,
.ML__focused .ML__selected .ML__contains-caret,
.ML__focused .ML__selected .ML__smart-fence__close,
.ML__focused .ML__selected .ML__placeholder {
color: var(--_selection-color);
opacity: 1;
}
.ML__selection {
box-sizing: border-box;
background: var(--_selection-background-color) !important;
}
.ML__contains-caret.ML__close,
.ML__contains-caret.ML__open,
.ML__contains-caret > .ML__close,
.ML__contains-caret > .ML__open,
.ML__contains-caret .ML__sqrt-sign,
.ML__contains-caret .ML__sqrt-line {
color: var(--_caret-color);
}
.ML__contains-highlight {
box-sizing: border-box;
background: transparent;
}
.ML__focused .ML__contains-highlight {
background: var(--_contains-highlight-background-color);
}
.ML__raw-latex {
font-family: 'Berkeley Mono', 'IBM Plex Mono', 'Source Code Pro', Consolas, 'Roboto Mono', Menlo, 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Courier, monospace;
font-weight: 400;
font-size: 0.8em;
letter-spacing: -0.05em;
color: var(--_latex-color);
}
.ML__suggestion {
color: var(--neutral-500);
}
.ML__virtual-keyboard-toggle.is-visible.is-pressed:hover {
background: hsl(var(--_hue), 25%, 35%);
color: #fafafa;
fill: currentColor;
}
.ML__virtual-keyboard-toggle:focus {
outline: none;
border-radius: 8px;
border: 2px solid hsl(var(--_hue), 40%, 50%);
}
.ML__virtual-keyboard-toggle.is-pressed,
.ML__virtual-keyboard-toggle.is-active:hover,
.ML__virtual-keyboard-toggle.is-active {
background: hsl(var(--_hue), 25%, 35%);
color: #fafafa;
fill: currentColor;
}
/* Add an attribute 'data-tooltip' to automatically show a
tooltip over a element on hover.
*/
[data-tooltip] {
position: relative;
}
[data-tooltip]::after {
content: attr(data-tooltip);
position: absolute;
display: block;
z-index: 2;
pointer-events: none;
right: auto;
top: calc(-100% - 4px);
width: max-content;
max-width: 200px;
padding: 8px 8px;
border-radius: 4px;
background: #616161;
color: #fff;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
text-align: center;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-style: normal;
font-weight: 400;
font-size: 13px;
/* Phone */
opacity: 0;
transform: scale(0.5);
}
@media only screen and (max-width: 767px) {
[data-tooltip]::after {
padding: 8px 16px;
font-size: 16px;
}
}
menu [data-tooltip]::after {
left: 100%;
top: 0%;
}
menu .ML__base {
cursor: default;
}
/** Don't display if we're tracking, i.e. have the pointer down */
.tracking [data-tooltip]:hover::after {
/* Use visibility, not display. Display will remove the after from the DOM, and the override below will not work */
visibility: hidden;
}
/** But do display if tracking and inside a menu */
.tracking menu li[data-tooltip]:hover::after,
[data-tooltip]:hover::after {
visibility: visible;
opacity: 1;
transform: scale(1);
transition-property: opacity, scale;
transition-duration: 0.15s;
transition-delay: 1s;
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}
.ML__prompt {
border-radius: 2px;
}
.ML__editablePromptBox {
outline: 1px solid #acacac;
border-radius: 2px;
z-index: -1;
}
.ML__focusedPromptBox {
outline: highlight auto 1px;
}
.ML__lockedPromptBox {
background-color: rgba(142, 142, 141, 0.4);
z-index: -1;
}
.ML__correctPromptBox {
outline: 1px solid var(--_correct-color);
box-shadow: 0 0 5px var(--_correct-color);
}
.ML__incorrectPromptBox {
outline: 1px solid var(--_incorrect-color);
box-shadow: 0 0 5px var(--_incorrect-color);
}
.variant-submenu {
display: flex;
flex-direction: column;
padding: 8px;
}
.variant-submenu [part=menu-item] {
font-size: 2rem;
text-align: center;
margin: 0;
}
.insert-matrix-submenu {
display: grid;
padding: 8px;
align-content: center;
justify-content: center;
grid-template-columns: repeat(5, minmax(0, 1fr));
}
.insert-matrix-submenu [part=menu-item] {
font-size: 21px;
border: none;
border-radius: 0;
line-height: 21px;
text-align: center;
padding: 0;
margin: 0;
}
.border-submenu [part=menu-item] {
font-size: 2rem;
line-height: 1.2;
text-align: center;
}
.swatches-submenu {
--_swatch-size: 2rem;
--_columns: 4;
display: flex;
flex-flow: wrap;
padding: 8px;
max-width: calc(var(--_columns) * (var(--_swatch-size) + 18px) + 16px);
box-sizing: border-box;
}
.menu-swatch {
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
width: fit-content;
height: fit-content;
margin: 2px;
padding: 0;
background: var(--neutral-200);
}
.menu-swatch > .label {
padding: 0;
margin: 0;
line-height: 0;
}
.menu-swatch > .label > span {
display: inline-block;
margin: 6px;
min-width: var(--_swatch-size);
min-height: var(--_swatch-size);
border-radius: 50%;
}
.menu-swatch.active {
background: var(--neutral-100);
scale: 1.4;
}
.menu-swatch.active > .label > span {
border-radius: 2px;
}
.menu-swatch .ui-checkmark,
.menu-swatch .ui-mixedmark {
position: absolute;
margin: 0;
padding: 0;
color: white;
}
.menu-swatch.dark-contrast .ui-checkmark,
.menu-swatch.dark-contrast .ui-mixedmark {
color: #000;
}
`,$0=`.ML__container {
min-height: auto !important;
--_hue: var(--hue, 212);
--_placeholder-color: var(--placeholder-color, hsl(var(--_hue), 40%, 49%));
--_placeholder-opacity: var(--placeholder-opacity, 0.4);
--_text-font-family: var(--text-font-family, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif);
}
.ML__sr-only {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
clip-path: inset(50%);
white-space: nowrap;
border: 0;
}
.ML__is-inline {
display: inline-block;
}
.ML__base {
visibility: inherit;
display: inline-block;
position: relative;
cursor: text;
padding: 0;
margin: 0;
box-sizing: content-box;
border: 0;
outline: 0;
vertical-align: baseline;
font-weight: inherit;
font-family: inherit;
font-style: inherit;
text-decoration: none;
width: min-content;
}
.ML__strut,
.ML__strut--bottom {
display: inline-block;
min-height: 0.5em;
}
.ML__small-delim {
font-family: KaTeX_Main;
}
/* Text mode */
.ML__text {
font-family: var(--_text-font-family);
white-space: pre;
}
/* Use cmr for 'math upright' */
.ML__cmr {
font-family: KaTeX_Main;
font-style: normal;
}
.ML__mathit {
font-family: KaTeX_Math;
/* The KaTeX_Math font is italic by default, so the font-style below is only
useful when a fallback font is used
*/
font-style: italic;
}
.ML__mathbf {
font-family: KaTeX_Main;
font-weight: bold;
}
/* Lowercase greek symbols should stick to math font when \\mathbf is applied
to match TeX idiosyncratic behavior */
.lcGreek.ML__mathbf {
font-family: KaTeX_Math;
font-weight: normal;
}
.ML__mathbfit {
font-family: KaTeX_Math;
font-weight: bold;
font-style: italic;
}
.ML__ams {
font-family: KaTeX_AMS;
}
/* Blackboard */
.ML__bb {
font-family: KaTeX_AMS;
}
.ML__cal {
font-family: KaTeX_Caligraphic;
}
.ML__frak {
font-family: KaTeX_Fraktur;
}
.ML__tt {
font-family: KaTeX_Typewriter;
}
.ML__script {
font-family: KaTeX_Script;
}
.ML__sans {
font-family: KaTeX_SansSerif;
}
.ML__series_ul {
font-weight: 100;
}
.ML__series_el {
font-weight: 100;
}
.ML__series_l {
font-weight: 200;
}
.ML__series_sl {
font-weight: 300;
}
.ML__series_sb {
font-weight: 500;
}
.ML__bold,
.ML__boldsymbol {
font-weight: 700;
}
.ML__series_eb {
font-weight: 800;
}
.ML__series_ub {
font-weight: 900;
}
.ML__series_uc {
font-stretch: ultra-condensed;
}
.ML__series_ec {
font-stretch: extra-condensed;
}
.ML__series_c {
font-stretch: condensed;
}
.ML__series_sc {
font-stretch: semi-condensed;
}
.ML__series_sx {
font-stretch: semi-expanded;
}
.ML__series_x {
font-stretch: expanded;
}
.ML__series_ex {
font-stretch: extra-expanded;
}
.ML__series_ux {
font-stretch: ultra-expanded;
}
.ML__it {
font-style: italic;
}
.ML__shape_ol {
-webkit-text-stroke: 1px black;
text-stroke: 1px black;
color: transparent;
}
.ML__shape_sc {
font-variant: small-caps;
}
.ML__shape_sl {
font-style: oblique;
}
/* First level emphasis */
.ML__emph {
color: #bc2612;
}
/* Second level emphasis */
.ML__emph .ML__emph {
color: #0c7f99;
}
.ML__highlight {
color: #007cb2;
background: #edd1b0;
}
.ML__center {
text-align: center;
}
.ML__label_padding {
padding: 0 0.5em;
}
.ML__frac-line {
width: 100%;
min-height: 1px;
}
.ML__frac-line:after {
content: '';
display: block;
margin-top: max(-1px, -0.04em);
min-height: max(1px, 0.04em);
/* Ensure the line is visible when printing even if "turn off background images" is on*/
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
/* There's a bug since Chrome 62 where
sub-pixel border lines don't draw at some zoom
levels (110%, 90%).
Setting the min-height used to work around it, but that workaround
broke in Chrome 84 or so.
Setting the background (and the min-height) seems to work for now.
*/
background: currentColor;
box-sizing: content-box;
/* Vuetify sets the box-sizing to inherit
causes the fraction line to not draw at all sizes (see #26) */
/* On some versions of Firefox on Windows, the line fails to
draw at some zoom levels, but setting the transform triggers
the hardware accelerated path, which works */
transform: translate(0, 0);
}
.ML__sqrt {
display: inline-block;
}
.ML__sqrt-sign {
display: inline-block;
position: relative;
}
.ML__sqrt-line {
display: inline-block;
height: max(1px, 0.04em);
width: 100%;
}
.ML__sqrt-line:before {
content: '';
display: block;
margin-top: min(-1px, -0.04em);
min-height: max(1px, 0.04em);
/* Ensure the line is visible when printing even if "turn off background images" is on*/
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
background: currentColor;
/* On some versions of Firefox on Windows, the line fails to
draw at some zoom levels, but setting the transform triggers
the hardware accelerated path, which works */
transform: translate(0, 0);
}
.ML__sqrt-line:after {
border-bottom-width: 1px;
content: ' ';
display: block;
margin-top: -0.1em;
}
.ML__sqrt-index {
margin-left: 0.27777778em;
margin-right: -0.55555556em;
}
.ML__delim-size1 {
font-family: KaTeX_Size1;
}
.ML__delim-size2 {
font-family: KaTeX_Size2;
}
.ML__delim-size3 {
font-family: KaTeX_Size3;
}
.ML__delim-size4 {
font-family: KaTeX_Size4;
}
.ML__delim-mult .delim-size1 > span {
font-family: KaTeX_Size1;
}
.ML__delim-mult .delim-size4 > span {
font-family: KaTeX_Size4;
}
.ML__accent-body > span {
font-family: KaTeX_Main;
width: 0;
}
.ML__accent-vec {
position: relative;
left: 0.24em;
}
/** The markup for a LaTeX formula, either in an editable mathfield or
in a static display.
*/
.ML__latex {
display: inline-block;
direction: ltr;
text-align: left;
text-indent: 0;
text-rendering: auto;
font-family: KaTeX_Main, 'Times New Roman', serif;
font-style: normal;
font-size-adjust: none;
font-stretch: normal;
font-variant-caps: normal;
letter-spacing: normal;
line-height: 1.2;
word-wrap: normal;
word-spacing: normal;
white-space: nowrap;
text-shadow: none;
-webkit-user-select: none;
user-select: none;
width: min-content;
}
.ML__latex .style-wrap {
position: relative;
}
.ML__latex .mfrac {
display: inline-block;
}
.ML__latex .left-right {
display: inline-block;
}
.ML__latex .vlist-t {
display: inline-table;
table-layout: fixed;
border-collapse: collapse;
}
.ML__latex .vlist-r {
display: table-row;
}
.ML__latex .vlist {
display: table-cell;
vertical-align: bottom;
position: relative;
}
.ML__latex .vlist > span {
display: block;
height: 0;
position: relative;
}
.ML__latex .vlist > span > span {
display: inline-block;
}
.ML__latex .vlist > span > .pstrut {
overflow: hidden;
width: 0;
}
.ML__latex .vlist-t2 {
margin-right: -2px;
}
.ML__latex .vlist-s {
display: table-cell;
vertical-align: bottom;
font-size: 1px;
width: 2px;
min-width: 2px;
}
.ML__latex .msubsup {
text-align: left;
}
.ML__latex .negativethinspace {
display: inline-block;
margin-left: -0.16667em;
height: 0.71em;
}
.ML__latex .thinspace {
display: inline-block;
width: 0.16667em;
height: 0.71em;
}
.ML__latex .mediumspace {
display: inline-block;
width: 0.22222em;
height: 0.71em;
}
.ML__latex .thickspace {
display: inline-block;
width: 0.27778em;
height: 0.71em;
}
.ML__latex .enspace {
display: inline-block;
width: 0.5em;
height: 0.71em;
}
.ML__latex .quad {
display: inline-block;
width: 1em;
height: 0.71em;
}
.ML__latex .qquad {
display: inline-block;
width: 2em;
height: 0.71em;
}
.ML__latex .llap,
.ML__latex .rlap {
width: 0;
position: relative;
display: inline-block;
}
.ML__latex .llap > .inner,
.ML__latex .rlap > .inner {
position: absolute;
}
.ML__latex .llap > .fix,
.ML__latex .rlap > .fix {
display: inline-block;
}
.ML__latex .llap > .inner {
right: 0;
}
.ML__latex .rlap > .inner {
left: 0;
}
.ML__latex .rule {
display: inline-block;
border: solid 0;
position: relative;
box-sizing: border-box;
}
.ML__latex .overline .overline-line,
.ML__latex .underline .underline-line {
width: 100%;
}
.ML__latex .overline .overline-line:before,
.ML__latex .underline .underline-line:before {
content: '';
border-bottom-style: solid;
border-bottom-width: max(1px, 0.04em);
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
display: block;
}
.ML__latex .overline .overline-line:after,
.ML__latex .underline .underline-line:after {
border-bottom-style: solid;
border-bottom-width: max(1px, 0.04em);
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
content: '';
display: block;
margin-top: -1px;
}
.ML__latex .stretchy {
display: block;
position: absolute;
width: 100%;
left: 0;
overflow: hidden;
}
.ML__latex .stretchy:before,
.ML__latex .stretchy:after {
content: '';
}
.ML__latex .stretchy svg {
display: block;
position: absolute;
width: 100%;
height: inherit;
fill: currentColor;
stroke: currentColor;
fill-rule: nonzero;
fill-opacity: 1;
stroke-width: 1;
stroke-linecap: butt;
stroke-linejoin: miter;
stroke-miterlimit: 4;
stroke-dasharray: none;
stroke-dashoffset: 0;
stroke-opacity: 1;
}
.ML__latex .slice-1-of-2 {
display: inline-flex;
position: absolute;
left: 0;
width: 50.2%;
overflow: hidden;
}
.ML__latex .slice-2-of-2 {
display: inline-flex;
position: absolute;
right: 0;
width: 50.2%;
overflow: hidden;
}
.ML__latex .slice-1-of-3 {
display: inline-flex;
position: absolute;
left: 0;
width: 25.1%;
overflow: hidden;
}
.ML__latex .slice-2-of-3 {
display: inline-flex;
position: absolute;
left: 25%;
width: 50%;
overflow: hidden;
}
.ML__latex .slice-3-of-3 {
display: inline-flex;
position: absolute;
right: 0;
width: 25.1%;
overflow: hidden;
}
.ML__latex .slice-1-of-1 {
display: inline-flex;
position: absolute;
width: 100%;
left: 0;
overflow: hidden;
}
.ML__latex .nulldelimiter {
display: inline-block;
}
.ML__latex .op-group {
display: inline-block;
}
.ML__latex .op-symbol {
position: relative;
}
.ML__latex .op-symbol.small-op {
font-family: KaTeX_Size1;
}
.ML__latex .op-symbol.large-op {
font-family: KaTeX_Size2;
}
.ML__latex .mtable .vertical-separator {
display: inline-block;
min-width: 1px;
box-sizing: border-box;
}
.ML__latex .mtable .arraycolsep {
display: inline-block;
}
.ML__latex .mtable .col-align-m > .vlist-t {
text-align: center;
}
.ML__latex .mtable .col-align-c > .vlist-t {
text-align: center;
}
.ML__latex .mtable .col-align-l > .vlist-t {
text-align: left;
}
.ML__latex .mtable .col-align-r > .vlist-t {
text-align: right;
}
.ML__error {
display: inline-block;
background-image: radial-gradient(ellipse at center, hsl(341, 100%, 40%), rgba(0, 0, 0, 0) 70%);
background-color: hsla(341, 100%, 40%, 0.1);
background-repeat: repeat-x;
background-size: 3px 3px;
padding-bottom: 3px;
background-position: 0 100%;
}
.ML__error > .ML__error {
background: transparent;
padding: 0;
}
.ML__placeholder {
color: var(--_placeholder-color);
opacity: var(--_placeholder-opacity);
padding-left: 0.4ex;
padding-right: 0.4ex;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}
.ML__notation {
position: absolute;
box-sizing: border-box;
line-height: 0;
}
/* This class is used to implement the \`\\mathtip\` and \`\\texttip\` commands
For UI elements, see \`[data-ML__tooltip]\`
*/
.ML__tooltip-container {
position: relative;
transform: scale(0);
}
.ML__tooltip-container .ML__tooltip-content {
position: fixed;
display: inline-table;
visibility: hidden;
z-index: 2;
width: max-content;
max-width: 400px;
padding: 12px 12px;
border-radius: 8px;
background: #616161;
--_selection-color: #fff;
color: #fff;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
opacity: 0;
transition: opacity 0.15s cubic-bezier(0.4, 0, 1, 1);
}
.ML__tooltip-container .ML__tooltip-content .ML__text {
white-space: normal;
}
.ML__tooltip-container .ML__tooltip-content .ML__base {
display: contents;
}
.ML__tooltip-container:hover .ML__tooltip-content {
visibility: visible;
opacity: 1;
font-size: 0.75em;
transform: scale(1) translate(0, 3em);
}
`,W0=`#mathlive-environment-popover.is-visible {
visibility: visible;
}
#mathlive-environment-popover {
--_environment-panel-height: var(--environment-panel-height, 70px);
--_accent-color: var(--accent-color, #aaa);
--_background: var(--environment-panel-background, #fff);
--_button-background: var(--environment-panel-button-background, white);
--_button-background-hover: var(--environment-panel-button-background-hover, #f5f5f7);
--_button-background-active: var(--environment-panel-button-background-active, #f5f5f7);
--_button-text: var(--environment-panel-button-text, #e3e4e8);
position: absolute;
width: calc(var(--_environment-panel-height) * 2);
height: var(--_environment-panel-height);
border-radius: 4px;
border: 1.5px solid var(--_accent-color);
background-color: var(--_background);
box-shadow: 0 0 30px 0 var(--environment-shadow, rgba(0, 0, 0, 0.4));
pointer-events: all;
visibility: hidden;
}
#mathlive-environment-popover .MLEP__array-buttons {
height: calc(var(--_environment-panel-height) * 5/4);
width: calc(var(--_environment-panel-height) * 5/4);
margin-left: calc(0px - var(--_environment-panel-height) * 0.16);
margin-top: calc(0px - var(--_environment-panel-height) * 0.19);
}
#mathlive-environment-popover .MLEP__array-buttons .font {
fill: white;
}
#mathlive-environment-popover .MLEP__array-buttons circle {
fill: #7f7f7f;
transition: fill 300ms;
}
#mathlive-environment-popover .MLEP__array-buttons .MLEP__array-insert-background {
fill-opacity: 1;
fill: var(--_background);
stroke: var(--_accent-color);
stroke-width: 3px;
}
#mathlive-environment-popover .MLEP__array-buttons line {
stroke: var(--_accent-color);
stroke-opacity: 0;
stroke-width: 40;
pointer-events: none;
transition: stroke-opacity 300ms;
stroke-linecap: round;
}
#mathlive-environment-popover .MLEP__array-buttons g[data-command]:hover circle {
fill: var(--_accent-color);
}
#mathlive-environment-popover .MLEP__array-buttons g[data-command]:hover line {
stroke-opacity: 1;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls {
height: 100%;
width: 50%;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options {
width: var(--_environment-panel-height);
height: var(--_environment-panel-height);
display: flex;
flex-wrap: wrap;
flex-direction: row;
justify-content: space-around;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg {
pointer-events: all;
margin-top: 2px;
width: calc(var(--_environment-panel-height) / 3 * 28 / 24);
height: calc(var(--_environment-panel-height) / 3 - 2px);
border-radius: calc(var(--_environment-panel-height) / 25);
background-color: var(--_button-background);
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg:hover {
background-color: var(--_button-background-hover);
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg path,
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg line {
stroke: var(--_button-text);
stroke-width: 2;
stroke-linecap: round;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg rect,
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg path {
fill-opacity: 0;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active {
pointer-events: none;
background-color: var(--_button-background-active);
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active path,
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active line {
stroke: var(--_accent-color);
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active circle {
fill: var(--_accent-color);
}
`,V0=`/* The element that display info while in latex mode */
#mathlive-suggestion-popover {
background-color: rgba(97, 97, 97);
color: #fff;
text-align: center;
border-radius: 8px;
position: fixed;
z-index: 1;
display: none;
flex-direction: column;
justify-content: center;
box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
}
#mathlive-suggestion-popover.top-tip::after {
content: '';
position: absolute;
top: -15px;
left: calc(50% - 15px);
width: 0;
height: 0;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
border-bottom: 15px solid rgba(97, 97, 97);
font-size: 1rem;
}
#mathlive-suggestion-popover.bottom-tip::after {
content: '';
position: absolute;
bottom: -15px;
left: calc(50% - 15px);
width: 0;
height: 0;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
border-top: 15px solid rgba(97, 97, 97);
font-size: 1rem;
}
#mathlive-suggestion-popover.is-animated {
transition: all 0.2s cubic-bezier(0.64, 0.09, 0.08, 1);
animation: ML__fade-in cubic-bezier(0, 0, 0.2, 1) 0.15s;
}
#mathlive-suggestion-popover.is-visible {
display: flex;
}
@keyframes ML__fade-in {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
/* The wrapper class for the entire content of the popover panel */
#mathlive-suggestion-popover ul {
display: flex;
flex-flow: column;
list-style: none;
margin: 0;
padding: 0;
align-items: flex-start;
max-height: 400px;
overflow-y: auto;
}
#mathlive-suggestion-popover li {
display: flex;
flex-direction: row;
justify-content: space-between;
margin: 8px;
padding: 8px;
width: calc(100% - 16px - 16px);
column-gap: 1em;
border-radius: 8px;
cursor: pointer;
/* Since the content can be clicked on, provide feedback on hover */
}
#mathlive-suggestion-popover li a {
color: #5ea6fd;
padding-top: 0.3em;
margin-top: 0.4em;
display: block;
}
#mathlive-suggestion-popover li a:hover {
color: #5ea6fd;
text-decoration: underline;
}
#mathlive-suggestion-popover li:hover,
#mathlive-suggestion-popover li.is-pressed,
#mathlive-suggestion-popover li.is-active {
background: rgba(255, 255, 255, 0.1);
}
/* The command inside a popover (inside a #mathlive-suggestion-popover) */
.ML__popover__command {
font-size: 1.6rem;
font-family: KaTeX_Main;
}
.ML__popover__current {
background: #5ea6fd;
color: #fff;
}
.ML__popover__latex {
font-family: 'IBM Plex Mono', 'Source Code Pro', Consolas, 'Roboto Mono', Menlo, 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Courier, monospace;
align-self: center;
}
/* The keyboard shortcuts for a symbol as displayed in the popover */
.ML__popover__keybinding {
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 0.8em;
opacity: 0.7;
}
/* Style for the character that joins the modifiers of a keyboard shortcut
(usually a "+" sign)*/
.ML__shortcut-join {
opacity: 0.5;
}
`,H0=`/* The element that displays the keys as the user type them */
#mathlive-keystroke-caption-panel {
visibility: hidden;
/*min-width: 160px;*/
/*background-color: rgba(97, 97, 200, .95);*/
background: var(--secondary, hsl(var(--_hue), 19%, 26%));
border-color: var(--secondary-border, hsl(0, 0%, 91%));
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
text-align: center;
border-radius: 6px;
padding: 16px;
position: absolute;
z-index: 1;
display: flex;
flex-direction: row-reverse;
justify-content: center;
--keystroke: white;
--on-keystroke: #555;
--keystroke-border: #f7f7f7;
}
@media (prefers-color-scheme: dark) {
body:not([theme='light']) #mathlive-keystroke-caption-panel {
--keystroke: hsl(var(--_hue), 50%, 30%);
--on-keystroke: hsl(0, 0%, 98%);
--keystroke-border: hsl(var(--_hue), 50%, 25%);
}
}
body[theme='dark'] #mathlive-keystroke-caption-panel {
--keystroke: hsl(var(--_hue), 50%, 30%);
--on-keystroke: hsl(0, 0%, 98%);
--keystroke-border: hsl(var(--_hue), 50%, 25%);
}
#mathlive-keystroke-caption-panel > span {
min-width: 14px;
/*height: 8px;*/
margin: 0 8px 0 0;
padding: 4px;
background-color: var(--keystroke);
color: var(--on-keystroke);
fill: currentColor;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 1em;
border-radius: 6px;
border: 2px solid var(--keystroke-border);
/*box-shadow: 0 7px 14px rgba(0,0,0,0.25), 0 5px 5px rgba(0,0,0,0.22);*/
}
`,j0=`.ML__keyboard {
--_keyboard-height: 0;
--_keyboard-zindex: var(--keyboard-zindex, 105);
--_accent-color: var(--keyboard-accent-color, #0c75d8);
--_background: var(--keyboard-background, #cacfd7);
--_border: var(--keyboard-border, #ddd);
--_padding-horizontal: var(--keyboard-padding-horizontal, 0px);
--_padding-top: var(--keyboard-padding-top, 5px);
--_padding-bottom: var(--keyboard-padding-bottom, 0px);
--_row-padding-left: var(--keyboard-row-padding-left, 0px);
--_row-padding-right: var(--keyboard-row-padding-right, 0px);
--_toolbar-text: var(--keyboard-toolbar-text, #2c2e2f);
--_toolbar-text-active: var(--keyboard-toolbar-text-active, var(--_accent-color));
--_toolbar-background: var(--keyboard-toolbar-background, transparent);
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #eee);
--_toolbar-background-selected: var(--keyboard-toolbar-background-selected, transparent);
--_toolbar-font-size: var(--keyboard-toolbar-font-size, '135%');
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #fff);
--_keycap-background: var(--keycap-background, white);
--_keycap-background-hover: var(--keycap-background-hover, #f5f5f7);
--_keycap-background-active: var(--keycap-background-active, var(--_accent-color));
--_keycap-background-pressed: var(--keycap-background-pressed, var(--_accent-color));
--_keycap-border: var(--keycap-border, #e5e6e9);
--_keycap-border-bottom: var(--keycap-border-bottom, #8d8f92);
--_keycap-text: var(--keycap-text, #000);
--_keycap-text-active: var(--keycap-text-active, #fff);
--_keycap-text-hover: var(--keycap-text-hover, var(--_keycap-text));
--_keycap-text-pressed: var(--keycap-text-pressed, #fff);
--_keycap-shift-text: var(--keycap-shift-text, var(--_accent-color));
--_keycap-primary-background: var(--keycap-primary-background, var(--_accent-color));
--_keycap-primary-text: var(--keycap-primary-text, #ddd);
--_keycap-primary-background-hover: var(--keycap-primary-background-hover, #0d80f2);
--_keycap-secondary-background: var(--keycap-secondary-background, #a0a9b8);
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #7d8795);
--_keycap-secondary-text: var(--keycap-secondary-text, #060707);
--_keycap-secondary-border: var(--keycap-secondary-border, #c5c9d0);
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, #989da6);
--_keycap-height: var(--keycap-height, 60px);
/* Keycap width (incl. margin) */
--_keycap-max-width: var(--keycap-max-width, 100px);
--_keycap-gap: var(--keycap-gap, 8px);
--_keycap-font-size: var(--keycap-font-size, clamp(16px, 4cqw, 24px));
--_keycap-small-font-size: var(--keycap-small-font-size, calc(var(--keycap-font-size) * 0.8));
--_keycap-extra-small-font-size: var(--keycap-extra-small-font-size, calc(var(--keycap-font-size) / 1.42));
--_variant-panel-background: var(--variant-panel-background, #fff);
--_variant-keycap-text: var(--variant-keycap-text, var(--_keycap-text));
--_variant-keycap-text-active: var(--variant-keycap-text-active, var(--_keycap-text-active));
--_variant-keycap-background-active: var(--variant-keycap-background-active, var(--_accent-color));
--_variant-keycap-length: var(--variant-keycap-length, 70px);
--_variant-keycap-font-size: var(--variant-keycap-font-size, 30px);
--_variant-keycap-aside-font-size: var(--variant-keycap-aside-font-size, 12px);
--_keycap-shift-font-size: var(--keycap-shift-font-size, 16px);
--_keycap-shift-color: var(--keycap-shift-color, var(--_accent-color));
--_box-placeholder-color: var(--box-placeholder-color, var(--_accent-color));
--_box-placeholder-pressed-color: var(--box-placeholder-pressed-color, var(--keycap-text-pressed));
}
.is-math-mode .MLK__rows .if-text-mode,
.is-text-mode .MLK__rows .if-math-mode {
display: none;
}
.if-can-undo,
.if-can-redo,
.if-can-copy,
.if-can-cut,
.if-can-paste {
opacity: 0.4;
pointer-events: none;
}
.can-undo .if-can-undo,
.can-redo .if-can-redo,
.can-copy .if-can-copy,
.can-cut .if-can-cut,
.can-paste .if-can-paste {
opacity: 1;
pointer-events: all;
}
body > .ML__keyboard {
position: fixed;
--_padding-bottom: calc(var(--keyboard-padding-bottom, 0px) + env(safe-area-inset-bottom, 0));
}
body > .ML__keyboard.is-visible > .MLK__backdrop {
box-shadow: 0 -5px 6px rgba(0, 0, 0, 0.08);
border-top: 1px solid var(--_border);
}
body > .ML__keyboard.backdrop-is-transparent.is-visible > .MLK__backdrop {
box-shadow: none;
border: none;
}
body > .ML__keyboard.is-visible.animate > .MLK__backdrop {
transition: 0.28s cubic-bezier(0, 0, 0.2, 1);
transition-property: transform, opacity;
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}
.ML__keyboard {
position: relative;
overflow: hidden;
top: 0;
left: 0;
height: 100%;
width: 100%;
z-index: var(--_keyboard-zindex);
box-sizing: border-box;
outline: none;
border: none;
margin: 0;
padding: 0;
line-height: 1;
overflow-wrap: unset;
text-align: left;
vertical-align: baseline;
cursor: auto;
white-space: pre;
box-shadow: none;
opacity: 1;
transform: none;
pointer-events: none;
}
.ML__keyboard :where(div) {
box-sizing: border-box;
outline: none;
border: none;
margin: 0;
padding: 0;
line-height: 1;
overflow-wrap: unset;
text-align: left;
vertical-align: baseline;
cursor: auto;
white-space: pre;
box-shadow: none;
transform: none;
}
.MLK__backdrop {
position: absolute;
bottom: calc(-1 * var(--_keyboard-height));
width: 100%;
height: var(--_keyboard-height);
box-sizing: border-box;
padding-top: var(--_padding-top);
padding-bottom: var(--_padding-bottom);
padding-left: var(--_padding-horizontal);
padding-right: var(--_padding-horizontal);
opacity: 0;
visibility: hidden;
transform: translate(0, 0);
background: var(--_background);
}
.backdrop-is-transparent .MLK__backdrop {
background: transparent;
}
/* If a custom layout has a custom container/backdrop
(backdrop-is-transparent), make sure to let pointer event go through. */
.backdrop-is-transparent .MLK__plate {
background: transparent;
pointer-events: none;
}
/* If a custom layout has a custom container/backdrop, make sure to
allow pointer events on it. */
.backdrop-is-transparent .MLK__layer > div > div {
pointer-events: all;
}
.ML__keyboard.is-visible > .MLK__backdrop {
transform: translate(0, calc(-1 * var(--_keyboard-height)));
opacity: 1;
visibility: visible;
}
.caps-lock-indicator {
display: none;
width: 8px;
height: 8px;
background: #0cbc0c;
box-shadow: inset 0 0 4px 0 #13ca13, 0 0 4px 0 #a9ef48;
border-radius: 8px;
right: 8px;
top: 8px;
position: absolute;
}
.ML__keyboard.is-caps-lock .caps-lock-indicator {
display: block;
}
.ML__keyboard.is-caps-lock .shift {
background: var(--_keycap-background-active);
color: var(--_keycap-text-active);
}
.MLK__plate {
position: absolute;
top: var(--_padding-top);
left: var(--_padding-horizontal);
width: calc(100% - 2 * var(--_padding-horizontal));
margin: 0;
padding: 0;
box-sizing: border-box;
container-type: inline-size;
touch-action: none;
-webkit-user-select: none;
user-select: none;
pointer-events: all;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 16px;
/* Size of toolbar labels */
font-weight: 400;
text-shadow: none;
}
.ML__box-placeholder {
color: var(--_box-placeholder-color);
}
.MLK__tex {
font-family: KaTeX_Main, KaTeX_Math, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
}
.MLK__tex-math {
font-family: KaTeX_Math, KaTeX_Main, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
font-style: italic;
}
.MLK__layer {
display: none;
outline: none;
}
.MLK__layer.is-visible {
display: flex;
flex-flow: column;
}
/* Keyboard layouts are made or rows of keys... */
.MLK__rows {
--_keycap-width: min(var(--_keycap-max-width), 10cqw);
display: flex;
flex-flow: column;
align-items: center;
border-collapse: separate;
clear: both;
border: 0;
margin: 0;
margin-bottom: var(--_keycap-gap);
gap: var(--_keycap-gap);
/* If the styling include, e.g., some shadows, they will be
cut off by the overflow. In that case, set the padding to
compensate. */
padding-left: var(--_row-padding-left);
padding-right: var(--_row-padding-right);
overflow: visible;
touch-action: none;
}
.MLK__rows > .MLK__row {
display: flex;
flex-flow: row;
justify-content: center;
width: 100%;
gap: var(--_keycap-gap);
margin: 0;
padding: 0;
/* For the alignment of the text on some modifiers (e.g. shift) */
/* Extra spacing between two adjacent keys */
}
.MLK__rows > .MLK__row .tex {
font-family: KaTeX_Math, KaTeX_Main, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
}
.MLK__rows > .MLK__row .tex-math {
font-family: KaTeX_Math, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
}
.MLK__rows > .MLK__row .big-op {
font-size: calc(1.25 * var(--_keycap-font-size));
}
.MLK__rows > .MLK__row .small {
font-size: var(--_keycap-small-font-size);
}
.MLK__rows > .MLK__row .bottom {
justify-content: flex-end;
}
.MLK__rows > .MLK__row .left {
align-items: flex-start;
padding-left: 12px;
}
.MLK__rows > .MLK__row .right {
align-items: flex-end;
padding-right: 12px;
}
.MLK__rows > .MLK__row .w0 {
width: 0;
}
.MLK__rows > .MLK__row .w5 {
width: calc(0.5 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .w15 {
width: calc(1.5 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .w20 {
width: calc(2 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .w40 {
width: calc(4 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .w50 {
width: calc(5 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .MLK__keycap.w50 {
font-size: 80%;
padding-top: 10px;
font-weight: 100;
}
.MLK__rows > .MLK__row .separator {
background: transparent;
border: none;
pointer-events: none;
}
.MLK__rows > .MLK__row .horizontal-rule {
height: 6px;
margin-top: 3px;
margin-bottom: 0;
width: 100%;
border-radius: 0;
border-top: var(--_horizontal-rule);
}
.MLK__rows > .MLK__row .ghost {
background: var(--_toolbar-background);
border: none;
color: var(--_toolbar-text);
}
.MLK__rows > .MLK__row .ghost:hover {
background: var(--_toolbar-background-hover);
}
.MLK__rows > .MLK__row .bigfnbutton {
font-size: var(--_keycap-extra-small-font-size);
}
.MLK__rows > .MLK__row .shift,
.MLK__rows > .MLK__row .action {
color: var(--_keycap-secondary-text);
background: var(--_keycap-secondary-background);
border-color: var(--_keycap-secondary-border);
border-bottom-color: var(--_keycap-secondary-border-bottom);
line-height: 0.8;
font-size: min(1rem, var(--_keycap-small-font-size));
font-weight: 600;
padding: 8px 12px 8px 12px;
}
.MLK__rows > .MLK__row .shift:hover,
.MLK__rows > .MLK__row .action:hover {
background: var(--_keycap-secondary-background-hover);
}
.MLK__rows > .MLK__row .action.primary {
background: var(--_keycap-primary-background);
color: var(--_keycap-primary-text);
}
.MLK__rows > .MLK__row .action.primary:hover {
background: var(--_keycap-primary-background-hover);
color: var(--_keycap-primary-text);
}
.MLK__rows > .MLK__row .shift.selected,
.MLK__rows > .MLK__row .action.selected {
color: var(--_toolbar-text-active);
}
.MLK__rows > .MLK__row .shift.selected.is-pressed,
.MLK__rows > .MLK__row .action.selected.is-pressed,
.MLK__rows > .MLK__row .shift.selected.is-active,
.MLK__rows > .MLK__row .action.selected.is-active {
color: white;
}
.MLK__rows > .MLK__row .warning {
background: #cd0030;
color: white;
}
.MLK__rows > .MLK__row .warning svg.svg-glyph {
width: 24px;
height: 24px;
min-height: 24px;
}
/** A regular keycap
* Use the :where() pseudo-class to give it a very low specifity,
* so that it can be overriden by custom style.
*/
:where(.MLK__rows > .MLK__row div) {
display: flex;
flex-flow: column;
align-items: center;
justify-content: space-evenly;
width: calc(var(--_keycap-width) - var(--_keycap-gap));
height: var(--_keycap-height);
box-sizing: border-box;
padding: 0;
vertical-align: top;
text-align: center;
float: left;
color: var(--_keycap-text);
fill: currentColor;
font-size: var(--_keycap-font-size);
background: var(--_keycap-background);
border: 1px solid var(--_keycap-border);
border-bottom-color: var(--_keycap-border-bottom);
border-radius: 6px;
cursor: pointer;
touch-action: none;
/* Keys with a variants panel */
position: relative;
overflow: hidden;
-webkit-user-select: none;
user-select: none;
-webkit-tap-highlight-color: transparent;
}
:where(.MLK__rows > .MLK__row div):hover {
overflow: visible;
background: var(--_keycap-background-hover);
}
:where(.MLK__rows > .MLK__row div) .ML__latex {
pointer-events: none;
touch-action: none;
}
:where(.MLK__rows > .MLK__row div) svg.svg-glyph {
margin: 8px 0;
width: 20px;
height: 20px;
min-height: 20px;
}
:where(.MLK__rows > .MLK__row div) svg.svg-glyph-lg {
margin: 8px 0;
width: 24px;
height: 24px;
min-height: 24px;
}
:where(.MLK__rows > .MLK__row div).MLK__tex-math {
font-size: 25px;
}
:where(.MLK__rows > .MLK__row div).is-pressed {
background: var(--_keycap-background-pressed);
color: var(--_keycap-text-pressed);
--_box-placeholder-color: var(--_box-placeholder-pressed-color);
}
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active,
:where(.MLK__rows > .MLK__row div).action.is-active,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed,
:where(.MLK__rows > .MLK__row div).action.is-pressed {
z-index: calc(var(--_keyboard-zindex) - 5);
}
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active aside,
:where(.MLK__rows > .MLK__row div).action.is-active aside,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed aside,
:where(.MLK__rows > .MLK__row div).action.is-pressed aside {
display: none;
}
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active .MLK__shift,
:where(.MLK__rows > .MLK__row div).action.is-active .MLK__shift,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed .MLK__shift,
:where(.MLK__rows > .MLK__row div).action.is-pressed .MLK__shift {
display: none;
}
:where(.MLK__rows > .MLK__row div).shift.is-pressed,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed,
:where(.MLK__rows > .MLK__row div).action.is-pressed {
background: var(--_keycap-background-pressed);
color: var(--_keycap-text-pressed);
}
:where(.MLK__rows > .MLK__row div).shift.is-active,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active,
:where(.MLK__rows > .MLK__row div).action.is-active {
background: var(--_keycap-background-active);
color: var(--_keycap-text-active);
--_box-placeholder-color: var(--_box-placeholder-pressed-color);
}
:where(.MLK__rows > .MLK__row div) small {
color: var(--_keycap-secondary-text);
}
:where(.MLK__rows > .MLK__row div) aside {
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 10px;
line-height: 10px;
color: var(--_keycap-secondary-text);
}
/* Add an attribute 'data-tooltip' to display a tooltip on hover.
Note there are a different set of tooltip rules for the keyboard toggle
(it's in a different CSS tree) */
.ML__keyboard [data-tooltip] {
position: relative;
}
.ML__keyboard [data-tooltip]::after {
position: absolute;
display: inline-table;
content: attr(data-tooltip);
top: inherit;
bottom: 100%;
width: max-content;
max-width: 200px;
padding: 8px 8px;
background: #616161;
color: #fff;
text-align: center;
z-index: 2;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
border-radius: 2px;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-weight: 400;
font-size: 12px;
transition: all 0.15s cubic-bezier(0.4, 0, 1, 1) 1s;
opacity: 0;
transform: scale(0.5);
}
.ML__keyboard [data-tooltip]:hover {
position: relative;
}
.ML__keyboard [data-tooltip]:hover::after {
opacity: 1;
transform: scale(1);
}
.MLK__toolbar {
align-self: center;
display: flex;
flex-flow: row;
justify-content: space-between;
width: 100%;
max-width: 996px;
min-height: 32px;
/* Icons for undo/redo, etc. */
}
.MLK__toolbar svg {
height: 20px;
width: 20px;
}
.MLK__toolbar > .left {
position: relative;
display: flex;
justify-content: flex-start;
flex-flow: row;
}
.MLK__toolbar > .right {
display: flex;
justify-content: flex-end;
flex-flow: row;
}
.MLK__toolbar > div > div {
/* "button" in the toolbar */
display: flex;
align-items: center;
justify-content: center;
color: var(--_toolbar-text);
fill: currentColor;
background: var(--_toolbar-background);
font-size: var(--_toolbar-font-size);
padding: 4px 15px;
cursor: pointer;
width: max-content;
min-width: 42px;
min-height: 34px;
border: none;
padding-left: 10px;
padding-right: 10px;
padding-bottom: 8px;
padding-top: 8px;
margin-top: 0;
margin-bottom: 4px;
margin-left: 4px;
margin-right: 4px;
border-radius: 8px;
box-shadow: none;
border-bottom: 2px solid transparent;
}
.MLK__toolbar > div > div:not(.disabled):not(.selected):hover {
background: var(--_toolbar-background-hover);
}
.MLK__toolbar > div > div.disabled svg,
.MLK__toolbar > div > div.disabled:hover svg,
.MLK__toolbar > div > div.disabled.is-pressed svg {
color: var(--_toolbar-text);
opacity: 0.2;
}
.MLK__toolbar > div > div:hover,
.MLK__toolbar > div > div:active,
.MLK__toolbar > div > div.is-pressed,
.MLK__toolbar > div > div.is-active {
color: var(--_toolbar-text-active);
}
.MLK__toolbar > div > div.selected {
color: var(--_toolbar-text-active);
background: var(--_toolbar-background-selected);
border-radius: 0;
border-bottom-color: var(--_toolbar-text-active);
padding-bottom: 4px;
margin-bottom: 8px;
}
/* This is the element that displays variants on press+hold */
.MLK__variant-panel {
visibility: hidden;
position: fixed;
display: flex;
flex-flow: row wrap-reverse;
justify-content: center;
align-content: center;
margin: 0;
padding: 0;
bottom: auto;
top: 0;
box-sizing: content-box;
transform: none;
z-index: calc(var(--_keyboard-zindex) + 1);
touch-action: none;
max-width: 350px;
background: var(--_variant-panel-background);
text-align: center;
border-radius: 6px;
padding: 6px;
box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
transition: none;
}
.MLK__variant-panel.is-visible {
visibility: visible;
}
.MLK__variant-panel.compact {
--_variant-keycap-length: var(--variant-keycap-length, 50px);
--_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);
--_variant-keycap-aside-font-size: var(--variant-keycap-aside-font-size, 10px);
}
.MLK__variant-panel .item {
display: flex;
flex-flow: column;
align-items: center;
justify-content: center;
font-size: var(--_variant-keycap-font-size);
height: var(--_variant-keycap-length);
width: var(--_variant-keycap-length);
margin: 0;
box-sizing: border-box;
border-radius: 5px;
border: 1px solid transparent;
background: transparent;
pointer-events: all;
cursor: pointer;
color: var(--_variant-keycap-text);
fill: currentColor;
}
@media (max-height: 412px) {
.MLK__variant-panel .item {
--_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);
--_variant-keycap-length: var(--variant-keycap-length, 50px);
}
}
.MLK__variant-panel .item .ML__latex {
pointer-events: none;
}
.MLK__variant-panel .item.is-active {
background: var(--_variant-keycap-background-active);
color: var(--_variant-keycap-text-active);
}
.MLK__variant-panel .item.is-pressed {
background: var(--_variant-keycap-background-pressed);
color: var(--_variant-keycap-text-pressed);
}
.MLK__variant-panel .item.small {
font-size: var(--_keycap-small-font-size);
}
.MLK__variant-panel .item.swatch-button {
box-sizing: border-box;
background: #fbfbfb;
}
.MLK__variant-panel .item.swatch-button > span {
display: inline-block;
margin: 6px;
width: calc(100% - 12px);
height: calc(100% - 12px);
border-radius: 50%;
}
.MLK__variant-panel .item.swatch-button:hover {
background: #f0f0f0;
}
.MLK__variant-panel .item.swatch-button:hover > span {
border-radius: 2px;
}
.MLK__variant-panel .item.box > div,
.MLK__variant-panel .item.box > span {
border: 1px dashed rgba(0, 0, 0, 0.24);
}
.MLK__variant-panel .item .warning {
min-height: 60px;
min-width: 60px;
background: #cd0030;
color: white;
padding: 5px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 5px;
}
.MLK__variant-panel .item .warning.is-pressed,
.MLK__variant-panel .item .warning.is-active {
background: red;
}
.MLK__variant-panel .item .warning svg.svg-glyph {
width: 50px;
height: 50px;
}
.MLK__variant-panel .item aside {
font-size: var(--_variant-keycap-aside-font-size);
line-height: 12px;
opacity: 0.78;
padding-top: 2px;
}
.MLK__keycap {
position: relative;
}
.MLK__shift {
display: block;
position: absolute;
right: 4px;
top: 4px;
font-size: var(--_keycap-shift-font-size);
color: var(--_keycap-shift-color);
}
.hide-shift .MLK__shift {
display: none;
}
@media (max-width: 414px) {
.MLK__variant-panel {
max-width: 350px;
--_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);
--_variant-keycap-length: var(--variant-keycap-length, 50px);
}
}
/* @xs breakpoint: iPhone 5 */
@container (max-width: 414px) {
.MLK__rows {
--_keycap-gap: max(var(--_keycap-gap, 2px), 2px);
--_keycap-height: max(var(--_keycap-height), 42px);
--_keycap-width: min(min(var(--_keycap-max-width), 10cqw), 62px);
}
.MLK__toolbar > div > div {
font-size: 100%;
margin-left: 2px;
margin-right: 2px;
}
.MLK__rows .shift,
.MLK__rows .action {
font-size: 65%;
}
.MLK__rows .warning svg.svg-glyph {
width: 14px;
height: 14px;
min-height: 14px;
}
}
@container (max-width: 744px) {
.MLK__rows {
--_keycap-gap: max(var(--keycap-gap, 2px), 2px);
--_keycap-height: max(var(--keycap-height, 52px), 52px);
--_keycap-width: min(min(var(--_keycap-max-width), 10cqw), 62px);
}
.MLK__toolbar > div > div {
padding-left: 0;
padding-right: 0;
}
.MLK__tooltip::after {
padding: 8px 16px;
font-size: 16px;
}
.MLK__rows > .MLK__row > div.fnbutton {
font-size: 16px;
}
.MLK__rows > .MLK__row > div.bigfnbutton {
font-size: calc(var(--_keycap-extra-small-font-size) / 1.55);
}
.MLK__rows > .MLK__row > div.small {
font-size: 13px;
}
.MLK__rows > .MLK__row > div > aside {
display: none;
}
.MLK__shift {
display: none;
}
}
/* Medium breakpoint: larger phones */
@container (max-width: 768px) {
.MLK__rows {
--_keycap-height: max(var(--keycap-height, 42px), 42px);
}
.MLK__rows > .MLK__row > div > small {
font-size: 14px;
}
}
@media (max-height: 768px) {
.MLK__rows {
--_keycap-height: max(var(--keycap-height, 42px), 42px);
}
.MLK__rows > .MLK__row > div > small {
font-size: 14px;
}
}
@container (max-width: 1444px) {
.MLK__rows .if-wide {
display: none;
}
}
@media (prefers-color-scheme: dark) {
.ML__keyboard {
--_accent-color: var(--keyboard-accent-color, #0b5c9c);
--_background: var(--keyboard-background, #151515);
--_border: var(--keyboard-border, transparent);
--_toolbar-text: var(--keyboard-toolbar-text, #e3e4e8);
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #303030);
--keyboard-toolbar-background-hover: #303030;
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #303030);
--_keycap-background: var(--keycap-background, #1f2022);
--_keycap-background-hover: var(--keycap-background-hover, #2f3032);
--_keycap-border: var(--_keycap-border, transparent);
--_keycap-border-bottom: var(--_keycap-border-bottom, transparent);
--_keycap-text: var(--keycap-text, #e3e4e8);
--_keycap-secondary-background: var(--keycap-secondary-background, #3d4144);
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #4d5154);
--_keycap-secondary-text: var(--keycap-secondary-text, #e7ebee);
--keycap-secondary-border: transparent;
--keycap-secondary-border-bottom: transparent;
--_keycap-secondary-border: var(--keycap-secondary-border, transparent);
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, transparent);
--_variant-panel-background: var(--variant-panel-background, #303030);
--_variant-keycap-text-active: var(--variant-keycap-text-active, #fff);
}
}
/* Same as the media query, but with a class */
[theme='dark'] .ML__keyboard {
--_accent-color: var(--keyboard-accent-color, #0b5c9c);
--_background: var(--keyboard-background, #151515);
--_border: var(--keyboard-border, transparent);
--_toolbar-text: var(--keyboard-toolbar-text, #e3e4e8);
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #303030);
--keyboard-toolbar-background-hover: #303030;
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #303030);
--_keycap-background: var(--keycap-background, #1f2022);
--_keycap-background-hover: var(--keycap-background-hover, #2f3032);
--_keycap-border: var(--_keycap-border, transparent);
--_keycap-border-bottom: var(--_keycap-border-bottom, transparent);
--_keycap-text: var(--keycap-text, #e3e4e8);
--_keycap-secondary-background: var(--keycap-secondary-background, #3d4144);
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #4d5154);
--_keycap-secondary-text: var(--keycap-secondary-text, #e7ebee);
--keycap-secondary-border: transparent;
--keycap-secondary-border-bottom: transparent;
--_keycap-secondary-border: var(--keycap-secondary-border, transparent);
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, transparent);
--_variant-panel-background: var(--variant-panel-background, #303030);
--_variant-keycap-text-active: var(--variant-keycap-text-active, #fff);
}
[theme='light'] .ML__keyboard {
--_accent-color: var(--keyboard-accent-color, #0c75d8);
--_background: var(--keyboard-background, #cacfd7);
--_border: var(--keyboard-border, #ddd);
--_toolbar-text: var(--keyboard-toolbar-text, #2c2e2f);
--_toolbar-background: var(--keyboard-toolbar-background, transparent);
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #eee);
--_toolbar-background-selected: var(--keyboard-toolbar-background-selected, transparent);
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #fff);
--_keycap-background: var(--keycap-background, white);
--_keycap-background-hover: var(--keycap-background-hover, #f5f5f7);
--_keycap-background-active: var(--keycap-background-active, var(--_accent-color));
--_keycap-background-pressed: var(--keycap-background-pressed, var(--_accent-color));
--_keycap-border: var(--_keycap-border, #e5e6e9);
--_keycap-border-bottom: var(--_keycap-border-bottom, #8d8f92);
--_keycap-text: var(--keycap-text, #000);
--_keycap-text-active: var(--keycap-text-active, #fff);
--_keycap-text-hover: var(--keycap-text-hover, var(--_keycap-text));
--_keycap-text-pressed: var(--keycap-text-pressed, #fff);
--_keycap-shift-text: var(--keycap-shift-text, var(--_accent-color));
--_keycap-secondary-background: var(--keycap-secondary-background, #a0a9b8);
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #7d8795);
--_keycap-secondary-text: var(--keycap-secondary-text, #060707);
--_keycap-secondary-border: var(--keycap-secondary-border, #c5c9d0);
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, #989da6);
--_variant-panel-background: var(--variant-panel-background, #fff);
--_variant-keycap-text: var(--variant-keycap-textvar, var(--_keycap-text));
--_variant-keycap-text-active: var(--variant-keycap-text-active, var(--_keycap-text-active));
--_variant-keycap-background-active: var(--variant-keycap-background-active, var(--_accent-color));
}
`,G0=`:host {
--primary-color: #5898ff;
--primary-color-dimmed: #c0c0f0;
--primary-color-dark: var(--blue-500);
--primary-color-light: var(--blue-100);
--primary-color-reverse: #ffffff;
--secondary-color: #ff8a65;
--secondary-color-dimmed: #f0d5c5;
--secondary-color-dark: var(--orange-500);
--secondary-color-light: var(--orange-100);
--secondary-color-reverse: #ffffff;
--link-color: #5898ff;
--link-color-dimmed: #c5c5c5;
--link-color-dark: #121212;
--link-color-light: #e2e2e2;
--link-color-reverse: #ffffff;
--semantic-blue: var(--blue-700);
--semantic-red: var(--red-400);
--semantic-orange: var(--orange-400);
--semantic-green: var(--green-700);
--neutral-100: #f5f5f5;
--neutral-200: #eeeeee;
--neutral-300: #e0e0e0;
--neutral-400: #bdbdbd;
--neutral-500: #9e9e9e;
--neutral-600: #757575;
--neutral-700: #616161;
--neutral-800: #424242;
--neutral-900: #212121;
--red-25: #fff8f7;
--red-50: #fff1ef;
--red-100: #ffeae6;
--red-200: #ffcac1;
--red-300: #ffa495;
--red-400: #ff7865;
--red-500: #f21c0d;
--red-600: #e50018;
--red-700: #d30024;
--red-800: #bd002c;
--red-900: #a1002f;
--orange-25: #fffbf8;
--orange-50: #fff7f1;
--orange-100: #fff3ea;
--orange-200: #ffe1c9;
--orange-300: #ffcca2;
--orange-400: #ffb677;
--orange-500: #fe9310;
--orange-600: #f58700;
--orange-700: #ea7c00;
--orange-800: #dc6d00;
--orange-900: #ca5b00;
--brown-25: #fff8ef;
--brown-50: #fff1df;
--brown-100: #ffe9ce;
--brown-200: #ebcca6;
--brown-300: #cdaf8a;
--brown-400: #af936f;
--brown-500: #856a47;
--brown-600: #7f5e34;
--brown-700: #78511f;
--brown-800: #6e4200;
--brown-900: #593200;
--yellow-25: #fffdf9;
--yellow-50: #fffcf2;
--yellow-100: #fffaec;
--yellow-200: #fff2ce;
--yellow-300: #ffe8ab;
--yellow-400: #ffdf85;
--yellow-500: #ffcf33;
--yellow-600: #f1c000;
--yellow-700: #dfb200;
--yellow-800: #c9a000;
--yellow-900: #ad8a00;
--lime-25: #f4ffee;
--lime-50: #e9ffdd;
--lime-100: #ddffca;
--lime-200: #a8fb6f;
--lime-300: #94e659;
--lime-400: #80d142;
--lime-500: #63b215;
--lime-600: #45a000;
--lime-700: #268e00;
--lime-800: #007417;
--lime-900: #005321;
--green-25: #f5fff5;
--green-50: #ebffea;
--green-100: #e0ffdf;
--green-200: #a7ffa7;
--green-300: #5afa65;
--green-400: #45e953;
--green-500: #17cf36;
--green-600: #00b944;
--green-700: #00a34a;
--green-800: #008749;
--green-900: #00653e;
--teal-25: #f3ffff;
--teal-50: #e6fffe;
--teal-100: #d9fffe;
--teal-200: #8dfffe;
--teal-300: #57f4f4;
--teal-400: #43e5e5;
--teal-500: #17cfcf;
--teal-600: #00c2c0;
--teal-700: #00b5b1;
--teal-800: #00a49e;
--teal-900: #009087;
--cyan-25: #f7fcff;
--cyan-50: #eff8ff;
--cyan-100: #e7f5ff;
--cyan-200: #c2e6ff;
--cyan-300: #95d5ff;
--cyan-400: #61c4ff;
--cyan-500: #13a7ec;
--cyan-600: #069eda;
--cyan-700: #0095c9;
--cyan-800: #0088b2;
--cyan-900: #0a7897;
--blue-25: #f7faff;
--blue-50: #eef5ff;
--blue-100: #e5f1ff;
--blue-200: #bfdbff;
--blue-300: #92c2ff;
--blue-400: #63a8ff;
--blue-500: #0d80f2;
--blue-600: #0077db;
--blue-700: #006dc4;
--blue-800: #0060a7;
--blue-900: #005086;
--indigo-25: #f8f7ff;
--indigo-50: #f1efff;
--indigo-100: #eae7ff;
--indigo-200: #ccc3ff;
--indigo-300: #ac99ff;
--indigo-400: #916aff;
--indigo-500: #63c;
--indigo-600: #5a21b2;
--indigo-700: #4e0b99;
--indigo-800: #3b0071;
--indigo-900: #220040;
--purple-25: #fbf7ff;
--purple-50: #f8f0ff;
--purple-100: #f4e8ff;
--purple-200: #e4c4ff;
--purple-300: #d49aff;
--purple-400: #c36aff;
--purple-500: #a219e6;
--purple-600: #9000c4;
--purple-700: #7c009f;
--purple-800: #600073;
--purple-900: #3d0043;
--magenta-25: #fff8fb;
--magenta-50: #fff2f6;
--magenta-100: #ffebf2;
--magenta-200: #ffcddf;
--magenta-300: #ffa8cb;
--magenta-400: #ff7fb7;
--magenta-500: #eb4799;
--magenta-600: #da3689;
--magenta-700: #c82179;
--magenta-800: #b00065;
--magenta-900: #8a004c;
}
@media (prefers-color-scheme: dark) {
:host {
--semantic-blue: var(--blue-700);
--semantic-red: var(--red-400);
--semantic-orange: var(--orange-400);
--semantic-green: var(--green-700);
--semantic-bg-blue: var(--blue-25);
--semantic-bg-red: var(--red-25);
--semantic-bg-orange: var(--orange-25);
--semantic-bg-green: var(--green-25);
--neutral-100: #121212;
--neutral-200: #424242;
--neutral-300: #616161;
--neutral-400: #757575;
--neutral-500: #9e9e9e;
--neutral-600: #bdbdbd;
--neutral-700: #e0e0e0;
--neutral-800: #eeeeee;
--neutral-900: #f5f5f5;
}
}
:host([theme='dark']) {
--semantic-blue: var(--blue-700);
--semantic-red: var(--red-400);
--semantic-orange: var(--orange-400);
--semantic-green: var(--green-700);
--semantic-bg-blue: var(--blue-25);
--semantic-bg-red: var(--red-25);
--semantic-bg-orange: var(--orange-25);
--semantic-bg-green: var(--green-25);
--neutral-100: #121212;
--neutral-200: #424242;
--neutral-300: #616161;
--neutral-400: #757575;
--neutral-500: #9e9e9e;
--neutral-600: #bdbdbd;
--neutral-700: #e0e0e0;
--neutral-800: #eeeeee;
--neutral-900: #f5f5f5;
}
/* @media (prefers-color-scheme: dark) {
:host {
--label-color: #fff;
--active-label-color: #000;
--menu-bg: #525252;
--active-bg: #5898ff;
--active-bg-dimmed: #5c5c5c;
}
} */
:host {
--ui-font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont,
'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji',
'Segoe UI Emoji', 'Segoe UI Symbol';
--ui-font-size: 14px;
--ui-line-height: 1.5;
--ui-letter-spacing: 0.007em;
--mono-font-family: 'Berkeley Mono', 'JetBrains Mono', 'IBM Plex Mono',
'Source Code Pro', Menlo, Monaco, 'Courier New', monospace;
--ui-layer-1: var(--neutral-100);
--ui-layer-2: var(--neutral-200);
--ui-layer-3: var(--neutral-300);
--ui-layer-4: var(--neutral-400);
--ui-layer-5: var(--neutral-500);
--ui-layer-6: var(--neutral-600);
--ui-border-color: var(--primary-color);
--ui-border-radius: 4px;
--ui-text: var(--neutral-900);
--ui-text-secondary: var(--neutral-700);
--ui-text-placeholder: var(--neutral-500);
--ui-text-muted: var(--neutral-300);
/** A field is a UI element in which a user can type data, for
* example an input or textarea element.
*/
--ui-field-bg: var(--neutral-100);
--ui-field-bg-hover: var(--neutral-100);
--ui-field-bg-disabled: var(--neutral-300);
--ui-field-bg-invalid: var(--red-100);
--ui-field-bg-focus: var(--neutral-100);
--ui-field-border: 0.5px solid var(--border-color);
--ui-field-border-hover: 0.5px solid var(--border-color);
--ui-field-border-disabled: 0.5px solid var(--border-color);
--ui-field-border-invalid: 0.5px solid var(--border-color);
--ui-field-border-focus: 0.5px solid var(--border-color);
--ui-menu-bg: var(--neutral-100);
--ui-menu-text: var(--neutral-900);
--ui-menu-bg-hover: var(--neutral-200);
--ui-menu-text-hover: var(--neutral-900);
/** The \`active\` state is used for the state of menu items
* when they are selected.
*/
--ui-menu-bg-active: var(--primary-color);
--ui-menu-text-active: var(--primary-color-reverse);
/** The \`active-muted\` set is used for the state of
* submenus when they are open.
*/
--ui-menu-bg-active-muted: var(--neutral-300);
--ui-menu-text-active-muted: var(--neutral-900);
/* --ui-menu-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.302),
0 2px 6px 2px rgba(60, 64, 67, 0.149); */
--ui-menu-shadow: 0 0 2px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 0, 0, 0.2);
--ui-menu-divider: 0.5px solid #c7c7c7;
/* var(--neutral-300); */
--ui-menu-z-index: 10000;
--page-bg: var(--neutral-100);
--content-bg: var(--neutral-200);
}
@media (prefers-color-scheme: dark) {
:host {
--ui-menu-bg: var(--neutral-200);
}
}
:host([theme='dark']) {
--ui-menu-bg: var(--neutral-200);
}
/* PingFang SC is a macOS font. Microsoft Yahei is a Windows font.
Noto is a Linux/Android font.
*/
:lang(zh-cn),
:lang(zh-sg),
:lang(zh-my),
:lang(zh) {
--ui-font-family: -apple-system, system-ui, 'PingFang SC', 'Hiragino Sans GB',
'Noto Sans CJK SC', 'Noto Sans SC', 'Noto Sans', 'Microsoft Yahei UI',
'Microsoft YaHei New', 'Microsoft Yahei', '\u5FAE\u8F6F\u96C5\u9ED1', SimSun, '\u5B8B\u4F53',
STXihei, '\u534E\u6587\u7EC6\u9ED1', sans-serif;
}
:lang(zh-tw),
:lang(zh-hk),
:lang(zh-mo) {
--ui-font-family: -apple-system, system-ui, 'Noto Sans',
'Microsoft JhengHei UI', 'Microsoft JhengHei', '\u5FAE\u8EDF\u6B63\u9ED1\u9AD4', '\u65B0\u7D30\u660E\u9AD4',
'PMingLiU', '\u7D30\u660E\u9AD4', 'MingLiU', sans-serif;
}
:lang(ja),
:lang(ja-jp),
:lang(ja-jp-mac) {
--ui-font-family: -apple-system, system-ui, 'Hiragino Sans',
'Hiragino Kaku Gothic ProN', 'Noto Sans CJK JP', 'Noto Sans JP', 'Noto Sans',
'\u6E38\u30B4\u30B7\u30C3\u30AF', '\u6E38\u30B4\u30B7\u30C3\u30AF\u4F53', YuGothic, 'Yu Gothic', '\u30E1\u30A4\u30EA\u30AA', Meiryo,
'\uFF2D\uFF33 \uFF30\u30B4\u30B7\u30C3\u30AF', 'MS PGothic', sans-serif;
}
:lang(ko),
:lang(ko-kr),
:lang(ko-kr-std) {
--ui-font-family: -apple-system, system-ui, 'Noto Sans CJK KR', 'Noto Sans KR',
'Noto Sans', 'Malgun Gothic', '\uB9D1\uC740 \uACE0\uB515', 'Apple SD Gothic Neo',
'\uC560\uD50C SD \uC0B0\uB3CC\uACE0\uB515 Neo', 'Apple SD \uC0B0\uB3CC\uACE0\uB515 Neo', '\uB3CB\uC6C0', Dotum, sans-serif;
}
:lang(ko-kr-apple) {
--ui-font-family: -apple-system, system-ui, 'Noto Sans CJK KR', 'Noto Sans KR',
'Noto Sans', 'Apple SD Gothic Neo', '\uC560\uD50C SD \uC0B0\uB3CC\uACE0\uB515 Neo',
'Apple SD \uC0B0\uB3CC\uACE0\uB515 Neo', '\uB3CB\uC6C0', Dotum, sans-serif;
}
:lang(zh-cn),
:lang(zh-sg),
:lang(zh-my),
:lang(zh),
:lang(zh-tw),
:lang(zh-hk),
:lang(zh-mo),
:lang(ja),
:lang(ja-jp),
:lang(ja-jp-mac),
:lang(ko),
:lang(ko-kr),
:lang(ko-kr-std),
:lang(ko-kr-apple) {
--ui-font-size: 1rem;
--ui-line-height: 1.7;
--ui-letter-spacing: 0;
}
:dir(rtl) {
--ui-line-height: auto;
--ui-letter-spacing: 0;
}
`,Z0=`.ui-menu *,
.ui-menu ::before,
.ui-menu ::after {
box-sizing: border-box;
}
.ui-menu {
display: none;
color-scheme: light dark;
-webkit-user-select: none;
/* Important: Safari iOS doesn't respect user-select */
user-select: none;
cursor: default;
-webkit-touch-callout: none;
-webkit-tap-highlight-color: rgba(0 0 0 0);
--active-label-color: #fff;
/* ui-menu-text-active */
--label-color: #121212;
/* ui-menu-text */
--menu-bg: #e2e2e2;
/* ui-menu-background */
--active-bg: #5898ff;
/* ui-menu-background-active */
--active-bg-dimmed: #c5c5c5;
/* ui-menu-background-active-muted */
}
/** Use the :where pseudo selector to make the specificity of the
* selector 0, so that it can be overridden by the user.
*/
:where(.ui-menu-container) {
position: absolute;
overflow: visible;
width: auto;
height: auto;
z-index: 10000;
border-radius: 8px;
background: var(--ui-menu-bg);
box-shadow: var(--ui-menu-shadow);
list-style: none;
padding: 6px 0 6px 0;
margin: 0;
user-select: none;
cursor: default;
color: var(--ui-menu-text);
font-weight: normal;
font-style: normal;
text-shadow: none;
text-transform: none;
letter-spacing: 0;
outline: none;
opacity: 1;
/* The [popover] elements have a 1px solid black border. Ugh. */
border: none;
width: fit-content;
height: fit-content;
}
:where(.ui-menu-container > li) {
display: flex;
flex-flow: row;
align-items: center;
padding: 1px 7px 1px 7px;
margin-top: 0;
margin-left: 6px;
margin-right: 6px;
border-radius: 4px;
white-space: nowrap;
position: relative;
outline: none;
fill: currentColor;
user-select: none;
cursor: default;
text-align: left;
color: inherit;
font-family: var(--ui-font-family);
font-size: var(--ui-font-size);
line-height: var(--ui-line-height);
letter-spacing: var(--ui-letter-spacing);
}
:where(.ui-menu-container > li > .label) {
appearance: none;
background: none;
outline: none;
width: 100%;
margin: 0;
padding: 1px 2px 1px 1px;
overflow: visible;
border: 1px solid transparent;
white-space: nowrap;
text-align: start;
}
:where(.ui-menu-container > li:has(.heading)) {
margin-top: 0.5em;
}
:where(.ui-menu-container > li > .label.heading) {
font-weight: bold;
opacity: 0.4;
}
:where(.ui-menu-container > li.indent > .label) {
margin-inline-start: 12px;
}
:where(.ui-menu-container > li > .label.indent) {
margin-inline-start: 12px;
}
:where(.ui-menu-container > li[role='divider']) {
border-bottom: 1px solid var(--ui-menu-divider);
border-radius: 0;
padding: 0;
margin-left: 15px;
margin-right: 15px;
padding-top: 5px;
margin-bottom: 5px;
width: calc(100% - 30px);
/** 100% - (margin-left + margin-right) */
}
:where(.ui-menu-container > li[aria-disabled='true']) {
opacity: 0.5;
}
:where(.ui-menu-container > li.active) {
background: var(--ui-menu-bg-active);
background: -apple-system-control-accent;
color: var(--ui-menu-text-active);
}
:where(.ui-menu-container > li.active.is-submenu-open) {
background: var(--ui-menu-bg-active-muted);
color: inherit;
}
:where(.ui-menu-container > li[aria-haspopup='true'] > .label) {
padding-inline-end: 0;
}
:where(.ui-menu-container > li[aria-haspopup='true'].active::after) {
color: var(--ui-menu-text-active);
}
/** Keyboard shortcut */
:where(.ui-menu-container > li > kbd) {
font-family: var(--ui-font-family);
margin-inline-start: 12px;
opacity: 0.4;
}
:where(.ui-menu-container > li.active > kbd) {
opacity: 0.85;
}
.ui-trailing-chevron {
display: flex;
margin-inline-start: 24px;
width: 10px;
height: 10px;
margin-bottom: 4px;
}
.ui-trailing-chevron:dir(rtl) {
transform: scaleX(-1);
}
.ui-checkmark {
display: flex;
margin-inline-end: -11px;
margin-inline-start: -4px;
margin-top: 2px;
width: 16px;
height: 16px;
}
.ui-mixedmark {
display: flex;
margin-inline-end: -11px;
margin-inline-start: -4px;
margin-top: 2px;
width: 16px;
height: 16px;
}
`,Ws;function po(e){let t="";switch(e){case"mathfield-element":t=`
:host { display: inline-block; background-color: field; color: fieldtext; border-width: 1px; border-style: solid; border-color: #acacac; border-radius: 2px; padding:4px;}
:host([hidden]) { display: none; }
:host([disabled]), :host([disabled]:focus), :host([disabled]:focus-within) { outline: none; opacity: .5; }
:host(:focus), :host(:focus-within) {
outline: Highlight auto 1px; /* For Firefox */
outline: -webkit-focus-ring-color auto 1px;
}
:host([readonly]:focus), :host([readonly]:focus-within),
:host([read-only]:focus), :host([read-only]:focus-within) {
outline: none;
}
@media (hover: none) and (pointer: coarse) {
:host(:not(:focus)) :first-child { pointer-events: none !important; }
}`;break;case"core":t=$0;break;case"mathfield":t=z0;break;case"environment-popover":t=W0;break;case"suggestion-popover":t=V0;break;case"keystroke-caption":t=H0;break;case"virtual-keyboard":t=j0;break;case"ui":t=G0;break;case"menu":t=Z0;break;default:debugger}return t}function Vo(e){return Ws||(Ws={}),Ws[e]||(Ws[e]=new CSSStyleSheet,Ws[e].replaceSync(po(e))),Ws[e]}var ks;function Cs(e){var t;if(!("adoptedStyleSheets"in document)){if(window.document.getElementById(`mathlive-style-${e}`))return;const r=window.document.createElement("style");r.id=`mathlive-style-${e}`,r.append(window.document.createTextNode(po(e))),window.document.head.appendChild(r);return}if(ks||(ks={}),((t=ks[e])!=null?t:0)!==0)ks[e]+=1;else{const r=Vo(e);document.adoptedStyleSheets=[...document.adoptedStyleSheets,r],ks[e]=1}}function Vs(e){if("adoptedStyleSheets"in document&&ks!=null&&ks[e]&&(ks[e]-=1,ks[e]<=0)){const t=Ws[e];document.adoptedStyleSheets=document.adoptedStyleSheets.filter(r=>r!==t)}}var pu=class Cd extends Qe{constructor(t){var r;super(i(F({},t),{type:"accent",body:(r=t.body)!=null?r:void 0})),t.accentChar?this.accent=t.accentChar:this.svgAccent=t==null?void 0:t.svgAccent,this.skipBoundary=!0,this.captureSelection=!0}static fromJson(t){return new Cd(t)}toJson(){return i(F({},super.toJson()),{accentChar:this.accent,svgAccent:this.svgAccent})}render(t){var r;const n=new Qr({parent:t,mathstyle:"cramp"},this.style),a=(r=Qe.createBox(n,this.body))!=null?r:new St("\u25A2",{style:this.style});let o=0;!this.hasEmptyBranch("body")&&this.body.length===2&&this.body[1].isCharacterBox()&&(o=a.skew);let _=Math.min(a.height,Ks),N;if(this.svgAccent)N=ou(this.svgAccent),_=n.metrics.bigOpSpacing1-_;else if(this.accent){const W=new St(this.accent,{fontFamily:"Main-Regular"});W.italic=0;const j=this.accent===8407?" ML__accent-vec":"";N=new St(new St(W),{classes:"ML__accent-body"+j})}N=new Ai({shift:0,children:[{box:new St(a)},-_,{box:N,marginLeft:a.left+2*o,classes:["ML__center"]}]});const z=new St(N,{type:"lift"});return this.caret&&(z.caret=this.caret),this.bind(n,z.wrap(n)),this.attachSupsub(n,{base:z})}},mu={"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\lparen":"\\rparen","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},vu=Object.fromEntries(Object.entries(mu).map(([e,t])=>[t,e]));function gu(e){var t;return(t={"[":91,"]":93,"(":40,")":41,"\\mid":8739,"|":8739,"\u2223":8739,"\u2225":8741,"\\|":8739,"\\{":123,"\\}":125,"\\lbrace":123,"\\rbrace":125,"\\lparen":40,"\\rparen":41,"\\lbrack":91,"\\rbrack":93,"\\vert":8739,"\\lvert":8739,"\\mvert":8739,"\\rvert":8739,"\\Vert":8741,"\\lVert":8741,"\\mVert":8741,"\\rVert":8741,"\\parallel":8741,"\\shortparallel":8741,"\\langle":10216,"\\rangle":10217,"\\lfloor":8970,"\\rfloor":8971,"\\lceil":8968,"\\rceil":8969,"\\ulcorner":9484,"\\urcorner":9488,"\\llcorner":9492,"\\lrcorner":9496,"\\lgroup":10222,"\\rgroup":10223,"\\lmoustache":9136,"\\rmoustache":9137,"\\surd":8730}[e])!=null?t:e.codePointAt(0)}function Y0(e,t,r,n){var a;const _=new St(gu(e),{fontFamily:"Main-Regular",isSelected:n.isSelected,classes:"ML__small-delim "+((a=n.classes)!=null?a:"")}).wrap(t);return r&&_.setTop((1-t.scalingFactor)*ts),_}function Wf(e,t,r,n,a){var o,_;const N=new Qr({parent:n,mathstyle:"textstyle"},a==null?void 0:a.style),z=new St(gu(e),{fontFamily:`Size${t}-Regular`,isSelected:a.isSelected,classes:((o=a.classes)!=null?o:"")+` ML__delim-size${t}`,type:(_=a.type)!=null?_:"ignore"}).wrap(N);return r&&z.setTop((1-N.scalingFactor)*ts),z}function Vf(e,t,r,n,a){var o;let _,N,z,W;_=z=W=gu(e),N=null;let j="Size1-Regular";e==="\\vert"||e==="\\lvert"||e==="\\rvert"||e==="\\mvert"||e==="\\mid"?z=_=W=8739:e==="\\Vert"||e==="\\lVert"||e==="\\rVert"||e==="\\mVert"||e==="\\|"?z=_=W=8741:e==="\\uparrow"?z=W=9168:e==="\\Uparrow"?z=W=8214:e==="\\downarrow"?_=z=9168:e==="\\Downarrow"?_=z=8214:e==="\\updownarrow"?(_=8593,z=9168,W=8595):e==="\\Updownarrow"?(_=8657,z=8214,W=8659):e==="["||e==="\\lbrack"?(_=9121,z=9122,W=9123,j="Size4-Regular"):e==="]"||e==="\\rbrack"?(_=9124,z=9125,W=9126,j="Size4-Regular"):e==="\\lfloor"||e==="\u230A"?(z=_=9122,W=9123,j="Size4-Regular"):e==="\\lceil"||e==="\u2308"?(_=9121,z=W=9122,j="Size4-Regular"):e==="\\rfloor"||e==="\u230B"?(z=_=9125,W=9126,j="Size4-Regular"):e==="\\rceil"||e==="\u2309"?(_=9124,z=W=9125,j="Size4-Regular"):e==="("||e==="\\lparen"?(_=9115,z=9116,W=9117,j="Size4-Regular"):e===")"||e==="\\rparen"?(_=9118,z=9119,W=9120,j="Size4-Regular"):e==="\\{"||e==="\\lbrace"?(_=9127,N=9128,W=9129,z=9130,j="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(_=9131,N=9132,W=9133,z=9130,j="Size4-Regular"):e==="\\lgroup"||e==="\u27EE"?(_=9127,W=9129,z=9130,j="Size4-Regular"):e==="\\rgroup"||e==="\u27EF"?(_=9131,W=9133,z=9130,j="Size4-Regular"):e==="\\lmoustache"||e==="\u23B0"?(_=9127,W=9133,z=9130,j="Size4-Regular"):e==="\\rmoustache"||e==="\u23B1"?(_=9131,W=9129,z=9130,j="Size4-Regular"):e==="\\surd"?(_=57345,W=9143,z=57344,j="Size4-Regular"):e==="\\ulcorner"?(_=9484,z=W=32):e==="\\urcorner"?(_=9488,z=W=32):e==="\\llcorner"?(W=9492,z=_=32):e==="\\lrcorner"&&(_=9496,z=_=32);const X=zo(_,j),ae=X.height+X.depth,he=zo(z,j),_e=he.height+he.depth,Ue=zo(W,j),yt=Ue.height+Ue.depth;let Be=0,nt=1;if(N!==null){const Ii=zo(N,j);Be=Ii.height+Ii.depth,nt=2}const wt=ae+yt+Be,st=Math.max(0,Math.ceil((t-wt)/(nt*_e))),zt=wt+st*nt*_e;let qt=ts;r&&(qt=qt*n.scalingFactor);const Gt=zt/2-qt,Hr=.008,_n=[];_n.push({box:new St(W,{fontFamily:j})}),_n.push(-Hr);const Lt=new St(z,{fontFamily:j});if(N===null)for(let Ii=0;Ii<st;Ii++)_n.push({box:Lt});else{for(let Ii=0;Ii<st;Ii++)_n.push({box:Lt});_n.push(-Hr),_n.push({box:new St(N,{fontFamily:j})}),_n.push(-Hr);for(let Ii=0;Ii<st;Ii++)_n.push({box:Lt})}_n.push(-Hr),_n.push({box:new St(_,{fontFamily:j})});let Ra="";j==="Size1-Regular"?Ra=" delim-size1":j==="Size4-Regular"&&(Ra=" delim-size4");const ys=new Ai({bottom:Gt,children:_n},{classes:Ra});return new St(ys,i(F({},a!=null?a:{}),{classes:((o=a==null?void 0:a.classes)!=null?o:"")+" ML__delim-mult"}))}var Hf=new Set(["(",")","\\lparen","\\rparen","[","]","\\lbrack","\\rbrack","\\{","\\}","\\lbrace","\\rbrace","\\lfloor","\\rfloor","\\lceil","\\rceil","\\surd","\u230A","\u230B","\u2308","\u2309"]),X0=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\mvert","\\mid","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache","\u27EE","\u27EF","\u23B0","\u23B1"]),jf=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),q0=[0,1.2,1.8,2.4,3];function J0(e,t,r,n){return e===void 0||e==="."?mo(r,n.classes):(e==="<"||e==="\\lt"||e==="\u27E8"?e="\\langle":(e===">"||e==="\\gt"||e==="\u27E9")&&(e="\\rangle"),Hf.has(e)||jf.has(e)?Wf(e,t,!1,r,n):X0.has(e)?Vf(e,q0[t],!1,r,n):(console.assert(!1,"Unknown delimiter '"+e+"'"),null))}var Q0=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],ep=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"stack"}],tp=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function rp(e){return e.type==="small"?"Main-Regular":e.type==="large"?"Size"+e.size+"-Regular":(console.assert(e.type==="stack"),"Size4-Regular")}function np(e,t,r,n){const a={"-4":0,"-3":1,0:2}[n.mathstyle.sizeDelta];for(let o=a;o<r.length&&r[o].type!=="stack";o++){const _=zo(e,rp(r[o]));if(_.defaultMetrics)return{type:"small",mathstyle:"scriptstyle"};let N=_.height+_.depth;if(r[o].type==="small"&&(r[o].mathstyle==="scriptscriptstyle"?N*=Math.max(ac[Math.max(1,n.size-2)],n.minFontScale):r[o].mathstyle==="scriptstyle"&&(N*=Math.max(ac[Math.max(1,n.size-1)],n.minFontScale))),N>t)return r[o]}return r[r.length-1]}function _u(e,t,r,n,a,o){if(!t||t.length===0||t===".")return mo(a);t==="<"||t==="\\lt"?t="\\langle":(t===">"||t==="\\gt")&&(t="\\rangle");let _;jf.has(t)?_=Q0:Hf.has(t)?_=tp:_=ep;const N=np(gu(t),r,_,a),z=new Qr({parent:a,mathstyle:N.mathstyle},o==null?void 0:o.style);return N.type==="small"?Y0(t,z,n,i(F({},o),{type:e})):N.type==="large"?Wf(t,N.size,n,z,i(F({},o),{type:e})):(console.assert(N.type==="stack"),Vf(t,r,n,z,i(F({},o),{type:e})))}function yl(e,t,r,n,a,o){if(t===".")return mo(a,o==null?void 0:o.classes);const _=ts*a.scalingFactor,N=901,z=5/Uo,W=Math.max(r-_,n+_),j=Math.max(W/500*N,2*W-z);return _u(e,t,j,!0,a,o)}function mo(e,t){const r=new St(null,{classes:" nulldelimiter "+(t!=null?t:""),type:"ignore"});return r.width=e.getRegisterAsEm("nulldelimiterspace"),r.wrap(new Qr({parent:e,mathstyle:"textstyle"}))}var Ls=class Ld extends Qe{constructor(t){var r;super({type:"placeholder",command:"\\placeholder",mode:(r=t==null?void 0:t.mode)!=null?r:"math",style:t==null?void 0:t.style}),this.captureSelection=!0}static fromJson(t){return new Ld(t)}toJson(){return super.toJson()}render(t){let r;return this.value=t.placeholderSymbol,typeof t.renderPlaceholder=="function"?r=t.renderPlaceholder(t):r=this.createBox(t),this.caret&&(r.classes+=" ML__placeholder-selected"),r}_serialize(t){return t.skipPlaceholders?"":"\\placeholder{}"}},Gf=["matrix","matrix*","pmatrix","pmatrix*","bmatrix","bmatrix*","Bmatrix","Bmatrix*","vmatrix","vmatrix*","Vmatrix","Vmatrix*"],Zf=["cases","dcases","rcases"],Yf=["align","align*","aligned","gather","gathered","split"],ip=["array","subequations","eqnarray"];function ap(e){return ip.concat(Yf).concat(Zf).concat(Gf).includes(e)}function Xf(e){return Gf.includes(e)}function sp(e){return Zf.includes(e)}function op(e){return Yf.includes(e)}function lp(e,t,r){let n=0;for(const W of r)"align"in W&&(n+=1);let a=0;const o=[];for(const W of t){let j=0;for(a=Math.max(a,Math.min(W.length,n));j<W.length;){const X=[],ae=Math.min(W.length,j+n);for(;j<ae;){const he=W[j];he.length===0?X.push([new Qe({type:"first",mode:e.mode})]):he[0].type!=="first"?X.push([new Qe({type:"first",mode:e.mode}),...he]):(console.assert(!he.slice(1).some(_e=>_e.type==="first")),X.push(he)),j+=1}o.push(X)}}o.length>0&&o[o.length-1].length===1&&o[o.length-1][0].length===1&&o[o.length-1][0][0].type==="first"&&o.pop();const _=[];for(const W of o){if(W.length!==a)for(let j=W.length;j<a;j++)W.push([new Qe({type:"first",mode:e.mode}),new Ls]);_.push(W)}let N=0,z=0;for(const W of _){z=0;for(const j of W){for(const X of j)X.parent=e,X.parentBranch=[N,z];z+=1}N+=1}return e.isDirty=!0,_}var gn=class Rd extends Qe{constructor(t,r,n,a={}){var o;super({type:"array"}),this.environmentName=t,this.rowGaps=n,a.mathstyleName&&(this.mathstyleName=a.mathstyleName),a.columns&&(a.columns.length===0?this.colFormat=[{align:"l"}]:this.colFormat=a.columns),this.colFormat||(this.colFormat=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]),this.array=lp(this,r,this.colFormat),a.leftDelim&&(this.leftDelim=a.leftDelim),a.rightDelim&&(this.rightDelim=a.rightDelim),a.arraycolsep!==void 0&&(this.arraycolsep=a.arraycolsep),this.colSeparationType=a.colSeparationType,a.arraystretch!==void 0&&(this.arraystretch=a.arraystretch),this.minColumns=(o=a.minColumns)!=null?o:1}static fromJson(t){return new Rd(t.environmentName,t.array,t.rowGaps,t)}toJson(){const t=i(F({},super.toJson()),{environmentName:this.environmentName,array:this.array.map(r=>r.map(n=>n.map(a=>a.toJson()))),rowGaps:this.rowGaps,columns:this.colFormat,colSeparationType:this.colSeparationType});return this.arraystretch!==void 0&&(t.arraystretch=this.arraystretch),this.arraycolsep!==void 0&&(t.arraycolsep=this.arraycolsep),this.leftDelim&&(t.leftDelim=this.leftDelim),this.rightDelim&&(t.rightDelim=this.rightDelim),t}branch(t){var r;if(cu(t))return(r=this.array[t[0]][t[1]])!=null?r:void 0}createBranch(t){var r;return cu(t)?(this.isDirty=!0,(r=this.branch(t))!=null?r:[]):[]}get rowCount(){return this.array.length}get colCount(){return this.array[0].length}get maxColumns(){return this.colFormat.filter(t=>!!t.align).length}removeBranch(t){if(co(t))return super.removeBranch(t);const r=this.branch(t);return this.array[t[0]][t[1]]=void 0,r.forEach(n=>{n.parent=void 0,n.parentBranch=void 0}),console.assert(r[0].type==="first"),r.shift(),this.isDirty=!0,r}get hasChildren(){return this.children.length>0}get children(){const t=[];for(const r of this.array)for(const n of r)if(n)for(const a of n)t.push(...a.children),t.push(a);return[...t,...super.children]}render(t){var r,n,a,o,_,N;const z=new Qr({parent:t,mathstyle:this.mathstyleName},this.style),W=z.getRegisterAsEm("arrayrulewidth"),j=z.getRegisterAsEm("arraycolsep"),X=z.getRegisterAsEm("doublerulesep"),ae=(n=(r=this.arraystretch)!=null?r:z.getRegisterAsNumber("arraystretch"))!=null?n:1;let he=typeof this.arraycolsep=="number"?this.arraycolsep:j;this.colSeparationType==="small"&&(he=.2778*(new Qr({parent:t,mathstyle:"scriptstyle"}).scalingFactor/t.scalingFactor));const _e=ae*u0,Ue=.7*_e,yt=.3*_e;let Be=0;const nt=[];let wt=0;const st=this.array.length;for(let Sn=0;Sn<st;++Sn){const di=this.array[Sn];wt=Math.max(wt,di.length);const Oi=new Qr({parent:z,mathstyle:this.mathstyleName},this.style);let bs=Ue/Oi.scalingFactor,xs=yt/Oi.scalingFactor;const Es={cells:[],height:0,depth:0,pos:0};for(const ns of di){const of=(a=Qe.createBox(Oi,ns,{type:"ignore"}))!=null?a:new St(null,{type:"ignore"});xs=Math.max(xs,of.depth),bs=Math.max(bs,of.height),Es.cells.push(of)}let ws=(o=Pf(this.rowGaps[Sn]))!=null?o:0;ws>0&&(ws+=yt,xs=Math.max(xs,ws),ws=0),Sn<st-1&&!Xf(this.environmentName)&&this.environmentName!=="cases"&&this.environmentName!=="array"&&(xs+=z.getRegisterAsEm("jot")),Es.height=bs,Es.depth=xs,Be+=bs,Es.pos=Be,Be+=xs+ws,nt.push(Es)}const zt=Be/2+ts,qt=[];for(let Sn=0;Sn<wt;Sn++){const di=[];for(const Oi of nt){const bs=Oi.cells[Sn];bs.depth=Oi.depth,bs.height=Oi.height,di.push({box:bs,shift:Oi.pos-zt})}di.length>0&&qt.push(new Ai({individualShift:di}))}const Gt=[];let Hr=!1,_n=!1,Lt=0,Ra=!this.leftDelim;const{colFormat:ys}=this;for(const Sn of ys){if("align"in Sn&&Lt>=qt.length)break;if("align"in Sn)Hr?Gt.push(bu(2*he)):(_n||Ra)&&Gt.push(bu(he)),Gt.push(new St(qt[Lt],{classes:"col-align-"+Sn.align})),Lt++,Hr=!0,_n=!1,Ra=!1;else if("gap"in Sn){if(typeof Sn.gap=="number")Gt.push(bu(Sn.gap));else{const di=up(t,nt,zt,Sn.gap);di&&Gt.push(di)}Hr=!1,_n=!1,Ra=!1}else if("separator"in Sn){const di=new St(null,{classes:"vertical-separator"});di.height=Be,di.setStyle("height",Be,"em"),di.setStyle("border-right",`${W}em ${Sn.separator} currentColor`),di.setStyle("vertical-align",-(Be-zt),"em");let Oi=0;_n?Oi=X-W:Hr&&(Oi=he-W),di.left=Oi,Gt.push(di),Hr=!1,_n=!0,Ra=!1}}Hr&&!this.rightDelim&&Gt.push(bu(he));const Wa=new St(Gt,{classes:"mtable"});if((!this.leftDelim||this.leftDelim===".")&&(!this.rightDelim||this.rightDelim==="."))return this.caret&&(Wa.caret=this.caret),this.bind(t,Wa);const Ii=Wa.height,Pa=Wa.depth,ha=this.bind(t,new St([this.bind(t,yl("open",(_=this.leftDelim)!=null?_:".",Ii,Pa,z,{isSelected:this.isSelected})),Wa,this.bind(t,yl("close",(N=this.rightDelim)!=null?N:".",Ii,Pa,z,{isSelected:this.isSelected}))],{type:"ord"}));return ha?(ha.setStyle("display","inline-block"),this.caret&&(ha.caret=this.caret),this.bind(t,this.attachSupsub(t,{base:ha}))):null}_serialize(t){var r;const n=[];if(this.environmentName==="lines"?n.push("{\\displaylines"):n.push(`\\begin{${this.environmentName}}`),this.environmentName==="array"){if(n.push("{"),this.colFormat!==void 0)for(const a of this.colFormat)"align"in a&&typeof a.align=="string"?n.push(a.align):"separator"in a&&a.separator==="solid"?n.push("|"):"separator"in a&&a.separator==="dashed"&&n.push(":");n.push("}")}for(let a=0;a<this.array.length;a++){for(let o=0;o<this.array[a].length;o++)o>0&&n.push(" & "),n.push(Qe.serialize(this.array[a][o],t));if(a<this.array.length-1){const o=this.rowGaps[a];o!=null&&o.dimension?n.push(`\\\\[${o.dimension} ${(r=o.unit)!=null?r:"pt"}] `):n.push("\\\\ ")}}return this.environmentName==="lines"?n.push("}"):n.push(`\\end{${this.environmentName}}`),Jr(n)}getCell(t,r){return this.array[t][r]}setCell(t,r,n){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.array[t][r]!==void 0);for(const o of this.array[t][r])o.parent=void 0,o.parentBranch=void 0;let a=n;(n.length===0||n[0].type!=="first")&&(a=[new Qe({type:"first",mode:this.mode}),...n]),this.array[t][r]=a;for(const o of a)o.parent=this,o.parentBranch=[t,r];this.isDirty=!0}addRowBefore(t){console.assert(this.type==="array"&&Array.isArray(this.array));const r=[];for(let n=0;n<this.colCount;n++)r.push(yu(this));this.array.splice(t,0,r);for(let n=t;n<this.rowCount;n++)for(let a=0;a<this.colCount;a++){const o=this.array[n][a];if(o)for(const _ of o)_.parentBranch=[n,a]}this.isDirty=!0}addRowAfter(t){console.assert(this.type==="array"&&Array.isArray(this.array));const r=[];for(let n=0;n<this.colCount;n++)r.push(yu(this));this.array.splice(t+1,0,r);for(let n=t+1;n<this.rowCount;n++)for(let a=0;a<this.colCount;a++){const o=this.array[n][a];if(o)for(const _ of o)_.parentBranch=[n,a]}this.isDirty=!0}removeRow(t){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.rowCount>t);const r=this.array.splice(t,1);for(const n of r)for(const a of n)if(a)for(const o of a)o.parent=void 0,o.parentBranch=void 0;for(let n=t;n<this.rowCount;n++)for(let a=0;a<this.colCount;a++){const o=this.array[n][a];if(o)for(const _ of o)_.parentBranch=[n,a]}this.isDirty=!0}addColumnBefore(t){console.assert(this.type==="array"&&Array.isArray(this.array));for(const r of this.array)r.splice(t,0,yu(this));for(let r=0;r<this.rowCount;r++)for(let n=t;n<this.colCount;n++){const a=this.array[r][n];if(a)for(const o of a)o.parentBranch=[r,n]}this.isDirty=!0}addColumnAfter(t){console.assert(this.type==="array"&&Array.isArray(this.array));for(const r of this.array)r.splice(t+1,0,yu(this));for(let r=0;r<this.rowCount;r++)for(let n=t+1;n<this.colCount;n++){const a=this.array[r][n];if(a)for(const o of a)o.parentBranch=[r,n]}this.isDirty=!0}addColumn(){this.addColumnAfter(this.colCount-1)}removeColumn(t){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.colCount>t);for(const r of this.array){const n=r.splice(t,1);for(const a of n)if(a)for(const o of a)o.parent=void 0,o.parentBranch=void 0}for(let r=0;r<this.rowCount;r++)for(let n=t;n<this.colCount;n++){const a=this.array[r][n];if(a)for(const o of a)o.parentBranch=[r,n]}this.isDirty=!0}get cells(){const t=[];for(const r of this.array)for(const n of r)n&&t.push(n.filter(a=>a.type!=="first"));return t}};function yu(e){const t=new Qe({type:"first",mode:e.mode});t.parent=e;const r=new Ls;return r.parent=e,[t,r]}function bu(e){const t=new St(null,{classes:"arraycolsep"});return t.width=e,t}function up(e,t,r,n){if(!n)return null;const a=[];for(const o of t){const _=Qe.createBox(e,n,{type:"ignore"});_&&(_.depth=o.depth,_.height=o.height,a.push({box:_,shift:o.pos-r}))}return new Ai({individualShift:a}).wrap(e)}var Hs=class Pd extends Qe{constructor(t){super({mode:t.mode,command:t.command,style:t.style,body:t.body,type:"box"}),this.framecolor=t.framecolor,this.backgroundcolor=t.backgroundcolor,this.padding=t.padding,this.offset=t.offset,this.border=t.border}static fromJson(t){return new Pd(t)}toJson(){return i(F({},super.toJson()),{framecolor:this.framecolor,backgroundcolor:this.backgroundcolor,padding:this.padding,offset:this.offset,border:this.border})}render(t){var r,n,a,o;const _=Qe.createBox(t,this.body,{type:"lift"});if(!_)return null;const N=t.toEm((r=this.offset)!=null?r:{dimension:0});_.depth+=N,_.setStyle("display","inline-block"),_.setStyle("position","relative"),_.setStyle("height",Math.floor(100*_.height+_.depth)/100,"em"),_.setStyle("vertical-align",-Math.floor(100*_.height)/100,"em");const z=new Qr({parent:t},this.style),W=z.toEm((n=this.padding)!=null?n:{register:"fboxsep"}),j=new St(null,{classes:"ML__box"});j.height=_.height+W,j.depth=_.depth+W,j.setStyle("box-sizing","border-box"),j.setStyle("position","absolute"),j.setStyle("top",-W+.3,"em"),j.setStyle("left",0),j.setStyle("height",j.height+j.depth,"em"),j.setStyle("width","100%"),this.backgroundcolor&&j.setStyle("background-color",(a=z.toColor(this.backgroundcolor))!=null?a:"transparent"),this.framecolor&&j.setStyle("border",`${z.getRegisterAsEm("fboxrule",2)}em solid ${(o=z.toColor(this.framecolor))!=null?o:"black"}`),this.border&&j.setStyle("border",this.border);const X=new St([j,_],{type:"lift"});return X.setStyle("display","inline-block"),X.setStyle("position","relative"),X.setStyle("line-height",0),X.height=_.height+W+(N>0?N:0),X.depth=_.depth+W+(N<0?-N:0),X.setStyle("padding-left",W,"em"),X.setStyle("padding-right",W,"em"),X.setStyle("height",Math.floor(100*(_.height+_.depth+2*W+Math.abs(N)))/100,"em"),X.setStyle("margin-top",-W,"em"),X.setStyle("top",Math.floor(100*(_.depth-_.height+2*W-N))/100,"em"),X.setStyle("vertical-align",Math.floor(100*(_.depth+2*W))/100,"em"),this.caret&&(X.caret=this.caret),this.attachSupsub(t,{base:X})}_serialize(t){return t.skipStyles?Jr([this.bodyToLatex(t),this.supsubToLatex(t)]):super._serialize(t)}},qf=class Id extends Qe{constructor(t,r){var n;super({type:"composition",mode:(n=r==null?void 0:r.mode)!=null?n:"math",value:t})}static fromJson(t){return new Id(t.value,t)}toJson(){return super.toJson()}get computedStyle(){return{}}render(t){const r=new St(this.value,{classes:"ML__composition",type:"composition"});return this.bind(t,r),this.caret&&(r.caret=this.caret),r}_serialize(t){return""}},vo=class Od extends Qe{constructor(t){super({type:"error",value:t,command:t,mode:"math"}),this.verbatimLatex=t}static fromJson(t){return new Od(t.command)}toJson(){return super.toJson()}render(t){const r=this.createBox(t,{classes:"ML__error"});return this.caret&&(r.caret=this.caret),r}},Jf=class Fd extends Qe{constructor(t,r,n){super({type:"group",mode:r,style:n}),this.body=t,this.boxType=t.length>1?"ord":"ignore",this.skipBoundary=!0,this.displayContainsHighlight=!1,t&&t.length===1&&t[0].command===","&&(this.captureSelection=!0)}static fromJson(t){return new Fd(t.body,t.mode,t.style)}render(t){const r=Qe.createBox(t,this.body,{type:this.boxType});return r?(this.caret&&(r.caret=this.caret),this.bind(t,r)):null}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const r=Je(this.command,this.mode);return r!=null&&r.serialize?r.serialize(this,t):`{${this.bodyToLatex(t)}}`}},si=class Bd extends Qe{constructor(t,r,n){super({type:"leftright",style:n.style,displayContainsHighlight:!0}),this.variant=t,this.body=r,this.leftDelim=n.leftDelim,this.rightDelim=n.rightDelim}static fromJson(t){var r;return new Bd((r=t.variant)!=null?r:"",t.body,t)}toJson(){const t=super.toJson();return this.variant&&(t.variant=this.variant),this.leftDelim&&(t.leftDelim=this.leftDelim),this.rightDelim&&(t.rightDelim=this.rightDelim),t}_serialize(t){var r,n;const a=this.matchingRightDelim();return this.variant==="left...right"?Jr(["\\left",(r=this.leftDelim)!=null?r:".",this.bodyToLatex(t),"\\right",a]):this.variant==="mleft...mright"?Jr(["\\mleft",(n=this.leftDelim)!=null?n:".",this.bodyToLatex(t),"\\mright",a]):Jr([!this.leftDelim||this.leftDelim==="."?"":this.leftDelim,this.bodyToLatex(t),a])}matchingRightDelim(){var t,r;if(this.rightDelim&&this.rightDelim!=="?")return this.rightDelim;const n=(t=this.leftDelim)!=null?t:".";return(r=mu[n])!=null?r:n}render(t){var r,n;const a=new Qr({parent:t},this.style);console.assert(this.body!==void 0);const o=new Qr({parent:t,mathstyle:"textstyle"},this.style),_=(r=Qe.createBox(a,this.body,{type:"inner"}))!=null?r:new St(null,{type:"inner"}),N=_.height/o.scalingFactor,z=_.depth/o.scalingFactor,W=[];if(this.leftDelim&&W.push(this.bind(o,yl("open",this.leftDelim,N,z,o,{isSelected:this.isSelected,classes:"ML__open"+(this.containsCaret?" ML__contains-caret":""),mode:this.mode,style:this.style}))),_&&(Qf(_.children,this,a,N,z),W.push(_)),this.rightDelim){let he=this.containsCaret?" ML__contains-caret":"",_e=this.rightDelim;_e==="?"&&(a.smartFence?(_e=this.matchingRightDelim(),he+=" ML__smart-fence__close"):_e="."),W.push(this.bind(o,yl("close",_e,N,z,o,{isSelected:this.isSelected,classes:he+" ML__close",mode:this.mode,style:this.style})))}let j=this.variant==="mleft...mright";const X=this.leftSibling;X&&(!j&&X.isFunction&&(j=!0),!j&&X.type==="subsup"&&((n=X.leftSibling)!=null&&n.isFunction)&&(j=!0));const ae=new St(W,{type:j?"close":"inner",classes:"left-right"});return ae.setStyle("margin-top",`${-_.depth}em`),ae.setStyle("height",`${_.height+_.depth}em`),this.caret&&(ae.caret=this.caret),this.bind(a,ae.wrap(a))}};function Qf(e,t,r,n,a){if(e)for(let o=0;o<e.length;o++){const _=e[o];_.type==="middle"?(e[o]=t.bind(r,yl("inner",_.value,n,a,r,{isSelected:t.isSelected})),e[o].caret=_.caret,e[o].isSelected=_.isSelected,e[o].cssId=_.cssId,e[o].htmlData=_.htmlData,e[o].htmlStyle=_.htmlStyle,e[o].attributes=_.attributes,e[o].cssProperties=_.cssProperties):_.children&&Qf(_.children,t,r,n,a)}}var eh=class Nd extends Qe{constructor(t,r){var n;super({type:"macro",command:t,style:r.style}),this.body=r.body,r.captureSelection===void 0?r.args?this.captureSelection=!1:this.captureSelection=!0:this.captureSelection=r.captureSelection,this.macroArgs=r.args,this.expand=(n=r.expand)!=null?n:!1}static fromJson(t){return new Nd(t.command,t)}toJson(){const t=super.toJson();return this.expand&&(t.expand=!0),this.captureSelection!==void 0&&(t.captureSelection=this.captureSelection),this.macroArgs&&(t.args=this.macroArgs),t}_serialize(t){var r;return t.expandMacro&&this.expand?this.bodyToLatex(t):this.command+((r=this.macroArgs)!=null?r:"")}render(t){const r=Qe.createBox(t,this.body);return r?(this.caret&&(r.caret=this.caret),this.bind(t,r)):null}},cp=class Kd extends Qe{constructor(){super({type:"macro-argument"})}static fromJson(t){return new Kd}toJson(){return super.toJson()}_serialize(t){return""}render(t){return null}},th=class Ud extends Qe{constructor(t,r,n=!1,a,o){var _;super({type:"prompt",mode:(_=o==null?void 0:o.mode)!=null?_:"math",style:o==null?void 0:o.style,command:"\\placeholder"}),this.body=a,this.correctness=r,this.placeholderId=t,this.locked=n,this.captureSelection=this.locked}static fromJson(t){return new Ud(t.placeholderId,t.correctness,t.locked,t.body,t)}toJson(){const t=super.toJson();return this.placeholderId&&(t.placeholderId=this.placeholderId),this.body||delete t.body,this.body&&(t.body=this.body.filter(r=>r.type!=="first").map(r=>r.toJson())),this.correctness&&(t.correctness=this.correctness),t.locked=this.locked,t}render(t){const r=new Qr({parent:t}),n=r.getRegisterAsEm("fboxsep"),a=n,o=n,_=Qe.createBox(t,this.body);if(!_)return null;_.height||(_.height=r.metrics.xHeight),_.setStyle("vertical-align",-_.height,"em"),this.correctness==="correct"?_.setStyle("color","var(--correct-color, var(--ML__correct-color))"):this.correctness==="incorrect"&&_.setStyle("color","var(--incorrect-color, var(--ML__incorrect-color))");const N=new St(_,{type:"ord"});N.setStyle("display","inline-block"),N.setStyle("height",_.height+_.depth,"em"),N.setStyle("vertical-align",-o,"em");let z="ML__prompt ";this.locked?z+=" ML__lockedPromptBox ":z+=" ML__editablePromptBox ",this.correctness==="correct"?z+=" ML__correctPromptBox ":this.correctness==="incorrect"&&(z+=" ML__incorrectPromptBox "),this.containsCaret&&(z+=" ML__focusedPromptBox ");const W=new St(null,{classes:z,attributes:{part:"prompt"}});W.height=N.height+o,W.depth=N.depth+o,W.width=N.width+2*a,W.setStyle("box-sizing","border-box"),W.setStyle("position","absolute"),W.setStyle("height",N.height+N.depth+2*o,"em"),a===0&&W.setStyle("width","100%"),a!==0&&(W.setStyle("width",`calc(100% + ${2*a}em)`),W.setStyle("top",n,"em"),W.setStyle("left",-a,"em")),(!this.body||this.body.length===1)&&(W.width=3*a,W.setStyle("width",`calc(100% + ${3*a}em)`),W.setStyle("left",-1.5*a,"em"));let j="";this.correctness==="incorrect"&&(j+='<line x1="3%" y1="97%" x2="97%" y2="3%" stroke-width="0.5" stroke="var(--incorrect-color, var(--ML__incorrect-color))" stroke-linecap="round" />'),j&&(W.svgOverlay=j);const X=new St([W,N],{classes:"ML__prompt-atom"});return X.setStyle("position","relative"),X.setStyle("display","inline-block"),X.setStyle("line-height",0),X.height=N.height+o+.2,X.depth=N.depth+o,X.left=a,X.right=a,X.setStyle("height",N.height+o,"em"),X.setStyle("top",N.depth-N.height,"em"),X.setStyle("vertical-align",N.depth+o,"em"),X.setStyle("margin-left",.5,"em"),X.setStyle("margin-right",.5,"em"),this.caret&&(X.caret=this.caret),this.bind(r,this.attachSupsub(t,{base:X}))}_serialize(t){var r;const n=(r=this.bodyToLatex(t))!=null?r:"";if(t.skipPlaceholders)return n;let a="\\placeholder";return this.placeholderId&&(a+=`[${this.placeholderId}]`),this.correctness==="correct"?a+="[correct]":this.correctness==="incorrect"&&(a+="[incorrect]"),this.locked&&(a+="[locked]"),qn(a,n)}},xu=class zd extends Qe{constructor(t){super({type:"subsup",style:t==null?void 0:t.style}),this.subsupPlacement="auto"}static fromJson(t){const r=new zd(t);for(const n of Wo)t[n]&&r.setChildren(t[n],n);return r}render(t){var r;const n=new Qr({parent:t,isPhantom:!0}),a=this.leftSibling,o=(r=a.render(n))!=null?r:new St(null),_=new St(null);return _.height=o.height,_.depth=o.depth,this.attachSupsub(t,{base:_,isCharacterBox:a.isCharacterBox(),type:"ignore"})}_serialize(t){return this.supsubToLatex(t)}};function Ho(e){return e?!/^(<$$>|<$>|<space>|<{>|<}>|#[0-9\?]|\\.+)$/.test(e):!1}var rh=class{constructor(e,t,r){this.errors=[],this.index=0,this.endCount=0;var n,a,o,_;r!=null||(r={}),this.tokens=e,this.context=t instanceof Qr&&!(r!=null&&r.parseMode)&&!r.mathstyle?t:new Qr({from:t,mathstyle:r.mathstyle},r.style),this.args=(n=r.args)!=null?n:void 0,this.smartFence=this.context.smartFence,this.parsingContext={parent:void 0,mathlist:[],style:(a=r.style)!=null?a:{},parseMode:(o=r.parseMode)!=null?o:"math",mathstyle:(_=r.mathstyle)!=null?_:"displaystyle",tabular:!1}}beginContext(e){var t,r,n;const a=this.parsingContext,o={parent:a,mathlist:[],style:F({},a.style),parseMode:(t=e==null?void 0:e.mode)!=null?t:a.parseMode,mathstyle:(r=e==null?void 0:e.mathstyle)!=null?r:a.mathstyle,tabular:(n=e==null?void 0:e.tabular)!=null?n:!1};this.parsingContext=o}endContext(){this.parsingContext=this.parsingContext.parent}onError(e){this.errors.push(F({before:oo(this.tokens.slice(this.index,this.index+10)),after:oo(this.tokens.slice(Math.max(0,this.index-10),this.index))},e))}get mathlist(){return this.parsingContext.mathlist}set mathlist(e){this.parsingContext.mathlist=e}get parseMode(){return this.parsingContext.parseMode}set parseMode(e){this.parsingContext.parseMode=e}get tabularMode(){return this.parsingContext.tabular}get style(){let e=this.parsingContext;for(;e;){if(e.style)return F({},e.style);e=e.parent}return{}}set style(e){this.parsingContext.style=e}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}next(){this.index+=1}get(){return this.endCount=0,this.index<this.tokens.length?this.tokens[this.index++]:""}peek(){return this.tokens[this.index]}match(e){return this.tokens[this.index]===e?(this.index++,!0):!1}lastSubsupAtom(){let e;return this.mathlist.length>0&&(e=this.mathlist[this.mathlist.length-1],e.type==="subsup"||e.subsupPlacement!==void 0)||(e=new xu({style:this.style}),this.mathlist.push(e)),e}hasPattern(e){return e.test(this.tokens[this.index])}hasInfixCommand(){var e;const{index:t}=this;if(t<this.tokens.length&&this.tokens[t].startsWith("\\")){const r=Je(this.tokens[t],this.parseMode);return!r||r.definitionType==="symbol"||r.ifMode&&!r.ifMode.includes(this.parseMode)?!1:(e=r.infix)!=null?e:!1}return!1}matchColumnSeparator(){return!this.tabularMode||this.peek()!=="&"?!1:(this.index++,!0)}matchRowSeparator(){if(!this.tabularMode)return!1;const e=this.peek();return e!=="\\\\"&&e!=="\\cr"&&e!=="\\tabularnewline"?!1:(this.index++,!0)}placeholder(){var e;const t=(e=this.args)==null?void 0:e.call(this,"?");return t?na(t,{parseMode:this.parseMode,mathstyle:"textstyle"}):[new Ls({mode:this.parseMode,style:this.style})]}skipWhitespace(){for(;this.match("<space>"););}skipUntilToken(e){let t=this.tokens[this.index];for(;t&&t!==e;)t=this.tokens[++this.index];t===e&&this.index++}skipFiller(){for(;this.match("\\relax")||this.match("<space>"););}matchKeyword(e){const t=this.index;let r=this.end(),n="";for(;!r;){const o=this.get();Ho(o)?(n+=o,r=this.end()||n.length>=e.length):r=!0}const a=e.toUpperCase()===n.toUpperCase();return a||(this.index=t),a}scanString(){let e="";for(;!this.end();){const t=this.peek();if(t==="]")return e;if(t==="<space>")e+=" ";else if(t.startsWith("\\"))this.onError({code:"unexpected-command-in-string"}),e+=t.substring(1);else if(Ho(t))e+=t;else return e;this.next()}return e}scanBalancedString(){let e="",t=this.end(),r=1;for(;!t;){const n=this.get();n==="<space>"?e+=" ":n==="<{>"?(e+="{",r+=1):n==="<}>"?(r-=1,r>0?e+="}":this.index-=1):n==="<$>"?e+="$":n==="<$$>"?e+="$$":e+=n,t=r===0||this.end()}return e}scanLiteralGroup(){var e;if(!this.match("<{>"))return"";let t="",r=1;for(;r>0&&!this.end();){const n=this.get();n==="<}>"?(r-=1,r>0&&(t+="}")):n==="<{>"?(r+=1,t+="{"):(/\\[a-zA-Z]+$/.test(t)&&/^[a-zA-Z]/.test(n)&&(t+=" "),t+=(e={"<space>":" ","<$$>":"$$","<$>":"$"}[n])!=null?e:n)}return t}scanNumber(e=!0){var t,r;let n=!1,a=this.peek();for(;a==="<space>"||a==="+"||a==="-";)this.get(),a==="-"&&(n=!n),a=this.peek();e=!!e;let o=10,_=/\d/;if(this.match("'"))o=8,_=/[0-7]/,e=!0;else if(this.match('"'))o=16,_=/[\dA-F]/,e=!0;else if(this.match("x"))o=16,_=/[\dA-Fa-f]/,e=!0;else if(this.match("`"))return a=this.get(),a?a.length===2&&a.startsWith("\\")?{number:(n?-1:1)*((t=a.codePointAt(1))!=null?t:0),base:"alpha"}:{number:(n?-1:1)*((r=a.codePointAt(0))!=null?r:0),base:"alpha"}:null;let N="";for(;this.hasPattern(_);)N+=this.get();if(!e&&(this.match(".")||this.match(",")))for(N+=".";this.hasPattern(_);)N+=this.get();const z=e?Number.parseInt(N,o):Number.parseFloat(N);return Number.isNaN(z)?null:{number:n?-z:z,base:o===16?"hexadecimal":o===8?"octal":"decimal"}}scanRegister(){var e;const t=this.index,r=this.scanNumber(!1);if(this.skipWhitespace(),this.match("\\relax"))return r;let n=!1;if(r===null)for(;;){const o=this.peek();if(o==="-")n=!n;else if(o!=="+")break;this.next(),this.skipWhitespace()}if(this.match("\\global")){this.skipWhitespace();const o=this.get();return o.startsWith("\\")?r?{register:o,global:!0,factor:(n?-1:1)*r.number}:n?{register:o,global:!0,factor:-1}:{register:o,global:!0}:(this.index=t,null)}let a=this.get();return a!=null&&a.startsWith("\\")?(a=a.substring(1),this.context.registers[a]?!n||r!==null?{register:a,factor:(n?-1:1)*((e=r==null?void 0:r.number)!=null?e:1)}:{register:a}:(this.index=t,null)):(this.index=t,null)}scanValue(){const e=this.scanRegister();if(e)return e;const t=this.index,r=this.scanGlueOrDimen();if(r&&("unit"in r||"glue"in r&&"unit"in r.glue))return r;this.index=t;const n=this.scanNumber();if(n)return n;if(this.end()||!Ho(this.peek()))return null;const a=this.scanString();return a.length>0?{string:a}:null}scanDimen(){const e=this.scanNumber(!1);if(e===null)return null;const t=e.number;this.skipWhitespace(),this.matchKeyword("true"),this.skipWhitespace();let r;return this.matchKeyword("pt")?r="pt":this.matchKeyword("mm")?r="mm":this.matchKeyword("cm")?r="cm":this.matchKeyword("ex")?r="ex":this.matchKeyword("px")?r="px":this.matchKeyword("em")?r="em":this.matchKeyword("bp")?r="bp":this.matchKeyword("dd")?r="dd":this.matchKeyword("pc")?r="pc":this.matchKeyword("in")?r="in":this.matchKeyword("mu")&&(r="mu"),r?{dimension:t,unit:r}:{dimension:t}}scanGlueOrDimen(){const e=this.scanDimen();if(e===null)return null;if(this.skipWhitespace(),this.match("\\relax"))return e;const t={glue:e};if(this.matchKeyword("plus")){const r=this.scanDimen();if(r)t.grow=r;else return t}if(this.skipWhitespace(),this.match("\\relax"))return t;if(this.skipWhitespace(),this.matchKeyword("minus")){const r=this.scanDimen();if(r)t.shrink=r;else return t}return!t.grow&&!t.shrink?e:t}scanColspec(){this.skipWhitespace();const e=[];for(;!this.end()&&!(this.peek()==="<}>"||this.peek()==="]");){const t=this.get();t==="c"||t==="r"||t==="l"?e.push({align:t}):t==="|"?e.push({separator:"solid"}):t===":"?e.push({separator:"dashed"}):t==="@"&&(this.match("<{>")&&(this.beginContext({mode:"math"}),e.push({gap:this.scan(r=>r==="<}>")}),this.endContext()),this.match("<}>")||this.onError({code:"unbalanced-braces"}))}return e}scanModeSet(){let e;if(this.match("\\(")&&(e="textstyle"),!e&&this.match("\\[")&&(e="displaystyle"),!e)return null;this.beginContext({mode:"math",mathstyle:e});const t=this.scan(r=>r===(e==="displaystyle"?"\\]":"\\)"));return this.match(e==="displaystyle"?"\\]":"\\)")||this.onError({code:"unbalanced-mode-shift"}),this.endContext(),t}scanModeShift(){let e="";if(this.match("<$>")&&(e="<$>"),!e&&this.match("<$$>")&&(e="<$$>"),!e)return null;this.beginContext({mode:"math",mathstyle:"textstyle"});const t=this.scan(r=>r===e);return this.match(e)||this.onError({code:"unbalanced-mode-shift"}),this.endContext(),t}scanEnvironment(){if(!this.match("\\begin"))return null;const e=this.scanArgument("string");if(!e)return null;const t=De(e);if(!t)return this.onError({code:"unknown-environment",arg:e}),null;const r=[];if(t.params)for(const N of t.params)if(N.isOptional)r.push(this.scanOptionalArgument(N.type));else{const z=this.scanArgument(N.type);z||this.onError({code:"missing-argument",arg:e}),r.push(z)}this.beginContext({tabular:t.tabular});const n=[],a=[];let o=[],_=!1;do if(this.end()&&(this.onError({code:"unbalanced-environment",arg:e}),_=!0),!_&&this.match("\\end")&&(this.scanArgument("string")!==e&&this.onError({code:"unbalanced-environment",arg:e}),_=!0),!_)if(this.matchColumnSeparator())o.push(this.mathlist),this.mathlist=[];else if(this.matchRowSeparator()){o.push(this.mathlist),this.mathlist=[];let N=null;this.skipWhitespace(),this.match("[")&&(N=this.scanDimen(),this.skipWhitespace(),this.match("]")),a.push(N!=null?N:{dimension:0}),n.push(o),o=[]}else this.mathlist.push(...this.scan(N=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline"].includes(N)));while(!_);return o.push(this.mathlist),o.length>0&&n.push(o),this.endContext(),t.createAtom(e,n,a,r)}scanExpression(){const e=this.mathlist;if(this.mathlist=[],this.parseExpression()){const t=this.mathlist;return this.mathlist=e,t}return this.mathlist=e,null}scan(e){this.beginContext(),e||(e=_=>_==="<}>");let t="",r=null,n=[],a=null;for(;!this.end()&&!e(this.peek());)this.hasInfixCommand()&&!t?(t=this.get(),r=Je(t,"math"),r&&(n=this.scanArguments(r)[1]),a=this.mathlist,this.mathlist=[]):this.parseExpression();let o;return t?(console.assert(!!r),n.unshift(this.mathlist),a&&n.unshift(a),o=[r.createAtom({command:t,args:n,style:this.style,mode:this.parseMode})]):o=this.mathlist,this.endContext(),o}scanGroup(){const e=this.index;if(!this.match("<{>"))return null;const t=this.scan(n=>n==="<}>");this.match("<}>")||this.onError({code:"unbalanced-braces"});const r=new Jf(t,this.parseMode,this.style);return r.verbatimLatex=oo(this.tokens.slice(e,this.index)),r}scanSmartFence(){if(this.skipWhitespace(),!this.match("("))return null;this.beginContext();let e=1;for(;!this.end()&&e!==0;)this.match("(")&&(e+=1),this.match(")")&&(e-=1),e!==0&&this.parseExpression();const t=new si("",this.mathlist,{leftDelim:"(",rightDelim:e===0?")":"?"});return this.endContext(),t}scanDelim(){this.skipWhitespace();const e=this.peek();if(!e)return this.onError({code:"unexpected-end-of-string"}),null;if(!Ho(e)&&!e.startsWith("\\"))return null;this.next();const t=Je(e,"math");return t?t.definitionType==="function"&&t.ifMode&&!t.ifMode.includes(this.parseMode)?(this.onError({code:"unexpected-delimiter",arg:e}),null):t.definitionType==="symbol"&&(t.type==="mopen"||t.type==="mclose")||/^(\.|\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(e)?e:(this.onError({code:"unexpected-delimiter",arg:e}),null):(this.onError({code:"unknown-command",arg:e}),null)}scanLeftRight(){var e;if(this.match("\\right"))return this.onError({code:"unbalanced-braces"}),new vo("\\right");if(this.match("\\mright"))return this.onError({code:"unbalanced-braces"}),new vo("\\mright");let t="\\right";if(!this.match("\\left")){if(!this.match("\\mleft"))return null;t="\\mright"}const r=this.scanDelim();if(!r)return this.onError({code:"unexpected-delimiter"}),new vo(t==="\\right"?"\\left":"\\mleft");for(this.beginContext();!this.end()&&!this.match(t);)this.parseExpression();const n=this.mathlist;this.endContext();const a=(e=this.scanDelim())!=null?e:".";return new si(t==="\\right"?"left...right":"mleft...mright",n,{leftDelim:r,rightDelim:a,style:this.style})}parseSupSub(){if(this.parseMode!=="math")return!1;let e=this.peek();if(e!=="^"&&e!=="_"&&e!=="'")return!1;const t=this.lastSubsupAtom();for(;e==="^"||e==="_"||e==="'";)this.match("'")?this.match("'")?t.addChild(new Qe({type:"mord",command:"\\doubleprime",mode:"math",value:"\u2032\u2032"}),"superscript"):t.addChild(new Qe({type:"mord",command:"\\prime",mode:"math",value:"\u2032"}),"superscript"):(this.match("^")||this.match("_"))&&t.addChildren(J(this.scanArgument("expression")),e==="_"?"subscript":"superscript"),e=this.peek();return!0}parseLimits(){if(this.parseMode!=="math")return!1;const e=this.match("\\limits"),t=!e&&this.match("\\nolimits"),r=!t&&!e&&this.match("\\displaylimits");if(!e&&!t&&!r)return!1;const n=this.mathlist.length>0?this.mathlist[this.mathlist.length-1]:null;return n===null?!1:(n.explicitSubsupPlacement=!0,e&&(n.subsupPlacement="over-under"),t&&(n.subsupPlacement="adjacent"),r&&(n.subsupPlacement="auto"),!0)}scanArguments(e){if(!(e!=null&&e.params))return[void 0,[]];let t;const r=[];let n=e.infix?2:0;for(;n<e.params.length;){const a=e.params[n];a.type==="rest"?r.push(this.scan(o=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline","\\right"].includes(o))):a.isOptional?r.push(this.scanOptionalArgument(a.type)):a.type.endsWith("*")?t=a.type.slice(0,-1):r.push(this.scanArgument(a.type)),n+=1}return[t,r]}scanSymbolOrLiteral(){const e=this.peek();if(!e)return null;this.next();let t;if(Ho(e)){const r=Aa.createAtom(this.parseMode,e,F({},this.style));return r?[r]:null}if(t=this.scanMacro(e),t)return[t];if(e.startsWith("\\")){const r=Je(e,this.parseMode);if(!r)return this.onError({code:"unknown-command",arg:e}),[new vo(e)];if(r.definitionType==="symbol"){const n=F({},this.style);r.variant&&(n.variant=r.variant),t=new Qe({type:r.type,command:e,style:n,value:String.fromCodePoint(r.codepoint),mode:this.parseMode,verbatimLatex:e})}else{if(r.applyMode||r.applyStyle||r.infix)return this.onError({code:"invalid-command",arg:e}),[new vo(e)];r.createAtom&&(t=r.createAtom({command:e,args:[],style:this.style,mode:this.parseMode}))}}return t?[t]:null}scanArgument(e){var t;this.skipFiller();const r=this.parseMode;if(e==="auto"&&(e=r),!this.match("<{>")){if(e==="string")return this.scanString();if(e==="value")return this.scanValue();if(e==="delim")return(t=this.scanDelim())!=null?t:".";if(e==="expression")return this.scanExpression();if(e==="math"){e!==r&&this.beginContext({mode:"math"});const a=this.scanSymbolOrLiteral();return e!==r&&this.endContext(),a}if(e==="text"){e!==r&&this.beginContext({mode:"text"});const a=this.scanSymbolOrLiteral();return e!==r&&this.endContext(),a}return e==="balanced-string"||console.assert(!1),null}if(e==="text"){this.beginContext({mode:"text"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const a=this.mathlist;return this.endContext(),{group:a}}if(e==="math"){this.beginContext({mode:"math"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const a=this.mathlist;return this.endContext(),{group:a}}let n=null;if(e==="expression"){this.beginContext({mode:"math"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const a=this.mathlist;return this.endContext(),{group:a}}return e==="string"?n=this.scanString():e==="balanced-string"?n=this.scanBalancedString():e==="colspec"?n=this.scanColspec():e==="value"&&(n=this.scanValue()),this.skipUntilToken("<}>"),n}scanOptionalArgument(e){if(e=e==="auto"?this.parseMode:e,this.skipFiller(),!this.match("["))return null;let t=null;for(;!this.end()&&!this.match("]");)if(e==="string")t=this.scanString();else if(e==="value")t=this.scanValue();else if(e==="colspec")t=this.scanColspec();else if(e==="bbox"){const r={},n=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const a of n){const o=a.match(/^\s*([\d.]+)\s*([a-z]{2})/);if(o)r.padding={dimension:parseInt(o[1]),unit:o[2]};else{const _=a.match(/^\s*border\s*:\s*(.*)/);_?r.border=_[1]:r.backgroundcolor={string:a}}}t=r}else e==="math"&&(this.beginContext({mode:"math"}),t=this.mathlist.concat(this.scan(r=>r==="]")),this.endContext());return t}scanSymbolOrCommand(e){var t,r,n;if(e==="\\placeholder"){const N=this.scanOptionalArgument("string"),z=this.scanOptionalArgument("math"),W=Qe.serialize(z,{defaultMode:"math"});let j=[],X;!X&&W==="correct"?X="correct":!X&&W==="incorrect"?X="incorrect":W!==""&&(j=z);const ae=this.scanOptionalArgument("string")==="locked",he=this.scanArgument("auto");let _e;return he&&Array.isArray(he)&&he.length>0?_e=he:he&&typeof he=="object"&&"group"in he?_e=he.group:_e=j,N?[new th(N,X,ae,_e!=null?_e:j,{mode:this.parseMode,style:this.style})]:[new Ls({mode:this.parseMode,style:this.style})]}if(e==="\\renewcommand"||e==="\\newcommand"||e==="\\providecommand"||e==="\\def"){const N=this.index,z=this.scanLiteralGroup()||this.next();if(!z)return null;if(this.context.registers[z.substring(1)]){const W=this.scanArgument("string");W!==null&&(this.context.registers[z.substring(1)]=W);const j=Jr([e,oo(this.tokens.slice(N,this.index))]);return[new Qe({type:"text",value:"",verbatimLatex:j})]}}let a=this.scanMacro(e);if(a)return[a];const o=Je(e,this.parseMode);if(!o)return this.parseMode==="text"?(/[a-zA-Z]/.test((t=this.peek())!=null?t:"")&&(e+=" "),[...e].map(N=>new Qe({type:"text",value:N,mode:"text",style:this.style}))):(this.onError({code:"unknown-command",arg:e}),[new vo(e)]);const _=this.index;if(o.definitionType==="symbol"){const N=F({},this.style);o.variant&&(N.variant=o.variant),a=new Qe({type:o.type,command:e,style:N,value:String.fromCodePoint(o.codepoint),mode:this.parseMode})}else{if(o.ifMode&&!o.ifMode.includes(this.parseMode))return[];const N=this.parseMode;o.applyMode&&(this.parseMode=o.applyMode);let z,W=[];if(o.parse?W=o.parse(this):[z,W]=this.scanArguments(o),this.parseMode=N,o.applyMode&&!o.applyStyle&&!o.createAtom)return J(W[0]);if(o.infix)return this.onError({code:"too-many-infix-commands",arg:e}),null;if(typeof o.createAtom=="function")a=o.createAtom({command:e,args:W,style:this.style,mode:this.parseMode}),z&&(a.body=J(this.scanArgument(z)));else if(typeof o.applyStyle=="function"){const j=F(F({},this.style),o.applyStyle(e,W,this.context)),X=this.parseMode;if(o.applyMode&&(this.parseMode=o.applyMode),z){const ae=this.style;this.style=j;const he=this.scanArgument(z);return this.style=ae,this.parseMode=X,J(he)}this.style=j}else a=new Qe({type:"mord",command:(r=o.command)!=null?r:e,style:F({},this.style),value:e,mode:(n=o.applyMode)!=null?n:this.parseMode})}if(!a)return null;if(a instanceof Qe&&a.verbatimLatex===void 0&&!/^\\(llap|rlap|class|cssId|htmlData)$/.test(e)){const N=Jr([e,oo(this.tokens.slice(_,this.index))]);N&&(a.verbatimLatex=N)}if(a.verbatimLatex===null&&(a.verbatimLatex=void 0),a.isFunction&&this.smartFence){const N=this.scanSmartFence();if(N)return[a,N]}return[a]}scanSymbolCommandOrLiteral(){const e=this.get();if(!e)return null;if(Ho(e)){const t=Aa.createAtom(this.parseMode,e,F({},this.style));if(!t)return null;if(t.isFunction&&this.smartFence){const r=this.scanSmartFence();if(r)return[t,r]}return[t]}return e.startsWith("\\")?this.scanSymbolOrCommand(e):e==="<space>"?this.parseMode==="text"?[new vl(" "," ",this.style)]:null:(e==="<}>"?this.onError({latex:"",code:"unbalanced-braces"}):this.onError({latex:"",code:"unexpected-token",arg:e}),null)}scanMacro(e){var t;const r=this.context.getMacro(e);if(!r)return null;const n=this.index,a=r.args,o={"?":(t=this.args)==null?void 0:t.call(this,"?")};for(let _=1;_<=a;_++){let N=this.scanLiteralGroup();if(!N){const z=this.index;this.scanExpression(),N=oo(this.tokens.slice(z,this.index))}o[_]=N}return new eh(e,{expand:r.expand,captureSelection:r.captureSelection,args:n===this.index?null:oo(this.tokens.slice(n,this.index)),style:this.parsingContext.style,body:na(r.def,{context:this.context,parseMode:this.parseMode,args:_=>o[_],mathstyle:this.parsingContext.mathstyle,style:this.parsingContext.style})})}parseExpression(){var e,t,r,n;let a=(n=(r=(t=(e=this.scanEnvironment())!=null?e:this.scanModeShift())!=null?t:this.scanModeSet())!=null?r:this.scanGroup())!=null?n:this.scanLeftRight();if(a===null){if(this.parseSupSub()||this.parseLimits())return!0;a=this.scanSymbolCommandOrLiteral()}return a?(Array.isArray(a)?this.mathlist.push(...a):this.mathlist.push(a),!0):!1}};function na(e,t){var r,n,a,o;const _=(r=t==null?void 0:t.args)!=null?r:void 0,N=new rh(iu(e,_),t==null?void 0:t.context,{args:_,mathstyle:(n=t==null?void 0:t.mathstyle)!=null?n:"displaystyle",parseMode:(a=t==null?void 0:t.parseMode)!=null?a:"math",style:(o=t==null?void 0:t.style)!=null?o:{}}),z=[];for(;!N.end();)z.push(...N.scan(()=>!1));return z}function nh(e,t){var r;const n=new rh(iu(e,null),t==null?void 0:t.context,{mathstyle:"displaystyle",parseMode:(r=t==null?void 0:t.parseMode)!=null?r:"math"});for(;!n.end();)n.scan();return n.errors}var ih=class $d extends Qe{constructor(t,r){super({type:"chem"},{command:t,mode:"math"});const n=Jn.go(gt.go(r,t==="\\pu"?"pu":"ce"),!1);this.body=na(n),this._verbatimLatex=t+"{"+r+"}",this.arg=r,this.captureSelection=!0}static fromJson(t){return new $d(t.command,t.arg)}set verbatimLatex(t){}get verbatimLatex(){return this._verbatimLatex}toJson(){return i(F({},super.toJson()),{arg:this.arg})}render(t){const r=Qe.createBox(t,this.body,{type:"inner"});return this.caret&&(r.caret=this.caret),this.bind(t,r)}_serialize(t){return console.assert(this.verbatimLatex!==void 0),this.verbatimLatex}};ke(["ce","pu"],"{chemformula:balanced-string}",{createAtom:e=>{var t;return new ih(e.command,(t=e.args[0])!=null?t:"")}});var gt={go:function(e,t){if(!e)return[];t===void 0&&(t="ce");var r="0",n={};n.parenthesisLevel=0,e=e.replace(/\n/g," "),e=e.replace(/[\u2212\u2013\u2014\u2010]/g,"-"),e=e.replace(/[\u2026]/g,"...");for(var a,o=10,_=[];;){a!==e?(o=10,a=e):o--;var N=gt.stateMachines[t],z=N.transitions[r]||N.transitions["*"];e:for(var W=0;W<z.length;W++){var j=gt.patterns.match_(z[W].pattern,e);if(j){for(var X=z[W].task,ae=0;ae<X.action_.length;ae++){var he;if(N.actions[X.action_[ae].type_])he=N.actions[X.action_[ae].type_](n,j.match_,X.action_[ae].option);else if(gt.actions[X.action_[ae].type_])he=gt.actions[X.action_[ae].type_](n,j.match_,X.action_[ae].option);else throw["MhchemBugA","mhchem bug A. Please report. ("+X.action_[ae].type_+")"];gt.concatArray(_,he)}if(r=X.nextState||r,e.length>0){if(X.revisit||(e=j.remainder),!X.toContinue)break e}else return _}}if(o<=0)throw["MhchemBugU","mhchem bug U. Please report."]}},concatArray:function(e,t){if(t)if(Object.prototype.toString.call(t)==="[object Array]")for(var r=0;r<t.length;r++)e.push(t[r]);else e.push(t)},patterns:{patterns:{empty:/^$/,else:/^./,else2:/^./,space:/^\s/,"space A":/^\s(?=[A-Z\\$])/,space$:/^\s$/,"a-z":/^[a-z]/,x:/^x/,x$:/^x$/,i$:/^i$/,letters:/^(?:[a-zA-Z\u03B1-\u03C9\u0391-\u03A9?@]|(?:\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))))+/,"\\greek":/^\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))/,"one lowercase latin letter $":/^(?:([a-z])(?:$|[^a-zA-Z]))$/,"$one lowercase latin letter$ $":/^\$(?:([a-z])(?:$|[^a-zA-Z]))\$$/,"one lowercase greek letter $":/^(?:\$?[\u03B1-\u03C9]\$?|\$?\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega)\s*\$?)(?:\s+|\{\}|(?![a-zA-Z]))$/,digits:/^[0-9]+/,"-9.,9":/^[+\-]?(?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))/,"-9.,9 no missing 0":/^[+\-]?[0-9]+(?:[.,][0-9]+)?/,"(-)(9.,9)(e)(99)":function(e){var t=e.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))?(\((?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))\))?(?:(?:([eE])|\s*(\*|x|\\times|\u00D7)\s*10\^)([+\-]?[0-9]+|\{[+\-]?[0-9]+\}))?/);return t&&t[0]?{match_:t.slice(1),remainder:e.substr(t[0].length)}:null},"(-)(9)^(-9)":function(e){var t=e.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\^([+\-]?[0-9]+|\{[+\-]?[0-9]+\})/);return t&&t[0]?{match_:t.slice(1),remainder:e.substr(t[0].length)}:null},"state of aggregation $":function(e){var t=gt.patterns.findObserveGroups(e,"",/^\([a-z]{1,3}(?=[\),])/,")","");if(t&&t.remainder.match(/^($|[\s,;\)\]\}])/))return t;var r=e.match(/^(?:\((?:\\ca\s?)?\$[amothc]\$\))/);return r?{match_:r[0],remainder:e.substr(r[0].length)}:null},"_{(state of aggregation)}$":/^_\{(\([a-z]{1,3}\))\}/,"{[(":/^(?:\\\{|\[|\()/,")]}":/^(?:\)|\]|\\\})/,", ":/^[,;]\s*/,",":/^[,;]/,".":/^[.]/,". ":/^([.\u22C5\u00B7\u2022])\s*/,"...":/^\.\.\.(?=$|[^.])/,"* ":/^([*])\s*/,"^{(...)}":function(e){return gt.patterns.findObserveGroups(e,"^{","","","}")},"^($...$)":function(e){return gt.patterns.findObserveGroups(e,"^","$","$","")},"^a":/^\^([0-9]+|[^\\_])/,"^\\x{}{}":function(e){return gt.patterns.findObserveGroups(e,"^",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"^\\x{}":function(e){return gt.patterns.findObserveGroups(e,"^",/^\\[a-zA-Z]+\{/,"}","")},"^\\x":/^\^(\\[a-zA-Z]+)\s*/,"^(-1)":/^\^(-?\d+)/,"'":/^'/,"_{(...)}":function(e){return gt.patterns.findObserveGroups(e,"_{","","","}")},"_($...$)":function(e){return gt.patterns.findObserveGroups(e,"_","$","$","")},_9:/^_([+\-]?[0-9]+|[^\\])/,"_\\x{}{}":function(e){return gt.patterns.findObserveGroups(e,"_",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"_\\x{}":function(e){return gt.patterns.findObserveGroups(e,"_",/^\\[a-zA-Z]+\{/,"}","")},"_\\x":/^_(\\[a-zA-Z]+)\s*/,"^_":/^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,"{}":/^\{\}/,"{...}":function(e){return gt.patterns.findObserveGroups(e,"","{","}","")},"{(...)}":function(e){return gt.patterns.findObserveGroups(e,"{","","","}")},"$...$":function(e){return gt.patterns.findObserveGroups(e,"","$","$","")},"${(...)}$":function(e){return gt.patterns.findObserveGroups(e,"${","","","}$")},"$(...)$":function(e){return gt.patterns.findObserveGroups(e,"$","","","$")},"=<>":/^[=<>]/,"#":/^[#\u2261]/,"+":/^\+/,"-$":/^-(?=[\s_},;\]/]|$|\([a-z]+\))/,"-9":/^-(?=[0-9])/,"- orbital overlap":/^-(?=(?:[spd]|sp)(?:$|[\s,;\)\]\}]))/,"-":/^-/,"pm-operator":/^(?:\\pm|\$\\pm\$|\+-|\+\/-)/,operator:/^(?:\+|(?:[\-=<>]|<<|>>|\\approx|\$\\approx\$)(?=\s|$|-?[0-9]))/,arrowUpDown:/^(?:v|\(v\)|\^|\(\^\))(?=$|[\s,;\)\]\}])/,"\\bond{(...)}":function(e){return gt.patterns.findObserveGroups(e,"\\bond{","","","}")},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,CMT:/^[CMT](?=\[)/,"[(...)]":function(e){return gt.patterns.findObserveGroups(e,"[","","","]")},"1st-level escape":/^(&|\\\\|\\hline)\s*/,"\\,":/^(?:\\[,\ ;:])/,"\\x{}{}":function(e){return gt.patterns.findObserveGroups(e,"",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"\\x{}":function(e){return gt.patterns.findObserveGroups(e,"",/^\\[a-zA-Z]+\{/,"}","")},"\\ca":/^\\ca(?:\s+|(?![a-zA-Z]))/,"\\x":/^(?:\\[a-zA-Z]+\s*|\\[_&{}%])/,orbital:/^(?:[0-9]{1,2}[spdfgh]|[0-9]{0,2}sp)(?=$|[^a-zA-Z])/,others:/^[\/~|]/,"\\frac{(...)}":function(e){return gt.patterns.findObserveGroups(e,"\\frac{","","","}","{","","","}")},"\\overset{(...)}":function(e){return gt.patterns.findObserveGroups(e,"\\overset{","","","}","{","","","}")},"\\underset{(...)}":function(e){return gt.patterns.findObserveGroups(e,"\\underset{","","","}","{","","","}")},"\\underbrace{(...)}":function(e){return gt.patterns.findObserveGroups(e,"\\underbrace{","","","}_","{","","","}")},"\\color{(...)}0":function(e){return gt.patterns.findObserveGroups(e,"\\color{","","","}")},"\\color{(...)}{(...)}1":function(e){return gt.patterns.findObserveGroups(e,"\\color{","","","}","{","","","}")},"\\color(...){(...)}2":function(e){return gt.patterns.findObserveGroups(e,"\\color","\\","",/^(?=\{)/,"{","","","}")},"\\ce{(...)}":function(e){return gt.patterns.findObserveGroups(e,"\\ce{","","","}")},oxidation$:/^(?:[+-][IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"d-oxidation$":/^(?:[+-]?\s?[IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"roman numeral":/^[IVX]+/,"1/2$":/^[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+(?:\$[a-z]\$|[a-z])?$/,amount:function(e){var t;if(t=e.match(/^(?:(?:(?:\([+\-]?[0-9]+\/[0-9]+\)|[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+|[+\-]?[0-9]+[.,][0-9]+|[+\-]?\.[0-9]+|[+\-]?[0-9]+)(?:[a-z](?=\s*[A-Z]))?)|[+\-]?[a-z](?=\s*[A-Z])|\+(?!\s))/),t)return{match_:t[0],remainder:e.substr(t[0].length)};var r=gt.patterns.findObserveGroups(e,"","$","$","");return r&&(t=r.match_.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/),t)?{match_:t[0],remainder:e.substr(t[0].length)}:null},amount2:function(e){return this.amount(e)},"(KV letters),":/^(?:[A-Z][a-z]{0,2}|i)(?=,)/,formula$:function(e){if(e.match(/^\([a-z]+\)$/))return null;var t=e.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);return t?{match_:t[0],remainder:e.substr(t[0].length)}:null},uprightEntities:/^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,"/":/^\s*(\/)\s*/,"//":/^\s*(\/\/)\s*/,"*":/^\s*[*.]\s*/},findObserveGroups:function(e,t,r,n,a,o,_,N,z,W){var j=function(Be,nt){if(typeof nt=="string")return Be.indexOf(nt)!==0?null:nt;var wt=Be.match(nt);return wt?wt[0]:null},X=function(Be,nt,wt){for(var st=0;nt<Be.length;){var zt=Be.charAt(nt),qt=j(Be.substr(nt),wt);if(qt!==null&&st===0)return{endMatchBegin:nt,endMatchEnd:nt+qt.length};if(zt==="{")st++;else if(zt==="}"){if(st===0)throw["ExtraCloseMissingOpen","Extra close brace or missing open brace"];st--}nt++}return st>0,null},ae=j(e,t);if(ae===null||(e=e.substr(ae.length),ae=j(e,r),ae===null))return null;var he=X(e,ae.length,n||a);if(he===null)return null;var _e=e.substring(0,n?he.endMatchEnd:he.endMatchBegin);if(o||_){var Ue=this.findObserveGroups(e.substr(he.endMatchEnd),o,_,N,z);if(Ue===null)return null;var yt=[_e,Ue.match_];return{match_:W?yt.join(""):yt,remainder:Ue.remainder}}else return{match_:_e,remainder:e.substr(he.endMatchEnd)}},match_:function(e,t){var r=gt.patterns.patterns[e];if(r===void 0)throw["MhchemBugP","mhchem bug P. Please report. ("+e+")"];if(typeof r=="function")return gt.patterns.patterns[e](t);var n=t.match(r);if(n){var a;return n[2]?a=[n[1],n[2]]:n[1]?a=n[1]:a=n[0],{match_:a,remainder:t.substr(n[0].length)}}return null}},actions:{"a=":function(e,t){e.a=(e.a||"")+t},"b=":function(e,t){e.b=(e.b||"")+t},"p=":function(e,t){e.p=(e.p||"")+t},"o=":function(e,t){e.o=(e.o||"")+t},"q=":function(e,t){e.q=(e.q||"")+t},"d=":function(e,t){e.d=(e.d||"")+t},"rm=":function(e,t){e.rm=(e.rm||"")+t},"text=":function(e,t){e.text_=(e.text_||"")+t},insert:function(e,t,r){return{type_:r}},"insert+p1":function(e,t,r){return{type_:r,p1:t}},"insert+p1+p2":function(e,t,r){return{type_:r,p1:t[0],p2:t[1]}},copy:function(e,t){return t},rm:function(e,t){return{type_:"rm",p1:t||""}},text:function(e,t){return gt.go(t,"text")},"{text}":function(e,t){var r=["{"];return gt.concatArray(r,gt.go(t,"text")),r.push("}"),r},"tex-math":function(e,t){return gt.go(t,"tex-math")},"tex-math tight":function(e,t){return gt.go(t,"tex-math tight")},bond:function(e,t,r){return{type_:"bond",kind_:r||t}},"color0-output":function(e,t){return{type_:"color0",color:t[0]}},ce:function(e,t){return gt.go(t)},"1/2":function(e,t){var r=[];t.match(/^[+\-]/)&&(r.push(t.substr(0,1)),t=t.substr(1));var n=t.match(/^([0-9]+|\$[a-z]\$|[a-z])\/([0-9]+)(\$[a-z]\$|[a-z])?$/);return n[1]=n[1].replace(/\$/g,""),r.push({type_:"frac",p1:n[1],p2:n[2]}),n[3]&&(n[3]=n[3].replace(/\$/g,""),r.push({type_:"tex-math",p1:n[3]})),r},"9,9":function(e,t){return gt.go(t,"9,9")}},createTransitions:function(e){var t,r,n,a,o={};for(t in e)for(r in e[t])for(n=r.split("|"),e[t][r].stateArray=n,a=0;a<n.length;a++)o[n[a]]=[];for(t in e)for(r in e[t])for(n=e[t][r].stateArray||[],a=0;a<n.length;a++){var _=e[t][r];if(_.action_){_.action_=[].concat(_.action_);for(var N=0;N<_.action_.length;N++)typeof _.action_[N]=="string"&&(_.action_[N]={type_:_.action_[N]})}else _.action_=[];for(var z=t.split("|"),W=0;W<z.length;W++)if(n[a]==="*")for(var j in o)o[j].push({pattern:z[W],task:_});else o[n[a]].push({pattern:z[W],task:_})}return o},stateMachines:{}};gt.stateMachines={ce:{transitions:gt.createTransitions({empty:{"*":{action_:"output"}},else:{"0|1|2":{action_:"beginsWithBond=false",revisit:!0,toContinue:!0}},oxidation$:{0:{action_:"oxidation-output"}},CMT:{r:{action_:"rdt=",nextState:"rt"},rd:{action_:"rqt=",nextState:"rdt"}},arrowUpDown:{"0|1|2|as":{action_:["sb=false","output","operator"],nextState:"1"}},uprightEntities:{"0|1|2":{action_:["o=","output"],nextState:"1"}},orbital:{"0|1|2|3":{action_:"o=",nextState:"o"}},"->":{"0|1|2|3":{action_:"r=",nextState:"r"},"a|as":{action_:["output","r="],nextState:"r"},"*":{action_:["output","r="],nextState:"r"}},"+":{o:{action_:"d= kv",nextState:"d"},"d|D":{action_:"d=",nextState:"d"},q:{action_:"d=",nextState:"qd"},"qd|qD":{action_:"d=",nextState:"qd"},dq:{action_:["output","d="],nextState:"d"},3:{action_:["sb=false","output","operator"],nextState:"0"}},amount:{"0|2":{action_:"a=",nextState:"a"}},"pm-operator":{"0|1|2|a|as":{action_:["sb=false","output",{type_:"operator",option:"\\pm"}],nextState:"0"}},operator:{"0|1|2|a|as":{action_:["sb=false","output","operator"],nextState:"0"}},"-$":{"o|q":{action_:["charge or bond","output"],nextState:"qd"},d:{action_:"d=",nextState:"d"},D:{action_:["output",{type_:"bond",option:"-"}],nextState:"3"},q:{action_:"d=",nextState:"qd"},qd:{action_:"d=",nextState:"qd"},"qD|dq":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},"-9":{"3|o":{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"3"}},"- orbital overlap":{o:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},d:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"}},"-":{"0|1|2":{action_:[{type_:"output",option:1},"beginsWithBond=true",{type_:"bond",option:"-"}],nextState:"3"},3:{action_:{type_:"bond",option:"-"}},a:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},as:{action_:[{type_:"output",option:2},{type_:"bond",option:"-"}],nextState:"3"},b:{action_:"b="},o:{action_:{type_:"- after o/d",option:!1},nextState:"2"},q:{action_:{type_:"- after o/d",option:!1},nextState:"2"},"d|qd|dq":{action_:{type_:"- after o/d",option:!0},nextState:"2"},"D|qD|p":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},amount2:{"1|3":{action_:"a=",nextState:"a"}},letters:{"0|1|2|3|a|as|b|p|bp|o":{action_:"o=",nextState:"o"},"q|dq":{action_:["output","o="],nextState:"o"},"d|D|qd|qD":{action_:"o after d",nextState:"o"}},digits:{o:{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},q:{action_:["output","o="],nextState:"o"},a:{action_:"o=",nextState:"o"}},"space A":{"b|p|bp":{}},space:{a:{nextState:"as"},0:{action_:"sb=false"},"1|2":{action_:"sb=true"},"r|rt|rd|rdt|rdq":{action_:"output",nextState:"0"},"*":{action_:["output","sb=true"],nextState:"1"}},"1st-level escape":{"1|2":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}]},"*":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}],nextState:"0"}},"[(...)]":{"r|rt":{action_:"rd=",nextState:"rd"},"rd|rdt":{action_:"rq=",nextState:"rdq"}},"...":{"o|d|D|dq|qd|qD":{action_:["output",{type_:"bond",option:"..."}],nextState:"3"},"*":{action_:[{type_:"output",option:1},{type_:"insert",option:"ellipsis"}],nextState:"1"}},". |* ":{"*":{action_:["output",{type_:"insert",option:"addition compound"}],nextState:"1"}},"state of aggregation $":{"*":{action_:["output","state of aggregation"],nextState:"1"}},"{[(":{"a|as|o":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"0|1|2|3":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"*":{action_:["output","o=","output","parenthesisLevel++"],nextState:"2"}},")]}":{"0|1|2|3|b|p|bp|o":{action_:["o=","parenthesisLevel--"],nextState:"o"},"a|as|d|D|q|qd|qD|dq":{action_:["output","o=","parenthesisLevel--"],nextState:"o"}},", ":{"*":{action_:["output","comma"],nextState:"0"}},"^_":{"*":{}},"^{(...)}|^($...$)":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"D"},q:{action_:"d=",nextState:"qD"},"d|D|qd|qD|dq":{action_:["output","d="],nextState:"D"}},"^a|^\\x{}{}|^\\x{}|^\\x|'":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"d"},q:{action_:"d=",nextState:"qd"},"d|qd|D|qD":{action_:"d="},dq:{action_:["output","d="],nextState:"d"}},"_{(state of aggregation)}$":{"d|D|q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"_{(...)}|_($...$)|_9|_\\x{}{}|_\\x{}|_\\x":{"0|1|2|as":{action_:"p=",nextState:"p"},b:{action_:"p=",nextState:"bp"},"3|o":{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},"q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"=<>":{"0|1|2|3|a|as|o|q|d|D|qd|qD|dq":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"#":{"0|1|2|3|a|as|o":{action_:[{type_:"output",option:2},{type_:"bond",option:"#"}],nextState:"3"}},"{}":{"*":{action_:{type_:"output",option:1},nextState:"1"}},"{...}":{"0|1|2|3|a|as|b|p|bp":{action_:"o=",nextState:"o"},"o|d|D|q|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"$...$":{a:{action_:"a="},"0|1|2|3|as|b|p|bp|o":{action_:"o=",nextState:"o"},"as|o":{action_:"o="},"q|d|D|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"\\bond{(...)}":{"*":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"\\frac{(...)}":{"*":{action_:[{type_:"output",option:1},"frac-output"],nextState:"3"}},"\\overset{(...)}":{"*":{action_:[{type_:"output",option:2},"overset-output"],nextState:"3"}},"\\underset{(...)}":{"*":{action_:[{type_:"output",option:2},"underset-output"],nextState:"3"}},"\\underbrace{(...)}":{"*":{action_:[{type_:"output",option:2},"underbrace-output"],nextState:"3"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:[{type_:"output",option:2},"color-output"],nextState:"3"}},"\\color{(...)}0":{"*":{action_:[{type_:"output",option:2},"color0-output"]}},"\\ce{(...)}":{"*":{action_:[{type_:"output",option:2},"ce"],nextState:"3"}},"\\,":{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"1"}},"\\x{}{}|\\x{}|\\x":{"0|1|2|3|a|as|b|p|bp|o|c0":{action_:["o=","output"],nextState:"3"},"*":{action_:["output","o=","output"],nextState:"3"}},others:{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"3"}},else2:{a:{action_:"a to o",nextState:"o",revisit:!0},as:{action_:["output","sb=true"],nextState:"1",revisit:!0},"r|rt|rd|rdt|rdq":{action_:["output"],nextState:"0",revisit:!0},"*":{action_:["output","copy"],nextState:"3"}}}),actions:{"o after d":function(e,t){var r;if((e.d||"").match(/^[0-9]+$/)){var n=e.d;e.d=void 0,r=this.output(e),e.b=n}else r=this.output(e);return gt.actions["o="](e,t),r},"d= kv":function(e,t){e.d=t,e.dType="kv"},"charge or bond":function(e,t){if(e.beginsWithBond){var r=[];return gt.concatArray(r,this.output(e)),gt.concatArray(r,gt.actions.bond(e,t,"-")),r}else e.d=t},"- after o/d":function(e,t,r){var n=gt.patterns.match_("orbital",e.o||""),a=gt.patterns.match_("one lowercase greek letter $",e.o||""),o=gt.patterns.match_("one lowercase latin letter $",e.o||""),_=gt.patterns.match_("$one lowercase latin letter$ $",e.o||""),N=t==="-"&&(n&&n.remainder===""||a||o||_);N&&!e.a&&!e.b&&!e.p&&!e.d&&!e.q&&!n&&o&&(e.o="$"+e.o+"$");var z=[];return N?(gt.concatArray(z,this.output(e)),z.push({type_:"hyphen"})):(n=gt.patterns.match_("digits",e.d||""),r&&n&&n.remainder===""?(gt.concatArray(z,gt.actions["d="](e,t)),gt.concatArray(z,this.output(e))):(gt.concatArray(z,this.output(e)),gt.concatArray(z,gt.actions.bond(e,t,"-")))),z},"a to o":function(e){e.o=e.a,e.a=void 0},"sb=true":function(e){e.sb=!0},"sb=false":function(e){e.sb=!1},"beginsWithBond=true":function(e){e.beginsWithBond=!0},"beginsWithBond=false":function(e){e.beginsWithBond=!1},"parenthesisLevel++":function(e){e.parenthesisLevel++},"parenthesisLevel--":function(e){e.parenthesisLevel--},"state of aggregation":function(e,t){return{type_:"state of aggregation",p1:gt.go(t,"o")}},comma:function(e,t){var r=t.replace(/\s*$/,""),n=r!==t;return n&&e.parenthesisLevel===0?{type_:"comma enumeration L",p1:r}:{type_:"comma enumeration M",p1:r}},output:function(e,t,r){var n;if(!e.r)n=[],!e.a&&!e.b&&!e.p&&!e.o&&!e.q&&!e.d&&!r||(e.sb&&n.push({type_:"entitySkip"}),!e.o&&!e.q&&!e.d&&!e.b&&!e.p&&r!==2?(e.o=e.a,e.a=void 0):!e.o&&!e.q&&!e.d&&(e.b||e.p)?(e.o=e.a,e.d=e.b,e.q=e.p,e.a=e.b=e.p=void 0):e.o&&e.dType==="kv"&&gt.patterns.match_("d-oxidation$",e.d||"")?e.dType="oxidation":e.o&&e.dType==="kv"&&!e.q&&(e.dType=void 0),n.push({type_:"chemfive",a:gt.go(e.a,"a"),b:gt.go(e.b,"bd"),p:gt.go(e.p,"pq"),o:gt.go(e.o,"o"),q:gt.go(e.q,"pq"),d:gt.go(e.d,e.dType==="oxidation"?"oxidation":"bd"),dType:e.dType}));else{var a;e.rdt==="M"?a=gt.go(e.rd,"tex-math"):e.rdt==="T"?a=[{type_:"text",p1:e.rd||""}]:a=gt.go(e.rd);var o;e.rqt==="M"?o=gt.go(e.rq,"tex-math"):e.rqt==="T"?o=[{type_:"text",p1:e.rq||""}]:o=gt.go(e.rq),n={type_:"arrow",r:e.r,rd:a,rq:o}}for(var _ in e)_!=="parenthesisLevel"&&_!=="beginsWithBond"&&delete e[_];return n},"oxidation-output":function(e,t){var r=["{"];return gt.concatArray(r,gt.go(t,"oxidation")),r.push("}"),r},"frac-output":function(e,t){return{type_:"frac-ce",p1:gt.go(t[0]),p2:gt.go(t[1])}},"overset-output":function(e,t){return{type_:"overset",p1:gt.go(t[0]),p2:gt.go(t[1])}},"underset-output":function(e,t){return{type_:"underset",p1:gt.go(t[0]),p2:gt.go(t[1])}},"underbrace-output":function(e,t){return{type_:"underbrace",p1:gt.go(t[0]),p2:gt.go(t[1])}},"color-output":function(e,t){return{type_:"color",color1:t[0],color2:gt.go(t[1])}},"r=":function(e,t){e.r=t},"rdt=":function(e,t){e.rdt=t},"rd=":function(e,t){e.rd=t},"rqt=":function(e,t){e.rqt=t},"rq=":function(e,t){e.rq=t},operator:function(e,t,r){return{type_:"operator",kind_:r||t}}}},a:{transitions:gt.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},"$(...)$":{"*":{action_:"tex-math tight",nextState:"1"}},",":{"*":{action_:{type_:"insert",option:"commaDecimal"}}},else2:{"*":{action_:"copy"}}}),actions:{}},o:{transitions:gt.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},letters:{"*":{action_:"rm"}},"\\ca":{"*":{action_:{type_:"insert",option:"circa"}}},"\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"{text}"}},else2:{"*":{action_:"copy"}}}),actions:{}},text:{transitions:gt.createTransitions({empty:{"*":{action_:"output"}},"{...}":{"*":{action_:"text="}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"\\greek":{"*":{action_:["output","rm"]}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:["output","copy"]}},else:{"*":{action_:"text="}}}),actions:{output:function(e){if(e.text_){var t={type_:"text",p1:e.text_};for(var r in e)delete e[r];return t}}}},pq:{transitions:gt.createTransitions({empty:{"*":{}},"state of aggregation $":{"*":{action_:"state of aggregation"}},i$:{0:{nextState:"!f",revisit:!0}},"(KV letters),":{0:{action_:"rm",nextState:"0"}},formula$:{0:{nextState:"f",revisit:!0}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"!f",revisit:!0}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"a-z":{f:{action_:"tex-math"}},letters:{"*":{action_:"rm"}},"-9.,9":{"*":{action_:"9,9"}},",":{"*":{action_:{type_:"insert+p1",option:"comma enumeration S"}}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"state of aggregation":function(e,t){return{type_:"state of aggregation subscript",p1:gt.go(t,"o")}},"color-output":function(e,t){return{type_:"color",color1:t[0],color2:gt.go(t[1],"pq")}}}},bd:{transitions:gt.createTransitions({empty:{"*":{}},x$:{0:{nextState:"!f",revisit:!0}},formula$:{0:{nextState:"f",revisit:!0}},else:{0:{nextState:"!f",revisit:!0}},"-9.,9 no missing 0":{"*":{action_:"9,9"}},".":{"*":{action_:{type_:"insert",option:"electron dot"}}},"a-z":{f:{action_:"tex-math"}},x:{"*":{action_:{type_:"insert",option:"KV x"}}},letters:{"*":{action_:"rm"}},"'":{"*":{action_:{type_:"insert",option:"prime"}}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"color-output":function(e,t){return{type_:"color",color1:t[0],color2:gt.go(t[1],"bd")}}}},oxidation:{transitions:gt.createTransitions({empty:{"*":{}},"roman numeral":{"*":{action_:"roman-numeral"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},else:{"*":{action_:"copy"}}}),actions:{"roman-numeral":function(e,t){return{type_:"roman numeral",p1:t||""}}}},"tex-math":{transitions:gt.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},else:{"*":{action_:"o="}}}),actions:{output:function(e){if(e.o){var t={type_:"tex-math",p1:e.o};for(var r in e)delete e[r];return t}}}},"tex-math tight":{transitions:gt.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},"-|+":{"*":{action_:"tight operator"}},else:{"*":{action_:"o="}}}),actions:{"tight operator":function(e,t){e.o=(e.o||"")+"{"+t+"}"},output:function(e){if(e.o){var t={type_:"tex-math",p1:e.o};for(var r in e)delete e[r];return t}}}},"9,9":{transitions:gt.createTransitions({empty:{"*":{}},",":{"*":{action_:"comma"}},else:{"*":{action_:"copy"}}}),actions:{comma:function(){return{type_:"commaDecimal"}}}},pu:{transitions:gt.createTransitions({empty:{"*":{action_:"output"}},space$:{"*":{action_:["output","space"]}},"{[(|)]}":{"0|a":{action_:"copy"}},"(-)(9)^(-9)":{0:{action_:"number^",nextState:"a"}},"(-)(9.,9)(e)(99)":{0:{action_:"enumber",nextState:"a"}},space:{"0|a":{}},"pm-operator":{"0|a":{action_:{type_:"operator",option:"\\pm"},nextState:"0"}},operator:{"0|a":{action_:"copy",nextState:"0"}},"//":{d:{action_:"o=",nextState:"/"}},"/":{d:{action_:"o=",nextState:"/"}},"{...}|else":{"0|d":{action_:"d=",nextState:"d"},a:{action_:["space","d="],nextState:"d"},"/|q":{action_:"q=",nextState:"q"}}}),actions:{enumber:function(e,t){var r=[];return t[0]==="+-"||t[0]==="+/-"?r.push("\\pm "):t[0]&&r.push(t[0]),t[1]&&(gt.concatArray(r,gt.go(t[1],"pu-9,9")),t[2]&&(t[2].match(/[,.]/)?gt.concatArray(r,gt.go(t[2],"pu-9,9")):r.push(t[2])),(t[3]||t[4])&&(t[3]==="e"||t[4]==="*"?r.push({type_:"cdot"}):r.push({type_:"times"}))),t[5]&&r.push("10^{"+t[5]+"}"),r},"number^":function(e,t){var r=[];return t[0]==="+-"||t[0]==="+/-"?r.push("\\pm "):t[0]&&r.push(t[0]),gt.concatArray(r,gt.go(t[1],"pu-9,9")),r.push("^{"+t[2]+"}"),r},operator:function(e,t,r){return{type_:"operator",kind_:r||t}},space:function(){return{type_:"pu-space-1"}},output:function(e){var t,r=gt.patterns.match_("{(...)}",e.d||"");r&&r.remainder===""&&(e.d=r.match_);var n=gt.patterns.match_("{(...)}",e.q||"");if(n&&n.remainder===""&&(e.q=n.match_),e.d&&(e.d=e.d.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),e.d=e.d.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F")),e.q){e.q=e.q.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),e.q=e.q.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F");var a={d:gt.go(e.d,"pu"),q:gt.go(e.q,"pu")};e.o==="//"?t={type_:"pu-frac",p1:a.d,p2:a.q}:(t=a.d,a.d.length>1||a.q.length>1?t.push({type_:" / "}):t.push({type_:"/"}),gt.concatArray(t,a.q))}else t=gt.go(e.d,"pu-2");for(var o in e)delete e[o];return t}}},"pu-2":{transitions:gt.createTransitions({empty:{"*":{action_:"output"}},"*":{"*":{action_:["output","cdot"],nextState:"0"}},"\\x":{"*":{action_:"rm="}},space:{"*":{action_:["output","space"],nextState:"0"}},"^{(...)}|^(-1)":{1:{action_:"^(-1)"}},"-9.,9":{0:{action_:"rm=",nextState:"0"},1:{action_:"^(-1)",nextState:"0"}},"{...}|else":{"*":{action_:"rm=",nextState:"1"}}}),actions:{cdot:function(){return{type_:"tight cdot"}},"^(-1)":function(e,t){e.rm+="^{"+t+"}"},space:function(){return{type_:"pu-space-2"}},output:function(e){var t=[];if(e.rm){var r=gt.patterns.match_("{(...)}",e.rm||"");r&&r.remainder===""?t=gt.go(r.match_,"pu"):t={type_:"rm",p1:e.rm}}for(var n in e)delete e[n];return t}}},"pu-9,9":{transitions:gt.createTransitions({empty:{0:{action_:"output-0"},o:{action_:"output-o"}},",":{0:{action_:["output-0","comma"],nextState:"o"}},".":{0:{action_:["output-0","copy"],nextState:"o"}},else:{"*":{action_:"text="}}}),actions:{comma:function(){return{type_:"commaDecimal"}},"output-0":function(e){var t=[];if(e.text_=e.text_||"",e.text_.length>4){var r=e.text_.length%3;r===0&&(r=3);for(var n=e.text_.length-3;n>0;n-=3)t.push(e.text_.substr(n,3)),t.push({type_:"1000 separator"});t.push(e.text_.substr(0,r)),t.reverse()}else t.push(e.text_);for(var a in e)delete e[a];return t},"output-o":function(e){var t=[];if(e.text_=e.text_||"",e.text_.length>4){for(var r=e.text_.length-3,n=0;n<r;n+=3)t.push(e.text_.substr(n,3)),t.push({type_:"1000 separator"});t.push(e.text_.substr(n))}else t.push(e.text_);for(var a in e)delete e[a];return t}}}};var Jn={go:function(e,t){if(!e)return"";for(var r="",n=!1,a=0;a<e.length;a++){var o=e[a];typeof o=="string"?r+=o:(r+=Jn._go2(o),o.type_==="1st-level escape"&&(n=!0))}return!t&&!n&&r&&(r="{"+r+"}"),r},_goInner:function(e){return e&&Jn.go(e,!0)},_go2:function(e){var t;switch(e.type_){case"chemfive":t="";var r={a:Jn._goInner(e.a),b:Jn._goInner(e.b),p:Jn._goInner(e.p),o:Jn._goInner(e.o),q:Jn._goInner(e.q),d:Jn._goInner(e.d)};r.a&&(r.a.match(/^[+\-]/)&&(r.a="{"+r.a+"}"),t+=r.a+"\\,"),(r.b||r.p)&&(t+="{\\vphantom{X}}",t+="^{\\hphantom{"+(r.b||"")+"}}_{\\hphantom{"+(r.p||"")+"}}",t+="{\\vphantom{X}}",t+="^{\\smash[t]{\\vphantom{2}}\\llap{"+(r.b||"")+"}}",t+="_{\\vphantom{2}\\llap{\\smash[t]{"+(r.p||"")+"}}}"),r.o&&(r.o.match(/^[+\-]/)&&(r.o="{"+r.o+"}"),t+=r.o),e.dType==="kv"?((r.d||r.q)&&(t+="{\\vphantom{X}}"),r.d&&(t+="^{"+r.d+"}"),r.q&&(t+="_{\\smash[t]{"+r.q+"}}")):e.dType==="oxidation"?(r.d&&(t+="{\\vphantom{X}}",t+="^{"+r.d+"}"),r.q&&(t+="{\\vphantom{X}}",t+="_{\\smash[t]{"+r.q+"}}")):(r.q&&(t+="{\\vphantom{X}}",t+="_{\\smash[t]{"+r.q+"}}"),r.d&&(t+="{\\vphantom{X}}",t+="^{"+r.d+"}"));break;case"rm":t="\\mathrm{"+e.p1+"}";break;case"text":e.p1.match(/[\^_]/)?(e.p1=e.p1.replace(" ","~").replace("-","\\text{-}"),t="\\mathrm{"+e.p1+"}"):t="\\text{"+e.p1+"}";break;case"roman numeral":t="\\mathrm{"+e.p1+"}";break;case"state of aggregation":t="\\mskip2mu "+Jn._goInner(e.p1);break;case"state of aggregation subscript":t="\\mskip1mu "+Jn._goInner(e.p1);break;case"bond":if(t=Jn._getBond(e.kind_),!t)throw["MhchemErrorBond","mhchem Error. Unknown bond type ("+e.kind_+")"];break;case"frac":var n="\\frac{"+e.p1+"}{"+e.p2+"}";t="\\mathchoice{\\textstyle"+n+"}{"+n+"}{"+n+"}{"+n+"}";break;case"pu-frac":var a="\\frac{"+Jn._goInner(e.p1)+"}{"+Jn._goInner(e.p2)+"}";t="\\mathchoice{\\textstyle"+a+"}{"+a+"}{"+a+"}{"+a+"}";break;case"tex-math":t=e.p1+" ";break;case"frac-ce":t="\\frac{"+Jn._goInner(e.p1)+"}{"+Jn._goInner(e.p2)+"}";break;case"overset":t="\\overset{"+Jn._goInner(e.p1)+"}{"+Jn._goInner(e.p2)+"}";break;case"underset":t="\\underset{"+Jn._goInner(e.p1)+"}{"+Jn._goInner(e.p2)+"}";break;case"underbrace":t="\\underbrace{"+Jn._goInner(e.p1)+"}_{"+Jn._goInner(e.p2)+"}";break;case"color":t="{\\color{"+e.color1+"}{"+Jn._goInner(e.color2)+"}}";break;case"color0":t="\\color{"+e.color+"}";break;case"arrow":var o={rd:Jn._goInner(e.rd),rq:Jn._goInner(e.rq)},_=Jn._getArrow(e.r);o.rd||o.rq?e.r==="<=>"||e.r==="<=>>"||e.r==="<<=>"||e.r==="<-->"?(_="\\long"+_,o.rd&&(_="\\overset{"+o.rd+"}{"+_+"}"),o.rq&&(e.r==="<-->"?_="\\underset{\\lower2mu{"+o.rq+"}}{"+_+"}":_="\\underset{\\lower6mu{"+o.rq+"}}{"+_+"}"),_=" {}\\mathrel{"+_+"}{} "):(o.rq&&(_+="[{"+o.rq+"}]"),_+="{"+o.rd+"}",_=" {}\\mathrel{\\x"+_+"}{} "):_=" {}\\mathrel{\\long"+_+"}{} ",t=_;break;case"operator":t=Jn._getOperator(e.kind_);break;case"1st-level escape":t=e.p1+" ";break;case"space":t=" ";break;case"entitySkip":t="~";break;case"pu-space-1":t="~";break;case"pu-space-2":t="\\mkern3mu ";break;case"1000 separator":t="\\mkern2mu ";break;case"commaDecimal":t="{,}";break;case"comma enumeration L":t="{"+e.p1+"}\\mkern6mu ";break;case"comma enumeration M":t="{"+e.p1+"}\\mkern3mu ";break;case"comma enumeration S":t="{"+e.p1+"}\\mkern1mu ";break;case"hyphen":t="\\text{-}";break;case"addition compound":t="\\,{\\cdot}\\,";break;case"electron dot":t="\\mkern1mu \\bullet\\mkern1mu ";break;case"KV x":t="{\\times}";break;case"prime":t="\\prime ";break;case"cdot":t="\\cdot ";break;case"tight cdot":t="\\mkern1mu{\\cdot}\\mkern1mu ";break;case"times":t="\\times ";break;case"circa":t="{\\sim}";break;case"^":t="uparrow";break;case"v":t="downarrow";break;case"ellipsis":t="\\ldots ";break;case"/":t="/";break;case" / ":t="\\,/\\,";break;default:throw["MhchemBugT","mhchem bug T. Please report."]}return t},_getArrow:function(e){switch(e){case"->":return"rightarrow";case"\u2192":return"rightarrow";case"\u27F6":return"rightarrow";case"<-":return"leftarrow";case"<->":return"leftrightarrow";case"<-->":return"leftrightarrows";case"<=>":return"rightleftharpoons";case"\u21CC":return"rightleftharpoons";case"<=>>":return"Rightleftharpoons";case"<<=>":return"Leftrightharpoons";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getBond:function(e){switch(e){case"-":return"{-}";case"1":return"{-}";case"=":return"{=}";case"2":return"{=}";case"#":return"{\\equiv}";case"3":return"{\\equiv}";case"~":return"{\\tripledash}";case"~-":return"{\\rlap{\\lower.1em{-}}\\raise.1em{\\tripledash}}";case"~=":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{\\tripledash}}-}";case"~--":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{\\tripledash}}-}";case"-~-":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{-}}\\tripledash}";case"...":return"{{\\cdot}{\\cdot}{\\cdot}}";case"....":return"{{\\cdot}{\\cdot}{\\cdot}{\\cdot}}";case"->":return"{\\rightarrow}";case"<-":return"{\\leftarrow}";case"<":return"{<}";case">":return"{>}";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getOperator:function(e){switch(e){case"+":return" {}+{} ";case"-":return" {}-{} ";case"=":return" {}={} ";case"<":return" {}<{} ";case">":return" {}>{} ";case"<<":return" {}\\ll{} ";case">>":return" {}\\gg{} ";case"\\pm":return" {}\\pm{} ";case"\\approx":return" {}\\approx{} ";case"$\\approx$":return" {}\\approx{} ";case"v":return" \\downarrow{} ";case"(v)":return" \\downarrow{} ";case"^":return" \\uparrow{} ";case"(^)":return" \\uparrow{} ";default:throw["MhchemBugT","mhchem bug T. Please report."]}}};function Rg(e){}function Pg(e){}var ah=class Wd extends Qe{constructor(t){super(i(F({},t),{type:"delim"})),this.value=t.delim,this.size=t.size}static fromJson(t){return new Wd(t)}toJson(){return i(F({},super.toJson()),{delim:this.value,size:this.size})}render(t){return new St(this.value,{type:"middle"})}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const r=Je(this.command,this.mode);return r!=null&&r.serialize?r.serialize(this,t):qn(this.command,this.value)}},sh=class Vd extends Qe{constructor(t){super(i(F({},t),{type:"sizeddelim",value:t.delim})),this.delimType=t.delimType,this.size=t.size}static fromJson(t){return new Vd(t)}toJson(){return i(F({},super.toJson()),{delim:this.value,size:this.size,delimType:this.delimType})}render(t){let r=J0(this.value,this.size,t,{classes:{open:"mopen",close:"mclose"}[this.delimType],type:this.delimType,isSelected:this.isSelected});return r?(r=this.bind(t,r),this.caret&&(r.caret=this.caret),r):null}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const r=Je(this.command,this.mode);return r!=null&&r.serialize?r.serialize(this,t):qn(this.command,this.value)}},bl=class Hd extends Qe{constructor(t,r,n,a){var o,_;super({type:"enclose",command:t,style:a.style}),this.body=r,this.backgroundcolor=a.backgroundcolor,n.updiagonalarrow&&(n.updiagonalstrike=!1),n.box&&(n.left=!1,n.right=!1,n.bottom=!1,n.top=!1),this.notation=n,this.shadow=(o=a.shadow)!=null?o:"none",this.strokeWidth=(_=a.strokeWidth)!=null?_:"0.06em",this.strokeWidth||(this.strokeWidth="0.06em"),this.strokeStyle=a.strokeStyle,this.svgStrokeStyle=a.svgStrokeStyle,this.strokeColor=a.strokeColor,this.borderStyle=a.borderStyle,this.padding=a.padding,this.captureSelection=!1}static fromJson(t){return new Hd(t.command,t.body,t.notation,t)}toJson(){return i(F({},super.toJson()),{notation:this.notation,shadow:this.shadow,strokeWidth:this.strokeWidth,strokeStyle:this.strokeStyle,svgStrokeStyle:this.svgStrokeStyle,strokeColor:this.strokeColor,borderStyle:this.borderStyle,padding:this.padding})}_serialize(t){var r;if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const n=Je(this.command,this.mode);if(n!=null&&n.serialize)return n.serialize(this,t);let a=(r=this.command)!=null?r:"";if(this.command==="\\enclose"){a+="{"+Object.keys(this.notation).join(" ")+"}";let o="",_="";this.backgroundcolor&&this.backgroundcolor!=="transparent"&&(o+=_+'mathbackground="'+this.backgroundcolor+'"',_=","),this.shadow&&this.shadow!=="auto"&&(o+=_+'shadow="'+this.shadow+'"',_=","),this.strokeWidth||this.strokeStyle!=="solid"?(o+=_+this.borderStyle,_=","):this.strokeColor&&this.strokeColor!=="currentColor"&&(o+=_+'mathcolor="'+this.strokeColor+'"',_=","),o&&(a+=`[${o}]`)}return qn(a,this.bodyToLatex(t))}render(t){const r=new Qr({parent:t},this.style),n=Qe.createBox(r,this.body);if(!n)return null;const a=fp(this.borderStyle),o=r.toEm(!this.padding||this.padding==="auto"?{register:"fboxsep"}:{string:this.padding});n.setStyle("position","relative"),n.setStyle("display","inline-block"),n.setStyle("top",o,"em"),n.setStyle("height",n.height+n.depth,"em"),n.setStyle("width",n.width,"em");const _=new St(null,{classes:"ML__notation"});let N=n.height+n.depth+2*o;const z=n.width+2*o;let W="";if(this.notation.horizontalstrike&&(W+=this.line(3,50,97,50)),this.notation.verticalstrike&&(W+=this.line(50,3,50,97)),this.notation.updiagonalstrike&&(W+=this.line(3,97,97,3)),this.notation.downdiagonalstrike&&(W+=this.line(3,3,97,97)),this.notation.updiagonalarrow){W+=this.line(o.toString(),(o+n.depth+n.height).toString(),(o+n.width).toString(),o.toString());const _e=.03*Math.sqrt(z*z+N*N)*1,Ue=n.width*_e,yt=(n.depth+n.height)*_e,Be=o+n.width;let nt=o;nt+yt-.4*Ue<0&&(nt=.4*Ue-yt),W+='<polygon points="',W+=`${Be},${nt} ${Be-Ue-.4*yt},${nt+yt-.4*Ue} `,W+=`${Be-.7*Ue},${nt+.7*yt} ${Be-Ue+.4*yt},${nt+yt+.4*Ue} `,W+=`${Be},${nt}`,W+=`" stroke='none' fill="${this.strokeColor}"`,W+="/>"}let j=0;if(this.notation.phasorangle){const ae=oh(r),he=(n.height+n.depth+2*ae+o).toString(),_e=(n.height+n.depth)/2;W+=this.line(o.toString(),he,(o+_e+n.width).toString(),he),W+=this.line(o.toString(),he,(o+_e).toString(),(o-ae).toString()),N+=ae,j=_e,n.left+=N/2-o}if(this.notation.longdiv){const ae=oh(r);N+=ae,W+=this.line(o.toString(),o.toString(),(o+n.width).toString(),o.toString());const he=.3;j=he+ae,n.left+=he+ae,n.setTop(o+ae),W+='<path d="',W+=`M ${o} ${o} a${he} ${(n.depth+n.height+2*ae)/2}, 0, 1, 1, 0 ${n.depth+n.height+2*ae} "`,W+=` stroke-width="${hp(r)}" stroke="${this.strokeColor}" fill="none"`,W+="/>"}if(_.width=n.width+2*o+j,_.height=n.height+o,_.depth=n.depth+o,_.setStyle("box-sizing","border-box"),_.setStyle("left",`calc(-${a} / 2 )`),_.setStyle("height",`${Math.floor(100*N)/100}em`),_.setStyle("top",`calc(${a} / 2 )`),this.backgroundcolor&&_.setStyle("background-color",this.backgroundcolor),this.notation.box&&_.setStyle("border","1px solid red"),this.notation.actuarial&&(_.setStyle("border-top",this.borderStyle),_.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(_.setStyle("border-bottom",this.borderStyle),_.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(_.setStyle("border-radius","8px"),_.setStyle("border",this.borderStyle)),this.notation.circle&&(_.setStyle("border-radius","50%"),_.setStyle("border",this.borderStyle)),this.notation.top&&_.setStyle("border-top",this.borderStyle),this.notation.left&&_.setStyle("border-left",this.borderStyle),this.notation.right&&_.setStyle("border-right",this.borderStyle),this.notation.bottom&&_.setStyle("border-bottom",this.borderStyle),W){let ae="";this.shadow==="auto"&&(ae+="filter: drop-shadow(0 0 .5px rgba(255, 255, 255, .7)) drop-shadow(1px 1px 2px #333)"),this.shadow!=="none"&&(ae+=`filter: drop-shadow(${this.shadow})`),ae+=` stroke-width="${this.strokeWidth}" stroke="${this.strokeColor}"`,ae+=' stroke-linecap="round"',this.svgStrokeStyle&&(ae+=` stroke-dasharray="${this.svgStrokeStyle}"`),_.svgStyle=ae,_.svgOverlay=W}const X=new St([_,n]);return X.setStyle("position","relative"),X.setStyle("vertical-align",o,"em"),X.setStyle("height",`${Math.floor(100*(n.height+n.depth+2*o))/100}em`),X.setStyle("display","inline-block"),X.height=_.height,X.depth=_.depth,X.width=_.width-2*o,X.left=o,X.right=o,this.caret&&(X.caret=this.caret),X.wrap(r)}line(t,r,n,a){return`<line x1="${Eu(t)}" y1="${Eu(r)}" x2="${Eu(n)}" y2="${Eu(a)}" vector-effect="non-scaling-stroke"></line>`}};function Eu(e){return typeof e=="number"?`${Math.floor(100*e)/100}%`:e}function fp(e){if(!e)return"1px";const t=e.match(/([0-9][a-zA-Z\%]+)/);return t===null?"1px":t[1]}function hp(e){return(Math.floor(100*e.metrics.sqrtRuleThickness/e.scalingFactor)/100/10).toString()+"em"}function oh(e){const t=e.isDisplayStyle?Ks:e.metrics.defaultRuleThickness;return e.metrics.defaultRuleThickness+e.scalingFactor*t/4}var jo=class jd extends Qe{constructor(t,r,n){var a,o;super(i(F({},n),{type:"genfrac",displayContainsHighlight:!0})),this.above=t,this.below=r,this.hasBarLine=(a=n==null?void 0:n.hasBarLine)!=null?a:!0,this.continuousFraction=(o=n==null?void 0:n.continuousFraction)!=null?o:!1,this.numerPrefix=n==null?void 0:n.numerPrefix,this.denomPrefix=n==null?void 0:n.denomPrefix,this.mathstyleName=n==null?void 0:n.mathstyleName,this.leftDelim=n==null?void 0:n.leftDelim,this.rightDelim=n==null?void 0:n.rightDelim,this.fractionNavigationOrder=n==null?void 0:n.fractionNavigationOrder}static fromJson(t){return new jd(t.above,t.below,t)}toJson(){const t={};return this.continuousFraction&&(t.continuousFraction=!0),this.numerPrefix&&(t.numerPrefix=this.numerPrefix),this.denomPrefix&&(t.denomPrefix=this.denomPrefix),this.leftDelim&&(t.leftDelim=this.leftDelim),this.rightDelim&&(t.rightDelim=this.rightDelim),this.hasBarLine||(t.hasBarLine=!1),this.mathstyleName&&(t.mathstyleName=this.mathstyleName),this.fractionNavigationOrder&&(t.fractionNavigationOrder=this.fractionNavigationOrder),F(F({},super.toJson()),t)}get children(){if(this._children)return this._children;const t=[];if(this.fractionNavigationOrder==="denominator-numerator"){for(const r of this.below)t.push(...r.children),t.push(r);for(const r of this.above)t.push(...r.children),t.push(r)}else{for(const r of this.above)t.push(...r.children),t.push(r);for(const r of this.below)t.push(...r.children),t.push(r)}return this._children=t,t}render(t){var r,n;const a=new Qr({parent:t,mathstyle:this.mathstyleName},this.style),o=a.metrics,_=new Qr({parent:a,mathstyle:this.continuousFraction?"":"numerator"},this.style),N=this.numerPrefix?new St([new St(this.numerPrefix),Qe.createBox(_,this.above)],{isTight:_.isTight,type:"ignore"}):(r=Qe.createBox(_,this.above,{type:"ignore"}))!=null?r:new St(null,{type:"ignore"}),z=new Qr({parent:a,mathstyle:this.continuousFraction?"":"denominator"},this.style),W=this.denomPrefix?new St([new St(this.denomPrefix),Qe.createBox(z,this.below,{type:"ignore"})]):(n=Qe.createBox(z,this.below,{type:"ignore"}))!=null?n:new St(null,{type:"ignore"}),j=this.hasBarLine?o.defaultRuleThickness:0;let X,ae=0,he;a.isDisplayStyle?(X=_.metrics.num1,ae=j>0?3*j:7*j,he=z.metrics.denom1):(j>0?(X=_.metrics.num2,ae=j):(X=_.metrics.num3,ae=3*o.defaultRuleThickness),he=z.metrics.denom2);const _e=[];this.isSelected&&_e.push("ML__selected");const Ue=N.depth,yt=W.height;let Be;if(j<=0){const Gt=X-Ue-(yt-he);Gt<ae&&(X+=(ae-Gt)/2,he+=(ae-Gt)/2),Be=new Ai({individualShift:[{box:N,shift:-X,classes:[..._e,"ML__center"]},{box:W,shift:he,classes:[..._e,"ML__center"]}]}).wrap(a)}else{const Gt=new St(null,{classes:"ML__frac-line",mode:this.mode,style:this.style});Gt.softWidth=Math.max(N.width,W.width),Gt.height=j/2,Gt.depth=j/2;const Hr=ts+j/2;X<ae+Ue+Hr&&(X=ae+Ue+Hr);const _n=ts-j/2;he<ae+yt-_n&&(he=ae+yt-_n),Be=new Ai({individualShift:[{box:W,shift:he,classes:[..._e,"ML__center"]},{box:Gt,shift:-_n,classes:_e},{box:N,shift:-X,classes:[..._e,"ML__center"]}]}).wrap(a)}const nt=a.isDisplayStyle?o.delim1:o.delim2,wt=this.leftDelim?this.bind(t,_u("open",this.leftDelim,nt,!0,t,{style:this.style,mode:this.mode,isSelected:this.isSelected})):mo(a,"open");let st=null;this.continuousFraction?st=new St(null,{type:"close"}):this.rightDelim?st=this.bind(t,_u("close",this.rightDelim,nt,!0,t,{style:this.style,mode:this.mode,isSelected:this.isSelected})):st=mo(a,"close");const zt=new St([wt,Be,st],{isTight:a.isTight,type:"inner",classes:"mfrac"}),qt=this.bind(t,zt);return this.caret&&(qt.caret=this.caret),this.attachSupsub(t,{base:qt})}},Ni=class Gd extends Qe{constructor(t,r){var n;super({type:"latex",value:t,mode:"latex"}),this.isSuggestion=(n=r==null?void 0:r.isSuggestion)!=null?n:!1,this.isError=!1}static fromJson(t){const r=new Gd(t.value);return t.isSuggestion&&(r.isSuggestion=!0),t.isError&&(r.isError=!0),r}toJson(){const t={};return this.isSuggestion&&(t.isSuggestion=!0),this.isError&&(t.isError=!0),F({type:"latex",value:this.value},t)}get computedStyle(){return{}}render(t){const r=new St(this.value,{classes:this.isSuggestion?"ML__suggestion":this.isError?"ML__error":"",type:"latex",maxFontSize:1});return r?(this.caret&&(r.caret=this.caret),this.bind(t,r)):null}},xl=class Zd extends Qe{constructor(t){super({type:"latexgroup",mode:"latex"}),this.body=[...t].map(r=>new Ni(r)),this.skipBoundary=!1}static fromJson(t){return new Zd("")}toJson(){return super.toJson()}render(t){const r=Qe.createBox(t,this.body);return r?(this.caret&&(r.caret=this.caret),this.bind(t,r)):null}_serialize(t){var r,n;return(n=(r=this.body)==null?void 0:r.map(a=>a.value).join(""))!=null?n:""}},_c=class Yd extends Qe{constructor(t,r){super(i(F({},r),{type:"extensible-symbol",isFunction:r==null?void 0:r.isFunction})),this.value=t,this.variant=r==null?void 0:r.variant,this.subsupPlacement=r==null?void 0:r.limits}static fromJson(t){return new Yd(t.symbol,t)}toJson(){const t=super.toJson();return this.variant&&(t.variant=this.variant),this.subsupPlacement&&(t.limits=this.subsupPlacement),this.isExtensibleSymbol&&(t.isExtensibleSymbol=!0),this.value&&(t.symbol=this.value),t}render(t){var r;const n=t.isDisplayStyle&&this.value!=="\\smallint",a=new St(this.value,{fontFamily:n?"Size2-Regular":"Size1-Regular",classes:"op-symbol "+(n?"large-op":"small-op"),type:"op",maxFontSize:t.scalingFactor,isSelected:this.isSelected});if(!a)return null;a.right=a.italic;const o=(a.height-a.depth)/2-ts*t.scalingFactor,_=a.italic;a.setTop(o);let N=a;if(this.superscript||this.subscript){const z=(r=this.subsupPlacement)!=null?r:"auto";N=z==="over-under"||z==="auto"&&t.isDisplayStyle?this.attachLimits(t,{base:a,baseShift:o,slant:_}):this.attachSupsub(t,{base:a})}return new St(this.bind(t,N),{type:"op",caret:this.caret,isSelected:this.isSelected,classes:"op-group"}).wrap(t)}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const r=Je(this.command,this.mode);if(r!=null&&r.serialize)return r.serialize(this,t);const n=[];return n.push(this.command),this.explicitSubsupPlacement&&(this.subsupPlacement==="over-under"&&n.push("\\limits"),this.subsupPlacement==="adjacent"&&n.push("\\nolimits"),this.subsupPlacement==="auto"&&n.push("\\displaylimits")),n.push(this.supsubToLatex(t)),Jr(n)}},go=class Xd extends Qe{constructor(t){const r=t.body;super(i(F({},t),{type:"overlap",body:typeof r=="string"?[new Qe({value:r})]:r,style:t==null?void 0:t.style})),this.skipBoundary=!0,this.align=t==null?void 0:t.align,this.boxType=t==null?void 0:t.boxType}static fromJson(t){return new Xd(t)}toJson(){const t={};return this.align&&(t.align=this.align),this.boxType&&(t.boxType=this.boxType),F(F({},super.toJson()),t)}render(t){const r=Qe.createBox(t,this.body,{classes:"inner"});return r?(this.caret&&(r.caret=this.caret),this.bind(t,new St([r,new St(null,{classes:"fix"})],{classes:this.align==="right"?"rlap":"llap",type:this.boxType}))):null}},za=class qd extends Qe{constructor(t){var r,n,a,o;super({type:"overunder",command:t.command,style:t.style,mode:t.mode,body:t.body,skipBoundary:(r=t.skipBoundary)!=null?r:!0}),this.subsupPlacement=t.supsubPlacement,this.svgAbove=t.svgAbove,this.svgBelow=t.svgBelow,this.svgBody=t.svgBody,this.above=t.above,this.below=t.below,this.boxType=(n=t.boxType)!=null?n:"ord",this.paddedBody=(a=t.paddedBody)!=null?a:!1,this.paddedLabels=(o=t.paddedLabels)!=null?o:!1}static fromJson(t){return new qd(t)}toJson(){const t=super.toJson();return this.skipBoundary||(t.skipBoundary=!1),this.subsupPlacement&&(t.subsupPlacement=this.subsupPlacement),this.svgAbove&&(t.svgAbove=this.svgAbove),this.svgBelow&&(t.svgBelow=this.svgBelow),this.svgBody&&(t.svgBody=this.svgBody),this.boxType!=="ord"&&(t.boxType=this.boxType),this.paddedBody&&(t.paddedBody=!0),this.paddedLabels&&(t.paddedLabels=!0),t}render(t){let r=this.svgBody?ou(this.svgBody):Qe.createBox(t,this.body,{type:"ignore"});const n=new Qr({parent:t,mathstyle:"scriptstyle"},this.style);let a=null;this.svgAbove?a=ou(this.svgAbove):this.above&&(a=Qe.createBox(n,this.above,{type:"ignore"}));let o=null;this.svgBelow?o=ou(this.svgBelow):this.below&&(o=Qe.createBox(n,this.below,{type:"ignore"})),this.paddedBody&&(r=new St([mo(t,"open"),r,mo(t,"close")],{type:"ignore"}));let _=dp(t,{base:r,above:a,below:o,type:this.boxType==="bin"||this.boxType==="rel"?this.boxType:"ord",paddedAboveBelow:this.paddedLabels});return _?(this.subsupPlacement==="over-under"?_=this.attachLimits(t,{base:_,type:_.type}):_=this.attachSupsub(t,{base:_}),this.caret&&(_.caret=this.caret),this.bind(t,_)):null}};function dp(e,t){if(!t.base)return null;if(!t.above&&!t.below){const N=new St(t.base,{type:t.type});return N.setStyle("position","relative"),N}let r=0;t.above&&(r=e.metrics.bigOpSpacing5);let n=null;const a=t.base,o=0,_=["ML__center"];if(t.paddedAboveBelow&&_.push("ML__label_padding"),t.below&&t.above){const N=e.metrics.bigOpSpacing5+t.below.height+t.below.depth+a.depth+o;n=new Ai({bottom:N,children:[e.metrics.bigOpSpacing5,{box:t.below,classes:_},{box:a,classes:["ML__center"]},r,{box:t.above,classes:_},e.metrics.bigOpSpacing5]})}else t.below?n=new Ai({top:a.height-o,children:[e.metrics.bigOpSpacing5,{box:t.below,classes:_},{box:a,classes:["ML__center"]}]}):t.above&&(n=new Ai({bottom:a.depth+o,children:[{box:a,classes:["ML__center"]},r,{box:t.above,classes:_},e.metrics.bigOpSpacing5]}));return new St(n,{type:t.type})}var El=class Jd extends Qe{constructor(t){var r,n,a,o;super(i(F({},t),{type:"phantom"})),this.captureSelection=!0,this.isInvisible=(r=t.isInvisible)!=null?r:!1,this.smashDepth=(n=t.smashDepth)!=null?n:!1,this.smashHeight=(a=t.smashHeight)!=null?a:!1,this.smashWidth=(o=t.smashWidth)!=null?o:!1}static fromJson(t){return new Jd(t)}toJson(){const t={};return this.isInvisible&&(t.isInvisible=!0),this.smashDepth&&(t.smashDepth=!0),this.smashHeight&&(t.smashHeight=!0),this.smashWidth&&(t.smashWidth=!0),F(F({},super.toJson()),t)}render(t){const r=new Qr({parent:t,isPhantom:!0});if(!this.smashDepth&&!this.smashHeight&&!this.smashWidth)return console.assert(this.isInvisible),Qe.createBox(r,this.body,{classes:"inner"});const n=Qe.createBox(this.isInvisible?r:t,this.body);if(!n)return null;if(this.smashWidth){const a=new St(null,{classes:"fix"});return new St([n,a],{classes:"rlap"}).wrap(t)}if(!this.smashHeight&&!this.smashDepth)return n;if(this.smashHeight&&(n.height=0),this.smashDepth&&(n.depth=0),n.children)for(const a of n.children)this.smashHeight&&(a.height=0),this.smashDepth&&(a.depth=0);return new Ai({firstBaseline:[{box:n}]},{type:n.type}).wrap(t)}},wl=class Qd extends Qe{constructor(t){var r;super(F({type:"spacing"},t)),this.width=t==null?void 0:t.width,this._braced=(r=t==null?void 0:t.braced)!=null?r:!1}static fromJson(t){return new Qd(t)}toJson(){const t=super.toJson();return this.width!==void 0&&(t.width=this.width),this._braced&&(t.braced=!0),t}render(t){var r;if(this.command==="space")return new St(this.mode==="math"?null:" ");let n;if(this.width!==void 0)n=new St(null,{classes:"mspace"}),n.left=t.toEm(this.width);else{const a=(r={"\\qquad":"qquad","\\quad":"quad","\\enspace":"enspace","\\;":"thickspace","\\:":"mediumspace","\\>":"mediumspace","\\,":"thinspace","\\!":"negativethinspace"}[this.command])!=null?r:"mediumspace";n=new St(null,{classes:a})}return n=this.bind(t,n),this.caret&&(n.caret=this.caret),n}_serialize(t){var r;if(!t.expandMacro&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const n=Je(this.command,this.mode);if(n!=null&&n.serialize)return n.serialize(this,t);const a=(r=this.command)!=null?r:"";return this.width===void 0?a:this._braced&&!("register"in this.width)?`${a}{${Wi(this.width)}}`:`${a}${Wi(this.width)}`}},lh=class e0 extends Qe{constructor(t){var r;super(i(F({},t),{type:"surd",mode:(r=t.mode)!=null?r:"math",style:t.style,displayContainsHighlight:!0,body:t.body})),this.above=t.index}static fromJson(t){return new e0(i(F({},t),{index:t.above}))}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const r=Je(this.command,this.mode);if(r!=null&&r.serialize)return r.serialize(this,t);const n=this.command,a=this.bodyToLatex(t);return this.above&&!this.hasEmptyBranch("above")?qn(`${n}[${this.aboveToLatex(t)}]`,a):/^[0-9]$/.test(a)?`${n}${a}`:qn(n,a)}get children(){if(this._children)return this._children;const t=[];if(this.above)for(const r of this.above)t.push(...r.children),t.push(r);if(this.body)for(const r of this.body)t.push(...r.children),t.push(r);return this._children=t,t}render(t){var r;const n=new Qr({parent:t,mathstyle:"cramp"},this.style),a=(r=Qe.createBox(n,this.body,{type:"inner"}))!=null?r:new St(null),o=n.scalingFactor,_=n.metrics.defaultRuleThickness/o,N=t.isDisplayStyle?Ks:_,z=new St(null,{classes:"ML__sqrt-line",style:this.style});z.height=_,z.softWidth=a.width;let W=o*(_+N/4);const X=Math.max(o*2*N,a.height+a.depth)+W+_,ae=new Qr({parent:t},this.style),he=this.bind(ae,new St(_u("inner","\\surd",X,!1,ae,{isSelected:this.isSelected}),{isSelected:this.isSelected,classes:"ML__sqrt-sign",style:this.style}));if(!he)return null;const _e=he.height+he.depth-_;_e>a.height+a.depth+W&&(W=(W+_e-(a.height+a.depth))/2),he.setTop(he.height-a.height-W);const Ue=this.bind(t,new Ai({firstBaseline:[{box:new St(a)},W-2*_,{box:z},_]})),yt=Qe.createBox(new Qr({parent:t,mathstyle:"scriptscriptstyle"}),this.above,{type:"ignore"});if(!yt){const wt=new St([he,Ue],{classes:this.containsCaret?"ML__contains-caret":"",type:"inner"});return wt.setStyle("display","inline-block"),wt.setStyle("height",wt.height+wt.depth,"em"),this.caret&&(wt.caret=this.caret),this.bind(t,wt)}const Be=new Ai({shift:-.6*(Math.max(he.height,Ue.height)-Math.max(he.depth,Ue.depth)),children:[{box:yt}]}),nt=new St([new St(Be,{classes:"ML__sqrt-index",type:"ignore"}),he,Ue],{type:"inner",classes:this.containsCaret?"ML__contains-caret":""});return nt.height=he.height,nt.depth=he.depth,this.caret&&(nt.caret=this.caret),this.bind(t,nt)}},pp=class extends St{constructor(e){super(null,{type:"skip"}),this._width=e}toMarkup(){return`<span style="display:inline-block;width:${Math.ceil(this.width*100)/100}em"></span>`}};function wu(e,t){if(!e.parent)return;const r=e.parent.children,n=r.indexOf(e);let a=n-1;for(;a>=0&&r[a].type==="ignore";)a-=1;if(a<0&&e.parent.parent&&e.parent.type==="lift"){wu(e.parent,t);return}n>0&&r[n-1].type==="skip"?r[n-1].width+=t:r.splice(n,0,new pp(t))}var mp={ord:{op:3,bin:4,rel:5,inner:3},op:{ord:3,op:3,rel:5,inner:3},bin:{ord:4,op:4,open:4,inner:4},rel:{ord:5,op:5,open:5,inner:5},close:{op:3,bin:4,rel:5,inner:3},punct:{ord:3,op:3,rel:3,open:3,punct:3,inner:3},inner:{ord:3,op:3,bin:4,rel:5,open:3,punct:3,inner:3}},vp={ord:{op:3},op:{ord:3,op:3},close:{op:3},inner:{op:3}};function gp(e){Ml(e,(t,r)=>{r.type==="bin"&&(!t||/^(middle|bin|op|rel|open|punct)$/.test(t.type))&&(r.type="ord"),(t==null?void 0:t.type)==="bin"&&/^(rel|close|punct)$/.test(r.type)&&(t.type="ord"),r.type!=="ignore"&&(t=r)})}function Sl(e,t){if(!e.children)return e;const r=e.children;gp(r);const n=t.getRegisterAsEm("thinmuskip"),a=t.getRegisterAsEm("medmuskip"),o=t.getRegisterAsEm("thickmuskip");return Ml(r,(_,N)=>{var z,W,j;if(!_)return;const X=_.type,ae=N.isTight?(z=vp[X])!=null?z:null:(W=mp[X])!=null?W:null,he=(j=ae==null?void 0:ae[N.type])!=null?j:null;he===3&&wu(N,n),he===4&&wu(N,a),he===5&&wu(N,o)}),e}function Ml(e,t,r=void 0){if(!e)return r;e=[...e];for(const n of e)n.type==="lift"?r=Ml(n.children,t,r):n.type==="ignore"?Ml(n.children,t):(t(r,n),Ml(n.children,t),r=n);return r}var yc=class t0 extends Qe{constructor(t){super({type:"tooltip",command:t.command,mode:t.mode,style:t.style,body:t.body,displayContainsHighlight:!0}),this.tooltip=new Qe({type:"root",mode:t.content,body:t.tooltip,style:{}}),this.skipBoundary=!0,this.captureSelection=!1}static fromJson(t){return new t0(i(F({},t),{tooltip:js(t.tooltip)}))}toJson(){var t;const r=(t=this.tooltip.body)==null?void 0:t.filter(n=>n.type!=="first").map(n=>n.toJson());return i(F({},super.toJson()),{tooltip:r})}render(t){const r=Qe.createBox(new Qr,this.body);if(!r)return null;const n=new Qr({parent:t,mathstyle:"displaystyle"},{fontSize:sc}),a=au(Sl(new St(this.tooltip.render(n),{classes:"ML__tooltip-content"}),n)),o=new St([a,r],{classes:"ML__tooltip-container"});return this.caret&&(o.caret=this.caret),this.bind(t,o)}},_o=class r0 extends Qe{constructor(t,r){super(i(F({},r),{type:"operator",isFunction:r==null?void 0:r.isFunction})),this.value=t,this.variant=r==null?void 0:r.variant,this.variantStyle=r==null?void 0:r.variantStyle,this.subsupPlacement=r==null?void 0:r.limits}static fromJson(t){return new r0(t.symbol,t)}toJson(){const t=super.toJson();return this.variant&&(t.variant=this.variant),this.variantStyle&&(t.variantStyle=this.variantStyle),this.subsupPlacement&&(t.limits=this.subsupPlacement),this.value&&(t.symbol=this.value),t}render(t){var r;const n=new St(this.value,{type:"op",mode:"math",maxFontSize:t.scalingFactor,style:{variant:this.variant,variantStyle:this.variantStyle},isSelected:this.isSelected,letterShapeStyle:t.letterShapeStyle});let a=n;if(this.superscript||this.subscript){const o=(r=this.subsupPlacement)!=null?r:"auto";a=o==="over-under"||o==="auto"&&t.isDisplayStyle?this.attachLimits(t,{base:n}):this.attachSupsub(t,{base:n})}return new St(this.bind(t,a),{type:"op",caret:this.caret,isSelected:this.isSelected,classes:"op-group"}).wrap(t)}_serialize(t){if(!(t.expandMacro||t.skipStyles||t.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const r=Je(this.command,this.mode);if(r!=null&&r.serialize)return r.serialize(this,t);const n=[this.command];return this.explicitSubsupPlacement&&(this.subsupPlacement==="over-under"&&n.push("\\limits"),this.subsupPlacement==="adjacent"&&n.push("\\nolimits"),this.subsupPlacement==="auto"&&n.push("\\displaylimits")),n.push(this.supsubToLatex(t)),Jr(n)}};function js(e){if(v(e))return e.map(n=>js(n));if(typeof e=="string")return Qe.fromJson(e);e=F({},e);for(const n of Wo)e[n]&&(e[n]=js(e[n]));e.args&&(e.args=_p(e.args)),e.array&&(e.array=js(e.array));const t=e.type;let r;t==="accent"&&(r=pu.fromJson(e)),t==="array"&&(r=gn.fromJson(e)),t==="box"&&(r=Hs.fromJson(e)),t==="chem"&&(r=ih.fromJson(e)),t==="composition"&&(r=qf.fromJson(e)),t==="delim"&&(r=ah.fromJson(e)),t==="enclose"&&(r=bl.fromJson(e)),t==="error"&&(r=vo.fromJson(e)),t==="extensible-symbol"&&(r=_c.fromJson(e)),t==="genfrac"&&(r=jo.fromJson(e)),t==="group"&&(r=Jf.fromJson(e)),t==="latex"&&(r=Ni.fromJson(e)),t==="latexgroup"&&(r=xl.fromJson(e)),t==="leftright"&&(r=si.fromJson(e)),t==="macro"&&(r=eh.fromJson(e)),t==="macro-argument"&&(r=cp.fromJson(e)),t==="operator"&&(r=_o.fromJson(e)),t==="overlap"&&(r=go.fromJson(e)),t==="overunder"&&(r=za.fromJson(e)),t==="placeholder"&&(r=Ls.fromJson(e)),t==="prompt"&&(r=th.fromJson(e)),t==="phantom"&&(r=El.fromJson(e)),t==="sizeddelim"&&(r=sh.fromJson(e)),t==="spacing"&&(r=wl.fromJson(e)),t==="subsup"&&(r=xu.fromJson(e)),t==="surd"&&(r=lh.fromJson(e)),t==="text"&&(r=vl.fromJson(e)),t==="tooltip"&&(r=yc.fromJson(e)),r||(console.assert(!t||["first","mbin","mrel","mclose","minner","mop","mopen","mord","mpunct","root","space"].includes(t),`MathLive 0.98.5: an unexpected atom type "${t}" was encountered. Add new atom constructors to \`fromJson()\` in "atom.ts"`),r=Qe.fromJson(e));for(const n of Wo)e[n]&&r.setChildren(e[n],n);return e.verbatimLatex!==void 0&&(r.verbatimLatex=e.verbatimLatex),e.subsupPlacement&&(r.subsupPlacement=e.subsupPlacement),e.explicitSubsupPlacement&&(r.explicitSubsupPlacement=!0),e.isFunction&&(r.isFunction=!0),e.isExtensibleSymbol&&(r.isExtensibleSymbol=!0),e.skipBoundary&&(r.skipBoundary=!0),e.captureSelection&&(r.captureSelection=!0),r}function _p(e){if(e&&Array.isArray(e))return e.map(t=>t==="<null>"?null:typeof t=="object"&&"group"in t?{group:t.group.map(r=>js(r))}:typeof t=="object"&&"atoms"in t?t.atoms.map(r=>js(r)):t)}var uh={main:["Main-Regular","ML__cmr"],"main-italic":["Main-Italic","ML__cmr ML__it"],"main-bold":["Main-Bold","ML__cmr ML__bold"],"main-bolditalic":["Main-BoldItalic","ML__cmr ML__bold ML__it"],normal:["Main-Regular","ML__cmr"],"normal-bold":["Main-Bold","ML__mathbf"],"normal-italic":["Math-Italic","ML__mathit"],"normal-bolditalic":["Math-BoldItalic","ML__mathbfit"],ams:["AMS-Regular","ML__ams"],"ams-bold":["AMS-Regular","ML__ams"],"ams-italic":["AMS-Regular","ML__ams"],"ams-bolditalic":["AMS-Regular","ML__ams"],"sans-serif":["SansSerif-Regular","ML__sans"],"sans-serif-bold":["SansSerif-Regular","ML__sans ML__bold"],"sans-serif-italic":["SansSerif-Regular","ML__sans"],"sans-serif-bolditalic":["SansSerif-Regular","ML__sans"],calligraphic:["Caligraphic-Regular","ML__cal"],"calligraphic-bold":["Caligraphic-Regular","ML__cal ML__bold"],"calligraphic-italic":["Caligraphic-Regular","ML__cal ML__it"],"calligraphic-bolditalic":["Caligraphic-Regular","ML__cal ML__bold ML__it"],script:["Script-Regular","ML__script"],"script-bold":["Script-Regular","ML__script ML__bold"],"script-italic":["Script-Regular","ML__script ML__it"],"script-bolditalic":["Script-Regular","ML__script ML__bold ML__it"],fraktur:["Fraktur-Regular","ML__frak"],"fraktur-bold":["Fraktur-Regular","ML__frak"],"fraktur-italic":["Fraktur-Regular","ML__frak"],"fraktur-bolditalic":["Fraktur-Regular","ML__frak"],monospace:["Typewriter-Regular","ML__tt"],"monospace-bold":["Typewriter-Regular","ML__tt ML__bold"],"monospace-italic":["Typewriter-Regular","ML__tt ML__it"],"monospace-bolditalic":["Typewriter-Regular","ML__tt ML__bold ML__it"],"double-struck":["AMS-Regular","ML__bb"],"double-struck-bold":["AMS-Regular","ML__bb"],"double-struck-italic":["AMS-Regular","ML__bb"],"double-struck-bolditalic":["AMS-Regular","ML__bb"]},bc={"double-struck":/^[A-Z ]$/,script:/^[A-Z ]$/,calligraphic:/^[\dA-Z ]$/,fraktur:/^[\dA-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^]$/,monospace:/^[\dA-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A8\u03A9]$/,"sans-serif":/^[\dA-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A8\u03A9]$/},ch=/^[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5]$/,yp=/^[\u0393|\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A6\u03A8\u03A9]$/,bp=[/^[a-z]$/,/^[A-Z]$/,ch,yp],xp={iso:["it","it","it","it"],tex:["it","it","it","up"],french:["it","up","up","up"],upright:["up","up","up","up"]},Ep=class extends Aa{constructor(){super("math")}createAtom(e,t,r){var n,a,o,_;if(t===null)return new Qe({type:"mord",mode:"math",command:e,value:e,style:r});const N=window.MathfieldElement.isFunction((n=t.command)!=null?n:e);if(t.definitionType==="symbol"){const W=new Qe({type:(a=t.type)!=null?a:"mord",mode:"math",command:(o=t.command)!=null?o:e,value:String.fromCodePoint(t.codepoint),style:r});return N&&(W.isFunction=!0),e.startsWith("\\")&&(W.verbatimLatex=e),W}const z=new Qe({type:"mord",mode:"math",command:(_=t.command)!=null?_:e,value:e,style:r});return N&&(z.isFunction=!0),e.startsWith("\\")&&(z.verbatimLatex=e),z}serialize(e,t){const r=wp(e,i(F({},t),{defaultMode:"math"}));return r.length===0||t.defaultMode!=="text"?r:["$ ",...r," $"]}getFont(e,t){console.assert(t.variant!==void 0);let{variant:r}=t,{variantStyle:n}=t;r==="normal"&&!n&&/[\u00A3\u0131\u0237]/.test(e.value)&&(r="main",n="italic"),r==="normal"&&!n&&e.value.length===1&&bp.forEach((N,z)=>{var W;N.test(e.value)&&xp[(W=t.letterShapeStyle)!=null?W:"tex"][z]==="it"&&(n="italic")}),n==="up"&&(n=void 0);const a=n?r+"-"+n:r;console.assert(uh[a]!==void 0);const[o,_]=uh[a];return bc[r]&&!bc[r].test(e.value)?(e.value=H(e.value,r,n),null):(ch.test(e.value)&&(e.classes+=" lcGreek"),_&&(e.classes+=" "+_),o)}};function wp(e,t){const{parent:r}=e[0],n=fh(r);return Us(e,"variant").map(a=>{const o=fh(a[0]);let _="";o&&o!==n&&(_={calligraphic:"\\mathcal",fraktur:"\\mathfrak","double-struck":"\\mathbb",script:"\\mathscr",monospace:"\\mathtt","sans-serif":"\\mathsf",normal:"\\mathrm","normal-italic":"\\mathnormal","normal-bold":"\\mathbf","normal-bolditalic":"\\mathbfit",ams:"","ams-italic":"\\mathit","ams-bold":"\\mathbf","ams-bolditalic":"\\mathbfit",main:"","main-italic":"\\mathit","main-bold":"\\mathbf","main-bolditalic":"\\mathbfit"}[o],console.assert(_!==void 0));const N=Jr(a.map(z=>z._serialize(t)));return _?qn(_,N):N})}function fh(e){if(!e)return"";const{style:t}=e;if(t.variant===void 0)return"";let r=t.variant;return!["calligraphic","fraktur","double-struck","script","monospace","sans-serif"].includes(t.variant)&&t.variantStyle&&t.variantStyle!=="up"&&(r+="-"+t.variantStyle),r}new Ep;function Sp(e,t){return e.map(r=>r._serialize(t))}function Mp(e,t){return Us(e,"fontShape").map(r=>{const n=Sp(r,t),{fontShape:a}=r[0].style;let o="";return a==="it"&&(o="\\textit"),a==="sl"&&(o="\\textsl"),a==="sc"&&(o="\\textsc"),a==="n"&&(o="\\textup"),!o&&a?`{${qn("\\fontshape",a)}${Jr(n)}}`:o?qn(o,Jr(n)):Jr(n)})}function Tp(e,t){return Us(e,"fontSeries").map(r=>{const n=Mp(r,t),{fontSeries:a}=r[0].style;let o="";return a==="b"&&(o="\\textbf"),a==="l"&&(o="\\textlf"),a==="m"&&(o="\\textmd"),a&&!o?`{${qn("\\fontseries",a)}${Jr(n)}}`:o?qn(o,Jr(n)):Jr(n)})}function Dp(e,t){return Us(e,"fontSize").map(r=>{var n,a;const o=Tp(r,t),_=(a=["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][(n=r[0].style.fontSize)!=null?n:""])!=null?a:"";return _?`${_} ${Jr(o)}`:Jr(o)})}function Ap(e,t,r){return Us(e,"fontFamily").map(n=>{var a,o;const _=Dp(n,t),N=(o={roman:"textrm",monospace:"texttt","sans-serif":"textsf"}[(a=n[0].style.fontFamily)!=null?a:""])!=null?o:"";return N?`\\${N}{${Jr(_)}}`:n[0].style.fontFamily?`{\\fontfamily{${n[0].style.fontFamily}} ${Jr(_)}}`:r?`\\text{${Jr(_)}}`:Jr(_)})}var hh={roman:"","sans-serif":"ML__sans",monospace:"ML__tt"},kp=class extends Aa{constructor(){super("text")}createAtom(e,t,r){return t&&t.definitionType==="symbol"?new vl(e,String.fromCodePoint(t.codepoint),r!=null?r:{}):null}serialize(e,t){return Ap(e,i(F({},t),{defaultMode:"text"}),t.defaultMode!=="text")}getFont(e,t){var r,n,a,o,_;const{fontFamily:N}=t;if(hh[N]?e.classes+=" "+hh[N]:N&&e.setStyle("font-family",N),t.fontShape&&(e.classes+=" ",e.classes+=(r={it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape])!=null?r:""),t.fontSeries){const z=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);z&&(e.classes+=" ",e.classes+=(a={ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[(n=z[1])!=null?n:""])!=null?a:"",e.classes+=" ",e.classes+=(_={uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[(o=z[2])!=null?o:""])!=null?_:"")}return"Main-Regular"}};new kp;var Cp=class extends Aa{constructor(){super("latex")}createAtom(e){return new Ni(e)}serialize(e,t){return e.filter(r=>r instanceof Ni&&!r.isSuggestion).map(r=>r.value)}getFont(){return null}};new Cp;var Lp={id:"dvorak",locale:"en",displayName:"Dvorak",virtualLayout:"dvorak",platform:"",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["x","X","\u2248","\u02DB"],KeyC:["j","J","\u2206","\xD4"],KeyD:["e","E","\xB4","\xB4"],KeyE:[".",">","\u2265","\u02D8"],KeyF:["u","U","\xA8","\xA8"],KeyG:["i","I","\u02C6","\u02C6"],KeyH:["d","D","\u2202","\xCE"],KeyI:["c","C","\xE7","\xC7"],KeyJ:["h","H","\u02D9","\xD3"],KeyK:["t","T","\u2020","\u02C7"],KeyL:["n","N","\u02DC","\u02DC"],KeyM:["m","M","\xB5","\xC2"],KeyN:["b","B","\u222B","\u0131"],KeyO:["r","R","\xAE","\u2030"],KeyP:["l","L","\xAC","\xD2"],KeyQ:["'",'"',"\xE6","\xC6"],KeyR:["p","P","\u03C0","\u220F"],KeyS:["o","O","\xF8","\xD8"],KeyT:["y","Y","\xA5","\xC1"],KeyU:["g","G","\xA9","\u02DD"],KeyV:["k","K","\u02DA","\uF8FF"],KeyW:[",","<","\u2264","\xAF"],KeyX:["q","Q","\u0153","\u0152"],KeyY:["f","F","\u0192","\xCF"],KeyZ:[";",":","\u2026","\xDA"],Digit1:["1","!","\xA1","\u2044"],Digit2:["2","@","\u2122","\u20AC"],Digit3:["3","#","\xA3","\u2039"],Digit4:["4","$","\xA2","\u203A"],Digit5:["5","%","\u221E","\uFB01"],Digit6:["6","^","\xA7","\uFB02"],Digit7:["7","&","\xB6","\u2021"],Digit8:["8","*","\u2022","\xB0"],Digit9:["9","(","\xAA","\xB7"],Digit0:["0",")","\xBA","\u201A"],Space:[" "," "," "," "],Minus:["[","{","\u201C","\u201D"],Equal:["]","}","\u2018","\u2019"],BracketLeft:["/","?","\xF7","\xBF"],BracketRight:["=","+","\u2260","\xB1"],Backslash:["\\","|","\xAB","\xBB"],Semicolon:["s","S","\xDF","\xCD"],Quote:["-","_","\u2013","\u2014"],Backquote:["`","~","`","`"],Comma:["w","W","\u2211","\u201E"],Period:["v","V","\u221A","\u25CA"],Slash:["z","Z","\u03A9","\xB8"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[".",".",".","."],IntlBackslash:["\xA7","\xB1","\xA7","\xB1"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}},xc={id:"apple.en-intl",displayName:"English (international)",virtualLayout:"qwerty",platform:"apple",locale:"en",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\u222B","\u0131"],KeyC:["c","C","\xE7","\xC7"],KeyD:["d","D","\u2202","\xCE"],KeyE:["e","E","\xB4","\xB4"],KeyF:["f","F","\u0192","\xCF"],KeyG:["g","G","\xA9","\u02DD"],KeyH:["h","H","\u02D9","\xD3"],KeyI:["i","I","\u02C6","\u02C6"],KeyJ:["j","J","\u2206","\xD4"],KeyK:["k","K","\u02DA","\uF8FF"],KeyL:["l","L","\xAC","\xD2"],KeyM:["m","M","\xB5","\xC2"],KeyN:["n","N","\u02DC","\u02DC"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\u0153","\u0152"],KeyR:["r","R","\xAE","\u2030"],KeyS:["s","S","\xDF","\xCD"],KeyT:["t","T","\u2020","\u02C7"],KeyU:["u","U","\xA8","\xA8"],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\u2211","\u201E"],KeyX:["x","X","\u2248","\u02DB"],KeyY:["y","Y","\xA5","\xC1"],KeyZ:["z","Z","\u03A9","\xB8"],Digit1:["1","!","\xA1","\u2044"],Digit2:["2","@","\u2122","\u20AC"],Digit3:["3","#","\xA3","\u2039"],Digit4:["4","$","\xA2","\u203A"],Digit5:["5","%","\u221E","\uFB01"],Digit6:["6","^","\xA7","\uFB02"],Digit7:["7","&","\xB6","\u2021"],Digit8:["8","*","\u2022","\xB0"],Digit9:["9","(","\xAA","\xB7"],Digit0:["0",")","\xBA","\u201A"],Space:[" "," "," "," "],Minus:["-","_","\u2013","\u2014"],Equal:["=","+","\u2260","\xB1"],BracketLeft:["[","{","\u201C","\u201D"],BracketRight:["]","}","\u2018","\u2019"],Backslash:["\\","|","\xAB","\xBB"],Semicolon:[";",":","\u2026","\xDA"],Quote:["'",'"',"\xE6","\xC6"],Backquote:["`","\u02DC","`","`"],Comma:[",","<","\u2264","\xAF"],Period:[".",">","\u2265","\u02D8"],Slash:["/","?","\xF7","\xBF"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[".",".",".","."],IntlBackslash:["\xA7","\xB1","\xA7","\xB1"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}},dh={id:"windows.en-intl",displayName:"English (international)",platform:"windows",virtualLayout:"qwerty",locale:"en",score:0,mapping:{KeyA:["a","A","\xE1","\xC1"],KeyB:["b","B","",""],KeyC:["c","C","\xA9","\xA2"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\xE9","\xC9"],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","\xED","\xCD"],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","\xF8","\xD8"],KeyM:["m","M","\xB5",""],KeyN:["n","N","\xF1","\xD1"],KeyO:["o","O","\xF3","\xD3"],KeyP:["p","P","\xF6","\xD6"],KeyQ:["q","Q","\xE4","\xC4"],KeyR:["r","R","\xAE",""],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\xFE","\xDE"],KeyU:["u","U","\xFA","\xDA"],KeyV:["v","V","",""],KeyW:["w","W","\xE5","\xC5"],KeyX:["x","X","",""],KeyY:["y","Y","\xFC","\xDC"],KeyZ:["z","Z","\xE6","\xC6"],Digit1:["1","!","\xA1","\xB9"],Digit2:["2","@","\xB2",""],Digit3:["3","#","\xB3",""],Digit4:["4","$","\xA4","\xA3"],Digit5:["5","%","\u20AC",""],Digit6:["6","^","\xBC",""],Digit7:["7","&","\xBD",""],Digit8:["8","*","\xBE",""],Digit9:["9","(","\u2018",""],Digit0:["0",")","\u2019",""],Space:[" "," ","",""],Minus:["-","_","\xA5",""],Equal:["=","+","\xD7","\xF7"],BracketLeft:["[","{","\xAB",""],BracketRight:["]","}","\xBB",""],Backslash:["\\","|","\xAC","\xA6"],Semicolon:[";",":","\xB6","\xB0"],Quote:["'",'"',"\xB4","\xA8"],Backquote:["`","~","",""],Comma:[",","<","\xE7","\xC7"],Period:[".",">","",""],Slash:["/","?","\xBF",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["\\","|","",""]}},ph={id:"linux.en",displayName:"English",platform:"linux",virtualLayout:"qwerty",locale:"en",score:0,mapping:{KeyA:["a","A","a","A"],KeyB:["b","B","b","B"],KeyC:["c","C","c","C"],KeyD:["d","D","d","D"],KeyE:["e","E","e","E"],KeyF:["f","F","f","F"],KeyG:["g","G","g","G"],KeyH:["h","H","h","H"],KeyI:["i","I","i","I"],KeyJ:["j","J","j","J"],KeyK:["k","K","k","K"],KeyL:["l","L","l","L"],KeyM:["m","M","m","M"],KeyN:["n","N","n","N"],KeyO:["o","O","o","O"],KeyP:["p","P","p","P"],KeyQ:["q","Q","q","Q"],KeyR:["r","R","r","R"],KeyS:["s","S","s","S"],KeyT:["t","T","t","T"],KeyU:["u","U","u","U"],KeyV:["v","V","v","V"],KeyW:["w","W","w","W"],KeyX:["x","X","x","X"],KeyY:["y","Y","y","Y"],KeyZ:["z","Z","z","Z"],Digit1:["1","!","1","!"],Digit2:["2","@","2","@"],Digit3:["3","#","3","#"],Digit4:["4","$","4","$"],Digit5:["5","%","5","%"],Digit6:["6","^","6","^"],Digit7:["7","&","7","&"],Digit8:["8","*","8","*"],Digit9:["9","(","9","("],Digit0:["0",")","0",")"],Space:[" "," "," "," "],Minus:["-","_","-","_"],Equal:["=","+","=","+"],BracketLeft:["[","{","[","{"],BracketRight:["]","}","]","}"],Backslash:["\\","|","\\","|"],Semicolon:[";",":",";",":"],Quote:["'",'"',"'",'"'],Backquote:["`","~","`","~"],Comma:[",","<",",","<"],Period:[".",">",".",">"],Slash:["/","?","/","?"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}},Rp={id:"apple.french",locale:"fr",displayName:"French",platform:"apple",virtualLayout:"azerty",score:0,mapping:{KeyA:["q","Q","\u2021","\u03A9"],KeyB:["b","B","\xDF","\u222B"],KeyC:["c","C","\xA9","\xA2"],KeyD:["d","D","\u2202","\u2206"],KeyE:["e","E","\xEA","\xCA"],KeyF:["f","F","\u0192","\xB7"],KeyG:["g","G","\uFB01","\uFB02"],KeyH:["h","H","\xCC","\xCE"],KeyI:["i","I","\xEE","\xEF"],KeyJ:["j","J","\xCF","\xCD"],KeyK:["k","K","\xC8","\xCB"],KeyL:["l","L","\xAC","|"],KeyM:[",","?","\u221E","\xBF"],KeyN:["n","N","~","\u0131"],KeyO:["o","O","\u0153","\u0152"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["a","A","\xE6","\xC6"],KeyR:["r","R","\xAE","\u201A"],KeyS:["s","S","\xD2","\u2211"],KeyT:["t","T","\u2020","\u2122"],KeyU:["u","U","\xBA","\xAA"],KeyV:["v","V","\u25CA","\u221A"],KeyW:["z","Z","\xC2","\xC5"],KeyX:["x","X","\u2248","\u2044"],KeyY:["y","Y","\xDA","\u0178"],KeyZ:["w","W","\u2039","\u203A"],Digit1:["&","1","\uF8FF","\xB4"],Digit2:["\xE9","2","\xEB","\u201E"],Digit3:['"',"3","\u201C","\u201D"],Digit4:["'","4","\u2018","\u2019"],Digit5:["(","5","{","["],Digit6:["\xA7","6","\xB6","\xE5"],Digit7:["\xE8","7","\xAB","\xBB"],Digit8:["!","8","\xA1","\xDB"],Digit9:["\xE7","9","\xC7","\xC1"],Digit0:["\xE0","0","\xF8","\xD8"],Space:[" "," "," "," "],Minus:[")","\xB0","}","]"],Equal:["-","_","\u2014","\u2013"],BracketLeft:["^","\xA8","\xF4","\xD4"],BracketRight:["$","*","\u20AC","\xA5"],Backslash:["`","\xA3","@","#"],Semicolon:["m","M","\xB5","\xD3"],Quote:["\xF9","%","\xD9","\u2030"],Backquote:["<",">","\u2264","\u2265"],Comma:[";",".","\u2026","\u2022"],Period:[":","/","\xF7","\\"],Slash:["=","+","\u2260","\xB1"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",".",",","."],IntlBackslash:["@","#","\u2022","\u0178"],NumpadEqual:["=","=","=","="]}},Pp={id:"windows.french",locale:"fr",displayName:"French",virtualLayout:"azerty",platform:"windows",score:0,mapping:{KeyA:["q","Q","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:[",","?","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["a","A","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["z","Z","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["w","W","",""],Digit1:["&","1","",""],Digit2:["\xE9","2","~",""],Digit3:['"',"3","#",""],Digit4:["'","4","{",""],Digit5:["(","5","[",""],Digit6:["-","6","|",""],Digit7:["\xE8","7","`",""],Digit8:["_","8","\\",""],Digit9:["\xE7","9","^",""],Digit0:["\xE0","0","@",""],Space:[" "," ","",""],Minus:[")","\xB0","]",""],Equal:["=","+","}",""],BracketLeft:["^","\xA8","",""],BracketRight:["$","\xA3","\xA4",""],Backslash:["*","\xB5","",""],Semicolon:["m","M","",""],Quote:["\xF9","%","",""],Backquote:["\xB2","","",""],Comma:[";",".","",""],Period:[":","/","",""],Slash:["!","\xA7","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}},Ip={id:"linux.french",locale:"fr",displayName:"French",virtualLayout:"azerty",platform:"linux",score:0,mapping:{KeyA:["q","Q","@","\u03A9"],KeyB:["b","B","\u201D","\u2019"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\xA2"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0309","\u031B"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:[",","?","\u0301","\u030B"],KeyN:["n","N","n","N"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["a","A","\xE6","\xC6"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201C","\u2018"],KeyW:["z","Z","\xAB","<"],KeyX:["x","X","\xBB",">"],KeyY:["y","Y","\u2190","\xA5"],KeyZ:["w","W","\u0142","\u0141"],Digit1:["&","1","\xB9","\xA1"],Digit2:["\xE9","2","~","\u215B"],Digit3:['"',"3","#","\xA3"],Digit4:["'","4","{","$"],Digit5:["(","5","[","\u215C"],Digit6:["-","6","|","\u215D"],Digit7:["\xE8","7","`","\u215E"],Digit8:["_","8","\\","\u2122"],Digit9:["\xE7","9","^","\xB1"],Digit0:["\xE0","0","@","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:[")","\xB0","]","\xBF"],Equal:["=","+","}","\u0328"],BracketLeft:["\u0302","\u0308","\u0308","\u030A"],BracketRight:["$","\xA3","\xA4","\u0304"],Backslash:["*","\xB5","\u0300","\u0306"],Semicolon:["m","M","\xB5","\xBA"],Quote:["\xF9","%","\u0302","\u030C"],Backquote:["\xB2","~","\xAC","\xAC"],Comma:[";",".","\u2500","\xD7"],Period:[":","/","\xB7","\xF7"],Slash:["!","\xA7","\u0323","\u0307"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"]}},Op={id:"apple.german",locale:"de",displayName:"German",virtualLayout:"qwertz",platform:"apple",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\u222B","\u2039"],KeyC:["c","C","\xE7","\xC7"],KeyD:["d","D","\u2202","\u2122"],KeyE:["e","E","\u20AC","\u2030"],KeyF:["f","F","\u0192","\xCF"],KeyG:["g","G","\xA9","\xCC"],KeyH:["h","H","\xAA","\xD3"],KeyI:["i","I","\u2044","\xDB"],KeyJ:["j","J","\xBA","\u0131"],KeyK:["k","K","\u2206","\u02C6"],KeyL:["l","L","@","\uFB02"],KeyM:["m","M","\xB5","\u02D8"],KeyN:["n","N","~","\u203A"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\xAB","\xBB"],KeyR:["r","R","\xAE","\xB8"],KeyS:["s","S","\u201A","\xCD"],KeyT:["t","T","\u2020","\u02DD"],KeyU:["u","U","\xA8","\xC1"],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\u2211","\u201E"],KeyX:["x","X","\u2248","\xD9"],KeyY:["z","Z","\u03A9","\u02C7"],KeyZ:["y","Y","\xA5","\u2021"],Digit1:["1","!","\xA1","\xAC"],Digit2:["2",'"',"\u201C","\u201D"],Digit3:["3","\xA7","\xB6","#"],Digit4:["4","$","\xA2","\xA3"],Digit5:["5","%","[","\uFB01"],Digit6:["6","&","]","^"],Digit7:["7","/","|","\\"],Digit8:["8","(","{","\u02DC"],Digit9:["9",")","}","\xB7"],Digit0:["0","=","\u2260","\xAF"],Space:[" "," "," "," "],Minus:["\xDF","?","\xBF","\u02D9"],Equal:["\xB4","`","'","\u02DA"],BracketLeft:["\xFC","\xDC","\u2022","\xB0"],BracketRight:["+","*","\xB1","\uF8FF"],Backslash:["#","'","\u2018","\u2019"],Semicolon:["\xF6","\xD6","\u0153","\u0152"],Quote:["\xE4","\xC4","\xE6","\xC6"],Backquote:["<",">","\u2264","\u2265"],Comma:[",",";","\u221E","\u02DB"],Period:[".",":","\u2026","\xF7"],Slash:["-","_","\u2013","\u2014"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",",",".","."],IntlBackslash:["^","\xB0","\u201E","\u201C"],NumpadEqual:["=","=","=","="]}},Fp={id:"windows.german",locale:"de",displayName:"German",platform:"windows",virtualLayout:"qwertz",score:0,mapping:{KeyA:["a","A","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:["m","M","\xB5",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["q","Q","@",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["w","W","",""],KeyX:["x","X","",""],KeyY:["z","Z","",""],KeyZ:["y","Y","",""],Digit1:["1","!","",""],Digit2:["2",'"',"\xB2",""],Digit3:["3","\xA7","\xB3",""],Digit4:["4","$","",""],Digit5:["5","%","",""],Digit6:["6","&","",""],Digit7:["7","/","{",""],Digit8:["8","(","[",""],Digit9:["9",")","]",""],Digit0:["0","=","}",""],Space:[" "," ","",""],Minus:["\xDF","?","\\","\u1E9E"],Equal:["\xB4","`","",""],BracketLeft:["\xFC","\xDC","",""],BracketRight:["+","*","~",""],Backslash:["#","'","",""],Semicolon:["\xF6","\xD6","",""],Quote:["\xE4","\xC4","",""],Backquote:["^","\xB0","",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","|",""]}},Bp={id:"linux.german",locale:"de",displayName:"German",platform:"windows",virtualLayout:"qwertz",score:0,mapping:{KeyA:["a","A","\xE6","\xC6"],KeyB:["b","B","\u201C","\u2018"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\u20AC"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0323","\u0307"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:["m","M","\xB5","\xBA"],KeyN:["n","N","\u201D","\u2019"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["q","Q","@","\u03A9"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\u017F","\u1E9E"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201E","\u201A"],KeyW:["w","W","\u0142","\u0141"],KeyX:["x","X","\xAB","\u2039"],KeyY:["z","Z","\u2190","\xA5"],KeyZ:["y","Y","\xBB","\u203A"],Digit1:["1","!","\xB9","\xA1"],Digit2:["2",'"',"\xB2","\u215B"],Digit3:["3","\xA7","\xB3","\xA3"],Digit4:["4","$","\xBC","\xA4"],Digit5:["5","%","\xBD","\u215C"],Digit6:["6","&","\xAC","\u215D"],Digit7:["7","/","{","\u215E"],Digit8:["8","(","[","\u2122"],Digit9:["9",")","]","\xB1"],Digit0:["0","=","}","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:["\xDF","?","\\","\xBF"],Equal:["\u0301","\u0300","\u0327","\u0328"],BracketLeft:["\xFC","\xDC","\u0308","\u030A"],BracketRight:["+","*","~","\xAF"],Backslash:["#","'","\u2019","\u0306"],Semicolon:["\xF6","\xD6","\u030B","\u0323"],Quote:["\xE4","\xC4","\u0302","\u030C"],Backquote:["\u0302","\xB0","\u2032","\u2033"],Comma:[",",";","\xB7","\xD7"],Period:[".",":","\u2026","\xF7"],Slash:["-","_","\u2013","\u2014"],PrintScreen:["","","",""],PageUp:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["","1","","1"],Numpad2:["","2","","2"],Numpad3:["","3","","3"],Numpad4:["","4","","4"],Numpad5:["","5","","5"],Numpad6:["","6","","6"],Numpad7:["","7","","7"],Numpad8:["","8","","8"],Numpad9:["","9","","9"],Numpad0:["","0","","0"],NumpadDecimal:["",",","",","],IntlBackslash:["<",">","|","\u0331"],AltRight:["\r","\r","\r","\r"],MetaRight:[".",".",".","."]}},Np={id:"apple.spanish",locale:"es",displayName:"Spanish ISO",platform:"apple",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\xDF",""],KeyC:["c","C","\xA9"," "],KeyD:["d","D","\u2202","\u2206"],KeyE:["e","E","\u20AC","\u20AC"],KeyF:["f","F","\u0192","\uFB01"],KeyG:["g","G","\uF8FF","\uFB02"],KeyH:["h","H","\u2122"," "],KeyI:["i","I"," "," "],KeyJ:["j","J","\xB6","\xAF"],KeyK:["k","K","\xA7","\u02C7"],KeyL:["l","L"," ","\u02D8"],KeyM:["m","M","\xB5","\u02DA"],KeyN:["n","N"," ","\u02D9"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\u0153","\u0152"],KeyR:["r","R","\xAE"," "],KeyS:["s","S","\u222B"," "],KeyT:["t","T","\u2020","\u2021"],KeyU:["u","U"," "," "],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\xE6","\xC6"],KeyX:["x","X","\u2211","\u203A"],KeyY:["y","Y","\xA5"," "],KeyZ:["z","Z","\u03A9","\u2039"],Digit1:["1","!","|","\u0131"],Digit2:["2",'"',"@","\u02DD"],Digit3:["3","\xB7","#","\u2022"],Digit4:["4","$","\xA2","\xA3"],Digit5:["5","%","\u221E","\u2030"],Digit6:["6","&","\xAC"," "],Digit7:["7","/","\xF7","\u2044"],Digit8:["8","(","\u201C","\u2018"],Digit9:["9",")","\u201D","\u2019"],Digit0:["0","=","\u2260","\u2248"],Space:[" "," "," "," "],Minus:["'","?","\xB4","\xB8"],Equal:["\xA1","\xBF","\u201A","\u02DB"],BracketLeft:["`","^","[","\u02C6"],BracketRight:["+","*","]","\xB1"],Backslash:["\xE7","\xC7","}","\xBB"],Semicolon:["\xF1","\xD1","~","\u02DC"],Quote:["\xB4","\xA8","{","\xAB"],Backquote:["<",">","\u2264","\u2265"],Comma:[",",";","\u201E",""],Period:[".",":","\u2026","\u2026"],Slash:["-","_","\u2013","\u2014"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[",",",",",",","],IntlBackslash:["\xBA","\xAA","\\","\xB0"]}},Kp={id:"windows.spanish",locale:"es",displayName:"Spanish",platform:"windows",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:["m","M","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["q","Q","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["w","W","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["z","Z","",""],Digit1:["1","!","|",""],Digit2:["2",'"',"@",""],Digit3:["3","\xB7","#",""],Digit4:["4","$","~",""],Digit5:["5","%","\u20AC",""],Digit6:["6","&","\xAC",""],Digit7:["7","/","",""],Digit8:["8","(","",""],Digit9:["9",")","",""],Digit0:["0","=","",""],Space:[" "," ","",""],Minus:["'","?","",""],Equal:["\xA1","\xBF","",""],BracketLeft:["`","^","[",""],BracketRight:["+","*","]",""],Backslash:["\xE7","\xC7","}",""],Semicolon:["\xF1","\xD1","",""],Quote:["\xB4","\xA8","{",""],Backquote:["\xBA","\xAA","\\",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}},Up={id:"linux.spanish",locale:"es",displayName:"Spanish",platform:"linux",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","\xE6","\xC6"],KeyB:["b","B","\u201D","\u2019"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\xA2"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0309","\u031B"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:["m","M","\xB5","\xBA"],KeyN:["n","N","n","N"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["q","Q","@","\u03A9"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201C","\u2018"],KeyW:["w","W","\u0142","\u0141"],KeyX:["x","X","\xBB",">"],KeyY:["y","Y","\u2190","\xA5"],KeyZ:["z","Z","\xAB","<"],Digit1:["1","!","|","\xA1"],Digit2:["2",'"',"@","\u215B"],Digit3:["3","\xB7","#","\xA3"],Digit4:["4","$","~","$"],Digit5:["5","%","\xBD","\u215C"],Digit6:["6","&","\xAC","\u215D"],Digit7:["7","/","{","\u215E"],Digit8:["8","(","[","\u2122"],Digit9:["9",")","]","\xB1"],Digit0:["0","=","}","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:["'","?","\\","\xBF"],Equal:["\xA1","\xBF","\u0303","~"],BracketLeft:["\u0300","\u0302","[","\u030A"],BracketRight:["+","*","]","\u0304"],Backslash:["\xE7","\xC7","}","\u0306"],Semicolon:["\xF1","\xD1","~","\u030B"],Quote:["\u0301","\u0308","{","{"],Backquote:["\xBA","\xAA","\\","\\"],Comma:[",",";","\u2500","\xD7"],Period:[".",":","\xB7","\xF7"],Slash:["-","_","\u0323","\u0307"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadEnter:["\r","\r","\r","\r"],Numpad1:["","1","","1"],Numpad2:["","2","","2"],Numpad3:["","3","","3"],Numpad4:["","4","","4"],Numpad5:["","5","","5"],Numpad6:["","6","","6"],Numpad7:["","7","","7"],Numpad8:["","8","","8"],Numpad9:["","9","","9"],Numpad0:["","0","","0"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}};function mh(e){const t=e.split("+"),r={shift:!1,alt:!1,cmd:!1,win:!1,meta:!1,ctrl:!1,key:t.pop()};return t.includes("shift")&&(r.shift=!0),t.includes("alt")&&(r.alt=!0),t.includes("ctrl")&&(r.ctrl=!0),t.includes("cmd")&&(r.cmd=!0),t.includes("win")&&(r.win=!0),t.includes("meta")&&(r.meta=!0),r}function Go(e){let t="";return e.shift&&(t+="shift+"),e.alt&&(t+="alt+"),e.ctrl&&(t+="ctrl+"),e.cmd&&(t+="cmd+"),e.win&&(t+="win+"),e.meta&&(t+="meta+"),t+e.key}var zp={enter:"[Enter]",escape:"[Escape]",backspace:"[Backspace]",tab:"[Tab]",space:"[Space]",pausebreak:"[Pause]",insert:"[Insert]",home:"[Home]",pageup:"[PageUp]",delete:"[Delete]",end:"[End]",pagedown:"[PageDown]",right:"[ArrowRight]",left:"[ArrowLeft]",down:"[ArrowDown]",up:"[ArrowUp]",numpad0:"[Numpad0]",numpad1:"[Numpad1]",numpad2:"[Numpad2]",numpad3:"[Numpad3]",numpad4:"[Numpad4]",numpad5:"[Numpad5]",numpad6:"[Numpad6]",numpad7:"[Numpad7]",numpad8:"[Numpad8]",numpad9:"[Numpad9]",numpad_divide:"[NumpadDivide]",numpad_multiply:"[NumpadMultiply]",numpad_subtract:"[NumpadSubtract]",numpad_add:"[NumpadAdd]",numpad_decimal:"[NumpadDecimal]",numpad_separator:"[NumpadComma]",capslock:"[Capslock]",f1:"[F1]",f2:"[F2]",f3:"[F3]",f4:"[F4]",f5:"[F5]",f6:"[F6]",f7:"[F7]",f8:"[F8]",f9:"[F9]",f10:"[F10]",f11:"[F11]",f12:"[F12]",f13:"[F13]",f14:"[F14]",f15:"[F15]",f16:"[F16]",f17:"[F17]",f18:"[F18]",f19:"[F19]"},Tl=[],Dl;function Ec(){switch(y()){case"macos":case"ios":return"apple";case"windows":return"windows"}return"linux"}function Ca(e){(!e.platform||e.platform===Ec())&&Tl.push(e)}function $p(e,t){var r;const n={shift:!1,alt:!1,cmd:!1,win:!1,meta:!1,ctrl:!1,key:""};if(!e)return n;for(const[a,o]of Object.entries(t.mapping)){if(o[0]===e)return n.key=`[${a}]`,n;if(o[1]===e)return n.shift=!0,n.key=`[${a}]`,n;if(o[2]===e)return n.alt=!0,n.key=`[${a}]`,n;if(o[3]===e)return n.shift=!0,n.alt=!0,n.key=`[${a}]`,n}return n.key=(r=zp[e])!=null?r:"",n}function Wp(e){if(e.code)return e;const t=Object.entries(Al().mapping);let r=!1,n=!1,a="";for(let o=0;o<4;o++){for(const[_,N]of t)if(N[o]===e.key){a=_,o===3?(r=!0,n=!0):o===2?r=!0:o===1&&(n=!0);break}if(a)break}return new KeyboardEvent(e.type,i(F({},e),{altKey:r,shiftKey:n,code:a}))}function Vp(e){var t,r;if(!e||e.key==="Unidentified"||e.key==="Dead")return;const n=e.shiftKey&&e.altKey?3:e.altKey?2:e.shiftKey?1:0;for(const a of Tl)((t=a.mapping[e.code])==null?void 0:t[n])===e.key?a.score+=1:(r=a.mapping[e.code])!=null&&r[n]&&(a.score=0);Tl.sort((a,o)=>o.score-a.score)}function Hp(e){Dl=Tl.find(t=>e.startsWith(t.locale))}function Al(){return Dl!=null?Dl:Tl[0]}function jp(){switch(Ec()){case"apple":return xc;case"windows":return dh;case"linux":return ph}return xc}switch(Ec()){case"apple":Ca(xc),Ca(Rp),Ca(Np),Ca(Op);break;case"windows":Ca(dh),Ca(Pp),Ca(Kp),Ca(Fp);break;case"linux":Ca(ph),Ca(Ip),Ca(Up),Ca(Bp);break}Ca(Lp);function wc(e){var t;const r=/macos|ios/.test(y()),n=e.split("+");let a="";for(const o of n)a&&(a+=r?"\u2009":'<span class="ML__shortcut-join">+</span>'),o.startsWith("[Key")?a+=o.slice(4,5):o.startsWith("Key")?a+=o.slice(3,4):o.startsWith("[Digit")?a+=o.slice(6,7):o.startsWith("Digit")?a+=o.slice(5,6):a+=(t={cmd:"\u2318",meta:r?"\u2318":"Ctrl",shift:r?"\u21E7":"Shift",alt:r?"\u2325":"Alt",ctrl:r?"\u2303":"Ctrl","\n":r?"\u23CE":"Return","[return]":r?"\u23CE":"Return","[enter]":r?"\u2324":"Enter","[tab]":r?"\u21E5":"Tab","[escape]":"Esc","[backspace]":r?"\u232B":"Backspace","[delete]":r?"\u2326":"Del","[pageup]":r?"\u21DE":"Page Up","[pagedown]":r?"\u21DF":"Page Down","[home]":r?"\u2912":"Home","[end]":r?"\u2913":"End","[space]":"Space","[equal]":"=","[minus]":"-","[comma]":",","[slash]":"/","[backslash]":"\\","[bracketleft]":"[","[bracketright]":"]",semicolon:";",period:".",comma:",",minus:"-",equal:"=",quote:"'",backslash:"\\",intlbackslash:"\\",backquote:"`",slash:"/",numpadmultiply:"* &#128290;",numpaddivide:"/ &#128290;",numpadsubtract:"- &#128290;",numpadadd:"+ &#128290;",numpaddecimal:". &#128290;",numpadcomma:", &#128290;",help:"help",left:"\u21E0",up:"\u21E1",right:"\u21E2",down:"\u21E3","[arrowleft]":"\u21E0","[arrowup]":"\u21E1","[arrowright]":"\u21E2","[arrowdown]":"\u21E3"}[o.toLowerCase()])!=null?t:o.toUpperCase();return a}function Su(e){if(e instanceof MouseEvent||e instanceof PointerEvent)return{x:e.clientX,y:e.clientY};if(e instanceof TouchEvent){const t=[...e.touches].reduce((n,a)=>({x:n.x+a.clientX,y:n.y+a.clientY}),{x:0,y:0}),r=e.touches.length;return{x:t.x/r,y:t.y/r}}}function yo(e){const t={alt:!1,control:!1,shift:!1,meta:!1};return(e instanceof MouseEvent||e instanceof PointerEvent||e instanceof TouchEvent||e instanceof KeyboardEvent)&&(e.altKey&&(t.alt=!0),e.ctrlKey&&(t.control=!0),e.metaKey&&(t.meta=!0),e.shiftKey&&(t.shift=!0)),t}function Gp(e,t){return!e&&t||e&&!t?!1:!e||!t?!0:e.alt===t.alt&&e.control===t.control&&e.shift===t.shift&&e.meta===t.meta}var Zp=new Set(["Backquote","Digit0","Digit1","Digit2","Digit3","Digit4","Digit5","Digit6","Digit7","Digit8","Digit9","Minus","Equal","IntlYen","KeyQ","KeyW","KeyE","KeyR","KeyT","KeyY","KeyU","KeyI","KeyO","KeyP","BracketLeft","BracketRight","Backslash","KeyA","KeyS","KeyD","KeyF","KeyG","KeyH","KeyJ","KeyK","KeyL","Semicolon","Quote","IntlBackslash","KeyZ","KeyX","KeyC","KeyV","KeyB","KeyN","KeyM","Comma","Period","Slash","IntlRo","Space","Numpad0","Numpad1","Numpad2","Numpad3","Numpad4","Numpad5","Numpad6","Numpad7","Numpad8","Numpad9","NumpadAdd","NumpadComma","NumpadDecimal","NumpadDivide","NumpadEqual","NumpadHash","NumpadMultiply","NumpadParenLeft","NumpadParenRight","NumpadStar","NumpadSubstract"]);function Mu(e){return e.ctrlKey||e.metaKey||["Dead","Process"].includes(e.key)?!1:e.code===""?!0:Zp.has(e.code)}function Tu(){var e;let t=document.activeElement;for(;(e=t==null?void 0:t.shadowRoot)!=null&&e.activeElement;)t=t.shadowRoot.activeElement;return t}var ds=class Os{static get scrim(){return Os._scrim||(Os._scrim=new Os),Os._scrim}static open(t){Os.scrim.open(t)}static close(){Os.scrim.close()}static get state(){return Os.scrim.state}static get element(){return Os.scrim.element}constructor(t){var r,n;this.lightDismiss=(r=t==null?void 0:t.lightDismiss)!=null?r:!0,this.translucent=(n=t==null?void 0:t.translucent)!=null?n:!1,this.state="closed"}get element(){if(this._element)return this._element;const t=document.createElement("div");return t.setAttribute("role","presentation"),t.style.position="fixed",t.style.contain="content",t.style.top="0",t.style.left="0",t.style.right="0",t.style.bottom="0",t.style.zIndex="var(--scrim-zindex, 10099)",t.style.outline="none",this.translucent?(t.style.background="rgba(255, 255, 255, .2)",t.style.backdropFilter="contrast(40%)"):t.style.background="transparent",this._element=t,t}open(t){var r;if(this.state!=="closed")return;this.state="opening",this.onDismiss=t==null?void 0:t.onDismiss,this.savedActiveElement=Tu();const{element:n}=this;((r=t==null?void 0:t.root)!=null?r:document.body).appendChild(n),n.addEventListener("click",this),document.addEventListener("touchmove",this,!1),document.addEventListener("scroll",this,!1);const a=window.innerWidth-document.documentElement.clientWidth;this.savedMarginRight=document.body.style.marginRight,this.savedOverflow=document.body.style.overflow,document.body.style.overflow="hidden";const o=Number.parseFloat(getComputedStyle(document.body).marginRight);document.body.style.marginRight=`${o+a}px`,t!=null&&t.child&&n.append(t.child),this.state="open"}close(){var t,r,n,a;if(this.state!=="open"){console.assert(this.element.parentElement!==null);return}this.state="closing",typeof this.onDismiss=="function"&&this.onDismiss(),this.onDismiss=void 0;const{element:o}=this;o.removeEventListener("click",this),document.removeEventListener("touchmove",this,!1),document.removeEventListener("scroll",this,!1),o.remove(),document.body.style.overflow=(t=this.savedOverflow)!=null?t:"",document.body.style.marginRight=(r=this.savedMarginRight)!=null?r:"",Tu()!==this.savedActiveElement&&((a=(n=this.savedActiveElement)==null?void 0:n.focus)==null||a.call(n)),o.innerHTML="",this.state="closed"}handleEvent(t){this.lightDismiss&&(t.target===this._element&&t.type==="click"?(this.close(),t.preventDefault(),t.stopPropagation()):t.target===document&&(t.type==="touchmove"||t.type==="scroll")&&(this.close(),t.preventDefault(),t.stopPropagation()))}};function Yp(e,t,r){let n=null,a=null,o=!1,_=!1,N=!1;const z=new AbortController,W=z.signal;return e.addEventListener("keydown",j=>{if(o||j.key==="Process"||j.code==="CapsLock"||/(Control|Meta|Alt|Shift)(Left|Right)/.test(j.code)){n=null;return}n=j,a=null,r.onKeystroke(j)?e.textContent="":n=null},{capture:!0,signal:W}),e.addEventListener("keypress",j=>{o||(n&&a&&r.onKeystroke(n),a=j)},{capture:!0,signal:W}),e.addEventListener("compositionstart",j=>{e.textContent="",o=!0,r.onCompositionStart(j.data)},{capture:!0,signal:W}),e.addEventListener("compositionupdate",j=>{o&&r.onCompositionUpdate(j.data)},{capture:!0,signal:W}),e.addEventListener("compositionend",j=>{e.textContent="",o&&(o=!1,r.onCompositionEnd(j.data))},{capture:!0,signal:W}),e.addEventListener("beforeinput",j=>j.stopImmediatePropagation(),{signal:W}),e.addEventListener("input",j=>{var X;if(!o&&(e.textContent="",j.inputType!=="insertCompositionText")){if(j.inputType==="insertFromPaste"){j.preventDefault(),j.stopPropagation();return}r.onInput((X=j.data)!=null?X:""),j.preventDefault(),j.stopPropagation()}},{signal:W}),e.addEventListener("paste",j=>{e.focus({preventScroll:!0}),e.textContent="",r.onPaste(j)||j.preventDefault(),j.stopImmediatePropagation()},{signal:W}),e.addEventListener("cut",j=>r.onCut(j),{capture:!0,signal:W}),e.addEventListener("copy",j=>r.onCopy(j),{capture:!0,signal:W}),e.addEventListener("blur",j=>{var X,ae;if(((ae=(X=j.relatedTarget)==null?void 0:X._mathfield)==null?void 0:ae.element)===t){e.focus({preventScroll:!0}),j.preventDefault(),j.stopPropagation();return}const he=ds.state;if(he==="open"||he==="opening"){j.preventDefault(),j.stopPropagation();return}if(j.relatedTarget===j.target.getRootNode().host){j.preventDefault(),j.stopPropagation();return}N||_||(N=!0,n=null,a=null,r.onBlur(),N=!1)},{capture:!0,signal:W}),e.addEventListener("focus",j=>{N||_||(_=!0,r.onFocus(),_=!1)},{capture:!0,signal:W}),{dispose:()=>z.abort(),cancelComposition:()=>{o&&(e.blur(),requestAnimationFrame(()=>e.focus({preventScroll:!0})))},blur:()=>{typeof e.blur=="function"&&e.blur()},focus:()=>{!_&&typeof e.focus=="function"&&e.focus({preventScroll:!0})},hasFocus:()=>Tu()===e,setAriaLabel:j=>e.setAttribute("aria-label",j),setValue:j=>{var X;e.textContent=j,e.style.left="-1000px",(X=window.getSelection())==null||X.selectAllChildren(e)},moveTo:(j,X)=>{e.style.top=`${X}px`,e.style.left=`${j}px`}}}function Zo(e){var t;if(!e||!Mu(e))return"";let r;return e.key==="Unidentified"&&e.target&&(r=e.target.value),r=(t=r!=null?r:e.key)!=null?t:e.code,/^(Dead|Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(r)&&(r=""),r}function vh(e){e=Wp(e);const t=[];return e.ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),e.altKey&&t.push("alt"),e.shiftKey&&t.push("shift"),t.length===0?`[${e.code}]`:(t.push(`[${e.code}]`),t.join("+"))}function Xp(e){if(b()){const t=y(),r=e.startsWith("!"),n=e.endsWith(t);if(r&&!n||!r&&n)return!0}return e==="!other"?!1:e==="other"}function qp(e,t,r){if(e.length===0)return"";const n=Go(mh(vh(r))),a=Go({key:r.key,shift:r.shiftKey,alt:r.altKey,ctrl:r.ctrlKey,meta:r.metaKey||r.ctrlKey&&/macos|ios/.test(y()),cmd:!1,win:!1});for(let o=e.length-1;o>=0;o--)if((e[o].key===n||e[o].key===a)&&(!e[o].ifMode||e[o].ifMode===t))return e[o].command;return""}function gh(e){let t=e;return v(t)&&(t=t.length>0?t[0]+"("+t.slice(1).join("")+")":""),t}function Jp(e,t){let r=[];if(typeof t=="string"){const o=B0[t];v(o)?r=o.slice():o&&r.push(o)}const n=gh(t),a=new RegExp("^"+n.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");for(const o of e)a.test(gh(o.command))&&r.push(o.key);return r.map(wc)}function Qp(e,t){if(e.ifPlatform&&!/^!?(macos|windows|android|ios|chromeos|other)$/.test(e.ifPlatform))throw new Error(`Unexpected platform "${e.ifPlatform}" for keybinding ${e.key}`);if(e.ifLayout!==void 0&&(t.score===0||!e.ifLayout.includes(t.id)))return;const r=mh(e.key);let n=e.ifPlatform;if(r.cmd){if(n&&n!=="macos"&&n!=="ios")throw new Error('Unexpected "cmd" modifier with platform "'+n+`"
"cmd" modifier can only be used with macOS or iOS platform.`);n||(n=y()==="ios"?"ios":"macos"),r.win=!1,r.cmd=!1,r.meta=!0}if(r.win){if(n&&n!=="windows")throw new Error('Unexpected "win" modifier with platform "'+n+`"
"win" modifier can only be used with Windows platform.`);n="windows",r.win=!1,r.cmd=!1,r.meta=!0}if(n&&!Xp(n))return;if(/^\[.+\]$/.test(r.key))return i(F({},e),{key:Go(r)});const a=$p(r.key,t);if(!a)return i(F({},e),{key:Go(r)});if(a.shift&&r.shift||a.alt&&r.alt)throw new Error(`The keybinding ${e.key} (${Sc(e.command)}) is conflicting with the key combination ${Go(a)} using the ${t.displayName} keyboard layout`);return a.shift=a.shift||r.shift,a.alt=a.alt||r.alt,a.meta=r.meta,a.ctrl=r.ctrl,i(F({},e),{key:Go(a)})}function Sc(e){if(Array.isArray(e)){const t=[...e];return t.shift()+"("+t.map(r=>typeof r=="string"?`"${r}"`:r.toString()).join(", ")+")"}return e}function em(e,t){const r=[],n=[];for(const a of e)try{const o=Qp(a,t);if(!o)continue;const _=n.find(N=>N.key===o.key&&N.ifMode===o.ifMode);if(_)throw new Error(`Ambiguous key binding ${a.key} (${Sc(a.command)}) matches ${_.key} (${Sc(_.command)}) with the ${t.displayName} keyboard layout`);n.push(o)}catch(o){o instanceof Error&&r.push(o.message)}return[n,r]}var tm=class extends Wn{constructor(){super("latex")}createAtom(e){return new Ni(e)}onPaste(e,t){if(!t)return!1;const r=typeof t=="string"?t:t.getData("application/x-latex")||t.getData("text/plain");return r&&e.model.contentWillChange({inputType:"insertFromPaste",data:r})?(e.stopCoalescingUndo(),e.stopRecording(),this.insert(e.model,r)&&(e.startRecording(),e.snapshot("paste"),e.model.contentDidChange({inputType:"insertFromPaste"}),oi(e)),e.startRecording(),!0):!1}insert(e,t,r){if(!e.contentWillChange({data:t,inputType:"insertText"}))return!1;r||(r={}),r.insertionMode||(r.insertionMode="replaceSelection"),r.selectionMode||(r.selectionMode="placeholder");const{silenceNotifications:n}=e;r.silenceNotifications&&(e.silenceNotifications=!0);const a=e.silenceNotifications;e.silenceNotifications=!0,r.insertionMode==="replaceSelection"&&!e.selectionIsCollapsed?e.deleteAtoms(Xi(e.selection)):r.insertionMode==="replaceAll"?(e.root.setChildren([],"body"),e.position=0):r.insertionMode==="insertBefore"?e.collapseSelection("backward"):r.insertionMode==="insertAfter"&&e.collapseSelection("forward");const o=[];for(const z of t)Ie.test(z)&&o.push(new Ni(z));let _=e.at(e.position);if(_ instanceof xl&&(_=_.lastChild),!(_.parent instanceof xl)){const z=new xl("");_.parent.addChildAfter(z,_),_=z.firstChild}const N=_.parent.addChildrenAfter(o,_);return e.silenceNotifications=a,r.selectionMode==="before"||(r.selectionMode==="item"?e.setSelection(e.anchor,e.offsetOf(N)):N&&(e.position=e.offsetOf(N))),e.contentDidChange({data:t,inputType:"insertText"}),e.silenceNotifications=n,!0}};function rm(e){return e.atoms.find(t=>t.type==="latexgroup")}function kl(e){var t,r;const n=e.atoms.find(a=>a.type==="latexgroup");return n?(r=(t=n.body)==null?void 0:t.filter(a=>a.type==="latex"))!=null?r:[]:[]}function _h(e,t){var r;let n=0,a=!1;const o=Number.isFinite(t==null?void 0:t.before)?(r=t==null?void 0:t.before)!=null?r:0:e.lastOffset;for(;n<=o&&!a;){const z=e.at(n);a=z instanceof Ni&&z.isSuggestion,a||n++}if(!a)return[void 0,void 0];let _=n,N=!1;for(;_<=o&&!N;){const z=e.at(_);N=!(z instanceof Ni&&z.isSuggestion),N||_++}return[n-1,_-1]}new tm;function Du(e){const t=kl(e.model).filter(r=>r.isSuggestion);if(t.length!==0){e.model.position=e.model.offsetOf(t[0].leftSibling);for(const r of t)r.parent.removeChild(r)}}function Cl(e,t){var r;const{model:n}=e;Du(e);for(const j of kl(n))j.isError=!1;if(!n.selectionIsCollapsed||e.options.popoverPolicy==="off"){Xo(e);return}const a=[];let o=n.at(n.position);for(;o&&o instanceof Ni&&/^[a-zA-Z\*]$/.test(o.value);)o=o.leftSibling;if(o&&o instanceof Ni&&o.value==="\\")for(a.push(o),o=o.rightSibling;o&&o instanceof Ni&&/^[a-zA-Z\*]$/.test(o.value);)a.push(o),o=o.rightSibling;const _=a.map(j=>j.value).join(""),N=ze(e,_);if(N.length===0){if(/^\\[a-zA-Z\*]+$/.test(_))for(const j of a)j.isError=!0;Xo(e);return}const z=(r=t==null?void 0:t.atIndex)!=null?r:0;e.suggestionIndex=z<0?N.length-1:z%N.length;const W=N[e.suggestionIndex];if(W!==_){const j=a[a.length-1];j.parent.addChildrenAfter([...W.slice(_.length-W.length)].map(X=>new Ni(X,{isSuggestion:!0})),j),bo(e,{interactive:!0})}im(e,N)}function yh(e){const[t,r]=_h(e,{before:e.position});if(t===void 0||r===void 0)return!1;let n=!1;return e.getAtoms([t,r]).forEach(a=>{a.isSuggestion&&(a.isSuggestion=!1,n=!0)}),n}function Yo(e,t="accept",r){var n,a;Xo(e);const o=rm(e.model);if(!o)return!1;if(t==="accept-suggestion"||t==="accept-all"){const W=kl(e.model).filter(j=>j.isSuggestion);if(W.length!==0){for(const j of W)j.isSuggestion=!1;e.model.position=e.model.offsetOf(W[W.length-1])}if(t==="accept-suggestion")return W.length!==0}const N=kl(e.model).filter(W=>!W.isSuggestion).map(W=>W.value).join(""),z=o.leftSibling;return o.parent.removeChild(o),e.model.position=e.model.offsetOf(z),e.switchMode((n=r==null?void 0:r.mode)!=null?n:"math"),t==="reject"||(Wn.insert(e.model,N,{selectionMode:(a=r==null?void 0:r.selectItem)!=null&&a?"item":"placeholder",format:"latex",mode:"math"}),e.snapshot(),e.model.announce("replacement"),e.switchMode("math")),!0}function Au(e){var t;let r=document.getElementById(e);return r?r.dataset.refcount=Number(Number.parseInt((t=r.dataset.refcount)!=null?t:"0")+1).toString():(r=document.createElement("div"),r.setAttribute("aria-hidden","true"),r.dataset.refcount="1",r.id=e,document.body.append(r)),r}function Mc(e){var t;const r=document.getElementById(e);if(!r)return;const n=Number.parseInt((t=r.getAttribute("data-refcount"))!=null?t:"0");n<=1?r.remove():r.dataset.refcount=Number(n-1).toString()}function nm(e,t){const r=new Qr({from:e.context}),n=new Qe({mode:"math",type:"root",body:na(t,{context:r})}),a=au(Sl(new St(n.render(r),{classes:"ML__base"}),r));return su(a,{classes:"ML__latex"}).toMarkup()}function im(e,t){var r;if(t.length===0){Xo(e);return}let n="";for(const[o,_]of t.entries()){const N=_,z=nm(e,_),W=Jp(e.keybindings,N).join("<br>");n+=`<li role="button" data-command="${N}" ${o===e.suggestionIndex?"class=ML__popover__current":""}><span class="ML__popover__latex">${N}</span><span class="ML__popover__command">${z}</span>`,W&&(n+=`<span class="ML__popover__keybinding">${W}</span>`),n+="</li>"}const a=am(e,`<ul>${n}</ul>`);Tc()&&((r=a.querySelector(".ML__popover__current"))==null||r.scrollIntoView({block:"nearest",inline:"nearest"})),setTimeout(()=>{var o;a&&!Tc()&&(a.classList.add("is-visible"),ku(e),(o=a.querySelector(".ML__popover__current"))==null||o.scrollIntoView({block:"nearest",inline:"nearest"}))},32)}function Tc(){const e=document.getElementById("mathlive-suggestion-popover");return e?e.classList.contains("is-visible"):!1}function ku(e,t){var r;if(!e.element||e.element.mathfield!==e||!Tc())return;if(((r=e.model.at(e.model.position))==null?void 0:r.type)!=="latex"){Xo(e);return}if(t!=null&&t.deferred){setTimeout(()=>ku(e),32);return}const n=gl(e.field);if(!n)return;const a=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,o=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,_=window.innerWidth-document.documentElement.clientWidth,N=window.innerHeight-document.documentElement.clientHeight,z=window.mathVirtualKeyboard.boundingRect.height,W=document.getElementById("mathlive-suggestion-popover");n.x+W.offsetWidth/2>o-_?W.style.left=`${o-W.offsetWidth-_}px`:n.x-W.offsetWidth/2<0?W.style.left="0":W.style.left=`${n.x-W.offsetWidth/2}px`;const j=n.y-n.height;a-N-z-n.y<j?(W.classList.add("ML__popover--reverse-direction"),W.classList.remove("top-tip"),W.classList.add("bottom-tip"),W.style.top=`${n.y-n.height-W.offsetHeight-15}px`):(W.classList.remove("ML__popover--reverse-direction"),W.classList.add("top-tip"),W.classList.remove("bottom-tip"),W.style.top=`${n.y+15}px`)}function Xo(e){e.suggestionIndex=0;const t=document.getElementById("mathlive-suggestion-popover");t&&(t.classList.remove("is-visible"),t.innerHTML="")}function am(e,t){let r=document.getElementById("mathlive-suggestion-popover");return r||(r=Au("mathlive-suggestion-popover"),Cs("suggestion-popover"),Cs("core"),r.addEventListener("pointerdown",n=>n.preventDefault()),r.addEventListener("click",n=>{let a=n.target;for(;a&&!a.dataset.command;)a=a.parentElement;a&&(Yo(e,"reject"),Wn.insert(e.model,a.dataset.command,{selectionMode:"placeholder",format:"latex",mode:"math"}),e.dirty=!0,e.focus())})),r.innerHTML=window.MathfieldElement.createHTML(t),r}function sm(){document.getElementById("mathlive-suggestion-popover")&&(Mc("mathlive-suggestion-popover"),Vs("suggestion-popover"),Vs("core"))}function om(){const e=String(new Error().stack).replace(/^Error.*\n/,"").split(`
`);if(e.length===0)return console.error(`Can't use relative paths to specify assets location because the sourcefile location could not be determined (unexpected stack trace format "${new Error().stack}").`),"";let t=e[1],r=t.match(/http.*\.ts[\?:]/);return r&&(t=e[2]),r=t.match(/(https?:.*):[0-9]+:[0-9]+/),r||(r=t.match(/at (.*(\.ts))[\?:]/),r||(r=t.match(/at (.*(\.mjs|\.js))[\?:]/))),r?r[1]:(console.error(e),console.error(`Can't use relative paths to specify assets location because the source file location could not be determined (unexpected location "${t}").`),"")}var Cu=null,bh,xh,Dc=((xh=(bh=globalThis==null?void 0:globalThis.document)==null?void 0:bh.currentScript)==null?void 0:xh.src)||om();function Eh(e){return qs(this,null,function*(){if(/^(?:[a-z+]+:)?\/\//i.test(e))return new URL(e).href;if(Cu===null)try{const t=yield fetch(Dc,{method:"HEAD"});t.status===200&&(Cu=t.url)}catch(t){console.error(`Invalid URL "${e}" (relative to "${Dc}")`)}return new URL(e,Cu!=null?Cu:Dc).href})}function lm(e,t,r={}){return new FontFace(e,`url(${t}.woff2) format('woff2')`,r)}var La="not-loaded";function um(){return qs(this,null,function*(){return La="not-loaded",Lu()})}function Lu(){return qs(this,null,function*(){var e;if(La!=="not-loaded")return;if(La="loading",(e=getComputedStyle(document.documentElement).getPropertyValue("--ML__static-fonts"))!=null?e:!1){La="ready";return}if(document.body.classList.remove("ML__fonts-did-not-load"),"fonts"in document){const r=["KaTeX_Main","KaTeX_Math","KaTeX_AMS","KaTeX_Caligraphic","KaTeX_Fraktur","KaTeX_SansSerif","KaTeX_Script","KaTeX_Typewriter","KaTeX_Size1","KaTeX_Size2","KaTeX_Size3","KaTeX_Size4"],n=Array.from(document.fonts).map(_=>_.family);if(r.every(_=>n.includes(_))){La="ready";return}if(!window.MathfieldElement.fontsDirectory){La="not-loaded";return}const a=yield Eh(window.MathfieldElement.fontsDirectory);if(!a){document.body.classList.add("ML__fonts-did-not-load"),La="error";return}const o=[["KaTeX_Main-Regular"],["KaTeX_Main-BoldItalic",{style:"italic",weight:"bold"}],["KaTeX_Main-Bold",{weight:"bold"}],["KaTeX_Main-Italic",{style:"italic"}],["KaTeX_Math-Italic",{style:"italic"}],["KaTeX_Math-BoldItalic",{style:"italic",weight:"bold"}],["KaTeX_AMS-Regular"],["KaTeX_Caligraphic-Regular"],["KaTeX_Caligraphic-Bold",{weight:"bold"}],["KaTeX_Fraktur-Regular"],["KaTeX_Fraktur-Bold",{weight:"bold"}],["KaTeX_SansSerif-Regular"],["KaTeX_SansSerif-Bold",{weight:"bold"}],["KaTeX_SansSerif-Italic",{style:"italic"}],["KaTeX_Script-Regular"],["KaTeX_Typewriter-Regular"],["KaTeX_Size1-Regular"],["KaTeX_Size2-Regular"],["KaTeX_Size3-Regular"],["KaTeX_Size4-Regular"]].map(_=>lm(_[0].replace(/-[a-zA-Z]+$/,""),`${a}/${_[0]}`,_[1]));try{(yield Promise.all(o.map(N=>{try{return N.load()}catch(z){}}))).forEach(N=>document.fonts.add(N)),La="ready";return}catch(_){console.error(`MathLive 0.98.5: The math fonts could not be loaded from "${a}"`,{cause:_}),document.body.classList.add("ML__fonts-did-not-load")}La="error"}})}function cm(e){let t=0;for(let r=0;r<e.length;r++)t=t*31+e.charCodeAt(r),t=t|0;return Math.abs(t)}function oi(e,t){e&&(e.dirty||(e.dirty=!0,requestAnimationFrame(()=>{ho(e)&&e.dirty&&(e.atomBoundsCache=new Map,bo(e,t),e.atomBoundsCache=void 0)})))}function fm(e,t){var r;t=t!=null?t:{};const n=new Qr({from:i(F({},e.context),{atomIdsSettings:{seed:t.forHighlighting?cm(Qe.serialize([e.model.root],{expandMacro:!1,defaultMode:e.options.defaultMode})):"random",groupNumbers:(r=t.forHighlighting)!=null?r:!1},letterShapeStyle:e.options.letterShapeStyle}),mathstyle:e.options.defaultMode==="inline-math"?"textstyle":"displaystyle"}),a=e.model.root.render(n);return su(Sl(a,n),{classes:e.hasEditablePrompts?"ML__latex ML__prompting":"ML__latex",attributes:{translate:"no","aria-hidden":"true"}})}function wh(e,t){const{model:r}=e;r.root.caret=void 0,r.root.isSelected=!1,r.root.containsCaret=!0;for(const a of r.atoms)a.caret=void 0,a.isSelected=!1,a.containsCaret=!1;if(r.selectionIsCollapsed){const a=r.at(r.position);a.caret=e.model.mode;let o=a.parent;for(;o;)o.containsCaret=!0,o=o.parent}else{const a=r.getAtoms(r.selection,{includeChildren:!0});for(const o of a)o.isSelected=!0}return fm(e,t).toMarkup()}function bo(e,t){if(!ho(e))return;t!=null||(t={});const r=e.element.querySelector("[part=virtual-keyboard-toggle]");r&&(r.style.display=e.hasEditableContent?"":"none");const n=e.field;if(!n)return;const a=e.isSelectionEditable&&e.hasFocus(),o=n.classList.contains("ML__focused");o&&!a?n.classList.remove("ML__focused"):!o&&a&&n.classList.add("ML__focused");let _=wh(e,t);const N=e.element.querySelector("[part=menu-toggle]");if(N&&(e.model.atoms.length<=1||e.disabled||e.readOnly&&!e.hasEditableContent||e.userSelect==="none"?N.style.display="none":N.style.display=""),e.model.atoms.length<=1){const z=e.options.contentPlaceholder;z&&(_+=`<span part=placeholder class="ML__content-placeholder">${Pi(z)}</span>`)}n.innerHTML=window.MathfieldElement.createHTML(_),Ru(e,t.interactive),e.dirty=!1}function Ru(e,t){const r=e.field;if(!r)return;for(const N of r.querySelectorAll(".ML__selection, .ML__contains-highlight"))N.remove();!(t!=null&&t)&&La!=="error"&&La!=="ready"&&setTimeout(()=>{La==="ready"?Ru(e):setTimeout(()=>Ru(e),128)},32);const n=e.model,a=r.offsetWidth,o=r.getBoundingClientRect().width;let _=Math.floor(o)/a;if(_=isNaN(_)?1:_,n.selectionIsCollapsed){ku(e,{deferred:!0});let N=n.at(n.position);for(;N&&N.type!=="prompt"&&!(N.containsCaret&&N.displayContainsHighlight);)N=N.parent;if(N!=null&&N.containsCaret&&N.displayContainsHighlight){const z=Kf(e,_l(e,N),_);if(z){z.left/=_,z.right/=_,z.top/=_,z.bottom/=_;const W=document.createElement("div");W.classList.add("ML__contains-highlight"),W.style.position="absolute",W.style.left=`${z.left+1}px`,W.style.top=`${Math.ceil(z.top)}px`,W.style.width=`${Math.ceil(z.right-z.left)}px`,W.style.height=`${Math.ceil(z.bottom-z.top)}px`,r.insertBefore(W,r.childNodes[0])}}return}for(const N of hm(zf(e,{excludeAtomsWithBackground:!0}))){N.left/=_,N.right/=_,N.top/=_,N.bottom/=_;const z=document.createElement("div");z.classList.add("ML__selection"),z.style.position="absolute",z.style.left=`${N.left}px`,z.style.top=`${N.top}px`,z.style.width=`${Math.ceil(N.right-N.left)}px`,z.style.height=`${Math.ceil(N.bottom-N.top-1)}px`,r.insertBefore(z,r.childNodes[0])}}function hm(e){let t=[];for(const r of e){let n=!1;for(const a of t)if(r.left===a.left&&r.right===a.right&&r.top===a.top&&r.bottom===a.bottom){n=!0;break}n||t.push(r)}e=t,t=[];for(const r of e){let n=0;for(const a of e)if(r.left>=a.left&&r.right<=a.right&&r.top>=a.top&&r.bottom<=a.bottom&&(n+=1,n>1))break;n===1&&t.push(r)}return t}var Sh=3,ps;function _a(e,t){t=F({target:"mathfield",canUndo:!1,audioFeedback:void 0,changeContent:!1,changeSelection:!1},t!=null?t:{}),ps||(ps={});for(const r of Object.keys(e))console.assert(!ps[r],"Selector already defined: ",r),ps[r]=i(F({},t),{fn:e[r]})}function Ac(e){let t;if(Array.isArray(e)){if(e[0]==="performWithFeedback")return Ac(e[1]);t=e[0]}else t=e;return t=t.replace(/-\w/g,r=>r[1].toUpperCase()),ps[t]}function qo(e){var t;return(t=Ac(e))==null?void 0:t.target}function dm(e,t){var r;if(!t)return!1;let n,a=[],o=!1,_=!1;v(t)?(n=t[0],a=t.slice(1)):n=t,n=n.replace(/-\w/g,W=>W[1].toUpperCase());const N=ps[n],z=N==null?void 0:N.target;if(z==="model"){if(!e.isSelectionEditable&&(N!=null&&N.changeContent))return e.model.announce("plonk"),!1;/^(delete|add)/.test(n)&&(n!=="deleteBackward"&&e.flushInlineShortcutBuffer(),e.snapshot(n)),/^complete/.test(n)||Du(e),ps[n].fn(e.model,...a),Cl(e),_=!0,o=!0}else if(z==="virtual-keyboard")_=(r=window.mathVirtualKeyboard.executeCommand(t))!=null?r:!1,o=!0;else if(ps[n]){if(!e.isSelectionEditable&&(N!=null&&N.changeContent))return e.model.announce("plonk"),!1;/^(undo|redo)/.test(n)&&e.flushInlineShortcutBuffer(),_=ps[n].fn(e,...a),o=!0}else throw new Error(`Unknown command "${n}"`);return z!=="virtual-keyboard"&&(!e.model.selectionIsCollapsed||N!=null&&N.changeSelection&&t!=="deleteBackward")&&(e.flushInlineShortcutBuffer(),N!=null&&N.changeContent||e.stopCoalescingUndo(),e.defaultStyle={}),_&&oi(e),o}function pm(e,t){var r;if(!e)return!1;e.focus(),yd.keypressVibration&&p()&&navigator.vibrate(Sh);const n=Ac(t);window.MathfieldElement.playSound((r=n==null?void 0:n.audioFeedback)!=null?r:"keypress");const a=e.executeCommand(t);return e.scrollIntoView(),a}_a({performWithFeedback:(e,t)=>pm(e,t)});function mm(e){return Cl(e,{atIndex:e.suggestionIndex+1}),!1}function vm(e){return Cl(e,{atIndex:e.suggestionIndex-1}),!1}_a({complete:Yo},{target:"mathfield",audioFeedback:"return",canUndo:!0,changeContent:!0,changeSelection:!0}),_a({nextSuggestion:mm,previousSuggestion:vm},{target:"mathfield",audioFeedback:"keypress",changeSelection:!0});var Pu="mathlive#virtual-keyboard-message";function kc(e){var t;return e.type!=="message"?!1:((t=e.data)==null?void 0:t.type)===Pu}var gm=class n0{constructor(){this.targetOrigin=window.origin,this.originValidator="none",this._boundingRect=new DOMRect(0,0,0,0),this._isShifted=!1,window.addEventListener("message",this),this.sendMessage("proxy-created"),this.listeners={}}static get singleton(){return this._singleton||(this._singleton=new n0),this._singleton}set alphabeticLayout(t){this.sendMessage("update-setting",{alphabeticLayout:t})}set layouts(t){this.sendMessage("update-setting",{layouts:t})}get normalizedLayouts(){return[]}set editToolbar(t){this.sendMessage("update-setting",{editToolbar:t})}set actionKeycap(t){this.sendMessage("update-setting",{actionKeycap:t})}set shiftKeycap(t){this.sendMessage("update-setting",{shiftKeycap:t})}set backspaceKeycap(t){this.sendMessage("update-setting",{backspaceKeycap:t})}set tabKeycap(t){this.sendMessage("update-setting",{tabKeycap:t})}set container(t){throw new Error("Container inside an iframe cannot be changed")}show(t){this.sendMessage("show",t)}hide(t){this.sendMessage("hide",t)}get isShifted(){return this._isShifted}get visible(){return this._boundingRect.height>0}set visible(t){t?this.show():this.hide()}get boundingRect(){return this._boundingRect}executeCommand(t){return this.sendMessage("execute-command",{command:t}),!0}updateToolbar(t){this.sendMessage("update-toolbar",t)}update(t){this.sendMessage("update-setting",t)}connect(){this.sendMessage("connect")}disconnect(){this.sendMessage("disconnect")}addEventListener(t,r,n){this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].has(r)||this.listeners[t].add(r)}dispatchEvent(t){return!this.listeners[t.type]||this.listeners[t.type].size===0?!0:(this.listeners[t.type].forEach(r=>{typeof r=="function"?r(t):r==null||r.handleEvent(t)}),!t.defaultPrevented)}removeEventListener(t,r,n){this.listeners[t]&&this.listeners[t].delete(r)}handleEvent(t){if(kc(t)){if(!gc(t.origin,this.originValidator))throw new DOMException(`Message from unknown origin (${t.origin}) cannot be handled`,"SecurityError");this.handleMessage(t.data)}}handleMessage(t){const{action:r}=t;if(r==="execute-command"){const{command:n}=t;qo(n)==="virtual-keyboard"&&this.executeCommand(n);return}if(r==="synchronize-proxy"){this._boundingRect=t.boundingRect,this._isShifted=t.isShifted;return}if(r==="geometry-changed"){this._boundingRect=t.boundingRect,this.dispatchEvent(new Event("geometrychange"));return}}sendMessage(t,r={}){if(!window.top)throw new DOMException("A frame does not have access to the top window and can\u2018t communicate with the keyboard. Review virtualKeyboardTargetOrigin and originValidator on mathfields embedded in an iframe","SecurityError");window.top.postMessage(F({type:Pu,action:t},r),this.targetOrigin)}},Mh={numeric:{label:"123",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.numeric",rows:[[{latex:"x",shift:"y",variants:["y","z","t","r","x^2","x^n","x^{#?}","x_n","x_i","x_{#?}",{latex:"f(#?)",class:"small"},{latex:"g(#?)",class:"small"}]},{latex:"n",shift:"a",variants:["i","j","p","k","a","u"]},"[separator-5]","[7]","[8]","[9]","[/]","[separator-5]",{latex:"\\exponentialE",shift:"\\ln",variants:["\\exp","\\times 10^{#?}","\\ln","\\log_{10}","\\log"]},{latex:"\\imaginaryI",variants:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"]},{latex:"\\pi",shift:"\\sin",variants:["\\prod",{latex:"\\theta",aside:"theta"},{latex:"\\rho",aside:"rho"},{latex:"\\tau",aside:"tau"},"\\sin","\\cos","\\tan"]}],[{label:"<",latex:"<",class:"hide-shift",shift:{latex:"\\le",label:"\u2264"}},{label:">",latex:">",class:"hide-shift",shift:{latex:"\\ge",label:"\u2265"}},"[separator-5]","[4]","[5]","[6]","[*]","[separator-5]",{class:"hide-shift",latex:"#@^2}",shift:"#@^{\\prime}}"},{latex:"#@^{#0}}",class:"hide-shift",shift:"#@_{#?}"},{class:"hide-shift",latex:"\\sqrt{#0}",shift:{latex:"\\sqrt[#0]{#?}}"}}],["[(]","[)]","[separator-5]","[1]","[2]","[3]","[-]","[separator-5]",{latex:"\\int^{\\infty}_{0}\\!#?\\,\\mathrm{d}x",class:"small hide-shift",shift:"\\int",variants:[{latex:"\\int_{#?}^{#?}",class:"small"},{latex:"\\int",class:"small"},{latex:"\\iint",class:"small"},{latex:"\\iiint",class:"small"},{latex:"\\oint",class:"small"},"\\mathrm{d}x",{latex:"\\dfrac{\\mathrm{d}}{\\mathrm{d} x}",class:"small"},{latex:"\\frac{\\partial}{\\partial x}",class:"small"},"\\partial"]},{class:"hide-shift",latex:"\\forall",shift:"\\exists"},{label:"[backspace]",width:1}],[{label:"[shift]",width:2},"[separator-5]","[0]","[.]","[=]","[+]","[separator-5]","[left]","[right]",{label:"[action]",width:1}]]},greek:{label:"&alpha;&beta;&gamma;",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.greek",rows:[[{label:"<i>&#x03c6;</i>",class:"MLK__tex hide-shift",insert:"\\varphi",aside:"phi var.",shift:"\\Phi"},{label:"<i>&#x03c2;</i>",class:"MLK__tex hide-shift",insert:"\\varsigma",aside:"sigma var.",shift:"\\Sigma"},{label:"<i>&#x03f5;</i>",class:"MLK__tex hide-shift",insert:"\\epsilon",aside:"espilon",shift:'\\char"0190'},{label:"<i>&rho;</i>",class:"MLK__tex hide-shift",insert:"\\rho",aside:"rho",shift:'\\char"3A1'},{label:"<i>&tau;</i>",class:"MLK__tex hide-shift",insert:"\\tau",aside:"tau",shift:'\\char"3A4'},{label:"<i>&upsilon;</i>",class:"MLK__tex hide-shift",insert:"\\upsilon",aside:"upsilon",shift:"\\Upsilon"},{label:"<i>&theta;</i>",class:"MLK__tex hide-shift",insert:"\\theta",aside:"theta",shift:"\\Theta"},{label:"<i>&iota;</i>",class:"MLK__tex hide-shift",insert:"\\iota",aside:"iota",shift:'\\char"399'},{label:"<i>&omicron;</i>",class:"MLK__tex hide-shift",insert:"\\omicron",aside:"omicron",shift:'\\char"39F'},{label:"<i>&pi;</i>",class:"MLK__tex hide-shift",insert:"\\pi",aside:"pi",shift:"\\Pi"}],["[separator-5]",{label:"<i>&alpha;</i>",class:"MLK__tex hide-shift",insert:"\\alpha",aside:"alpha",shift:'\\char"391'},{label:"<i>&sigma;</i>",class:"MLK__tex hide-shift",insert:"\\sigma",aside:"sigma",shift:"\\Sigma"},{label:"<i>&delta;</i>",class:"MLK__tex hide-shift",insert:"\\delta",aside:"delta",shift:"\\Delta"},{latex:"\\phi",class:"MLK__tex hide-shift",insert:"\\phi",aside:"phi",shift:"\\Phi"},{label:"<i>&gamma;</i>",class:"MLK__tex hide-shift",insert:"\\gamma",aside:"gamma",shift:"\\Gamma"},{label:"<i>&eta;</i>",class:"MLK__tex hide-shift",insert:"\\eta",aside:"eta",shift:'\\char"397'},{label:"<i>&xi;</i>",class:"MLK__tex hide-shift",insert:"\\xi",aside:"xi",shift:"\\Xi"},{label:"<i>&kappa;</i>",class:"MLK__tex hide-shift",insert:"\\kappa",aside:"kappa",shift:"\\Kappa"},{label:"<i>&lambda;</i>",class:"MLK__tex hide-shift",insert:"\\lambda",aside:"lambda",shift:"\\Lambda"},"[separator-5]"],["[shift]",{label:"<i>&zeta;</i>",class:"MLK__tex hide-shift",insert:"\\zeta",aside:"zeta",shift:'\\char"396'},{label:"<i>&chi;</i>",class:"MLK__tex hide-shift",insert:"\\chi",aside:"chi",shift:'\\char"3A7'},{label:"<i>&psi;</i>",class:"MLK__tex hide-shift",insert:"\\psi",aside:"zeta",shift:"\\Psi"},{label:"<i>&omega;</i>",class:"MLK__tex hide-shift",insert:"\\omega",aside:"omega",shift:"\\Omega"},{label:"<i>&beta;</i>",class:"MLK__tex hide-shift",insert:"\\beta",aside:"beta",shift:'\\char"392'},{label:"<i>&nu;</i>",class:"MLK__tex hide-shift",insert:"\\nu",aside:"nu",shift:'\\char"39D'},{label:"<i>&mu;</i>",class:"MLK__tex hide-shift",insert:"\\mu",aside:"mu",shift:'\\char"39C'},"[backspace]"],["[separator]",{label:"<i>&#x03b5;</i>",class:"MLK__tex",insert:"\\varepsilon",aside:"espilon var."},{label:"<i>&#x03d1;</i>",class:"MLK__tex",insert:"\\vartheta",aside:"theta var."},{label:"<i>&#x3f0;</i>",class:"MLK__tex",insert:"\\varkappa",aside:"kappa var."},{label:"<i>&#x03d6;</i>",class:"MLK__tex",insert:"\\varpi",aside:"pi var."},{label:"<i>&#x03f1;</i>",class:"MLK__tex",insert:"\\varrho",aside:"rho var."},"[left]","[right]","[action]"]]},symbols:{label:"&infin;\u2260\u2208",labelClass:"MLK__tex",tooltip:"keyboard.tooltip.symbols",rows:[[{latex:"\\sin",shift:"\\sin^{-1}",variants:[{class:"small",latex:"\\sinh"},{class:"small",latex:"\\sin^{-1}"},{class:"small",latex:"\\arsinh"}]},"\\ln",{latex:"\\mathrm{abs}",insert:"\\mathrm{abs}\\left(#0\\right)"},{latex:"\\rarr",shift:"\\rArr",variants:[{latex:"\\implies",aside:"implies"},{latex:"\\to",aside:"to"},"\\dashv",{latex:"\\roundimplies",aside:"round implies"}]},{latex:"\\exists",variants:["\\nexists"],shift:"\\nexists"},{latex:"\\in",shift:"\\notin",variants:["\\notin","\\owns"]},"\\cup",{latex:"\\overrightarrow{#@}",shift:"\\overleftarrow{#@}",variants:["\\overleftarrow{#@}","\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"]},{class:"small",latex:"\\lim_{#?}",shift:"\\lim_{x\\to\\infty}",variants:[{class:"small",latex:"\\liminf_{#?}"},{class:"small",latex:"\\limsup_{#?}"}]},"\\exponentialE"],[{latex:"\\cos",shift:"\\cos^{-1}",variants:[{class:"small",latex:"\\cosh"},{class:"small",latex:"\\cos^{-1}"},{class:"small",latex:"\\arcosh"}]},{latex:"\\log",shift:"\\log_{10}",variants:["\\log_{#0}","\\log_{10}"]},"\\left\\vert#0\\right\\vert",{latex:"\\larr",shift:"\\lArr",variants:[{latex:"\\impliedby",aside:"implied by"},{latex:"\\gets",aside:"gets"},"\\lArr","\\vdash",{latex:"\\models",aside:"models"}]},{latex:"\\forall",shift:"\\lnot",variants:[{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"}]},{latex:"\\ni",shift:"\\not\\owns"},"\\cap",{latex:"\\overline{#@}",shift:"\\underline{#@}",variants:["\\overbrace{#@}","\\overlinesegment{#@}","\\overleftrightarrow{#@}","\\overrightarrow{#@}","\\overleftarrow{#@}","\\overgroup{#@}","\\underbrace{#@}","\\underlinesegment{#@}","\\underleftrightarrow{#@}","\\underrightarrow{#@}","\\underleftarrow{#@}","\\undergroup{#@}"]},{class:"hide-shift",latex:"\\int",shift:"\\iint",variants:[{latex:"\\int_{#?}^{#?}",class:"small"},{latex:"\\int",class:"small"},{latex:"\\smallint",class:"small"},{latex:"\\iint",class:"small"},{latex:"\\iiint",class:"small"},{latex:"\\oint",class:"small"},"\\intop","\\iiint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"]},{latex:"\\pi",shift:"\\tau",variants:["\\tau"]}],[{latex:"\\tan",shift:"\\tan^{-1}",variants:[{class:"small",latex:"\\tanh"},{class:"small",latex:"\\tan^{-1}"},{class:"small",latex:"\\artanh"},{class:"small",latex:"\\arctan"},{class:"small",latex:"\\arctg"},{class:"small",latex:"\\tg"}]},{latex:"\\exp",insert:"\\exp\\left(#0\\right)",variants:["\\exponentialE^{#0}"]},"\\left\\Vert#0\\right\\Vert",{latex:"\\lrArr",shift:"\\leftrightarrow",variants:[{latex:"\\iff",aside:"if and only if"},"\\leftrightarrow","\\leftrightarrows","\\Leftrightarrow",{latex:"^\\biconditional",aside:"biconditional"}]},{latex:"\\vert",shift:"!"},{latex:"#@^{\\complement}",aside:"complement",variants:[{latex:"\\setminus",aside:"set minus"},{latex:"\\smallsetminus",aside:"small set minus"}]},{latex:"\\subset",shift:"\\subseteq",variants:["\\subset","\\subseteq","\\subsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsubseteq","\\supset","\\supseteq","\\supsetneq","\\supsetneqq","\\nsupset","\\nsupseteq"]},{latex:"#@^{\\prime}",shift:"#@^{\\doubleprime}",variants:["#@^{\\doubleprime}","#@\\degree"]},{latex:"\\mathrm{d}",shift:"\\partial",variants:["\\mathrm{d}x",{latex:"\\dfrac{\\mathrm{d}}{\\mathrm{d} x}",class:"small"},{latex:"\\frac{\\partial}{\\partial x}",class:"small"},"\\partial"]},{latex:"\\infty",variants:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"]}],[{label:"[shift]",width:2},{class:"box",latex:",",shift:";",variants:[";","?"]},{class:"box",latex:"\\colon",shift:"\\Colon",variants:[{latex:"\\Colon",aside:"such that",class:"box"},{latex:":",aside:"ratio",class:"box"},{latex:"\\vdots",aside:"",class:"box"},{latex:"\\ddots",aside:"",class:"box"},{latex:"\\ldotp",aside:"low dot",class:"box"},{latex:"\\cdotp",aside:"center dot",class:"box"},{latex:"\\ldots",aside:"low ellipsis",class:"box"},{latex:"\\cdots",aside:"center ellipsis",class:"box"},{latex:"\\therefore",aside:"therefore",class:"box"},{latex:"\\because",aside:"because",class:"box"}]},{class:"box",latex:"\\cdot",aside:"centered dot",shift:"\\ast",variants:["\\circ","\\bigcirc","\\bullet","\\odot","\\oslash","\\circledcirc","\\ast","\\star","\\times","\\doteq","\\doteqdot"]},"[separator]","[left]","[right]",{label:"[backspace]",width:1,class:"action hide-shift"},{label:"[action]",width:1}]]},compact:{label:"compact",rows:[["[+]","[-]","[*]","[/]","[=]","[.]","[(]","[)]","\\sqrt{#0}","#@^{#?}"],["[1]","[2]","[3]","[4]","[5]","[6]","[7]","[8]","[9]","[0]"],["[hr]"],["[undo]","[redo]","[separator]","[separator]","[separator]","[left]","[right]",{label:"[backspace]",class:"action hide-shift"},"[hide-keyboard]"]]},minimalist:{label:"minimalist",layers:[{style:`
.minimalist-backdrop {
display: flex;
justify-content: center;
}
.minimalist-container {
--keycap-height: 40px;
--keycap-max-width: 53px;
--keycap-small-font-size: 12px;
background: var(--keyboard-background);
padding: 20px;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
border: 1px solid var(--keyboard-border);
box-shadow: 0 0 32px rgb(0 0 0 / 30%);
}
`,backdrop:"minimalist-backdrop",container:"minimalist-container",rows:[["+","-","\\times",{latex:"\\frac{#@}{#0}",class:"small"},"=","[.]","(",")",{latex:"\\sqrt{#0}",class:"small"},{latex:"#@^{#?}",class:"small"}],["1","2","3","4","5","6","7","8","9","0"],["[hr]"],["[undo]","[redo]","[separator]","[separator]","[separator]","[left]","[right]",{label:"[backspace]",class:"action hide-shift"},"[hide-keyboard]"]]}]},"numeric-only":{label:"123",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.numeric",id:"numeric-only",rows:[["7","8","9","[separator]",{label:"[backspace]",width:2}],["4","5","6","[separator]","[separator]","[separator]"],["1","2","3","[separator]","[separator]","[separator]"],["0",{label:"[.]",variants:[]},"-","[separator]","[left]","[right]"]]}},Iu={0:["\\varnothing","\\infty"],1:["\\frac{1}{#@}","#@^{-1}","\\times 10^{#?}","\\phi","\\imaginaryI"],2:["\\frac{1}{2}","#@^2","\\sqrt2","\\exponentialE"],3:["\\frac{1}{3}","#@^3","\\sqrt3","\\pi"],4:["\\frac{1}{4}","#@^4"],5:["\\frac{1}{5}","#@^5","\\sqrt5"],6:["\\frac{1}{6}","#@^6"],7:["\\frac{1}{7}","#@^7"],8:["\\frac{1}{8}","#@^8"],9:["\\frac{1}{9}","#@^9"],".":[".",",",";","\\colon"],",":["{,}",".",";","\\colon"],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"},"\xE0","\xE1","\xE2","\xE4","\xE6"],b:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"},"\xE7"],d:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn\u2019t"},"\xE8","\xE9","\xEA","\xEB"],g:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"},"\xEC","\xED","\xEE","\xEF"],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\mathbb{N}",aside:"set of natural numbers"},"\xF1"],o:["\xF8","\u0153","\xF2","\xF3","\xF4","\xF6","\u0153"],p:[{latex:"\\mathbb{P}",aside:"set of primes"}],q:[{latex:"\\mathbb{Q}",aside:"set of rational numbers"}],r:[{latex:"\\mathbb{R}",aside:"set of real numbers"}],u:["\xF9","\xFA","\xFB","\xFC"],z:[{latex:"\\mathbb{Z}",aside:"set of integers"}],y:["\xFD","\xFF"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space<br>\u207B\xB3\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\,\\char"2039',insert:"\\,",aside:"thin space<br>\xB3\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\:\\char"2039',insert:"\\:",aside:"medium space<br>\u2074\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\;\\char"2039',insert:"\\;",aside:"thick space<br>\u2075\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\ \\char"2039',insert:"\\ ",aside:"\u2153 em"},{latex:'\\char"203A\\enspace\\char"2039',insert:"\\enspace",aside:"\xBD em"},{latex:'\\char"203A\\quad\\char"2039',insert:"\\quad",aside:"1 em"},{latex:'\\char"203A\\qquad\\char"2039',insert:"\\qquad",aside:"2 em"}]},Ll;function Th(e,t){var r,n,a;const o=Gs.singleton;if(!o)return;const _=Jo(e),N=(n=(r=o.getKeycap(_==null?void 0:_.id))==null?void 0:r.variants)!=null?n:"";if(typeof N=="string"&&!Dh(N)||Array.isArray(N)&&N.length===0){t==null||t();return}const z={};let W="";for(const Ue of ym(N)){const yt=kh(Ue),Be=Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);z[Be]=yt;const[nt,wt]=Ou(yt);W+=`<div id=${Be} class="item ${wt}">${nt}</div>`}const j=document.createElement("div");j.setAttribute("aria-hidden","true"),j.className="MLK__variant-panel",j.style.height="auto";const X=Object.keys(z).length;let ae=5;X===1?ae=1:X===2||X===4?ae=2:X===3||X===5||X===6?ae=3:X>=7&&X<14&&(ae=4),j.style.width=`calc(var(--variant-keycap-length) * ${ae} + 12px)`,j.innerHTML=yd.createHTML(W),ds.open({root:(a=o==null?void 0:o.container)==null?void 0:a.querySelector(".ML__keyboard"),child:j}),Ll=new AbortController;const{signal:he}=Ll,_e=e==null?void 0:e.getBoundingClientRect();if(_e){_e.top-j.clientHeight<0&&(j.style.width="auto",X<=6?j.style.height="56px":X<=12?j.style.height="108px":X<=18?j.style.height="205px":j.classList.add("compact"));const Ue=Math.max(0,Math.min(window.innerWidth-j.offsetWidth,(_e.left+_e.right-j.offsetWidth)/2)),yt=_e.top-j.clientHeight+5;j.style.transform=`translate(${Ue}px, ${yt}px)`,j.classList.add("is-visible"),requestAnimationFrame(()=>{j.addEventListener("pointerup",Be=>{const nt=Jo(Be.target);!(nt!=null&&nt.id)||!z[nt.id]||(Cc(z[nt.id]),Rl(),t==null||t(),Be.preventDefault())},{capture:!0,passive:!1,signal:he}),j.addEventListener("pointerenter",Be=>{const nt=Jo(Be.target);!(nt!=null&&nt.id)||!z[nt.id]||nt.classList.add("is-active")},{capture:!0,signal:he}),j.addEventListener("pointerleave",Be=>{const nt=Jo(Be.target);!(nt!=null&&nt.id)||!z[nt.id]||nt.classList.remove("is-active")},{capture:!0,signal:he}),window.addEventListener("pointercancel",()=>{Rl(),t==null||t()},{signal:he}),window.addEventListener("pointerup",()=>{Rl(),t==null||t()},{signal:he})})}}function Rl(){Ll==null||Ll.abort(),Ll=null,ds.state==="open"&&ds.close()}function _m(e){if(e==="foreground-color"){const t=[];for(const r of Object.keys(m))t.push({class:"swatch-button",label:'<span style="border: 3px solid '+m[r]+'"></span>',command:["applyStyle",{color:r}]});return t}if(e==="background-color"){const t=[];for(const r of Object.keys(k))t.push({class:"swatch-button",label:'<span style="background:'+k[r]+'"></span>',command:["applyStyle",{backgroundColor:r}]});return t}}function Dh(e){return Iu[e]!==void 0}function ym(e){var t;return typeof e!="string"?e:(Iu[e]||(Iu[e]=(t=_m(e))!=null?t:[]),Iu[e])}function bm(e){return typeof e=="string"?e:Object.entries(e).map(([t,r])=>`${t}:${r} !important`).join(";")}function xm(e){return Object.keys(e).map(t=>`${t} {${bm(e[t])}}`).join("")}function Pl(e){if(!e)return"";const t=new Qr,r=new Qe({mode:"math",type:"root",body:na(e,{context:t,args:a=>a==="@"?"{\\class{ML__box-placeholder}{\\blacksquare}}":"\\placeholder{}"})}),n=au(Sl(new St(r.render(t),{classes:"ML__base"}),t));return su(n,{classes:"ML__latex"}).toMarkup()}function Il(e){var t;if(Array.isArray(e))return e.map(n=>Il(n)).flat();const r=typeof e=="string"?{markup:e}:e;return"rows"in r&&Array.isArray(r.rows)&&(r.rows=r.rows.map(n=>n.map(a=>kh(a)))),(t=r.id)!=null||(r.id="ML__layer_"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36)),[r]}function Em(){var e,t;let n=window.mathVirtualKeyboard.alphabeticLayout;if(n==="auto"){const N=Al();N&&(n=N.virtualLayout),(!n||n==="auto")&&(n=(e={fr:"azerty",be:"azerty",al:"qwertz",ba:"qwertz",cz:"qwertz",de:"qwertz",hu:"qwertz",sk:"qwertz",ch:"qwertz"}[f.locale.slice(0,2)])!=null?e:"qwerty")}const a={qwerty:["qwertyuiop"," asdfghjkl ","^zxcvbnm~"],azerty:["azertyuiop","qsdfghjklm","^ wxcvbn ~"],qwertz:["qwertzuiop"," asdfghjkl ","^yxcvbnm~"],dvorak:["^ pyfgcrl ","aoeuidhtns","qjkxbmwvz~"],colemak:[" qwfpgjluy ","arstdhneio","^zxcvbkm~"]},o=(t=a[n])!=null?t:a.qwerty,_=n==="azerty"?[[{label:"1",variants:"1"},{label:"2",shift:{latex:"\xE9"},variants:"2"},{label:"3",shift:{latex:"\xF9"},variants:"3"},{label:"4",variants:"4"},{label:"5",shift:{label:"(",latex:"("},variants:"5"},{label:"6",shift:{label:")",latex:")"},variants:"6"},{label:"7",shift:{latex:"\xE8"},variants:"7"},{label:"8",shift:{latex:"\xEA"},variants:"8"},{label:"9",shift:{latex:"\xE7"},variants:"9"},{label:"0",shift:{latex:"\xE0"},variants:"0"}]]:[[{label:"1",variants:"1"},{label:"2",variants:"2"},{label:"3",variants:"3"},{label:"4",variants:"4"},{label:"5",shift:{latex:"\\frac{#@}{#?}"},variants:"5"},{label:"6",shift:{latex:"#@^#?"},variants:"6"},{label:"7",variants:"7"},{label:"8",shift:{latex:"\\times"},variants:"8"},{label:"9",shift:{label:"(",latex:"("},variants:"9"},{label:"0",shift:{label:")",latex:")"},variants:"0"}]];for(const N of o){const z=[];for(const W of N)/[a-z]/.test(W)?z.push({label:W,class:"hide-shift",shift:{label:W.toUpperCase()},variants:Dh(W)?W:void 0}):W==="~"?n!=="dvorak"?z.push("[backspace]"):z.push({label:"[backspace]",width:1}):W==="^"?z.push("[shift]"):W===" "&&z.push("[separator-5]");_.push(z)}return _.push(["[-]","[+]","[=]",{label:" ",width:1.5},{label:",",shift:";",variants:".",class:"hide-shift"},"[.]","[left]","[right]",{label:"[action]",width:1.5}]),{label:"abc",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.alphabetic",layers:Il({rows:_})}}function Ah(e){if(e==="alphabetic")return Em();if(typeof e=="string")return console.assert(Mh[e]!==void 0,`MathLive 0.98.5: unknown keyboard layout "${e}"`),Ah(Mh[e]);let t;if("rows"in e&&Array.isArray(e.rows)){console.assert(!("layers"in e||"markup"in e),'MathLive 0.98.5: when providing a "rows" property, "layers" and "markup" are ignored');const a=e,{rows:o}=a,_=L(a,["rows"]);t=i(F({},_),{layers:Il({rows:e.rows})})}else if("markup"in e&&typeof e.markup=="string"){const a=e,{markup:o}=a,_=L(a,["markup"]);t=i(F({},_),{layers:Il(e.markup)})}else t=F({},e),"layers"in e?t.layers=Il(e.layers):console.error('MathLive 0.98.5: provide either a "rows", "markup" or "layers" property');let r=!1,n=!1;for(const a of t.layers)if(a.rows)for(const o of a.rows.flat()){Qo(o)&&(r=!0);const _=o.command;typeof _=="string"&&["undo","redo","cut","copy","paste"].includes(_)&&(n=!0)}return(!("displayShiftedKeycaps"in e)||e.displayShiftedKeycaps===void 0)&&(t.displayShiftedKeycaps=r),(!("displayEditToolbar"in e)||e.displayEditToolbar===void 0)&&(t.displayEditToolbar=!n),t}function wm(e,t){var r,n;let a='<div class="left">';if(e.normalizedLayouts.length>1)for(const[o,_]of e.normalizedLayouts.entries()){const N=_,z=[o===t?"selected":"layer-switch"];N.tooltip&&z.push("MLK__tooltip"),N.labelClass&&z.push(...N.labelClass.split(" ")),a+=`<div class="${z.join(" ")}"`,N.tooltip&&(a+=" data-tooltip='"+((r=u(N.tooltip))!=null?r:N.tooltip)+"' "),o!==t&&(a+=`data-layer="${N.layers[0].id}"`),a+=`>${(n=N.label)!=null?n:"untitled"}</div>`}return a+="</div>",a}function Sm(e,t){let r="";if(e.editToolbar==="none")return"";const a=[];t.selectionIsCollapsed?a.push("undo","redo","pasteFromClipboard"):a.push("cutToClipboard","copyToClipboard","pasteFromClipboard");const o={undo:`<div class='action ${t.canUndo===!1?"disabled":""}'
data-command='"undo"'
data-tooltip='${u("tooltip.undo")}'>
<svg><use xlink:href='#svg-undo' /></svg>
</div>`,redo:`<div class='action ${t.canRedo===!1?"disabled":""}'
data-command='"redo"'
data-tooltip='${u("tooltip.redo")}'>
<svg><use xlink:href='#svg-redo' /></svg>
</div>`,cutToClipboard:`
<div class='action'
data-command='"cutToClipboard"'
data-tooltip='${u("tooltip.cut to clipboard")}'>
<svg><use xlink:href='#svg-cut' /></svg>
</div>
`,copyToClipboard:`
<div class='action'
data-command='"copyToClipboard"'
data-tooltip='${u("tooltip.copy to clipboard")}'>
<svg><use xlink:href='#svg-copy' /></svg>
</div>
`,pasteFromClipboard:`
<div class='action'
data-command='"pasteFromClipboard"'
data-tooltip='${u("tooltip.paste from clipboard")}'>
<svg><use xlink:href='#svg-paste' /></svg>
</div>
`};return r+=a.map(_=>o[_]).join(""),r}function Mm(e){for(const t of e)Tm(t)}function Tm(e){const t=Gs.singleton;if(!t)return;const r={};if(!e.id){if(e.hasAttribute("data-label")&&(r.label=e.dataset.label),e.hasAttribute("data-latex")&&(r.latex=e.dataset.latex),e.hasAttribute("data-key")&&(r.key=e.dataset.key),e.hasAttribute("data-insert")&&(r.insert=e.dataset.insert),e.hasAttribute("data-variants")&&(r.variants=e.dataset.variants),e.hasAttribute("data-aside")&&(r.aside=e.dataset.aside),e.className&&(r.class=e.className),!r.label&&!r.latex&&!r.key&&!r.insert&&(r.latex=e.innerText,r.label=e.innerHTML),e.hasAttribute("data-command"))try{r.command=JSON.parse(e.dataset.command)}catch(n){}e.id=t.registerKeycap(r)}if(!e.innerHTML){const[n,a]=Ou(r);e.innerHTML=window.MathfieldElement.createHTML(n)}}function Dm(){Cs("virtual-keyboard"),Cs("core"),Lu()}function Am(){Vs("core"),Vs("virtual-keyboard")}var km=`<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="svg-delete-backward" viewBox="0 0 576 512">
<path d="M432.1 208.1L385.9 256L432.1 303C442.3 312.4 442.3 327.6 432.1 336.1C423.6 346.3 408.4 346.3 399 336.1L352 289.9L304.1 336.1C295.6 346.3 280.4 346.3 271 336.1C261.7 327.6 261.7 312.4 271 303L318.1 256L271 208.1C261.7 199.6 261.7 184.4 271 175C280.4 165.7 295.6 165.7 304.1 175L352 222.1L399 175C408.4 165.7 423.6 165.7 432.1 175C442.3 184.4 442.3 199.6 432.1 208.1V208.1zM512 64C547.3 64 576 92.65 576 128V384C576 419.3 547.3 448 512 448H205.3C188.3 448 172 441.3 160 429.3L9.372 278.6C3.371 272.6 0 264.5 0 256C0 247.5 3.372 239.4 9.372 233.4L160 82.75C172 70.74 188.3 64 205.3 64L512 64zM528 128C528 119.2 520.8 112 512 112H205.3C201 112 196.9 113.7 193.9 116.7L54.63 256L193.9 395.3C196.9 398.3 201 400 205.3 400H512C520.8 400 528 392.8 528 384V128z"/>
</symbol>
<symbol id="svg-shift" viewBox="0 0 384 512">
<path d="M2.438 252.3C7.391 264.2 19.06 272 32 272h80v160c0 26.51 21.49 48 48 48h64C250.5 480 272 458.5 272 432v-160H352c12.94 0 24.61-7.797 29.56-19.75c4.953-11.97 2.219-25.72-6.938-34.88l-160-176C208.4 35.13 200.2 32 192 32S175.6 35.13 169.4 41.38l-160 176C.2188 226.5-2.516 240.3 2.438 252.3zM192 86.63L313.4 224H224v208H160V224H70.63L192 86.63z"/>
</symbol>
<symbol id="svg-commit" viewBox="0 0 512 512">
<path d="M135 432.1l-128-128C2.344 300.3 0 294.2 0 288s2.344-12.28 7.031-16.97l128-128c9.375-9.375 24.56-9.375 33.94 0s9.375 24.56 0 33.94L81.94 264H464v-208C464 42.75 474.8 32 488 32S512 42.75 512 56V288c0 13.25-10.75 24-24 24H81.94l87.03 87.03c9.375 9.375 9.375 24.56 0 33.94S144.4 442.3 135 432.1z"/>
</symbol>
<symbol id="circle-plus" viewBox="0 0 512 512"><path d="M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM232 344c0 13.3 10.7 24 24 24s24-10.7 24-24V280h64c13.3 0 24-10.7 24-24s-10.7-24-24-24H280V168c0-13.3-10.7-24-24-24s-24 10.7-24 24v64H168c-13.3 0-24 10.7-24 24s10.7 24 24 24h64v64z"/></symbol>
<symbol id="svg-command" viewBox="0 0 640 512">
<path d="M34.495 36.465l211.051 211.05c4.686 4.686 4.686 12.284 0 16.971L34.495 475.535c-4.686 4.686-12.284 4.686-16.97 0l-7.071-7.07c-4.686-4.686-4.686-12.284 0-16.971L205.947 256 10.454 60.506c-4.686-4.686-4.686-12.284 0-16.971l7.071-7.07c4.686-4.687 12.284-4.687 16.97 0zM640 468v-10c0-6.627-5.373-12-12-12H300c-6.627 0-12 5.373-12 12v10c0 6.627 5.373 12 12 12h328c6.627 0 12-5.373 12-12z"/>
</symbol>
<symbol id="svg-undo" viewBox="0 0 512 512">
<path d="M20 8h10c6.627 0 12 5.373 12 12v110.625C85.196 57.047 165.239 7.715 256.793 8.001 393.18 8.428 504.213 120.009 504 256.396 503.786 393.181 392.834 504 256 504c-63.926 0-122.202-24.187-166.178-63.908-5.113-4.618-5.354-12.561-.482-17.433l7.069-7.069c4.503-4.503 11.749-4.714 16.482-.454C150.782 449.238 200.935 470 256 470c117.744 0 214-95.331 214-214 0-117.744-95.331-214-214-214-82.862 0-154.737 47.077-190.289 116H180c6.627 0 12 5.373 12 12v10c0 6.627-5.373 12-12 12H20c-6.627 0-12-5.373-12-12V20c0-6.627 5.373-12 12-12z"/>
</symbol>
<symbol id="svg-redo" viewBox="0 0 512 512">
<path d="M492 8h-10c-6.627 0-12 5.373-12 12v110.625C426.804 57.047 346.761 7.715 255.207 8.001 118.82 8.428 7.787 120.009 8 256.396 8.214 393.181 119.166 504 256 504c63.926 0 122.202-24.187 166.178-63.908 5.113-4.618 5.354-12.561.482-17.433l-7.069-7.069c-4.503-4.503-11.749-4.714-16.482-.454C361.218 449.238 311.065 470 256 470c-117.744 0-214-95.331-214-214 0-117.744 95.331-214 214-214 82.862 0 154.737 47.077 190.289 116H332c-6.627 0-12 5.373-12 12v10c0 6.627 5.373 12 12 12h160c6.627 0 12-5.373 12-12V20c0-6.627-5.373-12-12-12z"/>
</symbol>
<symbol id="svg-arrow-left" viewBox="0 0 320 512">
<path d="M206.7 464.6l-183.1-191.1C18.22 267.1 16 261.1 16 256s2.219-11.97 6.688-16.59l183.1-191.1c9.152-9.594 24.34-9.906 33.9-.7187c9.625 9.125 9.938 24.37 .7187 33.91L73.24 256l168 175.4c9.219 9.5 8.906 24.78-.7187 33.91C231 474.5 215.8 474.2 206.7 464.6z"/>
</symbol>
<symbol id="svg-arrow-right" viewBox="0 0 320 512">
<path d="M113.3 47.41l183.1 191.1c4.469 4.625 6.688 10.62 6.688 16.59s-2.219 11.97-6.688 16.59l-183.1 191.1c-9.152 9.594-24.34 9.906-33.9 .7187c-9.625-9.125-9.938-24.38-.7187-33.91l168-175.4L78.71 80.6c-9.219-9.5-8.906-24.78 .7187-33.91C88.99 37.5 104.2 37.82 113.3 47.41z"/>
</symbol>
<symbol id="svg-tab" viewBox="0 0 448 512">
<path d="M32 217.1c0-8.8 7.2-16 16-16h144v-93.9c0-7.1 8.6-10.7 13.6-5.7l143.5 143.1c6.3 6.3 6.3 16.4 0 22.7L205.6 410.4c-5 5-13.6 1.5-13.6-5.7v-93.9H48c-8.8 0-16-7.2-16-16v-77.7m-32 0v77.7c0 26.5 21.5 48 48 48h112v61.9c0 35.5 43 53.5 68.2 28.3l143.6-143c18.8-18.8 18.8-49.2 0-68L228.2 78.9c-25.1-25.1-68.2-7.3-68.2 28.3v61.9H48c-26.5 0-48 21.6-48 48zM436 64h-8c-6.6 0-12 5.4-12 12v360c0 6.6 5.4 12 12 12h8c6.6 0 12-5.4 12-12V76c0-6.6-5.4-12-12-12z"/>
</symbol>
<symbol id="svg-paste" viewBox="0 0 512 512"><path d="M160 32c11.6 0 21.3 8.2 23.5 19.2C185 58.6 191.6 64 199.2 64H208c8.8 0 16 7.2 16 16V96H96V80c0-8.8 7.2-16 16-16h8.8c7.6 0 14.2-5.4 15.7-12.8C138.7 40.2 148.4 32 160 32zM64 64h2.7C65 69 64 74.4 64 80V96c0 17.7 14.3 32 32 32H224c17.7 0 32-14.3 32-32V80c0-5.6-1-11-2.7-16H256c17.7 0 32 14.3 32 32h32c0-35.3-28.7-64-64-64H210.6c-9-18.9-28.3-32-50.6-32s-41.6 13.1-50.6 32H64C28.7 32 0 60.7 0 96V384c0 35.3 28.7 64 64 64H192V416H64c-17.7 0-32-14.3-32-32V96c0-17.7 14.3-32 32-32zM288 480c-17.7 0-32-14.3-32-32V192c0-17.7 14.3-32 32-32h96v56c0 22.1 17.9 40 40 40h56V448c0 17.7-14.3 32-32 32H288zM416 165.3L474.7 224H424c-4.4 0-8-3.6-8-8V165.3zM448 512c35.3 0 64-28.7 64-64V235.9c0-12.7-5.1-24.9-14.1-33.9l-59.9-59.9c-9-9-21.2-14.1-33.9-14.1H288c-35.3 0-64 28.7-64 64V448c0 35.3 28.7 64 64 64H448z"/></symbol>
<symbol id="svg-cut" viewBox="0 0 512 512"><path d="M485.6 444.2L333.6 314.9C326.9 309.2 326.1 299.1 331.8 292.4C337.5 285.6 347.6 284.8 354.4 290.5L506.4 419.8C513.1 425.5 513.9 435.6 508.2 442.4C502.5 449.1 492.4 449.9 485.6 444.2zM485.7 67.76C492.5 62.07 502.5 62.94 508.2 69.69C513.9 76.45 513.1 86.55 506.3 92.24L208.5 343.1C218.3 359.7 224 379.2 224 400C224 461.9 173.9 512 112 512C50.14 512 0 461.9 0 400C0 338.1 50.14 288 112 288C141.5 288 168.4 299.4 188.4 318.1L262.2 256L188.4 193.9C168.4 212.6 141.5 224 112 224C50.14 224 0 173.9 0 112C0 50.14 50.14 0 112 0C173.9 0 224 50.14 224 112C224 132.8 218.3 152.3 208.5 168.9L287 235.1L485.7 67.76zM32 112C32 156.2 67.82 192 112 192C156.2 192 192 156.2 192 112C192 67.82 156.2 32 112 32C67.82 32 32 67.82 32 112zM112 480C156.2 480 192 444.2 192 400C192 355.8 156.2 320 112 320C67.82 320 32 355.8 32 400C32 444.2 67.82 480 112 480z"/></symbol>
<symbol id="svg-copy" viewBox="0 0 512 512"><path d="M272 416C263.2 416 256 423.2 256 432V448c0 17.67-14.33 32-32 32H64c-17.67 0-32-14.33-32-32V192c0-17.67 14.33-32 32-32h112C184.8 160 192 152.8 192 144C192 135.2 184.8 128 176 128H63.99c-35.35 0-64 28.65-64 64l.0098 256C0 483.3 28.65 512 64 512h160c35.35 0 64-28.65 64-64v-16C288 423.2 280.8 416 272 416zM502.6 86.63l-77.25-77.25C419.4 3.371 411.2 0 402.7 0H288C252.7 0 224 28.65 224 64v256c0 35.35 28.65 64 64 64h160c35.35 0 64-28.65 64-64V109.3C512 100.8 508.6 92.63 502.6 86.63zM416 45.25L466.7 96H416V45.25zM480 320c0 17.67-14.33 32-32 32h-160c-17.67 0-32-14.33-32-32V64c0-17.67 14.33-32 32-32h96l.0026 64c0 17.67 14.33 32 32 32H480V320z"/>
</symbol>
<symbol id="svg-angle-double-right" viewBox="0 0 512 512"><path d="M470.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 256 265.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160zm-352 160l160-160c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L210.7 256 73.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z"/>
</symbol>
<symbol id="svg-angle-double-left" viewBox="0 0 512 512"><path d="M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160zm352-160l-160 160c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L301.3 256 438.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0z"/>
</symbol>
<symbol id="svg-trash" viewBox="0 0 448 512">
<path d="M336 64l-33.6-44.8C293.3 7.1 279.1 0 264 0h-80c-15.1 0-29.3 7.1-38.4 19.2L112 64H24C10.7 64 0 74.7 0 88v2c0 3.3 2.7 6 6 6h26v368c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V96h26c3.3 0 6-2.7 6-6v-2c0-13.3-10.7-24-24-24h-88zM184 32h80c5 0 9.8 2.4 12.8 6.4L296 64H152l19.2-25.6c3-4 7.8-6.4 12.8-6.4zm200 432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V96h320v368zm-176-44V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12zm-80 0V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12zm160 0V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12z"/>
</symbol>
<symbol id="svg-keyboard-down" viewBox="0 0 576 512"><path d="M64 48c-8.8 0-16 7.2-16 16V240c0 8.8 7.2 16 16 16H512c8.8 0 16-7.2 16-16V64c0-8.8-7.2-16-16-16H64zM0 64C0 28.7 28.7 0 64 0H512c35.3 0 64 28.7 64 64V240c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V64zM159 359c9.4-9.4 24.6-9.4 33.9 0l95 95 95-95c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L305 505c-4.5 4.5-10.6 7-17 7s-12.5-2.5-17-7L159 393c-9.4-9.4-9.4-24.6 0-33.9zm1-167c0-8.8 7.2-16 16-16H400c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V192zM120 88h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H120c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16zm64 16c0-8.8 7.2-16 16-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H200c-8.8 0-16-7.2-16-16V104zm96-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H280c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16zm64 16c0-8.8 7.2-16 16-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H360c-8.8 0-16-7.2-16-16V104zm96-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H440c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16z"/></symbol>
</svg>`;function Cm(e){e.resetKeycapRegistry(),Dm();const t=document.createElement("div");t.className="ML__keyboard";const r=document.createElement("div");r.className="MLK__plate",r.innerHTML=window.MathfieldElement.createHTML(km+e.normalizedLayouts.map((_,N)=>Lm(e,_,N)).join(""));const n=document.createElement("div");n.className="MLK__backdrop",n.appendChild(r),t.appendChild(n),t.addEventListener("pointerdown",Pm,{passive:!1});const a=t.querySelectorAll(".ML__edit-toolbar");if(a)for(const _ of a)_.addEventListener("click",N=>{var z,W;let j=N.target,X="";for(;j&&!X;)X=(z=j==null?void 0:j.getAttribute("data-command"))!=null?z:"",j=(W=j==null?void 0:j.parentElement)!=null?W:null;X&&e.executeCommand(JSON.parse(X))});Mm(t.querySelectorAll(".MLK__keycap, .action, .fnbutton, .bigfnbutton"));const o=t.querySelectorAll(".MLK__layer");console.assert(o.length>0,"No virtual keyboards available");for(const _ of o)_.addEventListener("pointerdown",N=>N.preventDefault());return e.currentLayer=e.latentLayer,t}function Lm(e,t,r){const n=[];if(!("layers"in t))return"";for(const a of t.layers)n.push(`<div tabindex="-1" class="MLK__layer" id="${a.id}">`),(e.normalizedLayouts.length>1||t.displayEditToolbar)&&(n.push("<div class='MLK__toolbar' role='toolbar'>"),n.push(wm(e,r)),t.displayEditToolbar&&n.push('<div class="ML__edit-toolbar right"></div>'),n.push("</div>")),n.push(Rm(e,a)),n.push("</div>");return n.join("")}function Rm(e,t){if(typeof t=="string")return t;let r="";if(typeof t.style=="string"?r+=`<style>${t.style}</style>`:typeof t.style=="object"&&(r+=`<style>${xm(t.style)}</style>`),t.backdrop&&(r+=`<div class='${t.backdrop}'>`),t.container&&(r+=`<div class='${t.container}'>`),t.rows){r+="<div class=MLK__rows>";for(const n of t.rows){r+="<div dir='ltr' class=MLK__row>";for(const a of n)if(a){const o=e.registerKeycap(a),[_,N]=Ou(a);/(^|\s)separator/.test(N)?r+=`<div class="${N}"`:r+=`<div tabindex="-1" id="${o}" class="${N}"`,a.tooltip&&(r+=` data-tooltip="${a.tooltip}"`),r+=`>${_}</div>`}r+="</div>"}r+="</div>"}else t.markup&&(r+=t.markup);return t.container&&(r+="</div>"),t.backdrop&&(r+="</div>"),r}function Ou(e,t={shifted:!1}){var r,n,a,o,_,N,z;let W="",j=(r=e.class)!=null?r:"";if(t.shifted&&Qo(e)&&(j+=" is-active"),t.shifted&&"shift"in e)typeof e.shift=="string"?W=Pl(e.shift):typeof e.shift=="object"&&(W=e.shift.label?e.shift.label:(n=Pl(e.shift.latex||e.shift.insert||"")||e.shift.key)!=null?n:""),typeof e.shift=="object"&&(j=(o=(a=e.shift.class)!=null?a:e.class)!=null?o:"");else{if(W=e.label?e.label:(_=Pl(e.latex||e.insert||"")||e.key)!=null?_:"",e.shift){let X;typeof e.shift=="string"?X=Pl(e.shift):e.shift.label?X=e.shift.label:X=(N=Pl(e.shift.latex||e.shift.insert||"")||e.shift.key)!=null?N:"",W+=`<span class="MLK__shift">${X}</span>`}e.aside&&(W+=`<aside>${e.aside}</aside>`)}return e.layer&&!/layer-switch/.test(j)&&(j+=" layer-switch"),/(^|\s)(separator|action|shift|fnbutton|bigfnbutton)($|\s)/.test(j)||(j+=" MLK__keycap"),!/\bw[0-9]+\b/.test(j)&&e.width&&(j+=(z={0:" w0",.5:" w5",1.5:" w15",2:" w20",5:" w50"}[e.width])!=null?z:""),[W,j||"MLK__keycap"]}var xo={"[left]":{class:"action hide-shift",label:"<svg class=svg-glyph><use xlink:href=#svg-arrow-left /></svg>",command:["performWithFeedback","moveToPreviousChar"],shift:{label:"<svg class=svg-glyph><use xlink:href=#svg-angle-double-left /></svg>",command:["performWithFeedback","extendSelectionBackward"]}},"[right]":{class:"action hide-shift",label:"<svg class=svg-glyph><use xlink:href=#svg-arrow-right /></svg>",command:["performWithFeedback","moveToNextChar"],shift:{label:"<svg class=svg-glyph><use xlink:href=#svg-angle-double-right /></svg>",command:["performWithFeedback","extendSelectionForward"]}},"[up]":{class:"action hide-shift",label:"\u2191",command:["performWithFeedback","moveUp"],shift:{label:"\u219F",command:["performWithFeedback","extendSelectionUpward"]}},"[down]":{class:"action hide-shift",label:"\u2193",command:["performWithFeedback","moveDown"],shift:{label:"\u21A1",command:["performWithFeedback","extendSelectionDownward"]}},"[return]":{class:"action hide-shift",command:["performWithFeedback","commit"],shift:{command:["performWithFeedback","addRowAfter"]},width:1.5,label:"<svg class=svg-glyph><use xlink:href=#svg-commit /></svg>"},"[action]":{class:"action hide-shift",command:["performWithFeedback","commit"],shift:{label:"<svg class=svg-glyph><use xlink:href=#circle-plus /></svg>",command:["performWithFeedback","addRowAfter"]},width:1.5,label:"<svg class=svg-glyph><use xlink:href=#svg-commit /></svg>"},"[hr]":{class:"separator horizontal-rule"},"[hide-keyboard]":{class:"action",command:["hideVirtualKeyboard"],width:1.5,label:"<svg class=svg-glyph-lg><use xlink:href=#svg-keyboard-down /></svg>"},"[.]":{variants:".",command:["performWithFeedback","insertDecimalSeparator"],shift:",",class:"big-op hide-shift",label:"."},"[,]":{variants:",",command:["performWithFeedback","insertDecimalSeparator"],shift:".",class:"big-op hide-shift",label:","},"[+]":{variants:[{latex:"\\sum_{#0}^{#0}",class:"small"},"\\oplus"],latex:"+",label:"+",class:"big-op hide-shift",shift:{latex:"\\sum",insert:"\\sum",class:"small"}},"[-]":{variants:["\\pm","\\ominus"],latex:"-",label:"&#x2212;",shift:"\\pm",class:"big-op hide-shift"},"[/]":{class:"big-op hide-shift",shift:{class:"",latex:"\\frac{1}{#@}"},variants:["/","\\div","\\%","\\oslash"],latex:"\\frac{#@}{#?}",label:"&divide;"},"[*]":{variants:[{latex:"\\prod_{#0}^{#0}",class:"small"},"\\otimes","\\cdot"],latex:"\\cdot",label:"&times;",shift:{latex:"\\times"},class:"big-op hide-shift"},"[=]":{variants:["\\neq","\\equiv","\\varpropto","\\thickapprox","\\lt","\\gt","\\le","\\ge"],latex:"=",label:"=",shift:{label:"\u2260",latex:"\\ne"},class:"big-op hide-shift"},"[backspace]":{class:"action bottom right hide-shift",width:1.5,command:["performWithFeedback","deleteBackward"],label:"<svg class=svg-glyph><use xlink:href=#svg-delete-backward /></svg>",shift:{class:"action warning",label:"<svg class=svg-glyph><use xlink:href=#svg-trash /></svg>",command:"deleteAll"}},"[undo]":{class:"ghost if-can-undo",command:"undo",label:"<svg class=svg-glyph><use xlink:href=#svg-undo /></svg>",tooltip:"tooltip.undo"},"[redo]":{class:"ghost if-can-redo",command:"redo",label:"<svg class=svg-glyph><use xlink:href=#svg-redo /></svg>",tooltip:"tooltip.redo"},"[(]":{variants:[{latex:"\\lbrack",key:"["},"\\langle","\\lfloor","\\lceil",{latex:"\\lbrace",key:"{"}],key:"(",label:"(",shift:{label:"[",key:"["},class:"hide-shift"},"[)]":{variants:[{latex:"\\rbrack",key:"]"},"\\rangle","\\rfloor","\\rceil",{latex:"\\rbrace",key:"]"}],key:")",label:")",shift:{label:"]",latex:"\\rbrack"},class:"hide-shift"},"[0]":{variants:"0",latex:"0",label:"0",shift:"\\infty",class:"hide-shift"},"[1]":{variants:"1",latex:"1",label:"1",shift:"#@^{-1}",class:"hide-shift"},"[2]":{variants:"2",latex:"2",label:"2",shift:"#@^2",class:"hide-shift"},"[3]":{variants:"3",latex:"3",label:"3",shift:"#@^3",class:"hide-shift"},"[4]":{variants:"4",latex:"4",label:"4",shift:"#@^4",class:"hide-shift"},"[5]":{variants:"5",latex:"5",label:"5",shift:"#@^5",class:"hide-shift"},"[6]":{variants:"6",latex:"6",label:"6",shift:"#@^6",class:"hide-shift"},"[7]":{variants:"7",latex:"7",label:"7",shift:"#@^7",class:"hide-shift"},"[8]":{variants:"8",latex:"8",label:"8",shift:"#@^8",class:"hide-shift"},"[9]":{variants:"9",latex:"9",label:"9",shift:"#@^9",class:"hide-shift"},"[separator-5]":{class:"separator",width:.5},"[separator]":{class:"separator"},"[separator-10]":{class:"separator"},"[separator-15]":{class:"separator",width:1.5},"[separator-20]":{class:"separator",width:2},"[separator-50]":{class:"separator",width:5},"[shift]":{class:"shift bottom left",width:1.5,label:"<span class=caps-lock-indicator></span><svg class=svg-glyph><use xlink:href=#svg-shift /></svg>"},"[foreground-color]":{variants:"foreground-color",command:["applyStyle",{color:"red"}],label:"<span style='border-radius: 50%;width:22px;height:22px; border: 3px solid #cc2428; box-sizing: border-box'>"},"[background-color]":{variants:"background-color",command:["applyStyle",{backgroundColor:"yellow"}],label:"<span style='border-radius: 50%;width:22px;height:22px; background:#fff590; box-sizing: border-box'></span>"}};function kh(e){var t;if(typeof e=="string"){if(e==="[.]"&&window.MathfieldElement.decimalSeparator===","&&(e="[,]"),!xo[e])return{latex:e};e={label:e}}let r;return"label"in e&&e.label&&xo[e.label]&&(r=i(F(F({},xo[e.label]),e),{label:xo[e.label].label})),"key"in e&&e.key&&xo[e.key]&&(r=i(F(F({},xo[e.key]),e),{key:xo[e.key].key})),r?(r.command==="insertDecimalSeparator"&&(r.label=(t=window.MathfieldElement.decimalSeparator)!=null?t:"."),e.label==="[action]"&&(r=F(F({},r),window.mathVirtualKeyboard.actionKeycap)),e.label==="[shift]"&&(r=F(F({},r),window.mathVirtualKeyboard.shiftKeycap)),e.label==="[backspace]"&&(r=F(F({},r),window.mathVirtualKeyboard.backspaceKeycap)),e.label==="[tab]"&&(r=F(F({},r),window.mathVirtualKeyboard.tabKeycap)),r):e}var Ol;function Pm(e){var t;if(e.button!==0)return;const r=Gs.singleton;if(!r)return;let n=e.target;for(;n&&!n.getAttribute("data-layer");)n=n.parentElement;if(n){r.currentLayer=(t=n.getAttribute("data-layer"))!=null?t:"",e.preventDefault();return}const a=Jo(e.target);if(!(a!=null&&a.id))return;const o=r.getKeycap(a.id);if(!o)return;console.assert(e.type==="pointerdown");const _=new AbortController,N=_.signal;a.classList.add("is-pressed"),a.addEventListener("pointerenter",Fu(_),{capture:!0,signal:N}),a.addEventListener("pointerleave",Fu(_),{capture:!0,signal:N}),a.addEventListener("pointercancel",Fu(_),{signal:N}),a.addEventListener("pointerup",Fu(_),{signal:N}),Qo(o)&&(a.classList.add("is-active"),r.shiftPressCount++),o.variants&&(Ol&&clearTimeout(Ol),Ol=setTimeout(()=>{a.classList.contains("is-pressed")&&(a.classList.remove("is-pressed"),a.classList.add("is-active"),e.target&&"releasePointerCapture"in e.target&&e.target.releasePointerCapture(e.pointerId),Th(a,()=>{_.abort(),a==null||a.classList.remove("is-active")}))},300)),e.preventDefault()}function Fu(e){return t=>{const r=Jo(t.target);if(!(r!=null&&r.id))return;const n=Gs.singleton;if(!n)return;const a=n.getKeycap(r.id);if(a){if(t.type==="pointerenter"&&t.target===r&&t.isPrimary&&r.classList.add("is-pressed"),t.type==="pointercancel"){r.classList.remove("is-pressed"),Qo(a)&&(n.shiftPressCount--,r.classList.toggle("is-active",n.isShifted)),e.abort();return}if(t.type==="pointerleave"&&t.target===r){r.classList.remove("is-pressed"),Qo(a)&&(n.shiftPressCount--,r.classList.toggle("is-active",n.isShifted));return}if(t.type==="pointerup"){Ol&&clearTimeout(Ol),Qo(a)?r.classList.toggle("is-active",n.isShifted):r.classList.contains("is-pressed")&&(r.classList.remove("is-pressed"),n.isShifted&&a.shift?typeof a.shift=="string"?n.executeCommand(["insert",a.shift,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]):Cc(a.shift):Cc(a),n.shiftPressCount===1&&!t.shiftKey&&(n.shiftPressCount=0)),e.abort(),t.preventDefault();return}}}}function Cc(e){var t;let r=e.command;!r&&e.insert&&(r=["insert",e.insert,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]),!r&&e.key&&(r=["typedText",e.key,{focus:!0,feedback:!0,simulateKeystroke:!0}]),!r&&e.latex&&(r=["insert",e.latex,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]),r||(r=["typedText",e.label,{focus:!0,feedback:!0,simulateKeystroke:!0}]),(t=Gs.singleton)==null||t.executeCommand(r)}function Im(e){if(e.nodeType!==1)return!1;const t=e.classList;return t.contains("MLK__keycap")||t.contains("shift")||t.contains("action")||t.contains("fnbutton")||t.contains("bigfnbutton")}function Jo(e){if(!e)return;let t=e;for(;t&&!Im(t);)t=t.parentElement;return t!=null?t:void 0}function Qo(e){return!!e.class&&/(^|\s)shift($|\s)/.test(e.class)}var Gs=class i0{constructor(){this.originalContainerBottomPadding=null,this.keycapRegistry={},this._shiftPressCount=0;var t,r,n;this.targetOrigin=window.origin,this.originValidator="none",this._alphabeticLayout="auto",this._layouts=Object.freeze(["default"]),this._editToolbar="default",this._container=(r=(t=window.document)==null?void 0:t.body)!=null?r:null,this._visible=!1,this._rebuilding=!1,this.observer=new ResizeObserver(a=>{this.adjustBoundingRect(),this.dispatchEvent(new Event("geometrychange")),this.sendMessage("geometry-changed",{boundingRect:this.boundingRect})}),this.listeners={};try{(n=window.top)==null||n.addEventListener("message",this)}catch(a){window.addEventListener("message",this)}document.body.addEventListener("focusin",a=>{const o=a.target;o!=null&&o.isConnected&&setTimeout(()=>{const _=Ch();_&&!_.readOnly&&_.mathVirtualKeyboardPolicy==="auto"&&w()&&this.show({animate:!0})},300)}),document.addEventListener("focusout",a=>{a.target.mathVirtualKeyboardPolicy!=="manual"&&setTimeout(()=>{Ch()||this.hide()},300)})}get currentLayer(){var t,r,n;return(n=(r=(t=this._element)==null?void 0:t.querySelector(".MLK__layer.is-visible"))==null?void 0:r.id)!=null?n:""}set currentLayer(t){var r;if(!this._element){this.latentLayer=t;return}let n=t?this._element.querySelector(`#${t}.MLK__layer`):null;n||(n=this._element.querySelector(".MLK__layer")),n&&((r=this._element.querySelector(".MLK__layer.is-visible"))==null||r.classList.remove("is-visible"),n.classList.add("is-visible")),this.render()}get shiftPressCount(){return this._shiftPressCount}set shiftPressCount(t){var r;this._shiftPressCount=t>2||t<0?0:t,(r=this._element)==null||r.classList.toggle("is-caps-lock",this.shiftPressCount===2),this.render()}get isShifted(){return this._shiftPressCount>0}resetKeycapRegistry(){this.keycapRegistry={}}registerKeycap(t){const r="ML__k"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);return this.keycapRegistry[r]=t,r}getKeycap(t){return t?this.keycapRegistry[t]:void 0}getLayer(t){const r=this.normalizedLayouts;for(const n of r)for(const a of n.layers)if(a.id===t)return a}get alphabeticLayout(){return this._alphabeticLayout}set alphabeticLayout(t){this._alphabeticLayout=t,this.rebuild()}get actionKeycap(){return this._actionKeycap}set actionKeycap(t){this._actionKeycap=typeof t=="string"?{label:t}:t}get shiftKeycap(){return this._shiftKeycap}set shiftKeycap(t){this._shiftKeycap=typeof t=="string"?{label:t}:t}get backspaceKeycap(){return this._backspaceKeycap}set backspaceKeycap(t){this._backspaceKeycap=typeof t=="string"?{label:t}:t}get tabKeycap(){return this._tabKeycap}set tabKeycap(t){this._tabKeycap=typeof t=="string"?{label:t}:t}get layouts(){return this._layouts}set layouts(t){this.updateNormalizedLayouts(t),this.rebuild()}updateNormalizedLayouts(t){const r=Array.isArray(t)?[...t]:[t],n=r.findIndex(a=>a==="default");n>=0&&r.splice(n,1,"numeric","symbols","alphabetic","greek"),this._layouts=Object.freeze(r),this._normalizedLayouts=r.map(a=>Ah(a))}get normalizedLayouts(){return this._normalizedLayouts||this.updateNormalizedLayouts(this._layouts),this._normalizedLayouts}get editToolbar(){return this._editToolbar}set editToolbar(t){this._editToolbar=t,this.rebuild()}get container(){return this._container}set container(t){this._container=t,this.rebuild()}static get singleton(){if(this._singleton===void 0)try{this._singleton=new i0}catch(t){this._singleton=null}return this._singleton}get style(){return this._style}addEventListener(t,r,n){this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].has(r)||this.listeners[t].add(r)}dispatchEvent(t){return!this.listeners[t.type]||this.listeners[t.type].size===0?!0:(this.listeners[t.type].forEach(r=>{typeof r=="function"?r(t):r==null||r.handleEvent(t)}),!t.defaultPrevented)}removeEventListener(t,r,n){this.listeners[t]&&this.listeners[t].delete(r)}get element(){return this._element}set element(t){var r;this._element!==t&&((r=this._element)==null||r.remove(),this._element=t)}get visible(){return this._visible}set visible(t){t?this.show():this.hide()}get boundingRect(){var t;if(!this._visible)return new DOMRect;const r=(t=this._element)==null?void 0:t.getElementsByClassName("MLK__plate")[0];return r?r.getBoundingClientRect():new DOMRect}adjustBoundingRect(){var t,r;const n=this.boundingRect.height;if(this.container===document.body){(t=this._element)==null||t.style.setProperty("--_keyboard-height",`calc(${n}px + var(--_padding-top) + var(--_padding-bottom) + env(safe-area-inset-bottom, 0))`);const a=n-1;this.container.style.paddingBottom=this.originalContainerBottomPadding?`calc(${this.originalContainerBottomPadding} + ${a}px)`:`${a}px`}else(r=this._element)==null||r.style.setProperty("--_keyboard-height",`${n}px`)}rebuild(){if(this._rebuilding||!this._element)return;this._rebuilding=!0;const t=this.currentLayer;requestAnimationFrame(()=>{this._rebuilding=!1,this._element&&(this._element.remove(),this._element=void 0),this.visible&&(this.buildAndAttachElement(),this.currentLayer=t,this.render(),this.adjustBoundingRect(),this._element.classList.add("is-visible"))})}render(){if(!this._element)return;const t=this.getLayer(this.currentLayer);this._element.classList.toggle("backdrop-is-transparent",!!(t&&(t.backdrop||t.container)));const r=this._element.querySelectorAll(".MLK__layer.is-visible .MLK__keycap, .MLK__layer.is-visible .action, .fnbutton, .MLK__layer.is-visible .bigfnbutton, .MLK__layer.is-visible .shift");if(r)for(const n of r){const a=this.getKeycap(n.id);if(a){const[o,_]=Ou(a,{shifted:this.isShifted});n.innerHTML=window.MathfieldElement.createHTML(o),n.className=_}}}show(t){var r;if(this._visible)return;const n=this.container;if(n&&window.mathVirtualKeyboard&&this.stateWillChange(!0)){if(this._element||(this.buildAndAttachElement(),this.adjustBoundingRect()),!this._visible){const a=this._element.getElementsByClassName("MLK__plate")[0];if(a&&this.observer.observe(a),n===window.document.body){const o=n.style.paddingBottom;this.originalContainerBottomPadding=o;const _=a.offsetHeight-1;n.style.paddingBottom=o?`calc(${o} + ${_}px)`:`${_}px`}window.addEventListener("mouseup",this),window.addEventListener("blur",this),window.addEventListener("keydown",this,{capture:!0}),window.addEventListener("keyup",this,{capture:!0}),(r=this._element)==null||r.classList.toggle("is-caps-lock",this.shiftPressCount===2),this.currentLayer=this.latentLayer}this._visible=!0,t!=null&&t.animate?requestAnimationFrame(()=>{this._element&&(this._element.classList.add("animate"),this._element.addEventListener("transitionend",()=>{var a;return(a=this._element)==null?void 0:a.classList.remove("animate")},{once:!0}),this._element.classList.add("is-visible"),this.stateChanged())}):(this._element.classList.add("is-visible"),this.stateChanged())}}hide(t){var r;const n=this.container;if(n&&this._visible&&this.stateWillChange(!1)){if(this._visible=!1,this._element){this.latentLayer=this.currentLayer;const a=this._element.getElementsByClassName("MLK__plate")[0];a&&this.observer.unobserve(a),window.removeEventListener("mouseup",this),window.removeEventListener("blur",this),window.removeEventListener("keydown",this,{capture:!0}),window.removeEventListener("keyup",this,{capture:!0}),window.removeEventListener("contextmenu",this,{capture:!0}),Rl(),Am(),(r=this._element)==null||r.remove(),this._element=void 0,this.originalContainerBottomPadding!==null&&(n.style.paddingBottom=this.originalContainerBottomPadding)}this.stateChanged()}}get height(){var t,r;return(r=(t=this.element)==null?void 0:t.offsetHeight)!=null?r:0}buildAndAttachElement(){var t;console.assert(!this.element),this.element=Cm(this),window.addEventListener("contextmenu",this,{capture:!0}),this.element.addEventListener("contextmenu",r=>{r.shiftKey||((r.ctrlKey||r.button===2)&&Th(r.target),r.preventDefault(),r.stopPropagation())},{capture:!0}),(t=this.container)==null||t.appendChild(this.element)}handleEvent(t){if(kc(t)){if(!gc(t.origin,this.originValidator))throw new DOMException(`Message from unknown origin (${t.origin}) cannot be handled`,"SecurityError");t.data.action==="disconnect"?this.connectedMathfieldWindow=void 0:t.data.action!=="update-setting"&&t.data.action!=="proxy-created"&&t.data.action!=="execute-command"&&(console.assert(t.source!==void 0),this.connectedMathfieldWindow=t.source),this.handleMessage(t.data,t.source)}if(this._element)switch(t.type){case"mouseup":case"blur":document.body.style.userSelect="",this.shiftPressCount=0;break;case"contextmenu":t.button!==2&&t.preventDefault();break;case"keydown":{t.key==="Shift"&&!t.repeat&&(this.shiftPressCount=1);break}case"keyup":{(t.key==="Shift"||!t.getModifierState("Shift")&&this.shiftPressCount!==2)&&(this.shiftPressCount=0);break}}}handleMessage(t,r){const{action:n}=t;if(n==="execute-command"){const{command:a}=t,o=qo(a);if(window.top!==void 0&&o!=="virtual-keyboard")return;this.executeCommand(a);return}if((n==="connect"||n==="show")&&this.sendMessage("synchronize-proxy",{boundingRect:this.boundingRect,alphabeticLayout:this._alphabeticLayout,layouts:this._layouts,editToolbar:this._editToolbar},r),n!=="disconnect"&&window===window.top){if(n==="show"){typeof t.animate!="undefined"?this.show({animate:t.animate}):this.show();return}if(n==="hide"){typeof t.animate!="undefined"?this.hide({animate:t.animate}):this.hide();return}if(n==="update-setting"){t.alphabeticLayout&&(this.alphabeticLayout=t.alphabeticLayout),t.layouts&&(this.layouts=t.layouts),t.editToolbar&&(this.editToolbar=t.editToolbar);return}if(n==="proxy-created"){this.sendMessage("synchronize-proxy",{boundingRect:this.boundingRect,alphabeticLayout:this._alphabeticLayout,layouts:this._layouts,editToolbar:this._editToolbar},r);return}}}sendMessage(t,r,n){if(n||(n=this.connectedMathfieldWindow),this.targetOrigin===null||this.targetOrigin==="null"||n===window){window.dispatchEvent(new MessageEvent("message",{source:window,data:F({type:Pu,action:t},r)}));return}if(n)n.postMessage(F({type:Pu,action:t},r),{targetOrigin:this.targetOrigin});else if(r.command&&this.dispatchEvent(new CustomEvent("math-virtual-keyboard-command",{detail:r.command})),t==="execute-command"&&Array.isArray(r.command)&&r.command[0]==="insert"){const a=r.command[1].split("");for(const o of a)this.dispatchEvent(new KeyboardEvent("keydown",{key:o,bubbles:!0})),this.dispatchEvent(new KeyboardEvent("keyup",{key:o,bubbles:!0}))}}stateWillChange(t){return this.dispatchEvent(new CustomEvent("before-virtual-keyboard-toggle",{detail:{visible:t},bubbles:!0,cancelable:!0,composed:!0}))}stateChanged(){this.dispatchEvent(new Event("virtual-keyboard-toggle")),this._visible||(this.dispatchEvent(new Event("geometrychange")),this.sendMessage("geometry-changed",{boundingRect:this.boundingRect}))}focus(){this.sendMessage("focus",{})}blur(){this.sendMessage("blur",{})}updateToolbar(t){const r=this._element;if(!r)return;r.classList.toggle("is-math-mode",t.mode==="math"),r.classList.toggle("is-text-mode",t.mode==="text"),r.classList.toggle("can-undo",t.canUndo),r.classList.toggle("can-redo",t.canRedo),r.classList.toggle("can-copy",!t.selectionIsCollapsed),r.classList.toggle("can-copy",!t.selectionIsCollapsed),r.classList.toggle("can-paste",!0);const n=r.querySelectorAll(".ML__edit-toolbar");if(n)for(const a of n)a.innerHTML=Sm(this,t)}update(t){this._style=t.style,this.updateToolbar(t)}connect(){this.connectedMathfieldWindow=window}disconnect(){this.connectedMathfieldWindow=void 0}executeCommand(t){let r,n=[],a=qo(t);return v(t)?(r=t[0],r==="performWithFeedback"&&(t=t.slice(1),a=qo(t)),n=t.slice(1)):r=t,r=r.replace(/-\w/g,o=>o[1].toUpperCase()),a==="virtual-keyboard"?ps[r].fn(void 0,...n):(this.sendMessage("execute-command",{command:t}),!1)}dispose(){window.removeEventListener("mouseup",this),window.removeEventListener("blur",this),window.removeEventListener("message",this)}};function Ch(){var e,t;let r=Tu(),n=null;for(;r;){if("host"in r&&((t=(e=r.host)==null?void 0:e.tagName)==null?void 0:t.toLowerCase())==="math-field"){n=r.host;break}r=r.parentNode}return n}if(b()&&!("mathVirtualKeyboard"in window))if(window===window.top){const e=Gs.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>e})}else Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>gm.singleton,configurable:!0});function Bu(e){const t={};for(const r of Object.keys(e))switch(r){case"scriptDepth":const n=e.scriptDepth;if(v(n))t.scriptDepth=[n[0],n[1]];else if(typeof n=="number")t.scriptDepth=[n,n];else if(typeof n=="string"){const[o,_]=n.split(",").map(N=>parseInt(N.trim()));t.scriptDepth=[o,_]}else throw new TypeError("Unexpected value for scriptDepth");break;case"mathVirtualKeyboardPolicy":let a=e.mathVirtualKeyboardPolicy.toLowerCase();if(a==="sandboxed"){if(window!==window.top){const o=Gs.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>o})}a="manual"}t.mathVirtualKeyboardPolicy=a;break;case"letterShapeStyle":e.letterShapeStyle==="auto"?f.locale.startsWith("fr")?t.letterShapeStyle="french":t.letterShapeStyle="tex":t.letterShapeStyle=e.letterShapeStyle;break;case"defaultMode":["text","math","inline-math"].includes(e.defaultMode)?t.defaultMode=e.defaultMode:(console.error('MathLive 0.98.5: valid values for defaultMode are "text", "math" or "inline-math"'),t.defaultMode="math");break;case"macros":t.macros=Ze(e.macros);break;default:v(e[r])?t[r]=[...e[r]]:typeof e[r]=="object"&&!(e[r]instanceof Element)&&r!=="computeEngine"?t[r]=F({},e[r]):t[r]=e[r]}return t}function Eo(e,t){let r;typeof t=="string"?r=[t]:t===void 0?r=Object.keys(e):r=t;const n={};for(const a of r)e[a]===null?n[a]=null:v(e[a])?n[a]=[...e[a]]:typeof e[a]=="object"&&!(e[a]instanceof Element)&&a!=="computeEngine"?n[a]=F({},e[a]):n[a]=e[a];return typeof t=="string"?n[t]:n}function Nu(){return{readOnly:!1,defaultMode:"math",macros:{},registers:{},colorMap:C,backgroundColorMap:P,letterShapeStyle:f.locale.startsWith("fr")?"french":"tex",minFontScale:0,smartMode:!1,smartFence:!0,smartSuperscript:!0,scriptDepth:[1/0,1/0],removeExtraneousParentheses:!0,isImplicitFunction:e=>["\\sin","\\cos","\\tan","\\arcsin","\\arccos","\\arctan","\\arcsec","\\arccsc","\\arsinh","\\arcosh","\\artanh","\\arcsech","\\arccsch","\\arg","\\ch","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\sec","\\sinh","\\sh","\\tanh","\\tg","\\th","\\lg","\\lb","\\log","\\ln"].includes(e),mathModeSpace:"",placeholderSymbol:"\u25A2",contentPlaceholder:"",popoverPolicy:"auto",environmentPopoverPolicy:"off",keybindings:F0,inlineShortcuts:Of,inlineShortcutTimeout:0,mathVirtualKeyboardPolicy:"auto",virtualKeyboardTargetOrigin:window==null?void 0:window.origin,originValidator:"none",onInlineShortcut:()=>"",onScrollIntoView:null,onExport:O0,value:""}}function Lh(e){return e.defaultMode==="inline-math"?"math":e.defaultMode}function Zs(e,t){!e||!t||(v(e)?e.forEach(r=>Zs(r,t)):typeof e=="object"&&!e.style.color&&!e.style.backgroundColor&&!e.style.fontFamily&&!e.style.fontShape&&!e.style.fontSeries&&!e.style.fontSize&&!e.style.variant&&!e.style.variantStyle&&(e.applyStyle(t),Zs(e.body,t),Zs(e.above,t),Zs(e.below,t),Zs(e.subscript,t),Zs(e.superscript,t)))}function Lc(e,t,r,n){function a(_,N){for(const z of o)if(z.style[_]!==N)return!1;return!0}if(t=e.normalizeRange(t),t[0]===t[1])return!1;const o=e.getAtoms(t,{includeChildren:!0});n.operation==="toggle"&&(r.color&&a("color",r.color)&&(r.color="none",delete r.verbatimColor),r.backgroundColor&&a("backgroundColor",r.backgroundColor)&&(r.backgroundColor="none",delete r.verbatimBackgroundColor),r.fontFamily&&a("fontFamily",r.fontFamily)&&(r.fontFamily="none"),r.fontSeries&&a("fontSeries",r.fontSeries)&&(r.fontSeries="auto"),r.fontShape&&a("fontShape",r.fontShape)&&(r.fontShape="auto"),r.fontSize&&a("fontSize",r.fontSize)&&(r.fontSize=sc),r.variant&&a("variant",r.variant)&&(r.variant="normal"),r.variantStyle&&a("variantStyle",r.variantStyle)&&(r.variantStyle=""));for(const _ of o)_.applyStyle(r);return!0}function Om(e,t){const r=e.at(e.position);if(r.type==="composition")r.value=t;else{const{caret:n}=r;r.caret=void 0;const a=new qf(t,{mode:r.mode});a.caret=n,r.parent.addChildAfter(a,r),e.position+=1}}function Fm(e){const t=e.at(e.position);t.type==="composition"&&(t.parent.removeChild(t),e.position-=1)}Ut(["math","displaymath"],$a),Ut("center",$a),ke("displaylines","",{parse:e=>{const t=[];let r=[];e.beginContext({tabular:!0});do{if(e.end()||e.match("<}>"))break;e.matchColumnSeparator()||e.matchRowSeparator()?(t.push([r]),r=[]):r.push(...e.scan(n=>["<}>","&","\\cr","\\\\","\\tabularnewline"].includes(n)))}while(!0);return e.endContext(),t.push([r]),t},createAtom:e=>new gn("lines",e.args,[],{leftDelim:".",rightDelim:".",columns:[{align:"l"}]})}),bt("array","{columns:colspec}",(e,t,r,n)=>new gn(e,Rc(t),r,{columns:n[0],mathstyleName:"textstyle"})),bt(["equation","equation*","subequations"],"",(e,t,r)=>new gn(e,Rc(t),r,{columns:[{align:"c"}]})),bt(["multline","multline*"],"",$a),bt(["align","align*","aligned","eqnarray"],"",$a),bt("split","",$a),bt(["gather","gathered"],"",$a),bt(["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],"[columns:colspec]",$a),bt(["smallmatrix","smallmatrix*"],"[columns:colspec]",$a),bt(["cases","dcases","rcases"],"",$a);function Bm(e){for(const t of e)for(const r of t)if(r.length>0)return!1;return!0}function Rc(e,t=1){return Bm(e)?Array(t).fill([[new Qe({type:"first"}),new Ls]]):e.map(r=>r.length===0?[[new Qe({type:"first"})]]:r.map(n=>n.length===0?[new Qe({type:"first"})]:(n[0].type!=="first"&&n.unshift(new Qe({type:"first"})),n)))}function $a(e,t=[[[]]],r=[],n=[]){switch(t=Rc(t,["split","align","align*","aligned","eqnarray"].includes(e)?2:1),e){case"math":return new gn(e,t,r,{mathstyleName:"textstyle"});case"displaymath":return new gn(e,t,r,{mathstyleName:"textstyle"});case"center":return new gn(e,t,r,{columns:[{align:"c"}]});case"multline":case"multline*":return new gn(e,t,r,{columns:[{align:"m"}],leftDelim:".",rightDelim:"."});case"split":return new gn(e,t,r,{columns:[{align:"r"},{align:"l"}],minColumns:2});case"gather":case"gathered":return new gn(e,t,r,{columns:[{gap:.25},{align:"c"},{gap:0}]});case"pmatrix":case"pmatrix*":return new gn(e,t,r,{mathstyleName:"textstyle",leftDelim:"(",rightDelim:")",columns:wo(n[0])});case"bmatrix":case"bmatrix*":return new gn(e,t,r,{mathstyleName:"textstyle",leftDelim:"[",rightDelim:"]",columns:wo(n[0])});case"Bmatrix":case"Bmatrix*":return new gn(e,t,r,{mathstyleName:"textstyle",leftDelim:"\\lbrace",rightDelim:"\\rbrace",columns:wo(n[0])});case"vmatrix":case"vmatrix*":return new gn(e,t,r,{mathstyleName:"textstyle",leftDelim:"\\vert",rightDelim:"\\vert",columns:wo(n[0])});case"Vmatrix":case"Vmatrix*":return new gn(e,t,r,{mathstyleName:"textstyle",leftDelim:"\\Vert",rightDelim:"\\Vert",columns:wo(n[0])});case"matrix":case"matrix*":return new gn(e,t,r,{mathstyleName:"textstyle",leftDelim:".",rightDelim:".",columns:wo(n==null?void 0:n[0])});case"smallmatrix":case"smallmatrix*":return new gn(e,t,r,{mathstyleName:"scriptstyle",columns:wo(n==null?void 0:n[0]),colSeparationType:"small",arraystretch:.5});case"cases":case"dcases":return new gn(e,t,r,{mathstyleName:e==="dcases"?"displaystyle":"textstyle",arraystretch:1.2,leftDelim:"\\lbrace",rightDelim:".",columns:[{align:"l"},{gap:1},{align:"l"}]});case"rcases":return new gn(e,t,r,{arraystretch:1.2,leftDelim:".",rightDelim:"\\rbrace",columns:[{align:"l"},{gap:1},{align:"l"}]});case"lines":return new gn(e,t,r,{leftDelim:".",rightDelim:".",columns:[{align:"l"}]});case"align":case"align*":case"aligned":case"eqnarray":{let a=0;for(const N of t)a=Math.max(a,N.length);const o=[{gap:0},{align:"r"},{gap:.25},{align:"l"}];let _=2;for(;_<a;)o.push({gap:1},{align:"r"},{gap:.25},{align:"l"}),_+=2;return o.push({gap:0}),new gn(e,t,r,{arraycolsep:0,columns:o,minColumns:2})}}return new gn(e,t,r,{mathstyleName:"textstyle"})}function wo(e){return e!=null?e:[{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"}]}function Nm(e,t){let r=e.at(e.position);for(;r&&!(r.parent instanceof gn);)r=r.parent;if(r&&r.type==="array"&&r.environmentName,!r||!(r.parent instanceof gn)){const n=e.at(e.position);if(r=n,!r.parent.parent){let a=e.extractAtoms([e.position,e.lastOffset]),o=e.extractAtoms([0,e.position]);o.length===0&&(o=zu()),a.length===0&&(a=zu());let _;return t.endsWith("column")?(_=$a("split",[[o,a]]),e.root=_,So(_,0,0)?Mo(e,_,0,0):So(_,0,1)?Mo(e,_,0,1):e.position=e.offsetOf(n)):(_=$a("lines",[[o],[a]]),e.root=_,So(_,0,0)?Mo(e,_,0,0):So(_,1,0)?Mo(e,_,1,0):e.position=e.offsetOf(n)),[void 0,[0,0]]}if(r.parent instanceof si){const a=r.parent;let o=e.extractAtoms([e.position,e.offsetOf(a.lastChild)]),_=e.extractAtoms([e.offsetOf(a.firstChild),e.position]);_.length===0&&(_=zu()),o.length===0&&(o=zu());let N="pmatrix";const z=a.leftDelim,W=a.rightDelim;z==="("&&(W===")"||W==="?")?N="pmatrix":(z==="["||z==="\\lbrack")&&(W==="]"||W==="\\rbrack"||W==="?")?N="bmatrix":z==="\\vert"&&W==="\\vert"?N="vmatrix":z==="\\Vert"&&W==="\\Vert"?N="Vmatrix":(z==="{"||z==="\\lbrace")&&(W==="."||W==="?")&&(N="cases");const j=$a(N,t.endsWith("column")?[[_,o]]:[[_],[o]]);return a.parent.addChildBefore(j,a),a.parent.removeChild(a),So(j,0,0)?Mo(e,j,0,0):t.endsWith("column")?So(j,0,1)?Mo(e,j,0,1):e.position=e.offsetOf(r):So(j,1,0)?Mo(e,j,1,0):e.position=e.offsetOf(r),[void 0,[0,0]]}}return r&&r.parent instanceof gn?[r.parent,r.parentBranch]:[void 0,[0,0]]}function So(e,t,r){const n=e.getCell(t,r);return!n||n.length!==2?!1:n[1].type==="placeholder"}function Km(e,t,r,n){const a=t.getCell(r,n);return a?[e.offsetOf(a[0]),e.offsetOf(a[a.length-1])]:-1}function Mo(e,t,r,n){const a=Km(e,t,r,n);typeof a!="number"&&e.setSelection(a)}function Ku(e,t,r,n,a){const o=t.getCell(r,n);o&&e.setPositionHandlingPlaceholder(e.offsetOf(o[a==="start"?0:o.length-1]))}function Uu(e,t){const[r,[n,a]]=Nm(e,t);if(r)switch(t){case"after row":r.addRowAfter(n),Ku(e,r,n+1,0,"end");break;case"after column":if(r.maxColumns<=r.colCount){e.announce("plonk");return}r.addColumnAfter(a),Ku(e,r,n,a+1,"end");break;case"before row":r.addRowBefore(n),Ku(e,r,n,0,"start");break;case"before column":if(r.maxColumns<=r.colCount){e.announce("plonk");return}r.addColumnBefore(a),Ku(e,r,n,a,"start");break}}function Rh(e){return e.contentWillChange({inputType:"insertText"})?(Uu(e,"after row"),e.contentDidChange({inputType:"insertText"}),!0):!1}function Um(e){return e.contentWillChange({inputType:"insertText"})?(Uu(e,"before row"),e.contentDidChange({inputType:"insertText"}),!0):!1}function Ph(e){return e.contentWillChange({inputType:"insertText"})?(Uu(e,"after column"),e.contentDidChange({inputType:"insertText"}),!0):!1}function zm(e){return e.contentWillChange({inputType:"insertText"})?(Uu(e,"before column"),e.contentDidChange({inputType:"insertText"}),!0):!1}function Ih(e,t){if(!e.contentWillChange({}))return!1;e.mathfield.snapshot();let r=".",n=".";switch(t){case"pmatrix":case"pmatrix*":r="(",n=")";break;case"bmatrix":case"bmatrix*":r="[",n="]";break;case"Bmatrix":case"Bmatrix*":r="\\lbrace",n="\\rbrace";break;case"vmatrix":case"vmatrix*":r="\\vert",n="\\vert";break;case"Vmatrix":case"Vmatrix*":r="\\Vert",n="\\Vert";break;case"matrix":case"matrix*":r=".",n=".";break;case"cases":case"dcases":r="\\lbrace";break;case"rcases":n="\\rbrace";break}const a=e.at(e.position),o=a.type==="array"?a:e.parentEnvironment;return o.environmentName=t,o.leftDelim=r,o.rightDelim=n,e.contentDidChange({}),!0}function Oh(e,t){let r=e.at(e.position);for(;r&&!(Array.isArray(r.parentBranch)&&r.parent instanceof gn);)r=r.parent;if(Array.isArray(r==null?void 0:r.parentBranch)&&(r==null?void 0:r.parent)instanceof gn){const n=r.parent,a=r.parentBranch;let o;switch(t){case"row":if(n.rowCount>1){n.removeRow(a[0]);const _=n.getCell(Math.max(0,a[0]-1),a[1]);o=e.offsetOf(_[_.length-1])}break;case"column":if(n.colCount>n.minColumns){n.removeColumn(a[1]);const _=n.getCell(a[0],Math.max(0,a[1]-1));o=e.offsetOf(_[_.length-1])}break}o&&e.setPositionHandlingPlaceholder(o)}}function $m(e){return e.contentWillChange({inputType:"deleteContent"})?(Oh(e,"row"),e.contentDidChange({inputType:"deleteContent"}),!0):!1}function Wm(e){return e.contentWillChange({inputType:"deleteContent"})?(Oh(e,"column"),e.contentDidChange({inputType:"deleteContent"}),!0):!1}_a({addRowAfter:Rh,addColumnAfter:Ph,addRowBefore:Um,addColumnBefore:zm,removeRow:$m,removeColumn:Wm,setEnvironment:Ih},{target:"model",canUndo:!0,changeContent:!0,changeSelection:!0});function zu(){return[new Ls]}var Fh=class a0{constructor(t){this.recording=!1,this.model=t,this.reset()}reset(){this.stack=[],this.index=-1,this.lastOp=""}startRecording(){this.recording=!0}stopRecording(){this.recording=!1}canUndo(){return this.index-1>=0}canRedo(){return this.stack.length-1>this.index}stopCoalescing(t){t&&this.index>=0&&(this.stack[this.index].selection=t),this.lastOp=""}undo(){return this.canUndo()?(this.model.setState(this.stack[this.index-1],{silenceNotifications:!1,type:"undo"}),this.index-=1,this.lastOp="",!0):!1}redo(){return this.canRedo()?(this.index+=1,this.model.setState(this.stack[this.index],{silenceNotifications:!1,type:"redo"}),this.lastOp="",!0):!1}pop(){this.canUndo()&&(this.stack.splice(this.index,this.stack.length-this.index),this.index-=1)}snapshot(t){return this.recording?(t&&t===this.lastOp&&this.pop(),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push(this.model.getState()),this.index+=1,this.stack.length>a0.maximumDepth&&(this.stack.shift(),this.index-=1),this.lastOp=t!=null?t:"",!0):!1}};Fh.maximumDepth=1e3;var Vm=Fh;function Pc(e,t,r){if(e.at(t).mode!=="text")return t;const n=r==="backward"?-1:1;let a;if(ht.test(e.at(t).value)){let o=t,_;do _=e.at(o).mode==="text"&&ht.test(e.at(o).value),o+=n;while(e.at(o)&&_);a=e.at(o)?o-2*n:o-n}else if(/\s/.test(e.at(t).value)){let o=t;for(;e.at(o)&&e.at(o).mode==="text"&&/\s/.test(e.at(o).value);)o+=n;if(!e.at(o))a=o-n;else{let _=!0;do _=e.at(o).mode==="text"&&!/\s/.test(e.at(o).value),o+=n;while(e.at(o)&&_);a=e.at(o)?o-2*n:o-n}}else{let o=t;for(;e.at(o)&&e.at(o).mode==="text"&&!/\s/.test(e.at(o).value);)o+=n;a=e.at(o)?o:o-n;let _=!0;for(;e.at(o)&&_;)_=e.at(o).mode==="text"&&/\s/.test(e.at(o).value),_&&(a=o),o+=n;a=e.at(o)?o-2*n:o-n}return a-(n>0?0:1)}function el(e,t,r){var n,a,o,_,N,z,W;const j=e.position;(n=r==null?void 0:r.extend)!=null&&n||e.collapseSelection(t);let X=e.at(e.position);if(t==="forward"&&(X.type==="subsup"?(X=X.rightSibling,X||(X=e.at(e.position+1))):X=e.at(e.position+1)),!X)return e.announce("plonk"),!1;let ae=e.offsetOf(X);if(X instanceof vl)ae=Pc(e,ae,t);else if(X instanceof Ni)if(X.isSuggestion)for(console.assert(t==="forward");X&&X instanceof Ni;)X.isSuggestion=!1,ae=e.offsetOf(X),X=X.rightSibling;else if(t==="forward"){if(X=X.rightSibling,!X||!(X instanceof Ni))return e.announce("plonk"),!1;for(;X&&X instanceof Ni&&/[a-zA-Z\*]/.test(X.value);)ae=e.offsetOf(X),X=X.rightSibling}else{if(X=X.leftSibling,!X||!(X instanceof Ni))return e.announce("plonk"),!1;for(;X&&X instanceof Ni&&/[a-zA-Z\*]/.test(X.value);)ae=e.offsetOf(X),X=X.leftSibling}else if(t==="forward"&&X.type==="mopen"){let he=0;do X.type==="mopen"?he+=1:X.type==="mclose"&&(he-=1),X=X.rightSibling;while(!X.isLastSibling&&he!==0);ae=e.offsetOf(X.leftSibling)}else if(t==="backward"&&X.type==="mclose"){let he=0;do X.type==="mopen"?he+=1:X.type==="mclose"&&(he-=1),X=X.leftSibling;while(!X.isFirstSibling&&he!==0);ae=e.offsetOf(X)}else if(t==="backward")if(X.type==="first")for(;ae>0&&X.type==="first";)ae-=1,X=e.at(ae);else{const he=X.type;X.type==="subsup"&&(ae=e.offsetOf(e.at(ae).leftSibling)),ae-=1;let _e=(a=e.at(ae))==null?void 0:a.type;for(;ae>=0&&_e===he;)((o=e.at(ae))==null?void 0:o.type)==="subsup"?ae=e.offsetOf(e.at(ae).leftSibling):ae-=1,_e=e.at(ae).type}else{const{type:he}=X;let _e=(_=e.at(ae))==null?void 0:_.type;const{lastOffset:Ue}=e;for(;ae<=Ue&&(_e===he||_e==="subsup");){for(;((N=e.at(ae).rightSibling)==null?void 0:N.type)==="subsup";)ae=e.offsetOf(e.at(ae).rightSibling);ae+=1,_e=(z=e.at(ae))==null?void 0:z.type}ae-=1}if((W=r==null?void 0:r.extend)!=null&&W){if(!e.setSelection(e.anchor,ae))return e.announce("plonk"),!1}else{if(ae===e.position)return e.announce("plonk"),!1;e.position=ae}return e.announce("move",j),e.mathfield.stopCoalescingUndo(),!0}function ms(e,t,r){var n,a;if(r=r!=null?r:{extend:!1},e.mathfield.adoptStyle=t==="backward"?"right":"left",t!=="forward"){const[N,z]=_h(e);N!==void 0&&z!==void 0&&e.deleteAtoms([N,z])}if(t==="upward")return jm(e,r);if(t==="downward")return Gm(e,r);if(r.extend){let N=$u(e,e.position,t);N<0&&(N=0),N>e.lastOffset&&(N=e.lastOffset);const z=e.setSelection(e.anchor,N);return e.mathfield.stopCoalescingUndo(),z}if(e.selectionIsPlaceholder){e.collapseSelection(t);const N=ms(e,t);return e.mathfield.stopCoalescingUndo(),N}let o=e.position;const _=o;if(e.collapseSelection(t)?(o=e.position,Bh(e,o)||(o=$u(e,o,t))):o=$u(e,o,t),o<0||o>e.lastOffset){let N=!0;return e.silenceNotifications||(N=(a=(n=e.mathfield.host)==null?void 0:n.dispatchEvent(new CustomEvent("move-out",{detail:{direction:t},cancelable:!0,bubbles:!0,composed:!0})))!=null?a:!0),N&&e.announce("plonk"),N}return e.setPositionHandlingPlaceholder(o),e.mathfield.stopCoalescingUndo(),e.announce("move",_),!0}function $u(e,t,r){return t=t+(r==="forward"?1:-1),t<0||t>e.lastOffset||Bh(e,t)?t:$u(e,t,r)}function Bh(e,t){var r;const n=e.at(t);let a=n.parent;for(;a&&!a.inCaptureSelection;)a=a.parent;return!(a!=null&&a.inCaptureSelection||(r=n.parent)!=null&&r.skipBoundary&&(!n.isFirstSibling&&n.isLastSibling||n.type==="first")||e.mathfield.hasEditablePrompts&&!n.parentPrompt)}function Hm(e,t,r){let n=1/0,a=0;for(;a<t.length;a++){const o=$f(e.getHTMLElement(t[a])).right,_=Math.abs(r-o);if(_<=n)n=_;else break}return t[a-1]}function Wu(e,t,r,n,a){const o=e.mathfield.hasEditablePrompts,_=o?r.filter(W=>W.type==="prompt"&&!W.captureSelection):r,N=$f(e.mathfield.getHTMLElement(t)).right,z=e.offsetOf(Hm(e.mathfield,_,N))-(o?1:0);if(n){const[W,j]=e.selection.ranges[0];let X;z<(a==="up"?W:j)?X={ranges:[[z,j]],direction:"backward"}:X={ranges:[[W,z]],direction:"forward"},e.setSelection(X)}else e.setPositionHandlingPlaceholder(z);e.announce(`move ${a}`)}function jm(e,t){var r,n;const a=(r=t==null?void 0:t.extend)!=null?r:!1;a||e.collapseSelection("backward");const o=()=>{var z,W;let j=!0;return e.silenceNotifications||(j=(W=(z=e.mathfield.host)==null?void 0:z.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"upward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?W:!0),e.announce(j?"plonk":"line"),j},_=e.at(e.position);let N=_;for(;N&&N.parentBranch!=="below"&&!(Array.isArray(N.parentBranch)&&N.parent instanceof gn);)N=N.parent;if(Array.isArray(N==null?void 0:N.parentBranch)&&N.parent instanceof gn){const z=N.parent;if(N.parentBranch[0]<1)return o();const W=N.parentBranch[0]-1,j=z.array[W][N.parentBranch[1]];if(!j.some(ae=>ae.type==="prompt"&&!ae.captureSelection)&&e.mathfield.hasEditablePrompts)return o();Wu(e,_,j,a,"up")}else if(N){const z=(n=N.parent.branch("above"))!=null?n:N.parent.createBranch("above");if(!z.some(j=>j.type==="prompt"&&j.placeholderId)&&e.mathfield.hasEditablePrompts)return o();Wu(e,_,z,a,"up")}else return o();return e.mathfield.stopCoalescingUndo(),!0}function Gm(e,t){var r,n;const a=(r=t==null?void 0:t.extend)!=null?r:!1;a||e.collapseSelection("forward");const o=()=>{var z,W;let j=!0;return e.silenceNotifications||(j=(W=(z=e.mathfield.host)==null?void 0:z.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"downward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?W:!0),e.announce(j?"plonk":"line"),j},_=e.at(e.position);let N=_;for(;N&&N.parentBranch!=="above"&&!(Array.isArray(N.parentBranch)&&N.parent instanceof gn);)N=N.parent;if(Array.isArray(N==null?void 0:N.parentBranch)&&N.parent instanceof gn){const z=N.parent;if(N.parentBranch[0]+1>z.array.length-1)return o();const W=N.parentBranch[0]+1,j=z.array[W][N.parentBranch[1]];if(!j.some(ae=>ae.type==="prompt"&&!ae.captureSelection)&&e.mathfield.hasEditablePrompts)return o();Wu(e,_,j,a,"down")}else if(N){const z=(n=N.parent.branch("below"))!=null?n:N.parent.createBranch("below");if(!z.some(j=>j.type==="prompt")&&e.mathfield.hasEditablePrompts)return o();Wu(e,_,z,a,"down")}else return o();return!0}function Nh(e){const t=e.position,r=e.at(t).parent;return r!=null&&r.parent?(e.position=e.offsetOf(r),e.mathfield.stopCoalescingUndo(),e.announce("move",t),!0):(e.announce("plonk"),!1)}function Zm(e){let t=0,r=e.at(e.position),n=!1;for(;r;)(!r.hasEmptyBranch("superscript")||!r.hasEmptyBranch("subscript"))&&(t+=1),r.hasEmptyBranch("superscript")?r.hasEmptyBranch("subscript")||(n=!1):n=!0,r=r.parent;return n?t:0}function Ym(e){let t=0,r=e.at(e.position),n=!1;for(;r;)(!r.hasEmptyBranch("superscript")||!r.hasEmptyBranch("subscript"))&&(t+=1),r.hasEmptyBranch("superscript")?r.hasEmptyBranch("subscript")||(n=!0):n=!1,r=r.parent;return n?t:0}function Kh(e){var t;if(e.collapseSelection(),Zm(e)>=e.mathfield.options.scriptDepth[1])return e.announce("plonk"),!1;let r=e.at(e.position);return r.subsupPlacement===void 0&&(((t=r.rightSibling)==null?void 0:t.type)!=="subsup"&&r.parent.addChildAfter(new xu({style:r.computedStyle}),r),r=r.rightSibling),r.createBranch("superscript"),e.setSelection(e.getSiblingsRange(e.offsetOf(r.superscript[0]))),!0}function Uh(e){var t;if(e.collapseSelection(),Ym(e)>=e.mathfield.options.scriptDepth[0])return e.announce("plonk"),!1;let r=e.at(e.position);return r.subsupPlacement===void 0&&(((t=e.at(e.position+1))==null?void 0:t.type)!=="subsup"&&r.parent.addChildAfter(new xu({style:e.at(e.position).computedStyle}),r),r=e.at(e.position+1)),r.createBranch("subscript"),e.setSelection(e.getSiblingsRange(e.offsetOf(r.subscript[0]))),!0}function Xm(){function e(z){const W=[],j=[];return[...z.querySelectorAll(`input, select, textarea, a[href], button,
[tabindex], audio[controls], video[controls],
[contenteditable]:not([contenteditable="false"]), details>summary`)].filter(t).forEach((ae,he)=>{const _e=n(ae);_e===0?W.push(ae):j.push({documentOrder:he,tabIndex:_e,node:ae})}),j.sort((ae,he)=>ae.tabIndex===he.tabIndex?ae.documentOrder-he.documentOrder:ae.tabIndex-he.tabIndex).map(ae=>ae.node).concat(W)}function t(z){return!(!r(z)||a(z)||n(z)<0)}function r(z){return!(z.disabled||z.type==="hidden"&&z.tagName.toUpperCase()==="INPUT"||N(z))}function n(z){var W;const j=Number.parseInt((W=z.getAttribute("tabindex"))!=null?W:"NaN",10);return Number.isNaN(j)?z.contentEditable==="true"||(z.nodeName==="AUDIO"||z.nodeName==="VIDEO")&&z.getAttribute("tabindex")===null?0:z.tabIndex:j}function a(z){return z.tagName.toUpperCase()==="INPUT"&&z.type==="radio"&&!_(z)}function o(z,W){for(const j of z)if(j.checked&&j.form===W)return j;return null}function _(z){var W;if(!z.name)return!0;const X=((W=z.form)!=null?W:z.ownerDocument).querySelectorAll('input[type="radio"][name="'+z.name+'"]'),ae=o(X,z.form);return!ae||ae===z}function N(z){if(!b()||z===document.activeElement||z.contains(document.activeElement))return!1;if(getComputedStyle(z).visibility==="hidden")return!0;const W=z.getBoundingClientRect();if(W.width===0||W.height===0)return!0;for(;z;){if(getComputedStyle(z).display==="none")return!0;z=z.parentElement}return!1}return b()?e(document.body):[]}function ia(e,t,r="forward"){const n=e.position;if(Array.isArray(t)){const a=e.offsetOf(t[0]),o=e.offsetOf(t[t.length-1]);return r==="forward"?e.setSelection(a,o):e.setSelection(o,a),e.announce("move",n),e.mathfield.stopCoalescingUndo(),!0}return r==="forward"?ia(e,[t.leftSibling,t]):ia(e,[t,t.leftSibling])}function rs(e,t){const r=e.position;if(typeof t=="number"&&(t=e.at(t)),t.type==="prompt")e.setSelection(e.offsetOf(t.firstChild),e.offsetOf(t.lastChild));else{const n=e.offsetOf(t);t.type==="placeholder"?e.setSelection(n-1,n):e.position=n}return e.announce("move",r),e.mathfield.stopCoalescingUndo(),!0}function Vu(e,t,r=!0){var n,a;const o=t==="forward"?1:-1;e.at(e.anchor).type==="placeholder"&&ms(e,t);let _;const N=e.at(e.anchor).parentPrompt;N?t==="forward"?_=e.offsetOf(N)+1:_=e.offsetOf(N.leftSibling):_=Math.max(e.position+o,0);const z=Ic(e,_,t);if(!z||t==="forward"&&e.offsetOf(z)<_||t==="backward"&&e.offsetOf(z)>_){if(!r||!((a=(n=e.mathfield.host)==null?void 0:n.dispatchEvent(new CustomEvent("move-out",{detail:{direction:t},cancelable:!0,bubbles:!0,composed:!0})))==null||a))return e.announce("plonk"),!1;const j=Xm();if(!document.activeElement||j.length<=1)return e.announce("plonk"),!1;let X=j.indexOf(document.activeElement)+o;return X<0&&(X=j.length-1),X>=j.length&&(X=0),j[X].focus(),e.mathfield.stopCoalescingUndo(),!0}return rs(e,z),!0}function Ic(e,t=0,r="forward"){return e.findAtom(n=>n.type==="placeholder"||n.type==="prompt"||!e.mathfield.readOnly&&n.treeDepth>2&&n.isFirstSibling&&n.isLastSibling,t,r)}_a({moveToOpposite:e=>{const t={superscript:"subscript",subscript:"superscript",above:"below",below:"above"},r=e.at(e.position),{parent:n}=r;if(!n)return e.announce("plonk"),!1;const a=r.parentBranch;let o;if(typeof a=="string"&&(o=t[a]),!o){const N=r.subsupPlacement?Uh(e):Kh(e);return e.mathfield.stopCoalescingUndo(),N}n.branch(o)||n.createBranch(o);const _=e.setSelection(e.getBranchRange(e.offsetOf(n),o));return e.mathfield.stopCoalescingUndo(),_},moveBeforeParent:e=>{const{parent:t}=e.at(e.position);return t?(e.position=e.offsetOf(t),e.mathfield.stopCoalescingUndo(),!0):(e.announce("plonk"),!1)},moveAfterParent:e=>Nh(e),moveToNextChar:e=>ms(e,"forward"),moveToPreviousChar:e=>ms(e,"backward"),moveUp:e=>ms(e,"upward"),moveDown:e=>ms(e,"downward"),moveToNextWord:e=>el(e,"forward"),moveToPreviousWord:e=>el(e,"backward"),moveToGroupStart:e=>{const t=e.offsetOf(e.at(e.position).firstSibling);return t===e.position?(e.announce("plonk"),!1):(e.position=t,e.mathfield.stopCoalescingUndo(),!0)},moveToGroupEnd:e=>{const t=e.offsetOf(e.at(e.position).lastSibling);return t===e.position?(e.announce("plonk"),!1):(e.position=t,e.mathfield.stopCoalescingUndo(),!0)},moveToNextGroup:e=>{var t,r,n,a;if(e.position===e.lastOffset&&e.anchor===e.lastOffset)return Vu(e,"forward");const o=e.at(e.position);if(o.mode==="text"){if(e.selectionIsCollapsed){let ae=o;for(;ae&&ae.mode==="text";)ae=ae.leftSibling;let he=o;for(;((t=he.rightSibling)==null?void 0:t.mode)==="text";)he=he.rightSibling;if(ae&&he)return ia(e,[ae,he])}if(o.rightSibling.mode==="text"){let ae=o;for(;ae&&ae.mode==="text";)ae=ae.rightSibling;return ae?(rs(e,(r=ae.leftSibling)!=null?r:ae),e.mathfield.switchMode("math"),!0):rs(e,e.lastOffset)}}const N=e.at(e.anchor).parentPrompt,z=N?e.offsetOf(N)+1:Math.max(e.position+1,0),W=Ic(e,z,"forward");if(W)return rs(e,W);const j=zh(e,o,ae=>ae.type==="leftright"||ae.type==="text","forward");if(j){if(j.mode==="text"){let ae=j;for(;ae&&ae.mode==="text";)ae=ae.rightSibling;return ia(e,[(n=j.leftSibling)!=null?n:j,(a=ae.leftSibling)!=null?a:ae])}return ia(e,j)}const X=o.parent;if(X){if(X.type==="leftright"||X.type==="surd")return ia(e,X);if(o.parentBranch==="superscript"&&X.subscript)return ia(e,X.subscript);if(o.parentBranch==="above"&&X.below)return ia(e,X.below);if(o.parentBranch==="superscript"||o.parentBranch==="subscript")return rs(e,X);if(o.parentBranch==="above"||o.parentBranch==="below")return ia(e,X)}return rs(e,e.lastOffset)},moveToPreviousGroup:e=>{var t;if(e.position===0&&e.anchor===0)return Vu(e,"backward");let r=e.at(e.position);const n=r.mode;if(n==="text"){if(e.selectionIsCollapsed){let N=r;for(;N&&N.mode==="text";)N=N.leftSibling;let z=r;for(;((t=z.rightSibling)==null?void 0:t.mode)==="text";)z=z.rightSibling;if(N&&z)return ia(e,[N,z])}for(;r&&r.mode==="text";)r=r.leftSibling;return r?rs(e,r):rs(e,0)}const a=e.at(e.anchor).parentPrompt,o=a?e.offsetOf(a.leftSibling):Math.max(e.position-1,0),_=Ic(e,o,"backward");if(_)return rs(e,_);if(n==="math"){const N=zh(e,r,W=>W.type==="leftright"||W.type==="text","backward");if(N){if(N.mode==="text"){let W=N;for(;W&&W.mode==="text";)W=W.leftSibling;return ia(e,[N,W])}return ia(e,N)}const z=r.parent;if(z){if(z.type==="leftright"||z.type==="surd")return ia(e,z);if(r.parentBranch==="subscript"&&z.superscript)return ia(e,z.superscript);if(r.parentBranch==="below"&&z.above)return ia(e,z.above);if(r.parentBranch==="superscript"||r.parentBranch==="subscript")return rs(e,z);if(r.parentBranch==="above"||r.parentBranch==="below")return ia(e,z)}return rs(e,0)}return!1},moveToMathfieldStart:e=>e.selectionIsCollapsed&&e.position===0?(e.announce("plonk"),!1):(e.position=0,e.mathfield.stopCoalescingUndo(),!0),moveToMathfieldEnd:e=>e.selectionIsCollapsed&&e.position===e.lastOffset?(e.announce("plonk"),!1):(e.position=e.lastOffset,e.mathfield.stopCoalescingUndo(),!0),moveToSuperscript:Kh,moveToSubscript:Uh},{target:"model",changeSelection:!0}),_a({moveToNextPlaceholder:e=>Vu(e,"forward"),moveToPreviousPlaceholder:e=>Vu(e,"backward")},{target:"model",changeSelection:!0,audioFeedback:"return"});function zh(e,t,r,n){if(n==="forward"){let o=t.rightSibling;for(;o&&!r(o);)o=o.rightSibling;return o}let a=t.leftSibling;for(;a&&!r(a);)a=a.leftSibling;return a}function Hu(e,t,r){typeof t=="function"&&(r=t,t=1/0),t===void 0&&(t=1/0);let n=e.position,a=!1,o="";for(;!a;){const _=e.at(n);a=t===0||_===void 0||_.type==="first"||_.mode!=="math"||!(_.type&&/mord|mpunct|operator/.test(_.type)||_.type==="mop"&&/[a-zA-Z ]+/.test(_.value))||!_.hasEmptyBranch("superscript")||!_.hasEmptyBranch("subscript")||typeof r=="function"&&!r(_),a||(_.mode="text",_.command=_.value,_.verbatimLatex=void 0,o+=_.value),n-=1,t-=1}e.contentDidChange({data:o,inputType:"insertText"})}function To(e,t,r){typeof t=="function"&&(r=t,t=1/0),t===void 0&&(t=1/0);let n=e.position,a=!1;const o=[];for(;!a;){const _=e.at(n);a=t===0||!_||_.type==="first"||_.isFirstSibling||_.mode!=="text"||_.value===" "||typeof r=="function"&&!r(_),a||(o.push(Qe.serialize([_],{defaultMode:"math"})),_.mode="math"),n-=1,t-=1}Oc(e),e.contentDidChange({data:Jr(o),inputType:"insertText"})}function Oc(e){var t;let r=e.position-1;for(;r>=0&&((t=e.at(r))==null?void 0:t.mode)==="math";)r-=1;if(!(r<0)&&e.at(r).mode==="text"&&e.at(r).value===" "&&e.at(r-1).mode==="math"){e.at(r-1).parent.removeChild(e.at(r-1));const n=e.silenceNotifications;e.silenceNotifications=!0,e.position-=1,e.silenceNotifications=n,e.contentDidChange({inputType:"deleteContent"})}}function qm(e){let t="",r=e.position,n=!1;for(;!n;){const a=e.at(r);n=!(a&&(a.mode==="text"||a.mode==="math"&&a.type&&/mord|mpunct/.test(a.type))),n||(t=a.value+t),r-=1}return t}function Jm(e,t,r){const{model:n}=e;if(n.mode==="latex"||!n.at(n.position).isLastSibling||!r||!Mu(r))return!1;const a=Zo(r);if(!n.selectionIsCollapsed)return!!(e.model.mode==="text"&&/[/_^]/.test(a));const o=qm(n)+a;if(e.model.mode==="text"){if(t==="Esc"||/[/\\]/.test(a))return!0;if(/[\^_]/.test(a))return/(^|\s)[a-zA-Z][^_]$/.test(o)&&To(n,1),!0;const _={")":"(","}":"{","]":"["}[a],{parent:N}=n.at(n.position);if(_&&N instanceof si&&N.leftDelim===_)return!0;if(/(^|[^a-zA-Z])(a|I) $/.test(o))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(a))return!0;if(/(^|[^a-zA-Z'])[a-zA-Z] $/.test(o))return To(n,1),!1;if(/\D\.[^\d\s]$/.test(o)){To(n,1);const z=n.at(n.position);return z.value="\u22C5",z.style.variant="normal",z.command="\\cdot",z.verbatimLatex=void 0,n.contentDidChange({data:"\\cdot",inputType:"insertText"}),!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(o)||/\.\d$/.test(o)||/\([\d+\-.]$/.test(o))return To(n,1),!0;if(/\([a-z][,;]$/.test(o))return To(n,2),!0;if(/[\d+\-=><*|]$/.test(a))return Oc(n),!0}else{if(t==="[Space]")return Hu(n,void 0,_=>/[a-z][:,;.]$/.test(_.value)),!0;if(/[a-zA-Z]{3,}$/.test(o)&&!/(dxd|abc|xyz|uvw)$/.test(o))return Hu(n,void 0,_=>/[a-zA-Z]/.test(_.value)),!0;if(/(^|\W)(if)$/i.test(o))return Hu(n,1),!0;if(/(\u0393|\u0394|\u0398|\u039B|\u039E|\u03A0|\u03A3|\u03A5|\u03A6|\u03A8|\u03A9|[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5){3,}$/u.test(o)&&!/(αβγ)$/.test(o))return Hu(n,void 0,_=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039B|\u039E|\u03A0|\u03A3|\u03A5|\u03A6|\u03A8|\u03A9|[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5)/u.test(_.value)),!0;if(a==="?"||a==="."&&!/[\d-+]\.$/.test(o))return!0}return!1}function Qm(e,t){if(!e.isSelectionEditable||!e.keystrokeCaptionVisible)return;const r=$h(),n=e.element.getBoundingClientRect();r.style.left=`${n.left}px`,r.style.top=`${n.top-64}px`,r.innerHTML=window.MathfieldElement.createHTML("<span>"+(wc(t)||t)+"</span>"+r.innerHTML),r.style.visibility="visible",setTimeout(()=>{r.childNodes.length>0&&r.childNodes[r.childNodes.length-1].remove(),r.childNodes.length===0&&(r.style.visibility="hidden")},3e3)}function ev(e){if(e.keystrokeCaptionVisible=!e.keystrokeCaptionVisible,e.keystrokeCaptionVisible){const t=$h();t.innerHTML=""}else{const t=Au("mathlive-keystroke-caption-panel");t.style.visibility="hidden"}return!1}function $h(){const e=document.getElementById("mathlive-keystroke-caption-panel");return e||(Cs("keystroke-caption"),Cs("core"),Au("mathlive-keystroke-caption-panel"))}function tv(){document.getElementById("mathlive-keystroke-caption-panel")&&(Mc("mathlive-keystroke-caption-panel"),Vs("core"),Vs("keystroke-caption"))}function Wh(e,t){var r,n,a;const{model:o}=e,_=vh(t);if(t.isTrusted){Vp(t);const he=Al();e.keyboardLayout!==he.id&&(e.keyboardLayout=he.id,e._keybindings=void 0)}if(clearTimeout(e.inlineShortcutBufferFlushTimer),e.inlineShortcutBufferFlushTimer=0,Qm(e,_),t.isTrusted&&t.defaultPrevented)return e.flushInlineShortcutBuffer(),!1;let N,z="",W;const j=e.inlineShortcutBuffer;if(e.isSelectionEditable){if(o.mode==="math")if(_==="[Backspace]")j.pop();else if(!Mu(t))e.flushInlineShortcutBuffer();else{const he=Zo(t),_e=[...(n=(r=j[j.length-1])==null?void 0:r.keystrokes)!=null?n:[],he];j.push({state:o.getState(),keystrokes:_e,leftSiblings:rv(e)});let Ue=0,yt="";for(;!N&&Ue<_e.length;)W=j.length-(_e.length-Ue),yt=_e.slice(Ue).join(""),N=mc(j[W].leftSiblings,yt,e.options.inlineShortcuts),!N&&/^[a-zA-Z][a-zA-Z0-9]+?([_\^][a-zA-Z0-9\*\+\-]+?)?$/.test(yt)&&(N=e.options.onInlineShortcut(e,yt)),Ue+=1;e.flushInlineShortcutBuffer({defer:!0})}e.options.smartMode&&(N?e.switchMode("math"):Jm(e,_,t)&&(e.switchMode({math:"text",text:"math"}[o.mode]),z=""))}if(!N){if(z||(z=qp(e.keybindings,o.mode,t)),!z&&(_==="[Enter]"||_==="[Return]")){let he=!1;return o.contentWillChange({inputType:"insertLineBreak"})&&(e.host&&(he=!e.host.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),he||t.preventDefault&&(t.preventDefault(),t.stopPropagation()),o.contentDidChange({inputType:"insertLineBreak"})),he}if((!z||_==="[Space]")&&o.mode==="math"){if(_==="[Space]"){if(e.adoptStyle="none",e.flushInlineShortcutBuffer(),e.options.mathModeSpace)return Wn.insert(o,e.options.mathModeSpace,{format:"latex",mode:"math"}),e.snapshot("insert-space"),z="",e.dirty=!0,e.scrollIntoView(),t.preventDefault&&(t.preventDefault(),t.stopPropagation()),!1;const he=o.at(o.position+1),_e=o.at(o.position-1);if((he==null?void 0:he.mode)==="text"||(_e==null?void 0:_e.mode)==="text")return Wn.insert(o," ",{mode:"text"}),e.snapshot("insert-space"),e.dirty=!0,e.scrollIntoView(),!1}(a=o.at(o.position))!=null&&a.isDigit()&&window.MathfieldElement.decimalSeparator===","&&Zo(t)===","&&(z="insertDecimalSeparator")}}if(!N&&!z){if(o.mathfield.smartFence){if(Bc(o,Zo(t),e.effectiveStyle))return e.dirty=!0,e.scrollIntoView(),t.preventDefault&&t.preventDefault(),!1}else{const{parent:he}=o.at(o.position);if(he instanceof si&&he.rightDelim==="?"&&o.at(o.position).isLastSibling&&/^[)}\]|]$/.test(_))return e.snapshot(),he.isDirty=!0,he.rightDelim=_,o.position+=1,o.selectionDidChange(),o.contentDidChange({data:Zo(t),inputType:"insertText"}),e.snapshot("insert-fence"),e.dirty=!0,e.scrollIntoView(),t.preventDefault&&t.preventDefault(),!1;if(!o.selectionIsCollapsed){const _e=Zo(t);if(_e==="("||_e==="{"||_e==="["){const Ue={"(":"(","{":"\\lbrace","[":"\\lbrack"}[_e],yt={"(":")","{":"\\rbrace","[":"\\rbrack"}[_e],[Be,nt]=Xi(o.selection);return e.snapshot(),o.position=nt,Wn.insert(o,yt,{format:"latex"}),o.position=Be,Wn.insert(o,Ue,{format:"latex"}),o.setSelection(Be+1,nt+1),o.contentDidChange({data:_e,inputType:"insertText"}),e.snapshot("insert-fence"),e.dirty=!0,e.scrollIntoView(),t.preventDefault&&t.preventDefault(),!1}}}return!0}const X=o.at(Math.max(o.position,o.anchor)),{parent:ae}=X;if(z==="moveAfterParent"&&(ae==null?void 0:ae.type)==="leftright"&&X.isLastSibling&&e.options.smartFence&&Bc(o,".",e.defaultStyle)&&(z="",oi(e)),e.keyboardDelegate.cancelComposition(),z)e.executeCommand(z);else if(N){const he=e.effectiveStyle;o.setState(j[W].state);const _e=j[j.length-1].keystrokes;for(const Ue of _e)Wn.insert(o,Ue,{silenceNotifications:!0,style:he});e.snapshot("insert-shortcut"),o.setState(j[W].state),o.deferNotifications({content:!0,selection:!0,data:N,type:"insertText"},()=>(Wn.insert(o,N,{format:"latex",style:he}),Oc(e.model),N.endsWith(" ")&&(e.switchMode("text"),Wn.insert(o," ",{style:he,mode:"text"})),e.snapshot(),o.selectionIsCollapsed||e.flushInlineShortcutBuffer(),!0)),e.dirty=!0,o.announce("replacement")}return e.scrollIntoView(),t.preventDefault&&t.preventDefault(),!1}function Fc(e,t,r){const{model:n}=e;if(!e.isSelectionEditable){n.announce("plonk");return}r!=null||(r={}),r.focus&&e.focus(),r.feedback&&window.MathfieldElement.playSound("keypress"),typeof r.mode=="string"&&(e.switchMode(r.mode),e.snapshot());let a=Af(t);const o=window.mathVirtualKeyboard;if(o!=null&&o.isShifted&&(a=typeof a=="string"?a.toUpperCase():a.map(z=>z.toUpperCase())),r.simulateKeystroke){let z=!0;for(const W of a)Wh(e,new KeyboardEvent("keypress",{key:W}))&&(z=!1);if(z)return}const _=n.at(n.position),N=F(F({},_.computedStyle),e.defaultStyle);if(n.selectionIsCollapsed||(n.deleteAtoms(Xi(n.selection)),e.snapshot("delete")),n.mode==="latex")n.deferNotifications({content:!0,selection:!0,data:t,type:"insertText"},()=>{Du(e);for(const z of a)Wn.insert(n,z);e.snapshot("insert-latex"),Cl(e)});else if(n.mode==="text"){for(const z of a)Wn.insert(n,z,{style:N});e.snapshot("insert-text")}else if(n.mode==="math")for(const z of a)nv(e,z,N,_);e.dirty=!0,e.scrollIntoView()}function rv(e){const t=e.model,r=[];let n=t.at(Math.min(t.position,t.anchor));for(;n.type!=="first";)r.push(n),n=n.leftSibling;return r}function nv(e,t,r,n){const a=e.model;let o={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(t===" "&&e.options.mathModeSpace&&(o=["insert",e.options.mathModeSpace]),o){e.executeCommand(o);return}if(/\d/.test(t)&&e.options.smartSuperscript&&n.parentBranch==="superscript"&&n.parent.type!=="mop"&&n.parent.type!=="operator"&&n.parent.type!=="extensible-symbol"&&n.hasNoSiblings){iv(a),Wn.insert(a,t,{style:r}),e.snapshot(),Nh(a),e.snapshot();return}if(/[a-zA-Z0-9]/.test(t)&&e.adoptStyle!=="none"){const _=e.adoptStyle==="left"?n:n.parent?n.rightSibling:null;(_==null?void 0:_.type)==="mord"&&/[a-zA-Z0-9]/.test(_.value)&&(r=F({},r),_.style.variant&&(r.variant=_.style.variant),_.style.variantStyle&&(r.variantStyle=_.style.variantStyle))}Wn.insert(a,t,{style:r}),e.snapshot(`insert-${a.at(a.position).type}`)}function iv(e){e.selectionIsCollapsed||(e.deleteAtoms(Xi(e.selection)),e.mathfield.snapshot("delete"))}function Bc(e,t,r){if(!t||e.mode!=="math")return!1;const n=e.at(e.position),{parent:a}=n,o={"(":"(",")":")","{":"\\lbrace","}":"\\rbrace","[":"\\lbrack","]":"\\rbrack","|":"|"}[t];if(!o)return!1;const _=vu[o],N=mu[o];if(!e.selectionIsCollapsed){e.mathfield.snapshot();const[z,W]=Xi(e.selection),j=e.extractAtoms([z,W]),X=a.addChildrenAfter([new si("left...right",j,{leftDelim:o,rightDelim:N})],e.at(z));return e.setSelection(e.offsetOf(X.firstChild),e.offsetOf(X.lastChild)),e.mathfield.snapshot("insert-fence"),e.contentDidChange({data:o,inputType:"insertText"}),!0}if(o==="|"){const z=a instanceof si?a.leftDelim+a.rightDelim:"";if(z==="\\lbrace\\rbrace"||z==="\\{\\}"||z==="\\lbrace?")return e.mathfield.snapshot(),Wn.insert(e,"\\,\\middle\\vert\\,",{format:"latex",style:r}),e.mathfield.snapshot("insert-fence"),e.contentDidChange({data:o,inputType:"insertText"}),!0}if(N){if(a instanceof si&&a.firstChild===n&&(a.leftDelim==="?"||a.leftDelim==="."))return a.leftDelim=o,a.isDirty=!0,e.mathfield.snapshot(),e.contentDidChange({data:o,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;if(!(a instanceof si)){let X=n;for(;X&&!(X.type==="mclose"&&X.value===N);)X=X.rightSibling;if(X){e.mathfield.snapshot();const ae=e.extractAtoms([e.offsetOf(n),e.offsetOf(X)]);return ae.pop(),a.addChildrenAfter([new si("left...right",ae,{leftDelim:o,rightDelim:N})],n),e.position=e.offsetOf(a.firstChild)+1,e.contentDidChange({data:o,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}}const z=e.offsetOf(n.lastSibling);let W;for(W=e.position;W<=z;W++){const X=e.at(W);if(X instanceof si&&(X.leftDelim==="?"||X.leftDelim===".")&&Vh(o,X.rightDelim))break}const j=e.at(W);if(W<=z&&j instanceof si){j.leftDelim=o,e.mathfield.snapshot();let X=e.extractAtoms([e.position,W-1]);return X=X.filter(ae=>ae.type!=="first"),j.addChildren(X,j.parentBranch),e.position+=1,e.contentDidChange({data:o,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}if(a instanceof si&&(a.leftDelim==="?"||a.leftDelim===".")&&Vh(o,a.rightDelim)){a.isDirty=!0,a.leftDelim=o,e.mathfield.snapshot();const X=e.extractAtoms([e.offsetOf(n.firstSibling),e.position]);for(const ae of X)a.parent.addChildBefore(ae,a);return e.contentDidChange({data:o,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}if(!(a instanceof si&&a.leftDelim==="|")){if(e.mathfield.snapshot(),Wn.insert(e,`\\left${o}\\right?`,{format:"latex",style:r}),n.lastSibling.type!=="first"){const X=e.offsetOf(n.lastSibling),ae=e.extractAtoms([e.position,X]);e.at(e.position).body=ae,e.position-=1}return e.mathfield.snapshot("insert-fence"),!0}}if(_){let z=n;for(;z;){if(z.type==="mopen"&&z.value===_){e.mathfield.snapshot();const he=z.leftSibling,_e=e.extractAtoms([e.offsetOf(z.leftSibling),e.offsetOf(n)]);_e.shift();const Ue=new si("left...right",_e,{leftDelim:_,rightDelim:o});return a.addChildrenAfter([Ue],he),e.position=e.offsetOf(Ue),e.contentDidChange({data:o,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0}z=z.leftSibling}if(a instanceof si&&n.isLastSibling&&Nc(a.leftDelim,o))return e.mathfield.snapshot(),a.isDirty=!0,a.rightDelim=o,e.position+=1,e.contentDidChange({data:o,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;const W=e.offsetOf(n.firstSibling);let j;for(j=e.position;j>=W;j--){const he=e.at(j);if(he instanceof si&&(he.rightDelim==="?"||he.rightDelim===".")&&Nc(he.leftDelim,o))break}const X=e.at(j);if(j>=W&&X instanceof si)return e.mathfield.snapshot(),X.rightDelim=o,X.addChildren(e.extractAtoms([j,e.position]),X.parentBranch),e.contentDidChange({data:o,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;if(a instanceof si&&(a.rightDelim==="?"||a.rightDelim===".")&&Nc(a.leftDelim,o))return e.mathfield.snapshot(),a.isDirty=!0,a.rightDelim=o,a.parent.addChildren(e.extractAtoms([e.position,e.offsetOf(n.lastSibling)]),a.parentBranch),e.position=e.offsetOf(a),e.contentDidChange({data:o,inputType:"insertText"}),e.mathfield.snapshot("insert-fence"),!0;const ae=a.parent;return ae instanceof si&&(ae.rightDelim==="?"||ae.rightDelim===".")&&e.at(e.position).isLastSibling?(e.position=e.offsetOf(ae),Bc(e,o,r)):!1}return!1}function Nc(e,t){return e?["(","\\lparen","{","\\{","\\lbrace","[","\\lbrack"].includes(e)?[")","\\rparen","}","\\}","\\rbrace","]","\\rbrack"].includes(t):mu[e]===t:!0}function Vh(e,t){return t?[")","\\rparen","}","\\}","\\rbrace","]","\\rbrack"].includes(t)?["(","\\lparen","{","\\{","\\lbrace","[","\\lbrack"].includes(e):vu[t]===e:!0}_a({undo:e=>(e.undo(),!0),redo:e=>(e.redo(),!0),scrollIntoView:e=>(e.scrollIntoView(),!0),scrollToStart:e=>(e.field.scroll(0,0),!0),scrollToEnd:e=>{const t=e.field.getBoundingClientRect();return e.field.scroll(t.left-window.scrollX,0),!0},toggleKeystrokeCaption:ev,toggleContextMenu:e=>{const t=e.toggleContextMenu();return t||e.model.announce("plonk"),t},plonk:e=>(e.model.announce("plonk"),!0),switchMode:(e,t,r,n)=>(e.switchMode(t,r,n),!0),insert:(e,t,r)=>e.insert(t,r),typedText:(e,t,r)=>(Fc(e,t,r),!0),insertDecimalSeparator:e=>{const t=e.model;return t.mode==="math"&&window.MathfieldElement.decimalSeparator===","&&t.at(Math.max(t.position,t.anchor)).isDigit()?(e.insert("{,}",{format:"latex"}),e.snapshot("insert-mord"),!0):(e.insert("."),!0)},commit:e=>{var t;return e.model.contentWillChange({inputType:"insertLineBreak"})&&((t=e.host)==null||t.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),e.model.contentDidChange({inputType:"insertLineBreak"})),!0},insertPrompt:(e,t,r)=>{const n=e.getPrompts();let a="prompt-"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36),o=0;for(;n.includes(a)&&o<100;){if(o===99)return console.error("could not find a unique ID after 100 tries"),!1;a="prompt-"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36),o++}return e.insert(`\\placeholder[${t!=null?t:a}]{}`,r),!0}}),_a({copyToClipboard:e=>(e.focus(),e.model.selectionIsCollapsed&&e.select(),"queryCommandSupported"in document&&document.queryCommandSupported("copy")?document.execCommand("copy"):e.element.querySelector(".ML__keyboard-sink").dispatchEvent(new ClipboardEvent("copy",{bubbles:!0,composed:!0})),!1)},{target:"mathfield"}),_a({cutToClipboard:e=>(e.focus(),"queryCommandSupported"in document&&document.queryCommandSupported("cut")?document.execCommand("cut"):e.element.querySelector(".ML__keyboard-sink").dispatchEvent(new ClipboardEvent("cut",{bubbles:!0,composed:!0})),!0),pasteFromClipboard:e=>(e.focus(),"queryCommandSupported"in document&&document.queryCommandSupported("paste")?(document.execCommand("paste"),!0):(navigator.clipboard.readText().then(t=>{t&&e.model.contentWillChange({inputType:"insertFromPaste",data:t})?(e.stopCoalescingUndo(),e.stopRecording(),e.insert(t,{mode:e.model.mode})&&(Cl(e),e.startRecording(),e.snapshot("paste"),e.model.contentDidChange({inputType:"insertFromPaste"}),oi(e))):e.model.announce("plonk"),e.startRecording()}),!0))},{target:"mathfield",canUndo:!0,changeContent:!0,changeSelection:!0});function av(e,t){e.flushInlineShortcutBuffer(),e.stopCoalescingUndo();const r=Kc(e,t),{model:n}=e;return n.selectionIsCollapsed?(e.defaultStyle.fontSeries&&r.fontSeries===e.defaultStyle.fontSeries&&(r.fontSeries="auto"),r.fontShape&&r.fontShape===e.defaultStyle.fontShape&&(r.fontShape="auto"),r.color&&r.color===e.defaultStyle.color&&(r.color="none"),r.backgroundColor&&r.backgroundColor===e.defaultStyle.backgroundColor&&(r.backgroundColor="none"),r.fontSize&&r.fontSize===e.defaultStyle.fontSize&&(r.fontSize="auto"),e.defaultStyle=F(F({},e.defaultStyle),r)):e.model.deferNotifications({content:!0,type:"insertText"},()=>{n.selection.ranges.forEach(a=>Lc(n,a,r,{operation:"toggle"})),e.snapshot("style-change")}),!0}_a({applyStyle:av},{target:"mathfield",canUndo:!0,changeContent:!0});function Kc(e,t){var r,n,a,o,_,N,z,W,j,X;const ae={};if(typeof t.color=="string"){const _e=(n=e.colorMap((r=t.color)!=null?r:t.verbatimColor))!=null?n:"none";_e!==t.color&&(ae.verbatimColor=(a=t.verbatimColor)!=null?a:t.color),ae.color=_e}if(typeof t.backgroundColor=="string"){const _e=(_=e.backgroundColorMap((o=t.backgroundColor)!=null?o:t.verbatimBackgroundColor))!=null?_:"none";_e!==t.backgroundColor&&(ae.verbatimBackgroundColor=(N=t.verbatimBackgroundColor)!=null?N:t.backgroundColor),ae.backgroundColor=_e}typeof t.fontFamily=="string"&&(ae.fontFamily=t.fontFamily),typeof t.series=="string"&&(ae.fontSeries=t.series),typeof t.fontSeries=="string"&&(ae.fontSeries=t.fontSeries.toLowerCase()),ae.fontSeries&&(ae.fontSeries=(z={bold:"b",medium:"m",normal:"m"}[ae.fontSeries])!=null?z:ae.fontSeries),typeof t.shape=="string"&&(ae.fontShape=t.shape),typeof t.fontShape=="string"&&(ae.fontShape=t.fontShape.toLowerCase()),ae.fontShape&&(ae.fontShape=(W={italic:"it",up:"n",upright:"n",normal:"n"}[ae.fontShape])!=null?W:ae.fontShape),t.variant&&(ae.variant=t.variant.toLowerCase()),t.variantStyle&&(ae.variantStyle=t.variantStyle.toLowerCase());const he=(j=t.size)!=null?j:t.fontSize;return typeof he=="number"?ae.fontSize=Math.max(1,Math.min(10,he)):typeof he=="string"&&(ae.fontSize=(X={size1:1,size2:2,size3:3,size4:4,size5:5,size6:6,size7:7,size8:8,size9:9,size10:10}[he.toLowerCase()])!=null?X:{tiny:1,scriptsize:2,footnotesize:3,small:4,normal:5,normalsize:5,large:6,Large:7,LARGE:8,huge:9,Huge:10}[he]),ae}function Uc(e){let[t,r]=Xi(e.selection);if(t=Hh(e,t,"backward"),r=Hh(e,r,"forward"),t===r){const n=e.at(t);if(n.type==="leftright")return e.setSelection(e.offsetOf(n.firstChild)-1,r);if(n.type==="first"&&(n.parent.type==="leftright"||n.parent.type==="surd"))return e.setSelection(t-1,e.offsetOf(n.parent.lastChild)+1);e.setSelection(t-1,r)}else e.setSelection(t,r);return!0}function Hh(e,t,r){var n,a,o;let _=e.at(t);if(!_)return t;const N=r==="forward"?1:-1;if(_.mode==="text"){for(;_&&!(_.mode!=="text"||!ht.test(_.value));)t+=N,_=e.at(t);return r==="backward"?t-1:t}if(_.mode==="latex"){if(/[a-zA-Z\*]/.test(_.value))if(r==="backward")for(;_&&_.mode==="latex"&&_.value!=="\\"&&/[a-zA-Z]/.test(_.value);)t+=N,_=e.at(t);else for(;_&&_.mode==="latex"&&/[a-zA-Z\*]/.test(_.value);)t+=N,_=e.at(t);else if(_.value==="{"){if(r==="forward"){for(;_&&_.mode==="latex"&&_.value!=="}";)t+=N,_=e.at(t);return t}return t-1}else if(_.value==="}"){if(r==="backward"){for(;_&&_.mode==="latex"&&_.value!=="{";)t+=N,_=e.at(t);return t-1}return t}return t-1}if(_.mode==="math"){if(_.isDigit()){for(;(n=e.at(t+N))!=null&&n.isDigit();)t+=N;return r==="backward"?t-1:t}if(_.style.variant||_.style.variantStyle){let z=(a=e.at(t))==null?void 0:a.style;for(;z&&z.variant===_.style.variant&&z.variantStyle===_.style.variantStyle;)z=(o=e.at(t+N))==null?void 0:o.style,t+=N;return r==="backward"?t-1:t}return t}return t}_a({selectGroup:e=>{const t=Uc(e);return t||e.announce("plonk"),t},selectAll:e=>e.setSelection(0,e.lastOffset),extendSelectionForward:e=>ms(e,"forward",{extend:!0}),extendSelectionBackward:e=>ms(e,"backward",{extend:!0}),extendToNextWord:e=>el(e,"forward",{extend:!0}),extendToPreviousWord:e=>el(e,"backward",{extend:!0}),extendSelectionUpward:e=>ms(e,"upward",{extend:!0}),extendSelectionDownward:e=>ms(e,"downward",{extend:!0}),extendToNextBoundary:e=>el(e,"forward",{extend:!0}),extendToPreviousBoundary:e=>el(e,"backward",{extend:!0}),extendToGroupStart:e=>{const t=e.setSelection(e.anchor,e.offsetOf(e.at(e.position).firstSibling));return t||e.announce("plonk"),t},extendToGroupEnd:e=>{const t=e.setSelection(e.anchor,e.offsetOf(e.at(e.position).lastSibling));return t||e.announce("plonk"),t},extendToMathFieldStart:e=>{const t=e.setSelection(e.anchor,0);return t||e.announce("plonk"),t},extendToMathFieldEnd:e=>{const t=e.setSelection(e.anchor,e.lastOffset);return t||e.announce("plonk"),t}},{target:"model",changeSelection:!0});var Do=null,Fl=0,ju=class Va{static start(t,r,n,a){var o;Va.element=t,(o=Va.controller)==null||o.abort(),Va.controller=new AbortController;const _={signal:Va.controller.signal};"PointerEvent"in window?(t.addEventListener("pointermove",n,_),t.addEventListener("pointerup",a,_),t.addEventListener("pointercancel",a,_),zc(r)&&(Va.pointerId=r.pointerId,t.setPointerCapture(r.pointerId))):(window.addEventListener("mousemove",n,_),window.addEventListener("blur",a,_),window.addEventListener("mouseup",a,_))}static stop(){var t;(t=Va.controller)==null||t.abort(),Va.controller=void 0,typeof Va.pointerId=="number"&&(Va.element.releasePointerCapture(Va.pointerId),Va.pointerId=void 0)}};function zc(e){return e!==null&&globalThis.PointerEvent!==void 0&&e instanceof PointerEvent}function jh(e,t){var r;if(t.buttons>1)return;e.atomBoundsCache=new Map;const n=e;let a,o=!1,_=!1,N="none",z=!1,W=!1;const j=t.clientX,X=t.clientY,ae=Date.now(),he=n.field,_e=setInterval(()=>{z?he.scroll({top:0,left:he.scrollLeft-16}):W&&he.scroll({top:0,left:he.scrollLeft+16})},32);function Ue(){ju.stop(),o=!1,clearInterval(_e),e.element.classList.remove("tracking"),t&&t.preventDefault()}function yt(nt){if(!n.hasFocus()){Ue();return}const wt=nt.clientX,st=nt.clientY,zt=zc(nt)&&nt.pointerType==="touch"?20:5;if(Date.now()<ae+500&&Math.abs(j-wt)<zt&&Math.abs(X-st)<zt){nt.preventDefault(),nt.stopPropagation();return}const qt=he.getBoundingClientRect();W=wt>qt.right,z=wt<qt.left;let Gt=a;zc(nt)&&(nt.isPrimary||(Gt=Bl(n,nt.clientX,nt.clientY,{bias:0})));const Hr=Bl(n,wt,st,{bias:wt<=j?wt===j?0:-1:1});Gt>=0&&Hr>=0&&(n.model.extendSelectionTo(Gt,Hr),oi(e)),_&&Uc(n.model)}Do&&Math.abs(Do.x-j)<5&&Math.abs(Do.y-X)<5&&Date.now()<Do.time+500?(Fl+=1,Do.time=ae):(Do={x:j,y:X,time:ae},Fl=1);const Be=he.getBoundingClientRect();if(j>=Be.left&&j<=Be.right&&X>=Be.top&&X<=Be.bottom){if(e.flushInlineShortcutBuffer(),e.adoptStyle="left",a=Bl(e,j,X,{bias:0}),a>=0){if(e.element.classList.add("tracking"),t.shiftKey){const nt=e.model.selectionIsCollapsed;e.model.extendSelectionTo(e.model.anchor,a),yh(e.model)||nt?N="all":N="selection"}else e.model.at(a).type==="placeholder"?(e.model.setSelection(a-1,a),N="selection"):((r=e.model.at(a).rightSibling)==null?void 0:r.type)==="placeholder"?(e.model.setSelection(a,a+1),N="selection"):(e.model.position=a,yh(e.model)?N="all":N="selection");e.defaultStyle={},t.detail===3||Fl>2?(Ue(),(t.detail===3||Fl===3)&&(e.model.selection={ranges:[[0,e.model.lastOffset]]},N="all")):o||(o=!0,ju.start(he,t,yt,Ue),(t.detail===2||Fl===2)&&(_=!0,Uc(e.model),N="all"))}e.hasFocus()||(N="none",e.focus({preventScroll:!0}))}else Do=null;e.stopCoalescingUndo(),N!=="none"&&(e.model.selectionIsCollapsed&&(N="all"),oi(e)),t.preventDefault()}function sv(e,t,r){if(e>=r.left&&e<=r.right&&t>=r.top&&t<=r.bottom)return 0;const n=e-(r.left+r.right)/2,a=t-(r.top+r.bottom)/2;return n*n+a*a}function Gh(e,t,r,n,a){if(!r.id)return[1/0,null];if(t.has(r.id))return t.get(r.id);const o=_l(e,r);if(!o)return[1/0,null];let _=[1/0,null];if(r.hasChildren&&!r.captureSelection&&n>=o.left&&n<=o.right)for(const N of r.children){const z=Gh(e,t,N,n,a);z[0]<=_[0]&&(_=z)}return _[1]||(_=[sv(n,a,o),r]),t.set(r.id,_),_}function ov(e,t,r){const[,n]=Gh(e,new Map,e.model.root,t,r);return n}function Bl(e,t,r,n){var a;const o=e.field.querySelector(".ML__latex").getBoundingClientRect();if(!o)return 0;if(t>o.right||r>o.bottom+8)return e.model.lastOffset;if(t<o.left||r<o.top-8)return 0;n=n!=null?n:{},n.bias=(a=n.bias)!=null?a:0;let _=ov(e,t,r);const N=[];let z=_;for(;z;)N.unshift(z),z=z.parent;for(const j of N)if(j.captureSelection){_=j;break}let W=e.model.offsetOf(_);if(W<0)return-1;if(_.leftSibling)if(n.bias===0&&_.type!=="placeholder"){const j=_l(e,_);j&&t<(j.left+j.right)/2&&(W=e.model.offsetOf(_.leftSibling))}else n.bias<0&&(W=e.model.offsetOf(_.leftSibling));return W}var lv=class extends Wn{constructor(){super("math")}onPaste(e,t){if(!t||!e.model.contentWillChange({data:typeof t=="string"?t:null,dataTransfer:typeof t=="string"?null:t,inputType:"insertFromPaste"}))return!1;let r="",n="auto",a=typeof t!="string"?t.getData("application/json+mathlive"):"";if(a)try{const o=JSON.parse(a);if(o&&Array.isArray(o)){e.snapshot();const _=js(o),{model:N}=e;N.selectionIsCollapsed||N.deleteAtoms(Xi(N.selection));const z=N.at(N.position);if(z.parent instanceof gn){console.assert(z.parentBranch!==void 0);const W=[];let j=[];_[0].type==="first"&&_.shift(),_[_.length-1].type==="first"&&_.pop();for(const _e of _)_e.type==="first"&&j.length>0?(W.push(j),j=[_e]):j.push(_e);j.length>0&&W.push(j);let X=Number(z.parentBranch[0]),ae=Number(z.parentBranch[1]);const he=z.parent.maxColumns;for(;z.parent.colCount-ae<W.length&&z.parent.colCount<he;)z.parent.addColumn();z.parent.addChildrenAfter(W[0],z);for(let _e=1;_e<W.length;_e++)ae++,ae>=he&&(ae=0,z.parent.addRowAfter(X),X++),z.parent.setCell(X,ae,W[_e])}else z.parent.addChildrenAfter(_.filter(W=>W.type!=="first"),z);return N.position=N.offsetOf(_[_.length-1]),N.contentDidChange({inputType:"insertFromPaste"}),oi(e),!0}}catch(o){}if(a=typeof t!="string"?t.getData("application/json"):"",a&&window.MathfieldElement.computeEngine)try{const o=JSON.parse(a);if(typeof o=="object"&&"latex"in o&&o.latex&&(r=o.latex),!r){const _=window.MathfieldElement.computeEngine.box(o);_&&!_.has("Error")&&(r=_.latex)}r||(n="latex")}catch(o){}if(!r&&typeof t!="string"&&(r=t.getData("application/x-latex"),r&&(n="latex")),r||(r=typeof t=="string"?t:t.getData("text/plain")),r){let o;return[o,r]=vc(r),n==="auto"&&o&&(n="latex"),e.stopCoalescingUndo(),e.stopRecording(),this.insert(e.model,r,{format:n})&&(e.startRecording(),e.snapshot("paste"),oi(e)),e.startRecording(),!0}return!1}insert(e,t,r){var n,a;const o=typeof t=="string"?t:(a=(n=window.MathfieldElement.computeEngine)==null?void 0:n.box(t).latex)!=null?a:"";if(!r.silenceNotifications&&!e.contentWillChange({data:o,inputType:"insertText"}))return!1;r.insertionMode||(r.insertionMode="replaceSelection"),r.selectionMode||(r.selectionMode="placeholder"),r.format||(r.format="auto");const{silenceNotifications:_}=e;r.silenceNotifications&&(e.silenceNotifications=!0);const N=e.silenceNotifications;e.silenceNotifications=!0;const z={"?":"\\placeholder{}","@":"\\placeholder{}"};z[0]=r.insertionMode==="replaceAll"?"":e.getValue(e.selection,"latex-unstyled"),r.insertionMode==="replaceSelection"&&!e.selectionIsCollapsed?e.deleteAtoms(Xi(e.selection)):r.insertionMode==="replaceAll"?(e.root.setChildren([],"body"),e.position=0):r.insertionMode==="insertBefore"?e.collapseSelection("backward"):r.insertionMode==="insertAfter"&&e.collapseSelection("forward"),!e.at(e.position).isLastSibling&&e.at(e.position+1).type==="placeholder"?e.deleteAtoms([e.position,e.position+1]):e.at(e.position).type==="placeholder"&&e.deleteAtoms([e.position-1,e.position]);let W=-1;z[0]?z["@"]=z[0]:typeof t=="string"&&/(^|[^\\])#@/.test(t)&&(W=cv(e),W>=0&&(z["@"]=e.getValue(W,e.position,"latex"))),z[0]||(z[0]=z["?"]);let j=!1;const X=wt=>(j=!0,z[wt]);let[ae,he]=Zh(e,t,X,r);if(!he)return!1;const _e=he.length===1&&he[0].type==="genfrac";_e&&W>=0&&typeof e.mathfield.options.isImplicitFunction=="function"&&e.mathfield.options.isImplicitFunction(e.at(e.position).command)?(z["@"]=z["?"],j=!1,[ae,he]=Zh(e,t,X,r)):W>=0&&e.deleteAtoms([W,e.position]);const{parent:Ue}=e.at(e.position),yt=Ue.hasEmptyBranch("body");if(_e&&ae!=="latex"&&e.mathfield.options.removeExtraneousParentheses&&Ue instanceof si&&Ue.leftDelim==="("&&yt){const wt=Ue.parent,st=Ue.parentBranch;wt.removeChild(Ue),wt.setChildren(he,st)}const Be=e.at(e.position);Be.parent.addChildrenAfter(he,Be),ae==="latex"&&typeof t=="string"&&(Ue==null?void 0:Ue.type)==="root"&&yt&&!j&&(Ue.verbatimLatex=t),e.silenceNotifications=N;const nt=he[he.length-1];if(r.selectionMode==="placeholder"){const wt=he.flatMap(st=>[st,...st.children]).find(st=>st.type==="placeholder");if(wt){const st=e.offsetOf(wt);e.setSelection(st-1,st),e.announce("move")}else nt&&(e.position=e.offsetOf(nt))}else r.selectionMode==="before"||(r.selectionMode==="after"?nt&&(e.position=e.offsetOf(nt)):r.selectionMode==="item"&&e.setSelection(e.anchor,e.offsetOf(nt)));return e.contentDidChange({data:o,inputType:"insertText"}),e.silenceNotifications=_,!0}};function Zh(e,t,r,n){var a;let o,_=[];if(typeof t!="string"||n.format==="math-json"){const N=window.MathfieldElement.computeEngine;if(!N)return["math-json",[]];[o,t]=["latex",N.box(t).latex],_=na(t,{context:e.mathfield.context})}else typeof t=="string"&&n.format==="ascii-math"?([o,t]=du(t,{format:"ascii-math",inlineShortcuts:e.mathfield.options.inlineShortcuts}),_=na(t,{context:e.mathfield.context}),o!=="latex"&&e.mathfield.options.removeExtraneousParentheses&&Gu(_)):(n.format==="auto"||(a=n.format)!=null&&a.startsWith("latex"))&&(n.format==="auto"&&([o,t]=du(t,{format:"auto",inlineShortcuts:e.mathfield.options.inlineShortcuts})),n.format==="latex"&&([,t]=vc(t)),_=na(t,{context:e.mathfield.context,args:r}),n.format!=="latex"&&e.mathfield.options.removeExtraneousParentheses&&Gu(_));return Zs(_,n.style),[o!=null?o:"latex",_]}function uv(e){if(!e||(console.assert(e[0].type==="first"),e.length>1))return null;const t=e[0];return t instanceof si&&t.leftDelim==="("&&t.rightDelim===")"?t.removeBranch("body"):null}function Gu(e){if(e){for(let t=0;e[t];t++){const r=e[t];if(r instanceof si&&r.leftDelim==="("){let n=0,a=0,o=0;for(let _=0;r.body[_];_++)r.body[_].type==="genfrac"&&(n++,a=_),o++;o===0&&n===1&&(e[t]=r.body[a])}}for(const t of e){for(const r of t.branches)if(!t.hasEmptyBranch(r)){Gu(t.branch(r));const n=uv(t.branch(r));n&&t.setChildren(n,r)}if(t instanceof gn)for(const r of t.cells)Gu(r)}}}function cv(e){let t=e.at(e.position);if(t.mode==="text"){for(;!t.isFirstSibling&&t.mode==="text";)t=t.leftSibling;return e.offsetOf(t)}const r=t;let n=!1;if(t.type==="mclose"){const a=vu[t.value];for(;!t.isFirstSibling&&!(t.type==="mopen"&&t.value===a);)t=t.leftSibling;t.isFirstSibling||(t=t.leftSibling),n=!0}else t.type==="leftright"&&(t=t.leftSibling,n=!0);if(n)for(;!t.isFirstSibling&&(t.isFunction||Yh(t));)t=t.leftSibling;else{const a=[];for(;!t.isFirstSibling&&(Yh(t)||a.length>0);)t.type==="mclose"&&a.unshift(t.value),t.type==="mopen"&&a.length>0&&t.value===vu[a[0]]&&a.shift(),t=t.leftSibling}return r===t?-1:e.offsetOf(t)}function Yh(e){return e.isDigit()?!0:e.type&&/^(mord|surd|subsup|leftright|mop|mclose)$/.test(e.type)?!e.isExtensibleSymbol:!1}new lv;var fv=class extends Wn{constructor(){super("text")}onPaste(e,t){if(!t)return!1;const r=typeof t=="string"?t:t.getData("text/plain");return r&&e.model.contentWillChange({inputType:"insertFromPaste",data:r})?(e.stopCoalescingUndo(),e.stopRecording(),this.insert(e.model,r)&&(e.model.contentDidChange({inputType:"insertFromPaste"}),e.startRecording(),e.snapshot("paste"),oi(e)),e.startRecording(),!0):!1}insert(e,t,r={}){if(!e.contentWillChange({data:t,inputType:"insertText"}))return!1;r.insertionMode||(r.insertionMode="replaceSelection"),r.selectionMode||(r.selectionMode="placeholder"),r.format||(r.format="auto");const{silenceNotifications:n}=e;r.silenceNotifications&&(e.silenceNotifications=!0);const a=e.silenceNotifications;e.silenceNotifications=!0,r.insertionMode==="replaceSelection"&&!e.selectionIsCollapsed?e.deleteAtoms(Xi(e.selection)):r.insertionMode==="replaceAll"?(e.root.setChildren([],"body"),e.position=0):r.insertionMode==="insertBefore"?e.collapseSelection("backward"):r.insertionMode==="insertAfter"&&e.collapseSelection("forward");const o=hv(t,e.mathfield.context);if(Zs(o,r.style),!o)return!1;const _=e.at(e.position),N=_.parent.addChildrenAfter(o,_);return e.silenceNotifications=a,r.selectionMode==="before"||(r.selectionMode==="item"?e.setSelection(e.anchor,e.offsetOf(N)):N&&(e.position=e.offsetOf(N))),e.contentDidChange({data:t,inputType:"insertText"}),e.silenceNotifications=n,!0}};function hv(e,t){return e=e.replace(/\\/g,"\\textbackslash "),e=e.replace(/#/g,"\\#"),e=e.replace(/\$/g,"\\$"),e=e.replace(/%/g,"\\%"),e=e.replace(/&/g,"\\&"),e=e.replace(/_/g,"\\_"),e=e.replace(/{/g,"\\textbraceleft "),e=e.replace(/}/g,"\\textbraceright "),e=e.replace(/lbrace/g,"\\textbraceleft "),e=e.replace(/rbrace/g,"\\textbraceright "),e=e.replace(/\^/g,"\\textasciicircum "),e=e.replace(/~/g,"\\textasciitilde "),e=e.replace(/£/g,"\\textsterling "),na(e,{context:t,parseMode:"text"})}new fv;function vs(e){return{value:e.model.getValue(),selectionIsCollapsed:e.model.selectionIsCollapsed,canUndo:e.canUndo(),canRedo:e.canRedo(),style:e.selectionStyle,mode:e.model.mode}}var Bn=4,fa=20,wi=2*(fa+Bn),Zu=(e,t)=>`
<line x1="${e+fa}" y1="${t+fa}"
x2="${e>t?e+fa:7*fa+10*Bn}"
y2="${e<t?t+fa:7*fa+10*Bn}"/>
<svg id="plus" viewBox="0 0 40 40" x="${e}" y="${t}" width="40" height="40">
<circle class="cls-2" cx="20" cy="20" r="20"/>
<path class="font" d="m33.33,20c0,1.84-1.49,3.34-3.33,3.34h-6.67v6.66c0,1.84-1.49,3.34-3.33,3.34s-3.34-1.5-3.34-3.34v-6.66h-6.66c-1.84,0-3.34-1.5-3.34-3.34s1.5-3.33,3.34-3.33h6.66v-6.67c0-1.84,1.5-3.33,3.34-3.33s3.33,1.49,3.33,3.33v6.67h6.67c1.84,0,3.33,1.49,3.33,3.33Z"/>
</svg>`,Xh=(e,t)=>`
<line x1="${e+fa}" y1="${t+fa}"
x2="${e>t?e+fa:7*fa+10*Bn}"
y2="${e<t?t+fa:7*fa+10*Bn}"/>
<svg id="minus" viewBox="0 0 40 40" x="${e}" y="${t}" width="40" height="40">
<circle class="cls-2" cx="20" cy="20" r="20"/>
<path class="font" d="m33.33,20c0,1.84-1.49,3.33-3.33,3.33H10c-1.84,0-3.34-1.49-3.34-3.33s1.5-3.34,3.34-3.34h20c1.84,0,3.33,1.5,3.33,3.34Z"/>
</svg>`,Yu=(e,t,r)=>`
<svg id="arrow" viewBox="0 0 40 40" x="${e}" y="${t}" width="40" height="40">
<circle class="cls-2" cx="20" cy="20" r="20"/>
<g transform="rotate(${r})" transform-origin="20 20">
<path class="font" d="m17.7,7.23h4.6c.52,0,.94.42.94.94v13.82c0,.52.42.94.94.94h3.39c.83,0,1.25,1.01.66,1.6l-7.56,7.56c-.37.37-.96.37-1.32,0l-7.56-7.56c-.59-.59-.17-1.6.66-1.6h3.39c.52,0,.94-.42.94-.94v-13.82c0-.52.42-.94.94-.94Z"/>
</g>
</svg>`,dv=`
<svg class="MLEP__array-buttons" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox=
"-2 -2 ${8*fa+10*Bn+5} ${8*fa+10*Bn+5}">
<rect
class="MLEP__array-insert-background rows"
x="0"
y="${wi+Bn}"
height="${3*wi}"
width="${wi}"
rx="${wi/2}"/>
<rect
class="MLEP__array-insert-background columns"
x="${wi+Bn}"
y="0"
height="${wi}"
width="${3*wi}"
rx="${wi/2}"/>
<g data-command='"moveDown"'>
${Yu(2*(Bn+wi),2*Bn+3*wi,0)}
</g>
<g data-command='"moveUp"'>
${Yu(2*(Bn+wi),2*Bn+wi,180)}
</g>
<g data-command='"moveToNextWord"'>
${Yu(2*Bn+3*wi,2*(Bn+wi),-90)}
</g>
<g data-command='"moveToPreviousWord"'>
${Yu(2*Bn+wi,2*(Bn+wi),90)}
</g>
<g>
<g data-command='"addColumnBefore"'>
${Zu(2*Bn+wi,Bn)}
</g>
<g data-command='"removeColumn"'>
${Xh(2*Bn+2*wi,Bn)}
</g>
<g data-command='"addColumnAfter"'>
${Zu(2*Bn+3*wi,Bn)}
</g>
<g data-command='"addRowBefore"'>
${Zu(Bn,2*Bn+wi)}
</g>
<g data-command='"removeRow"'>
${Xh(Bn,2*Bn+2*wi)}
</g>
<g data-command='"addRowAfter"'>
${Zu(Bn,2*Bn+3*wi)}
</g>
</svg>`,pv=e=>`
<svg id="matrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","matrix"]'>
<rect class="cls-1" width="28" height="24"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/></svg>`,mv=e=>`
<svg id="pmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","pmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m6,4c-3.96,4.6-3.96,11.4,0,16"/>
<path class="cls-2" d="m22,4c3.96,4.6,3.96,11.4,0,16"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/></svg>`,qh=e=>`
<svg id="Bmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","Bmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m6,4c-1.1,0-2,.9-2,2v3c0,1.66-.9,3-2,3,1.1,0,2,1.34,2,3v3c0,1.1.9,2,2,2"/>
<path class="cls-2" d="m22,4c1.1,0,2,.9,2,2v3c0,1.66.9,3,2,3-1.1,0-2,1.34-2,3v3c0,1.1-.9,2-2,2"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/>
</svg>`,vv=e=>`
<svg id="bmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","bmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m6,4h-3v16h3"/>
<path class="cls-2" d="m22,4h3v16h-3"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/>
</svg>`,gv=e=>`
<svg id="vmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","vmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/>
<line class="cls-2" x1="4" y1="4" x2="4" y2="20"/>
<line class="cls-2" x1="24" y1="4" x2="24" y2="20"/>
</svg>`,_v=e=>`
<svg id="Vmatrix" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="-3.5 -3 35 30"
data-command='["setEnvironment","Vmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/>
<line class="cls-2" x1="6" y1="4" x2="6" y2="20"/>
<line class="cls-2" x1="22" y1="4" x2="22" y2="20"/>
<line class="cls-2" x1="2" y1="4" x2="2" y2="20"/>
<line class="cls-2" x1="26" y1="4" x2="26" y2="20"/>
</svg>`,yv=e=>`
<svg id="cases" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","cases"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m10,4c-1.1,0-2,.9-2,2v3c0,1.66-.9,3-2,3,1.1,0,2,1.34,2,3v3c0,1.1.9,2,2,2"/>
<circle cx="13" cy="8" r="1"/>
<circle cx="13" cy="16" r="1"/>
<circle cx="21" cy="8" r="1"/>
<circle cx="21" cy="16" r="1"/>
</svg>`,bv=e=>`
<svg id="rcases" class="${e}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","rcases"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m18,20c1.1,0,2-.9,2-2v-3c0-1.66.9-3,2-3-1.1,0-2-1.34-2-3v-3c0-1.1-.9-2-2-2"/>
<circle cx="15" cy="8" r="1"/>
<circle cx="15" cy="16" r="1"/>
<circle cx="7" cy="8" r="1"/>
<circle cx="7" cy="16" r="1"/>
</svg>`,$c={matrix:pv,pmatrix:mv,bmatrix:vv,Bmatrix:qh,vmatrix:gv,Vmatrix:_v},Wc={cases:yv,rcases:bv,Bmatrix:qh};function xv(e){var t,r;const n=(t=e.model.parentEnvironment)==null?void 0:t.array;if(!n)return;let a=0;n.forEach(_e=>{(!a||_e.length>a)&&(a=_e.length)});let o=document.getElementById("mathlive-environment-popover");o||(o=Au("mathlive-environment-popover"),Cs("environment-popover"),Cs("core"),o.setAttribute("aria-hidden","true"));let _;const N=o.querySelector(".MLEP__environment-controls");N?_=N:(_=document.createElement("div"),o.innerHTML="",o.appendChild(_)),_.className="MLEP__environment-controls",_.style.display="flex",_.style.width="100%",_.style.height="100%",_.style.boxSizing="border-box",_.innerHTML=dv;let z=[],W="";const j=e.model.parentEnvironment.environmentName;if(Xf(j)){const _e=wv(j);W=$c[_e]("active");const Ue=$c,{[_e]:yt}=Ue,Be=L(Ue,[U(_e)]);z=Object.values(Be).map(nt=>nt("inactive"))}else if(sp(j)){const _e=Sv(j);W=Wc[_e]("active");const Ue=Wc,{[_e]:yt}=Ue,Be=L(Ue,[U(_e)]);z=Object.values(Be).map(nt=>nt("inactive"))}else op(j)&&(W=$c.matrix("active"),z=Object.values(Wc).map(_e=>_e("inactive")));const X=document.createElement("div");X.className="MLEP__environment-delimiter-controls",X.style.display="flex",X.style.flexDirection="column",X.innerHTML=`
<div class='MLEP__array-delimiter-options'>
${W}
${z.join("")}
</div>`,W&&_.appendChild(X),_.querySelectorAll("[data-command]").forEach(_e=>{const Ue=_e.dataset.command;let yt=Ue;try{yt=JSON.parse(Ue)}catch(Be){}_e.addEventListener("mousedown",Be=>Be.preventDefault()),yt&&_e.addEventListener("click",()=>e.executeCommand(yt))});const he=(r=e.field)==null?void 0:r.getBoundingClientRect();he&&(o.style.top=`${window.scrollY+(he.top-o.clientHeight-15)}px`,o.style.left=`${he.left+20}px`,o.classList.add("is-visible"))}function Vc(){const e=document.getElementById("mathlive-environment-popover");e==null||e.classList.remove("is-visible")}function Ev(){document.getElementById("mathlive-environment-popover")&&(Mc("mathlive-environment-popover"),Vs("environment-popover"),Vs("core"))}function Xu(e){if(!e.hasFocus())return;let t=!1;if(e.model.mode==="math"){const r=e.model.parentEnvironment;if(r!=null&&r.array&&ap(r.environmentName)){const n=e.options.environmentPopoverPolicy;t=n==="auto"||n==="on"}}t?xv(e):Vc()}function wv(e){return e.replace("*","")}function Sv(e){return e==="dcases"?"cases":e}function Jh(e){const t=getComputedStyle(e).direction;return t==="ltr"||t==="rtl"?t:"ltr"}function Qh(e,t,r){return t==="left"||t==="leading"&&r==="ltr"||t==="trailing"&&r==="rtl"?e.left:e.right}function Hc(e,t,r,n){return r==="middle"?e-t/2:r==="start"&&n==="rtl"||r==="end"&&n==="ltr"||r==="top"||r==="right"?Math.max(0,e-t):e}function Mv(e,t,r,n){return r==="middle"?e-t/2:r==="start"&&n==="ltr"||r==="end"&&n==="rtl"||r==="top"||r==="right"?e:e-t}function Tv(e,t){var r,n,a;const o=(r=Jh(e))!=null?r:"ltr";e.style.position="fixed",e.style.left="",e.style.top="",e.style.right="",e.style.bottom="",e.style.height="",e.style.width="";const _=e.getBoundingClientRect(),N=Number.isFinite(t.maxHeight)?Math.min(t.maxHeight,window.innerHeight):window.innerHeight;let z=Math.min(N,(n=t.height)!=null?n:_.height),W=Hc(t.location.y,z,t.verticalPos,o);W+z>window.innerHeight-8&&(t.alternateLocation?(W=Hc(t.alternateLocation.y,z,t.verticalPos,o),W+z>window.innerHeight-8&&(W=void 0)):W=void 0),Number.isFinite(W)||(W=Math.max(8,window.innerHeight-8-z),8+z>window.innerHeight-8&&(e.style.bottom="8px")),z=Math.min(W+z,window.innerHeight-8)-W;const j=Number.isFinite(t.maxWidth)?Math.min(t.maxWidth,window.innerWidth):window.innerWidth;let X=Math.min(j,(a=t.width)!=null?a:_.width),ae=Hc(t.location.x,X,t.horizontalPos,o);ae+X>window.innerWidth-8&&(t.alternateLocation?(ae=Mv(t.alternateLocation.x,X,t.verticalPos,o),ae+X>window.innerWidth-8&&(ae=void 0)):ae=void 0),Number.isFinite(ae)||(ae=Math.max(8,window.innerWidth-8-X),8+X>window.innerWidth-8&&(e.style.right="8px")),X=Math.min(ae+X,window.innerWidth-8)-ae,o==="rtl"?e.style.right=`${Math.ceil(window.innerWidth-ae-X).toString()}px`:e.style.left=`${Math.ceil(ae).toString()}px`,e.style.top=`${Math.ceil(W).toString()}px`,z!==_.height&&(e.style.height=`${Math.ceil(z).toString()}px`),X!==_.width&&(e.style.width=`${Math.ceil(X).toString()}px`)}function Dv(e,t){return Math.hypot(t.x-e.x,t.y-e.y)}function tl(e){return"submenu"in e}function gs(e){return"type"in e&&e.type==="command"||"onMenuSelect"in e||"id"in e}function jc(e){return"type"in e&&e.type==="divider"}function Gc(e){return"type"in e&&e.type==="heading"}var ed={};function Zc(e){let t=ed[e];if(!t){let r;switch(e){case"checkmark":r=`<span aria-hidden="true" class="ui-checkmark"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M435.848 83.466L172.804 346.51l-96.652-96.652c-4.686-4.686-12.284-4.686-16.971 0l-28.284 28.284c-4.686 4.686-4.686 12.284 0 16.971l133.421 133.421c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-28.284-28.284c-4.686-4.686-12.284-4.686-16.97 0z"></path></svg>
</span>`;break;case"trailing-chevron":r='<span aria-hidden="true" class="ui-trailing-chevron"><svg focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"></path></svg></span>';break;case"mixedmark":r='<span aria-hidden="true" class="ui-mixedmark"><svg xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 512 512"><path fill="currentColor" d="M0 256c0-13.3 10.7-24 24-24H488c13.3 0 24 10.7 24 24s-10.7 24-24 24H24c-13.3 0-24-10.7-24-24z"/></svg></span>'}if(r){const n=document.createElement("template");n.innerHTML=r,ed[e]=n,t=n}}if(t){if("content"in t)return t.content.cloneNode(!0);const r=document.createElement("svg");return r.innerHTML=t.innerHTML,r}}var td=80,rd=class{constructor(e,t){this._element=null;var r;this.parentMenu=t,this._declaration=e,tl(e)?(this.type="submenu",this.submenu=new nd(e.submenu,{parentMenu:t,submenuClass:e.submenuClass,columnCount:e.columnCount})):this.type=(r=e.type)!=null?r:"command",this.hasCheck=gs(e)&&e.checked!==void 0}get rootMenu(){return this.parentMenu.rootMenu}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}dispose(){var e,t;(e=this._abortController)==null||e.abort(),this._abortController=void 0,(t=this._element)==null||t.remove(),this._element=null,this.submenu&&this.submenu.dispose(),this.submenu=void 0}get menuItem(){return this._declaration}get label(){var e;return(e=this._label)!=null?e:""}set label(e){e===void 0&&(e=""),e!==this._label&&(this._label=e,this.dirty=!0)}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this.dirty=!0)}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.element&&(e?this.element.removeAttribute("aria-disabled"):this.element.setAttribute("aria-disabled","true")),this.dirty=!0}get checked(){return this._checked}set checked(e){this._checked=e,this.dirty=!0}get tooltip(){return this._tooltip}set tooltip(e){e!==this._tooltip&&(this._tooltip=e,this.dirty=!0)}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){e!==this._ariaLabel&&(this._ariaLabel=e,this.dirty=!0)}get active(){var e,t;return(t=(e=this.element)==null?void 0:e.classList.contains("active"))!=null?t:!1}set active(e){this.element&&this.element.classList.toggle("active",e)}updateState(e){var t,r,n;const a=this._declaration;if(jc(a)){this.enabled=!1,this.checked=!1;return}Gc(a)&&(this.enabled=!1,this.checked=!1,this.visible=!0),gs(a)&&(this.checked=gs(a)&&((t=rl(a.checked,e))!=null?t:!1)),(gs(a)||tl(a))&&(this.enabled=(r=rl(a.enabled,e))!=null?r:!0,this.visible=(n=rl(a.visible,e))!=null?n:!0,this.visible&&this.enabled&&this.submenu&&(this.submenu.updateState(e),this.submenu.visible||(this.visible=!1))),(gs(a)||Gc(a)||tl(a))&&(this.label=rl(a.label,e),this.tooltip=rl(a.tooltip,e),this.ariaLabel=rl(a.ariaLabel,e)),this._element&&this.updateElement()}set dirty(e){console.assert(e===!0),e&&this.parentMenu&&(this.parentMenu.dirty=!0)}updateElement(){if(!this.visible||!this.element)return;const e=this.element;e.textContent="",this.enabled?e.removeAttribute("aria-disabled"):e.setAttribute("aria-disabled","true"),this.checked===!0?(e.setAttribute("aria-checked","true"),e.append(Zc("checkmark"))):this.checked==="mixed"?(e.setAttribute("aria-checked","mixed"),e.append(Zc("mixedmark"))):e.removeAttribute("aria-checked"),this.ariaLabel&&e.setAttribute("aria-label",this.ariaLabel);const t=document.createElement("span");if(t.className=this.parentMenu.hasCheck?"label indent":"label",this.type==="heading"&&t.classList.add("heading"),t.innerHTML=this.label,e.append(t),this._tooltip&&e.setAttribute("data-tooltip",this._tooltip),gs(this._declaration)&&this._declaration.keyboardShortcut){const r=document.createElement("kbd");r.innerHTML=wc(this._declaration.keyboardShortcut),e.append(r)}this.type==="submenu"&&e.append(Zc("trailing-chevron"))}get element(){if(this._element)return this._element;if(jc(this._declaration)){const r=document.createElement("li");return r.setAttribute("part","menu-divider"),r.setAttribute("role","divider"),this._element=r,r}const e=document.createElement("li");this._element=e,(gs(this._declaration)||Gc(this._declaration)||tl(this._declaration))&&this._declaration.class&&(e.className=this._declaration.class),e.setAttribute("part","menu-item"),e.setAttribute("tabindex","-1"),this.hasCheck?e.setAttribute("role","menuitemcheckbox"):e.setAttribute("role","menuitem"),this.type==="submenu"&&(e.setAttribute("aria-haspopup","true"),e.setAttribute("aria-expanded","false"));const t=this.abortController.signal;return e.addEventListener("pointerenter",this,{signal:t}),e.addEventListener("pointerleave",this,{signal:t}),e.addEventListener("pointerup",this,{signal:t}),e.addEventListener("click",this,{signal:t}),this._element}dispatchSelect(){if(!gs(this._declaration))return;const e=new CustomEvent("menu-select",{cancelable:!0,bubbles:!0,detail:{modifiers:this.rootMenu.modifiers,id:this._declaration.id,data:this._declaration.data}});this.parentMenu.dispatchEvent(e)&&typeof this._declaration.onMenuSelect=="function"&&this._declaration.onMenuSelect({modifiers:this.rootMenu.modifiers,id:this._declaration.id,data:this._declaration.data})}handleEvent(e){var t;if(!(!this.visible||!this.enabled)){if(e.type==="click"){this.rootMenu.state==="modal"&&this.select(),e.stopPropagation(),e.preventDefault();return}if(e.type==="pointerenter"){const r=e;this.rootMenu.cancelDelayedOperation(),this.parentMenu.isSubmenuOpen&&((t=this.parentMenu.activeMenuItem)!=null&&t.movingTowardSubmenu(r))?this.rootMenu.scheduleOperation(()=>{this.parentMenu.activeMenuItem=this,this.openSubmenu()}):(this.parentMenu.activeMenuItem=this,this.openSubmenu({withDelay:!0}));return}if(e.type==="pointerleave"){this.rootMenu.activeSubmenu===this.parentMenu&&(this.parentMenu.activeMenuItem=null);return}if(e.type==="pointerup"){this.rootMenu.state!=="modal"&&this.select(),e.stopPropagation(),e.preventDefault();return}}}select(){if(this.rootMenu.cancelDelayedOperation(),this.type==="submenu"){this.openSubmenu();return}this.active=!1,setTimeout(()=>{this.active=!0,setTimeout(()=>{this.rootMenu.hide(),this.dispatchSelect()},td)},td)}openSubmenu(e){var t;if(this.type!=="submenu"||!this.element)return;if((t=e==null?void 0:e.withDelay)!=null&&t){this.rootMenu.scheduleOperation(()=>this.openSubmenu());return}const r=this.element.getBoundingClientRect(),n=Jh(this.element);this.submenu.show({container:this.rootMenu.element.parentNode,location:{x:Qh(r,"trailing",n),y:r.top-4},alternateLocation:{x:Qh(r,"leading",n),y:r.top-4}})}movingTowardSubmenu(e){if(!this.element||this.type!=="submenu")return!1;const t=this.rootMenu.lastMoveEvent;if(!t)return!1;const r=e.timeStamp-t.timeStamp;if(r>500)return!1;const n=e.clientX-t.clientX;if(Av(n,t.clientY-e.clientY,r)<=.2)return!1;let o="right";if(this.submenu.element){const _=this.submenu.element.getBoundingClientRect(),N=this.element.getBoundingClientRect();_.left<N.left+N.width/2&&(o="left")}return o==="right"?n>0:n<0}};function Av(e,t,r){return Math.hypot(e,t)/r}function rl(e,t){return e===void 0||typeof e!="function"?e:(t!=null||(t={alt:!1,control:!1,shift:!1,meta:!1}),e(t))}var nd=class cl{constructor(t,r){this._element=null,this._activeMenuItem=null,this._dirty=!0;var n,a;this.parentMenu=(n=r==null?void 0:r.parentMenu)!=null?n:null,this._submenuClass=r==null?void 0:r.submenuClass,this.columnCount=(a=r==null?void 0:r.columnCount)!=null?a:1,this.isSubmenuOpen=!1,this.menuItems=t}get children(){return this._menuItems}set menuItems(t){const r=this.parentMenu;this.dispose(),this.parentMenu=r,t=[...t],this._menuItems=t.map(n=>n.onCreate?n.onCreate(n,this):new rd(n,this)),this.hasCheck=void 0,this.dirty=!0}dispose(){var t;this.hide(),this._element&&this._element.remove(),this._abortController&&this._abortController.abort(),(t=this._menuItems)==null||t.forEach(r=>r.dispose()),this._menuItems=[],this._activeMenuItem=null,this.parentMenu=null}handleEvent(t){if(t.type==="wheel"&&this._element){const r=t;this._element.scrollBy(0,r.deltaY),t.stopPropagation()}}dispatchEvent(t){return this.rootMenu.dispatchEvent(t)}get rootMenu(){return this.parentMenu.rootMenu}updateState(t){var r,n,a;this._menuItems.forEach(W=>W.updateState(t));const o=this.hasCheck;this.hasCheck=this._menuItems.some(W=>W.visible&&W.hasCheck),this.hasCheck!==o&&this._menuItems.forEach(W=>W.updateState(t));let _,N=0;for(const W of this._menuItems)W.type==="heading"?(_&&N===0&&(_.visible=!1),_=W,N=0):W.type==="divider"&&_?(_.visible=N>0,_=void 0,N=0):_&&W.visible&&(N+=1);_&&(_.visible=N>0);let z=!0;for(const W of this._menuItems)W.type==="divider"?(W.visible=!z,z=!0):W.visible&&(z=!1);(r=this.activeMenuItem)!=null&&r.visible||(this.activeMenuItem=null),!((n=this.activeMenuItem)!=null&&n.enabled)&&((a=this.activeMenuItem)==null?void 0:a.type)==="submenu"&&this._activeMenuItem.submenu.hide(),this._dirty=!1}get enabled(){return this.updateIfDirty(),this._menuItems.some(t=>t.type!=="divider"&&t.visible&&t.enabled)}get visible(){return this.updateIfDirty(),this._menuItems.some(t=>t.type!=="divider"&&t.visible)}set dirty(t){console.assert(t===!0),this._dirty!==t&&t&&this.parentMenu&&(this._dirty=!0,this.parentMenu.dirty=!0)}updateIfDirty(){this._dirty&&this.updateState(this.rootMenu.modifiers)}updateElement(){var t;if(this._element){this._element.textContent="";for(const{element:r,visible:n}of this._menuItems)r&&n&&this._element.append(r);(t=this._element.querySelector("li:first-of-type"))==null||t.setAttribute("tabindex","0")}}get element(){if(this._element)return this._element;const t=document.createElement("menu");t.setAttribute("role","menu"),t.setAttribute("tabindex","-1"),t.setAttribute("aria-orientation","vertical"),t.setAttribute("part","ui-menu-container"),this._submenuClass&&t.classList.add(this._submenuClass),t.classList.add("ui-menu-container"),this._abortController||(this._abortController=new AbortController);const r=this._abortController.signal;return t.addEventListener("focus",this,{signal:r}),t.addEventListener("wheel",this,{passive:!0,signal:r}),this._element=t,this.updateElement(),t}get activeMenuItem(){return this._activeMenuItem}set activeMenuItem(t){var r,n,a,o;if(this.rootMenu.cancelDelayedOperation(),t!==this._activeMenuItem){if(this.activeMenuItem){const _=this.activeMenuItem;_.active=!1,(r=_.submenu)==null||r.hide()}if(!((n=t==null?void 0:t.visible)==null||n)){this._activeMenuItem=null;return}this._activeMenuItem=t,t&&(t.active=!0)}t?(a=t.element)==null||a.focus({preventScroll:!0}):(o=this._element)==null||o.focus({preventScroll:!0})}get firstMenuItem(){this.updateIfDirty();let t=0,r=!1;const n=this._menuItems;for(;!r&&t<=n.length-1;){const a=n[t];r=a.type!=="divider"&&a.visible&&a.enabled,t+=1}return r?n[t-1]:null}get lastMenuItem(){this.updateIfDirty();const t=this._menuItems;let r=t.length-1,n=!1;for(;!n&&r>=0;){const a=t[r];n=a.type!=="divider"&&a.visible&&a.enabled,r-=1}return n?t[r+1]:null}nextMenuItem(t){if(t===0)return this._activeMenuItem;if(!this._activeMenuItem)return t>0?this.firstMenuItem:this.lastMenuItem;if(!this.firstMenuItem||!this.lastMenuItem||!this._activeMenuItem)return null;this.updateIfDirty();const r=this._menuItems.indexOf(this.firstMenuItem),n=this._menuItems.indexOf(this.lastMenuItem);let a=this._menuItems.indexOf(this._activeMenuItem),o=1;for(;a>=r&&a<=n;){a+=t>0?1:-1;const _=this._menuItems[a];if(!_)break;if(_.visible&&_.enabled){if(o===Math.abs(t))return this._menuItems[a];o+=1}}return t>0?this.lastMenuItem:this.firstMenuItem}getMenuItemColumn(t){this.updateIfDirty();const n=this._menuItems.filter(a=>a.visible&&a.enabled).indexOf(t);return n<0?-1:n%this.columnCount}static get collator(){return cl._collator||(cl._collator=new Intl.Collator(void 0,{usage:"search",sensitivity:"base"})),cl._collator}findMenuItem(t){var r;this.updateIfDirty();const n=this._menuItems.filter(N=>N.type!=="divider"&&N.visible&&N.enabled);if(n.length===0)return null;const a=Math.max(...n.map(N=>N.label.length))-t.length;if(a<0)return null;let o=null,_=0;for(;_<a&&!o;)o=(r=n.find(N=>cl.collator.compare(t,N.label.substring(_,t.length))===0))!=null?r:null,_++;return o}show(t){return!this.visible||!t.container?!1:(this.updateElement(),t.container.appendChild(this.element),d()&&(this.element.popover="manual",this.element.showPopover()),t.location&&Tv(this.element,{location:t.location,alternateLocation:t.alternateLocation,verticalPos:"bottom",horizontalPos:"start"}),this.element.focus({preventScroll:!0}),this.parentMenu&&(this.parentMenu.openSubmenu=this),!0)}hide(){var t,r,n,a,o;this.openSubmenu=null,this.activeMenuItem=null,this.parentMenu&&(this.parentMenu.openSubmenu=null),d()&&((t=this._element)!=null&&t.popover)&&this.element.hidePopover(),(n=(r=this.parentMenu)==null?void 0:r.element)==null||n.focus(),(o=(a=this._element)==null?void 0:a.parentNode)==null||o.removeChild(this._element)}set openSubmenu(t){var r,n,a,o;const _=t!==null;((r=this.activeMenuItem)==null?void 0:r.type)==="submenu"&&((n=this.activeMenuItem.element)==null||n.setAttribute("aria-expanded",_.toString())),(o=(a=this.activeMenuItem)==null?void 0:a.element)==null||o.classList.toggle("is-submenu-open",_),this.isSubmenuOpen=_}},id=class s0 extends nd{constructor(t,r){var n;super(t),this.state="closed",this.typingBufferResetTimer=0,this.hysteresisTimer=0,this._updating=!1,this._host=(n=r==null?void 0:r.host)!=null?n:null,this.isDynamic=t.some(ad),this._modifiers={shift:!1,control:!1,alt:!1,meta:!1},this.typingBuffer="",this.state="closed"}get modifiers(){return this._modifiers}set modifiers(t){Gp(this._modifiers,t)||(this._modifiers=t,this.dirty=!0)}get activeSubmenu(){let t=this;for(;t.isSubmenuOpen;)t=t.activeMenuItem.submenu;return t}set dirty(t){this._updating||(console.assert(t===!0),this._dirty!==t&&(this._dirty=!0,t&&setTimeout(()=>{this.updateState(this.modifiers),this.updateElement()})))}updateState(t){this._updating=!0,this.modifiers=t!=null?t:this.modifiers,super.updateState(this.modifiers),this._updating=!1}handleKeyupEvent(t){this.isDynamic&&(this.modifiers=yo(t)),t.stopImmediatePropagation()}handleKeydownEvent(t){var r,n,a;if(t.key==="Tab"||t.key==="Escape"){this.hide();return}this.isDynamic&&(this.modifiers=yo(t));let o=!0;const _=this.activeSubmenu,N=_.activeMenuItem;switch(t.key){case" ":case"Space":case"Return":case"Enter":N==null||N.select(yo(t));break;case"ArrowRight":if((N==null?void 0:N.type)==="submenu")N.select(yo(t)),this.activeSubmenu.activeMenuItem=this.activeSubmenu.firstMenuItem;else if(!N)_.activeMenuItem=_.firstMenuItem;else{const z=(r=_.getMenuItemColumn(N))!=null?r:-1;if(z>=0&&z<((n=_.columnCount)!=null?n:1)-1){const W=_.nextMenuItem(1);W&&(_.activeMenuItem=W)}}break;case"ArrowLeft":if(_===this.rootMenu)N||(_.activeMenuItem=_.firstMenuItem);else if((N&&(a=_.getMenuItemColumn(N))!=null?a:-1)<=0||!N){_.hide();const W=_.parentMenu.activeMenuItem;if(W){const{element:j}=W;j==null||j.focus(),j==null||j.classList.remove("is-submenu-open")}}else{const W=_.nextMenuItem(-1);W&&(_.activeMenuItem=W)}break;case"ArrowDown":_.activeMenuItem=_.nextMenuItem(_.columnCount);break;case"ArrowUp":_.activeMenuItem=_.nextMenuItem(-_.columnCount);break;case"Home":case"PageUp":_.activeMenuItem=_.firstMenuItem;break;case"End":case"PageDown":_.activeMenuItem=_.lastMenuItem;break;case"Backspace":if(this.typingBuffer&&(this.typingBuffer=this.typingBuffer.slice(0,-1),this.typingBuffer)){clearTimeout(this.typingBufferResetTimer);const z=_.findMenuItem(this.typingBuffer);z&&(_.activeMenuItem=z),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}break;default:if(Mu(t)){isFinite(this.typingBufferResetTimer)&&clearTimeout(this.typingBufferResetTimer),this.typingBuffer+=t.key;const z=_.findMenuItem(this.typingBuffer);z&&(_.activeMenuItem=z),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}else o=!1}o&&(t.preventDefault(),t.stopPropagation())}handleEvent(t){if(t.type==="keydown")this.handleKeydownEvent(t);else if(t.type==="keyup")this.handleKeyupEvent(t);else if(t.type==="pointermove")this.lastMoveEvent=t;else if(t.type==="pointerup"&&t.target===this.scrim)Number.isFinite(this.rootMenu._openTimestamp)&&Date.now()-this.rootMenu._openTimestamp<120?this.state="modal":this.state==="modal"&&this.hide();else if(t.type==="contextmenu"){t.preventDefault(),t.stopPropagation();return}super.handleEvent(t)}dispatchEvent(t){return this._host?this._host.dispatchEvent(t):!0}get scrim(){return ds.element}connectScrim(t){const r=this.scrim;r.addEventListener("pointerup",this),r.addEventListener("contextmenu",this),r.addEventListener("keydown",this),r.addEventListener("keyup",this),r.addEventListener("pointermove",this),ds.open({root:t,onDismiss:()=>this.hide()})}disconnectScrim(){const t=this.scrim;t.removeEventListener("pointerup",this),t.removeEventListener("contextmenu",this),t.removeEventListener("keydown",this),t.removeEventListener("keyup",this),t.removeEventListener("pointermove",this),ds.state==="open"&&ds.scrim.close()}get rootMenu(){return this}show(t){return this._onDismiss=t==null?void 0:t.onDismiss,t!=null&&t.modifiers&&(this.modifiers=t.modifiers),this.updateState(),this.connectScrim(t==null?void 0:t.target),super.show(i(F({},t),{container:this.scrim}))?(this._openTimestamp=Date.now(),this.state="open",!0):(this.disconnectScrim(),!1)}hide(){this.cancelDelayedOperation(),this.state!==void 0&&(this.state!=="closed"&&(this.activeMenuItem=null,ds.element.parentElement.focus(),super.hide(),this.state="closed",this.disconnectScrim()),this._onDismiss&&(this._onDismiss(),this._onDismiss=void 0))}scheduleOperation(t){this.cancelDelayedOperation();const r=s0.SUBMENU_DELAY;if(r<=0){t();return}this.hysteresisTimer=setTimeout(()=>{this.hysteresisTimer=0,t()},r)}cancelDelayedOperation(){this.hysteresisTimer&&(clearTimeout(this.hysteresisTimer),this.hysteresisTimer=0)}};id.SUBMENU_DELAY=120;var kv=id;function ad(e){return jc(e)?!1:typeof e.label=="function"||typeof e.ariaLabel=="function"||typeof e.tooltip=="function"||(gs(e)||tl(e))&&(typeof e.enabled=="function"||typeof e.visible=="function")||gs(e)&&typeof e.checked=="function"?!0:tl(e)?e.submenu.some(ad):!1}var qu=class{};qu.DELAY=300,qu.MAX_DISTANCE=10;function Cv(e){return new Promise((t,r)=>{const n=Su(e);n||t(!1);let a=n;const o=setTimeout(()=>{_.abort(),t(Dv(a,n)<qu.MAX_DISTANCE)},qu.DELAY),_=new AbortController,N=_.signal;for(const z of["pointermove","pointerup","pointercancel"])window.addEventListener(z,W=>{if(W.type==="pointerup"||W.type==="pointercancel")clearTimeout(o),_.abort(),t(!1);else if(W.type==="pointermove"){const j=Su(W);j&&(a=j)}},{passive:!0,signal:N})})}function sd(e,t,r){return qs(this,null,function*(){if(e.type==="contextmenu"){const n=e;if(r.show({target:t,location:Su(n),modifiers:yo(n)}))return e.preventDefault(),e.stopPropagation(),!0}if(e.type==="keydown"){const n=e;if(n.code==="ContextMenu"||n.code==="F10"&&n.shiftKey){const a=t==null?void 0:t.getBoundingClientRect();if(a&&r.show({target:t,location:{x:Math.ceil(a.left+a.width/2),y:Math.ceil(a.top+a.height/2)},modifiers:yo(n)}))return e.preventDefault(),e.stopPropagation(),!0}}if(e.type==="pointerdown"&&e.pointerType!=="mouse"&&e.button===0){let n=e.target;for(;n&&t!==n;)n=n.parentNode;if(!n||!r.visible)return!1;const a=Su(e);if(yield Cv(e))return r.state!=="closed"?!1:(r.show({target:t,location:a}),!0)}return!1})}var od={acute:714,grave:715,dot:729,ddot:168,mathring:730,tilde:126,bar:713,breve:728,check:711,hat:94,vec:8407};ke(Object.keys(od),"{body:auto}",{createAtom:e=>new pu(i(F({},e),{body:J(e.args[0]),accentChar:od[e.command.slice(1)]}))}),ke(["widehat","widecheck","widetilde"],"{body:auto}",{createAtom:e=>{const t=vt(J(e.args[0]));return new pu(i(F({},e),{body:J(e.args[0]),svgAccent:e.command.slice(1)+(t.length>5?"4":["1","1","2","2","3","3"][t.length])}))}}),ke(["overarc","overparen","wideparen"],"{body:auto}",{createAtom:e=>new pu(i(F({},e),{body:J(e.args[0]),svgAccent:"overarc"}))}),ke(["underarc","underparen"],"{body:auto}",{createAtom:e=>new za(i(F({},e),{body:J(e.args[0]),svgBelow:"underarc"}))}),ke("utilde","{body:auto}",{createAtom:e=>{const t=J(e.args[0]),r=vt(t),n="widetilde"+(r.length>5?"4":["1","1","2","2","3","3"][r.length]);return new za(i(F({},e),{body:t,svgBelow:n,boxType:dl(t)}))}}),ke("^","{:string}",{createAtom:e=>{var t;return new Qe(i(F({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&(t={a:"\xE2",e:"\xEA",i:"\xEE",o:"\xF4",u:"\xFB",A:"\xC2",E:"\xCA",I:"\xCE",O:"\xD4",U:"\xDB"}[e.args[0]])!=null?t:"^"}))}}),ke("`","{:string}",{createAtom:e=>{var t;return new Qe(i(F({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&(t={a:"\xE0",e:"\xE8",i:"\xEC",o:"\xF2",u:"\xF9",A:"\xC0",E:"\xC8",I:"\xCC",O:"\xD2",U:"\xD9"}[e.args[0]])!=null?t:"`"}))}}),ke("'","{:string}",{createAtom:e=>{var t;return new Qe(i(F({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&(t={a:"\xE1",e:"\xE9",i:"\xED",o:"\xF3",u:"\xFA",A:"\xC1",E:"\xC9",I:"\xCD",O:"\xD3",U:"\xDA"}[e.args[0]])!=null?t:"'"}))}}),ke('"',"{:string}",{createAtom:e=>{var t,r;return new Qe(i(F({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:(t=e.args)!=null&&t[0]?(r={a:"\xE4",e:"\xEB",i:"\xEF",o:"\xF6",u:"\xFC",A:"\xC4",E:"\xCB",I:"\xCB",O:"\xD6",U:"\xDC"}[e.args[0]])!=null?r:'"'+e.args[0]:'"'}))}}),ke(".","{:string}",{createAtom:e=>{var t,r;return new Qe(i(F({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:(t=e.args)!=null&&t[0]?(r={a:"\u0227",e:"\u0117",i:"\u0307i",o:"\u022F",u:"\u0307u",A:"\u0226",E:"\u0116",I:"\u0130",O:"\u022E",U:"\u0307U"}[e.args[0]])!=null?r:"."+e.args[0]:"."}))}}),ke("=","{:string}",{createAtom:e=>{var t,r;return new Qe(i(F({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:(t=e.args)!=null&&t[0]?(r={a:"\u0101",e:"\u0113",i:"\u012B",o:"\u014D",u:"\u016B",A:"\u0100",E:"\u0112",I:"\u012A",O:"\u014C",U:"\u016A"}[e.args[0]])!=null?r:"="+e.args[0]:"="}))}}),ke("~","{:string}",{createAtom:e=>{var t;return new Qe(i(F({type:"mord"},e),{isFunction:!1,limits:"adjacent",value:e.args[0]&&(t={n:"\xF1",N:"\xD1",a:"\xE3",o:"\xF5",A:"\xC3",O:"\xD5"}[e.args[0]])!=null?t:"\xB4"}))}}),ke("c","{:string}",{createAtom:e=>{var t;return new Qe(i(F({},e),{type:"mord",isFunction:!1,limits:"adjacent",value:e.args[0]&&(t={c:"\xE7",C:"\xC7"}[e.args[0]])!=null?t:""}))}}),ke("enclose","{notation:string}[style:string]{body:auto}",{createAtom:e=>{var t,r;const n=e.args,a={strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"none",svgStrokeStyle:void 0,borderStyle:void 0,style:(t=e.style)!=null?t:{}};if(n[1]){const _=n[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const N of _){const z=N.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(z)a.strokeWidth=z[1],a.strokeStyle=z[2],a.strokeColor=z[3];else{const W=N.match(/\s*([a-z]*)\s*=\s*"(.*)"/);W&&(W[1]==="mathbackground"?a.backgroundcolor=W[2]:W[1]==="mathcolor"?a.strokeColor=W[2]:W[1]==="padding"?a.padding=W[2]:W[1]==="shadow"&&(a.shadow=W[2]))}}a.strokeStyle==="dashed"?a.svgStrokeStyle="5,5":a.strokeStyle==="dotted"&&(a.svgStrokeStyle="1,5")}a.borderStyle=`${a.strokeWidth} ${a.strokeStyle} ${a.strokeColor}`;const o={};return((r=n[0])!=null?r:"").split(/[, ]/).filter(_=>_.length>0).forEach(_=>{o[_.toLowerCase()]=!0}),new bl(e.command,J(n[2]),o,a)}}),ke("cancel","{body:auto}",{createAtom:e=>{var t;return new bl(e.command,J(e.args[0]),{updiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(t=e.style)!=null?t:{}})}}),ke("bcancel","{body:auto}",{createAtom:e=>{var t;return new bl(e.command,J(e.args[0]),{downdiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(t=e.style)!=null?t:{}})}}),ke("xcancel","{body:auto}",{createAtom:e=>{var t;return new bl(e.command,J(e.args[0]),{updiagonalstrike:!0,downdiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(t=e.style)!=null?t:{}})}}),ke(["overrightarrow","overleftarrow","Overrightarrow","overleftharpoon","overrightharpoon","overleftrightarrow","overlinesegment","overgroup"],"{:auto}",{createAtom:e=>{var t;return new za(i(F({},e),{body:J((t=e.args)==null?void 0:t[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgAbove:e.command.slice(1)}))}}),ke("overbrace","{:auto}",{createAtom:e=>new za(i(F({},e),{body:J(e.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgAbove:e.command.slice(1)}))}),ke(["underrightarrow","underleftarrow","underleftrightarrow","underlinesegment","undergroup"],"{:auto}",{createAtom:e=>new za(i(F({},e),{body:J(e.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgBelow:e.command.slice(1)}))}),ke(["underbrace"],"{:auto}",{createAtom:e=>new za(i(F({},e),{body:J(e.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgBelow:e.command.slice(1)}))}),ke(["xrightarrow","longrightarrow","xleftarrow","longleftarrow","xRightarrow","xLeftarrow","xleftharpoonup","xleftharpoondown","xrightharpoonup","xrightharpoondown","xlongequal","xtwoheadleftarrow","xtwoheadrightarrow","xleftrightarrow","longleftrightarrow","xLeftrightarrow","xrightleftharpoons","longrightleftharpoons","xleftrightharpoons","xhookleftarrow","xhookrightarrow","xmapsto","xtofrom","xleftrightarrows","longleftrightarrows","xRightleftharpoons","longRightleftharpoons","xLeftrightharpoons","longLeftrightharpoons"],"[:auto]{:auto}",{createAtom:e=>{var t,r,n,a,o;return new za(i(F({},e),{svgBody:e.command.slice(1),above:((r=J((t=e.args)==null?void 0:t[1]))==null?void 0:r.length)===0?void 0:J((n=e.args)==null?void 0:n[1]),below:(o=J((a=e.args)==null?void 0:a[0]))!=null?o:null,skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,paddedLabels:!0,boxType:"rel"}))},serialize:(e,t)=>e.command+(e.hasEmptyBranch("below")?"":`[${e.belowToLatex(t)}]`)+`{${e.aboveToLatex(t)}}${e.supsubToLatex(t)}`}),ke(["arccos","arcsin","arctan","arctg","arcctg","arg","ch","cos","cosh","cot","cotg","coth","ctg","cth","csc","cosec","deg","dim","exp","gcd","hom","inf","ker","lb","lg","ln","log","Pr","sec","sh","sin","sinh","sup","tan","tanh","tg","th","arcsec","arccsc","arsinh","arcosh","artanh","arcsech","arccsch"],"",{isFunction:!0,ifMode:"math",createAtom:e=>new _o(e.command.slice(1),i(F({},e),{limits:"adjacent",isFunction:!0,variant:"main",variantStyle:"up"}))}),ke(["liminf","limsup"],"",{ifMode:"math",createAtom:e=>new _o({"\\liminf":"lim inf","\\limsup":"lim sup"}[e.command],i(F({},e),{limits:"over-under",variant:"main"}))}),ke(["lim","mod"],"",{ifMode:"math",createAtom:e=>new _o(e.command.slice(1),i(F({},e),{limits:"over-under",variant:"main"}))}),ke(["det","max","min"],"",{ifMode:"math",isFunction:!0,createAtom:e=>new _o(e.command.slice(1),i(F({},e),{limits:"over-under",isFunction:!0,variant:"main"}))}),ke(["ang"],"{:math}",{ifMode:"math",createAtom:e=>new Qe(i(F({},e),{body:J(e.args[0])})),serialize:(e,t)=>`\\ang{${e.bodyToLatex(t)}}`,render:(e,t)=>{const r=e.createBox(t),n=r.caret;r.caret=void 0;const a=new St("\xB0",{style:i(F({},e.style),{variant:"normal",variantStyle:"up"})});return new St([r,a],{type:"inner",isSelected:e.isSelected,caret:n})}}),ke("sqrt","[index:auto]{radicand:expression}",{ifMode:"math",createAtom:e=>new lh(i(F({},e),{body:J(e.args[1]),index:e.args[0]?J(e.args[0]):void 0}))}),ke(["frac","dfrac","tfrac","cfrac","binom","dbinom","tbinom"],"{:expression}{:expression}",{ifMode:"math",createAtom:e=>{const t=F({},e),r=e.command,n=e.args;switch(r){case"\\dfrac":case"\\frac":case"\\tfrac":t.hasBarLine=!0;break;case"\\atopfrac":t.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":t.hasBarLine=!1,t.leftDelim="(",t.rightDelim=")";break;case"\\cfrac":t.hasBarLine=!0,t.continuousFraction=!0;break;default:}switch(r){case"\\dfrac":case"\\dbinom":t.mathstyleName="displaystyle";break;case"\\tfrac":case"\\tbinom":t.mathstyleName="textstyle";break;default:}return new jo(n[0]?J(n[0]):[new Ls],n[1]?J(n[1]):[new Ls],t)},serialize:(e,t)=>{const r=e.aboveToLatex(t),n=e.belowToLatex(t);return/^[0-9]$/.test(r)&&/^[0-9]$/.test(n)?`${e.command}${r}${n}`:qn(e.command,r,n)}}),ke(["brace","brack"],"",{infix:!0,createAtom:e=>new jo(J(e.args[0]),J(e.args[1]),i(F({},e),{hasBarLine:!1,leftDelim:e.command==="\\brace"?"\\lbrace":"\\lbrack",rightDelim:e.command==="\\brace"?"\\rbrace":"\\rbrack"})),serialize:(e,t)=>Jr([e.aboveToLatex(t),e.command,e.belowToLatex(t)])}),ke(["over","atop","choose"],"",{infix:!0,createAtom:e=>{let t,r;const n=e.args;return e.command==="\\choose"&&(t="(",r=")"),new jo(J(n[0]),J(n[1]),i(F({},e),{hasBarLine:e.command==="\\over",leftDelim:t,rightDelim:r}))},serialize:(e,t)=>Jr([e.aboveToLatex(t),e.command,e.belowToLatex(t)])}),ke(["overwithdelims","atopwithdelims"],"{numer:auto}{denom:auto}{left-delim:delim}{right-delim:delim}",{infix:!0,createAtom:e=>{var t,r;const n=e.args;return new jo(J(n[0]),J(n[1]),i(F({},e),{leftDelim:(t=n[2])!=null?t:".",rightDelim:(r=n[3])!=null?r:".",hasBarLine:!1}))},serialize:(e,t)=>`${e.aboveToLatex(t)} ${e.command}${e.leftDelim}${e.rightDelim}${e.belowToLatex(t)}`}),ke("pdiff","{numerator}{denominator}",{ifMode:"math",createAtom:e=>new jo(J(e.args[0]),J(e.args[1]),i(F({},e),{hasBarLine:!0,numerPrefix:"\u2202",denomPrefix:"\u2202"}))}),ke(["sum","prod","bigcup","bigcap","coprod","bigvee","bigwedge","biguplus","bigotimes","bigoplus","bigodot","bigsqcup","intop"],"",{ifMode:"math",createAtom:e=>new _c({coprod:"\u2210",bigvee:"\u22C1",bigwedge:"\u22C0",biguplus:"\u2A04",bigcap:"\u22C2",bigcup:"\u22C3",intop:"\u222B",prod:"\u220F",sum:"\u2211",bigotimes:"\u2A02",bigoplus:"\u2A01",bigodot:"\u2A00",bigsqcup:"\u2A06",smallint:"\u222B"}[e.command.slice(1)],i(F({},e),{limits:"auto",variant:"main"}))}),ke("smallint","",{ifMode:"math",createAtom:e=>new _o("\u222B",i(F({},e),{limits:"adjacent",variant:"main"}))});var ld={int:"\u222B",iint:"\u222C",iiint:"\u222D",oint:"\u222E",oiint:"\u222F",oiiint:"\u2230",intclockwise:"\u2231",varointclockwise:"\u2232",ointctrclockwise:"\u2233",intctrclockwise:"\u2A11",sqcup:"\u2294",sqcap:"\u2293",uplus:"\u228E",wr:"\u2240",amalg:"\u2A3F",Cap:"\u22D2",Cup:"\u22D3",doublecap:"\u22D2",doublecup:"\u22D3"};ke(Object.keys(ld),"",{ifMode:"math",createAtom:e=>{const t=e.command,r=ld[t.slice(1)];return new _c(r,i(F({},e),{limits:"adjacent",variant:{"\u22D2":"ams","\u22D3":"ams"}[r]}))}}),ke(["Re","Im"],"",{ifMode:"math",createAtom:e=>new _o({"\\Re":"\u211C","\\Im":"\u2111"}[e.command],i(F({},e),{limits:"adjacent",isFunction:!0,variant:"fraktur"}))}),ke("middle","{:delim}",{ifMode:"math",createAtom:e=>{var t;return new ah(i(F({},e),{delim:(t=e.args[0])!=null?t:"|",size:1}))}}),ke("the","{:value}",{createAtom:e=>new Qe(i(F({},e),{captureSelection:!0,verbatimLatex:null})),render:(e,t)=>{var r;const n=new Qr({parent:t},e.style);let a="";e.isSelected&&(a+=" ML__selected");const o=n.evaluate(e.args[0]);return new St(((r=Wi(o))!=null?r:"").split("").map(_=>new St(_,{type:"ord",classes:a,mode:e.mode,isSelected:e.isSelected,style:F({variant:"main"},e.style)})),{type:"lift",style:e.style,caret:e.caret,isSelected:e.isSelected,classes:a}).wrap(n)},serialize:e=>{var t;return`\\the${(t=Wi(e.args[0]))!=null?t:"\\relax"}`}}),ke("mathtip","{:auto}{:math}",{createAtom:e=>new yc(i(F({},e),{body:J(e.args[0]),tooltip:J(e.args[1]),content:"math"})),serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`\\texttip{${e.bodyToLatex(t)}}{${Qe.serialize([e.tooltip],i(F({},t),{defaultMode:"math"}))}}`}),ke("texttip","{:auto}{:text}",{createAtom:e=>new yc(i(F({},e),{body:J(e.args[0]),tooltip:J(e.args[1]),content:"text"})),serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`\\texttip{${e.bodyToLatex(t)}}{${Qe.serialize([e.tooltip],i(F({},t),{defaultMode:"text"}))}}`}),ke("error","{:math}",{createAtom:e=>new Qe(i(F({},e),{body:J(e.args[0])})),serialize:(e,t)=>`\\error{${e.bodyToLatex(t)}}`,render:(e,t)=>e.createBox(t,{classes:"ML__error"})}),ke("ensuremath","{:math}",{createAtom:e=>new Qe(i(F({},e),{body:J(e.args[0])})),serialize:(e,t)=>`${e.command}{${e.bodyToLatex(i(F({},t),{defaultMode:"math"}))}}`}),ke("color","{:value}",{applyStyle:(e,t,r)=>{var n,a;return{verbatimColor:(n=Wi(t[0]))!=null?n:void 0,color:r.toColor((a=t[0])!=null?a:{string:"red"})}}}),ke("textcolor","{:value}{content:auto*}",{applyStyle:(e,t,r)=>{var n,a;return{verbatimColor:(n=Wi(t[0]))!=null?n:void 0,color:r.toColor((a=t[0])!=null?a:{string:"red"})}}}),ke("boxed","{content:math}",{createAtom:e=>new Hs(i(F({},e),{body:J(e.args[0]),framecolor:{string:"black"}}))}),ke("colorbox","{:value}{:text*}",{applyStyle:(e,t,r)=>{var n,a;return{verbatimBackgroundColor:(n=Wi(t[0]))!=null?n:void 0,backgroundColor:r.toBackgroundColor((a=t[0])!=null?a:{string:"yellow"})}}}),ke("fcolorbox","{frame-color:value}{background-color:value}{content:text}",{applyMode:"text",createAtom:e=>{var t,r;return new Hs(i(F({},e),{body:J(e.args[2]),framecolor:(t=e.args[0])!=null?t:{string:"blue"},backgroundcolor:(r=e.args[1])!=null?r:{string:"yellow"}}))},serialize:(e,t)=>{var r,n;return t.skipStyles?e.bodyToLatex(i(F({},t),{defaultMode:"text"})):qn(e.command,(r=Wi(e.framecolor))!=null?r:"",(n=Wi(e.backgroundcolor))!=null?n:"",e.bodyToLatex(i(F({},t),{defaultMode:"text"})))}}),ke("bbox","[:bbox]{body:auto}",{createAtom:e=>{var t;const r=e.args[0],n=J(e.args[1]);return r?new Hs(i(F({},e),{body:n,padding:r.padding,border:r.border,backgroundcolor:(t=r.backgroundcolor)!=null?t:void 0})):new Hs(i(F({},e),{body:n}))},serialize:(e,t)=>{var r,n;if(t.skipStyles)return e.bodyToLatex(t);let a=e.command;if(Number.isFinite(e.padding)||e.border!==void 0||e.backgroundcolor!==void 0){const o=[];e.padding&&o.push((r=Wi(e.padding))!=null?r:""),e.border&&o.push(`border: ${e.border}`),e.backgroundcolor&&o.push((n=Wi(e.backgroundcolor))!=null?n:""),a+=`[${o.join(",")}]`}return qn(a,e.bodyToLatex(t))}}),ke(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"],"{:rest}",{createAtom:e=>new Qe(i(F({},e),{body:J(e.args[0])})),render:(e,t)=>{const r=new Qr({parent:t,mathstyle:e.command.slice(1)},e.style),n=Qe.createBox(r,e.body,{type:"lift"});return e.caret&&(n.caret=e.caret),e.bind(t,n)},serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`{${Jr([e.command,e.bodyToLatex(t)])}}`}),ke(["tiny","scriptsize","footnotesize","small","normalsize","large","Large","LARGE","huge","Huge"],"",{applyStyle:e=>({fontSize:{"\\tiny":1,"\\scriptsize":2,"\\footnotesize":3,"\\small":4,"\\normalsize":5,"\\large":6,"\\Large":7,"\\LARGE":8,"\\huge":9,"\\Huge":10}[e]})}),ke("fontseries","{:string}",{ifMode:"text",applyStyle:(e,t)=>{var r;return{fontSeries:(r=t[0])!=null?r:"auto"}}}),ke("fontshape","{:string}",{ifMode:"text",applyStyle:(e,t)=>{var r;return{fontShape:(r=t[0])!=null?r:"auto"}}}),ke("fontfamily","{:string}",{ifMode:"text",applyStyle:(e,t)=>{var r;return{fontFamily:(r=t[0])!=null?r:"roman"}}}),ke("selectfont","",{ifMode:"text",applyStyle:()=>({})}),ke("bf","{:rest}",{applyStyle:()=>({fontSeries:"b",fontShape:"n",fontFamily:"roman"})}),ke(["boldsymbol","bm"],"{:math}",{applyMode:"math",createAtom:e=>new Qe(i(F({},e),{body:J(e.args[0])})),serialize:(e,t)=>`${e.command}{${e.bodyToLatex(t)}}`,render:(e,t)=>e.createBox(t,{classes:"ML__boldsymbol"})}),ke("bold","{:math*}",{applyMode:"math",applyStyle:()=>({variantStyle:"bold"})}),ke("bfseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),ke("mdseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),ke("upshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),ke("slshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),ke("scshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),ke("textbf","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),ke("textmd","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),ke("textup","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),ke("textnormal","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n",fontSeries:"m"})}),ke("textsl","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),ke("textit","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"it"})}),ke("textsc","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),ke("textrm","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"roman"})}),ke("textsf","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"sans-serif"})}),ke("texttt","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"monospace"})}),ke("mathbf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"bold"})}),ke("mathit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"italic"})}),ke("mathnormal","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"italic"})}),ke("mathbfit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"bolditalic"})}),ke("mathrm","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"up"})}),ke("mathsf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"sans-serif",variantStyle:"up"})}),ke("mathtt","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"monospace",variantStyle:"up"})}),ke("it","{:rest}",{applyStyle:()=>({fontSeries:"m",fontShape:"it",fontFamily:"roman",variantStyle:"italic"})}),ke("rmfamily","",{applyStyle:()=>({fontFamily:"roman"})}),ke("sffamily","",{applyStyle:()=>({fontFamily:"sans-serif"})}),ke("ttfamily","",{applyStyle:()=>({fontFamily:"monospace"})}),ke(["Bbb","mathbb"],"{:math*}",{applyStyle:()=>({variant:"double-struck",variantStyle:"up"})}),ke(["frak","mathfrak"],"{:math*}",{applyStyle:()=>({variant:"fraktur",variantStyle:"up"})}),ke("mathcal","{:math*}",{applyStyle:()=>({variant:"calligraphic",variantStyle:"up"})}),ke("mathscr","{:math*}",{applyStyle:()=>({variant:"script",variantStyle:"up"})}),ke("mbox","{:text}",{ifMode:"math",createAtom:e=>new Qe(i(F({},e),{type:"mord",body:J(e.args[0]),mode:"math"})),serialize:(e,t)=>qn("\\mbox",e.bodyToLatex(i(F({},t),{defaultMode:"text"})))}),ke("text","{:text}",{ifMode:"math",applyMode:"text"}),ke(["class","htmlClass"],"{name:string}{content:auto}",{createAtom:e=>new Qe(i(F({},e),{body:J(e.args[1])})),serialize:(e,t)=>!e.args[0]||t.skipStyles?e.bodyToLatex(t):`${e.command}{${e.args[0]}}{${e.bodyToLatex(t)}}`,render:(e,t)=>{var r;return e.createBox(t,{classes:(r=e.args[0])!=null?r:""})}}),ke(["cssId","htmlId"],"{id:string}{content:auto}",{createAtom:e=>new Qe(i(F({},e),{body:J(e.args[1])})),serialize:(e,t)=>{var r;return!((r=e.args)!=null&&r[0])||t.skipStyles?e.bodyToLatex(t):`${e.command}{${e.args[0]}}{${e.bodyToLatex(t)}}`},render:(e,t)=>{var r;const n=e.createBox(t);return n.cssId=(r=e.args[0])!=null?r:"",n}}),ke("htmlData","{data:string}{content:auto}",{createAtom:e=>new Qe(i(F({},e),{body:J(e.args[1])})),serialize:(e,t)=>{var r;return!((r=e.args)!=null&&r[0])||t.skipStyles?e.bodyToLatex(t):`\\htmlData{${e.args[0]}}{${e.bodyToLatex(t)}}`},render:(e,t)=>{var r;const n=e.createBox(t);return n.htmlData=(r=e.args[0])!=null?r:"",n}}),ke(["style","htmlStyle"],"{data:string}{content:auto}",{createAtom:e=>new Qe(i(F({},e),{body:J(e.args[1])})),serialize:(e,t)=>{var r;return!((r=e.args)!=null&&r[0])||t.skipStyles?e.bodyToLatex(t):`${e.command}{${e.args[0]}}{${e.bodyToLatex(t)}}`},render:(e,t)=>{var r;const n=e.createBox(t);return n.htmlStyle=(r=e.args[0])!=null?r:"",n}}),ke("em","{:rest}",{createAtom:e=>new Qe(i(F({},e),{body:J(e.args[0])})),serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`{\\em ${e.bodyToLatex(t)}}`,render:(e,t)=>e.createBox(t,{classes:"ML__emph",boxType:"lift"})}),ke("emph","{:auto}",{createAtom:e=>new Qe(i(F({},e),{body:J(e.args[1])})),serialize:(e,t)=>t.skipStyles?e.bodyToLatex(t):`\\emph{${e.bodyToLatex(t)}}`,render:(e,t)=>e.createBox(t,{classes:"ML__emph",boxType:"lift"})});var ud={"\\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}};ke(["bigl","Bigl","biggl","Biggl","bigr","Bigr","biggr","Biggr","bigm","Bigm","biggm","Biggm","big","Big","bigg","Bigg"],"{:delim}",{createAtom:e=>{var t;return new sh(i(F({},e),{delim:(t=e.args[0])!=null?t:".",size:ud[e.command].size,delimType:ud[e.command].mclass}))}}),ke(["hspace","hspace*"],"{width:value}",{createAtom:e=>{var t;return new wl(i(F({},e),{width:(t=e.args[0])!=null?t:{dimension:0}}))}}),ke(["mkern","kern","mskip","hskip","mspace"],"{width:value}",{createAtom:e=>{var t;return new wl(i(F({},e),{width:(t=e.args[0])!=null?t:{dimension:0}}))}}),ke("mathchoice","{:math}{:math}{:math}{:math}",{createAtom:e=>new Qe(e),render:(e,t)=>{let r=0;const n=t.mathstyle.id;(n===uu||n===lo)&&(r=1),(n===$o||n===ka)&&(r=2),(n===uo||n===ra)&&(r=3);const a=J(e.args[r]);return Qe.createBox(t,a)},serialize:(e,t)=>`\\mathchoice{${Qe.serialize(e.args[0],t)}}{${Qe.serialize(e.args[1],t)}}{${Qe.serialize(e.args[2],t)}}{${Qe.serialize(e.args[3],t)}}`}),ke("mathop","{:auto}",{createAtom:e=>new Qe(i(F({},e),{type:"mop",body:J(e.args[0]),limits:"over-under",isFunction:!0,captureSelection:!0})),render:(e,t)=>{var r;let n=Qe.createBox(t,e.body);if(e.superscript||e.subscript){const a=(r=e.subsupPlacement)!=null?r:"auto";n=a==="over-under"||a==="auto"&&t.isDisplayStyle?e.attachLimits(t,{base:n}):e.attachSupsub(t,{base:n})}return new St(e.bind(t,n),{type:"op",isSelected:e.isSelected,classes:"op-group"})},serialize:(e,t)=>{const r=[qn(e.command,e.bodyToLatex(t))];return e.explicitSubsupPlacement&&(e.subsupPlacement==="over-under"&&r.push("\\limits"),e.subsupPlacement==="adjacent"&&r.push("\\nolimits"),e.subsupPlacement==="auto"&&r.push("\\displaylimits")),r.push(e.supsubToLatex(t)),Jr(r)}}),ke(["mathbin","mathrel","mathopen","mathclose","mathpunct","mathord","mathinner"],"{:auto}",{createAtom:e=>new Qe(i(F({},e),{type:{"\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[e.command],body:J(e.args[0])}))}),ke(["operatorname","operatorname*"],"{operator:math}",{createAtom:e=>{const t=J(e.args[0]).map(r=>{var n;return r.type!=="first"&&(r.type="mord",r.value=(n={"\u2217":"*","\u2212":"-"}[r.value])!=null?n:r.value,r.isFunction=!1,!r.style.variant&&!r.style.variantStyle&&(r.style.variant="main",r.style.variantStyle="up")),r});return new Qe(i(F({},e),{type:"mop",body:t,isFunction:!0,limits:e.command==="\\operatorname"?"adjacent":"over-under"}))},render:(e,t)=>{var r;let n=Qe.createBox(t,e.body);if(e.superscript||e.subscript){const a=(r=e.subsupPlacement)!=null?r:"auto";n=a==="over-under"||a==="auto"&&t.isDisplayStyle?e.attachLimits(t,{base:n}):e.attachSupsub(t,{base:n})}return e.caret&&(n.caret=e.caret),new St(e.bind(t,n),{type:"op",isSelected:e.isSelected,classes:"op-group"})},serialize:(e,t)=>{const r=[qn(e.command,e.bodyToLatex(t))];return e.explicitSubsupPlacement&&(e.subsupPlacement==="over-under"&&r.push("\\limits"),e.subsupPlacement==="adjacent"&&r.push("\\nolimits"),e.subsupPlacement==="auto"&&r.push("\\displaylimits")),r.push(e.supsubToLatex(t)),Jr(r)}}),ke(["char","unicode"],"{charcode:value}",{createAtom:e=>new Qe(i(F({},e),{type:e.mode==="text"?"text":"mord"})),serialize:e=>{var t;return`${e.command}${Wi((t=e.args[0])!=null?t:{number:10067,base:"hexadecimal"})}`},render:(e,t)=>{let r=t.evaluate(e.args[0]);return(!r||!("number"in r))&&(r={number:10067,base:"hexadecimal"}),e.value=String.fromCodePoint(r.number),e.createBox(t)}}),ke("rule","[raise:value]{width:value}{thickness:value}",{createAtom:e=>new Qe(e),render:(e,t)=>{var r,n,a;const o=new Qr({parent:t,mathstyle:"textstyle"},e.style),_=o.toEm((r=e.args[0])!=null?r:{dimension:0}),N=o.toEm((n=e.args[1])!=null?n:{dimension:10}),z=o.toEm((a=e.args[2])!=null?a:{dimension:10}),W=new St(null,{classes:"rule",type:"ord"});return W.width=N,W.height=z+_,W.depth=-_,W.setStyle("border-right-width",N,"em"),W.setStyle("border-top-width",z,"em"),W.setStyle("border-color",e.style.color),W.setStyle("vertical-align",_,"em"),e.isSelected&&W.setStyle("opacity","50%"),e.bind(o,W),e.caret&&(W.caret=e.caret),W.wrap(t)},serialize:e=>`\\rule${e.args[0]?`[${Wi(e.args[0])}]`:""}{${Wi(e.args[1])}}{${Wi(e.args[2])}}`}),ke(["overline","underline"],"{:auto}",{createAtom:e=>new Qe(i(F({},e),{body:J(e.args[0])})),render:(e,t)=>{const r=e.command.substring(1),n=new Qr({parent:t,mathstyle:"cramp"},e.style),a=Qe.createBox(n,e.body);if(!a)return null;const o=n.metrics.defaultRuleThickness/n.scalingFactor,_=new St(null,{classes:r+"-line"});_.height=o,_.maxFontSize=o*1.125*n.scalingFactor;let N;return r==="overline"?N=new Ai({shift:0,children:[{box:a},3*o,{box:_},o]}):N=new Ai({top:a.height,children:[o,{box:_},3*o,{box:a}]}),e.caret&&(N.caret=e.caret),new St(N,{classes:r,type:"ignore"})}}),ke("overset","{:auto}{base:auto}",{createAtom:e=>{const t=J(e.args[1]);return new za(i(F({},e),{above:J(e.args[0]),body:t,skipBoundary:!1,boxType:dl(t)}))},serialize:(e,t)=>qn(e.command,e.aboveToLatex(t),e.bodyToLatex(t))}),ke("underset","{:auto}{base:auto}",{createAtom:e=>{const t=J(e.args[1]);return new za(i(F({},e),{below:J(e.args[0]),body:t,skipBoundary:!1,boxType:dl(t)}))},serialize:(e,t)=>qn(e.command,e.belowToLatex(t),e.bodyToLatex(t))}),ke("overunderset","{above:auto}{below:auto}{base:auto}",{createAtom:e=>{const t=J(e.args[2]);return new za(i(F({},e),{above:J(e.args[0]),below:J(e.args[1]),body:t,skipBoundary:!1,boxType:dl(t)}))},serialize:(e,t)=>qn(e.command,e.belowToLatex(t),e.bodyToLatex(t))}),ke(["stackrel","stackbin"],"[below:auto]{above:auto}{base:auto}",{createAtom:e=>new za(i(F({},e),{body:J(e.args[2]),above:J(e.args[1]),below:J(e.args[0]),skipBoundary:!1,boxType:e.command==="\\stackrel"?"rel":"bin"})),serialize:(e,t)=>qn(e.command,e.aboveToLatex(t),e.bodyToLatex(t))}),ke("smash","[:string]{:auto}",{createAtom:e=>{var t,r,n,a;return new El(i(F({},e),{body:J(e.args[1]),smashHeight:(r=(t=e.args[0])==null?void 0:t.includes("t"))!=null?r:!0,smashDepth:(a=(n=e.args[0])==null?void 0:n.includes("b"))!=null?a:!0}))}}),ke(["vphantom"],"{:auto}",{createAtom:e=>new El(i(F({},e),{body:J(e.args[0]),isInvisible:!0,smashWidth:!0}))}),ke(["hphantom"],"{:auto}",{createAtom:e=>new El(i(F({},e),{body:J(e.args[0]),isInvisible:!0,smashHeight:!0,smashDepth:!0}))}),ke(["phantom"],"{:auto}",{createAtom:e=>new El(i(F({},e),{body:J(e.args[0]),isInvisible:!0}))}),ke("not","{:math}",{createAtom:e=>{const t=J(e.args[0]);return t.length===0?new Qe(i(F({},e),{type:"mrel",value:"\uE020"})):new Qe(i(F({},e),{body:[new go(i(F({},e),{body:"\uE020",align:"right"})),...t],captureSelection:!0}))},serialize:(e,t)=>{const r=e.args[0],n=r&&typeof r=="object"&&"group"in r;return e.value!=="\uE020"?n?`\\not{${Qe.serialize(r.group,t)}}`:`\\not${Qe.serialize(r,t)}`:n?"\\not{}":"\\not"},render:(e,t)=>{if(e.value)return e.createBox(t);const n=e.args[0]&&typeof e.args[0]=="object"&&"group"in e.args[0]?"ord":dl(J(e.args[0])),a=Qe.createBox(t,e.body,{type:n});return e.caret&&(a.caret=e.caret),e.bind(t,a)}}),ke(["ne","neq"],"",{createAtom:e=>new Qe(i(F({},e),{type:"mrel",body:[new go(i(F({},e),{body:"\uE020",align:"right",boxType:"rel"})),new Qe(i(F({},e),{value:"="}))],captureSelection:!0})),serialize:e=>e.command}),ke("rlap","{:auto}",{createAtom:e=>new go(i(F({},e),{body:J(e.args[0]),align:"right"}))}),ke("llap","{:auto}",{createAtom:e=>new go(i(F({},e),{body:J(e.args[0]),align:"left"}))}),ke("mathrlap","{:math}",{createAtom:e=>new go(i(F({},e),{body:J(e.args[0]),align:"left"}))}),ke("mathllap","{:math}",{createAtom:e=>new go(i(F({},e),{body:J(e.args[0]),align:"left"}))}),ke("raisebox","{:value}{:text}",{createAtom:e=>{var t;return new Hs(i(F({},e),{body:J(e.args[1]),padding:{dimension:0},offset:(t=e.args[0])!=null?t:{dimension:0}}))},serialize:(e,t)=>{var r;return qn("\\raisebox",(r=Wi(e.offset))!=null?r:"0pt",e.bodyToLatex(t))}}),ke("raise","{:value}{:auto}",{createAtom:e=>{var t;return new Hs(i(F({},e),{body:J(e.args[1]),padding:{dimension:0},offset:(t=e.args[0])!=null?t:{dimension:0}}))},serialize:(e,t)=>{var r;return qn("\\raise",(r=Wi(e.offset))!=null?r:"0pt",e.bodyToLatex(t))}}),ke("lower","{:value}{:auto}",{createAtom:e=>{var t;return new Hs(i(F({},e),{body:J(e.args[1]),padding:{dimension:0},offset:(t=hs(e.args[0],-1))!=null?t:{dimension:0}}))},serialize:(e,t)=>{var r,n;return qn("\\lower",(n=Wi(hs((r=e.offset)!=null?r:{dimension:0},-1)))!=null?n:"0pt",e.bodyToLatex(t))}}),dt("0123456789/@.?!"),se(65,90),se(97,122),dt([["\\forall",8704],["\\exists",8707],["\\nexists",8708,"mord","ams"],["\\mid",8739,"mrel"],["\\top",8868],["\\bot",8869]]),dt([["\\#",35],["\\&",38],["\\parallelogram",9649],["\\spadesuit",9824],["\\heartsuit",9825],["\\diamondsuit",9826],["\\clubsuit",9827],["\\flat",9837],["\\natural",9838],["\\sharp",9839]]),dt([["\\backslash",92],["\\nabla",8711],["\\partial",8706],["\\ell",8467],["\\hbar",8463],["\\Q",81,"mord","double-struck"],["\\C",67,"mord","double-struck"],["\\P",80,"mord","double-struck"],["\\pounds",163],["\\euro",8364]]),dt([["\\rightarrow",8594],["\\to",8594],["\\leftarrow",8592],["\\gets",8592],["\\Rightarrow",8658],["\\Leftarrow",8656],["\\longrightarrow",10230],["\\longleftarrow",10229],["\\Longrightarrow",10233],["\\implies",10233],["\\Longleftarrow",10232],["\\impliedby",10232],["\\longleftrightarrow",10231],["\\biconditional",10231],["\\Longleftrightarrow",10234],["\\mapsto",8614],["\\longmapsto",10236],["\\uparrow",8593],["\\downarrow",8595],["\\Uparrow",8657],["\\Downarrow",8659],["\\updownarrow",8597],["\\Updownarrow",8661],["\\hookrightarrow",8618],["\\hookleftarrow",8617],["\\rightharpoonup",8640],["\\leftharpoonup",8636],["\\rightharpoondown",8641],["\\leftharpoondown",8637],["\\searrow",8600],["\\nearrow",8599],["\\swarrow",8601],["\\nwarrow",8598],["\\originalof",8886],["\\laplace",8886],["\\imageof",8887],["\\Laplace",8887]],"mrel"),dt([["\\mapsfrom",8612,"mrel"],["\\Mapsfrom",10502,"mrel"],["\\MapsTo",10503,"mrel"],["\\Yup",8516,"mord"],["\\lightning",8623,"mrel"],["\\leftarrowtriangle",8701,"mrel"],["\\rightarrowtriangle",8702,"mrel"],["\\leftrightarrowtriangle",8703,"mrel"],["\\boxdot",8865,"mbin"],["\\bigtriangleup",9651,"mbin"],["\\bigtriangledown",9661,"mbin"],["\\boxbar",9707,"mbin"],["\\Lbag",10181,"mopen"],["\\Rbag",10182,"mclose"],["\\llbracket",10214,"mopen"],["\\rrbracket",10215,"mclose"],["\\longmapsfrom",10235,"mrel"],["\\Longmapsfrom",10237,"mrel"],["\\Longmapsto",10238,"mrel"],["\\boxslash",10692,"mbin"],["\\boxbslash",10693,"mbin"],["\\boxast",10694,"mbin"],["\\boxcircle",10695,"mbin"],["\\boxbox",10696,"mbin"],["\\fatsemi",10783,"mop"],["\\leftslice",10918,"mrel"],["\\rightslice",10919,"mrel"],["\\interleave",10996,"mbin"],["\\biginterleave",11004,"mop"],["\\sslash",11005,"mbin"],["\\talloblong",11006,"mbin"]]),dt([["\\lbrace",123,"mopen"],["\\rbrace",125,"mclose"],["\\lparen",40,"mopen"],["\\rparen",41,"mclose"],["\\langle",10216,"mopen"],["\\rangle",10217,"mclose"],["\\lfloor",8970,"mopen"],["\\rfloor",8971,"mclose"],["\\lceil",8968,"mopen"],["\\rceil",8969,"mclose"],["\\vert",8739],["\\lvert",8739,"mopen"],["\\rvert",8739,"mclose"],["\\|",8741],["\\Vert",8741],["\\mVert",8741],["\\lVert",8741,"mopen"],["\\rVert",8741,"mclose"],["\\lbrack",91,"mopen"],["\\rbrack",93,"mclose"],["\\{",123,"mopen"],["\\}",125,"mclose"],["(",40,"mopen"],[")",41,"mclose"],["[",91,"mopen"],["]",93,"mclose"],["\\ulcorner",9484,"mopen","ams"],["\\urcorner",9488,"mclose","ams"],["\\llcorner",9492,"mopen","ams"],["\\lrcorner",9496,"mclose","ams"],["\\lgroup",10222,"mopen"],["\\rgroup",10223,"mclose"],["\\lmoustache",9136,"mopen"],["\\rmoustache",9137,"mclose"]]),dt([["\\dashrightarrow",8674],["\\dashleftarrow",8672],["\\Rrightarrow",8667],["\\Lleftarrow",8666],["\\leftrightarrows",8646],["\\rightleftarrows",8644],["\\curvearrowright",8631],["\\curvearrowleft",8630],["\\rightrightarrows",8649],["\\leftleftarrows",8647],["\\upuparrows",8648],["\\downdownarrows",8650],["\\vartriangle",9651],["\\triangleq",8796],["\\vartriangleleft",8882],["\\trianglelefteq",8884],["\\ntriangleleft",8938],["\\ntrianglelefteq",8940],["\\vartriangleright",8883],["\\trianglerighteq",8885],["\\ntriangleright",8939],["\\ntrianglerighteq",8941],["\\blacktriangleleft",9664],["\\blacktriangleright",9654],["\\leftarrowtail",8610],["\\rightarrowtail",8611],["\\looparrowright",8620],["\\looparrowleft",8619],["\\twoheadleftarrow",8606],["\\twoheadrightarrow",8608],["\\twoheadrightarrowtail",10518],["\\rightleftharpoons",8652],["\\leftrightharpoons",8651],["\\Rsh",8625],["\\Lsh",8624],["\\circlearrowright",8635],["\\circlearrowleft",8634],["\\restriction",8638],["\\upharpoonright",8638],["\\upharpoonleft",8639],["\\downharpoonright",8642],["\\downharpoonleft",8643],["\\rightsquigarrow",8669],["\\leadsto",8669],["\\leftrightsquigarrow",8621],["\\multimap",8888],["\\nleftarrow",8602],["\\nrightarrow",8603],["\\nRightarrow",8655],["\\nLeftarrow",8653],["\\nleftrightarrow",8622],["\\nLeftrightarrow",8654],["\\nvrightarrow",8696],["\\nvtwoheadrightarrow",10496],["\\nvrightarrowtail",10516],["\\nvtwoheadrightarrowtail",10519],["\\shortparallel",8741],["\\nless",8814],["\\nleqslant",57360],["\\lneq",10887],["\\lneqq",8808],["\\nleqq",57361],["\\lvertneqq",57356],["\\lnsim",8934],["\\lnapprox",10889],["\\nprec",8832],["\\npreceq",8928],["\\precnsim",8936],["\\precnapprox",10937],["\\nsim",8769],["\\nshortmid",57350],["\\nmid",8740],["\\nvdash",8876],["\\nvDash",8877],["\\ngtr",8815],["\\ngeqslant",57359],["\\ngeqq",57358],["\\gneq",10888],["\\gneqq",8809],["\\gvertneqq",57357],["\\gnsim",8935],["\\gnapprox",10890],["\\nsucc",8833],["\\nsucceq",8929],["\\succnsim",8937],["\\succnapprox",10938],["\\ncong",8774],["\\nshortparallel",57351],["\\nparallel",8742],["\\nVDash",8879],["\\nsupseteqq",57368],["\\supsetneq",8843],["\\varsupsetneq",57371],["\\supsetneqq",10956],["\\varsupsetneqq",57369],["\\nVdash",8878],["\\precneqq",10933],["\\succneqq",10934],["\\nsubseteqq",57366],["\\leqslant",10877],["\\geqslant",10878],["\\gtrsim",8819],["\\approxeq",8778],["\\thickapprox",8776],["\\lessapprox",10885],["\\gtrapprox",10886],["\\precapprox",10935],["\\succapprox",10936],["\\thicksim",8764],["\\succsim",8831],["\\precsim",8830],["\\backsim",8765],["\\eqsim",8770],["\\backsimeq",8909],["\\lesssim",8818],["\\nleq",8816],["\\ngeq",8817],["\\smallsmile",8995],["\\smallfrown",8994],["\\leqq",8806],["\\eqslantless",10901],["\\lll",8920],["\\lessgtr",8822],["\\lesseqgtr",8922],["\\lesseqqgtr",10891],["\\risingdotseq",8787],["\\fallingdotseq",8786],["\\subseteqq",10949],["\\Subset",8912],["\\sqsubset",8847],["\\preccurlyeq",8828],["\\curlyeqprec",8926],["\\vDash",8872],["\\Vvdash",8874],["\\bumpeq",8783],["\\Bumpeq",8782],["\\geqq",8807],["\\eqslantgtr",10902],["\\ggg",8921],["\\gtrless",8823],["\\gtreqless",8923],["\\gtreqqless",10892],["\\supseteqq",10950],["\\Supset",8913],["\\sqsupset",8848],["\\succcurlyeq",8829],["\\curlyeqsucc",8927],["\\Vdash",8873],["\\shortmid",8739],["\\between",8812],["\\pitchfork",8916],["\\varpropto",8733],["\\backepsilon",8717],["\\llless",8920],["\\gggtr",8921],["\\doteqdot",8785],["\\Doteq",8785],["\\eqcirc",8790],["\\circeq",8791],["\\therefore",8756],["\\because",8757]],"mrel","ams"),dt([["+",43],["-",8722],["\u2212",8722],["\\pm",177],["\\mp",8723],["*",8727],["\\times",215],["\\div",247],["\\divides",8739],["\\cdot",8901],["\\cap",8745],["\\cup",8746],["\\setminus",8726],["\\land",8743],["\\wedge",8743],["\\lor",8744],["\\vee",8744],["\\circ",8728],["\\bigcirc",9711],["\\bullet",8729],["\\oplus",8853],["\\ominus",8854],["\\otimes",8855],["\\odot",8857],["\\oslash",8856],["\\bigtriangleup",9651],["\\bigtriangledown",9661],["\\triangleleft",9667],["\\triangleright",9657],["\\And",38],["\\dagger",8224],["\\dag",8224],["\\ddag",8225],["\\ddagger",8225],["\\ast",8727],["\\star",8902],["\\bigstar",9733],["\\diamond",8900]],"mbin"),dt([["\\lhd",8882],["\\rhd",8883],["\\lessdot",8918],["\\gtrdot",8919],["\\ltimes",8905],["\\rtimes",8906],["\\leftthreetimes",8907],["\\rightthreetimes",8908],["\\intercal",8890],["\\dotplus",8724],["\\doublebarwedge",10846],["\\divideontimes",8903],["\\centerdot",8901],["\\smallsetminus",8726],["\\barwedge",8892],["\\veebar",8891],["\\nor",8891],["\\curlywedge",8911],["\\curlyvee",8910],["\\boxminus",8863],["\\boxplus",8862],["\\boxtimes",8864],["\\boxdot",8865],["\\circleddash",8861],["\\circledast",8859],["\\circledcirc",8858],["\\unlhd",8884],["\\unrhd",8885]],"mbin","ams"),dt([["\\surd",8730],["\\infty",8734],["\\prime",8242],["\\doubleprime",8243],["\\angle",8736],["`",8216],["\\$",36],["\\%",37],["\\_",95],["\\alpha",945],["\\beta",946],["\\gamma",947],["\\delta",948],["\\epsilon",1013],["\\varepsilon",949],["\\zeta",950],["\\eta",951],["\\theta",952],["\\vartheta",977],["\\iota",953],["\\kappa",954],["\\varkappa",1008,"mord","ams"],["\\lambda",955],["\\mu",956],["\\nu",957],["\\xi",958],["\\omicron",111],["\\pi",960],["\\varpi",982],["\\rho",961],["\\varrho",1009],["\\sigma",963],["\\varsigma",962],["\\tau",964],["\\phi",981],["\\varphi",966],["\\upsilon",965],["\\chi",967],["\\psi",968],["\\omega",969],["\\Gamma",915],["\\Delta",916],["\\Theta",920],["\\Lambda",923],["\\Xi",926],["\\Pi",928],["\\Sigma",931],["\\Upsilon",933],["\\Phi",934],["\\Psi",936],["\\Omega",937],["\\digamma",989,"mord","ams"],["\\emptyset",8709]]),dt([["=",61],["<",60],["\\lt",60],[">",62],["\\gt",62],["\\le",8804],["\\leq",8804],["\\ge",8805],["\\geq",8805],["\\ll",8810],["\\gg",8811],["\\coloneq",8788],["\\coloneqq",8788],["\\colonequals",8788],["\\measeq",8797],["\\eqdef",8798],["\\questeq",8799],[":",58],["\\cong",8773],["\\equiv",8801],["\\prec",8826],["\\preceq",10927],["\\succ",8827],["\\succeq",10928],["\\perp",8869],["\\propto",8733],["\\Colon",8759],["\\smile",8995],["\\frown",8994],["\\sim",8764],["\\doteq",8784],["\\bowtie",8904],["\\Join",8904],["\\asymp",8781],["\\sqsubseteq",8849],["\\sqsupseteq",8850],["\\approx",8776],["\\~",126],["\\leftrightarrow",8596],["\\Leftrightarrow",8660],["\\models",8872],["\\vdash",8866],["\\dashv",8867],["\\roundimplies",10608],["\\in",8712],["\\notin",8713],["\\ni",8715],["\\owns",8715],["\\subset",8834],["\\supset",8835],["\\subseteq",8838],["\\supseteq",8839],["\\differencedelta",8710],["\\mvert",8739],["\\parallel",8741],["\\simeq",8771]],"mrel"),dt([["\\lnot",172],["\\neg",172],["\\triangle",9651],["\\subsetneq",8842],["\\varsubsetneq",57370],["\\subsetneqq",10955],["\\varsubsetneqq",57367],["\\nsubset",8836],["\\nsupset",8837],["\\nsubseteq",8840],["\\nsupseteq",8841]],"mrel","ams"),dt([["\\wp",8472],["\\aleph",8501]]),dt([["\\blacktriangle",9650],["\\hslash",8463],["\\Finv",8498],["\\Game",8513],["\\eth",240],["\\mho",8487],["\\Bbbk",107],["\\yen",165],["\\square",9633],["\\Box",9633],["\\blacksquare",9632],["\\circledS",9416],["\\circledR",174],["\\triangledown",9661],["\\blacktriangledown",9660],["\\checkmark",10003],["\\diagup",9585],["\\measuredangle",8737],["\\sphericalangle",8738],["\\backprime",8245],["\\backdoubleprime",8246],["\\Diamond",9674],["\\lozenge",9674],["\\blacklozenge",10731],["\\varnothing",8709],["\\complement",8705],["\\maltese",10016],["\\beth",8502],["\\daleth",8504],["\\gimel",8503]],"mord","ams"),dt([["\\ ",160],["~",160]],"space"),ke(["!",",",":",";",">","enskip","enspace","quad","qquad"],"",{createAtom:e=>new wl(e)}),ke("space","",{createAtom:e=>new wl(e)}),dt([["\\colon",58],["\\cdotp",8901],["\\vdots",8942,"mord"],["\\ldotp",46],[",",44],[";",59]],"mpunct"),dt([["\\cdots",8943],["\\ddots",8945],["\\ldots",8230],["\\mathellipsis",8230]],"minner"),dt([["\\/",47],["|",8739,"mord"],["\\imath",305],["\\jmath",567],["\\degree",176],["'",8242],['"',8221]]);var cd="<mo>&#x2061;</mo>",Ju="<mo>&#8290;</mo>";function Qu(e){return e.replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function wn(e,t){return!e||!t.generateID?"":` extid="${e}"`}function Lv(e,t,r){var n,a,o,_,N,z,W,j,X,ae,he;let _e=!1;t=t!=null?t:e.atoms.length;let Ue="",yt="",Be=e.atoms[e.index];const nt=(a=(n=Be.style)==null?void 0:n.variant)!=null?a:"",wt=(_=(o=Be.style)==null?void 0:o.variantStyle)!=null?_:"";let st="";if(nt||wt){const qt=H(Be.value,(N=Be.style)==null?void 0:N.variant,(z=Be.style)==null?void 0:z.variantStyle);if(qt!==Be.value)return e.index+=1,Ue=`<mi${wn(Be.id,r)}>${qt}</mi>`,Rs(Ue,e,r)||(e.mathML+=Ue,e.lastType="mi"),!0;st=(W={upnormal:"normal",boldnormal:"bold",italicmain:"italic",bolditalicmain:"bold-italic","updouble-struck":"double-struck","double-struck":"double-struck",boldfraktur:"bold-fraktur",calligraphic:"script",upcalligraphic:"script",script:"script",boldscript:"bold-script",boldcalligraphic:"bold-script",fraktur:"fraktur","upsans-serif":"sans-serif","boldsans-serif":"bold-sans-serif","italicsans-serif":"sans-serif-italic","bolditalicsans-serif":"sans-serif-bold-italic",monospace:"monospace"}[wt+nt])!=null?W:"",st=` mathvariant="${st}"`}const zt={"\\exponentialE":"&#x02147;","\\imaginaryI":"&#x2148;","\\differentialD":"&#x2146;","\\capitalDifferentialD":"&#x2145;","\\alpha":"&#x03b1;","\\pi":"&#x03c0;","\\infty":"&#x221e;","\\forall":"&#x2200;","\\nexists":"&#x2204;","\\exists":"&#x2203;","\\hbar":"\u210F","\\cdotp":"\u22C5","\\ldots":"\u2026","\\cdots":"\u22EF","\\ddots":"\u22F1","\\vdots":"\u22EE","\\ldotp":"."};if(Be.command==="!")return e.index+=1,Ue="<mo>!</mo>",Rs(Ue,e,r)||(e.mathML+=Ue,e.lastType="mo"),!0;if(zt[Be.command]){e.index+=1;let qt=`<mi${wn(Be.id,r)}${st}>${zt[Be.command]}</mi>`;return(e.lastType==="mi"||e.lastType==="mn"||e.lastType==="mtext"||e.lastType==="fence")&&(qt=Ju+qt),Rs(qt,e,r)||(e.mathML+=qt,e.lastType="mi"),!0}if(Be.command==="\\operatorname")yt=nl(Be.body),e.index+=1;else if(nt||wt)for(;e.index<t&&(Be.type==="mord"||Be.type==="macro")&&!Be.isDigit()&&nt===((X=(j=Be.style)==null?void 0:j.variant)!=null?X:"")&&wt===((he=(ae=Be.style)==null?void 0:ae.variantStyle)!=null?he:"");)yt+=nl([Be]),e.index+=1,Be=e.atoms[e.index];else(Be.type==="mord"||Be.type==="macro")&&!Be.isDigit()&&(yt+=nl([Be]),e.index+=1);if(yt.length>0){_e=!0,Ue=`<mi${st}>${yt}</mi>`;const qt=e.lastType;Ue.endsWith(">f</mi>")||Ue.endsWith(">g</mi>")?(Ue+=cd,e.lastType="applyfunction"):e.lastType=/^<mo>(.*)<\/mo>$/.test(Ue)?"mo":"mi",Rs(Ue,e,r)||((qt==="mi"||qt==="mn"||qt==="mtext"||qt==="fence")&&(Ue=Ju+Ue),e.mathML+=Ue)}return _e}function Rv(e){return e.index<e.atoms.length&&e.atoms[e.index].superscript&&e.atoms[e.index].type==="subsup"}function Pv(e){let t=-1,r=e.index,n=!1,a=!1;for(;r<e.atoms.length&&!n&&!a;){const o=e.atoms[r];n=!o.isDigit(),a=!n&&o.superscript!==void 0,r++}return a&&(t=r-1),t}function Rs(e,t,r){var n;let a=t.atoms[t.index-1];if(!a)return!1;if(!a.superscript&&!a.subscript)if(((n=t.atoms[t.index])==null?void 0:n.type)==="subsup")a=t.atoms[t.index],t.index+=1;else return!1;const o=t.lastType;t.lastType="";const _=un(a.superscript,r);t.lastType="";const N=un(a.subscript,r);if(t.lastType=o,!_&&!N)return!1;let z="";return _&&N?z=`<msubsup>${e}${N}${_}</msubsup>`:_?z=`<msup>${e}${_}</msup>`:N&&(z=`<msub>${e}${N}</msub>`),t.mathML+=z,t.lastType="",!0}function Iv(e,t,r){t=t!=null?t:e.atoms.length;const n=e.index;let a="";for(;e.index<t&&e.atoms[e.index].mode==="text";)a+=e.atoms[e.index].value?e.atoms[e.index].value:" ",e.index+=1;return a.length>0?(e.mathML+=`<mtext ${wn(e.atoms[n].id,r)}>${a}</mtext>`,e.lastType="mtext",!0):!1}function Ov(e,t,r){t=t!=null?t:e.atoms.length;const n=e.index;let a="",o=Pv(e);for(o>=0&&o<t&&(t=o);e.index<t&&e.atoms[e.index].isDigit();)a+=e.atoms[e.index].asDigit(),e.index+=1;return a.length<=0?!1:(a="<mn"+wn(e.atoms[n].id,r)+">"+a+"</mn>",o<0&&Rv(e)&&(o=e.index,e.index+=1),Rs(a,e,r)||(e.mathML+=a,e.lastType="mn"),!0)}function Fv(e,t,r){let n=!1;t=t!=null?t:e.atoms.length;let a="",o="";if(e.index<t&&e.atoms[e.index].type==="mopen"){let _=!1,N=0;const z=e.index;let W=-1,j=z+1;for(;j<t&&!_;)e.atoms[j].type==="mopen"?N+=1:e.atoms[j].type==="mclose"&&(N-=1),N===-1&&(_=!0,W=j),j+=1;_&&(a="<mrow>",a+=Ao(e.atoms[z],r),a+=un(e.atoms,r,z+1,W),a+=Ao(e.atoms[W],r),a+="</mrow>",e.index=W+1,(e.lastType==="mi"||e.lastType==="mn"||e.lastType==="mfrac"||e.lastType==="fence")&&(e.mathML+=Ju),Rs(a,e,r)&&(n=!0,e.lastType="",a=""),o="fence")}return a.length>0&&(n=!0,e.mathML+=a,e.lastType=o),n}function Bv(e,t,r){let n=!1;t=t!=null?t:e.atoms.length;let a="",o="";const _=e.atoms[e.index];if(!_)return!1;const N={"\\ne":"&ne;","\\neq":"&neq;","\\pm":"&#177;","\\times":"&#215;","\\colon":":","\\vert":"|","\\Vert":"\u2225","\\mid":"\u2223","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lbrack":"[","\\rbrack":"]","\\lparen":"(","\\rparen":")","\\langle":"\u27E8","\\rangle":"\u27E9","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309"};if(N[_.command]){e.index+=1;const z=`<mo${wn(_.id,r)}>${N[_.command]}</mo>`;return Rs(z,e,r)||(e.mathML+=z,e.lastType="mo"),!0}if(e.index<t&&(_.type==="mbin"||_.type==="mrel"))a+=Yc(e.atoms[e.index],r),e.index+=1,o="mo";else if(e.index<t&&(_.type==="mop"||_.type==="operator"||_.type==="extensible-symbol")){if(_.subsupPlacement==="over-under"&&(_.superscript||_.subscript)){const z=Ao(_,r);return _.superscript&&_.subscript?(a+="<munderover>"+z,a+=un(_.subscript,r),a+=un(_.superscript,r),a+="</munderover>"):_.superscript?(a+="<mover>"+z,a+=un(_.superscript,r),a+="</mover>"):_.subscript&&(a+="<munder>"+z,a+=un(_.subscript,r),a+="</munder>"),e.mathML+=a,e.lastType="mo",e.index+=1,!0}{const z=e.atoms[e.index],W=z.value==="\\operatorname",j=W?'<mi class="MathML-Unit"'+wn(z.id,r)+">"+nl(z.value)+"</mi>":Ao(z,r);a+=j,!W&&!/^<mo>(.*)<\/mo>$/.test(j)?(a+=cd,o="applyfunction"):o=W?"mi":"mo"}(e.lastType==="mi"||e.lastType==="mn")&&!/^<mo>(.*)<\/mo>$/.test(a)&&(a=Ju+a),e.index+=1}return a.length>0&&(n=!0,Rs(a,e,r)||(e.mathML+=a,e.lastType=o)),n}function un(e,t,r,n){t!=null||(t={});const a={atoms:[],index:r!=null?r:0,mathML:"",lastType:""};if(typeof e=="number"||typeof e=="boolean")a.mathML=e.toString();else if(typeof e=="string")a.mathML=e;else if(e instanceof Qe)a.mathML=Yc(e,t);else if(Array.isArray(e)){a.atoms=e;let o=0;for(n=n||(e?e.length:0);a.index<n;)if(Iv(a,n,t)||Ov(a,n,t)||Lv(a,n,t)||Bv(a,n,t)||Fv(a,n,t))o+=1;else if(a.index<n){let _=Yc(a.atoms[a.index],t);a.lastType==="mn"&&_.length>0&&a.atoms[a.index].type==="genfrac"&&(_="<mo>&#x2064;</mo>"+_),a.atoms[a.index].type==="genfrac"?a.lastType="mfrac":a.lastType="",a.index+=1,Rs(_,a,t)?o+=1:_.length>0&&(a.mathML+=_,o+=1)}o>1&&(a.mathML="<mrow>"+a.mathML+"</mrow>")}return a.mathML}function Ao(e,t){let r="";const n=nl(e.value);return n&&(r="<mo"+wn(e.id,t)+">"+n+"</mo>"),r}function nl(e){if(!e)return"";if(typeof e=="string")return Qu(e);if(!Array.isArray(e)&&typeof e.body=="string")return Qu(e.body);let t="";for(const r of e)typeof r.value=="string"&&(t+=r.value);return Qu(t)}function Yc(e,t){var r,n,a,o,_,N,z,W,j,X,ae,he,_e,Ue,yt,Be,nt,wt,st,zt,qt,Gt;if(e.mode==="text")return`<mi${wn(e.id,t)}>${e.value}</mi>`;const Hr={widehat:"^",widecheck:"\u02C7",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",longleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",longrightarrow:"\u2192",underbrace:"\u23DF",overbrace:"\u23DE",overgroup:"\u23E0",undergroup:"\u23E1",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21D2",xRightarrow:"\u21D2",overleftharpoon:"\u21BC",xleftharpoonup:"\u21BC",overrightharpoon:"\u21C0",xrightharpoonup:"\u21C0",xLeftarrow:"\u21D0",xLeftrightarrow:"\u21D4",xhookleftarrow:"\u21A9",xhookrightarrow:"\u21AA",xmapsto:"\u21A6",xrightharpoondown:"\u21C1",xleftharpoondown:"\u21BD",xrightleftharpoons:"\u21CC",longrightleftharpoons:"\u21CC",xleftrightharpoons:"\u21CB",xtwoheadleftarrow:"\u219E",xtwoheadrightarrow:"\u21A0",xlongequal:"=",xtofrom:"\u21C4",xleftrightarrows:"\u21C4",xRightleftharpoons:"\u21CC",longRightleftharpoons:"\u21CC",xLeftrightharpoons:"\u21CB",longLeftrightharpoons:"\u21CB"},_n={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\>":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let Lt="",Ra="",ys,Wa,Ii,Pa,ha,Sn;const{command:di}=e;if(e.command==="\\error")return`<merror${wn(e.id,t)}>${un(e.body,t)}</merror>`;const Oi={"\\vert":"|","\\Vert":"\u2225","\\mid":"\u2223","\\lbrack":"[","\\rbrack":"]","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"\u27E8","\\rangle":"\u27E9","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309"},bs={"\\vec":"&#x20d7;","\\acute":"&#x00b4;","\\grave":"&#x0060;","\\dot":"&#x02d9;","\\ddot":"&#x00a8;","\\tilde":"&#x007e;","\\bar":"&#x00af;","\\breve":"&#x02d8;","\\check":"&#x02c7;","\\hat":"&#x005e;"};switch(e.type){case"first":break;case"group":case"root":Lt=un(e.body,t);break;case"array":if((e.leftDelim&&e.leftDelim!=="."||e.rightDelim&&e.rightDelim!==".")&&(Lt+="<mrow>",e.leftDelim&&e.leftDelim!=="."&&(Lt+="<mo>"+(Oi[e.leftDelim]||e.leftDelim)+"</mo>")),Lt+="<mtable",e.colFormat){for(Lt+=' columnalign="',Ii=0;Ii<e.colFormat.length;Ii++)e.colFormat[Ii].align&&(Lt+={l:"left",c:"center",r:"right"}[e.colFormat[Ii].align]+" ");Lt+='"'}for(Lt+=">",Wa=0;Wa<e.array.length;Wa++){for(Lt+="<mtr>",ys=0;ys<e.array[Wa].length;ys++)Lt+="<mtd>"+un(e.array[Wa][ys],t)+"</mtd>";Lt+="</mtr>"}Lt+="</mtable>",(e.leftDelim&&e.leftDelim!=="."||e.rightDelim&&e.rightDelim!==".")&&(e.rightDelim&&e.rightDelim!=="."&&(Lt+="<mo>"+(Oi[e.leftDelim]||e.rightDelim)+"</mo>"),Lt+="</mrow>");break;case"genfrac":(e.leftDelim||e.rightDelim)&&(Lt+="<mrow>"),e.leftDelim&&e.leftDelim!=="."&&(Lt+="<mo"+wn(e.id,t)+">"+(Oi[e.leftDelim]||e.leftDelim)+"</mo>"),e.hasBarLine?(Lt+="<mfrac>",Lt+=un(e.above,t)||"<mi>&nbsp;</mi>",Lt+=un(e.below,t)||"<mi>&nbsp;</mi>",Lt+="</mfrac>"):(Lt+="<mtable"+wn(e.id,t)+">",Lt+="<mtr>"+un(e.above,t)+"</mtr>",Lt+="<mtr>"+un(e.below,t)+"</mtr>",Lt+="</mtable>"),e.rightDelim&&e.rightDelim!=="."&&(Lt+="<mo"+wn(e.id,t)+">"+(Oi[e.rightDelim]||e.rightDelim)+"</mo>"),(e.leftDelim||e.rightDelim)&&(Lt+="</mrow>");break;case"surd":e.hasEmptyBranch("above")?(Lt+="<msqrt"+wn(e.id,t)+">",Lt+=un(e.body,t),Lt+="</msqrt>"):(Lt+="<mroot"+wn(e.id,t)+">",Lt+=un(e.body,t),Lt+=un(e.above,t),Lt+="</mroot>");break;case"leftright":const xs=e,Es=xs.leftDelim;Lt="<mrow>",Es&&Es!=="."&&(Lt+=`<mo${wn(e.id,t)}>${(r=Oi[Es])!=null?r:Es}</mo>`),e.body&&(Lt+=un(e.body,t));const ws=xs.matchingRightDelim();ws&&ws!=="."&&(Lt+=`<mo${wn(e.id,t)}>${(n=Oi[ws])!=null?n:ws}</mo>`),Lt+="</mrow>";break;case"sizeddelim":case"delim":Lt+=`<mo${wn(e.id,t)}>${Oi[e.value]||e.value}</mo>`;break;case"accent":Lt+='<mover accent="true"'+wn(e.id,t)+">",Lt+=un(e.body,t),Lt+="<mo>"+(bs[di]||e.accent)+"</mo>",Lt+="</mover>";break;case"line":case"overlap":break;case"overunder":ha=e.above,Pa=e.below,(e.svgAbove||ha)&&(e.svgBelow||Pa)?Sn=e.body:ha&&ha.length>0?(Sn=e.body,(o=(a=e.body)==null?void 0:a[0])!=null&&o.below?(Pa=e.body[0].below,Sn=e.body[0].body):((N=(_=e.body)==null?void 0:_[0])==null?void 0:N.type)==="first"&&((W=(z=e.body)==null?void 0:z[1])!=null&&W.below)&&(Pa=e.body[1].below,Sn=e.body[1].body)):Pa&&Pa.length>0&&(Sn=e.body,(X=(j=e.body)==null?void 0:j[0])!=null&&X.above?(ha=e.body[0].above,Sn=e.body[0].body):((he=(ae=e.body)==null?void 0:ae[0])==null?void 0:he.type)==="first"&&((Ue=(_e=e.body)==null?void 0:_e[1])!=null&&Ue.above)&&(ha=e.body[1].overscript,Sn=e.body[1].body)),(e.svgAbove||ha)&&(e.svgBelow||Pa)?(Lt+=`<munderover ${wn(e.id,t)}>`,Lt+=(yt=Hr[e.svgBody])!=null?yt:un(Sn,t),Lt+=(Be=Hr[e.svgBelow])!=null?Be:un(Pa,t),Lt+=(nt=Hr[e.svgAbove])!=null?nt:un(ha,t),Lt+="</munderover>"):e.svgAbove||ha?(Lt+=`<mover ${wn(e.id,t)}>`+((wt=Hr[e.svgBody])!=null?wt:un(Sn,t)),Lt+=(st=Hr[e.svgAbove])!=null?st:un(ha,t),Lt+="</mover>"):(e.svgBelow||Pa)&&(Lt+=`<munder ${wn(e.id,t)}>`+((zt=Hr[e.svgBody])!=null?zt:un(Sn,t)),Lt+=(qt=Hr[e.svgBelow])!=null?qt:un(Pa,t),Lt+="</munder>");break;case"placeholder":Lt+="?";break;case"mord":{Lt=typeof e.value=="string"?e.value:di,di==="\\char"?Lt="&#x"+("000000"+e.args[0].number.toString(16)).slice(-4)+";":Lt.length>0&&Lt.startsWith("\\")&&(typeof e.value=="string"&&e.value.charCodeAt(0)>255?Lt="&#x"+("000000"+e.value.charCodeAt(0).toString(16)).slice(-4)+";":typeof e.value=="string"?Lt=e.value.charAt(0):(console.error("Did not expect this"),Lt=""));const ns=/\d/.test(Lt)?"mn":"mi";Lt=`<${ns}${wn(e.id,t)}>${Qu(Lt)}</${ns}>`;break}case"mbin":case"mrel":case"minner":Lt=Ao(e,t);break;case"mpunct":Lt='<mo separator="true"'+wn(e.id,t)+">"+di+"</mo>";break;case"mop":case"operator":case"extensible-symbol":e.body!=="\u200B"&&(Lt="<mo"+wn(e.id,t)+">",Lt+=di==="\\operatorname"?e.body:di||e.body,Lt+="</mo>");break;case"box":Lt='<menclose notation="box"',e.backgroundcolor&&(Lt+=' mathbackground="'+e.backgroundcolor+'"'),Lt+=wn(e.id,t)+">"+un(e.body,t)+"</menclose>";break;case"spacing":Lt+='<mspace width="'+((Gt=_n[di])!=null?Gt:0)+'em"/>';break;case"enclose":Lt='<menclose notation="';for(const ns in e.notation)Object.prototype.hasOwnProperty.call(e.notation,ns)&&e.notation[ns]&&(Lt+=Ra+ns,Ra=" ");Lt+=wn(e.id,t)+'">'+un(e.body,t)+"</menclose>";break;case"prompt":Lt='<menclose notation="roundexbox""">'+un(e.body,t)+"</menclose>";break;case"space":Lt+="&nbsp;";break;case"subsup":break;case"phantom":break;case"composition":break;case"rule":break;case"chem":break;case"mopen":Lt+=Ao(e,t);break;case"mclose":Lt+=Ao(e,t);break;case"macro":{const ns=e.command+nl(e.macroArgs);ns&&(Lt+=`<mo ${wn(e.id,t)}>${ns}</mo>`)}break;case"latexgroup":Lt+=un(e.body,t);break;case"latex":Lt+="<mtext"+wn(e.id,t)+">"+e.value+"</mtext>";break;case"tooltip":Lt+=un(e.body,t);break;case"text":Lt+=`<mtext ${wn(e.id,t)}x>${e.value}</mtext>`;break;default:if(e.command==="\\displaystyle")return`<mrow ${wn(e.id,t)} displaystyle="true">${un(e.body,t)}</mrow>`;if(e.command==="\\textstyle")return`<mrow ${wn(e.id,t)} displaystyle="false">${un(e.body,t)}</mrow>`;console.info("Unexpected element in conversion to MathML:",e)}return Lt}var il={"\\alpha":"alpha ","\\mu":"mew ","\\sigma":"sigma ","\\pi":"pie ","\\imaginaryI":"imaginary eye ","\\imaginaryJ":"imaginary jay ","\\sum":"Summation ","\\prod":"Product ","+":"plus ","-":"minus ",";":'<break time="150ms"/> semi-colon <break time="150ms"/>',",":'<break time="150ms"/> comma <break time="150ms"/>',"|":'<break time="150ms"/>Vertical bar<break time="150ms"/>',"(":'<break time="150ms"/>Open paren. <break time="150ms"/>',")":'<break time="150ms"/> Close paren. <break time="150ms"/>',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\pm":"plus or minus","\\mp":"minus or plus","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","\\ne":"is not equal to ","\\neq":"is not equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","\u200B":"","\u2212":"minus ",":":'<break time="150ms"/> such that <break time="200ms"/> ',"\\colon":'<break time="150ms"/> such that <break time="200ms"/> ',"\\hbar":"etch bar ","\\iff":'<break time="200ms"/>if, and only if, <break time="200ms"/>',"\\Longleftrightarrow":'<break time="200ms"/>if, and only if, <break time="200ms"/>',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set <break time="150ms"/><say-as interpret-as="character">n</say-as>',"\\C":'the set <break time="150ms"/><say-as interpret-as="character">c</say-as>',"\\Z":'the set <break time="150ms"/><say-as interpret-as="character">z</say-as>',"\\Q":'the set <break time="150ms"/><say-as interpret-as="character">q</say-as>',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdot":"times ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lparen":'<break time="150ms"/>open paren<break time="150ms"/>',"\\rparen":'<break time="150ms"/>close paren<break time="150ms"/>',"\\lbrace":'<break time="150ms"/>open brace<break time="150ms"/>',"\\{":'<break time="150ms"/>open brace<break time="150ms"/>',"\\rbrace":'<break time="150ms"/>close brace<break time="150ms"/>',"\\}":'<break time="150ms"/>close brace<break time="150ms"/>',"\\langle":'<break time="150ms"/>left angle bracket<break time="150ms"/>',"\\rangle":'<break time="150ms"/>right angle bracket<break time="150ms"/>',"\\lfloor":'<break time="150ms"/>open floor<break time="150ms"/>',"\\rfloor":'<break time="150ms"/>close floor<break time="150ms"/>',"\\lceil":'<break time="150ms"/>open ceiling<break time="150ms"/>',"\\rceil":'<break time="150ms"/>close ceiling<break time="150ms"/>',"\\vert":'<break time="150ms"/>vertical bar<break time="150ms"/>',"\\mvert":'<break time="150ms"/>divides<break time="150ms"/>',"\\lvert":'<break time="150ms"/>left vertical bar<break time="150ms"/>',"\\rvert":'<break time="150ms"/>right vertical bar<break time="150ms"/>',"\\lbrack":'<break time="150ms"/> open square bracket <break time="150ms"/>',"\\rbrack":'<break time="150ms"/> close square bracket <break time="150ms"/>',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"},Xc={array:"array",matrix:"matrix",pmatrix:"parenthesis matrix",bmatrix:"square brackets matrix",Bmatrix:"braces matrix",vmatrix:"bars matrix",Vmatrix:"double bars matrix","matrix*":"matrix",smallmatrix:"small matrix"};function Nv(e){let t="";return e.startsWith("\\")&&(t=" "+e.replace("\\","")+" "),t}function Nl(e){let t=0;if(v(e))for(const r of e)r.type!=="first"&&(t+=1);return t===1}function Kv(e){if(v(e)){for(const t of e)if(t.type!=="first"&&t.id)return t.id.toString()}return""}function fd(e){let t="";if(v(e))for(const r of e)r.type!=="first"&&typeof r.value=="string"&&(t+=r.value);return t}function Uv(e){return e?e.map(t=>t.value).join(""):""}function Wr(e,t){var r,n,a,o,_;function N(j){return window.MathfieldElement.textToSpeechMarkup?/[a-z]/.test(j)?` <say-as interpret-as="character">${j}</say-as>`:/[A-Z]/.test(j)?`capital <say-as interpret-as="character">${j.toLowerCase()}</say-as>`:j:/[a-z]/.test(j)?" '"+j.toUpperCase()+"'":/[A-Z]/.test(j)?" 'capital "+j.toUpperCase()+"'":j}function z(j){return"<emphasis>"+j+"</emphasis>"}if(!t)return"";let W="";if(v(t)){let j=!1,X=!1;for(let ae=0;ae<t.length;ae++)t[ae].type!=="first"&&(t[ae].mode!=="text"&&(X=!1),ae<t.length-2&&t[ae].type==="mopen"&&t[ae+2].type==="mclose"&&t[ae+1].type==="mord"?(W+=" of ",W+=z(Wr(e,t[ae+1])),ae+=2):t[ae].mode==="text"?X?W+=(r=t[ae].value)!=null?r:" ":(X=!0,W+=Wr("text",t[ae])):t[ae].isDigit()?j?W+=t[ae].asDigit():(j=!0,W+=Wr(e,t[ae])):(j=!1,W+=Wr(e,t[ae])))}else if(t.mode==="text")t.id&&e==="math"&&(W+='<mark name="'+t.id.toString()+'"/>'),W+=t.value;else{t.id&&e==="math"&&(W+='<mark name="'+t.id.toString()+'"/>');let j="",X="",ae="",he=!1;const{command:_e}=t;switch(_e){case"\\vec":return"vector "+Wr(e,t.body);case"\\acute":return Wr(e,t.body)+" acute";case"\\grave":return Wr(e,t.body)+" grave";case"\\dot":return"dot over"+Wr(e,t.body);case"\\ddot":return"double dot over"+Wr(e,t.body);case"\\mathring":return"ring over"+Wr(e,t.body);case"\\tilde":case"\\widetilde":return"tilde over"+Wr(e,t.body);case"\\bar":return Wr(e,t.body)+" bar";case"\\breve":return Wr(e,t.body)+" breve";case"\\check":case"\\widecheck":return"check over "+Wr(e,t.body);case"\\hat":case"\\widehat":return"hat over"+Wr(e,t.body);case"\\overarc":case"\\overparen":case"\\wideparen":return"arc over "+Wr(e,t.body);case"\\underarc":case"\\underparen":return"arc under "+Wr(e,t.body)}switch(t.type){case"prompt":const Ue=t.body.length>1?'start input . <break time="500ms"/> '+Wr(e,t.body)+'. <break time="500ms"/> end input':"blank";W+=' <break time="300ms"/> '+Ue+'. <break time="700ms"/>'+((n=t.correctness)!=null?n:"")+' . <break time="700ms"/> ';break;case"array":const yt=t.array,Be=t.environmentName;if(Object.keys(Xc).includes(Be)){W+=` begin ${Xc[Be]} `;for(let st=0;st<yt.length;st++){st>0&&(W+=","),W+=` row ${st+1} `;for(let zt=0;zt<yt[st].length;zt++)zt>0&&(W+=","),W+=` column ${zt+1}: `,W+=Wr("math",yt[st][zt])}W+=` end ${Xc[Be]} `}break;case"group":_e==="\\ne"?W+=" not equal ":(_e==="\\not"&&(W+=" not "),W+=Wr("math",t.body));break;case"root":W+=Wr("math",t.body);break;case"genfrac":if(j=Wr("math",t.above),X=Wr("math",t.below),Nl(t.above)&&Nl(t.below)){const zt={"1/2":" half ","1/3":" one third ","2/3":" two third","1/4":" one quarter ","3/4":" three quarter ","1/5":" one fifth ","2/5":" two fifths ","3/5":" three fifths ","4/5":" four fifths ","1/6":" one sixth ","5/6":" five sixths ","1/8":" one eight ","3/8":" three eights ","5/8":" five eights ","7/8":" seven eights ","1/9":" one ninth ","2/9":" two ninths ","4/9":" four ninths ","5/9":" five ninths ","7/9":" seven ninths ","8/9":" eight ninths "}[fd(t.above)+"/"+fd(t.below)];zt?W=zt:W+=j+" over "+X}else W+=' the fraction <break time="150ms"/>'+j+' over <break time="150ms"/>'+X+'.<break time="150ms"/> End fraction.<break time="150ms"/>';break;case"surd":if(ae=Wr("math",t.body),t.hasEmptyBranch("above"))W+=Nl(t.body)?" the square root of "+ae+" , ":' the square root of <break time="200ms"/>'+ae+'. <break time="200ms"/> End square root';else{let st=Wr("math",t.above);st=st.trim();const zt=st.replace(/<mark([^/]*)\/>/g,"");zt==="3"?W+=' the cube root of <break time="200ms"/>'+ae+'. <break time="200ms"/> End cube root':zt==="n"?W+=' the nth root of <break time="200ms"/>'+ae+'. <break time="200ms"/> End root':W+=' the root with index: <break time="200ms"/>'+st+', of <break time="200ms"/>'+ae+'. <break time="200ms"/> End root'}break;case"leftright":{const st=t;W+=(a=st.leftDelim?il[st.leftDelim]:void 0)!=null?a:st.leftDelim,W+=Wr("math",t.body),W+=(o=st.rightDelim?il[st.rightDelim]:void 0)!=null?o:st.rightDelim}break;case"rule":break;case"overunder":break;case"overlap":break;case"macro":const nt=_e.replace(/^\\/g,""),wt=$t()[nt];wt&&(wt!=null&&wt.expand?W+=Wr("math",t.body):W+=`${nt} `);break;case"placeholder":W+="placeholder ";break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":{if(_e==="\\mathbin"||_e==="\\mathrel"||_e==="\\mathopen"||_e==="\\mathclose"||_e==="\\mathpunct"||_e==="\\mathord"||_e==="\\mathinner"){W=Wr(e,t.body);break}let st=t.isDigit()?t.asDigit():t.value,zt=t.command;if((t.type==="delim"||t.type==="sizeddelim")&&(zt=t.value,st=zt),e==="text")W+=st;else{if(t.type==="mbin"&&(W+='<break time="150ms"/>'),st){const qt=il[st]||(zt?il[zt.trim()]:"");if(qt)W+=" "+qt;else{const Gt=zt?Nv(zt.trim()):"";W+=Gt||N(st)}}else W+=Wr("math",t.body);t.type==="mbin"&&(W+='<break time="150ms"/>')}break}case"mop":case"operator":case"extensible-symbol":if(t.value!=="\u200B"){const st=t.command;if(st==="\\sum")if(!t.hasEmptyBranch("superscript")&&!t.hasEmptyBranch("subscript")){let zt=Wr("math",t.superscript);zt=zt.trim();let qt=Wr("math",t.subscript);qt=qt.trim(),W+=' the summation from <break time="200ms"/>'+qt+'<break time="200ms"/> to <break time="200ms"/>'+zt+'<break time="200ms"/> of <break time="150ms"/>',he=!0}else if(t.hasEmptyBranch("subscript"))W+=" the summation of";else{let zt=Wr("math",t.subscript);zt=zt.trim(),W+=' the summation from <break time="200ms"/>'+zt+'<break time="200ms"/> of <break time="150ms"/>',he=!0}else if(st==="\\prod")if(!t.hasEmptyBranch("superscript")&&!t.hasEmptyBranch("subscript")){let zt=Wr("math",t.superscript);zt=zt.trim();let qt=Wr("math",t.subscript);qt=qt.trim(),W+=' the product from <break time="200ms"/>'+qt+'<break time="200ms"/> to <break time="200ms"/>'+zt+'<break time="200ms"/> of <break time="150ms"/>',he=!0}else if(t.hasEmptyBranch("subscript"))W+=" the product of ";else{let zt=Wr("math",t.subscript);zt=zt.trim(),W+=' the product from <break time="200ms"/>'+zt+'<break time="200ms"/> of <break time="150ms"/>',he=!0}else if(st==="\\int")if(!t.hasEmptyBranch("superscript")&&!t.hasEmptyBranch("subscript")){let zt=Wr("math",t.superscript);zt=zt.trim();let qt=Wr("math",t.subscript);qt=qt.trim(),W+=' the integral from <break time="200ms"/>'+z(qt)+'<break time="200ms"/> to <break time="200ms"/>'+z(zt)+' <break time="200ms"/> of ',he=!0}else W+=' the integral of <break time="200ms"/> ';else if(typeof t.value=="string"){const zt=(_=il[t.value])!=null?_:t.command?il[t.command]:void 0;W+=zt||" "+t.value}else t.command&&(t.command==="\\mathop"?W+=Wr("math",t.body):t.command==="\\operatorname"?W+=Uv(t.body):W+=t.command.startsWith("\\")?" "+t.command.slice(1):" "+t.command)}break;case"enclose":ae=Wr("math",t.body),W+=" crossed out "+ae+". End crossed out.";break;case"space":case"spacing":break}if(!he&&!t.hasEmptyBranch("superscript")){let Ue=Wr(e,t.superscript);Ue=Ue.trim();const yt=Ue.replace(/<[^>]*>/g,"");if(Nl(t.superscript)){if(e==="math"){const Be=Kv(t.superscript);Be&&(W+='<mark name="'+Be+'"/>')}yt==="\u2032"?W+=" prime ":yt==="2"?W+=" squared ":yt==="3"?W+=" cubed ":Number.isNaN(Number.parseInt(yt))?W+=" to the "+Ue+"; ":W+=' to the <say-as interpret-as="ordinal">'+yt+"</say-as> power; "}else Number.isNaN(Number.parseInt(yt))?W+=" raised to the "+Ue+"; ":W+=' raised to the <say-as interpret-as="ordinal">'+yt+"</say-as> power; "}if(!he&&!t.hasEmptyBranch("subscript")){let Ue=Wr("math",t.subscript);Ue=Ue.trim(),W+=Nl(t.subscript)?" sub "+Ue:" subscript "+Ue+". End subscript. "}}return W}function al(e){var t,r;if(window.MathfieldElement.textToSpeechRules==="sre"&&("sre"in window||"SRE"in window)){const a=un(e);if(a){window.MathfieldElement.textToSpeechMarkup&&(window.MathfieldElement.textToSpeechRulesOptions=(t=window.MathfieldElement.textToSpeechRulesOptions)!=null?t:{},window.MathfieldElement.textToSpeechRulesOptions=i(F({},window.MathfieldElement.textToSpeechRulesOptions),{markup:window.MathfieldElement.textToSpeechMarkup}),window.MathfieldElement.textToSpeechRulesOptions.markup==="ssml"&&(window.MathfieldElement.textToSpeechRulesOptions=i(F({},window.MathfieldElement.textToSpeechRulesOptions),{markup:"ssml_step"})),window.MathfieldElement.textToSpeechRulesOptions=i(F({},window.MathfieldElement.textToSpeechRulesOptions),{rate:window.MathfieldElement.speechEngineRate}));const o=(r=window.SRE)!=null?r:window.sre.System.getInstance();window.MathfieldElement.textToSpeechRulesOptions&&o.setupEngine(window.MathfieldElement.textToSpeechRulesOptions);let _="";try{_=o.toSpeech(a)}catch(N){console.error("MathLive 0.98.5: `SRE.toSpeech()` runtime error",N)}return _}return""}let n=Wr("math",e);if(window.MathfieldElement.textToSpeechMarkup==="ssml"){let a="";window.MathfieldElement.speechEngineRate&&(a='<prosody rate="'+window.MathfieldElement.speechEngineRate+'">'),n='<?xml version="1.0"?><speak version="1.1" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="en-US"><amazon:auto-breaths>'+a+"<p><s>"+n+"</s></p>"+(a?"</prosody>":"")+"</amazon:auto-breaths></speak>"}else window.MathfieldElement.textToSpeechMarkup==="mac"&&y()==="macos"?n=n.replace(/<mark([^/]*)\/>/g,"").replace(/<emphasis>/g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(/<break time="(\d*)ms"\/>/g,"[[slc $1]]").replace(/<say-as[^>]*>/g,"").replace(/<\/say-as>/g,""):n=n.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return n}var Kl={"\\ne":"\u2260","\\neq":"\u2260","\u2212":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega","\\exponentialE":"e","\\imaginaryI":"i","\\imaginaryJ":"j","\\!":" ","\\,":" ","\\:":" ","\\>":" ","\\;":" ","\\enskip":" ","\\enspace":" ","\\qquad":" ","\\quad":" ","\\infty":"oo"},Ul={"\\pm":"+-","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrack":"[","\\rbrack":"]","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"(:","\\rangle":":)","\\sum":" sum ","\\prod":" prod ","\\bigcap":" nnn ","\\bigcup":" uuu ","\\int":" int ","\\oint":" oint ","\\ge":">=","\\le":"<=","\\ne":"!=","\\neq":"!=","\\lt":"<","\\gt":">","\\gets":"<-","\\to":"->","\\land":" and ","\\lor":" or ","\\lnot":" not ","\\forall":" AA ","\\exists":" EE ","\\in":" in ","\\notin":" !in ","\\mapsto":"|->","\\implies":"=>","\\iff":"<=>","\\cdot":"*","\\ast":"**","\\star":"***","\\times":"xx","\\div":"-:","\\ltimes":"|><","\\rtimes":"><|","\\bowtie":"|><|","\\circ":"@"};function zv(e){let t="";for(const r of e){const n=t[t.length-1];n!==void 0&&/\d/.test(n)&&/^\d/.test(r)&&(t+=" "),t+=r}return t}function hi(e){var t,r,n,a,o,_,N,z,W,j,X,ae,he;if(!e)return"";if(v(e)){if(e.length===0)return"";if(e[0].mode==="latex")return e.map(hi).join("");if(e[0].mode==="text"){let wt=0,st="";for(;((t=e[wt])==null?void 0:t.mode)==="text";)st+=e[wt].body?hi(e[wt].body):e[wt].value,wt++;return`"${st}" ${hi(e.slice(wt))}`}let Be=0;const nt=[];for(;e[Be]&&e[Be].mode==="math";){let wt="";for(;e[Be]&&e[Be].type==="mord"&&/\d/.test(e[Be].value);)wt+=e[Be++].value;wt?nt.push(wt):nt.push(hi(e[Be++]))}return nt.push(hi(e.slice(Be))),zv(nt)}if(e.mode==="text")return`"${e.value}"`;let _e="";const{command:Ue}=e;let yt;if(Ue==="\\placeholder")return`(${hi(e.body)})`;switch(e.type){case"accent":const Be={"\\vec":"vec","\\dot":"dot","\\ddot":"ddot","\\bar":"bar","\\hat":"hat","\\acute":"acute;","\\grave":"grave","\\tilde":"tilde","\\breve":"breave","\\check":"check"}[Ue];_e=`${Be!=null?Be:""} ${hi(e.body)} `;break;case"first":return"";case"latexgroup":return e.body.map(Gt=>Gt.value).join("");case"group":case"root":_e=(r=Kl[Ue])!=null?r:hi(e.body);break;case"genfrac":{const Gt=e;(Gt.leftDelim||Gt.rightDelim)&&(_e=Gt.leftDelim==="."||!Gt.leftDelim?"{:":Gt.leftDelim),Gt.hasBarLine?(_e+="(",_e+=hi(Gt.above),_e+=")/(",_e+=hi(Gt.below),_e+=")"):(_e+="("+hi(Gt.above)+"),",_e+="("+hi(Gt.below)+")"),(Gt.leftDelim||Gt.rightDelim)&&(_e+=Gt.rightDelim==="."||!Gt.rightDelim?"{:":Gt.rightDelim)}break;case"surd":_e+=e.hasEmptyBranch("above")?"sqrt("+hi(e.body)+")":"root("+hi(e.above)+")("+hi(e.body)+")";break;case"latex":_e=e.value;break;case"leftright":{const Gt=e,Hr=Gt.leftDelim;_e+=Hr==="."||!Hr?"{:":Hr,_e+=hi(Gt.body);const _n=Gt.matchingRightDelim();_e+=_n==="."||!_n?":}":_n}break;case"sizeddelim":case"delim":_e=e.value;break;case"overlap":break;case"overunder":break;case"mord":_e=(a=(n=Kl[Ue])!=null?n:Ue)!=null?a:typeof e.value=="string"?e.value:"",_e.startsWith("\\")&&(_e+=" "),yt=Ue?Ue.match(/{?\\char"([\dabcdefABCDEF]+)}?/):null,yt?_e=String.fromCodePoint(Number.parseInt("0x"+yt[1])):_e.length>0&&_e.startsWith("\\")&&(_e=typeof e.value=="string"?e.value.charAt(0):e.command),_e=$v(_e,e.style);break;case"mbin":case"mrel":case"minner":_e=(_=(o=Kl[Ue])!=null?o:Ul[Ue])!=null?_:e.value;break;case"mopen":case"mclose":_e=e.value;break;case"mpunct":_e=(N=Ul[Ue])!=null?N:Ue;break;case"mop":case"operator":case"extensible-symbol":e.value!=="\u200B"&&(Ul[Ue]?_e=Ul[Ue]:_e=Ue==="\\operatorname"?hi(e.body):(z=e.value)!=null?z:Ue,_e+=" ");break;case"array":const nt=e.array,wt=e.environmentName,st=(W={bmatrix:["[","]"],"bmatrix*":["[","]"]}[wt])!=null?W:["(",")"],zt=[];for(const Gt of nt){const Hr=[];for(const _n of Gt)Hr.push(st[0]+hi(_n)+st[1]);zt.push(Hr.join(","))}const qt=(j={bmatrix:["[","]"],"bmatrix*":["[","]"],cases:["{",":}"]}[wt])!=null?j:["(",")"];_e=qt[0]+zt.join(",")+qt[1];break;case"box":break;case"spacing":_e=(X=Kl[Ue])!=null?X:" ";break;case"enclose":_e="("+hi(e.body)+")";break;case"space":_e=" ";break;case"subsup":_e="";break;case"macro":_e=(he=(ae=Kl[Ue])!=null?ae:Ul[Ue])!=null?he:hi(e.body);break}if(!e.hasEmptyBranch("subscript")){_e+="_";const Be=hi(e.subscript);_e+=Be.length!==1?`(${Be})`:Be}if(!e.hasEmptyBranch("superscript")){_e+="^";const Be=hi(e.superscript);_e+=Be.length!==1?`(${Be})`:Be}return _e}function $v(e,t){if(!t)return e;let r=e;return t.variant==="double-struck"&&(r=`bbb "${r}"`),t.variant==="script"&&(r=`cc "${r}"`),t.variant==="fraktur"&&(r=`fr "${r}"`),t.variant==="sans-serif"&&(r=`sf "${r}"`),t.variant==="monospace"&&(r=`tt "${r}"`),t.variantStyle==="bold"&&(r=`bb "${r}"`),t.color?`color({${t.color}})(${r})`:r}function Pi(e,t){var r,n;t!=null||(t={}),t.mathstyle=(r=t.mathstyle)!=null?r:"displaystyle";const a=new Qr({from:i(F({},dc()),{renderPlaceholder:()=>new St(160,{maxFontSize:1}),letterShapeStyle:(n=t==null?void 0:t.letterShapeStyle)!=null?n:"tex"}),mathstyle:t.mathstyle}),_=new Qe({mode:"math",type:"root",body:na(e,{context:a,parseMode:"math",mathstyle:t.mathstyle})}).render(a);return _?(au(Sl(_,a)),su(_,{classes:"ML__latex"}).toMarkup()):""}function Ig(e){return nh(e,{context:dc()})}function Wv(e,t={}){return un(na(e,{parseMode:"math",args:()=>"",mathstyle:"displaystyle"}),t)}function Vv(e){const t=na(e,{parseMode:"math",mathstyle:"displaystyle"});return al(t)}var ec;function Hv(e){var t,r;if(!ec){const n=(t=globalThis[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:t.ComputeEngine;n?ec=new n:console.error(`MathLive 0.98.5: The CortexJS Compute Engine library is not available.
Load the library, for example with:
import "https://unpkg.com/@cortex-js/compute-engine?module"`)}return(r=ec==null?void 0:ec.box(e).latex)!=null?r:""}function Og(e,t="math"){return hi(new Qe({type:"root",body:na(e,{parseMode:t})}))}function Fg(e){return du(e,{format:"ascii-math"})[1]}function qc(e){if(typeof e=="string"){const t=jv(e);if(!t)throw new Error(`Invalid color: ${e}`);return t}return"C"in e?Zv(e):"a"in e?hd(e):e}function sl(e){return e<0?0:e>255?255:Math.round(e)}function jv(e){if(!e||e[0]!=="#")return;e=e.slice(1);let t;return e.length<=4?(t={r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16)},e.length===4&&(t.a=parseInt(e[3]+e[3],16)/255)):(t={r:parseInt(e[0]+e[1],16),g:parseInt(e[2]+e[3],16),b:parseInt(e[4]+e[5],16)},e.length===8&&(t.a=parseInt(e[6]+e[7],16)/255)),t&&typeof t.a=="undefined"&&(t.a=1),t}function Jc(e){const[t,r,n]=[e.L,e.C,e.H],a=n*Math.PI/180,o={L:t,a:r*Math.cos(a),b:r*Math.sin(a)};return e.alpha!==void 0&&(o.alpha=e.alpha),o}function Gv(e){const[t,r,n]=[e.L,e.a,e.b],a=Math.sqrt(r*r+n*n),_=Math.atan2(n,r)*180/Math.PI,N={L:t,C:a,H:_};return e.alpha!==void 0&&(N.alpha=e.alpha),N}function Qc(e){const[t,r,n]=[e.L,e.a,e.b],a=Math.pow(.9999999984505198*t+.39633779217376786*r+.2158037580607588*n,3),o=Math.pow(1.00000000888176*t-.10556134232365635*r-.0638541747717059*n,3),_=Math.pow(t*1.000000054672411-.0894841820949657*r-1.2914855378640917*n,3),N=4.076741661347994*a-3.307711590408193*o+.230969928729428*_,z=-1.2684380040921763*a+2.6097574006633715*o-.3413193963102197*_,W=-.004196086541837188*a-.7034186144594493*o+1.7076147009309444*_,j=X=>{const ae=Math.abs(X);return ae<=.0031308?X*12.92:(Math.sign(X)||1)*(1.055*Math.pow(ae,1/2.4)-.055)};return[j(N),j(z),j(W)]}function ef(e){const[t,r,n]=e;return t>=0&&t<=1&&r>=0&&r<=1&&n>=0&&n<=1}function tf(e,t){let[r,n,a]=e;return r=sl(r*255),n=sl(n*255),a=sl(a*255),t!==void 0?{r,g:n,b:a,alpha:t}:{r,g:n,b:a}}function hd(e){let[t,r,n]=Qc(e);if(ef([t,r,n]))return tf([t,r,n],e.alpha);const a=Gv(e);if(a.C=0,[t,r,n]=Qc(Jc(a)),!ef([t,r,n]))return tf([t,r,n],e.alpha);let o=0,_=e.L,N=(o+_)/2;a.C=N;const z=.36/Math.pow(2,12);for(;_-o>z;)N=(o+_)/2,a.C=N,[t,r,n]=Qc(Jc(a)),ef([t,r,n])?o=N:_=N;return tf([t,r,n],e.alpha)}function Zv(e){return hd(Jc(e))}function dd(e,t){const r=qc(e),n=qc(t),a=.56,o=.57,_=.62,N=.65,z=.022,W=1.414,j=.1,X=5e-4,ae=1.14,he=.027,_e=1.14,Ue=.027;function yt(Gt){return Gt>=z?Gt:Gt+Ss(z-Gt,W)}function Be(Gt){return(Gt<0?-1:1)*Math.pow(Math.abs(Gt),2.4)}const nt=yt(Be(n.r/255)*.2126729+Be(n.g/255)*.7151522+Be(n.b/255)*.072175),wt=yt(Be(r.r/255)*.2126729+Be(r.g/255)*.7151522+Be(r.b/255)*.072175);let st,zt,qt;return Math.abs(wt-nt)<X?zt=0:wt>nt?(st=Ss(wt,a)-Ss(nt,o),zt=st*ae):(st=Ss(wt,N)-Ss(nt,_),zt=st*_e),Math.abs(zt)<j?qt=0:zt>0?qt=zt-Ue:qt=zt+he,qt*100}function pd(e,t,r){r!=null||(r="#fff"),t!=null||(t="#000");const n=dd(e,r),a=dd(e,t);return Math.abs(n)>Math.abs(a)?r:t}function Yv(e){const t=qc(e);let r=((1<<24)+(sl(t.r)<<16)+(sl(t.g)<<8)+sl(t.b)).toString(16).slice(1);return t.alpha!==void 0&&t.alpha<1&&(r+=("00"+Math.round(t.alpha*255).toString(16)).slice(-2)),r[0]===r[1]&&r[2]===r[3]&&r[4]===r[5]&&r[6]===r[7]&&(r=r[0]+r[2]+r[4]+(t.alpha!==void 0&&t.alpha<1?r[6]:"")),"#"+r}function Vn(e){const t=md(e);let r="";for(const n of t){if(typeof n.value!="string")return"";r+=n.value}return r}function md(e){const r=e.model.selection.ranges;return r.length!==1?[]:e.model.getAtoms(r[0])}function Xv(e,t){const r=md(e);if(r.length!==1)return!1;const n=bc[t];return n?!!n.test(r[0].value):!1}function qv(e,t){return Vn(e).length>0}function Jv(e){return[rf(e,"double-struck","mathbb","tooltip.blackboard"),rf(e,"fraktur","mathfrak","tooltip.fraktur"),rf(e,"calligraphic","mathcal","tooltip.caligraphic"),nf(e,"up","mathrm","tooltip.roman-upright"),nf(e,"bold","mathbf","tooltip.bold"),nf(e,"italic","mathit","tooltip.italic")]}function Qv(e){return[{label:()=>Pi(`\\vec{${Vn(e)}}`),visible:()=>Vn(e).length===1,onMenuSelect:()=>e.insert("\\vec{#@}",{selectionMode:"item"})},{label:()=>Pi(`\\overrightarrow{${Vn(e)}}`),visible:()=>Vn(e).length>0,onMenuSelect:()=>e.insert("\\overrightarrow{#@}",{selectionMode:"item"})},{label:()=>Pi(`\\overleftarrow{${Vn(e)}}`),visible:()=>Vn(e).length>0,onMenuSelect:()=>e.insert("\\overleftarrow{#@}",{selectionMode:"item"})},{label:()=>Pi(`\\dot{${Vn(e)}}`),visible:()=>Vn(e).length===1,onMenuSelect:()=>e.insert("\\dot{#@}",{selectionMode:"item"})},{label:()=>Pi(`\\ddot{${Vn(e)}}`),visible:()=>Vn(e).length===1,onMenuSelect:()=>e.insert("\\ddot{#@}",{selectionMode:"item"})},{label:()=>Pi(`\\bar{${Vn(e)}}`),visible:()=>Vn(e).length===1,onMenuSelect:()=>e.insert("\\bar{#@}",{selectionMode:"item"})},{label:()=>Pi(`\\overline{${Vn(e)}}`),visible:()=>Vn(e).length>0,onMenuSelect:()=>e.insert("\\overline{#@}",{selectionMode:"item"})},{label:()=>Pi(`\\overgroup{${Vn(e)}}`),visible:()=>Vn(e).length>0,onMenuSelect:()=>e.insert("\\overgroup{#@}",{selectionMode:"item"})},{label:()=>Pi(`\\overbrace{${Vn(e)}}`),visible:()=>Vn(e).length>0,onMenuSelect:()=>e.insert("\\overbrace{#@}",{selectionMode:"item"})},{label:()=>Pi(`\\underline{${Vn(e)}}`),visible:()=>Vn(e).length>0,onMenuSelect:()=>e.insert("\\underline{#@}",{selectionMode:"item"})},{label:()=>Pi(`\\undergroup{${Vn(e)}}`),visible:()=>Vn(e).length>0,onMenuSelect:()=>e.insert("\\undergroup{#@}",{selectionMode:"item"})},{label:()=>Pi(`\\underbrace{${Vn(e)}}`),visible:()=>Vn(e).length>0,onMenuSelect:()=>e.insert("\\underbrace{#@}",{selectionMode:"item"})}]}function eg(e){return[{label:()=>Pi(`\\boxed{${e.getValue(e.model.selection)}}}`),onMenuSelect:()=>e.insert("\\boxed{#@}",{selectionMode:"item"})},{label:()=>Pi(`\\bbox[5px, border: 2px solid red]{${e.getValue(e.model.selection)}}`),onMenuSelect:()=>e.insert("\\bbox[5px, border: 2px solid red]{#@}",{selectionMode:"item"})},{label:()=>Pi(`\\bbox[5px, border: 2px dashed black]{${e.getValue(e.model.selection)}}`),onMenuSelect:()=>e.insert("\\bbox[5px, border: 2px dashed black]{#@}",{selectionMode:"item"})}]}function tg(e){const t=[];for(const r of Object.keys(k))t.push({class:(Yv(pd(k[r]))==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${k[r]} "></span>`,ariaLabel:()=>{var n;return(n=u(r))!=null?n:r},checked:()=>{var n;return{some:"mixed",all:!0}[(n=e.queryStyle({backgroundColor:r}))!=null?n:!1]},onMenuSelect:()=>{e.applyStyle({backgroundColor:r},{operation:"toggle"}),e.adoptStyle="none"}});return t}function rg(e){const t=[];for(const r of Object.keys(m))t.push({class:(pd(m[r])==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${m[r]} "></span>`,ariaLabel:()=>{var n;return(n=u(r))!=null?n:r},checked:()=>{var n;return{some:"mixed",all:!0}[(n=e.queryStyle({color:r}))!=null?n:!1]},onMenuSelect:()=>{e.applyStyle({color:r},{operation:"toggle"}),e.adoptStyle="none"}});return t}var ng=class extends rd{constructor(e,t,r,n){super(e,t),this.row=r,this.col=n}set active(e){const t=this.parentMenu.children;if(e)for(const r of t)r.element.classList.toggle("active",r.row<=this.row&&r.col<=this.col);else for(const r of t)r.element.classList.remove("active")}};function ig(e){const t=[];for(let r=1;r<=5;r++)for(let n=1;n<=5;n++)t.push({onCreate:(a,o)=>new ng(a,o,r,n),label:"\u2610",tooltip:()=>u("tooltip.row-by-col",r,n),data:{row:r,col:n},onMenuSelect:()=>{e.insert(`\\begin{pmatrix}${Array(r).fill(Array(n).fill("#?").join(" & ")).join("\\\\")}\\end{pmatrix}`,{selectionMode:"item"})}});return t}function ag(e){return[{label:()=>u("menu.array.add row above"),id:"add-row-above",onMenuSelect:()=>e.executeCommand("addRowBefore"),visible:()=>ko(e)},{label:()=>u("menu.array.add row below"),id:"add-row-below",onMenuSelect:()=>e.executeCommand("addRowAfter"),visible:()=>ko(e)},{label:()=>u("menu.array.add column before"),id:"add-column-before",onMenuSelect:()=>e.executeCommand("addColumnBefore"),visible:()=>ko(e),enabled:()=>{const t=e.model.parentEnvironment;if(!t)return!1;const[r,n]=og(e);return r<t.maxColumns}},{label:()=>u("menu.array.add column after"),id:"add-column-after",onMenuSelect:()=>e.executeCommand("addColumnAfter"),visible:()=>ko(e)},{type:"divider"},{label:()=>u("menu.array.delete row"),id:"delete-row",onMenuSelect:()=>e.executeCommand("removeRow"),visible:()=>ko(e)},{label:()=>u("menu.array.delete column"),id:"delete-column",onMenuSelect:()=>e.executeCommand("removeColumn"),visible:()=>ko(e)},{type:"divider"},{label:()=>u("menu.borders"),visible:()=>(sg(e)||ko(e))&&e.isSelectionEditable,submenu:[{label:" \u22F1 ",id:"environment-no-border",onMenuSelect:()=>zl(e,"matrix")},{label:"(\u22F1)",id:"environment-parentheses",onMenuSelect:()=>zl(e,"pmatrix")},{label:"[\u22F1]",id:"environment-brackets",onMenuSelect:()=>zl(e,"bmatrix")},{label:"|\u22F1|",id:"environment-bar",onMenuSelect:()=>zl(e,"vmatrix")},{label:"{\u22F1}",id:"environment-braces",onMenuSelect:()=>zl(e,"Bmatrix")}],submenuClass:"border-submenu"},{type:"divider"},{label:()=>u("menu.insert matrix"),id:"insert-matrix",visible:()=>e.isSelectionEditable,submenu:ig(e),submenuClass:"insert-matrix-submenu",columnCount:5},{label:()=>u("menu.mode"),id:"mode",visible:()=>e.isSelectionEditable&&e.model.selectionIsCollapsed,submenu:[{label:()=>u("menu.mode-math"),id:"mode-math",onMenuSelect:()=>{Yo(e,"accept-all"),e.executeCommand(["switchMode","math"])},checked:()=>e.model.mode==="math"},{label:()=>u("menu.mode-text"),id:"mode-text",onMenuSelect:()=>{Yo(e,"accept-all"),e.executeCommand(["switchMode","text"])},checked:()=>e.model.mode==="text"},{label:()=>u("menu.mode-latex"),id:"mode-latex",onMenuSelect:()=>e.executeCommand(["switchMode","latex"]),checked:()=>e.model.mode==="latex"}]},{type:"divider"},{label:()=>u("menu.font-style"),id:"variant",visible:()=>e.isSelectionEditable,submenu:Jv(e),submenuClass:"variant-submenu"},{label:()=>u("menu.color"),id:"color",visible:()=>e.isSelectionEditable,submenu:rg(e),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>u("menu.background-color"),id:"background-color",visible:()=>e.isSelectionEditable,submenu:tg(e),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>u("menu.accent"),id:"accent",visible:()=>e.isSelectionEditable,submenu:Qv(e),submenuClass:"variant-submenu"},{label:()=>u("menu.decoration"),id:"decoration",visible:()=>e.isSelectionEditable&&Vn(e).length>0,submenu:eg(e),submenuClass:"variant-submenu"},{type:"divider"},{label:()=>u("menu.evaluate"),id:"ce-evaluate",visible:()=>e.isSelectionEditable&&window.MathfieldElement.computeEngine!==null,onMenuSelect:()=>{const t=lg(e);if(!t){e.model.announce("plonk");return}e.model.selectionIsCollapsed?(e.model.position=e.model.lastOffset,e.insert(`=${t}`,{insertionMode:"insertAfter",selectionMode:"item"})):e.insert(t,{insertionMode:"replaceSelection",selectionMode:"item"})}},{label:()=>u("menu.simplify"),id:"ce-simplify",visible:()=>e.isSelectionEditable&&window.MathfieldElement.computeEngine!==null,onMenuSelect:()=>{var t,r;if(e.model.selectionIsCollapsed){const n=(t=e.expression)==null?void 0:t.simplify();if(e.model.position=e.model.lastOffset,!n){e.model.announce("plonk");return}e.insert(`=${n.latex}`,{insertionMode:"insertAfter",selectionMode:"item"})}else{const n=(r=window.MathfieldElement.computeEngine)==null?void 0:r.parse(e.getValue(e.model.selection)).simplify();if(!n){e.model.announce("plonk");return}e.insert(n.latex,{insertionMode:"replaceSelection",selectionMode:"item"})}}},{label:()=>{var t;if(window.MathfieldElement.computeEngine===null)return"";const r=(t=e.expression)==null?void 0:t.unknowns[0];return r?u("menu.solve-for",Pi(r)):u("menu.solve")},id:"ce-solve",visible:()=>{var t;return e.isSelectionEditable&&window.MathfieldElement.computeEngine!==null&&((t=e.expression)==null?void 0:t.unknowns.length)===1&&e.expression.unknowns[0]!=="Nothing"},onMenuSelect:()=>{var t;const r=e.expression,n=r==null?void 0:r.unknowns[0],a=(t=r.solve(n))==null?void 0:t.map(o=>{var _;return(_=o.simplify().latex)!=null?_:""});if(!a){e.model.announce("plonk");return}e.insert(`${n}=${a.length===1?a[0]:"\\left\\lbrace"+(a==null?void 0:a.join(", "))+"\\right\\rbrace"}`,{insertionMode:"replaceAll",selectionMode:"item"})}},{type:"divider"},{label:()=>u("menu.cut"),onMenuSelect:()=>e.executeCommand("cutToClipboard"),visible:()=>!e.options.readOnly&&e.isSelectionEditable,keyboardShortcut:"meta+X"},{label:()=>u("menu.copy"),id:"copy",submenu:[{label:()=>u("menu.copy-as-latex"),id:"copy-latex",onMenuSelect:()=>Wn.copyToClipboard(e,"latex"),keyboardShortcut:"meta+C"},{label:()=>u("menu.copy-as-ascii-math"),id:"copy-ascii-math",onMenuSelect:()=>Wn.copyToClipboard(e,"ascii-math")},{label:()=>u("menu.copy-as-mathml"),id:"copy-math-ml",onMenuSelect:()=>Wn.copyToClipboard(e,"math-ml")}]},{label:()=>u("menu.paste"),id:"paste",onMenuSelect:()=>e.executeCommand("pasteFromClipboard"),visible:()=>e.hasEditableContent,keyboardShortcut:"meta+V"},{label:()=>u("menu.select-all"),id:"select-all",keyboardShortcut:"meta+A",onMenuSelect:()=>e.executeCommand("selectAll")}]}function ko(e){var t;return!!((t=e.model.parentEnvironment)!=null&&t.array)}function sg(e){return e.model.at(e.model.position).type==="array"}function og(e){var t;const r=(t=e.model.parentEnvironment)==null?void 0:t.array;return r?[r.length,r.reduce((n,a)=>Math.max(n,a.length),0)]:[0,0]}function zl(e,t){Du(e),e.flushInlineShortcutBuffer(),Ih(e.model,t),oi(e)}function lg(e){var t,r;let n;if(e.model.selectionIsCollapsed?n=(t=window.MathfieldElement.computeEngine)==null?void 0:t.parse(e.getValue(),{canonical:!1}):n=(r=window.MathfieldElement.computeEngine)==null?void 0:r.parse(e.getValue(e.model.selection),{canonical:!1}),!n)return"";let a=n.evaluate();return a.isSame(n)&&(a=n.N()),a.latex}function rf(e,t,r,n){return{label:()=>Pi(`\\${r}{${Vn(e)}}`),tooltip:()=>{var a;return(a=u(n))!=null?a:n},visible:()=>Xv(e,t),checked:()=>{var a;return{some:"mixed",all:!0}[(a=e.queryStyle({variant:t}))!=null?a:!1]},onMenuSelect:()=>{e.applyStyle({variant:t},{operation:"toggle"}),e.adoptStyle="none"}}}function nf(e,t,r,n){return{label:()=>Pi(`\\${r}{${Vn(e)}}`),tooltip:()=>{var a;return(a=u(n))!=null?a:n},visible:()=>qv(e,t),checked:()=>{var a;return{some:"mixed",all:!0}[(a=e.queryStyle({variantStyle:t}))!=null?a:!1]},onMenuSelect:()=>{e.applyStyle({variantStyle:t},{operation:"toggle"}),e.adoptStyle="none"}}}function ol(e,t){return e+al(t)}_a({speak:(e,t,r)=>ug(e,t,r)},{target:"mathfield"});function ug(e,t,r){var n,a;r=r!=null?r:{withHighlighting:!1};const{model:o}=e;function _(j){let X=null;switch(j){case"all":X=o.root;break;case"selection":X=o.getAtoms(o.selection);break;case"left":{X=o.getAtoms(o.offsetOf(o.at(o.position).leftSibling),o.position);break}case"right":{X=o.getAtoms(o.position,o.offsetOf(o.at(o.position).rightSibling));break}case"group":X=o.getAtoms(o.getSiblingsRange(o.position));break;case"parent":{const{parent:ae}=o.at(o.position);ae!=null&&ae.parent?X=ae:X=o.root;break}default:X=o.root}return X}function N(j){let X="";switch(j){case"all":console.log("Internal failure: speak all failed");break;case"selection":X="no selection";break;case"left":X="at start";break;case"right":X="at end";break;case"group":console.log("Internal failure: speak group failed");break;case"parent":X="no parent";break;default:console.log('unknown speak_ param value: "'+j+'"');break}return X}const z=_(t);if(z===null)return(a=(n=window.MathfieldElement).speakHook)==null||a.call(n,N(t)),!1;(r.withHighlighting||window.MathfieldElement.speechEngine==="amazon")&&(window.MathfieldElement.textToSpeechMarkup=window.sre&&window.MathfieldElement.textToSpeechRules==="sre"?"ssml_step":"ssml");const W=al(z);return b()&&r.withHighlighting?(Xs().readAloudMathfield=e,bo(e,{forHighlighting:!0}),window.MathfieldElement.readAloudHook&&window.MathfieldElement.readAloudHook(e.field,W)):window.MathfieldElement.speakHook&&window.MathfieldElement.speakHook(W),!1}function cg(e){var t,r;if(!b()){console.log("Speak:",e);return}if(!window.MathfieldElement.speechEngine||window.MathfieldElement.speechEngine==="local"){const n=new SpeechSynthesisUtterance(e);window.speechSynthesis.speak(n)}else if(window.MathfieldElement.speechEngine==="amazon")if(!("AWS"in window))console.error("MathLive 0.98.5: AWS SDK not loaded. See https://www.npmjs.com/package/aws-sdk");else{const n=new window.AWS.Polly({apiVersion:"2016-06-10"}),a={OutputFormat:"mp3",VoiceId:(t=window.MathfieldElement.speechEngineVoice)!=null?t:"Joanna",Engine:["Amy","Emma","Brian","Ivy","Joanna","Kendra","Kimberly","Salli","Joey","Justin","Matthew"].includes((r=window.MathfieldElement.speechEngineVoice)!=null?r:"Joanna")?"neural":"standard",Text:e,TextType:"ssml"};n.synthesizeSpeech(a,(o,_)=>{if(o)console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech()\` error: ${o}`);else if(_!=null&&_.AudioStream){const N=new Uint8Array(_.AudioStream),z=new Blob([N.buffer],{type:"audio/mpeg"}),W=URL.createObjectURL(z);new Audio(W).play().catch(X=>console.log(X))}else console.log("polly.synthesizeSpeech():",_)})}else window.MathfieldElement.speechEngine==="google"&&console.error("MathLive 0.98.5: The Google speech engine is not supported yet. Please come again.")}function vd(e){var t;let r;if(e.parent.type==="prompt")e.parentBranch==="body"&&(r="prompt");else if(e.parentBranch==="body")r=e.type&&(t={enclose:"cross out",leftright:"delimiter",surd:"square root",root:"math field",mop:"operator",first:"first"}[e.type])!=null?t:"parent";else if(e.parent.type==="genfrac"){if(e.parentBranch==="above")return"numerator";if(e.parentBranch==="below")return"denominator"}else e.parent.type==="surd"?e.parentBranch==="above"&&(r="index"):e.parentBranch==="superscript"?r="superscript":e.parentBranch==="subscript"&&(r="subscript");return r||console.log("unknown relationship"),r!=null?r:"parent"}function fg(e,t,r,n){let a="";if(t==="plonk")window.MathfieldElement.playSound("plonk"),e.flushInlineShortcutBuffer();else if(t==="delete")a=ol("deleted: ",n);else if(t==="focus"||t.includes("move"))a=hg(e.model,r)+(e.model.selectionIsCollapsed?"":"selected: ")+dg(e.model);else if(t==="replacement")a=ol("",e.model.at(e.model.position));else if(t==="line"){const o=ol("",e.model.root);e.keyboardDelegate.setAriaLabel(o)}else a=n?ol(t+" ",n):t;if(a){const o=e.ariaLiveText.textContent.includes("\xA0")?" \u202F ":" \xA0 ";e.ariaLiveText.textContent=a+o}}function hg(e,t){if(Number.isNaN(t))return"";const r=e.at(t);if(!r||r.treeDepth<=e.at(e.position).treeDepth)return"";let n="",a=r.parent;const o=e.at(e.position).parent;for(;a!==e.root&&a!==o;)n+=`out of ${vd(a)};`,a=a.parent;return n}function dg(e){if(!e.selectionIsCollapsed)return ol("",e.getAtoms(e.selection));let t="";const r=e.at(e.position),n=vd(r);return r.isFirstSibling&&(t=(n?"start of "+n:"unknown")+": "),r.isLastSibling?r.isFirstSibling||(t+=n?"end of "+n:"unknown"):t+=ol("",r),t}var pg=class{constructor(e,t,r){this.mathfield=e,this.mode=t,this.silenceNotifications=!1,this._selection={ranges:[[0,0]],direction:"none"},this._anchor=0,this._position=0,this.root=r}dispose(){this.mathfield=void 0}getState(){const e={ranges:[...this._selection.ranges]};return this.selection.direction&&this.selection.direction!=="none"&&(e.direction=this.selection.direction),{content:this.root.toJson(),selection:e,mode:this.mode}}setState(e,t){var r;const n=this.silenceNotifications;this.silenceNotifications=(r=t==null?void 0:t.silenceNotifications)!=null?r:!0;let a={};if((t==null?void 0:t.type)==="undo"&&(a={inputType:"historyUndo"}),(t==null?void 0:t.type)==="redo"&&(a={inputType:"historyRedo"}),this.contentWillChange(a)){const o=this.silenceNotifications;this.silenceNotifications=!0,this.mode=e.mode,this.root=js(e.content),this.selection=e.selection,this.silenceNotifications=o,this.contentDidChange(a)}this.silenceNotifications=n}get atoms(){return this.root.children}get selection(){return this._selection}set selection(e){this.setSelection(e)}setSelection(e,t){return!this.mathfield.contentEditable&&this.mathfield.userSelect==="none"?!1:this.deferNotifications({selection:!0},()=>{var r,n,a;const o=this.normalizeSelection(e,t);if(o===void 0)throw new TypeError("Invalid selection");if(o.ranges.length===1&&o.ranges[0][0]===o.ranges[0][1]){const j=o.ranges[0][0];if(!this.mathfield.dirty&&!((r=this.at(j))!=null&&r.parentPrompt)&&this.mathfield.hasEditablePrompts){if((n=this.at(j-1))!=null&&n.parentPrompt){this._anchor=this.normalizeOffset(j-1),this._position=this._anchor,this._selection=this.normalizeSelection(this._anchor);return}if((a=this.at(j+1))!=null&&a.parentPrompt){this._anchor=this.normalizeOffset(j+1),this._position=this._anchor,this._selection=this.normalizeSelection(this._anchor);return}this._anchor=0,this._position=0,this._selection={ranges:[[0,0]]};return}this._anchor=j,this._position=j,this._selection=o;return}const _=Xi(o);o.direction==="backward"?[this._position,this._anchor]=_:[this._anchor,this._position]=_;const N=this.at(_[0]+1),z=this.at(_[1]),W=Qe.commonAncestor(N,z);(W==null?void 0:W.type)==="array"&&N.parent===W&&z.parent===W?this._selection={ranges:[_],direction:o.direction}:this._selection={ranges:[_],direction:o.direction},console.assert(this._position>=0&&this._position<=this.lastOffset)})}setPositionHandlingPlaceholder(e){var t;const r=this.at(e);(r==null?void 0:r.type)==="placeholder"?this.setSelection(e-1,e):((t=r==null?void 0:r.rightSibling)==null?void 0:t.type)==="placeholder"?this.setSelection(e,e+1):this.position=e,r instanceof Ni&&r.isSuggestion&&(r.isSuggestion=!1),this.mathfield.stopCoalescingUndo()}get position(){return this._position}set position(e){this.setSelection(e,e)}get anchor(){return this._anchor}get selectionIsCollapsed(){return this._anchor===this._position}get selectionIsPlaceholder(){return Math.abs(this._anchor-this._position)===1?this.at(Math.max(this._anchor,this._position)).type==="placeholder":!1}collapseSelection(e="forward"){return this._anchor===this._position?!1:(e==="backward"?this.position=Math.min(this._anchor,this._position):this.position=Math.max(this._anchor,this._position),!0)}get lastOffset(){return this.atoms.length-1}at(e){return this.atoms[e]}offsetOf(e){return this.atoms.indexOf(e)}getSiblingsRange(e){const t=this.at(e),{parent:r}=t;if(!r)return[0,this.lastOffset];const n=t.parent.branch(t.parentBranch);return[this.offsetOf(n[0]),this.offsetOf(n[n.length-1])]}getBranchRange(e,t){const r=this.at(e).branch(t);return[this.offsetOf(r[0]),this.offsetOf(r[r.length-1])]}getAtoms(e,t,r){let n=r!=null?r:{};if(hu(e)){if(n=t!=null?t:{},e.ranges.length>1)return e.ranges.reduce((W,j)=>[...W,...this.getAtoms(j,n)],[]);e=e.ranges[0]}let a,o;if($s(e)){if(a=e,!$s(t))return[];o=t}else[a,o]=e,n=t!=null?t:{};if(!Number.isFinite(a))return[];n.includeChildren===void 0&&(n.includeChildren=!1),a<0&&(a=this.lastOffset-a+1),o<0&&(o=this.lastOffset-o+1);const _=Math.min(a,o)+1,N=Math.max(a,o);if(!n.includeChildren&&_===1&&N===this.lastOffset)return[this.root];let z=[];for(let W=_;W<=N;W++){const j=this.atoms[W];gd(this,j,_,N)&&z.push(j)}return n.includeChildren||(z=z.filter(W=>{let j=!1,{parent:X}=W;for(;X&&!j;)j=gd(this,X,_,N),X=X.parent;return!j})),z}getAllAtoms(e=0){const t=[],r=this.lastOffset;for(let n=e;n<=r;n++)t.push(this.atoms[n]);for(let n=0;n<e;n++)t.push(this.atoms[n]);return t}findAtom(e,t=0,r="forward"){let n;const a=this.lastOffset;if(r==="forward"){for(let o=t;o<=a;o++)if(n=this.atoms[o],e(n))return n;for(let o=0;o<t;o++)if(n=this.atoms[o],e(n))return n;return}for(let o=t;o>=0;o--)if(n=this.atoms[o],e(n))return n;for(let o=a;o>t;o--)if(n=this.atoms[o],e(n))return n}extractAtoms(e){let t=this.getAtoms(e);if(t.length===1&&!t[0].parent)if(t[0].type==="root")t=[...t[0].body],t.shift();else return t=this.root.cells.flat(),this.root=new Qe({type:"root",body:[]}),t;for(const r of t)r.parent.removeChild(r);return t}deleteAtoms(e){this.extractAtoms(e),this.position=e[0]}atomToString(e,t){const r=t!=null?t:"latex";if(r.startsWith("latex"))return Qe.serialize([e],{expandMacro:r==="latex-expanded",skipStyles:r==="latex-unstyled",skipPlaceholders:r==="latex-without-placeholders",defaultMode:this.mathfield.options.defaultMode});if(r==="math-ml")return un(e);if(r==="spoken")return al(e);if(r==="spoken-text"){const n=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="";const a=al(e);return window.MathfieldElement.textToSpeechMarkup=n,a}if(r==="spoken-ssml"||r==="spoken-ssml-with-highlighting"){const n=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="ssml";const a=al(e);return window.MathfieldElement.textToSpeechMarkup=n,a}return r==="ascii-math"?hi(e):(console.error(`MathLive 0.98.5: Unexpected format "${r}`),"")}getValue(e,t,r){if(e===void 0)return this.atomToString(this.root,"latex");if(typeof e=="string"&&e!=="math-json")return this.atomToString(this.root,e);let n,a;if($s(e)&&$s(t)?(n=[this.normalizeRange([e,t])],a=r):fu(e)?(n=[this.normalizeRange(e)],a=t):hu(e)?(n=e.ranges,a=t):(n=[this.normalizeRange([0,-1])],a=e),a!=null||(a="latex"),a==="math-json"){if(!window.MathfieldElement.computeEngine)return window[Symbol.for("io.cortexjs.compute-engine")]||console.error(`The CortexJS Compute Engine library is not available.
Load the library, for example with:
import "https://unpkg.com/@cortex-js/compute-engine?module"`),'["Error", "compute-engine-not-available"]';const o=this.getValue({ranges:n},"latex-unstyled");try{const _=window.MathfieldElement.computeEngine.parse(o);return JSON.stringify(_.json)}catch(_){return JSON.stringify(["Error",`'${_.toString()}'`])}}if(a.startsWith("latex")){const o={expandMacro:a==="latex-expanded",skipStyles:a==="latex-unstyled",skipPlaceholders:a==="latex-without-placeholders",defaultMode:this.mathfield.options.defaultMode};return Jr(n.map(_=>Qe.serialize(this.getAtoms(_),o)))}return n.map(o=>this.getAtoms(o).map(_=>this.atomToString(_,a)).join("")).join("")}extendSelectionTo(e,t){return!this.mathfield.contentEditable&&this.mathfield.userSelect==="none"?!1:this.deferNotifications({selection:!0},()=>{const r=this.normalizeRange([e,t]);let[n,a]=r,{parent:o}=this.at(a);if(o&&(o.type==="genfrac"||o.type==="subsup"))for(;o!==this.root&&af(this,o,[n,a]);)a=this.offsetOf(o),o=o.parent;for(o=this.at(n).parent;o!==this.root&&af(this,o,[n,a]);)n=this.offsetOf(o.leftSibling),o=o.parent;if(o=this.at(a).parent,(o==null?void 0:o.type)==="genfrac")for(;o!==this.root&&af(this,o,[n,a]);)a=this.offsetOf(o),console.assert(a>=0),o=o.parent;this._position=this.normalizeOffset(t),this._selection={ranges:[[n,a]],direction:"none"}})}announce(e,t,r=[]){var n,a;((a=(n=this.mathfield.host)==null?void 0:n.dispatchEvent(new CustomEvent("announce",{detail:{command:e,previousPosition:t,atoms:r},cancelable:!0,bubbles:!0,composed:!0})))!=null?a:!0)&&fg(this.mathfield,e,t,r)}deferNotifications(e,t){const r=this._selection,n=this._anchor,a=this._position,o=this.silenceNotifications;this.silenceNotifications=!0;const _=this.root.changeCounter;t();const N=this.root.changeCounter!==_,z=n!==this._anchor||a!==this._position||A0(this._selection,r)==="different";return this.silenceNotifications=o,e.content&&N&&this.contentDidChange({inputType:e.type}),e.selection&&z&&this.selectionDidChange(),N||z}normalizeOffset(e){return e>0?e=Math.min(e,this.lastOffset):e<0&&(e=this.lastOffset+e+1),e}normalizeRange(e){let[t,r]=e;return t=this.normalizeOffset(t),r=this.normalizeOffset(r),t<r?[t,r]:[r,t]}normalizeSelection(e,t){var r;let n;if($s(e)){const a=this.normalizeOffset(e);if($s(t)){const o=this.normalizeOffset(t);n=a<=o?{ranges:[[a,o]],direction:"none"}:{ranges:[[o,a]],direction:"backward"}}else n={ranges:[[a,a]],direction:"none"}}else if(fu(e)){const a=this.normalizeOffset(e[0]),o=this.normalizeOffset(e[1]);n=a<=o?{ranges:[[a,o]],direction:"none"}:{ranges:[[o,a]],direction:"backward"}}else hu(e)&&(n={ranges:e.ranges.map(a=>this.normalizeRange(a)),direction:(r=e.direction)!=null?r:"none"});return console.assert(n!==void 0),n}get parentEnvironment(){let e=this.at(this.position).parent;if(e){for(;e.parent&&e.type!=="array";)e=e.parent;if(e.type==="array")return e}}get cell(){var e;let t=this.at(this.position);if(t){for(;t&&((e=t.parent)==null?void 0:e.type)!=="array";)t=t.parent;if(!(!(t!=null&&t.parent)||t.parent.type!=="array"))return t.parentBranch}}contentWillChange(e={}){if(this.silenceNotifications||!this.mathfield)return!0;const t=this.silenceNotifications;this.silenceNotifications=!0;const r=this.mathfield.onContentWillChange(e);return this.silenceNotifications=t,r}contentDidChange(e){var t;if(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(vs(this.mathfield)),this.silenceNotifications||!this.mathfield.host||!this.mathfield)return;const r=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.host.dispatchEvent(new InputEvent("input",i(F({},e),{data:e.data?e.data:(t=e.inputType)!=null?t:"",bubbles:!0,composed:!0}))),this.silenceNotifications=r}selectionDidChange(){if(!this.mathfield||(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(vs(this.mathfield)),this.silenceNotifications))return;const e=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.onSelectionDidChange(),this.silenceNotifications=e}};function gd(e,t,r,n){const a=e.offsetOf(t);if(a<r||a>n)return!1;if(!t.hasChildren)return!0;const o=e.offsetOf(t.firstChild);if(o>=r&&o<=n){const _=e.offsetOf(t.lastChild);if(_>=r&&_<=n)return!0}return!1}function af(e,t,r){if(!(t!=null&&t.hasChildren))return!1;const[n,a]=r,o=e.offsetOf(t.firstChild),_=e.offsetOf(t.lastChild);return o>=n&&o<=a&&_>=o&&_<=a}function $l(e,t,r,n){var a,o,_,N,z,W;const j=r.parent;if(j&&r instanceof si){const X=!n&&t==="forward"||n==="body"&&t==="backward";let ae=X?e.offsetOf(r.firstChild):e.offsetOf(r.lastChild);return X?r.rightDelim!=="?"&&r.rightDelim!=="."?(r.leftDelim=".",r.isDirty=!0):(j.addChildrenAfter(r.removeBranch("body"),r),j.removeChild(r),ae--):r.leftDelim!=="?"&&r.leftDelim!=="."?(r.rightDelim=".",r.isDirty=!0):(j.addChildrenAfter(r.removeBranch("body"),r),j.removeChild(r),ae--),e.position=ae,!0}if(j&&r.type==="surd"){if(t==="forward"&&!n||t==="backward"&&n==="body"){const X=r.leftSibling;r.hasChildren&&j.addChildrenAfter(r.removeBranch("body"),r),j.removeChild(r),e.position=e.offsetOf(X)}else t==="forward"&&n==="body"?e.position=e.offsetOf(r):!n&&t==="backward"?r.hasChildren?e.position=e.offsetOf(r.lastChild):(e.position=Math.max(0,e.offsetOf(r)-1),j.removeChild(r)):n==="above"&&(r.hasEmptyBranch("above")&&r.removeBranch("above"),t==="backward"?e.position=e.offsetOf(r.leftSibling):e.position=e.offsetOf(r.body[0]));return!0}if(j&&(r.type==="box"||r.type==="enclose")){const X=n&&t==="backward"||!n&&t==="forward"?r.leftSibling:r.lastChild;return j.addChildrenAfter(r.removeBranch("body"),r),j.removeChild(r),e.position=e.offsetOf(X),!0}if(r.type==="genfrac"||r.type==="overunder"){if(!n)return r.type==="overunder"&&r.hasEmptyBranch("body")||r.type==="genfrac"&&r.hasEmptyBranch("below")&&r.hasEmptyBranch("above")?!1:(e.position=e.offsetOf(t==="forward"?r.firstChild:r.lastChild),!0);const X=Wl.fractionNavigationOrder==="numerator-denominator"?"above":"below",ae=X==="above"?"below":"above";if(j&&(t==="forward"&&n===X||t==="backward"&&n===ae)){const he=r.removeBranch(X),_e=r.removeBranch(ae);return j.addChildrenAfter([...he,..._e],r),j.removeChild(r),e.position=e.offsetOf(he.length>0?he[he.length-1]:_e[0]),!0}return t==="backward"?e.position=e.offsetOf(r.leftSibling):e.position=e.offsetOf(r),!0}if(r.isExtensibleSymbol||r.type==="subsup"){if(!n&&t==="forward")return!1;if(!n){if(r.subscript||r.superscript){const X=t==="forward"?(_=(a=r.superscript)==null?void 0:a[0])!=null?_:(o=r.subscript)==null?void 0:o[0]:(W=(N=r.subscript)==null?void 0:N[0].lastSibling)!=null?W:(z=r.superscript)==null?void 0:z[0].lastSibling;return X&&(e.position=e.offsetOf(X)),!0}return!1}if(!r.hasChildren&&r.type==="subsup"){const X=t==="forward"?e.offsetOf(r):Math.max(0,e.offsetOf(r)-1);return r.parent.removeChild(r),e.position=X,!0}if(n==="superscript")if(t==="backward"){const X=e.offsetOf(r.firstChild)-1;console.assert(X>=0),e.position=X}else r.subscript?e.position=e.offsetOf(r.subscript[0]):e.position=e.offsetOf(r);else n==="subscript"&&(t==="backward"&&r.superscript?e.position=e.offsetOf(r.superscript[0].lastSibling):t==="backward"?e.position=e.offsetOf(r.firstChild)-1:e.position=e.offsetOf(r));if(n&&r.hasEmptyBranch(n)&&(r.removeBranch(n),r.type==="subsup"&&!r.subscript&&!r.superscript)){const X=t==="forward"?e.offsetOf(r):Math.max(0,e.offsetOf(r)-1);r.parent.removeChild(r),e.position=X}return!0}if((j==null?void 0:j.type)==="genfrac"&&!n&&r.type!=="first"){let X=e.offsetOf(r.leftSibling);return j.removeChild(r),j.hasEmptyBranch("above")&&j.hasEmptyBranch("below")?(X=e.offsetOf(j.leftSibling),j.parent.removeChild(j),e.announce("delete",void 0,[j]),e.position=X,!0):(e.announce("delete",void 0,[r]),e.position=X,!0)}if(t==="backward"&&((j==null?void 0:j.command)==="\\ln"||(j==null?void 0:j.command)==="\\log")&&r.parentBranch!=="body"){const X=e.offsetOf(j.leftSibling);return j.parent.removeChild(j),e.announce("delete",void 0,[j]),e.position=X,!0}return!1}function mg(e){return!e.mathfield.isSelectionEditable||!e.contentWillChange({inputType:"deleteContentBackward"})?!1:e.selectionIsCollapsed?e.deferNotifications({content:!0,selection:!0,type:"deleteContentBackward"},()=>{let t=e.at(e.position);if(!(t&&$l(e,"backward",t))){if(t!=null&&t.isFirstSibling){if($l(e,"backward",t.parent,t.parentBranch))return;t=null}if(!t){e.announce("plonk");return}e.position=e.offsetOf(t.leftSibling),t.parent.removeChild(t),e.announce("delete",void 0,[t])}}):_s(e,Xi(e.selection),"deleteContentBackward")}function vg(e){return!e.mathfield.isSelectionEditable||!e.contentWillChange({inputType:"deleteContentForward"})?!1:e.selectionIsCollapsed?e.deferNotifications({content:!0,selection:!0,type:"deleteContentForward"},()=>{var t,r;let n=e.at(e.position).rightSibling;if(n&&$l(e,"forward",n))return;if(n){if(e.at(e.position).isLastSibling&&$l(e,"forward",n.parent,n.parentBranch))return}else{if(n=e.at(e.position),n.isLastSibling&&$l(e,"forward",n.parent,n.parentBranch))return;n=void 0}if(e.position===e.lastOffset||!n){e.announce("plonk");return}n.parent.removeChild(n);let a=(t=e.at(e.position))==null?void 0:t.rightSibling;for(;(a==null?void 0:a.type)==="subsup";)a.parent.removeChild(a),a=(r=e.at(e.position))==null?void 0:r.rightSibling;e.announce("delete",void 0,[n])}):_s(e,Xi(e.selection),"deleteContentForward")}function _s(e,t,r){const n=e.getAtoms(t);if(n.length>0&&n[0].parent){let a=n[0].parent.firstChild;a.type==="first"&&(a=a.rightSibling);const o=n[n.length-1].parent.lastChild;let _=n[0];_.type==="first"&&(_=_.rightSibling);const N=n[n.length-1];if(_===a&&N===o){const z=n[0].parent;z.parent&&z.type!=="prompt"&&(t=[e.offsetOf(z.leftSibling),e.offsetOf(z)])}if(n.length===1&&n[0].type==="placeholder"&&n[0].parent.type==="genfrac"){const z=n[0].parent,W=n[0].parentBranch==="below"?"above":"below",j=e.offsetOf(z.leftSibling);return e.deferNotifications({content:!0,selection:!0,type:r},()=>{var X,ae;const he=z.removeBranch(W);if(he.length===1&&he[0].type==="placeholder")(ae=z.parent)==null||ae.removeChild(z),e.position=Math.max(0,j);else{const _e=z.parent.addChildrenAfter(he,z);(X=z.parent)==null||X.removeChild(z),e.position=e.offsetOf(_e)}})}}return e.deferNotifications({content:!0,selection:!0,type:r},()=>e.deleteAtoms(t))}_a({deleteAll:e=>e.contentWillChange({inputType:"deleteContent"})&&_s(e,[0,-1],"deleteContent"),deleteForward:e=>vg(e),deleteBackward:e=>mg(e),deleteNextWord:e=>e.contentWillChange({inputType:"deleteWordForward"})&&_s(e,[e.anchor,Pc(e,e.position,"forward")],"deleteWordForward"),deletePreviousWord:e=>e.contentWillChange({inputType:"deleteWordBackward"})&&_s(e,[e.anchor,Pc(e,e.position,"backward")],"deleteWordBackward"),deleteToGroupStart:e=>e.contentWillChange({inputType:"deleteSoftLineBackward"})&&_s(e,[e.anchor,e.offsetOf(e.at(e.position).firstSibling)],"deleteSoftLineBackward"),deleteToGroupEnd:e=>e.contentWillChange({inputType:"deleteSoftLineForward"})&&_s(e,[e.anchor,e.offsetOf(e.at(e.position).lastSibling)],"deleteSoftLineForward"),deleteToMathFieldStart:e=>e.contentWillChange({inputType:"deleteHardLineBackward"})&&_s(e,[e.anchor,0],"deleteHardLineBackward"),deleteToMathFieldEnd:e=>e.contentWillChange({inputType:"deleteHardLineForward"})&&_s(e,[e.anchor,-1],"deleteHardLineForward")},{target:"model",audioFeedback:"delete",canUndo:!0,changeContent:!0,changeSelection:!0});var gg=`<svg xmlns="http://www.w3.org/2000/svg" style="width: 21px;" viewBox="0 0 576 512" role="img" aria-label="${u("tooltip.toggle virtual keyboard")}"><path d="M528 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h480c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm16 336c0 8.823-7.177 16-16 16H48c-8.823 0-16-7.177-16-16V112c0-8.823 7.177-16 16-16h480c8.823 0 16 7.177 16 16v288zM168 268v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm-336 80v-24c0-6.627-5.373-12-12-12H84c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm384 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zM120 188v-24c0-6.627-5.373-12-12-12H84c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm-96 152v-8c0-6.627-5.373-12-12-12H180c-6.627 0-12 5.373-12 12v8c0 6.627 5.373 12 12 12h216c6.627 0 12-5.373 12-12z"/></svg>`,_g=`<svg xmlns="http://www.w3.org/2000/svg" style="height: 18px;" viewBox="0 0 448 512" role="img" aria-label="${u("tooltip.menu")}"><path d="M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"/></svg>`,yg=class{constructor(e,t){this.focusBlurInProgress=!1;var r,n,a;this.options=F(i(F({},Nu()),{macros:$t(),registers:If()}),Bu(t)),this.eventController=new AbortController;const o=this.eventController.signal;t.eventSink&&(this.host=t.eventSink),this.element=e,e.mathfield=this,this.blurred=!0,this.keystrokeCaptionVisible=!1,this.suggestionIndex=0,this.inlineShortcutBuffer=[],this.inlineShortcutBufferFlushTimer=0,this.defaultStyle={},this.adoptStyle="left",this.options.defaultMode==="inline-math"?this.element.classList.add("ML__is-inline"):this.element.classList.remove("ML__is-inline"),this.dirty=!1;let _=(n=(r=t.value)!=null?r:this.element.textContent)!=null?n:"";_=_.trim();const N=Lh(this.options),z=new Qe({type:"root",mode:N,body:na(_,{context:this.context})});this.model=new pg(this,N,z),this.undoManager=new Vm(this.model);const W=[];if(W.push("<span contenteditable=true aria-multiline=false part=keyboard-sink class=ML__keyboard-sink autocapitalize=off autocomplete=off autocorrect=off spellcheck=false inputmode=none tabindex=0></span>"),W.push('<span part=container class=ML__container aria-hidden=true style="visibility:hidden">'),W.push("<span part=content class=ML__content>"),W.push(wh(this)),W.push("</span>"),window.mathVirtualKeyboard&&(W.push(`<div part=virtual-keyboard-toggle class=ML__virtual-keyboard-toggle role=button ${this.hasEditableContent?"":'style="display:none;"'} data-l10n-tooltip="tooltip.toggle virtual keyboard">`),W.push(gg),W.push("</div>")),W.push('<div part=menu-toggle class=ML__menu-toggle role=button data-l10n-tooltip="tooltip.menu">'),W.push(_g),W.push("</div>"),W.push("</span>"),W.push("<span class=ML__sr-only>"),W.push("<span role=status aria-live=assertive aria-atomic=true></span>"),W.push("</span>"),this.element.innerHTML=window.MathfieldElement.createHTML(W.join("")),!this.element.children){console.error("%cMathLive 0.98.5: Something went wrong and the mathfield could not be created.%c\nIf you are using Vue, this may be because you are using the runtime-only build of Vue. Make sure to include `runtimeCompiler: true` in your Vue configuration. There may a warning from Vue in the log above.","color:red;font-family:system-ui;font-size:1.2rem;font-weight:bold","color:inherit;font-family:system-ui;font-size:inherit;font-weight:inherit");return}this._l10Subscription=f.subscribe(()=>f.update(this.element)),f.update(this.element),this.field=this.element.querySelector("[part=content]"),this.field.addEventListener("click",X=>X.stopImmediatePropagation(),{capture:!1,signal:o}),this.field.addEventListener("wheel",this,{passive:!1,signal:o}),"PointerEvent"in window?this.field.addEventListener("pointerdown",this,{signal:o}):this.field.addEventListener("mousedown",this,{signal:o}),(a=this.element.querySelector("[part=virtual-keyboard-toggle]"))==null||a.addEventListener("click",()=>{window.mathVirtualKeyboard.visible?window.mathVirtualKeyboard.hide():(window.mathVirtualKeyboard.show({animate:!0}),window.mathVirtualKeyboard.update(vs(this)))},{signal:o}),this._menu=new kv(ag(this),{host:this.host}),this.field.addEventListener("contextmenu",this,{signal:o});const j=this.element.querySelector("[part=menu-toggle]");j==null||j.addEventListener("pointerdown",X=>{if(X.currentTarget!==j||this._menu.state!=="closed")return;this.element.classList.add("tracking");const ae=j.getBoundingClientRect();this._menu.modifiers=yo(X),this._menu.show({target:j,location:{x:ae.left,y:ae.bottom},onDismiss:()=>this.element.classList.remove("tracking")}),X.preventDefault(),X.stopPropagation()},{signal:o}),(this.model.atoms.length<=1||this.disabled||this.readOnly&&!this.hasEditableContent||this.userSelect==="none")&&(j.style.display="none"),this.ariaLiveText=this.element.querySelector("[role=status]"),this.keyboardDelegate=Yp(this.element.querySelector(".ML__keyboard-sink"),this.element,this),window.addEventListener("resize",this,{signal:o}),document.addEventListener("scroll",this,{signal:o}),this.resizeObserver=new ResizeObserver(()=>oi(this)),this.resizeObserver.observe(this.field),window.mathVirtualKeyboard.addEventListener("virtual-keyboard-toggle",this,{signal:o}),Dl&&!f.locale.startsWith(Dl.locale)&&Hp(f.locale),La!=="ready"&&document.fonts.ready.then(()=>Ru(this)),e.querySelector("[part=container]").style.removeProperty("visibility"),this.undoManager.startRecording(),this.undoManager.snapshot("set-value")}get defaultStyle(){return this._defaultStyle}set defaultStyle(e){this._defaultStyle=e}get effectiveStyle(){if(this.adoptStyle==="none")return this.defaultStyle;const e=this.model.at(this.model.position),t=this.adoptStyle==="right"?e.rightSibling:e;if(!t)return this.defaultStyle;if(t.type==="group"){const r=t.branch("body");return!r||r.length<2?{}:this.adoptStyle==="right"?r[1].computedStyle:r[r.length-1].computedStyle}return t.computedStyle}connectToVirtualKeyboard(){this.connectedToVirtualKeyboard||(this.connectedToVirtualKeyboard=!0,window.addEventListener("message",this,{signal:this.eventController.signal}),window.mathVirtualKeyboard.connect(),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(vs(this)),Xu(this))}disconnectFromVirtualKeyboard(){this.connectedToVirtualKeyboard&&(window.removeEventListener("message",this),window.mathVirtualKeyboard.disconnect(),this.connectedToVirtualKeyboard=!1,Vc())}showMenu(e){var t,r;const n=(r=(t=e==null?void 0:e.location)!=null?t:gl(this.field))!=null?r:void 0,a=e==null?void 0:e.modifiers,o=this.element.querySelector("[part=container]");return this._menu.show({target:o,location:n,modifiers:a})}get colorMap(){return e=>{var t,r,n;return(n=(r=(t=this.options).colorMap)==null?void 0:r.call(t,e))!=null?n:C(e)}}get backgroundColorMap(){return e=>{var t,r,n,a,o,_;return(_=(o=(r=(t=this.options).backgroundColorMap)==null?void 0:r.call(t,e))!=null?o:(a=(n=this.options).colorMap)==null?void 0:a.call(n,e))!=null?_:P(e)}}get smartFence(){var e;return(e=this.options.smartFence)!=null?e:!1}get readOnly(){var e;return(e=this.options.readOnly)!=null?e:!1}get disabled(){var e,t;return(t=(e=this.host)==null?void 0:e.disabled)!=null?t:!1}get contentEditable(){return this.host?this.host.getAttribute("contenteditable")!=="false":!1}get userSelect(){if(!this.host)return"";const e=getComputedStyle(this.host);return e.getPropertyValue("user-select")||e.getPropertyValue("-webkit-user-select")}get hasEditableContent(){return this.disabled||!this.contentEditable?!1:!this.readOnly||this.hasEditablePrompts}get hasEditablePrompts(){return this.readOnly&&!this.disabled&&this.contentEditable&&this.model.findAtom(e=>e.type==="prompt"&&!e.locked)!==void 0}get isSelectionEditable(){if(this.disabled||!this.contentEditable)return!1;if(!this.readOnly)return!0;const e=this.model.at(this.model.anchor),t=this.model.at(this.model.position),r=Qe.commonAncestor(e,t);return!!((r==null?void 0:r.type)==="prompt"||r!=null&&r.parentPrompt)}get letterShapeStyle(){var e;return(e=this.options.letterShapeStyle)!=null?e:"tex"}get minFontScale(){return this.options.minFontScale}get selectionStyle(){if(this.model.selectionIsCollapsed)return this.effectiveStyle;const e=this.model.getAtoms(this.model.selection);if(e.length===0)return{};const t=F({},e[0].style);for(const r of e)for(const[n,a]of Object.entries(r.style))t[n]!==a&&delete t[n];return t}queryStyle(e){const t=Kc(this,e);"verbatimColor"in t&&delete t.verbatimColor,"verbatimBackgroundColor"in t&&delete t.verbatimBackgroundColor;const r=Object.keys(t).length;if(r===0)return"all";if(r>1){for(const z of Object.keys(t)){const W=this.queryStyle({[z]:t[z]});if(W==="none")return"none";if(W==="some")return"some"}return"all"}const n=Object.keys(t)[0],a=t[n];if(this.model.selectionIsCollapsed)return this.effectiveStyle[n]===a?"all":"none";const o=this.model.getAtoms(this.model.selection,{includeChildren:!0});let _=o.length;if(_===0)return"none";let N=0;for(const z of o){if(z.type==="first"){_-=1;continue}z.style[n]===a&&(N+=1)}return N===0?"none":N===_?"all":"some"}get keybindings(){var e,t;if(this._keybindings)return this._keybindings;const[r,n]=em(this.options.keybindings,(e=Al())!=null?e:jp());return((t=Al())==null?void 0:t.score)>0&&(this._keybindings=r,n.length>0&&console.error("MathLive 0.98.5: Invalid keybindings for current keyboard layout",n)),r}get menu(){return this._menu}setOptions(e){var t;this.options=F(F({},this.options),Bu(e)),this._keybindings=void 0,this.options.defaultMode==="inline-math"?this.element.classList.add("ML__is-inline"):this.element.classList.remove("ML__is-inline");let r=this.options.defaultMode;r==="inline-math"&&(r="math"),((t=this.model.root.firstChild)==null?void 0:t.mode)!==r&&(this.model.root.firstChild.mode=r),this.options.readOnly&&this.hasFocus()&&window.mathVirtualKeyboard.visible&&this.executeCommand("hideVirtualKeyboard");const n=Qe.serialize([this.model.root],{expandMacro:!1,defaultMode:this.options.defaultMode});("macros"in e||this.model.getValue()!==n)&&Wn.insert(this.model,n,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",silenceNotifications:!0,mode:"math"}),("value"in e||"macros"in e||"registers"in e||"colorMap"in e||"backgroundColorMap"in e||"letterShapeStyle"in e||"minFontScale"in e||"readOnly"in e||"placeholderSymbol"in e)&&oi(this)}getOptions(e){return Eo(this.options,e)}getOption(e){return Eo(this.options,e)}handleEvent(e){return qs(this,null,function*(){var t;if(ho(this)){if(kc(e)){if(!gc(e.origin,(t=this.options.originValidator)!=null?t:"none"))throw new DOMException(`Message from unknown origin (${e.origin}) cannot be handled`,"SecurityError");const{action:r}=e.data;if(r==="execute-command"){const n=e.data.command;if(qo(n)==="virtual-keyboard")return;this.executeCommand(n)}else r==="update-state"||(r==="focus"?this.focus({preventScroll:!0}):r==="blur"&&this.blur());return}switch(e.type){case"focus":this.onFocus();break;case"blur":this.onBlur();break;case"mousedown":this.userSelect!=="none"&&jh(this,e);break;case"pointerdown":this.userSelect!=="none"&&(jh(this,e),e.shiftKey===!1&&(yield sd(e,this.element.querySelector("[part=container]"),this._menu))&&ju.stop());break;case"contextmenu":this.userSelect!=="none"&&e.shiftKey===!1&&(yield sd(e,this.element.querySelector("[part=container]"),this._menu))&&ju.stop();break;case"virtual-keyboard-toggle":this.hasFocus()&&Xu(this);break;case"resize":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>ho(this)&&this.onGeometryChange());break;case"scroll":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>ho(this)&&this.onGeometryChange());break;case"wheel":this.onWheel(e);break;default:console.warn("Unexpected event type",e.type)}}})}dispose(){if(!ho(this))return;f.unsubscribe(this._l10Subscription),this.keyboardDelegate.dispose(),this.keyboardDelegate=void 0,this.eventController.abort(),this.eventController=void 0,this.resizeObserver.disconnect(),window.mathVirtualKeyboard.removeEventListener("virtual-keyboard-toggle",this),this.disconnectFromVirtualKeyboard(),this.model.dispose();const e=this.element;delete e.mathfield,this.element=void 0,this.host=void 0,this.field=void 0,this.ariaLiveText=void 0,tv(),sm(),Ev()}flushInlineShortcutBuffer(e){if(e!=null||(e={defer:!1}),!e.defer){this.inlineShortcutBuffer=[],clearTimeout(this.inlineShortcutBufferFlushTimer),this.inlineShortcutBufferFlushTimer=0;return}this.options.inlineShortcutTimeout>0&&(clearTimeout(this.inlineShortcutBufferFlushTimer),this.inlineShortcutBufferFlushTimer=setTimeout(()=>this.flushInlineShortcutBuffer(),this.options.inlineShortcutTimeout))}executeCommand(e){return qo(e)==="virtual-keyboard"?(this.focus({preventScroll:!0}),window.mathVirtualKeyboard.executeCommand(e),requestAnimationFrame(()=>window.mathVirtualKeyboard.update(vs(this))),!1):dm(this,e)}get errors(){return nh(this.model.getValue(),{context:this.context})}getValue(e,t,r){return this.model.getValue(e,t,r)}setValue(e,t){var r;t=t!=null?t:{mode:"math"},t.insertionMode===void 0&&(t.insertionMode="replaceAll"),(t.format===void 0||t.format==="auto")&&(t.format="latex"),(t.mode===void 0||t.mode==="auto")&&(t.mode=(r=C0(this.model,this.model.position))!=null?r:"math");const n=this.undoManager.canUndo();Wn.insert(this.model,e,t)&&(oi(this),n||this.undoManager.reset(),this.undoManager.snapshot("set-value"))}get expression(){const e=window.MathfieldElement.computeEngine;return e?e.box(e.parse(this.model.getValue("latex-unstyled"))):(console.error("MathLive 0.98.5: no compute engine available. Make sure the Compute Engine library is loaded."),null)}scrollIntoView(){var e;if(!this.element)return;if(this.host){if(this.options.onScrollIntoView)this.options.onScrollIntoView(this);else if(this.host.scrollIntoView({block:"nearest",inline:"nearest"}),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.container===window.document.body){const n=window.mathVirtualKeyboard.boundingRect,a=this.host.getBoundingClientRect();a.bottom>n.top&&((e=window.document.scrollingElement)==null||e.scrollBy(0,a.bottom-n.top+8))}}this.dirty&&bo(this,{interactive:!0});const t=this.field.getBoundingClientRect();let r=null;if(this.model.selectionIsCollapsed)r=gl(this.field);else{const n=zf(this);if(n.length>0){let a=-1/0,o=-1/0;for(const _ of n)_.right>a&&(a=_.right),_.top<o&&(o=_.top);r={x:a+t.left-this.field.scrollLeft,y:o+t.top-this.field.scrollTop,height:0}}}if(this.host&&r){const n=this.host.getBoundingClientRect(),a=r.y;let o=this.host.scrollTop;a<n.top?o=a-n.top+this.host.scrollTop:a>n.bottom&&(o=a-n.bottom+this.host.scrollTop+r.height),this.host.scroll({top:o,left:0})}if(r){const n=r.x-window.scrollX;let a=this.field.scrollLeft;n<t.left?a=n-t.left+this.field.scrollLeft-20:n>t.right&&(a=n-t.right+this.field.scrollLeft+20),this.field.scroll({top:this.field.scrollTop,left:a})}}insert(e,t){return typeof e!="string"||e.length===0&&((t==null?void 0:t.insertionMode)==="insertBefore"||(t==null?void 0:t.insertionMode)==="insertAfter")||e.length===0&&this.model.selectionIsCollapsed?!1:(this.flushInlineShortcutBuffer(),t=t!=null?t:{mode:"math"},t.focus&&this.focus(),t.feedback&&(window.MathfieldElement.keypressVibration&&p()&&navigator.vibrate(Sh),window.MathfieldElement.playSound("keypress")),e==="\\\\"?Rh(this.model):e==="&"?Ph(this.model):this.model.selectionIsCollapsed?Wn.insert(this.model,e,F({style:this.model.at(this.model.position).computedStyle},t)):Wn.insert(this.model,e,t),this.snapshot(`insert-${this.model.at(this.model.position).type}`),oi(this),t.scrollIntoView&&this.scrollIntoView(),!0)}switchMode(e,t="",r=""){var n;if(this.model.mode===e||!this.hasEditableContent||!this.contentEditable||this.disabled)return;const a=this.model.mode;if(this.model.mode=e,!((n=this.host)!=null&&n.dispatchEvent(new Event("mode-change",{bubbles:!0,composed:!0,cancelable:!0})))){this.model.mode=a;return}const o=this.model.mode,{model:_}=this;_.deferNotifications({content:!!r||!!t,selection:!0,type:"insertText"},()=>{let N=!1;if(this.flushInlineShortcutBuffer(),this.stopCoalescingUndo(),t&&e!=="latex"){const z=na(t,{context:this.context,parseMode:e});_.collapseSelection("forward");const W=_.at(_.position);_.position=_.offsetOf(W.parent.addChildrenAfter(z,W)),N=!0}if(this.model.mode=e,e==="latex"){let z=_.selectionIsCollapsed;Yo(this,"accept");let W,j=_.at(_.position);if(z)W="\\";else{const ae=Xi(_.selection);W=this.model.getValue(ae,"latex");const he=this.model.extractAtoms(ae);he.length===1&&he[0].type==="placeholder"&&(W=t,z=!0),j=_.at(ae[0])}const X=new xl(W);j.parent.addChildAfter(X,j),z?_.position=_.offsetOf(X.lastChild):_.setSelection(_.offsetOf(X.firstChild),_.offsetOf(X.lastChild))}else kl(_).forEach(z=>{z.isError=!1});if(r){const z=na(r,{context:this.context,parseMode:o});_.collapseSelection("forward");const W=_.at(_.position);_.position=_.offsetOf(W.parent.addChildrenAfter(z,W)),N=!0}return oi(this),this.undoManager.snapshot(e==="latex"?"insert-latex":"insert"),N}),this.model.mode=e,window.mathVirtualKeyboard.update(vs(this))}hasFocus(){return!this.blurred}focus(e){var t;this.hasFocus()||(this.keyboardDelegate.focus(),this.connectToVirtualKeyboard(),this.onFocus(),this.model.announce("line")),(t=e==null?void 0:e.preventScroll)!=null&&t||this.scrollIntoView()}blur(){this.disconnectFromVirtualKeyboard(),this.hasFocus()&&this.keyboardDelegate.blur()}select(){this.model.selection={ranges:[[0,this.model.lastOffset]]},this.focus()}applyStyle(e,t={}){var r,n;const a={operation:"set",silenceNotifications:!1};fu(t)?a.range=t:(t.operation==="toggle"&&(a.operation="toggle"),a.range=t.range,a.silenceNotifications=(r=t.silenceNotifications)!=null?r:!1);const o=Kc(this,e),_=(n=a.operation)!=null?n:"set";if(a.range===void 0&&this.model.selectionIsCollapsed){if(_==="set"){this.defaultStyle=F(F({},this.defaultStyle),o);return}const N=F({},this.defaultStyle);for(const z of Object.keys(o))N[z]===o[z]?(z==="color"&&delete N.verbatimColor,z==="backgroundColor"&&delete N.verbatimBackgroundColor,delete N[z]):N[z]=o[z];this.defaultStyle=N;return}this.model.deferNotifications({content:!a.silenceNotifications,type:"insertText"},()=>{if(a.range===void 0)for(const N of this.model.selection.ranges)Lc(this.model,N,o,{operation:_});else Lc(this.model,a.range,o,{operation:_})}),oi(this)}toggleContextMenu(){var e;return this._menu.visible?this._menu.state==="open"?(this._menu.hide(),!0):(this._menu.show({target:this.element.querySelector("[part=container]"),location:(e=this.getCaretPoint())!=null?e:void 0,onDismiss:()=>{var t;return(t=this.element)==null?void 0:t.focus()}}),!0):!1}getCaretPoint(){const e=gl(this.field);return e?{x:e.x,y:e.y}:null}setCaretPoint(e,t){const r=Bl(this,e,t,{bias:0});if(r<0)return!1;const n=this.model.position;return this.model.position=r,this.model.announce("move",n),oi(this),!0}getPrompt(e){const t=this.model.findAtom(r=>r.type==="prompt"&&r.placeholderId===e);return console.assert(t!==void 0,"MathLive 0.98.5: no prompts with matching ID found"),t}getPromptValue(e,t){const r=this.getPrompt(e);if(!r)return"";const n=this.model.offsetOf(r.firstChild),a=this.model.offsetOf(r.lastChild);return this.model.getValue(n,a,t)}getPrompts(e){return this.model.getAllAtoms().filter(t=>t.type!=="prompt"?!1:e?!(e.id&&t.placeholderId!==e.id||e.locked&&t.locked!==e.locked||e.correctness==="undefined"&&t.correctness||e.correctness&&t.correctness!==e.correctness):!0).map(t=>t.placeholderId)}setPromptValue(e,t,r){if(t!==void 0){const n=this.getPrompt(e);if(!n){console.error(`MathLive 0.98.5: unknown prompt ${e}`);return}const a=this.model.getBranchRange(this.model.offsetOf(n),"body");this.model.setSelection(a),this.insert(t,i(F({},r),{insertionMode:"replaceSelection"}))}r!=null&&r.silenceNotifications&&(this.valueOnFocus=this.getValue()),oi(this)}setPromptState(e,t,r){const n=this.getPrompt(e);if(!n){console.error(`MathLive 0.98.5: unknown prompt ${e}`);return}t==="undefined"?n.correctness=void 0:typeof t=="string"&&(n.correctness=t),typeof r=="boolean"&&(n.locked=r,n.captureSelection=r),oi(this)}getPromptState(e){const t=this.getPrompt(e);return t?[t.correctness,t.locked]:(console.error(`MathLive 0.98.5: unknown prompt ${e}`),[void 0,!0])}getPromptRange(e){const t=this.getPrompt(e);return t?this.model.getBranchRange(this.model.offsetOf(t),"body"):(console.error(`MathLive 0.98.5: unknown prompt ${e}`),[0,0])}canUndo(){return this.undoManager.canUndo()}canRedo(){return this.undoManager.canRedo()}popUndoStack(){this.undoManager.pop()}snapshot(e){var t;this.undoManager.snapshot(e)&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(vs(this)),(t=this.host)==null||t.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"snapshot"}})))}stopCoalescingUndo(){this.undoManager.stopCoalescing(this.model.selection)}stopRecording(){this.undoManager.stopRecording()}startRecording(){this.undoManager.startRecording()}undo(){var e;this.undoManager.undo()&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(vs(this)),(e=this.host)==null||e.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"undo"}})))}redo(){var e;this.undoManager.redo()&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(vs(this)),(e=this.host)==null||e.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"undo"}})))}resetUndo(){var e;(e=this.undoManager)==null||e.reset()}onSelectionDidChange(){var e,t;const r=this.model;this.keyboardDelegate.setValue(r.getValue(this.model.selection,"latex-expanded"));{const n=r.at(r.position),a=(e=n.mode)!=null?e:Lh(this.options);this.model.mode!==a&&(this.model.mode==="latex"?(Yo(this,"accept",{mode:a}),r.position=r.offsetOf(n)):this.switchMode(a))}(t=this.host)==null||t.dispatchEvent(new Event("selection-change",{bubbles:!0,composed:!0})),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(vs(this)),Xu(this)}onContentWillChange(e){var t,r,n;return(n=(r=this.host)==null?void 0:r.dispatchEvent(new InputEvent("beforeinput",i(F({},e),{data:e.data?e.data:(t=e.inputType)!=null?t:"",cancelable:!0,bubbles:!0,composed:!0}))))!=null?n:!0}onFocus(){this.focusBlurInProgress||!this.blurred||(this.focusBlurInProgress=!0,this.blurred=!1,this.keyboardDelegate.focus(),this.stopCoalescingUndo(),bo(this,{interactive:!0}),this.valueOnFocus=this.model.getValue(),this.hasEditablePrompts&&!this.model.at(this.model.anchor).parentPrompt&&this.executeCommand("moveToNextPlaceholder"),this.focusBlurInProgress=!1)}onBlur(){var e,t,r;if(this.focusBlurInProgress||this.blurred)return;this.focusBlurInProgress=!0,this.stopCoalescingUndo(),this.blurred=!0,this.ariaLiveText.textContent="",Xo(this),this.model.getValue()!==this.valueOnFocus&&((e=this.host)==null||e.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),this.disconnectFromVirtualKeyboard(),(t=this.host)==null||t.dispatchEvent(new Event("blur",{bubbles:!1,composed:!0})),(r=this.host)==null||r.dispatchEvent(new UIEvent("focusout",{bubbles:!0,composed:!0})),oi(this),this.focusBlurInProgress=!1,Vc();const n=new AbortController,a=n.signal;document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&document.addEventListener("visibilitychange",()=>{ho(this)&&document.visibilityState==="visible"&&this.focus({preventScroll:!0})},{once:!0,signal:a})},{once:!0,signal:a}),setTimeout(()=>n.abort(),100)}onInput(e){Fc(this,e)}onKeystroke(e){return Wh(this,e)}onCompositionStart(e){this.model.deleteAtoms(Xi(this.model.selection));const t=gl(this.field);t&&requestAnimationFrame(()=>{bo(this),this.keyboardDelegate.moveTo(t.x,t.y-t.height)})}onCompositionUpdate(e){Om(this.model,e),oi(this)}onCompositionEnd(e){Fm(this.model),Fc(this,e,{simulateKeystroke:!0})}onCut(e){if(!this.isSelectionEditable){this.model.announce("plonk");return}this.model.contentWillChange({inputType:"deleteByCut"})&&(this.stopCoalescingUndo(),Wn.onCopy(this,e),_s(this.model,Xi(this.model.selection),"deleteByCut"),this.snapshot("cut"),oi(this))}onCopy(e){Wn.onCopy(this,e)}onPaste(e){let t=this.isSelectionEditable;return t&&(t=Wn.onPaste(this.model.at(this.model.position).mode,this,e.clipboardData)),t||this.model.announce("plonk"),e.preventDefault(),e.stopPropagation(),t}onGeometryChange(){this._menu.hide(),ku(this),Xu(this)}onWheel(e){const t=5*e.deltaX;if(!Number.isFinite(t)||t===0)return;const r=this.field;t<0&&r.scrollLeft===0||t>0&&r.offsetWidth+r.scrollLeft>=r.scrollWidth||(r.scrollBy({top:0,left:t}),e.preventDefault(),e.stopPropagation())}getHTMLElement(e){let t=e;for(;!t.id&&t.hasChildren;)t=e.children[0];return this.field.querySelector(`[data-atom-id="${t.id}"]`)}get context(){var e,t;return{registers:(e=this.options.registers)!=null?e:{},smartFence:this.smartFence,letterShapeStyle:this.letterShapeStyle,minFontScale:this.minFontScale,placeholderSymbol:(t=this.options.placeholderSymbol)!=null?t:"\u25A2",colorMap:r=>this.colorMap(r),backgroundColorMap:r=>this.backgroundColorMap(r),getMacro:r=>pt(r,this.options.macros),atomIdsSettings:{seed:"random",groupNumbers:!1}}}};function _d(e){if(e&&(e.classList.remove("ML__highlight"),e.children))for(const t of e.children)_d(t)}function sf(e,t){var r;e&&(!t||((r=e.dataset)==null?void 0:r.atomId)===t?(e.classList.add("ML__highlight"),e.children&&e.children.length>0&&[...e.children].forEach(n=>{n instanceof HTMLElement&&sf(n)})):(e.classList.remove("ML__highlight"),e.children&&e.children.length>0&&[...e.children].forEach(n=>{n instanceof HTMLElement&&sf(n,t)})))}function bg(e,t){var r;if(!b())return;if(window.MathfieldElement.speechEngine!=="amazon"){console.error("MathLive 0.98.5: Use Amazon TTS Engine for synchronized highlighting"),typeof window.MathfieldElement.speakHook=="function"&&window.MathfieldElement.speakHook(t);return}if(!window.AWS){console.error("MathLive 0.98.5: AWS SDK not loaded. See https://www.npmjs.com/package/aws-sdk");return}const n=new window.AWS.Polly({apiVersion:"2016-06-10"}),a={OutputFormat:"json",VoiceId:(r=window.MathfieldElement.speechEngineVoice)!=null?r:"Joanna",Engine:"standard",Text:t,TextType:"ssml",SpeechMarkTypes:["ssml"]};Xs().readAloudElement=e,n.synthesizeSpeech(a,(o,_)=>{if(o){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech()\` error: ${o}`);return}if(!(_!=null&&_.AudioStream)){console.log("polly.synthesizeSpeech():",_);return}const N=new TextDecoder("utf-8").decode(new Uint8Array(_.AudioStream));Xs().readAloudMarks=N.split(`
`).map(z=>z?JSON.parse(z):{}),Xs().readAloudTokens=[];for(const z of Xs().readAloudMarks)z.value&&Xs().readAloudTokens.push(z.value);Xs().readAloudCurrentMark="",a.OutputFormat="mp3",a.SpeechMarkTypes=[],n.synthesizeSpeech(a,(z,W)=>{if(z){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech("${t}") error:${z}`);return}if(!(W!=null&&W.AudioStream))return;const j=new Uint8Array(W.AudioStream),X=new Blob([j.buffer],{type:"audio/mpeg"}),ae=URL.createObjectURL(X),he=Xs();he.readAloudAudio?he.readAloudAudio.pause():(he.readAloudAudio=new Audio,he.readAloudAudio.addEventListener("ended",()=>{const _e=he.readAloudMathfield;he.readAloudStatus="ended",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),_e?(bo(_e),he.readAloudElement=null,he.readAloudMathfield=null,he.readAloudTokens=[],he.readAloudMarks=[],he.readAloudCurrentMark=""):_d(he.readAloudElement)}),he.readAloudAudio.addEventListener("timeupdate",()=>{let _e="";const Ue=he.readAloudAudio.currentTime*1e3+100;for(const yt of he.readAloudMarks)yt.time<Ue&&(_e=yt.value);he.readAloudCurrentMark!==_e&&(he.readAloudCurrentToken=_e,_e&&_e===he.readAloudFinalToken?he.readAloudAudio.pause():(he.readAloudCurrentMark=_e,sf(he.readAloudElement,he.readAloudCurrentMark)))})),he.readAloudAudio.src=ae,he.readAloudStatus="playing",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),he.readAloudAudio.play()})})}b()||console.error('MathLive 0.98.5: this version of the MathLive library is for use in the browser. A subset of the API is available on the server side in the "mathlive-ssr" library. If using server side rendering (with React for example) you may want to do a dynamic import of the MathLive library inside a `useEffect()` call.');var sn=new WeakMap,xg=.5,Ys={letterShapeStyle:"mf.letterShapeStyle = ...",horizontalSpacingScale:'Removed. Use `"thinmuskip"`, `"medmuskip"`, and `"thickmuskip"` registers ',macros:"mf.macros = ...",registers:"mf.registers = ...",backgroundColorMap:"mf.backgroundColorMap = ...",colorMap:"mf.colorMap = ...",enablePopover:"mf.popoverPolicy = ...",mathModeSpace:"mf.mathModeSpace = ...",placeholderSymbol:"mf.placeholderSymbol = ...",readOnly:"mf.readOnly = ...",removeExtraneousParentheses:"mf.removeExtraneousParentheses = ...",scriptDepth:"mf.scriptDepth = ...",smartFence:"mf.smartFence = ...",smartMode:"mf.smartMode = ...",smartSuperscript:"mf.smartSuperscript = ...",inlineShortcutTimeout:"mf.inlineShortcutTimeout = ...",inlineShortcuts:"mf.inlineShortcuts = ...",keybindings:"mf.keybindings = ...",virtualKeyboardMode:"mf.mathVirtualKeyboardPolicy = ...",customVirtualKeyboardLayers:"mathVirtualKeyboard.layers = ...",customVirtualKeyboards:"mathVirtualKeyboard.layouts = ...",keypressSound:"mathVirtualKeyboard.keypressSound = ...",keypressVibration:"mathVirtualKeyboard.keypressVibration = ...",plonkSound:"mathVirtualKeyboard.plonkSound = ...",virtualKeyboardContainer:"mathVirtualKeyboard.container = ...",virtualKeyboardLayout:"mathVirtualKeyboard.alphabeticLayout = ...",virtualKeyboardTheme:"No longer supported",virtualKeyboardToggleGlyph:"No longer supported",virtualKeyboardToolbar:"mathVirtualKeyboard.editToolbar = ...",virtualKeyboards:"Use `mathVirtualKeyboard.layouts`",speechEngine:"`MathfieldElement.speechEngine`",speechEngineRate:"`MathfieldElement.speechEngineRate`",speechEngineVoice:"`MathfieldElement.speechEngineVoice`",textToSpeechMarkup:"`MathfieldElement.textToSpeechMarkup`",textToSpeechRules:"`MathfieldElement.textToSpeechRules`",textToSpeechRulesOptions:"`MathfieldElement.textToSpeechRulesOptions`",readAloudHook:"`MathfieldElement.readAloudHook`",speakHook:"`MathfieldElement.speakHook`",computeEngine:"`MathfieldElement.computeEngine`",fontsDirectory:"`MathfieldElement.fontsDirectory`",soundsDirectory:"`MathfieldElement.soundsDirectory`",createHTML:"`MathfieldElement.createHTML`",onExport:"`MathfieldElement.onExport`",onInlineShortcut:"`MathfieldElement.onInlineShortcut`",onScrollIntoView:"`MathfieldElement.onScrollIntoView`",locale:"MathfieldElement.locale = ...",strings:"MathfieldElement.strings = ...",decimalSeparator:"MathfieldElement.decimalSeparator = ...",fractionNavigationOrder:"MathfieldElement.fractionNavigationOrder = ..."},Ki=class Co extends HTMLElement{static get formAssociated(){return ll()}static get optionsAttributes(){return{"default-mode":"string","letter-shape-style":"string","min-font-scale":"number","popover-policy":"string","math-mode-space":"string","read-only":"boolean","remove-extraneous-parentheses":"on/off","smart-fence":"on/off","smart-mode":"on/off","smart-superscript":"on/off","inline-shortcut-timeout":"string","script-depth":"string",placeholder:"string","virtual-keyboard-target-origin":"string","math-virtual-keyboard-policy":"string"}}static get observedAttributes(){return[...Object.keys(this.optionsAttributes),"contenteditable","disabled","readonly","read-only"]}static get fontsDirectory(){return this._fontsDirectory}static set fontsDirectory(t){t!==this._fontsDirectory&&(this._fontsDirectory=t,um())}get fontsDirectory(){throw new Error("Use MathfieldElement.fontsDirectory instead")}set fontsDirectory(t){throw new Error("Use MathfieldElement.fontsDirectory instead")}static get soundsDirectory(){return this._soundsDirectory}static set soundsDirectory(t){this._soundsDirectory=t,this.audioBuffers={}}get soundsDirectory(){throw new Error("Use MathfieldElement.soundsDirectory instead")}set soundsDirectory(t){throw new Error("Use MathfieldElement.soundsDirectory instead")}static get keypressSound(){return this._keypressSound}static set keypressSound(t){var r,n,a;this.audioBuffers={},t===null?this._keypressSound={spacebar:null,return:null,delete:null,default:null}:typeof t=="string"?this._keypressSound={spacebar:t,return:t,delete:t,default:t}:typeof t=="object"&&"default"in t&&(this._keypressSound={spacebar:(r=t.spacebar)!=null?r:t.default,return:(n=t.return)!=null?n:t.default,delete:(a=t.delete)!=null?a:t.default,default:t.default})}static get plonkSound(){return this._plonkSound}static set plonkSound(t){this.audioBuffers={},this._plonkSound=t}static get audioContext(){return this._audioContext||(this._audioContext=new AudioContext),this._audioContext}static get speechEngine(){return this._speechEngine}static set speechEngine(t){this._speechEngine=t}static get speechEngineRate(){return this._speechEngineRate}static set speechEngineRate(t){this._speechEngineRate=t}static get speechEngineVoice(){return this._speechEngineVoice}static set speechEngineVoice(t){this._speechEngineVoice=t}static get textToSpeechMarkup(){return this._textToSpeechMarkup}static set textToSpeechMarkup(t){this._textToSpeechMarkup=t}static get textToSpeechRules(){return this._textToSpeechRules}static set textToSpeechRules(t){this._textToSpeechRules=t}static get textToSpeechRulesOptions(){return this._textToSpeechRulesOptions}static set textToSpeechRulesOptions(t){this._textToSpeechRulesOptions=t}static get locale(){return f.locale}static set locale(t){t==="auto"&&(t=navigator.language.slice(0,5)),f.locale=t}get locale(){throw new Error("Use MathfieldElement.locale instead")}set locale(t){throw new Error("Use MathfieldElement.locale instead")}static get strings(){return f.strings}static set strings(t){f.merge(t)}get strings(){throw new Error("Use MathfieldElement.strings instead")}set strings(t){throw new Error("Use MathfieldElement.strings instead")}static get decimalSeparator(){return this._decimalSeparator}static set decimalSeparator(t){this._decimalSeparator=t,this._computeEngine&&(this._computeEngine.latexOptions.decimalMarker=this.decimalSeparator===","?"{,}":".")}get decimalSeparator(){throw new Error("Use MathfieldElement.decimalSeparator instead")}set decimalSeparator(t){throw new Error("Use MathfieldElement.decimalSeparator instead")}static get computeEngine(){var t,r;if(this._computeEngine===void 0){const n=(t=window[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:t.ComputeEngine;if(!n)return null;this._computeEngine=new n,this._computeEngine&&this.decimalSeparator===","&&(this._computeEngine.latexOptions.decimalMarker="{,}")}return(r=this._computeEngine)!=null?r:null}static set computeEngine(t){this._computeEngine=t}get computeEngine(){throw new Error("Use MathfieldElement.computeEngine instead")}set computeEngine(t){throw new Error("Use MathfieldElement.computeEngine instead")}static get isFunction(){return typeof this._isFunction!="function"?()=>!1:this._isFunction}static set isFunction(t){this._isFunction=t}static loadSound(t){return qs(this,null,function*(){delete this.audioBuffers[t];let r="";switch(t){case"keypress":r=this._keypressSound.default;break;case"return":r=this._keypressSound.return;break;case"spacebar":r=this._keypressSound.spacebar;break;case"delete":r=this._keypressSound.delete;break;case"plonk":r=this.plonkSound;break}if(typeof r!="string")return;r=r.trim();const n=this.soundsDirectory;if(!(n==null||n==="null"||r==="none"||r==="null"))try{const o=yield(yield fetch(yield Eh(`${n}/${r}`))).arrayBuffer(),_=yield this.audioContext.decodeAudioData(o);this.audioBuffers[t]=_}catch(a){}})}static playSound(t){return qs(this,null,function*(){if((this.audioContext.state==="suspended"||this.audioContext.state==="interrupted")&&(yield this.audioContext.resume()),this.audioBuffers[t]||(yield this.loadSound(t)),!this.audioBuffers[t])return;const r=this.audioContext.createBufferSource();r.buffer=this.audioBuffers[t];const n=this.audioContext.createGain();n.gain.value=xg,r.connect(n).connect(this.audioContext.destination),r.start()})}constructor(t){if(super(),t){const r=[];for(const n of Object.keys(t))if(Ys[n])if(Ys[n].startsWith("mf."))if(Ys[n].startsWith(`mf.${n}`))r.push(`Option \`${n}\` cannot be used as a constructor option. Use ${Ys[n]}`);else{const a=Ys[n].match(/([a-zA-Z]+) =/);r.push(`Option \`${n}\` has been renamed \`${a[1]}\``)}else r.push(`Option \`${n}\` cannot be used as a constructor option. Use ${Ys[n]}`);if(r.length>0){console.group("%cMathLive 0.98.5: %cInvalid Options","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),console.warn("Some of the options passed to `new MathfieldElement(...)` are invalid. \n See https://cortexjs.io/mathlive/changelog/ for details.");for(const n of r)console.warn(n);console.groupEnd()}}if(ll()&&(this._internals=this.attachInternals(),this._internals.role="math",this._internals.ariaLabel="math input field",this._internals.ariaMultiLine="false"),this.attachShadow({mode:"open",delegatesFocus:!0}),this.shadowRoot&&"adoptedStyleSheets"in this.shadowRoot){this.shadowRoot.adoptedStyleSheets=[Vo("core"),Vo("mathfield"),Vo("mathfield-element"),Vo("ui"),Vo("menu")],this.shadowRoot.appendChild(document.createElement("span"));const r=document.createElement("slot");r.style.display="none",this.shadowRoot.appendChild(r)}else this.shadowRoot.innerHTML="<style>"+po("core")+po("mathfield")+po("mathfield-element")+po("ui")+po("menu")+'</style><span></span><slot style="display:none"></slot>';t&&this._setOptions(t),this.shadowRoot.addEventListener("slotchange",()=>{var r;const n=this.shadowRoot.querySelector("slot:not([name])");this.value=(r=n==null?void 0:n.assignedNodes().map(a=>a.nodeType===3?a.textContent:"").join("").trim())!=null?r:""})}showMenu(t){var r,n;return(n=(r=this._mathfield)==null?void 0:r.showMenu(t))!=null?n:!1}get mathVirtualKeyboard(){throw new Error("The `mathVirtualKeyboard` property is not available on the MathfieldElement. Use `window.mathVirtualKeyboard` instead.")}onPointerDown(){window.addEventListener("pointerup",t=>{var r;t.target===this&&!((r=this._mathfield)!=null&&r.disabled)&&this.dispatchEvent(new MouseEvent("click",{altKey:t.altKey,button:t.button,buttons:t.buttons,clientX:t.clientX,clientY:t.clientY,ctrlKey:t.ctrlKey,metaKey:t.metaKey,movementX:t.movementX,movementY:t.movementY,relatedTarget:t.relatedTarget,screenX:t.screenX,screenY:t.screenY,shiftKey:t.shiftKey}))},{once:!0})}getPromptValue(t,r){var n,a;return(a=(n=this._mathfield)==null?void 0:n.getPromptValue(t,r))!=null?a:""}setPromptValue(t,r,n){var a;(a=this._mathfield)==null||a.setPromptValue(t,r,n)}getPromptRange(t){var r,n;return(n=(r=this._mathfield)==null?void 0:r.getPromptRange(t))!=null?n:null}getPrompts(t){var r,n;return(n=(r=this._mathfield)==null?void 0:r.getPrompts(t))!=null?n:[]}get form(){var t;return(t=this._internals)==null?void 0:t.form}get name(){var t;return(t=this.getAttribute("name"))!=null?t:""}get type(){return this.localName}get mode(){var t,r;return(r=(t=this._mathfield)==null?void 0:t.model.mode)!=null?r:this.defaultMode==="text"?"text":"math"}set mode(t){var r;(r=this._mathfield)==null||r.switchMode(t)}get expression(){if(this._mathfield)return window[Symbol.for("io.cortexjs.compute-engine")]?this._mathfield.expression:(console.error(`MathLive 0.98.5: The CortexJS Compute Engine library is not available.
Load the library, for example with:
import "https://unpkg.com/@cortex-js/compute-engine?module"`),null)}set expression(t){var r,n;if(!this._mathfield)return;const a=(n=(r=Co.computeEngine)==null?void 0:r.box(t).latex)!=null?n:null;a!==null&&this._mathfield.setValue(a),window[Symbol.for("io.cortexjs.compute-engine")]||console.error(`MathLive 0.98.5: The CortexJS Compute Engine library is not available.
Load the library, for example with:
import "https://unpkg.com/@cortex-js/compute-engine?module"`)}get errors(){var t,r;return(r=(t=this._mathfield)==null?void 0:t.errors)!=null?r:[]}_getOptions(t){return this._mathfield?Eo(this._mathfield.options,t):sn.has(this)?F({},Eo(F(F({},Nu()),Bu(sn.get(this).options)),t)):null}getOptions(t){return console.warn("%cMathLive 0.98.5: %cDeprecated Usage%c\n `mf.getOptions()` is deprecated. Read the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem","color: inherit, font-size: 1rem"),this._mathfield?Eo(this._mathfield.options,t):sn.has(this)?Eo(F(F({},Nu()),Bu(sn.get(this).options)),t):null}reflectAttributes(){const t=Nu(),r=this._getOptions();Object.keys(Co.optionsAttributes).forEach(n=>{const a=Ps(n);Co.optionsAttributes[n]==="on/off"?t[a]!==r[a]?this.setAttribute(n,r[a]?"on":"off"):this.removeAttribute(n):t[a]!==r[a]&&(Co.optionsAttributes[n]==="boolean"?r[a]?this.setAttribute(n,""):this.removeAttribute(n):(typeof r[a]=="string"||typeof r[a]=="number")&&this.setAttribute(n,r[a].toString()))})}getOption(t){return console.warn("%cMathLive 0.98.5: %cDeprecated Usage%c\n `mf.getOption()` is deprecated. Read the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem","color: inherit, font-size: 1rem"),this._getOptions([t])[t]}_getOption(t){return this._getOptions([t])[t]}_setOptions(t){if(this._mathfield)this._mathfield.setOptions(t);else if(sn.has(this)){const r=F(F({},sn.get(this).options),t);sn.set(this,i(F({},sn.get(this)),{selection:{ranges:r.readOnly?[[0,0]]:[[0,-1]]},options:r}))}else sn.set(this,{value:void 0,selection:{ranges:[[0,0]]},options:t,menuItems:void 0});this.reflectAttributes()}setOptions(t){console.group("%cMathLive 0.98.5: %cDeprecated Usage","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),console.warn(" `mf.setOptions()` is deprecated. Set the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.");for(const r of Object.keys(t))Ys[r]&&console.warn(`\`mf.setOptions({${r}:...})\` -> ${Ys[r]}`);console.groupEnd(),this._setOptions(t)}executeCommand(t){var r,n;return(n=(r=this._mathfield)==null?void 0:r.executeCommand(t))!=null?n:!1}getValue(t,r,n){var a,o;if(this._mathfield)return this._mathfield.model.getValue(t,r,n);if(sn.has(this)){let _,N,z;if(hu(t)?([_,N]=t.ranges[0],z=r):fu(t)?([_,N]=t,z=r):$s(t)&&$s(r)?(_=t,N=r,z=n):(_=0,N=-1,z=t),(z===void 0||z==="latex")&&_===0&&N===-1)return(o=(a=sn.get(this).value)!=null?a:this.textContent)!=null?o:""}return""}setValue(t,r){if(this._mathfield&&t!==void 0){r!=null||(r={silenceNotifications:!0,mode:"math"}),this._mathfield.setValue(t,r);return}if(sn.has(this)){const a=sn.get(this).options;sn.set(this,{value:t,selection:{ranges:[[-1,-1]],direction:"forward"},options:a,menuItems:void 0});return}const n=Vl(this);sn.set(this,{value:t,selection:{ranges:[[-1,-1]],direction:"forward"},options:n,menuItems:void 0})}hasFocus(){var t,r;return(r=(t=this._mathfield)==null?void 0:t.hasFocus())!=null?r:!1}focus(){var t;(t=this._mathfield)==null||t.focus()}blur(){var t;(t=this._mathfield)==null||t.blur()}select(){var t;(t=this._mathfield)==null||t.select()}insert(t,r){var n,a;return(a=(n=this._mathfield)==null?void 0:n.insert(t,r))!=null?a:!1}applyStyle(t,r){var n;return(n=this._mathfield)==null?void 0:n.applyStyle(t,r)}queryStyle(t){var r,n;return(n=(r=this._mathfield)==null?void 0:r.queryStyle(t))!=null?n:"none"}get caretPoint(){var t,r;return(r=(t=this._mathfield)==null?void 0:t.getCaretPoint())!=null?r:null}set caretPoint(t){var r;t&&((r=this._mathfield)==null||r.setCaretPoint(t.x,t.y))}setCaretPoint(t,r){var n,a;return(a=(n=this._mathfield)==null?void 0:n.setCaretPoint(t,r))!=null?a:!1}offsetFromPoint(t,r,n){return this._mathfield?Bl(this._mathfield,t,r,n):-1}hitboxFromOffset(t){if(!this._mathfield)return null;const r=this._mathfield.model.at(t);if(!r)return null;const n=_l(this._mathfield,r);return n?new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top):null}resetUndo(){var t;(t=this._mathfield)==null||t.resetUndo()}canUndo(){return this._mathfield?this._mathfield.canUndo():!1}canRedo(){return this._mathfield?this._mathfield.canRedo():!1}handleEvent(t){var r,n,a,o;ds.state==="closed"&&((n=(r=this._mathfield)==null?void 0:r.menu)==null?void 0:n.state)==="closed"&&(t.type==="pointerdown"&&this.onPointerDown(),t.type==="focus"&&((a=this._mathfield)==null||a.focus()),t.type==="blur"&&((o=this._mathfield)==null||o.blur()))}connectedCallback(){var t,r,n,a;const o=window.getComputedStyle(this),_=this.shadowRoot,N=o.userSelect!=="none";if(N)_.host.addEventListener("pointerdown",this,!0);else{const j=_.querySelector("span");j.style.pointerEvents="none"}_.host.addEventListener("focus",this,!0),_.host.addEventListener("blur",this,!0),ll()||(this.hasAttribute("role")||this.setAttribute("role","math"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","math input field"),this.setAttribute("aria-multiline","false")),N&&!this.hasAttribute("contenteditable")&&this.setAttribute("contenteditable","true"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0");const z=_.querySelector("slot:not([name])");if(z)try{this._style=z.assignedElements().filter(j=>j.tagName.toLowerCase()==="style").map(j=>j.textContent).join("")}catch(j){console.error(j)}if(this._style){const j=document.createElement("style");j.textContent=this._style,_.appendChild(j)}let W="";if(this.hasAttribute("value")?W=this.getAttribute("value"):W=(t=z==null?void 0:z.assignedNodes().map(j=>j.nodeType===3?j.textContent:"").join("").trim())!=null?t:"",this._mathfield=new yg(_.querySelector(":host > span"),i(F({},(n=(r=sn.get(this))==null?void 0:r.options)!=null?n:Vl(this)),{eventSink:this,value:W})),!sn.has(this)){this.upgradeProperty("disabled"),this.upgradeProperty("readonly");for(const j of Object.keys(Co.optionsAttributes))this.upgradeProperty(Ps(j))}if(!((a=this._mathfield)!=null&&a.model)){this._mathfield=null;return}if(sn.has(this)){const j=this._mathfield,X=sn.get(this),ae=X.menuItems;j.model.deferNotifications({content:!1,selection:!1},()=>{const he=X.value;he!==void 0&&j.setValue(he),j.model.selection=X.selection,sn.delete(this)}),ae&&(this.menuItems=ae)}window.queueMicrotask(()=>{this.isConnected&&this.dispatchEvent(new Event("mount",{cancelable:!1,bubbles:!0,composed:!0}))}),Lu()}disconnectedCallback(){var t,r;if(this.shadowRoot.host.removeEventListener("pointerdown",this,!0),!this._mathfield)return;window.queueMicrotask(()=>this.dispatchEvent(new Event("unmount",{cancelable:!1,bubbles:!0,composed:!0})));const n=Eo(this._mathfield.options,Object.keys(Co.optionsAttributes).map(a=>Ps(a)));sn.set(this,{value:this._mathfield.getValue(),selection:this._mathfield.model.selection,menuItems:(r=(t=this._mathfield.menu)==null?void 0:t.menuItems)!=null?r:void 0,options:n}),this._mathfield.dispose(),this._mathfield=null}upgradeProperty(t){if(this.hasOwnProperty(t)){const r=this[t];delete this[t],(t==="readonly"||t==="read-only")&&(t="readOnly"),this[t]=r}}attributeChangedCallback(t,r,n){if(r===n)return;const a=n!==null;switch(t){case"contenteditable":oi(this._mathfield);break;case"disabled":this.disabled=a;break;case"read-only":case"readonly":this.readOnly=a;break;default:}}get readonly(){return this.hasAttribute("readonly")||this.hasAttribute("read-only")}set readonly(t){const r=!!t;r?(this.setAttribute("readonly",""),ll()?this._internals.ariaReadOnly="true":this.setAttribute("aria-readonly","true"),this.setAttribute("aria-readonly","true")):(ll()?this._internals.ariaReadOnly="false":this.removeAttribute("aria-readonly"),this.removeAttribute("readonly"),this.removeAttribute("read-only")),this._setOptions({readOnly:r})}get disabled(){return this.hasAttribute("disabled")}set disabled(t){var r;const n=!!t;n?this.setAttribute("disabled",""):this.removeAttribute("disabled"),ll()?this._internals.ariaDisabled=n?"true":"false":this.setAttribute("aria-disabled",n?"true":"false"),n&&((r=this._mathfield)!=null&&r.hasFocus)&&window.mathVirtualKeyboard.visible&&this._mathfield.executeCommand("hideVirtualKeyboard")}get value(){return this.getValue()}set value(t){this.setValue(t)}get defaultMode(){return this._getOption("defaultMode")}set defaultMode(t){this._setOptions({defaultMode:t})}get macros(){return this._getOption("macros")}set macros(t){this._setOptions({macros:t})}get registers(){const t=this;return new Proxy({},{get:(r,n)=>{if(typeof n=="string")return t._getOption("registers")[n]},set(r,n,a){return typeof n!="string"?!1:(t._setOptions({registers:i(F({},t._getOption("registers")),{[n]:a})}),!0)}})}set registers(t){this._setOptions({registers:t})}get colorMap(){return this._getOption("colorMap")}set colorMap(t){this._setOptions({colorMap:t})}get backgroundColorMap(){return this._getOption("backgroundColorMap")}set backgroundColorMap(t){this._setOptions({backgroundColorMap:t})}get letterShapeStyle(){return this._getOption("letterShapeStyle")}set letterShapeStyle(t){this._setOptions({letterShapeStyle:t})}get minFontScale(){return this._getOption("minFontScale")}set minFontScale(t){this._setOptions({minFontScale:t})}get smartMode(){return this._getOption("smartMode")}set smartMode(t){this._setOptions({smartMode:t})}get smartFence(){return this._getOption("smartFence")}set smartFence(t){this._setOptions({smartFence:t})}get smartSuperscript(){return this._getOption("smartSuperscript")}set smartSuperscript(t){this._setOptions({smartSuperscript:t})}get scriptDepth(){return this._getOption("scriptDepth")}set scriptDepth(t){this._setOptions({scriptDepth:t})}get removeExtraneousParentheses(){return this._getOption("removeExtraneousParentheses")}set removeExtraneousParentheses(t){this._setOptions({removeExtraneousParentheses:t})}get mathModeSpace(){return this._getOption("mathModeSpace")}set mathModeSpace(t){this._setOptions({mathModeSpace:t})}get placeholderSymbol(){return this._getOption("placeholderSymbol")}set placeholderSymbol(t){this._setOptions({placeholderSymbol:t})}get popoverPolicy(){return this._getOption("popoverPolicy")}set popoverPolicy(t){this._setOptions({popoverPolicy:t})}get environmentPopoverPolicy(){return this._getOption("environmentPopoverPolicy")}set environmentPopoverPolicy(t){this._setOptions({environmentPopoverPolicy:t})}get menuItems(){var t,r,n;return this._mathfield?(t=this._mathfield.menu._menuItems.map(a=>a.menuItem))!=null?t:[]:(n=(r=sn.get(this))==null?void 0:r.menuItems)!=null?n:[]}set menuItems(t){var r;if(this._mathfield){const n=(r=this._mathfield.element)==null?void 0:r.querySelector("[part=menu-toggle]");n&&(n.style.display=t.length===0?"none":""),this._mathfield.menu.menuItems=t}sn.has(this)?sn.set(this,i(F({},sn.get(this)),{menuItems:t})):sn.set(this,{value:void 0,selection:{ranges:[[0,0]]},options:Vl(this),menuItems:t})}get mathVirtualKeyboardPolicy(){return this._getOption("mathVirtualKeyboardPolicy")}set mathVirtualKeyboardPolicy(t){this._setOptions({mathVirtualKeyboardPolicy:t})}get inlineShortcuts(){return this._getOption("inlineShortcuts")}set inlineShortcuts(t){this._setOptions({inlineShortcuts:t})}get inlineShortcutTimeout(){return this._getOption("inlineShortcutTimeout")}set inlineShortcutTimeout(t){this._setOptions({inlineShortcutTimeout:t})}get keybindings(){return this._getOption("keybindings")}set keybindings(t){this._setOptions({keybindings:t})}get onInlineShortcut(){return this._getOption("onInlineShortcut")}set onInlineShortcut(t){this._setOptions({onInlineShortcut:t})}get onScrollIntoView(){return this._getOption("onScrollIntoView")}set onScrollIntoView(t){this._setOptions({onScrollIntoView:t})}get onExport(){return this._getOption("onExport")}set onExport(t){this._setOptions({onExport:t})}get readOnly(){return this._getOption("readOnly")}set readOnly(t){this._setOptions({readOnly:t})}get isSelectionEditable(){var t,r;return(r=(t=this._mathfield)==null?void 0:t.isSelectionEditable)!=null?r:!1}setPromptState(t,r,n){var a;(a=this._mathfield)==null||a.setPromptState(t,r,n)}getPromptState(t){var r,n;return(n=(r=this._mathfield)==null?void 0:r.getPromptState(t))!=null?n:[void 0,!0]}get virtualKeyboardTargetOrigin(){return this._getOption("virtualKeyboardTargetOrigin")}set virtualKeyboardTargetOrigin(t){this._setOptions({virtualKeyboardTargetOrigin:t})}get selection(){return this._mathfield?this._mathfield.model.selection:sn.has(this)?sn.get(this).selection:{ranges:[[0,0]],direction:"forward"}}set selection(t){if(typeof t=="number"&&(t={ranges:[[t,t]]}),this._mathfield){this._mathfield.model.selection=t,oi(this._mathfield);return}if(sn.has(this)){sn.set(this,i(F({},sn.get(this)),{selection:t}));return}sn.set(this,{value:void 0,selection:t,options:Vl(this),menuItems:void 0})}get selectionIsCollapsed(){const t=this.selection;return t.ranges.length===1&&t.ranges[0][0]===t.ranges[0][1]}get position(){return this._mathfield?this._mathfield.model.position:sn.has(this)?sn.get(this).selection.ranges[0][0]:0}set position(t){if(this._mathfield&&(this._mathfield.model.position=t,oi(this._mathfield)),sn.has(this)){sn.set(this,i(F({},sn.get(this)),{selection:{ranges:[[t,t]]}}));return}sn.set(this,{value:void 0,selection:{ranges:[[t,t]]},options:Vl(this),menuItems:void 0})}getOffsetDepth(t){var r,n;return this._mathfield?((n=(r=this._mathfield.model.at(t))==null?void 0:r.treeDepth)!=null?n:2)-2:0}get lastOffset(){var t,r;return(r=(t=this._mathfield)==null?void 0:t.model.lastOffset)!=null?r:-1}};Ki.version="0.98.5",Ki._fontsDirectory="./fonts",Ki._soundsDirectory="./sounds",Ki.keypressVibration=!0,Ki._keypressSound={spacebar:"keypress-spacebar.wav",return:"keypress-return.wav",delete:"keypress-delete.wav",default:"keypress-standard.wav"},Ki._plonkSound="plonk.wav",Ki.audioBuffers={},Ki.createHTML=e=>e,Ki._speechEngineRate="100%",Ki._speechEngineVoice="Joanna",Ki._textToSpeechMarkup="",Ki._textToSpeechRules="mathlive",Ki._textToSpeechRulesOptions={},Ki.speakHook=cg,Ki.readAloudHook=bg,Ki._decimalSeparator=".",Ki.fractionNavigationOrder="numerator-denominator",Ki._isFunction=e=>{var t,r;const n=window.MathfieldElement.computeEngine;return(r=(t=n==null?void 0:n.parse(e).domain)==null?void 0:t.isFunction)!=null?r:!1};var Wl=Ki;function Ps(e){return e.replace(/[^a-zA-Z\d]+(.)/g,(t,r)=>r.toUpperCase())}function Vl(e){const t={readOnly:!1},r=Wl.optionsAttributes;return Object.keys(r).forEach(n=>{if(e.hasAttribute(n)){const a=e.getAttribute(n);n==="placeholder"?t.contentPlaceholder=a!=null?a:"":r[n]==="boolean"?t[Ps(n)]=!0:r[n]==="on/off"?a==="on"?t[Ps(n)]=!0:a==="off"?t[Ps(n)]=!1:t[Ps(n)]=void 0:r[n]==="number"?t[Ps(n)]=Number.parseFloat(a!=null?a:"0"):t[Ps(n)]=a}}),t}function ll(){return!(!("ElementInternals"in window)||!HTMLElement.prototype.attachInternals||!("role"in window.ElementInternals.prototype))}var yd=Wl,bd,xd,Ed,wd;if(b()&&!((bd=window.customElements)!=null&&bd.get("math-field"))){(Ed=window[xd=Symbol.for("io.cortexjs.mathlive")])!=null||(window[xd]={});const e=window[Symbol.for("io.cortexjs.mathlive")];e.version="0.98.5",window.MathfieldElement=Wl,(wd=window.customElements)==null||wd.define("math-field",Wl)}function Eg(e,t,r){let n=r,a=0;const o=e.length;for(;n<t.length;){const _=t[n];if(a<=0&&t.slice(n,n+o)===e)return n;_==="\\"?n++:_==="{"?a++:_==="}"&&a--,n++}return-1}function tc(e,t,r,n,a="latex"){const o=[];for(const _ of e)if(_.type==="text"){const N=_.data;let z=!0,W=0,j;j=N.indexOf(t),j!==-1&&(W=j,W>0&&o.push({type:"text",data:N.slice(0,W)}),z=!1);let X=!1;for(;!X;){if(z){if(j=N.indexOf(t,W),j===-1){X=!0;break}W!==j&&o.push({type:"text",data:N.slice(W,j)}),W=j}else{if(j=Eg(r,N,W+t.length),j===-1){X=!0;break}let ae=N.slice(W+t.length,j);a==="ascii-math"&&([,ae]=du(ae,{format:"ascii-math"})),o.push({type:"math",data:ae,rawData:N.slice(W,j+r.length),mathstyle:n}),W=j+r.length}z=!z}W<N.length&&o.push({type:"text",data:N.slice(W)})}else o.push(_);return o}function Sd(e,t,r){let n=[{type:"text",data:e}];return t!=null&&t.inline&&t.inline.forEach(([a,o])=>{n=tc(n,a,o,"textstyle")}),t!=null&&t.display&&t.display.forEach(([a,o])=>{n=tc(n,a,o,"displaystyle")}),r!=null&&r.inline&&r.inline.forEach(([a,o])=>{n=tc(n,a,o,"textstyle","ascii-math")}),r!=null&&r.display&&r.display.forEach(([a,o])=>{n=tc(n,a,o,"displaystyle","ascii-math")}),n}function wg(e,t){const r=document.createElement("span");r.setAttribute("translate","no");try{const n="<math xmlns='http://www.w3.org/1998/Math/MathML'>"+t.renderToMathML(e)+"</math>";r.innerHTML=window.MathfieldElement.createHTML(n)}catch(n){console.error(`MathLive 0.98.5: Could not convert "${e}"' to MathML with ${n}`),r.textContent=e}return r.className="ML__sr-only",r}function Sg(e,t,r,n){try{const a=t.renderToMarkup(e,{mathstyle:r,format:"html"}),o=document.createElement("span");return o.dataset.latex=e,o.style.display=r==="displaystyle"?"flex":"inline-flex",o.setAttribute("aria-hidden","true"),o.setAttribute("translate","no"),o.innerHTML=window.MathfieldElement.createHTML(a),o}catch(a){if(console.error("Could not parse'"+e+"' with ",a),n)return document.createTextNode(e)}return null}function ul(e,t,r,n){var a;const o=Sg(e,r,t||"textstyle",n),_=(a=r.renderAccessibleContent)!=null?a:"";if(o&&/\b(mathml|speakable-text)\b/i.test(_)){const N=document.createElement("span");if(/\bmathml\b/i.test(_)&&r.renderToMathML&&N.append(wg(e,r)),/\bspeakable-text\b/i.test(_)&&r.renderToSpeakableText){const z=document.createElement("span");z.setAttribute("translate","no");const W=r.renderToSpeakableText(e);z.innerHTML=window.MathfieldElement.createHTML(W),z.className="ML__sr-only",N.append(z)}return N.append(o),N}return o}function Mg(e,t){var r,n,a;let o=null;if((r=t.TeX)!=null&&r.processEnvironments&&/^\s*\\begin/.test(e)){o=document.createDocumentFragment();const _=ul(e,"",t,!0);_&&o.appendChild(_)}else{if(!e.trim())return null;const _=Sd(e,(n=t.TeX)==null?void 0:n.delimiters,(a=t.asciiMath)==null?void 0:a.delimiters);if(_.length===1&&_[0].type==="text")return null;o=document.createDocumentFragment();for(const N of _)if(N.type==="text")o.appendChild(document.createTextNode(N.data));else{const z=ul(N.data,N.mathstyle==="textstyle"?"textstyle":"displaystyle",t,!0);z&&o.appendChild(z)}}return o}function Md(e,t){var r,n,a,o,_,N,z,W,j,X,ae,he,_e,Ue,yt,Be;if(e.childNodes.length===1&&e.childNodes[0].nodeType===3){const nt=(r=e.childNodes[0].textContent)!=null?r:"";if((n=t.TeX)!=null&&n.processEnvironments&&/^\s*\\begin/.test(nt)){e.textContent="";const st=ul(nt,"",t,!0);st&&e.append(st);return}const wt=Sd(nt,(a=t.TeX)==null?void 0:a.delimiters,(o=t.asciiMath)==null?void 0:o.delimiters);if(wt.length===1&&wt[0].type==="math"){e.textContent="";const st=ul(wt[0].data,wt[0].mathstyle==="textstyle"?"textstyle":"displaystyle",t,!0);st&&e.append(st);return}if(wt.length===1&&wt[0].type==="text")return}for(let nt=e.childNodes.length-1;nt>=0;nt--){const wt=e.childNodes[nt];if(wt.nodeType===3){const st=Mg((_=wt.textContent)!=null?_:"",t);st&&(nt+=st.childNodes.length-1,wt.replaceWith(st))}else if(wt.nodeType===1){const st=wt,zt=wt.nodeName.toLowerCase();if(zt==="script"){const qt=wt;let Gt;if((N=t.processScriptTypePattern)!=null&&N.test(qt.type))Gt=(z=qt.textContent)!=null?z:"";else if((W=t.processMathJSONScriptTypePattern)!=null&&W.test(qt.type))try{Gt=(X=t.serializeToLatex)==null?void 0:X.call(t,JSON.parse((j=qt.textContent)!=null?j:""))}catch(Hr){console.error(Hr)}if(Gt){let Hr="textstyle";for(const Lt of qt.type.split(";")){const[Ra,ys]=Lt.toLowerCase().split("=");Ra.trim()==="mode"&&(Hr=ys.trim()==="display"?"displaystyle":"textstyle")}const _n=ul(Gt,Hr,t,!0);_n&&qt.parentNode.replaceChild(_n,qt)}}else if(((he=(ae=t.processClassPattern)==null?void 0:ae.test(st.className))!=null?he:!1)||!((Ue=(_e=t.skipTags)==null?void 0:_e.includes(zt))!=null&&Ue||(Be=(yt=t.ignoreClassPattern)==null?void 0:yt.test(st.className))!=null&&Be))if(e.childNodes.length===1&&e.childNodes[0].nodeType===3){const Gt=e.textContent;e.textContent="";const Hr=ul(Gt!=null?Gt:"","displaystyle",t,!0);Hr&&e.append(Hr)}else Md(st,t)}}}var Tg={skipTags:["math-field","noscript","style","textarea","pre","code","annotation","annotation-xml"],processScriptType:"math/tex",processMathJSONScriptType:"math/json",ignoreClass:"tex2jax_ignore",processClass:"tex2jax_process",renderAccessibleContent:"mathml",asciiMath:{delimiters:{inline:[["`","`"]]}},TeX:{processEnvironments:!0,delimiters:{inline:[["\\(","\\)"]],display:[["$$","$$"],["\\[","\\]"]]}}};function Dg(e,t){var r,n,a,o;try{const _=F(F({},Tg),t);_.ignoreClassPattern=new RegExp((r=_.ignoreClass)!=null?r:""),_.processClassPattern=new RegExp((n=_.processClass)!=null?n:""),_.processScriptTypePattern=new RegExp((a=_.processScriptType)!=null?a:""),_.processMathJSONScriptTypePattern=new RegExp((o=_.processMathJSONScriptType)!=null?o:""),Lu(),Cs("core"),Md(e,_)}catch(_){_ instanceof Error?console.error("renderMathInElement(): "+_.message):console.error("renderMathInElement(): Could not render math for element",e)}}function Ag(e,t){const r=Gs.singleton;return r?(r.show(),Rl(),r.currentLayer=t,r.render(),r.focus(),!0):!1}function kg(){const e=window.mathVirtualKeyboard;return e.visible?e.hide({animate:!0}):e.show({animate:!0}),!1}_a({switchKeyboardLayer:Ag,toggleVirtualKeyboard:kg,hideVirtualKeyboard:()=>(window.mathVirtualKeyboard.hide({animate:!0}),!1),showVirtualKeyboard:()=>(window.mathVirtualKeyboard.show({animate:!0}),!1)},{target:"virtual-keyboard"});function Xs(){var e,t;return(t=globalThis[e=Symbol.for("io.cortexjs.mathlive")])!=null||(globalThis[e]={}),globalThis[Symbol.for("io.cortexjs.mathlive")]}function Bg(){return console.warn("%cMathLive 0.98.5: %cmakeSharedVirtualKeyboard() is deprecated. \n Use `window.mathVirtualKeyboard` to access the virtual keyboard instance.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),window.mathVirtualKeyboard}function Ng(e){Lg(document.body,e)}function Cg(e){if(typeof e=="string"){const t=document.getElementById(e);if(t===null)throw new Error(`The element with ID "${e}" could not be found.`);return t}return typeof e=="string"?null:e}function Lg(e,t){var r,n,a,o;const _=Cg(e);if(!_)return;const N=t!=null?t:{};(r=N.renderToMarkup)!=null||(N.renderToMarkup=Pi),(n=N.renderToMathML)!=null||(N.renderToMathML=Wv),(a=N.renderToSpeakableText)!=null||(N.renderToSpeakableText=Vv),(o=N.serializeToLatex)!=null||(N.serializeToLatex=Hv),Dg(_,N)}var Kg={mathlive:"0.98.5"}}}]);
}());