var Zz=Object.defineProperty;var Jz=(t,e,n)=>e in t?Zz(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var to=(t,e,n)=>Jz(t,typeof e!="symbol"?e+"":e,n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var Rme=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Oh(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Dme(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var i2={exports:{}},W0={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var ZS;function eU(){if(ZS)return W0;ZS=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,s){var a=null;if(s!==void 0&&(a=""+s),i.key!==void 0&&(a=""+i.key),"key"in i){s={};for(var l in i)l!=="key"&&(s[l]=i[l])}else s=i;return i=s.ref,{$$typeof:t,type:r,key:a,ref:i!==void 0?i:null,props:s}}return W0.Fragment=e,W0.jsx=n,W0.jsxs=n,W0}var JS;function tU(){return JS||(JS=1,i2.exports=eU()),i2.exports}var A=tU(),s2={exports:{}},wt={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var ew;function nU(){if(ew)return wt;ew=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),g=Symbol.iterator;function b(H){return H===null||typeof H!="object"?null:(H=g&&H[g]||H["@@iterator"],typeof H=="function"?H:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,x={};function S(H,ne,P){this.props=H,this.context=ne,this.refs=x,this.updater=P||v}S.prototype.isReactComponent={},S.prototype.setState=function(H,ne){if(typeof H!="object"&&typeof H!="function"&&H!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,H,ne,"setState")},S.prototype.forceUpdate=function(H){this.updater.enqueueForceUpdate(this,H,"forceUpdate")};function C(){}C.prototype=S.prototype;function O(H,ne,P){this.props=H,this.context=ne,this.refs=x,this.updater=P||v}var L=O.prototype=new C;L.constructor=O,E(L,S.prototype),L.isPureReactComponent=!0;var D=Array.isArray;function R(){}var F={H:null,A:null,T:null,S:null},G=Object.prototype.hasOwnProperty;function Z(H,ne,P){var Ee=P.ref;return{$$typeof:t,type:H,key:ne,ref:Ee!==void 0?Ee:null,props:P}}function q(H,ne){return Z(H.type,ne,H.props)}function ie(H){return typeof H=="object"&&H!==null&&H.$$typeof===t}function se(H){var ne={"=":"=0",":":"=2"};return"$"+H.replace(/[=:]/g,function(P){return ne[P]})}var Te=/\/+/g;function oe(H,ne){return typeof H=="object"&&H!==null&&H.key!=null?se(""+H.key):ne.toString(36)}function re(H){switch(H.status){case"fulfilled":return H.value;case"rejected":throw H.reason;default:switch(typeof H.status=="string"?H.then(R,R):(H.status="pending",H.then(function(ne){H.status==="pending"&&(H.status="fulfilled",H.value=ne)},function(ne){H.status==="pending"&&(H.status="rejected",H.reason=ne)})),H.status){case"fulfilled":return H.value;case"rejected":throw H.reason}}throw H}function X(H,ne,P,Ee,Fe){var He=typeof H;(He==="undefined"||He==="boolean")&&(H=null);var it=!1;if(H===null)it=!0;else switch(He){case"bigint":case"string":case"number":it=!0;break;case"object":switch(H.$$typeof){case t:case e:it=!0;break;case f:return it=H._init,X(it(H._payload),ne,P,Ee,Fe)}}if(it)return Fe=Fe(H),it=Ee===""?"."+oe(H,0):Ee,D(Fe)?(P="",it!=null&&(P=it.replace(Te,"$&/")+"/"),X(Fe,ne,P,"",function(St){return St})):Fe!=null&&(ie(Fe)&&(Fe=q(Fe,P+(Fe.key==null||H&&H.key===Fe.key?"":(""+Fe.key).replace(Te,"$&/")+"/")+it)),ne.push(Fe)),1;it=0;var kt=Ee===""?".":Ee+":";if(D(H))for(var Tt=0;Tt<H.length;Tt++)Ee=H[Tt],He=kt+oe(Ee,Tt),it+=X(Ee,ne,P,He,Fe);else if(Tt=b(H),typeof Tt=="function")for(H=Tt.call(H),Tt=0;!(Ee=H.next()).done;)Ee=Ee.value,He=kt+oe(Ee,Tt++),it+=X(Ee,ne,P,He,Fe);else if(He==="object"){if(typeof H.then=="function")return X(re(H),ne,P,Ee,Fe);throw ne=String(H),Error("Objects are not valid as a React child (found: "+(ne==="[object Object]"?"object with keys {"+Object.keys(H).join(", ")+"}":ne)+"). If you meant to render a collection of children, use an array instead.")}return it}function ee(H,ne,P){if(H==null)return H;var Ee=[],Fe=0;return X(H,Ee,"","",function(He){return ne.call(P,He,Fe++)}),Ee}function ce(H){if(H._status===-1){var ne=H._result;ne=ne(),ne.then(function(P){(H._status===0||H._status===-1)&&(H._status=1,H._result=P)},function(P){(H._status===0||H._status===-1)&&(H._status=2,H._result=P)}),H._status===-1&&(H._status=0,H._result=ne)}if(H._status===1)return H._result.default;throw H._result}var we=typeof reportError=="function"?reportError:function(H){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ne=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof H=="object"&&H!==null&&typeof H.message=="string"?String(H.message):String(H),error:H});if(!window.dispatchEvent(ne))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",H);return}console.error(H)},j={map:ee,forEach:function(H,ne,P){ee(H,function(){ne.apply(this,arguments)},P)},count:function(H){var ne=0;return ee(H,function(){ne++}),ne},toArray:function(H){return ee(H,function(ne){return ne})||[]},only:function(H){if(!ie(H))throw Error("React.Children.only expected to receive a single React element child.");return H}};return wt.Activity=p,wt.Children=j,wt.Component=S,wt.Fragment=n,wt.Profiler=i,wt.PureComponent=O,wt.StrictMode=r,wt.Suspense=u,wt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,wt.__COMPILER_RUNTIME={__proto__:null,c:function(H){return F.H.useMemoCache(H)}},wt.cache=function(H){return function(){return H.apply(null,arguments)}},wt.cacheSignal=function(){return null},wt.cloneElement=function(H,ne,P){if(H==null)throw Error("The argument must be a React element, but you passed "+H+".");var Ee=E({},H.props),Fe=H.key;if(ne!=null)for(He in ne.key!==void 0&&(Fe=""+ne.key),ne)!G.call(ne,He)||He==="key"||He==="__self"||He==="__source"||He==="ref"&&ne.ref===void 0||(Ee[He]=ne[He]);var He=arguments.length-2;if(He===1)Ee.children=P;else if(1<He){for(var it=Array(He),kt=0;kt<He;kt++)it[kt]=arguments[kt+2];Ee.children=it}return Z(H.type,Fe,Ee)},wt.createContext=function(H){return H={$$typeof:a,_currentValue:H,_currentValue2:H,_threadCount:0,Provider:null,Consumer:null},H.Provider=H,H.Consumer={$$typeof:s,_context:H},H},wt.createElement=function(H,ne,P){var Ee,Fe={},He=null;if(ne!=null)for(Ee in ne.key!==void 0&&(He=""+ne.key),ne)G.call(ne,Ee)&&Ee!=="key"&&Ee!=="__self"&&Ee!=="__source"&&(Fe[Ee]=ne[Ee]);var it=arguments.length-2;if(it===1)Fe.children=P;else if(1<it){for(var kt=Array(it),Tt=0;Tt<it;Tt++)kt[Tt]=arguments[Tt+2];Fe.children=kt}if(H&&H.defaultProps)for(Ee in it=H.defaultProps,it)Fe[Ee]===void 0&&(Fe[Ee]=it[Ee]);return Z(H,He,Fe)},wt.createRef=function(){return{current:null}},wt.forwardRef=function(H){return{$$typeof:l,render:H}},wt.isValidElement=ie,wt.lazy=function(H){return{$$typeof:f,_payload:{_status:-1,_result:H},_init:ce}},wt.memo=function(H,ne){return{$$typeof:d,type:H,compare:ne===void 0?null:ne}},wt.startTransition=function(H){var ne=F.T,P={};F.T=P;try{var Ee=H(),Fe=F.S;Fe!==null&&Fe(P,Ee),typeof Ee=="object"&&Ee!==null&&typeof Ee.then=="function"&&Ee.then(R,we)}catch(He){we(He)}finally{ne!==null&&P.types!==null&&(ne.types=P.types),F.T=ne}},wt.unstable_useCacheRefresh=function(){return F.H.useCacheRefresh()},wt.use=function(H){return F.H.use(H)},wt.useActionState=function(H,ne,P){return F.H.useActionState(H,ne,P)},wt.useCallback=function(H,ne){return F.H.useCallback(H,ne)},wt.useContext=function(H){return F.H.useContext(H)},wt.useDebugValue=function(){},wt.useDeferredValue=function(H,ne){return F.H.useDeferredValue(H,ne)},wt.useEffect=function(H,ne){return F.H.useEffect(H,ne)},wt.useEffectEvent=function(H){return F.H.useEffectEvent(H)},wt.useId=function(){return F.H.useId()},wt.useImperativeHandle=function(H,ne,P){return F.H.useImperativeHandle(H,ne,P)},wt.useInsertionEffect=function(H,ne){return F.H.useInsertionEffect(H,ne)},wt.useLayoutEffect=function(H,ne){return F.H.useLayoutEffect(H,ne)},wt.useMemo=function(H,ne){return F.H.useMemo(H,ne)},wt.useOptimistic=function(H,ne){return F.H.useOptimistic(H,ne)},wt.useReducer=function(H,ne,P){return F.H.useReducer(H,ne,P)},wt.useRef=function(H){return F.H.useRef(H)},wt.useState=function(H){return F.H.useState(H)},wt.useSyncExternalStore=function(H,ne,P){return F.H.useSyncExternalStore(H,ne,P)},wt.useTransition=function(){return F.H.useTransition()},wt.version="19.2.4",wt}var tw;function Mh(){return tw||(tw=1,s2.exports=nU()),s2.exports}var z=Mh();const le=Oh(z);var a2={exports:{}},K0={},o2={exports:{}},l2={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var nw;function rU(){return nw||(nw=1,(function(t){function e(X,ee){var ce=X.length;X.push(ee);e:for(;0<ce;){var we=ce-1>>>1,j=X[we];if(0<i(j,ee))X[we]=ee,X[ce]=j,ce=we;else break e}}function n(X){return X.length===0?null:X[0]}function r(X){if(X.length===0)return null;var ee=X[0],ce=X.pop();if(ce!==ee){X[0]=ce;e:for(var we=0,j=X.length,H=j>>>1;we<H;){var ne=2*(we+1)-1,P=X[ne],Ee=ne+1,Fe=X[Ee];if(0>i(P,ce))Ee<j&&0>i(Fe,P)?(X[we]=Fe,X[Ee]=ce,we=Ee):(X[we]=P,X[ne]=ce,we=ne);else if(Ee<j&&0>i(Fe,ce))X[we]=Fe,X[Ee]=ce,we=Ee;else break e}}return ee}function i(X,ee){var ce=X.sortIndex-ee.sortIndex;return ce!==0?ce:X.id-ee.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}var u=[],d=[],f=1,p=null,g=3,b=!1,v=!1,E=!1,x=!1,S=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function L(X){for(var ee=n(d);ee!==null;){if(ee.callback===null)r(d);else if(ee.startTime<=X)r(d),ee.sortIndex=ee.expirationTime,e(u,ee);else break;ee=n(d)}}function D(X){if(E=!1,L(X),!v)if(n(u)!==null)v=!0,R||(R=!0,se());else{var ee=n(d);ee!==null&&re(D,ee.startTime-X)}}var R=!1,F=-1,G=5,Z=-1;function q(){return x?!0:!(t.unstable_now()-Z<G)}function ie(){if(x=!1,R){var X=t.unstable_now();Z=X;var ee=!0;try{e:{v=!1,E&&(E=!1,C(F),F=-1),b=!0;var ce=g;try{t:{for(L(X),p=n(u);p!==null&&!(p.expirationTime>X&&q());){var we=p.callback;if(typeof we=="function"){p.callback=null,g=p.priorityLevel;var j=we(p.expirationTime<=X);if(X=t.unstable_now(),typeof j=="function"){p.callback=j,L(X),ee=!0;break t}p===n(u)&&r(u),L(X)}else r(u);p=n(u)}if(p!==null)ee=!0;else{var H=n(d);H!==null&&re(D,H.startTime-X),ee=!1}}break e}finally{p=null,g=ce,b=!1}ee=void 0}}finally{ee?se():R=!1}}}var se;if(typeof O=="function")se=function(){O(ie)};else if(typeof MessageChannel<"u"){var Te=new MessageChannel,oe=Te.port2;Te.port1.onmessage=ie,se=function(){oe.postMessage(null)}}else se=function(){S(ie,0)};function re(X,ee){F=S(function(){X(t.unstable_now())},ee)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(X){X.callback=null},t.unstable_forceFrameRate=function(X){0>X||125<X?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):G=0<X?Math.floor(1e3/X):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_next=function(X){switch(g){case 1:case 2:case 3:var ee=3;break;default:ee=g}var ce=g;g=ee;try{return X()}finally{g=ce}},t.unstable_requestPaint=function(){x=!0},t.unstable_runWithPriority=function(X,ee){switch(X){case 1:case 2:case 3:case 4:case 5:break;default:X=3}var ce=g;g=X;try{return ee()}finally{g=ce}},t.unstable_scheduleCallback=function(X,ee,ce){var we=t.unstable_now();switch(typeof ce=="object"&&ce!==null?(ce=ce.delay,ce=typeof ce=="number"&&0<ce?we+ce:we):ce=we,X){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=ce+j,X={id:f++,callback:ee,priorityLevel:X,startTime:ce,expirationTime:j,sortIndex:-1},ce>we?(X.sortIndex=ce,e(d,X),n(u)===null&&X===n(d)&&(E?(C(F),F=-1):E=!0,re(D,ce-we))):(X.sortIndex=j,e(u,X),v||b||(v=!0,R||(R=!0,se()))),X},t.unstable_shouldYield=q,t.unstable_wrapCallback=function(X){var ee=g;return function(){var ce=g;g=ee;try{return X.apply(this,arguments)}finally{g=ce}}}})(l2)),l2}var rw;function iU(){return rw||(rw=1,o2.exports=rU()),o2.exports}var u2={exports:{}},si={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var iw;function sU(){if(iw)return si;iw=1;var t=Mh();function e(u){var d="https://react.dev/errors/"+u;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)d+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+u+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function s(u,d,f){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:p==null?null:""+p,children:u,containerInfo:d,implementation:f}}var a=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(u,d){if(u==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return si.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,si.createPortal=function(u,d){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(e(299));return s(u,d,null,f)},si.flushSync=function(u){var d=a.T,f=r.p;try{if(a.T=null,r.p=2,u)return u()}finally{a.T=d,r.p=f,r.d.f()}},si.preconnect=function(u,d){typeof u=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(u,d))},si.prefetchDNS=function(u){typeof u=="string"&&r.d.D(u)},si.preinit=function(u,d){if(typeof u=="string"&&d&&typeof d.as=="string"){var f=d.as,p=l(f,d.crossOrigin),g=typeof d.integrity=="string"?d.integrity:void 0,b=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;f==="style"?r.d.S(u,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:p,integrity:g,fetchPriority:b}):f==="script"&&r.d.X(u,{crossOrigin:p,integrity:g,fetchPriority:b,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},si.preinitModule=function(u,d){if(typeof u=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var f=l(d.as,d.crossOrigin);r.d.M(u,{crossOrigin:f,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(u)},si.preload=function(u,d){if(typeof u=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var f=d.as,p=l(f,d.crossOrigin);r.d.L(u,f,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},si.preloadModule=function(u,d){if(typeof u=="string")if(d){var f=l(d.as,d.crossOrigin);r.d.m(u,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:f,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(u)},si.requestFormReset=function(u){r.d.r(u)},si.unstable_batchedUpdates=function(u,d){return u(d)},si.useFormState=function(u,d,f){return a.H.useFormState(u,d,f)},si.useFormStatus=function(){return a.H.useHostTransitionStatus()},si.version="19.2.4",si}var sw;function QA(){if(sw)return u2.exports;sw=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),u2.exports=sU(),u2.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var aw;function aU(){if(aw)return K0;aw=1;var t=iU(),e=Mh(),n=QA();function r(o){var c="https://react.dev/errors/"+o;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)c+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+o+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function s(o){var c=o,h=o;if(o.alternate)for(;c.return;)c=c.return;else{o=c;do c=o,(c.flags&4098)!==0&&(h=c.return),o=c.return;while(o)}return c.tag===3?h:null}function a(o){if(o.tag===13){var c=o.memoizedState;if(c===null&&(o=o.alternate,o!==null&&(c=o.memoizedState)),c!==null)return c.dehydrated}return null}function l(o){if(o.tag===31){var c=o.memoizedState;if(c===null&&(o=o.alternate,o!==null&&(c=o.memoizedState)),c!==null)return c.dehydrated}return null}function u(o){if(s(o)!==o)throw Error(r(188))}function d(o){var c=o.alternate;if(!c){if(c=s(o),c===null)throw Error(r(188));return c!==o?null:o}for(var h=o,m=c;;){var y=h.return;if(y===null)break;var _=y.alternate;if(_===null){if(m=y.return,m!==null){h=m;continue}break}if(y.child===_.child){for(_=y.child;_;){if(_===h)return u(y),o;if(_===m)return u(y),c;_=_.sibling}throw Error(r(188))}if(h.return!==m.return)h=y,m=_;else{for(var N=!1,I=y.child;I;){if(I===h){N=!0,h=y,m=_;break}if(I===m){N=!0,m=y,h=_;break}I=I.sibling}if(!N){for(I=_.child;I;){if(I===h){N=!0,h=_,m=y;break}if(I===m){N=!0,m=_,h=y;break}I=I.sibling}if(!N)throw Error(r(189))}}if(h.alternate!==m)throw Error(r(190))}if(h.tag!==3)throw Error(r(188));return h.stateNode.current===h?o:c}function f(o){var c=o.tag;if(c===5||c===26||c===27||c===6)return o;for(o=o.child;o!==null;){if(c=f(o),c!==null)return c;o=o.sibling}return null}var p=Object.assign,g=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),O=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),ie=Symbol.iterator;function se(o){return o===null||typeof o!="object"?null:(o=ie&&o[ie]||o["@@iterator"],typeof o=="function"?o:null)}var Te=Symbol.for("react.client.reference");function oe(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===Te?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case E:return"Fragment";case S:return"Profiler";case x:return"StrictMode";case D:return"Suspense";case R:return"SuspenseList";case Z:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case v:return"Portal";case O:return o.displayName||"Context";case C:return(o._context.displayName||"Context")+".Consumer";case L:var c=o.render;return o=o.displayName,o||(o=c.displayName||c.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case F:return c=o.displayName||null,c!==null?c:oe(o.type)||"Memo";case G:c=o._payload,o=o._init;try{return oe(o(c))}catch{}}return null}var re=Array.isArray,X=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},we=[],j=-1;function H(o){return{current:o}}function ne(o){0>j||(o.current=we[j],we[j]=null,j--)}function P(o,c){j++,we[j]=o.current,o.current=c}var Ee=H(null),Fe=H(null),He=H(null),it=H(null);function kt(o,c){switch(P(He,c),P(Fe,o),P(Ee,null),c.nodeType){case 9:case 11:o=(o=c.documentElement)&&(o=o.namespaceURI)?_S(o):0;break;default:if(o=c.tagName,c=c.namespaceURI)c=_S(c),o=xS(c,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}ne(Ee),P(Ee,o)}function Tt(){ne(Ee),ne(Fe),ne(He)}function St(o){o.memoizedState!==null&&P(it,o);var c=Ee.current,h=xS(c,o.type);c!==h&&(P(Fe,o),P(Ee,h))}function Jn(o){Fe.current===o&&(ne(Ee),ne(Fe)),it.current===o&&(ne(it),q0._currentValue=ce)}var Un,At;function gt(o){if(Un===void 0)try{throw Error()}catch(h){var c=h.stack.trim().match(/\n( *(at )?)/);Un=c&&c[1]||"",At=-1<h.stack.indexOf(`
    at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
`+Un+o+At}var Yt=!1;function Qe(o,c){if(!o||Yt)return"";Yt=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(c){var Se=function(){throw Error()};if(Object.defineProperty(Se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Se,[])}catch(me){var pe=me}Reflect.construct(o,[],Se)}else{try{Se.call()}catch(me){pe=me}o.call(Se.prototype)}}else{try{throw Error()}catch(me){pe=me}(Se=o())&&typeof Se.catch=="function"&&Se.catch(function(){})}}catch(me){if(me&&pe&&typeof me.stack=="string")return[me.stack,pe.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=m.DetermineComponentFrameRoot(),N=_[0],I=_[1];if(N&&I){var K=N.split(`
`),he=I.split(`
`);for(y=m=0;m<K.length&&!K[m].includes("DetermineComponentFrameRoot");)m++;for(;y<he.length&&!he[y].includes("DetermineComponentFrameRoot");)y++;if(m===K.length||y===he.length)for(m=K.length-1,y=he.length-1;1<=m&&0<=y&&K[m]!==he[y];)y--;for(;1<=m&&0<=y;m--,y--)if(K[m]!==he[y]){if(m!==1||y!==1)do if(m--,y--,0>y||K[m]!==he[y]){var ye=`
`+K[m].replace(" at new "," at ");return o.displayName&&ye.includes("<anonymous>")&&(ye=ye.replace("<anonymous>",o.displayName)),ye}while(1<=m&&0<=y);break}}}finally{Yt=!1,Error.prepareStackTrace=h}return(h=o?o.displayName||o.name:"")?gt(h):""}function $t(o,c){switch(o.tag){case 26:case 27:case 5:return gt(o.type);case 16:return gt("Lazy");case 13:return o.child!==c&&c!==null?gt("Suspense Fallback"):gt("Suspense");case 19:return gt("SuspenseList");case 0:case 15:return Qe(o.type,!1);case 11:return Qe(o.type.render,!1);case 1:return Qe(o.type,!0);case 31:return gt("Activity");default:return""}}function wn(o){try{var c="",h=null;do c+=$t(o,h),h=o,o=o.return;while(o);return c}catch(m){return`
Error generating stack: `+m.message+`
`+m.stack}}var zt=Object.prototype.hasOwnProperty,vn=t.unstable_scheduleCallback,Or=t.unstable_cancelCallback,ra=t.unstable_shouldYield,Hs=t.unstable_requestPaint,fn=t.unstable_now,lr=t.unstable_getCurrentPriorityLevel,ge=t.unstable_ImmediatePriority,Re=t.unstable_UserBlockingPriority,lt=t.unstable_NormalPriority,Ae=t.unstable_LowPriority,pt=t.unstable_IdlePriority,sn=t.log,hi=t.unstable_setDisableYieldValue,Yn=null,hn=null;function er(o){if(typeof sn=="function"&&hi(o),hn&&typeof hn.setStrictMode=="function")try{hn.setStrictMode(Yn,o)}catch{}}var xt=Math.clz32?Math.clz32:Qt,ni=Math.log,Je=Math.LN2;function Qt(o){return o>>>=0,o===0?32:31-(ni(o)/Je|0)|0}var Pe=256,kn=262144,Mn=4194304;function It(o){var c=o&42;if(c!==0)return c;switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return o&261888;case 262144:case 524288:case 1048576:case 2097152:return o&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function Q(o,c,h){var m=o.pendingLanes;if(m===0)return 0;var y=0,_=o.suspendedLanes,N=o.pingedLanes;o=o.warmLanes;var I=m&134217727;return I!==0?(m=I&~_,m!==0?y=It(m):(N&=I,N!==0?y=It(N):h||(h=I&~o,h!==0&&(y=It(h))))):(I=m&~_,I!==0?y=It(I):N!==0?y=It(N):h||(h=m&~o,h!==0&&(y=It(h)))),y===0?0:c!==0&&c!==y&&(c&_)===0&&(_=y&-y,h=c&-c,_>=h||_===32&&(h&4194048)!==0)?c:y}function _e(o,c){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&c)===0}function je(o,c){switch(o){case 1:case 2:case 4:case 8:case 64:return c+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function _t(){var o=Mn;return Mn<<=1,(Mn&62914560)===0&&(Mn=4194304),o}function Rn(o){for(var c=[],h=0;31>h;h++)c.push(o);return c}function yn(o,c){o.pendingLanes|=c,c!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function et(o,c,h,m,y,_){var N=o.pendingLanes;o.pendingLanes=h,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=h,o.entangledLanes&=h,o.errorRecoveryDisabledLanes&=h,o.shellSuspendCounter=0;var I=o.entanglements,K=o.expirationTimes,he=o.hiddenUpdates;for(h=N&~h;0<h;){var ye=31-xt(h),Se=1<<ye;I[ye]=0,K[ye]=-1;var pe=he[ye];if(pe!==null)for(he[ye]=null,ye=0;ye<pe.length;ye++){var me=pe[ye];me!==null&&(me.lane&=-536870913)}h&=~Se}m!==0&&Xe(o,m,0),_!==0&&y===0&&o.tag!==0&&(o.suspendedLanes|=_&~(N&~c))}function Xe(o,c,h){o.pendingLanes|=c,o.suspendedLanes&=~c;var m=31-xt(c);o.entangledLanes|=c,o.entanglements[m]=o.entanglements[m]|1073741824|h&261930}function bt(o,c){var h=o.entangledLanes|=c;for(o=o.entanglements;h;){var m=31-xt(h),y=1<<m;y&c|o[m]&c&&(o[m]|=c),h&=~y}}function ur(o,c){var h=c&-c;return h=(h&42)!==0?1:Fn(h),(h&(o.suspendedLanes|c))!==0?0:h}function Fn(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function La(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function fc(){var o=ee.p;return o!==0?o:(o=window.event,o===void 0?32:VS(o.type))}function hc(o,c){var h=ee.p;try{return ee.p=o,c()}finally{ee.p=h}}var ia=Math.random().toString(36).slice(2),cr="__reactFiber$"+ia,ri="__reactProps$"+ia,jo="__reactContainer$"+ia,t0="__reactEvents$"+ia,sp="__reactListeners$"+ia,pc="__reactHandles$"+ia,ap="__reactResources$"+ia,au="__reactMarker$"+ia;function n0(o){delete o[cr],delete o[ri],delete o[t0],delete o[sp],delete o[pc]}function pi(o){var c=o[cr];if(c)return c;for(var h=o.parentNode;h;){if(c=h[jo]||h[cr]){if(h=c.alternate,c.child!==null||h!==null&&h.child!==null)for(o=NS(o);o!==null;){if(h=o[cr])return h;o=NS(o)}return c}o=h,h=o.parentNode}return null}function Pa(o){if(o=o[cr]||o[jo]){var c=o.tag;if(c===5||c===6||c===13||c===31||c===26||c===27||c===3)return o}return null}function $o(o){var c=o.tag;if(c===5||c===26||c===27||c===6)return o.stateNode;throw Error(r(33))}function qo(o){var c=o[ap];return c||(c=o[ap]={hoistableStyles:new Map,hoistableScripts:new Map}),c}function br(o){o[au]=!0}var op=new Set,ou={};function Ba(o,c){De(o,c),De(o+"Capture",c)}function De(o,c){for(ou[o]=c,o=0;o<c.length;o++)op.add(c[o])}var st=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Lt={},an={};function dr(o){return zt.call(an,o)?!0:zt.call(Lt,o)?!1:st.test(o)?an[o]=!0:(Lt[o]=!0,!1)}function ii(o,c,h){if(dr(c))if(h===null)o.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":o.removeAttribute(c);return;case"boolean":var m=c.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){o.removeAttribute(c);return}}o.setAttribute(c,""+h)}}function Ki(o,c,h){if(h===null)o.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(c);return}o.setAttribute(c,""+h)}}function Ni(o,c,h,m){if(m===null)o.removeAttribute(h);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(h);return}o.setAttributeNS(c,h,""+m)}}function Cn(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function Xi(o){var c=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function lp(o,c,h){var m=Object.getOwnPropertyDescriptor(o.constructor.prototype,c);if(!o.hasOwnProperty(c)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var y=m.get,_=m.set;return Object.defineProperty(o,c,{configurable:!0,get:function(){return y.call(this)},set:function(N){h=""+N,_.call(this,N)}}),Object.defineProperty(o,c,{enumerable:m.enumerable}),{getValue:function(){return h},setValue:function(N){h=""+N},stopTracking:function(){o._valueTracker=null,delete o[c]}}}}function mc(o){if(!o._valueTracker){var c=Xi(o)?"checked":"value";o._valueTracker=lp(o,c,""+o[c])}}function r0(o){if(!o)return!1;var c=o._valueTracker;if(!c)return!0;var h=c.getValue(),m="";return o&&(m=Xi(o)?o.checked?"true":"false":o.value),o=m,o!==h?(c.setValue(o),!0):!1}function gc(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var rv=/[\n"\\]/g;function Oi(o){return o.replace(rv,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function i0(o,c,h,m,y,_,N,I){o.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?o.type=N:o.removeAttribute("type"),c!=null?N==="number"?(c===0&&o.value===""||o.value!=c)&&(o.value=""+Cn(c)):o.value!==""+Cn(c)&&(o.value=""+Cn(c)):N!=="submit"&&N!=="reset"||o.removeAttribute("value"),c!=null?bc(o,N,Cn(c)):h!=null?bc(o,N,Cn(h)):m!=null&&o.removeAttribute("value"),y==null&&_!=null&&(o.defaultChecked=!!_),y!=null&&(o.checked=y&&typeof y!="function"&&typeof y!="symbol"),I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?o.name=""+Cn(I):o.removeAttribute("name")}function lu(o,c,h,m,y,_,N,I){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(o.type=_),c!=null||h!=null){if(!(_!=="submit"&&_!=="reset"||c!=null)){mc(o);return}h=h!=null?""+Cn(h):"",c=c!=null?""+Cn(c):h,I||c===o.value||(o.value=c),o.defaultValue=c}m=m??y,m=typeof m!="function"&&typeof m!="symbol"&&!!m,o.checked=I?o.checked:!!m,o.defaultChecked=!!m,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(o.name=N),mc(o)}function bc(o,c,h){c==="number"&&gc(o.ownerDocument)===o||o.defaultValue===""+h||(o.defaultValue=""+h)}function qr(o,c,h,m){if(o=o.options,c){c={};for(var y=0;y<h.length;y++)c["$"+h[y]]=!0;for(h=0;h<o.length;h++)y=c.hasOwnProperty("$"+o[h].value),o[h].selected!==y&&(o[h].selected=y),y&&m&&(o[h].defaultSelected=!0)}else{for(h=""+Cn(h),c=null,y=0;y<o.length;y++){if(o[y].value===h){o[y].selected=!0,m&&(o[y].defaultSelected=!0);return}c!==null||o[y].disabled||(c=o[y])}c!==null&&(c.selected=!0)}}function up(o,c,h){if(c!=null&&(c=""+Cn(c),c!==o.value&&(o.value=c),h==null)){o.defaultValue!==c&&(o.defaultValue=c);return}o.defaultValue=h!=null?""+Cn(h):""}function vc(o,c,h,m){if(c==null){if(m!=null){if(h!=null)throw Error(r(92));if(re(m)){if(1<m.length)throw Error(r(93));m=m[0]}h=m}h==null&&(h=""),c=h}h=Cn(c),o.defaultValue=h,m=o.textContent,m===h&&m!==""&&m!==null&&(o.value=m),mc(o)}function mt(o,c){if(c){var h=o.firstChild;if(h&&h===o.lastChild&&h.nodeType===3){h.nodeValue=c;return}}o.textContent=c}var cp=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function vr(o,c,h){var m=c.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?m?o.setProperty(c,""):c==="float"?o.cssFloat="":o[c]="":m?o.setProperty(c,h):typeof h!="number"||h===0||cp.has(c)?c==="float"?o.cssFloat=h:o[c]=(""+h).trim():o[c]=h+"px"}function on(o,c,h){if(c!=null&&typeof c!="object")throw Error(r(62));if(o=o.style,h!=null){for(var m in h)!h.hasOwnProperty(m)||c!=null&&c.hasOwnProperty(m)||(m.indexOf("--")===0?o.setProperty(m,""):m==="float"?o.cssFloat="":o[m]="");for(var y in c)m=c[y],c.hasOwnProperty(y)&&h[y]!==m&&vr(o,y,m)}else for(var _ in c)c.hasOwnProperty(_)&&vr(o,_,c[_])}function Vo(o){if(o.indexOf("-")===-1)return!1;switch(o){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var za=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),s0=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Go(o){return s0.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function ze(){}var tt=null;function Ct(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var qt=null,Wn=null;function bs(o){var c=Pa(o);if(c&&(o=c.stateNode)){var h=o[ri]||null;e:switch(o=c.stateNode,c.type){case"input":if(i0(o,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),c=h.name,h.type==="radio"&&c!=null){for(h=o;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+Oi(""+c)+'"][type="radio"]'),c=0;c<h.length;c++){var m=h[c];if(m!==o&&m.form===o.form){var y=m[ri]||null;if(!y)throw Error(r(90));i0(m,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(c=0;c<h.length;c++)m=h[c],m.form===o.form&&r0(m)}break e;case"textarea":up(o,h.value,h.defaultValue);break e;case"select":c=h.value,c!=null&&qr(o,!!h.multiple,c,!1)}}}var a0=!1;function dp(o,c,h){if(a0)return o(c,h);a0=!0;try{var m=o(c);return m}finally{if(a0=!1,(qt!==null||Wn!==null)&&(Zp(),qt&&(c=qt,o=Wn,Wn=qt=null,bs(c),o)))for(c=0;c<o.length;c++)bs(o[c])}}function o0(o,c){var h=o.stateNode;if(h===null)return null;var m=h[ri]||null;if(m===null)return null;h=m[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(o=o.type,m=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!m;break e;default:o=!1}if(o)return null;if(h&&typeof h!="function")throw Error(r(231,c,typeof h));return h}var Ua=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),iv=!1;if(Ua)try{var l0={};Object.defineProperty(l0,"passive",{get:function(){iv=!0}}),window.addEventListener("test",l0,l0),window.removeEventListener("test",l0,l0)}catch{iv=!1}var Yo=null,sv=null,fp=null;function x6(){if(fp)return fp;var o,c=sv,h=c.length,m,y="value"in Yo?Yo.value:Yo.textContent,_=y.length;for(o=0;o<h&&c[o]===y[o];o++);var N=h-o;for(m=1;m<=N&&c[h-m]===y[_-m];m++);return fp=y.slice(o,1<m?1-m:void 0)}function hp(o){var c=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&c===13&&(o=13)):o=c,o===10&&(o=13),32<=o||o===13?o:0}function pp(){return!0}function T6(){return!1}function Mi(o){function c(h,m,y,_,N){this._reactName=h,this._targetInst=y,this.type=m,this.nativeEvent=_,this.target=N,this.currentTarget=null;for(var I in o)o.hasOwnProperty(I)&&(h=o[I],this[I]=h?h(_):_[I]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?pp:T6,this.isPropagationStopped=T6,this}return p(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=pp)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=pp)},persist:function(){},isPersistent:pp}),c}var uu={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},mp=Mi(uu),u0=p({},uu,{view:0,detail:0}),XP=Mi(u0),av,ov,c0,gp=p({},u0,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:uv,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==c0&&(c0&&o.type==="mousemove"?(av=o.screenX-c0.screenX,ov=o.screenY-c0.screenY):ov=av=0,c0=o),av)},movementY:function(o){return"movementY"in o?o.movementY:ov}}),S6=Mi(gp),QP=p({},gp,{dataTransfer:0}),ZP=Mi(QP),JP=p({},u0,{relatedTarget:0}),lv=Mi(JP),eB=p({},uu,{animationName:0,elapsedTime:0,pseudoElement:0}),tB=Mi(eB),nB=p({},uu,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),rB=Mi(nB),iB=p({},uu,{data:0}),w6=Mi(iB),sB={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},aB={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},oB={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function lB(o){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(o):(o=oB[o])?!!c[o]:!1}function uv(){return lB}var uB=p({},u0,{key:function(o){if(o.key){var c=sB[o.key]||o.key;if(c!=="Unidentified")return c}return o.type==="keypress"?(o=hp(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?aB[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:uv,charCode:function(o){return o.type==="keypress"?hp(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?hp(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),cB=Mi(uB),dB=p({},gp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),k6=Mi(dB),fB=p({},u0,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:uv}),hB=Mi(fB),pB=p({},uu,{propertyName:0,elapsedTime:0,pseudoElement:0}),mB=Mi(pB),gB=p({},gp,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),bB=Mi(gB),vB=p({},uu,{newState:0,oldState:0}),yB=Mi(vB),EB=[9,13,27,32],cv=Ua&&"CompositionEvent"in window,d0=null;Ua&&"documentMode"in document&&(d0=document.documentMode);var _B=Ua&&"TextEvent"in window&&!d0,C6=Ua&&(!cv||d0&&8<d0&&11>=d0),A6=" ",N6=!1;function O6(o,c){switch(o){case"keyup":return EB.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function M6(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var yc=!1;function xB(o,c){switch(o){case"compositionend":return M6(c);case"keypress":return c.which!==32?null:(N6=!0,A6);case"textInput":return o=c.data,o===A6&&N6?null:o;default:return null}}function TB(o,c){if(yc)return o==="compositionend"||!cv&&O6(o,c)?(o=x6(),fp=sv=Yo=null,yc=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return C6&&c.locale!=="ko"?null:c.data;default:return null}}var SB={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function R6(o){var c=o&&o.nodeName&&o.nodeName.toLowerCase();return c==="input"?!!SB[o.type]:c==="textarea"}function D6(o,c,h,m){qt?Wn?Wn.push(m):Wn=[m]:qt=m,c=sm(c,"onChange"),0<c.length&&(h=new mp("onChange","change",null,h,m),o.push({event:h,listeners:c}))}var f0=null,h0=null;function wB(o){mS(o,0)}function bp(o){var c=$o(o);if(r0(c))return o}function I6(o,c){if(o==="change")return c}var L6=!1;if(Ua){var dv;if(Ua){var fv="oninput"in document;if(!fv){var P6=document.createElement("div");P6.setAttribute("oninput","return;"),fv=typeof P6.oninput=="function"}dv=fv}else dv=!1;L6=dv&&(!document.documentMode||9<document.documentMode)}function B6(){f0&&(f0.detachEvent("onpropertychange",z6),h0=f0=null)}function z6(o){if(o.propertyName==="value"&&bp(h0)){var c=[];D6(c,h0,o,Ct(o)),dp(wB,c)}}function kB(o,c,h){o==="focusin"?(B6(),f0=c,h0=h,f0.attachEvent("onpropertychange",z6)):o==="focusout"&&B6()}function CB(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return bp(h0)}function AB(o,c){if(o==="click")return bp(c)}function NB(o,c){if(o==="input"||o==="change")return bp(c)}function OB(o,c){return o===c&&(o!==0||1/o===1/c)||o!==o&&c!==c}var Qi=typeof Object.is=="function"?Object.is:OB;function p0(o,c){if(Qi(o,c))return!0;if(typeof o!="object"||o===null||typeof c!="object"||c===null)return!1;var h=Object.keys(o),m=Object.keys(c);if(h.length!==m.length)return!1;for(m=0;m<h.length;m++){var y=h[m];if(!zt.call(c,y)||!Qi(o[y],c[y]))return!1}return!0}function U6(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function F6(o,c){var h=U6(o);o=0;for(var m;h;){if(h.nodeType===3){if(m=o+h.textContent.length,o<=c&&m>=c)return{node:h,offset:c-o};o=m}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=U6(h)}}function H6(o,c){return o&&c?o===c?!0:o&&o.nodeType===3?!1:c&&c.nodeType===3?H6(o,c.parentNode):"contains"in o?o.contains(c):o.compareDocumentPosition?!!(o.compareDocumentPosition(c)&16):!1:!1}function j6(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var c=gc(o.document);c instanceof o.HTMLIFrameElement;){try{var h=typeof c.contentWindow.location.href=="string"}catch{h=!1}if(h)o=c.contentWindow;else break;c=gc(o.document)}return c}function hv(o){var c=o&&o.nodeName&&o.nodeName.toLowerCase();return c&&(c==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||c==="textarea"||o.contentEditable==="true")}var MB=Ua&&"documentMode"in document&&11>=document.documentMode,Ec=null,pv=null,m0=null,mv=!1;function $6(o,c,h){var m=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;mv||Ec==null||Ec!==gc(m)||(m=Ec,"selectionStart"in m&&hv(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),m0&&p0(m0,m)||(m0=m,m=sm(pv,"onSelect"),0<m.length&&(c=new mp("onSelect","select",null,c,h),o.push({event:c,listeners:m}),c.target=Ec)))}function cu(o,c){var h={};return h[o.toLowerCase()]=c.toLowerCase(),h["Webkit"+o]="webkit"+c,h["Moz"+o]="moz"+c,h}var _c={animationend:cu("Animation","AnimationEnd"),animationiteration:cu("Animation","AnimationIteration"),animationstart:cu("Animation","AnimationStart"),transitionrun:cu("Transition","TransitionRun"),transitionstart:cu("Transition","TransitionStart"),transitioncancel:cu("Transition","TransitionCancel"),transitionend:cu("Transition","TransitionEnd")},gv={},q6={};Ua&&(q6=document.createElement("div").style,"AnimationEvent"in window||(delete _c.animationend.animation,delete _c.animationiteration.animation,delete _c.animationstart.animation),"TransitionEvent"in window||delete _c.transitionend.transition);function du(o){if(gv[o])return gv[o];if(!_c[o])return o;var c=_c[o],h;for(h in c)if(c.hasOwnProperty(h)&&h in q6)return gv[o]=c[h];return o}var V6=du("animationend"),G6=du("animationiteration"),Y6=du("animationstart"),RB=du("transitionrun"),DB=du("transitionstart"),IB=du("transitioncancel"),W6=du("transitionend"),K6=new Map,bv="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");bv.push("scrollEnd");function js(o,c){K6.set(o,c),Ba(c,[o])}var vp=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var c=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(c))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},vs=[],xc=0,vv=0;function yp(){for(var o=xc,c=vv=xc=0;c<o;){var h=vs[c];vs[c++]=null;var m=vs[c];vs[c++]=null;var y=vs[c];vs[c++]=null;var _=vs[c];if(vs[c++]=null,m!==null&&y!==null){var N=m.pending;N===null?y.next=y:(y.next=N.next,N.next=y),m.pending=y}_!==0&&X6(h,y,_)}}function Ep(o,c,h,m){vs[xc++]=o,vs[xc++]=c,vs[xc++]=h,vs[xc++]=m,vv|=m,o.lanes|=m,o=o.alternate,o!==null&&(o.lanes|=m)}function yv(o,c,h,m){return Ep(o,c,h,m),_p(o)}function fu(o,c){return Ep(o,null,null,c),_p(o)}function X6(o,c,h){o.lanes|=h;var m=o.alternate;m!==null&&(m.lanes|=h);for(var y=!1,_=o.return;_!==null;)_.childLanes|=h,m=_.alternate,m!==null&&(m.childLanes|=h),_.tag===22&&(o=_.stateNode,o===null||o._visibility&1||(y=!0)),o=_,_=_.return;return o.tag===3?(_=o.stateNode,y&&c!==null&&(y=31-xt(h),o=_.hiddenUpdates,m=o[y],m===null?o[y]=[c]:m.push(c),c.lane=h|536870912),_):null}function _p(o){if(50<B0)throw B0=0,Ay=null,Error(r(185));for(var c=o.return;c!==null;)o=c,c=o.return;return o.tag===3?o.stateNode:null}var Tc={};function LB(o,c,h,m){this.tag=o,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zi(o,c,h,m){return new LB(o,c,h,m)}function Ev(o){return o=o.prototype,!(!o||!o.isReactComponent)}function Fa(o,c){var h=o.alternate;return h===null?(h=Zi(o.tag,c,o.key,o.mode),h.elementType=o.elementType,h.type=o.type,h.stateNode=o.stateNode,h.alternate=o,o.alternate=h):(h.pendingProps=c,h.type=o.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=o.flags&65011712,h.childLanes=o.childLanes,h.lanes=o.lanes,h.child=o.child,h.memoizedProps=o.memoizedProps,h.memoizedState=o.memoizedState,h.updateQueue=o.updateQueue,c=o.dependencies,h.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},h.sibling=o.sibling,h.index=o.index,h.ref=o.ref,h.refCleanup=o.refCleanup,h}function Q6(o,c){o.flags&=65011714;var h=o.alternate;return h===null?(o.childLanes=0,o.lanes=c,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=h.childLanes,o.lanes=h.lanes,o.child=h.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=h.memoizedProps,o.memoizedState=h.memoizedState,o.updateQueue=h.updateQueue,o.type=h.type,c=h.dependencies,o.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),o}function xp(o,c,h,m,y,_){var N=0;if(m=o,typeof o=="function")Ev(o)&&(N=1);else if(typeof o=="string")N=Fz(o,h,Ee.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case Z:return o=Zi(31,h,c,y),o.elementType=Z,o.lanes=_,o;case E:return hu(h.children,y,_,c);case x:N=8,y|=24;break;case S:return o=Zi(12,h,c,y|2),o.elementType=S,o.lanes=_,o;case D:return o=Zi(13,h,c,y),o.elementType=D,o.lanes=_,o;case R:return o=Zi(19,h,c,y),o.elementType=R,o.lanes=_,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case O:N=10;break e;case C:N=9;break e;case L:N=11;break e;case F:N=14;break e;case G:N=16,m=null;break e}N=29,h=Error(r(130,o===null?"null":typeof o,"")),m=null}return c=Zi(N,h,c,y),c.elementType=o,c.type=m,c.lanes=_,c}function hu(o,c,h,m){return o=Zi(7,o,m,c),o.lanes=h,o}function _v(o,c,h){return o=Zi(6,o,null,c),o.lanes=h,o}function Z6(o){var c=Zi(18,null,null,0);return c.stateNode=o,c}function xv(o,c,h){return c=Zi(4,o.children!==null?o.children:[],o.key,c),c.lanes=h,c.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},c}var J6=new WeakMap;function ys(o,c){if(typeof o=="object"&&o!==null){var h=J6.get(o);return h!==void 0?h:(c={value:o,source:c,stack:wn(c)},J6.set(o,c),c)}return{value:o,source:c,stack:wn(c)}}var Sc=[],wc=0,Tp=null,g0=0,Es=[],_s=0,Wo=null,sa=1,aa="";function Ha(o,c){Sc[wc++]=g0,Sc[wc++]=Tp,Tp=o,g0=c}function eT(o,c,h){Es[_s++]=sa,Es[_s++]=aa,Es[_s++]=Wo,Wo=o;var m=sa;o=aa;var y=32-xt(m)-1;m&=~(1<<y),h+=1;var _=32-xt(c)+y;if(30<_){var N=y-y%5;_=(m&(1<<N)-1).toString(32),m>>=N,y-=N,sa=1<<32-xt(c)+y|h<<y|m,aa=_+o}else sa=1<<_|h<<y|m,aa=o}function Tv(o){o.return!==null&&(Ha(o,1),eT(o,1,0))}function Sv(o){for(;o===Tp;)Tp=Sc[--wc],Sc[wc]=null,g0=Sc[--wc],Sc[wc]=null;for(;o===Wo;)Wo=Es[--_s],Es[_s]=null,aa=Es[--_s],Es[_s]=null,sa=Es[--_s],Es[_s]=null}function tT(o,c){Es[_s++]=sa,Es[_s++]=aa,Es[_s++]=Wo,sa=c.id,aa=c.overflow,Wo=o}var Vr=null,Dn=null,Wt=!1,Ko=null,xs=!1,wv=Error(r(519));function Xo(o){var c=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw b0(ys(c,o)),wv}function nT(o){var c=o.stateNode,h=o.type,m=o.memoizedProps;switch(c[cr]=o,c[ri]=m,h){case"dialog":Ft("cancel",c),Ft("close",c);break;case"iframe":case"object":case"embed":Ft("load",c);break;case"video":case"audio":for(h=0;h<U0.length;h++)Ft(U0[h],c);break;case"source":Ft("error",c);break;case"img":case"image":case"link":Ft("error",c),Ft("load",c);break;case"details":Ft("toggle",c);break;case"input":Ft("invalid",c),lu(c,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":Ft("invalid",c);break;case"textarea":Ft("invalid",c),vc(c,m.value,m.defaultValue,m.children)}h=m.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||c.textContent===""+h||m.suppressHydrationWarning===!0||yS(c.textContent,h)?(m.popover!=null&&(Ft("beforetoggle",c),Ft("toggle",c)),m.onScroll!=null&&Ft("scroll",c),m.onScrollEnd!=null&&Ft("scrollend",c),m.onClick!=null&&(c.onclick=ze),c=!0):c=!1,c||Xo(o,!0)}function rT(o){for(Vr=o.return;Vr;)switch(Vr.tag){case 5:case 31:case 13:xs=!1;return;case 27:case 3:xs=!0;return;default:Vr=Vr.return}}function kc(o){if(o!==Vr)return!1;if(!Wt)return rT(o),Wt=!0,!1;var c=o.tag,h;if((h=c!==3&&c!==27)&&((h=c===5)&&(h=o.type,h=!(h!=="form"&&h!=="button")||$y(o.type,o.memoizedProps)),h=!h),h&&Dn&&Xo(o),rT(o),c===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));Dn=AS(o)}else if(c===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));Dn=AS(o)}else c===27?(c=Dn,cl(o.type)?(o=Wy,Wy=null,Dn=o):Dn=c):Dn=Vr?Ss(o.stateNode.nextSibling):null;return!0}function pu(){Dn=Vr=null,Wt=!1}function kv(){var o=Ko;return o!==null&&(Li===null?Li=o:Li.push.apply(Li,o),Ko=null),o}function b0(o){Ko===null?Ko=[o]:Ko.push(o)}var Cv=H(null),mu=null,ja=null;function Qo(o,c,h){P(Cv,c._currentValue),c._currentValue=h}function $a(o){o._currentValue=Cv.current,ne(Cv)}function Av(o,c,h){for(;o!==null;){var m=o.alternate;if((o.childLanes&c)!==c?(o.childLanes|=c,m!==null&&(m.childLanes|=c)):m!==null&&(m.childLanes&c)!==c&&(m.childLanes|=c),o===h)break;o=o.return}}function Nv(o,c,h,m){var y=o.child;for(y!==null&&(y.return=o);y!==null;){var _=y.dependencies;if(_!==null){var N=y.child;_=_.firstContext;e:for(;_!==null;){var I=_;_=y;for(var K=0;K<c.length;K++)if(I.context===c[K]){_.lanes|=h,I=_.alternate,I!==null&&(I.lanes|=h),Av(_.return,h,o),m||(N=null);break e}_=I.next}}else if(y.tag===18){if(N=y.return,N===null)throw Error(r(341));N.lanes|=h,_=N.alternate,_!==null&&(_.lanes|=h),Av(N,h,o),N=null}else N=y.child;if(N!==null)N.return=y;else for(N=y;N!==null;){if(N===o){N=null;break}if(y=N.sibling,y!==null){y.return=N.return,N=y;break}N=N.return}y=N}}function Cc(o,c,h,m){o=null;for(var y=c,_=!1;y!==null;){if(!_){if((y.flags&524288)!==0)_=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var N=y.alternate;if(N===null)throw Error(r(387));if(N=N.memoizedProps,N!==null){var I=y.type;Qi(y.pendingProps.value,N.value)||(o!==null?o.push(I):o=[I])}}else if(y===it.current){if(N=y.alternate,N===null)throw Error(r(387));N.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(o!==null?o.push(q0):o=[q0])}y=y.return}o!==null&&Nv(c,o,h,m),c.flags|=262144}function Sp(o){for(o=o.firstContext;o!==null;){if(!Qi(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function gu(o){mu=o,ja=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function Gr(o){return iT(mu,o)}function wp(o,c){return mu===null&&gu(o),iT(o,c)}function iT(o,c){var h=c._currentValue;if(c={context:c,memoizedValue:h,next:null},ja===null){if(o===null)throw Error(r(308));ja=c,o.dependencies={lanes:0,firstContext:c},o.flags|=524288}else ja=ja.next=c;return h}var PB=typeof AbortController<"u"?AbortController:function(){var o=[],c=this.signal={aborted:!1,addEventListener:function(h,m){o.push(m)}};this.abort=function(){c.aborted=!0,o.forEach(function(h){return h()})}},BB=t.unstable_scheduleCallback,zB=t.unstable_NormalPriority,yr={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ov(){return{controller:new PB,data:new Map,refCount:0}}function v0(o){o.refCount--,o.refCount===0&&BB(zB,function(){o.controller.abort()})}var y0=null,Mv=0,Ac=0,Nc=null;function UB(o,c){if(y0===null){var h=y0=[];Mv=0,Ac=Iy(),Nc={status:"pending",value:void 0,then:function(m){h.push(m)}}}return Mv++,c.then(sT,sT),c}function sT(){if(--Mv===0&&y0!==null){Nc!==null&&(Nc.status="fulfilled");var o=y0;y0=null,Ac=0,Nc=null;for(var c=0;c<o.length;c++)(0,o[c])()}}function FB(o,c){var h=[],m={status:"pending",value:null,reason:null,then:function(y){h.push(y)}};return o.then(function(){m.status="fulfilled",m.value=c;for(var y=0;y<h.length;y++)(0,h[y])(c)},function(y){for(m.status="rejected",m.reason=y,y=0;y<h.length;y++)(0,h[y])(void 0)}),m}var aT=X.S;X.S=function(o,c){$5=fn(),typeof c=="object"&&c!==null&&typeof c.then=="function"&&UB(o,c),aT!==null&&aT(o,c)};var bu=H(null);function Rv(){var o=bu.current;return o!==null?o:En.pooledCache}function kp(o,c){c===null?P(bu,bu.current):P(bu,c.pool)}function oT(){var o=Rv();return o===null?null:{parent:yr._currentValue,pool:o}}var Oc=Error(r(460)),Dv=Error(r(474)),Cp=Error(r(542)),Ap={then:function(){}};function lT(o){return o=o.status,o==="fulfilled"||o==="rejected"}function uT(o,c,h){switch(h=o[h],h===void 0?o.push(c):h!==c&&(c.then(ze,ze),c=h),c.status){case"fulfilled":return c.value;case"rejected":throw o=c.reason,dT(o),o;default:if(typeof c.status=="string")c.then(ze,ze);else{if(o=En,o!==null&&100<o.shellSuspendCounter)throw Error(r(482));o=c,o.status="pending",o.then(function(m){if(c.status==="pending"){var y=c;y.status="fulfilled",y.value=m}},function(m){if(c.status==="pending"){var y=c;y.status="rejected",y.reason=m}})}switch(c.status){case"fulfilled":return c.value;case"rejected":throw o=c.reason,dT(o),o}throw yu=c,Oc}}function vu(o){try{var c=o._init;return c(o._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(yu=h,Oc):h}}var yu=null;function cT(){if(yu===null)throw Error(r(459));var o=yu;return yu=null,o}function dT(o){if(o===Oc||o===Cp)throw Error(r(483))}var Mc=null,E0=0;function Np(o){var c=E0;return E0+=1,Mc===null&&(Mc=[]),uT(Mc,o,c)}function _0(o,c){c=c.props.ref,o.ref=c!==void 0?c:null}function Op(o,c){throw c.$$typeof===g?Error(r(525)):(o=Object.prototype.toString.call(c),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":o)))}function fT(o){function c(ae,J){if(o){var de=ae.deletions;de===null?(ae.deletions=[J],ae.flags|=16):de.push(J)}}function h(ae,J){if(!o)return null;for(;J!==null;)c(ae,J),J=J.sibling;return null}function m(ae){for(var J=new Map;ae!==null;)ae.key!==null?J.set(ae.key,ae):J.set(ae.index,ae),ae=ae.sibling;return J}function y(ae,J){return ae=Fa(ae,J),ae.index=0,ae.sibling=null,ae}function _(ae,J,de){return ae.index=de,o?(de=ae.alternate,de!==null?(de=de.index,de<J?(ae.flags|=67108866,J):de):(ae.flags|=67108866,J)):(ae.flags|=1048576,J)}function N(ae){return o&&ae.alternate===null&&(ae.flags|=67108866),ae}function I(ae,J,de,xe){return J===null||J.tag!==6?(J=_v(de,ae.mode,xe),J.return=ae,J):(J=y(J,de),J.return=ae,J)}function K(ae,J,de,xe){var ut=de.type;return ut===E?ye(ae,J,de.props.children,xe,de.key):J!==null&&(J.elementType===ut||typeof ut=="object"&&ut!==null&&ut.$$typeof===G&&vu(ut)===J.type)?(J=y(J,de.props),_0(J,de),J.return=ae,J):(J=xp(de.type,de.key,de.props,null,ae.mode,xe),_0(J,de),J.return=ae,J)}function he(ae,J,de,xe){return J===null||J.tag!==4||J.stateNode.containerInfo!==de.containerInfo||J.stateNode.implementation!==de.implementation?(J=xv(de,ae.mode,xe),J.return=ae,J):(J=y(J,de.children||[]),J.return=ae,J)}function ye(ae,J,de,xe,ut){return J===null||J.tag!==7?(J=hu(de,ae.mode,xe,ut),J.return=ae,J):(J=y(J,de),J.return=ae,J)}function Se(ae,J,de){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return J=_v(""+J,ae.mode,de),J.return=ae,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case b:return de=xp(J.type,J.key,J.props,null,ae.mode,de),_0(de,J),de.return=ae,de;case v:return J=xv(J,ae.mode,de),J.return=ae,J;case G:return J=vu(J),Se(ae,J,de)}if(re(J)||se(J))return J=hu(J,ae.mode,de,null),J.return=ae,J;if(typeof J.then=="function")return Se(ae,Np(J),de);if(J.$$typeof===O)return Se(ae,wp(ae,J),de);Op(ae,J)}return null}function pe(ae,J,de,xe){var ut=J!==null?J.key:null;if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return ut!==null?null:I(ae,J,""+de,xe);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case b:return de.key===ut?K(ae,J,de,xe):null;case v:return de.key===ut?he(ae,J,de,xe):null;case G:return de=vu(de),pe(ae,J,de,xe)}if(re(de)||se(de))return ut!==null?null:ye(ae,J,de,xe,null);if(typeof de.then=="function")return pe(ae,J,Np(de),xe);if(de.$$typeof===O)return pe(ae,J,wp(ae,de),xe);Op(ae,de)}return null}function me(ae,J,de,xe,ut){if(typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint")return ae=ae.get(de)||null,I(J,ae,""+xe,ut);if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case b:return ae=ae.get(xe.key===null?de:xe.key)||null,K(J,ae,xe,ut);case v:return ae=ae.get(xe.key===null?de:xe.key)||null,he(J,ae,xe,ut);case G:return xe=vu(xe),me(ae,J,de,xe,ut)}if(re(xe)||se(xe))return ae=ae.get(de)||null,ye(J,ae,xe,ut,null);if(typeof xe.then=="function")return me(ae,J,de,Np(xe),ut);if(xe.$$typeof===O)return me(ae,J,de,wp(J,xe),ut);Op(J,xe)}return null}function Ze(ae,J,de,xe){for(var ut=null,Zt=null,nt=J,Ot=J=0,Gt=null;nt!==null&&Ot<de.length;Ot++){nt.index>Ot?(Gt=nt,nt=null):Gt=nt.sibling;var Jt=pe(ae,nt,de[Ot],xe);if(Jt===null){nt===null&&(nt=Gt);break}o&&nt&&Jt.alternate===null&&c(ae,nt),J=_(Jt,J,Ot),Zt===null?ut=Jt:Zt.sibling=Jt,Zt=Jt,nt=Gt}if(Ot===de.length)return h(ae,nt),Wt&&Ha(ae,Ot),ut;if(nt===null){for(;Ot<de.length;Ot++)nt=Se(ae,de[Ot],xe),nt!==null&&(J=_(nt,J,Ot),Zt===null?ut=nt:Zt.sibling=nt,Zt=nt);return Wt&&Ha(ae,Ot),ut}for(nt=m(nt);Ot<de.length;Ot++)Gt=me(nt,ae,Ot,de[Ot],xe),Gt!==null&&(o&&Gt.alternate!==null&&nt.delete(Gt.key===null?Ot:Gt.key),J=_(Gt,J,Ot),Zt===null?ut=Gt:Zt.sibling=Gt,Zt=Gt);return o&&nt.forEach(function(ml){return c(ae,ml)}),Wt&&Ha(ae,Ot),ut}function ht(ae,J,de,xe){if(de==null)throw Error(r(151));for(var ut=null,Zt=null,nt=J,Ot=J=0,Gt=null,Jt=de.next();nt!==null&&!Jt.done;Ot++,Jt=de.next()){nt.index>Ot?(Gt=nt,nt=null):Gt=nt.sibling;var ml=pe(ae,nt,Jt.value,xe);if(ml===null){nt===null&&(nt=Gt);break}o&&nt&&ml.alternate===null&&c(ae,nt),J=_(ml,J,Ot),Zt===null?ut=ml:Zt.sibling=ml,Zt=ml,nt=Gt}if(Jt.done)return h(ae,nt),Wt&&Ha(ae,Ot),ut;if(nt===null){for(;!Jt.done;Ot++,Jt=de.next())Jt=Se(ae,Jt.value,xe),Jt!==null&&(J=_(Jt,J,Ot),Zt===null?ut=Jt:Zt.sibling=Jt,Zt=Jt);return Wt&&Ha(ae,Ot),ut}for(nt=m(nt);!Jt.done;Ot++,Jt=de.next())Jt=me(nt,ae,Ot,Jt.value,xe),Jt!==null&&(o&&Jt.alternate!==null&&nt.delete(Jt.key===null?Ot:Jt.key),J=_(Jt,J,Ot),Zt===null?ut=Jt:Zt.sibling=Jt,Zt=Jt);return o&&nt.forEach(function(Qz){return c(ae,Qz)}),Wt&&Ha(ae,Ot),ut}function gn(ae,J,de,xe){if(typeof de=="object"&&de!==null&&de.type===E&&de.key===null&&(de=de.props.children),typeof de=="object"&&de!==null){switch(de.$$typeof){case b:e:{for(var ut=de.key;J!==null;){if(J.key===ut){if(ut=de.type,ut===E){if(J.tag===7){h(ae,J.sibling),xe=y(J,de.props.children),xe.return=ae,ae=xe;break e}}else if(J.elementType===ut||typeof ut=="object"&&ut!==null&&ut.$$typeof===G&&vu(ut)===J.type){h(ae,J.sibling),xe=y(J,de.props),_0(xe,de),xe.return=ae,ae=xe;break e}h(ae,J);break}else c(ae,J);J=J.sibling}de.type===E?(xe=hu(de.props.children,ae.mode,xe,de.key),xe.return=ae,ae=xe):(xe=xp(de.type,de.key,de.props,null,ae.mode,xe),_0(xe,de),xe.return=ae,ae=xe)}return N(ae);case v:e:{for(ut=de.key;J!==null;){if(J.key===ut)if(J.tag===4&&J.stateNode.containerInfo===de.containerInfo&&J.stateNode.implementation===de.implementation){h(ae,J.sibling),xe=y(J,de.children||[]),xe.return=ae,ae=xe;break e}else{h(ae,J);break}else c(ae,J);J=J.sibling}xe=xv(de,ae.mode,xe),xe.return=ae,ae=xe}return N(ae);case G:return de=vu(de),gn(ae,J,de,xe)}if(re(de))return Ze(ae,J,de,xe);if(se(de)){if(ut=se(de),typeof ut!="function")throw Error(r(150));return de=ut.call(de),ht(ae,J,de,xe)}if(typeof de.then=="function")return gn(ae,J,Np(de),xe);if(de.$$typeof===O)return gn(ae,J,wp(ae,de),xe);Op(ae,de)}return typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint"?(de=""+de,J!==null&&J.tag===6?(h(ae,J.sibling),xe=y(J,de),xe.return=ae,ae=xe):(h(ae,J),xe=_v(de,ae.mode,xe),xe.return=ae,ae=xe),N(ae)):h(ae,J)}return function(ae,J,de,xe){try{E0=0;var ut=gn(ae,J,de,xe);return Mc=null,ut}catch(nt){if(nt===Oc||nt===Cp)throw nt;var Zt=Zi(29,nt,null,ae.mode);return Zt.lanes=xe,Zt.return=ae,Zt}finally{}}}var Eu=fT(!0),hT=fT(!1),Zo=!1;function Iv(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Lv(o,c){o=o.updateQueue,c.updateQueue===o&&(c.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function Jo(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function el(o,c,h){var m=o.updateQueue;if(m===null)return null;if(m=m.shared,(tn&2)!==0){var y=m.pending;return y===null?c.next=c:(c.next=y.next,y.next=c),m.pending=c,c=_p(o),X6(o,null,h),c}return Ep(o,m,c,h),_p(o)}function x0(o,c,h){if(c=c.updateQueue,c!==null&&(c=c.shared,(h&4194048)!==0)){var m=c.lanes;m&=o.pendingLanes,h|=m,c.lanes=h,bt(o,h)}}function Pv(o,c){var h=o.updateQueue,m=o.alternate;if(m!==null&&(m=m.updateQueue,h===m)){var y=null,_=null;if(h=h.firstBaseUpdate,h!==null){do{var N={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};_===null?y=_=N:_=_.next=N,h=h.next}while(h!==null);_===null?y=_=c:_=_.next=c}else y=_=c;h={baseState:m.baseState,firstBaseUpdate:y,lastBaseUpdate:_,shared:m.shared,callbacks:m.callbacks},o.updateQueue=h;return}o=h.lastBaseUpdate,o===null?h.firstBaseUpdate=c:o.next=c,h.lastBaseUpdate=c}var Bv=!1;function T0(){if(Bv){var o=Nc;if(o!==null)throw o}}function S0(o,c,h,m){Bv=!1;var y=o.updateQueue;Zo=!1;var _=y.firstBaseUpdate,N=y.lastBaseUpdate,I=y.shared.pending;if(I!==null){y.shared.pending=null;var K=I,he=K.next;K.next=null,N===null?_=he:N.next=he,N=K;var ye=o.alternate;ye!==null&&(ye=ye.updateQueue,I=ye.lastBaseUpdate,I!==N&&(I===null?ye.firstBaseUpdate=he:I.next=he,ye.lastBaseUpdate=K))}if(_!==null){var Se=y.baseState;N=0,ye=he=K=null,I=_;do{var pe=I.lane&-536870913,me=pe!==I.lane;if(me?(Vt&pe)===pe:(m&pe)===pe){pe!==0&&pe===Ac&&(Bv=!0),ye!==null&&(ye=ye.next={lane:0,tag:I.tag,payload:I.payload,callback:null,next:null});e:{var Ze=o,ht=I;pe=c;var gn=h;switch(ht.tag){case 1:if(Ze=ht.payload,typeof Ze=="function"){Se=Ze.call(gn,Se,pe);break e}Se=Ze;break e;case 3:Ze.flags=Ze.flags&-65537|128;case 0:if(Ze=ht.payload,pe=typeof Ze=="function"?Ze.call(gn,Se,pe):Ze,pe==null)break e;Se=p({},Se,pe);break e;case 2:Zo=!0}}pe=I.callback,pe!==null&&(o.flags|=64,me&&(o.flags|=8192),me=y.callbacks,me===null?y.callbacks=[pe]:me.push(pe))}else me={lane:pe,tag:I.tag,payload:I.payload,callback:I.callback,next:null},ye===null?(he=ye=me,K=Se):ye=ye.next=me,N|=pe;if(I=I.next,I===null){if(I=y.shared.pending,I===null)break;me=I,I=me.next,me.next=null,y.lastBaseUpdate=me,y.shared.pending=null}}while(!0);ye===null&&(K=Se),y.baseState=K,y.firstBaseUpdate=he,y.lastBaseUpdate=ye,_===null&&(y.shared.lanes=0),sl|=N,o.lanes=N,o.memoizedState=Se}}function pT(o,c){if(typeof o!="function")throw Error(r(191,o));o.call(c)}function mT(o,c){var h=o.callbacks;if(h!==null)for(o.callbacks=null,o=0;o<h.length;o++)pT(h[o],c)}var Rc=H(null),Mp=H(0);function gT(o,c){o=Za,P(Mp,o),P(Rc,c),Za=o|c.baseLanes}function zv(){P(Mp,Za),P(Rc,Rc.current)}function Uv(){Za=Mp.current,ne(Rc),ne(Mp)}var Ji=H(null),Ts=null;function tl(o){var c=o.alternate;P(fr,fr.current&1),P(Ji,o),Ts===null&&(c===null||Rc.current!==null||c.memoizedState!==null)&&(Ts=o)}function Fv(o){P(fr,fr.current),P(Ji,o),Ts===null&&(Ts=o)}function bT(o){o.tag===22?(P(fr,fr.current),P(Ji,o),Ts===null&&(Ts=o)):nl()}function nl(){P(fr,fr.current),P(Ji,Ji.current)}function es(o){ne(Ji),Ts===o&&(Ts=null),ne(fr)}var fr=H(0);function Rp(o){for(var c=o;c!==null;){if(c.tag===13){var h=c.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||Gy(h)||Yy(h)))return c}else if(c.tag===19&&(c.memoizedProps.revealOrder==="forwards"||c.memoizedProps.revealOrder==="backwards"||c.memoizedProps.revealOrder==="unstable_legacy-backwards"||c.memoizedProps.revealOrder==="together")){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===o)break;for(;c.sibling===null;){if(c.return===null||c.return===o)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var qa=0,Nt=null,pn=null,Er=null,Dp=!1,Dc=!1,_u=!1,Ip=0,w0=0,Ic=null,HB=0;function tr(){throw Error(r(321))}function Hv(o,c){if(c===null)return!1;for(var h=0;h<c.length&&h<o.length;h++)if(!Qi(o[h],c[h]))return!1;return!0}function jv(o,c,h,m,y,_){return qa=_,Nt=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,X.H=o===null||o.memoizedState===null?e5:ry,_u=!1,_=h(m,y),_u=!1,Dc&&(_=yT(c,h,m,y)),vT(o),_}function vT(o){X.H=A0;var c=pn!==null&&pn.next!==null;if(qa=0,Er=pn=Nt=null,Dp=!1,w0=0,Ic=null,c)throw Error(r(300));o===null||_r||(o=o.dependencies,o!==null&&Sp(o)&&(_r=!0))}function yT(o,c,h,m){Nt=o;var y=0;do{if(Dc&&(Ic=null),w0=0,Dc=!1,25<=y)throw Error(r(301));if(y+=1,Er=pn=null,o.updateQueue!=null){var _=o.updateQueue;_.lastEffect=null,_.events=null,_.stores=null,_.memoCache!=null&&(_.memoCache.index=0)}X.H=t5,_=c(h,m)}while(Dc);return _}function jB(){var o=X.H,c=o.useState()[0];return c=typeof c.then=="function"?k0(c):c,o=o.useState()[0],(pn!==null?pn.memoizedState:null)!==o&&(Nt.flags|=1024),c}function $v(){var o=Ip!==0;return Ip=0,o}function qv(o,c,h){c.updateQueue=o.updateQueue,c.flags&=-2053,o.lanes&=~h}function Vv(o){if(Dp){for(o=o.memoizedState;o!==null;){var c=o.queue;c!==null&&(c.pending=null),o=o.next}Dp=!1}qa=0,Er=pn=Nt=null,Dc=!1,w0=Ip=0,Ic=null}function mi(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Er===null?Nt.memoizedState=Er=o:Er=Er.next=o,Er}function hr(){if(pn===null){var o=Nt.alternate;o=o!==null?o.memoizedState:null}else o=pn.next;var c=Er===null?Nt.memoizedState:Er.next;if(c!==null)Er=c,pn=o;else{if(o===null)throw Nt.alternate===null?Error(r(467)):Error(r(310));pn=o,o={memoizedState:pn.memoizedState,baseState:pn.baseState,baseQueue:pn.baseQueue,queue:pn.queue,next:null},Er===null?Nt.memoizedState=Er=o:Er=Er.next=o}return Er}function Lp(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function k0(o){var c=w0;return w0+=1,Ic===null&&(Ic=[]),o=uT(Ic,o,c),c=Nt,(Er===null?c.memoizedState:Er.next)===null&&(c=c.alternate,X.H=c===null||c.memoizedState===null?e5:ry),o}function Pp(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return k0(o);if(o.$$typeof===O)return Gr(o)}throw Error(r(438,String(o)))}function Gv(o){var c=null,h=Nt.updateQueue;if(h!==null&&(c=h.memoCache),c==null){var m=Nt.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(c={data:m.data.map(function(y){return y.slice()}),index:0})))}if(c==null&&(c={data:[],index:0}),h===null&&(h=Lp(),Nt.updateQueue=h),h.memoCache=c,h=c.data[c.index],h===void 0)for(h=c.data[c.index]=Array(o),m=0;m<o;m++)h[m]=q;return c.index++,h}function Va(o,c){return typeof c=="function"?c(o):c}function Bp(o){var c=hr();return Yv(c,pn,o)}function Yv(o,c,h){var m=o.queue;if(m===null)throw Error(r(311));m.lastRenderedReducer=h;var y=o.baseQueue,_=m.pending;if(_!==null){if(y!==null){var N=y.next;y.next=_.next,_.next=N}c.baseQueue=y=_,m.pending=null}if(_=o.baseState,y===null)o.memoizedState=_;else{c=y.next;var I=N=null,K=null,he=c,ye=!1;do{var Se=he.lane&-536870913;if(Se!==he.lane?(Vt&Se)===Se:(qa&Se)===Se){var pe=he.revertLane;if(pe===0)K!==null&&(K=K.next={lane:0,revertLane:0,gesture:null,action:he.action,hasEagerState:he.hasEagerState,eagerState:he.eagerState,next:null}),Se===Ac&&(ye=!0);else if((qa&pe)===pe){he=he.next,pe===Ac&&(ye=!0);continue}else Se={lane:0,revertLane:he.revertLane,gesture:null,action:he.action,hasEagerState:he.hasEagerState,eagerState:he.eagerState,next:null},K===null?(I=K=Se,N=_):K=K.next=Se,Nt.lanes|=pe,sl|=pe;Se=he.action,_u&&h(_,Se),_=he.hasEagerState?he.eagerState:h(_,Se)}else pe={lane:Se,revertLane:he.revertLane,gesture:he.gesture,action:he.action,hasEagerState:he.hasEagerState,eagerState:he.eagerState,next:null},K===null?(I=K=pe,N=_):K=K.next=pe,Nt.lanes|=Se,sl|=Se;he=he.next}while(he!==null&&he!==c);if(K===null?N=_:K.next=I,!Qi(_,o.memoizedState)&&(_r=!0,ye&&(h=Nc,h!==null)))throw h;o.memoizedState=_,o.baseState=N,o.baseQueue=K,m.lastRenderedState=_}return y===null&&(m.lanes=0),[o.memoizedState,m.dispatch]}function Wv(o){var c=hr(),h=c.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=o;var m=h.dispatch,y=h.pending,_=c.memoizedState;if(y!==null){h.pending=null;var N=y=y.next;do _=o(_,N.action),N=N.next;while(N!==y);Qi(_,c.memoizedState)||(_r=!0),c.memoizedState=_,c.baseQueue===null&&(c.baseState=_),h.lastRenderedState=_}return[_,m]}function ET(o,c,h){var m=Nt,y=hr(),_=Wt;if(_){if(h===void 0)throw Error(r(407));h=h()}else h=c();var N=!Qi((pn||y).memoizedState,h);if(N&&(y.memoizedState=h,_r=!0),y=y.queue,Qv(TT.bind(null,m,y,o),[o]),y.getSnapshot!==c||N||Er!==null&&Er.memoizedState.tag&1){if(m.flags|=2048,Lc(9,{destroy:void 0},xT.bind(null,m,y,h,c),null),En===null)throw Error(r(349));_||(qa&127)!==0||_T(m,c,h)}return h}function _T(o,c,h){o.flags|=16384,o={getSnapshot:c,value:h},c=Nt.updateQueue,c===null?(c=Lp(),Nt.updateQueue=c,c.stores=[o]):(h=c.stores,h===null?c.stores=[o]:h.push(o))}function xT(o,c,h,m){c.value=h,c.getSnapshot=m,ST(c)&&wT(o)}function TT(o,c,h){return h(function(){ST(c)&&wT(o)})}function ST(o){var c=o.getSnapshot;o=o.value;try{var h=c();return!Qi(o,h)}catch{return!0}}function wT(o){var c=fu(o,2);c!==null&&Pi(c,o,2)}function Kv(o){var c=mi();if(typeof o=="function"){var h=o;if(o=h(),_u){er(!0);try{h()}finally{er(!1)}}}return c.memoizedState=c.baseState=o,c.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Va,lastRenderedState:o},c}function kT(o,c,h,m){return o.baseState=h,Yv(o,pn,typeof m=="function"?m:Va)}function $B(o,c,h,m,y){if(Fp(o))throw Error(r(485));if(o=c.action,o!==null){var _={payload:y,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){_.listeners.push(N)}};X.T!==null?h(!0):_.isTransition=!1,m(_),h=c.pending,h===null?(_.next=c.pending=_,CT(c,_)):(_.next=h.next,c.pending=h.next=_)}}function CT(o,c){var h=c.action,m=c.payload,y=o.state;if(c.isTransition){var _=X.T,N={};X.T=N;try{var I=h(y,m),K=X.S;K!==null&&K(N,I),AT(o,c,I)}catch(he){Xv(o,c,he)}finally{_!==null&&N.types!==null&&(_.types=N.types),X.T=_}}else try{_=h(y,m),AT(o,c,_)}catch(he){Xv(o,c,he)}}function AT(o,c,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(m){NT(o,c,m)},function(m){return Xv(o,c,m)}):NT(o,c,h)}function NT(o,c,h){c.status="fulfilled",c.value=h,OT(c),o.state=h,c=o.pending,c!==null&&(h=c.next,h===c?o.pending=null:(h=h.next,c.next=h,CT(o,h)))}function Xv(o,c,h){var m=o.pending;if(o.pending=null,m!==null){m=m.next;do c.status="rejected",c.reason=h,OT(c),c=c.next;while(c!==m)}o.action=null}function OT(o){o=o.listeners;for(var c=0;c<o.length;c++)(0,o[c])()}function MT(o,c){return c}function RT(o,c){if(Wt){var h=En.formState;if(h!==null){e:{var m=Nt;if(Wt){if(Dn){t:{for(var y=Dn,_=xs;y.nodeType!==8;){if(!_){y=null;break t}if(y=Ss(y.nextSibling),y===null){y=null;break t}}_=y.data,y=_==="F!"||_==="F"?y:null}if(y){Dn=Ss(y.nextSibling),m=y.data==="F!";break e}}Xo(m)}m=!1}m&&(c=h[0])}}return h=mi(),h.memoizedState=h.baseState=c,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:MT,lastRenderedState:c},h.queue=m,h=QT.bind(null,Nt,m),m.dispatch=h,m=Kv(!1),_=ny.bind(null,Nt,!1,m.queue),m=mi(),y={state:c,dispatch:null,action:o,pending:null},m.queue=y,h=$B.bind(null,Nt,y,_,h),y.dispatch=h,m.memoizedState=o,[c,h,!1]}function DT(o){var c=hr();return IT(c,pn,o)}function IT(o,c,h){if(c=Yv(o,c,MT)[0],o=Bp(Va)[0],typeof c=="object"&&c!==null&&typeof c.then=="function")try{var m=k0(c)}catch(N){throw N===Oc?Cp:N}else m=c;c=hr();var y=c.queue,_=y.dispatch;return h!==c.memoizedState&&(Nt.flags|=2048,Lc(9,{destroy:void 0},qB.bind(null,y,h),null)),[m,_,o]}function qB(o,c){o.action=c}function LT(o){var c=hr(),h=pn;if(h!==null)return IT(c,h,o);hr(),c=c.memoizedState,h=hr();var m=h.queue.dispatch;return h.memoizedState=o,[c,m,!1]}function Lc(o,c,h,m){return o={tag:o,create:h,deps:m,inst:c,next:null},c=Nt.updateQueue,c===null&&(c=Lp(),Nt.updateQueue=c),h=c.lastEffect,h===null?c.lastEffect=o.next=o:(m=h.next,h.next=o,o.next=m,c.lastEffect=o),o}function PT(){return hr().memoizedState}function zp(o,c,h,m){var y=mi();Nt.flags|=o,y.memoizedState=Lc(1|c,{destroy:void 0},h,m===void 0?null:m)}function Up(o,c,h,m){var y=hr();m=m===void 0?null:m;var _=y.memoizedState.inst;pn!==null&&m!==null&&Hv(m,pn.memoizedState.deps)?y.memoizedState=Lc(c,_,h,m):(Nt.flags|=o,y.memoizedState=Lc(1|c,_,h,m))}function BT(o,c){zp(8390656,8,o,c)}function Qv(o,c){Up(2048,8,o,c)}function VB(o){Nt.flags|=4;var c=Nt.updateQueue;if(c===null)c=Lp(),Nt.updateQueue=c,c.events=[o];else{var h=c.events;h===null?c.events=[o]:h.push(o)}}function zT(o){var c=hr().memoizedState;return VB({ref:c,nextImpl:o}),function(){if((tn&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}function UT(o,c){return Up(4,2,o,c)}function FT(o,c){return Up(4,4,o,c)}function HT(o,c){if(typeof c=="function"){o=o();var h=c(o);return function(){typeof h=="function"?h():c(null)}}if(c!=null)return o=o(),c.current=o,function(){c.current=null}}function jT(o,c,h){h=h!=null?h.concat([o]):null,Up(4,4,HT.bind(null,c,o),h)}function Zv(){}function $T(o,c){var h=hr();c=c===void 0?null:c;var m=h.memoizedState;return c!==null&&Hv(c,m[1])?m[0]:(h.memoizedState=[o,c],o)}function qT(o,c){var h=hr();c=c===void 0?null:c;var m=h.memoizedState;if(c!==null&&Hv(c,m[1]))return m[0];if(m=o(),_u){er(!0);try{o()}finally{er(!1)}}return h.memoizedState=[m,c],m}function Jv(o,c,h){return h===void 0||(qa&1073741824)!==0&&(Vt&261930)===0?o.memoizedState=c:(o.memoizedState=h,o=V5(),Nt.lanes|=o,sl|=o,h)}function VT(o,c,h,m){return Qi(h,c)?h:Rc.current!==null?(o=Jv(o,h,m),Qi(o,c)||(_r=!0),o):(qa&42)===0||(qa&1073741824)!==0&&(Vt&261930)===0?(_r=!0,o.memoizedState=h):(o=V5(),Nt.lanes|=o,sl|=o,c)}function GT(o,c,h,m,y){var _=ee.p;ee.p=_!==0&&8>_?_:8;var N=X.T,I={};X.T=I,ny(o,!1,c,h);try{var K=y(),he=X.S;if(he!==null&&he(I,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var ye=FB(K,m);C0(o,c,ye,rs(o))}else C0(o,c,m,rs(o))}catch(Se){C0(o,c,{then:function(){},status:"rejected",reason:Se},rs())}finally{ee.p=_,N!==null&&I.types!==null&&(N.types=I.types),X.T=N}}function GB(){}function ey(o,c,h,m){if(o.tag!==5)throw Error(r(476));var y=YT(o).queue;GT(o,y,c,ce,h===null?GB:function(){return WT(o),h(m)})}function YT(o){var c=o.memoizedState;if(c!==null)return c;c={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Va,lastRenderedState:ce},next:null};var h={};return c.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Va,lastRenderedState:h},next:null},o.memoizedState=c,o=o.alternate,o!==null&&(o.memoizedState=c),c}function WT(o){var c=YT(o);c.next===null&&(c=o.alternate.memoizedState),C0(o,c.next.queue,{},rs())}function ty(){return Gr(q0)}function KT(){return hr().memoizedState}function XT(){return hr().memoizedState}function YB(o){for(var c=o.return;c!==null;){switch(c.tag){case 24:case 3:var h=rs();o=Jo(h);var m=el(c,o,h);m!==null&&(Pi(m,c,h),x0(m,c,h)),c={cache:Ov()},o.payload=c;return}c=c.return}}function WB(o,c,h){var m=rs();h={lane:m,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Fp(o)?ZT(c,h):(h=yv(o,c,h,m),h!==null&&(Pi(h,o,m),JT(h,c,m)))}function QT(o,c,h){var m=rs();C0(o,c,h,m)}function C0(o,c,h,m){var y={lane:m,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(Fp(o))ZT(c,y);else{var _=o.alternate;if(o.lanes===0&&(_===null||_.lanes===0)&&(_=c.lastRenderedReducer,_!==null))try{var N=c.lastRenderedState,I=_(N,h);if(y.hasEagerState=!0,y.eagerState=I,Qi(I,N))return Ep(o,c,y,0),En===null&&yp(),!1}catch{}finally{}if(h=yv(o,c,y,m),h!==null)return Pi(h,o,m),JT(h,c,m),!0}return!1}function ny(o,c,h,m){if(m={lane:2,revertLane:Iy(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},Fp(o)){if(c)throw Error(r(479))}else c=yv(o,h,m,2),c!==null&&Pi(c,o,2)}function Fp(o){var c=o.alternate;return o===Nt||c!==null&&c===Nt}function ZT(o,c){Dc=Dp=!0;var h=o.pending;h===null?c.next=c:(c.next=h.next,h.next=c),o.pending=c}function JT(o,c,h){if((h&4194048)!==0){var m=c.lanes;m&=o.pendingLanes,h|=m,c.lanes=h,bt(o,h)}}var A0={readContext:Gr,use:Pp,useCallback:tr,useContext:tr,useEffect:tr,useImperativeHandle:tr,useLayoutEffect:tr,useInsertionEffect:tr,useMemo:tr,useReducer:tr,useRef:tr,useState:tr,useDebugValue:tr,useDeferredValue:tr,useTransition:tr,useSyncExternalStore:tr,useId:tr,useHostTransitionStatus:tr,useFormState:tr,useActionState:tr,useOptimistic:tr,useMemoCache:tr,useCacheRefresh:tr};A0.useEffectEvent=tr;var e5={readContext:Gr,use:Pp,useCallback:function(o,c){return mi().memoizedState=[o,c===void 0?null:c],o},useContext:Gr,useEffect:BT,useImperativeHandle:function(o,c,h){h=h!=null?h.concat([o]):null,zp(4194308,4,HT.bind(null,c,o),h)},useLayoutEffect:function(o,c){return zp(4194308,4,o,c)},useInsertionEffect:function(o,c){zp(4,2,o,c)},useMemo:function(o,c){var h=mi();c=c===void 0?null:c;var m=o();if(_u){er(!0);try{o()}finally{er(!1)}}return h.memoizedState=[m,c],m},useReducer:function(o,c,h){var m=mi();if(h!==void 0){var y=h(c);if(_u){er(!0);try{h(c)}finally{er(!1)}}}else y=c;return m.memoizedState=m.baseState=y,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:y},m.queue=o,o=o.dispatch=WB.bind(null,Nt,o),[m.memoizedState,o]},useRef:function(o){var c=mi();return o={current:o},c.memoizedState=o},useState:function(o){o=Kv(o);var c=o.queue,h=QT.bind(null,Nt,c);return c.dispatch=h,[o.memoizedState,h]},useDebugValue:Zv,useDeferredValue:function(o,c){var h=mi();return Jv(h,o,c)},useTransition:function(){var o=Kv(!1);return o=GT.bind(null,Nt,o.queue,!0,!1),mi().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,c,h){var m=Nt,y=mi();if(Wt){if(h===void 0)throw Error(r(407));h=h()}else{if(h=c(),En===null)throw Error(r(349));(Vt&127)!==0||_T(m,c,h)}y.memoizedState=h;var _={value:h,getSnapshot:c};return y.queue=_,BT(TT.bind(null,m,_,o),[o]),m.flags|=2048,Lc(9,{destroy:void 0},xT.bind(null,m,_,h,c),null),h},useId:function(){var o=mi(),c=En.identifierPrefix;if(Wt){var h=aa,m=sa;h=(m&~(1<<32-xt(m)-1)).toString(32)+h,c="_"+c+"R_"+h,h=Ip++,0<h&&(c+="H"+h.toString(32)),c+="_"}else h=HB++,c="_"+c+"r_"+h.toString(32)+"_";return o.memoizedState=c},useHostTransitionStatus:ty,useFormState:RT,useActionState:RT,useOptimistic:function(o){var c=mi();c.memoizedState=c.baseState=o;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return c.queue=h,c=ny.bind(null,Nt,!0,h),h.dispatch=c,[o,c]},useMemoCache:Gv,useCacheRefresh:function(){return mi().memoizedState=YB.bind(null,Nt)},useEffectEvent:function(o){var c=mi(),h={impl:o};return c.memoizedState=h,function(){if((tn&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},ry={readContext:Gr,use:Pp,useCallback:$T,useContext:Gr,useEffect:Qv,useImperativeHandle:jT,useInsertionEffect:UT,useLayoutEffect:FT,useMemo:qT,useReducer:Bp,useRef:PT,useState:function(){return Bp(Va)},useDebugValue:Zv,useDeferredValue:function(o,c){var h=hr();return VT(h,pn.memoizedState,o,c)},useTransition:function(){var o=Bp(Va)[0],c=hr().memoizedState;return[typeof o=="boolean"?o:k0(o),c]},useSyncExternalStore:ET,useId:KT,useHostTransitionStatus:ty,useFormState:DT,useActionState:DT,useOptimistic:function(o,c){var h=hr();return kT(h,pn,o,c)},useMemoCache:Gv,useCacheRefresh:XT};ry.useEffectEvent=zT;var t5={readContext:Gr,use:Pp,useCallback:$T,useContext:Gr,useEffect:Qv,useImperativeHandle:jT,useInsertionEffect:UT,useLayoutEffect:FT,useMemo:qT,useReducer:Wv,useRef:PT,useState:function(){return Wv(Va)},useDebugValue:Zv,useDeferredValue:function(o,c){var h=hr();return pn===null?Jv(h,o,c):VT(h,pn.memoizedState,o,c)},useTransition:function(){var o=Wv(Va)[0],c=hr().memoizedState;return[typeof o=="boolean"?o:k0(o),c]},useSyncExternalStore:ET,useId:KT,useHostTransitionStatus:ty,useFormState:LT,useActionState:LT,useOptimistic:function(o,c){var h=hr();return pn!==null?kT(h,pn,o,c):(h.baseState=o,[o,h.queue.dispatch])},useMemoCache:Gv,useCacheRefresh:XT};t5.useEffectEvent=zT;function iy(o,c,h,m){c=o.memoizedState,h=h(m,c),h=h==null?c:p({},c,h),o.memoizedState=h,o.lanes===0&&(o.updateQueue.baseState=h)}var sy={enqueueSetState:function(o,c,h){o=o._reactInternals;var m=rs(),y=Jo(m);y.payload=c,h!=null&&(y.callback=h),c=el(o,y,m),c!==null&&(Pi(c,o,m),x0(c,o,m))},enqueueReplaceState:function(o,c,h){o=o._reactInternals;var m=rs(),y=Jo(m);y.tag=1,y.payload=c,h!=null&&(y.callback=h),c=el(o,y,m),c!==null&&(Pi(c,o,m),x0(c,o,m))},enqueueForceUpdate:function(o,c){o=o._reactInternals;var h=rs(),m=Jo(h);m.tag=2,c!=null&&(m.callback=c),c=el(o,m,h),c!==null&&(Pi(c,o,h),x0(c,o,h))}};function n5(o,c,h,m,y,_,N){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(m,_,N):c.prototype&&c.prototype.isPureReactComponent?!p0(h,m)||!p0(y,_):!0}function r5(o,c,h,m){o=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(h,m),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(h,m),c.state!==o&&sy.enqueueReplaceState(c,c.state,null)}function xu(o,c){var h=c;if("ref"in c){h={};for(var m in c)m!=="ref"&&(h[m]=c[m])}if(o=o.defaultProps){h===c&&(h=p({},h));for(var y in o)h[y]===void 0&&(h[y]=o[y])}return h}function i5(o){vp(o)}function s5(o){console.error(o)}function a5(o){vp(o)}function Hp(o,c){try{var h=o.onUncaughtError;h(c.value,{componentStack:c.stack})}catch(m){setTimeout(function(){throw m})}}function o5(o,c,h){try{var m=o.onCaughtError;m(h.value,{componentStack:h.stack,errorBoundary:c.tag===1?c.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function ay(o,c,h){return h=Jo(h),h.tag=3,h.payload={element:null},h.callback=function(){Hp(o,c)},h}function l5(o){return o=Jo(o),o.tag=3,o}function u5(o,c,h,m){var y=h.type.getDerivedStateFromError;if(typeof y=="function"){var _=m.value;o.payload=function(){return y(_)},o.callback=function(){o5(c,h,m)}}var N=h.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(o.callback=function(){o5(c,h,m),typeof y!="function"&&(al===null?al=new Set([this]):al.add(this));var I=m.stack;this.componentDidCatch(m.value,{componentStack:I!==null?I:""})})}function KB(o,c,h,m,y){if(h.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(c=h.alternate,c!==null&&Cc(c,h,y,!0),h=Ji.current,h!==null){switch(h.tag){case 31:case 13:return Ts===null?Jp():h.alternate===null&&nr===0&&(nr=3),h.flags&=-257,h.flags|=65536,h.lanes=y,m===Ap?h.flags|=16384:(c=h.updateQueue,c===null?h.updateQueue=new Set([m]):c.add(m),My(o,m,y)),!1;case 22:return h.flags|=65536,m===Ap?h.flags|=16384:(c=h.updateQueue,c===null?(c={transitions:null,markerInstances:null,retryQueue:new Set([m])},h.updateQueue=c):(h=c.retryQueue,h===null?c.retryQueue=new Set([m]):h.add(m)),My(o,m,y)),!1}throw Error(r(435,h.tag))}return My(o,m,y),Jp(),!1}if(Wt)return c=Ji.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=y,m!==wv&&(o=Error(r(422),{cause:m}),b0(ys(o,h)))):(m!==wv&&(c=Error(r(423),{cause:m}),b0(ys(c,h))),o=o.current.alternate,o.flags|=65536,y&=-y,o.lanes|=y,m=ys(m,h),y=ay(o.stateNode,m,y),Pv(o,y),nr!==4&&(nr=2)),!1;var _=Error(r(520),{cause:m});if(_=ys(_,h),P0===null?P0=[_]:P0.push(_),nr!==4&&(nr=2),c===null)return!0;m=ys(m,h),h=c;do{switch(h.tag){case 3:return h.flags|=65536,o=y&-y,h.lanes|=o,o=ay(h.stateNode,m,o),Pv(h,o),!1;case 1:if(c=h.type,_=h.stateNode,(h.flags&128)===0&&(typeof c.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(al===null||!al.has(_))))return h.flags|=65536,y&=-y,h.lanes|=y,y=l5(y),u5(y,o,h,m),Pv(h,y),!1}h=h.return}while(h!==null);return!1}var oy=Error(r(461)),_r=!1;function Yr(o,c,h,m){c.child=o===null?hT(c,null,h,m):Eu(c,o.child,h,m)}function c5(o,c,h,m,y){h=h.render;var _=c.ref;if("ref"in m){var N={};for(var I in m)I!=="ref"&&(N[I]=m[I])}else N=m;return gu(c),m=jv(o,c,h,N,_,y),I=$v(),o!==null&&!_r?(qv(o,c,y),Ga(o,c,y)):(Wt&&I&&Tv(c),c.flags|=1,Yr(o,c,m,y),c.child)}function d5(o,c,h,m,y){if(o===null){var _=h.type;return typeof _=="function"&&!Ev(_)&&_.defaultProps===void 0&&h.compare===null?(c.tag=15,c.type=_,f5(o,c,_,m,y)):(o=xp(h.type,null,m,c,c.mode,y),o.ref=c.ref,o.return=c,c.child=o)}if(_=o.child,!my(o,y)){var N=_.memoizedProps;if(h=h.compare,h=h!==null?h:p0,h(N,m)&&o.ref===c.ref)return Ga(o,c,y)}return c.flags|=1,o=Fa(_,m),o.ref=c.ref,o.return=c,c.child=o}function f5(o,c,h,m,y){if(o!==null){var _=o.memoizedProps;if(p0(_,m)&&o.ref===c.ref)if(_r=!1,c.pendingProps=m=_,my(o,y))(o.flags&131072)!==0&&(_r=!0);else return c.lanes=o.lanes,Ga(o,c,y)}return ly(o,c,h,m,y)}function h5(o,c,h,m){var y=m.children,_=o!==null?o.memoizedState:null;if(o===null&&c.stateNode===null&&(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((c.flags&128)!==0){if(_=_!==null?_.baseLanes|h:h,o!==null){for(m=c.child=o.child,y=0;m!==null;)y=y|m.lanes|m.childLanes,m=m.sibling;m=y&~_}else m=0,c.child=null;return p5(o,c,_,h,m)}if((h&536870912)!==0)c.memoizedState={baseLanes:0,cachePool:null},o!==null&&kp(c,_!==null?_.cachePool:null),_!==null?gT(c,_):zv(),bT(c);else return m=c.lanes=536870912,p5(o,c,_!==null?_.baseLanes|h:h,h,m)}else _!==null?(kp(c,_.cachePool),gT(c,_),nl(),c.memoizedState=null):(o!==null&&kp(c,null),zv(),nl());return Yr(o,c,y,h),c.child}function N0(o,c){return o!==null&&o.tag===22||c.stateNode!==null||(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.sibling}function p5(o,c,h,m,y){var _=Rv();return _=_===null?null:{parent:yr._currentValue,pool:_},c.memoizedState={baseLanes:h,cachePool:_},o!==null&&kp(c,null),zv(),bT(c),o!==null&&Cc(o,c,m,!0),c.childLanes=y,null}function jp(o,c){return c=qp({mode:c.mode,children:c.children},o.mode),c.ref=o.ref,o.child=c,c.return=o,c}function m5(o,c,h){return Eu(c,o.child,null,h),o=jp(c,c.pendingProps),o.flags|=2,es(c),c.memoizedState=null,o}function XB(o,c,h){var m=c.pendingProps,y=(c.flags&128)!==0;if(c.flags&=-129,o===null){if(Wt){if(m.mode==="hidden")return o=jp(c,m),c.lanes=536870912,N0(null,o);if(Fv(c),(o=Dn)?(o=CS(o,xs),o=o!==null&&o.data==="&"?o:null,o!==null&&(c.memoizedState={dehydrated:o,treeContext:Wo!==null?{id:sa,overflow:aa}:null,retryLane:536870912,hydrationErrors:null},h=Z6(o),h.return=c,c.child=h,Vr=c,Dn=null)):o=null,o===null)throw Xo(c);return c.lanes=536870912,null}return jp(c,m)}var _=o.memoizedState;if(_!==null){var N=_.dehydrated;if(Fv(c),y)if(c.flags&256)c.flags&=-257,c=m5(o,c,h);else if(c.memoizedState!==null)c.child=o.child,c.flags|=128,c=null;else throw Error(r(558));else if(_r||Cc(o,c,h,!1),y=(h&o.childLanes)!==0,_r||y){if(m=En,m!==null&&(N=ur(m,h),N!==0&&N!==_.retryLane))throw _.retryLane=N,fu(o,N),Pi(m,o,N),oy;Jp(),c=m5(o,c,h)}else o=_.treeContext,Dn=Ss(N.nextSibling),Vr=c,Wt=!0,Ko=null,xs=!1,o!==null&&tT(c,o),c=jp(c,m),c.flags|=4096;return c}return o=Fa(o.child,{mode:m.mode,children:m.children}),o.ref=c.ref,c.child=o,o.return=c,o}function $p(o,c){var h=c.ref;if(h===null)o!==null&&o.ref!==null&&(c.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(r(284));(o===null||o.ref!==h)&&(c.flags|=4194816)}}function ly(o,c,h,m,y){return gu(c),h=jv(o,c,h,m,void 0,y),m=$v(),o!==null&&!_r?(qv(o,c,y),Ga(o,c,y)):(Wt&&m&&Tv(c),c.flags|=1,Yr(o,c,h,y),c.child)}function g5(o,c,h,m,y,_){return gu(c),c.updateQueue=null,h=yT(c,m,h,y),vT(o),m=$v(),o!==null&&!_r?(qv(o,c,_),Ga(o,c,_)):(Wt&&m&&Tv(c),c.flags|=1,Yr(o,c,h,_),c.child)}function b5(o,c,h,m,y){if(gu(c),c.stateNode===null){var _=Tc,N=h.contextType;typeof N=="object"&&N!==null&&(_=Gr(N)),_=new h(m,_),c.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=sy,c.stateNode=_,_._reactInternals=c,_=c.stateNode,_.props=m,_.state=c.memoizedState,_.refs={},Iv(c),N=h.contextType,_.context=typeof N=="object"&&N!==null?Gr(N):Tc,_.state=c.memoizedState,N=h.getDerivedStateFromProps,typeof N=="function"&&(iy(c,h,N,m),_.state=c.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(N=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),N!==_.state&&sy.enqueueReplaceState(_,_.state,null),S0(c,m,_,y),T0(),_.state=c.memoizedState),typeof _.componentDidMount=="function"&&(c.flags|=4194308),m=!0}else if(o===null){_=c.stateNode;var I=c.memoizedProps,K=xu(h,I);_.props=K;var he=_.context,ye=h.contextType;N=Tc,typeof ye=="object"&&ye!==null&&(N=Gr(ye));var Se=h.getDerivedStateFromProps;ye=typeof Se=="function"||typeof _.getSnapshotBeforeUpdate=="function",I=c.pendingProps!==I,ye||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(I||he!==N)&&r5(c,_,m,N),Zo=!1;var pe=c.memoizedState;_.state=pe,S0(c,m,_,y),T0(),he=c.memoizedState,I||pe!==he||Zo?(typeof Se=="function"&&(iy(c,h,Se,m),he=c.memoizedState),(K=Zo||n5(c,h,K,m,pe,he,N))?(ye||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(c.flags|=4194308)):(typeof _.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=m,c.memoizedState=he),_.props=m,_.state=he,_.context=N,m=K):(typeof _.componentDidMount=="function"&&(c.flags|=4194308),m=!1)}else{_=c.stateNode,Lv(o,c),N=c.memoizedProps,ye=xu(h,N),_.props=ye,Se=c.pendingProps,pe=_.context,he=h.contextType,K=Tc,typeof he=="object"&&he!==null&&(K=Gr(he)),I=h.getDerivedStateFromProps,(he=typeof I=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(N!==Se||pe!==K)&&r5(c,_,m,K),Zo=!1,pe=c.memoizedState,_.state=pe,S0(c,m,_,y),T0();var me=c.memoizedState;N!==Se||pe!==me||Zo||o!==null&&o.dependencies!==null&&Sp(o.dependencies)?(typeof I=="function"&&(iy(c,h,I,m),me=c.memoizedState),(ye=Zo||n5(c,h,ye,m,pe,me,K)||o!==null&&o.dependencies!==null&&Sp(o.dependencies))?(he||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(m,me,K),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(m,me,K)),typeof _.componentDidUpdate=="function"&&(c.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof _.componentDidUpdate!="function"||N===o.memoizedProps&&pe===o.memoizedState||(c.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||N===o.memoizedProps&&pe===o.memoizedState||(c.flags|=1024),c.memoizedProps=m,c.memoizedState=me),_.props=m,_.state=me,_.context=K,m=ye):(typeof _.componentDidUpdate!="function"||N===o.memoizedProps&&pe===o.memoizedState||(c.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||N===o.memoizedProps&&pe===o.memoizedState||(c.flags|=1024),m=!1)}return _=m,$p(o,c),m=(c.flags&128)!==0,_||m?(_=c.stateNode,h=m&&typeof h.getDerivedStateFromError!="function"?null:_.render(),c.flags|=1,o!==null&&m?(c.child=Eu(c,o.child,null,y),c.child=Eu(c,null,h,y)):Yr(o,c,h,y),c.memoizedState=_.state,o=c.child):o=Ga(o,c,y),o}function v5(o,c,h,m){return pu(),c.flags|=256,Yr(o,c,h,m),c.child}var uy={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function cy(o){return{baseLanes:o,cachePool:oT()}}function dy(o,c,h){return o=o!==null?o.childLanes&~h:0,c&&(o|=ns),o}function y5(o,c,h){var m=c.pendingProps,y=!1,_=(c.flags&128)!==0,N;if((N=_)||(N=o!==null&&o.memoizedState===null?!1:(fr.current&2)!==0),N&&(y=!0,c.flags&=-129),N=(c.flags&32)!==0,c.flags&=-33,o===null){if(Wt){if(y?tl(c):nl(),(o=Dn)?(o=CS(o,xs),o=o!==null&&o.data!=="&"?o:null,o!==null&&(c.memoizedState={dehydrated:o,treeContext:Wo!==null?{id:sa,overflow:aa}:null,retryLane:536870912,hydrationErrors:null},h=Z6(o),h.return=c,c.child=h,Vr=c,Dn=null)):o=null,o===null)throw Xo(c);return Yy(o)?c.lanes=32:c.lanes=536870912,null}var I=m.children;return m=m.fallback,y?(nl(),y=c.mode,I=qp({mode:"hidden",children:I},y),m=hu(m,y,h,null),I.return=c,m.return=c,I.sibling=m,c.child=I,m=c.child,m.memoizedState=cy(h),m.childLanes=dy(o,N,h),c.memoizedState=uy,N0(null,m)):(tl(c),fy(c,I))}var K=o.memoizedState;if(K!==null&&(I=K.dehydrated,I!==null)){if(_)c.flags&256?(tl(c),c.flags&=-257,c=hy(o,c,h)):c.memoizedState!==null?(nl(),c.child=o.child,c.flags|=128,c=null):(nl(),I=m.fallback,y=c.mode,m=qp({mode:"visible",children:m.children},y),I=hu(I,y,h,null),I.flags|=2,m.return=c,I.return=c,m.sibling=I,c.child=m,Eu(c,o.child,null,h),m=c.child,m.memoizedState=cy(h),m.childLanes=dy(o,N,h),c.memoizedState=uy,c=N0(null,m));else if(tl(c),Yy(I)){if(N=I.nextSibling&&I.nextSibling.dataset,N)var he=N.dgst;N=he,m=Error(r(419)),m.stack="",m.digest=N,b0({value:m,source:null,stack:null}),c=hy(o,c,h)}else if(_r||Cc(o,c,h,!1),N=(h&o.childLanes)!==0,_r||N){if(N=En,N!==null&&(m=ur(N,h),m!==0&&m!==K.retryLane))throw K.retryLane=m,fu(o,m),Pi(N,o,m),oy;Gy(I)||Jp(),c=hy(o,c,h)}else Gy(I)?(c.flags|=192,c.child=o.child,c=null):(o=K.treeContext,Dn=Ss(I.nextSibling),Vr=c,Wt=!0,Ko=null,xs=!1,o!==null&&tT(c,o),c=fy(c,m.children),c.flags|=4096);return c}return y?(nl(),I=m.fallback,y=c.mode,K=o.child,he=K.sibling,m=Fa(K,{mode:"hidden",children:m.children}),m.subtreeFlags=K.subtreeFlags&65011712,he!==null?I=Fa(he,I):(I=hu(I,y,h,null),I.flags|=2),I.return=c,m.return=c,m.sibling=I,c.child=m,N0(null,m),m=c.child,I=o.child.memoizedState,I===null?I=cy(h):(y=I.cachePool,y!==null?(K=yr._currentValue,y=y.parent!==K?{parent:K,pool:K}:y):y=oT(),I={baseLanes:I.baseLanes|h,cachePool:y}),m.memoizedState=I,m.childLanes=dy(o,N,h),c.memoizedState=uy,N0(o.child,m)):(tl(c),h=o.child,o=h.sibling,h=Fa(h,{mode:"visible",children:m.children}),h.return=c,h.sibling=null,o!==null&&(N=c.deletions,N===null?(c.deletions=[o],c.flags|=16):N.push(o)),c.child=h,c.memoizedState=null,h)}function fy(o,c){return c=qp({mode:"visible",children:c},o.mode),c.return=o,o.child=c}function qp(o,c){return o=Zi(22,o,null,c),o.lanes=0,o}function hy(o,c,h){return Eu(c,o.child,null,h),o=fy(c,c.pendingProps.children),o.flags|=2,c.memoizedState=null,o}function E5(o,c,h){o.lanes|=c;var m=o.alternate;m!==null&&(m.lanes|=c),Av(o.return,c,h)}function py(o,c,h,m,y,_){var N=o.memoizedState;N===null?o.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:m,tail:h,tailMode:y,treeForkCount:_}:(N.isBackwards=c,N.rendering=null,N.renderingStartTime=0,N.last=m,N.tail=h,N.tailMode=y,N.treeForkCount=_)}function _5(o,c,h){var m=c.pendingProps,y=m.revealOrder,_=m.tail;m=m.children;var N=fr.current,I=(N&2)!==0;if(I?(N=N&1|2,c.flags|=128):N&=1,P(fr,N),Yr(o,c,m,h),m=Wt?g0:0,!I&&o!==null&&(o.flags&128)!==0)e:for(o=c.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&E5(o,h,c);else if(o.tag===19)E5(o,h,c);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===c)break e;for(;o.sibling===null;){if(o.return===null||o.return===c)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}switch(y){case"forwards":for(h=c.child,y=null;h!==null;)o=h.alternate,o!==null&&Rp(o)===null&&(y=h),h=h.sibling;h=y,h===null?(y=c.child,c.child=null):(y=h.sibling,h.sibling=null),py(c,!1,y,h,_,m);break;case"backwards":case"unstable_legacy-backwards":for(h=null,y=c.child,c.child=null;y!==null;){if(o=y.alternate,o!==null&&Rp(o)===null){c.child=y;break}o=y.sibling,y.sibling=h,h=y,y=o}py(c,!0,h,null,_,m);break;case"together":py(c,!1,null,null,void 0,m);break;default:c.memoizedState=null}return c.child}function Ga(o,c,h){if(o!==null&&(c.dependencies=o.dependencies),sl|=c.lanes,(h&c.childLanes)===0)if(o!==null){if(Cc(o,c,h,!1),(h&c.childLanes)===0)return null}else return null;if(o!==null&&c.child!==o.child)throw Error(r(153));if(c.child!==null){for(o=c.child,h=Fa(o,o.pendingProps),c.child=h,h.return=c;o.sibling!==null;)o=o.sibling,h=h.sibling=Fa(o,o.pendingProps),h.return=c;h.sibling=null}return c.child}function my(o,c){return(o.lanes&c)!==0?!0:(o=o.dependencies,!!(o!==null&&Sp(o)))}function QB(o,c,h){switch(c.tag){case 3:kt(c,c.stateNode.containerInfo),Qo(c,yr,o.memoizedState.cache),pu();break;case 27:case 5:St(c);break;case 4:kt(c,c.stateNode.containerInfo);break;case 10:Qo(c,c.type,c.memoizedProps.value);break;case 31:if(c.memoizedState!==null)return c.flags|=128,Fv(c),null;break;case 13:var m=c.memoizedState;if(m!==null)return m.dehydrated!==null?(tl(c),c.flags|=128,null):(h&c.child.childLanes)!==0?y5(o,c,h):(tl(c),o=Ga(o,c,h),o!==null?o.sibling:null);tl(c);break;case 19:var y=(o.flags&128)!==0;if(m=(h&c.childLanes)!==0,m||(Cc(o,c,h,!1),m=(h&c.childLanes)!==0),y){if(m)return _5(o,c,h);c.flags|=128}if(y=c.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),P(fr,fr.current),m)break;return null;case 22:return c.lanes=0,h5(o,c,h,c.pendingProps);case 24:Qo(c,yr,o.memoizedState.cache)}return Ga(o,c,h)}function x5(o,c,h){if(o!==null)if(o.memoizedProps!==c.pendingProps)_r=!0;else{if(!my(o,h)&&(c.flags&128)===0)return _r=!1,QB(o,c,h);_r=(o.flags&131072)!==0}else _r=!1,Wt&&(c.flags&1048576)!==0&&eT(c,g0,c.index);switch(c.lanes=0,c.tag){case 16:e:{var m=c.pendingProps;if(o=vu(c.elementType),c.type=o,typeof o=="function")Ev(o)?(m=xu(o,m),c.tag=1,c=b5(null,c,o,m,h)):(c.tag=0,c=ly(null,c,o,m,h));else{if(o!=null){var y=o.$$typeof;if(y===L){c.tag=11,c=c5(null,c,o,m,h);break e}else if(y===F){c.tag=14,c=d5(null,c,o,m,h);break e}}throw c=oe(o)||o,Error(r(306,c,""))}}return c;case 0:return ly(o,c,c.type,c.pendingProps,h);case 1:return m=c.type,y=xu(m,c.pendingProps),b5(o,c,m,y,h);case 3:e:{if(kt(c,c.stateNode.containerInfo),o===null)throw Error(r(387));m=c.pendingProps;var _=c.memoizedState;y=_.element,Lv(o,c),S0(c,m,null,h);var N=c.memoizedState;if(m=N.cache,Qo(c,yr,m),m!==_.cache&&Nv(c,[yr],h,!0),T0(),m=N.element,_.isDehydrated)if(_={element:m,isDehydrated:!1,cache:N.cache},c.updateQueue.baseState=_,c.memoizedState=_,c.flags&256){c=v5(o,c,m,h);break e}else if(m!==y){y=ys(Error(r(424)),c),b0(y),c=v5(o,c,m,h);break e}else{switch(o=c.stateNode.containerInfo,o.nodeType){case 9:o=o.body;break;default:o=o.nodeName==="HTML"?o.ownerDocument.body:o}for(Dn=Ss(o.firstChild),Vr=c,Wt=!0,Ko=null,xs=!0,h=hT(c,null,m,h),c.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling}else{if(pu(),m===y){c=Ga(o,c,h);break e}Yr(o,c,m,h)}c=c.child}return c;case 26:return $p(o,c),o===null?(h=DS(c.type,null,c.pendingProps,null))?c.memoizedState=h:Wt||(h=c.type,o=c.pendingProps,m=am(He.current).createElement(h),m[cr]=c,m[ri]=o,Wr(m,h,o),br(m),c.stateNode=m):c.memoizedState=DS(c.type,o.memoizedProps,c.pendingProps,o.memoizedState),null;case 27:return St(c),o===null&&Wt&&(m=c.stateNode=OS(c.type,c.pendingProps,He.current),Vr=c,xs=!0,y=Dn,cl(c.type)?(Wy=y,Dn=Ss(m.firstChild)):Dn=y),Yr(o,c,c.pendingProps.children,h),$p(o,c),o===null&&(c.flags|=4194304),c.child;case 5:return o===null&&Wt&&((y=m=Dn)&&(m=Cz(m,c.type,c.pendingProps,xs),m!==null?(c.stateNode=m,Vr=c,Dn=Ss(m.firstChild),xs=!1,y=!0):y=!1),y||Xo(c)),St(c),y=c.type,_=c.pendingProps,N=o!==null?o.memoizedProps:null,m=_.children,$y(y,_)?m=null:N!==null&&$y(y,N)&&(c.flags|=32),c.memoizedState!==null&&(y=jv(o,c,jB,null,null,h),q0._currentValue=y),$p(o,c),Yr(o,c,m,h),c.child;case 6:return o===null&&Wt&&((o=h=Dn)&&(h=Az(h,c.pendingProps,xs),h!==null?(c.stateNode=h,Vr=c,Dn=null,o=!0):o=!1),o||Xo(c)),null;case 13:return y5(o,c,h);case 4:return kt(c,c.stateNode.containerInfo),m=c.pendingProps,o===null?c.child=Eu(c,null,m,h):Yr(o,c,m,h),c.child;case 11:return c5(o,c,c.type,c.pendingProps,h);case 7:return Yr(o,c,c.pendingProps,h),c.child;case 8:return Yr(o,c,c.pendingProps.children,h),c.child;case 12:return Yr(o,c,c.pendingProps.children,h),c.child;case 10:return m=c.pendingProps,Qo(c,c.type,m.value),Yr(o,c,m.children,h),c.child;case 9:return y=c.type._context,m=c.pendingProps.children,gu(c),y=Gr(y),m=m(y),c.flags|=1,Yr(o,c,m,h),c.child;case 14:return d5(o,c,c.type,c.pendingProps,h);case 15:return f5(o,c,c.type,c.pendingProps,h);case 19:return _5(o,c,h);case 31:return XB(o,c,h);case 22:return h5(o,c,h,c.pendingProps);case 24:return gu(c),m=Gr(yr),o===null?(y=Rv(),y===null&&(y=En,_=Ov(),y.pooledCache=_,_.refCount++,_!==null&&(y.pooledCacheLanes|=h),y=_),c.memoizedState={parent:m,cache:y},Iv(c),Qo(c,yr,y)):((o.lanes&h)!==0&&(Lv(o,c),S0(c,null,null,h),T0()),y=o.memoizedState,_=c.memoizedState,y.parent!==m?(y={parent:m,cache:m},c.memoizedState=y,c.lanes===0&&(c.memoizedState=c.updateQueue.baseState=y),Qo(c,yr,m)):(m=_.cache,Qo(c,yr,m),m!==y.cache&&Nv(c,[yr],h,!0))),Yr(o,c,c.pendingProps.children,h),c.child;case 29:throw c.pendingProps}throw Error(r(156,c.tag))}function Ya(o){o.flags|=4}function gy(o,c,h,m,y){if((c=(o.mode&32)!==0)&&(c=!1),c){if(o.flags|=16777216,(y&335544128)===y)if(o.stateNode.complete)o.flags|=8192;else if(K5())o.flags|=8192;else throw yu=Ap,Dv}else o.flags&=-16777217}function T5(o,c){if(c.type!=="stylesheet"||(c.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!zS(c))if(K5())o.flags|=8192;else throw yu=Ap,Dv}function Vp(o,c){c!==null&&(o.flags|=4),o.flags&16384&&(c=o.tag!==22?_t():536870912,o.lanes|=c,Uc|=c)}function O0(o,c){if(!Wt)switch(o.tailMode){case"hidden":c=o.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?o.tail=null:h.sibling=null;break;case"collapsed":h=o.tail;for(var m=null;h!==null;)h.alternate!==null&&(m=h),h=h.sibling;m===null?c||o.tail===null?o.tail=null:o.tail.sibling=null:m.sibling=null}}function In(o){var c=o.alternate!==null&&o.alternate.child===o.child,h=0,m=0;if(c)for(var y=o.child;y!==null;)h|=y.lanes|y.childLanes,m|=y.subtreeFlags&65011712,m|=y.flags&65011712,y.return=o,y=y.sibling;else for(y=o.child;y!==null;)h|=y.lanes|y.childLanes,m|=y.subtreeFlags,m|=y.flags,y.return=o,y=y.sibling;return o.subtreeFlags|=m,o.childLanes=h,c}function ZB(o,c,h){var m=c.pendingProps;switch(Sv(c),c.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return In(c),null;case 1:return In(c),null;case 3:return h=c.stateNode,m=null,o!==null&&(m=o.memoizedState.cache),c.memoizedState.cache!==m&&(c.flags|=2048),$a(yr),Tt(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(o===null||o.child===null)&&(kc(c)?Ya(c):o===null||o.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,kv())),In(c),null;case 26:var y=c.type,_=c.memoizedState;return o===null?(Ya(c),_!==null?(In(c),T5(c,_)):(In(c),gy(c,y,null,m,h))):_?_!==o.memoizedState?(Ya(c),In(c),T5(c,_)):(In(c),c.flags&=-16777217):(o=o.memoizedProps,o!==m&&Ya(c),In(c),gy(c,y,o,m,h)),null;case 27:if(Jn(c),h=He.current,y=c.type,o!==null&&c.stateNode!=null)o.memoizedProps!==m&&Ya(c);else{if(!m){if(c.stateNode===null)throw Error(r(166));return In(c),null}o=Ee.current,kc(c)?nT(c):(o=OS(y,m,h),c.stateNode=o,Ya(c))}return In(c),null;case 5:if(Jn(c),y=c.type,o!==null&&c.stateNode!=null)o.memoizedProps!==m&&Ya(c);else{if(!m){if(c.stateNode===null)throw Error(r(166));return In(c),null}if(_=Ee.current,kc(c))nT(c);else{var N=am(He.current);switch(_){case 1:_=N.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:_=N.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":_=N.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":_=N.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":_=N.createElement("div"),_.innerHTML="<script><\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof m.is=="string"?N.createElement("select",{is:m.is}):N.createElement("select"),m.multiple?_.multiple=!0:m.size&&(_.size=m.size);break;default:_=typeof m.is=="string"?N.createElement(y,{is:m.is}):N.createElement(y)}}_[cr]=c,_[ri]=m;e:for(N=c.child;N!==null;){if(N.tag===5||N.tag===6)_.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===c)break e;for(;N.sibling===null;){if(N.return===null||N.return===c)break e;N=N.return}N.sibling.return=N.return,N=N.sibling}c.stateNode=_;e:switch(Wr(_,y,m),y){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&Ya(c)}}return In(c),gy(c,c.type,o===null?null:o.memoizedProps,c.pendingProps,h),null;case 6:if(o&&c.stateNode!=null)o.memoizedProps!==m&&Ya(c);else{if(typeof m!="string"&&c.stateNode===null)throw Error(r(166));if(o=He.current,kc(c)){if(o=c.stateNode,h=c.memoizedProps,m=null,y=Vr,y!==null)switch(y.tag){case 27:case 5:m=y.memoizedProps}o[cr]=c,o=!!(o.nodeValue===h||m!==null&&m.suppressHydrationWarning===!0||yS(o.nodeValue,h)),o||Xo(c,!0)}else o=am(o).createTextNode(m),o[cr]=c,c.stateNode=o}return In(c),null;case 31:if(h=c.memoizedState,o===null||o.memoizedState!==null){if(m=kc(c),h!==null){if(o===null){if(!m)throw Error(r(318));if(o=c.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(557));o[cr]=c}else pu(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;In(c),o=!1}else h=kv(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=h),o=!0;if(!o)return c.flags&256?(es(c),c):(es(c),null);if((c.flags&128)!==0)throw Error(r(558))}return In(c),null;case 13:if(m=c.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(y=kc(c),m!==null&&m.dehydrated!==null){if(o===null){if(!y)throw Error(r(318));if(y=c.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[cr]=c}else pu(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;In(c),y=!1}else y=kv(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=y),y=!0;if(!y)return c.flags&256?(es(c),c):(es(c),null)}return es(c),(c.flags&128)!==0?(c.lanes=h,c):(h=m!==null,o=o!==null&&o.memoizedState!==null,h&&(m=c.child,y=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(y=m.alternate.memoizedState.cachePool.pool),_=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(_=m.memoizedState.cachePool.pool),_!==y&&(m.flags|=2048)),h!==o&&h&&(c.child.flags|=8192),Vp(c,c.updateQueue),In(c),null);case 4:return Tt(),o===null&&zy(c.stateNode.containerInfo),In(c),null;case 10:return $a(c.type),In(c),null;case 19:if(ne(fr),m=c.memoizedState,m===null)return In(c),null;if(y=(c.flags&128)!==0,_=m.rendering,_===null)if(y)O0(m,!1);else{if(nr!==0||o!==null&&(o.flags&128)!==0)for(o=c.child;o!==null;){if(_=Rp(o),_!==null){for(c.flags|=128,O0(m,!1),o=_.updateQueue,c.updateQueue=o,Vp(c,o),c.subtreeFlags=0,o=h,h=c.child;h!==null;)Q6(h,o),h=h.sibling;return P(fr,fr.current&1|2),Wt&&Ha(c,m.treeForkCount),c.child}o=o.sibling}m.tail!==null&&fn()>Xp&&(c.flags|=128,y=!0,O0(m,!1),c.lanes=4194304)}else{if(!y)if(o=Rp(_),o!==null){if(c.flags|=128,y=!0,o=o.updateQueue,c.updateQueue=o,Vp(c,o),O0(m,!0),m.tail===null&&m.tailMode==="hidden"&&!_.alternate&&!Wt)return In(c),null}else 2*fn()-m.renderingStartTime>Xp&&h!==536870912&&(c.flags|=128,y=!0,O0(m,!1),c.lanes=4194304);m.isBackwards?(_.sibling=c.child,c.child=_):(o=m.last,o!==null?o.sibling=_:c.child=_,m.last=_)}return m.tail!==null?(o=m.tail,m.rendering=o,m.tail=o.sibling,m.renderingStartTime=fn(),o.sibling=null,h=fr.current,P(fr,y?h&1|2:h&1),Wt&&Ha(c,m.treeForkCount),o):(In(c),null);case 22:case 23:return es(c),Uv(),m=c.memoizedState!==null,o!==null?o.memoizedState!==null!==m&&(c.flags|=8192):m&&(c.flags|=8192),m?(h&536870912)!==0&&(c.flags&128)===0&&(In(c),c.subtreeFlags&6&&(c.flags|=8192)):In(c),h=c.updateQueue,h!==null&&Vp(c,h.retryQueue),h=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),m=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(m=c.memoizedState.cachePool.pool),m!==h&&(c.flags|=2048),o!==null&&ne(bu),null;case 24:return h=null,o!==null&&(h=o.memoizedState.cache),c.memoizedState.cache!==h&&(c.flags|=2048),$a(yr),In(c),null;case 25:return null;case 30:return null}throw Error(r(156,c.tag))}function JB(o,c){switch(Sv(c),c.tag){case 1:return o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 3:return $a(yr),Tt(),o=c.flags,(o&65536)!==0&&(o&128)===0?(c.flags=o&-65537|128,c):null;case 26:case 27:case 5:return Jn(c),null;case 31:if(c.memoizedState!==null){if(es(c),c.alternate===null)throw Error(r(340));pu()}return o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 13:if(es(c),o=c.memoizedState,o!==null&&o.dehydrated!==null){if(c.alternate===null)throw Error(r(340));pu()}return o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 19:return ne(fr),null;case 4:return Tt(),null;case 10:return $a(c.type),null;case 22:case 23:return es(c),Uv(),o!==null&&ne(bu),o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 24:return $a(yr),null;case 25:return null;default:return null}}function S5(o,c){switch(Sv(c),c.tag){case 3:$a(yr),Tt();break;case 26:case 27:case 5:Jn(c);break;case 4:Tt();break;case 31:c.memoizedState!==null&&es(c);break;case 13:es(c);break;case 19:ne(fr);break;case 10:$a(c.type);break;case 22:case 23:es(c),Uv(),o!==null&&ne(bu);break;case 24:$a(yr)}}function M0(o,c){try{var h=c.updateQueue,m=h!==null?h.lastEffect:null;if(m!==null){var y=m.next;h=y;do{if((h.tag&o)===o){m=void 0;var _=h.create,N=h.inst;m=_(),N.destroy=m}h=h.next}while(h!==y)}}catch(I){un(c,c.return,I)}}function rl(o,c,h){try{var m=c.updateQueue,y=m!==null?m.lastEffect:null;if(y!==null){var _=y.next;m=_;do{if((m.tag&o)===o){var N=m.inst,I=N.destroy;if(I!==void 0){N.destroy=void 0,y=c;var K=h,he=I;try{he()}catch(ye){un(y,K,ye)}}}m=m.next}while(m!==_)}}catch(ye){un(c,c.return,ye)}}function w5(o){var c=o.updateQueue;if(c!==null){var h=o.stateNode;try{mT(c,h)}catch(m){un(o,o.return,m)}}}function k5(o,c,h){h.props=xu(o.type,o.memoizedProps),h.state=o.memoizedState;try{h.componentWillUnmount()}catch(m){un(o,c,m)}}function R0(o,c){try{var h=o.ref;if(h!==null){switch(o.tag){case 26:case 27:case 5:var m=o.stateNode;break;case 30:m=o.stateNode;break;default:m=o.stateNode}typeof h=="function"?o.refCleanup=h(m):h.current=m}}catch(y){un(o,c,y)}}function oa(o,c){var h=o.ref,m=o.refCleanup;if(h!==null)if(typeof m=="function")try{m()}catch(y){un(o,c,y)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(y){un(o,c,y)}else h.current=null}function C5(o){var c=o.type,h=o.memoizedProps,m=o.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":h.autoFocus&&m.focus();break e;case"img":h.src?m.src=h.src:h.srcSet&&(m.srcset=h.srcSet)}}catch(y){un(o,o.return,y)}}function by(o,c,h){try{var m=o.stateNode;_z(m,o.type,h,c),m[ri]=c}catch(y){un(o,o.return,y)}}function A5(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&cl(o.type)||o.tag===4}function vy(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||A5(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&cl(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function yy(o,c,h){var m=o.tag;if(m===5||m===6)o=o.stateNode,c?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(o,c):(c=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,c.appendChild(o),h=h._reactRootContainer,h!=null||c.onclick!==null||(c.onclick=ze));else if(m!==4&&(m===27&&cl(o.type)&&(h=o.stateNode,c=null),o=o.child,o!==null))for(yy(o,c,h),o=o.sibling;o!==null;)yy(o,c,h),o=o.sibling}function Gp(o,c,h){var m=o.tag;if(m===5||m===6)o=o.stateNode,c?h.insertBefore(o,c):h.appendChild(o);else if(m!==4&&(m===27&&cl(o.type)&&(h=o.stateNode),o=o.child,o!==null))for(Gp(o,c,h),o=o.sibling;o!==null;)Gp(o,c,h),o=o.sibling}function N5(o){var c=o.stateNode,h=o.memoizedProps;try{for(var m=o.type,y=c.attributes;y.length;)c.removeAttributeNode(y[0]);Wr(c,m,h),c[cr]=o,c[ri]=h}catch(_){un(o,o.return,_)}}var Wa=!1,xr=!1,Ey=!1,O5=typeof WeakSet=="function"?WeakSet:Set,Pr=null;function ez(o,c){if(o=o.containerInfo,Hy=hm,o=j6(o),hv(o)){if("selectionStart"in o)var h={start:o.selectionStart,end:o.selectionEnd};else e:{h=(h=o.ownerDocument)&&h.defaultView||window;var m=h.getSelection&&h.getSelection();if(m&&m.rangeCount!==0){h=m.anchorNode;var y=m.anchorOffset,_=m.focusNode;m=m.focusOffset;try{h.nodeType,_.nodeType}catch{h=null;break e}var N=0,I=-1,K=-1,he=0,ye=0,Se=o,pe=null;t:for(;;){for(var me;Se!==h||y!==0&&Se.nodeType!==3||(I=N+y),Se!==_||m!==0&&Se.nodeType!==3||(K=N+m),Se.nodeType===3&&(N+=Se.nodeValue.length),(me=Se.firstChild)!==null;)pe=Se,Se=me;for(;;){if(Se===o)break t;if(pe===h&&++he===y&&(I=N),pe===_&&++ye===m&&(K=N),(me=Se.nextSibling)!==null)break;Se=pe,pe=Se.parentNode}Se=me}h=I===-1||K===-1?null:{start:I,end:K}}else h=null}h=h||{start:0,end:0}}else h=null;for(jy={focusedElem:o,selectionRange:h},hm=!1,Pr=c;Pr!==null;)if(c=Pr,o=c.child,(c.subtreeFlags&1028)!==0&&o!==null)o.return=c,Pr=o;else for(;Pr!==null;){switch(c=Pr,_=c.alternate,o=c.flags,c.tag){case 0:if((o&4)!==0&&(o=c.updateQueue,o=o!==null?o.events:null,o!==null))for(h=0;h<o.length;h++)y=o[h],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((o&1024)!==0&&_!==null){o=void 0,h=c,y=_.memoizedProps,_=_.memoizedState,m=h.stateNode;try{var Ze=xu(h.type,y);o=m.getSnapshotBeforeUpdate(Ze,_),m.__reactInternalSnapshotBeforeUpdate=o}catch(ht){un(h,h.return,ht)}}break;case 3:if((o&1024)!==0){if(o=c.stateNode.containerInfo,h=o.nodeType,h===9)Vy(o);else if(h===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":Vy(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(r(163))}if(o=c.sibling,o!==null){o.return=c.return,Pr=o;break}Pr=c.return}}function M5(o,c,h){var m=h.flags;switch(h.tag){case 0:case 11:case 15:Xa(o,h),m&4&&M0(5,h);break;case 1:if(Xa(o,h),m&4)if(o=h.stateNode,c===null)try{o.componentDidMount()}catch(N){un(h,h.return,N)}else{var y=xu(h.type,c.memoizedProps);c=c.memoizedState;try{o.componentDidUpdate(y,c,o.__reactInternalSnapshotBeforeUpdate)}catch(N){un(h,h.return,N)}}m&64&&w5(h),m&512&&R0(h,h.return);break;case 3:if(Xa(o,h),m&64&&(o=h.updateQueue,o!==null)){if(c=null,h.child!==null)switch(h.child.tag){case 27:case 5:c=h.child.stateNode;break;case 1:c=h.child.stateNode}try{mT(o,c)}catch(N){un(h,h.return,N)}}break;case 27:c===null&&m&4&&N5(h);case 26:case 5:Xa(o,h),c===null&&m&4&&C5(h),m&512&&R0(h,h.return);break;case 12:Xa(o,h);break;case 31:Xa(o,h),m&4&&I5(o,h);break;case 13:Xa(o,h),m&4&&L5(o,h),m&64&&(o=h.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(h=uz.bind(null,h),Nz(o,h))));break;case 22:if(m=h.memoizedState!==null||Wa,!m){c=c!==null&&c.memoizedState!==null||xr,y=Wa;var _=xr;Wa=m,(xr=c)&&!_?Qa(o,h,(h.subtreeFlags&8772)!==0):Xa(o,h),Wa=y,xr=_}break;case 30:break;default:Xa(o,h)}}function R5(o){var c=o.alternate;c!==null&&(o.alternate=null,R5(c)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(c=o.stateNode,c!==null&&n0(c)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var Hn=null,Ri=!1;function Ka(o,c,h){for(h=h.child;h!==null;)D5(o,c,h),h=h.sibling}function D5(o,c,h){if(hn&&typeof hn.onCommitFiberUnmount=="function")try{hn.onCommitFiberUnmount(Yn,h)}catch{}switch(h.tag){case 26:xr||oa(h,c),Ka(o,c,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:xr||oa(h,c);var m=Hn,y=Ri;cl(h.type)&&(Hn=h.stateNode,Ri=!1),Ka(o,c,h),H0(h.stateNode),Hn=m,Ri=y;break;case 5:xr||oa(h,c);case 6:if(m=Hn,y=Ri,Hn=null,Ka(o,c,h),Hn=m,Ri=y,Hn!==null)if(Ri)try{(Hn.nodeType===9?Hn.body:Hn.nodeName==="HTML"?Hn.ownerDocument.body:Hn).removeChild(h.stateNode)}catch(_){un(h,c,_)}else try{Hn.removeChild(h.stateNode)}catch(_){un(h,c,_)}break;case 18:Hn!==null&&(Ri?(o=Hn,wS(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,h.stateNode),Yc(o)):wS(Hn,h.stateNode));break;case 4:m=Hn,y=Ri,Hn=h.stateNode.containerInfo,Ri=!0,Ka(o,c,h),Hn=m,Ri=y;break;case 0:case 11:case 14:case 15:rl(2,h,c),xr||rl(4,h,c),Ka(o,c,h);break;case 1:xr||(oa(h,c),m=h.stateNode,typeof m.componentWillUnmount=="function"&&k5(h,c,m)),Ka(o,c,h);break;case 21:Ka(o,c,h);break;case 22:xr=(m=xr)||h.memoizedState!==null,Ka(o,c,h),xr=m;break;default:Ka(o,c,h)}}function I5(o,c){if(c.memoizedState===null&&(o=c.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{Yc(o)}catch(h){un(c,c.return,h)}}}function L5(o,c){if(c.memoizedState===null&&(o=c.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{Yc(o)}catch(h){un(c,c.return,h)}}function tz(o){switch(o.tag){case 31:case 13:case 19:var c=o.stateNode;return c===null&&(c=o.stateNode=new O5),c;case 22:return o=o.stateNode,c=o._retryCache,c===null&&(c=o._retryCache=new O5),c;default:throw Error(r(435,o.tag))}}function Yp(o,c){var h=tz(o);c.forEach(function(m){if(!h.has(m)){h.add(m);var y=cz.bind(null,o,m);m.then(y,y)}})}function Di(o,c){var h=c.deletions;if(h!==null)for(var m=0;m<h.length;m++){var y=h[m],_=o,N=c,I=N;e:for(;I!==null;){switch(I.tag){case 27:if(cl(I.type)){Hn=I.stateNode,Ri=!1;break e}break;case 5:Hn=I.stateNode,Ri=!1;break e;case 3:case 4:Hn=I.stateNode.containerInfo,Ri=!0;break e}I=I.return}if(Hn===null)throw Error(r(160));D5(_,N,y),Hn=null,Ri=!1,_=y.alternate,_!==null&&(_.return=null),y.return=null}if(c.subtreeFlags&13886)for(c=c.child;c!==null;)P5(c,o),c=c.sibling}var $s=null;function P5(o,c){var h=o.alternate,m=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:Di(c,o),Ii(o),m&4&&(rl(3,o,o.return),M0(3,o),rl(5,o,o.return));break;case 1:Di(c,o),Ii(o),m&512&&(xr||h===null||oa(h,h.return)),m&64&&Wa&&(o=o.updateQueue,o!==null&&(m=o.callbacks,m!==null&&(h=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=h===null?m:h.concat(m))));break;case 26:var y=$s;if(Di(c,o),Ii(o),m&512&&(xr||h===null||oa(h,h.return)),m&4){var _=h!==null?h.memoizedState:null;if(m=o.memoizedState,h===null)if(m===null)if(o.stateNode===null){e:{m=o.type,h=o.memoizedProps,y=y.ownerDocument||y;t:switch(m){case"title":_=y.getElementsByTagName("title")[0],(!_||_[au]||_[cr]||_.namespaceURI==="http://www.w3.org/2000/svg"||_.hasAttribute("itemprop"))&&(_=y.createElement(m),y.head.insertBefore(_,y.querySelector("head > title"))),Wr(_,m,h),_[cr]=o,br(_),m=_;break e;case"link":var N=PS("link","href",y).get(m+(h.href||""));if(N){for(var I=0;I<N.length;I++)if(_=N[I],_.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&_.getAttribute("rel")===(h.rel==null?null:h.rel)&&_.getAttribute("title")===(h.title==null?null:h.title)&&_.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){N.splice(I,1);break t}}_=y.createElement(m),Wr(_,m,h),y.head.appendChild(_);break;case"meta":if(N=PS("meta","content",y).get(m+(h.content||""))){for(I=0;I<N.length;I++)if(_=N[I],_.getAttribute("content")===(h.content==null?null:""+h.content)&&_.getAttribute("name")===(h.name==null?null:h.name)&&_.getAttribute("property")===(h.property==null?null:h.property)&&_.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&_.getAttribute("charset")===(h.charSet==null?null:h.charSet)){N.splice(I,1);break t}}_=y.createElement(m),Wr(_,m,h),y.head.appendChild(_);break;default:throw Error(r(468,m))}_[cr]=o,br(_),m=_}o.stateNode=m}else BS(y,o.type,o.stateNode);else o.stateNode=LS(y,m,o.memoizedProps);else _!==m?(_===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):_.count--,m===null?BS(y,o.type,o.stateNode):LS(y,m,o.memoizedProps)):m===null&&o.stateNode!==null&&by(o,o.memoizedProps,h.memoizedProps)}break;case 27:Di(c,o),Ii(o),m&512&&(xr||h===null||oa(h,h.return)),h!==null&&m&4&&by(o,o.memoizedProps,h.memoizedProps);break;case 5:if(Di(c,o),Ii(o),m&512&&(xr||h===null||oa(h,h.return)),o.flags&32){y=o.stateNode;try{mt(y,"")}catch(Ze){un(o,o.return,Ze)}}m&4&&o.stateNode!=null&&(y=o.memoizedProps,by(o,y,h!==null?h.memoizedProps:y)),m&1024&&(Ey=!0);break;case 6:if(Di(c,o),Ii(o),m&4){if(o.stateNode===null)throw Error(r(162));m=o.memoizedProps,h=o.stateNode;try{h.nodeValue=m}catch(Ze){un(o,o.return,Ze)}}break;case 3:if(um=null,y=$s,$s=om(c.containerInfo),Di(c,o),$s=y,Ii(o),m&4&&h!==null&&h.memoizedState.isDehydrated)try{Yc(c.containerInfo)}catch(Ze){un(o,o.return,Ze)}Ey&&(Ey=!1,B5(o));break;case 4:m=$s,$s=om(o.stateNode.containerInfo),Di(c,o),Ii(o),$s=m;break;case 12:Di(c,o),Ii(o);break;case 31:Di(c,o),Ii(o),m&4&&(m=o.updateQueue,m!==null&&(o.updateQueue=null,Yp(o,m)));break;case 13:Di(c,o),Ii(o),o.child.flags&8192&&o.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(Kp=fn()),m&4&&(m=o.updateQueue,m!==null&&(o.updateQueue=null,Yp(o,m)));break;case 22:y=o.memoizedState!==null;var K=h!==null&&h.memoizedState!==null,he=Wa,ye=xr;if(Wa=he||y,xr=ye||K,Di(c,o),xr=ye,Wa=he,Ii(o),m&8192)e:for(c=o.stateNode,c._visibility=y?c._visibility&-2:c._visibility|1,y&&(h===null||K||Wa||xr||Tu(o)),h=null,c=o;;){if(c.tag===5||c.tag===26){if(h===null){K=h=c;try{if(_=K.stateNode,y)N=_.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{I=K.stateNode;var Se=K.memoizedProps.style,pe=Se!=null&&Se.hasOwnProperty("display")?Se.display:null;I.style.display=pe==null||typeof pe=="boolean"?"":(""+pe).trim()}}catch(Ze){un(K,K.return,Ze)}}}else if(c.tag===6){if(h===null){K=c;try{K.stateNode.nodeValue=y?"":K.memoizedProps}catch(Ze){un(K,K.return,Ze)}}}else if(c.tag===18){if(h===null){K=c;try{var me=K.stateNode;y?kS(me,!0):kS(K.stateNode,!1)}catch(Ze){un(K,K.return,Ze)}}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===o)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===o)break e;for(;c.sibling===null;){if(c.return===null||c.return===o)break e;h===c&&(h=null),c=c.return}h===c&&(h=null),c.sibling.return=c.return,c=c.sibling}m&4&&(m=o.updateQueue,m!==null&&(h=m.retryQueue,h!==null&&(m.retryQueue=null,Yp(o,h))));break;case 19:Di(c,o),Ii(o),m&4&&(m=o.updateQueue,m!==null&&(o.updateQueue=null,Yp(o,m)));break;case 30:break;case 21:break;default:Di(c,o),Ii(o)}}function Ii(o){var c=o.flags;if(c&2){try{for(var h,m=o.return;m!==null;){if(A5(m)){h=m;break}m=m.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var y=h.stateNode,_=vy(o);Gp(o,_,y);break;case 5:var N=h.stateNode;h.flags&32&&(mt(N,""),h.flags&=-33);var I=vy(o);Gp(o,I,N);break;case 3:case 4:var K=h.stateNode.containerInfo,he=vy(o);yy(o,he,K);break;default:throw Error(r(161))}}catch(ye){un(o,o.return,ye)}o.flags&=-3}c&4096&&(o.flags&=-4097)}function B5(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var c=o;B5(c),c.tag===5&&c.flags&1024&&c.stateNode.reset(),o=o.sibling}}function Xa(o,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)M5(o,c.alternate,c),c=c.sibling}function Tu(o){for(o=o.child;o!==null;){var c=o;switch(c.tag){case 0:case 11:case 14:case 15:rl(4,c,c.return),Tu(c);break;case 1:oa(c,c.return);var h=c.stateNode;typeof h.componentWillUnmount=="function"&&k5(c,c.return,h),Tu(c);break;case 27:H0(c.stateNode);case 26:case 5:oa(c,c.return),Tu(c);break;case 22:c.memoizedState===null&&Tu(c);break;case 30:Tu(c);break;default:Tu(c)}o=o.sibling}}function Qa(o,c,h){for(h=h&&(c.subtreeFlags&8772)!==0,c=c.child;c!==null;){var m=c.alternate,y=o,_=c,N=_.flags;switch(_.tag){case 0:case 11:case 15:Qa(y,_,h),M0(4,_);break;case 1:if(Qa(y,_,h),m=_,y=m.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(he){un(m,m.return,he)}if(m=_,y=m.updateQueue,y!==null){var I=m.stateNode;try{var K=y.shared.hiddenCallbacks;if(K!==null)for(y.shared.hiddenCallbacks=null,y=0;y<K.length;y++)pT(K[y],I)}catch(he){un(m,m.return,he)}}h&&N&64&&w5(_),R0(_,_.return);break;case 27:N5(_);case 26:case 5:Qa(y,_,h),h&&m===null&&N&4&&C5(_),R0(_,_.return);break;case 12:Qa(y,_,h);break;case 31:Qa(y,_,h),h&&N&4&&I5(y,_);break;case 13:Qa(y,_,h),h&&N&4&&L5(y,_);break;case 22:_.memoizedState===null&&Qa(y,_,h),R0(_,_.return);break;case 30:break;default:Qa(y,_,h)}c=c.sibling}}function _y(o,c){var h=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),o=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(o=c.memoizedState.cachePool.pool),o!==h&&(o!=null&&o.refCount++,h!=null&&v0(h))}function xy(o,c){o=null,c.alternate!==null&&(o=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==o&&(c.refCount++,o!=null&&v0(o))}function qs(o,c,h,m){if(c.subtreeFlags&10256)for(c=c.child;c!==null;)z5(o,c,h,m),c=c.sibling}function z5(o,c,h,m){var y=c.flags;switch(c.tag){case 0:case 11:case 15:qs(o,c,h,m),y&2048&&M0(9,c);break;case 1:qs(o,c,h,m);break;case 3:qs(o,c,h,m),y&2048&&(o=null,c.alternate!==null&&(o=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==o&&(c.refCount++,o!=null&&v0(o)));break;case 12:if(y&2048){qs(o,c,h,m),o=c.stateNode;try{var _=c.memoizedProps,N=_.id,I=_.onPostCommit;typeof I=="function"&&I(N,c.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(K){un(c,c.return,K)}}else qs(o,c,h,m);break;case 31:qs(o,c,h,m);break;case 13:qs(o,c,h,m);break;case 23:break;case 22:_=c.stateNode,N=c.alternate,c.memoizedState!==null?_._visibility&2?qs(o,c,h,m):D0(o,c):_._visibility&2?qs(o,c,h,m):(_._visibility|=2,Pc(o,c,h,m,(c.subtreeFlags&10256)!==0||!1)),y&2048&&_y(N,c);break;case 24:qs(o,c,h,m),y&2048&&xy(c.alternate,c);break;default:qs(o,c,h,m)}}function Pc(o,c,h,m,y){for(y=y&&((c.subtreeFlags&10256)!==0||!1),c=c.child;c!==null;){var _=o,N=c,I=h,K=m,he=N.flags;switch(N.tag){case 0:case 11:case 15:Pc(_,N,I,K,y),M0(8,N);break;case 23:break;case 22:var ye=N.stateNode;N.memoizedState!==null?ye._visibility&2?Pc(_,N,I,K,y):D0(_,N):(ye._visibility|=2,Pc(_,N,I,K,y)),y&&he&2048&&_y(N.alternate,N);break;case 24:Pc(_,N,I,K,y),y&&he&2048&&xy(N.alternate,N);break;default:Pc(_,N,I,K,y)}c=c.sibling}}function D0(o,c){if(c.subtreeFlags&10256)for(c=c.child;c!==null;){var h=o,m=c,y=m.flags;switch(m.tag){case 22:D0(h,m),y&2048&&_y(m.alternate,m);break;case 24:D0(h,m),y&2048&&xy(m.alternate,m);break;default:D0(h,m)}c=c.sibling}}var I0=8192;function Bc(o,c,h){if(o.subtreeFlags&I0)for(o=o.child;o!==null;)U5(o,c,h),o=o.sibling}function U5(o,c,h){switch(o.tag){case 26:Bc(o,c,h),o.flags&I0&&o.memoizedState!==null&&Hz(h,$s,o.memoizedState,o.memoizedProps);break;case 5:Bc(o,c,h);break;case 3:case 4:var m=$s;$s=om(o.stateNode.containerInfo),Bc(o,c,h),$s=m;break;case 22:o.memoizedState===null&&(m=o.alternate,m!==null&&m.memoizedState!==null?(m=I0,I0=16777216,Bc(o,c,h),I0=m):Bc(o,c,h));break;default:Bc(o,c,h)}}function F5(o){var c=o.alternate;if(c!==null&&(o=c.child,o!==null)){c.child=null;do c=o.sibling,o.sibling=null,o=c;while(o!==null)}}function L0(o){var c=o.deletions;if((o.flags&16)!==0){if(c!==null)for(var h=0;h<c.length;h++){var m=c[h];Pr=m,j5(m,o)}F5(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)H5(o),o=o.sibling}function H5(o){switch(o.tag){case 0:case 11:case 15:L0(o),o.flags&2048&&rl(9,o,o.return);break;case 3:L0(o);break;case 12:L0(o);break;case 22:var c=o.stateNode;o.memoizedState!==null&&c._visibility&2&&(o.return===null||o.return.tag!==13)?(c._visibility&=-3,Wp(o)):L0(o);break;default:L0(o)}}function Wp(o){var c=o.deletions;if((o.flags&16)!==0){if(c!==null)for(var h=0;h<c.length;h++){var m=c[h];Pr=m,j5(m,o)}F5(o)}for(o=o.child;o!==null;){switch(c=o,c.tag){case 0:case 11:case 15:rl(8,c,c.return),Wp(c);break;case 22:h=c.stateNode,h._visibility&2&&(h._visibility&=-3,Wp(c));break;default:Wp(c)}o=o.sibling}}function j5(o,c){for(;Pr!==null;){var h=Pr;switch(h.tag){case 0:case 11:case 15:rl(8,h,c);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var m=h.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:v0(h.memoizedState.cache)}if(m=h.child,m!==null)m.return=h,Pr=m;else e:for(h=o;Pr!==null;){m=Pr;var y=m.sibling,_=m.return;if(R5(m),m===h){Pr=null;break e}if(y!==null){y.return=_,Pr=y;break e}Pr=_}}}var nz={getCacheForType:function(o){var c=Gr(yr),h=c.data.get(o);return h===void 0&&(h=o(),c.data.set(o,h)),h},cacheSignal:function(){return Gr(yr).controller.signal}},rz=typeof WeakMap=="function"?WeakMap:Map,tn=0,En=null,Ut=null,Vt=0,ln=0,ts=null,il=!1,zc=!1,Ty=!1,Za=0,nr=0,sl=0,Su=0,Sy=0,ns=0,Uc=0,P0=null,Li=null,wy=!1,Kp=0,$5=0,Xp=1/0,Qp=null,al=null,Mr=0,ol=null,Fc=null,Ja=0,ky=0,Cy=null,q5=null,B0=0,Ay=null;function rs(){return(tn&2)!==0&&Vt!==0?Vt&-Vt:X.T!==null?Iy():fc()}function V5(){if(ns===0)if((Vt&536870912)===0||Wt){var o=kn;kn<<=1,(kn&3932160)===0&&(kn=262144),ns=o}else ns=536870912;return o=Ji.current,o!==null&&(o.flags|=32),ns}function Pi(o,c,h){(o===En&&(ln===2||ln===9)||o.cancelPendingCommit!==null)&&(Hc(o,0),ll(o,Vt,ns,!1)),yn(o,h),((tn&2)===0||o!==En)&&(o===En&&((tn&2)===0&&(Su|=h),nr===4&&ll(o,Vt,ns,!1)),la(o))}function G5(o,c,h){if((tn&6)!==0)throw Error(r(327));var m=!h&&(c&127)===0&&(c&o.expiredLanes)===0||_e(o,c),y=m?az(o,c):Oy(o,c,!0),_=m;do{if(y===0){zc&&!m&&ll(o,c,0,!1);break}else{if(h=o.current.alternate,_&&!iz(h)){y=Oy(o,c,!1),_=!1;continue}if(y===2){if(_=c,o.errorRecoveryDisabledLanes&_)var N=0;else N=o.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){c=N;e:{var I=o;y=P0;var K=I.current.memoizedState.isDehydrated;if(K&&(Hc(I,N).flags|=256),N=Oy(I,N,!1),N!==2){if(Ty&&!K){I.errorRecoveryDisabledLanes|=_,Su|=_,y=4;break e}_=Li,Li=y,_!==null&&(Li===null?Li=_:Li.push.apply(Li,_))}y=N}if(_=!1,y!==2)continue}}if(y===1){Hc(o,0),ll(o,c,0,!0);break}e:{switch(m=o,_=y,_){case 0:case 1:throw Error(r(345));case 4:if((c&4194048)!==c)break;case 6:ll(m,c,ns,!il);break e;case 2:Li=null;break;case 3:case 5:break;default:throw Error(r(329))}if((c&62914560)===c&&(y=Kp+300-fn(),10<y)){if(ll(m,c,ns,!il),Q(m,0,!0)!==0)break e;Ja=c,m.timeoutHandle=TS(Y5.bind(null,m,h,Li,Qp,wy,c,ns,Su,Uc,il,_,"Throttled",-0,0),y);break e}Y5(m,h,Li,Qp,wy,c,ns,Su,Uc,il,_,null,-0,0)}}break}while(!0);la(o)}function Y5(o,c,h,m,y,_,N,I,K,he,ye,Se,pe,me){if(o.timeoutHandle=-1,Se=c.subtreeFlags,Se&8192||(Se&16785408)===16785408){Se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ze},U5(c,_,Se);var Ze=(_&62914560)===_?Kp-fn():(_&4194048)===_?$5-fn():0;if(Ze=jz(Se,Ze),Ze!==null){Ja=_,o.cancelPendingCommit=Ze(tS.bind(null,o,c,_,h,m,y,N,I,K,ye,Se,null,pe,me)),ll(o,_,N,!he);return}}tS(o,c,_,h,m,y,N,I,K)}function iz(o){for(var c=o;;){var h=c.tag;if((h===0||h===11||h===15)&&c.flags&16384&&(h=c.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var m=0;m<h.length;m++){var y=h[m],_=y.getSnapshot;y=y.value;try{if(!Qi(_(),y))return!1}catch{return!1}}if(h=c.child,c.subtreeFlags&16384&&h!==null)h.return=c,c=h;else{if(c===o)break;for(;c.sibling===null;){if(c.return===null||c.return===o)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function ll(o,c,h,m){c&=~Sy,c&=~Su,o.suspendedLanes|=c,o.pingedLanes&=~c,m&&(o.warmLanes|=c),m=o.expirationTimes;for(var y=c;0<y;){var _=31-xt(y),N=1<<_;m[_]=-1,y&=~N}h!==0&&Xe(o,h,c)}function Zp(){return(tn&6)===0?(z0(0),!1):!0}function Ny(){if(Ut!==null){if(ln===0)var o=Ut.return;else o=Ut,ja=mu=null,Vv(o),Mc=null,E0=0,o=Ut;for(;o!==null;)S5(o.alternate,o),o=o.return;Ut=null}}function Hc(o,c){var h=o.timeoutHandle;h!==-1&&(o.timeoutHandle=-1,Sz(h)),h=o.cancelPendingCommit,h!==null&&(o.cancelPendingCommit=null,h()),Ja=0,Ny(),En=o,Ut=h=Fa(o.current,null),Vt=c,ln=0,ts=null,il=!1,zc=_e(o,c),Ty=!1,Uc=ns=Sy=Su=sl=nr=0,Li=P0=null,wy=!1,(c&8)!==0&&(c|=c&32);var m=o.entangledLanes;if(m!==0)for(o=o.entanglements,m&=c;0<m;){var y=31-xt(m),_=1<<y;c|=o[y],m&=~_}return Za=c,yp(),h}function W5(o,c){Nt=null,X.H=A0,c===Oc||c===Cp?(c=cT(),ln=3):c===Dv?(c=cT(),ln=4):ln=c===oy?8:c!==null&&typeof c=="object"&&typeof c.then=="function"?6:1,ts=c,Ut===null&&(nr=1,Hp(o,ys(c,o.current)))}function K5(){var o=Ji.current;return o===null?!0:(Vt&4194048)===Vt?Ts===null:(Vt&62914560)===Vt||(Vt&536870912)!==0?o===Ts:!1}function X5(){var o=X.H;return X.H=A0,o===null?A0:o}function Q5(){var o=X.A;return X.A=nz,o}function Jp(){nr=4,il||(Vt&4194048)!==Vt&&Ji.current!==null||(zc=!0),(sl&134217727)===0&&(Su&134217727)===0||En===null||ll(En,Vt,ns,!1)}function Oy(o,c,h){var m=tn;tn|=2;var y=X5(),_=Q5();(En!==o||Vt!==c)&&(Qp=null,Hc(o,c)),c=!1;var N=nr;e:do try{if(ln!==0&&Ut!==null){var I=Ut,K=ts;switch(ln){case 8:Ny(),N=6;break e;case 3:case 2:case 9:case 6:Ji.current===null&&(c=!0);var he=ln;if(ln=0,ts=null,jc(o,I,K,he),h&&zc){N=0;break e}break;default:he=ln,ln=0,ts=null,jc(o,I,K,he)}}sz(),N=nr;break}catch(ye){W5(o,ye)}while(!0);return c&&o.shellSuspendCounter++,ja=mu=null,tn=m,X.H=y,X.A=_,Ut===null&&(En=null,Vt=0,yp()),N}function sz(){for(;Ut!==null;)Z5(Ut)}function az(o,c){var h=tn;tn|=2;var m=X5(),y=Q5();En!==o||Vt!==c?(Qp=null,Xp=fn()+500,Hc(o,c)):zc=_e(o,c);e:do try{if(ln!==0&&Ut!==null){c=Ut;var _=ts;t:switch(ln){case 1:ln=0,ts=null,jc(o,c,_,1);break;case 2:case 9:if(lT(_)){ln=0,ts=null,J5(c);break}c=function(){ln!==2&&ln!==9||En!==o||(ln=7),la(o)},_.then(c,c);break e;case 3:ln=7;break e;case 4:ln=5;break e;case 7:lT(_)?(ln=0,ts=null,J5(c)):(ln=0,ts=null,jc(o,c,_,7));break;case 5:var N=null;switch(Ut.tag){case 26:N=Ut.memoizedState;case 5:case 27:var I=Ut;if(N?zS(N):I.stateNode.complete){ln=0,ts=null;var K=I.sibling;if(K!==null)Ut=K;else{var he=I.return;he!==null?(Ut=he,em(he)):Ut=null}break t}}ln=0,ts=null,jc(o,c,_,5);break;case 6:ln=0,ts=null,jc(o,c,_,6);break;case 8:Ny(),nr=6;break e;default:throw Error(r(462))}}oz();break}catch(ye){W5(o,ye)}while(!0);return ja=mu=null,X.H=m,X.A=y,tn=h,Ut!==null?0:(En=null,Vt=0,yp(),nr)}function oz(){for(;Ut!==null&&!ra();)Z5(Ut)}function Z5(o){var c=x5(o.alternate,o,Za);o.memoizedProps=o.pendingProps,c===null?em(o):Ut=c}function J5(o){var c=o,h=c.alternate;switch(c.tag){case 15:case 0:c=g5(h,c,c.pendingProps,c.type,void 0,Vt);break;case 11:c=g5(h,c,c.pendingProps,c.type.render,c.ref,Vt);break;case 5:Vv(c);default:S5(h,c),c=Ut=Q6(c,Za),c=x5(h,c,Za)}o.memoizedProps=o.pendingProps,c===null?em(o):Ut=c}function jc(o,c,h,m){ja=mu=null,Vv(c),Mc=null,E0=0;var y=c.return;try{if(KB(o,y,c,h,Vt)){nr=1,Hp(o,ys(h,o.current)),Ut=null;return}}catch(_){if(y!==null)throw Ut=y,_;nr=1,Hp(o,ys(h,o.current)),Ut=null;return}c.flags&32768?(Wt||m===1?o=!0:zc||(Vt&536870912)!==0?o=!1:(il=o=!0,(m===2||m===9||m===3||m===6)&&(m=Ji.current,m!==null&&m.tag===13&&(m.flags|=16384))),eS(c,o)):em(c)}function em(o){var c=o;do{if((c.flags&32768)!==0){eS(c,il);return}o=c.return;var h=ZB(c.alternate,c,Za);if(h!==null){Ut=h;return}if(c=c.sibling,c!==null){Ut=c;return}Ut=c=o}while(c!==null);nr===0&&(nr=5)}function eS(o,c){do{var h=JB(o.alternate,o);if(h!==null){h.flags&=32767,Ut=h;return}if(h=o.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!c&&(o=o.sibling,o!==null)){Ut=o;return}Ut=o=h}while(o!==null);nr=6,Ut=null}function tS(o,c,h,m,y,_,N,I,K){o.cancelPendingCommit=null;do tm();while(Mr!==0);if((tn&6)!==0)throw Error(r(327));if(c!==null){if(c===o.current)throw Error(r(177));if(_=c.lanes|c.childLanes,_|=vv,et(o,h,_,N,I,K),o===En&&(Ut=En=null,Vt=0),Fc=c,ol=o,Ja=h,ky=_,Cy=y,q5=m,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,dz(lt,function(){return aS(),null})):(o.callbackNode=null,o.callbackPriority=0),m=(c.flags&13878)!==0,(c.subtreeFlags&13878)!==0||m){m=X.T,X.T=null,y=ee.p,ee.p=2,N=tn,tn|=4;try{ez(o,c,h)}finally{tn=N,ee.p=y,X.T=m}}Mr=1,nS(),rS(),iS()}}function nS(){if(Mr===1){Mr=0;var o=ol,c=Fc,h=(c.flags&13878)!==0;if((c.subtreeFlags&13878)!==0||h){h=X.T,X.T=null;var m=ee.p;ee.p=2;var y=tn;tn|=4;try{P5(c,o);var _=jy,N=j6(o.containerInfo),I=_.focusedElem,K=_.selectionRange;if(N!==I&&I&&I.ownerDocument&&H6(I.ownerDocument.documentElement,I)){if(K!==null&&hv(I)){var he=K.start,ye=K.end;if(ye===void 0&&(ye=he),"selectionStart"in I)I.selectionStart=he,I.selectionEnd=Math.min(ye,I.value.length);else{var Se=I.ownerDocument||document,pe=Se&&Se.defaultView||window;if(pe.getSelection){var me=pe.getSelection(),Ze=I.textContent.length,ht=Math.min(K.start,Ze),gn=K.end===void 0?ht:Math.min(K.end,Ze);!me.extend&&ht>gn&&(N=gn,gn=ht,ht=N);var ae=F6(I,ht),J=F6(I,gn);if(ae&&J&&(me.rangeCount!==1||me.anchorNode!==ae.node||me.anchorOffset!==ae.offset||me.focusNode!==J.node||me.focusOffset!==J.offset)){var de=Se.createRange();de.setStart(ae.node,ae.offset),me.removeAllRanges(),ht>gn?(me.addRange(de),me.extend(J.node,J.offset)):(de.setEnd(J.node,J.offset),me.addRange(de))}}}}for(Se=[],me=I;me=me.parentNode;)me.nodeType===1&&Se.push({element:me,left:me.scrollLeft,top:me.scrollTop});for(typeof I.focus=="function"&&I.focus(),I=0;I<Se.length;I++){var xe=Se[I];xe.element.scrollLeft=xe.left,xe.element.scrollTop=xe.top}}hm=!!Hy,jy=Hy=null}finally{tn=y,ee.p=m,X.T=h}}o.current=c,Mr=2}}function rS(){if(Mr===2){Mr=0;var o=ol,c=Fc,h=(c.flags&8772)!==0;if((c.subtreeFlags&8772)!==0||h){h=X.T,X.T=null;var m=ee.p;ee.p=2;var y=tn;tn|=4;try{M5(o,c.alternate,c)}finally{tn=y,ee.p=m,X.T=h}}Mr=3}}function iS(){if(Mr===4||Mr===3){Mr=0,Hs();var o=ol,c=Fc,h=Ja,m=q5;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?Mr=5:(Mr=0,Fc=ol=null,sS(o,o.pendingLanes));var y=o.pendingLanes;if(y===0&&(al=null),La(h),c=c.stateNode,hn&&typeof hn.onCommitFiberRoot=="function")try{hn.onCommitFiberRoot(Yn,c,void 0,(c.current.flags&128)===128)}catch{}if(m!==null){c=X.T,y=ee.p,ee.p=2,X.T=null;try{for(var _=o.onRecoverableError,N=0;N<m.length;N++){var I=m[N];_(I.value,{componentStack:I.stack})}}finally{X.T=c,ee.p=y}}(Ja&3)!==0&&tm(),la(o),y=o.pendingLanes,(h&261930)!==0&&(y&42)!==0?o===Ay?B0++:(B0=0,Ay=o):B0=0,z0(0)}}function sS(o,c){(o.pooledCacheLanes&=c)===0&&(c=o.pooledCache,c!=null&&(o.pooledCache=null,v0(c)))}function tm(){return nS(),rS(),iS(),aS()}function aS(){if(Mr!==5)return!1;var o=ol,c=ky;ky=0;var h=La(Ja),m=X.T,y=ee.p;try{ee.p=32>h?32:h,X.T=null,h=Cy,Cy=null;var _=ol,N=Ja;if(Mr=0,Fc=ol=null,Ja=0,(tn&6)!==0)throw Error(r(331));var I=tn;if(tn|=4,H5(_.current),z5(_,_.current,N,h),tn=I,z0(0,!1),hn&&typeof hn.onPostCommitFiberRoot=="function")try{hn.onPostCommitFiberRoot(Yn,_)}catch{}return!0}finally{ee.p=y,X.T=m,sS(o,c)}}function oS(o,c,h){c=ys(h,c),c=ay(o.stateNode,c,2),o=el(o,c,2),o!==null&&(yn(o,2),la(o))}function un(o,c,h){if(o.tag===3)oS(o,o,h);else for(;c!==null;){if(c.tag===3){oS(c,o,h);break}else if(c.tag===1){var m=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(al===null||!al.has(m))){o=ys(h,o),h=l5(2),m=el(c,h,2),m!==null&&(u5(h,m,c,o),yn(m,2),la(m));break}}c=c.return}}function My(o,c,h){var m=o.pingCache;if(m===null){m=o.pingCache=new rz;var y=new Set;m.set(c,y)}else y=m.get(c),y===void 0&&(y=new Set,m.set(c,y));y.has(h)||(Ty=!0,y.add(h),o=lz.bind(null,o,c,h),c.then(o,o))}function lz(o,c,h){var m=o.pingCache;m!==null&&m.delete(c),o.pingedLanes|=o.suspendedLanes&h,o.warmLanes&=~h,En===o&&(Vt&h)===h&&(nr===4||nr===3&&(Vt&62914560)===Vt&&300>fn()-Kp?(tn&2)===0&&Hc(o,0):Sy|=h,Uc===Vt&&(Uc=0)),la(o)}function lS(o,c){c===0&&(c=_t()),o=fu(o,c),o!==null&&(yn(o,c),la(o))}function uz(o){var c=o.memoizedState,h=0;c!==null&&(h=c.retryLane),lS(o,h)}function cz(o,c){var h=0;switch(o.tag){case 31:case 13:var m=o.stateNode,y=o.memoizedState;y!==null&&(h=y.retryLane);break;case 19:m=o.stateNode;break;case 22:m=o.stateNode._retryCache;break;default:throw Error(r(314))}m!==null&&m.delete(c),lS(o,h)}function dz(o,c){return vn(o,c)}var nm=null,$c=null,Ry=!1,rm=!1,Dy=!1,ul=0;function la(o){o!==$c&&o.next===null&&($c===null?nm=$c=o:$c=$c.next=o),rm=!0,Ry||(Ry=!0,hz())}function z0(o,c){if(!Dy&&rm){Dy=!0;do for(var h=!1,m=nm;m!==null;){if(o!==0){var y=m.pendingLanes;if(y===0)var _=0;else{var N=m.suspendedLanes,I=m.pingedLanes;_=(1<<31-xt(42|o)+1)-1,_&=y&~(N&~I),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(h=!0,fS(m,_))}else _=Vt,_=Q(m,m===En?_:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(_&3)===0||_e(m,_)||(h=!0,fS(m,_));m=m.next}while(h);Dy=!1}}function fz(){uS()}function uS(){rm=Ry=!1;var o=0;ul!==0&&Tz()&&(o=ul);for(var c=fn(),h=null,m=nm;m!==null;){var y=m.next,_=cS(m,c);_===0?(m.next=null,h===null?nm=y:h.next=y,y===null&&($c=h)):(h=m,(o!==0||(_&3)!==0)&&(rm=!0)),m=y}Mr!==0&&Mr!==5||z0(o),ul!==0&&(ul=0)}function cS(o,c){for(var h=o.suspendedLanes,m=o.pingedLanes,y=o.expirationTimes,_=o.pendingLanes&-62914561;0<_;){var N=31-xt(_),I=1<<N,K=y[N];K===-1?((I&h)===0||(I&m)!==0)&&(y[N]=je(I,c)):K<=c&&(o.expiredLanes|=I),_&=~I}if(c=En,h=Vt,h=Q(o,o===c?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),m=o.callbackNode,h===0||o===c&&(ln===2||ln===9)||o.cancelPendingCommit!==null)return m!==null&&m!==null&&Or(m),o.callbackNode=null,o.callbackPriority=0;if((h&3)===0||_e(o,h)){if(c=h&-h,c===o.callbackPriority)return c;switch(m!==null&&Or(m),La(h)){case 2:case 8:h=Re;break;case 32:h=lt;break;case 268435456:h=pt;break;default:h=lt}return m=dS.bind(null,o),h=vn(h,m),o.callbackPriority=c,o.callbackNode=h,c}return m!==null&&m!==null&&Or(m),o.callbackPriority=2,o.callbackNode=null,2}function dS(o,c){if(Mr!==0&&Mr!==5)return o.callbackNode=null,o.callbackPriority=0,null;var h=o.callbackNode;if(tm()&&o.callbackNode!==h)return null;var m=Vt;return m=Q(o,o===En?m:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),m===0?null:(G5(o,m,c),cS(o,fn()),o.callbackNode!=null&&o.callbackNode===h?dS.bind(null,o):null)}function fS(o,c){if(tm())return null;G5(o,c,!0)}function hz(){wz(function(){(tn&6)!==0?vn(ge,fz):uS()})}function Iy(){if(ul===0){var o=Ac;o===0&&(o=Pe,Pe<<=1,(Pe&261888)===0&&(Pe=256)),ul=o}return ul}function hS(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:Go(""+o)}function pS(o,c){var h=c.ownerDocument.createElement("input");return h.name=c.name,h.value=c.value,o.id&&h.setAttribute("form",o.id),c.parentNode.insertBefore(h,c),o=new FormData(o),h.parentNode.removeChild(h),o}function pz(o,c,h,m,y){if(c==="submit"&&h&&h.stateNode===y){var _=hS((y[ri]||null).action),N=m.submitter;N&&(c=(c=N[ri]||null)?hS(c.formAction):N.getAttribute("formAction"),c!==null&&(_=c,N=null));var I=new mp("action","action",null,m,y);o.push({event:I,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(ul!==0){var K=N?pS(y,N):new FormData(y);ey(h,{pending:!0,data:K,method:y.method,action:_},null,K)}}else typeof _=="function"&&(I.preventDefault(),K=N?pS(y,N):new FormData(y),ey(h,{pending:!0,data:K,method:y.method,action:_},_,K))},currentTarget:y}]})}}for(var Ly=0;Ly<bv.length;Ly++){var Py=bv[Ly],mz=Py.toLowerCase(),gz=Py[0].toUpperCase()+Py.slice(1);js(mz,"on"+gz)}js(V6,"onAnimationEnd"),js(G6,"onAnimationIteration"),js(Y6,"onAnimationStart"),js("dblclick","onDoubleClick"),js("focusin","onFocus"),js("focusout","onBlur"),js(RB,"onTransitionRun"),js(DB,"onTransitionStart"),js(IB,"onTransitionCancel"),js(W6,"onTransitionEnd"),De("onMouseEnter",["mouseout","mouseover"]),De("onMouseLeave",["mouseout","mouseover"]),De("onPointerEnter",["pointerout","pointerover"]),De("onPointerLeave",["pointerout","pointerover"]),Ba("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ba("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ba("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ba("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ba("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ba("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var U0="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),bz=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(U0));function mS(o,c){c=(c&4)!==0;for(var h=0;h<o.length;h++){var m=o[h],y=m.event;m=m.listeners;e:{var _=void 0;if(c)for(var N=m.length-1;0<=N;N--){var I=m[N],K=I.instance,he=I.currentTarget;if(I=I.listener,K!==_&&y.isPropagationStopped())break e;_=I,y.currentTarget=he;try{_(y)}catch(ye){vp(ye)}y.currentTarget=null,_=K}else for(N=0;N<m.length;N++){if(I=m[N],K=I.instance,he=I.currentTarget,I=I.listener,K!==_&&y.isPropagationStopped())break e;_=I,y.currentTarget=he;try{_(y)}catch(ye){vp(ye)}y.currentTarget=null,_=K}}}}function Ft(o,c){var h=c[t0];h===void 0&&(h=c[t0]=new Set);var m=o+"__bubble";h.has(m)||(gS(c,o,2,!1),h.add(m))}function By(o,c,h){var m=0;c&&(m|=4),gS(h,o,m,c)}var im="_reactListening"+Math.random().toString(36).slice(2);function zy(o){if(!o[im]){o[im]=!0,op.forEach(function(h){h!=="selectionchange"&&(bz.has(h)||By(h,!1,o),By(h,!0,o))});var c=o.nodeType===9?o:o.ownerDocument;c===null||c[im]||(c[im]=!0,By("selectionchange",!1,c))}}function gS(o,c,h,m){switch(VS(c)){case 2:var y=Vz;break;case 8:y=Gz;break;default:y=Jy}h=y.bind(null,c,h,o),y=void 0,!iv||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(y=!0),m?y!==void 0?o.addEventListener(c,h,{capture:!0,passive:y}):o.addEventListener(c,h,!0):y!==void 0?o.addEventListener(c,h,{passive:y}):o.addEventListener(c,h,!1)}function Uy(o,c,h,m,y){var _=m;if((c&1)===0&&(c&2)===0&&m!==null)e:for(;;){if(m===null)return;var N=m.tag;if(N===3||N===4){var I=m.stateNode.containerInfo;if(I===y)break;if(N===4)for(N=m.return;N!==null;){var K=N.tag;if((K===3||K===4)&&N.stateNode.containerInfo===y)return;N=N.return}for(;I!==null;){if(N=pi(I),N===null)return;if(K=N.tag,K===5||K===6||K===26||K===27){m=_=N;continue e}I=I.parentNode}}m=m.return}dp(function(){var he=_,ye=Ct(h),Se=[];e:{var pe=K6.get(o);if(pe!==void 0){var me=mp,Ze=o;switch(o){case"keypress":if(hp(h)===0)break e;case"keydown":case"keyup":me=cB;break;case"focusin":Ze="focus",me=lv;break;case"focusout":Ze="blur",me=lv;break;case"beforeblur":case"afterblur":me=lv;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=S6;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=ZP;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=hB;break;case V6:case G6:case Y6:me=tB;break;case W6:me=mB;break;case"scroll":case"scrollend":me=XP;break;case"wheel":me=bB;break;case"copy":case"cut":case"paste":me=rB;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=k6;break;case"toggle":case"beforetoggle":me=yB}var ht=(c&4)!==0,gn=!ht&&(o==="scroll"||o==="scrollend"),ae=ht?pe!==null?pe+"Capture":null:pe;ht=[];for(var J=he,de;J!==null;){var xe=J;if(de=xe.stateNode,xe=xe.tag,xe!==5&&xe!==26&&xe!==27||de===null||ae===null||(xe=o0(J,ae),xe!=null&&ht.push(F0(J,xe,de))),gn)break;J=J.return}0<ht.length&&(pe=new me(pe,Ze,null,h,ye),Se.push({event:pe,listeners:ht}))}}if((c&7)===0){e:{if(pe=o==="mouseover"||o==="pointerover",me=o==="mouseout"||o==="pointerout",pe&&h!==tt&&(Ze=h.relatedTarget||h.fromElement)&&(pi(Ze)||Ze[jo]))break e;if((me||pe)&&(pe=ye.window===ye?ye:(pe=ye.ownerDocument)?pe.defaultView||pe.parentWindow:window,me?(Ze=h.relatedTarget||h.toElement,me=he,Ze=Ze?pi(Ze):null,Ze!==null&&(gn=s(Ze),ht=Ze.tag,Ze!==gn||ht!==5&&ht!==27&&ht!==6)&&(Ze=null)):(me=null,Ze=he),me!==Ze)){if(ht=S6,xe="onMouseLeave",ae="onMouseEnter",J="mouse",(o==="pointerout"||o==="pointerover")&&(ht=k6,xe="onPointerLeave",ae="onPointerEnter",J="pointer"),gn=me==null?pe:$o(me),de=Ze==null?pe:$o(Ze),pe=new ht(xe,J+"leave",me,h,ye),pe.target=gn,pe.relatedTarget=de,xe=null,pi(ye)===he&&(ht=new ht(ae,J+"enter",Ze,h,ye),ht.target=de,ht.relatedTarget=gn,xe=ht),gn=xe,me&&Ze)t:{for(ht=vz,ae=me,J=Ze,de=0,xe=ae;xe;xe=ht(xe))de++;xe=0;for(var ut=J;ut;ut=ht(ut))xe++;for(;0<de-xe;)ae=ht(ae),de--;for(;0<xe-de;)J=ht(J),xe--;for(;de--;){if(ae===J||J!==null&&ae===J.alternate){ht=ae;break t}ae=ht(ae),J=ht(J)}ht=null}else ht=null;me!==null&&bS(Se,pe,me,ht,!1),Ze!==null&&gn!==null&&bS(Se,gn,Ze,ht,!0)}}e:{if(pe=he?$o(he):window,me=pe.nodeName&&pe.nodeName.toLowerCase(),me==="select"||me==="input"&&pe.type==="file")var Zt=I6;else if(R6(pe))if(L6)Zt=NB;else{Zt=CB;var nt=kB}else me=pe.nodeName,!me||me.toLowerCase()!=="input"||pe.type!=="checkbox"&&pe.type!=="radio"?he&&Vo(he.elementType)&&(Zt=I6):Zt=AB;if(Zt&&(Zt=Zt(o,he))){D6(Se,Zt,h,ye);break e}nt&&nt(o,pe,he),o==="focusout"&&he&&pe.type==="number"&&he.memoizedProps.value!=null&&bc(pe,"number",pe.value)}switch(nt=he?$o(he):window,o){case"focusin":(R6(nt)||nt.contentEditable==="true")&&(Ec=nt,pv=he,m0=null);break;case"focusout":m0=pv=Ec=null;break;case"mousedown":mv=!0;break;case"contextmenu":case"mouseup":case"dragend":mv=!1,$6(Se,h,ye);break;case"selectionchange":if(MB)break;case"keydown":case"keyup":$6(Se,h,ye)}var Ot;if(cv)e:{switch(o){case"compositionstart":var Gt="onCompositionStart";break e;case"compositionend":Gt="onCompositionEnd";break e;case"compositionupdate":Gt="onCompositionUpdate";break e}Gt=void 0}else yc?O6(o,h)&&(Gt="onCompositionEnd"):o==="keydown"&&h.keyCode===229&&(Gt="onCompositionStart");Gt&&(C6&&h.locale!=="ko"&&(yc||Gt!=="onCompositionStart"?Gt==="onCompositionEnd"&&yc&&(Ot=x6()):(Yo=ye,sv="value"in Yo?Yo.value:Yo.textContent,yc=!0)),nt=sm(he,Gt),0<nt.length&&(Gt=new w6(Gt,o,null,h,ye),Se.push({event:Gt,listeners:nt}),Ot?Gt.data=Ot:(Ot=M6(h),Ot!==null&&(Gt.data=Ot)))),(Ot=_B?xB(o,h):TB(o,h))&&(Gt=sm(he,"onBeforeInput"),0<Gt.length&&(nt=new w6("onBeforeInput","beforeinput",null,h,ye),Se.push({event:nt,listeners:Gt}),nt.data=Ot)),pz(Se,o,he,h,ye)}mS(Se,c)})}function F0(o,c,h){return{instance:o,listener:c,currentTarget:h}}function sm(o,c){for(var h=c+"Capture",m=[];o!==null;){var y=o,_=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||_===null||(y=o0(o,h),y!=null&&m.unshift(F0(o,y,_)),y=o0(o,c),y!=null&&m.push(F0(o,y,_))),o.tag===3)return m;o=o.return}return[]}function vz(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function bS(o,c,h,m,y){for(var _=c._reactName,N=[];h!==null&&h!==m;){var I=h,K=I.alternate,he=I.stateNode;if(I=I.tag,K!==null&&K===m)break;I!==5&&I!==26&&I!==27||he===null||(K=he,y?(he=o0(h,_),he!=null&&N.unshift(F0(h,he,K))):y||(he=o0(h,_),he!=null&&N.push(F0(h,he,K)))),h=h.return}N.length!==0&&o.push({event:c,listeners:N})}var yz=/\r\n?/g,Ez=/\u0000|\uFFFD/g;function vS(o){return(typeof o=="string"?o:""+o).replace(yz,`
`).replace(Ez,"")}function yS(o,c){return c=vS(c),vS(o)===c}function mn(o,c,h,m,y,_){switch(h){case"children":typeof m=="string"?c==="body"||c==="textarea"&&m===""||mt(o,m):(typeof m=="number"||typeof m=="bigint")&&c!=="body"&&mt(o,""+m);break;case"className":Ki(o,"class",m);break;case"tabIndex":Ki(o,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":Ki(o,h,m);break;case"style":on(o,m,_);break;case"data":if(c!=="object"){Ki(o,"data",m);break}case"src":case"href":if(m===""&&(c!=="a"||h!=="href")){o.removeAttribute(h);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){o.removeAttribute(h);break}m=Go(""+m),o.setAttribute(h,m);break;case"action":case"formAction":if(typeof m=="function"){o.setAttribute(h,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof _=="function"&&(h==="formAction"?(c!=="input"&&mn(o,c,"name",y.name,y,null),mn(o,c,"formEncType",y.formEncType,y,null),mn(o,c,"formMethod",y.formMethod,y,null),mn(o,c,"formTarget",y.formTarget,y,null)):(mn(o,c,"encType",y.encType,y,null),mn(o,c,"method",y.method,y,null),mn(o,c,"target",y.target,y,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){o.removeAttribute(h);break}m=Go(""+m),o.setAttribute(h,m);break;case"onClick":m!=null&&(o.onclick=ze);break;case"onScroll":m!=null&&Ft("scroll",o);break;case"onScrollEnd":m!=null&&Ft("scrollend",o);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(h=m.__html,h!=null){if(y.children!=null)throw Error(r(60));o.innerHTML=h}}break;case"multiple":o.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":o.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){o.removeAttribute("xlink:href");break}h=Go(""+m),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?o.setAttribute(h,""+m):o.removeAttribute(h);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?o.setAttribute(h,""):o.removeAttribute(h);break;case"capture":case"download":m===!0?o.setAttribute(h,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?o.setAttribute(h,m):o.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?o.setAttribute(h,m):o.removeAttribute(h);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?o.removeAttribute(h):o.setAttribute(h,m);break;case"popover":Ft("beforetoggle",o),Ft("toggle",o),ii(o,"popover",m);break;case"xlinkActuate":Ni(o,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":Ni(o,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":Ni(o,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":Ni(o,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":Ni(o,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":Ni(o,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":Ni(o,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":Ni(o,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":Ni(o,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":ii(o,"is",m);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=za.get(h)||h,ii(o,h,m))}}function Fy(o,c,h,m,y,_){switch(h){case"style":on(o,m,_);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(h=m.__html,h!=null){if(y.children!=null)throw Error(r(60));o.innerHTML=h}}break;case"children":typeof m=="string"?mt(o,m):(typeof m=="number"||typeof m=="bigint")&&mt(o,""+m);break;case"onScroll":m!=null&&Ft("scroll",o);break;case"onScrollEnd":m!=null&&Ft("scrollend",o);break;case"onClick":m!=null&&(o.onclick=ze);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ou.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(y=h.endsWith("Capture"),c=h.slice(2,y?h.length-7:void 0),_=o[ri]||null,_=_!=null?_[h]:null,typeof _=="function"&&o.removeEventListener(c,_,y),typeof m=="function")){typeof _!="function"&&_!==null&&(h in o?o[h]=null:o.hasAttribute(h)&&o.removeAttribute(h)),o.addEventListener(c,m,y);break e}h in o?o[h]=m:m===!0?o.setAttribute(h,""):ii(o,h,m)}}}function Wr(o,c,h){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ft("error",o),Ft("load",o);var m=!1,y=!1,_;for(_ in h)if(h.hasOwnProperty(_)){var N=h[_];if(N!=null)switch(_){case"src":m=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:mn(o,c,_,N,h,null)}}y&&mn(o,c,"srcSet",h.srcSet,h,null),m&&mn(o,c,"src",h.src,h,null);return;case"input":Ft("invalid",o);var I=_=N=y=null,K=null,he=null;for(m in h)if(h.hasOwnProperty(m)){var ye=h[m];if(ye!=null)switch(m){case"name":y=ye;break;case"type":N=ye;break;case"checked":K=ye;break;case"defaultChecked":he=ye;break;case"value":_=ye;break;case"defaultValue":I=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(r(137,c));break;default:mn(o,c,m,ye,h,null)}}lu(o,_,I,K,he,N,y,!1);return;case"select":Ft("invalid",o),m=N=_=null;for(y in h)if(h.hasOwnProperty(y)&&(I=h[y],I!=null))switch(y){case"value":_=I;break;case"defaultValue":N=I;break;case"multiple":m=I;default:mn(o,c,y,I,h,null)}c=_,h=N,o.multiple=!!m,c!=null?qr(o,!!m,c,!1):h!=null&&qr(o,!!m,h,!0);return;case"textarea":Ft("invalid",o),_=y=m=null;for(N in h)if(h.hasOwnProperty(N)&&(I=h[N],I!=null))switch(N){case"value":m=I;break;case"defaultValue":y=I;break;case"children":_=I;break;case"dangerouslySetInnerHTML":if(I!=null)throw Error(r(91));break;default:mn(o,c,N,I,h,null)}vc(o,m,y,_);return;case"option":for(K in h)if(h.hasOwnProperty(K)&&(m=h[K],m!=null))switch(K){case"selected":o.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:mn(o,c,K,m,h,null)}return;case"dialog":Ft("beforetoggle",o),Ft("toggle",o),Ft("cancel",o),Ft("close",o);break;case"iframe":case"object":Ft("load",o);break;case"video":case"audio":for(m=0;m<U0.length;m++)Ft(U0[m],o);break;case"image":Ft("error",o),Ft("load",o);break;case"details":Ft("toggle",o);break;case"embed":case"source":case"link":Ft("error",o),Ft("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(he in h)if(h.hasOwnProperty(he)&&(m=h[he],m!=null))switch(he){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:mn(o,c,he,m,h,null)}return;default:if(Vo(c)){for(ye in h)h.hasOwnProperty(ye)&&(m=h[ye],m!==void 0&&Fy(o,c,ye,m,h,void 0));return}}for(I in h)h.hasOwnProperty(I)&&(m=h[I],m!=null&&mn(o,c,I,m,h,null))}function _z(o,c,h,m){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,_=null,N=null,I=null,K=null,he=null,ye=null;for(me in h){var Se=h[me];if(h.hasOwnProperty(me)&&Se!=null)switch(me){case"checked":break;case"value":break;case"defaultValue":K=Se;default:m.hasOwnProperty(me)||mn(o,c,me,null,m,Se)}}for(var pe in m){var me=m[pe];if(Se=h[pe],m.hasOwnProperty(pe)&&(me!=null||Se!=null))switch(pe){case"type":_=me;break;case"name":y=me;break;case"checked":he=me;break;case"defaultChecked":ye=me;break;case"value":N=me;break;case"defaultValue":I=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,c));break;default:me!==Se&&mn(o,c,pe,me,m,Se)}}i0(o,N,I,K,he,ye,_,y);return;case"select":me=N=I=pe=null;for(_ in h)if(K=h[_],h.hasOwnProperty(_)&&K!=null)switch(_){case"value":break;case"multiple":me=K;default:m.hasOwnProperty(_)||mn(o,c,_,null,m,K)}for(y in m)if(_=m[y],K=h[y],m.hasOwnProperty(y)&&(_!=null||K!=null))switch(y){case"value":pe=_;break;case"defaultValue":I=_;break;case"multiple":N=_;default:_!==K&&mn(o,c,y,_,m,K)}c=I,h=N,m=me,pe!=null?qr(o,!!h,pe,!1):!!m!=!!h&&(c!=null?qr(o,!!h,c,!0):qr(o,!!h,h?[]:"",!1));return;case"textarea":me=pe=null;for(I in h)if(y=h[I],h.hasOwnProperty(I)&&y!=null&&!m.hasOwnProperty(I))switch(I){case"value":break;case"children":break;default:mn(o,c,I,null,m,y)}for(N in m)if(y=m[N],_=h[N],m.hasOwnProperty(N)&&(y!=null||_!=null))switch(N){case"value":pe=y;break;case"defaultValue":me=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(r(91));break;default:y!==_&&mn(o,c,N,y,m,_)}up(o,pe,me);return;case"option":for(var Ze in h)if(pe=h[Ze],h.hasOwnProperty(Ze)&&pe!=null&&!m.hasOwnProperty(Ze))switch(Ze){case"selected":o.selected=!1;break;default:mn(o,c,Ze,null,m,pe)}for(K in m)if(pe=m[K],me=h[K],m.hasOwnProperty(K)&&pe!==me&&(pe!=null||me!=null))switch(K){case"selected":o.selected=pe&&typeof pe!="function"&&typeof pe!="symbol";break;default:mn(o,c,K,pe,m,me)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ht in h)pe=h[ht],h.hasOwnProperty(ht)&&pe!=null&&!m.hasOwnProperty(ht)&&mn(o,c,ht,null,m,pe);for(he in m)if(pe=m[he],me=h[he],m.hasOwnProperty(he)&&pe!==me&&(pe!=null||me!=null))switch(he){case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(r(137,c));break;default:mn(o,c,he,pe,m,me)}return;default:if(Vo(c)){for(var gn in h)pe=h[gn],h.hasOwnProperty(gn)&&pe!==void 0&&!m.hasOwnProperty(gn)&&Fy(o,c,gn,void 0,m,pe);for(ye in m)pe=m[ye],me=h[ye],!m.hasOwnProperty(ye)||pe===me||pe===void 0&&me===void 0||Fy(o,c,ye,pe,m,me);return}}for(var ae in h)pe=h[ae],h.hasOwnProperty(ae)&&pe!=null&&!m.hasOwnProperty(ae)&&mn(o,c,ae,null,m,pe);for(Se in m)pe=m[Se],me=h[Se],!m.hasOwnProperty(Se)||pe===me||pe==null&&me==null||mn(o,c,Se,pe,m,me)}function ES(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function xz(){if(typeof performance.getEntriesByType=="function"){for(var o=0,c=0,h=performance.getEntriesByType("resource"),m=0;m<h.length;m++){var y=h[m],_=y.transferSize,N=y.initiatorType,I=y.duration;if(_&&I&&ES(N)){for(N=0,I=y.responseEnd,m+=1;m<h.length;m++){var K=h[m],he=K.startTime;if(he>I)break;var ye=K.transferSize,Se=K.initiatorType;ye&&ES(Se)&&(K=K.responseEnd,N+=ye*(K<I?1:(I-he)/(K-he)))}if(--m,c+=8*(_+N)/(y.duration/1e3),o++,10<o)break}}if(0<o)return c/o/1e6}return navigator.connection&&(o=navigator.connection.downlink,typeof o=="number")?o:5}var Hy=null,jy=null;function am(o){return o.nodeType===9?o:o.ownerDocument}function _S(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function xS(o,c){if(o===0)switch(c){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&c==="foreignObject"?0:o}function $y(o,c){return o==="textarea"||o==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.children=="bigint"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var qy=null;function Tz(){var o=window.event;return o&&o.type==="popstate"?o===qy?!1:(qy=o,!0):(qy=null,!1)}var TS=typeof setTimeout=="function"?setTimeout:void 0,Sz=typeof clearTimeout=="function"?clearTimeout:void 0,SS=typeof Promise=="function"?Promise:void 0,wz=typeof queueMicrotask=="function"?queueMicrotask:typeof SS<"u"?function(o){return SS.resolve(null).then(o).catch(kz)}:TS;function kz(o){setTimeout(function(){throw o})}function cl(o){return o==="head"}function wS(o,c){var h=c,m=0;do{var y=h.nextSibling;if(o.removeChild(h),y&&y.nodeType===8)if(h=y.data,h==="/$"||h==="/&"){if(m===0){o.removeChild(y),Yc(c);return}m--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")m++;else if(h==="html")H0(o.ownerDocument.documentElement);else if(h==="head"){h=o.ownerDocument.head,H0(h);for(var _=h.firstChild;_;){var N=_.nextSibling,I=_.nodeName;_[au]||I==="SCRIPT"||I==="STYLE"||I==="LINK"&&_.rel.toLowerCase()==="stylesheet"||h.removeChild(_),_=N}}else h==="body"&&H0(o.ownerDocument.body);h=y}while(h);Yc(c)}function kS(o,c){var h=o;o=0;do{var m=h.nextSibling;if(h.nodeType===1?c?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(c?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),m&&m.nodeType===8)if(h=m.data,h==="/$"){if(o===0)break;o--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||o++;h=m}while(h)}function Vy(o){var c=o.firstChild;for(c&&c.nodeType===10&&(c=c.nextSibling);c;){var h=c;switch(c=c.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":Vy(h),n0(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}o.removeChild(h)}}function Cz(o,c,h,m){for(;o.nodeType===1;){var y=h;if(o.nodeName.toLowerCase()!==c.toLowerCase()){if(!m&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(m){if(!o[au])switch(c){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(_=o.getAttribute("rel"),_==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(_!==y.rel||o.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||o.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||o.getAttribute("title")!==(y.title==null?null:y.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(_=o.getAttribute("src"),(_!==(y.src==null?null:y.src)||o.getAttribute("type")!==(y.type==null?null:y.type)||o.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&_&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(c==="input"&&o.type==="hidden"){var _=y.name==null?null:""+y.name;if(y.type==="hidden"&&o.getAttribute("name")===_)return o}else return o;if(o=Ss(o.nextSibling),o===null)break}return null}function Az(o,c,h){if(c==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!h||(o=Ss(o.nextSibling),o===null))return null;return o}function CS(o,c){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!c||(o=Ss(o.nextSibling),o===null))return null;return o}function Gy(o){return o.data==="$?"||o.data==="$~"}function Yy(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function Nz(o,c){var h=o.ownerDocument;if(o.data==="$~")o._reactRetry=c;else if(o.data!=="$?"||h.readyState!=="loading")c();else{var m=function(){c(),h.removeEventListener("DOMContentLoaded",m)};h.addEventListener("DOMContentLoaded",m),o._reactRetry=m}}function Ss(o){for(;o!=null;o=o.nextSibling){var c=o.nodeType;if(c===1||c===3)break;if(c===8){if(c=o.data,c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"||c==="F!"||c==="F")break;if(c==="/$"||c==="/&")return null}}return o}var Wy=null;function AS(o){o=o.nextSibling;for(var c=0;o;){if(o.nodeType===8){var h=o.data;if(h==="/$"||h==="/&"){if(c===0)return Ss(o.nextSibling);c--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||c++}o=o.nextSibling}return null}function NS(o){o=o.previousSibling;for(var c=0;o;){if(o.nodeType===8){var h=o.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(c===0)return o;c--}else h!=="/$"&&h!=="/&"||c++}o=o.previousSibling}return null}function OS(o,c,h){switch(c=am(h),o){case"html":if(o=c.documentElement,!o)throw Error(r(452));return o;case"head":if(o=c.head,!o)throw Error(r(453));return o;case"body":if(o=c.body,!o)throw Error(r(454));return o;default:throw Error(r(451))}}function H0(o){for(var c=o.attributes;c.length;)o.removeAttributeNode(c[0]);n0(o)}var ws=new Map,MS=new Set;function om(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var eo=ee.d;ee.d={f:Oz,r:Mz,D:Rz,C:Dz,L:Iz,m:Lz,X:Bz,S:Pz,M:zz};function Oz(){var o=eo.f(),c=Zp();return o||c}function Mz(o){var c=Pa(o);c!==null&&c.tag===5&&c.type==="form"?WT(c):eo.r(o)}var qc=typeof document>"u"?null:document;function RS(o,c,h){var m=qc;if(m&&typeof c=="string"&&c){var y=Oi(c);y='link[rel="'+o+'"][href="'+y+'"]',typeof h=="string"&&(y+='[crossorigin="'+h+'"]'),MS.has(y)||(MS.add(y),o={rel:o,crossOrigin:h,href:c},m.querySelector(y)===null&&(c=m.createElement("link"),Wr(c,"link",o),br(c),m.head.appendChild(c)))}}function Rz(o){eo.D(o),RS("dns-prefetch",o,null)}function Dz(o,c){eo.C(o,c),RS("preconnect",o,c)}function Iz(o,c,h){eo.L(o,c,h);var m=qc;if(m&&o&&c){var y='link[rel="preload"][as="'+Oi(c)+'"]';c==="image"&&h&&h.imageSrcSet?(y+='[imagesrcset="'+Oi(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(y+='[imagesizes="'+Oi(h.imageSizes)+'"]')):y+='[href="'+Oi(o)+'"]';var _=y;switch(c){case"style":_=Vc(o);break;case"script":_=Gc(o)}ws.has(_)||(o=p({rel:"preload",href:c==="image"&&h&&h.imageSrcSet?void 0:o,as:c},h),ws.set(_,o),m.querySelector(y)!==null||c==="style"&&m.querySelector(j0(_))||c==="script"&&m.querySelector($0(_))||(c=m.createElement("link"),Wr(c,"link",o),br(c),m.head.appendChild(c)))}}function Lz(o,c){eo.m(o,c);var h=qc;if(h&&o){var m=c&&typeof c.as=="string"?c.as:"script",y='link[rel="modulepreload"][as="'+Oi(m)+'"][href="'+Oi(o)+'"]',_=y;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=Gc(o)}if(!ws.has(_)&&(o=p({rel:"modulepreload",href:o},c),ws.set(_,o),h.querySelector(y)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector($0(_)))return}m=h.createElement("link"),Wr(m,"link",o),br(m),h.head.appendChild(m)}}}function Pz(o,c,h){eo.S(o,c,h);var m=qc;if(m&&o){var y=qo(m).hoistableStyles,_=Vc(o);c=c||"default";var N=y.get(_);if(!N){var I={loading:0,preload:null};if(N=m.querySelector(j0(_)))I.loading=5;else{o=p({rel:"stylesheet",href:o,"data-precedence":c},h),(h=ws.get(_))&&Ky(o,h);var K=N=m.createElement("link");br(K),Wr(K,"link",o),K._p=new Promise(function(he,ye){K.onload=he,K.onerror=ye}),K.addEventListener("load",function(){I.loading|=1}),K.addEventListener("error",function(){I.loading|=2}),I.loading|=4,lm(N,c,m)}N={type:"stylesheet",instance:N,count:1,state:I},y.set(_,N)}}}function Bz(o,c){eo.X(o,c);var h=qc;if(h&&o){var m=qo(h).hoistableScripts,y=Gc(o),_=m.get(y);_||(_=h.querySelector($0(y)),_||(o=p({src:o,async:!0},c),(c=ws.get(y))&&Xy(o,c),_=h.createElement("script"),br(_),Wr(_,"link",o),h.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},m.set(y,_))}}function zz(o,c){eo.M(o,c);var h=qc;if(h&&o){var m=qo(h).hoistableScripts,y=Gc(o),_=m.get(y);_||(_=h.querySelector($0(y)),_||(o=p({src:o,async:!0,type:"module"},c),(c=ws.get(y))&&Xy(o,c),_=h.createElement("script"),br(_),Wr(_,"link",o),h.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},m.set(y,_))}}function DS(o,c,h,m){var y=(y=He.current)?om(y):null;if(!y)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(c=Vc(h.href),h=qo(y).hoistableStyles,m=h.get(c),m||(m={type:"style",instance:null,count:0,state:null},h.set(c,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){o=Vc(h.href);var _=qo(y).hoistableStyles,N=_.get(o);if(N||(y=y.ownerDocument||y,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(o,N),(_=y.querySelector(j0(o)))&&!_._p&&(N.instance=_,N.state.loading=5),ws.has(o)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},ws.set(o,h),_||Uz(y,o,h,N.state))),c&&m===null)throw Error(r(528,""));return N}if(c&&m!==null)throw Error(r(529,""));return null;case"script":return c=h.async,h=h.src,typeof h=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=Gc(h),h=qo(y).hoistableScripts,m=h.get(c),m||(m={type:"script",instance:null,count:0,state:null},h.set(c,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function Vc(o){return'href="'+Oi(o)+'"'}function j0(o){return'link[rel="stylesheet"]['+o+"]"}function IS(o){return p({},o,{"data-precedence":o.precedence,precedence:null})}function Uz(o,c,h,m){o.querySelector('link[rel="preload"][as="style"]['+c+"]")?m.loading=1:(c=o.createElement("link"),m.preload=c,c.addEventListener("load",function(){return m.loading|=1}),c.addEventListener("error",function(){return m.loading|=2}),Wr(c,"link",h),br(c),o.head.appendChild(c))}function Gc(o){return'[src="'+Oi(o)+'"]'}function $0(o){return"script[async]"+o}function LS(o,c,h){if(c.count++,c.instance===null)switch(c.type){case"style":var m=o.querySelector('style[data-href~="'+Oi(h.href)+'"]');if(m)return c.instance=m,br(m),m;var y=p({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return m=(o.ownerDocument||o).createElement("style"),br(m),Wr(m,"style",y),lm(m,h.precedence,o),c.instance=m;case"stylesheet":y=Vc(h.href);var _=o.querySelector(j0(y));if(_)return c.state.loading|=4,c.instance=_,br(_),_;m=IS(h),(y=ws.get(y))&&Ky(m,y),_=(o.ownerDocument||o).createElement("link"),br(_);var N=_;return N._p=new Promise(function(I,K){N.onload=I,N.onerror=K}),Wr(_,"link",m),c.state.loading|=4,lm(_,h.precedence,o),c.instance=_;case"script":return _=Gc(h.src),(y=o.querySelector($0(_)))?(c.instance=y,br(y),y):(m=h,(y=ws.get(_))&&(m=p({},h),Xy(m,y)),o=o.ownerDocument||o,y=o.createElement("script"),br(y),Wr(y,"link",m),o.head.appendChild(y),c.instance=y);case"void":return null;default:throw Error(r(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(m=c.instance,c.state.loading|=4,lm(m,h.precedence,o));return c.instance}function lm(o,c,h){for(var m=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=m.length?m[m.length-1]:null,_=y,N=0;N<m.length;N++){var I=m[N];if(I.dataset.precedence===c)_=I;else if(_!==y)break}_?_.parentNode.insertBefore(o,_.nextSibling):(c=h.nodeType===9?h.head:h,c.insertBefore(o,c.firstChild))}function Ky(o,c){o.crossOrigin==null&&(o.crossOrigin=c.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=c.referrerPolicy),o.title==null&&(o.title=c.title)}function Xy(o,c){o.crossOrigin==null&&(o.crossOrigin=c.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=c.referrerPolicy),o.integrity==null&&(o.integrity=c.integrity)}var um=null;function PS(o,c,h){if(um===null){var m=new Map,y=um=new Map;y.set(h,m)}else y=um,m=y.get(h),m||(m=new Map,y.set(h,m));if(m.has(o))return m;for(m.set(o,null),h=h.getElementsByTagName(o),y=0;y<h.length;y++){var _=h[y];if(!(_[au]||_[cr]||o==="link"&&_.getAttribute("rel")==="stylesheet")&&_.namespaceURI!=="http://www.w3.org/2000/svg"){var N=_.getAttribute(c)||"";N=o+N;var I=m.get(N);I?I.push(_):m.set(N,[_])}}return m}function BS(o,c,h){o=o.ownerDocument||o,o.head.insertBefore(h,c==="title"?o.querySelector("head > title"):null)}function Fz(o,c,h){if(h===1||c.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;switch(c.rel){case"stylesheet":return o=c.disabled,typeof c.precedence=="string"&&o==null;default:return!0}case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function zS(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function Hz(o,c,h,m){if(h.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var y=Vc(m.href),_=c.querySelector(j0(y));if(_){c=_._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(o.count++,o=cm.bind(o),c.then(o,o)),h.state.loading|=4,h.instance=_,br(_);return}_=c.ownerDocument||c,m=IS(m),(y=ws.get(y))&&Ky(m,y),_=_.createElement("link"),br(_);var N=_;N._p=new Promise(function(I,K){N.onload=I,N.onerror=K}),Wr(_,"link",m),h.instance=_}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(h,c),(c=h.state.preload)&&(h.state.loading&3)===0&&(o.count++,h=cm.bind(o),c.addEventListener("load",h),c.addEventListener("error",h))}}var Qy=0;function jz(o,c){return o.stylesheets&&o.count===0&&fm(o,o.stylesheets),0<o.count||0<o.imgCount?function(h){var m=setTimeout(function(){if(o.stylesheets&&fm(o,o.stylesheets),o.unsuspend){var _=o.unsuspend;o.unsuspend=null,_()}},6e4+c);0<o.imgBytes&&Qy===0&&(Qy=62500*xz());var y=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&fm(o,o.stylesheets),o.unsuspend)){var _=o.unsuspend;o.unsuspend=null,_()}},(o.imgBytes>Qy?50:800)+c);return o.unsuspend=h,function(){o.unsuspend=null,clearTimeout(m),clearTimeout(y)}}:null}function cm(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)fm(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var dm=null;function fm(o,c){o.stylesheets=null,o.unsuspend!==null&&(o.count++,dm=new Map,c.forEach($z,o),dm=null,cm.call(o))}function $z(o,c){if(!(c.state.loading&4)){var h=dm.get(o);if(h)var m=h.get(null);else{h=new Map,dm.set(o,h);for(var y=o.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_<y.length;_++){var N=y[_];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(h.set(N.dataset.precedence,N),m=N)}m&&h.set(null,m)}y=c.instance,N=y.getAttribute("data-precedence"),_=h.get(N)||m,_===m&&h.set(null,y),h.set(N,y),this.count++,m=cm.bind(this),y.addEventListener("load",m),y.addEventListener("error",m),_?_.parentNode.insertBefore(y,_.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(y,o.firstChild)),c.state.loading|=4}}var q0={$$typeof:O,Provider:null,Consumer:null,_currentValue:ce,_currentValue2:ce,_threadCount:0};function qz(o,c,h,m,y,_,N,I,K){this.tag=1,this.containerInfo=o,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Rn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rn(0),this.hiddenUpdates=Rn(null),this.identifierPrefix=m,this.onUncaughtError=y,this.onCaughtError=_,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=K,this.incompleteTransitions=new Map}function US(o,c,h,m,y,_,N,I,K,he,ye,Se){return o=new qz(o,c,h,N,K,he,ye,Se,I),c=1,_===!0&&(c|=24),_=Zi(3,null,null,c),o.current=_,_.stateNode=o,c=Ov(),c.refCount++,o.pooledCache=c,c.refCount++,_.memoizedState={element:m,isDehydrated:h,cache:c},Iv(_),o}function FS(o){return o?(o=Tc,o):Tc}function HS(o,c,h,m,y,_){y=FS(y),m.context===null?m.context=y:m.pendingContext=y,m=Jo(c),m.payload={element:h},_=_===void 0?null:_,_!==null&&(m.callback=_),h=el(o,m,c),h!==null&&(Pi(h,o,c),x0(h,o,c))}function jS(o,c){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var h=o.retryLane;o.retryLane=h!==0&&h<c?h:c}}function Zy(o,c){jS(o,c),(o=o.alternate)&&jS(o,c)}function $S(o){if(o.tag===13||o.tag===31){var c=fu(o,67108864);c!==null&&Pi(c,o,67108864),Zy(o,67108864)}}function qS(o){if(o.tag===13||o.tag===31){var c=rs();c=Fn(c);var h=fu(o,c);h!==null&&Pi(h,o,c),Zy(o,c)}}var hm=!0;function Vz(o,c,h,m){var y=X.T;X.T=null;var _=ee.p;try{ee.p=2,Jy(o,c,h,m)}finally{ee.p=_,X.T=y}}function Gz(o,c,h,m){var y=X.T;X.T=null;var _=ee.p;try{ee.p=8,Jy(o,c,h,m)}finally{ee.p=_,X.T=y}}function Jy(o,c,h,m){if(hm){var y=e2(m);if(y===null)Uy(o,c,m,pm,h),GS(o,m);else if(Wz(y,o,c,h,m))m.stopPropagation();else if(GS(o,m),c&4&&-1<Yz.indexOf(o)){for(;y!==null;){var _=Pa(y);if(_!==null)switch(_.tag){case 3:if(_=_.stateNode,_.current.memoizedState.isDehydrated){var N=It(_.pendingLanes);if(N!==0){var I=_;for(I.pendingLanes|=2,I.entangledLanes|=2;N;){var K=1<<31-xt(N);I.entanglements[1]|=K,N&=~K}la(_),(tn&6)===0&&(Xp=fn()+500,z0(0))}}break;case 31:case 13:I=fu(_,2),I!==null&&Pi(I,_,2),Zp(),Zy(_,2)}if(_=e2(m),_===null&&Uy(o,c,m,pm,h),_===y)break;y=_}y!==null&&m.stopPropagation()}else Uy(o,c,m,null,h)}}function e2(o){return o=Ct(o),t2(o)}var pm=null;function t2(o){if(pm=null,o=pi(o),o!==null){var c=s(o);if(c===null)o=null;else{var h=c.tag;if(h===13){if(o=a(c),o!==null)return o;o=null}else if(h===31){if(o=l(c),o!==null)return o;o=null}else if(h===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;o=null}else c!==o&&(o=null)}}return pm=o,null}function VS(o){switch(o){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(lr()){case ge:return 2;case Re:return 8;case lt:case Ae:return 32;case pt:return 268435456;default:return 32}default:return 32}}var n2=!1,dl=null,fl=null,hl=null,V0=new Map,G0=new Map,pl=[],Yz="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function GS(o,c){switch(o){case"focusin":case"focusout":dl=null;break;case"dragenter":case"dragleave":fl=null;break;case"mouseover":case"mouseout":hl=null;break;case"pointerover":case"pointerout":V0.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":G0.delete(c.pointerId)}}function Y0(o,c,h,m,y,_){return o===null||o.nativeEvent!==_?(o={blockedOn:c,domEventName:h,eventSystemFlags:m,nativeEvent:_,targetContainers:[y]},c!==null&&(c=Pa(c),c!==null&&$S(c)),o):(o.eventSystemFlags|=m,c=o.targetContainers,y!==null&&c.indexOf(y)===-1&&c.push(y),o)}function Wz(o,c,h,m,y){switch(c){case"focusin":return dl=Y0(dl,o,c,h,m,y),!0;case"dragenter":return fl=Y0(fl,o,c,h,m,y),!0;case"mouseover":return hl=Y0(hl,o,c,h,m,y),!0;case"pointerover":var _=y.pointerId;return V0.set(_,Y0(V0.get(_)||null,o,c,h,m,y)),!0;case"gotpointercapture":return _=y.pointerId,G0.set(_,Y0(G0.get(_)||null,o,c,h,m,y)),!0}return!1}function YS(o){var c=pi(o.target);if(c!==null){var h=s(c);if(h!==null){if(c=h.tag,c===13){if(c=a(h),c!==null){o.blockedOn=c,hc(o.priority,function(){qS(h)});return}}else if(c===31){if(c=l(h),c!==null){o.blockedOn=c,hc(o.priority,function(){qS(h)});return}}else if(c===3&&h.stateNode.current.memoizedState.isDehydrated){o.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}o.blockedOn=null}function mm(o){if(o.blockedOn!==null)return!1;for(var c=o.targetContainers;0<c.length;){var h=e2(o.nativeEvent);if(h===null){h=o.nativeEvent;var m=new h.constructor(h.type,h);tt=m,h.target.dispatchEvent(m),tt=null}else return c=Pa(h),c!==null&&$S(c),o.blockedOn=h,!1;c.shift()}return!0}function WS(o,c,h){mm(o)&&h.delete(c)}function Kz(){n2=!1,dl!==null&&mm(dl)&&(dl=null),fl!==null&&mm(fl)&&(fl=null),hl!==null&&mm(hl)&&(hl=null),V0.forEach(WS),G0.forEach(WS)}function gm(o,c){o.blockedOn===c&&(o.blockedOn=null,n2||(n2=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Kz)))}var bm=null;function KS(o){bm!==o&&(bm=o,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){bm===o&&(bm=null);for(var c=0;c<o.length;c+=3){var h=o[c],m=o[c+1],y=o[c+2];if(typeof m!="function"){if(t2(m||h)===null)continue;break}var _=Pa(h);_!==null&&(o.splice(c,3),c-=3,ey(_,{pending:!0,data:y,method:h.method,action:m},m,y))}}))}function Yc(o){function c(K){return gm(K,o)}dl!==null&&gm(dl,o),fl!==null&&gm(fl,o),hl!==null&&gm(hl,o),V0.forEach(c),G0.forEach(c);for(var h=0;h<pl.length;h++){var m=pl[h];m.blockedOn===o&&(m.blockedOn=null)}for(;0<pl.length&&(h=pl[0],h.blockedOn===null);)YS(h),h.blockedOn===null&&pl.shift();if(h=(o.ownerDocument||o).$$reactFormReplay,h!=null)for(m=0;m<h.length;m+=3){var y=h[m],_=h[m+1],N=y[ri]||null;if(typeof _=="function")N||KS(h);else if(N){var I=null;if(_&&_.hasAttribute("formAction")){if(y=_,N=_[ri]||null)I=N.formAction;else if(t2(y)!==null)continue}else I=N.action;typeof I=="function"?h[m+1]=I:(h.splice(m,3),m-=3),KS(h)}}}function XS(){function o(_){_.canIntercept&&_.info==="react-transition"&&_.intercept({handler:function(){return new Promise(function(N){return y=N})},focusReset:"manual",scroll:"manual"})}function c(){y!==null&&(y(),y=null),m||setTimeout(h,20)}function h(){if(!m&&!navigation.transition){var _=navigation.currentEntry;_&&_.url!=null&&navigation.navigate(_.url,{state:_.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,y=null;return navigation.addEventListener("navigate",o),navigation.addEventListener("navigatesuccess",c),navigation.addEventListener("navigateerror",c),setTimeout(h,100),function(){m=!0,navigation.removeEventListener("navigate",o),navigation.removeEventListener("navigatesuccess",c),navigation.removeEventListener("navigateerror",c),y!==null&&(y(),y=null)}}}function r2(o){this._internalRoot=o}vm.prototype.render=r2.prototype.render=function(o){var c=this._internalRoot;if(c===null)throw Error(r(409));var h=c.current,m=rs();HS(h,m,o,c,null,null)},vm.prototype.unmount=r2.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var c=o.containerInfo;HS(o.current,2,null,o,null,null),Zp(),c[jo]=null}};function vm(o){this._internalRoot=o}vm.prototype.unstable_scheduleHydration=function(o){if(o){var c=fc();o={blockedOn:null,target:o,priority:c};for(var h=0;h<pl.length&&c!==0&&c<pl[h].priority;h++);pl.splice(h,0,o),h===0&&YS(o)}};var QS=e.version;if(QS!=="19.2.4")throw Error(r(527,QS,"19.2.4"));ee.findDOMNode=function(o){var c=o._reactInternals;if(c===void 0)throw typeof o.render=="function"?Error(r(188)):(o=Object.keys(o).join(","),Error(r(268,o)));return o=d(c),o=o!==null?f(o):null,o=o===null?null:o.stateNode,o};var Xz={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:X,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ym=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ym.isDisabled&&ym.supportsFiber)try{Yn=ym.inject(Xz),hn=ym}catch{}}return K0.createRoot=function(o,c){if(!i(o))throw Error(r(299));var h=!1,m="",y=i5,_=s5,N=a5;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(m=c.identifierPrefix),c.onUncaughtError!==void 0&&(y=c.onUncaughtError),c.onCaughtError!==void 0&&(_=c.onCaughtError),c.onRecoverableError!==void 0&&(N=c.onRecoverableError)),c=US(o,1,!1,null,null,h,m,null,y,_,N,XS),o[jo]=c.current,zy(o),new r2(c)},K0.hydrateRoot=function(o,c,h){if(!i(o))throw Error(r(299));var m=!1,y="",_=i5,N=s5,I=a5,K=null;return h!=null&&(h.unstable_strictMode===!0&&(m=!0),h.identifierPrefix!==void 0&&(y=h.identifierPrefix),h.onUncaughtError!==void 0&&(_=h.onUncaughtError),h.onCaughtError!==void 0&&(N=h.onCaughtError),h.onRecoverableError!==void 0&&(I=h.onRecoverableError),h.formState!==void 0&&(K=h.formState)),c=US(o,1,!0,c,h??null,m,y,K,_,N,I,XS),c.context=FS(null),h=c.current,m=rs(),m=Fn(m),y=Jo(m),y.callback=null,el(h,y,m),h=m,c.current.lanes=h,yn(c,h),la(c),o[jo]=c.current,zy(o),new vm(c)},K0.version="19.2.4",K0}var ow;function oU(){if(ow)return a2.exports;ow=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),a2.exports=aU(),a2.exports}var lU=oU();const ZA=z.createContext({theme:"system",resolvedTheme:"light",setTheme:()=>{},toggleTheme:()=>{}}),JA=()=>z.useContext(ZA),u4="cycls_theme_preference",lw=()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",uw=()=>{if(typeof window>"u")return"system";try{return localStorage.getItem(u4)||"system"}catch{return"system"}},cw=(t,e)=>{const n=document.documentElement;n.classList.remove("light","dark"),n.removeAttribute("data-theme"),t==="system"?n.setAttribute("data-resolved-theme",e):(n.classList.add(t),n.setAttribute("data-theme",t),n.setAttribute("data-resolved-theme",t))},c2=({children:t})=>{const[e,n]=z.useState(()=>uw()),[r,i]=z.useState(()=>{const u=uw();return u==="system"?lw():u});z.useEffect(()=>{const u=window.matchMedia("(prefers-color-scheme: dark)"),d=f=>{if(e==="system"){const p=f.matches?"dark":"light";i(p),cw("system",p)}};return u.addEventListener("change",d),()=>u.removeEventListener("change",d)},[e]),z.useEffect(()=>{const u=e==="system"?lw():e;cw(e,u),requestAnimationFrame(()=>{i(u)})},[e]);const s=z.useCallback(u=>{n(u);try{u==="system"?localStorage.removeItem(u4):localStorage.setItem(u4,u)}catch{}},[]),a=z.useCallback(()=>{s(r==="dark"?"light":"dark")},[r,s]),l={theme:e,resolvedTheme:r,setTheme:s,toggleTheme:a};return A.jsx(ZA.Provider,{value:l,children:t})},e9=({className:t=""})=>{const{resolvedTheme:e,toggleTheme:n}=JA(),r=e==="dark";return A.jsx("button",{onClick:n,className:`
        theme-toggle
        inline-flex items-center justify-center
        rounded-xl p-2
        hover:bg-[var(--bg-hover)] active:bg-[var(--bg-active)]
        focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--text-primary)]/20
        transition-colors duration-200
        ${t}
      `,"aria-label":r?"Switch to light mode":"Switch to dark mode",title:r?"Light mode":"Dark mode",children:r?A.jsxs("svg",{className:"theme-toggle-icon w-5 h-5 text-[var(--text-primary)]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[A.jsx("circle",{cx:"12",cy:"12",r:"4"}),A.jsx("path",{d:"M12 2v2"}),A.jsx("path",{d:"M12 20v2"}),A.jsx("path",{d:"M4.93 4.93l1.41 1.41"}),A.jsx("path",{d:"M17.66 17.66l1.41 1.41"}),A.jsx("path",{d:"M2 12h2"}),A.jsx("path",{d:"M20 12h2"}),A.jsx("path",{d:"M6.34 17.66l-1.41 1.41"}),A.jsx("path",{d:"M19.07 4.93l-1.41 1.41"})]}):A.jsx("svg",{className:"theme-toggle-icon w-5 h-5 text-[var(--text-primary)]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:A.jsx("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"})})})},c4=z.createContext(!1),uU=()=>z.useContext(c4);/**
 * react-router v7.13.0
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */var dw="popstate";function cU(t={}){function e(r,i){let{pathname:s,search:a,hash:l}=r.location;return d4("",{pathname:s,search:a,hash:l},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:ih(i)}return fU(e,n,null,t)}function $n(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Zs(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function dU(){return Math.random().toString(36).substring(2,10)}function fw(t,e){return{usr:t.state,key:t.key,idx:e}}function d4(t,e,n=null,r){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?Fd(e):e,state:n,key:e&&e.key||r||dU()}}function ih({pathname:t="/",search:e="",hash:n=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Fd(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substring(r),t=t.substring(0,r)),t&&(e.pathname=t)}return e}function fU(t,e,n,r={}){let{window:i=document.defaultView,v5Compat:s=!1}=r,a=i.history,l="POP",u=null,d=f();d==null&&(d=0,a.replaceState({...a.state,idx:d},""));function f(){return(a.state||{idx:null}).idx}function p(){l="POP";let x=f(),S=x==null?null:x-d;d=x,u&&u({action:l,location:E.location,delta:S})}function g(x,S){l="PUSH";let C=d4(E.location,x,S);d=f()+1;let O=fw(C,d),L=E.createHref(C);try{a.pushState(O,"",L)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;i.location.assign(L)}s&&u&&u({action:l,location:E.location,delta:1})}function b(x,S){l="REPLACE";let C=d4(E.location,x,S);d=f();let O=fw(C,d),L=E.createHref(C);a.replaceState(O,"",L),s&&u&&u({action:l,location:E.location,delta:0})}function v(x){return hU(x)}let E={get action(){return l},get location(){return t(i,a)},listen(x){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(dw,p),u=x,()=>{i.removeEventListener(dw,p),u=null}},createHref(x){return e(i,x)},createURL:v,encodeLocation(x){let S=v(x);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:g,replace:b,go(x){return a.go(x)}};return E}function hU(t,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),$n(n,"No window.location.(origin|href) available to create URL");let r=typeof t=="string"?t:ih(t);return r=r.replace(/ $/,"%20"),!e&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function t9(t,e,n="/"){return pU(t,e,n,!1)}function pU(t,e,n,r){let i=typeof e=="string"?Fd(e):e,s=No(i.pathname||"/",n);if(s==null)return null;let a=n9(t);mU(a);let l=null;for(let u=0;l==null&&u<a.length;++u){let d=kU(s);l=SU(a[u],d,r)}return l}function n9(t,e=[],n=[],r="",i=!1){let s=(a,l,u=i,d)=>{let f={relativePath:d===void 0?a.path||"":d,caseSensitive:a.caseSensitive===!0,childrenIndex:l,route:a};if(f.relativePath.startsWith("/")){if(!f.relativePath.startsWith(r)&&u)return;$n(f.relativePath.startsWith(r),`Absolute route path "${f.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(r.length)}let p=To([r,f.relativePath]),g=n.concat(f);a.children&&a.children.length>0&&($n(a.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),n9(a.children,e,g,p,u)),!(a.path==null&&!a.index)&&e.push({path:p,score:xU(p,a.index),routesMeta:g})};return t.forEach((a,l)=>{var u;if(a.path===""||!((u=a.path)!=null&&u.includes("?")))s(a,l);else for(let d of r9(a.path))s(a,l,!0,d)}),e}function r9(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let a=r9(r.join("/")),l=[];return l.push(...a.map(u=>u===""?s:[s,u].join("/"))),i&&l.push(...a),l.map(u=>t.startsWith("/")&&u===""?"/":u)}function mU(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:TU(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var gU=/^:[\w-]+$/,bU=3,vU=2,yU=1,EU=10,_U=-2,hw=t=>t==="*";function xU(t,e){let n=t.split("/"),r=n.length;return n.some(hw)&&(r+=_U),e&&(r+=vU),n.filter(i=>!hw(i)).reduce((i,s)=>i+(gU.test(s)?bU:s===""?yU:EU),r)}function TU(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function SU(t,e,n=!1){let{routesMeta:r}=t,i={},s="/",a=[];for(let l=0;l<r.length;++l){let u=r[l],d=l===r.length-1,f=s==="/"?e:e.slice(s.length)||"/",p=Ig({path:u.relativePath,caseSensitive:u.caseSensitive,end:d},f),g=u.route;if(!p&&d&&n&&!r[r.length-1].route.index&&(p=Ig({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},f)),!p)return null;Object.assign(i,p.params),a.push({params:i,pathname:To([s,p.pathname]),pathnameBase:OU(To([s,p.pathnameBase])),route:g}),p.pathnameBase!=="/"&&(s=To([s,p.pathnameBase]))}return a}function Ig(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=wU(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let s=i[0],a=s.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:r.reduce((d,{paramName:f,isOptional:p},g)=>{if(f==="*"){let v=l[g]||"";a=s.slice(0,s.length-v.length).replace(/(.)\/+$/,"$1")}const b=l[g];return p&&!b?d[f]=void 0:d[f]=(b||"").replace(/%2F/g,"/"),d},{}),pathname:s,pathnameBase:a,pattern:t}}function wU(t,e=!1,n=!0){Zs(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,l,u)=>(r.push({paramName:l,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function kU(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Zs(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function No(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}var CU=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function AU(t,e="/"){let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?Fd(t):t,s;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?s=pw(n.substring(1),"/"):s=pw(n,e)):s=e,{pathname:s,search:MU(r),hash:RU(i)}}function pw(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function d2(t,e,n,r){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(r)}].  Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function NU(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function a_(t){let e=NU(t);return e.map((n,r)=>r===e.length-1?n.pathname:n.pathnameBase)}function o_(t,e,n,r=!1){let i;typeof t=="string"?i=Fd(t):(i={...t},$n(!i.pathname||!i.pathname.includes("?"),d2("?","pathname","search",i)),$n(!i.pathname||!i.pathname.includes("#"),d2("#","pathname","hash",i)),$n(!i.search||!i.search.includes("#"),d2("#","search","hash",i)));let s=t===""||i.pathname==="",a=s?"/":i.pathname,l;if(a==null)l=n;else{let p=e.length-1;if(!r&&a.startsWith("..")){let g=a.split("/");for(;g[0]==="..";)g.shift(),p-=1;i.pathname=g.join("/")}l=p>=0?e[p]:"/"}let u=AU(i,l),d=a&&a!=="/"&&a.endsWith("/"),f=(s||a===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(d||f)&&(u.pathname+="/"),u}var To=t=>t.join("/").replace(/\/\/+/g,"/"),OU=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),MU=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,RU=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,DU=class{constructor(t,e,n,r=!1){this.status=t,this.statusText=e||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function IU(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function LU(t){return t.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var i9=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function s9(t,e){let n=t;if(typeof n!="string"||!CU.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(i9)try{let s=new URL(window.location.href),a=n.startsWith("//")?new URL(s.protocol+n):new URL(n),l=No(a.pathname,e);a.origin===s.origin&&l!=null?n=l+a.search+a.hash:i=!0}catch{Zs(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var a9=["POST","PUT","PATCH","DELETE"];new Set(a9);var PU=["GET",...a9];new Set(PU);var Hd=z.createContext(null);Hd.displayName="DataRouter";var ob=z.createContext(null);ob.displayName="DataRouterState";var BU=z.createContext(!1),o9=z.createContext({isTransitioning:!1});o9.displayName="ViewTransition";var zU=z.createContext(new Map);zU.displayName="Fetchers";var UU=z.createContext(null);UU.displayName="Await";var ps=z.createContext(null);ps.displayName="Navigation";var Rh=z.createContext(null);Rh.displayName="Location";var Na=z.createContext({outlet:null,matches:[],isDataRoute:!1});Na.displayName="Route";var l_=z.createContext(null);l_.displayName="RouteError";var l9="REACT_ROUTER_ERROR",FU="REDIRECT",HU="ROUTE_ERROR_RESPONSE";function jU(t){if(t.startsWith(`${l9}:${FU}:{`))try{let e=JSON.parse(t.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function $U(t){if(t.startsWith(`${l9}:${HU}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new DU(e.status,e.statusText,e.data)}catch{}}function qU(t,{relative:e}={}){$n(jd(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=z.useContext(ps),{hash:i,pathname:s,search:a}=Dh(t,{relative:e}),l=s;return n!=="/"&&(l=s==="/"?n:To([n,s])),r.createHref({pathname:l,search:a,hash:i})}function jd(){return z.useContext(Rh)!=null}function Lo(){return $n(jd(),"useLocation() may be used only in the context of a <Router> component."),z.useContext(Rh).location}var u9="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function c9(t){z.useContext(ps).static||z.useLayoutEffect(t)}function d9(){let{isDataRoute:t}=z.useContext(Na);return t?rF():VU()}function VU(){$n(jd(),"useNavigate() may be used only in the context of a <Router> component.");let t=z.useContext(Hd),{basename:e,navigator:n}=z.useContext(ps),{matches:r}=z.useContext(Na),{pathname:i}=Lo(),s=JSON.stringify(a_(r)),a=z.useRef(!1);return c9(()=>{a.current=!0}),z.useCallback((u,d={})=>{if(Zs(a.current,u9),!a.current)return;if(typeof u=="number"){n.go(u);return}let f=o_(u,JSON.parse(s),i,d.relative==="path");t==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:To([e,f.pathname])),(d.replace?n.replace:n.push)(f,d.state,d)},[e,n,s,i,t])}z.createContext(null);function Dh(t,{relative:e}={}){let{matches:n}=z.useContext(Na),{pathname:r}=Lo(),i=JSON.stringify(a_(n));return z.useMemo(()=>o_(t,JSON.parse(i),r,e==="path"),[t,i,r,e])}function GU(t,e){return f9(t,e)}function f9(t,e,n,r,i){var C;$n(jd(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=z.useContext(ps),{matches:a}=z.useContext(Na),l=a[a.length-1],u=l?l.params:{},d=l?l.pathname:"/",f=l?l.pathnameBase:"/",p=l&&l.route;{let O=p&&p.path||"";p9(d,!p||O.endsWith("*")||O.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${O}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.

Please change the parent <Route path="${O}"> to <Route path="${O==="/"?"*":`${O}/*`}">.`)}let g=Lo(),b;if(e){let O=typeof e=="string"?Fd(e):e;$n(f==="/"||((C=O.pathname)==null?void 0:C.startsWith(f)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${f}" but pathname "${O.pathname}" was given in the \`location\` prop.`),b=O}else b=g;let v=b.pathname||"/",E=v;if(f!=="/"){let O=f.replace(/^\//,"").split("/");E="/"+v.replace(/^\//,"").split("/").slice(O.length).join("/")}let x=t9(t,{pathname:E});Zs(p||x!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Zs(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let S=QU(x&&x.map(O=>Object.assign({},O,{params:Object.assign({},u,O.params),pathname:To([f,s.encodeLocation?s.encodeLocation(O.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:O.pathname]),pathnameBase:O.pathnameBase==="/"?f:To([f,s.encodeLocation?s.encodeLocation(O.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:O.pathnameBase])})),a,n,r,i);return e&&S?z.createElement(Rh.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...b},navigationType:"POP"}},S):S}function YU(){let t=nF(),e=IU(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},a=null;return console.error("Error handled by React Router default ErrorBoundary:",t),a=z.createElement(z.Fragment,null,z.createElement("p",null,"💿 Hey developer 👋"),z.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",z.createElement("code",{style:s},"ErrorBoundary")," or"," ",z.createElement("code",{style:s},"errorElement")," prop on your route.")),z.createElement(z.Fragment,null,z.createElement("h2",null,"Unexpected Application Error!"),z.createElement("h3",{style:{fontStyle:"italic"}},e),n?z.createElement("pre",{style:i},n):null,a)}var WU=z.createElement(YU,null),h9=class extends z.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.onError?this.props.onError(t,e):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const n=$U(t.digest);n&&(t=n)}let e=t!==void 0?z.createElement(Na.Provider,{value:this.props.routeContext},z.createElement(l_.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?z.createElement(KU,{error:t},e):e}};h9.contextType=BU;var f2=new WeakMap;function KU({children:t,error:e}){let{basename:n}=z.useContext(ps);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let r=jU(e.digest);if(r){let i=f2.get(e);if(i)throw i;let s=s9(r.location,n);if(i9&&!f2.get(e))if(s.isExternal||r.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const a=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:r.replace}));throw f2.set(e,a),a}return z.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return t}function XU({routeContext:t,match:e,children:n}){let r=z.useContext(Hd);return r&&r.static&&r.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=e.route.id),z.createElement(Na.Provider,{value:t},n)}function QU(t,e=[],n=null,r=null,i=null){if(t==null){if(!n)return null;if(n.errors)t=n.matches;else if(e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let s=t,a=n==null?void 0:n.errors;if(a!=null){let f=s.findIndex(p=>p.route.id&&(a==null?void 0:a[p.route.id])!==void 0);$n(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),s=s.slice(0,Math.min(s.length,f+1))}let l=!1,u=-1;if(n)for(let f=0;f<s.length;f++){let p=s[f];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(u=f),p.route.id){let{loaderData:g,errors:b}=n,v=p.route.loader&&!g.hasOwnProperty(p.route.id)&&(!b||b[p.route.id]===void 0);if(p.route.lazy||v){l=!0,u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}let d=n&&r?(f,p)=>{var g,b;r(f,{location:n.location,params:((b=(g=n.matches)==null?void 0:g[0])==null?void 0:b.params)??{},unstable_pattern:LU(n.matches),errorInfo:p})}:void 0;return s.reduceRight((f,p,g)=>{let b,v=!1,E=null,x=null;n&&(b=a&&p.route.id?a[p.route.id]:void 0,E=p.route.errorElement||WU,l&&(u<0&&g===0?(p9("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,x=null):u===g&&(v=!0,x=p.route.hydrateFallbackElement||null)));let S=e.concat(s.slice(0,g+1)),C=()=>{let O;return b?O=E:v?O=x:p.route.Component?O=z.createElement(p.route.Component,null):p.route.element?O=p.route.element:O=f,z.createElement(XU,{match:p,routeContext:{outlet:f,matches:S,isDataRoute:n!=null},children:O})};return n&&(p.route.ErrorBoundary||p.route.errorElement||g===0)?z.createElement(h9,{location:n.location,revalidation:n.revalidation,component:E,error:b,children:C(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:d}):C()},null)}function u_(t){return`${t} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function ZU(t){let e=z.useContext(Hd);return $n(e,u_(t)),e}function JU(t){let e=z.useContext(ob);return $n(e,u_(t)),e}function eF(t){let e=z.useContext(Na);return $n(e,u_(t)),e}function c_(t){let e=eF(t),n=e.matches[e.matches.length-1];return $n(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function tF(){return c_("useRouteId")}function nF(){var r;let t=z.useContext(l_),e=JU("useRouteError"),n=c_("useRouteError");return t!==void 0?t:(r=e.errors)==null?void 0:r[n]}function rF(){let{router:t}=ZU("useNavigate"),e=c_("useNavigate"),n=z.useRef(!1);return c9(()=>{n.current=!0}),z.useCallback(async(i,s={})=>{Zs(n.current,u9),n.current&&(typeof i=="number"?await t.navigate(i):await t.navigate(i,{fromRouteId:e,...s}))},[t,e])}var mw={};function p9(t,e,n){!e&&!mw[t]&&(mw[t]=!0,Zs(!1,n))}z.memo(iF);function iF({routes:t,future:e,state:n,onError:r}){return f9(t,void 0,n,r,e)}function m9({to:t,replace:e,state:n,relative:r}){$n(jd(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=z.useContext(ps);Zs(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:s}=z.useContext(Na),{pathname:a}=Lo(),l=d9(),u=o_(t,a_(s),a,r==="path"),d=JSON.stringify(u);return z.useEffect(()=>{l(JSON.parse(d),{replace:e,state:n,relative:r})},[l,d,r,e,n]),null}function hg(t){$n(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function sF({basename:t="/",children:e=null,location:n,navigationType:r="POP",navigator:i,static:s=!1,unstable_useTransitions:a}){$n(!jd(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=t.replace(/^\/*/,"/"),u=z.useMemo(()=>({basename:l,navigator:i,static:s,unstable_useTransitions:a,future:{}}),[l,i,s,a]);typeof n=="string"&&(n=Fd(n));let{pathname:d="/",search:f="",hash:p="",state:g=null,key:b="default"}=n,v=z.useMemo(()=>{let E=No(d,l);return E==null?null:{location:{pathname:E,search:f,hash:p,state:g,key:b},navigationType:r}},[l,d,f,p,g,b,r]);return Zs(v!=null,`<Router basename="${l}"> is not able to match the URL "${d}${f}${p}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:z.createElement(ps.Provider,{value:u},z.createElement(Rh.Provider,{children:e,value:v}))}function aF({children:t,location:e}){return GU(f4(t),e)}function f4(t,e=[]){let n=[];return z.Children.forEach(t,(r,i)=>{if(!z.isValidElement(r))return;let s=[...e,i];if(r.type===z.Fragment){n.push.apply(n,f4(r.props.children,s));return}$n(r.type===hg,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),$n(!r.props.index||!r.props.children,"An index route cannot have child routes.");let a={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=f4(r.props.children,s)),n.push(a)}),n}var pg="get",mg="application/x-www-form-urlencoded";function lb(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function oF(t){return lb(t)&&t.tagName.toLowerCase()==="button"}function lF(t){return lb(t)&&t.tagName.toLowerCase()==="form"}function uF(t){return lb(t)&&t.tagName.toLowerCase()==="input"}function cF(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function dF(t,e){return t.button===0&&(!e||e==="_self")&&!cF(t)}var Em=null;function fF(){if(Em===null)try{new FormData(document.createElement("form"),0),Em=!1}catch{Em=!0}return Em}var hF=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function h2(t){return t!=null&&!hF.has(t)?(Zs(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${mg}"`),null):t}function pF(t,e){let n,r,i,s,a;if(lF(t)){let l=t.getAttribute("action");r=l?No(l,e):null,n=t.getAttribute("method")||pg,i=h2(t.getAttribute("enctype"))||mg,s=new FormData(t)}else if(oF(t)||uF(t)&&(t.type==="submit"||t.type==="image")){let l=t.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=t.getAttribute("formaction")||l.getAttribute("action");if(r=u?No(u,e):null,n=t.getAttribute("formmethod")||l.getAttribute("method")||pg,i=h2(t.getAttribute("formenctype"))||h2(l.getAttribute("enctype"))||mg,s=new FormData(l,t),!fF()){let{name:d,type:f,value:p}=t;if(f==="image"){let g=d?`${d}.`:"";s.append(`${g}x`,"0"),s.append(`${g}y`,"0")}else d&&s.append(d,p)}}else{if(lb(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=pg,r=null,i=mg,a=t}return s&&i==="text/plain"&&(a=s,s=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:s,body:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function d_(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function mF(t,e,n,r){let i=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname==="/"?i.pathname=`_root.${r}`:e&&No(i.pathname,e)==="/"?i.pathname=`${e.replace(/\/$/,"")}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${r}`,i}async function gF(t,e){if(t.id in e)return e[t.id];try{let n=await import(t.module);return e[t.id]=n,n}catch(n){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function bF(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function vF(t,e,n){let r=await Promise.all(t.map(async i=>{let s=e.routes[i.route.id];if(s){let a=await gF(s,n);return a.links?a.links():[]}return[]}));return xF(r.flat(1).filter(bF).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function gw(t,e,n,r,i,s){let a=(u,d)=>n[d]?u.route.id!==n[d].route.id:!0,l=(u,d)=>{var f;return n[d].pathname!==u.pathname||((f=n[d].route.path)==null?void 0:f.endsWith("*"))&&n[d].params["*"]!==u.params["*"]};return s==="assets"?e.filter((u,d)=>a(u,d)||l(u,d)):s==="data"?e.filter((u,d)=>{var p;let f=r.routes[u.route.id];if(!f||!f.hasLoader)return!1;if(a(u,d)||l(u,d))return!0;if(u.route.shouldRevalidate){let g=u.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((p=n[0])==null?void 0:p.params)||{},nextUrl:new URL(t,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function yF(t,e,{includeHydrateFallback:n}={}){return EF(t.map(r=>{let i=e.routes[r.route.id];if(!i)return[];let s=[i.module];return i.clientActionModule&&(s=s.concat(i.clientActionModule)),i.clientLoaderModule&&(s=s.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(s=s.concat(i.hydrateFallbackModule)),i.imports&&(s=s.concat(i.imports)),s}).flat(1))}function EF(t){return[...new Set(t)]}function _F(t){let e={},n=Object.keys(t).sort();for(let r of n)e[r]=t[r];return e}function xF(t,e){let n=new Set;return new Set(e),t.reduce((r,i)=>{let s=JSON.stringify(_F(i));return n.has(s)||(n.add(s),r.push({key:s,link:i})),r},[])}function g9(){let t=z.useContext(Hd);return d_(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function TF(){let t=z.useContext(ob);return d_(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var f_=z.createContext(void 0);f_.displayName="FrameworkContext";function b9(){let t=z.useContext(f_);return d_(t,"You must render this element inside a <HydratedRouter> element"),t}function SF(t,e){let n=z.useContext(f_),[r,i]=z.useState(!1),[s,a]=z.useState(!1),{onFocus:l,onBlur:u,onMouseEnter:d,onMouseLeave:f,onTouchStart:p}=e,g=z.useRef(null);z.useEffect(()=>{if(t==="render"&&a(!0),t==="viewport"){let E=S=>{S.forEach(C=>{a(C.isIntersecting)})},x=new IntersectionObserver(E,{threshold:.5});return g.current&&x.observe(g.current),()=>{x.disconnect()}}},[t]),z.useEffect(()=>{if(r){let E=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(E)}}},[r]);let b=()=>{i(!0)},v=()=>{i(!1),a(!1)};return n?t!=="intent"?[s,g,{}]:[s,g,{onFocus:X0(l,b),onBlur:X0(u,v),onMouseEnter:X0(d,b),onMouseLeave:X0(f,v),onTouchStart:X0(p,b)}]:[!1,g,{}]}function X0(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function wF({page:t,...e}){let{router:n}=g9(),r=z.useMemo(()=>t9(n.routes,t,n.basename),[n.routes,t,n.basename]);return r?z.createElement(CF,{page:t,matches:r,...e}):null}function kF(t){let{manifest:e,routeModules:n}=b9(),[r,i]=z.useState([]);return z.useEffect(()=>{let s=!1;return vF(t,e,n).then(a=>{s||i(a)}),()=>{s=!0}},[t,e,n]),r}function CF({page:t,matches:e,...n}){let r=Lo(),{future:i,manifest:s,routeModules:a}=b9(),{basename:l}=g9(),{loaderData:u,matches:d}=TF(),f=z.useMemo(()=>gw(t,e,d,s,r,"data"),[t,e,d,s,r]),p=z.useMemo(()=>gw(t,e,d,s,r,"assets"),[t,e,d,s,r]),g=z.useMemo(()=>{if(t===r.pathname+r.search+r.hash)return[];let E=new Set,x=!1;if(e.forEach(C=>{var L;let O=s.routes[C.route.id];!O||!O.hasLoader||(!f.some(D=>D.route.id===C.route.id)&&C.route.id in u&&((L=a[C.route.id])!=null&&L.shouldRevalidate)||O.hasClientLoader?x=!0:E.add(C.route.id))}),E.size===0)return[];let S=mF(t,l,i.unstable_trailingSlashAwareDataRequests,"data");return x&&E.size>0&&S.searchParams.set("_routes",e.filter(C=>E.has(C.route.id)).map(C=>C.route.id).join(",")),[S.pathname+S.search]},[l,i.unstable_trailingSlashAwareDataRequests,u,r,s,f,e,t,a]),b=z.useMemo(()=>yF(p,s),[p,s]),v=kF(p);return z.createElement(z.Fragment,null,g.map(E=>z.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...n})),b.map(E=>z.createElement("link",{key:E,rel:"modulepreload",href:E,...n})),v.map(({key:E,link:x})=>z.createElement("link",{key:E,nonce:n.nonce,...x,crossOrigin:x.crossOrigin??n.crossOrigin})))}function AF(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var NF=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{NF&&(window.__reactRouterVersion="7.13.0")}catch{}function OF({basename:t,children:e,unstable_useTransitions:n,window:r}){let i=z.useRef();i.current==null&&(i.current=cU({window:r,v5Compat:!0}));let s=i.current,[a,l]=z.useState({action:s.action,location:s.location}),u=z.useCallback(d=>{n===!1?l(d):z.startTransition(()=>l(d))},[n]);return z.useLayoutEffect(()=>s.listen(u),[s,u]),z.createElement(sF,{basename:t,children:e,location:a.location,navigationType:a.action,navigator:s,unstable_useTransitions:n})}var v9=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,y9=z.forwardRef(function({onClick:e,discover:n="render",prefetch:r="none",relative:i,reloadDocument:s,replace:a,state:l,target:u,to:d,preventScrollReset:f,viewTransition:p,unstable_defaultShouldRevalidate:g,...b},v){let{basename:E,unstable_useTransitions:x}=z.useContext(ps),S=typeof d=="string"&&v9.test(d),C=s9(d,E);d=C.to;let O=qU(d,{relative:i}),[L,D,R]=SF(r,b),F=IF(d,{replace:a,state:l,target:u,preventScrollReset:f,relative:i,viewTransition:p,unstable_defaultShouldRevalidate:g,unstable_useTransitions:x});function G(q){e&&e(q),q.defaultPrevented||F(q)}let Z=z.createElement("a",{...b,...R,href:C.absoluteURL||O,onClick:C.isExternal||s?e:G,ref:AF(v,D),target:u,"data-discover":!S&&n==="render"?"true":void 0});return L&&!S?z.createElement(z.Fragment,null,Z,z.createElement(wF,{page:O})):Z});y9.displayName="Link";var MF=z.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:r="",end:i=!1,style:s,to:a,viewTransition:l,children:u,...d},f){let p=Dh(a,{relative:d.relative}),g=Lo(),b=z.useContext(ob),{navigator:v,basename:E}=z.useContext(ps),x=b!=null&&UF(p)&&l===!0,S=v.encodeLocation?v.encodeLocation(p).pathname:p.pathname,C=g.pathname,O=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(C=C.toLowerCase(),O=O?O.toLowerCase():null,S=S.toLowerCase()),O&&E&&(O=No(O,E)||O);const L=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let D=C===S||!i&&C.startsWith(S)&&C.charAt(L)==="/",R=O!=null&&(O===S||!i&&O.startsWith(S)&&O.charAt(S.length)==="/"),F={isActive:D,isPending:R,isTransitioning:x},G=D?e:void 0,Z;typeof r=="function"?Z=r(F):Z=[r,D?"active":null,R?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let q=typeof s=="function"?s(F):s;return z.createElement(y9,{...d,"aria-current":G,className:Z,ref:f,style:q,to:a,viewTransition:l},typeof u=="function"?u(F):u)});MF.displayName="NavLink";var RF=z.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:r,replace:i,state:s,method:a=pg,action:l,onSubmit:u,relative:d,preventScrollReset:f,viewTransition:p,unstable_defaultShouldRevalidate:g,...b},v)=>{let{unstable_useTransitions:E}=z.useContext(ps),x=BF(),S=zF(l,{relative:d}),C=a.toLowerCase()==="get"?"get":"post",O=typeof l=="string"&&v9.test(l),L=D=>{if(u&&u(D),D.defaultPrevented)return;D.preventDefault();let R=D.nativeEvent.submitter,F=(R==null?void 0:R.getAttribute("formmethod"))||a,G=()=>x(R||D.currentTarget,{fetcherKey:e,method:F,navigate:n,replace:i,state:s,relative:d,preventScrollReset:f,viewTransition:p,unstable_defaultShouldRevalidate:g});E&&n!==!1?z.startTransition(()=>G()):G()};return z.createElement("form",{ref:v,method:C,action:S,onSubmit:r?u:L,...b,"data-discover":!O&&t==="render"?"true":void 0})});RF.displayName="Form";function DF(t){return`${t} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function E9(t){let e=z.useContext(Hd);return $n(e,DF(t)),e}function IF(t,{target:e,replace:n,state:r,preventScrollReset:i,relative:s,viewTransition:a,unstable_defaultShouldRevalidate:l,unstable_useTransitions:u}={}){let d=d9(),f=Lo(),p=Dh(t,{relative:s});return z.useCallback(g=>{if(dF(g,e)){g.preventDefault();let b=n!==void 0?n:ih(f)===ih(p),v=()=>d(t,{replace:b,state:r,preventScrollReset:i,relative:s,viewTransition:a,unstable_defaultShouldRevalidate:l});u?z.startTransition(()=>v()):v()}},[f,d,p,n,r,e,t,i,s,a,l,u])}var LF=0,PF=()=>`__${String(++LF)}__`;function BF(){let{router:t}=E9("useSubmit"),{basename:e}=z.useContext(ps),n=tF(),r=t.fetch,i=t.navigate;return z.useCallback(async(s,a={})=>{let{action:l,method:u,encType:d,formData:f,body:p}=pF(s,e);if(a.navigate===!1){let g=a.fetcherKey||PF();await r(g,n,a.action||l,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:f,body:p,formMethod:a.method||u,formEncType:a.encType||d,flushSync:a.flushSync})}else await i(a.action||l,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:f,body:p,formMethod:a.method||u,formEncType:a.encType||d,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,e,n])}function zF(t,{relative:e}={}){let{basename:n}=z.useContext(ps),r=z.useContext(Na);$n(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),s={...Dh(t||".",{relative:e})},a=Lo();if(t==null){s.search=a.search;let l=new URLSearchParams(s.search),u=l.getAll("index");if(u.some(f=>f==="")){l.delete("index"),u.filter(p=>p).forEach(p=>l.append("index",p));let f=l.toString();s.search=f?`?${f}`:""}}return(!t||t===".")&&i.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:To([n,s.pathname])),ih(s)}function UF(t,{relative:e}={}){let n=z.useContext(o9);$n(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=E9("useViewTransitionState"),i=Dh(t,{relative:e});if(!n.isTransitioning)return!1;let s=No(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=No(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ig(i.pathname,a)!=null||Ig(i.pathname,s)!=null}var Uu,FF=(Uu=class extends Error{constructor(n){super(new.target.formatMessage(new.target.kind,n.message,n.code,n.docsUrl),{cause:n.cause});to(this,"clerkError",!0);to(this,"code");to(this,"longMessage");to(this,"docsUrl");to(this,"cause");Object.setPrototypeOf(this,Uu.prototype),this.code=n.code,this.docsUrl=n.docsUrl,this.longMessage=n.longMessage,this.cause=n.cause}get name(){return this.constructor.name}toString(){return`[${this.name}]
Message:${this.message}`}static formatMessage(n,r,i,s){const a="Clerk:",l=new RegExp(a.replace(" ","\\s*"),"i");return r=r.replace(l,""),r=`${a} ${r.trim()}

(code="${i}")

`,s&&(r+=`

Docs: ${s}`),r}},to(Uu,"kind","ClerkError"),Uu);const HF=Object.freeze({InvalidProxyUrlErrorMessage:"The proxyUrl passed to Clerk is invalid. The expected value for proxyUrl is an absolute URL or a relative path with a leading '/'. (key={{url}})",InvalidPublishableKeyErrorMessage:"The publishableKey passed to Clerk is invalid. You can get your Publishable key at https://dashboard.clerk.com/last-active?path=api-keys. (key={{key}})",MissingPublishableKeyErrorMessage:"Missing publishableKey. You can get your key at https://dashboard.clerk.com/last-active?path=api-keys.",MissingSecretKeyErrorMessage:"Missing secretKey. You can get your key at https://dashboard.clerk.com/last-active?path=api-keys.",MissingClerkProvider:"{{source}} can only be used within the <ClerkProvider /> component. Learn more: https://clerk.com/docs/components/clerk-provider"});function _9({packageName:t,customMessages:e}){let n=t;function r(s,a){if(!a)return`${n}: ${s}`;let l=s;const u=s.matchAll(/{{([a-zA-Z0-9-_]+)}}/g);for(const d of u){const f=(a[d[1]]||"").toString();l=l.replace(`{{${d[1]}}}`,f)}return`${n}: ${l}`}const i={...HF,...e};return{setPackageName({packageName:s}){return typeof s=="string"&&(n=s),this},setMessages({customMessages:s}){return Object.assign(i,s||{}),this},throwInvalidPublishableKeyError(s){throw new Error(r(i.InvalidPublishableKeyErrorMessage,s))},throwInvalidProxyUrl(s){throw new Error(r(i.InvalidProxyUrlErrorMessage,s))},throwMissingPublishableKeyError(){throw new Error(r(i.MissingPublishableKeyErrorMessage))},throwMissingSecretKeyError(){throw new Error(r(i.MissingSecretKeyErrorMessage))},throwMissingClerkProviderError(s){throw new Error(r(i.MissingClerkProvider,s))},throw(s){throw new Error(r(s))}}}var Fu,h4=(Fu=class extends FF{constructor(n,r){super({...r,message:n});to(this,"clerkRuntimeError",!0);Object.setPrototypeOf(this,Fu.prototype)}},to(Fu,"kind","ClerkRuntimeError"),Fu);const jF={strict_mfa:{afterMinutes:10,level:"multi_factor"},strict:{afterMinutes:10,level:"second_factor"},moderate:{afterMinutes:60,level:"second_factor"},lax:{afterMinutes:1440,level:"second_factor"}},$F=new Set(["first_factor","second_factor","multi_factor"]),qF=new Set(["strict_mfa","strict","moderate","lax"]),VF=t=>typeof t=="number"&&t>0,GF=t=>$F.has(t),YF=t=>qF.has(t),p2=t=>t.replace(/^(org:)*/,"org:"),WF=(t,e)=>{const{orgId:n,orgRole:r,orgPermissions:i}=e;return!t.role&&!t.permission||!n||!r||!i?null:t.permission?i.includes(p2(t.permission)):t.role?p2(r)===p2(t.role):null},bw=(t,e)=>{const{org:n,user:r}=XF(t),[i,s]=e.split(":"),a=s||i;return i==="org"?n.includes(a):i==="user"?r.includes(a):[...n,...r].includes(a)},KF=(t,e)=>{const{features:n,plans:r}=e;return t.feature&&n?bw(n,t.feature):t.plan&&r?bw(r,t.plan):null},XF=t=>{const e=t?t.split(",").map(n=>n.trim()):[];return{org:e.filter(n=>n.split(":")[0].includes("o")).map(n=>n.split(":")[1]),user:e.filter(n=>n.split(":")[0].includes("u")).map(n=>n.split(":")[1])}},QF=t=>{if(!t)return!1;const e=i=>typeof i=="string"?jF[i]:i,n=typeof t=="string"&&YF(t),r=typeof t=="object"&&GF(t.level)&&VF(t.afterMinutes);return n||r?e.bind(null,t):!1},ZF=(t,{factorVerificationAge:e})=>{if(!t.reverification||!e)return null;const n=QF(t.reverification);if(!n)return null;const{level:r,afterMinutes:i}=n(),[s,a]=e,l=s!==-1?i>s:null,u=a!==-1?i>a:null;switch(r){case"first_factor":return l;case"second_factor":return a!==-1?u:l;case"multi_factor":return a===-1?l:l&&u}},JF=t=>e=>{if(!t.userId)return!1;const n=KF(e,t),r=WF(e,t),i=ZF(e,t);return[n||r,i].some(s=>s===null)?[n||r,i].some(s=>s===!0):[n||r,i].every(s=>s===!0)},eH=({authObject:{sessionId:t,sessionStatus:e,userId:n,actor:r,orgId:i,orgRole:s,orgSlug:a,signOut:l,getToken:u,has:d,sessionClaims:f},options:{treatPendingAsSignedOut:p=!0}})=>{if(t===void 0&&n===void 0)return{isLoaded:!1,isSignedIn:void 0,sessionId:t,sessionClaims:void 0,userId:n,actor:void 0,orgId:void 0,orgRole:void 0,orgSlug:void 0,has:void 0,signOut:l,getToken:u};if(t===null&&n===null)return{isLoaded:!0,isSignedIn:!1,sessionId:t,userId:n,sessionClaims:null,actor:null,orgId:null,orgRole:null,orgSlug:null,has:()=>!1,signOut:l,getToken:u};if(p&&e==="pending")return{isLoaded:!0,isSignedIn:!1,sessionId:null,userId:null,sessionClaims:null,actor:null,orgId:null,orgRole:null,orgSlug:null,has:()=>!1,signOut:l,getToken:u};if(t&&f&&n&&i&&s)return{isLoaded:!0,isSignedIn:!0,sessionId:t,sessionClaims:f,userId:n,actor:r||null,orgId:i,orgRole:s,orgSlug:a||null,has:d,signOut:l,getToken:u};if(t&&f&&n&&!i)return{isLoaded:!0,isSignedIn:!0,sessionId:t,sessionClaims:f,userId:n,actor:r||null,orgId:null,orgRole:null,orgSlug:null,has:d,signOut:l,getToken:u}},tH=[".lcl.dev",".stg.dev",".lclstage.dev",".stgstage.dev",".dev.lclclerk.com",".stg.lclclerk.com",".accounts.lclclerk.com","accountsstage.dev","accounts.dev"],x9=t=>typeof atob<"u"&&typeof atob=="function"?atob(t):typeof global<"u"&&global.Buffer?new global.Buffer(t,"base64").toString():t,T9="pk_live_",nH="pk_test_";function S9(t){if(!t.endsWith("$"))return!1;const e=t.slice(0,-1);return e.includes("$")?!1:e.includes(".")}function vw(t,e={}){if(t=t||"",!t||!p4(t)){if(e.fatal&&!t)throw new Error("Publishable key is missing. Ensure that your publishable key is correctly configured. Double-check your environment configuration for your keys, or access them here: https://dashboard.clerk.com/last-active?path=api-keys");if(e.fatal&&!p4(t))throw new Error("Publishable key not valid.");return null}const n=t.startsWith(T9)?"production":"development";let r;try{r=x9(t.split("_")[2])}catch{if(e.fatal)throw new Error("Publishable key not valid: Failed to decode key.");return null}if(!S9(r)){if(e.fatal)throw new Error("Publishable key not valid: Decoded key has invalid format.");return null}let i=r.slice(0,-1);return e.proxyUrl?i=e.proxyUrl:n!=="development"&&e.domain&&e.isSatellite&&(i=`clerk.${e.domain}`),{instanceType:n,frontendApi:i}}function p4(t=""){try{if(!(t.startsWith(T9)||t.startsWith(nH)))return!1;const e=t.split("_");if(e.length!==3)return!1;const n=e[2];return n?S9(x9(n)):!1}catch{return!1}}function rH(){const t=new Map;return{isDevOrStagingUrl:e=>{if(!e)return!1;const n=typeof e=="string"?e:e.hostname;let r=t.get(n);return r===void 0&&(r=tH.some(i=>n.endsWith(i)),t.set(n,r)),r}}}const iH="METHOD_CALLED",sH=.1;function h_(t,e){return{event:iH,eventSamplingRate:sH,payload:{method:t,...e}}}var m2={exports:{}},g2={};/**
 * @license React
 * use-sync-external-store-shim.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var yw;function aH(){if(yw)return g2;yw=1;var t=Mh();function e(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,i=t.useEffect,s=t.useLayoutEffect,a=t.useDebugValue;function l(p,g){var b=g(),v=r({inst:{value:b,getSnapshot:g}}),E=v[0].inst,x=v[1];return s(function(){E.value=b,E.getSnapshot=g,u(E)&&x({inst:E})},[p,b,g]),i(function(){return u(E)&&x({inst:E}),p(function(){u(E)&&x({inst:E})})},[p]),a(b),b}function u(p){var g=p.getSnapshot;p=p.value;try{var b=g();return!n(p,b)}catch{return!0}}function d(p,g){return g()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return g2.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:f,g2}var Ew;function w9(){return Ew||(Ew=1,m2.exports=aH()),m2.exports}var p_=w9();const k9=0,C9=1,A9=2,_w=3;var xw=Object.prototype.hasOwnProperty;function m4(t,e){var n,r;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((r=t.length)===e.length)for(;r--&&m4(t[r],e[r]););return r===-1}if(!n||typeof t=="object"){r=0;for(n in t)if(xw.call(t,n)&&++r&&!xw.call(e,n)||!(n in e)||!m4(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!==t&&e!==e}const go=new WeakMap,Il=()=>{},li=Il(),Lg=Object,Kt=t=>t===li,Gs=t=>typeof t=="function",Oo=(t,e)=>({...t,...e}),N9=t=>Gs(t.then),b2={},_m={},m_="undefined",Ih=typeof window!=m_,g4=typeof document!=m_,oH=Ih&&"Deno"in window,lH=()=>Ih&&typeof window.requestAnimationFrame!=m_,O9=(t,e)=>{const n=go.get(t);return[()=>!Kt(e)&&t.get(e)||b2,r=>{if(!Kt(e)){const i=t.get(e);e in _m||(_m[e]=i),n[5](e,Oo(i,r),i||b2)}},n[6],()=>!Kt(e)&&e in _m?_m[e]:!Kt(e)&&t.get(e)||b2]};let b4=!0;const uH=()=>b4,[v4,y4]=Ih&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Il,Il],cH=()=>{const t=g4&&document.visibilityState;return Kt(t)||t!=="hidden"},dH=t=>(g4&&document.addEventListener("visibilitychange",t),v4("focus",t),()=>{g4&&document.removeEventListener("visibilitychange",t),y4("focus",t)}),fH=t=>{const e=()=>{b4=!0,t()},n=()=>{b4=!1};return v4("online",e),v4("offline",n),()=>{y4("online",e),y4("offline",n)}},hH={isOnline:uH,isVisible:cH},pH={initFocus:dH,initReconnect:fH},Tw=!le.useId,sh=!Ih||oH,mH=t=>lH()?window.requestAnimationFrame(t):setTimeout(t,1),gg=sh?z.useEffect:z.useLayoutEffect,v2=typeof navigator<"u"&&navigator.connection,Sw=!sh&&v2&&(["slow-2g","2g"].includes(v2.effectiveType)||v2.saveData),xm=new WeakMap,gH=t=>Lg.prototype.toString.call(t),y2=(t,e)=>t===`[object ${e}]`;let bH=0;const E4=t=>{const e=typeof t,n=gH(t),r=y2(n,"Date"),i=y2(n,"RegExp"),s=y2(n,"Object");let a,l;if(Lg(t)===t&&!r&&!i){if(a=xm.get(t),a)return a;if(a=++bH+"~",xm.set(t,a),Array.isArray(t)){for(a="@",l=0;l<t.length;l++)a+=E4(t[l])+",";xm.set(t,a)}if(s){a="#";const u=Lg.keys(t).sort();for(;!Kt(l=u.pop());)Kt(t[l])||(a+=l+":"+E4(t[l])+",");xm.set(t,a)}}else a=r?t.toJSON():e=="symbol"?t.toString():e=="string"?JSON.stringify(t):""+t;return a},g_=t=>{if(Gs(t))try{t=t()}catch{t=""}const e=t;return t=typeof t=="string"?t:(Array.isArray(t)?t.length:t)?E4(t):"",[t,e]};let vH=0;const _4=()=>++vH;async function M9(...t){const[e,n,r,i]=t,s=Oo({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let a=s.populateCache;const l=s.rollbackOnError;let u=s.optimisticData;const d=g=>typeof l=="function"?l(g):l!==!1,f=s.throwOnError;if(Gs(n)){const g=n,b=[],v=e.keys();for(const E of v)!/^\$(inf|sub)\$/.test(E)&&g(e.get(E)._k)&&b.push(E);return Promise.all(b.map(p))}return p(n);async function p(g){const[b]=g_(g);if(!b)return;const[v,E]=O9(e,b),[x,S,C,O]=go.get(e),L=()=>{const oe=x[b];return(Gs(s.revalidate)?s.revalidate(v().data,g):s.revalidate!==!1)&&(delete C[b],delete O[b],oe&&oe[0])?oe[0](A9).then(()=>v().data):v().data};if(t.length<3)return L();let D=r,R,F=!1;const G=_4();S[b]=[G,0];const Z=!Kt(u),q=v(),ie=q.data,se=q._c,Te=Kt(se)?ie:se;if(Z&&(u=Gs(u)?u(Te,ie):u,E({data:u,_c:Te})),Gs(D))try{D=D(Te)}catch(oe){R=oe,F=!0}if(D&&N9(D))if(D=await D.catch(oe=>{R=oe,F=!0}),G!==S[b][0]){if(F)throw R;return D}else F&&Z&&d(R)&&(a=!0,E({data:Te,_c:li}));if(a&&!F)if(Gs(a)){const oe=a(D,Te);E({data:oe,error:li,_c:li})}else E({data:D,error:li,_c:li});if(S[b][1]=_4(),Promise.resolve(L()).then(()=>{E({_c:li})}),F){if(f)throw R;return}return D}}const ww=(t,e)=>{for(const n in t)t[n][0]&&t[n][0](e)},R9=(t,e)=>{if(!go.has(t)){const n=Oo(pH,e),r=Object.create(null),i=M9.bind(li,t);let s=Il;const a=Object.create(null),l=(f,p)=>{const g=a[f]||[];return a[f]=g,g.push(p),()=>g.splice(g.indexOf(p),1)},u=(f,p,g)=>{t.set(f,p);const b=a[f];if(b)for(const v of b)v(p,g)},d=()=>{if(!go.has(t)&&(go.set(t,[r,Object.create(null),Object.create(null),Object.create(null),i,u,l]),!sh)){const f=n.initFocus(setTimeout.bind(li,ww.bind(li,r,k9))),p=n.initReconnect(setTimeout.bind(li,ww.bind(li,r,C9)));s=()=>{f&&f(),p&&p(),go.delete(t)}}};return d(),[t,i,d,s]}return[t,go.get(t)[4]]},yH=(t,e,n,r,i)=>{const s=n.errorRetryCount,a=i.retryCount,l=~~((Math.random()+.5)*(1<<(a<8?a:8)))*n.errorRetryInterval;!Kt(s)&&a>s||setTimeout(r,l,i)},EH=m4,[b_,_H]=R9(new Map),D9=Oo({onLoadingSlow:Il,onSuccess:Il,onError:Il,onErrorRetry:yH,onDiscarded:Il,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:Sw?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:Sw?5e3:3e3,compare:EH,isPaused:()=>!1,cache:b_,mutate:_H,fallback:{}},hH),I9=(t,e)=>{const n=Oo(t,e);if(e){const{use:r,fallback:i}=t,{use:s,fallback:a}=e;r&&s&&(n.use=r.concat(s)),i&&a&&(n.fallback=Oo(i,a))}return n},x4=z.createContext({}),xH=t=>{const{value:e}=t,n=z.useContext(x4),r=Gs(e),i=z.useMemo(()=>r?e(n):e,[r,n,e]),s=z.useMemo(()=>r?i:I9(n,i),[r,n,i]),a=i&&i.provider,l=z.useRef(li);a&&!l.current&&(l.current=R9(a(s.cache||b_),i));const u=l.current;return u&&(s.cache=u[0],s.mutate=u[1]),gg(()=>{if(u)return u[2]&&u[2](),u[3]},[]),z.createElement(x4.Provider,Oo(t,{value:s}))},TH="$inf$",L9=Ih&&window.__SWR_DEVTOOLS_USE__,SH=L9?window.__SWR_DEVTOOLS_USE__:[],wH=()=>{L9&&(window.__SWR_DEVTOOLS_REACT__=le)},kH=t=>Gs(t[1])?[t[0],t[1],t[2]||{}]:[t[0],null,(t[1]===null?t[2]:t[1])||{}],CH=()=>Oo(D9,z.useContext(x4)),AH=t=>(e,n,r)=>t(e,n&&((...s)=>{const[a]=g_(e),[,,,l]=go.get(b_);if(a.startsWith(TH))return n(...s);const u=l[a];return Kt(u)?n(...s):(delete l[a],u)}),r),NH=SH.concat(AH),OH=t=>function(...n){const r=CH(),[i,s,a]=kH(n),l=I9(r,a);let u=t;const{use:d}=l,f=(d||[]).concat(NH);for(let p=f.length;p--;)u=f[p](u);return u(i,s||l.fetcher||null,l)},MH=(t,e,n)=>{const r=e[t]||(e[t]=[]);return r.push(n),()=>{const i=r.indexOf(n);i>=0&&(r[i]=r[r.length-1],r.pop())}};wH();const E2=le.use||(t=>{switch(t.status){case"pending":throw t;case"fulfilled":return t.value;case"rejected":throw t.reason;default:throw t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}),t}}),_2={dedupe:!0},RH=(t,e,n)=>{const{cache:r,compare:i,suspense:s,fallbackData:a,revalidateOnMount:l,revalidateIfStale:u,refreshInterval:d,refreshWhenHidden:f,refreshWhenOffline:p,keepPreviousData:g}=n,[b,v,E,x]=go.get(r),[S,C]=g_(t),O=z.useRef(!1),L=z.useRef(!1),D=z.useRef(S),R=z.useRef(e),F=z.useRef(n),G=()=>F.current,Z=()=>G().isVisible()&&G().isOnline(),[q,ie,se,Te]=O9(r,S),oe=z.useRef({}).current,re=Kt(a)?Kt(n.fallback)?li:n.fallback[S]:a,X=(At,gt)=>{for(const Yt in oe){const Qe=Yt;if(Qe==="data"){if(!i(At[Qe],gt[Qe])&&(!Kt(At[Qe])||!i(Fe,gt[Qe])))return!1}else if(gt[Qe]!==At[Qe])return!1}return!0},ee=z.useMemo(()=>{const At=!S||!e?!1:Kt(l)?G().isPaused()||s?!1:u!==!1:l,gt=vn=>{const Or=Oo(vn);return delete Or._k,At?{isValidating:!0,isLoading:!0,...Or}:Or},Yt=q(),Qe=Te(),$t=gt(Yt),wn=Yt===Qe?$t:gt(Qe);let zt=$t;return[()=>{const vn=gt(q());return X(vn,zt)?(zt.data=vn.data,zt.isLoading=vn.isLoading,zt.isValidating=vn.isValidating,zt.error=vn.error,zt):(zt=vn,vn)},()=>wn]},[r,S]),ce=p_.useSyncExternalStore(z.useCallback(At=>se(S,(gt,Yt)=>{X(Yt,gt)||At()}),[r,S]),ee[0],ee[1]),we=!O.current,j=b[S]&&b[S].length>0,H=ce.data,ne=Kt(H)?re&&N9(re)?E2(re):re:H,P=ce.error,Ee=z.useRef(ne),Fe=g?Kt(H)?Kt(Ee.current)?ne:Ee.current:H:ne,He=j&&!Kt(P)?!1:we&&!Kt(l)?l:G().isPaused()?!1:s?Kt(ne)?!1:u:Kt(ne)||u,it=!!(S&&e&&we&&He),kt=Kt(ce.isValidating)?it:ce.isValidating,Tt=Kt(ce.isLoading)?it:ce.isLoading,St=z.useCallback(async At=>{const gt=R.current;if(!S||!gt||L.current||G().isPaused())return!1;let Yt,Qe,$t=!0;const wn=At||{},zt=!E[S]||!wn.dedupe,vn=()=>Tw?!L.current&&S===D.current&&O.current:S===D.current,Or={isValidating:!1,isLoading:!1},ra=()=>{ie(Or)},Hs=()=>{const lr=E[S];lr&&lr[1]===Qe&&delete E[S]},fn={isValidating:!0};Kt(q().data)&&(fn.isLoading=!0);try{if(zt&&(ie(fn),n.loadingTimeout&&Kt(q().data)&&setTimeout(()=>{$t&&vn()&&G().onLoadingSlow(S,n)},n.loadingTimeout),E[S]=[gt(C),_4()]),[Yt,Qe]=E[S],Yt=await Yt,zt&&setTimeout(Hs,n.dedupingInterval),!E[S]||E[S][1]!==Qe)return zt&&vn()&&G().onDiscarded(S),!1;Or.error=li;const lr=v[S];if(!Kt(lr)&&(Qe<=lr[0]||Qe<=lr[1]||lr[1]===0))return ra(),zt&&vn()&&G().onDiscarded(S),!1;const ge=q().data;Or.data=i(ge,Yt)?ge:Yt,zt&&vn()&&G().onSuccess(Yt,S,n)}catch(lr){Hs();const ge=G(),{shouldRetryOnError:Re}=ge;ge.isPaused()||(Or.error=lr,zt&&vn()&&(ge.onError(lr,S,ge),(Re===!0||Gs(Re)&&Re(lr))&&(!G().revalidateOnFocus||!G().revalidateOnReconnect||Z())&&ge.onErrorRetry(lr,S,ge,lt=>{const Ae=b[S];Ae&&Ae[0]&&Ae[0](_w,lt)},{retryCount:(wn.retryCount||0)+1,dedupe:!0})))}return $t=!1,ra(),!0},[S,r]),Jn=z.useCallback((...At)=>M9(r,D.current,...At),[]);if(gg(()=>{R.current=e,F.current=n,Kt(H)||(Ee.current=H)}),gg(()=>{if(!S)return;const At=St.bind(li,_2);let gt=0;G().revalidateOnFocus&&(gt=Date.now()+G().focusThrottleInterval);const Qe=MH(S,b,($t,wn={})=>{if($t==k9){const zt=Date.now();G().revalidateOnFocus&&zt>gt&&Z()&&(gt=zt+G().focusThrottleInterval,At())}else if($t==C9)G().revalidateOnReconnect&&Z()&&At();else{if($t==A9)return St();if($t==_w)return St(wn)}});return L.current=!1,D.current=S,O.current=!0,ie({_k:C}),He&&(E[S]||(Kt(ne)||sh?At():mH(At))),()=>{L.current=!0,Qe()}},[S]),gg(()=>{let At;function gt(){const Qe=Gs(d)?d(q().data):d;Qe&&At!==-1&&(At=setTimeout(Yt,Qe))}function Yt(){!q().error&&(f||G().isVisible())&&(p||G().isOnline())?St(_2).then(gt):gt()}return gt(),()=>{At&&(clearTimeout(At),At=-1)}},[d,f,p,S]),z.useDebugValue(Fe),s&&Kt(ne)&&S){if(!Tw&&sh)throw new Error("Fallback data is required when using Suspense in SSR.");R.current=e,F.current=n,L.current=!1;const At=x[S];if(!Kt(At)){const gt=Jn(At);E2(gt)}if(Kt(P)){const gt=St(_2);Kt(Fe)||(gt.status="fulfilled",gt.value=!0),E2(gt)}else throw P}return{mutate:Jn,get data(){return oe.data=!0,Fe},get error(){return oe.error=!0,P},get isValidating(){return oe.isValidating=!0,kt},get isLoading(){return oe.isLoading=!0,Tt}}},DH=Lg.defineProperty(xH,"defaultValue",{value:D9}),IH=OH(RH);var kw=Object.prototype.hasOwnProperty;function Cw(t,e,n){for(n of t.keys())if(Df(n,e))return n}function Df(t,e){var n,r,i;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((r=t.length)===e.length)for(;r--&&Df(t[r],e[r]););return r===-1}if(n===Set){if(t.size!==e.size)return!1;for(r of t)if(i=r,i&&typeof i=="object"&&(i=Cw(e,i),!i)||!e.has(i))return!1;return!0}if(n===Map){if(t.size!==e.size)return!1;for(r of t)if(i=r[0],i&&typeof i=="object"&&(i=Cw(e,i),!i)||!Df(r[1],e.get(i)))return!1;return!0}if(n===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(n===DataView){if((r=t.byteLength)===e.byteLength)for(;r--&&t.getInt8(r)===e.getInt8(r););return r===-1}if(ArrayBuffer.isView(t)){if((r=t.byteLength)===e.byteLength)for(;r--&&t[r]===e[r];);return r===-1}if(!n||typeof t=="object"){r=0;for(n in t)if(kw.call(t,n)&&++r&&!kw.call(e,n)||!(n in e)||!Df(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!==t&&e!==e}function LH(t,e){if(!t)throw typeof e=="string"?new Error(e):new Error(`${e.displayName} not found`)}const Po=(t,e)=>{const{assertCtxFn:n=LH}={},r=le.createContext(void 0);return r.displayName=t,[r,()=>{const a=le.useContext(r);return n(a,`${t} not found`),a.value},()=>{const a=le.useContext(r);return a?a.value:{}}]};function PH({swrConfig:t,children:e}){return le.createElement(DH,{value:t},e)}const[P9,ub]=Po("ClerkInstanceContext"),[BH,B9]=Po("UserContext"),[zH]=Po("ClientContext"),[UH]=Po("SessionContext");le.createContext({});const[FH]=Po("CheckoutContext"),HH=({children:t,...e})=>le.createElement(FH.Provider,{value:{value:e}},t),[jH,$H]=Po("OrganizationContext"),qH=({children:t,organization:e,swrConfig:n})=>le.createElement(PH,{swrConfig:n},le.createElement(jH.Provider,{value:{value:{organization:e}}},t));function cb(t){if(!le.useContext(P9)){if(typeof t=="function"){t();return}throw new Error(`${t} can only be used within the <ClerkProvider /> component.

Possible fixes:
1. Ensure that the <ClerkProvider /> is correctly wrapping your application where this component is used.
2. Check for multiple versions of the \`@clerk/shared\` package in your project. Use a tool like \`npm ls @clerk/shared\` to identify multiple versions, and update your dependencies to only rely on one.

Learn more: https://clerk.com/docs/components/clerk-provider`.trim())}}const VH="billing-subscription",GH={SUBSCRIPTION_KEY:VH};function YH(t){return{queryKey:[t.stablePrefix,t.authenticated,t.tracked,t.untracked],invalidationKey:[t.stablePrefix,t.authenticated,t.tracked],stableKey:t.stablePrefix,authenticated:t.authenticated}}const WH=()=>(cb("useClerk"),ub());typeof window<"u"?le.useLayoutEffect:le.useEffect;const Aw="useUser";function KH(){var e;cb(Aw);const t=B9();return(e=ub().telemetry)==null||e.record(h_(Aw)),t===void 0?{isLoaded:!1,isSignedIn:void 0,user:void 0}:t===null?{isLoaded:!0,isSignedIn:!1,user:null}:{isLoaded:!0,isSignedIn:!0,user:t}}const Nw=Df;function XH(t){const{userId:e,orgId:n,for:r}=t;return z.useMemo(()=>{const i=r==="organization"?n:void 0;return YH({stablePrefix:GH.SUBSCRIPTION_KEY,authenticated:!0,tracked:{userId:e,orgId:i},untracked:{args:{orgId:i}}})},[e,n,r])}const Ow="useSubscription";function QH(t){var f;cb(Ow);const e=ub(),n=B9(),{organization:r}=$H(),i=e.__unstable__environment;(f=e.telemetry)==null||f.record(h_(Ow));const s=(t==null?void 0:t.for)==="organization"?i==null?void 0:i.commerceSettings.billing.organization.enabled:i==null?void 0:i.commerceSettings.billing.user.enabled,a=((t==null?void 0:t.enabled)??!0)&&s,{queryKey:l}=XH({userId:n==null?void 0:n.id,orgId:r==null?void 0:r.id,for:t==null?void 0:t.for}),u=IH(a?{queryKey:l}:null,({queryKey:p})=>{const g=p[3].args;return p[2].userId?e.billing.getSubscription(g):null},{dedupingInterval:1e3*60,keepPreviousData:t==null?void 0:t.keepPreviousData}),d=z.useCallback(()=>{u.mutate()},[u]);return{data:u.data,error:u.error,isLoading:u.isLoading,isFetching:u.isValidating,revalidate:d}}const ZH=t=>{const e=z.useRef(t);return z.useEffect(()=>{e.current=t},[t]),e.current},is=(t,e,n)=>{const r=!!n,i=z.useRef(n);z.useEffect(()=>{i.current=n},[n]),z.useEffect(()=>{if(!r||!t)return()=>{};const s=(...a)=>{i.current&&i.current(...a)};return t.on(e,s),()=>{t.off(e,s)}},[r,e,t,i])},z9=le.createContext(null);z9.displayName="ElementsContext";const JH=(t,e)=>{if(!t)throw new Error(`Could not find Elements context; You need to wrap the part of your app that ${e} in an <Elements> provider.`);return t},Pg=t=>t!==null&&typeof t=="object",ej=(t,e,n)=>Pg(t)?Object.keys(t).reduce((r,i)=>{const s=!Pg(e)||!U9(t[i],e[i]);return n.includes(i)?(s&&console.warn(`Unsupported prop change: options.${i} is not a mutable property.`),r):s?{...r||{},[i]:t[i]}:r},null):null,Mw="[object Object]",U9=(t,e)=>{if(!Pg(t)||!Pg(e))return t===e;const n=Array.isArray(t);if(n!==Array.isArray(e))return!1;const r=Object.prototype.toString.call(t)===Mw;if(r!==(Object.prototype.toString.call(e)===Mw))return!1;if(!r&&!n)return t===e;const i=Object.keys(t),s=Object.keys(e);if(i.length!==s.length)return!1;const a={};for(let p=0;p<i.length;p+=1)a[i[p]]=!0;for(let p=0;p<s.length;p+=1)a[s[p]]=!0;const l=Object.keys(a);if(l.length!==i.length)return!1;const u=t,d=e,f=p=>U9(u[p],d[p]);return l.every(f)},Rw=t=>JH(le.useContext(z9),t),tj=t=>t.charAt(0).toUpperCase()+t.slice(1),nj=(t,e)=>{const n=`${tj(t)}Element`,s=e?a=>{Rw(`mounts <${n}>`);const{id:l,className:u}=a;return le.createElement("div",{id:l,className:u})}:({id:a,className:l,fallback:u,options:d={},onBlur:f,onFocus:p,onReady:g,onChange:b,onEscape:v,onClick:E,onLoadError:x,onLoaderStart:S,onNetworksChange:C,onConfirm:O,onCancel:L,onShippingAddressChange:D,onShippingRateChange:R})=>{const F=Rw(`mounts <${n}>`),G="elements"in F?F.elements:null,[Z,q]=le.useState(null),ie=le.useRef(null),se=le.useRef(null),[Te,oe]=z.useState(!1);is(Z,"blur",f),is(Z,"focus",p),is(Z,"escape",v),is(Z,"click",E),is(Z,"loaderror",x),is(Z,"loaderstart",S),is(Z,"networkschange",C),is(Z,"confirm",O),is(Z,"cancel",L),is(Z,"shippingaddresschange",D),is(Z,"shippingratechange",R),is(Z,"change",b);let re;g&&(re=()=>{oe(!0),g(Z)}),is(Z,"ready",re),le.useLayoutEffect(()=>{if(ie.current===null&&se.current!==null&&G){let ee=null;G&&(ee=G.create(t,d)),ie.current=ee,q(ee),ee&&ee.mount(se.current)}},[G,d]);const X=ZH(d);return le.useEffect(()=>{if(!ie.current)return;const ee=ej(d,X,["paymentRequest"]);ee&&"update"in ie.current&&ie.current.update(ee)},[d,X]),le.useLayoutEffect(()=>()=>{if(ie.current&&typeof ie.current.destroy=="function")try{ie.current.destroy(),ie.current=null}catch{}},[]),le.createElement(le.Fragment,null,!Te&&u,le.createElement("div",{id:a,style:{height:Te?"unset":"0px",visibility:Te?"visible":"hidden"},className:l,ref:se}))};return s.displayName=n,s.__elementType=t,s};nj("payment",typeof window>"u");Po("PaymentElementContext");Po("StripeUtilsContext");var Ks=_9({packageName:"@clerk/clerk-react"});function rj(t){Ks.setMessages(t).setPackageName(t)}var[ij,sj]=Po("AuthContext"),aj=P9,F9=ub,oj="You've added multiple <ClerkProvider> components in your React component tree. Wrap your components in a single <ClerkProvider>.",lj=t=>`You've passed multiple children components to <${t}/>. You can only pass a single child component or text.`,uj="Invalid state. Feel free to submit a bug or reach out to support here: https://clerk.com/support",x2="Unsupported usage of isSatellite, domain or proxyUrl. The usage of isSatellite, domain or proxyUrl as function is not supported in non-browser environments.",cj="<UserProfile.Page /> component needs to be a direct child of `<UserProfile />` or `<UserButton />`.",dj="<UserProfile.Link /> component needs to be a direct child of `<UserProfile />` or `<UserButton />`.",fj="<OrganizationProfile.Page /> component needs to be a direct child of `<OrganizationProfile />` or `<OrganizationSwitcher />`.",hj="<OrganizationProfile.Link /> component needs to be a direct child of `<OrganizationProfile />` or `<OrganizationSwitcher />`.",pj=t=>`<${t} /> can only accept <${t}.Page /> and <${t}.Link /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.`,mj=t=>`Missing props. <${t}.Page /> component requires the following props: url, label, labelIcon, alongside with children to be rendered inside the page.`,gj=t=>`Missing props. <${t}.Link /> component requires the following props: url, label and labelIcon.`,bj="<UserButton /> can only accept <UserButton.UserProfilePage />, <UserButton.UserProfileLink /> and <UserButton.MenuItems /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.",vj="<UserButton.MenuItems /> component can only accept <UserButton.Action /> and <UserButton.Link /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.",yj="<UserButton.MenuItems /> component needs to be a direct child of `<UserButton />`.",Ej="<UserButton.Action /> component needs to be a direct child of `<UserButton.MenuItems />`.",_j="<UserButton.Link /> component needs to be a direct child of `<UserButton.MenuItems />`.",xj="Missing props. <UserButton.Link /> component requires the following props: href, label and labelIcon.",Tj="Missing props. <UserButton.Action /> component requires the following props: label.",db=t=>{cb(()=>{Ks.throwMissingClerkProviderError({source:t})})},H9=t=>new Promise(e=>{const n=r=>{["ready","degraded"].includes(r)&&(e(),t.off("status",n))};t.on("status",n,{notify:!0})}),Sj=t=>async e=>(await H9(t),t.session?t.session.getToken(e):null),wj=t=>async(...e)=>(await H9(t),t.signOut(...e)),Lh=(t={})=>{var e;db("useAuth");const{treatPendingAsSignedOut:n,...r}=t??{},i=r;let a=sj();a.sessionId===void 0&&a.userId===void 0&&(a=i??{});const l=F9(),u=z.useCallback(Sj(l),[l]),d=z.useCallback(wj(l),[l]);return(e=l.telemetry)==null||e.record(h_("useAuth",{treatPendingAsSignedOut:n})),kj({...a,getToken:u,signOut:d},{treatPendingAsSignedOut:n})};function kj(t,{treatPendingAsSignedOut:e=!0}={}){const{userId:n,orgId:r,orgRole:i,has:s,signOut:a,getToken:l,orgPermissions:u,factorVerificationAge:d,sessionClaims:f}=t??{},p=z.useCallback(b=>s?s(b):JF({userId:n,orgId:r,orgRole:i,orgPermissions:u,factorVerificationAge:d,features:(f==null?void 0:f.fea)||"",plans:(f==null?void 0:f.pla)||""})(b),[s,n,r,i,u,d,f]),g=eH({authObject:{...t,getToken:l,signOut:a,has:p},options:{treatPendingAsSignedOut:e}});return g||Ks.throw(uj)}var dn=(t,e)=>{const r=(typeof e=="string"?e:e==null?void 0:e.component)||t.displayName||t.name||"Component";t.displayName=r;const i=typeof e=="string"?void 0:e,s=a=>{db(r||"withClerk");const l=F9();return!l.loaded&&!(i!=null&&i.renderWhileLoading)?null:le.createElement(t,{...a,component:r,clerk:l})};return s.displayName=`withClerk(${r})`,s};const Cj=()=>{try{return!1}catch{}return!1},Aj=()=>{try{return!1}catch{}return!1},Nj=()=>{try{return!0}catch{}return!1},Dw=new Set,v_=(t,e,n)=>{const r=Aj()||Nj(),i=t;Dw.has(i)||r||(Dw.add(i),console.warn(`Clerk - DEPRECATION WARNING: "${t}" is deprecated and will be removed in the next major release.
${e}`))};var Oj=({children:t,treatPendingAsSignedOut:e})=>{db("SignedIn");const{userId:n}=Lh({treatPendingAsSignedOut:e});return n?t:null},Mj=({children:t,treatPendingAsSignedOut:e})=>{db("SignedOut");const{userId:n}=Lh({treatPendingAsSignedOut:e});return n===null?t:null};dn(({clerk:t,...e})=>{const{client:n,session:r}=t,i=n.signedInSessions?n.signedInSessions.length>0:n.activeSessions&&n.activeSessions.length>0;return le.useEffect(()=>{r===null&&i?t.redirectToAfterSignOut():t.redirectToSignIn(e)},[]),null},"RedirectToSignIn");dn(({clerk:t,...e})=>(le.useEffect(()=>{t.redirectToSignUp(e)},[]),null),"RedirectToSignUp");dn(({clerk:t,...e})=>(le.useEffect(()=>{t.redirectToTasks(e)},[]),null),"RedirectToTasks");dn(({clerk:t})=>(le.useEffect(()=>{v_("RedirectToUserProfile","Use the `redirectToUserProfile()` method instead."),t.redirectToUserProfile()},[]),null),"RedirectToUserProfile");dn(({clerk:t})=>(le.useEffect(()=>{v_("RedirectToOrganizationProfile","Use the `redirectToOrganizationProfile()` method instead."),t.redirectToOrganizationProfile()},[]),null),"RedirectToOrganizationProfile");dn(({clerk:t})=>(le.useEffect(()=>{v_("RedirectToCreateOrganization","Use the `redirectToCreateOrganization()` method instead."),t.redirectToCreateOrganization()},[]),null),"RedirectToCreateOrganization");dn(({clerk:t,...e})=>(le.useEffect(()=>{t.handleRedirectCallback(e)},[]),null),"AuthenticateWithRedirectCallback");function T2(t,e,n){if(typeof t=="function")return t(e);if(typeof t<"u")return t;if(typeof n<"u")return n}const _i=t=>{Cj()&&console.error(`Clerk: ${t}`)};var fb=QA();const Rj=Oh(fb),Iw=(t,...e)=>{const n={...t};for(const r of e)delete n[r];return n};var nc=t=>e=>{try{return le.Children.only(t)}catch{return Ks.throw(lj(e))}},rc=(t,e)=>(t||(t=e),typeof t=="string"&&(t=le.createElement("button",null,t)),t),ic=t=>(...e)=>{if(t&&typeof t=="function")return t(...e)};function Dj(t){return typeof t=="function"}var Tm=new Map;function Ij(t,e,n=1){le.useEffect(()=>{const r=Tm.get(t)||0;return r==n?Ks.throw(e):(Tm.set(t,r+1),()=>{Tm.set(t,(Tm.get(t)||1)-1)})},[])}function Lj(t,e,n){const r=t.displayName||t.name||e||"Component",i=s=>(Ij(e,n),le.createElement(t,{...s}));return i.displayName=`withMaxAllowedInstancesGuard(${r})`,i}var If=t=>{const[e,n]=z.useState(new Map);return t.map(r=>({id:r.id,mount:i=>n(s=>new Map(s).set(String(r.id),i)),unmount:()=>n(i=>{const s=new Map(i);return s.set(String(r.id),null),s}),portal:()=>{const i=e.get(String(r.id));return i?fb.createPortal(r.component,i):null}}))},yi=(t,e)=>!!t&&le.isValidElement(t)&&(t==null?void 0:t.type)===e,j9=(t,e)=>V9({children:t,reorderItemsLabels:["account","security","billing","apiKeys"],LinkComponent:Bh,PageComponent:Ph,MenuItemsComponent:pb,componentName:"UserProfile"},e),$9=(t,e)=>V9({children:t,reorderItemsLabels:["general","members","billing","apiKeys"],LinkComponent:gb,PageComponent:mb,componentName:"OrganizationProfile"},e),q9=t=>{const e=[],n=[gb,mb,pb,Ph,Bh];return le.Children.forEach(t,r=>{n.some(i=>yi(r,i))||e.push(r)}),e},V9=(t,e)=>{const{children:n,LinkComponent:r,PageComponent:i,MenuItemsComponent:s,reorderItemsLabels:a,componentName:l}=t,{allowForAnyChildren:u=!1}=e||{},d=[];le.Children.forEach(n,C=>{if(!yi(C,i)&&!yi(C,r)&&!yi(C,s)){C&&!u&&_i(pj(l));return}const{props:O}=C,{children:L,label:D,url:R,labelIcon:F}=O;if(yi(C,i))if(Lw(O,a))d.push({label:D});else if(S2(O))d.push({label:D,labelIcon:F,children:L,url:R});else{_i(mj(l));return}if(yi(C,r))if(w2(O))d.push({label:D,labelIcon:F,url:R});else{_i(gj(l));return}});const f=[],p=[],g=[];d.forEach((C,O)=>{if(S2(C)){f.push({component:C.children,id:O}),p.push({component:C.labelIcon,id:O});return}w2(C)&&g.push({component:C.labelIcon,id:O})});const b=If(f),v=If(p),E=If(g),x=[],S=[];return d.forEach((C,O)=>{if(Lw(C,a)){x.push({label:C.label});return}if(S2(C)){const{portal:L,mount:D,unmount:R}=b.find(q=>q.id===O),{portal:F,mount:G,unmount:Z}=v.find(q=>q.id===O);x.push({label:C.label,url:C.url,mount:D,unmount:R,mountIcon:G,unmountIcon:Z}),S.push(L),S.push(F);return}if(w2(C)){const{portal:L,mount:D,unmount:R}=E.find(F=>F.id===O);x.push({label:C.label,url:C.url,mountIcon:D,unmountIcon:R}),S.push(L);return}}),{customPages:x,customPagesPortals:S}},Lw=(t,e)=>{const{children:n,label:r,url:i,labelIcon:s}=t;return!n&&!i&&!s&&e.some(a=>a===r)},S2=t=>{const{children:e,label:n,url:r,labelIcon:i}=t;return!!e&&!!r&&!!i&&!!n},w2=t=>{const{children:e,label:n,url:r,labelIcon:i}=t;return!e&&!!r&&!!i&&!!n},Pj=(t,e)=>{var n;return Bj({children:t,reorderItemsLabels:["manageAccount","signOut"],MenuItemsComponent:pb,MenuActionComponent:Y9,MenuLinkComponent:W9,UserProfileLinkComponent:Bh,UserProfilePageComponent:Ph,allowForAnyChildren:(n=e==null?void 0:e.allowForAnyChildren)!=null?n:!1})},Bj=({children:t,MenuItemsComponent:e,MenuActionComponent:n,MenuLinkComponent:r,UserProfileLinkComponent:i,UserProfilePageComponent:s,reorderItemsLabels:a,allowForAnyChildren:l=!1})=>{const u=[],d=[],f=[];le.Children.forEach(t,E=>{if(!yi(E,e)&&!yi(E,i)&&!yi(E,s)){E&&!l&&_i(bj);return}if(yi(E,i)||yi(E,s))return;const{props:x}=E;le.Children.forEach(x.children,S=>{if(!yi(S,n)&&!yi(S,r)){S&&_i(vj);return}const{props:C}=S,{label:O,labelIcon:L,href:D,onClick:R,open:F}=C;if(yi(S,n))if(Pw(C,a))u.push({label:O});else if(k2(C)){const G={label:O,labelIcon:L};if(R!==void 0)u.push({...G,onClick:R});else if(F!==void 0)u.push({...G,open:F.startsWith("/")?F:`/${F}`});else{_i("Custom menu item must have either onClick or open property");return}}else{_i(Tj);return}if(yi(S,r))if(C2(C))u.push({label:O,labelIcon:L,href:D});else{_i(xj);return}})});const p=[],g=[];u.forEach((E,x)=>{k2(E)&&p.push({component:E.labelIcon,id:x}),C2(E)&&g.push({component:E.labelIcon,id:x})});const b=If(p),v=If(g);return u.forEach((E,x)=>{if(Pw(E,a)&&d.push({label:E.label}),k2(E)){const{portal:S,mount:C,unmount:O}=b.find(D=>D.id===x),L={label:E.label,mountIcon:C,unmountIcon:O};"onClick"in E?L.onClick=E.onClick:"open"in E&&(L.open=E.open),d.push(L),f.push(S)}if(C2(E)){const{portal:S,mount:C,unmount:O}=v.find(L=>L.id===x);d.push({label:E.label,href:E.href,mountIcon:C,unmountIcon:O}),f.push(S)}}),{customMenuItems:d,customMenuItemsPortals:f}},Pw=(t,e)=>{const{children:n,label:r,onClick:i,labelIcon:s}=t;return!n&&!i&&!s&&e.some(a=>a===r)},k2=t=>{const{label:e,labelIcon:n,onClick:r,open:i}=t;return!!n&&!!e&&(typeof r=="function"||typeof i=="string")},C2=t=>{const{label:e,href:n,labelIcon:r}=t;return!!n&&!!r&&!!e},zj=t=>{const e=t==null?void 0:t.isReady;return n=>new Promise((r,i)=>{const{root:s=document==null?void 0:document.body,selector:a,timeout:l=0}=n;if(!s){i(new Error("No root element provided"));return}let u=s;if(a&&(u=s==null?void 0:s.querySelector(a)),e(u,a)){r();return}const d=new MutationObserver(f=>{for(const p of f)if(!u&&a&&(u=s==null?void 0:s.querySelector(a)),(t.childList&&p.type==="childList"||t.attributes&&p.type==="attributes")&&e(u,a)){d.disconnect(),r();return}});d.observe(s,t),l>0&&setTimeout(()=>{d.disconnect(),i(new Error(`Timeout waiting for ${a}`))},l)})},Uj=zj({childList:!0,subtree:!0,isReady:(t,e)=>{var n;return!!(t!=null&&t.childElementCount)&&((n=t==null?void 0:t.matches)==null?void 0:n.call(t,e))&&t.childElementCount>0}});function Ci(t,e){const n=z.useRef(),[r,i]=z.useState("rendering");return z.useEffect(()=>{if(!t)throw new Error("Clerk: no component name provided, unable to detect mount.");if(typeof window<"u"&&!n.current){const s=`[data-clerk-component="${t}"]`,a=e==null?void 0:e.selector;n.current=Uj({selector:a?s+a:s}).then(()=>{i("rendered")}).catch(()=>{i("error")})}},[t,e==null?void 0:e.selector]),r}var Sm=t=>"mount"in t,Bw=t=>"open"in t,zw=t=>t==null?void 0:t.map(({mountIcon:e,unmountIcon:n,...r})=>r),ti=class extends le.PureComponent{constructor(){super(...arguments),this.rootRef=le.createRef()}componentDidUpdate(t){var e,n,r,i;if(!Sm(t)||!Sm(this.props))return;const s=Iw(t.props,"customPages","customMenuItems","children"),a=Iw(this.props.props,"customPages","customMenuItems","children"),l=((e=s.customPages)==null?void 0:e.length)!==((n=a.customPages)==null?void 0:n.length),u=((r=s.customMenuItems)==null?void 0:r.length)!==((i=a.customMenuItems)==null?void 0:i.length),d=zw(t.props.customMenuItems),f=zw(this.props.props.customMenuItems);(!Nw(s,a)||!Nw(d,f)||l||u)&&this.rootRef.current&&this.props.updateProps({node:this.rootRef.current,props:this.props.props})}componentDidMount(){this.rootRef.current&&(Sm(this.props)&&this.props.mount(this.rootRef.current,this.props.props),Bw(this.props)&&this.props.open(this.props.props))}componentWillUnmount(){this.rootRef.current&&(Sm(this.props)&&this.props.unmount(this.rootRef.current),Bw(this.props)&&this.props.close())}render(){const{hideRootHtmlElement:t=!1}=this.props,e={ref:this.rootRef,...this.props.rootProps,...this.props.component&&{"data-clerk-component":this.props.component}};return le.createElement(le.Fragment,null,!t&&le.createElement("div",{...e}),this.props.children)}},hb=t=>{var e,n;return le.createElement(le.Fragment,null,(e=t==null?void 0:t.customPagesPortals)==null?void 0:e.map((r,i)=>z.createElement(r,{key:i})),(n=t==null?void 0:t.customMenuItemsPortals)==null?void 0:n.map((r,i)=>z.createElement(r,{key:i})))},Fj=dn(({clerk:t,component:e,fallback:n,...r})=>{const s=Ci(e)==="rendering"||!t.loaded,a={...s&&n&&{style:{display:"none"}}};return le.createElement(le.Fragment,null,s&&n,t.loaded&&le.createElement(ti,{component:e,mount:t.mountSignIn,unmount:t.unmountSignIn,updateProps:t.__unstable__updateProps,props:r,rootProps:a}))},{component:"SignIn",renderWhileLoading:!0}),Hj=dn(({clerk:t,component:e,fallback:n,...r})=>{const s=Ci(e)==="rendering"||!t.loaded,a={...s&&n&&{style:{display:"none"}}};return le.createElement(le.Fragment,null,s&&n,t.loaded&&le.createElement(ti,{component:e,mount:t.mountSignUp,unmount:t.unmountSignUp,updateProps:t.__unstable__updateProps,props:r,rootProps:a}))},{component:"SignUp",renderWhileLoading:!0});function Ph({children:t}){return _i(cj),le.createElement(le.Fragment,null,t)}function Bh({children:t}){return _i(dj),le.createElement(le.Fragment,null,t)}var jj=dn(({clerk:t,component:e,fallback:n,...r})=>{const s=Ci(e)==="rendering"||!t.loaded,a={...s&&n&&{style:{display:"none"}}},{customPages:l,customPagesPortals:u}=j9(r.children);return le.createElement(le.Fragment,null,s&&n,le.createElement(ti,{component:e,mount:t.mountUserProfile,unmount:t.unmountUserProfile,updateProps:t.__unstable__updateProps,props:{...r,customPages:l},rootProps:a},le.createElement(hb,{customPagesPortals:u})))},{component:"UserProfile",renderWhileLoading:!0});Object.assign(jj,{Page:Ph,Link:Bh});var G9=z.createContext({mount:()=>{},unmount:()=>{},updateProps:()=>{}}),$j=dn(({clerk:t,component:e,fallback:n,...r})=>{const s=Ci(e)==="rendering"||!t.loaded,a={...s&&n&&{style:{display:"none"}}},{customPages:l,customPagesPortals:u}=j9(r.children,{allowForAnyChildren:!!r.__experimental_asProvider}),d={...r.userProfileProps,customPages:l},{customMenuItems:f,customMenuItemsPortals:p}=Pj(r.children,{allowForAnyChildren:!!r.__experimental_asProvider}),g=q9(r.children),b={mount:t.mountUserButton,unmount:t.unmountUserButton,updateProps:t.__unstable__updateProps,props:{...r,userProfileProps:d,customMenuItems:f}},v={customPagesPortals:u,customMenuItemsPortals:p};return le.createElement(G9.Provider,{value:b},s&&n,t.loaded&&le.createElement(ti,{component:e,...b,hideRootHtmlElement:!!r.__experimental_asProvider,rootProps:a},r.__experimental_asProvider?g:null,le.createElement(hb,{...v})))},{component:"UserButton",renderWhileLoading:!0});function pb({children:t}){return _i(yj),le.createElement(le.Fragment,null,t)}function Y9({children:t}){return _i(Ej),le.createElement(le.Fragment,null,t)}function W9({children:t}){return _i(_j),le.createElement(le.Fragment,null,t)}function qj(t){const e=z.useContext(G9),n={...e,props:{...e.props,...t}};return le.createElement(ti,{...n})}var Vj=Object.assign($j,{UserProfilePage:Ph,UserProfileLink:Bh,MenuItems:pb,Action:Y9,Link:W9,__experimental_Outlet:qj});function mb({children:t}){return _i(fj),le.createElement(le.Fragment,null,t)}function gb({children:t}){return _i(hj),le.createElement(le.Fragment,null,t)}var Gj=dn(({clerk:t,component:e,fallback:n,...r})=>{const s=Ci(e)==="rendering"||!t.loaded,a={...s&&n&&{style:{display:"none"}}},{customPages:l,customPagesPortals:u}=$9(r.children);return le.createElement(le.Fragment,null,s&&n,t.loaded&&le.createElement(ti,{component:e,mount:t.mountOrganizationProfile,unmount:t.unmountOrganizationProfile,updateProps:t.__unstable__updateProps,props:{...r,customPages:l},rootProps:a},le.createElement(hb,{customPagesPortals:u})))},{component:"OrganizationProfile",renderWhileLoading:!0});Object.assign(Gj,{Page:mb,Link:gb});dn(({clerk:t,component:e,fallback:n,...r})=>{const s=Ci(e)==="rendering"||!t.loaded,a={...s&&n&&{style:{display:"none"}}};return le.createElement(le.Fragment,null,s&&n,t.loaded&&le.createElement(ti,{component:e,mount:t.mountCreateOrganization,unmount:t.unmountCreateOrganization,updateProps:t.__unstable__updateProps,props:r,rootProps:a}))},{component:"CreateOrganization",renderWhileLoading:!0});var K9=z.createContext({mount:()=>{},unmount:()=>{},updateProps:()=>{}}),Yj=dn(({clerk:t,component:e,fallback:n,...r})=>{const s=Ci(e)==="rendering"||!t.loaded,a={...s&&n&&{style:{display:"none"}}},{customPages:l,customPagesPortals:u}=$9(r.children,{allowForAnyChildren:!!r.__experimental_asProvider}),d={...r.organizationProfileProps,customPages:l},f=q9(r.children),p={mount:t.mountOrganizationSwitcher,unmount:t.unmountOrganizationSwitcher,updateProps:t.__unstable__updateProps,props:{...r,organizationProfileProps:d},rootProps:a,component:e};return t.__experimental_prefetchOrganizationSwitcher(),le.createElement(K9.Provider,{value:p},le.createElement(le.Fragment,null,s&&n,t.loaded&&le.createElement(ti,{...p,hideRootHtmlElement:!!r.__experimental_asProvider},r.__experimental_asProvider?f:null,le.createElement(hb,{customPagesPortals:u}))))},{component:"OrganizationSwitcher",renderWhileLoading:!0});function Wj(t){const e=z.useContext(K9),n={...e,props:{...e.props,...t}};return le.createElement(ti,{...n})}Object.assign(Yj,{OrganizationProfilePage:mb,OrganizationProfileLink:gb,__experimental_Outlet:Wj});dn(({clerk:t,component:e,fallback:n,...r})=>{const s=Ci(e)==="rendering"||!t.loaded,a={...s&&n&&{style:{display:"none"}}};return le.createElement(le.Fragment,null,s&&n,t.loaded&&le.createElement(ti,{component:e,mount:t.mountOrganizationList,unmount:t.unmountOrganizationList,updateProps:t.__unstable__updateProps,props:r,rootProps:a}))},{component:"OrganizationList",renderWhileLoading:!0});dn(({clerk:t,component:e,fallback:n,...r})=>{const s=Ci(e)==="rendering"||!t.loaded,a={...s&&n&&{style:{display:"none"}}};return le.createElement(le.Fragment,null,s&&n,t.loaded&&le.createElement(ti,{component:e,open:t.openGoogleOneTap,close:t.closeGoogleOneTap,updateProps:t.__unstable__updateProps,props:r,rootProps:a}))},{component:"GoogleOneTap",renderWhileLoading:!0});dn(({clerk:t,component:e,fallback:n,...r})=>{const s=Ci(e)==="rendering"||!t.loaded,a={...s&&n&&{style:{display:"none"}}};return le.createElement(le.Fragment,null,s&&n,t.loaded&&le.createElement(ti,{component:e,mount:t.mountWaitlist,unmount:t.unmountWaitlist,updateProps:t.__unstable__updateProps,props:r,rootProps:a}))},{component:"Waitlist",renderWhileLoading:!0});var Kj=dn(({clerk:t,component:e,fallback:n,...r})=>{const s=Ci(e,{selector:'[data-component-status="ready"]'})==="rendering"||!t.loaded,a={...s&&n&&{style:{display:"none"}}};return le.createElement(le.Fragment,null,s&&n,t.loaded&&le.createElement(ti,{component:e,mount:t.mountPricingTable,unmount:t.unmountPricingTable,updateProps:t.__unstable__updateProps,props:r,rootProps:a}))},{component:"PricingTable",renderWhileLoading:!0});dn(({clerk:t,component:e,fallback:n,...r})=>{const s=Ci(e)==="rendering"||!t.loaded,a={...s&&n&&{style:{display:"none"}}};return le.createElement(le.Fragment,null,s&&n,t.loaded&&le.createElement(ti,{component:e,mount:t.mountAPIKeys,unmount:t.unmountAPIKeys,updateProps:t.__unstable__updateProps,props:r,rootProps:a}))},{component:"ApiKeys",renderWhileLoading:!0});dn(({clerk:t,component:e,fallback:n,...r})=>{const s=Ci(e)==="rendering"||!t.loaded,a={...s&&n&&{style:{display:"none"}}};return le.createElement(le.Fragment,null,s&&n,t.loaded&&le.createElement(ti,{component:e,mount:t.mountUserAvatar,unmount:t.unmountUserAvatar,updateProps:t.__unstable__updateProps,props:r,rootProps:a}))},{component:"UserAvatar",renderWhileLoading:!0});dn(({clerk:t,component:e,fallback:n,...r})=>{const s=Ci(e)==="rendering"||!t.loaded,a={...s&&n&&{style:{display:"none"}}};return le.createElement(le.Fragment,null,s&&n,t.loaded&&le.createElement(ti,{component:e,mount:t.mountTaskChooseOrganization,unmount:t.unmountTaskChooseOrganization,updateProps:t.__unstable__updateProps,props:r,rootProps:a}))},{component:"TaskChooseOrganization",renderWhileLoading:!0});dn(({clerk:t,component:e,fallback:n,...r})=>{const s=Ci(e)==="rendering"||!t.loaded,a={...s&&n&&{style:{display:"none"}}};return le.createElement(le.Fragment,null,s&&n,t.loaded&&le.createElement(ti,{component:e,mount:t.mountTaskResetPassword,unmount:t.unmountTaskResetPassword,updateProps:t.__unstable__updateProps,props:r,rootProps:a}))},{component:"TaskResetPassword",renderWhileLoading:!0});var X9=t=>{throw TypeError(t)},y_=(t,e,n)=>e.has(t)||X9("Cannot "+n),Ln=(t,e,n)=>(y_(t,e,"read from private field"),n?n.call(t):e.get(t)),xl=(t,e,n)=>e.has(t)?X9("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),wu=(t,e,n,r)=>(y_(t,e,"write to private field"),e.set(t,n),n),A2=(t,e,n)=>(y_(t,e,"access private method"),n);const Xj={initialDelay:125,maxDelayBetweenRetries:0,factor:2,shouldRetry:(t,e)=>e<5,retryImmediately:!1,jitter:!0},Qj=100,Q9=async t=>new Promise(e=>setTimeout(e,t)),Z9=(t,e)=>e?t*(1+Math.random()):t,Zj=t=>{let e=0;const n=()=>{const r=t.initialDelay,i=t.factor;let s=r*Math.pow(i,e);return s=Z9(s,t.jitter),Math.min(t.maxDelayBetweenRetries||s,s)};return async()=>{await Q9(n()),e++}},Jj=async(t,e={})=>{let n=0;const{shouldRetry:r,initialDelay:i,maxDelayBetweenRetries:s,factor:a,retryImmediately:l,jitter:u,onBeforeRetry:d}={...Xj,...e},f=Zj({initialDelay:i,maxDelayBetweenRetries:s,factor:a,jitter:u});for(;;)try{return await t()}catch(p){if(n++,!r(p,n))throw p;d&&await d(n),l&&n===1?await Q9(Z9(Qj,u)):await f()}},e$="loadScript cannot be called when document does not exist",t$="loadScript cannot be called without a src";async function n$(t="",e){const{async:n,defer:r,beforeLoad:i,crossOrigin:s,nonce:a}=e||{};return Jj(()=>new Promise((u,d)=>{t||d(new Error(t$)),(!document||!document.body)&&d(new Error(e$));const f=document.createElement("script");s&&f.setAttribute("crossorigin",s),f.async=n||!1,f.defer=r||!1,f.addEventListener("load",()=>{f.remove(),u(f)}),f.addEventListener("error",p=>{f.remove(),d(p.error??new Error(`failed to load script: ${t}`))}),f.src=t,f.nonce=a,i==null||i(f),document.body.appendChild(f)}),{shouldRetry:(u,d)=>d<=5})}function r$(t){return t?i$(t)||J9(t):!0}function i$(t){return/^http(s)?:\/\//.test(t||"")}function J9(t){return t.startsWith("/")}function s$(t){return t?J9(t)?new URL(t,window.location.origin).toString():t:""}function a$(t){if(!t)return"";let e;if(t.match(/^(clerk\.)+\w*$/))e=/(clerk\.)*(?=clerk\.)/;else{if(t.match(/\.clerk.accounts/))return t;e=/^(clerk\.)*/gi}return`clerk.${t.replace(e,"")}`}const o$=(t,e="5.121.1")=>{if(t)return t;const n=l$(e);return n?n==="snapshot"?"5.121.1":n:u$(e)},l$=t=>{var e;return(e=t.trim().replace(/^v/,"").match(/-(.+?)(\.|$)/))==null?void 0:e[1]},u$=t=>t.trim().replace(/^v/,"").split(".")[0],eN="failed_to_load_clerk_js",c$="failed_to_load_clerk_js_timeout",T4="Failed to load Clerk",{isDevOrStagingUrl:d$}=rH(),tN=_9({packageName:"@clerk/shared"});function f$(t){tN.setPackageName({packageName:t})}function S4(){if(typeof window>"u"||!window.Clerk)return!1;const t=window.Clerk;return typeof t=="object"&&typeof t.load=="function"}function h$(t){if(typeof window>"u"||!window.performance)return!1;const e=performance.getEntriesByName(t,"resource");if(e.length===0)return!1;const n=e[e.length-1];return n.transferSize===0&&n.decodedBodySize===0&&(n.responseEnd===0||n.responseEnd>0&&n.responseStart>0||"responseStatus"in n&&(n.responseStatus>=400||n.responseStatus===0))}function Uw(t,e){return new Promise((n,r)=>{let i=!1;const s=(f,p)=>{clearTimeout(f),clearInterval(p)};e==null||e.addEventListener("error",()=>{s(u,d),r(new h4(T4,{code:eN}))});const a=()=>{i||S4()&&(i=!0,s(u,d),n(null))},u=setTimeout(()=>{i||(i=!0,s(u,d),S4()?n(null):r(new h4(T4,{code:c$})))},t);a();const d=setInterval(()=>{if(i){clearInterval(d);return}a()},100)})}const p$=async t=>{const e=(t==null?void 0:t.scriptLoadTimeout)??15e3;if(S4())return null;if(!(t!=null&&t.publishableKey))return tN.throwMissingPublishableKeyError(),null;const n=m$(t),r=document.querySelector("script[data-clerk-js-script]");if(r)if(h$(n))r.remove();else try{return await Uw(e,r),null}catch{r.remove()}const i=Uw(e);return n$(n,{async:!0,crossOrigin:"anonymous",nonce:t.nonce,beforeLoad:b$(t)}).catch(s=>{throw new h4(T4+(s.message?`, ${s.message}`:""),{code:eN,cause:s})}),i},m$=t=>{var f,p;const{clerkJSUrl:e,clerkJSVariant:n,clerkJSVersion:r,proxyUrl:i,domain:s,publishableKey:a}=t;if(e)return e;let l="";i&&r$(i)?l=s$(i).replace(/http(s)?:\/\//,""):s&&!d$(((f=vw(a))==null?void 0:f.frontendApi)||"")?l=a$(s):l=((p=vw(a))==null?void 0:p.frontendApi)||"";const u=n?`${n.replace(/\.+$/,"")}.`:"",d=o$(r);return`https://${l}/npm/@clerk/clerk-js@${d}/dist/clerk.${u}browser.js`},g$=t=>{const e={};return t.publishableKey&&(e["data-clerk-publishable-key"]=t.publishableKey),t.proxyUrl&&(e["data-clerk-proxy-url"]=t.proxyUrl),t.domain&&(e["data-clerk-domain"]=t.domain),t.nonce&&(e.nonce=t.nonce),e},b$=t=>e=>{const n=g$(t);for(const r in n)e.setAttribute(r,n[r])},v$=(t,e,n)=>!t&&n?y$(n):E$(e),y$=t=>{const e=t.userId,n=t.user,r=t.sessionId,i=t.sessionStatus,s=t.sessionClaims;return{userId:e,user:n,sessionId:r,session:t.session,sessionStatus:i,sessionClaims:s,organization:t.organization,orgId:t.orgId,orgRole:t.orgRole,orgPermissions:t.orgPermissions,orgSlug:t.orgSlug,actor:t.actor,factorVerificationAge:t.factorVerificationAge}},E$=t=>{var v,E,x,S;const e=t.user?t.user.id:t.user,n=t.user,r=t.session?t.session.id:t.session,i=t.session,s=(v=t.session)==null?void 0:v.status,a=t.session?(x=(E=t.session.lastActiveToken)==null?void 0:E.jwt)==null?void 0:x.claims:null,l=t.session?t.session.factorVerificationAge:null,u=i==null?void 0:i.actor,d=t.organization,f=t.organization?t.organization.id:t.organization,p=d==null?void 0:d.slug,g=d&&((S=n==null?void 0:n.organizationMemberships)==null?void 0:S.find(C=>C.organization.id===f)),b=g&&g.permissions;return{userId:e,user:n,sessionId:r,session:i,sessionStatus:s,sessionClaims:a,organization:d,orgId:f,orgRole:g&&g.role,orgSlug:p,orgPermissions:b,actor:u,factorVerificationAge:l}};function Bg(){return typeof window<"u"}const Fw=(t,e,n,r,i)=>{const{notify:s}=i||{};let a=t.get(n);a||(a=[],t.set(n,a)),a.push(r),s&&e.has(n)&&r(e.get(n))},Hw=(t,e,n)=>(t.get(e)||[]).map(r=>r(n)),jw=(t,e,n)=>{const r=t.get(e);r&&(n?r.splice(r.indexOf(n)>>>0,1):t.set(e,[]))},_$=()=>{const t=new Map,e=new Map,n=new Map;return{on:(...i)=>Fw(t,e,...i),prioritizedOn:(...i)=>Fw(n,e,...i),emit:(i,s)=>{e.set(i,s),Hw(n,i,s),Hw(t,i,s)},off:(...i)=>jw(t,...i),prioritizedOff:(...i)=>jw(n,...i),internal:{retrieveListeners:i=>t.get(i)||[]}}},wm={Status:"status"},x$=()=>_$();typeof window<"u"&&!window.global&&(window.global=typeof global>"u"?window:global);dn(({clerk:t,children:e,...n})=>{const{appearance:r,signUpFallbackRedirectUrl:i,forceRedirectUrl:s,fallbackRedirectUrl:a,signUpForceRedirectUrl:l,mode:u,initialValues:d,withSignUp:f,oauthFlow:p,...g}=n;e=rc(e,"Sign in");const b=nc(e)("SignInButton"),v=()=>{const S={forceRedirectUrl:s,fallbackRedirectUrl:a,signUpFallbackRedirectUrl:i,signUpForceRedirectUrl:l,initialValues:d,withSignUp:f,oauthFlow:p};return u==="modal"?t.openSignIn({...S,appearance:r}):t.redirectToSignIn({...S,signInFallbackRedirectUrl:a,signInForceRedirectUrl:s})},x={...g,onClick:async S=>(b&&typeof b=="object"&&"props"in b&&await ic(b.props.onClick)(S),v())};return le.cloneElement(b,x)},{component:"SignInButton",renderWhileLoading:!0});dn(({clerk:t,children:e,...n})=>{const{redirectUrl:r,...i}=n;e=rc(e,"Sign in with Metamask");const s=nc(e)("SignInWithMetamaskButton"),a=async()=>{async function d(){await t.authenticateWithMetamask({redirectUrl:r||void 0})}d()},u={...i,onClick:async d=>(await ic(s.props.onClick)(d),a())};return le.cloneElement(s,u)},{component:"SignInWithMetamask",renderWhileLoading:!0});dn(({clerk:t,children:e,...n})=>{const{redirectUrl:r="/",signOutOptions:i,...s}=n;e=rc(e,"Sign out");const a=nc(e)("SignOutButton"),l=()=>t.signOut({redirectUrl:r,...i}),d={...s,onClick:async f=>(await ic(a.props.onClick)(f),l())};return le.cloneElement(a,d)},{component:"SignOutButton",renderWhileLoading:!0});dn(({clerk:t,children:e,...n})=>{const{appearance:r,unsafeMetadata:i,fallbackRedirectUrl:s,forceRedirectUrl:a,signInFallbackRedirectUrl:l,signInForceRedirectUrl:u,mode:d,initialValues:f,oauthFlow:p,...g}=n;e=rc(e,"Sign up");const b=nc(e)("SignUpButton"),v=()=>{const S={fallbackRedirectUrl:s,forceRedirectUrl:a,signInFallbackRedirectUrl:l,signInForceRedirectUrl:u,initialValues:f,oauthFlow:p};return d==="modal"?t.openSignUp({...S,appearance:r,unsafeMetadata:i}):t.redirectToSignUp({...S,signUpFallbackRedirectUrl:s,signUpForceRedirectUrl:a})},x={...g,onClick:async S=>(b&&typeof b=="object"&&"props"in b&&await ic(b.props.onClick)(S),v())};return le.cloneElement(b,x)},{component:"SignUpButton",renderWhileLoading:!0});var T$=()=>({fields:{identifier:null,password:null,code:null},raw:null,global:null}),S$=()=>({fields:{firstName:null,lastName:null,emailAddress:null,phoneNumber:null,password:null,username:null,code:null,captcha:null,legalAccepted:null},raw:null,global:null}),w$=class{constructor(t){this.isomorphicClerk=t,this.signInSignalProxy=this.buildSignInProxy(),this.signUpSignalProxy=this.buildSignUpProxy()}signInSignal(){return this.signInSignalProxy}signUpSignal(){return this.signUpSignalProxy}buildSignInProxy(){const t=this.gateProperty.bind(this),e=()=>this.client.signIn.__internal_future;return{errors:T$(),fetchStatus:"idle",signIn:{status:"needs_identifier",availableStrategies:[],isTransferable:!1,get id(){return t(e,"id",void 0)},get supportedFirstFactors(){return t(e,"supportedFirstFactors",[])},get supportedSecondFactors(){return t(e,"supportedSecondFactors",[])},get secondFactorVerification(){return t(e,"secondFactorVerification",{status:null,error:null,expireAt:null,externalVerificationRedirectURL:null,nonce:null,attempts:null,message:null,strategy:null,verifiedAtClient:null,verifiedFromTheSameClient:()=>!1,__internal_toSnapshot:()=>{throw new Error("__internal_toSnapshot called before Clerk is loaded")},pathRoot:"",reload:()=>{throw new Error("__internal_toSnapshot called before Clerk is loaded")}})},get identifier(){return t(e,"identifier",null)},get createdSessionId(){return t(e,"createdSessionId",null)},get userData(){return t(e,"userData",{})},get firstFactorVerification(){return t(e,"firstFactorVerification",{status:null,error:null,expireAt:null,externalVerificationRedirectURL:null,nonce:null,attempts:null,message:null,strategy:null,verifiedAtClient:null,verifiedFromTheSameClient:()=>!1,__internal_toSnapshot:()=>{throw new Error("__internal_toSnapshot called before Clerk is loaded")},pathRoot:"",reload:()=>{throw new Error("__internal_toSnapshot called before Clerk is loaded")}})},create:this.gateMethod(e,"create"),password:this.gateMethod(e,"password"),sso:this.gateMethod(e,"sso"),finalize:this.gateMethod(e,"finalize"),emailCode:this.wrapMethods(()=>e().emailCode,["sendCode","verifyCode"]),emailLink:this.wrapStruct(()=>e().emailLink,["sendLink","waitForVerification"],["verification"],{verification:null}),resetPasswordEmailCode:this.wrapMethods(()=>e().resetPasswordEmailCode,["sendCode","verifyCode","submitPassword"]),phoneCode:this.wrapMethods(()=>e().phoneCode,["sendCode","verifyCode"]),mfa:this.wrapMethods(()=>e().mfa,["sendPhoneCode","verifyPhoneCode","verifyTOTP","verifyBackupCode"]),ticket:this.gateMethod(e,"ticket"),passkey:this.gateMethod(e,"passkey"),web3:this.gateMethod(e,"web3")}}}buildSignUpProxy(){const t=this.gateProperty.bind(this),e=this.gateMethod.bind(this),n=this.wrapMethods.bind(this),r=()=>this.client.signUp.__internal_future;return{errors:S$(),fetchStatus:"idle",signUp:{get id(){return t(r,"id",void 0)},get requiredFields(){return t(r,"requiredFields",[])},get optionalFields(){return t(r,"optionalFields",[])},get missingFields(){return t(r,"missingFields",[])},get username(){return t(r,"username",null)},get firstName(){return t(r,"firstName",null)},get lastName(){return t(r,"lastName",null)},get emailAddress(){return t(r,"emailAddress",null)},get phoneNumber(){return t(r,"phoneNumber",null)},get web3Wallet(){return t(r,"web3Wallet",null)},get hasPassword(){return t(r,"hasPassword",!1)},get unsafeMetadata(){return t(r,"unsafeMetadata",{})},get createdSessionId(){return t(r,"createdSessionId",null)},get createdUserId(){return t(r,"createdUserId",null)},get abandonAt(){return t(r,"abandonAt",null)},get legalAcceptedAt(){return t(r,"legalAcceptedAt",null)},get locale(){return t(r,"locale",null)},get status(){return t(r,"status","missing_requirements")},get unverifiedFields(){return t(r,"unverifiedFields",[])},get isTransferable(){return t(r,"isTransferable",!1)},create:e(r,"create"),update:e(r,"update"),sso:e(r,"sso"),password:e(r,"password"),ticket:e(r,"ticket"),web3:e(r,"web3"),finalize:e(r,"finalize"),verifications:n(()=>r().verifications,["sendEmailCode","verifyEmailCode","sendPhoneCode","verifyPhoneCode"])}}}__internal_effect(t){throw new Error("__internal_effect called before Clerk is loaded")}__internal_computed(t){throw new Error("__internal_computed called before Clerk is loaded")}get client(){const t=this.isomorphicClerk.client;if(!t)throw new Error("Clerk client not ready");return t}gateProperty(t,e,n){return!Bg()||!this.isomorphicClerk.loaded?n:t()[e]}gateMethod(t,e){return(async(...n)=>{if(!Bg())return Ks.throw(`Attempted to call a method (${e}) that is not supported on the server.`);this.isomorphicClerk.loaded||await new Promise(i=>this.isomorphicClerk.addOnLoaded(i));const r=t();return r[e].apply(r,n)})}wrapMethods(t,e){return Object.fromEntries(e.map(n=>[n,this.gateMethod(t,n)]))}wrapStruct(t,e,n,r){const i={};for(const s of e)i[s]=this.gateMethod(t,s);for(const s of n)Object.defineProperty(i,s,{get:()=>this.gateProperty(t,s,r[s]),enumerable:!0});return i}};typeof globalThis.__BUILD_DISABLE_RHC__>"u"&&(globalThis.__BUILD_DISABLE_RHC__=!1);var k$={name:"@clerk/clerk-react",version:"5.59.6",environment:"production"},bg,td,nd,Tl,ua,vg,Al,bf,yg,nN=class rN{constructor(e){xl(this,bf),this.clerkjs=null,this.preopenOneTap=null,this.preopenUserVerification=null,this.preopenEnableOrganizationsPrompt=null,this.preopenSignIn=null,this.preopenCheckout=null,this.preopenPlanDetails=null,this.preopenSubscriptionDetails=null,this.preopenSignUp=null,this.preopenUserProfile=null,this.preopenOrganizationProfile=null,this.preopenCreateOrganization=null,this.preOpenWaitlist=null,this.premountSignInNodes=new Map,this.premountSignUpNodes=new Map,this.premountUserAvatarNodes=new Map,this.premountUserProfileNodes=new Map,this.premountUserButtonNodes=new Map,this.premountOrganizationProfileNodes=new Map,this.premountCreateOrganizationNodes=new Map,this.premountOrganizationSwitcherNodes=new Map,this.premountOrganizationListNodes=new Map,this.premountMethodCalls=new Map,this.premountWaitlistNodes=new Map,this.premountPricingTableNodes=new Map,this.premountAPIKeysNodes=new Map,this.premountOAuthConsentNodes=new Map,this.premountTaskChooseOrganizationNodes=new Map,this.premountTaskResetPasswordNodes=new Map,this.premountAddListenerCalls=new Map,this.loadedListeners=[],xl(this,bg,"loading"),xl(this,td),xl(this,nd),xl(this,Tl),xl(this,ua,x$()),xl(this,vg),this.buildSignInUrl=i=>{const s=()=>{var a;return((a=this.clerkjs)==null?void 0:a.buildSignInUrl(i))||""};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("buildSignInUrl",s)},this.buildSignUpUrl=i=>{const s=()=>{var a;return((a=this.clerkjs)==null?void 0:a.buildSignUpUrl(i))||""};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("buildSignUpUrl",s)},this.buildAfterSignInUrl=(...i)=>{const s=()=>{var a;return((a=this.clerkjs)==null?void 0:a.buildAfterSignInUrl(...i))||""};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("buildAfterSignInUrl",s)},this.buildAfterSignUpUrl=(...i)=>{const s=()=>{var a;return((a=this.clerkjs)==null?void 0:a.buildAfterSignUpUrl(...i))||""};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("buildAfterSignUpUrl",s)},this.buildAfterSignOutUrl=()=>{const i=()=>{var s;return((s=this.clerkjs)==null?void 0:s.buildAfterSignOutUrl())||""};if(this.clerkjs&&this.loaded)return i();this.premountMethodCalls.set("buildAfterSignOutUrl",i)},this.buildNewSubscriptionRedirectUrl=()=>{const i=()=>{var s;return((s=this.clerkjs)==null?void 0:s.buildNewSubscriptionRedirectUrl())||""};if(this.clerkjs&&this.loaded)return i();this.premountMethodCalls.set("buildNewSubscriptionRedirectUrl",i)},this.buildAfterMultiSessionSingleSignOutUrl=()=>{const i=()=>{var s;return((s=this.clerkjs)==null?void 0:s.buildAfterMultiSessionSingleSignOutUrl())||""};if(this.clerkjs&&this.loaded)return i();this.premountMethodCalls.set("buildAfterMultiSessionSingleSignOutUrl",i)},this.buildUserProfileUrl=()=>{const i=()=>{var s;return((s=this.clerkjs)==null?void 0:s.buildUserProfileUrl())||""};if(this.clerkjs&&this.loaded)return i();this.premountMethodCalls.set("buildUserProfileUrl",i)},this.buildCreateOrganizationUrl=()=>{const i=()=>{var s;return((s=this.clerkjs)==null?void 0:s.buildCreateOrganizationUrl())||""};if(this.clerkjs&&this.loaded)return i();this.premountMethodCalls.set("buildCreateOrganizationUrl",i)},this.buildOrganizationProfileUrl=()=>{const i=()=>{var s;return((s=this.clerkjs)==null?void 0:s.buildOrganizationProfileUrl())||""};if(this.clerkjs&&this.loaded)return i();this.premountMethodCalls.set("buildOrganizationProfileUrl",i)},this.buildWaitlistUrl=()=>{const i=()=>{var s;return((s=this.clerkjs)==null?void 0:s.buildWaitlistUrl())||""};if(this.clerkjs&&this.loaded)return i();this.premountMethodCalls.set("buildWaitlistUrl",i)},this.buildTasksUrl=()=>{const i=()=>{var s;return((s=this.clerkjs)==null?void 0:s.buildTasksUrl())||""};if(this.clerkjs&&this.loaded)return i();this.premountMethodCalls.set("buildTasksUrl",i)},this.buildUrlWithAuth=i=>{const s=()=>{var a;return((a=this.clerkjs)==null?void 0:a.buildUrlWithAuth(i))||""};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("buildUrlWithAuth",s)},this.handleUnauthenticated=async()=>{const i=()=>{var s;return(s=this.clerkjs)==null?void 0:s.handleUnauthenticated()};this.clerkjs&&this.loaded?i():this.premountMethodCalls.set("handleUnauthenticated",i)},this.on=(...i)=>{var s;if((s=this.clerkjs)!=null&&s.on)return this.clerkjs.on(...i);Ln(this,ua).on(...i)},this.off=(...i)=>{var s;if((s=this.clerkjs)!=null&&s.off)return this.clerkjs.off(...i);Ln(this,ua).off(...i)},this.addOnLoaded=i=>{this.loadedListeners.push(i),this.loaded&&this.emitLoaded()},this.emitLoaded=()=>{this.loadedListeners.forEach(i=>i()),this.loadedListeners=[]},this.beforeLoad=i=>{if(!i)throw new Error("Failed to hydrate latest Clerk JS")},this.hydrateClerkJS=i=>{var s,a;if(!i)throw new Error("Failed to hydrate latest Clerk JS");return this.clerkjs=i,this.premountMethodCalls.forEach(l=>l()),this.premountAddListenerCalls.forEach((l,u)=>{l.nativeUnsubscribe=i.addListener(u)}),(s=Ln(this,ua).internal.retrieveListeners("status"))==null||s.forEach(l=>{this.on("status",l,{notify:!0})}),(a=Ln(this,ua).internal.retrieveListeners("queryClientStatus"))==null||a.forEach(l=>{this.on("queryClientStatus",l,{notify:!0})}),this.preopenSignIn!==null&&i.openSignIn(this.preopenSignIn),this.preopenCheckout!==null&&i.__internal_openCheckout(this.preopenCheckout),this.preopenPlanDetails!==null&&i.__internal_openPlanDetails(this.preopenPlanDetails),this.preopenSubscriptionDetails!==null&&i.__internal_openSubscriptionDetails(this.preopenSubscriptionDetails),this.preopenSignUp!==null&&i.openSignUp(this.preopenSignUp),this.preopenUserProfile!==null&&i.openUserProfile(this.preopenUserProfile),this.preopenUserVerification!==null&&i.__internal_openReverification(this.preopenUserVerification),this.preopenOneTap!==null&&i.openGoogleOneTap(this.preopenOneTap),this.preopenOrganizationProfile!==null&&i.openOrganizationProfile(this.preopenOrganizationProfile),this.preopenCreateOrganization!==null&&i.openCreateOrganization(this.preopenCreateOrganization),this.preOpenWaitlist!==null&&i.openWaitlist(this.preOpenWaitlist),this.preopenEnableOrganizationsPrompt&&i.__internal_openEnableOrganizationsPrompt(this.preopenEnableOrganizationsPrompt),this.premountSignInNodes.forEach((l,u)=>{i.mountSignIn(u,l)}),this.premountSignUpNodes.forEach((l,u)=>{i.mountSignUp(u,l)}),this.premountUserProfileNodes.forEach((l,u)=>{i.mountUserProfile(u,l)}),this.premountUserAvatarNodes.forEach((l,u)=>{i.mountUserAvatar(u,l)}),this.premountUserButtonNodes.forEach((l,u)=>{i.mountUserButton(u,l)}),this.premountOrganizationListNodes.forEach((l,u)=>{i.mountOrganizationList(u,l)}),this.premountWaitlistNodes.forEach((l,u)=>{i.mountWaitlist(u,l)}),this.premountPricingTableNodes.forEach((l,u)=>{i.mountPricingTable(u,l)}),this.premountAPIKeysNodes.forEach((l,u)=>{i.mountAPIKeys(u,l)}),this.premountOAuthConsentNodes.forEach((l,u)=>{i.__internal_mountOAuthConsent(u,l)}),this.premountTaskChooseOrganizationNodes.forEach((l,u)=>{i.mountTaskChooseOrganization(u,l)}),this.premountTaskResetPasswordNodes.forEach((l,u)=>{i.mountTaskResetPassword(u,l)}),typeof this.clerkjs.status>"u"&&Ln(this,ua).emit(wm.Status,"ready"),this.emitLoaded(),this.clerkjs},this.__experimental_checkout=(...i)=>{var s;return(s=this.clerkjs)==null?void 0:s.__experimental_checkout(...i)},this.__unstable__updateProps=async i=>{const s=await A2(this,bf,yg).call(this);if(s&&"__unstable__updateProps"in s)return s.__unstable__updateProps(i)},this.setActive=i=>this.clerkjs?this.clerkjs.setActive(i):Promise.reject(),this.openSignIn=i=>{this.clerkjs&&this.loaded?this.clerkjs.openSignIn(i):this.preopenSignIn=i},this.closeSignIn=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeSignIn():this.preopenSignIn=null},this.__internal_openCheckout=i=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_openCheckout(i):this.preopenCheckout=i},this.__internal_closeCheckout=()=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_closeCheckout():this.preopenCheckout=null},this.__internal_openPlanDetails=i=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_openPlanDetails(i):this.preopenPlanDetails=i},this.__internal_closePlanDetails=()=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_closePlanDetails():this.preopenPlanDetails=null},this.__internal_openSubscriptionDetails=i=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_openSubscriptionDetails(i):this.preopenSubscriptionDetails=i??null},this.__internal_closeSubscriptionDetails=()=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_closeSubscriptionDetails():this.preopenSubscriptionDetails=null},this.__internal_openReverification=i=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_openReverification(i):this.preopenUserVerification=i},this.__internal_closeReverification=()=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_closeReverification():this.preopenUserVerification=null},this.__internal_openEnableOrganizationsPrompt=i=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_openEnableOrganizationsPrompt(i):this.preopenEnableOrganizationsPrompt=i},this.__internal_closeEnableOrganizationsPrompt=()=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_closeEnableOrganizationsPrompt():this.preopenEnableOrganizationsPrompt=null},this.openGoogleOneTap=i=>{this.clerkjs&&this.loaded?this.clerkjs.openGoogleOneTap(i):this.preopenOneTap=i},this.closeGoogleOneTap=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeGoogleOneTap():this.preopenOneTap=null},this.openUserProfile=i=>{this.clerkjs&&this.loaded?this.clerkjs.openUserProfile(i):this.preopenUserProfile=i},this.closeUserProfile=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeUserProfile():this.preopenUserProfile=null},this.openOrganizationProfile=i=>{this.clerkjs&&this.loaded?this.clerkjs.openOrganizationProfile(i):this.preopenOrganizationProfile=i},this.closeOrganizationProfile=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeOrganizationProfile():this.preopenOrganizationProfile=null},this.openCreateOrganization=i=>{this.clerkjs&&this.loaded?this.clerkjs.openCreateOrganization(i):this.preopenCreateOrganization=i},this.closeCreateOrganization=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeCreateOrganization():this.preopenCreateOrganization=null},this.openWaitlist=i=>{this.clerkjs&&this.loaded?this.clerkjs.openWaitlist(i):this.preOpenWaitlist=i},this.closeWaitlist=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeWaitlist():this.preOpenWaitlist=null},this.openSignUp=i=>{this.clerkjs&&this.loaded?this.clerkjs.openSignUp(i):this.preopenSignUp=i},this.closeSignUp=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeSignUp():this.preopenSignUp=null},this.mountSignIn=(i,s)=>{this.clerkjs&&this.loaded?this.clerkjs.mountSignIn(i,s):this.premountSignInNodes.set(i,s)},this.unmountSignIn=i=>{this.clerkjs&&this.loaded?this.clerkjs.unmountSignIn(i):this.premountSignInNodes.delete(i)},this.mountSignUp=(i,s)=>{this.clerkjs&&this.loaded?this.clerkjs.mountSignUp(i,s):this.premountSignUpNodes.set(i,s)},this.unmountSignUp=i=>{this.clerkjs&&this.loaded?this.clerkjs.unmountSignUp(i):this.premountSignUpNodes.delete(i)},this.mountUserAvatar=(i,s)=>{this.clerkjs&&this.loaded?this.clerkjs.mountUserAvatar(i,s):this.premountUserAvatarNodes.set(i,s)},this.unmountUserAvatar=i=>{this.clerkjs&&this.loaded?this.clerkjs.unmountUserAvatar(i):this.premountUserAvatarNodes.delete(i)},this.mountUserProfile=(i,s)=>{this.clerkjs&&this.loaded?this.clerkjs.mountUserProfile(i,s):this.premountUserProfileNodes.set(i,s)},this.unmountUserProfile=i=>{this.clerkjs&&this.loaded?this.clerkjs.unmountUserProfile(i):this.premountUserProfileNodes.delete(i)},this.mountOrganizationProfile=(i,s)=>{this.clerkjs&&this.loaded?this.clerkjs.mountOrganizationProfile(i,s):this.premountOrganizationProfileNodes.set(i,s)},this.unmountOrganizationProfile=i=>{this.clerkjs&&this.loaded?this.clerkjs.unmountOrganizationProfile(i):this.premountOrganizationProfileNodes.delete(i)},this.mountCreateOrganization=(i,s)=>{this.clerkjs&&this.loaded?this.clerkjs.mountCreateOrganization(i,s):this.premountCreateOrganizationNodes.set(i,s)},this.unmountCreateOrganization=i=>{this.clerkjs&&this.loaded?this.clerkjs.unmountCreateOrganization(i):this.premountCreateOrganizationNodes.delete(i)},this.mountOrganizationSwitcher=(i,s)=>{this.clerkjs&&this.loaded?this.clerkjs.mountOrganizationSwitcher(i,s):this.premountOrganizationSwitcherNodes.set(i,s)},this.unmountOrganizationSwitcher=i=>{this.clerkjs&&this.loaded?this.clerkjs.unmountOrganizationSwitcher(i):this.premountOrganizationSwitcherNodes.delete(i)},this.__experimental_prefetchOrganizationSwitcher=()=>{const i=()=>{var s;return(s=this.clerkjs)==null?void 0:s.__experimental_prefetchOrganizationSwitcher()};this.clerkjs&&this.loaded?i():this.premountMethodCalls.set("__experimental_prefetchOrganizationSwitcher",i)},this.mountOrganizationList=(i,s)=>{this.clerkjs&&this.loaded?this.clerkjs.mountOrganizationList(i,s):this.premountOrganizationListNodes.set(i,s)},this.unmountOrganizationList=i=>{this.clerkjs&&this.loaded?this.clerkjs.unmountOrganizationList(i):this.premountOrganizationListNodes.delete(i)},this.mountUserButton=(i,s)=>{this.clerkjs&&this.loaded?this.clerkjs.mountUserButton(i,s):this.premountUserButtonNodes.set(i,s)},this.unmountUserButton=i=>{this.clerkjs&&this.loaded?this.clerkjs.unmountUserButton(i):this.premountUserButtonNodes.delete(i)},this.mountWaitlist=(i,s)=>{this.clerkjs&&this.loaded?this.clerkjs.mountWaitlist(i,s):this.premountWaitlistNodes.set(i,s)},this.unmountWaitlist=i=>{this.clerkjs&&this.loaded?this.clerkjs.unmountWaitlist(i):this.premountWaitlistNodes.delete(i)},this.mountPricingTable=(i,s)=>{this.clerkjs&&this.loaded?this.clerkjs.mountPricingTable(i,s):this.premountPricingTableNodes.set(i,s)},this.unmountPricingTable=i=>{this.clerkjs&&this.loaded?this.clerkjs.unmountPricingTable(i):this.premountPricingTableNodes.delete(i)},this.mountAPIKeys=(i,s)=>{this.clerkjs&&this.loaded?this.clerkjs.mountAPIKeys(i,s):this.premountAPIKeysNodes.set(i,s)},this.unmountAPIKeys=i=>{this.clerkjs&&this.loaded?this.clerkjs.unmountAPIKeys(i):this.premountAPIKeysNodes.delete(i)},this.__internal_mountOAuthConsent=(i,s)=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_mountOAuthConsent(i,s):this.premountOAuthConsentNodes.set(i,s)},this.__internal_unmountOAuthConsent=i=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_unmountOAuthConsent(i):this.premountOAuthConsentNodes.delete(i)},this.mountTaskChooseOrganization=(i,s)=>{this.clerkjs&&this.loaded?this.clerkjs.mountTaskChooseOrganization(i,s):this.premountTaskChooseOrganizationNodes.set(i,s)},this.unmountTaskChooseOrganization=i=>{this.clerkjs&&this.loaded?this.clerkjs.unmountTaskChooseOrganization(i):this.premountTaskChooseOrganizationNodes.delete(i)},this.mountTaskResetPassword=(i,s)=>{this.clerkjs&&this.loaded?this.clerkjs.mountTaskResetPassword(i,s):this.premountTaskResetPasswordNodes.set(i,s)},this.unmountTaskResetPassword=i=>{this.clerkjs&&this.loaded?this.clerkjs.unmountTaskResetPassword(i):this.premountTaskResetPasswordNodes.delete(i)},this.addListener=i=>{if(this.clerkjs)return this.clerkjs.addListener(i);{const s=()=>{var a;const l=this.premountAddListenerCalls.get(i);l&&((a=l.nativeUnsubscribe)==null||a.call(l),this.premountAddListenerCalls.delete(i))};return this.premountAddListenerCalls.set(i,{unsubscribe:s,nativeUnsubscribe:void 0}),s}},this.navigate=i=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.navigate(i)};this.clerkjs&&this.loaded?s():this.premountMethodCalls.set("navigate",s)},this.redirectWithAuth=async(...i)=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.redirectWithAuth(...i)};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("redirectWithAuth",s)},this.redirectToSignIn=async i=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.redirectToSignIn(i)};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("redirectToSignIn",s)},this.redirectToSignUp=async i=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.redirectToSignUp(i)};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("redirectToSignUp",s)},this.redirectToUserProfile=async()=>{const i=()=>{var s;return(s=this.clerkjs)==null?void 0:s.redirectToUserProfile()};if(this.clerkjs&&this.loaded)return i();this.premountMethodCalls.set("redirectToUserProfile",i)},this.redirectToAfterSignUp=()=>{const i=()=>{var s;return(s=this.clerkjs)==null?void 0:s.redirectToAfterSignUp()};if(this.clerkjs&&this.loaded)return i();this.premountMethodCalls.set("redirectToAfterSignUp",i)},this.redirectToAfterSignIn=()=>{const i=()=>{var s;return(s=this.clerkjs)==null?void 0:s.redirectToAfterSignIn()};this.clerkjs&&this.loaded?i():this.premountMethodCalls.set("redirectToAfterSignIn",i)},this.redirectToAfterSignOut=()=>{const i=()=>{var s;return(s=this.clerkjs)==null?void 0:s.redirectToAfterSignOut()};this.clerkjs&&this.loaded?i():this.premountMethodCalls.set("redirectToAfterSignOut",i)},this.redirectToOrganizationProfile=async()=>{const i=()=>{var s;return(s=this.clerkjs)==null?void 0:s.redirectToOrganizationProfile()};if(this.clerkjs&&this.loaded)return i();this.premountMethodCalls.set("redirectToOrganizationProfile",i)},this.redirectToCreateOrganization=async()=>{const i=()=>{var s;return(s=this.clerkjs)==null?void 0:s.redirectToCreateOrganization()};if(this.clerkjs&&this.loaded)return i();this.premountMethodCalls.set("redirectToCreateOrganization",i)},this.redirectToWaitlist=async()=>{const i=()=>{var s;return(s=this.clerkjs)==null?void 0:s.redirectToWaitlist()};if(this.clerkjs&&this.loaded)return i();this.premountMethodCalls.set("redirectToWaitlist",i)},this.redirectToTasks=async i=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.redirectToTasks(i)};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("redirectToTasks",s)},this.handleRedirectCallback=async i=>{var s;const a=()=>{var l;return(l=this.clerkjs)==null?void 0:l.handleRedirectCallback(i)};this.clerkjs&&this.loaded?(s=a())==null||s.catch(()=>{}):this.premountMethodCalls.set("handleRedirectCallback",a)},this.handleGoogleOneTapCallback=async(i,s)=>{var a;const l=()=>{var u;return(u=this.clerkjs)==null?void 0:u.handleGoogleOneTapCallback(i,s)};this.clerkjs&&this.loaded?(a=l())==null||a.catch(()=>{}):this.premountMethodCalls.set("handleGoogleOneTapCallback",l)},this.handleEmailLinkVerification=async i=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.handleEmailLinkVerification(i)};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("handleEmailLinkVerification",s)},this.authenticateWithMetamask=async i=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.authenticateWithMetamask(i)};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("authenticateWithMetamask",s)},this.authenticateWithCoinbaseWallet=async i=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.authenticateWithCoinbaseWallet(i)};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("authenticateWithCoinbaseWallet",s)},this.authenticateWithBase=async i=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.authenticateWithBase(i)};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("authenticateWithBase",s)},this.authenticateWithOKXWallet=async i=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.authenticateWithOKXWallet(i)};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("authenticateWithOKXWallet",s)},this.authenticateWithSolana=async i=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.authenticateWithSolana(i)};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("authenticateWithSolana",s)},this.authenticateWithWeb3=async i=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.authenticateWithWeb3(i)};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("authenticateWithWeb3",s)},this.authenticateWithGoogleOneTap=async i=>(await A2(this,bf,yg).call(this)).authenticateWithGoogleOneTap(i),this.__internal_loadStripeJs=async()=>(await A2(this,bf,yg).call(this)).__internal_loadStripeJs(),this.createOrganization=async i=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.createOrganization(i)};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("createOrganization",s)},this.getOrganization=async i=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.getOrganization(i)};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("getOrganization",s)},this.joinWaitlist=async i=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.joinWaitlist(i)};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("joinWaitlist",s)},this.signOut=async(...i)=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.signOut(...i)};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("signOut",s)},this.__internal_attemptToEnableEnvironmentSetting=i=>{const s=()=>{var a;return(a=this.clerkjs)==null?void 0:a.__internal_attemptToEnableEnvironmentSetting(i)};if(this.clerkjs&&this.loaded)return s();this.premountMethodCalls.set("__internal_attemptToEnableEnvironmentSetting",s)};const{Clerk:n=null,publishableKey:r}=e||{};wu(this,Tl,r),wu(this,nd,e==null?void 0:e.proxyUrl),wu(this,td,e==null?void 0:e.domain),this.options=e,this.Clerk=n,this.mode=Bg()?"browser":"server",wu(this,vg,new w$(this)),this.options.sdkMetadata||(this.options.sdkMetadata=k$),Ln(this,ua).emit(wm.Status,"loading"),Ln(this,ua).prioritizedOn(wm.Status,i=>wu(this,bg,i)),Ln(this,Tl)&&this.loadClerkJS()}get publishableKey(){return Ln(this,Tl)}get loaded(){var e;return((e=this.clerkjs)==null?void 0:e.loaded)||!1}get status(){var e;return this.clerkjs?((e=this.clerkjs)==null?void 0:e.status)||(this.clerkjs.loaded?"ready":"loading"):Ln(this,bg)}static getOrCreateInstance(e){return(!Bg()||!Ln(this,Al)||e.Clerk&&Ln(this,Al).Clerk!==e.Clerk||Ln(this,Al).publishableKey!==e.publishableKey)&&wu(this,Al,new rN(e)),Ln(this,Al)}static clearInstance(){wu(this,Al,null)}get domain(){return typeof window<"u"&&window.location?T2(Ln(this,td),new URL(window.location.href),""):typeof Ln(this,td)=="function"?Ks.throw(x2):Ln(this,td)||""}get proxyUrl(){return typeof window<"u"&&window.location?T2(Ln(this,nd),new URL(window.location.href),""):typeof Ln(this,nd)=="function"?Ks.throw(x2):Ln(this,nd)||""}__internal_getOption(e){var n,r;return(n=this.clerkjs)!=null&&n.__internal_getOption?(r=this.clerkjs)==null?void 0:r.__internal_getOption(e):this.options[e]}get sdkMetadata(){var e;return((e=this.clerkjs)==null?void 0:e.sdkMetadata)||this.options.sdkMetadata||void 0}get instanceType(){var e;return(e=this.clerkjs)==null?void 0:e.instanceType}get frontendApi(){var e;return((e=this.clerkjs)==null?void 0:e.frontendApi)||""}get isStandardBrowser(){var e;return((e=this.clerkjs)==null?void 0:e.isStandardBrowser)||this.options.standardBrowser||!1}get __internal_queryClient(){var e;return(e=this.clerkjs)==null?void 0:e.__internal_queryClient}get isSatellite(){return typeof window<"u"&&window.location?T2(this.options.isSatellite,new URL(window.location.href),!1):typeof this.options.isSatellite=="function"?Ks.throw(x2):!1}async loadClerkJS(){var e;if(!(this.mode!=="browser"||this.loaded)){typeof window<"u"&&(window.__clerk_publishable_key=Ln(this,Tl),window.__clerk_proxy_url=this.proxyUrl,window.__clerk_domain=this.domain);try{if(this.Clerk){let n;Dj(this.Clerk)?(n=new this.Clerk(Ln(this,Tl),{proxyUrl:this.proxyUrl,domain:this.domain}),this.beforeLoad(n),await n.load(this.options)):(n=this.Clerk,n.loaded||(this.beforeLoad(n),await n.load(this.options))),global.Clerk=n}else if(!__BUILD_DISABLE_RHC__){if(global.Clerk||await p$({...this.options,publishableKey:Ln(this,Tl),proxyUrl:this.proxyUrl,domain:this.domain,nonce:this.options.nonce}),!global.Clerk)throw new Error("Failed to download latest ClerkJS. Contact support@clerk.com.");this.beforeLoad(global.Clerk),await global.Clerk.load(this.options)}return(e=global.Clerk)!=null&&e.loaded?this.hydrateClerkJS(global.Clerk):void 0}catch(n){const r=n;Ln(this,ua).emit(wm.Status,"error"),console.error(r.stack||r.message||r);return}}}get version(){var e;return(e=this.clerkjs)==null?void 0:e.version}get client(){if(this.clerkjs)return this.clerkjs.client}get session(){if(this.clerkjs)return this.clerkjs.session}get user(){if(this.clerkjs)return this.clerkjs.user}get organization(){if(this.clerkjs)return this.clerkjs.organization}get telemetry(){if(this.clerkjs)return this.clerkjs.telemetry}get __unstable__environment(){if(this.clerkjs)return this.clerkjs.__unstable__environment}get isSignedIn(){return this.clerkjs?this.clerkjs.isSignedIn:!1}get billing(){var e;return(e=this.clerkjs)==null?void 0:e.billing}get __internal_state(){return this.loaded&&this.clerkjs?this.clerkjs.__internal_state:Ln(this,vg)}get apiKeys(){var e;return(e=this.clerkjs)==null?void 0:e.apiKeys}__unstable__setEnvironment(...e){if(this.clerkjs&&"__unstable__setEnvironment"in this.clerkjs)this.clerkjs.__unstable__setEnvironment(e);else return}};bg=new WeakMap;td=new WeakMap;nd=new WeakMap;Tl=new WeakMap;ua=new WeakMap;vg=new WeakMap;Al=new WeakMap;bf=new WeakSet;yg=function(){return new Promise(t=>{this.addOnLoaded(()=>t(this.clerkjs))})};xl(nN,Al);var $w=nN;function C$(t){const{isomorphicClerkOptions:e,initialState:n,children:r}=t,{isomorphicClerk:i,clerkStatus:s}=A$(e),[a,l]=le.useState({client:i.client,session:i.session,user:i.user,organization:i.organization});le.useEffect(()=>i.addListener(se=>l({...se})),[]);const u=v$(i.loaded,a,n),d=le.useMemo(()=>({value:i}),[s]),f=le.useMemo(()=>({value:a.client}),[a.client]),{sessionId:p,sessionStatus:g,sessionClaims:b,session:v,userId:E,user:x,orgId:S,actor:C,organization:O,orgRole:L,orgSlug:D,orgPermissions:R,factorVerificationAge:F}=u,G=le.useMemo(()=>({value:{sessionId:p,sessionStatus:g,sessionClaims:b,userId:E,actor:C,orgId:S,orgRole:L,orgSlug:D,orgPermissions:R,factorVerificationAge:F}}),[p,g,E,C,S,L,D,F,b==null?void 0:b.__raw]),Z=le.useMemo(()=>({value:v}),[p,v]),q=le.useMemo(()=>({value:x}),[E,x]),ie=le.useMemo(()=>({value:{organization:O}}),[S,O]);return le.createElement(aj.Provider,{value:d},le.createElement(zH.Provider,{value:f},le.createElement(UH.Provider,{value:Z},le.createElement(qH,{...ie.value},le.createElement(ij.Provider,{value:G},le.createElement(BH.Provider,{value:q},le.createElement(HH,{value:void 0},r)))))))}var A$=t=>{const e=le.useRef($w.getOrCreateInstance(t)),[n,r]=le.useState(e.current.status);return le.useEffect(()=>{e.current.__unstable__updateProps({appearance:t.appearance})},[t.appearance]),le.useEffect(()=>{e.current.__unstable__updateProps({options:t})},[t.localization]),le.useEffect(()=>(e.current.on("status",r),()=>{e.current&&e.current.off("status",r),$w.clearInstance()}),[]),{isomorphicClerk:e.current,clerkStatus:n}};function N$(t){const{initialState:e,children:n,__internal_bypassMissingPublishableKey:r,...i}=t,{publishableKey:s="",Clerk:a}=i;return!a&&!r&&(s?s&&!p4(s)&&Ks.throwInvalidPublishableKeyError({key:s}):Ks.throwMissingPublishableKeyError()),le.createElement(C$,{initialState:e,isomorphicClerkOptions:i},n)}var iN=Lj(N$,"ClerkProvider",oj);iN.displayName="ClerkProvider";rj({packageName:"@clerk/clerk-react"});f$("@clerk/clerk-react");function qw(t){const e=[],n=String(t||"");let r=n.indexOf(","),i=0,s=!1;for(;!s;){r===-1&&(r=n.length,s=!0);const a=n.slice(i,r).trim();(a||!s)&&e.push(a),i=r+1,r=n.indexOf(",",i)}return e}function sN(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const O$=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,M$=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,R$={};function Vw(t,e){return(R$.jsx?M$:O$).test(t)}const D$=/[ \t\n\f\r]/g;function I$(t){return typeof t=="object"?t.type==="text"?Gw(t.value):!1:Gw(t)}function Gw(t){return t.replace(D$,"")===""}let zh=class{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}};zh.prototype.normal={};zh.prototype.property={};zh.prototype.space=void 0;function aN(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new zh(n,r,e)}function ah(t){return t.toLowerCase()}class Yi{constructor(e,n){this.attribute=n,this.property=e}}Yi.prototype.attribute="";Yi.prototype.booleanish=!1;Yi.prototype.boolean=!1;Yi.prototype.commaOrSpaceSeparated=!1;Yi.prototype.commaSeparated=!1;Yi.prototype.defined=!1;Yi.prototype.mustUseProperty=!1;Yi.prototype.number=!1;Yi.prototype.overloadedBoolean=!1;Yi.prototype.property="";Yi.prototype.spaceSeparated=!1;Yi.prototype.space=void 0;let L$=0;const Mt=sc(),Tr=sc(),w4=sc(),Be=sc(),An=sc(),gd=sc(),ss=sc();function sc(){return 2**++L$}const k4=Object.freeze(Object.defineProperty({__proto__:null,boolean:Mt,booleanish:Tr,commaOrSpaceSeparated:ss,commaSeparated:gd,number:Be,overloadedBoolean:w4,spaceSeparated:An},Symbol.toStringTag,{value:"Module"})),N2=Object.keys(k4);class E_ extends Yi{constructor(e,n,r,i){let s=-1;if(super(e,n),Yw(this,"space",i),typeof r=="number")for(;++s<N2.length;){const a=N2[s];Yw(this,N2[s],(r&k4[a])===k4[a])}}}E_.prototype.defined=!0;function Yw(t,e,n){n&&(t[e]=n)}function $d(t){const e={},n={};for(const[r,i]of Object.entries(t.properties)){const s=new E_(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),e[r]=s,n[ah(r)]=r,n[ah(s.attribute)]=r}return new zh(e,n,t.space)}const oN=$d({properties:{ariaActiveDescendant:null,ariaAtomic:Tr,ariaAutoComplete:null,ariaBusy:Tr,ariaChecked:Tr,ariaColCount:Be,ariaColIndex:Be,ariaColSpan:Be,ariaControls:An,ariaCurrent:null,ariaDescribedBy:An,ariaDetails:null,ariaDisabled:Tr,ariaDropEffect:An,ariaErrorMessage:null,ariaExpanded:Tr,ariaFlowTo:An,ariaGrabbed:Tr,ariaHasPopup:null,ariaHidden:Tr,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:An,ariaLevel:Be,ariaLive:null,ariaModal:Tr,ariaMultiLine:Tr,ariaMultiSelectable:Tr,ariaOrientation:null,ariaOwns:An,ariaPlaceholder:null,ariaPosInSet:Be,ariaPressed:Tr,ariaReadOnly:Tr,ariaRelevant:null,ariaRequired:Tr,ariaRoleDescription:An,ariaRowCount:Be,ariaRowIndex:Be,ariaRowSpan:Be,ariaSelected:Tr,ariaSetSize:Be,ariaSort:null,ariaValueMax:Be,ariaValueMin:Be,ariaValueNow:Be,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function lN(t,e){return e in t?t[e]:e}function uN(t,e){return lN(t,e.toLowerCase())}const P$=$d({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:gd,acceptCharset:An,accessKey:An,action:null,allow:null,allowFullScreen:Mt,allowPaymentRequest:Mt,allowUserMedia:Mt,alt:null,as:null,async:Mt,autoCapitalize:null,autoComplete:An,autoFocus:Mt,autoPlay:Mt,blocking:An,capture:null,charSet:null,checked:Mt,cite:null,className:An,cols:Be,colSpan:null,content:null,contentEditable:Tr,controls:Mt,controlsList:An,coords:Be|gd,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Mt,defer:Mt,dir:null,dirName:null,disabled:Mt,download:w4,draggable:Tr,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Mt,formTarget:null,headers:An,height:Be,hidden:w4,high:Be,href:null,hrefLang:null,htmlFor:An,httpEquiv:An,id:null,imageSizes:null,imageSrcSet:null,inert:Mt,inputMode:null,integrity:null,is:null,isMap:Mt,itemId:null,itemProp:An,itemRef:An,itemScope:Mt,itemType:An,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Mt,low:Be,manifest:null,max:null,maxLength:Be,media:null,method:null,min:null,minLength:Be,multiple:Mt,muted:Mt,name:null,nonce:null,noModule:Mt,noValidate:Mt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Mt,optimum:Be,pattern:null,ping:An,placeholder:null,playsInline:Mt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Mt,referrerPolicy:null,rel:An,required:Mt,reversed:Mt,rows:Be,rowSpan:Be,sandbox:An,scope:null,scoped:Mt,seamless:Mt,selected:Mt,shadowRootClonable:Mt,shadowRootDelegatesFocus:Mt,shadowRootMode:null,shape:null,size:Be,sizes:null,slot:null,span:Be,spellCheck:Tr,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Be,step:null,style:null,tabIndex:Be,target:null,title:null,translate:null,type:null,typeMustMatch:Mt,useMap:null,value:Tr,width:Be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:An,axis:null,background:null,bgColor:null,border:Be,borderColor:null,bottomMargin:Be,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Mt,declare:Mt,event:null,face:null,frame:null,frameBorder:null,hSpace:Be,leftMargin:Be,link:null,longDesc:null,lowSrc:null,marginHeight:Be,marginWidth:Be,noResize:Mt,noHref:Mt,noShade:Mt,noWrap:Mt,object:null,profile:null,prompt:null,rev:null,rightMargin:Be,rules:null,scheme:null,scrolling:Tr,standby:null,summary:null,text:null,topMargin:Be,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Be,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Mt,disableRemotePlayback:Mt,prefix:null,property:null,results:Be,security:null,unselectable:null},space:"html",transform:uN}),B$=$d({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ss,accentHeight:Be,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Be,amplitude:Be,arabicForm:null,ascent:Be,attributeName:null,attributeType:null,azimuth:Be,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Be,by:null,calcMode:null,capHeight:Be,className:An,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Be,diffuseConstant:Be,direction:null,display:null,dur:null,divisor:Be,dominantBaseline:null,download:Mt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Be,enableBackground:null,end:null,event:null,exponent:Be,externalResourcesRequired:null,fill:null,fillOpacity:Be,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:gd,g2:gd,glyphName:gd,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Be,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Be,horizOriginX:Be,horizOriginY:Be,id:null,ideographic:Be,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Be,k:Be,k1:Be,k2:Be,k3:Be,k4:Be,kernelMatrix:ss,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Be,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Be,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Be,overlineThickness:Be,paintOrder:null,panose1:null,path:null,pathLength:Be,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:An,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Be,pointsAtY:Be,pointsAtZ:Be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ss,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ss,rev:ss,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ss,requiredFeatures:ss,requiredFonts:ss,requiredFormats:ss,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Be,specularExponent:Be,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Be,strikethroughThickness:Be,string:null,stroke:null,strokeDashArray:ss,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Be,strokeOpacity:Be,strokeWidth:null,style:null,surfaceScale:Be,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ss,tabIndex:Be,tableValues:null,target:null,targetX:Be,targetY:Be,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ss,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Be,underlineThickness:Be,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Be,values:null,vAlphabetic:Be,vMathematical:Be,vectorEffect:null,vHanging:Be,vIdeographic:Be,version:null,vertAdvY:Be,vertOriginX:Be,vertOriginY:Be,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Be,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:lN}),cN=$d({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),dN=$d({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:uN}),fN=$d({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),z$={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},U$=/[A-Z]/g,Ww=/-[a-z]/g,F$=/^data[-\w.:]+$/i;function bb(t,e){const n=ah(e);let r=e,i=Yi;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&F$.test(e)){if(e.charAt(4)==="-"){const s=e.slice(5).replace(Ww,j$);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=e.slice(4);if(!Ww.test(s)){let a=s.replace(U$,H$);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}i=E_}return new i(r,e)}function H$(t){return"-"+t.toLowerCase()}function j$(t){return t.charAt(1).toUpperCase()}const Uh=aN([oN,P$,cN,dN,fN],"html"),eu=aN([oN,B$,cN,dN,fN],"svg");function Kw(t){const e=String(t||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function hN(t){return t.join(" ").trim()}var Wc={},O2,Xw;function $$(){if(Xw)return O2;Xw=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
`,d="/",f="*",p="",g="comment",b="declaration";function v(x,S){if(typeof x!="string")throw new TypeError("First argument must be a string");if(!x)return[];S=S||{};var C=1,O=1;function L(oe){var re=oe.match(e);re&&(C+=re.length);var X=oe.lastIndexOf(u);O=~X?oe.length-X:O+oe.length}function D(){var oe={line:C,column:O};return function(re){return re.position=new R(oe),Z(),re}}function R(oe){this.start=oe,this.end={line:C,column:O},this.source=S.source}R.prototype.content=x;function F(oe){var re=new Error(S.source+":"+C+":"+O+": "+oe);if(re.reason=oe,re.filename=S.source,re.line=C,re.column=O,re.source=x,!S.silent)throw re}function G(oe){var re=oe.exec(x);if(re){var X=re[0];return L(X),x=x.slice(X.length),re}}function Z(){G(n)}function q(oe){var re;for(oe=oe||[];re=ie();)re!==!1&&oe.push(re);return oe}function ie(){var oe=D();if(!(d!=x.charAt(0)||f!=x.charAt(1))){for(var re=2;p!=x.charAt(re)&&(f!=x.charAt(re)||d!=x.charAt(re+1));)++re;if(re+=2,p===x.charAt(re-1))return F("End of comment missing");var X=x.slice(2,re-2);return O+=2,L(X),x=x.slice(re),O+=2,oe({type:g,comment:X})}}function se(){var oe=D(),re=G(r);if(re){if(ie(),!G(i))return F("property missing ':'");var X=G(s),ee=oe({type:b,property:E(re[0].replace(t,p)),value:X?E(X[0].replace(t,p)):p});return G(a),ee}}function Te(){var oe=[];q(oe);for(var re;re=se();)re!==!1&&(oe.push(re),q(oe));return oe}return Z(),Te()}function E(x){return x?x.replace(l,p):p}return O2=v,O2}var Qw;function q$(){if(Qw)return Wc;Qw=1;var t=Wc&&Wc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Wc,"__esModule",{value:!0}),Wc.default=n;const e=t($$());function n(r,i){let s=null;if(!r||typeof r!="string")return s;const a=(0,e.default)(r),l=typeof i=="function";return a.forEach(u=>{if(u.type!=="declaration")return;const{property:d,value:f}=u;l?i(d,f,u):f&&(s=s||{},s[d]=f)}),s}return Wc}var Q0={},Zw;function V$(){if(Zw)return Q0;Zw=1,Object.defineProperty(Q0,"__esModule",{value:!0}),Q0.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(d){return!d||n.test(d)||t.test(d)},a=function(d,f){return f.toUpperCase()},l=function(d,f){return"".concat(f,"-")},u=function(d,f){return f===void 0&&(f={}),s(d)?d:(d=d.toLowerCase(),f.reactCompat?d=d.replace(i,l):d=d.replace(r,l),d.replace(e,a))};return Q0.camelCase=u,Q0}var Z0,Jw;function G$(){if(Jw)return Z0;Jw=1;var t=Z0&&Z0.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},e=t(q$()),n=V$();function r(i,s){var a={};return!i||typeof i!="string"||(0,e.default)(i,function(l,u){l&&u&&(a[(0,n.camelCase)(l,s)]=u)}),a}return r.default=r,Z0=r,Z0}var Y$=G$();const W$=Oh(Y$),vb=pN("end"),Oa=pN("start");function pN(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function K$(t){const e=Oa(t),n=vb(t);if(e&&n)return{start:e,end:n}}function Lf(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?ek(t.position):"start"in t||"end"in t?ek(t):"line"in t||"column"in t?C4(t):""}function C4(t){return tk(t&&t.line)+":"+tk(t&&t.column)}function ek(t){return C4(t&&t.start)+"-"+C4(t&&t.end)}function tk(t){return t&&typeof t=="number"?t:1}class ci extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof e=="string"?i=e:!s.cause&&e&&(a=!0,i=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?s.ruleId=r:(s.source=r.slice(0,u),s.ruleId=r.slice(u+1))}if(!s.place&&s.ancestors&&s.ancestors){const u=s.ancestors[s.ancestors.length-1];u&&(s.place=u.position)}const l=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=Lf(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ci.prototype.file="";ci.prototype.name="";ci.prototype.reason="";ci.prototype.message="";ci.prototype.stack="";ci.prototype.column=void 0;ci.prototype.line=void 0;ci.prototype.ancestors=void 0;ci.prototype.cause=void 0;ci.prototype.fatal=void 0;ci.prototype.place=void 0;ci.prototype.ruleId=void 0;ci.prototype.source=void 0;const __={}.hasOwnProperty,X$=new Map,Q$=/[A-Z]/g,Z$=new Set(["table","tbody","thead","tfoot","tr"]),J$=new Set(["td","th"]),mN="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function eq(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=lq(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=oq(n,e.jsx,e.jsxs)}const i={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?eu:Uh,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},s=gN(i,t,void 0);return s&&typeof s!="string"?s:i.create(t,i.Fragment,{children:s||void 0},void 0)}function gN(t,e,n){if(e.type==="element")return tq(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return nq(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return iq(t,e,n);if(e.type==="mdxjsEsm")return rq(t,e);if(e.type==="root")return sq(t,e,n);if(e.type==="text")return aq(t,e)}function tq(t,e,n){const r=t.schema;let i=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=eu,t.schema=i),t.ancestors.push(e);const s=vN(t,e.tagName,!1),a=uq(t,e);let l=T_(t,e);return Z$.has(e.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!I$(u):!0})),bN(t,a,s,e),x_(a,l),t.ancestors.pop(),t.schema=r,t.create(e,s,a,n)}function nq(t,e){if(e.data&&e.data.estree&&t.evaluater){const r=e.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}oh(t,e.position)}function rq(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);oh(t,e.position)}function iq(t,e,n){const r=t.schema;let i=r;e.name==="svg"&&r.space==="html"&&(i=eu,t.schema=i),t.ancestors.push(e);const s=e.name===null?t.Fragment:vN(t,e.name,!0),a=cq(t,e),l=T_(t,e);return bN(t,a,s,e),x_(a,l),t.ancestors.pop(),t.schema=r,t.create(e,s,a,n)}function sq(t,e,n){const r={};return x_(r,T_(t,e)),t.create(e,t.Fragment,r,n)}function aq(t,e){return e.value}function bN(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function x_(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function oq(t,e,n){return r;function r(i,s,a,l){const d=Array.isArray(a.children)?n:e;return l?d(s,a,l):d(s,a)}}function lq(t,e){return n;function n(r,i,s,a){const l=Array.isArray(s.children),u=Oa(r);return e(i,s,a,l,{columnNumber:u?u.column-1:void 0,fileName:t,lineNumber:u?u.line:void 0},void 0)}}function uq(t,e){const n={};let r,i;for(i in e.properties)if(i!=="children"&&__.call(e.properties,i)){const s=dq(t,i,e.properties[i]);if(s){const[a,l]=s;t.tableCellAlignToStyle&&a==="align"&&typeof l=="string"&&J$.has(e.tagName)?r=l:n[a]=l}}if(r){const s=n.style||(n.style={});s[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function cq(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const s=r.data.estree.body[0];s.type;const a=s.expression;a.type;const l=a.properties[0];l.type,Object.assign(n,t.evaluater.evaluateExpression(l.argument))}else oh(t,e.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const l=r.value.data.estree.body[0];l.type,s=t.evaluater.evaluateExpression(l.expression)}else oh(t,e.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function T_(t,e){const n=[];let r=-1;const i=t.passKeys?new Map:X$;for(;++r<e.children.length;){const s=e.children[r];let a;if(t.passKeys){const u=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(u){const d=i.get(u)||0;a=u+"-"+d,i.set(u,d+1)}}const l=gN(t,s,a);l!==void 0&&n.push(l)}return n}function dq(t,e,n){const r=bb(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?sN(n):hN(n)),r.property==="style"){let i=typeof n=="object"?n:fq(t,String(n));return t.stylePropertyNameCase==="css"&&(i=hq(i)),["style",i]}return[t.elementAttributeNameCase==="react"&&r.space?z$[r.property]||r.property:r.attribute,n]}}function fq(t,e){try{return W$(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const r=n,i=new ci("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=t.filePath||void 0,i.url=mN+"#cannot-parse-style-attribute",i}}function vN(t,e,n){let r;if(!n)r={type:"Literal",value:e};else if(e.includes(".")){const i=e.split(".");let s=-1,a;for(;++s<i.length;){const l=Vw(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};a=a?{type:"MemberExpression",object:a,property:l,computed:!!(s&&l.type==="Literal"),optional:!1}:l}r=a}else r=Vw(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const i=r.value;return __.call(t.components,i)?t.components[i]:i}if(t.evaluater)return t.evaluater.evaluateExpression(r);oh(t)}function oh(t,e){const n=new ci("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=mN+"#cannot-handle-mdx-estrees-without-createevaluater",n}function hq(t){const e={};let n;for(n in t)__.call(t,n)&&(e[pq(n)]=t[n]);return e}function pq(t){let e=t.replace(Q$,mq);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function mq(t){return"-"+t.toLowerCase()}const M2={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},gq={};function S_(t,e){const n=gq,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return yN(t,r,i)}function yN(t,e,n){if(bq(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return nk(t.children,e,n)}return Array.isArray(t)?nk(t,e,n):""}function nk(t,e,n){const r=[];let i=-1;for(;++i<t.length;)r[i]=yN(t[i],e,n);return r.join("")}function bq(t){return!!(t&&typeof t=="object")}const rk=document.createElement("i");function w_(t){const e="&"+t+";";rk.innerHTML=e;const n=rk.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function cs(t,e,n,r){const i=t.length;let s=0,a;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(e,n),t.splice(...a);else for(n&&t.splice(e,n);s<r.length;)a=r.slice(s,s+1e4),a.unshift(e,0),t.splice(...a),s+=1e4,e+=1e4}function Os(t,e){return t.length>0?(cs(t,t.length,0,e),t):e}const ik={}.hasOwnProperty;function EN(t){const e={};let n=-1;for(;++n<t.length;)vq(e,t[n]);return e}function vq(t,e){let n;for(n in e){const i=(ik.call(t,n)?t[n]:void 0)||(t[n]={}),s=e[n];let a;if(s)for(a in s){ik.call(i,a)||(i[a]=[]);const l=s[a];yq(i[a],Array.isArray(l)?l:l?[l]:[])}}}function yq(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);cs(t,0,0,r)}function _N(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Xs(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const xi=tu(/[A-Za-z]/),ui=tu(/[\dA-Za-z]/),Eq=tu(/[#-'*+\--9=?A-Z^-~]/);function zg(t){return t!==null&&(t<32||t===127)}const A4=tu(/\d/),_q=tu(/[\dA-Fa-f]/),xq=tu(/[!-/:-@[-`{-~]/);function rt(t){return t!==null&&t<-2}function Tn(t){return t!==null&&(t<0||t===32)}function jt(t){return t===-2||t===-1||t===32}const yb=tu(new RegExp("\\p{P}|\\p{S}","u")),Yu=tu(/\s/);function tu(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function qd(t){const e=[];let n=-1,r=0,i=0;for(;++n<t.length;){const s=t.charCodeAt(n);let a="";if(s===37&&ui(t.charCodeAt(n+1))&&ui(t.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(a=String.fromCharCode(s));else if(s>55295&&s<57344){const l=t.charCodeAt(n+1);s<56320&&l>56319&&l<57344?(a=String.fromCharCode(s,l),i=1):a="�"}else a=String.fromCharCode(s);a&&(e.push(t.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function Bt(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(u){return jt(u)?(t.enter(n),l(u)):e(u)}function l(u){return jt(u)&&s++<i?(t.consume(u),l):(t.exit(n),e(u))}}const Tq={tokenize:Sq};function Sq(t){const e=t.attempt(this.parser.constructs.contentInitial,r,i);let n;return e;function r(l){if(l===null){t.consume(l);return}return t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),Bt(t,e,"linePrefix")}function i(l){return t.enter("paragraph"),s(l)}function s(l){const u=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,a(l)}function a(l){if(l===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(l);return}return rt(l)?(t.consume(l),t.exit("chunkText"),s):(t.consume(l),a)}}const wq={tokenize:kq},sk={tokenize:Cq};function kq(t){const e=this,n=[];let r=0,i,s,a;return l;function l(O){if(r<n.length){const L=n[r];return e.containerState=L[1],t.attempt(L[0].continuation,u,d)(O)}return d(O)}function u(O){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&C();const L=e.events.length;let D=L,R;for(;D--;)if(e.events[D][0]==="exit"&&e.events[D][1].type==="chunkFlow"){R=e.events[D][1].end;break}S(r);let F=L;for(;F<e.events.length;)e.events[F][1].end={...R},F++;return cs(e.events,D+1,0,e.events.slice(L)),e.events.length=F,d(O)}return l(O)}function d(O){if(r===n.length){if(!i)return g(O);if(i.currentConstruct&&i.currentConstruct.concrete)return v(O);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(sk,f,p)(O)}function f(O){return i&&C(),S(r),g(O)}function p(O){return e.parser.lazy[e.now().line]=r!==n.length,a=e.now().offset,v(O)}function g(O){return e.containerState={},t.attempt(sk,b,v)(O)}function b(O){return r++,n.push([e.currentConstruct,e.containerState]),g(O)}function v(O){if(O===null){i&&C(),S(0),t.consume(O);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),E(O)}function E(O){if(O===null){x(t.exit("chunkFlow"),!0),S(0),t.consume(O);return}return rt(O)?(t.consume(O),x(t.exit("chunkFlow")),r=0,e.interrupt=void 0,l):(t.consume(O),E)}function x(O,L){const D=e.sliceStream(O);if(L&&D.push(null),O.previous=s,s&&(s.next=O),s=O,i.defineSkip(O.start),i.write(D),e.parser.lazy[O.start.line]){let R=i.events.length;for(;R--;)if(i.events[R][1].start.offset<a&&(!i.events[R][1].end||i.events[R][1].end.offset>a))return;const F=e.events.length;let G=F,Z,q;for(;G--;)if(e.events[G][0]==="exit"&&e.events[G][1].type==="chunkFlow"){if(Z){q=e.events[G][1].end;break}Z=!0}for(S(r),R=F;R<e.events.length;)e.events[R][1].end={...q},R++;cs(e.events,G+1,0,e.events.slice(F)),e.events.length=R}}function S(O){let L=n.length;for(;L-- >O;){const D=n[L];e.containerState=D[1],D[0].exit.call(e,t)}n.length=O}function C(){i.write([null]),s=void 0,i=void 0,e.containerState._closeFlow=void 0}}function Cq(t,e,n){return Bt(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Td(t){if(t===null||Tn(t)||Yu(t))return 1;if(yb(t))return 2}function Eb(t,e,n){const r=[];let i=-1;for(;++i<t.length;){const s=t[i].resolveAll;s&&!r.includes(s)&&(e=s(e,n),r.push(s))}return e}const N4={name:"attention",resolveAll:Aq,tokenize:Nq};function Aq(t,e){let n=-1,r,i,s,a,l,u,d,f;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(r=n;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&e.sliceSerialize(t[r][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[r][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;u=t[r][1].end.offset-t[r][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const p={...t[r][1].end},g={...t[n][1].start};ak(p,-u),ak(g,u),a={type:u>1?"strongSequence":"emphasisSequence",start:p,end:{...t[r][1].end}},l={type:u>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:g},s={type:u>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...a.start},end:{...l.end}},t[r][1].end={...a.start},t[n][1].start={...l.end},d=[],t[r][1].end.offset-t[r][1].start.offset&&(d=Os(d,[["enter",t[r][1],e],["exit",t[r][1],e]])),d=Os(d,[["enter",i,e],["enter",a,e],["exit",a,e],["enter",s,e]]),d=Os(d,Eb(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),d=Os(d,[["exit",s,e],["enter",l,e],["exit",l,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(f=2,d=Os(d,[["enter",t[n][1],e],["exit",t[n][1],e]])):f=0,cs(t,r-1,n-r+3,d),n=r+d.length-f-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function Nq(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Td(r);let s;return a;function a(u){return s=u,t.enter("attentionSequence"),l(u)}function l(u){if(u===s)return t.consume(u),l;const d=t.exit("attentionSequence"),f=Td(u),p=!f||f===2&&i||n.includes(u),g=!i||i===2&&f||n.includes(r);return d._open=!!(s===42?p:p&&(i||!g)),d._close=!!(s===42?g:g&&(f||!p)),e(u)}}function ak(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const Oq={name:"autolink",tokenize:Mq};function Mq(t,e,n){let r=0;return i;function i(b){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(b),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),s}function s(b){return xi(b)?(t.consume(b),a):b===64?n(b):d(b)}function a(b){return b===43||b===45||b===46||ui(b)?(r=1,l(b)):d(b)}function l(b){return b===58?(t.consume(b),r=0,u):(b===43||b===45||b===46||ui(b))&&r++<32?(t.consume(b),l):(r=0,d(b))}function u(b){return b===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(b),t.exit("autolinkMarker"),t.exit("autolink"),e):b===null||b===32||b===60||zg(b)?n(b):(t.consume(b),u)}function d(b){return b===64?(t.consume(b),f):Eq(b)?(t.consume(b),d):n(b)}function f(b){return ui(b)?p(b):n(b)}function p(b){return b===46?(t.consume(b),r=0,f):b===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(b),t.exit("autolinkMarker"),t.exit("autolink"),e):g(b)}function g(b){if((b===45||ui(b))&&r++<63){const v=b===45?g:p;return t.consume(b),v}return n(b)}}const Fh={partial:!0,tokenize:Rq};function Rq(t,e,n){return r;function r(s){return jt(s)?Bt(t,i,"linePrefix")(s):i(s)}function i(s){return s===null||rt(s)?e(s):n(s)}}const xN={continuation:{tokenize:Iq},exit:Lq,name:"blockQuote",tokenize:Dq};function Dq(t,e,n){const r=this;return i;function i(a){if(a===62){const l=r.containerState;return l.open||(t.enter("blockQuote",{_container:!0}),l.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(a),t.exit("blockQuoteMarker"),s}return n(a)}function s(a){return jt(a)?(t.enter("blockQuotePrefixWhitespace"),t.consume(a),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(a))}}function Iq(t,e,n){const r=this;return i;function i(a){return jt(a)?Bt(t,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return t.attempt(xN,e,n)(a)}}function Lq(t){t.exit("blockQuote")}const TN={name:"characterEscape",tokenize:Pq};function Pq(t,e,n){return r;function r(s){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(s),t.exit("escapeMarker"),i}function i(s){return xq(s)?(t.enter("characterEscapeValue"),t.consume(s),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(s)}}const SN={name:"characterReference",tokenize:Bq};function Bq(t,e,n){const r=this;let i=0,s,a;return l;function l(p){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(p),t.exit("characterReferenceMarker"),u}function u(p){return p===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(p),t.exit("characterReferenceMarkerNumeric"),d):(t.enter("characterReferenceValue"),s=31,a=ui,f(p))}function d(p){return p===88||p===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(p),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),s=6,a=_q,f):(t.enter("characterReferenceValue"),s=7,a=A4,f(p))}function f(p){if(p===59&&i){const g=t.exit("characterReferenceValue");return a===ui&&!w_(r.sliceSerialize(g))?n(p):(t.enter("characterReferenceMarker"),t.consume(p),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return a(p)&&i++<s?(t.consume(p),f):n(p)}}const ok={partial:!0,tokenize:Uq},lk={concrete:!0,name:"codeFenced",tokenize:zq};function zq(t,e,n){const r=this,i={partial:!0,tokenize:D};let s=0,a=0,l;return u;function u(R){return d(R)}function d(R){const F=r.events[r.events.length-1];return s=F&&F[1].type==="linePrefix"?F[2].sliceSerialize(F[1],!0).length:0,l=R,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),f(R)}function f(R){return R===l?(a++,t.consume(R),f):a<3?n(R):(t.exit("codeFencedFenceSequence"),jt(R)?Bt(t,p,"whitespace")(R):p(R))}function p(R){return R===null||rt(R)?(t.exit("codeFencedFence"),r.interrupt?e(R):t.check(ok,E,L)(R)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),g(R))}function g(R){return R===null||rt(R)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),p(R)):jt(R)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),Bt(t,b,"whitespace")(R)):R===96&&R===l?n(R):(t.consume(R),g)}function b(R){return R===null||rt(R)?p(R):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),v(R))}function v(R){return R===null||rt(R)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),p(R)):R===96&&R===l?n(R):(t.consume(R),v)}function E(R){return t.attempt(i,L,x)(R)}function x(R){return t.enter("lineEnding"),t.consume(R),t.exit("lineEnding"),S}function S(R){return s>0&&jt(R)?Bt(t,C,"linePrefix",s+1)(R):C(R)}function C(R){return R===null||rt(R)?t.check(ok,E,L)(R):(t.enter("codeFlowValue"),O(R))}function O(R){return R===null||rt(R)?(t.exit("codeFlowValue"),C(R)):(t.consume(R),O)}function L(R){return t.exit("codeFenced"),e(R)}function D(R,F,G){let Z=0;return q;function q(re){return R.enter("lineEnding"),R.consume(re),R.exit("lineEnding"),ie}function ie(re){return R.enter("codeFencedFence"),jt(re)?Bt(R,se,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(re):se(re)}function se(re){return re===l?(R.enter("codeFencedFenceSequence"),Te(re)):G(re)}function Te(re){return re===l?(Z++,R.consume(re),Te):Z>=a?(R.exit("codeFencedFenceSequence"),jt(re)?Bt(R,oe,"whitespace")(re):oe(re)):G(re)}function oe(re){return re===null||rt(re)?(R.exit("codeFencedFence"),F(re)):G(re)}}}function Uq(t,e,n){const r=this;return i;function i(a){return a===null?n(a):(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}const R2={name:"codeIndented",tokenize:Hq},Fq={partial:!0,tokenize:jq};function Hq(t,e,n){const r=this;return i;function i(d){return t.enter("codeIndented"),Bt(t,s,"linePrefix",5)(d)}function s(d){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?a(d):n(d)}function a(d){return d===null?u(d):rt(d)?t.attempt(Fq,a,u)(d):(t.enter("codeFlowValue"),l(d))}function l(d){return d===null||rt(d)?(t.exit("codeFlowValue"),a(d)):(t.consume(d),l)}function u(d){return t.exit("codeIndented"),e(d)}}function jq(t,e,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):rt(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i):Bt(t,s,"linePrefix",5)(a)}function s(a){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?e(a):rt(a)?i(a):n(a)}}const $q={name:"codeText",previous:Vq,resolve:qq,tokenize:Gq};function qq(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)i===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(i=r):(r===e||t[r][1].type==="lineEnding")&&(t[i][1].type="codeTextData",r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),e-=r-i-2,r=i+2),i=void 0);return t}function Vq(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Gq(t,e,n){let r=0,i,s;return a;function a(p){return t.enter("codeText"),t.enter("codeTextSequence"),l(p)}function l(p){return p===96?(t.consume(p),r++,l):(t.exit("codeTextSequence"),u(p))}function u(p){return p===null?n(p):p===32?(t.enter("space"),t.consume(p),t.exit("space"),u):p===96?(s=t.enter("codeTextSequence"),i=0,f(p)):rt(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),u):(t.enter("codeTextData"),d(p))}function d(p){return p===null||p===32||p===96||rt(p)?(t.exit("codeTextData"),u(p)):(t.consume(p),d)}function f(p){return p===96?(t.consume(p),i++,f):i===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(p)):(s.type="codeTextData",d(p))}}class Yq{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const i=n||0;this.setCursor(Math.trunc(e));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&J0(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),J0(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),J0(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);J0(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);J0(this.left,n.reverse())}}}function J0(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function wN(t){const e={};let n=-1,r,i,s,a,l,u,d;const f=new Yq(t);for(;++n<f.length;){for(;n in e;)n=e[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,s=0,s<u.length&&u[s][1].type==="lineEndingBlank"&&(s+=2),s<u.length&&u[s][1].type==="content"))for(;++s<u.length&&u[s][1].type!=="content";)u[s][1].type==="chunkText"&&(u[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,Wq(f,n)),n=e[n],d=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(a=f.get(s),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=s);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},l=f.slice(i,n),l.unshift(r),f.splice(i,n-i+1,l))}}return cs(t,0,Number.POSITIVE_INFINITY,f.slice(0)),!d}function Wq(t,e){const n=t.get(e)[1],r=t.get(e)[2];let i=e-1;const s=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const l=a.events,u=[],d={};let f,p,g=-1,b=n,v=0,E=0;const x=[E];for(;b;){for(;t.get(++i)[1]!==b;);s.push(i),b._tokenizer||(f=r.sliceStream(b),b.next||f.push(null),p&&a.defineSkip(b.start),b._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(f),b._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),p=b,b=b.next}for(b=n;++g<l.length;)l[g][0]==="exit"&&l[g-1][0]==="enter"&&l[g][1].type===l[g-1][1].type&&l[g][1].start.line!==l[g][1].end.line&&(E=g+1,x.push(E),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(a.events=[],b?(b._tokenizer=void 0,b.previous=void 0):x.pop(),g=x.length;g--;){const S=l.slice(x[g],x[g+1]),C=s.pop();u.push([C,C+S.length-1]),t.splice(C,2,S)}for(u.reverse(),g=-1;++g<u.length;)d[v+u[g][0]]=v+u[g][1],v+=u[g][1]-u[g][0]-1;return d}const Kq={resolve:Qq,tokenize:Zq},Xq={partial:!0,tokenize:Jq};function Qq(t){return wN(t),t}function Zq(t,e){let n;return r;function r(l){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?s(l):rt(l)?t.check(Xq,a,s)(l):(t.consume(l),i)}function s(l){return t.exit("chunkContent"),t.exit("content"),e(l)}function a(l){return t.consume(l),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Jq(t,e,n){const r=this;return i;function i(a){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),Bt(t,s,"linePrefix")}function s(a){if(a===null||rt(a))return n(a);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?e(a):t.interrupt(r.parser.constructs.flow,n,e)(a)}}function kN(t,e,n,r,i,s,a,l,u){const d=u||Number.POSITIVE_INFINITY;let f=0;return p;function p(S){return S===60?(t.enter(r),t.enter(i),t.enter(s),t.consume(S),t.exit(s),g):S===null||S===32||S===41||zg(S)?n(S):(t.enter(r),t.enter(a),t.enter(l),t.enter("chunkString",{contentType:"string"}),E(S))}function g(S){return S===62?(t.enter(s),t.consume(S),t.exit(s),t.exit(i),t.exit(r),e):(t.enter(l),t.enter("chunkString",{contentType:"string"}),b(S))}function b(S){return S===62?(t.exit("chunkString"),t.exit(l),g(S)):S===null||S===60||rt(S)?n(S):(t.consume(S),S===92?v:b)}function v(S){return S===60||S===62||S===92?(t.consume(S),b):b(S)}function E(S){return!f&&(S===null||S===41||Tn(S))?(t.exit("chunkString"),t.exit(l),t.exit(a),t.exit(r),e(S)):f<d&&S===40?(t.consume(S),f++,E):S===41?(t.consume(S),f--,E):S===null||S===32||S===40||zg(S)?n(S):(t.consume(S),S===92?x:E)}function x(S){return S===40||S===41||S===92?(t.consume(S),E):E(S)}}function CN(t,e,n,r,i,s){const a=this;let l=0,u;return d;function d(b){return t.enter(r),t.enter(i),t.consume(b),t.exit(i),t.enter(s),f}function f(b){return l>999||b===null||b===91||b===93&&!u||b===94&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(b):b===93?(t.exit(s),t.enter(i),t.consume(b),t.exit(i),t.exit(r),e):rt(b)?(t.enter("lineEnding"),t.consume(b),t.exit("lineEnding"),f):(t.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===null||b===91||b===93||rt(b)||l++>999?(t.exit("chunkString"),f(b)):(t.consume(b),u||(u=!jt(b)),b===92?g:p)}function g(b){return b===91||b===92||b===93?(t.consume(b),l++,p):p(b)}}function AN(t,e,n,r,i,s){let a;return l;function l(g){return g===34||g===39||g===40?(t.enter(r),t.enter(i),t.consume(g),t.exit(i),a=g===40?41:g,u):n(g)}function u(g){return g===a?(t.enter(i),t.consume(g),t.exit(i),t.exit(r),e):(t.enter(s),d(g))}function d(g){return g===a?(t.exit(s),u(a)):g===null?n(g):rt(g)?(t.enter("lineEnding"),t.consume(g),t.exit("lineEnding"),Bt(t,d,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),f(g))}function f(g){return g===a||g===null||rt(g)?(t.exit("chunkString"),d(g)):(t.consume(g),g===92?p:f)}function p(g){return g===a||g===92?(t.consume(g),f):f(g)}}function Pf(t,e){let n;return r;function r(i){return rt(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):jt(i)?Bt(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const eV={name:"definition",tokenize:nV},tV={partial:!0,tokenize:rV};function nV(t,e,n){const r=this;let i;return s;function s(b){return t.enter("definition"),a(b)}function a(b){return CN.call(r,t,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function l(b){return i=Xs(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),b===58?(t.enter("definitionMarker"),t.consume(b),t.exit("definitionMarker"),u):n(b)}function u(b){return Tn(b)?Pf(t,d)(b):d(b)}function d(b){return kN(t,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function f(b){return t.attempt(tV,p,p)(b)}function p(b){return jt(b)?Bt(t,g,"whitespace")(b):g(b)}function g(b){return b===null||rt(b)?(t.exit("definition"),r.parser.defined.push(i),e(b)):n(b)}}function rV(t,e,n){return r;function r(l){return Tn(l)?Pf(t,i)(l):n(l)}function i(l){return AN(t,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return jt(l)?Bt(t,a,"whitespace")(l):a(l)}function a(l){return l===null||rt(l)?e(l):n(l)}}const iV={name:"hardBreakEscape",tokenize:sV};function sV(t,e,n){return r;function r(s){return t.enter("hardBreakEscape"),t.consume(s),i}function i(s){return rt(s)?(t.exit("hardBreakEscape"),e(s)):n(s)}}const aV={name:"headingAtx",resolve:oV,tokenize:lV};function oV(t,e){let n=t.length-2,r=3,i,s;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},s={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},cs(t,r,n-r+1,[["enter",i,e],["enter",s,e],["exit",s,e],["exit",i,e]])),t}function lV(t,e,n){let r=0;return i;function i(f){return t.enter("atxHeading"),s(f)}function s(f){return t.enter("atxHeadingSequence"),a(f)}function a(f){return f===35&&r++<6?(t.consume(f),a):f===null||Tn(f)?(t.exit("atxHeadingSequence"),l(f)):n(f)}function l(f){return f===35?(t.enter("atxHeadingSequence"),u(f)):f===null||rt(f)?(t.exit("atxHeading"),e(f)):jt(f)?Bt(t,l,"whitespace")(f):(t.enter("atxHeadingText"),d(f))}function u(f){return f===35?(t.consume(f),u):(t.exit("atxHeadingSequence"),l(f))}function d(f){return f===null||f===35||Tn(f)?(t.exit("atxHeadingText"),l(f)):(t.consume(f),d)}}const uV=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],uk=["pre","script","style","textarea"],cV={concrete:!0,name:"htmlFlow",resolveTo:hV,tokenize:pV},dV={partial:!0,tokenize:gV},fV={partial:!0,tokenize:mV};function hV(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function pV(t,e,n){const r=this;let i,s,a,l,u;return d;function d(P){return f(P)}function f(P){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(P),p}function p(P){return P===33?(t.consume(P),g):P===47?(t.consume(P),s=!0,E):P===63?(t.consume(P),i=3,r.interrupt?e:j):xi(P)?(t.consume(P),a=String.fromCharCode(P),x):n(P)}function g(P){return P===45?(t.consume(P),i=2,b):P===91?(t.consume(P),i=5,l=0,v):xi(P)?(t.consume(P),i=4,r.interrupt?e:j):n(P)}function b(P){return P===45?(t.consume(P),r.interrupt?e:j):n(P)}function v(P){const Ee="CDATA[";return P===Ee.charCodeAt(l++)?(t.consume(P),l===Ee.length?r.interrupt?e:se:v):n(P)}function E(P){return xi(P)?(t.consume(P),a=String.fromCharCode(P),x):n(P)}function x(P){if(P===null||P===47||P===62||Tn(P)){const Ee=P===47,Fe=a.toLowerCase();return!Ee&&!s&&uk.includes(Fe)?(i=1,r.interrupt?e(P):se(P)):uV.includes(a.toLowerCase())?(i=6,Ee?(t.consume(P),S):r.interrupt?e(P):se(P)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(P):s?C(P):O(P))}return P===45||ui(P)?(t.consume(P),a+=String.fromCharCode(P),x):n(P)}function S(P){return P===62?(t.consume(P),r.interrupt?e:se):n(P)}function C(P){return jt(P)?(t.consume(P),C):q(P)}function O(P){return P===47?(t.consume(P),q):P===58||P===95||xi(P)?(t.consume(P),L):jt(P)?(t.consume(P),O):q(P)}function L(P){return P===45||P===46||P===58||P===95||ui(P)?(t.consume(P),L):D(P)}function D(P){return P===61?(t.consume(P),R):jt(P)?(t.consume(P),D):O(P)}function R(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(t.consume(P),u=P,F):jt(P)?(t.consume(P),R):G(P)}function F(P){return P===u?(t.consume(P),u=null,Z):P===null||rt(P)?n(P):(t.consume(P),F)}function G(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||Tn(P)?D(P):(t.consume(P),G)}function Z(P){return P===47||P===62||jt(P)?O(P):n(P)}function q(P){return P===62?(t.consume(P),ie):n(P)}function ie(P){return P===null||rt(P)?se(P):jt(P)?(t.consume(P),ie):n(P)}function se(P){return P===45&&i===2?(t.consume(P),X):P===60&&i===1?(t.consume(P),ee):P===62&&i===4?(t.consume(P),H):P===63&&i===3?(t.consume(P),j):P===93&&i===5?(t.consume(P),we):rt(P)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(dV,ne,Te)(P)):P===null||rt(P)?(t.exit("htmlFlowData"),Te(P)):(t.consume(P),se)}function Te(P){return t.check(fV,oe,ne)(P)}function oe(P){return t.enter("lineEnding"),t.consume(P),t.exit("lineEnding"),re}function re(P){return P===null||rt(P)?Te(P):(t.enter("htmlFlowData"),se(P))}function X(P){return P===45?(t.consume(P),j):se(P)}function ee(P){return P===47?(t.consume(P),a="",ce):se(P)}function ce(P){if(P===62){const Ee=a.toLowerCase();return uk.includes(Ee)?(t.consume(P),H):se(P)}return xi(P)&&a.length<8?(t.consume(P),a+=String.fromCharCode(P),ce):se(P)}function we(P){return P===93?(t.consume(P),j):se(P)}function j(P){return P===62?(t.consume(P),H):P===45&&i===2?(t.consume(P),j):se(P)}function H(P){return P===null||rt(P)?(t.exit("htmlFlowData"),ne(P)):(t.consume(P),H)}function ne(P){return t.exit("htmlFlow"),e(P)}}function mV(t,e,n){const r=this;return i;function i(a){return rt(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s):n(a)}function s(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}function gV(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Fh,e,n)}}const bV={name:"htmlText",tokenize:vV};function vV(t,e,n){const r=this;let i,s,a;return l;function l(j){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(j),u}function u(j){return j===33?(t.consume(j),d):j===47?(t.consume(j),D):j===63?(t.consume(j),O):xi(j)?(t.consume(j),G):n(j)}function d(j){return j===45?(t.consume(j),f):j===91?(t.consume(j),s=0,v):xi(j)?(t.consume(j),C):n(j)}function f(j){return j===45?(t.consume(j),b):n(j)}function p(j){return j===null?n(j):j===45?(t.consume(j),g):rt(j)?(a=p,ee(j)):(t.consume(j),p)}function g(j){return j===45?(t.consume(j),b):p(j)}function b(j){return j===62?X(j):j===45?g(j):p(j)}function v(j){const H="CDATA[";return j===H.charCodeAt(s++)?(t.consume(j),s===H.length?E:v):n(j)}function E(j){return j===null?n(j):j===93?(t.consume(j),x):rt(j)?(a=E,ee(j)):(t.consume(j),E)}function x(j){return j===93?(t.consume(j),S):E(j)}function S(j){return j===62?X(j):j===93?(t.consume(j),S):E(j)}function C(j){return j===null||j===62?X(j):rt(j)?(a=C,ee(j)):(t.consume(j),C)}function O(j){return j===null?n(j):j===63?(t.consume(j),L):rt(j)?(a=O,ee(j)):(t.consume(j),O)}function L(j){return j===62?X(j):O(j)}function D(j){return xi(j)?(t.consume(j),R):n(j)}function R(j){return j===45||ui(j)?(t.consume(j),R):F(j)}function F(j){return rt(j)?(a=F,ee(j)):jt(j)?(t.consume(j),F):X(j)}function G(j){return j===45||ui(j)?(t.consume(j),G):j===47||j===62||Tn(j)?Z(j):n(j)}function Z(j){return j===47?(t.consume(j),X):j===58||j===95||xi(j)?(t.consume(j),q):rt(j)?(a=Z,ee(j)):jt(j)?(t.consume(j),Z):X(j)}function q(j){return j===45||j===46||j===58||j===95||ui(j)?(t.consume(j),q):ie(j)}function ie(j){return j===61?(t.consume(j),se):rt(j)?(a=ie,ee(j)):jt(j)?(t.consume(j),ie):Z(j)}function se(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(t.consume(j),i=j,Te):rt(j)?(a=se,ee(j)):jt(j)?(t.consume(j),se):(t.consume(j),oe)}function Te(j){return j===i?(t.consume(j),i=void 0,re):j===null?n(j):rt(j)?(a=Te,ee(j)):(t.consume(j),Te)}function oe(j){return j===null||j===34||j===39||j===60||j===61||j===96?n(j):j===47||j===62||Tn(j)?Z(j):(t.consume(j),oe)}function re(j){return j===47||j===62||Tn(j)?Z(j):n(j)}function X(j){return j===62?(t.consume(j),t.exit("htmlTextData"),t.exit("htmlText"),e):n(j)}function ee(j){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(j),t.exit("lineEnding"),ce}function ce(j){return jt(j)?Bt(t,we,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):we(j)}function we(j){return t.enter("htmlTextData"),a(j)}}const k_={name:"labelEnd",resolveAll:xV,resolveTo:TV,tokenize:SV},yV={tokenize:wV},EV={tokenize:kV},_V={tokenize:CV};function xV(t){let e=-1;const n=[];for(;++e<t.length;){const r=t[e][1];if(n.push(t[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",e+=i}}return t.length!==n.length&&cs(t,0,t.length,n),t}function TV(t,e){let n=t.length,r=0,i,s,a,l;for(;n--;)if(i=t[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;t[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(t[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const u={type:t[s][1].type==="labelLink"?"link":"image",start:{...t[s][1].start},end:{...t[t.length-1][1].end}},d={type:"label",start:{...t[s][1].start},end:{...t[a][1].end}},f={type:"labelText",start:{...t[s+r+2][1].end},end:{...t[a-2][1].start}};return l=[["enter",u,e],["enter",d,e]],l=Os(l,t.slice(s+1,s+r+3)),l=Os(l,[["enter",f,e]]),l=Os(l,Eb(e.parser.constructs.insideSpan.null,t.slice(s+r+4,a-3),e)),l=Os(l,[["exit",f,e],t[a-2],t[a-1],["exit",d,e]]),l=Os(l,t.slice(a+1)),l=Os(l,[["exit",u,e]]),cs(t,s,t.length,l),t}function SV(t,e,n){const r=this;let i=r.events.length,s,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return l;function l(g){return s?s._inactive?p(g):(a=r.parser.defined.includes(Xs(r.sliceSerialize({start:s.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(g),t.exit("labelMarker"),t.exit("labelEnd"),u):n(g)}function u(g){return g===40?t.attempt(yV,f,a?f:p)(g):g===91?t.attempt(EV,f,a?d:p)(g):a?f(g):p(g)}function d(g){return t.attempt(_V,f,p)(g)}function f(g){return e(g)}function p(g){return s._balanced=!0,n(g)}}function wV(t,e,n){return r;function r(p){return t.enter("resource"),t.enter("resourceMarker"),t.consume(p),t.exit("resourceMarker"),i}function i(p){return Tn(p)?Pf(t,s)(p):s(p)}function s(p){return p===41?f(p):kN(t,a,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function a(p){return Tn(p)?Pf(t,u)(p):f(p)}function l(p){return n(p)}function u(p){return p===34||p===39||p===40?AN(t,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):f(p)}function d(p){return Tn(p)?Pf(t,f)(p):f(p)}function f(p){return p===41?(t.enter("resourceMarker"),t.consume(p),t.exit("resourceMarker"),t.exit("resource"),e):n(p)}}function kV(t,e,n){const r=this;return i;function i(l){return CN.call(r,t,s,a,"reference","referenceMarker","referenceString")(l)}function s(l){return r.parser.defined.includes(Xs(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(l):n(l)}function a(l){return n(l)}}function CV(t,e,n){return r;function r(s){return t.enter("reference"),t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),i}function i(s){return s===93?(t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),t.exit("reference"),e):n(s)}}const AV={name:"labelStartImage",resolveAll:k_.resolveAll,tokenize:NV};function NV(t,e,n){const r=this;return i;function i(l){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(l),t.exit("labelImageMarker"),s}function s(l){return l===91?(t.enter("labelMarker"),t.consume(l),t.exit("labelMarker"),t.exit("labelImage"),a):n(l)}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):e(l)}}const OV={name:"labelStartLink",resolveAll:k_.resolveAll,tokenize:MV};function MV(t,e,n){const r=this;return i;function i(a){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelLink"),s}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):e(a)}}const D2={name:"lineEnding",tokenize:RV};function RV(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),Bt(t,e,"linePrefix")}}const Eg={name:"thematicBreak",tokenize:DV};function DV(t,e,n){let r=0,i;return s;function s(d){return t.enter("thematicBreak"),a(d)}function a(d){return i=d,l(d)}function l(d){return d===i?(t.enter("thematicBreakSequence"),u(d)):r>=3&&(d===null||rt(d))?(t.exit("thematicBreak"),e(d)):n(d)}function u(d){return d===i?(t.consume(d),r++,u):(t.exit("thematicBreakSequence"),jt(d)?Bt(t,l,"whitespace")(d):l(d))}}const zi={continuation:{tokenize:BV},exit:UV,name:"list",tokenize:PV},IV={partial:!0,tokenize:FV},LV={partial:!0,tokenize:zV};function PV(t,e,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return l;function l(b){const v=r.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||b===r.containerState.marker:A4(b)){if(r.containerState.type||(r.containerState.type=v,t.enter(v,{_container:!0})),v==="listUnordered")return t.enter("listItemPrefix"),b===42||b===45?t.check(Eg,n,d)(b):d(b);if(!r.interrupt||b===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),u(b)}return n(b)}function u(b){return A4(b)&&++a<10?(t.consume(b),u):(!r.interrupt||a<2)&&(r.containerState.marker?b===r.containerState.marker:b===41||b===46)?(t.exit("listItemValue"),d(b)):n(b)}function d(b){return t.enter("listItemMarker"),t.consume(b),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||b,t.check(Fh,r.interrupt?n:f,t.attempt(IV,g,p))}function f(b){return r.containerState.initialBlankLine=!0,s++,g(b)}function p(b){return jt(b)?(t.enter("listItemPrefixWhitespace"),t.consume(b),t.exit("listItemPrefixWhitespace"),g):n(b)}function g(b){return r.containerState.size=s+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(b)}}function BV(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(Fh,i,s);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Bt(t,e,"listItemIndent",r.containerState.size+1)(l)}function s(l){return r.containerState.furtherBlankLines||!jt(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(LV,e,a)(l))}function a(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Bt(t,t.attempt(zi,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function zV(t,e,n){const r=this;return Bt(t,i,"listItemIndent",r.containerState.size+1);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?e(s):n(s)}}function UV(t){t.exit(this.containerState.type)}function FV(t,e,n){const r=this;return Bt(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=r.events[r.events.length-1];return!jt(s)&&a&&a[1].type==="listItemPrefixWhitespace"?e(s):n(s)}}const ck={name:"setextUnderline",resolveTo:HV,tokenize:jV};function HV(t,e){let n=t.length,r,i,s;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!s&&t[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",s?(t.splice(i,0,["enter",a,e]),t.splice(s+1,0,["exit",t[r][1],e]),t[r][1].end={...t[s][1].end}):t[r][1]=a,t.push(["exit",a,e]),t}function jV(t,e,n){const r=this;let i;return s;function s(d){let f=r.events.length,p;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){p=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(t.enter("setextHeadingLine"),i=d,a(d)):n(d)}function a(d){return t.enter("setextHeadingLineSequence"),l(d)}function l(d){return d===i?(t.consume(d),l):(t.exit("setextHeadingLineSequence"),jt(d)?Bt(t,u,"lineSuffix")(d):u(d))}function u(d){return d===null||rt(d)?(t.exit("setextHeadingLine"),e(d)):n(d)}}const $V={tokenize:qV};function qV(t){const e=this,n=t.attempt(Fh,r,t.attempt(this.parser.constructs.flowInitial,i,Bt(t,t.attempt(this.parser.constructs.flow,i,t.attempt(Kq,i)),"linePrefix")));return n;function r(s){if(s===null){t.consume(s);return}return t.enter("lineEndingBlank"),t.consume(s),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const VV={resolveAll:ON()},GV=NN("string"),YV=NN("text");function NN(t){return{resolveAll:ON(t==="text"?WV:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],s=n.attempt(i,a,l);return a;function a(f){return d(f)?s(f):l(f)}function l(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),u}function u(f){return d(f)?(n.exit("data"),s(f)):(n.consume(f),u)}function d(f){if(f===null)return!0;const p=i[f];let g=-1;if(p)for(;++g<p.length;){const b=p[g];if(!b.previous||b.previous.call(r,r.previous))return!0}return!1}}}function ON(t){return e;function e(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return t?t(n,r):n}}function WV(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const r=t[n-1][1],i=e.sliceStream(r);let s=i.length,a=-1,l=0,u;for(;s--;){const d=i[s];if(typeof d=="string"){for(a=d.length;d.charCodeAt(a-1)===32;)l++,a--;if(a)break;a=-1}else if(d===-2)u=!0,l++;else if(d!==-1){s++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(l=0),l){const d={type:n===t.length||u||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:r.start._bufferIndex+a,_index:r.start._index+s,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(t.splice(n,0,["enter",d,e],["exit",d,e]),n+=2)}n++}return t}const KV={42:zi,43:zi,45:zi,48:zi,49:zi,50:zi,51:zi,52:zi,53:zi,54:zi,55:zi,56:zi,57:zi,62:xN},XV={91:eV},QV={[-2]:R2,[-1]:R2,32:R2},ZV={35:aV,42:Eg,45:[ck,Eg],60:cV,61:ck,95:Eg,96:lk,126:lk},JV={38:SN,92:TN},eG={[-5]:D2,[-4]:D2,[-3]:D2,33:AV,38:SN,42:N4,60:[Oq,bV],91:OV,92:[iV,TN],93:k_,95:N4,96:$q},tG={null:[N4,VV]},nG={null:[42,95]},rG={null:[]},iG=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:nG,contentInitial:XV,disable:rG,document:KV,flow:ZV,flowInitial:QV,insideSpan:tG,string:JV,text:eG},Symbol.toStringTag,{value:"Module"}));function sG(t,e,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let a=[],l=[];const u={attempt:F(D),check:F(R),consume:C,enter:O,exit:L,interrupt:F(R,{interrupt:!0})},d={code:null,containerState:{},defineSkip:E,events:[],now:v,parser:t,previous:null,sliceSerialize:g,sliceStream:b,write:p};let f=e.tokenize.call(d,u);return e.resolveAll&&s.push(e),d;function p(ie){return a=Os(a,ie),x(),a[a.length-1]!==null?[]:(G(e,0),d.events=Eb(s,d.events,d),d.events)}function g(ie,se){return oG(b(ie),se)}function b(ie){return aG(a,ie)}function v(){const{_bufferIndex:ie,_index:se,line:Te,column:oe,offset:re}=r;return{_bufferIndex:ie,_index:se,line:Te,column:oe,offset:re}}function E(ie){i[ie.line]=ie.column,q()}function x(){let ie;for(;r._index<a.length;){const se=a[r._index];if(typeof se=="string")for(ie=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===ie&&r._bufferIndex<se.length;)S(se.charCodeAt(r._bufferIndex));else S(se)}}function S(ie){f=f(ie)}function C(ie){rt(ie)?(r.line++,r.column=1,r.offset+=ie===-3?2:1,q()):ie!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=ie}function O(ie,se){const Te=se||{};return Te.type=ie,Te.start=v(),d.events.push(["enter",Te,d]),l.push(Te),Te}function L(ie){const se=l.pop();return se.end=v(),d.events.push(["exit",se,d]),se}function D(ie,se){G(ie,se.from)}function R(ie,se){se.restore()}function F(ie,se){return Te;function Te(oe,re,X){let ee,ce,we,j;return Array.isArray(oe)?ne(oe):"tokenize"in oe?ne([oe]):H(oe);function H(He){return it;function it(kt){const Tt=kt!==null&&He[kt],St=kt!==null&&He.null,Jn=[...Array.isArray(Tt)?Tt:Tt?[Tt]:[],...Array.isArray(St)?St:St?[St]:[]];return ne(Jn)(kt)}}function ne(He){return ee=He,ce=0,He.length===0?X:P(He[ce])}function P(He){return it;function it(kt){return j=Z(),we=He,He.partial||(d.currentConstruct=He),He.name&&d.parser.constructs.disable.null.includes(He.name)?Fe():He.tokenize.call(se?Object.assign(Object.create(d),se):d,u,Ee,Fe)(kt)}}function Ee(He){return ie(we,j),re}function Fe(He){return j.restore(),++ce<ee.length?P(ee[ce]):X}}}function G(ie,se){ie.resolveAll&&!s.includes(ie)&&s.push(ie),ie.resolve&&cs(d.events,se,d.events.length-se,ie.resolve(d.events.slice(se),d)),ie.resolveTo&&(d.events=ie.resolveTo(d.events,d))}function Z(){const ie=v(),se=d.previous,Te=d.currentConstruct,oe=d.events.length,re=Array.from(l);return{from:oe,restore:X};function X(){r=ie,d.previous=se,d.currentConstruct=Te,d.events.length=oe,l=re,q()}}function q(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function aG(t,e){const n=e.start._index,r=e.start._bufferIndex,i=e.end._index,s=e.end._bufferIndex;let a;if(n===i)a=[t[n].slice(r,s)];else{if(a=t.slice(n,i),r>-1){const l=a[0];typeof l=="string"?a[0]=l.slice(r):a.shift()}s>0&&a.push(t[i].slice(0,s))}return a}function oG(t,e){let n=-1;const r=[];let i;for(;++n<t.length;){const s=t[n];let a;if(typeof s=="string")a=s;else switch(s){case-5:{a="\r";break}case-4:{a=`
`;break}case-3:{a=`\r
`;break}case-2:{a=e?" ":"	";break}case-1:{if(!e&&i)continue;a=" ";break}default:a=String.fromCharCode(s)}i=s===-2,r.push(a)}return r.join("")}function lG(t){const r={constructs:EN([iG,...(t||{}).extensions||[]]),content:i(Tq),defined:[],document:i(wq),flow:i($V),lazy:{},string:i(GV),text:i(YV)};return r;function i(s){return a;function a(l){return sG(r,s,l)}}}function uG(t){for(;!wN(t););return t}const dk=/[\0\t\n\r]/g;function cG(){let t=1,e="",n=!0,r;return i;function i(s,a,l){const u=[];let d,f,p,g,b;for(s=e+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),p=0,e="",n&&(s.charCodeAt(0)===65279&&p++,n=void 0);p<s.length;){if(dk.lastIndex=p,d=dk.exec(s),g=d&&d.index!==void 0?d.index:s.length,b=s.charCodeAt(g),!d){e=s.slice(p);break}if(b===10&&p===g&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),p<g&&(u.push(s.slice(p,g)),t+=g-p),b){case 0:{u.push(65533),t++;break}case 9:{for(f=Math.ceil(t/4)*4,u.push(-2);t++<f;)u.push(-1);break}case 10:{u.push(-4),t=1;break}default:r=!0,t=1}p=g+1}return l&&(r&&u.push(-5),e&&u.push(e),u.push(null)),u}}const dG=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function fG(t){return t.replace(dG,hG)}function hG(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return _N(n.slice(s?2:1),s?16:10)}return w_(n)||t}const MN={}.hasOwnProperty;function pG(t,e,n){return typeof e!="string"&&(n=e,e=void 0),mG(n)(uG(lG(n).document().write(cG()(t,e,!0))))}function mG(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(zt),autolinkProtocol:Z,autolinkEmail:Z,atxHeading:s(Yt),blockQuote:s(St),characterEscape:Z,characterReference:Z,codeFenced:s(Jn),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(Jn,a),codeText:s(Un,a),codeTextData:Z,data:Z,codeFlowValue:Z,definition:s(At),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(gt),hardBreakEscape:s(Qe),hardBreakTrailing:s(Qe),htmlFlow:s($t,a),htmlFlowData:Z,htmlText:s($t,a),htmlTextData:Z,image:s(wn),label:a,link:s(zt),listItem:s(Or),listItemValue:g,listOrdered:s(vn,p),listUnordered:s(vn),paragraph:s(ra),reference:P,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(Yt),strong:s(Hs),thematicBreak:s(lr)},exit:{atxHeading:u(),atxHeadingSequence:D,autolink:u(),autolinkEmail:Tt,autolinkProtocol:kt,blockQuote:u(),characterEscapeValue:q,characterReferenceMarkerHexadecimal:Fe,characterReferenceMarkerNumeric:Fe,characterReferenceValue:He,characterReference:it,codeFenced:u(x),codeFencedFence:E,codeFencedFenceInfo:b,codeFencedFenceMeta:v,codeFlowValue:q,codeIndented:u(S),codeText:u(re),codeTextData:q,data:q,definition:u(),definitionDestinationString:L,definitionLabelString:C,definitionTitleString:O,emphasis:u(),hardBreakEscape:u(se),hardBreakTrailing:u(se),htmlFlow:u(Te),htmlFlowData:q,htmlText:u(oe),htmlTextData:q,image:u(ee),label:we,labelText:ce,lineEnding:ie,link:u(X),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:Ee,resourceDestinationString:j,resourceTitleString:H,resource:ne,setextHeading:u(G),setextHeadingLineSequence:F,setextHeadingText:R,strong:u(),thematicBreak:u()}};RN(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(ge){let Re={type:"root",children:[]};const lt={stack:[Re],tokenStack:[],config:e,enter:l,exit:d,buffer:a,resume:f,data:n},Ae=[];let pt=-1;for(;++pt<ge.length;)if(ge[pt][1].type==="listOrdered"||ge[pt][1].type==="listUnordered")if(ge[pt][0]==="enter")Ae.push(pt);else{const sn=Ae.pop();pt=i(ge,sn,pt)}for(pt=-1;++pt<ge.length;){const sn=e[ge[pt][0]];MN.call(sn,ge[pt][1].type)&&sn[ge[pt][1].type].call(Object.assign({sliceSerialize:ge[pt][2].sliceSerialize},lt),ge[pt][1])}if(lt.tokenStack.length>0){const sn=lt.tokenStack[lt.tokenStack.length-1];(sn[1]||fk).call(lt,void 0,sn[0])}for(Re.position={start:gl(ge.length>0?ge[0][1].start:{line:1,column:1,offset:0}),end:gl(ge.length>0?ge[ge.length-2][1].end:{line:1,column:1,offset:0})},pt=-1;++pt<e.transforms.length;)Re=e.transforms[pt](Re)||Re;return Re}function i(ge,Re,lt){let Ae=Re-1,pt=-1,sn=!1,hi,Yn,hn,er;for(;++Ae<=lt;){const xt=ge[Ae];switch(xt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{xt[0]==="enter"?pt++:pt--,er=void 0;break}case"lineEndingBlank":{xt[0]==="enter"&&(hi&&!er&&!pt&&!hn&&(hn=Ae),er=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:er=void 0}if(!pt&&xt[0]==="enter"&&xt[1].type==="listItemPrefix"||pt===-1&&xt[0]==="exit"&&(xt[1].type==="listUnordered"||xt[1].type==="listOrdered")){if(hi){let ni=Ae;for(Yn=void 0;ni--;){const Je=ge[ni];if(Je[1].type==="lineEnding"||Je[1].type==="lineEndingBlank"){if(Je[0]==="exit")continue;Yn&&(ge[Yn][1].type="lineEndingBlank",sn=!0),Je[1].type="lineEnding",Yn=ni}else if(!(Je[1].type==="linePrefix"||Je[1].type==="blockQuotePrefix"||Je[1].type==="blockQuotePrefixWhitespace"||Je[1].type==="blockQuoteMarker"||Je[1].type==="listItemIndent"))break}hn&&(!Yn||hn<Yn)&&(hi._spread=!0),hi.end=Object.assign({},Yn?ge[Yn][1].start:xt[1].end),ge.splice(Yn||Ae,0,["exit",hi,xt[2]]),Ae++,lt++}if(xt[1].type==="listItemPrefix"){const ni={type:"listItem",_spread:!1,start:Object.assign({},xt[1].start),end:void 0};hi=ni,ge.splice(Ae,0,["enter",ni,xt[2]]),Ae++,lt++,hn=void 0,er=!0}}}return ge[Re][1]._spread=sn,lt}function s(ge,Re){return lt;function lt(Ae){l.call(this,ge(Ae),Ae),Re&&Re.call(this,Ae)}}function a(){this.stack.push({type:"fragment",children:[]})}function l(ge,Re,lt){this.stack[this.stack.length-1].children.push(ge),this.stack.push(ge),this.tokenStack.push([Re,lt||void 0]),ge.position={start:gl(Re.start),end:void 0}}function u(ge){return Re;function Re(lt){ge&&ge.call(this,lt),d.call(this,lt)}}function d(ge,Re){const lt=this.stack.pop(),Ae=this.tokenStack.pop();if(Ae)Ae[0].type!==ge.type&&(Re?Re.call(this,ge,Ae[0]):(Ae[1]||fk).call(this,ge,Ae[0]));else throw new Error("Cannot close `"+ge.type+"` ("+Lf({start:ge.start,end:ge.end})+"): it’s not open");lt.position.end=gl(ge.end)}function f(){return S_(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function g(ge){if(this.data.expectingFirstListItemValue){const Re=this.stack[this.stack.length-2];Re.start=Number.parseInt(this.sliceSerialize(ge),10),this.data.expectingFirstListItemValue=void 0}}function b(){const ge=this.resume(),Re=this.stack[this.stack.length-1];Re.lang=ge}function v(){const ge=this.resume(),Re=this.stack[this.stack.length-1];Re.meta=ge}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const ge=this.resume(),Re=this.stack[this.stack.length-1];Re.value=ge.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const ge=this.resume(),Re=this.stack[this.stack.length-1];Re.value=ge.replace(/(\r?\n|\r)$/g,"")}function C(ge){const Re=this.resume(),lt=this.stack[this.stack.length-1];lt.label=Re,lt.identifier=Xs(this.sliceSerialize(ge)).toLowerCase()}function O(){const ge=this.resume(),Re=this.stack[this.stack.length-1];Re.title=ge}function L(){const ge=this.resume(),Re=this.stack[this.stack.length-1];Re.url=ge}function D(ge){const Re=this.stack[this.stack.length-1];if(!Re.depth){const lt=this.sliceSerialize(ge).length;Re.depth=lt}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function F(ge){const Re=this.stack[this.stack.length-1];Re.depth=this.sliceSerialize(ge).codePointAt(0)===61?1:2}function G(){this.data.setextHeadingSlurpLineEnding=void 0}function Z(ge){const lt=this.stack[this.stack.length-1].children;let Ae=lt[lt.length-1];(!Ae||Ae.type!=="text")&&(Ae=fn(),Ae.position={start:gl(ge.start),end:void 0},lt.push(Ae)),this.stack.push(Ae)}function q(ge){const Re=this.stack.pop();Re.value+=this.sliceSerialize(ge),Re.position.end=gl(ge.end)}function ie(ge){const Re=this.stack[this.stack.length-1];if(this.data.atHardBreak){const lt=Re.children[Re.children.length-1];lt.position.end=gl(ge.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(Re.type)&&(Z.call(this,ge),q.call(this,ge))}function se(){this.data.atHardBreak=!0}function Te(){const ge=this.resume(),Re=this.stack[this.stack.length-1];Re.value=ge}function oe(){const ge=this.resume(),Re=this.stack[this.stack.length-1];Re.value=ge}function re(){const ge=this.resume(),Re=this.stack[this.stack.length-1];Re.value=ge}function X(){const ge=this.stack[this.stack.length-1];if(this.data.inReference){const Re=this.data.referenceType||"shortcut";ge.type+="Reference",ge.referenceType=Re,delete ge.url,delete ge.title}else delete ge.identifier,delete ge.label;this.data.referenceType=void 0}function ee(){const ge=this.stack[this.stack.length-1];if(this.data.inReference){const Re=this.data.referenceType||"shortcut";ge.type+="Reference",ge.referenceType=Re,delete ge.url,delete ge.title}else delete ge.identifier,delete ge.label;this.data.referenceType=void 0}function ce(ge){const Re=this.sliceSerialize(ge),lt=this.stack[this.stack.length-2];lt.label=fG(Re),lt.identifier=Xs(Re).toLowerCase()}function we(){const ge=this.stack[this.stack.length-1],Re=this.resume(),lt=this.stack[this.stack.length-1];if(this.data.inReference=!0,lt.type==="link"){const Ae=ge.children;lt.children=Ae}else lt.alt=Re}function j(){const ge=this.resume(),Re=this.stack[this.stack.length-1];Re.url=ge}function H(){const ge=this.resume(),Re=this.stack[this.stack.length-1];Re.title=ge}function ne(){this.data.inReference=void 0}function P(){this.data.referenceType="collapsed"}function Ee(ge){const Re=this.resume(),lt=this.stack[this.stack.length-1];lt.label=Re,lt.identifier=Xs(this.sliceSerialize(ge)).toLowerCase(),this.data.referenceType="full"}function Fe(ge){this.data.characterReferenceType=ge.type}function He(ge){const Re=this.sliceSerialize(ge),lt=this.data.characterReferenceType;let Ae;lt?(Ae=_N(Re,lt==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ae=w_(Re);const pt=this.stack[this.stack.length-1];pt.value+=Ae}function it(ge){const Re=this.stack.pop();Re.position.end=gl(ge.end)}function kt(ge){q.call(this,ge);const Re=this.stack[this.stack.length-1];Re.url=this.sliceSerialize(ge)}function Tt(ge){q.call(this,ge);const Re=this.stack[this.stack.length-1];Re.url="mailto:"+this.sliceSerialize(ge)}function St(){return{type:"blockquote",children:[]}}function Jn(){return{type:"code",lang:null,meta:null,value:""}}function Un(){return{type:"inlineCode",value:""}}function At(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function gt(){return{type:"emphasis",children:[]}}function Yt(){return{type:"heading",depth:0,children:[]}}function Qe(){return{type:"break"}}function $t(){return{type:"html",value:""}}function wn(){return{type:"image",title:null,url:"",alt:null}}function zt(){return{type:"link",title:null,url:"",children:[]}}function vn(ge){return{type:"list",ordered:ge.type==="listOrdered",start:null,spread:ge._spread,children:[]}}function Or(ge){return{type:"listItem",spread:ge._spread,checked:null,children:[]}}function ra(){return{type:"paragraph",children:[]}}function Hs(){return{type:"strong",children:[]}}function fn(){return{type:"text",value:""}}function lr(){return{type:"thematicBreak"}}}function gl(t){return{line:t.line,column:t.column,offset:t.offset}}function RN(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?RN(t,r):gG(t,r)}}function gG(t,e){let n;for(n in e)if(MN.call(e,n))switch(n){case"canContainEols":{const r=e[n];r&&t[n].push(...r);break}case"transforms":{const r=e[n];r&&t[n].push(...r);break}case"enter":case"exit":{const r=e[n];r&&Object.assign(t[n],r);break}}}function fk(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+Lf({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+Lf({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+Lf({start:e.start,end:e.end})+") is still open")}function bG(t){const e=this;e.parser=n;function n(r){return pG(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function vG(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function yG(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
`}]}function EG(t,e){const n=e.value?e.value+`
`:"",r={},i=e.lang?e.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return e.meta&&(s.data={meta:e.meta}),t.patch(e,s),s=t.applyData(e,s),s={type:"element",tagName:"pre",properties:{},children:[s]},t.patch(e,s),s}function _G(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function xG(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function TG(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=String(e.identifier).toUpperCase(),i=qd(r.toLowerCase()),s=t.footnoteOrder.indexOf(r);let a,l=t.footnoteCounts.get(r);l===void 0?(l=0,t.footnoteOrder.push(r),a=t.footnoteOrder.length):a=s+1,l+=1,t.footnoteCounts.set(r,l);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};t.patch(e,u);const d={type:"element",tagName:"sup",properties:{},children:[u]};return t.patch(e,d),t.applyData(e,d)}function SG(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function wG(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function DN(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const i=t.all(e),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function kG(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return DN(t,e);const i={src:qd(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,s),t.applyData(e,s)}function CG(t,e){const n={src:qd(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function AG(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function NG(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return DN(t,e);const i={href:qd(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,s),t.applyData(e,s)}function OG(t,e){const n={href:qd(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function MG(t,e,n){const r=t.all(e),i=n?RG(n):IN(e),s={},a=[];if(typeof e.checked=="boolean"){const f=r[0];let p;f&&f.type==="element"&&f.tagName==="p"?p=f:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const f=r[l];(i||l!==0||f.type!=="element"||f.tagName!=="p")&&a.push({type:"text",value:`
`}),f.type==="element"&&f.tagName==="p"&&!i?a.push(...f.children):a.push(f)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&a.push({type:"text",value:`
`});const d={type:"element",tagName:"li",properties:s,children:a};return t.patch(e,d),t.applyData(e,d)}function RG(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r<n.length;)e=IN(n[r])}return e}function IN(t){const e=t.spread;return e??t.children.length>1}function DG(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(r,!0)};return t.patch(e,s),t.applyData(e,s)}function IG(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function LG(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function PG(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function BG(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},l=Oa(e.children[1]),u=vb(e.children[e.children.length-1]);l&&u&&(a.position={start:l,end:u}),i.push(a)}const s={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,s),t.applyData(e,s)}function zG(t,e,n){const r=n?n.children:void 0,s=(r?r.indexOf(e):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,l=a?a.length:e.children.length;let u=-1;const d=[];for(;++u<l;){const p=e.children[u],g={},b=a?a[u]:void 0;b&&(g.align=b);let v={type:"element",tagName:s,properties:g,children:[]};p&&(v.children=t.all(p),t.patch(p,v),v=t.applyData(p,v)),d.push(v)}const f={type:"element",tagName:"tr",properties:{},children:t.wrap(d,!0)};return t.patch(e,f),t.applyData(e,f)}function UG(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const hk=9,pk=32;function FG(t){const e=String(t),n=/\r?\n|\r/g;let r=n.exec(e),i=0;const s=[];for(;r;)s.push(mk(e.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return s.push(mk(e.slice(i),i>0,!1)),s.join("")}function mk(t,e,n){let r=0,i=t.length;if(e){let s=t.codePointAt(r);for(;s===hk||s===pk;)r++,s=t.codePointAt(r)}if(n){let s=t.codePointAt(i-1);for(;s===hk||s===pk;)i--,s=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function HG(t,e){const n={type:"text",value:FG(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function jG(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const $G={blockquote:vG,break:yG,code:EG,delete:_G,emphasis:xG,footnoteReference:TG,heading:SG,html:wG,imageReference:kG,image:CG,inlineCode:AG,linkReference:NG,link:OG,listItem:MG,list:DG,paragraph:IG,root:LG,strong:PG,table:BG,tableCell:UG,tableRow:zG,text:HG,thematicBreak:jG,toml:km,yaml:km,definition:km,footnoteDefinition:km};function km(){}const LN=-1,_b=0,Bf=1,Ug=2,C_=3,A_=4,N_=5,O_=6,PN=7,BN=8,gk=typeof self=="object"?self:globalThis,qG=(t,e)=>{const n=(i,s)=>(t.set(s,i),i),r=i=>{if(t.has(i))return t.get(i);const[s,a]=e[i];switch(s){case _b:case LN:return n(a,i);case Bf:{const l=n([],i);for(const u of a)l.push(r(u));return l}case Ug:{const l=n({},i);for(const[u,d]of a)l[r(u)]=r(d);return l}case C_:return n(new Date(a),i);case A_:{const{source:l,flags:u}=a;return n(new RegExp(l,u),i)}case N_:{const l=n(new Map,i);for(const[u,d]of a)l.set(r(u),r(d));return l}case O_:{const l=n(new Set,i);for(const u of a)l.add(r(u));return l}case PN:{const{name:l,message:u}=a;return n(new gk[l](u),i)}case BN:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:l}=new Uint8Array(a);return n(new DataView(l),a)}}return n(new gk[s](a),i)};return r},bk=t=>qG(new Map,t)(0),Kc="",{toString:VG}={},{keys:GG}=Object,ef=t=>{const e=typeof t;if(e!=="object"||!t)return[_b,e];const n=VG.call(t).slice(8,-1);switch(n){case"Array":return[Bf,Kc];case"Object":return[Ug,Kc];case"Date":return[C_,Kc];case"RegExp":return[A_,Kc];case"Map":return[N_,Kc];case"Set":return[O_,Kc];case"DataView":return[Bf,n]}return n.includes("Array")?[Bf,n]:n.includes("Error")?[PN,n]:[Ug,n]},Cm=([t,e])=>t===_b&&(e==="function"||e==="symbol"),YG=(t,e,n,r)=>{const i=(a,l)=>{const u=r.push(a)-1;return n.set(l,u),u},s=a=>{if(n.has(a))return n.get(a);let[l,u]=ef(a);switch(l){case _b:{let f=a;switch(u){case"bigint":l=BN,f=a.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+u);f=null;break;case"undefined":return i([LN],a)}return i([l,f],a)}case Bf:{if(u){let g=a;return u==="DataView"?g=new Uint8Array(a.buffer):u==="ArrayBuffer"&&(g=new Uint8Array(a)),i([u,[...g]],a)}const f=[],p=i([l,f],a);for(const g of a)f.push(s(g));return p}case Ug:{if(u)switch(u){case"BigInt":return i([u,a.toString()],a);case"Boolean":case"Number":case"String":return i([u,a.valueOf()],a)}if(e&&"toJSON"in a)return s(a.toJSON());const f=[],p=i([l,f],a);for(const g of GG(a))(t||!Cm(ef(a[g])))&&f.push([s(g),s(a[g])]);return p}case C_:return i([l,a.toISOString()],a);case A_:{const{source:f,flags:p}=a;return i([l,{source:f,flags:p}],a)}case N_:{const f=[],p=i([l,f],a);for(const[g,b]of a)(t||!(Cm(ef(g))||Cm(ef(b))))&&f.push([s(g),s(b)]);return p}case O_:{const f=[],p=i([l,f],a);for(const g of a)(t||!Cm(ef(g)))&&f.push(s(g));return p}}const{message:d}=a;return i([l,{name:u,message:d}],a)};return s},vk=(t,{json:e,lossy:n}={})=>{const r=[];return YG(!(e||n),!!e,new Map,r)(t),r},Sd=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?bk(vk(t,e)):structuredClone(t):(t,e)=>bk(vk(t,e));function WG(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function KG(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function XG(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||WG,r=t.options.footnoteBackLabel||KG,i=t.options.footnoteLabel||"Footnotes",s=t.options.footnoteLabelTagName||"h2",a=t.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let u=-1;for(;++u<t.footnoteOrder.length;){const d=t.footnoteById.get(t.footnoteOrder[u]);if(!d)continue;const f=t.all(d),p=String(d.identifier).toUpperCase(),g=qd(p.toLowerCase());let b=0;const v=[],E=t.footnoteCounts.get(p);for(;E!==void 0&&++b<=E;){v.length>0&&v.push({type:"text",value:" "});let C=typeof n=="string"?n:n(u,b);typeof C=="string"&&(C={type:"text",value:C}),v.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+g+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,b),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const x=f[f.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const C=x.children[x.children.length-1];C&&C.type==="text"?C.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...v)}else f.push(...v);const S={type:"element",tagName:"li",properties:{id:e+"fn-"+g},children:t.wrap(f,!0)};t.patch(d,S),l.push(S)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Sd(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
`},{type:"element",tagName:"ol",properties:{},children:t.wrap(l,!0)},{type:"text",value:`
`}]}}const Hh=(function(t){if(t==null)return eY;if(typeof t=="function")return xb(t);if(typeof t=="object")return Array.isArray(t)?QG(t):ZG(t);if(typeof t=="string")return JG(t);throw new Error("Expected function, string, or object as test")});function QG(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=Hh(t[n]);return xb(r);function r(...i){let s=-1;for(;++s<e.length;)if(e[s].apply(this,i))return!0;return!1}}function ZG(t){const e=t;return xb(n);function n(r){const i=r;let s;for(s in t)if(i[s]!==e[s])return!1;return!0}}function JG(t){return xb(e);function e(n){return n&&n.type===t}}function xb(t){return e;function e(n,r,i){return!!(tY(n)&&t.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function eY(){return!0}function tY(t){return t!==null&&typeof t=="object"&&"type"in t}const zN=[],nY=!0,O4=!1,UN="skip";function M_(t,e,n,r){let i;typeof e=="function"&&typeof n!="function"?(r=n,n=e):i=e;const s=Hh(i),a=r?-1:1;l(t,void 0,[])();function l(u,d,f){const p=u&&typeof u=="object"?u:{};if(typeof p.type=="string"){const b=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(u.type+(b?"<"+b+">":""))+")"})}return g;function g(){let b=zN,v,E,x;if((!e||s(u,d,f[f.length-1]||void 0))&&(b=rY(n(u,f)),b[0]===O4))return b;if("children"in u&&u.children){const S=u;if(S.children&&b[0]!==UN)for(E=(r?S.children.length:-1)+a,x=f.concat(S);E>-1&&E<S.children.length;){const C=S.children[E];if(v=l(C,E,x)(),v[0]===O4)return v;E=typeof v[1]=="number"?v[1]:E+a}}return b}}}function rY(t){return Array.isArray(t)?t:typeof t=="number"?[nY,t]:t==null?zN:[t]}function jh(t,e,n,r){let i,s,a;typeof e=="function"&&typeof n!="function"?(s=void 0,a=e,i=n):(s=e,a=n,i=r),M_(t,s,l,i);function l(u,d){const f=d[d.length-1],p=f?f.children.indexOf(u):void 0;return a(u,p,f)}}const M4={}.hasOwnProperty,iY={};function sY(t,e){const n=e||iY,r=new Map,i=new Map,s=new Map,a={...$G,...n.handlers},l={all:d,applyData:oY,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:a,one:u,options:n,patch:aY,wrap:uY};return jh(t,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const p=f.type==="definition"?r:i,g=String(f.identifier).toUpperCase();p.has(g)||p.set(g,f)}}),l;function u(f,p){const g=f.type,b=l.handlers[g];if(M4.call(l.handlers,g)&&b)return b(l,f,p);if(l.options.passThrough&&l.options.passThrough.includes(g)){if("children"in f){const{children:E,...x}=f,S=Sd(x);return S.children=l.all(f),S}return Sd(f)}return(l.options.unknownHandler||lY)(l,f,p)}function d(f){const p=[];if("children"in f){const g=f.children;let b=-1;for(;++b<g.length;){const v=l.one(g[b],f);if(v){if(b&&g[b-1].type==="break"&&(!Array.isArray(v)&&v.type==="text"&&(v.value=yk(v.value)),!Array.isArray(v)&&v.type==="element")){const E=v.children[0];E&&E.type==="text"&&(E.value=yk(E.value))}Array.isArray(v)?p.push(...v):p.push(v)}}}return p}}function aY(t,e){t.position&&(e.position=K$(t))}function oY(t,e){let n=e;if(t&&t.data){const r=t.data.hName,i=t.data.hChildren,s=t.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&s&&Object.assign(n.properties,Sd(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function lY(t,e){const n=e.data||{},r="value"in e&&!(M4.call(n,"hProperties")||M4.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function uY(t,e){const n=[];let r=-1;for(e&&n.push({type:"text",value:`
`});++r<t.length;)r&&n.push({type:"text",value:`
`}),n.push(t[r]);return e&&t.length>0&&n.push({type:"text",value:`
`}),n}function yk(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function Ek(t,e){const n=sY(t,e),r=n.one(t,void 0),i=XG(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
`},i),s}function cY(t,e){return t&&"run"in t?async function(n,r){const i=Ek(n,{file:r,...e});await t.run(i,r)}:function(n,r){return Ek(n,{file:r,...t||e})}}function _k(t){if(t)throw t}var I2,xk;function dY(){if(xk)return I2;xk=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(d){return typeof Array.isArray=="function"?Array.isArray(d):e.call(d)==="[object Array]"},s=function(d){if(!d||e.call(d)!=="[object Object]")return!1;var f=t.call(d,"constructor"),p=d.constructor&&d.constructor.prototype&&t.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!f&&!p)return!1;var g;for(g in d);return typeof g>"u"||t.call(d,g)},a=function(d,f){n&&f.name==="__proto__"?n(d,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):d[f.name]=f.newValue},l=function(d,f){if(f==="__proto__")if(t.call(d,f)){if(r)return r(d,f).value}else return;return d[f]};return I2=function u(){var d,f,p,g,b,v,E=arguments[0],x=1,S=arguments.length,C=!1;for(typeof E=="boolean"&&(C=E,E=arguments[1]||{},x=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});x<S;++x)if(d=arguments[x],d!=null)for(f in d)p=l(E,f),g=l(d,f),E!==g&&(C&&g&&(s(g)||(b=i(g)))?(b?(b=!1,v=p&&i(p)?p:[]):v=p&&s(p)?p:{},a(E,{name:f,newValue:u(C,v,g)})):typeof g<"u"&&a(E,{name:f,newValue:g}));return E},I2}var fY=dY();const L2=Oh(fY);function R4(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function hY(){const t=[],e={run:n,use:r};return e;function n(...i){let s=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);l(null,...i);function l(u,...d){const f=t[++s];let p=-1;if(u){a(u);return}for(;++p<i.length;)(d[p]===null||d[p]===void 0)&&(d[p]=i[p]);i=d,f?pY(f,l)(...d):a(null,...d)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return t.push(i),e}}function pY(t,e){let n;return r;function r(...a){const l=t.length>a.length;let u;l&&a.push(i);try{u=t.apply(this,a)}catch(d){const f=d;if(l&&n)throw f;return i(f)}l||(u&&u.then&&typeof u.then=="function"?u.then(s,i):u instanceof Error?i(u):s(u))}function i(a,...l){n||(n=!0,e(a,...l))}function s(a){i(null,a)}}const da={basename:mY,dirname:gY,extname:bY,join:vY,sep:"/"};function mY(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');$h(t);let n=0,r=-1,i=t.length,s;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let a=-1,l=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),l>-1&&(t.codePointAt(i)===e.codePointAt(l--)?l<0&&(r=i):(l=-1,r=a));return n===r?r=a:r<0&&(r=t.length),t.slice(n,r)}function gY(t){if($h(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function bY(t){$h(t);let e=t.length,n=-1,r=0,i=-1,s=0,a;for(;e--;){const l=t.codePointAt(e);if(l===47){if(a){r=e+1;break}continue}n<0&&(a=!0,n=e+1),l===46?i<0?i=e:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function vY(...t){let e=-1,n;for(;++e<t.length;)$h(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":yY(n)}function yY(t){$h(t);const e=t.codePointAt(0)===47;let n=EY(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function EY(t,e){let n="",r=0,i=-1,s=0,a=-1,l,u;for(;++a<=t.length;){if(a<t.length)l=t.codePointAt(a);else{if(l===47)break;l=47}if(l===47){if(!(i===a-1||s===1))if(i!==a-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=a,s=0;continue}}else if(n.length>0){n="",r=0,i=a,s=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,a):n=t.slice(i+1,a),r=a-i-1;i=a,s=0}else l===46&&s>-1?s++:s=-1}return n}function $h(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const _Y={cwd:xY};function xY(){return"/"}function D4(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function TY(t){if(typeof t=="string")t=new URL(t);else if(!D4(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return SY(t)}function SY(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const r=e.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(e)}const P2=["history","path","basename","stem","extname","dirname"];class FN{constructor(e){let n;e?D4(e)?n={path:e}:typeof e=="string"||wY(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":_Y.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<P2.length;){const s=P2[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)P2.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?da.basename(this.path):void 0}set basename(e){z2(e,"basename"),B2(e,"basename"),this.path=da.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?da.dirname(this.path):void 0}set dirname(e){Tk(this.basename,"dirname"),this.path=da.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?da.extname(this.path):void 0}set extname(e){if(B2(e,"extname"),Tk(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=da.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){D4(e)&&(e=TY(e)),z2(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?da.basename(this.path,this.extname):void 0}set stem(e){z2(e,"stem"),B2(e,"stem"),this.path=da.join(this.dirname||"",e+(this.extname||""))}fail(e,n,r){const i=this.message(e,n,r);throw i.fatal=!0,i}info(e,n,r){const i=this.message(e,n,r);return i.fatal=void 0,i}message(e,n,r){const i=new ci(e,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function B2(t,e){if(t&&t.includes(da.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+da.sep+"`")}function z2(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function Tk(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function wY(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const kY=(function(t){const r=this.constructor.prototype,i=r[t],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),CY={}.hasOwnProperty;class R_ extends kY{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=hY()}copy(){const e=new R_;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(L2(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(H2("data",this.frozen),this.namespace[e]=n,this):CY.call(this.namespace,e)&&this.namespace[e]||void 0:e?(H2("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(e,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=Am(e),r=this.parser||this.Parser;return U2("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),U2("process",this.parser||this.Parser),F2("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,a){const l=Am(e),u=r.parse(l);r.run(u,l,function(f,p,g){if(f||!p||!g)return d(f);const b=p,v=r.stringify(b,g);OY(v)?g.value=v:g.result=v,d(f,g)});function d(f,p){f||!p?a(f):s?s(p):n(void 0,p)}}}processSync(e){let n=!1,r;return this.freeze(),U2("processSync",this.parser||this.Parser),F2("processSync",this.compiler||this.Compiler),this.process(e,i),wk("processSync","process",n),r;function i(s,a){n=!0,_k(s),r=a}}run(e,n,r){Sk(e),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(a,l){const u=Am(n);i.run(e,u,d);function d(f,p,g){const b=p||e;f?l(f):a?a(b):r(void 0,b,g)}}}runSync(e,n){let r=!1,i;return this.run(e,n,s),wk("runSync","run",r),i;function s(a,l){_k(a),i=l,r=!0}}stringify(e,n){this.freeze();const r=Am(n),i=this.compiler||this.Compiler;return F2("stringify",i),Sk(e),i(e,r)}use(e,...n){const r=this.attachers,i=this.namespace;if(H2("use",this.frozen),e!=null)if(typeof e=="function")u(e,n);else if(typeof e=="object")Array.isArray(e)?l(e):a(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function s(d){if(typeof d=="function")u(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[f,...p]=d;u(f,p)}else a(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function a(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(d.plugins),d.settings&&(i.settings=L2(!0,i.settings,d.settings))}function l(d){let f=-1;if(d!=null)if(Array.isArray(d))for(;++f<d.length;){const p=d[f];s(p)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function u(d,f){let p=-1,g=-1;for(;++p<r.length;)if(r[p][0]===d){g=p;break}if(g===-1)r.push([d,...f]);else if(f.length>0){let[b,...v]=f;const E=r[g][1];R4(E)&&R4(b)&&(b=L2(!0,E,b)),r[g]=[d,b,...v]}}}}const AY=new R_().freeze();function U2(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function F2(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function H2(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Sk(t){if(!R4(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function wk(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Am(t){return NY(t)?t:new FN(t)}function NY(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function OY(t){return typeof t=="string"||MY(t)}function MY(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const RY="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",kk=[],Ck={allowDangerousHtml:!0},DY=/^(https?|ircs?|mailto|xmpp)$/i,IY=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function LY(t){const e=PY(t),n=BY(t);return zY(e.runSync(e.parse(n),n),t)}function PY(t){const e=t.rehypePlugins||kk,n=t.remarkPlugins||kk,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...Ck}:Ck;return AY().use(bG).use(n).use(cY,r).use(e)}function BY(t){const e=t.children||"",n=new FN;return typeof e=="string"&&(n.value=e),n}function zY(t,e){const n=e.allowedElements,r=e.allowElement,i=e.components,s=e.disallowedElements,a=e.skipHtml,l=e.unwrapDisallowed,u=e.urlTransform||UY;for(const f of IY)Object.hasOwn(e,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+RY+f.id,void 0);return jh(t,d),eq(t,{Fragment:A.Fragment,components:i,ignoreInvalidStyle:!0,jsx:A.jsx,jsxs:A.jsxs,passKeys:!0,passNode:!0});function d(f,p,g){if(f.type==="raw"&&g&&typeof p=="number")return a?g.children.splice(p,1):g.children[p]={type:"text",value:f.value},p;if(f.type==="element"){let b;for(b in M2)if(Object.hasOwn(M2,b)&&Object.hasOwn(f.properties,b)){const v=f.properties[b],E=M2[b];(E===null||E.includes(f.tagName))&&(f.properties[b]=u(String(v||""),b,f))}}if(f.type==="element"){let b=n?!n.includes(f.tagName):s?s.includes(f.tagName):!1;if(!b&&r&&typeof p=="number"&&(b=!r(f,p,g)),b&&g&&typeof p=="number")return l&&f.children?g.children.splice(p,1,...f.children):g.children.splice(p,1),p}}}function UY(t){const e=t.indexOf(":"),n=t.indexOf("?"),r=t.indexOf("#"),i=t.indexOf("/");return e===-1||i!==-1&&e>i||n!==-1&&e>n||r!==-1&&e>r||DY.test(t.slice(0,e))?t:""}function Ak(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(e);for(;i!==-1;)r++,i=n.indexOf(e,i+e.length);return r}function FY(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function HY(t,e,n){const i=Hh((n||{}).ignore||[]),s=jY(e);let a=-1;for(;++a<s.length;)M_(t,"text",l);function l(d,f){let p=-1,g;for(;++p<f.length;){const b=f[p],v=g?g.children:void 0;if(i(b,v?v.indexOf(b):void 0,g))return;g=b}if(g)return u(d,f)}function u(d,f){const p=f[f.length-1],g=s[a][0],b=s[a][1];let v=0;const x=p.children.indexOf(d);let S=!1,C=[];g.lastIndex=0;let O=g.exec(d.value);for(;O;){const L=O.index,D={index:O.index,input:O.input,stack:[...f,d]};let R=b(...O,D);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1?g.lastIndex=L+1:(v!==L&&C.push({type:"text",value:d.value.slice(v,L)}),Array.isArray(R)?C.push(...R):R&&C.push(R),v=L+O[0].length,S=!0),!g.global)break;O=g.exec(d.value)}return S?(v<d.value.length&&C.push({type:"text",value:d.value.slice(v)}),p.children.splice(x,1,...C)):C=[d],x+C.length}}function jY(t){const e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!t[0]||Array.isArray(t[0])?t:[t];let r=-1;for(;++r<n.length;){const i=n[r];e.push([$Y(i[0]),qY(i[1])])}return e}function $Y(t){return typeof t=="string"?new RegExp(FY(t),"g"):t}function qY(t){return typeof t=="function"?t:function(){return t}}const j2="phrasing",$2=["autolink","link","image","label"];function VY(){return{transforms:[ZY],enter:{literalAutolink:YY,literalAutolinkEmail:q2,literalAutolinkHttp:q2,literalAutolinkWww:q2},exit:{literalAutolink:QY,literalAutolinkEmail:XY,literalAutolinkHttp:WY,literalAutolinkWww:KY}}}function GY(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:j2,notInConstruct:$2},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:j2,notInConstruct:$2},{character:":",before:"[ps]",after:"\\/",inConstruct:j2,notInConstruct:$2}]}}function YY(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function q2(t){this.config.enter.autolinkProtocol.call(this,t)}function WY(t){this.config.exit.autolinkProtocol.call(this,t)}function KY(t){this.config.exit.data.call(this,t);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function XY(t){this.config.exit.autolinkEmail.call(this,t)}function QY(t){this.exit(t)}function ZY(t){HY(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,JY],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),eW]],{ignore:["link","linkReference"]})}function JY(t,e,n,r,i){let s="";if(!HN(i)||(/^w/i.test(e)&&(n=e+n,e="",s="http://"),!tW(n)))return!1;const a=nW(n+r);if(!a[0])return!1;const l={type:"link",title:null,url:s+e+a[0],children:[{type:"text",value:e+a[0]}]};return a[1]?[l,{type:"text",value:a[1]}]:l}function eW(t,e,n,r){return!HN(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function tW(t){const e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function nW(t){const e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],r=n.indexOf(")");const i=Ak(t,"(");let s=Ak(t,")");for(;r!==-1&&i>s;)t+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[t,n]}function HN(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||Yu(n)||yb(n))&&(!e||n!==47)}jN.peek=dW;function rW(){this.buffer()}function iW(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function sW(){this.buffer()}function aW(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function oW(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Xs(this.sliceSerialize(t)).toLowerCase(),n.label=e}function lW(t){this.exit(t)}function uW(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Xs(this.sliceSerialize(t)).toLowerCase(),n.label=e}function cW(t){this.exit(t)}function dW(){return"["}function jN(t,e,n,r){const i=n.createTracker(r);let s=i.move("[^");const a=n.enter("footnoteReference"),l=n.enter("reference");return s+=i.move(n.safe(n.associationId(t),{after:"]",before:s})),l(),a(),s+=i.move("]"),s}function fW(){return{enter:{gfmFootnoteCallString:rW,gfmFootnoteCall:iW,gfmFootnoteDefinitionLabelString:sW,gfmFootnoteDefinition:aW},exit:{gfmFootnoteCallString:oW,gfmFootnoteCall:lW,gfmFootnoteDefinitionLabelString:uW,gfmFootnoteDefinition:cW}}}function hW(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:jN},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,a){const l=s.createTracker(a);let u=l.move("[^");const d=s.enter("footnoteDefinition"),f=s.enter("label");return u+=l.move(s.safe(s.associationId(r),{before:u,after:"]"})),f(),u+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),u+=l.move((e?`
`:" ")+s.indentLines(s.containerFlow(r,l.current()),e?$N:pW))),d(),u}}function pW(t,e,n){return e===0?t:$N(t,e,n)}function $N(t,e,n){return(n?"":"    ")+t}const mW=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];qN.peek=EW;function gW(){return{canContainEols:["delete"],enter:{strikethrough:vW},exit:{strikethrough:yW}}}function bW(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:mW}],handlers:{delete:qN}}}function vW(t){this.enter({type:"delete",children:[]},t)}function yW(t){this.exit(t)}function qN(t,e,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(t,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),s(),a}function EW(){return"~"}function _W(t){return t.length}function xW(t,e){const n=e||{},r=(n.align||[]).concat(),i=n.stringLength||_W,s=[],a=[],l=[],u=[];let d=0,f=-1;for(;++f<t.length;){const E=[],x=[];let S=-1;for(t[f].length>d&&(d=t[f].length);++S<t[f].length;){const C=TW(t[f][S]);if(n.alignDelimiters!==!1){const O=i(C);x[S]=O,(u[S]===void 0||O>u[S])&&(u[S]=O)}E.push(C)}a[f]=E,l[f]=x}let p=-1;if(typeof r=="object"&&"length"in r)for(;++p<d;)s[p]=Nk(r[p]);else{const E=Nk(r);for(;++p<d;)s[p]=E}p=-1;const g=[],b=[];for(;++p<d;){const E=s[p];let x="",S="";E===99?(x=":",S=":"):E===108?x=":":E===114&&(S=":");let C=n.alignDelimiters===!1?1:Math.max(1,u[p]-x.length-S.length);const O=x+"-".repeat(C)+S;n.alignDelimiters!==!1&&(C=x.length+C+S.length,C>u[p]&&(u[p]=C),b[p]=C),g[p]=O}a.splice(1,0,g),l.splice(1,0,b),f=-1;const v=[];for(;++f<a.length;){const E=a[f],x=l[f];p=-1;const S=[];for(;++p<d;){const C=E[p]||"";let O="",L="";if(n.alignDelimiters!==!1){const D=u[p]-(x[p]||0),R=s[p];R===114?O=" ".repeat(D):R===99?D%2?(O=" ".repeat(D/2+.5),L=" ".repeat(D/2-.5)):(O=" ".repeat(D/2),L=O):L=" ".repeat(D)}n.delimiterStart!==!1&&!p&&S.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&C==="")&&(n.delimiterStart!==!1||p)&&S.push(" "),n.alignDelimiters!==!1&&S.push(O),S.push(C),n.alignDelimiters!==!1&&S.push(L),n.padding!==!1&&S.push(" "),(n.delimiterEnd!==!1||p!==d-1)&&S.push("|")}v.push(n.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return v.join(`
`)}function TW(t){return t==null?"":String(t)}function Nk(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}const Ok={}.hasOwnProperty;function VN(t,e){const n=e||{};function r(i,...s){let a=r.invalid;const l=r.handlers;if(i&&Ok.call(i,t)){const u=String(i[t]);a=Ok.call(l,u)?l[u]:r.unknown}if(a)return a.call(this,i,...s)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}function SW(t,e,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const a=n.indentLines(n.containerFlow(t,s.current()),wW);return i(),a}function wW(t,e,n){return">"+(n?"":" ")+t}function kW(t,e){return Mk(t,e.inConstruct,!0)&&!Mk(t,e.notInConstruct,!1)}function Mk(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let r=-1;for(;++r<e.length;)if(t.includes(e[r]))return!0;return!1}function Rk(t,e,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
`&&kW(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
`}function GN(t,e){const n=String(t);let r=n.indexOf(e),i=r,s=0,a=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>a&&(a=s):s=1,i=r+e.length,r=n.indexOf(e,i);return a}function CW(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function AW(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function NW(t,e,n,r){const i=AW(n),s=t.value||"",a=i==="`"?"GraveAccent":"Tilde";if(CW(t,n)){const p=n.enter("codeIndented"),g=n.indentLines(s,OW);return p(),g}const l=n.createTracker(r),u=i.repeat(Math.max(GN(s,i)+1,3)),d=n.enter("codeFenced");let f=l.move(u);if(t.lang){const p=n.enter(`codeFencedLang${a}`);f+=l.move(n.safe(t.lang,{before:f,after:" ",encode:["`"],...l.current()})),p()}if(t.lang&&t.meta){const p=n.enter(`codeFencedMeta${a}`);f+=l.move(" "),f+=l.move(n.safe(t.meta,{before:f,after:`
`,encode:["`"],...l.current()})),p()}return f+=l.move(`
`),s&&(f+=l.move(s+`
`)),f+=l.move(u),d(),f}function OW(t,e,n){return(n?"":"    ")+t}function D_(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function MW(t,e,n,r){const i=D_(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let l=n.enter("label");const u=n.createTracker(r);let d=u.move("[");return d+=u.move(n.safe(n.associationId(t),{before:d,after:"]",...u.current()})),d+=u.move("]: "),l(),!t.url||/[\0- \u007F]/.test(t.url)?(l=n.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(n.safe(t.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(l=n.enter("destinationRaw"),d+=u.move(n.safe(t.url,{before:d,after:t.title?" ":`
`,...u.current()}))),l(),t.title&&(l=n.enter(`title${s}`),d+=u.move(" "+i),d+=u.move(n.safe(t.title,{before:d,after:i,...u.current()})),d+=u.move(i),l()),a(),d}function RW(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function lh(t){return"&#x"+t.toString(16).toUpperCase()+";"}function Fg(t,e,n){const r=Td(t),i=Td(e);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}YN.peek=DW;function YN(t,e,n,r){const i=RW(n),s=n.enter("emphasis"),a=n.createTracker(r),l=a.move(i);let u=a.move(n.containerPhrasing(t,{after:i,before:l,...a.current()}));const d=u.charCodeAt(0),f=Fg(r.before.charCodeAt(r.before.length-1),d,i);f.inside&&(u=lh(d)+u.slice(1));const p=u.charCodeAt(u.length-1),g=Fg(r.after.charCodeAt(0),p,i);g.inside&&(u=u.slice(0,-1)+lh(p));const b=a.move(i);return s(),n.attentionEncodeSurroundingInfo={after:g.outside,before:f.outside},l+u+b}function DW(t,e,n){return n.options.emphasis||"*"}function IW(t,e){let n=!1;return jh(t,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,O4}),!!((!t.depth||t.depth<3)&&S_(t)&&(e.options.setext||n))}function LW(t,e,n,r){const i=Math.max(Math.min(6,t.depth||1),1),s=n.createTracker(r);if(IW(t,n)){const f=n.enter("headingSetext"),p=n.enter("phrasing"),g=n.containerPhrasing(t,{...s.current(),before:`
`,after:`
`});return p(),f(),g+`
`+(i===1?"=":"-").repeat(g.length-(Math.max(g.lastIndexOf("\r"),g.lastIndexOf(`
`))+1))}const a="#".repeat(i),l=n.enter("headingAtx"),u=n.enter("phrasing");s.move(a+" ");let d=n.containerPhrasing(t,{before:"# ",after:`
`,...s.current()});return/^[\t ]/.test(d)&&(d=lh(d.charCodeAt(0))+d.slice(1)),d=d?a+" "+d:a,n.options.closeAtx&&(d+=" "+a),u(),l(),d}WN.peek=PW;function WN(t){return t.value||""}function PW(){return"<"}KN.peek=BW;function KN(t,e,n,r){const i=D_(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let l=n.enter("label");const u=n.createTracker(r);let d=u.move("![");return d+=u.move(n.safe(t.alt,{before:d,after:"]",...u.current()})),d+=u.move("]("),l(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(l=n.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(n.safe(t.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(l=n.enter("destinationRaw"),d+=u.move(n.safe(t.url,{before:d,after:t.title?" ":")",...u.current()}))),l(),t.title&&(l=n.enter(`title${s}`),d+=u.move(" "+i),d+=u.move(n.safe(t.title,{before:d,after:i,...u.current()})),d+=u.move(i),l()),d+=u.move(")"),a(),d}function BW(){return"!"}XN.peek=zW;function XN(t,e,n,r){const i=t.referenceType,s=n.enter("imageReference");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("![");const d=n.safe(t.alt,{before:u,after:"]",...l.current()});u+=l.move(d+"]["),a();const f=n.stack;n.stack=[],a=n.enter("reference");const p=n.safe(n.associationId(t),{before:u,after:"]",...l.current()});return a(),n.stack=f,s(),i==="full"||!d||d!==p?u+=l.move(p+"]"):i==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function zW(){return"!"}QN.peek=UW;function QN(t,e,n){let r=t.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const a=n.unsafe[s],l=n.compilePattern(a);let u;if(a.atBreak)for(;u=l.exec(r);){let d=u.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(u.index+1)}}return i+r+i}function UW(){return"`"}function ZN(t,e){const n=S_(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}JN.peek=FW;function JN(t,e,n,r){const i=D_(n),s=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let l,u;if(ZN(t,n)){const f=n.stack;n.stack=[],l=n.enter("autolink");let p=a.move("<");return p+=a.move(n.containerPhrasing(t,{before:p,after:">",...a.current()})),p+=a.move(">"),l(),n.stack=f,p}l=n.enter("link"),u=n.enter("label");let d=a.move("[");return d+=a.move(n.containerPhrasing(t,{before:d,after:"](",...a.current()})),d+=a.move("]("),u(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),d+=a.move("<"),d+=a.move(n.safe(t.url,{before:d,after:">",...a.current()})),d+=a.move(">")):(u=n.enter("destinationRaw"),d+=a.move(n.safe(t.url,{before:d,after:t.title?" ":")",...a.current()}))),u(),t.title&&(u=n.enter(`title${s}`),d+=a.move(" "+i),d+=a.move(n.safe(t.title,{before:d,after:i,...a.current()})),d+=a.move(i),u()),d+=a.move(")"),l(),d}function FW(t,e,n){return ZN(t,n)?"<":"["}eO.peek=HW;function eO(t,e,n,r){const i=t.referenceType,s=n.enter("linkReference");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("[");const d=n.containerPhrasing(t,{before:u,after:"]",...l.current()});u+=l.move(d+"]["),a();const f=n.stack;n.stack=[],a=n.enter("reference");const p=n.safe(n.associationId(t),{before:u,after:"]",...l.current()});return a(),n.stack=f,s(),i==="full"||!d||d!==p?u+=l.move(p+"]"):i==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function HW(){return"["}function I_(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function jW(t){const e=I_(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function $W(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function tO(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function qW(t,e,n,r){const i=n.enter("list"),s=n.bulletCurrent;let a=t.ordered?$W(n):I_(n);const l=t.ordered?a==="."?")":".":jW(n);let u=e&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!t.ordered){const f=t.children?t.children[0]:void 0;if((a==="*"||a==="-")&&f&&(!f.children||!f.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),tO(n)===a&&f){let p=-1;for(;++p<t.children.length;){const g=t.children[p];if(g&&g.type==="listItem"&&g.children&&g.children[0]&&g.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(a=l),n.bulletCurrent=a;const d=n.containerFlow(t,r);return n.bulletLastUsed=a,n.bulletCurrent=s,i(),d}function VW(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function GW(t,e,n,r){const i=VW(n);let s=n.bulletCurrent||I_(n);e&&e.type==="list"&&e.ordered&&(s=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+s);let a=s.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(a=Math.ceil(a/4)*4);const l=n.createTracker(r);l.move(s+" ".repeat(a-s.length)),l.shift(a);const u=n.enter("listItem"),d=n.indentLines(n.containerFlow(t,l.current()),f);return u(),d;function f(p,g,b){return g?(b?"":" ".repeat(a))+p:(b?s:s+" ".repeat(a-s.length))+p}}function YW(t,e,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),a=n.containerPhrasing(t,r);return s(),i(),a}const WW=Hh(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function KW(t,e,n,r){return(t.children.some(function(a){return WW(a)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function XW(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}nO.peek=QW;function nO(t,e,n,r){const i=XW(n),s=n.enter("strong"),a=n.createTracker(r),l=a.move(i+i);let u=a.move(n.containerPhrasing(t,{after:i,before:l,...a.current()}));const d=u.charCodeAt(0),f=Fg(r.before.charCodeAt(r.before.length-1),d,i);f.inside&&(u=lh(d)+u.slice(1));const p=u.charCodeAt(u.length-1),g=Fg(r.after.charCodeAt(0),p,i);g.inside&&(u=u.slice(0,-1)+lh(p));const b=a.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:g.outside,before:f.outside},l+u+b}function QW(t,e,n){return n.options.strong||"*"}function ZW(t,e,n,r){return n.safe(t.value,r)}function JW(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function eK(t,e,n){const r=(tO(n)+(n.options.ruleSpaces?" ":"")).repeat(JW(n));return n.options.ruleSpaces?r.slice(0,-1):r}const rO={blockquote:SW,break:Rk,code:NW,definition:MW,emphasis:YN,hardBreak:Rk,heading:LW,html:WN,image:KN,imageReference:XN,inlineCode:QN,link:JN,linkReference:eO,list:qW,listItem:GW,paragraph:YW,root:KW,strong:nO,text:ZW,thematicBreak:eK};function tK(){return{enter:{table:nK,tableData:Dk,tableHeader:Dk,tableRow:iK},exit:{codeText:sK,table:rK,tableData:V2,tableHeader:V2,tableRow:V2}}}function nK(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function rK(t){this.exit(t),this.data.inTable=void 0}function iK(t){this.enter({type:"tableRow",children:[]},t)}function V2(t){this.exit(t)}function Dk(t){this.enter({type:"tableCell",children:[]},t)}function sK(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,aK));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function aK(t,e){return e==="|"?e:t}function oK(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,i=e.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[	 :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:g,table:a,tableCell:u,tableRow:l}};function a(b,v,E,x){return d(f(b,E,x),b.align)}function l(b,v,E,x){const S=p(b,E,x),C=d([S]);return C.slice(0,C.indexOf(`
`))}function u(b,v,E,x){const S=E.enter("tableCell"),C=E.enter("phrasing"),O=E.containerPhrasing(b,{...x,before:s,after:s});return C(),S(),O}function d(b,v){return xW(b,{align:v,alignDelimiters:r,padding:n,stringLength:i})}function f(b,v,E){const x=b.children;let S=-1;const C=[],O=v.enter("table");for(;++S<x.length;)C[S]=p(x[S],v,E);return O(),C}function p(b,v,E){const x=b.children;let S=-1;const C=[],O=v.enter("tableRow");for(;++S<x.length;)C[S]=u(x[S],b,v,E);return O(),C}function g(b,v,E){let x=rO.inlineCode(b,v,E);return E.stack.includes("tableCell")&&(x=x.replace(/\|/g,"\\$&")),x}}function lK(){return{exit:{taskListCheckValueChecked:Ik,taskListCheckValueUnchecked:Ik,paragraph:cK}}}function uK(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:dK}}}function Ik(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function cK(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=e.children;let s=-1,a;for(;++s<i.length;){const l=i[s];if(l.type==="paragraph"){a=l;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function dK(t,e,n,r){const i=t.children[0],s=typeof t.checked=="boolean"&&i&&i.type==="paragraph",a="["+(t.checked?"x":" ")+"] ",l=n.createTracker(r);s&&l.move(a);let u=rO.listItem(t,e,n,{...r,...l.current()});return s&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),u;function d(f){return f+a}}function fK(){return[VY(),fW(),gW(),tK(),lK()]}function hK(t){return{extensions:[GY(),hW(t),bW(),oK(t),uK()]}}const pK={tokenize:EK,partial:!0},iO={tokenize:_K,partial:!0},sO={tokenize:xK,partial:!0},aO={tokenize:TK,partial:!0},mK={tokenize:SK,partial:!0},oO={name:"wwwAutolink",tokenize:vK,previous:uO},lO={name:"protocolAutolink",tokenize:yK,previous:cO},Bo={name:"emailAutolink",tokenize:bK,previous:dO},Ma={};function gK(){return{text:Ma}}let ku=48;for(;ku<123;)Ma[ku]=Bo,ku++,ku===58?ku=65:ku===91&&(ku=97);Ma[43]=Bo;Ma[45]=Bo;Ma[46]=Bo;Ma[95]=Bo;Ma[72]=[Bo,lO];Ma[104]=[Bo,lO];Ma[87]=[Bo,oO];Ma[119]=[Bo,oO];function bK(t,e,n){const r=this;let i,s;return a;function a(p){return!I4(p)||!dO.call(r,r.previous)||L_(r.events)?n(p):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),l(p))}function l(p){return I4(p)?(t.consume(p),l):p===64?(t.consume(p),u):n(p)}function u(p){return p===46?t.check(mK,f,d)(p):p===45||p===95||ui(p)?(s=!0,t.consume(p),u):f(p)}function d(p){return t.consume(p),i=!0,u}function f(p){return s&&i&&xi(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(p)):n(p)}}function vK(t,e,n){const r=this;return i;function i(a){return a!==87&&a!==119||!uO.call(r,r.previous)||L_(r.events)?n(a):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(pK,t.attempt(iO,t.attempt(sO,s),n),n)(a))}function s(a){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(a)}}function yK(t,e,n){const r=this;let i="",s=!1;return a;function a(p){return(p===72||p===104)&&cO.call(r,r.previous)&&!L_(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(p),t.consume(p),l):n(p)}function l(p){if(xi(p)&&i.length<5)return i+=String.fromCodePoint(p),t.consume(p),l;if(p===58){const g=i.toLowerCase();if(g==="http"||g==="https")return t.consume(p),u}return n(p)}function u(p){return p===47?(t.consume(p),s?d:(s=!0,u)):n(p)}function d(p){return p===null||zg(p)||Tn(p)||Yu(p)||yb(p)?n(p):t.attempt(iO,t.attempt(sO,f),n)(p)}function f(p){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(p)}}function EK(t,e,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,t.consume(a),i):a===46&&r===3?(t.consume(a),s):n(a)}function s(a){return a===null?n(a):e(a)}}function _K(t,e,n){let r,i,s;return a;function a(d){return d===46||d===95?t.check(aO,u,l)(d):d===null||Tn(d)||Yu(d)||d!==45&&yb(d)?u(d):(s=!0,t.consume(d),a)}function l(d){return d===95?r=!0:(i=r,r=void 0),t.consume(d),a}function u(d){return i||r||!s?n(d):e(d)}}function xK(t,e){let n=0,r=0;return i;function i(a){return a===40?(n++,t.consume(a),i):a===41&&r<n?s(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?t.check(aO,e,s)(a):a===null||Tn(a)||Yu(a)?e(a):(t.consume(a),i)}function s(a){return a===41&&r++,t.consume(a),i}}function TK(t,e,n){return r;function r(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(t.consume(l),r):l===38?(t.consume(l),s):l===93?(t.consume(l),i):l===60||l===null||Tn(l)||Yu(l)?e(l):n(l)}function i(l){return l===null||l===40||l===91||Tn(l)||Yu(l)?e(l):r(l)}function s(l){return xi(l)?a(l):n(l)}function a(l){return l===59?(t.consume(l),r):xi(l)?(t.consume(l),a):n(l)}}function SK(t,e,n){return r;function r(s){return t.consume(s),i}function i(s){return ui(s)?n(s):e(s)}}function uO(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Tn(t)}function cO(t){return!xi(t)}function dO(t){return!(t===47||I4(t))}function I4(t){return t===43||t===45||t===46||t===95||ui(t)}function L_(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const wK={tokenize:DK,partial:!0};function kK(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:OK,continuation:{tokenize:MK},exit:RK}},text:{91:{name:"gfmFootnoteCall",tokenize:NK},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:CK,resolveTo:AK}}}}function CK(t,e,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){a=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return l;function l(u){if(!a||!a._balanced)return n(u);const d=Xs(r.sliceSerialize({start:a.end,end:r.now()}));return d.codePointAt(0)!==94||!s.includes(d.slice(1))?n(u):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(u),t.exit("gfmFootnoteCallLabelMarker"),e(u))}}function AK(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},t[t.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",i,e],["exit",i,e],["enter",s,e],["enter",a,e],["exit",a,e],["exit",s,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...l),t}function NK(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,a;return l;function l(p){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(p),t.exit("gfmFootnoteCallLabelMarker"),u}function u(p){return p!==94?n(p):(t.enter("gfmFootnoteCallMarker"),t.consume(p),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",d)}function d(p){if(s>999||p===93&&!a||p===null||p===91||Tn(p))return n(p);if(p===93){t.exit("chunkString");const g=t.exit("gfmFootnoteCallString");return i.includes(Xs(r.sliceSerialize(g)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(p),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(p)}return Tn(p)||(a=!0),s++,t.consume(p),p===92?f:d}function f(p){return p===91||p===92||p===93?(t.consume(p),s++,d):d(p)}}function OK(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,a=0,l;return u;function u(v){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(v),t.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(v){return v===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(v),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",f):n(v)}function f(v){if(a>999||v===93&&!l||v===null||v===91||Tn(v))return n(v);if(v===93){t.exit("chunkString");const E=t.exit("gfmFootnoteDefinitionLabelString");return s=Xs(r.sliceSerialize(E)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(v),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),g}return Tn(v)||(l=!0),a++,t.consume(v),v===92?p:f}function p(v){return v===91||v===92||v===93?(t.consume(v),a++,f):f(v)}function g(v){return v===58?(t.enter("definitionMarker"),t.consume(v),t.exit("definitionMarker"),i.includes(s)||i.push(s),Bt(t,b,"gfmFootnoteDefinitionWhitespace")):n(v)}function b(v){return e(v)}}function MK(t,e,n){return t.check(Fh,e,t.attempt(wK,e,n))}function RK(t){t.exit("gfmFootnoteDefinition")}function DK(t,e,n){const r=this;return Bt(t,i,"gfmFootnoteDefinitionIndent",5);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?e(s):n(s)}}function IK(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,l){let u=-1;for(;++u<a.length;)if(a[u][0]==="enter"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._close){let d=u;for(;d--;)if(a[d][0]==="exit"&&a[d][1].type==="strikethroughSequenceTemporary"&&a[d][1]._open&&a[u][1].end.offset-a[u][1].start.offset===a[d][1].end.offset-a[d][1].start.offset){a[u][1].type="strikethroughSequence",a[d][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},a[d][1].start),end:Object.assign({},a[u][1].end)},p={type:"strikethroughText",start:Object.assign({},a[d][1].end),end:Object.assign({},a[u][1].start)},g=[["enter",f,l],["enter",a[d][1],l],["exit",a[d][1],l],["enter",p,l]],b=l.parser.constructs.insideSpan.null;b&&cs(g,g.length,0,Eb(b,a.slice(d+1,u),l)),cs(g,g.length,0,[["exit",p,l],["enter",a[u][1],l],["exit",a[u][1],l],["exit",f,l]]),cs(a,d-1,u-d+3,g),u=d+g.length-2;break}}for(u=-1;++u<a.length;)a[u][1].type==="strikethroughSequenceTemporary"&&(a[u][1].type="data");return a}function s(a,l,u){const d=this.previous,f=this.events;let p=0;return g;function g(v){return d===126&&f[f.length-1][1].type!=="characterEscape"?u(v):(a.enter("strikethroughSequenceTemporary"),b(v))}function b(v){const E=Td(d);if(v===126)return p>1?u(v):(a.consume(v),p++,b);if(p<2&&!n)return u(v);const x=a.exit("strikethroughSequenceTemporary"),S=Td(v);return x._open=!S||S===2&&!!E,x._close=!E||E===2&&!!S,l(v)}}}class LK{constructor(){this.map=[]}add(e,n,r){PK(this,e,n,r)}consume(e){if(this.map.sort(function(s,a){return s[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let i=r.pop();for(;i;){for(const s of i)e.push(s);i=r.pop()}this.map.length=0}}function PK(t,e,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<t.map.length;){if(t.map[i][0]===e){t.map[i][1]+=n,t.map[i][2].push(...r);return}i+=1}t.map.push([e,n,r])}}function BK(t,e){let n=!1;const r=[];for(;e<t.length;){const i=t[e];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function zK(){return{flow:{null:{name:"table",tokenize:UK,resolveAll:FK}}}}function UK(t,e,n){const r=this;let i=0,s=0,a;return l;function l(q){let ie=r.events.length-1;for(;ie>-1;){const oe=r.events[ie][1].type;if(oe==="lineEnding"||oe==="linePrefix")ie--;else break}const se=ie>-1?r.events[ie][1].type:null,Te=se==="tableHead"||se==="tableRow"?R:u;return Te===R&&r.parser.lazy[r.now().line]?n(q):Te(q)}function u(q){return t.enter("tableHead"),t.enter("tableRow"),d(q)}function d(q){return q===124||(a=!0,s+=1),f(q)}function f(q){return q===null?n(q):rt(q)?s>1?(s=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(q),t.exit("lineEnding"),b):n(q):jt(q)?Bt(t,f,"whitespace")(q):(s+=1,a&&(a=!1,i+=1),q===124?(t.enter("tableCellDivider"),t.consume(q),t.exit("tableCellDivider"),a=!0,f):(t.enter("data"),p(q)))}function p(q){return q===null||q===124||Tn(q)?(t.exit("data"),f(q)):(t.consume(q),q===92?g:p)}function g(q){return q===92||q===124?(t.consume(q),p):p(q)}function b(q){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(q):(t.enter("tableDelimiterRow"),a=!1,jt(q)?Bt(t,v,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):v(q))}function v(q){return q===45||q===58?x(q):q===124?(a=!0,t.enter("tableCellDivider"),t.consume(q),t.exit("tableCellDivider"),E):D(q)}function E(q){return jt(q)?Bt(t,x,"whitespace")(q):x(q)}function x(q){return q===58?(s+=1,a=!0,t.enter("tableDelimiterMarker"),t.consume(q),t.exit("tableDelimiterMarker"),S):q===45?(s+=1,S(q)):q===null||rt(q)?L(q):D(q)}function S(q){return q===45?(t.enter("tableDelimiterFiller"),C(q)):D(q)}function C(q){return q===45?(t.consume(q),C):q===58?(a=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(q),t.exit("tableDelimiterMarker"),O):(t.exit("tableDelimiterFiller"),O(q))}function O(q){return jt(q)?Bt(t,L,"whitespace")(q):L(q)}function L(q){return q===124?v(q):q===null||rt(q)?!a||i!==s?D(q):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(q)):D(q)}function D(q){return n(q)}function R(q){return t.enter("tableRow"),F(q)}function F(q){return q===124?(t.enter("tableCellDivider"),t.consume(q),t.exit("tableCellDivider"),F):q===null||rt(q)?(t.exit("tableRow"),e(q)):jt(q)?Bt(t,F,"whitespace")(q):(t.enter("data"),G(q))}function G(q){return q===null||q===124||Tn(q)?(t.exit("data"),F(q)):(t.consume(q),q===92?Z:G)}function Z(q){return q===92||q===124?(t.consume(q),G):G(q)}}function FK(t,e){let n=-1,r=!0,i=0,s=[0,0,0,0],a=[0,0,0,0],l=!1,u=0,d,f,p;const g=new LK;for(;++n<t.length;){const b=t[n],v=b[1];b[0]==="enter"?v.type==="tableHead"?(l=!1,u!==0&&(Lk(g,e,u,d,f),f=void 0,u=0),d={type:"table",start:Object.assign({},v.start),end:Object.assign({},v.end)},g.add(n,0,[["enter",d,e]])):v.type==="tableRow"||v.type==="tableDelimiterRow"?(r=!0,p=void 0,s=[0,0,0,0],a=[0,n+1,0,0],l&&(l=!1,f={type:"tableBody",start:Object.assign({},v.start),end:Object.assign({},v.end)},g.add(n,0,[["enter",f,e]])),i=v.type==="tableDelimiterRow"?2:f?3:1):i&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(s[1]!==0&&(a[0]=a[1],p=Nm(g,e,s,i,void 0,p),s=[0,0,0,0]),a[2]=n)):v.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(a[0]=a[1],p=Nm(g,e,s,i,void 0,p)),s=a,a=[s[1],n,0,0])):v.type==="tableHead"?(l=!0,u=n):v.type==="tableRow"||v.type==="tableDelimiterRow"?(u=n,s[1]!==0?(a[0]=a[1],p=Nm(g,e,s,i,n,p)):a[1]!==0&&(p=Nm(g,e,a,i,n,p)),i=0):i&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")&&(a[3]=n)}for(u!==0&&Lk(g,e,u,d,f),g.consume(e.events),n=-1;++n<e.events.length;){const b=e.events[n];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=BK(e.events,n))}return t}function Nm(t,e,n,r,i,s){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(s.end=Object.assign({},rd(e.events,n[0])),t.add(n[0],0,[["exit",s,e]]));const u=rd(e.events,n[1]);if(s={type:a,start:Object.assign({},u),end:Object.assign({},u)},t.add(n[1],0,[["enter",s,e]]),n[2]!==0){const d=rd(e.events,n[2]),f=rd(e.events,n[3]),p={type:l,start:Object.assign({},d),end:Object.assign({},f)};if(t.add(n[2],0,[["enter",p,e]]),r!==2){const g=e.events[n[2]],b=e.events[n[3]];if(g[1].end=Object.assign({},b[1].end),g[1].type="chunkText",g[1].contentType="text",n[3]>n[2]+1){const v=n[2]+1,E=n[3]-n[2]-1;t.add(v,E,[])}}t.add(n[3]+1,0,[["exit",p,e]])}return i!==void 0&&(s.end=Object.assign({},rd(e.events,i)),t.add(i,0,[["exit",s,e]]),s=void 0),s}function Lk(t,e,n,r,i){const s=[],a=rd(e.events,n);i&&(i.end=Object.assign({},a),s.push(["exit",i,e])),r.end=Object.assign({},a),s.push(["exit",r,e]),t.add(n+1,0,s)}function rd(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const HK={name:"tasklistCheck",tokenize:$K};function jK(){return{text:{91:HK}}}function $K(t,e,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),s)}function s(u){return Tn(u)?(t.enter("taskListCheckValueUnchecked"),t.consume(u),t.exit("taskListCheckValueUnchecked"),a):u===88||u===120?(t.enter("taskListCheckValueChecked"),t.consume(u),t.exit("taskListCheckValueChecked"),a):n(u)}function a(u){return u===93?(t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),l):n(u)}function l(u){return rt(u)?e(u):jt(u)?t.check({tokenize:qK},e,n)(u):n(u)}}function qK(t,e,n){return Bt(t,r,"whitespace");function r(i){return i===null?n(i):e(i)}}function VK(t){return EN([gK(),kK(),IK(t),zK(),jK()])}const GK={};function YK(t){const e=this,n=t||GK,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(VK(n)),s.push(fK()),a.push(hK(n))}const Pk=/[#.]/g;function WK(t,e){const n=t||"",r={};let i=0,s,a;for(;i<n.length;){Pk.lastIndex=i;const l=Pk.exec(n),u=n.slice(i,l?l.index:n.length);u&&(s?s==="#"?r.id=u:Array.isArray(r.className)?r.className.push(u):r.className=[u]:a=u,i+=u.length),l&&(s=l[0],i++)}return{type:"element",tagName:a||e||"div",properties:r,children:[]}}function fO(t,e,n){const r=n?ZK(n):void 0;function i(s,a,...l){let u;if(s==null){u={type:"root",children:[]};const d=a;l.unshift(d)}else{u=WK(s,e);const d=u.tagName.toLowerCase(),f=r?r.get(d):void 0;if(u.tagName=f||d,KK(a))l.unshift(a);else for(const[p,g]of Object.entries(a))XK(t,u.properties,p,g)}for(const d of l)L4(u.children,d);return u.type==="element"&&u.tagName==="template"&&(u.content={type:"root",children:u.children},u.children=[]),u}return i}function KK(t){if(t===null||typeof t!="object"||Array.isArray(t))return!0;if(typeof t.type!="string")return!1;const e=t,n=Object.keys(t);for(const r of n){const i=e[r];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const s=i;for(const a of s)if(typeof a!="number"&&typeof a!="string")return!0}}return!!("children"in t&&Array.isArray(t.children))}function XK(t,e,n,r){const i=bb(t,n);let s;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;s=r}else typeof r=="boolean"?s=r:typeof r=="string"?i.spaceSeparated?s=Kw(r):i.commaSeparated?s=qw(r):i.commaOrSpaceSeparated?s=Kw(qw(r).join(" ")):s=Bk(i,i.property,r):Array.isArray(r)?s=[...r]:s=i.property==="style"?QK(r):String(r);if(Array.isArray(s)){const a=[];for(const l of s)a.push(Bk(i,i.property,l));s=a}i.property==="className"&&Array.isArray(e.className)&&(s=e.className.concat(s)),e[i.property]=s}}function L4(t,e){if(e!=null)if(typeof e=="number"||typeof e=="string")t.push({type:"text",value:String(e)});else if(Array.isArray(e))for(const n of e)L4(t,n);else if(typeof e=="object"&&"type"in e)e.type==="root"?L4(t,e.children):t.push(e);else throw new Error("Expected node, nodes, or string, got `"+e+"`")}function Bk(t,e,n){if(typeof n=="string"){if(t.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((t.boolean||t.overloadedBoolean)&&(n===""||ah(n)===ah(e)))return!0}return n}function QK(t){const e=[];for(const[n,r]of Object.entries(t))e.push([n,r].join(": "));return e.join("; ")}function ZK(t){const e=new Map;for(const n of t)e.set(n.toLowerCase(),n);return e}const JK=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],hO=fO(Uh,"div"),pO=fO(eu,"g",JK);function eX(t){const e=String(t),n=[];return{toOffset:i,toPoint:r};function r(s){if(typeof s=="number"&&s>-1&&s<=e.length){let a=0;for(;;){let l=n[a];if(l===void 0){const u=zk(e,n[a-1]);l=u===-1?e.length+1:u+1,n[a]=l}if(l>s)return{line:a+1,column:s-(a>0?n[a-1]:0)+1,offset:s};a++}}}function i(s){if(s&&typeof s.line=="number"&&typeof s.column=="number"&&!Number.isNaN(s.line)&&!Number.isNaN(s.column)){for(;n.length<s.line;){const l=n[n.length-1],u=zk(e,l),d=u===-1?e.length+1:u+1;if(l===d)break;n.push(d)}const a=(s.line>1?n[s.line-2]:0)+s.column-1;if(a<n[s.line-1])return a}}}function zk(t,e){const n=t.indexOf("\r",e),r=t.indexOf(`
`,e);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const va={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},mO={}.hasOwnProperty,tX=Object.prototype;function nX(t,e){const n=e||{};return P_({file:n.file||void 0,location:!1,schema:n.space==="svg"?eu:Uh,verbose:n.verbose||!1},t)}function P_(t,e){let n;switch(e.nodeName){case"#comment":{const r=e;return n={type:"comment",value:r.data},_g(t,r,n),n}case"#document":case"#document-fragment":{const r=e,i="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:gO(t,e.childNodes),data:{quirksMode:i}},t.file&&t.location){const s=String(t.file),a=eX(s),l=a.toPoint(0),u=a.toPoint(s.length);n.position={start:l,end:u}}return n}case"#documentType":{const r=e;return n={type:"doctype"},_g(t,r,n),n}case"#text":{const r=e;return n={type:"text",value:r.value},_g(t,r,n),n}default:return n=rX(t,e),n}}function gO(t,e){let n=-1;const r=[];for(;++n<e.length;){const i=P_(t,e[n]);r.push(i)}return r}function rX(t,e){const n=t.schema;t.schema=e.namespaceURI===va.svg?eu:Uh;let r=-1;const i={};for(;++r<e.attrs.length;){const l=e.attrs[r],u=(l.prefix?l.prefix+":":"")+l.name;mO.call(tX,u)||(i[u]=l.value)}const a=(t.schema.space==="svg"?pO:hO)(e.tagName,i,gO(t,e.childNodes));if(_g(t,e,a),a.tagName==="template"){const l=e,u=l.sourceCodeLocation,d=u&&u.startTag&&dd(u.startTag),f=u&&u.endTag&&dd(u.endTag),p=P_(t,l.content);d&&f&&t.file&&(p.position={start:d.end,end:f.start}),a.content=p}return t.schema=n,a}function _g(t,e,n){if("sourceCodeLocation"in e&&e.sourceCodeLocation&&t.file){const r=iX(t,n,e.sourceCodeLocation);r&&(t.location=!0,n.position=r)}}function iX(t,e,n){const r=dd(n);if(e.type==="element"){const i=e.children[e.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),t.verbose){const s={};let a;if(n.attrs)for(a in n.attrs)mO.call(n.attrs,a)&&(s[bb(t.schema,a).property]=dd(n.attrs[a]));n.startTag;const l=dd(n.startTag),u=n.endTag?dd(n.endTag):void 0,d={opening:l};u&&(d.closing=u),d.properties=s,e.data={position:d}}}return r}function dd(t){const e=Uk({line:t.startLine,column:t.startCol,offset:t.startOffset}),n=Uk({line:t.endLine,column:t.endCol,offset:t.endOffset});return e||n?{start:e,end:n}:void 0}function Uk(t){return t.line&&t.column?t:void 0}const sX={},aX={}.hasOwnProperty,bO=VN("type",{handlers:{root:lX,element:hX,text:dX,comment:fX,doctype:cX}});function oX(t,e){const r=(e||sX).space;return bO(t,r==="svg"?eu:Uh)}function lX(t,e){const n={nodeName:"#document",mode:(t.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=B_(t.children,n,e),Vd(t,n),n}function uX(t,e){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=B_(t.children,n,e),Vd(t,n),n}function cX(t){const e={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Vd(t,e),e}function dX(t){const e={nodeName:"#text",value:t.value,parentNode:null};return Vd(t,e),e}function fX(t){const e={nodeName:"#comment",data:t.value,parentNode:null};return Vd(t,e),e}function hX(t,e){const n=e;let r=n;t.type==="element"&&t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=eu);const i=[];let s;if(t.properties){for(s in t.properties)if(s!=="children"&&aX.call(t.properties,s)){const u=pX(r,s,t.properties[s]);u&&i.push(u)}}const a=r.space,l={nodeName:t.tagName,tagName:t.tagName,attrs:i,namespaceURI:va[a],childNodes:[],parentNode:null};return l.childNodes=B_(t.children,l,r),Vd(t,l),t.tagName==="template"&&t.content&&(l.content=uX(t.content,r)),l}function pX(t,e,n){const r=bb(t,e);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?sN(n):hN(n));const i={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const s=i.name.indexOf(":");s<0?i.prefix="":(i.name=i.name.slice(s+1),i.prefix=r.attribute.slice(0,s)),i.namespace=va[r.space]}return i}function B_(t,e,n){let r=-1;const i=[];if(t)for(;++r<t.length;){const s=bO(t[r],n);s.parentNode=e,i.push(s)}return i}function Vd(t,e){const n=t.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,e.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const mX=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],gX=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),jn="�";var U;(function(t){t[t.EOF=-1]="EOF",t[t.NULL=0]="NULL",t[t.TABULATION=9]="TABULATION",t[t.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",t[t.LINE_FEED=10]="LINE_FEED",t[t.FORM_FEED=12]="FORM_FEED",t[t.SPACE=32]="SPACE",t[t.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",t[t.QUOTATION_MARK=34]="QUOTATION_MARK",t[t.AMPERSAND=38]="AMPERSAND",t[t.APOSTROPHE=39]="APOSTROPHE",t[t.HYPHEN_MINUS=45]="HYPHEN_MINUS",t[t.SOLIDUS=47]="SOLIDUS",t[t.DIGIT_0=48]="DIGIT_0",t[t.DIGIT_9=57]="DIGIT_9",t[t.SEMICOLON=59]="SEMICOLON",t[t.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",t[t.EQUALS_SIGN=61]="EQUALS_SIGN",t[t.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",t[t.QUESTION_MARK=63]="QUESTION_MARK",t[t.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",t[t.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",t[t.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",t[t.GRAVE_ACCENT=96]="GRAVE_ACCENT",t[t.LATIN_SMALL_A=97]="LATIN_SMALL_A",t[t.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(U||(U={}));const Bi={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function vO(t){return t>=55296&&t<=57343}function bX(t){return t>=56320&&t<=57343}function vX(t,e){return(t-55296)*1024+9216+e}function yO(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&t>=1&&t<=31||t>=127&&t<=159}function EO(t){return t>=64976&&t<=65007||gX.has(t)}var ve;(function(t){t.controlCharacterInInputStream="control-character-in-input-stream",t.noncharacterInInputStream="noncharacter-in-input-stream",t.surrogateInInputStream="surrogate-in-input-stream",t.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",t.endTagWithAttributes="end-tag-with-attributes",t.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",t.unexpectedSolidusInTag="unexpected-solidus-in-tag",t.unexpectedNullCharacter="unexpected-null-character",t.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",t.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",t.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",t.missingEndTagName="missing-end-tag-name",t.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",t.unknownNamedCharacterReference="unknown-named-character-reference",t.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",t.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",t.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",t.eofBeforeTagName="eof-before-tag-name",t.eofInTag="eof-in-tag",t.missingAttributeValue="missing-attribute-value",t.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",t.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",t.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",t.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",t.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",t.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",t.missingDoctypePublicIdentifier="missing-doctype-public-identifier",t.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",t.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",t.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",t.cdataInHtmlContent="cdata-in-html-content",t.incorrectlyOpenedComment="incorrectly-opened-comment",t.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",t.eofInDoctype="eof-in-doctype",t.nestedComment="nested-comment",t.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",t.eofInComment="eof-in-comment",t.incorrectlyClosedComment="incorrectly-closed-comment",t.eofInCdata="eof-in-cdata",t.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",t.nullCharacterReference="null-character-reference",t.surrogateCharacterReference="surrogate-character-reference",t.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",t.controlCharacterReference="control-character-reference",t.noncharacterCharacterReference="noncharacter-character-reference",t.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",t.missingDoctypeName="missing-doctype-name",t.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",t.duplicateAttribute="duplicate-attribute",t.nonConformingDoctype="non-conforming-doctype",t.missingDoctype="missing-doctype",t.misplacedDoctype="misplaced-doctype",t.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",t.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",t.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",t.openElementsLeftAfterEof="open-elements-left-after-eof",t.abandonedHeadElementChild="abandoned-head-element-child",t.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",t.nestedNoscriptInHead="nested-noscript-in-head",t.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(ve||(ve={}));const yX=65536;class EX{constructor(e){this.handler=e,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=yX,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,n){const{line:r,col:i,offset:s}=this,a=i+n,l=s+n;return{code:e,startLine:r,endLine:r,startCol:a,endCol:a,startOffset:l,endOffset:l}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(bX(n))return this.pos++,this._addGap(),vX(e,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,U.EOF;return this._err(ve.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,n){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,n){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(e,this.pos);for(let r=0;r<e.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==e.charCodeAt(r))return!1;return!0}peek(e){const n=this.pos+e;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,U.EOF;const r=this.html.charCodeAt(n);return r===U.CARRIAGE_RETURN?U.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,U.EOF;let e=this.html.charCodeAt(this.pos);return e===U.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,U.LINE_FEED):e===U.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,vO(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===U.LINE_FEED||e===U.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){yO(e)?this._err(ve.controlCharacterInInputStream):EO(e)&&this._err(ve.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var Pt;(function(t){t[t.CHARACTER=0]="CHARACTER",t[t.NULL_CHARACTER=1]="NULL_CHARACTER",t[t.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",t[t.START_TAG=3]="START_TAG",t[t.END_TAG=4]="END_TAG",t[t.COMMENT=5]="COMMENT",t[t.DOCTYPE=6]="DOCTYPE",t[t.EOF=7]="EOF",t[t.HIBERNATION=8]="HIBERNATION"})(Pt||(Pt={}));function _O(t,e){for(let n=t.attrs.length-1;n>=0;n--)if(t.attrs[n].name===e)return t.attrs[n].value;return null}const _X=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTǇǋǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉ǲኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻ǲᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤĳạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ﬃɩᾹ\0\0᾽g;耀ﬀig;耀ﬄ;쀀𝔣lig;耀ﬁlig;쀀fjƀaltῙ῜ῡt;晭ig;耀ﬂns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒α‚‰‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସǳ⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗǈⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼ǲ㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),xX=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function TX(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=xX.get(t))!==null&&e!==void 0?e:t}var Fr;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(Fr||(Fr={}));const SX=32;var Ll;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Ll||(Ll={}));function P4(t){return t>=Fr.ZERO&&t<=Fr.NINE}function wX(t){return t>=Fr.UPPER_A&&t<=Fr.UPPER_F||t>=Fr.LOWER_A&&t<=Fr.LOWER_F}function kX(t){return t>=Fr.UPPER_A&&t<=Fr.UPPER_Z||t>=Fr.LOWER_A&&t<=Fr.LOWER_Z||P4(t)}function CX(t){return t===Fr.EQUALS||kX(t)}var Br;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(Br||(Br={}));var bo;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(bo||(bo={}));class AX{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=Br.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=bo.Strict}startEntity(e){this.decodeMode=e,this.state=Br.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case Br.EntityStart:return e.charCodeAt(n)===Fr.NUM?(this.state=Br.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=Br.NamedEntity,this.stateNamedEntity(e,n));case Br.NumericStart:return this.stateNumericStart(e,n);case Br.NumericDecimal:return this.stateNumericDecimal(e,n);case Br.NumericHex:return this.stateNumericHex(e,n);case Br.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|SX)===Fr.LOWER_X?(this.state=Br.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=Br.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,i){if(n!==r){const s=r-n;this.result=this.result*Math.pow(i,s)+Number.parseInt(e.substr(n,s),i),this.consumed+=s}}stateNumericHex(e,n){const r=n;for(;n<e.length;){const i=e.charCodeAt(n);if(P4(i)||wX(i))n+=1;else return this.addToNumericResult(e,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(e,r,n,16),-1}stateNumericDecimal(e,n){const r=n;for(;n<e.length;){const i=e.charCodeAt(n);if(P4(i))n+=1;else return this.addToNumericResult(e,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(e,r,n,10),-1}emitNumericEntity(e,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Fr.SEMI)this.consumed+=1;else if(this.decodeMode===bo.Strict)return 0;return this.emitCodePoint(TX(this.result),this.consumed),this.errors&&(e!==Fr.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let i=r[this.treeIndex],s=(i&Ll.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const a=e.charCodeAt(n);if(this.treeIndex=NX(r,i,this.treeIndex+Math.max(1,s),a),this.treeIndex<0)return this.result===0||this.decodeMode===bo.Attribute&&(s===0||CX(a))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],s=(i&Ll.VALUE_LENGTH)>>14,s!==0){if(a===Fr.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==bo.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,i=(r[n]&Ll.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[e]&~Ll.VALUE_LENGTH:i[e+1],r),n===3&&this.emitCodePoint(i[e+2],r),r}end(){var e;switch(this.state){case Br.NamedEntity:return this.result!==0&&(this.decodeMode!==bo.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Br.NumericDecimal:return this.emitNumericEntity(0,2);case Br.NumericHex:return this.emitNumericEntity(0,3);case Br.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Br.EntityStart:return 0}}}function NX(t,e,n,r){const i=(e&Ll.BRANCH_LENGTH)>>7,s=e&Ll.JUMP_TABLE;if(i===0)return s!==0&&r===s?n:-1;if(s){const u=r-s;return u<0||u>=i?-1:t[n+u]-1}let a=n,l=a+i-1;for(;a<=l;){const u=a+l>>>1,d=t[u];if(d<r)a=u+1;else if(d>r)l=u-1;else return t[u+i]}return-1}var Ne;(function(t){t.HTML="http://www.w3.org/1999/xhtml",t.MATHML="http://www.w3.org/1998/Math/MathML",t.SVG="http://www.w3.org/2000/svg",t.XLINK="http://www.w3.org/1999/xlink",t.XML="http://www.w3.org/XML/1998/namespace",t.XMLNS="http://www.w3.org/2000/xmlns/"})(Ne||(Ne={}));var Hu;(function(t){t.TYPE="type",t.ACTION="action",t.ENCODING="encoding",t.PROMPT="prompt",t.NAME="name",t.COLOR="color",t.FACE="face",t.SIZE="size"})(Hu||(Hu={}));var Ms;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(Ms||(Ms={}));var ue;(function(t){t.A="a",t.ADDRESS="address",t.ANNOTATION_XML="annotation-xml",t.APPLET="applet",t.AREA="area",t.ARTICLE="article",t.ASIDE="aside",t.B="b",t.BASE="base",t.BASEFONT="basefont",t.BGSOUND="bgsound",t.BIG="big",t.BLOCKQUOTE="blockquote",t.BODY="body",t.BR="br",t.BUTTON="button",t.CAPTION="caption",t.CENTER="center",t.CODE="code",t.COL="col",t.COLGROUP="colgroup",t.DD="dd",t.DESC="desc",t.DETAILS="details",t.DIALOG="dialog",t.DIR="dir",t.DIV="div",t.DL="dl",t.DT="dt",t.EM="em",t.EMBED="embed",t.FIELDSET="fieldset",t.FIGCAPTION="figcaption",t.FIGURE="figure",t.FONT="font",t.FOOTER="footer",t.FOREIGN_OBJECT="foreignObject",t.FORM="form",t.FRAME="frame",t.FRAMESET="frameset",t.H1="h1",t.H2="h2",t.H3="h3",t.H4="h4",t.H5="h5",t.H6="h6",t.HEAD="head",t.HEADER="header",t.HGROUP="hgroup",t.HR="hr",t.HTML="html",t.I="i",t.IMG="img",t.IMAGE="image",t.INPUT="input",t.IFRAME="iframe",t.KEYGEN="keygen",t.LABEL="label",t.LI="li",t.LINK="link",t.LISTING="listing",t.MAIN="main",t.MALIGNMARK="malignmark",t.MARQUEE="marquee",t.MATH="math",t.MENU="menu",t.META="meta",t.MGLYPH="mglyph",t.MI="mi",t.MO="mo",t.MN="mn",t.MS="ms",t.MTEXT="mtext",t.NAV="nav",t.NOBR="nobr",t.NOFRAMES="noframes",t.NOEMBED="noembed",t.NOSCRIPT="noscript",t.OBJECT="object",t.OL="ol",t.OPTGROUP="optgroup",t.OPTION="option",t.P="p",t.PARAM="param",t.PLAINTEXT="plaintext",t.PRE="pre",t.RB="rb",t.RP="rp",t.RT="rt",t.RTC="rtc",t.RUBY="ruby",t.S="s",t.SCRIPT="script",t.SEARCH="search",t.SECTION="section",t.SELECT="select",t.SOURCE="source",t.SMALL="small",t.SPAN="span",t.STRIKE="strike",t.STRONG="strong",t.STYLE="style",t.SUB="sub",t.SUMMARY="summary",t.SUP="sup",t.TABLE="table",t.TBODY="tbody",t.TEMPLATE="template",t.TEXTAREA="textarea",t.TFOOT="tfoot",t.TD="td",t.TH="th",t.THEAD="thead",t.TITLE="title",t.TR="tr",t.TRACK="track",t.TT="tt",t.U="u",t.UL="ul",t.SVG="svg",t.VAR="var",t.WBR="wbr",t.XMP="xmp"})(ue||(ue={}));var T;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.A=1]="A",t[t.ADDRESS=2]="ADDRESS",t[t.ANNOTATION_XML=3]="ANNOTATION_XML",t[t.APPLET=4]="APPLET",t[t.AREA=5]="AREA",t[t.ARTICLE=6]="ARTICLE",t[t.ASIDE=7]="ASIDE",t[t.B=8]="B",t[t.BASE=9]="BASE",t[t.BASEFONT=10]="BASEFONT",t[t.BGSOUND=11]="BGSOUND",t[t.BIG=12]="BIG",t[t.BLOCKQUOTE=13]="BLOCKQUOTE",t[t.BODY=14]="BODY",t[t.BR=15]="BR",t[t.BUTTON=16]="BUTTON",t[t.CAPTION=17]="CAPTION",t[t.CENTER=18]="CENTER",t[t.CODE=19]="CODE",t[t.COL=20]="COL",t[t.COLGROUP=21]="COLGROUP",t[t.DD=22]="DD",t[t.DESC=23]="DESC",t[t.DETAILS=24]="DETAILS",t[t.DIALOG=25]="DIALOG",t[t.DIR=26]="DIR",t[t.DIV=27]="DIV",t[t.DL=28]="DL",t[t.DT=29]="DT",t[t.EM=30]="EM",t[t.EMBED=31]="EMBED",t[t.FIELDSET=32]="FIELDSET",t[t.FIGCAPTION=33]="FIGCAPTION",t[t.FIGURE=34]="FIGURE",t[t.FONT=35]="FONT",t[t.FOOTER=36]="FOOTER",t[t.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",t[t.FORM=38]="FORM",t[t.FRAME=39]="FRAME",t[t.FRAMESET=40]="FRAMESET",t[t.H1=41]="H1",t[t.H2=42]="H2",t[t.H3=43]="H3",t[t.H4=44]="H4",t[t.H5=45]="H5",t[t.H6=46]="H6",t[t.HEAD=47]="HEAD",t[t.HEADER=48]="HEADER",t[t.HGROUP=49]="HGROUP",t[t.HR=50]="HR",t[t.HTML=51]="HTML",t[t.I=52]="I",t[t.IMG=53]="IMG",t[t.IMAGE=54]="IMAGE",t[t.INPUT=55]="INPUT",t[t.IFRAME=56]="IFRAME",t[t.KEYGEN=57]="KEYGEN",t[t.LABEL=58]="LABEL",t[t.LI=59]="LI",t[t.LINK=60]="LINK",t[t.LISTING=61]="LISTING",t[t.MAIN=62]="MAIN",t[t.MALIGNMARK=63]="MALIGNMARK",t[t.MARQUEE=64]="MARQUEE",t[t.MATH=65]="MATH",t[t.MENU=66]="MENU",t[t.META=67]="META",t[t.MGLYPH=68]="MGLYPH",t[t.MI=69]="MI",t[t.MO=70]="MO",t[t.MN=71]="MN",t[t.MS=72]="MS",t[t.MTEXT=73]="MTEXT",t[t.NAV=74]="NAV",t[t.NOBR=75]="NOBR",t[t.NOFRAMES=76]="NOFRAMES",t[t.NOEMBED=77]="NOEMBED",t[t.NOSCRIPT=78]="NOSCRIPT",t[t.OBJECT=79]="OBJECT",t[t.OL=80]="OL",t[t.OPTGROUP=81]="OPTGROUP",t[t.OPTION=82]="OPTION",t[t.P=83]="P",t[t.PARAM=84]="PARAM",t[t.PLAINTEXT=85]="PLAINTEXT",t[t.PRE=86]="PRE",t[t.RB=87]="RB",t[t.RP=88]="RP",t[t.RT=89]="RT",t[t.RTC=90]="RTC",t[t.RUBY=91]="RUBY",t[t.S=92]="S",t[t.SCRIPT=93]="SCRIPT",t[t.SEARCH=94]="SEARCH",t[t.SECTION=95]="SECTION",t[t.SELECT=96]="SELECT",t[t.SOURCE=97]="SOURCE",t[t.SMALL=98]="SMALL",t[t.SPAN=99]="SPAN",t[t.STRIKE=100]="STRIKE",t[t.STRONG=101]="STRONG",t[t.STYLE=102]="STYLE",t[t.SUB=103]="SUB",t[t.SUMMARY=104]="SUMMARY",t[t.SUP=105]="SUP",t[t.TABLE=106]="TABLE",t[t.TBODY=107]="TBODY",t[t.TEMPLATE=108]="TEMPLATE",t[t.TEXTAREA=109]="TEXTAREA",t[t.TFOOT=110]="TFOOT",t[t.TD=111]="TD",t[t.TH=112]="TH",t[t.THEAD=113]="THEAD",t[t.TITLE=114]="TITLE",t[t.TR=115]="TR",t[t.TRACK=116]="TRACK",t[t.TT=117]="TT",t[t.U=118]="U",t[t.UL=119]="UL",t[t.SVG=120]="SVG",t[t.VAR=121]="VAR",t[t.WBR=122]="WBR",t[t.XMP=123]="XMP"})(T||(T={}));const OX=new Map([[ue.A,T.A],[ue.ADDRESS,T.ADDRESS],[ue.ANNOTATION_XML,T.ANNOTATION_XML],[ue.APPLET,T.APPLET],[ue.AREA,T.AREA],[ue.ARTICLE,T.ARTICLE],[ue.ASIDE,T.ASIDE],[ue.B,T.B],[ue.BASE,T.BASE],[ue.BASEFONT,T.BASEFONT],[ue.BGSOUND,T.BGSOUND],[ue.BIG,T.BIG],[ue.BLOCKQUOTE,T.BLOCKQUOTE],[ue.BODY,T.BODY],[ue.BR,T.BR],[ue.BUTTON,T.BUTTON],[ue.CAPTION,T.CAPTION],[ue.CENTER,T.CENTER],[ue.CODE,T.CODE],[ue.COL,T.COL],[ue.COLGROUP,T.COLGROUP],[ue.DD,T.DD],[ue.DESC,T.DESC],[ue.DETAILS,T.DETAILS],[ue.DIALOG,T.DIALOG],[ue.DIR,T.DIR],[ue.DIV,T.DIV],[ue.DL,T.DL],[ue.DT,T.DT],[ue.EM,T.EM],[ue.EMBED,T.EMBED],[ue.FIELDSET,T.FIELDSET],[ue.FIGCAPTION,T.FIGCAPTION],[ue.FIGURE,T.FIGURE],[ue.FONT,T.FONT],[ue.FOOTER,T.FOOTER],[ue.FOREIGN_OBJECT,T.FOREIGN_OBJECT],[ue.FORM,T.FORM],[ue.FRAME,T.FRAME],[ue.FRAMESET,T.FRAMESET],[ue.H1,T.H1],[ue.H2,T.H2],[ue.H3,T.H3],[ue.H4,T.H4],[ue.H5,T.H5],[ue.H6,T.H6],[ue.HEAD,T.HEAD],[ue.HEADER,T.HEADER],[ue.HGROUP,T.HGROUP],[ue.HR,T.HR],[ue.HTML,T.HTML],[ue.I,T.I],[ue.IMG,T.IMG],[ue.IMAGE,T.IMAGE],[ue.INPUT,T.INPUT],[ue.IFRAME,T.IFRAME],[ue.KEYGEN,T.KEYGEN],[ue.LABEL,T.LABEL],[ue.LI,T.LI],[ue.LINK,T.LINK],[ue.LISTING,T.LISTING],[ue.MAIN,T.MAIN],[ue.MALIGNMARK,T.MALIGNMARK],[ue.MARQUEE,T.MARQUEE],[ue.MATH,T.MATH],[ue.MENU,T.MENU],[ue.META,T.META],[ue.MGLYPH,T.MGLYPH],[ue.MI,T.MI],[ue.MO,T.MO],[ue.MN,T.MN],[ue.MS,T.MS],[ue.MTEXT,T.MTEXT],[ue.NAV,T.NAV],[ue.NOBR,T.NOBR],[ue.NOFRAMES,T.NOFRAMES],[ue.NOEMBED,T.NOEMBED],[ue.NOSCRIPT,T.NOSCRIPT],[ue.OBJECT,T.OBJECT],[ue.OL,T.OL],[ue.OPTGROUP,T.OPTGROUP],[ue.OPTION,T.OPTION],[ue.P,T.P],[ue.PARAM,T.PARAM],[ue.PLAINTEXT,T.PLAINTEXT],[ue.PRE,T.PRE],[ue.RB,T.RB],[ue.RP,T.RP],[ue.RT,T.RT],[ue.RTC,T.RTC],[ue.RUBY,T.RUBY],[ue.S,T.S],[ue.SCRIPT,T.SCRIPT],[ue.SEARCH,T.SEARCH],[ue.SECTION,T.SECTION],[ue.SELECT,T.SELECT],[ue.SOURCE,T.SOURCE],[ue.SMALL,T.SMALL],[ue.SPAN,T.SPAN],[ue.STRIKE,T.STRIKE],[ue.STRONG,T.STRONG],[ue.STYLE,T.STYLE],[ue.SUB,T.SUB],[ue.SUMMARY,T.SUMMARY],[ue.SUP,T.SUP],[ue.TABLE,T.TABLE],[ue.TBODY,T.TBODY],[ue.TEMPLATE,T.TEMPLATE],[ue.TEXTAREA,T.TEXTAREA],[ue.TFOOT,T.TFOOT],[ue.TD,T.TD],[ue.TH,T.TH],[ue.THEAD,T.THEAD],[ue.TITLE,T.TITLE],[ue.TR,T.TR],[ue.TRACK,T.TRACK],[ue.TT,T.TT],[ue.U,T.U],[ue.UL,T.UL],[ue.SVG,T.SVG],[ue.VAR,T.VAR],[ue.WBR,T.WBR],[ue.XMP,T.XMP]]);function Gd(t){var e;return(e=OX.get(t))!==null&&e!==void 0?e:T.UNKNOWN}const Oe=T,MX={[Ne.HTML]:new Set([Oe.ADDRESS,Oe.APPLET,Oe.AREA,Oe.ARTICLE,Oe.ASIDE,Oe.BASE,Oe.BASEFONT,Oe.BGSOUND,Oe.BLOCKQUOTE,Oe.BODY,Oe.BR,Oe.BUTTON,Oe.CAPTION,Oe.CENTER,Oe.COL,Oe.COLGROUP,Oe.DD,Oe.DETAILS,Oe.DIR,Oe.DIV,Oe.DL,Oe.DT,Oe.EMBED,Oe.FIELDSET,Oe.FIGCAPTION,Oe.FIGURE,Oe.FOOTER,Oe.FORM,Oe.FRAME,Oe.FRAMESET,Oe.H1,Oe.H2,Oe.H3,Oe.H4,Oe.H5,Oe.H6,Oe.HEAD,Oe.HEADER,Oe.HGROUP,Oe.HR,Oe.HTML,Oe.IFRAME,Oe.IMG,Oe.INPUT,Oe.LI,Oe.LINK,Oe.LISTING,Oe.MAIN,Oe.MARQUEE,Oe.MENU,Oe.META,Oe.NAV,Oe.NOEMBED,Oe.NOFRAMES,Oe.NOSCRIPT,Oe.OBJECT,Oe.OL,Oe.P,Oe.PARAM,Oe.PLAINTEXT,Oe.PRE,Oe.SCRIPT,Oe.SECTION,Oe.SELECT,Oe.SOURCE,Oe.STYLE,Oe.SUMMARY,Oe.TABLE,Oe.TBODY,Oe.TD,Oe.TEMPLATE,Oe.TEXTAREA,Oe.TFOOT,Oe.TH,Oe.THEAD,Oe.TITLE,Oe.TR,Oe.TRACK,Oe.UL,Oe.WBR,Oe.XMP]),[Ne.MATHML]:new Set([Oe.MI,Oe.MO,Oe.MN,Oe.MS,Oe.MTEXT,Oe.ANNOTATION_XML]),[Ne.SVG]:new Set([Oe.TITLE,Oe.FOREIGN_OBJECT,Oe.DESC]),[Ne.XLINK]:new Set,[Ne.XML]:new Set,[Ne.XMLNS]:new Set},B4=new Set([Oe.H1,Oe.H2,Oe.H3,Oe.H4,Oe.H5,Oe.H6]);ue.STYLE,ue.SCRIPT,ue.XMP,ue.IFRAME,ue.NOEMBED,ue.NOFRAMES,ue.PLAINTEXT;var $;(function(t){t[t.DATA=0]="DATA",t[t.RCDATA=1]="RCDATA",t[t.RAWTEXT=2]="RAWTEXT",t[t.SCRIPT_DATA=3]="SCRIPT_DATA",t[t.PLAINTEXT=4]="PLAINTEXT",t[t.TAG_OPEN=5]="TAG_OPEN",t[t.END_TAG_OPEN=6]="END_TAG_OPEN",t[t.TAG_NAME=7]="TAG_NAME",t[t.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",t[t.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",t[t.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",t[t.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",t[t.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",t[t.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",t[t.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",t[t.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",t[t.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",t[t.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",t[t.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",t[t.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",t[t.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",t[t.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",t[t.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",t[t.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",t[t.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",t[t.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",t[t.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",t[t.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",t[t.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",t[t.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",t[t.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",t[t.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",t[t.BOGUS_COMMENT=40]="BOGUS_COMMENT",t[t.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",t[t.COMMENT_START=42]="COMMENT_START",t[t.COMMENT_START_DASH=43]="COMMENT_START_DASH",t[t.COMMENT=44]="COMMENT",t[t.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",t[t.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",t[t.COMMENT_END_DASH=49]="COMMENT_END_DASH",t[t.COMMENT_END=50]="COMMENT_END",t[t.COMMENT_END_BANG=51]="COMMENT_END_BANG",t[t.DOCTYPE=52]="DOCTYPE",t[t.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",t[t.DOCTYPE_NAME=54]="DOCTYPE_NAME",t[t.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",t[t.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",t[t.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",t[t.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",t[t.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",t[t.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",t[t.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",t[t.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",t[t.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",t[t.CDATA_SECTION=68]="CDATA_SECTION",t[t.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",t[t.CDATA_SECTION_END=70]="CDATA_SECTION_END",t[t.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",t[t.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})($||($={}));const mr={DATA:$.DATA,RCDATA:$.RCDATA,RAWTEXT:$.RAWTEXT,SCRIPT_DATA:$.SCRIPT_DATA,PLAINTEXT:$.PLAINTEXT,CDATA_SECTION:$.CDATA_SECTION};function RX(t){return t>=U.DIGIT_0&&t<=U.DIGIT_9}function vf(t){return t>=U.LATIN_CAPITAL_A&&t<=U.LATIN_CAPITAL_Z}function DX(t){return t>=U.LATIN_SMALL_A&&t<=U.LATIN_SMALL_Z}function Sl(t){return DX(t)||vf(t)}function Fk(t){return Sl(t)||RX(t)}function Om(t){return t+32}function xO(t){return t===U.SPACE||t===U.LINE_FEED||t===U.TABULATION||t===U.FORM_FEED}function Hk(t){return xO(t)||t===U.SOLIDUS||t===U.GREATER_THAN_SIGN}function IX(t){return t===U.NULL?ve.nullCharacterReference:t>1114111?ve.characterReferenceOutsideUnicodeRange:vO(t)?ve.surrogateCharacterReference:EO(t)?ve.noncharacterCharacterReference:yO(t)||t===U.CARRIAGE_RETURN?ve.controlCharacterReference:null}class LX{constructor(e,n){this.options=e,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=$.DATA,this.returnState=$.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new EX(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new AX(_X,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(ve.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(ve.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const i=IX(r);i&&this._err(i,1)}}:void 0)}_err(e,n=0){var r,i;(i=(r=this.handler).onParseError)===null||i===void 0||i.call(r,this.preprocessor.getError(e,n))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e==null||e())}write(e,n,r){this.active=!0,this.preprocessor.write(e,n),this._runParsingLoop(),this.paused||r==null||r()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let n=0;n<e;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,n){return this.preprocessor.startsWith(e,n)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:Pt.START_TAG,tagName:"",tagID:T.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:Pt.END_TAG,tagName:"",tagID:T.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:Pt.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:Pt.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,n){this.currentCharacterToken={type:e,chars:n,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e,n;const r=this.currentToken;if(_O(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const i=(e=(n=r.location).attrs)!==null&&e!==void 0?e:n.attrs=Object.create(null);i[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(ve.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const e=this.currentToken;this.prepareToken(e),e.tagID=Gd(e.tagName),e.type===Pt.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(ve.endTagWithAttributes),e.selfClosing&&this._err(ve.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case Pt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Pt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Pt.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:Pt.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,n)}_emitCodePoint(e){const n=xO(e)?Pt.WHITESPACE_CHARACTER:e===U.NULL?Pt.NULL_CHARACTER:Pt.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(Pt.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=$.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?bo.Attribute:bo.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===$.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===$.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===$.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case $.DATA:{this._stateData(e);break}case $.RCDATA:{this._stateRcdata(e);break}case $.RAWTEXT:{this._stateRawtext(e);break}case $.SCRIPT_DATA:{this._stateScriptData(e);break}case $.PLAINTEXT:{this._statePlaintext(e);break}case $.TAG_OPEN:{this._stateTagOpen(e);break}case $.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case $.TAG_NAME:{this._stateTagName(e);break}case $.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case $.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case $.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case $.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case $.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case $.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case $.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case $.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case $.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case $.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case $.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case $.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case $.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case $.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case $.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case $.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case $.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case $.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case $.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case $.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case $.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case $.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case $.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case $.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case $.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case $.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case $.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case $.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case $.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case $.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case $.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case $.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case $.BOGUS_COMMENT:{this._stateBogusComment(e);break}case $.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case $.COMMENT_START:{this._stateCommentStart(e);break}case $.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case $.COMMENT:{this._stateComment(e);break}case $.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case $.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case $.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case $.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case $.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case $.COMMENT_END:{this._stateCommentEnd(e);break}case $.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case $.DOCTYPE:{this._stateDoctype(e);break}case $.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case $.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case $.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case $.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case $.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case $.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case $.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case $.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case $.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case $.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case $.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case $.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case $.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case $.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case $.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case $.CDATA_SECTION:{this._stateCdataSection(e);break}case $.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case $.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case $.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case $.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case U.LESS_THAN_SIGN:{this.state=$.TAG_OPEN;break}case U.AMPERSAND:{this._startCharacterReference();break}case U.NULL:{this._err(ve.unexpectedNullCharacter),this._emitCodePoint(e);break}case U.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case U.AMPERSAND:{this._startCharacterReference();break}case U.LESS_THAN_SIGN:{this.state=$.RCDATA_LESS_THAN_SIGN;break}case U.NULL:{this._err(ve.unexpectedNullCharacter),this._emitChars(jn);break}case U.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case U.LESS_THAN_SIGN:{this.state=$.RAWTEXT_LESS_THAN_SIGN;break}case U.NULL:{this._err(ve.unexpectedNullCharacter),this._emitChars(jn);break}case U.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case U.LESS_THAN_SIGN:{this.state=$.SCRIPT_DATA_LESS_THAN_SIGN;break}case U.NULL:{this._err(ve.unexpectedNullCharacter),this._emitChars(jn);break}case U.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case U.NULL:{this._err(ve.unexpectedNullCharacter),this._emitChars(jn);break}case U.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(Sl(e))this._createStartTagToken(),this.state=$.TAG_NAME,this._stateTagName(e);else switch(e){case U.EXCLAMATION_MARK:{this.state=$.MARKUP_DECLARATION_OPEN;break}case U.SOLIDUS:{this.state=$.END_TAG_OPEN;break}case U.QUESTION_MARK:{this._err(ve.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=$.BOGUS_COMMENT,this._stateBogusComment(e);break}case U.EOF:{this._err(ve.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(ve.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=$.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(Sl(e))this._createEndTagToken(),this.state=$.TAG_NAME,this._stateTagName(e);else switch(e){case U.GREATER_THAN_SIGN:{this._err(ve.missingEndTagName),this.state=$.DATA;break}case U.EOF:{this._err(ve.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(ve.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=$.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const n=this.currentToken;switch(e){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:{this.state=$.BEFORE_ATTRIBUTE_NAME;break}case U.SOLIDUS:{this.state=$.SELF_CLOSING_START_TAG;break}case U.GREATER_THAN_SIGN:{this.state=$.DATA,this.emitCurrentTagToken();break}case U.NULL:{this._err(ve.unexpectedNullCharacter),n.tagName+=jn;break}case U.EOF:{this._err(ve.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(vf(e)?Om(e):e)}}_stateRcdataLessThanSign(e){e===U.SOLIDUS?this.state=$.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=$.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){Sl(e)?(this.state=$.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=$.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=$.BEFORE_ATTRIBUTE_NAME,!1;case U.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=$.SELF_CLOSING_START_TAG,!1;case U.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=$.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=$.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===U.SOLIDUS?this.state=$.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=$.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){Sl(e)?(this.state=$.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=$.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=$.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case U.SOLIDUS:{this.state=$.SCRIPT_DATA_END_TAG_OPEN;break}case U.EXCLAMATION_MARK:{this.state=$.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=$.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){Sl(e)?(this.state=$.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=$.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=$.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===U.HYPHEN_MINUS?(this.state=$.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=$.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===U.HYPHEN_MINUS?(this.state=$.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=$.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case U.HYPHEN_MINUS:{this.state=$.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case U.LESS_THAN_SIGN:{this.state=$.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case U.NULL:{this._err(ve.unexpectedNullCharacter),this._emitChars(jn);break}case U.EOF:{this._err(ve.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case U.HYPHEN_MINUS:{this.state=$.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case U.LESS_THAN_SIGN:{this.state=$.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case U.NULL:{this._err(ve.unexpectedNullCharacter),this.state=$.SCRIPT_DATA_ESCAPED,this._emitChars(jn);break}case U.EOF:{this._err(ve.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=$.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case U.HYPHEN_MINUS:{this._emitChars("-");break}case U.LESS_THAN_SIGN:{this.state=$.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case U.GREATER_THAN_SIGN:{this.state=$.SCRIPT_DATA,this._emitChars(">");break}case U.NULL:{this._err(ve.unexpectedNullCharacter),this.state=$.SCRIPT_DATA_ESCAPED,this._emitChars(jn);break}case U.EOF:{this._err(ve.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=$.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===U.SOLIDUS?this.state=$.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Sl(e)?(this._emitChars("<"),this.state=$.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=$.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){Sl(e)?(this.state=$.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=$.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=$.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(Bi.SCRIPT,!1)&&Hk(this.preprocessor.peek(Bi.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<Bi.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=$.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case U.HYPHEN_MINUS:{this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case U.LESS_THAN_SIGN:{this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case U.NULL:{this._err(ve.unexpectedNullCharacter),this._emitChars(jn);break}case U.EOF:{this._err(ve.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case U.HYPHEN_MINUS:{this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case U.LESS_THAN_SIGN:{this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case U.NULL:{this._err(ve.unexpectedNullCharacter),this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(jn);break}case U.EOF:{this._err(ve.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case U.HYPHEN_MINUS:{this._emitChars("-");break}case U.LESS_THAN_SIGN:{this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case U.GREATER_THAN_SIGN:{this.state=$.SCRIPT_DATA,this._emitChars(">");break}case U.NULL:{this._err(ve.unexpectedNullCharacter),this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(jn);break}case U.EOF:{this._err(ve.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===U.SOLIDUS?(this.state=$.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Bi.SCRIPT,!1)&&Hk(this.preprocessor.peek(Bi.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<Bi.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=$.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:break;case U.SOLIDUS:case U.GREATER_THAN_SIGN:case U.EOF:{this.state=$.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case U.EQUALS_SIGN:{this._err(ve.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=$.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=$.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:case U.SOLIDUS:case U.GREATER_THAN_SIGN:case U.EOF:{this._leaveAttrName(),this.state=$.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case U.EQUALS_SIGN:{this._leaveAttrName(),this.state=$.BEFORE_ATTRIBUTE_VALUE;break}case U.QUOTATION_MARK:case U.APOSTROPHE:case U.LESS_THAN_SIGN:{this._err(ve.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break}case U.NULL:{this._err(ve.unexpectedNullCharacter),this.currentAttr.name+=jn;break}default:this.currentAttr.name+=String.fromCodePoint(vf(e)?Om(e):e)}}_stateAfterAttributeName(e){switch(e){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:break;case U.SOLIDUS:{this.state=$.SELF_CLOSING_START_TAG;break}case U.EQUALS_SIGN:{this.state=$.BEFORE_ATTRIBUTE_VALUE;break}case U.GREATER_THAN_SIGN:{this.state=$.DATA,this.emitCurrentTagToken();break}case U.EOF:{this._err(ve.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=$.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:break;case U.QUOTATION_MARK:{this.state=$.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case U.APOSTROPHE:{this.state=$.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case U.GREATER_THAN_SIGN:{this._err(ve.missingAttributeValue),this.state=$.DATA,this.emitCurrentTagToken();break}default:this.state=$.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case U.QUOTATION_MARK:{this.state=$.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case U.AMPERSAND:{this._startCharacterReference();break}case U.NULL:{this._err(ve.unexpectedNullCharacter),this.currentAttr.value+=jn;break}case U.EOF:{this._err(ve.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case U.APOSTROPHE:{this.state=$.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case U.AMPERSAND:{this._startCharacterReference();break}case U.NULL:{this._err(ve.unexpectedNullCharacter),this.currentAttr.value+=jn;break}case U.EOF:{this._err(ve.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:{this._leaveAttrValue(),this.state=$.BEFORE_ATTRIBUTE_NAME;break}case U.AMPERSAND:{this._startCharacterReference();break}case U.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=$.DATA,this.emitCurrentTagToken();break}case U.NULL:{this._err(ve.unexpectedNullCharacter),this.currentAttr.value+=jn;break}case U.QUOTATION_MARK:case U.APOSTROPHE:case U.LESS_THAN_SIGN:case U.EQUALS_SIGN:case U.GRAVE_ACCENT:{this._err(ve.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break}case U.EOF:{this._err(ve.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:{this._leaveAttrValue(),this.state=$.BEFORE_ATTRIBUTE_NAME;break}case U.SOLIDUS:{this._leaveAttrValue(),this.state=$.SELF_CLOSING_START_TAG;break}case U.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=$.DATA,this.emitCurrentTagToken();break}case U.EOF:{this._err(ve.eofInTag),this._emitEOFToken();break}default:this._err(ve.missingWhitespaceBetweenAttributes),this.state=$.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case U.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=$.DATA,this.emitCurrentTagToken();break}case U.EOF:{this._err(ve.eofInTag),this._emitEOFToken();break}default:this._err(ve.unexpectedSolidusInTag),this.state=$.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){const n=this.currentToken;switch(e){case U.GREATER_THAN_SIGN:{this.state=$.DATA,this.emitCurrentComment(n);break}case U.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case U.NULL:{this._err(ve.unexpectedNullCharacter),n.data+=jn;break}default:n.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(Bi.DASH_DASH,!0)?(this._createCommentToken(Bi.DASH_DASH.length+1),this.state=$.COMMENT_START):this._consumeSequenceIfMatch(Bi.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Bi.DOCTYPE.length+1),this.state=$.DOCTYPE):this._consumeSequenceIfMatch(Bi.CDATA_START,!0)?this.inForeignNode?this.state=$.CDATA_SECTION:(this._err(ve.cdataInHtmlContent),this._createCommentToken(Bi.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=$.BOGUS_COMMENT):this._ensureHibernation()||(this._err(ve.incorrectlyOpenedComment),this._createCommentToken(2),this.state=$.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case U.HYPHEN_MINUS:{this.state=$.COMMENT_START_DASH;break}case U.GREATER_THAN_SIGN:{this._err(ve.abruptClosingOfEmptyComment),this.state=$.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=$.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){const n=this.currentToken;switch(e){case U.HYPHEN_MINUS:{this.state=$.COMMENT_END;break}case U.GREATER_THAN_SIGN:{this._err(ve.abruptClosingOfEmptyComment),this.state=$.DATA,this.emitCurrentComment(n);break}case U.EOF:{this._err(ve.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=$.COMMENT,this._stateComment(e)}}_stateComment(e){const n=this.currentToken;switch(e){case U.HYPHEN_MINUS:{this.state=$.COMMENT_END_DASH;break}case U.LESS_THAN_SIGN:{n.data+="<",this.state=$.COMMENT_LESS_THAN_SIGN;break}case U.NULL:{this._err(ve.unexpectedNullCharacter),n.data+=jn;break}case U.EOF:{this._err(ve.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){const n=this.currentToken;switch(e){case U.EXCLAMATION_MARK:{n.data+="!",this.state=$.COMMENT_LESS_THAN_SIGN_BANG;break}case U.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=$.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===U.HYPHEN_MINUS?this.state=$.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=$.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===U.HYPHEN_MINUS?this.state=$.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=$.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==U.GREATER_THAN_SIGN&&e!==U.EOF&&this._err(ve.nestedComment),this.state=$.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){const n=this.currentToken;switch(e){case U.HYPHEN_MINUS:{this.state=$.COMMENT_END;break}case U.EOF:{this._err(ve.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=$.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){const n=this.currentToken;switch(e){case U.GREATER_THAN_SIGN:{this.state=$.DATA,this.emitCurrentComment(n);break}case U.EXCLAMATION_MARK:{this.state=$.COMMENT_END_BANG;break}case U.HYPHEN_MINUS:{n.data+="-";break}case U.EOF:{this._err(ve.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=$.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){const n=this.currentToken;switch(e){case U.HYPHEN_MINUS:{n.data+="--!",this.state=$.COMMENT_END_DASH;break}case U.GREATER_THAN_SIGN:{this._err(ve.incorrectlyClosedComment),this.state=$.DATA,this.emitCurrentComment(n);break}case U.EOF:{this._err(ve.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=$.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:{this.state=$.BEFORE_DOCTYPE_NAME;break}case U.GREATER_THAN_SIGN:{this.state=$.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break}case U.EOF:{this._err(ve.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ve.missingWhitespaceBeforeDoctypeName),this.state=$.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(vf(e))this._createDoctypeToken(String.fromCharCode(Om(e))),this.state=$.DOCTYPE_NAME;else switch(e){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:break;case U.NULL:{this._err(ve.unexpectedNullCharacter),this._createDoctypeToken(jn),this.state=$.DOCTYPE_NAME;break}case U.GREATER_THAN_SIGN:{this._err(ve.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=$.DATA;break}case U.EOF:{this._err(ve.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=$.DOCTYPE_NAME}}_stateDoctypeName(e){const n=this.currentToken;switch(e){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:{this.state=$.AFTER_DOCTYPE_NAME;break}case U.GREATER_THAN_SIGN:{this.state=$.DATA,this.emitCurrentDoctype(n);break}case U.NULL:{this._err(ve.unexpectedNullCharacter),n.name+=jn;break}case U.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(vf(e)?Om(e):e)}}_stateAfterDoctypeName(e){const n=this.currentToken;switch(e){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:break;case U.GREATER_THAN_SIGN:{this.state=$.DATA,this.emitCurrentDoctype(n);break}case U.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Bi.PUBLIC,!1)?this.state=$.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Bi.SYSTEM,!1)?this.state=$.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(ve.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=$.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){const n=this.currentToken;switch(e){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:{this.state=$.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case U.QUOTATION_MARK:{this._err(ve.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=$.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case U.APOSTROPHE:{this._err(ve.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=$.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case U.GREATER_THAN_SIGN:{this._err(ve.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=$.DATA,this.emitCurrentDoctype(n);break}case U.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ve.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=$.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:break;case U.QUOTATION_MARK:{n.publicId="",this.state=$.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case U.APOSTROPHE:{n.publicId="",this.state=$.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case U.GREATER_THAN_SIGN:{this._err(ve.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=$.DATA,this.emitCurrentDoctype(n);break}case U.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ve.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=$.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case U.QUOTATION_MARK:{this.state=$.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case U.NULL:{this._err(ve.unexpectedNullCharacter),n.publicId+=jn;break}case U.GREATER_THAN_SIGN:{this._err(ve.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=$.DATA;break}case U.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case U.APOSTROPHE:{this.state=$.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case U.NULL:{this._err(ve.unexpectedNullCharacter),n.publicId+=jn;break}case U.GREATER_THAN_SIGN:{this._err(ve.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=$.DATA;break}case U.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:{this.state=$.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case U.GREATER_THAN_SIGN:{this.state=$.DATA,this.emitCurrentDoctype(n);break}case U.QUOTATION_MARK:{this._err(ve.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=$.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case U.APOSTROPHE:{this._err(ve.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=$.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case U.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ve.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=$.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const n=this.currentToken;switch(e){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:break;case U.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=$.DATA;break}case U.QUOTATION_MARK:{n.systemId="",this.state=$.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case U.APOSTROPHE:{n.systemId="",this.state=$.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case U.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ve.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=$.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){const n=this.currentToken;switch(e){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:{this.state=$.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case U.QUOTATION_MARK:{this._err(ve.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=$.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case U.APOSTROPHE:{this._err(ve.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=$.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case U.GREATER_THAN_SIGN:{this._err(ve.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=$.DATA,this.emitCurrentDoctype(n);break}case U.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ve.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=$.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:break;case U.QUOTATION_MARK:{n.systemId="",this.state=$.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case U.APOSTROPHE:{n.systemId="",this.state=$.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case U.GREATER_THAN_SIGN:{this._err(ve.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=$.DATA,this.emitCurrentDoctype(n);break}case U.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ve.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=$.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case U.QUOTATION_MARK:{this.state=$.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case U.NULL:{this._err(ve.unexpectedNullCharacter),n.systemId+=jn;break}case U.GREATER_THAN_SIGN:{this._err(ve.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=$.DATA;break}case U.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case U.APOSTROPHE:{this.state=$.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case U.NULL:{this._err(ve.unexpectedNullCharacter),n.systemId+=jn;break}case U.GREATER_THAN_SIGN:{this._err(ve.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=$.DATA;break}case U.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:break;case U.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=$.DATA;break}case U.EOF:{this._err(ve.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ve.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=$.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){const n=this.currentToken;switch(e){case U.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=$.DATA;break}case U.NULL:{this._err(ve.unexpectedNullCharacter);break}case U.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(e){switch(e){case U.RIGHT_SQUARE_BRACKET:{this.state=$.CDATA_SECTION_BRACKET;break}case U.EOF:{this._err(ve.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===U.RIGHT_SQUARE_BRACKET?this.state=$.CDATA_SECTION_END:(this._emitChars("]"),this.state=$.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case U.GREATER_THAN_SIGN:{this.state=$.DATA;break}case U.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=$.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0)if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(U.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&Fk(this.preprocessor.peek(1))?$.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){Fk(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===U.SEMICOLON&&this._err(ve.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}}const TO=new Set([T.DD,T.DT,T.LI,T.OPTGROUP,T.OPTION,T.P,T.RB,T.RP,T.RT,T.RTC]),jk=new Set([...TO,T.CAPTION,T.COLGROUP,T.TBODY,T.TD,T.TFOOT,T.TH,T.THEAD,T.TR]),Hg=new Set([T.APPLET,T.CAPTION,T.HTML,T.MARQUEE,T.OBJECT,T.TABLE,T.TD,T.TEMPLATE,T.TH]),PX=new Set([...Hg,T.OL,T.UL]),BX=new Set([...Hg,T.BUTTON]),$k=new Set([T.ANNOTATION_XML,T.MI,T.MN,T.MO,T.MS,T.MTEXT]),qk=new Set([T.DESC,T.FOREIGN_OBJECT,T.TITLE]),zX=new Set([T.TR,T.TEMPLATE,T.HTML]),UX=new Set([T.TBODY,T.TFOOT,T.THEAD,T.TEMPLATE,T.HTML]),FX=new Set([T.TABLE,T.TEMPLATE,T.HTML]),HX=new Set([T.TD,T.TH]);class jX{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=T.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===T.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Ne.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,n){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,n,!0)}pop(){const e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,n){const r=this._indexOf(e);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(e,n,r){const i=this._indexOf(e)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(e){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(e,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==Ne.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(e){for(;this.stackTop>=e;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<e)}}popUntilElementPopped(e){const n=this._indexOf(e);this.shortenToLength(Math.max(n,0))}popUntilPopped(e,n){const r=this._indexOfTagNames(e,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(B4,Ne.HTML)}popUntilTableCellPopped(){this.popUntilPopped(HX,Ne.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,n){for(let r=this.stackTop;r>=0;r--)if(e.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(e,n){const r=this._indexOfTagNames(e,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(FX,Ne.HTML)}clearBackToTableBodyContext(){this.clearBackTo(UX,Ne.HTML)}clearBackToTableRowContext(){this.clearBackTo(zX,Ne.HTML)}remove(e){const n=this._indexOf(e);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===T.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const n=this._indexOf(e)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===T.HTML}hasInDynamicScope(e,n){for(let r=this.stackTop;r>=0;r--){const i=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case Ne.HTML:{if(i===e)return!0;if(n.has(i))return!1;break}case Ne.SVG:{if(qk.has(i))return!1;break}case Ne.MATHML:{if($k.has(i))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,Hg)}hasInListItemScope(e){return this.hasInDynamicScope(e,PX)}hasInButtonScope(e){return this.hasInDynamicScope(e,BX)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const n=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case Ne.HTML:{if(B4.has(n))return!0;if(Hg.has(n))return!1;break}case Ne.SVG:{if(qk.has(n))return!1;break}case Ne.MATHML:{if($k.has(n))return!1;break}}}return!0}hasInTableScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Ne.HTML)switch(this.tagIDs[n]){case e:return!0;case T.TABLE:case T.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===Ne.HTML)switch(this.tagIDs[e]){case T.TBODY:case T.THEAD:case T.TFOOT:return!0;case T.TABLE:case T.HTML:return!1}return!0}hasInSelectScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Ne.HTML)switch(this.tagIDs[n]){case e:return!0;case T.OPTION:case T.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&TO.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&jk.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&jk.has(this.currentTagId);)this.pop()}}const G2=3;var ma;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})(ma||(ma={}));const Vk={type:ma.Marker};class $X{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,n){const r=[],i=n.length,s=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let l=0;l<this.entries.length;l++){const u=this.entries[l];if(u.type===ma.Marker)break;const{element:d}=u;if(this.treeAdapter.getTagName(d)===s&&this.treeAdapter.getNamespaceURI(d)===a){const f=this.treeAdapter.getAttrList(d);f.length===i&&r.push({idx:l,attrs:f})}}return r}_ensureNoahArkCondition(e){if(this.entries.length<G2)return;const n=this.treeAdapter.getAttrList(e),r=this._getNoahArkConditionCandidates(e,n);if(r.length<G2)return;const i=new Map(n.map(a=>[a.name,a.value]));let s=0;for(let a=0;a<r.length;a++){const l=r[a];l.attrs.every(u=>i.get(u.name)===u.value)&&(s+=1,s>=G2&&this.entries.splice(l.idx,1))}}insertMarker(){this.entries.unshift(Vk)}pushElement(e,n){this._ensureNoahArkCondition(e),this.entries.unshift({type:ma.Element,element:e,token:n})}insertElementAfterBookmark(e,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:ma.Element,element:e,token:n})}removeEntry(e){const n=this.entries.indexOf(e);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const e=this.entries.indexOf(Vk);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const n=this.entries.find(r=>r.type===ma.Marker||this.treeAdapter.getTagName(r.element)===e);return n&&n.type===ma.Element?n:null}getElementEntry(e){return this.entries.find(n=>n.type===ma.Element&&n.element===e)}}const wl={createDocument(){return{nodeName:"#document",mode:Ms.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(t,e,n){return{nodeName:t,tagName:t,attrs:n,namespaceURI:e,childNodes:[],parentNode:null}},createCommentNode(t){return{nodeName:"#comment",data:t,parentNode:null}},createTextNode(t){return{nodeName:"#text",value:t,parentNode:null}},appendChild(t,e){t.childNodes.push(e),e.parentNode=t},insertBefore(t,e,n){const r=t.childNodes.indexOf(n);t.childNodes.splice(r,0,e),e.parentNode=t},setTemplateContent(t,e){t.content=e},getTemplateContent(t){return t.content},setDocumentType(t,e,n,r){const i=t.childNodes.find(s=>s.nodeName==="#documentType");if(i)i.name=e,i.publicId=n,i.systemId=r;else{const s={nodeName:"#documentType",name:e,publicId:n,systemId:r,parentNode:null};wl.appendChild(t,s)}},setDocumentMode(t,e){t.mode=e},getDocumentMode(t){return t.mode},detachNode(t){if(t.parentNode){const e=t.parentNode.childNodes.indexOf(t);t.parentNode.childNodes.splice(e,1),t.parentNode=null}},insertText(t,e){if(t.childNodes.length>0){const n=t.childNodes[t.childNodes.length-1];if(wl.isTextNode(n)){n.value+=e;return}}wl.appendChild(t,wl.createTextNode(e))},insertTextBefore(t,e,n){const r=t.childNodes[t.childNodes.indexOf(n)-1];r&&wl.isTextNode(r)?r.value+=e:wl.insertBefore(t,wl.createTextNode(e),n)},adoptAttributes(t,e){const n=new Set(t.attrs.map(r=>r.name));for(let r=0;r<e.length;r++)n.has(e[r].name)||t.attrs.push(e[r])},getFirstChild(t){return t.childNodes[0]},getChildNodes(t){return t.childNodes},getParentNode(t){return t.parentNode},getAttrList(t){return t.attrs},getTagName(t){return t.tagName},getNamespaceURI(t){return t.namespaceURI},getTextNodeContent(t){return t.value},getCommentNodeContent(t){return t.data},getDocumentTypeNodeName(t){return t.name},getDocumentTypeNodePublicId(t){return t.publicId},getDocumentTypeNodeSystemId(t){return t.systemId},isTextNode(t){return t.nodeName==="#text"},isCommentNode(t){return t.nodeName==="#comment"},isDocumentTypeNode(t){return t.nodeName==="#documentType"},isElementNode(t){return Object.prototype.hasOwnProperty.call(t,"tagName")},setNodeSourceCodeLocation(t,e){t.sourceCodeLocation=e},getNodeSourceCodeLocation(t){return t.sourceCodeLocation},updateNodeSourceCodeLocation(t,e){t.sourceCodeLocation={...t.sourceCodeLocation,...e}}},SO="html",qX="about:legacy-compat",VX="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",wO=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],GX=[...wO,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],YX=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),kO=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],WX=[...kO,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Gk(t,e){return e.some(n=>t.startsWith(n))}function KX(t){return t.name===SO&&t.publicId===null&&(t.systemId===null||t.systemId===qX)}function XX(t){if(t.name!==SO)return Ms.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===VX)return Ms.QUIRKS;let{publicId:n}=t;if(n!==null){if(n=n.toLowerCase(),YX.has(n))return Ms.QUIRKS;let r=e===null?GX:wO;if(Gk(n,r))return Ms.QUIRKS;if(r=e===null?kO:WX,Gk(n,r))return Ms.LIMITED_QUIRKS}return Ms.NO_QUIRKS}const Yk={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},QX="definitionurl",ZX="definitionURL",JX=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(t=>[t.toLowerCase(),t])),eQ=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Ne.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Ne.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Ne.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Ne.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Ne.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Ne.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Ne.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Ne.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Ne.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Ne.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Ne.XMLNS}]]),tQ=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(t=>[t.toLowerCase(),t])),nQ=new Set([T.B,T.BIG,T.BLOCKQUOTE,T.BODY,T.BR,T.CENTER,T.CODE,T.DD,T.DIV,T.DL,T.DT,T.EM,T.EMBED,T.H1,T.H2,T.H3,T.H4,T.H5,T.H6,T.HEAD,T.HR,T.I,T.IMG,T.LI,T.LISTING,T.MENU,T.META,T.NOBR,T.OL,T.P,T.PRE,T.RUBY,T.S,T.SMALL,T.SPAN,T.STRONG,T.STRIKE,T.SUB,T.SUP,T.TABLE,T.TT,T.U,T.UL,T.VAR]);function rQ(t){const e=t.tagID;return e===T.FONT&&t.attrs.some(({name:r})=>r===Hu.COLOR||r===Hu.SIZE||r===Hu.FACE)||nQ.has(e)}function CO(t){for(let e=0;e<t.attrs.length;e++)if(t.attrs[e].name===QX){t.attrs[e].name=ZX;break}}function AO(t){for(let e=0;e<t.attrs.length;e++){const n=JX.get(t.attrs[e].name);n!=null&&(t.attrs[e].name=n)}}function z_(t){for(let e=0;e<t.attrs.length;e++){const n=eQ.get(t.attrs[e].name);n&&(t.attrs[e].prefix=n.prefix,t.attrs[e].name=n.name,t.attrs[e].namespace=n.namespace)}}function iQ(t){const e=tQ.get(t.tagName);e!=null&&(t.tagName=e,t.tagID=Gd(t.tagName))}function sQ(t,e){return e===Ne.MATHML&&(t===T.MI||t===T.MO||t===T.MN||t===T.MS||t===T.MTEXT)}function aQ(t,e,n){if(e===Ne.MATHML&&t===T.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===Hu.ENCODING){const i=n[r].value.toLowerCase();return i===Yk.TEXT_HTML||i===Yk.APPLICATION_XML}}return e===Ne.SVG&&(t===T.FOREIGN_OBJECT||t===T.DESC||t===T.TITLE)}function oQ(t,e,n,r){return(!r||r===Ne.HTML)&&aQ(t,e,n)||(!r||r===Ne.MATHML)&&sQ(t,e)}const lQ="hidden",uQ=8,cQ=3;var W;(function(t){t[t.INITIAL=0]="INITIAL",t[t.BEFORE_HTML=1]="BEFORE_HTML",t[t.BEFORE_HEAD=2]="BEFORE_HEAD",t[t.IN_HEAD=3]="IN_HEAD",t[t.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",t[t.AFTER_HEAD=5]="AFTER_HEAD",t[t.IN_BODY=6]="IN_BODY",t[t.TEXT=7]="TEXT",t[t.IN_TABLE=8]="IN_TABLE",t[t.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",t[t.IN_CAPTION=10]="IN_CAPTION",t[t.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",t[t.IN_TABLE_BODY=12]="IN_TABLE_BODY",t[t.IN_ROW=13]="IN_ROW",t[t.IN_CELL=14]="IN_CELL",t[t.IN_SELECT=15]="IN_SELECT",t[t.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",t[t.IN_TEMPLATE=17]="IN_TEMPLATE",t[t.AFTER_BODY=18]="AFTER_BODY",t[t.IN_FRAMESET=19]="IN_FRAMESET",t[t.AFTER_FRAMESET=20]="AFTER_FRAMESET",t[t.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",t[t.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(W||(W={}));const dQ={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},NO=new Set([T.TABLE,T.TBODY,T.TFOOT,T.THEAD,T.TR]),Wk={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:wl,onParseError:null};let Kk=class{constructor(e,n,r=null,i=null){this.fragmentContext=r,this.scriptHandler=i,this.currentToken=null,this.stopped=!1,this.insertionMode=W.INITIAL,this.originalInsertionMode=W.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...Wk,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new LX(this.options,this),this.activeFormattingElements=new $X(this.treeAdapter),this.fragmentContextID=r?Gd(this.treeAdapter.getTagName(r)):T.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new jX(this.document,this.treeAdapter,this)}static parse(e,n){const r=new this(n);return r.tokenizer.write(e,!0),r.document}static getFragmentParser(e,n){const r={...Wk,...n};e??(e=r.treeAdapter.createElement(ue.TEMPLATE,Ne.HTML,[]));const i=r.treeAdapter.createElement("documentmock",Ne.HTML,[]),s=new this(r,i,e);return s.fragmentContextID===T.TEMPLATE&&s.tmplInsertionModeStack.unshift(W.IN_TEMPLATE),s._initTokenizerForFragmentParsing(),s._insertFakeRootElement(),s._resetInsertionMode(),s._findFormInFragmentContext(),s}getFragment(){const e=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,n),n}_err(e,n,r){var i;if(!this.onParseError)return;const s=(i=e.location)!==null&&i!==void 0?i:dQ,a={code:n,startLine:s.startLine,startCol:s.startCol,startOffset:s.startOffset,endLine:r?s.startLine:s.endLine,endCol:r?s.startCol:s.endCol,endOffset:r?s.startOffset:s.endOffset};this.onParseError(a)}onItemPush(e,n,r){var i,s;(s=(i=this.treeAdapter).onItemPush)===null||s===void 0||s.call(i,e),r&&this.openElements.stackTop>0&&this._setContextModes(e,n)}onItemPop(e,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.call(r,e,this.openElements.current),n){let s,a;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,a=this.fragmentContextID):{current:s,currentTagId:a}=this.openElements,this._setContextModes(s,a)}}_setContextModes(e,n){const r=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===Ne.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&e!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,e)}_switchToTextParsing(e,n){this._insertElement(e,Ne.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=W.TEXT}switchToPlaintextParsing(){this.insertionMode=W.TEXT,this.originalInsertionMode=W.IN_BODY,this.tokenizer.state=mr.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===ue.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Ne.HTML))switch(this.fragmentContextID){case T.TITLE:case T.TEXTAREA:{this.tokenizer.state=mr.RCDATA;break}case T.STYLE:case T.XMP:case T.IFRAME:case T.NOEMBED:case T.NOFRAMES:case T.NOSCRIPT:{this.tokenizer.state=mr.RAWTEXT;break}case T.SCRIPT:{this.tokenizer.state=mr.SCRIPT_DATA;break}case T.PLAINTEXT:{this.tokenizer.state=mr.PLAINTEXT;break}}}_setDocumentType(e){const n=e.name||"",r=e.publicId||"",i=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),e.location){const a=this.treeAdapter.getChildNodes(this.document).find(l=>this.treeAdapter.isDocumentTypeNode(l));a&&this.treeAdapter.setNodeSourceCodeLocation(a,e.location)}}_attachElementToTree(e,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(e,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,e)}}_appendElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location)}_insertElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location),this.openElements.push(r,e.tagID)}_insertFakeElement(e,n){const r=this.treeAdapter.createElement(e,Ne.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(e){const n=this.treeAdapter.createElement(e.tagName,Ne.HTML,e.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const e=this.treeAdapter.createElement(ue.HTML,Ne.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,T.HTML)}_appendCommentNode(e,n){const r=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,e.location)}_insertCharacters(e){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,e.chars,r):this.treeAdapter.insertText(n,e.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,e.chars)),!e.location)return;const i=this.treeAdapter.getChildNodes(n),s=r?i.lastIndexOf(r):i.length,a=i[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(a)){const{endLine:u,endCol:d,endOffset:f}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(a,{endLine:u,endCol:d,endOffset:f})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,e.location)}_adoptNodes(e,n){for(let r=this.treeAdapter.getFirstChild(e);r;r=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(e,n){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&n.location){const r=n.location,i=this.treeAdapter.getTagName(e),s=n.type===Pt.END_TAG&&i===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,s)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,e.tagID===T.SVG&&this.treeAdapter.getTagName(n)===ue.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Ne.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===T.MGLYPH||e.tagID===T.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,Ne.HTML)}_processToken(e){switch(e.type){case Pt.CHARACTER:{this.onCharacter(e);break}case Pt.NULL_CHARACTER:{this.onNullCharacter(e);break}case Pt.COMMENT:{this.onComment(e);break}case Pt.DOCTYPE:{this.onDoctype(e);break}case Pt.START_TAG:{this._processStartTag(e);break}case Pt.END_TAG:{this.onEndTag(e);break}case Pt.EOF:{this.onEof(e);break}case Pt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,n,r){const i=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return oQ(e,i,s,r)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===ma.Marker||this.openElements.contains(i.element)),r=n===-1?e-1:n-1;for(let i=r;i>=0;i--){const s=this.activeFormattingElements.entries[i];this._insertElement(s.token,this.treeAdapter.getNamespaceURI(s.element)),s.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=W.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(T.P),this.openElements.popUntilTagNamePopped(T.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case T.TR:{this.insertionMode=W.IN_ROW;return}case T.TBODY:case T.THEAD:case T.TFOOT:{this.insertionMode=W.IN_TABLE_BODY;return}case T.CAPTION:{this.insertionMode=W.IN_CAPTION;return}case T.COLGROUP:{this.insertionMode=W.IN_COLUMN_GROUP;return}case T.TABLE:{this.insertionMode=W.IN_TABLE;return}case T.BODY:{this.insertionMode=W.IN_BODY;return}case T.FRAMESET:{this.insertionMode=W.IN_FRAMESET;return}case T.SELECT:{this._resetInsertionModeForSelect(e);return}case T.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case T.HTML:{this.insertionMode=this.headElement?W.AFTER_HEAD:W.BEFORE_HEAD;return}case T.TD:case T.TH:{if(e>0){this.insertionMode=W.IN_CELL;return}break}case T.HEAD:{if(e>0){this.insertionMode=W.IN_HEAD;return}break}}this.insertionMode=W.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let n=e-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===T.TEMPLATE)break;if(r===T.TABLE){this.insertionMode=W.IN_SELECT_IN_TABLE;return}}this.insertionMode=W.IN_SELECT}_isElementCausesFosterParenting(e){return NO.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){const n=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case T.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===Ne.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case T.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,e,n.beforeElement):this.treeAdapter.appendChild(n.parent,e)}_isSpecialElement(e,n){const r=this.treeAdapter.getNamespaceURI(e);return MX[r].has(n)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){HZ(this,e);return}switch(this.insertionMode){case W.INITIAL:{tf(this,e);break}case W.BEFORE_HTML:{zf(this,e);break}case W.BEFORE_HEAD:{Uf(this,e);break}case W.IN_HEAD:{Ff(this,e);break}case W.IN_HEAD_NO_SCRIPT:{Hf(this,e);break}case W.AFTER_HEAD:{jf(this,e);break}case W.IN_BODY:case W.IN_CAPTION:case W.IN_CELL:case W.IN_TEMPLATE:{MO(this,e);break}case W.TEXT:case W.IN_SELECT:case W.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case W.IN_TABLE:case W.IN_TABLE_BODY:case W.IN_ROW:{Y2(this,e);break}case W.IN_TABLE_TEXT:{BO(this,e);break}case W.IN_COLUMN_GROUP:{jg(this,e);break}case W.AFTER_BODY:{$g(this,e);break}case W.AFTER_AFTER_BODY:{xg(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){FZ(this,e);return}switch(this.insertionMode){case W.INITIAL:{tf(this,e);break}case W.BEFORE_HTML:{zf(this,e);break}case W.BEFORE_HEAD:{Uf(this,e);break}case W.IN_HEAD:{Ff(this,e);break}case W.IN_HEAD_NO_SCRIPT:{Hf(this,e);break}case W.AFTER_HEAD:{jf(this,e);break}case W.TEXT:{this._insertCharacters(e);break}case W.IN_TABLE:case W.IN_TABLE_BODY:case W.IN_ROW:{Y2(this,e);break}case W.IN_COLUMN_GROUP:{jg(this,e);break}case W.AFTER_BODY:{$g(this,e);break}case W.AFTER_AFTER_BODY:{xg(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){z4(this,e);return}switch(this.insertionMode){case W.INITIAL:case W.BEFORE_HTML:case W.BEFORE_HEAD:case W.IN_HEAD:case W.IN_HEAD_NO_SCRIPT:case W.AFTER_HEAD:case W.IN_BODY:case W.IN_TABLE:case W.IN_CAPTION:case W.IN_COLUMN_GROUP:case W.IN_TABLE_BODY:case W.IN_ROW:case W.IN_CELL:case W.IN_SELECT:case W.IN_SELECT_IN_TABLE:case W.IN_TEMPLATE:case W.IN_FRAMESET:case W.AFTER_FRAMESET:{z4(this,e);break}case W.IN_TABLE_TEXT:{nf(this,e);break}case W.AFTER_BODY:{vQ(this,e);break}case W.AFTER_AFTER_BODY:case W.AFTER_AFTER_FRAMESET:{yQ(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case W.INITIAL:{EQ(this,e);break}case W.BEFORE_HEAD:case W.IN_HEAD:case W.IN_HEAD_NO_SCRIPT:case W.AFTER_HEAD:{this._err(e,ve.misplacedDoctype);break}case W.IN_TABLE_TEXT:{nf(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,ve.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?jZ(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case W.INITIAL:{tf(this,e);break}case W.BEFORE_HTML:{_Q(this,e);break}case W.BEFORE_HEAD:{TQ(this,e);break}case W.IN_HEAD:{ta(this,e);break}case W.IN_HEAD_NO_SCRIPT:{kQ(this,e);break}case W.AFTER_HEAD:{AQ(this,e);break}case W.IN_BODY:{di(this,e);break}case W.IN_TABLE:{wd(this,e);break}case W.IN_TABLE_TEXT:{nf(this,e);break}case W.IN_CAPTION:{SZ(this,e);break}case W.IN_COLUMN_GROUP:{H_(this,e);break}case W.IN_TABLE_BODY:{wb(this,e);break}case W.IN_ROW:{kb(this,e);break}case W.IN_CELL:{CZ(this,e);break}case W.IN_SELECT:{FO(this,e);break}case W.IN_SELECT_IN_TABLE:{NZ(this,e);break}case W.IN_TEMPLATE:{MZ(this,e);break}case W.AFTER_BODY:{DZ(this,e);break}case W.IN_FRAMESET:{IZ(this,e);break}case W.AFTER_FRAMESET:{PZ(this,e);break}case W.AFTER_AFTER_BODY:{zZ(this,e);break}case W.AFTER_AFTER_FRAMESET:{UZ(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?$Z(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case W.INITIAL:{tf(this,e);break}case W.BEFORE_HTML:{xQ(this,e);break}case W.BEFORE_HEAD:{SQ(this,e);break}case W.IN_HEAD:{wQ(this,e);break}case W.IN_HEAD_NO_SCRIPT:{CQ(this,e);break}case W.AFTER_HEAD:{NQ(this,e);break}case W.IN_BODY:{Sb(this,e);break}case W.TEXT:{pZ(this,e);break}case W.IN_TABLE:{uh(this,e);break}case W.IN_TABLE_TEXT:{nf(this,e);break}case W.IN_CAPTION:{wZ(this,e);break}case W.IN_COLUMN_GROUP:{kZ(this,e);break}case W.IN_TABLE_BODY:{U4(this,e);break}case W.IN_ROW:{UO(this,e);break}case W.IN_CELL:{AZ(this,e);break}case W.IN_SELECT:{HO(this,e);break}case W.IN_SELECT_IN_TABLE:{OZ(this,e);break}case W.IN_TEMPLATE:{RZ(this,e);break}case W.AFTER_BODY:{$O(this,e);break}case W.IN_FRAMESET:{LZ(this,e);break}case W.AFTER_FRAMESET:{BZ(this,e);break}case W.AFTER_AFTER_BODY:{xg(this,e);break}}}onEof(e){switch(this.insertionMode){case W.INITIAL:{tf(this,e);break}case W.BEFORE_HTML:{zf(this,e);break}case W.BEFORE_HEAD:{Uf(this,e);break}case W.IN_HEAD:{Ff(this,e);break}case W.IN_HEAD_NO_SCRIPT:{Hf(this,e);break}case W.AFTER_HEAD:{jf(this,e);break}case W.IN_BODY:case W.IN_TABLE:case W.IN_CAPTION:case W.IN_COLUMN_GROUP:case W.IN_TABLE_BODY:case W.IN_ROW:case W.IN_CELL:case W.IN_SELECT:case W.IN_SELECT_IN_TABLE:{LO(this,e);break}case W.TEXT:{mZ(this,e);break}case W.IN_TABLE_TEXT:{nf(this,e);break}case W.IN_TEMPLATE:{jO(this,e);break}case W.AFTER_BODY:case W.IN_FRAMESET:case W.AFTER_FRAMESET:case W.AFTER_AFTER_BODY:case W.AFTER_AFTER_FRAMESET:{F_(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===U.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case W.IN_HEAD:case W.IN_HEAD_NO_SCRIPT:case W.AFTER_HEAD:case W.TEXT:case W.IN_COLUMN_GROUP:case W.IN_SELECT:case W.IN_SELECT_IN_TABLE:case W.IN_FRAMESET:case W.AFTER_FRAMESET:{this._insertCharacters(e);break}case W.IN_BODY:case W.IN_CAPTION:case W.IN_CELL:case W.IN_TEMPLATE:case W.AFTER_BODY:case W.AFTER_AFTER_BODY:case W.AFTER_AFTER_FRAMESET:{OO(this,e);break}case W.IN_TABLE:case W.IN_TABLE_BODY:case W.IN_ROW:{Y2(this,e);break}case W.IN_TABLE_TEXT:{PO(this,e);break}}}};function fQ(t,e){let n=t.activeFormattingElements.getElementEntryInScopeWithTagName(e.tagName);return n?t.openElements.contains(n.element)?t.openElements.hasInScope(e.tagID)||(n=null):(t.activeFormattingElements.removeEntry(n),n=null):IO(t,e),n}function hQ(t,e){let n=null,r=t.openElements.stackTop;for(;r>=0;r--){const i=t.openElements.items[r];if(i===e.element)break;t._isSpecialElement(i,t.openElements.tagIDs[r])&&(n=i)}return n||(t.openElements.shortenToLength(Math.max(r,0)),t.activeFormattingElements.removeEntry(e)),n}function pQ(t,e,n){let r=e,i=t.openElements.getCommonAncestor(e);for(let s=0,a=i;a!==n;s++,a=i){i=t.openElements.getCommonAncestor(a);const l=t.activeFormattingElements.getElementEntry(a),u=l&&s>=cQ;!l||u?(u&&t.activeFormattingElements.removeEntry(l),t.openElements.remove(a)):(a=mQ(t,l),r===e&&(t.activeFormattingElements.bookmark=l),t.treeAdapter.detachNode(r),t.treeAdapter.appendChild(a,r),r=a)}return r}function mQ(t,e){const n=t.treeAdapter.getNamespaceURI(e.element),r=t.treeAdapter.createElement(e.token.tagName,n,e.token.attrs);return t.openElements.replace(e.element,r),e.element=r,r}function gQ(t,e,n){const r=t.treeAdapter.getTagName(e),i=Gd(r);if(t._isElementCausesFosterParenting(i))t._fosterParentElement(n);else{const s=t.treeAdapter.getNamespaceURI(e);i===T.TEMPLATE&&s===Ne.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,n)}}function bQ(t,e,n){const r=t.treeAdapter.getNamespaceURI(n.element),{token:i}=n,s=t.treeAdapter.createElement(i.tagName,r,i.attrs);t._adoptNodes(e,s),t.treeAdapter.appendChild(e,s),t.activeFormattingElements.insertElementAfterBookmark(s,i),t.activeFormattingElements.removeEntry(n),t.openElements.remove(n.element),t.openElements.insertAfter(e,s,i.tagID)}function U_(t,e){for(let n=0;n<uQ;n++){const r=fQ(t,e);if(!r)break;const i=hQ(t,r);if(!i)break;t.activeFormattingElements.bookmark=r;const s=pQ(t,i,r.element),a=t.openElements.getCommonAncestor(r.element);t.treeAdapter.detachNode(s),a&&gQ(t,a,s),bQ(t,i,r)}}function z4(t,e){t._appendCommentNode(e,t.openElements.currentTmplContentOrNode)}function vQ(t,e){t._appendCommentNode(e,t.openElements.items[0])}function yQ(t,e){t._appendCommentNode(e,t.document)}function F_(t,e){if(t.stopped=!0,e.location){const n=t.fragmentContext?0:2;for(let r=t.openElements.stackTop;r>=n;r--)t._setEndLocation(t.openElements.items[r],e);if(!t.fragmentContext&&t.openElements.stackTop>=0){const r=t.openElements.items[0],i=t.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(t._setEndLocation(r,e),t.openElements.stackTop>=1)){const s=t.openElements.items[1],a=t.treeAdapter.getNodeSourceCodeLocation(s);a&&!a.endTag&&t._setEndLocation(s,e)}}}}function EQ(t,e){t._setDocumentType(e);const n=e.forceQuirks?Ms.QUIRKS:XX(e);KX(e)||t._err(e,ve.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,n),t.insertionMode=W.BEFORE_HTML}function tf(t,e){t._err(e,ve.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,Ms.QUIRKS),t.insertionMode=W.BEFORE_HTML,t._processToken(e)}function _Q(t,e){e.tagID===T.HTML?(t._insertElement(e,Ne.HTML),t.insertionMode=W.BEFORE_HEAD):zf(t,e)}function xQ(t,e){const n=e.tagID;(n===T.HTML||n===T.HEAD||n===T.BODY||n===T.BR)&&zf(t,e)}function zf(t,e){t._insertFakeRootElement(),t.insertionMode=W.BEFORE_HEAD,t._processToken(e)}function TQ(t,e){switch(e.tagID){case T.HTML:{di(t,e);break}case T.HEAD:{t._insertElement(e,Ne.HTML),t.headElement=t.openElements.current,t.insertionMode=W.IN_HEAD;break}default:Uf(t,e)}}function SQ(t,e){const n=e.tagID;n===T.HEAD||n===T.BODY||n===T.HTML||n===T.BR?Uf(t,e):t._err(e,ve.endTagWithoutMatchingOpenElement)}function Uf(t,e){t._insertFakeElement(ue.HEAD,T.HEAD),t.headElement=t.openElements.current,t.insertionMode=W.IN_HEAD,t._processToken(e)}function ta(t,e){switch(e.tagID){case T.HTML:{di(t,e);break}case T.BASE:case T.BASEFONT:case T.BGSOUND:case T.LINK:case T.META:{t._appendElement(e,Ne.HTML),e.ackSelfClosing=!0;break}case T.TITLE:{t._switchToTextParsing(e,mr.RCDATA);break}case T.NOSCRIPT:{t.options.scriptingEnabled?t._switchToTextParsing(e,mr.RAWTEXT):(t._insertElement(e,Ne.HTML),t.insertionMode=W.IN_HEAD_NO_SCRIPT);break}case T.NOFRAMES:case T.STYLE:{t._switchToTextParsing(e,mr.RAWTEXT);break}case T.SCRIPT:{t._switchToTextParsing(e,mr.SCRIPT_DATA);break}case T.TEMPLATE:{t._insertTemplate(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=W.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(W.IN_TEMPLATE);break}case T.HEAD:{t._err(e,ve.misplacedStartTagForHeadElement);break}default:Ff(t,e)}}function wQ(t,e){switch(e.tagID){case T.HEAD:{t.openElements.pop(),t.insertionMode=W.AFTER_HEAD;break}case T.BODY:case T.BR:case T.HTML:{Ff(t,e);break}case T.TEMPLATE:{ac(t,e);break}default:t._err(e,ve.endTagWithoutMatchingOpenElement)}}function ac(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==T.TEMPLATE&&t._err(e,ve.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(T.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode()):t._err(e,ve.endTagWithoutMatchingOpenElement)}function Ff(t,e){t.openElements.pop(),t.insertionMode=W.AFTER_HEAD,t._processToken(e)}function kQ(t,e){switch(e.tagID){case T.HTML:{di(t,e);break}case T.BASEFONT:case T.BGSOUND:case T.HEAD:case T.LINK:case T.META:case T.NOFRAMES:case T.STYLE:{ta(t,e);break}case T.NOSCRIPT:{t._err(e,ve.nestedNoscriptInHead);break}default:Hf(t,e)}}function CQ(t,e){switch(e.tagID){case T.NOSCRIPT:{t.openElements.pop(),t.insertionMode=W.IN_HEAD;break}case T.BR:{Hf(t,e);break}default:t._err(e,ve.endTagWithoutMatchingOpenElement)}}function Hf(t,e){const n=e.type===Pt.EOF?ve.openElementsLeftAfterEof:ve.disallowedContentInNoscriptInHead;t._err(e,n),t.openElements.pop(),t.insertionMode=W.IN_HEAD,t._processToken(e)}function AQ(t,e){switch(e.tagID){case T.HTML:{di(t,e);break}case T.BODY:{t._insertElement(e,Ne.HTML),t.framesetOk=!1,t.insertionMode=W.IN_BODY;break}case T.FRAMESET:{t._insertElement(e,Ne.HTML),t.insertionMode=W.IN_FRAMESET;break}case T.BASE:case T.BASEFONT:case T.BGSOUND:case T.LINK:case T.META:case T.NOFRAMES:case T.SCRIPT:case T.STYLE:case T.TEMPLATE:case T.TITLE:{t._err(e,ve.abandonedHeadElementChild),t.openElements.push(t.headElement,T.HEAD),ta(t,e),t.openElements.remove(t.headElement);break}case T.HEAD:{t._err(e,ve.misplacedStartTagForHeadElement);break}default:jf(t,e)}}function NQ(t,e){switch(e.tagID){case T.BODY:case T.HTML:case T.BR:{jf(t,e);break}case T.TEMPLATE:{ac(t,e);break}default:t._err(e,ve.endTagWithoutMatchingOpenElement)}}function jf(t,e){t._insertFakeElement(ue.BODY,T.BODY),t.insertionMode=W.IN_BODY,Tb(t,e)}function Tb(t,e){switch(e.type){case Pt.CHARACTER:{MO(t,e);break}case Pt.WHITESPACE_CHARACTER:{OO(t,e);break}case Pt.COMMENT:{z4(t,e);break}case Pt.START_TAG:{di(t,e);break}case Pt.END_TAG:{Sb(t,e);break}case Pt.EOF:{LO(t,e);break}}}function OO(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function MO(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function OQ(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function MQ(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(n,e.attrs))}function RQ(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&n&&(t.treeAdapter.detachNode(n),t.openElements.popAllUpToHtmlElement(),t._insertElement(e,Ne.HTML),t.insertionMode=W.IN_FRAMESET)}function DQ(t,e){t.openElements.hasInButtonScope(T.P)&&t._closePElement(),t._insertElement(e,Ne.HTML)}function IQ(t,e){t.openElements.hasInButtonScope(T.P)&&t._closePElement(),t.openElements.currentTagId!==void 0&&B4.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,Ne.HTML)}function LQ(t,e){t.openElements.hasInButtonScope(T.P)&&t._closePElement(),t._insertElement(e,Ne.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function PQ(t,e){const n=t.openElements.tmplCount>0;(!t.formElement||n)&&(t.openElements.hasInButtonScope(T.P)&&t._closePElement(),t._insertElement(e,Ne.HTML),n||(t.formElement=t.openElements.current))}function BQ(t,e){t.framesetOk=!1;const n=e.tagID;for(let r=t.openElements.stackTop;r>=0;r--){const i=t.openElements.tagIDs[r];if(n===T.LI&&i===T.LI||(n===T.DD||n===T.DT)&&(i===T.DD||i===T.DT)){t.openElements.generateImpliedEndTagsWithExclusion(i),t.openElements.popUntilTagNamePopped(i);break}if(i!==T.ADDRESS&&i!==T.DIV&&i!==T.P&&t._isSpecialElement(t.openElements.items[r],i))break}t.openElements.hasInButtonScope(T.P)&&t._closePElement(),t._insertElement(e,Ne.HTML)}function zQ(t,e){t.openElements.hasInButtonScope(T.P)&&t._closePElement(),t._insertElement(e,Ne.HTML),t.tokenizer.state=mr.PLAINTEXT}function UQ(t,e){t.openElements.hasInScope(T.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(T.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,Ne.HTML),t.framesetOk=!1}function FQ(t,e){const n=t.activeFormattingElements.getElementEntryInScopeWithTagName(ue.A);n&&(U_(t,e),t.openElements.remove(n.element),t.activeFormattingElements.removeEntry(n)),t._reconstructActiveFormattingElements(),t._insertElement(e,Ne.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function HQ(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ne.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function jQ(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(T.NOBR)&&(U_(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,Ne.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function $Q(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ne.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function qQ(t,e){t.treeAdapter.getDocumentMode(t.document)!==Ms.QUIRKS&&t.openElements.hasInButtonScope(T.P)&&t._closePElement(),t._insertElement(e,Ne.HTML),t.framesetOk=!1,t.insertionMode=W.IN_TABLE}function RO(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,Ne.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function DO(t){const e=_O(t,Hu.TYPE);return e!=null&&e.toLowerCase()===lQ}function VQ(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,Ne.HTML),DO(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function GQ(t,e){t._appendElement(e,Ne.HTML),e.ackSelfClosing=!0}function YQ(t,e){t.openElements.hasInButtonScope(T.P)&&t._closePElement(),t._appendElement(e,Ne.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function WQ(t,e){e.tagName=ue.IMG,e.tagID=T.IMG,RO(t,e)}function KQ(t,e){t._insertElement(e,Ne.HTML),t.skipNextNewLine=!0,t.tokenizer.state=mr.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=W.TEXT}function XQ(t,e){t.openElements.hasInButtonScope(T.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,mr.RAWTEXT)}function QQ(t,e){t.framesetOk=!1,t._switchToTextParsing(e,mr.RAWTEXT)}function Xk(t,e){t._switchToTextParsing(e,mr.RAWTEXT)}function ZQ(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ne.HTML),t.framesetOk=!1,t.insertionMode=t.insertionMode===W.IN_TABLE||t.insertionMode===W.IN_CAPTION||t.insertionMode===W.IN_TABLE_BODY||t.insertionMode===W.IN_ROW||t.insertionMode===W.IN_CELL?W.IN_SELECT_IN_TABLE:W.IN_SELECT}function JQ(t,e){t.openElements.currentTagId===T.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,Ne.HTML)}function eZ(t,e){t.openElements.hasInScope(T.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,Ne.HTML)}function tZ(t,e){t.openElements.hasInScope(T.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(T.RTC),t._insertElement(e,Ne.HTML)}function nZ(t,e){t._reconstructActiveFormattingElements(),CO(e),z_(e),e.selfClosing?t._appendElement(e,Ne.MATHML):t._insertElement(e,Ne.MATHML),e.ackSelfClosing=!0}function rZ(t,e){t._reconstructActiveFormattingElements(),AO(e),z_(e),e.selfClosing?t._appendElement(e,Ne.SVG):t._insertElement(e,Ne.SVG),e.ackSelfClosing=!0}function Qk(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ne.HTML)}function di(t,e){switch(e.tagID){case T.I:case T.S:case T.B:case T.U:case T.EM:case T.TT:case T.BIG:case T.CODE:case T.FONT:case T.SMALL:case T.STRIKE:case T.STRONG:{HQ(t,e);break}case T.A:{FQ(t,e);break}case T.H1:case T.H2:case T.H3:case T.H4:case T.H5:case T.H6:{IQ(t,e);break}case T.P:case T.DL:case T.OL:case T.UL:case T.DIV:case T.DIR:case T.NAV:case T.MAIN:case T.MENU:case T.ASIDE:case T.CENTER:case T.FIGURE:case T.FOOTER:case T.HEADER:case T.HGROUP:case T.DIALOG:case T.DETAILS:case T.ADDRESS:case T.ARTICLE:case T.SEARCH:case T.SECTION:case T.SUMMARY:case T.FIELDSET:case T.BLOCKQUOTE:case T.FIGCAPTION:{DQ(t,e);break}case T.LI:case T.DD:case T.DT:{BQ(t,e);break}case T.BR:case T.IMG:case T.WBR:case T.AREA:case T.EMBED:case T.KEYGEN:{RO(t,e);break}case T.HR:{YQ(t,e);break}case T.RB:case T.RTC:{eZ(t,e);break}case T.RT:case T.RP:{tZ(t,e);break}case T.PRE:case T.LISTING:{LQ(t,e);break}case T.XMP:{XQ(t,e);break}case T.SVG:{rZ(t,e);break}case T.HTML:{OQ(t,e);break}case T.BASE:case T.LINK:case T.META:case T.STYLE:case T.TITLE:case T.SCRIPT:case T.BGSOUND:case T.BASEFONT:case T.TEMPLATE:{ta(t,e);break}case T.BODY:{MQ(t,e);break}case T.FORM:{PQ(t,e);break}case T.NOBR:{jQ(t,e);break}case T.MATH:{nZ(t,e);break}case T.TABLE:{qQ(t,e);break}case T.INPUT:{VQ(t,e);break}case T.PARAM:case T.TRACK:case T.SOURCE:{GQ(t,e);break}case T.IMAGE:{WQ(t,e);break}case T.BUTTON:{UQ(t,e);break}case T.APPLET:case T.OBJECT:case T.MARQUEE:{$Q(t,e);break}case T.IFRAME:{QQ(t,e);break}case T.SELECT:{ZQ(t,e);break}case T.OPTION:case T.OPTGROUP:{JQ(t,e);break}case T.NOEMBED:case T.NOFRAMES:{Xk(t,e);break}case T.FRAMESET:{RQ(t,e);break}case T.TEXTAREA:{KQ(t,e);break}case T.NOSCRIPT:{t.options.scriptingEnabled?Xk(t,e):Qk(t,e);break}case T.PLAINTEXT:{zQ(t,e);break}case T.COL:case T.TH:case T.TD:case T.TR:case T.HEAD:case T.FRAME:case T.TBODY:case T.TFOOT:case T.THEAD:case T.CAPTION:case T.COLGROUP:break;default:Qk(t,e)}}function iZ(t,e){if(t.openElements.hasInScope(T.BODY)&&(t.insertionMode=W.AFTER_BODY,t.options.sourceCodeLocationInfo)){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t._setEndLocation(n,e)}}function sZ(t,e){t.openElements.hasInScope(T.BODY)&&(t.insertionMode=W.AFTER_BODY,$O(t,e))}function aZ(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n))}function oZ(t){const e=t.openElements.tmplCount>0,{formElement:n}=t;e||(t.formElement=null),(n||e)&&t.openElements.hasInScope(T.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(T.FORM):n&&t.openElements.remove(n))}function lZ(t){t.openElements.hasInButtonScope(T.P)||t._insertFakeElement(ue.P,T.P),t._closePElement()}function uZ(t){t.openElements.hasInListItemScope(T.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(T.LI),t.openElements.popUntilTagNamePopped(T.LI))}function cZ(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.popUntilTagNamePopped(n))}function dZ(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function fZ(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker())}function hZ(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(ue.BR,T.BR),t.openElements.pop(),t.framesetOk=!1}function IO(t,e){const n=e.tagName,r=e.tagID;for(let i=t.openElements.stackTop;i>0;i--){const s=t.openElements.items[i],a=t.openElements.tagIDs[i];if(r===a&&(r!==T.UNKNOWN||t.treeAdapter.getTagName(s)===n)){t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.stackTop>=i&&t.openElements.shortenToLength(i);break}if(t._isSpecialElement(s,a))break}}function Sb(t,e){switch(e.tagID){case T.A:case T.B:case T.I:case T.S:case T.U:case T.EM:case T.TT:case T.BIG:case T.CODE:case T.FONT:case T.NOBR:case T.SMALL:case T.STRIKE:case T.STRONG:{U_(t,e);break}case T.P:{lZ(t);break}case T.DL:case T.UL:case T.OL:case T.DIR:case T.DIV:case T.NAV:case T.PRE:case T.MAIN:case T.MENU:case T.ASIDE:case T.BUTTON:case T.CENTER:case T.FIGURE:case T.FOOTER:case T.HEADER:case T.HGROUP:case T.DIALOG:case T.ADDRESS:case T.ARTICLE:case T.DETAILS:case T.SEARCH:case T.SECTION:case T.SUMMARY:case T.LISTING:case T.FIELDSET:case T.BLOCKQUOTE:case T.FIGCAPTION:{aZ(t,e);break}case T.LI:{uZ(t);break}case T.DD:case T.DT:{cZ(t,e);break}case T.H1:case T.H2:case T.H3:case T.H4:case T.H5:case T.H6:{dZ(t);break}case T.BR:{hZ(t);break}case T.BODY:{iZ(t,e);break}case T.HTML:{sZ(t,e);break}case T.FORM:{oZ(t);break}case T.APPLET:case T.OBJECT:case T.MARQUEE:{fZ(t,e);break}case T.TEMPLATE:{ac(t,e);break}default:IO(t,e)}}function LO(t,e){t.tmplInsertionModeStack.length>0?jO(t,e):F_(t,e)}function pZ(t,e){var n;e.tagID===T.SCRIPT&&((n=t.scriptHandler)===null||n===void 0||n.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function mZ(t,e){t._err(e,ve.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function Y2(t,e){if(t.openElements.currentTagId!==void 0&&NO.has(t.openElements.currentTagId))switch(t.pendingCharacterTokens.length=0,t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=W.IN_TABLE_TEXT,e.type){case Pt.CHARACTER:{BO(t,e);break}case Pt.WHITESPACE_CHARACTER:{PO(t,e);break}}else qh(t,e)}function gZ(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,Ne.HTML),t.insertionMode=W.IN_CAPTION}function bZ(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,Ne.HTML),t.insertionMode=W.IN_COLUMN_GROUP}function vZ(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(ue.COLGROUP,T.COLGROUP),t.insertionMode=W.IN_COLUMN_GROUP,H_(t,e)}function yZ(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,Ne.HTML),t.insertionMode=W.IN_TABLE_BODY}function EZ(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(ue.TBODY,T.TBODY),t.insertionMode=W.IN_TABLE_BODY,wb(t,e)}function _Z(t,e){t.openElements.hasInTableScope(T.TABLE)&&(t.openElements.popUntilTagNamePopped(T.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function xZ(t,e){DO(e)?t._appendElement(e,Ne.HTML):qh(t,e),e.ackSelfClosing=!0}function TZ(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,Ne.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function wd(t,e){switch(e.tagID){case T.TD:case T.TH:case T.TR:{EZ(t,e);break}case T.STYLE:case T.SCRIPT:case T.TEMPLATE:{ta(t,e);break}case T.COL:{vZ(t,e);break}case T.FORM:{TZ(t,e);break}case T.TABLE:{_Z(t,e);break}case T.TBODY:case T.TFOOT:case T.THEAD:{yZ(t,e);break}case T.INPUT:{xZ(t,e);break}case T.CAPTION:{gZ(t,e);break}case T.COLGROUP:{bZ(t,e);break}default:qh(t,e)}}function uh(t,e){switch(e.tagID){case T.TABLE:{t.openElements.hasInTableScope(T.TABLE)&&(t.openElements.popUntilTagNamePopped(T.TABLE),t._resetInsertionMode());break}case T.TEMPLATE:{ac(t,e);break}case T.BODY:case T.CAPTION:case T.COL:case T.COLGROUP:case T.HTML:case T.TBODY:case T.TD:case T.TFOOT:case T.TH:case T.THEAD:case T.TR:break;default:qh(t,e)}}function qh(t,e){const n=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,Tb(t,e),t.fosterParentingEnabled=n}function PO(t,e){t.pendingCharacterTokens.push(e)}function BO(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function nf(t,e){let n=0;if(t.hasNonWhitespacePendingCharacterToken)for(;n<t.pendingCharacterTokens.length;n++)qh(t,t.pendingCharacterTokens[n]);else for(;n<t.pendingCharacterTokens.length;n++)t._insertCharacters(t.pendingCharacterTokens[n]);t.insertionMode=t.originalInsertionMode,t._processToken(e)}const zO=new Set([T.CAPTION,T.COL,T.COLGROUP,T.TBODY,T.TD,T.TFOOT,T.TH,T.THEAD,T.TR]);function SZ(t,e){const n=e.tagID;zO.has(n)?t.openElements.hasInTableScope(T.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(T.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=W.IN_TABLE,wd(t,e)):di(t,e)}function wZ(t,e){const n=e.tagID;switch(n){case T.CAPTION:case T.TABLE:{t.openElements.hasInTableScope(T.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(T.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=W.IN_TABLE,n===T.TABLE&&uh(t,e));break}case T.BODY:case T.COL:case T.COLGROUP:case T.HTML:case T.TBODY:case T.TD:case T.TFOOT:case T.TH:case T.THEAD:case T.TR:break;default:Sb(t,e)}}function H_(t,e){switch(e.tagID){case T.HTML:{di(t,e);break}case T.COL:{t._appendElement(e,Ne.HTML),e.ackSelfClosing=!0;break}case T.TEMPLATE:{ta(t,e);break}default:jg(t,e)}}function kZ(t,e){switch(e.tagID){case T.COLGROUP:{t.openElements.currentTagId===T.COLGROUP&&(t.openElements.pop(),t.insertionMode=W.IN_TABLE);break}case T.TEMPLATE:{ac(t,e);break}case T.COL:break;default:jg(t,e)}}function jg(t,e){t.openElements.currentTagId===T.COLGROUP&&(t.openElements.pop(),t.insertionMode=W.IN_TABLE,t._processToken(e))}function wb(t,e){switch(e.tagID){case T.TR:{t.openElements.clearBackToTableBodyContext(),t._insertElement(e,Ne.HTML),t.insertionMode=W.IN_ROW;break}case T.TH:case T.TD:{t.openElements.clearBackToTableBodyContext(),t._insertFakeElement(ue.TR,T.TR),t.insertionMode=W.IN_ROW,kb(t,e);break}case T.CAPTION:case T.COL:case T.COLGROUP:case T.TBODY:case T.TFOOT:case T.THEAD:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=W.IN_TABLE,wd(t,e));break}default:wd(t,e)}}function U4(t,e){const n=e.tagID;switch(e.tagID){case T.TBODY:case T.TFOOT:case T.THEAD:{t.openElements.hasInTableScope(n)&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=W.IN_TABLE);break}case T.TABLE:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=W.IN_TABLE,uh(t,e));break}case T.BODY:case T.CAPTION:case T.COL:case T.COLGROUP:case T.HTML:case T.TD:case T.TH:case T.TR:break;default:uh(t,e)}}function kb(t,e){switch(e.tagID){case T.TH:case T.TD:{t.openElements.clearBackToTableRowContext(),t._insertElement(e,Ne.HTML),t.insertionMode=W.IN_CELL,t.activeFormattingElements.insertMarker();break}case T.CAPTION:case T.COL:case T.COLGROUP:case T.TBODY:case T.TFOOT:case T.THEAD:case T.TR:{t.openElements.hasInTableScope(T.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=W.IN_TABLE_BODY,wb(t,e));break}default:wd(t,e)}}function UO(t,e){switch(e.tagID){case T.TR:{t.openElements.hasInTableScope(T.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=W.IN_TABLE_BODY);break}case T.TABLE:{t.openElements.hasInTableScope(T.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=W.IN_TABLE_BODY,U4(t,e));break}case T.TBODY:case T.TFOOT:case T.THEAD:{(t.openElements.hasInTableScope(e.tagID)||t.openElements.hasInTableScope(T.TR))&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=W.IN_TABLE_BODY,U4(t,e));break}case T.BODY:case T.CAPTION:case T.COL:case T.COLGROUP:case T.HTML:case T.TD:case T.TH:break;default:uh(t,e)}}function CZ(t,e){const n=e.tagID;zO.has(n)?(t.openElements.hasInTableScope(T.TD)||t.openElements.hasInTableScope(T.TH))&&(t._closeTableCell(),kb(t,e)):di(t,e)}function AZ(t,e){const n=e.tagID;switch(n){case T.TD:case T.TH:{t.openElements.hasInTableScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=W.IN_ROW);break}case T.TABLE:case T.TBODY:case T.TFOOT:case T.THEAD:case T.TR:{t.openElements.hasInTableScope(n)&&(t._closeTableCell(),UO(t,e));break}case T.BODY:case T.CAPTION:case T.COL:case T.COLGROUP:case T.HTML:break;default:Sb(t,e)}}function FO(t,e){switch(e.tagID){case T.HTML:{di(t,e);break}case T.OPTION:{t.openElements.currentTagId===T.OPTION&&t.openElements.pop(),t._insertElement(e,Ne.HTML);break}case T.OPTGROUP:{t.openElements.currentTagId===T.OPTION&&t.openElements.pop(),t.openElements.currentTagId===T.OPTGROUP&&t.openElements.pop(),t._insertElement(e,Ne.HTML);break}case T.HR:{t.openElements.currentTagId===T.OPTION&&t.openElements.pop(),t.openElements.currentTagId===T.OPTGROUP&&t.openElements.pop(),t._appendElement(e,Ne.HTML),e.ackSelfClosing=!0;break}case T.INPUT:case T.KEYGEN:case T.TEXTAREA:case T.SELECT:{t.openElements.hasInSelectScope(T.SELECT)&&(t.openElements.popUntilTagNamePopped(T.SELECT),t._resetInsertionMode(),e.tagID!==T.SELECT&&t._processStartTag(e));break}case T.SCRIPT:case T.TEMPLATE:{ta(t,e);break}}}function HO(t,e){switch(e.tagID){case T.OPTGROUP:{t.openElements.stackTop>0&&t.openElements.currentTagId===T.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===T.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===T.OPTGROUP&&t.openElements.pop();break}case T.OPTION:{t.openElements.currentTagId===T.OPTION&&t.openElements.pop();break}case T.SELECT:{t.openElements.hasInSelectScope(T.SELECT)&&(t.openElements.popUntilTagNamePopped(T.SELECT),t._resetInsertionMode());break}case T.TEMPLATE:{ac(t,e);break}}}function NZ(t,e){const n=e.tagID;n===T.CAPTION||n===T.TABLE||n===T.TBODY||n===T.TFOOT||n===T.THEAD||n===T.TR||n===T.TD||n===T.TH?(t.openElements.popUntilTagNamePopped(T.SELECT),t._resetInsertionMode(),t._processStartTag(e)):FO(t,e)}function OZ(t,e){const n=e.tagID;n===T.CAPTION||n===T.TABLE||n===T.TBODY||n===T.TFOOT||n===T.THEAD||n===T.TR||n===T.TD||n===T.TH?t.openElements.hasInTableScope(n)&&(t.openElements.popUntilTagNamePopped(T.SELECT),t._resetInsertionMode(),t.onEndTag(e)):HO(t,e)}function MZ(t,e){switch(e.tagID){case T.BASE:case T.BASEFONT:case T.BGSOUND:case T.LINK:case T.META:case T.NOFRAMES:case T.SCRIPT:case T.STYLE:case T.TEMPLATE:case T.TITLE:{ta(t,e);break}case T.CAPTION:case T.COLGROUP:case T.TBODY:case T.TFOOT:case T.THEAD:{t.tmplInsertionModeStack[0]=W.IN_TABLE,t.insertionMode=W.IN_TABLE,wd(t,e);break}case T.COL:{t.tmplInsertionModeStack[0]=W.IN_COLUMN_GROUP,t.insertionMode=W.IN_COLUMN_GROUP,H_(t,e);break}case T.TR:{t.tmplInsertionModeStack[0]=W.IN_TABLE_BODY,t.insertionMode=W.IN_TABLE_BODY,wb(t,e);break}case T.TD:case T.TH:{t.tmplInsertionModeStack[0]=W.IN_ROW,t.insertionMode=W.IN_ROW,kb(t,e);break}default:t.tmplInsertionModeStack[0]=W.IN_BODY,t.insertionMode=W.IN_BODY,di(t,e)}}function RZ(t,e){e.tagID===T.TEMPLATE&&ac(t,e)}function jO(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(T.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):F_(t,e)}function DZ(t,e){e.tagID===T.HTML?di(t,e):$g(t,e)}function $O(t,e){var n;if(e.tagID===T.HTML){if(t.fragmentContext||(t.insertionMode=W.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===T.HTML){t._setEndLocation(t.openElements.items[0],e);const r=t.openElements.items[1];r&&!(!((n=t.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&t._setEndLocation(r,e)}}else $g(t,e)}function $g(t,e){t.insertionMode=W.IN_BODY,Tb(t,e)}function IZ(t,e){switch(e.tagID){case T.HTML:{di(t,e);break}case T.FRAMESET:{t._insertElement(e,Ne.HTML);break}case T.FRAME:{t._appendElement(e,Ne.HTML),e.ackSelfClosing=!0;break}case T.NOFRAMES:{ta(t,e);break}}}function LZ(t,e){e.tagID===T.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagId!==T.FRAMESET&&(t.insertionMode=W.AFTER_FRAMESET))}function PZ(t,e){switch(e.tagID){case T.HTML:{di(t,e);break}case T.NOFRAMES:{ta(t,e);break}}}function BZ(t,e){e.tagID===T.HTML&&(t.insertionMode=W.AFTER_AFTER_FRAMESET)}function zZ(t,e){e.tagID===T.HTML?di(t,e):xg(t,e)}function xg(t,e){t.insertionMode=W.IN_BODY,Tb(t,e)}function UZ(t,e){switch(e.tagID){case T.HTML:{di(t,e);break}case T.NOFRAMES:{ta(t,e);break}}}function FZ(t,e){e.chars=jn,t._insertCharacters(e)}function HZ(t,e){t._insertCharacters(e),t.framesetOk=!1}function qO(t){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==Ne.HTML&&t.openElements.currentTagId!==void 0&&!t._isIntegrationPoint(t.openElements.currentTagId,t.openElements.current);)t.openElements.pop()}function jZ(t,e){if(rQ(e))qO(t),t._startTagOutsideForeignContent(e);else{const n=t._getAdjustedCurrentElement(),r=t.treeAdapter.getNamespaceURI(n);r===Ne.MATHML?CO(e):r===Ne.SVG&&(iQ(e),AO(e)),z_(e),e.selfClosing?t._appendElement(e,r):t._insertElement(e,r),e.ackSelfClosing=!0}}function $Z(t,e){if(e.tagID===T.P||e.tagID===T.BR){qO(t),t._endTagOutsideForeignContent(e);return}for(let n=t.openElements.stackTop;n>0;n--){const r=t.openElements.items[n];if(t.treeAdapter.getNamespaceURI(r)===Ne.HTML){t._endTagOutsideForeignContent(e);break}const i=t.treeAdapter.getTagName(r);if(i.toLowerCase()===e.tagName){e.tagName=i,t.openElements.shortenToLength(n);break}}}ue.AREA,ue.BASE,ue.BASEFONT,ue.BGSOUND,ue.BR,ue.COL,ue.EMBED,ue.FRAME,ue.HR,ue.IMG,ue.INPUT,ue.KEYGEN,ue.LINK,ue.META,ue.PARAM,ue.SOURCE,ue.TRACK,ue.WBR;const qZ=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,VZ=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),Zk={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function VO(t,e){const n=tJ(t),r=VN("type",{handlers:{root:GZ,element:YZ,text:WZ,comment:YO,doctype:KZ,raw:QZ},unknown:ZZ}),i={parser:n?new Kk(Zk):Kk.getFragmentParser(void 0,Zk),handle(l){r(l,i)},stitches:!1,options:e||{}};r(t,i),Yd(i,Oa());const s=n?i.parser.document:i.parser.getFragment(),a=nX(s,{file:i.options.file});return i.stitches&&jh(a,"comment",function(l,u,d){const f=l;if(f.value.stitch&&d&&u!==void 0){const p=d.children;return p[u]=f.value.stitch,u}}),a.type==="root"&&a.children.length===1&&a.children[0].type===t.type?a.children[0]:a}function GO(t,e){let n=-1;if(t)for(;++n<t.length;)e.handle(t[n])}function GZ(t,e){GO(t.children,e)}function YZ(t,e){JZ(t,e),GO(t.children,e),eJ(t,e)}function WZ(t,e){e.parser.tokenizer.state>4&&(e.parser.tokenizer.state=0);const n={type:Pt.CHARACTER,chars:t.value,location:Vh(t)};Yd(e,Oa(t)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function KZ(t,e){const n={type:Pt.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Vh(t)};Yd(e,Oa(t)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function XZ(t,e){e.stitches=!0;const n=nJ(t);if("children"in t&&"children"in n){const r=VO({type:"root",children:t.children},e.options);n.children=r.children}YO({type:"comment",value:{stitch:n}},e)}function YO(t,e){const n=t.value,r={type:Pt.COMMENT,data:n,location:Vh(t)};Yd(e,Oa(t)),e.parser.currentToken=r,e.parser._processToken(e.parser.currentToken)}function QZ(t,e){if(e.parser.tokenizer.preprocessor.html="",e.parser.tokenizer.preprocessor.pos=-1,e.parser.tokenizer.preprocessor.lastGapPos=-2,e.parser.tokenizer.preprocessor.gapStack=[],e.parser.tokenizer.preprocessor.skipNextNewLine=!1,e.parser.tokenizer.preprocessor.lastChunkWritten=!1,e.parser.tokenizer.preprocessor.endOfChunkHit=!1,e.parser.tokenizer.preprocessor.isEol=!1,WO(e,Oa(t)),e.parser.tokenizer.write(e.options.tagfilter?t.value.replace(qZ,"&lt;$1$2"):t.value,!1),e.parser.tokenizer._runParsingLoop(),e.parser.tokenizer.state===72||e.parser.tokenizer.state===78){e.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=e.parser.tokenizer._consume();e.parser.tokenizer._callState(n)}}function ZZ(t,e){const n=t;if(e.options.passThrough&&e.options.passThrough.includes(n.type))XZ(n,e);else{let r="";throw VZ.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function Yd(t,e){WO(t,e);const n=t.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=t.parser.tokenizer.preprocessor.line,n.location.endCol=t.parser.tokenizer.preprocessor.col+1,n.location.endOffset=t.parser.tokenizer.preprocessor.offset+1,t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)),t.parser.tokenizer.paused=!1,t.parser.tokenizer.inLoop=!1,t.parser.tokenizer.active=!1,t.parser.tokenizer.returnState=mr.DATA,t.parser.tokenizer.charRefCode=-1,t.parser.tokenizer.consumedAfterSnapshot=-1,t.parser.tokenizer.currentLocation=null,t.parser.tokenizer.currentCharacterToken=null,t.parser.tokenizer.currentToken=null,t.parser.tokenizer.currentAttr={name:"",value:""}}function WO(t,e){if(e&&e.offset!==void 0){const n={startLine:e.line,startCol:e.column,startOffset:e.offset,endLine:-1,endCol:-1,endOffset:-1};t.parser.tokenizer.preprocessor.lineStartPos=-e.column+1,t.parser.tokenizer.preprocessor.droppedBufferSize=e.offset,t.parser.tokenizer.preprocessor.line=e.line,t.parser.tokenizer.currentLocation=n}}function JZ(t,e){const n=t.tagName.toLowerCase();if(e.parser.tokenizer.state===mr.PLAINTEXT)return;Yd(e,Oa(t));const r=e.parser.openElements.current;let i="namespaceURI"in r?r.namespaceURI:va.html;i===va.html&&n==="svg"&&(i=va.svg);const s=oX({...t,children:[]},{space:i===va.svg?"svg":"html"}),a={type:Pt.START_TAG,tagName:n,tagID:Gd(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:Vh(t)};e.parser.currentToken=a,e.parser._processToken(e.parser.currentToken),e.parser.tokenizer.lastStartTagName=n}function eJ(t,e){const n=t.tagName.toLowerCase();if(!e.parser.tokenizer.inForeignNode&&mX.includes(n)||e.parser.tokenizer.state===mr.PLAINTEXT)return;Yd(e,vb(t));const r={type:Pt.END_TAG,tagName:n,tagID:Gd(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Vh(t)};e.parser.currentToken=r,e.parser._processToken(e.parser.currentToken),n===e.parser.tokenizer.lastStartTagName&&(e.parser.tokenizer.state===mr.RCDATA||e.parser.tokenizer.state===mr.RAWTEXT||e.parser.tokenizer.state===mr.SCRIPT_DATA)&&(e.parser.tokenizer.state=mr.DATA)}function tJ(t){const e=t.type==="root"?t.children[0]:t;return!!(e&&(e.type==="doctype"||e.type==="element"&&e.tagName.toLowerCase()==="html"))}function Vh(t){const e=Oa(t)||{line:void 0,column:void 0,offset:void 0},n=vb(t)||{line:void 0,column:void 0,offset:void 0};return{startLine:e.line,startCol:e.column,startOffset:e.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function nJ(t){return"children"in t?Sd({...t,children:[]}):Sd(t)}function rJ(t){return function(e,n){return VO(e,{...t,file:n})}}const Jk=(function(t,e,n){const r=Hh(n);if(!t||!t.type||!t.children)throw new Error("Expected parent node");if(typeof e=="number"){if(e<0||e===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(e=t.children.indexOf(e),e<0)throw new Error("Expected child node or index");for(;++e<t.children.length;)if(r(t.children[e],e,t))return t.children[e]}),oc=(function(t){if(t==null)return aJ;if(typeof t=="string")return sJ(t);if(typeof t=="object")return iJ(t);if(typeof t=="function")return j_(t);throw new Error("Expected function, string, or array as `test`")});function iJ(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=oc(t[n]);return j_(r);function r(...i){let s=-1;for(;++s<e.length;)if(e[s].apply(this,i))return!0;return!1}}function sJ(t){return j_(e);function e(n){return n.tagName===t}}function j_(t){return e;function e(n,r,i){return!!(oJ(n)&&t.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function aJ(t){return!!(t&&typeof t=="object"&&"type"in t&&t.type==="element"&&"tagName"in t&&typeof t.tagName=="string")}function oJ(t){return t!==null&&typeof t=="object"&&"type"in t&&"tagName"in t}const e8=/\n/g,t8=/[\t ]+/g,F4=oc("br"),n8=oc(pJ),lJ=oc("p"),r8=oc("tr"),uJ=oc(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",hJ,mJ]),KO=oc(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function XO(t,e){const n=e||{},r="children"in t?t.children:[],i=KO(t),s=JO(t,{whitespace:n.whitespace||"normal"}),a=[];(t.type==="text"||t.type==="comment")&&a.push(...ZO(t,{breakBefore:!0,breakAfter:!0}));let l=-1;for(;++l<r.length;)a.push(...QO(r[l],t,{whitespace:s,breakBefore:l?void 0:i,breakAfter:l<r.length-1?F4(r[l+1]):i}));const u=[];let d;for(l=-1;++l<a.length;){const f=a[l];typeof f=="number"?d!==void 0&&f>d&&(d=f):f&&(d!==void 0&&d>-1&&u.push(`
`.repeat(d)||" "),d=-1,u.push(f))}return u.join("")}function QO(t,e,n){return t.type==="element"?cJ(t,e,n):t.type==="text"?n.whitespace==="normal"?ZO(t,n):dJ(t):[]}function cJ(t,e,n){const r=JO(t,n),i=t.children||[];let s=-1,a=[];if(uJ(t))return a;let l,u;for(F4(t)||r8(t)&&Jk(e,t,r8)?u=`
`:lJ(t)?(l=2,u=2):KO(t)&&(l=1,u=1);++s<i.length;)a=a.concat(QO(i[s],t,{whitespace:r,breakBefore:s?void 0:l,breakAfter:s<i.length-1?F4(i[s+1]):u}));return n8(t)&&Jk(e,t,n8)&&a.push("	"),l&&a.unshift(l),u&&a.push(u),a}function ZO(t,e){const n=String(t.value),r=[],i=[];let s=0;for(;s<=n.length;){e8.lastIndex=s;const u=e8.exec(n),d=u&&"index"in u?u.index:n.length;r.push(fJ(n.slice(s,d).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),s===0?e.breakBefore:!0,d===n.length?e.breakAfter:!0)),s=d+1}let a=-1,l;for(;++a<r.length;)r[a].charCodeAt(r[a].length-1)===8203||a<r.length-1&&r[a+1].charCodeAt(0)===8203?(i.push(r[a]),l=void 0):r[a]?(typeof l=="number"&&i.push(l),i.push(r[a]),l=0):(a===0||a===r.length-1)&&i.push(0);return i}function dJ(t){return[String(t.value)]}function fJ(t,e,n){const r=[];let i=0,s;for(;i<t.length;){t8.lastIndex=i;const a=t8.exec(t);s=a?a.index:t.length,!i&&!s&&a&&!e&&r.push(""),i!==s&&r.push(t.slice(i,s)),i=a?s+a[0].length:s}return i!==s&&!n&&r.push(""),r.join(" ")}function JO(t,e){if(t.type==="element"){const n=t.properties||{};switch(t.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":e.whitespace;case"textarea":return"pre-wrap"}}return e.whitespace}function hJ(t){return!!(t.properties||{}).hidden}function pJ(t){return t.tagName==="td"||t.tagName==="th"}function mJ(t){return t.tagName==="dialog"&&!(t.properties||{}).open}function gJ(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},g={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},b=e.optional(i)+t.IDENT_RE+"\\s*\\(",v=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],E=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],x=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],S=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],L={type:E,keyword:v,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:x},D={className:"function.dispatch",relevance:0,keywords:{_hint:S},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},R=[D,p,l,n,t.C_BLOCK_COMMENT_MODE,f,d],F={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:L,contains:R.concat([{begin:/\(/,end:/\)/,keywords:L,contains:R.concat(["self"]),relevance:0}]),relevance:0},G={className:"function",begin:"("+a+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:L,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:L,relevance:0},{begin:b,returnBegin:!0,contains:[g],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[d,f]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:L,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,d,f,l,{begin:/\(/,end:/\)/,keywords:L,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,d,f,l]}]},l,n,t.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:L,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(F,G,D,R,[p,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:L,contains:["self",l]},{begin:t.IDENT_RE+"::",keywords:L},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function bJ(t){const e={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=gJ(t),r=n.keywords;return r.type=[...r.type,...e.type],r.literal=[...r.literal,...e.literal],r.built_in=[...r.built_in,...e.built_in],r._hints=e._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function vJ(t){const e=t.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},s=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,i]};i.contains.push(l);const u={match:/\\"/},d={className:"string",begin:/'/,end:/'/},f={match:/\\'/},p={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},g=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],b=t.SHEBANG({binary:`(${g.join("|")})`,relevance:10}),v={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},E=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],x=["true","false"],S={match:/(\/[a-z._-]+)+/},C=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],O=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],L=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],D=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:E,literal:x,built_in:[...C,...O,"set","shopt",...L,...D]},contains:[b,t.SHEBANG(),v,p,s,a,S,l,u,d,f,n]}}function yJ(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},g={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},b=e.optional(i)+t.IDENT_RE+"\\s*\\(",x={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},S=[p,l,n,t.C_BLOCK_COMMENT_MODE,f,d],C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:x,contains:S.concat([{begin:/\(/,end:/\)/,keywords:x,contains:S.concat(["self"]),relevance:0}]),relevance:0},O={begin:"("+a+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:x,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:x,relevance:0},{begin:b,returnBegin:!0,contains:[t.inherit(g,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,d,f,l,{begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,d,f,l]}]},l,n,t.C_BLOCK_COMMENT_MODE,p]};return{name:"C",aliases:["h"],keywords:x,disableAutodetect:!0,illegal:"</",contains:[].concat(C,O,S,[p,{begin:t.IDENT_RE+"::",keywords:x},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:p,strings:d,keywords:x}}}function EJ(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},g={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},b=e.optional(i)+t.IDENT_RE+"\\s*\\(",v=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],E=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],x=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],S=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],L={type:E,keyword:v,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:x},D={className:"function.dispatch",relevance:0,keywords:{_hint:S},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},R=[D,p,l,n,t.C_BLOCK_COMMENT_MODE,f,d],F={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:L,contains:R.concat([{begin:/\(/,end:/\)/,keywords:L,contains:R.concat(["self"]),relevance:0}]),relevance:0},G={className:"function",begin:"("+a+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:L,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:L,relevance:0},{begin:b,returnBegin:!0,contains:[g],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[d,f]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:L,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,d,f,l,{begin:/\(/,end:/\)/,keywords:L,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,d,f,l]}]},l,n,t.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:L,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(F,G,D,R,[p,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:L,contains:["self",l]},{begin:t.IDENT_RE+"::",keywords:L},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function _J(t){const e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],s=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],a={keyword:i.concat(s),built_in:e,literal:r},l=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},d={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},f={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},p=t.inherit(f,{illegal:/\n/}),g={className:"subst",begin:/\{/,end:/\}/,keywords:a},b=t.inherit(g,{illegal:/\n/}),v={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,b]},E={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},g]},x=t.inherit(E,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},b]});g.contains=[E,v,f,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,u,t.C_BLOCK_COMMENT_MODE],b.contains=[x,v,p,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,u,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const S={variants:[d,E,v,f,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},C={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},O=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",L={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:a,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},S,u,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,C,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,C,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+O+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:a,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,C],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[S,u,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},L]}}const xJ=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),TJ=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],SJ=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],wJ=[...TJ,...SJ],kJ=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),CJ=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),AJ=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),NJ=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function OJ(t){const e=t.regex,n=xJ(t),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",s=/@-?\w[\w]*(-\w+)*/,a="[a-zA-Z-][a-zA-Z0-9_-]*",l=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+a,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+CJ.join("|")+")"},{begin:":(:)?("+AJ.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+NJ.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:kJ.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+wJ.join("|")+")\\b"}]}}function MJ(t){const e=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function RJ(t){const s={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:s,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:s,illegal:/["']/}]}]}}function DJ(t){const e=t.regex,n=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[t.HASH_COMMENT_MODE,t.QUOTE_STRING_MODE,t.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:e.concat(n,e.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function IJ(t){const e=t.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:t.NUMBER_RE}]},r=t.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const i={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},s={className:"literal",begin:/\bon|off|true|false|yes|no\b/},a={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},l={begin:/\[/,end:/\]/,contains:[r,s,i,a,n,"self"],relevance:0},u=/[A-Za-z0-9_-]+/,d=/"(\\"|[^"])*"/,f=/'[^']*'/,p=e.either(u,d,f),g=e.concat(p,"(\\s*\\.\\s*",p,")*",e.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:g,className:"attr",starts:{end:/$/,contains:[r,l,s,i,a,n]}}]}}var id="[0-9](_*[0-9])*",Mm=`\\.(${id})`,Rm="[0-9a-fA-F](_*[0-9a-fA-F])*",i8={className:"number",variants:[{begin:`(\\b(${id})((${Mm})|\\.)?|(${Mm}))[eE][+-]?(${id})[fFdD]?\\b`},{begin:`\\b(${id})((${Mm})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Mm})[fFdD]?\\b`},{begin:`\\b(${id})[fFdD]\\b`},{begin:`\\b0[xX]((${Rm})\\.?|(${Rm})?\\.(${Rm}))[pP][+-]?(${id})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Rm})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function eM(t,e,n){return n===-1?"":t.replace(e,r=>eM(t,e,n-1))}function LJ(t){const e=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+eM("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),u={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},d={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},f={className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:u,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[f,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:u,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,i8,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},i8,d]}}const s8="[A-Za-z$_][0-9A-Za-z$_]*",PJ=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],BJ=["true","false","null","undefined","NaN","Infinity"],tM=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],nM=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],rM=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],zJ=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],UJ=[].concat(rM,tM,nM);function FJ(t){const e=t.regex,n=(ce,{after:we})=>{const j="</"+ce[0].slice(1);return ce.input.indexOf(j,we)!==-1},r=s8,i={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ce,we)=>{const j=ce[0].length+ce.index,H=ce.input[j];if(H==="<"||H===","){we.ignoreMatch();return}H===">"&&(n(ce,{after:j})||we.ignoreMatch());let ne;const P=ce.input.substring(j);if(ne=P.match(/^\s*=/)){we.ignoreMatch();return}if((ne=P.match(/^\s+extends\s+/))&&ne.index===0){we.ignoreMatch();return}}},l={$pattern:s8,keyword:PJ,literal:BJ,built_in:UJ,"variable.language":zJ},u="[0-9](_?[0-9])*",d=`\\.(${u})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${f})((${d})|\\.)?|(${d}))[eE][+-]?(${u})\\b`},{begin:`\\b(${f})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},g={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},b={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,g],subLanguage:"xml"}},v={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,g],subLanguage:"css"}},E={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,g],subLanguage:"graphql"}},x={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,g]},C={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},O=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,b,v,E,x,{match:/\$\d+/},p];g.contains=O.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(O)});const L=[].concat(C,g.contains),D=L.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(L)}]),R={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:D},F={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},G={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...tM,...nM]}},Z={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},q={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[R],illegal:/%/},ie={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function se(ce){return e.concat("(?!",ce.join("|"),")")}const Te={match:e.concat(/\b/,se([...rM,"super","import"].map(ce=>`${ce}\\s*\\(`)),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},oe={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},re={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},R]},X="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",ee={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(X)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[R]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:D,CLASS_REFERENCE:G},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),Z,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,b,v,E,x,C,{match:/\$\d+/},p,G,{scope:"attr",match:r+e.lookahead(":"),relevance:0},ee,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[C,t.REGEXP_MODE,{className:"function",begin:X,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:D}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},q,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[R,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},oe,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},Te,ie,F,re,{match:/\$[(.]/}]}}function HJ(t){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[e,n,t.QUOTE_STRING_MODE,i,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var sd="[0-9](_*[0-9])*",Dm=`\\.(${sd})`,Im="[0-9a-fA-F](_*[0-9a-fA-F])*",jJ={className:"number",variants:[{begin:`(\\b(${sd})((${Dm})|\\.)?|(${Dm}))[eE][+-]?(${sd})[fFdD]?\\b`},{begin:`\\b(${sd})((${Dm})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Dm})[fFdD]?\\b`},{begin:`\\b(${sd})[fFdD]\\b`},{begin:`\\b0[xX]((${Im})\\.?|(${Im})?\\.(${Im}))[pP][+-]?(${sd})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Im})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function $J(t){const e={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[t.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+t.UNDERSCORE_IDENT_RE},a={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,i]},{begin:"'",end:"'",illegal:/\n/,contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[t.BACKSLASH_ESCAPE,s,i]}]};i.contains.push(a);const l={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+t.UNDERSCORE_IDENT_RE+")?"},u={className:"meta",begin:"@"+t.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[t.inherit(a,{className:"string"}),"self"]}]},d=jJ,f=t.COMMENT("/\\*","\\*/",{contains:[t.C_BLOCK_COMMENT_MODE]}),p={variants:[{className:"type",begin:t.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},g=p;return g.variants[1].contains=[p],p.variants[1].contains=[g],{name:"Kotlin",aliases:["kt","kts"],keywords:e,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),t.C_LINE_COMMENT_MODE,f,n,r,l,u,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:e,relevance:5,contains:[{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[p,t.C_LINE_COMMENT_MODE,f],relevance:0},t.C_LINE_COMMENT_MODE,f,l,u,a,t.C_NUMBER_MODE]},f]},{begin:[/class|interface|trait/,/\s+/,t.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},t.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},l,u]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
`},d]}}const qJ=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),VJ=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],GJ=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],YJ=[...VJ,...GJ],WJ=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),iM=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),sM=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),KJ=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),XJ=iM.concat(sM).sort().reverse();function QJ(t){const e=qJ(t),n=XJ,r="and or not only",i="[\\w-]+",s="("+i+"|@\\{"+i+"\\})",a=[],l=[],u=function(O){return{className:"string",begin:"~?"+O+".*?"+O}},d=function(O,L,D){return{className:O,begin:L,relevance:D}},f={$pattern:/[a-z-]+/,keyword:r,attribute:WJ.join(" ")},p={begin:"\\(",end:"\\)",contains:l,keywords:f,relevance:0};l.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,u("'"),u('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,p,d("variable","@@?"+i,10),d("variable","@\\{"+i+"\\}"),d("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);const g=l.concat({begin:/\{/,end:/\}/,contains:a}),b={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},v={begin:s+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+KJ.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},E={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:f,returnEnd:!0,contains:l,relevance:0}},x={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:g}},S={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:s,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,b,d("keyword","all\\b"),d("variable","@\\{"+i+"\\}"),{begin:"\\b("+YJ.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,d("selector-tag",s,0),d("selector-id","#"+s),d("selector-class","\\."+s,0),d("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+iM.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+sM.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:g},{begin:"!important"},e.FUNCTION_DISPATCH]},C={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[S]};return a.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,E,x,C,v,S,b,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function ZJ(t){const e="\\[=*\\[",n="\\]=*\\]",r={begin:e,end:n,contains:["self"]},i=[t.COMMENT("--(?!"+e+")","$"),t.COMMENT("--"+e,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:e,end:n,contains:[r],relevance:5}])}}function JJ(t){const e={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,e]},r={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[e,n]},i={begin:"^"+t.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},s={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},a={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[e]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[t.HASH_COMMENT_MODE,e,n,r,i,s,a]}}function eee(t){const e=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},s={className:"bullet",begin:"^[ 	]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},a={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,u={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},d={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},f={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},p=t.inherit(d,{contains:[]}),g=t.inherit(f,{contains:[]});d.contains.push(g),f.contains.push(p);let b=[n,u];return[d,f,p,g].forEach(S=>{S.contains=S.contains.concat(b)}),b=b.concat(d,f),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:b},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:b}]}]},n,s,d,f,{className:"quote",begin:"^>\\s+",contains:b,end:"$"},i,r,u,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function tee(t){const e={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,l={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},u={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:l,illegal:"</",contains:[e,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+u.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:u,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}function nee(t){const e=t.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},a={begin:/->\{/,end:/\}/},l={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},u={scope:"variable",variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[l]},d={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},f=[t.BACKSLASH_ESCAPE,s,u],p=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],g=(E,x,S="\\1")=>{const C=S==="\\1"?S:e.concat(S,x);return e.concat(e.concat("(?:",E,")"),x,/(?:\\.|[^\\\/])*?/,C,/(?:\\.|[^\\\/])*?/,S,r)},b=(E,x,S)=>e.concat(e.concat("(?:",E,")"),x,/(?:\\.|[^\\\/])*?/,S,r),v=[u,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),a,{className:"string",contains:f,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},d,{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:g("s|tr|y",e.either(...p,{capture:!0}))},{begin:g("s|tr|y","\\(","\\)")},{begin:g("s|tr|y","\\[","\\]")},{begin:g("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:b("(?:m|qr)?",/\//,/\//)},{begin:b("m|qr",e.either(...p,{capture:!0}),/\1/)},{begin:b("m|qr",/\(/,/\)/)},{begin:b("m|qr",/\[/,/\]/)},{begin:b("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,l]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,l,d]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return s.contains=v,a.contains=v,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:v}}function ree(t){const e=t.regex,n=/(?![A-Za-z0-9])(?![$])/,r=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),s=e.concat(/[A-Z]+/,n),a={scope:"variable",match:"\\$+"+r},l={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},u={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},d=t.inherit(t.APOS_STRING_MODE,{illegal:null}),f=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(u)}),p={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(u),"on:begin":(oe,re)=>{re.data._beginMatch=oe[1]||oe[2]},"on:end":(oe,re)=>{re.data._beginMatch!==oe[1]&&re.ignoreMatch()}},g=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),b=`[ 	
]`,v={scope:"string",variants:[f,d,p,g]},E={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},x=["false","null","true"],S=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],C=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],L={keyword:S,literal:(oe=>{const re=[];return oe.forEach(X=>{re.push(X),X.toLowerCase()===X?re.push(X.toUpperCase()):re.push(X.toLowerCase())}),re})(x),built_in:C},D=oe=>oe.map(re=>re.replace(/\|\d+$/,"")),R={variants:[{match:[/new/,e.concat(b,"+"),e.concat("(?!",D(C).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},F=e.concat(r,"\\b(?!\\()"),G={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),F],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,e.concat(/::/,e.lookahead(/(?!class\b)/)),F],scope:{1:"title.class",3:"variable.constant"}},{match:[i,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},Z={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},q={relevance:0,begin:/\(/,end:/\)/,keywords:L,contains:[Z,a,G,t.C_BLOCK_COMMENT_MODE,v,E,R]},ie={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",D(S).join("\\b|"),"|",D(C).join("\\b|"),"\\b)"),r,e.concat(b,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[q]};q.contains.push(ie);const se=[Z,G,t.C_BLOCK_COMMENT_MODE,v,E,R],Te={begin:e.concat(/#\[\s*\\?/,e.either(i,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:x,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:x,keyword:["new","array"]},contains:["self",...se]},...se,{scope:"meta",variants:[{match:i},{match:s}]}]};return{case_insensitive:!1,keywords:L,contains:[Te,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},a,ie,G,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},R,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:L,contains:["self",Te,a,G,t.C_BLOCK_COMMENT_MODE,v,E]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},v,E]}}function iee(t){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function see(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function aee(t){const e=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},u={className:"meta",begin:/^(>>>|\.\.\.) /},d={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},f={begin:/\{\{/,relevance:0},p={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,u,f,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,u,f,d]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,f,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,f,d]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},g="[0-9](_?[0-9])*",b=`(\\b(${g}))?\\.(${g})|\\b(${g})\\.`,v=`\\b|${r.join("|")}`,E={className:"number",relevance:0,variants:[{begin:`(\\b(${g})|(${b}))[eE][+-]?(${g})[jJ]?(?=${v})`},{begin:`(${b})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${v})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${v})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${v})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${v})`},{begin:`\\b(${g})[jJ](?=${v})`}]},x={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},S={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",u,E,p,t.HASH_COMMENT_MODE]}]};return d.contains=[p,E,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[u,E,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},p,x,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[S]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[E,S,p]}]}}function oee(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function lee(t){const e=t.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=e.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=e.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[s,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function uee(t){const e=t.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=e.concat(r,/(::\w+)*/),a={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},u={begin:"#<",end:">"},d=[t.COMMENT("#","$",{contains:[l]}),t.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],f={className:"subst",begin:/#\{/,end:/\}/,keywords:a},p={className:"string",contains:[t.BACKSLASH_ESCAPE,f],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,f]})]}]},g="[1-9](_?[0-9])*|0",b="[0-9](_?[0-9])*",v={className:"number",relevance:0,variants:[{begin:`\\b(${g})(\\.(${b}))?([eE][+-]?(${b})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},E={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},R=[p,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:a},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[E]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[p,{begin:n}],relevance:0},v,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,f],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(u,d),relevance:0}].concat(u,d);f.contains=R,E.contains=R;const q=[{begin:/^\s*=>/,starts:{end:"$",contains:R}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:R}}];return d.unshift(u),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(q).concat(d).concat(R)}}function cee(t){const e=t.regex,n=/(r#)?/,r=e.concat(n,t.UNDERSCORE_IDENT_RE),i=e.concat(n,t.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,e.lookahead(/\s*\(/))},a="([ui](8|16|32|64|128|size)|f(32|64))?",l=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],u=["true","false","Some","None","Ok","Err"],d=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],f=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:f,keyword:l,literal:u,built_in:d},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+a},{begin:"\\b0o([0-7_]+)"+a},{begin:"\\b0x([A-Fa-f0-9_]+)"+a},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+a}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:d,type:f}},{className:"punctuation",begin:"->"},s]}}const dee=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),fee=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],hee=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],pee=[...fee,...hee],mee=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),gee=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),bee=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),vee=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function yee(t){const e=dee(t),n=bee,r=gee,i="@[a-z-]+",s="and or not only",l={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+pee.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+vee.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[e.BLOCK_COMMENT,l,e.HEXCOLOR,e.CSS_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:mee.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},l,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}function Eee(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function _ee(t){const e=t.regex,n=t.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],a=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],u=["add","asc","collation","desc","final","first","last","view"],d=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],f=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],p=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],g=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],b=f,v=[...d,...u].filter(D=>!f.includes(D)),E={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},x={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},S={match:e.concat(/\b/,e.either(...b),/\s*\(/),relevance:0,keywords:{built_in:b}};function C(D){return e.concat(/\b/,e.either(...D.map(R=>R.replace(/\s+/,"\\s+"))),/\b/)}const O={scope:"keyword",match:C(g),relevance:0};function L(D,{exceptions:R,when:F}={}){const G=F;return R=R||[],D.map(Z=>Z.match(/\|\d+$/)||R.includes(Z)?Z:G(Z)?`${Z}|0`:Z)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:L(v,{when:D=>D.length<3}),literal:s,type:l,built_in:p},contains:[{scope:"type",match:C(a)},O,S,E,r,i,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,x]}}function aM(t){return t?typeof t=="string"?t:t.source:null}function rf(t){return bn("(?=",t,")")}function bn(...t){return t.map(n=>aM(n)).join("")}function xee(t){const e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function vi(...t){return"("+(xee(t).capture?"":"?:")+t.map(r=>aM(r)).join("|")+")"}const $_=t=>bn(/\b/,t,/\w$/.test(t)?/\b/:/\B/),Tee=["Protocol","Type"].map($_),a8=["init","self"].map($_),See=["Any","Self"],W2=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],o8=["false","nil","true"],wee=["assignment","associativity","higherThan","left","lowerThan","none","right"],kee=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],l8=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],oM=vi(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),lM=vi(oM,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),K2=bn(oM,lM,"*"),uM=vi(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),qg=vi(uM,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),ca=bn(uM,qg,"*"),Lm=bn(/[A-Z]/,qg,"*"),Cee=["attached","autoclosure",bn(/convention\(/,vi("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",bn(/objc\(/,ca,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],Aee=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Nee(t){const e={match:/\s+/,relevance:0},n=t.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[t.C_LINE_COMMENT_MODE,n],i={match:[/\./,vi(...Tee,...a8)],className:{2:"keyword"}},s={match:bn(/\./,vi(...W2)),relevance:0},a=W2.filter(Qe=>typeof Qe=="string").concat(["_|0"]),l=W2.filter(Qe=>typeof Qe!="string").concat(See).map($_),u={variants:[{className:"keyword",match:vi(...l,...a8)}]},d={$pattern:vi(/\b\w+/,/#\w+/),keyword:a.concat(kee),literal:o8},f=[i,s,u],p={match:bn(/\./,vi(...l8)),relevance:0},g={className:"built_in",match:bn(/\b/,vi(...l8),/(?=\()/)},b=[p,g],v={match:/->/,relevance:0},E={className:"operator",relevance:0,variants:[{match:K2},{match:`\\.(\\.|${lM})+`}]},x=[v,E],S="([0-9]_*)+",C="([0-9a-fA-F]_*)+",O={className:"number",relevance:0,variants:[{match:`\\b(${S})(\\.(${S}))?([eE][+-]?(${S}))?\\b`},{match:`\\b0x(${C})(\\.(${C}))?([pP][+-]?(${S}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},L=(Qe="")=>({className:"subst",variants:[{match:bn(/\\/,Qe,/[0\\tnr"']/)},{match:bn(/\\/,Qe,/u\{[0-9a-fA-F]{1,8}\}/)}]}),D=(Qe="")=>({className:"subst",match:bn(/\\/,Qe,/[\t ]*(?:[\r\n]|\r\n)/)}),R=(Qe="")=>({className:"subst",label:"interpol",begin:bn(/\\/,Qe,/\(/),end:/\)/}),F=(Qe="")=>({begin:bn(Qe,/"""/),end:bn(/"""/,Qe),contains:[L(Qe),D(Qe),R(Qe)]}),G=(Qe="")=>({begin:bn(Qe,/"/),end:bn(/"/,Qe),contains:[L(Qe),R(Qe)]}),Z={className:"string",variants:[F(),F("#"),F("##"),F("###"),G(),G("#"),G("##"),G("###")]},q=[t.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[t.BACKSLASH_ESCAPE]}],ie={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:q},se=Qe=>{const $t=bn(Qe,/\//),wn=bn(/\//,Qe);return{begin:$t,end:wn,contains:[...q,{scope:"comment",begin:`#(?!.*${wn})`,end:/$/}]}},Te={scope:"regexp",variants:[se("###"),se("##"),se("#"),ie]},oe={match:bn(/`/,ca,/`/)},re={className:"variable",match:/\$\d+/},X={className:"variable",match:`\\$${qg}+`},ee=[oe,re,X],ce={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:Aee,contains:[...x,O,Z]}]}},we={scope:"keyword",match:bn(/@/,vi(...Cee),rf(vi(/\(/,/\s+/)))},j={scope:"meta",match:bn(/@/,ca)},H=[ce,we,j],ne={match:rf(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:bn(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,qg,"+")},{className:"type",match:Lm,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:bn(/\s+&\s+/,rf(Lm)),relevance:0}]},P={begin:/</,end:/>/,keywords:d,contains:[...r,...f,...H,v,ne]};ne.contains.push(P);const Ee={match:bn(ca,/\s*:/),keywords:"_|0",relevance:0},Fe={begin:/\(/,end:/\)/,relevance:0,keywords:d,contains:["self",Ee,...r,Te,...f,...b,...x,O,Z,...ee,...H,ne]},He={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,ne]},it={begin:vi(rf(bn(ca,/\s*:/)),rf(bn(ca,/\s+/,ca,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:ca}]},kt={begin:/\(/,end:/\)/,keywords:d,contains:[it,...r,...f,...x,O,Z,...H,ne,Fe],endsParent:!0,illegal:/["']/},Tt={match:[/(func|macro)/,/\s+/,vi(oe.match,ca,K2)],className:{1:"keyword",3:"title.function"},contains:[He,kt,e],illegal:[/\[/,/%/]},St={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[He,kt,e],illegal:/\[|%/},Jn={match:[/operator/,/\s+/,K2],className:{1:"keyword",3:"title"}},Un={begin:[/precedencegroup/,/\s+/,Lm],className:{1:"keyword",3:"title"},contains:[ne],keywords:[...wee,...o8],end:/}/},At={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},gt={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Yt={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,ca,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:d,contains:[He,...f,{begin:/:/,end:/\{/,keywords:d,contains:[{scope:"title.class.inherited",match:Lm},...f],relevance:0}]};for(const Qe of Z.variants){const $t=Qe.contains.find(zt=>zt.label==="interpol");$t.keywords=d;const wn=[...f,...b,...x,O,Z,...ee];$t.contains=[...wn,{begin:/\(/,end:/\)/,contains:["self",...wn]}]}return{name:"Swift",keywords:d,contains:[...r,Tt,St,At,gt,Yt,Jn,Un,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},Te,...f,...b,...x,O,Z,...ee,...H,ne,Fe]}}const Vg="[A-Za-z$_][0-9A-Za-z$_]*",cM=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],dM=["true","false","null","undefined","NaN","Infinity"],fM=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],hM=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],pM=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],mM=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],gM=[].concat(pM,fM,hM);function Oee(t){const e=t.regex,n=(ce,{after:we})=>{const j="</"+ce[0].slice(1);return ce.input.indexOf(j,we)!==-1},r=Vg,i={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ce,we)=>{const j=ce[0].length+ce.index,H=ce.input[j];if(H==="<"||H===","){we.ignoreMatch();return}H===">"&&(n(ce,{after:j})||we.ignoreMatch());let ne;const P=ce.input.substring(j);if(ne=P.match(/^\s*=/)){we.ignoreMatch();return}if((ne=P.match(/^\s+extends\s+/))&&ne.index===0){we.ignoreMatch();return}}},l={$pattern:Vg,keyword:cM,literal:dM,built_in:gM,"variable.language":mM},u="[0-9](_?[0-9])*",d=`\\.(${u})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${f})((${d})|\\.)?|(${d}))[eE][+-]?(${u})\\b`},{begin:`\\b(${f})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},g={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},b={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,g],subLanguage:"xml"}},v={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,g],subLanguage:"css"}},E={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,g],subLanguage:"graphql"}},x={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,g]},C={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},O=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,b,v,E,x,{match:/\$\d+/},p];g.contains=O.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(O)});const L=[].concat(C,g.contains),D=L.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(L)}]),R={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:D},F={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},G={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...fM,...hM]}},Z={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},q={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[R],illegal:/%/},ie={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function se(ce){return e.concat("(?!",ce.join("|"),")")}const Te={match:e.concat(/\b/,se([...pM,"super","import"].map(ce=>`${ce}\\s*\\(`)),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},oe={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},re={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},R]},X="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",ee={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(X)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[R]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:D,CLASS_REFERENCE:G},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),Z,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,b,v,E,x,C,{match:/\$\d+/},p,G,{scope:"attr",match:r+e.lookahead(":"),relevance:0},ee,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[C,t.REGEXP_MODE,{className:"function",begin:X,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:D}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},q,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[R,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},oe,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},Te,ie,F,re,{match:/\$[(.]/}]}}function Mee(t){const e=t.regex,n=Oee(t),r=Vg,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},a={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[n.exports.CLASS_REFERENCE]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},u=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],d={$pattern:Vg,keyword:cM.concat(u),literal:dM,built_in:gM.concat(i),"variable.language":mM},f={className:"meta",begin:"@"+r},p=(E,x,S)=>{const C=E.contains.findIndex(O=>O.label===x);if(C===-1)throw new Error("can not find mode to replace");E.contains.splice(C,1,S)};Object.assign(n.keywords,d),n.exports.PARAMS_CONTAINS.push(f);const g=n.contains.find(E=>E.scope==="attr"),b=Object.assign({},g,{match:e.concat(r,e.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,g,b]),n.contains=n.contains.concat([f,s,a,b]),p(n,"shebang",t.SHEBANG()),p(n,"use_strict",l);const v=n.contains.find(E=>E.label==="func.def");return v.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Ree(t){const e=t.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,a=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,l=/\d{1,2}(:\d{1,2}){1,2}/,u={className:"literal",variants:[{begin:e.concat(/# */,e.either(s,i),/ *#/)},{begin:e.concat(/# */,l,/ *#/)},{begin:e.concat(/# */,a,/ *#/)},{begin:e.concat(/# */,e.either(s,i),/ +/,e.either(a,l),/ *#/)}]},d={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},f={className:"label",begin:/^\w+:/},p=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),g=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,u,d,f,p,g,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[g]}]}}function Dee(t){t.regex;const e=t.COMMENT(/\(;/,/;\)/);e.contains.push("self");const n=t.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},s={className:"variable",begin:/\$[\w_]+/},a={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},l={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},u={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},d={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,e,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,a,i,t.QUOTE_STRING_MODE,u,d,l]}}function Iee(t){const e=t.regex,n=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=t.inherit(s,{begin:/\(/,end:/\)/}),l=t.inherit(t.APOS_STRING_MODE,{className:"string"}),u=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),d={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[s,u,l,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,a,u,l]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[u]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[d],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[d],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(n,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:d}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Lee(t){const e="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},a={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,i]},l=t.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),g={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},b={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},v={begin:/\{/,end:/\}/,contains:[b],illegal:"\\n",relevance:0},E={begin:"\\[",end:"\\]",contains:[b],illegal:"\\n",relevance:0},x=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},g,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},v,E,s,a],S=[...x];return S.pop(),S.push(l),b.contains=S,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:x}}const Pee={arduino:bJ,bash:vJ,c:yJ,cpp:EJ,csharp:_J,css:OJ,diff:MJ,go:RJ,graphql:DJ,ini:IJ,java:LJ,javascript:FJ,json:HJ,kotlin:$J,less:QJ,lua:ZJ,makefile:JJ,markdown:eee,objectivec:tee,perl:nee,php:ree,"php-template":iee,plaintext:see,python:aee,"python-repl":oee,r:lee,ruby:uee,rust:cee,scss:yee,shell:Eee,sql:_ee,swift:Nee,typescript:Mee,vbnet:Ree,wasm:Dee,xml:Iee,yaml:Lee};var X2,u8;function Bee(){if(u8)return X2;u8=1;function t(Q){return Q instanceof Map?Q.clear=Q.delete=Q.set=function(){throw new Error("map is read-only")}:Q instanceof Set&&(Q.add=Q.clear=Q.delete=function(){throw new Error("set is read-only")}),Object.freeze(Q),Object.getOwnPropertyNames(Q).forEach(_e=>{const je=Q[_e],_t=typeof je;(_t==="object"||_t==="function")&&!Object.isFrozen(je)&&t(je)}),Q}class e{constructor(_e){_e.data===void 0&&(_e.data={}),this.data=_e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(Q){return Q.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function r(Q,..._e){const je=Object.create(null);for(const _t in Q)je[_t]=Q[_t];return _e.forEach(function(_t){for(const Rn in _t)je[Rn]=_t[Rn]}),je}const i="</span>",s=Q=>!!Q.scope,a=(Q,{prefix:_e})=>{if(Q.startsWith("language:"))return Q.replace("language:","language-");if(Q.includes(".")){const je=Q.split(".");return[`${_e}${je.shift()}`,...je.map((_t,Rn)=>`${_t}${"_".repeat(Rn+1)}`)].join(" ")}return`${_e}${Q}`};class l{constructor(_e,je){this.buffer="",this.classPrefix=je.classPrefix,_e.walk(this)}addText(_e){this.buffer+=n(_e)}openNode(_e){if(!s(_e))return;const je=a(_e.scope,{prefix:this.classPrefix});this.span(je)}closeNode(_e){s(_e)&&(this.buffer+=i)}value(){return this.buffer}span(_e){this.buffer+=`<span class="${_e}">`}}const u=(Q={})=>{const _e={children:[]};return Object.assign(_e,Q),_e};class d{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(_e){this.top.children.push(_e)}openNode(_e){const je=u({scope:_e});this.add(je),this.stack.push(je)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(_e){return this.constructor._walk(_e,this.rootNode)}static _walk(_e,je){return typeof je=="string"?_e.addText(je):je.children&&(_e.openNode(je),je.children.forEach(_t=>this._walk(_e,_t)),_e.closeNode(je)),_e}static _collapse(_e){typeof _e!="string"&&_e.children&&(_e.children.every(je=>typeof je=="string")?_e.children=[_e.children.join("")]:_e.children.forEach(je=>{d._collapse(je)}))}}class f extends d{constructor(_e){super(),this.options=_e}addText(_e){_e!==""&&this.add(_e)}startScope(_e){this.openNode(_e)}endScope(){this.closeNode()}__addSublanguage(_e,je){const _t=_e.root;je&&(_t.scope=`language:${je}`),this.add(_t)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function p(Q){return Q?typeof Q=="string"?Q:Q.source:null}function g(Q){return E("(?=",Q,")")}function b(Q){return E("(?:",Q,")*")}function v(Q){return E("(?:",Q,")?")}function E(...Q){return Q.map(je=>p(je)).join("")}function x(Q){const _e=Q[Q.length-1];return typeof _e=="object"&&_e.constructor===Object?(Q.splice(Q.length-1,1),_e):{}}function S(...Q){return"("+(x(Q).capture?"":"?:")+Q.map(_t=>p(_t)).join("|")+")"}function C(Q){return new RegExp(Q.toString()+"|").exec("").length-1}function O(Q,_e){const je=Q&&Q.exec(_e);return je&&je.index===0}const L=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function D(Q,{joinWith:_e}){let je=0;return Q.map(_t=>{je+=1;const Rn=je;let yn=p(_t),et="";for(;yn.length>0;){const Xe=L.exec(yn);if(!Xe){et+=yn;break}et+=yn.substring(0,Xe.index),yn=yn.substring(Xe.index+Xe[0].length),Xe[0][0]==="\\"&&Xe[1]?et+="\\"+String(Number(Xe[1])+Rn):(et+=Xe[0],Xe[0]==="("&&je++)}return et}).map(_t=>`(${_t})`).join(_e)}const R=/\b\B/,F="[a-zA-Z]\\w*",G="[a-zA-Z_]\\w*",Z="\\b\\d+(\\.\\d+)?",q="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",ie="\\b(0b[01]+)",se="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Te=(Q={})=>{const _e=/^#![ ]*\//;return Q.binary&&(Q.begin=E(_e,/.*\b/,Q.binary,/\b.*/)),r({scope:"meta",begin:_e,end:/$/,relevance:0,"on:begin":(je,_t)=>{je.index!==0&&_t.ignoreMatch()}},Q)},oe={begin:"\\\\[\\s\\S]",relevance:0},re={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[oe]},X={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[oe]},ee={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},ce=function(Q,_e,je={}){const _t=r({scope:"comment",begin:Q,end:_e,contains:[]},je);_t.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Rn=S("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return _t.contains.push({begin:E(/[ ]+/,"(",Rn,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),_t},we=ce("//","$"),j=ce("/\\*","\\*/"),H=ce("#","$"),ne={scope:"number",begin:Z,relevance:0},P={scope:"number",begin:q,relevance:0},Ee={scope:"number",begin:ie,relevance:0},Fe={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[oe,{begin:/\[/,end:/\]/,relevance:0,contains:[oe]}]},He={scope:"title",begin:F,relevance:0},it={scope:"title",begin:G,relevance:0},kt={begin:"\\.\\s*"+G,relevance:0};var St=Object.freeze({__proto__:null,APOS_STRING_MODE:re,BACKSLASH_ESCAPE:oe,BINARY_NUMBER_MODE:Ee,BINARY_NUMBER_RE:ie,COMMENT:ce,C_BLOCK_COMMENT_MODE:j,C_LINE_COMMENT_MODE:we,C_NUMBER_MODE:P,C_NUMBER_RE:q,END_SAME_AS_BEGIN:function(Q){return Object.assign(Q,{"on:begin":(_e,je)=>{je.data._beginMatch=_e[1]},"on:end":(_e,je)=>{je.data._beginMatch!==_e[1]&&je.ignoreMatch()}})},HASH_COMMENT_MODE:H,IDENT_RE:F,MATCH_NOTHING_RE:R,METHOD_GUARD:kt,NUMBER_MODE:ne,NUMBER_RE:Z,PHRASAL_WORDS_MODE:ee,QUOTE_STRING_MODE:X,REGEXP_MODE:Fe,RE_STARTERS_RE:se,SHEBANG:Te,TITLE_MODE:He,UNDERSCORE_IDENT_RE:G,UNDERSCORE_TITLE_MODE:it});function Jn(Q,_e){Q.input[Q.index-1]==="."&&_e.ignoreMatch()}function Un(Q,_e){Q.className!==void 0&&(Q.scope=Q.className,delete Q.className)}function At(Q,_e){_e&&Q.beginKeywords&&(Q.begin="\\b("+Q.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",Q.__beforeBegin=Jn,Q.keywords=Q.keywords||Q.beginKeywords,delete Q.beginKeywords,Q.relevance===void 0&&(Q.relevance=0))}function gt(Q,_e){Array.isArray(Q.illegal)&&(Q.illegal=S(...Q.illegal))}function Yt(Q,_e){if(Q.match){if(Q.begin||Q.end)throw new Error("begin & end are not supported with match");Q.begin=Q.match,delete Q.match}}function Qe(Q,_e){Q.relevance===void 0&&(Q.relevance=1)}const $t=(Q,_e)=>{if(!Q.beforeMatch)return;if(Q.starts)throw new Error("beforeMatch cannot be used with starts");const je=Object.assign({},Q);Object.keys(Q).forEach(_t=>{delete Q[_t]}),Q.keywords=je.keywords,Q.begin=E(je.beforeMatch,g(je.begin)),Q.starts={relevance:0,contains:[Object.assign(je,{endsParent:!0})]},Q.relevance=0,delete je.beforeMatch},wn=["of","and","for","in","not","or","if","then","parent","list","value"],zt="keyword";function vn(Q,_e,je=zt){const _t=Object.create(null);return typeof Q=="string"?Rn(je,Q.split(" ")):Array.isArray(Q)?Rn(je,Q):Object.keys(Q).forEach(function(yn){Object.assign(_t,vn(Q[yn],_e,yn))}),_t;function Rn(yn,et){_e&&(et=et.map(Xe=>Xe.toLowerCase())),et.forEach(function(Xe){const bt=Xe.split("|");_t[bt[0]]=[yn,Or(bt[0],bt[1])]})}}function Or(Q,_e){return _e?Number(_e):ra(Q)?0:1}function ra(Q){return wn.includes(Q.toLowerCase())}const Hs={},fn=Q=>{console.error(Q)},lr=(Q,..._e)=>{console.log(`WARN: ${Q}`,..._e)},ge=(Q,_e)=>{Hs[`${Q}/${_e}`]||(console.log(`Deprecated as of ${Q}. ${_e}`),Hs[`${Q}/${_e}`]=!0)},Re=new Error;function lt(Q,_e,{key:je}){let _t=0;const Rn=Q[je],yn={},et={};for(let Xe=1;Xe<=_e.length;Xe++)et[Xe+_t]=Rn[Xe],yn[Xe+_t]=!0,_t+=C(_e[Xe-1]);Q[je]=et,Q[je]._emit=yn,Q[je]._multi=!0}function Ae(Q){if(Array.isArray(Q.begin)){if(Q.skip||Q.excludeBegin||Q.returnBegin)throw fn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Re;if(typeof Q.beginScope!="object"||Q.beginScope===null)throw fn("beginScope must be object"),Re;lt(Q,Q.begin,{key:"beginScope"}),Q.begin=D(Q.begin,{joinWith:""})}}function pt(Q){if(Array.isArray(Q.end)){if(Q.skip||Q.excludeEnd||Q.returnEnd)throw fn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Re;if(typeof Q.endScope!="object"||Q.endScope===null)throw fn("endScope must be object"),Re;lt(Q,Q.end,{key:"endScope"}),Q.end=D(Q.end,{joinWith:""})}}function sn(Q){Q.scope&&typeof Q.scope=="object"&&Q.scope!==null&&(Q.beginScope=Q.scope,delete Q.scope)}function hi(Q){sn(Q),typeof Q.beginScope=="string"&&(Q.beginScope={_wrap:Q.beginScope}),typeof Q.endScope=="string"&&(Q.endScope={_wrap:Q.endScope}),Ae(Q),pt(Q)}function Yn(Q){function _e(et,Xe){return new RegExp(p(et),"m"+(Q.case_insensitive?"i":"")+(Q.unicodeRegex?"u":"")+(Xe?"g":""))}class je{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Xe,bt){bt.position=this.position++,this.matchIndexes[this.matchAt]=bt,this.regexes.push([bt,Xe]),this.matchAt+=C(Xe)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Xe=this.regexes.map(bt=>bt[1]);this.matcherRe=_e(D(Xe,{joinWith:"|"}),!0),this.lastIndex=0}exec(Xe){this.matcherRe.lastIndex=this.lastIndex;const bt=this.matcherRe.exec(Xe);if(!bt)return null;const ur=bt.findIndex((La,fc)=>fc>0&&La!==void 0),Fn=this.matchIndexes[ur];return bt.splice(0,ur),Object.assign(bt,Fn)}}class _t{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Xe){if(this.multiRegexes[Xe])return this.multiRegexes[Xe];const bt=new je;return this.rules.slice(Xe).forEach(([ur,Fn])=>bt.addRule(ur,Fn)),bt.compile(),this.multiRegexes[Xe]=bt,bt}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Xe,bt){this.rules.push([Xe,bt]),bt.type==="begin"&&this.count++}exec(Xe){const bt=this.getMatcher(this.regexIndex);bt.lastIndex=this.lastIndex;let ur=bt.exec(Xe);if(this.resumingScanAtSamePosition()&&!(ur&&ur.index===this.lastIndex)){const Fn=this.getMatcher(0);Fn.lastIndex=this.lastIndex+1,ur=Fn.exec(Xe)}return ur&&(this.regexIndex+=ur.position+1,this.regexIndex===this.count&&this.considerAll()),ur}}function Rn(et){const Xe=new _t;return et.contains.forEach(bt=>Xe.addRule(bt.begin,{rule:bt,type:"begin"})),et.terminatorEnd&&Xe.addRule(et.terminatorEnd,{type:"end"}),et.illegal&&Xe.addRule(et.illegal,{type:"illegal"}),Xe}function yn(et,Xe){const bt=et;if(et.isCompiled)return bt;[Un,Yt,hi,$t].forEach(Fn=>Fn(et,Xe)),Q.compilerExtensions.forEach(Fn=>Fn(et,Xe)),et.__beforeBegin=null,[At,gt,Qe].forEach(Fn=>Fn(et,Xe)),et.isCompiled=!0;let ur=null;return typeof et.keywords=="object"&&et.keywords.$pattern&&(et.keywords=Object.assign({},et.keywords),ur=et.keywords.$pattern,delete et.keywords.$pattern),ur=ur||/\w+/,et.keywords&&(et.keywords=vn(et.keywords,Q.case_insensitive)),bt.keywordPatternRe=_e(ur,!0),Xe&&(et.begin||(et.begin=/\B|\b/),bt.beginRe=_e(bt.begin),!et.end&&!et.endsWithParent&&(et.end=/\B|\b/),et.end&&(bt.endRe=_e(bt.end)),bt.terminatorEnd=p(bt.end)||"",et.endsWithParent&&Xe.terminatorEnd&&(bt.terminatorEnd+=(et.end?"|":"")+Xe.terminatorEnd)),et.illegal&&(bt.illegalRe=_e(et.illegal)),et.contains||(et.contains=[]),et.contains=[].concat(...et.contains.map(function(Fn){return er(Fn==="self"?et:Fn)})),et.contains.forEach(function(Fn){yn(Fn,bt)}),et.starts&&yn(et.starts,Xe),bt.matcher=Rn(bt),bt}if(Q.compilerExtensions||(Q.compilerExtensions=[]),Q.contains&&Q.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language.  See documentation.");return Q.classNameAliases=r(Q.classNameAliases||{}),yn(Q)}function hn(Q){return Q?Q.endsWithParent||hn(Q.starts):!1}function er(Q){return Q.variants&&!Q.cachedVariants&&(Q.cachedVariants=Q.variants.map(function(_e){return r(Q,{variants:null},_e)})),Q.cachedVariants?Q.cachedVariants:hn(Q)?r(Q,{starts:Q.starts?r(Q.starts):null}):Object.isFrozen(Q)?r(Q):Q}var xt="11.11.1";class ni extends Error{constructor(_e,je){super(_e),this.name="HTMLInjectionError",this.html=je}}const Je=n,Qt=r,Pe=Symbol("nomatch"),kn=7,Mn=function(Q){const _e=Object.create(null),je=Object.create(null),_t=[];let Rn=!0;const yn="Could not find the language '{}', did you forget to load/include a language module?",et={disableAutodetect:!0,name:"Plain text",contains:[]};let Xe={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:f};function bt(De){return Xe.noHighlightRe.test(De)}function ur(De){let st=De.className+" ";st+=De.parentNode?De.parentNode.className:"";const Lt=Xe.languageDetectRe.exec(st);if(Lt){const an=pi(Lt[1]);return an||(lr(yn.replace("{}",Lt[1])),lr("Falling back to no-highlight mode for this block.",De)),an?Lt[1]:"no-highlight"}return st.split(/\s+/).find(an=>bt(an)||pi(an))}function Fn(De,st,Lt){let an="",dr="";typeof st=="object"?(an=De,Lt=st.ignoreIllegals,dr=st.language):(ge("10.7.0","highlight(lang, code, ...args) has been deprecated."),ge("10.7.0",`Please use highlight(code, options) instead.
https://github.com/highlightjs/highlight.js/issues/2277`),dr=De,an=st),Lt===void 0&&(Lt=!0);const ii={code:an,language:dr};ou("before:highlight",ii);const Ki=ii.result?ii.result:La(ii.language,ii.code,Lt);return Ki.code=ii.code,ou("after:highlight",Ki),Ki}function La(De,st,Lt,an){const dr=Object.create(null);function ii(ze,tt){return ze.keywords[tt]}function Ki(){if(!mt.keywords){vr.addText(on);return}let ze=0;mt.keywordPatternRe.lastIndex=0;let tt=mt.keywordPatternRe.exec(on),Ct="";for(;tt;){Ct+=on.substring(ze,tt.index);const qt=qr.case_insensitive?tt[0].toLowerCase():tt[0],Wn=ii(mt,qt);if(Wn){const[bs,a0]=Wn;if(vr.addText(Ct),Ct="",dr[qt]=(dr[qt]||0)+1,dr[qt]<=kn&&(Vo+=a0),bs.startsWith("_"))Ct+=tt[0];else{const dp=qr.classNameAliases[bs]||bs;Xi(tt[0],dp)}}else Ct+=tt[0];ze=mt.keywordPatternRe.lastIndex,tt=mt.keywordPatternRe.exec(on)}Ct+=on.substring(ze),vr.addText(Ct)}function Ni(){if(on==="")return;let ze=null;if(typeof mt.subLanguage=="string"){if(!_e[mt.subLanguage]){vr.addText(on);return}ze=La(mt.subLanguage,on,!0,cp[mt.subLanguage]),cp[mt.subLanguage]=ze._top}else ze=hc(on,mt.subLanguage.length?mt.subLanguage:null);mt.relevance>0&&(Vo+=ze.relevance),vr.__addSublanguage(ze._emitter,ze.language)}function Cn(){mt.subLanguage!=null?Ni():Ki(),on=""}function Xi(ze,tt){ze!==""&&(vr.startScope(tt),vr.addText(ze),vr.endScope())}function lp(ze,tt){let Ct=1;const qt=tt.length-1;for(;Ct<=qt;){if(!ze._emit[Ct]){Ct++;continue}const Wn=qr.classNameAliases[ze[Ct]]||ze[Ct],bs=tt[Ct];Wn?Xi(bs,Wn):(on=bs,Ki(),on=""),Ct++}}function mc(ze,tt){return ze.scope&&typeof ze.scope=="string"&&vr.openNode(qr.classNameAliases[ze.scope]||ze.scope),ze.beginScope&&(ze.beginScope._wrap?(Xi(on,qr.classNameAliases[ze.beginScope._wrap]||ze.beginScope._wrap),on=""):ze.beginScope._multi&&(lp(ze.beginScope,tt),on="")),mt=Object.create(ze,{parent:{value:mt}}),mt}function r0(ze,tt,Ct){let qt=O(ze.endRe,Ct);if(qt){if(ze["on:end"]){const Wn=new e(ze);ze["on:end"](tt,Wn),Wn.isMatchIgnored&&(qt=!1)}if(qt){for(;ze.endsParent&&ze.parent;)ze=ze.parent;return ze}}if(ze.endsWithParent)return r0(ze.parent,tt,Ct)}function gc(ze){return mt.matcher.regexIndex===0?(on+=ze[0],1):(Go=!0,0)}function rv(ze){const tt=ze[0],Ct=ze.rule,qt=new e(Ct),Wn=[Ct.__beforeBegin,Ct["on:begin"]];for(const bs of Wn)if(bs&&(bs(ze,qt),qt.isMatchIgnored))return gc(tt);return Ct.skip?on+=tt:(Ct.excludeBegin&&(on+=tt),Cn(),!Ct.returnBegin&&!Ct.excludeBegin&&(on=tt)),mc(Ct,ze),Ct.returnBegin?0:tt.length}function Oi(ze){const tt=ze[0],Ct=st.substring(ze.index),qt=r0(mt,ze,Ct);if(!qt)return Pe;const Wn=mt;mt.endScope&&mt.endScope._wrap?(Cn(),Xi(tt,mt.endScope._wrap)):mt.endScope&&mt.endScope._multi?(Cn(),lp(mt.endScope,ze)):Wn.skip?on+=tt:(Wn.returnEnd||Wn.excludeEnd||(on+=tt),Cn(),Wn.excludeEnd&&(on=tt));do mt.scope&&vr.closeNode(),!mt.skip&&!mt.subLanguage&&(Vo+=mt.relevance),mt=mt.parent;while(mt!==qt.parent);return qt.starts&&mc(qt.starts,ze),Wn.returnEnd?0:tt.length}function i0(){const ze=[];for(let tt=mt;tt!==qr;tt=tt.parent)tt.scope&&ze.unshift(tt.scope);ze.forEach(tt=>vr.openNode(tt))}let lu={};function bc(ze,tt){const Ct=tt&&tt[0];if(on+=ze,Ct==null)return Cn(),0;if(lu.type==="begin"&&tt.type==="end"&&lu.index===tt.index&&Ct===""){if(on+=st.slice(tt.index,tt.index+1),!Rn){const qt=new Error(`0 width match regex (${De})`);throw qt.languageName=De,qt.badRule=lu.rule,qt}return 1}if(lu=tt,tt.type==="begin")return rv(tt);if(tt.type==="illegal"&&!Lt){const qt=new Error('Illegal lexeme "'+Ct+'" for mode "'+(mt.scope||"<unnamed>")+'"');throw qt.mode=mt,qt}else if(tt.type==="end"){const qt=Oi(tt);if(qt!==Pe)return qt}if(tt.type==="illegal"&&Ct==="")return on+=`
`,1;if(s0>1e5&&s0>tt.index*3)throw new Error("potential infinite loop, way more iterations than matches");return on+=Ct,Ct.length}const qr=pi(De);if(!qr)throw fn(yn.replace("{}",De)),new Error('Unknown language: "'+De+'"');const up=Yn(qr);let vc="",mt=an||up;const cp={},vr=new Xe.__emitter(Xe);i0();let on="",Vo=0,za=0,s0=0,Go=!1;try{if(qr.__emitTokens)qr.__emitTokens(st,vr);else{for(mt.matcher.considerAll();;){s0++,Go?Go=!1:mt.matcher.considerAll(),mt.matcher.lastIndex=za;const ze=mt.matcher.exec(st);if(!ze)break;const tt=st.substring(za,ze.index),Ct=bc(tt,ze);za=ze.index+Ct}bc(st.substring(za))}return vr.finalize(),vc=vr.toHTML(),{language:De,value:vc,relevance:Vo,illegal:!1,_emitter:vr,_top:mt}}catch(ze){if(ze.message&&ze.message.includes("Illegal"))return{language:De,value:Je(st),illegal:!0,relevance:0,_illegalBy:{message:ze.message,index:za,context:st.slice(za-100,za+100),mode:ze.mode,resultSoFar:vc},_emitter:vr};if(Rn)return{language:De,value:Je(st),illegal:!1,relevance:0,errorRaised:ze,_emitter:vr,_top:mt};throw ze}}function fc(De){const st={value:Je(De),illegal:!1,relevance:0,_top:et,_emitter:new Xe.__emitter(Xe)};return st._emitter.addText(De),st}function hc(De,st){st=st||Xe.languages||Object.keys(_e);const Lt=fc(De),an=st.filter(pi).filter($o).map(Cn=>La(Cn,De,!1));an.unshift(Lt);const dr=an.sort((Cn,Xi)=>{if(Cn.relevance!==Xi.relevance)return Xi.relevance-Cn.relevance;if(Cn.language&&Xi.language){if(pi(Cn.language).supersetOf===Xi.language)return 1;if(pi(Xi.language).supersetOf===Cn.language)return-1}return 0}),[ii,Ki]=dr,Ni=ii;return Ni.secondBest=Ki,Ni}function ia(De,st,Lt){const an=st&&je[st]||Lt;De.classList.add("hljs"),De.classList.add(`language-${an}`)}function cr(De){let st=null;const Lt=ur(De);if(bt(Lt))return;if(ou("before:highlightElement",{el:De,language:Lt}),De.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",De);return}if(De.children.length>0&&(Xe.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(De)),Xe.throwUnescapedHTML))throw new ni("One of your code blocks includes unescaped HTML.",De.innerHTML);st=De;const an=st.textContent,dr=Lt?Fn(an,{language:Lt,ignoreIllegals:!0}):hc(an);De.innerHTML=dr.value,De.dataset.highlighted="yes",ia(De,Lt,dr.language),De.result={language:dr.language,re:dr.relevance,relevance:dr.relevance},dr.secondBest&&(De.secondBest={language:dr.secondBest.language,relevance:dr.secondBest.relevance}),ou("after:highlightElement",{el:De,result:dr,text:an})}function ri(De){Xe=Qt(Xe,De)}const jo=()=>{pc(),ge("10.6.0","initHighlighting() deprecated.  Use highlightAll() now.")};function t0(){pc(),ge("10.6.0","initHighlightingOnLoad() deprecated.  Use highlightAll() now.")}let sp=!1;function pc(){function De(){pc()}if(document.readyState==="loading"){sp||window.addEventListener("DOMContentLoaded",De,!1),sp=!0;return}document.querySelectorAll(Xe.cssSelector).forEach(cr)}function ap(De,st){let Lt=null;try{Lt=st(Q)}catch(an){if(fn("Language definition for '{}' could not be registered.".replace("{}",De)),Rn)fn(an);else throw an;Lt=et}Lt.name||(Lt.name=De),_e[De]=Lt,Lt.rawDefinition=st.bind(null,Q),Lt.aliases&&Pa(Lt.aliases,{languageName:De})}function au(De){delete _e[De];for(const st of Object.keys(je))je[st]===De&&delete je[st]}function n0(){return Object.keys(_e)}function pi(De){return De=(De||"").toLowerCase(),_e[De]||_e[je[De]]}function Pa(De,{languageName:st}){typeof De=="string"&&(De=[De]),De.forEach(Lt=>{je[Lt.toLowerCase()]=st})}function $o(De){const st=pi(De);return st&&!st.disableAutodetect}function qo(De){De["before:highlightBlock"]&&!De["before:highlightElement"]&&(De["before:highlightElement"]=st=>{De["before:highlightBlock"](Object.assign({block:st.el},st))}),De["after:highlightBlock"]&&!De["after:highlightElement"]&&(De["after:highlightElement"]=st=>{De["after:highlightBlock"](Object.assign({block:st.el},st))})}function br(De){qo(De),_t.push(De)}function op(De){const st=_t.indexOf(De);st!==-1&&_t.splice(st,1)}function ou(De,st){const Lt=De;_t.forEach(function(an){an[Lt]&&an[Lt](st)})}function Ba(De){return ge("10.7.0","highlightBlock will be removed entirely in v12.0"),ge("10.7.0","Please use highlightElement now."),cr(De)}Object.assign(Q,{highlight:Fn,highlightAuto:hc,highlightAll:pc,highlightElement:cr,highlightBlock:Ba,configure:ri,initHighlighting:jo,initHighlightingOnLoad:t0,registerLanguage:ap,unregisterLanguage:au,listLanguages:n0,getLanguage:pi,registerAliases:Pa,autoDetection:$o,inherit:Qt,addPlugin:br,removePlugin:op}),Q.debugMode=function(){Rn=!1},Q.safeMode=function(){Rn=!0},Q.versionString=xt,Q.regex={concat:E,lookahead:g,either:S,optional:v,anyNumberOfTimes:b};for(const De in St)typeof St[De]=="object"&&t(St[De]);return Object.assign(Q,St),Q},It=Mn({});return It.newInstance=()=>Mn({}),X2=It,It.HighlightJS=It,It.default=It,X2}var zee=Bee();const Uee=Oh(zee),c8={},Fee="hljs-";function Hee(t){const e=Uee.newInstance();return t&&s(t),{highlight:n,highlightAuto:r,listLanguages:i,register:s,registerAlias:a,registered:l};function n(u,d,f){const p=f||c8,g=typeof p.prefix=="string"?p.prefix:Fee;if(!e.getLanguage(u))throw new Error("Unknown language: `"+u+"` is not registered");e.configure({__emitter:jee,classPrefix:g});const b=e.highlight(d,{ignoreIllegals:!0,language:u});if(b.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:b.errorRaised});const v=b._emitter.root,E=v.data;return E.language=b.language,E.relevance=b.relevance,v}function r(u,d){const p=(d||c8).subset||i();let g=-1,b=0,v;for(;++g<p.length;){const E=p[g];if(!e.getLanguage(E))continue;const x=n(E,u,d);x.data&&x.data.relevance!==void 0&&x.data.relevance>b&&(b=x.data.relevance,v=x)}return v||{type:"root",children:[],data:{language:void 0,relevance:b}}}function i(){return e.listLanguages()}function s(u,d){if(typeof u=="string")e.registerLanguage(u,d);else{let f;for(f in u)Object.hasOwn(u,f)&&e.registerLanguage(f,u[f])}}function a(u,d){if(typeof u=="string")e.registerAliases(typeof d=="string"?d:[...d],{languageName:u});else{let f;for(f in u)if(Object.hasOwn(u,f)){const p=u[f];e.registerAliases(typeof p=="string"?p:[...p],{languageName:f})}}}function l(u){return!!e.getLanguage(u)}}class jee{constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=e:n.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,n){const r=this.stack[this.stack.length-1],i=e.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(e){const n=this,r=e.split(".").map(function(a,l){return l?a+"_".repeat(l):n.options.classPrefix+a}),i=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:r},children:[]};i.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const $ee={};function qee(t){const e=t||$ee,n=e.aliases,r=e.detect||!1,i=e.languages||Pee,s=e.plainText,a=e.prefix,l=e.subset;let u="hljs";const d=Hee(i);if(n&&d.registerAlias(n),a){const f=a.indexOf("-");u=f===-1?a:a.slice(0,f)}return function(f,p){jh(f,"element",function(g,b,v){if(g.tagName!=="code"||!v||v.type!=="element"||v.tagName!=="pre")return;const E=Vee(g);if(E===!1||!E&&!r||E&&s&&s.includes(E))return;Array.isArray(g.properties.className)||(g.properties.className=[]),g.properties.className.includes(u)||g.properties.className.unshift(u);const x=XO(g,{whitespace:"pre"});let S;try{S=E?d.highlight(E,x,{prefix:a}):d.highlightAuto(x,{prefix:a,subset:l})}catch(C){const O=C;if(E&&/Unknown language/.test(O.message)){p.message("Cannot highlight as `"+E+"`, it’s not registered",{ancestors:[v,g],cause:O,place:g.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw O}!E&&S.data&&S.data.language&&g.properties.className.push("language-"+S.data.language),S.children.length>0&&(g.children=S.children)})}}function Vee(t){const e=t.properties.className;let n=-1;if(!Array.isArray(e))return;let r;for(;++n<e.length;){const i=String(e[n]);if(i==="no-highlight"||i==="nohighlight")return!1;!r&&i.slice(0,5)==="lang-"&&(r=i.slice(5)),!r&&i.slice(0,9)==="language-"&&(r=i.slice(9))}return r}function Gee(t,e){return bM(t,{})||{type:"root",children:[]}}function bM(t,e){const n=Yee(t,e);return n&&e.afterTransform&&e.afterTransform(t,n),n}function Yee(t,e){switch(t.nodeType){case 1:return Qee(t,e);case 3:return Kee(t);case 8:return Xee(t);case 9:return d8(t,e);case 10:return Wee();case 11:return d8(t,e);default:return}}function d8(t,e){return{type:"root",children:vM(t,e)}}function Wee(){return{type:"doctype"}}function Kee(t){return{type:"text",value:t.nodeValue||""}}function Xee(t){return{type:"comment",value:t.nodeValue||""}}function Qee(t,e){const n=t.namespaceURI,r=n===va.svg?pO:hO,i=n===va.html?t.tagName.toLowerCase():t.tagName,s=n===va.html&&i==="template"?t.content:t,a=t.getAttributeNames(),l={};let u=-1;for(;++u<a.length;)l[a[u]]=t.getAttribute(a[u])||"";return r(i,l,vM(s,e))}function vM(t,e){const n=t.childNodes,r=[];let i=-1;for(;++i<n.length;){const s=bM(n[i],e);s!==void 0&&r.push(s)}return r}new DOMParser;function Zee(t,e){const n=Jee(t);return Gee(n)}function Jee(t){const e=document.createElement("template");return e.innerHTML=t,e.content}class Hi{constructor(e,n,r){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=n,this.end=r}static range(e,n){return n?!e||!e.loc||!n.loc||e.loc.lexer!==n.loc.lexer?null:new Hi(e.loc.lexer,e.loc.start,n.loc.end):e&&e.loc}}class ds{constructor(e,n){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=n}range(e,n){return new ds(n,Hi.range(this,e))}}class Le{constructor(e,n){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var r="KaTeX parse error: "+e,i,s,a=n&&n.loc;if(a&&a.start<=a.end){var l=a.lexer.input;i=a.start,s=a.end,i===l.length?r+=" at end of input: ":r+=" at position "+(i+1)+": ";var u=l.slice(i,s).replace(/[^]/g,"$&̲"),d;i>15?d="…"+l.slice(i-15,i):d=l.slice(0,i);var f;s+15<l.length?f=l.slice(s,s+15)+"…":f=l.slice(s),r+=d+u+f}var p=new Error(r);return p.name="ParseError",p.__proto__=Le.prototype,p.position=i,i!=null&&s!=null&&(p.length=s-i),p.rawMessage=e,p}}Le.prototype.__proto__=Error.prototype;var ete=function(e,n){return e===void 0?n:e},tte=/([A-Z])/g,nte=function(e){return e.replace(tte,"-$1").toLowerCase()},rte={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},ite=/[&><"']/g;function ste(t){return String(t).replace(ite,e=>rte[e])}var yM=function t(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?t(e.body[0]):e:e.type==="font"?t(e.body):e},ate=function(e){var n=yM(e);return n.type==="mathord"||n.type==="textord"||n.type==="atom"},ote=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},lte=function(e){var n=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return n?n[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(n[1])?null:n[1].toLowerCase():"_relative"},en={deflt:ete,escape:ste,hyphenate:nte,getBaseElem:yM,isCharacterBox:ate,protocolFromUrl:lte},Tg={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:t=>"#"+t},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(t,e)=>(e.push(t),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:t=>Math.max(0,t),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:t=>Math.max(0,t),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:t=>Math.max(0,t),cli:"-e, --max-expand <n>",cliProcessor:t=>t==="Infinity"?1/0:parseInt(t)},globalGroup:{type:"boolean",cli:!1}};function ute(t){if(t.default)return t.default;var e=t.type,n=Array.isArray(e)?e[0]:e;if(typeof n!="string")return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class q_{constructor(e){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var n in Tg)if(Tg.hasOwnProperty(n)){var r=Tg[n];this[n]=e[n]!==void 0?r.processor?r.processor(e[n]):e[n]:ute(r)}}reportNonstrict(e,n,r){var i=this.strict;if(typeof i=="function"&&(i=i(e,n,r)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new Le("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+e+"]"),r);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+n+" ["+e+"]"))}}useStrictBehavior(e,n,r){var i=this.strict;if(typeof i=="function")try{i=i(e,n,r)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+n+" ["+e+"]")),!1)}isTrusted(e){if(e.url&&!e.protocol){var n=en.protocolFromUrl(e.url);if(n==null)return!1;e.protocol=n}var r=typeof this.trust=="function"?this.trust(e):this.trust;return!!r}}class bl{constructor(e,n,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=n,this.cramped=r}sup(){return ga[cte[this.id]]}sub(){return ga[dte[this.id]]}fracNum(){return ga[fte[this.id]]}fracDen(){return ga[hte[this.id]]}cramp(){return ga[pte[this.id]]}text(){return ga[mte[this.id]]}isTight(){return this.size>=2}}var V_=0,Gg=1,bd=2,So=3,ch=4,Ds=5,kd=6,Ti=7,ga=[new bl(V_,0,!1),new bl(Gg,0,!0),new bl(bd,1,!1),new bl(So,1,!0),new bl(ch,2,!1),new bl(Ds,2,!0),new bl(kd,3,!1),new bl(Ti,3,!0)],cte=[ch,Ds,ch,Ds,kd,Ti,kd,Ti],dte=[Ds,Ds,Ds,Ds,Ti,Ti,Ti,Ti],fte=[bd,So,ch,Ds,kd,Ti,kd,Ti],hte=[So,So,Ds,Ds,Ti,Ti,Ti,Ti],pte=[Gg,Gg,So,So,Ds,Ds,Ti,Ti],mte=[V_,Gg,bd,So,bd,So,bd,So],ft={DISPLAY:ga[V_],TEXT:ga[bd],SCRIPT:ga[ch],SCRIPTSCRIPT:ga[kd]},H4=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function gte(t){for(var e=0;e<H4.length;e++)for(var n=H4[e],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(t>=i[0]&&t<=i[1])return n.name}return null}var Sg=[];H4.forEach(t=>t.blocks.forEach(e=>Sg.push(...e)));function EM(t){for(var e=0;e<Sg.length;e+=2)if(t>=Sg[e]&&t<=Sg[e+1])return!0;return!1}var Xc=80,bte=function(e,n){return"M95,"+(622+e+n)+`
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
c69,-144,104.5,-217.7,106.5,-221
l`+e/2.075+" -"+e+`
c5.3,-9.3,12,-14,20,-14
H400000v`+(40+e)+`H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M`+(834+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},vte=function(e,n){return"M263,"+(601+e+n)+`c0.7,0,18,39.7,52,119
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
c340,-704.7,510.7,-1060.3,512,-1067
l`+e/2.084+" -"+e+`
c4.7,-7.3,11,-11,19,-11
H40000v`+(40+e)+`H1012.3
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
M`+(1001+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},yte=function(e,n){return"M983 "+(10+e+n)+`
l`+e/3.13+" -"+e+`
c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
M`+(1001+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},Ete=function(e,n){return"M424,"+(2398+e+n)+`
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
l`+e/4.223+" -"+e+`c4,-6.7,10,-10,18,-10 H400000
v`+(40+e)+`H1014.6
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+n+`
h400000v`+(40+e)+"h-400000z"},_te=function(e,n){return"M473,"+(2713+e+n)+`
c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+`
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
606zM`+(1001+e)+" "+n+"h400000v"+(40+e)+"H1017.7z"},xte=function(e){var n=e/2;return"M400000 "+e+" H0 L"+n+" 0 l65 45 L145 "+(e-80)+" H400000z"},Tte=function(e,n,r){var i=r-54-n-e;return"M702 "+(e+n)+"H400000"+(40+e)+`
H742v`+i+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
219 661 l218 661zM702 `+n+"H400000v"+(40+e)+"H742z"},Ste=function(e,n,r){n=1e3*n;var i="";switch(e){case"sqrtMain":i=bte(n,Xc);break;case"sqrtSize1":i=vte(n,Xc);break;case"sqrtSize2":i=yte(n,Xc);break;case"sqrtSize3":i=Ete(n,Xc);break;case"sqrtSize4":i=_te(n,Xc);break;case"sqrtTall":i=Tte(n,Xc,r)}return i},wte=function(e,n){switch(e){case"⎜":return"M291 0 H417 V"+n+" H291z M291 0 H417 V"+n+" H291z";case"∣":return"M145 0 H188 V"+n+" H145z M145 0 H188 V"+n+" H145z";case"∥":return"M145 0 H188 V"+n+" H145z M145 0 H188 V"+n+" H145z"+("M367 0 H410 V"+n+" H367z M367 0 H410 V"+n+" H367z");case"⎟":return"M457 0 H583 V"+n+" H457z M457 0 H583 V"+n+" H457z";case"⎢":return"M319 0 H403 V"+n+" H319z M319 0 H403 V"+n+" H319z";case"⎥":return"M263 0 H347 V"+n+" H263z M263 0 H347 V"+n+" H263z";case"⎪":return"M384 0 H504 V"+n+" H384z M384 0 H504 V"+n+" H384z";case"⏐":return"M312 0 H355 V"+n+" H312z M312 0 H355 V"+n+" H312z";case"‖":return"M257 0 H300 V"+n+" H257z M257 0 H300 V"+n+" H257z"+("M478 0 H521 V"+n+" H478z M478 0 H521 V"+n+" H478z");default:return""}},f8={doubleleftarrow:`M262 157
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
 l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
 435 0h399565z`,leftgroupunder:`M400000 262
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,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`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
 -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
 -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},kte=function(e,n){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 h347 v-84
H403z M403 1759 V0 H319 V1759 v`+n+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v1759 H0 v84 H347z
M347 1759 V0 H263 V1759 v`+n+" v1759 h84z";case"vert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+" v585 h43z";case"doublevert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+` v585 h43z
M367 15 v585 v`+n+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+n+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+n+` v1715 h263 v84 H319z
MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+` v1799 H0 v-84 H319z
MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v602 h84z
M403 1759 V0 H319 V1759 v`+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v602 h84z
M347 1759 V0 h-84 V1759 v`+n+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
-36,557 l0,`+(n+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
l0,-`+(n+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(n+9)+`
c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class Gh{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){for(var e="",n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e}toText(){var e=n=>n.toText();return this.children.map(e).join("")}}var ya={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Pm={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},h8={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function Cte(t,e){ya[t]=e}function G_(t,e,n){if(!ya[e])throw new Error("Font metrics not found for font: "+e+".");var r=t.charCodeAt(0),i=ya[e][r];if(!i&&t[0]in h8&&(r=h8[t[0]].charCodeAt(0),i=ya[e][r]),!i&&n==="text"&&EM(r)&&(i=ya[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var Q2={};function Ate(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!Q2[e]){var n=Q2[e]={cssEmPerMu:Pm.quad[e]/18};for(var r in Pm)Pm.hasOwnProperty(r)&&(n[r]=Pm[r][e])}return Q2[e]}var Nte=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],p8=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],m8=function(e,n){return n.size<2?e:Nte[e-1][n.size-1]};let _M=class Du{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||Du.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=p8[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);return new Du(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:m8(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:p8[e-1]})}havingBaseStyle(e){e=e||this.style.text();var n=m8(Du.BASESIZE,e);return this.size===n&&this.textSize===Du.BASESIZE&&this.style===e?this:this.extend({style:e,size:n})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Du.BASESIZE?["sizing","reset-size"+this.size,"size"+Du.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=Ate(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}};_M.BASESIZE=6;var j4={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},Ote={ex:!0,em:!0,mu:!0},xM=function(e){return typeof e!="string"&&(e=e.unit),e in j4||e in Ote||e==="ex"},Zn=function(e,n){var r;if(e.unit in j4)r=j4[e.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(e.unit==="mu")r=n.fontMetrics().cssEmPerMu;else{var i;if(n.style.isTight()?i=n.havingStyle(n.style.text()):i=n,e.unit==="ex")r=i.fontMetrics().xHeight;else if(e.unit==="em")r=i.fontMetrics().quad;else throw new Le("Invalid unit: '"+e.unit+"'");i!==n&&(r*=i.sizeMultiplier/n.sizeMultiplier)}return Math.min(e.number*r,n.maxSize)},Ue=function(e){return+e.toFixed(4)+"em"},Wl=function(e){return e.filter(n=>n).join(" ")},TM=function(e,n,r){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},n){n.style.isTight()&&this.classes.push("mtight");var i=n.getColor();i&&(this.style.color=i)}},SM=function(e){var n=document.createElement(e);n.className=Wl(this.classes);for(var r in this.style)this.style.hasOwnProperty(r)&&(n.style[r]=this.style[r]);for(var i in this.attributes)this.attributes.hasOwnProperty(i)&&n.setAttribute(i,this.attributes[i]);for(var s=0;s<this.children.length;s++)n.appendChild(this.children[s].toNode());return n},Mte=/[\s"'>/=\x00-\x1f]/,wM=function(e){var n="<"+e;this.classes.length&&(n+=' class="'+en.escape(Wl(this.classes))+'"');var r="";for(var i in this.style)this.style.hasOwnProperty(i)&&(r+=en.hyphenate(i)+":"+this.style[i]+";");r&&(n+=' style="'+en.escape(r)+'"');for(var s in this.attributes)if(this.attributes.hasOwnProperty(s)){if(Mte.test(s))throw new Le("Invalid attribute name '"+s+"'");n+=" "+s+'="'+en.escape(this.attributes[s])+'"'}n+=">";for(var a=0;a<this.children.length;a++)n+=this.children[a].toMarkup();return n+="</"+e+">",n};class Yh{constructor(e,n,r,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,TM.call(this,e,r,i),this.children=n||[]}setAttribute(e,n){this.attributes[e]=n}hasClass(e){return this.classes.includes(e)}toNode(){return SM.call(this,"span")}toMarkup(){return wM.call(this,"span")}}class Y_{constructor(e,n,r,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,TM.call(this,n,i),this.children=r||[],this.setAttribute("href",e)}setAttribute(e,n){this.attributes[e]=n}hasClass(e){return this.classes.includes(e)}toNode(){return SM.call(this,"a")}toMarkup(){return wM.call(this,"a")}}class Rte{constructor(e,n,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=n,this.src=e,this.classes=["mord"],this.style=r}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(var n in this.style)this.style.hasOwnProperty(n)&&(e.style[n]=this.style[n]);return e}toMarkup(){var e='<img src="'+en.escape(this.src)+'"'+(' alt="'+en.escape(this.alt)+'"'),n="";for(var r in this.style)this.style.hasOwnProperty(r)&&(n+=en.hyphenate(r)+":"+this.style[r]+";");return n&&(e+=' style="'+en.escape(n)+'"'),e+="'/>",e}}var Dte={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class zs{constructor(e,n,r,i,s,a,l,u){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=n||0,this.depth=r||0,this.italic=i||0,this.skew=s||0,this.width=a||0,this.classes=l||[],this.style=u||{},this.maxFontSize=0;var d=gte(this.text.charCodeAt(0));d&&this.classes.push(d+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=Dte[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),n=null;this.italic>0&&(n=document.createElement("span"),n.style.marginRight=Ue(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=Wl(this.classes));for(var r in this.style)this.style.hasOwnProperty(r)&&(n=n||document.createElement("span"),n.style[r]=this.style[r]);return n?(n.appendChild(e),n):e}toMarkup(){var e=!1,n="<span";this.classes.length&&(e=!0,n+=' class="',n+=en.escape(Wl(this.classes)),n+='"');var r="";this.italic>0&&(r+="margin-right:"+this.italic+"em;");for(var i in this.style)this.style.hasOwnProperty(i)&&(r+=en.hyphenate(i)+":"+this.style[i]+";");r&&(e=!0,n+=' style="'+en.escape(r)+'"');var s=en.escape(this.text);return e?(n+=">",n+=s,n+="</span>",n):s}}class Mo{constructor(e,n){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=n||{}}toNode(){var e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"svg");for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&n.setAttribute(r,this.attributes[r]);for(var i=0;i<this.children.length;i++)n.appendChild(this.children[i].toNode());return n}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(e+=" "+n+'="'+en.escape(this.attributes[n])+'"');e+=">";for(var r=0;r<this.children.length;r++)e+=this.children[r].toMarkup();return e+="</svg>",e}}class Kl{constructor(e,n){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=n}toNode(){var e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"path");return this.alternate?n.setAttribute("d",this.alternate):n.setAttribute("d",f8[this.pathName]),n}toMarkup(){return this.alternate?'<path d="'+en.escape(this.alternate)+'"/>':'<path d="'+en.escape(f8[this.pathName])+'"/>'}}class $4{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"line");for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&n.setAttribute(r,this.attributes[r]);return n}toMarkup(){var e="<line";for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(e+=" "+n+'="'+en.escape(this.attributes[n])+'"');return e+="/>",e}}function g8(t){if(t instanceof zs)return t;throw new Error("Expected symbolNode but got "+String(t)+".")}function Ite(t){if(t instanceof Yh)return t;throw new Error("Expected span<HtmlDomNode> but got "+String(t)+".")}var Lte={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Pte={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},On={math:{},text:{}};function w(t,e,n,r,i,s){On[t][i]={font:e,group:n,replace:r},s&&r&&(On[t][r]=On[t][i])}var k="math",Ce="text",M="main",V="ams",qn="accent-token",Ke="bin",Ai="close",Wd="inner",dt="mathord",Ar="op-token",ms="open",Cb="punct",Y="rel",zo="spacing",te="textord";w(k,M,Y,"≡","\\equiv",!0);w(k,M,Y,"≺","\\prec",!0);w(k,M,Y,"≻","\\succ",!0);w(k,M,Y,"∼","\\sim",!0);w(k,M,Y,"⊥","\\perp");w(k,M,Y,"⪯","\\preceq",!0);w(k,M,Y,"⪰","\\succeq",!0);w(k,M,Y,"≃","\\simeq",!0);w(k,M,Y,"∣","\\mid",!0);w(k,M,Y,"≪","\\ll",!0);w(k,M,Y,"≫","\\gg",!0);w(k,M,Y,"≍","\\asymp",!0);w(k,M,Y,"∥","\\parallel");w(k,M,Y,"⋈","\\bowtie",!0);w(k,M,Y,"⌣","\\smile",!0);w(k,M,Y,"⊑","\\sqsubseteq",!0);w(k,M,Y,"⊒","\\sqsupseteq",!0);w(k,M,Y,"≐","\\doteq",!0);w(k,M,Y,"⌢","\\frown",!0);w(k,M,Y,"∋","\\ni",!0);w(k,M,Y,"∝","\\propto",!0);w(k,M,Y,"⊢","\\vdash",!0);w(k,M,Y,"⊣","\\dashv",!0);w(k,M,Y,"∋","\\owns");w(k,M,Cb,".","\\ldotp");w(k,M,Cb,"⋅","\\cdotp");w(k,M,te,"#","\\#");w(Ce,M,te,"#","\\#");w(k,M,te,"&","\\&");w(Ce,M,te,"&","\\&");w(k,M,te,"ℵ","\\aleph",!0);w(k,M,te,"∀","\\forall",!0);w(k,M,te,"ℏ","\\hbar",!0);w(k,M,te,"∃","\\exists",!0);w(k,M,te,"∇","\\nabla",!0);w(k,M,te,"♭","\\flat",!0);w(k,M,te,"ℓ","\\ell",!0);w(k,M,te,"♮","\\natural",!0);w(k,M,te,"♣","\\clubsuit",!0);w(k,M,te,"℘","\\wp",!0);w(k,M,te,"♯","\\sharp",!0);w(k,M,te,"♢","\\diamondsuit",!0);w(k,M,te,"ℜ","\\Re",!0);w(k,M,te,"♡","\\heartsuit",!0);w(k,M,te,"ℑ","\\Im",!0);w(k,M,te,"♠","\\spadesuit",!0);w(k,M,te,"§","\\S",!0);w(Ce,M,te,"§","\\S");w(k,M,te,"¶","\\P",!0);w(Ce,M,te,"¶","\\P");w(k,M,te,"†","\\dag");w(Ce,M,te,"†","\\dag");w(Ce,M,te,"†","\\textdagger");w(k,M,te,"‡","\\ddag");w(Ce,M,te,"‡","\\ddag");w(Ce,M,te,"‡","\\textdaggerdbl");w(k,M,Ai,"⎱","\\rmoustache",!0);w(k,M,ms,"⎰","\\lmoustache",!0);w(k,M,Ai,"⟯","\\rgroup",!0);w(k,M,ms,"⟮","\\lgroup",!0);w(k,M,Ke,"∓","\\mp",!0);w(k,M,Ke,"⊖","\\ominus",!0);w(k,M,Ke,"⊎","\\uplus",!0);w(k,M,Ke,"⊓","\\sqcap",!0);w(k,M,Ke,"∗","\\ast");w(k,M,Ke,"⊔","\\sqcup",!0);w(k,M,Ke,"◯","\\bigcirc",!0);w(k,M,Ke,"∙","\\bullet",!0);w(k,M,Ke,"‡","\\ddagger");w(k,M,Ke,"≀","\\wr",!0);w(k,M,Ke,"⨿","\\amalg");w(k,M,Ke,"&","\\And");w(k,M,Y,"⟵","\\longleftarrow",!0);w(k,M,Y,"⇐","\\Leftarrow",!0);w(k,M,Y,"⟸","\\Longleftarrow",!0);w(k,M,Y,"⟶","\\longrightarrow",!0);w(k,M,Y,"⇒","\\Rightarrow",!0);w(k,M,Y,"⟹","\\Longrightarrow",!0);w(k,M,Y,"↔","\\leftrightarrow",!0);w(k,M,Y,"⟷","\\longleftrightarrow",!0);w(k,M,Y,"⇔","\\Leftrightarrow",!0);w(k,M,Y,"⟺","\\Longleftrightarrow",!0);w(k,M,Y,"↦","\\mapsto",!0);w(k,M,Y,"⟼","\\longmapsto",!0);w(k,M,Y,"↗","\\nearrow",!0);w(k,M,Y,"↩","\\hookleftarrow",!0);w(k,M,Y,"↪","\\hookrightarrow",!0);w(k,M,Y,"↘","\\searrow",!0);w(k,M,Y,"↼","\\leftharpoonup",!0);w(k,M,Y,"⇀","\\rightharpoonup",!0);w(k,M,Y,"↙","\\swarrow",!0);w(k,M,Y,"↽","\\leftharpoondown",!0);w(k,M,Y,"⇁","\\rightharpoondown",!0);w(k,M,Y,"↖","\\nwarrow",!0);w(k,M,Y,"⇌","\\rightleftharpoons",!0);w(k,V,Y,"≮","\\nless",!0);w(k,V,Y,"","\\@nleqslant");w(k,V,Y,"","\\@nleqq");w(k,V,Y,"⪇","\\lneq",!0);w(k,V,Y,"≨","\\lneqq",!0);w(k,V,Y,"","\\@lvertneqq");w(k,V,Y,"⋦","\\lnsim",!0);w(k,V,Y,"⪉","\\lnapprox",!0);w(k,V,Y,"⊀","\\nprec",!0);w(k,V,Y,"⋠","\\npreceq",!0);w(k,V,Y,"⋨","\\precnsim",!0);w(k,V,Y,"⪹","\\precnapprox",!0);w(k,V,Y,"≁","\\nsim",!0);w(k,V,Y,"","\\@nshortmid");w(k,V,Y,"∤","\\nmid",!0);w(k,V,Y,"⊬","\\nvdash",!0);w(k,V,Y,"⊭","\\nvDash",!0);w(k,V,Y,"⋪","\\ntriangleleft");w(k,V,Y,"⋬","\\ntrianglelefteq",!0);w(k,V,Y,"⊊","\\subsetneq",!0);w(k,V,Y,"","\\@varsubsetneq");w(k,V,Y,"⫋","\\subsetneqq",!0);w(k,V,Y,"","\\@varsubsetneqq");w(k,V,Y,"≯","\\ngtr",!0);w(k,V,Y,"","\\@ngeqslant");w(k,V,Y,"","\\@ngeqq");w(k,V,Y,"⪈","\\gneq",!0);w(k,V,Y,"≩","\\gneqq",!0);w(k,V,Y,"","\\@gvertneqq");w(k,V,Y,"⋧","\\gnsim",!0);w(k,V,Y,"⪊","\\gnapprox",!0);w(k,V,Y,"⊁","\\nsucc",!0);w(k,V,Y,"⋡","\\nsucceq",!0);w(k,V,Y,"⋩","\\succnsim",!0);w(k,V,Y,"⪺","\\succnapprox",!0);w(k,V,Y,"≆","\\ncong",!0);w(k,V,Y,"","\\@nshortparallel");w(k,V,Y,"∦","\\nparallel",!0);w(k,V,Y,"⊯","\\nVDash",!0);w(k,V,Y,"⋫","\\ntriangleright");w(k,V,Y,"⋭","\\ntrianglerighteq",!0);w(k,V,Y,"","\\@nsupseteqq");w(k,V,Y,"⊋","\\supsetneq",!0);w(k,V,Y,"","\\@varsupsetneq");w(k,V,Y,"⫌","\\supsetneqq",!0);w(k,V,Y,"","\\@varsupsetneqq");w(k,V,Y,"⊮","\\nVdash",!0);w(k,V,Y,"⪵","\\precneqq",!0);w(k,V,Y,"⪶","\\succneqq",!0);w(k,V,Y,"","\\@nsubseteqq");w(k,V,Ke,"⊴","\\unlhd");w(k,V,Ke,"⊵","\\unrhd");w(k,V,Y,"↚","\\nleftarrow",!0);w(k,V,Y,"↛","\\nrightarrow",!0);w(k,V,Y,"⇍","\\nLeftarrow",!0);w(k,V,Y,"⇏","\\nRightarrow",!0);w(k,V,Y,"↮","\\nleftrightarrow",!0);w(k,V,Y,"⇎","\\nLeftrightarrow",!0);w(k,V,Y,"△","\\vartriangle");w(k,V,te,"ℏ","\\hslash");w(k,V,te,"▽","\\triangledown");w(k,V,te,"◊","\\lozenge");w(k,V,te,"Ⓢ","\\circledS");w(k,V,te,"®","\\circledR");w(Ce,V,te,"®","\\circledR");w(k,V,te,"∡","\\measuredangle",!0);w(k,V,te,"∄","\\nexists");w(k,V,te,"℧","\\mho");w(k,V,te,"Ⅎ","\\Finv",!0);w(k,V,te,"⅁","\\Game",!0);w(k,V,te,"‵","\\backprime");w(k,V,te,"▲","\\blacktriangle");w(k,V,te,"▼","\\blacktriangledown");w(k,V,te,"■","\\blacksquare");w(k,V,te,"⧫","\\blacklozenge");w(k,V,te,"★","\\bigstar");w(k,V,te,"∢","\\sphericalangle",!0);w(k,V,te,"∁","\\complement",!0);w(k,V,te,"ð","\\eth",!0);w(Ce,M,te,"ð","ð");w(k,V,te,"╱","\\diagup");w(k,V,te,"╲","\\diagdown");w(k,V,te,"□","\\square");w(k,V,te,"□","\\Box");w(k,V,te,"◊","\\Diamond");w(k,V,te,"¥","\\yen",!0);w(Ce,V,te,"¥","\\yen",!0);w(k,V,te,"✓","\\checkmark",!0);w(Ce,V,te,"✓","\\checkmark");w(k,V,te,"ℶ","\\beth",!0);w(k,V,te,"ℸ","\\daleth",!0);w(k,V,te,"ℷ","\\gimel",!0);w(k,V,te,"ϝ","\\digamma",!0);w(k,V,te,"ϰ","\\varkappa");w(k,V,ms,"┌","\\@ulcorner",!0);w(k,V,Ai,"┐","\\@urcorner",!0);w(k,V,ms,"└","\\@llcorner",!0);w(k,V,Ai,"┘","\\@lrcorner",!0);w(k,V,Y,"≦","\\leqq",!0);w(k,V,Y,"⩽","\\leqslant",!0);w(k,V,Y,"⪕","\\eqslantless",!0);w(k,V,Y,"≲","\\lesssim",!0);w(k,V,Y,"⪅","\\lessapprox",!0);w(k,V,Y,"≊","\\approxeq",!0);w(k,V,Ke,"⋖","\\lessdot");w(k,V,Y,"⋘","\\lll",!0);w(k,V,Y,"≶","\\lessgtr",!0);w(k,V,Y,"⋚","\\lesseqgtr",!0);w(k,V,Y,"⪋","\\lesseqqgtr",!0);w(k,V,Y,"≑","\\doteqdot");w(k,V,Y,"≓","\\risingdotseq",!0);w(k,V,Y,"≒","\\fallingdotseq",!0);w(k,V,Y,"∽","\\backsim",!0);w(k,V,Y,"⋍","\\backsimeq",!0);w(k,V,Y,"⫅","\\subseteqq",!0);w(k,V,Y,"⋐","\\Subset",!0);w(k,V,Y,"⊏","\\sqsubset",!0);w(k,V,Y,"≼","\\preccurlyeq",!0);w(k,V,Y,"⋞","\\curlyeqprec",!0);w(k,V,Y,"≾","\\precsim",!0);w(k,V,Y,"⪷","\\precapprox",!0);w(k,V,Y,"⊲","\\vartriangleleft");w(k,V,Y,"⊴","\\trianglelefteq");w(k,V,Y,"⊨","\\vDash",!0);w(k,V,Y,"⊪","\\Vvdash",!0);w(k,V,Y,"⌣","\\smallsmile");w(k,V,Y,"⌢","\\smallfrown");w(k,V,Y,"≏","\\bumpeq",!0);w(k,V,Y,"≎","\\Bumpeq",!0);w(k,V,Y,"≧","\\geqq",!0);w(k,V,Y,"⩾","\\geqslant",!0);w(k,V,Y,"⪖","\\eqslantgtr",!0);w(k,V,Y,"≳","\\gtrsim",!0);w(k,V,Y,"⪆","\\gtrapprox",!0);w(k,V,Ke,"⋗","\\gtrdot");w(k,V,Y,"⋙","\\ggg",!0);w(k,V,Y,"≷","\\gtrless",!0);w(k,V,Y,"⋛","\\gtreqless",!0);w(k,V,Y,"⪌","\\gtreqqless",!0);w(k,V,Y,"≖","\\eqcirc",!0);w(k,V,Y,"≗","\\circeq",!0);w(k,V,Y,"≜","\\triangleq",!0);w(k,V,Y,"∼","\\thicksim");w(k,V,Y,"≈","\\thickapprox");w(k,V,Y,"⫆","\\supseteqq",!0);w(k,V,Y,"⋑","\\Supset",!0);w(k,V,Y,"⊐","\\sqsupset",!0);w(k,V,Y,"≽","\\succcurlyeq",!0);w(k,V,Y,"⋟","\\curlyeqsucc",!0);w(k,V,Y,"≿","\\succsim",!0);w(k,V,Y,"⪸","\\succapprox",!0);w(k,V,Y,"⊳","\\vartriangleright");w(k,V,Y,"⊵","\\trianglerighteq");w(k,V,Y,"⊩","\\Vdash",!0);w(k,V,Y,"∣","\\shortmid");w(k,V,Y,"∥","\\shortparallel");w(k,V,Y,"≬","\\between",!0);w(k,V,Y,"⋔","\\pitchfork",!0);w(k,V,Y,"∝","\\varpropto");w(k,V,Y,"◀","\\blacktriangleleft");w(k,V,Y,"∴","\\therefore",!0);w(k,V,Y,"∍","\\backepsilon");w(k,V,Y,"▶","\\blacktriangleright");w(k,V,Y,"∵","\\because",!0);w(k,V,Y,"⋘","\\llless");w(k,V,Y,"⋙","\\gggtr");w(k,V,Ke,"⊲","\\lhd");w(k,V,Ke,"⊳","\\rhd");w(k,V,Y,"≂","\\eqsim",!0);w(k,M,Y,"⋈","\\Join");w(k,V,Y,"≑","\\Doteq",!0);w(k,V,Ke,"∔","\\dotplus",!0);w(k,V,Ke,"∖","\\smallsetminus");w(k,V,Ke,"⋒","\\Cap",!0);w(k,V,Ke,"⋓","\\Cup",!0);w(k,V,Ke,"⩞","\\doublebarwedge",!0);w(k,V,Ke,"⊟","\\boxminus",!0);w(k,V,Ke,"⊞","\\boxplus",!0);w(k,V,Ke,"⋇","\\divideontimes",!0);w(k,V,Ke,"⋉","\\ltimes",!0);w(k,V,Ke,"⋊","\\rtimes",!0);w(k,V,Ke,"⋋","\\leftthreetimes",!0);w(k,V,Ke,"⋌","\\rightthreetimes",!0);w(k,V,Ke,"⋏","\\curlywedge",!0);w(k,V,Ke,"⋎","\\curlyvee",!0);w(k,V,Ke,"⊝","\\circleddash",!0);w(k,V,Ke,"⊛","\\circledast",!0);w(k,V,Ke,"⋅","\\centerdot");w(k,V,Ke,"⊺","\\intercal",!0);w(k,V,Ke,"⋒","\\doublecap");w(k,V,Ke,"⋓","\\doublecup");w(k,V,Ke,"⊠","\\boxtimes",!0);w(k,V,Y,"⇢","\\dashrightarrow",!0);w(k,V,Y,"⇠","\\dashleftarrow",!0);w(k,V,Y,"⇇","\\leftleftarrows",!0);w(k,V,Y,"⇆","\\leftrightarrows",!0);w(k,V,Y,"⇚","\\Lleftarrow",!0);w(k,V,Y,"↞","\\twoheadleftarrow",!0);w(k,V,Y,"↢","\\leftarrowtail",!0);w(k,V,Y,"↫","\\looparrowleft",!0);w(k,V,Y,"⇋","\\leftrightharpoons",!0);w(k,V,Y,"↶","\\curvearrowleft",!0);w(k,V,Y,"↺","\\circlearrowleft",!0);w(k,V,Y,"↰","\\Lsh",!0);w(k,V,Y,"⇈","\\upuparrows",!0);w(k,V,Y,"↿","\\upharpoonleft",!0);w(k,V,Y,"⇃","\\downharpoonleft",!0);w(k,M,Y,"⊶","\\origof",!0);w(k,M,Y,"⊷","\\imageof",!0);w(k,V,Y,"⊸","\\multimap",!0);w(k,V,Y,"↭","\\leftrightsquigarrow",!0);w(k,V,Y,"⇉","\\rightrightarrows",!0);w(k,V,Y,"⇄","\\rightleftarrows",!0);w(k,V,Y,"↠","\\twoheadrightarrow",!0);w(k,V,Y,"↣","\\rightarrowtail",!0);w(k,V,Y,"↬","\\looparrowright",!0);w(k,V,Y,"↷","\\curvearrowright",!0);w(k,V,Y,"↻","\\circlearrowright",!0);w(k,V,Y,"↱","\\Rsh",!0);w(k,V,Y,"⇊","\\downdownarrows",!0);w(k,V,Y,"↾","\\upharpoonright",!0);w(k,V,Y,"⇂","\\downharpoonright",!0);w(k,V,Y,"⇝","\\rightsquigarrow",!0);w(k,V,Y,"⇝","\\leadsto");w(k,V,Y,"⇛","\\Rrightarrow",!0);w(k,V,Y,"↾","\\restriction");w(k,M,te,"‘","`");w(k,M,te,"$","\\$");w(Ce,M,te,"$","\\$");w(Ce,M,te,"$","\\textdollar");w(k,M,te,"%","\\%");w(Ce,M,te,"%","\\%");w(k,M,te,"_","\\_");w(Ce,M,te,"_","\\_");w(Ce,M,te,"_","\\textunderscore");w(k,M,te,"∠","\\angle",!0);w(k,M,te,"∞","\\infty",!0);w(k,M,te,"′","\\prime");w(k,M,te,"△","\\triangle");w(k,M,te,"Γ","\\Gamma",!0);w(k,M,te,"Δ","\\Delta",!0);w(k,M,te,"Θ","\\Theta",!0);w(k,M,te,"Λ","\\Lambda",!0);w(k,M,te,"Ξ","\\Xi",!0);w(k,M,te,"Π","\\Pi",!0);w(k,M,te,"Σ","\\Sigma",!0);w(k,M,te,"Υ","\\Upsilon",!0);w(k,M,te,"Φ","\\Phi",!0);w(k,M,te,"Ψ","\\Psi",!0);w(k,M,te,"Ω","\\Omega",!0);w(k,M,te,"A","Α");w(k,M,te,"B","Β");w(k,M,te,"E","Ε");w(k,M,te,"Z","Ζ");w(k,M,te,"H","Η");w(k,M,te,"I","Ι");w(k,M,te,"K","Κ");w(k,M,te,"M","Μ");w(k,M,te,"N","Ν");w(k,M,te,"O","Ο");w(k,M,te,"P","Ρ");w(k,M,te,"T","Τ");w(k,M,te,"X","Χ");w(k,M,te,"¬","\\neg",!0);w(k,M,te,"¬","\\lnot");w(k,M,te,"⊤","\\top");w(k,M,te,"⊥","\\bot");w(k,M,te,"∅","\\emptyset");w(k,V,te,"∅","\\varnothing");w(k,M,dt,"α","\\alpha",!0);w(k,M,dt,"β","\\beta",!0);w(k,M,dt,"γ","\\gamma",!0);w(k,M,dt,"δ","\\delta",!0);w(k,M,dt,"ϵ","\\epsilon",!0);w(k,M,dt,"ζ","\\zeta",!0);w(k,M,dt,"η","\\eta",!0);w(k,M,dt,"θ","\\theta",!0);w(k,M,dt,"ι","\\iota",!0);w(k,M,dt,"κ","\\kappa",!0);w(k,M,dt,"λ","\\lambda",!0);w(k,M,dt,"μ","\\mu",!0);w(k,M,dt,"ν","\\nu",!0);w(k,M,dt,"ξ","\\xi",!0);w(k,M,dt,"ο","\\omicron",!0);w(k,M,dt,"π","\\pi",!0);w(k,M,dt,"ρ","\\rho",!0);w(k,M,dt,"σ","\\sigma",!0);w(k,M,dt,"τ","\\tau",!0);w(k,M,dt,"υ","\\upsilon",!0);w(k,M,dt,"ϕ","\\phi",!0);w(k,M,dt,"χ","\\chi",!0);w(k,M,dt,"ψ","\\psi",!0);w(k,M,dt,"ω","\\omega",!0);w(k,M,dt,"ε","\\varepsilon",!0);w(k,M,dt,"ϑ","\\vartheta",!0);w(k,M,dt,"ϖ","\\varpi",!0);w(k,M,dt,"ϱ","\\varrho",!0);w(k,M,dt,"ς","\\varsigma",!0);w(k,M,dt,"φ","\\varphi",!0);w(k,M,Ke,"∗","*",!0);w(k,M,Ke,"+","+");w(k,M,Ke,"−","-",!0);w(k,M,Ke,"⋅","\\cdot",!0);w(k,M,Ke,"∘","\\circ",!0);w(k,M,Ke,"÷","\\div",!0);w(k,M,Ke,"±","\\pm",!0);w(k,M,Ke,"×","\\times",!0);w(k,M,Ke,"∩","\\cap",!0);w(k,M,Ke,"∪","\\cup",!0);w(k,M,Ke,"∖","\\setminus",!0);w(k,M,Ke,"∧","\\land");w(k,M,Ke,"∨","\\lor");w(k,M,Ke,"∧","\\wedge",!0);w(k,M,Ke,"∨","\\vee",!0);w(k,M,te,"√","\\surd");w(k,M,ms,"⟨","\\langle",!0);w(k,M,ms,"∣","\\lvert");w(k,M,ms,"∥","\\lVert");w(k,M,Ai,"?","?");w(k,M,Ai,"!","!");w(k,M,Ai,"⟩","\\rangle",!0);w(k,M,Ai,"∣","\\rvert");w(k,M,Ai,"∥","\\rVert");w(k,M,Y,"=","=");w(k,M,Y,":",":");w(k,M,Y,"≈","\\approx",!0);w(k,M,Y,"≅","\\cong",!0);w(k,M,Y,"≥","\\ge");w(k,M,Y,"≥","\\geq",!0);w(k,M,Y,"←","\\gets");w(k,M,Y,">","\\gt",!0);w(k,M,Y,"∈","\\in",!0);w(k,M,Y,"","\\@not");w(k,M,Y,"⊂","\\subset",!0);w(k,M,Y,"⊃","\\supset",!0);w(k,M,Y,"⊆","\\subseteq",!0);w(k,M,Y,"⊇","\\supseteq",!0);w(k,V,Y,"⊈","\\nsubseteq",!0);w(k,V,Y,"⊉","\\nsupseteq",!0);w(k,M,Y,"⊨","\\models");w(k,M,Y,"←","\\leftarrow",!0);w(k,M,Y,"≤","\\le");w(k,M,Y,"≤","\\leq",!0);w(k,M,Y,"<","\\lt",!0);w(k,M,Y,"→","\\rightarrow",!0);w(k,M,Y,"→","\\to");w(k,V,Y,"≱","\\ngeq",!0);w(k,V,Y,"≰","\\nleq",!0);w(k,M,zo," ","\\ ");w(k,M,zo," ","\\space");w(k,M,zo," ","\\nobreakspace");w(Ce,M,zo," ","\\ ");w(Ce,M,zo," "," ");w(Ce,M,zo," ","\\space");w(Ce,M,zo," ","\\nobreakspace");w(k,M,zo,null,"\\nobreak");w(k,M,zo,null,"\\allowbreak");w(k,M,Cb,",",",");w(k,M,Cb,";",";");w(k,V,Ke,"⊼","\\barwedge",!0);w(k,V,Ke,"⊻","\\veebar",!0);w(k,M,Ke,"⊙","\\odot",!0);w(k,M,Ke,"⊕","\\oplus",!0);w(k,M,Ke,"⊗","\\otimes",!0);w(k,M,te,"∂","\\partial",!0);w(k,M,Ke,"⊘","\\oslash",!0);w(k,V,Ke,"⊚","\\circledcirc",!0);w(k,V,Ke,"⊡","\\boxdot",!0);w(k,M,Ke,"△","\\bigtriangleup");w(k,M,Ke,"▽","\\bigtriangledown");w(k,M,Ke,"†","\\dagger");w(k,M,Ke,"⋄","\\diamond");w(k,M,Ke,"⋆","\\star");w(k,M,Ke,"◃","\\triangleleft");w(k,M,Ke,"▹","\\triangleright");w(k,M,ms,"{","\\{");w(Ce,M,te,"{","\\{");w(Ce,M,te,"{","\\textbraceleft");w(k,M,Ai,"}","\\}");w(Ce,M,te,"}","\\}");w(Ce,M,te,"}","\\textbraceright");w(k,M,ms,"{","\\lbrace");w(k,M,Ai,"}","\\rbrace");w(k,M,ms,"[","\\lbrack",!0);w(Ce,M,te,"[","\\lbrack",!0);w(k,M,Ai,"]","\\rbrack",!0);w(Ce,M,te,"]","\\rbrack",!0);w(k,M,ms,"(","\\lparen",!0);w(k,M,Ai,")","\\rparen",!0);w(Ce,M,te,"<","\\textless",!0);w(Ce,M,te,">","\\textgreater",!0);w(k,M,ms,"⌊","\\lfloor",!0);w(k,M,Ai,"⌋","\\rfloor",!0);w(k,M,ms,"⌈","\\lceil",!0);w(k,M,Ai,"⌉","\\rceil",!0);w(k,M,te,"\\","\\backslash");w(k,M,te,"∣","|");w(k,M,te,"∣","\\vert");w(Ce,M,te,"|","\\textbar",!0);w(k,M,te,"∥","\\|");w(k,M,te,"∥","\\Vert");w(Ce,M,te,"∥","\\textbardbl");w(Ce,M,te,"~","\\textasciitilde");w(Ce,M,te,"\\","\\textbackslash");w(Ce,M,te,"^","\\textasciicircum");w(k,M,Y,"↑","\\uparrow",!0);w(k,M,Y,"⇑","\\Uparrow",!0);w(k,M,Y,"↓","\\downarrow",!0);w(k,M,Y,"⇓","\\Downarrow",!0);w(k,M,Y,"↕","\\updownarrow",!0);w(k,M,Y,"⇕","\\Updownarrow",!0);w(k,M,Ar,"∐","\\coprod");w(k,M,Ar,"⋁","\\bigvee");w(k,M,Ar,"⋀","\\bigwedge");w(k,M,Ar,"⨄","\\biguplus");w(k,M,Ar,"⋂","\\bigcap");w(k,M,Ar,"⋃","\\bigcup");w(k,M,Ar,"∫","\\int");w(k,M,Ar,"∫","\\intop");w(k,M,Ar,"∬","\\iint");w(k,M,Ar,"∭","\\iiint");w(k,M,Ar,"∏","\\prod");w(k,M,Ar,"∑","\\sum");w(k,M,Ar,"⨂","\\bigotimes");w(k,M,Ar,"⨁","\\bigoplus");w(k,M,Ar,"⨀","\\bigodot");w(k,M,Ar,"∮","\\oint");w(k,M,Ar,"∯","\\oiint");w(k,M,Ar,"∰","\\oiiint");w(k,M,Ar,"⨆","\\bigsqcup");w(k,M,Ar,"∫","\\smallint");w(Ce,M,Wd,"…","\\textellipsis");w(k,M,Wd,"…","\\mathellipsis");w(Ce,M,Wd,"…","\\ldots",!0);w(k,M,Wd,"…","\\ldots",!0);w(k,M,Wd,"⋯","\\@cdots",!0);w(k,M,Wd,"⋱","\\ddots",!0);w(k,M,te,"⋮","\\varvdots");w(Ce,M,te,"⋮","\\varvdots");w(k,M,qn,"ˊ","\\acute");w(k,M,qn,"ˋ","\\grave");w(k,M,qn,"¨","\\ddot");w(k,M,qn,"~","\\tilde");w(k,M,qn,"ˉ","\\bar");w(k,M,qn,"˘","\\breve");w(k,M,qn,"ˇ","\\check");w(k,M,qn,"^","\\hat");w(k,M,qn,"⃗","\\vec");w(k,M,qn,"˙","\\dot");w(k,M,qn,"˚","\\mathring");w(k,M,dt,"","\\@imath");w(k,M,dt,"","\\@jmath");w(k,M,te,"ı","ı");w(k,M,te,"ȷ","ȷ");w(Ce,M,te,"ı","\\i",!0);w(Ce,M,te,"ȷ","\\j",!0);w(Ce,M,te,"ß","\\ss",!0);w(Ce,M,te,"æ","\\ae",!0);w(Ce,M,te,"œ","\\oe",!0);w(Ce,M,te,"ø","\\o",!0);w(Ce,M,te,"Æ","\\AE",!0);w(Ce,M,te,"Œ","\\OE",!0);w(Ce,M,te,"Ø","\\O",!0);w(Ce,M,qn,"ˊ","\\'");w(Ce,M,qn,"ˋ","\\`");w(Ce,M,qn,"ˆ","\\^");w(Ce,M,qn,"˜","\\~");w(Ce,M,qn,"ˉ","\\=");w(Ce,M,qn,"˘","\\u");w(Ce,M,qn,"˙","\\.");w(Ce,M,qn,"¸","\\c");w(Ce,M,qn,"˚","\\r");w(Ce,M,qn,"ˇ","\\v");w(Ce,M,qn,"¨",'\\"');w(Ce,M,qn,"˝","\\H");w(Ce,M,qn,"◯","\\textcircled");var kM={"--":!0,"---":!0,"``":!0,"''":!0};w(Ce,M,te,"–","--",!0);w(Ce,M,te,"–","\\textendash");w(Ce,M,te,"—","---",!0);w(Ce,M,te,"—","\\textemdash");w(Ce,M,te,"‘","`",!0);w(Ce,M,te,"‘","\\textquoteleft");w(Ce,M,te,"’","'",!0);w(Ce,M,te,"’","\\textquoteright");w(Ce,M,te,"“","``",!0);w(Ce,M,te,"“","\\textquotedblleft");w(Ce,M,te,"”","''",!0);w(Ce,M,te,"”","\\textquotedblright");w(k,M,te,"°","\\degree",!0);w(Ce,M,te,"°","\\degree");w(Ce,M,te,"°","\\textdegree",!0);w(k,M,te,"£","\\pounds");w(k,M,te,"£","\\mathsterling",!0);w(Ce,M,te,"£","\\pounds");w(Ce,M,te,"£","\\textsterling",!0);w(k,V,te,"✠","\\maltese");w(Ce,V,te,"✠","\\maltese");var b8='0123456789/@."';for(var Z2=0;Z2<b8.length;Z2++){var v8=b8.charAt(Z2);w(k,M,te,v8,v8)}var y8='0123456789!@*()-=+";:?/.,';for(var J2=0;J2<y8.length;J2++){var E8=y8.charAt(J2);w(Ce,M,te,E8,E8)}var Yg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(var eE=0;eE<Yg.length;eE++){var Bm=Yg.charAt(eE);w(k,M,dt,Bm,Bm),w(Ce,M,te,Bm,Bm)}w(k,V,te,"C","ℂ");w(Ce,V,te,"C","ℂ");w(k,V,te,"H","ℍ");w(Ce,V,te,"H","ℍ");w(k,V,te,"N","ℕ");w(Ce,V,te,"N","ℕ");w(k,V,te,"P","ℙ");w(Ce,V,te,"P","ℙ");w(k,V,te,"Q","ℚ");w(Ce,V,te,"Q","ℚ");w(k,V,te,"R","ℝ");w(Ce,V,te,"R","ℝ");w(k,V,te,"Z","ℤ");w(Ce,V,te,"Z","ℤ");w(k,M,dt,"h","ℎ");w(Ce,M,dt,"h","ℎ");var yt="";for(var gi=0;gi<Yg.length;gi++){var rr=Yg.charAt(gi);yt=String.fromCharCode(55349,56320+gi),w(k,M,dt,rr,yt),w(Ce,M,te,rr,yt),yt=String.fromCharCode(55349,56372+gi),w(k,M,dt,rr,yt),w(Ce,M,te,rr,yt),yt=String.fromCharCode(55349,56424+gi),w(k,M,dt,rr,yt),w(Ce,M,te,rr,yt),yt=String.fromCharCode(55349,56580+gi),w(k,M,dt,rr,yt),w(Ce,M,te,rr,yt),yt=String.fromCharCode(55349,56684+gi),w(k,M,dt,rr,yt),w(Ce,M,te,rr,yt),yt=String.fromCharCode(55349,56736+gi),w(k,M,dt,rr,yt),w(Ce,M,te,rr,yt),yt=String.fromCharCode(55349,56788+gi),w(k,M,dt,rr,yt),w(Ce,M,te,rr,yt),yt=String.fromCharCode(55349,56840+gi),w(k,M,dt,rr,yt),w(Ce,M,te,rr,yt),yt=String.fromCharCode(55349,56944+gi),w(k,M,dt,rr,yt),w(Ce,M,te,rr,yt),gi<26&&(yt=String.fromCharCode(55349,56632+gi),w(k,M,dt,rr,yt),w(Ce,M,te,rr,yt),yt=String.fromCharCode(55349,56476+gi),w(k,M,dt,rr,yt),w(Ce,M,te,rr,yt))}yt="𝕜";w(k,M,dt,"k",yt);w(Ce,M,te,"k",yt);for(var Cu=0;Cu<10;Cu++){var vl=Cu.toString();yt=String.fromCharCode(55349,57294+Cu),w(k,M,dt,vl,yt),w(Ce,M,te,vl,yt),yt=String.fromCharCode(55349,57314+Cu),w(k,M,dt,vl,yt),w(Ce,M,te,vl,yt),yt=String.fromCharCode(55349,57324+Cu),w(k,M,dt,vl,yt),w(Ce,M,te,vl,yt),yt=String.fromCharCode(55349,57334+Cu),w(k,M,dt,vl,yt),w(Ce,M,te,vl,yt)}var q4="ÐÞþ";for(var tE=0;tE<q4.length;tE++){var zm=q4.charAt(tE);w(k,M,dt,zm,zm),w(Ce,M,te,zm,zm)}var Um=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],_8=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],Bte=function(e,n){var r=e.charCodeAt(0),i=e.charCodeAt(1),s=(r-55296)*1024+(i-56320)+65536,a=n==="math"?0:1;if(119808<=s&&s<120484){var l=Math.floor((s-119808)/26);return[Um[l][2],Um[l][a]]}else if(120782<=s&&s<=120831){var u=Math.floor((s-120782)/10);return[_8[u][2],_8[u][a]]}else{if(s===120485||s===120486)return[Um[0][2],Um[0][a]];if(120486<s&&s<120782)return["",""];throw new Le("Unsupported character: "+e)}},Ab=function(e,n,r){return On[r][e]&&On[r][e].replace&&(e=On[r][e].replace),{value:e,metrics:G_(e,n,r)}},Vs=function(e,n,r,i,s){var a=Ab(e,n,r),l=a.metrics;e=a.value;var u;if(l){var d=l.italic;(r==="text"||i&&i.font==="mathit")&&(d=0),u=new zs(e,l.height,l.depth,d,l.skew,l.width,s)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+e+"' in style '"+n+"' and mode '"+r+"'")),u=new zs(e,0,0,0,0,0,s);if(i){u.maxFontSize=i.sizeMultiplier,i.style.isTight()&&u.classes.push("mtight");var f=i.getColor();f&&(u.style.color=f)}return u},zte=function(e,n,r,i){return i===void 0&&(i=[]),r.font==="boldsymbol"&&Ab(e,"Main-Bold",n).metrics?Vs(e,"Main-Bold",n,r,i.concat(["mathbf"])):e==="\\"||On[n][e].font==="main"?Vs(e,"Main-Regular",n,r,i):Vs(e,"AMS-Regular",n,r,i.concat(["amsrm"]))},Ute=function(e,n,r,i,s){return s!=="textord"&&Ab(e,"Math-BoldItalic",n).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},Fte=function(e,n,r){var i=e.mode,s=e.text,a=["mord"],l=i==="math"||i==="text"&&n.font,u=l?n.font:n.fontFamily,d="",f="";if(s.charCodeAt(0)===55349&&([d,f]=Bte(s,i)),d.length>0)return Vs(s,d,i,n,a.concat(f));if(u){var p,g;if(u==="boldsymbol"){var b=Ute(s,i,n,a,r);p=b.fontName,g=[b.fontClass]}else l?(p=NM[u].fontName,g=[u]):(p=Fm(u,n.fontWeight,n.fontShape),g=[u,n.fontWeight,n.fontShape]);if(Ab(s,p,i).metrics)return Vs(s,p,i,n,a.concat(g));if(kM.hasOwnProperty(s)&&p.slice(0,10)==="Typewriter"){for(var v=[],E=0;E<s.length;E++)v.push(Vs(s[E],p,i,n,a.concat(g)));return AM(v)}}if(r==="mathord")return Vs(s,"Math-Italic",i,n,a.concat(["mathnormal"]));if(r==="textord"){var x=On[i][s]&&On[i][s].font;if(x==="ams"){var S=Fm("amsrm",n.fontWeight,n.fontShape);return Vs(s,S,i,n,a.concat("amsrm",n.fontWeight,n.fontShape))}else if(x==="main"||!x){var C=Fm("textrm",n.fontWeight,n.fontShape);return Vs(s,C,i,n,a.concat(n.fontWeight,n.fontShape))}else{var O=Fm(x,n.fontWeight,n.fontShape);return Vs(s,O,i,n,a.concat(O,n.fontWeight,n.fontShape))}}else throw new Error("unexpected type: "+r+" in makeOrd")},Hte=(t,e)=>{if(Wl(t.classes)!==Wl(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize)return!1;if(t.classes.length===1){var n=t.classes[0];if(n==="mbin"||n==="mord")return!1}for(var r in t.style)if(t.style.hasOwnProperty(r)&&t.style[r]!==e.style[r])return!1;for(var i in e.style)if(e.style.hasOwnProperty(i)&&t.style[i]!==e.style[i])return!1;return!0},jte=t=>{for(var e=0;e<t.length-1;e++){var n=t[e],r=t[e+1];n instanceof zs&&r instanceof zs&&Hte(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,t.splice(e+1,1),e--)}return t},W_=function(e){for(var n=0,r=0,i=0,s=0;s<e.children.length;s++){var a=e.children[s];a.height>n&&(n=a.height),a.depth>r&&(r=a.depth),a.maxFontSize>i&&(i=a.maxFontSize)}e.height=n,e.depth=r,e.maxFontSize=i},Ui=function(e,n,r,i){var s=new Yh(e,n,r,i);return W_(s),s},CM=(t,e,n,r)=>new Yh(t,e,n,r),$te=function(e,n,r){var i=Ui([e],[],n);return i.height=Math.max(r||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),i.style.borderBottomWidth=Ue(i.height),i.maxFontSize=1,i},qte=function(e,n,r,i){var s=new Y_(e,n,r,i);return W_(s),s},AM=function(e){var n=new Gh(e);return W_(n),n},Vte=function(e,n){return e instanceof Gh?Ui([],[e],n):e},Gte=function(e){if(e.positionType==="individualShift"){for(var n=e.children,r=[n[0]],i=-n[0].shift-n[0].elem.depth,s=i,a=1;a<n.length;a++){var l=-n[a].shift-s-n[a].elem.depth,u=l-(n[a-1].elem.height+n[a-1].elem.depth);s=s+l,r.push({type:"kern",size:u}),r.push(n[a])}return{children:r,depth:i}}var d;if(e.positionType==="top"){for(var f=e.positionData,p=0;p<e.children.length;p++){var g=e.children[p];f-=g.type==="kern"?g.size:g.elem.height+g.elem.depth}d=f}else if(e.positionType==="bottom")d=-e.positionData;else{var b=e.children[0];if(b.type!=="elem")throw new Error('First child must have type "elem".');if(e.positionType==="shift")d=-b.elem.depth-e.positionData;else if(e.positionType==="firstBaseline")d=-b.elem.depth;else throw new Error("Invalid positionType "+e.positionType+".")}return{children:e.children,depth:d}},Yte=function(e,n){for(var{children:r,depth:i}=Gte(e),s=0,a=0;a<r.length;a++){var l=r[a];if(l.type==="elem"){var u=l.elem;s=Math.max(s,u.maxFontSize,u.height)}}s+=2;var d=Ui(["pstrut"],[]);d.style.height=Ue(s);for(var f=[],p=i,g=i,b=i,v=0;v<r.length;v++){var E=r[v];if(E.type==="kern")b+=E.size;else{var x=E.elem,S=E.wrapperClasses||[],C=E.wrapperStyle||{},O=Ui(S,[d,x],void 0,C);O.style.top=Ue(-s-b-x.depth),E.marginLeft&&(O.style.marginLeft=E.marginLeft),E.marginRight&&(O.style.marginRight=E.marginRight),f.push(O),b+=x.height+x.depth}p=Math.min(p,b),g=Math.max(g,b)}var L=Ui(["vlist"],f);L.style.height=Ue(g);var D;if(p<0){var R=Ui([],[]),F=Ui(["vlist"],[R]);F.style.height=Ue(-p);var G=Ui(["vlist-s"],[new zs("​")]);D=[Ui(["vlist-r"],[L,G]),Ui(["vlist-r"],[F])]}else D=[Ui(["vlist-r"],[L])];var Z=Ui(["vlist-t"],D);return D.length===2&&Z.classes.push("vlist-t2"),Z.height=g,Z.depth=-p,Z},Wte=(t,e)=>{var n=Ui(["mspace"],[],e),r=Zn(t,e);return n.style.marginRight=Ue(r),n},Fm=function(e,n,r){var i="";switch(e){case"amsrm":i="AMS";break;case"textrm":i="Main";break;case"textsf":i="SansSerif";break;case"texttt":i="Typewriter";break;default:i=e}var s;return n==="textbf"&&r==="textit"?s="BoldItalic":n==="textbf"?s="Bold":n==="textit"?s="Italic":s="Regular",i+"-"+s},NM={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},OM={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Kte=function(e,n){var[r,i,s]=OM[e],a=new Kl(r),l=new Mo([a],{width:Ue(i),height:Ue(s),style:"width:"+Ue(i),viewBox:"0 0 "+1e3*i+" "+1e3*s,preserveAspectRatio:"xMinYMin"}),u=CM(["overlay"],[l],n);return u.height=s,u.style.height=Ue(s),u.style.width=Ue(i),u},fe={fontMap:NM,makeSymbol:Vs,mathsym:zte,makeSpan:Ui,makeSvgSpan:CM,makeLineSpan:$te,makeAnchor:qte,makeFragment:AM,wrapFragment:Vte,makeVList:Yte,makeOrd:Fte,makeGlue:Wte,staticSvg:Kte,svgData:OM,tryCombineChars:jte},Kn={number:3,unit:"mu"},Au={number:4,unit:"mu"},no={number:5,unit:"mu"},Xte={mord:{mop:Kn,mbin:Au,mrel:no,minner:Kn},mop:{mord:Kn,mop:Kn,mrel:no,minner:Kn},mbin:{mord:Au,mop:Au,mopen:Au,minner:Au},mrel:{mord:no,mop:no,mopen:no,minner:no},mopen:{},mclose:{mop:Kn,mbin:Au,mrel:no,minner:Kn},mpunct:{mord:Kn,mop:Kn,mrel:no,mopen:Kn,mclose:Kn,mpunct:Kn,minner:Kn},minner:{mord:Kn,mop:Kn,mbin:Au,mrel:no,mopen:Kn,mpunct:Kn,minner:Kn}},Qte={mord:{mop:Kn},mop:{mord:Kn,mop:Kn},mbin:{},mrel:{},mopen:{},mclose:{mop:Kn},mpunct:{},minner:{mop:Kn}},MM={},Wg={},Kg={};function Ye(t){for(var{type:e,names:n,props:r,handler:i,htmlBuilder:s,mathmlBuilder:a}=t,l={type:e,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:i},u=0;u<n.length;++u)MM[n[u]]=l;e&&(s&&(Wg[e]=s),a&&(Kg[e]=a))}function lc(t){var{type:e,htmlBuilder:n,mathmlBuilder:r}=t;Ye({type:e,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:r})}var Xg=function(e){return e.type==="ordgroup"&&e.body.length===1?e.body[0]:e},gr=function(e){return e.type==="ordgroup"?e.body:[e]},Ro=fe.makeSpan,Zte=["leftmost","mbin","mopen","mrel","mop","mpunct"],Jte=["rightmost","mrel","mclose","mpunct"],ene={display:ft.DISPLAY,text:ft.TEXT,script:ft.SCRIPT,scriptscript:ft.SCRIPTSCRIPT},tne={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Lr=function(e,n,r,i){i===void 0&&(i=[null,null]);for(var s=[],a=0;a<e.length;a++){var l=Xt(e[a],n);if(l instanceof Gh){var u=l.children;s.push(...u)}else s.push(l)}if(fe.tryCombineChars(s),!r)return s;var d=n;if(e.length===1){var f=e[0];f.type==="sizing"?d=n.havingSize(f.size):f.type==="styling"&&(d=n.havingStyle(ene[f.style]))}var p=Ro([i[0]||"leftmost"],[],n),g=Ro([i[1]||"rightmost"],[],n),b=r==="root";return x8(s,(v,E)=>{var x=E.classes[0],S=v.classes[0];x==="mbin"&&Jte.includes(S)?E.classes[0]="mord":S==="mbin"&&Zte.includes(x)&&(v.classes[0]="mord")},{node:p},g,b),x8(s,(v,E)=>{var x=V4(E),S=V4(v),C=x&&S?v.hasClass("mtight")?Qte[x][S]:Xte[x][S]:null;if(C)return fe.makeGlue(C,d)},{node:p},g,b),s},x8=function t(e,n,r,i,s){i&&e.push(i);for(var a=0;a<e.length;a++){var l=e[a],u=RM(l);if(u){t(u.children,n,r,null,s);continue}var d=!l.hasClass("mspace");if(d){var f=n(l,r.node);f&&(r.insertAfter?r.insertAfter(f):(e.unshift(f),a++))}d?r.node=l:s&&l.hasClass("newline")&&(r.node=Ro(["leftmost"])),r.insertAfter=(p=>g=>{e.splice(p+1,0,g),a++})(a)}i&&e.pop()},RM=function(e){return e instanceof Gh||e instanceof Y_||e instanceof Yh&&e.hasClass("enclosing")?e:null},nne=function t(e,n){var r=RM(e);if(r){var i=r.children;if(i.length){if(n==="right")return t(i[i.length-1],"right");if(n==="left")return t(i[0],"left")}}return e},V4=function(e,n){return e?(n&&(e=nne(e,n)),tne[e.classes[0]]||null):null},dh=function(e,n){var r=["nulldelimiter"].concat(e.baseSizingClasses());return Ro(n.concat(r))},Xt=function(e,n,r){if(!e)return Ro();if(Wg[e.type]){var i=Wg[e.type](e,n);if(r&&n.size!==r.size){i=Ro(n.sizingClasses(r),[i],n);var s=n.sizeMultiplier/r.sizeMultiplier;i.height*=s,i.depth*=s}return i}else throw new Le("Got group of unknown type: '"+e.type+"'")};function Hm(t,e){var n=Ro(["base"],t,e),r=Ro(["strut"]);return r.style.height=Ue(n.height+n.depth),n.depth&&(r.style.verticalAlign=Ue(-n.depth)),n.children.unshift(r),n}function G4(t,e){var n=null;t.length===1&&t[0].type==="tag"&&(n=t[0].tag,t=t[0].body);var r=Lr(t,e,"root"),i;r.length===2&&r[1].hasClass("tag")&&(i=r.pop());for(var s=[],a=[],l=0;l<r.length;l++)if(a.push(r[l]),r[l].hasClass("mbin")||r[l].hasClass("mrel")||r[l].hasClass("allowbreak")){for(var u=!1;l<r.length-1&&r[l+1].hasClass("mspace")&&!r[l+1].hasClass("newline");)l++,a.push(r[l]),r[l].hasClass("nobreak")&&(u=!0);u||(s.push(Hm(a,e)),a=[])}else r[l].hasClass("newline")&&(a.pop(),a.length>0&&(s.push(Hm(a,e)),a=[]),s.push(r[l]));a.length>0&&s.push(Hm(a,e));var d;n?(d=Hm(Lr(n,e,!0)),d.classes=["tag"],s.push(d)):i&&s.push(i);var f=Ro(["katex-html"],s);if(f.setAttribute("aria-hidden","true"),d){var p=d.children[0];p.style.height=Ue(f.height+f.depth),f.depth&&(p.style.verticalAlign=Ue(-f.depth))}return f}function DM(t){return new Gh(t)}class as{constructor(e,n,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=n||[],this.classes=r||[]}setAttribute(e,n){this.attributes[e]=n}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&e.setAttribute(n,this.attributes[n]);this.classes.length>0&&(e.className=Wl(this.classes));for(var r=0;r<this.children.length;r++)if(this.children[r]instanceof Ea&&this.children[r+1]instanceof Ea){for(var i=this.children[r].toText()+this.children[++r].toText();this.children[r+1]instanceof Ea;)i+=this.children[++r].toText();e.appendChild(new Ea(i).toNode())}else e.appendChild(this.children[r].toNode());return e}toMarkup(){var e="<"+this.type;for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(e+=" "+n+'="',e+=en.escape(this.attributes[n]),e+='"');this.classes.length>0&&(e+=' class ="'+en.escape(Wl(this.classes))+'"'),e+=">";for(var r=0;r<this.children.length;r++)e+=this.children[r].toMarkup();return e+="</"+this.type+">",e}toText(){return this.children.map(e=>e.toText()).join("")}}let Ea=class{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return en.escape(this.toText())}toText(){return this.text}};class rne{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character="  ":e>=-.05556&&e<=-.05555?this.character=" ⁣":e>=-.1667&&e<=-.1666?this.character=" ⁣":e>=-.2223&&e<=-.2222?this.character=" ⁣":e>=-.2778&&e<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",Ue(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+Ue(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var Me={MathNode:as,TextNode:Ea,SpaceNode:rne,newDocumentFragment:DM},Us=function(e,n,r){return On[n][e]&&On[n][e].replace&&e.charCodeAt(0)!==55349&&!(kM.hasOwnProperty(e)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(e=On[n][e].replace),new Me.TextNode(e)},K_=function(e){return e.length===1?e[0]:new Me.MathNode("mrow",e)},X_=function(e,n){if(n.fontFamily==="texttt")return"monospace";if(n.fontFamily==="textsf")return n.fontShape==="textit"&&n.fontWeight==="textbf"?"sans-serif-bold-italic":n.fontShape==="textit"?"sans-serif-italic":n.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(n.fontShape==="textit"&&n.fontWeight==="textbf")return"bold-italic";if(n.fontShape==="textit")return"italic";if(n.fontWeight==="textbf")return"bold";var r=n.font;if(!r||r==="mathnormal")return null;var i=e.mode;if(r==="mathit")return"italic";if(r==="boldsymbol")return e.type==="textord"?"bold":"bold-italic";if(r==="mathbf")return"bold";if(r==="mathbb")return"double-struck";if(r==="mathsfit")return"sans-serif-italic";if(r==="mathfrak")return"fraktur";if(r==="mathscr"||r==="mathcal")return"script";if(r==="mathsf")return"sans-serif";if(r==="mathtt")return"monospace";var s=e.text;if(["\\imath","\\jmath"].includes(s))return null;On[i][s]&&On[i][s].replace&&(s=On[i][s].replace);var a=fe.fontMap[r].fontName;return G_(s,a,i)?fe.fontMap[r].variant:null};function nE(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof Ea&&e.text==="."}else if(t.type==="mo"&&t.children.length===1&&t.getAttribute("separator")==="true"&&t.getAttribute("lspace")==="0em"&&t.getAttribute("rspace")==="0em"){var n=t.children[0];return n instanceof Ea&&n.text===","}else return!1}var Wi=function(e,n,r){if(e.length===1){var i=Sn(e[0],n);return r&&i instanceof as&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var s=[],a,l=0;l<e.length;l++){var u=Sn(e[l],n);if(u instanceof as&&a instanceof as){if(u.type==="mtext"&&a.type==="mtext"&&u.getAttribute("mathvariant")===a.getAttribute("mathvariant")){a.children.push(...u.children);continue}else if(u.type==="mn"&&a.type==="mn"){a.children.push(...u.children);continue}else if(nE(u)&&a.type==="mn"){a.children.push(...u.children);continue}else if(u.type==="mn"&&nE(a))u.children=[...a.children,...u.children],s.pop();else if((u.type==="msup"||u.type==="msub")&&u.children.length>=1&&(a.type==="mn"||nE(a))){var d=u.children[0];d instanceof as&&d.type==="mn"&&(d.children=[...a.children,...d.children],s.pop())}else if(a.type==="mi"&&a.children.length===1){var f=a.children[0];if(f instanceof Ea&&f.text==="̸"&&(u.type==="mo"||u.type==="mi"||u.type==="mn")){var p=u.children[0];p instanceof Ea&&p.text.length>0&&(p.text=p.text.slice(0,1)+"̸"+p.text.slice(1),s.pop())}}}s.push(u),a=u}return s},Xl=function(e,n,r){return K_(Wi(e,n,r))},Sn=function(e,n){if(!e)return new Me.MathNode("mrow");if(Kg[e.type]){var r=Kg[e.type](e,n);return r}else throw new Le("Got group of unknown type: '"+e.type+"'")};function T8(t,e,n,r,i){var s=Wi(t,n),a;s.length===1&&s[0]instanceof as&&["mrow","mtable"].includes(s[0].type)?a=s[0]:a=new Me.MathNode("mrow",s);var l=new Me.MathNode("annotation",[new Me.TextNode(e)]);l.setAttribute("encoding","application/x-tex");var u=new Me.MathNode("semantics",[a,l]),d=new Me.MathNode("math",[u]);d.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&d.setAttribute("display","block");var f=i?"katex":"katex-mathml";return fe.makeSpan([f],[d])}var IM=function(e){return new _M({style:e.displayMode?ft.DISPLAY:ft.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},LM=function(e,n){if(n.displayMode){var r=["katex-display"];n.leqno&&r.push("leqno"),n.fleqn&&r.push("fleqn"),e=fe.makeSpan(r,[e])}return e},ine=function(e,n,r){var i=IM(r),s;if(r.output==="mathml")return T8(e,n,i,r.displayMode,!0);if(r.output==="html"){var a=G4(e,i);s=fe.makeSpan(["katex"],[a])}else{var l=T8(e,n,i,r.displayMode,!1),u=G4(e,i);s=fe.makeSpan(["katex"],[l,u])}return LM(s,r)},sne=function(e,n,r){var i=IM(r),s=G4(e,i),a=fe.makeSpan(["katex"],[s]);return LM(a,r)},ane={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},one=function(e){var n=new Me.MathNode("mo",[new Me.TextNode(ane[e.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},lne={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},une=function(e){return e.type==="ordgroup"?e.body.length:1},cne=function(e,n){function r(){var l=4e5,u=e.label.slice(1);if(["widehat","widecheck","widetilde","utilde"].includes(u)){var d=e,f=une(d.base),p,g,b;if(f>5)u==="widehat"||u==="widecheck"?(p=420,l=2364,b=.42,g=u+"4"):(p=312,l=2340,b=.34,g="tilde4");else{var v=[1,1,2,2,3,3][f];u==="widehat"||u==="widecheck"?(l=[0,1062,2364,2364,2364][v],p=[0,239,300,360,420][v],b=[0,.24,.3,.3,.36,.42][v],g=u+v):(l=[0,600,1033,2339,2340][v],p=[0,260,286,306,312][v],b=[0,.26,.286,.3,.306,.34][v],g="tilde"+v)}var E=new Kl(g),x=new Mo([E],{width:"100%",height:Ue(b),viewBox:"0 0 "+l+" "+p,preserveAspectRatio:"none"});return{span:fe.makeSvgSpan([],[x],n),minWidth:0,height:b}}else{var S=[],C=lne[u],[O,L,D]=C,R=D/1e3,F=O.length,G,Z;if(F===1){var q=C[3];G=["hide-tail"],Z=[q]}else if(F===2)G=["halfarrow-left","halfarrow-right"],Z=["xMinYMin","xMaxYMin"];else if(F===3)G=["brace-left","brace-center","brace-right"],Z=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
                    `+F+" children.");for(var ie=0;ie<F;ie++){var se=new Kl(O[ie]),Te=new Mo([se],{width:"400em",height:Ue(R),viewBox:"0 0 "+l+" "+D,preserveAspectRatio:Z[ie]+" slice"}),oe=fe.makeSvgSpan([G[ie]],[Te],n);if(F===1)return{span:oe,minWidth:L,height:R};oe.style.height=Ue(R),S.push(oe)}return{span:fe.makeSpan(["stretchy"],S,n),minWidth:L,height:R}}}var{span:i,minWidth:s,height:a}=r();return i.height=a,i.style.height=Ue(a),s>0&&(i.style.minWidth=Ue(s)),i},dne=function(e,n,r,i,s){var a,l=e.height+e.depth+r+i;if(/fbox|color|angl/.test(n)){if(a=fe.makeSpan(["stretchy",n],[],s),n==="fbox"){var u=s.color&&s.getColor();u&&(a.style.borderColor=u)}}else{var d=[];/^[bx]cancel$/.test(n)&&d.push(new $4({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&d.push(new $4({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var f=new Mo(d,{width:"100%",height:Ue(l)});a=fe.makeSvgSpan([],[f],s)}return a.height=l,a.style.height=Ue(l),a},Do={encloseSpan:dne,mathMLnode:one,svgSpan:cne};function Rt(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function Q_(t){var e=Nb(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function Nb(t){return t&&(t.type==="atom"||Pte.hasOwnProperty(t.type))?t:null}var Z_=(t,e)=>{var n,r,i;t&&t.type==="supsub"?(r=Rt(t.base,"accent"),n=r.base,t.base=n,i=Ite(Xt(t,e)),t.base=r):(r=Rt(t,"accent"),n=r.base);var s=Xt(n,e.havingCrampedStyle()),a=r.isShifty&&en.isCharacterBox(n),l=0;if(a){var u=en.getBaseElem(n),d=Xt(u,e.havingCrampedStyle());l=g8(d).skew}var f=r.label==="\\c",p=f?s.height+s.depth:Math.min(s.height,e.fontMetrics().xHeight),g;if(r.isStretchy)g=Do.svgSpan(r,e),g=fe.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:g,wrapperClasses:["svg-align"],wrapperStyle:l>0?{width:"calc(100% - "+Ue(2*l)+")",marginLeft:Ue(2*l)}:void 0}]},e);else{var b,v;r.label==="\\vec"?(b=fe.staticSvg("vec",e),v=fe.svgData.vec[1]):(b=fe.makeOrd({mode:r.mode,text:r.label},e,"textord"),b=g8(b),b.italic=0,v=b.width,f&&(p+=b.depth)),g=fe.makeSpan(["accent-body"],[b]);var E=r.label==="\\textcircled";E&&(g.classes.push("accent-full"),p=s.height);var x=l;E||(x-=v/2),g.style.left=Ue(x),r.label==="\\textcircled"&&(g.style.top=".2em"),g=fe.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-p},{type:"elem",elem:g}]},e)}var S=fe.makeSpan(["mord","accent"],[g],e);return i?(i.children[0]=S,i.height=Math.max(S.height,i.height),i.classes[0]="mord",i):S},PM=(t,e)=>{var n=t.isStretchy?Do.mathMLnode(t.label):new Me.MathNode("mo",[Us(t.label,t.mode)]),r=new Me.MathNode("mover",[Sn(t.base,e),n]);return r.setAttribute("accent","true"),r},fne=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));Ye({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(t,e)=>{var n=Xg(e[0]),r=!fne.test(t.funcName),i=!r||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:Z_,mathmlBuilder:PM});Ye({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var n=e[0],r=t.parser.mode;return r==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:t.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:Z_,mathmlBuilder:PM});Ye({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(t,e)=>{var{parser:n,funcName:r}=t,i=e[0];return{type:"accentUnder",mode:n.mode,label:r,base:i}},htmlBuilder:(t,e)=>{var n=Xt(t.base,e),r=Do.svgSpan(t,e),i=t.label==="\\utilde"?.12:0,s=fe.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:n}]},e);return fe.makeSpan(["mord","accentunder"],[s],e)},mathmlBuilder:(t,e)=>{var n=Do.mathMLnode(t.label),r=new Me.MathNode("munder",[Sn(t.base,e),n]);return r.setAttribute("accentunder","true"),r}});var jm=t=>{var e=new Me.MathNode("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};Ye({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,n){var{parser:r,funcName:i}=t;return{type:"xArrow",mode:r.mode,label:i,body:e[0],below:n[0]}},htmlBuilder(t,e){var n=e.style,r=e.havingStyle(n.sup()),i=fe.wrapFragment(Xt(t.body,r,e),e),s=t.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(s+"-arrow-pad");var a;t.below&&(r=e.havingStyle(n.sub()),a=fe.wrapFragment(Xt(t.below,r,e),e),a.classes.push(s+"-arrow-pad"));var l=Do.svgSpan(t,e),u=-e.fontMetrics().axisHeight+.5*l.height,d=-e.fontMetrics().axisHeight-.5*l.height-.111;(i.depth>.25||t.label==="\\xleftequilibrium")&&(d-=i.depth);var f;if(a){var p=-e.fontMetrics().axisHeight+a.height+.5*l.height+.111;f=fe.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:d},{type:"elem",elem:l,shift:u},{type:"elem",elem:a,shift:p}]},e)}else f=fe.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:d},{type:"elem",elem:l,shift:u}]},e);return f.children[0].children[0].children[1].classes.push("svg-align"),fe.makeSpan(["mrel","x-arrow"],[f],e)},mathmlBuilder(t,e){var n=Do.mathMLnode(t.label);n.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(t.body){var i=jm(Sn(t.body,e));if(t.below){var s=jm(Sn(t.below,e));r=new Me.MathNode("munderover",[n,s,i])}else r=new Me.MathNode("mover",[n,i])}else if(t.below){var a=jm(Sn(t.below,e));r=new Me.MathNode("munder",[n,a])}else r=jm(),r=new Me.MathNode("mover",[n,r]);return r}});var hne=fe.makeSpan;function BM(t,e){var n=Lr(t.body,e,!0);return hne([t.mclass],n,e)}function zM(t,e){var n,r=Wi(t.body,e);return t.mclass==="minner"?n=new Me.MathNode("mpadded",r):t.mclass==="mord"?t.isCharacterBox?(n=r[0],n.type="mi"):n=new Me.MathNode("mi",r):(t.isCharacterBox?(n=r[0],n.type="mo"):n=new Me.MathNode("mo",r),t.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):t.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):t.mclass==="mopen"||t.mclass==="mclose"?(n.attributes.lspace="0em",n.attributes.rspace="0em"):t.mclass==="minner"&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}Ye({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:n,funcName:r}=t,i=e[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:gr(i),isCharacterBox:en.isCharacterBox(i)}},htmlBuilder:BM,mathmlBuilder:zM});var Ob=t=>{var e=t.type==="ordgroup"&&t.body.length?t.body[0]:t;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};Ye({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:n}=t;return{type:"mclass",mode:n.mode,mclass:Ob(e[0]),body:gr(e[1]),isCharacterBox:en.isCharacterBox(e[1])}}});Ye({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:n,funcName:r}=t,i=e[1],s=e[0],a;r!=="\\stackrel"?a=Ob(i):a="mrel";var l={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:gr(i)},u={type:"supsub",mode:s.mode,base:l,sup:r==="\\underset"?null:s,sub:r==="\\underset"?s:null};return{type:"mclass",mode:n.mode,mclass:a,body:[u],isCharacterBox:en.isCharacterBox(u)}},htmlBuilder:BM,mathmlBuilder:zM});Ye({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"pmb",mode:n.mode,mclass:Ob(e[0]),body:gr(e[0])}},htmlBuilder(t,e){var n=Lr(t.body,e,!0),r=fe.makeSpan([t.mclass],n,e);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(t,e){var n=Wi(t.body,e),r=new Me.MathNode("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var pne={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},S8=()=>({type:"styling",body:[],mode:"math",style:"display"}),w8=t=>t.type==="textord"&&t.text==="@",mne=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function gne(t,e,n){var r=pne[t];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=n.callFunction("\\\\cdleft",[e[0]],[]),s={type:"atom",text:r,mode:"math",family:"rel"},a=n.callFunction("\\Big",[s],[]),l=n.callFunction("\\\\cdright",[e[1]],[]),u={type:"ordgroup",mode:"math",body:[i,a,l]};return n.callFunction("\\\\cdparent",[u],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var d={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[d],[])}default:return{type:"textord",text:" ",mode:"math"}}}function bne(t){var e=[];for(t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();;){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var n=t.fetch().text;if(n==="&"||n==="\\\\")t.consume();else if(n==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new Le("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var r=[],i=[r],s=0;s<e.length;s++){for(var a=e[s],l=S8(),u=0;u<a.length;u++)if(!w8(a[u]))l.body.push(a[u]);else{r.push(l),u+=1;var d=Q_(a[u]).text,f=new Array(2);if(f[0]={type:"ordgroup",mode:"math",body:[]},f[1]={type:"ordgroup",mode:"math",body:[]},!("=|.".indexOf(d)>-1))if("<>AV".indexOf(d)>-1)for(var p=0;p<2;p++){for(var g=!0,b=u+1;b<a.length;b++){if(mne(a[b],d)){g=!1,u=b;break}if(w8(a[b]))throw new Le("Missing a "+d+" character to complete a CD arrow.",a[b]);f[p].body.push(a[b])}if(g)throw new Le("Missing a "+d+" character to complete a CD arrow.",a[u])}else throw new Le('Expected one of "<>AV=|." after @',a[u]);var v=gne(d,f,t),E={type:"styling",body:[v],mode:"math",style:"display"};r.push(E),l=S8()}s%2===0?r.push(l):r.shift(),r=[],i.push(r)}t.gullet.endGroup(),t.gullet.endGroup();var x=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:x,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}Ye({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:e[0]}},htmlBuilder(t,e){var n=e.havingStyle(e.style.sup()),r=fe.wrapFragment(Xt(t.label,n,e),e);return r.classes.push("cd-label-"+t.side),r.style.bottom=Ue(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(t,e){var n=new Me.MathNode("mrow",[Sn(t.label,e)]);return n=new Me.MathNode("mpadded",[n]),n.setAttribute("width","0"),t.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new Me.MathNode("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});Ye({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(t,e){var{parser:n}=t;return{type:"cdlabelparent",mode:n.mode,fragment:e[0]}},htmlBuilder(t,e){var n=fe.wrapFragment(Xt(t.fragment,e),e);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(t,e){return new Me.MathNode("mrow",[Sn(t.fragment,e)])}});Ye({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:n}=t,r=Rt(e[0],"ordgroup"),i=r.body,s="",a=0;a<i.length;a++){var l=Rt(i[a],"textord");s+=l.text}var u=parseInt(s),d;if(isNaN(u))throw new Le("\\@char has non-numeric argument "+s);if(u<0||u>=1114111)throw new Le("\\@char with invalid code point "+s);return u<=65535?d=String.fromCharCode(u):(u-=65536,d=String.fromCharCode((u>>10)+55296,(u&1023)+56320)),{type:"textord",mode:n.mode,text:d}}});var UM=(t,e)=>{var n=Lr(t.body,e.withColor(t.color),!1);return fe.makeFragment(n)},FM=(t,e)=>{var n=Wi(t.body,e.withColor(t.color)),r=new Me.MathNode("mstyle",n);return r.setAttribute("mathcolor",t.color),r};Ye({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:n}=t,r=Rt(e[0],"color-token").color,i=e[1];return{type:"color",mode:n.mode,color:r,body:gr(i)}},htmlBuilder:UM,mathmlBuilder:FM});Ye({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:n,breakOnTokenText:r}=t,i=Rt(e[0],"color-token").color;n.gullet.macros.set("\\current@color",i);var s=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:i,body:s}},htmlBuilder:UM,mathmlBuilder:FM});Ye({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,n){var{parser:r}=t,i=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,s=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:s,size:i&&Rt(i,"size").value}},htmlBuilder(t,e){var n=fe.makeSpan(["mspace"],[],e);return t.newLine&&(n.classes.push("newline"),t.size&&(n.style.marginTop=Ue(Zn(t.size,e)))),n},mathmlBuilder(t,e){var n=new Me.MathNode("mspace");return t.newLine&&(n.setAttribute("linebreak","newline"),t.size&&n.setAttribute("height",Ue(Zn(t.size,e)))),n}});var Y4={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},HM=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new Le("Expected a control sequence",t);return e},vne=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},jM=(t,e,n,r)=>{var i=t.gullet.macros.get(n.text);i==null&&(n.noexpand=!0,i={tokens:[n],numArgs:0,unexpandable:!t.gullet.isExpandable(n.text)}),t.gullet.macros.set(e,i,r)};Ye({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:n}=t;e.consumeSpaces();var r=e.fetch();if(Y4[r.text])return(n==="\\global"||n==="\\\\globallong")&&(r.text=Y4[r.text]),Rt(e.parseFunction(),"internal");throw new Le("Invalid token after macro prefix",r)}});Ye({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=e.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new Le("Expected a control sequence",r);for(var s=0,a,l=[[]];e.gullet.future().text!=="{";)if(r=e.gullet.popToken(),r.text==="#"){if(e.gullet.future().text==="{"){a=e.gullet.future(),l[s].push("{");break}if(r=e.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new Le('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==s+1)throw new Le('Argument number "'+r.text+'" out of order');s++,l.push([])}else{if(r.text==="EOF")throw new Le("Expected a macro definition");l[s].push(r.text)}var{tokens:u}=e.gullet.consumeArg();return a&&u.unshift(a),(n==="\\edef"||n==="\\xdef")&&(u=e.gullet.expandTokens(u),u.reverse()),e.gullet.macros.set(i,{tokens:u,numArgs:s,delimiters:l},n===Y4[n]),{type:"internal",mode:e.mode}}});Ye({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=HM(e.gullet.popToken());e.gullet.consumeSpaces();var i=vne(e);return jM(e,r,i,n==="\\\\globallet"),{type:"internal",mode:e.mode}}});Ye({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=HM(e.gullet.popToken()),i=e.gullet.popToken(),s=e.gullet.popToken();return jM(e,r,s,n==="\\\\globalfuture"),e.gullet.pushToken(s),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var yf=function(e,n,r){var i=On.math[e]&&On.math[e].replace,s=G_(i||e,n,r);if(!s)throw new Error("Unsupported symbol "+e+" and font size "+n+".");return s},J_=function(e,n,r,i){var s=r.havingBaseStyle(n),a=fe.makeSpan(i.concat(s.sizingClasses(r)),[e],r),l=s.sizeMultiplier/r.sizeMultiplier;return a.height*=l,a.depth*=l,a.maxFontSize=s.sizeMultiplier,a},$M=function(e,n,r){var i=n.havingBaseStyle(r),s=(1-n.sizeMultiplier/i.sizeMultiplier)*n.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=Ue(s),e.height-=s,e.depth+=s},yne=function(e,n,r,i,s,a){var l=fe.makeSymbol(e,"Main-Regular",s,i),u=J_(l,n,i,a);return r&&$M(u,i,n),u},Ene=function(e,n,r,i){return fe.makeSymbol(e,"Size"+n+"-Regular",r,i)},qM=function(e,n,r,i,s,a){var l=Ene(e,n,s,i),u=J_(fe.makeSpan(["delimsizing","size"+n],[l],i),ft.TEXT,i,a);return r&&$M(u,i,ft.TEXT),u},rE=function(e,n,r){var i;n==="Size1-Regular"?i="delim-size1":i="delim-size4";var s=fe.makeSpan(["delimsizinginner",i],[fe.makeSpan([],[fe.makeSymbol(e,n,r)])]);return{type:"elem",elem:s}},iE=function(e,n,r){var i=ya["Size4-Regular"][e.charCodeAt(0)]?ya["Size4-Regular"][e.charCodeAt(0)][4]:ya["Size1-Regular"][e.charCodeAt(0)][4],s=new Kl("inner",wte(e,Math.round(1e3*n))),a=new Mo([s],{width:Ue(i),height:Ue(n),style:"width:"+Ue(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),l=fe.makeSvgSpan([],[a],r);return l.height=n,l.style.height=Ue(n),l.style.width=Ue(i),{type:"elem",elem:l}},W4=.008,$m={type:"kern",size:-1*W4},_ne=["|","\\lvert","\\rvert","\\vert"],xne=["\\|","\\lVert","\\rVert","\\Vert"],VM=function(e,n,r,i,s,a){var l,u,d,f,p="",g=0;l=d=f=e,u=null;var b="Size1-Regular";e==="\\uparrow"?d=f="⏐":e==="\\Uparrow"?d=f="‖":e==="\\downarrow"?l=d="⏐":e==="\\Downarrow"?l=d="‖":e==="\\updownarrow"?(l="\\uparrow",d="⏐",f="\\downarrow"):e==="\\Updownarrow"?(l="\\Uparrow",d="‖",f="\\Downarrow"):_ne.includes(e)?(d="∣",p="vert",g=333):xne.includes(e)?(d="∥",p="doublevert",g=556):e==="["||e==="\\lbrack"?(l="⎡",d="⎢",f="⎣",b="Size4-Regular",p="lbrack",g=667):e==="]"||e==="\\rbrack"?(l="⎤",d="⎥",f="⎦",b="Size4-Regular",p="rbrack",g=667):e==="\\lfloor"||e==="⌊"?(d=l="⎢",f="⎣",b="Size4-Regular",p="lfloor",g=667):e==="\\lceil"||e==="⌈"?(l="⎡",d=f="⎢",b="Size4-Regular",p="lceil",g=667):e==="\\rfloor"||e==="⌋"?(d=l="⎥",f="⎦",b="Size4-Regular",p="rfloor",g=667):e==="\\rceil"||e==="⌉"?(l="⎤",d=f="⎥",b="Size4-Regular",p="rceil",g=667):e==="("||e==="\\lparen"?(l="⎛",d="⎜",f="⎝",b="Size4-Regular",p="lparen",g=875):e===")"||e==="\\rparen"?(l="⎞",d="⎟",f="⎠",b="Size4-Regular",p="rparen",g=875):e==="\\{"||e==="\\lbrace"?(l="⎧",u="⎨",f="⎩",d="⎪",b="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(l="⎫",u="⎬",f="⎭",d="⎪",b="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(l="⎧",f="⎩",d="⎪",b="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(l="⎫",f="⎭",d="⎪",b="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(l="⎧",f="⎭",d="⎪",b="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(l="⎫",f="⎩",d="⎪",b="Size4-Regular");var v=yf(l,b,s),E=v.height+v.depth,x=yf(d,b,s),S=x.height+x.depth,C=yf(f,b,s),O=C.height+C.depth,L=0,D=1;if(u!==null){var R=yf(u,b,s);L=R.height+R.depth,D=2}var F=E+O+L,G=Math.max(0,Math.ceil((n-F)/(D*S))),Z=F+G*D*S,q=i.fontMetrics().axisHeight;r&&(q*=i.sizeMultiplier);var ie=Z/2-q,se=[];if(p.length>0){var Te=Z-E-O,oe=Math.round(Z*1e3),re=kte(p,Math.round(Te*1e3)),X=new Kl(p,re),ee=(g/1e3).toFixed(3)+"em",ce=(oe/1e3).toFixed(3)+"em",we=new Mo([X],{width:ee,height:ce,viewBox:"0 0 "+g+" "+oe}),j=fe.makeSvgSpan([],[we],i);j.height=oe/1e3,j.style.width=ee,j.style.height=ce,se.push({type:"elem",elem:j})}else{if(se.push(rE(f,b,s)),se.push($m),u===null){var H=Z-E-O+2*W4;se.push(iE(d,H,i))}else{var ne=(Z-E-O-L)/2+2*W4;se.push(iE(d,ne,i)),se.push($m),se.push(rE(u,b,s)),se.push($m),se.push(iE(d,ne,i))}se.push($m),se.push(rE(l,b,s))}var P=i.havingBaseStyle(ft.TEXT),Ee=fe.makeVList({positionType:"bottom",positionData:ie,children:se},P);return J_(fe.makeSpan(["delimsizing","mult"],[Ee],P),ft.TEXT,i,a)},sE=80,aE=.08,oE=function(e,n,r,i,s){var a=Ste(e,i,r),l=new Kl(e,a),u=new Mo([l],{width:"400em",height:Ue(n),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return fe.makeSvgSpan(["hide-tail"],[u],s)},Tne=function(e,n){var r=n.havingBaseSizing(),i=KM("\\surd",e*r.sizeMultiplier,WM,r),s=r.sizeMultiplier,a=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),l,u=0,d=0,f=0,p;return i.type==="small"?(f=1e3+1e3*a+sE,e<1?s=1:e<1.4&&(s=.7),u=(1+a+aE)/s,d=(1+a)/s,l=oE("sqrtMain",u,f,a,n),l.style.minWidth="0.853em",p=.833/s):i.type==="large"?(f=(1e3+sE)*$f[i.size],d=($f[i.size]+a)/s,u=($f[i.size]+a+aE)/s,l=oE("sqrtSize"+i.size,u,f,a,n),l.style.minWidth="1.02em",p=1/s):(u=e+a+aE,d=e+a,f=Math.floor(1e3*e+a)+sE,l=oE("sqrtTall",u,f,a,n),l.style.minWidth="0.742em",p=1.056),l.height=d,l.style.height=Ue(u),{span:l,advanceWidth:p,ruleWidth:(n.fontMetrics().sqrtRuleThickness+a)*s}},GM=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],Sne=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],YM=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],$f=[0,1.2,1.8,2.4,3],wne=function(e,n,r,i,s){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),GM.includes(e)||YM.includes(e))return qM(e,n,!1,r,i,s);if(Sne.includes(e))return VM(e,$f[n],!1,r,i,s);throw new Le("Illegal delimiter: '"+e+"'")},kne=[{type:"small",style:ft.SCRIPTSCRIPT},{type:"small",style:ft.SCRIPT},{type:"small",style:ft.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Cne=[{type:"small",style:ft.SCRIPTSCRIPT},{type:"small",style:ft.SCRIPT},{type:"small",style:ft.TEXT},{type:"stack"}],WM=[{type:"small",style:ft.SCRIPTSCRIPT},{type:"small",style:ft.SCRIPT},{type:"small",style:ft.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],Ane=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},KM=function(e,n,r,i){for(var s=Math.min(2,3-i.style.size),a=s;a<r.length&&r[a].type!=="stack";a++){var l=yf(e,Ane(r[a]),"math"),u=l.height+l.depth;if(r[a].type==="small"){var d=i.havingBaseStyle(r[a].style);u*=d.sizeMultiplier}if(u>n)return r[a]}return r[r.length-1]},XM=function(e,n,r,i,s,a){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var l;YM.includes(e)?l=kne:GM.includes(e)?l=WM:l=Cne;var u=KM(e,n,l,i);return u.type==="small"?yne(e,u.style,r,i,s,a):u.type==="large"?qM(e,u.size,r,i,s,a):VM(e,n,r,i,s,a)},Nne=function(e,n,r,i,s,a){var l=i.fontMetrics().axisHeight*i.sizeMultiplier,u=901,d=5/i.fontMetrics().ptPerEm,f=Math.max(n-l,r+l),p=Math.max(f/500*u,2*f-d);return XM(e,p,!0,i,s,a)},wo={sqrtImage:Tne,sizedDelim:wne,sizeToMaxHeight:$f,customSizedDelim:XM,leftRightDelim:Nne},k8={"\\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}},One=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function Mb(t,e){var n=Nb(t);if(n&&One.includes(n.text))return n;throw n?new Le("Invalid delimiter '"+n.text+"' after '"+e.funcName+"'",t):new Le("Invalid delimiter type '"+t.type+"'",t)}Ye({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(t,e)=>{var n=Mb(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:k8[t.funcName].size,mclass:k8[t.funcName].mclass,delim:n.text}},htmlBuilder:(t,e)=>t.delim==="."?fe.makeSpan([t.mclass]):wo.sizedDelim(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(Us(t.delim,t.mode));var n=new Me.MathNode("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=Ue(wo.sizeToMaxHeight[t.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}});function C8(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Ye({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=t.parser.gullet.macros.get("\\current@color");if(n&&typeof n!="string")throw new Le("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:Mb(e[0],t).text,color:n}}});Ye({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=Mb(e[0],t),r=t.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var s=Rt(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:i,left:n.text,right:s.delim,rightColor:s.color}},htmlBuilder:(t,e)=>{C8(t);for(var n=Lr(t.body,e,!0,["mopen","mclose"]),r=0,i=0,s=!1,a=0;a<n.length;a++)n[a].isMiddle?s=!0:(r=Math.max(n[a].height,r),i=Math.max(n[a].depth,i));r*=e.sizeMultiplier,i*=e.sizeMultiplier;var l;if(t.left==="."?l=dh(e,["mopen"]):l=wo.leftRightDelim(t.left,r,i,e,t.mode,["mopen"]),n.unshift(l),s)for(var u=1;u<n.length;u++){var d=n[u],f=d.isMiddle;f&&(n[u]=wo.leftRightDelim(f.delim,r,i,f.options,t.mode,[]))}var p;if(t.right===".")p=dh(e,["mclose"]);else{var g=t.rightColor?e.withColor(t.rightColor):e;p=wo.leftRightDelim(t.right,r,i,g,t.mode,["mclose"])}return n.push(p),fe.makeSpan(["minner"],n,e)},mathmlBuilder:(t,e)=>{C8(t);var n=Wi(t.body,e);if(t.left!=="."){var r=new Me.MathNode("mo",[Us(t.left,t.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if(t.right!=="."){var i=new Me.MathNode("mo",[Us(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),n.push(i)}return K_(n)}});Ye({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=Mb(e[0],t);if(!t.parser.leftrightDepth)throw new Le("\\middle without preceding \\left",n);return{type:"middle",mode:t.parser.mode,delim:n.text}},htmlBuilder:(t,e)=>{var n;if(t.delim===".")n=dh(e,[]);else{n=wo.sizedDelim(t.delim,1,e,t.mode,[]);var r={delim:t.delim,options:e};n.isMiddle=r}return n},mathmlBuilder:(t,e)=>{var n=t.delim==="\\vert"||t.delim==="|"?Us("|","text"):Us(t.delim,t.mode),r=new Me.MathNode("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var ex=(t,e)=>{var n=fe.wrapFragment(Xt(t.body,e),e),r=t.label.slice(1),i=e.sizeMultiplier,s,a=0,l=en.isCharacterBox(t.body);if(r==="sout")s=fe.makeSpan(["stretchy","sout"]),s.height=e.fontMetrics().defaultRuleThickness/i,a=-.5*e.fontMetrics().xHeight;else if(r==="phase"){var u=Zn({number:.6,unit:"pt"},e),d=Zn({number:.35,unit:"ex"},e),f=e.havingBaseSizing();i=i/f.sizeMultiplier;var p=n.height+n.depth+u+d;n.style.paddingLeft=Ue(p/2+u);var g=Math.floor(1e3*p*i),b=xte(g),v=new Mo([new Kl("phase",b)],{width:"400em",height:Ue(g/1e3),viewBox:"0 0 400000 "+g,preserveAspectRatio:"xMinYMin slice"});s=fe.makeSvgSpan(["hide-tail"],[v],e),s.style.height=Ue(p),a=n.depth+u+d}else{/cancel/.test(r)?l||n.classes.push("cancel-pad"):r==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var E=0,x=0,S=0;/box/.test(r)?(S=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),E=e.fontMetrics().fboxsep+(r==="colorbox"?0:S),x=E):r==="angl"?(S=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),E=4*S,x=Math.max(0,.25-n.depth)):(E=l?.2:0,x=E),s=Do.encloseSpan(n,r,E,x,e),/fbox|boxed|fcolorbox/.test(r)?(s.style.borderStyle="solid",s.style.borderWidth=Ue(S)):r==="angl"&&S!==.049&&(s.style.borderTopWidth=Ue(S),s.style.borderRightWidth=Ue(S)),a=n.depth+x,t.backgroundColor&&(s.style.backgroundColor=t.backgroundColor,t.borderColor&&(s.style.borderColor=t.borderColor))}var C;if(t.backgroundColor)C=fe.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:a},{type:"elem",elem:n,shift:0}]},e);else{var O=/cancel|phase/.test(r)?["svg-align"]:[];C=fe.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:s,shift:a,wrapperClasses:O}]},e)}return/cancel/.test(r)&&(C.height=n.height,C.depth=n.depth),/cancel/.test(r)&&!l?fe.makeSpan(["mord","cancel-lap"],[C],e):fe.makeSpan(["mord"],[C],e)},tx=(t,e)=>{var n=0,r=new Me.MathNode(t.label.indexOf("colorbox")>-1?"mpadded":"menclose",[Sn(t.body,e)]);switch(t.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),t.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);r.setAttribute("style","border: "+i+"em solid "+String(t.borderColor))}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&r.setAttribute("mathbackground",t.backgroundColor),r};Ye({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(t,e,n){var{parser:r,funcName:i}=t,s=Rt(e[0],"color-token").color,a=e[1];return{type:"enclose",mode:r.mode,label:i,backgroundColor:s,body:a}},htmlBuilder:ex,mathmlBuilder:tx});Ye({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(t,e,n){var{parser:r,funcName:i}=t,s=Rt(e[0],"color-token").color,a=Rt(e[1],"color-token").color,l=e[2];return{type:"enclose",mode:r.mode,label:i,backgroundColor:a,borderColor:s,body:l}},htmlBuilder:ex,mathmlBuilder:tx});Ye({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"enclose",mode:n.mode,label:"\\fbox",body:e[0]}}});Ye({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t,i=e[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:ex,mathmlBuilder:tx});Ye({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:n}=t;return{type:"enclose",mode:n.mode,label:"\\angl",body:e[0]}}});var QM={};function Ra(t){for(var{type:e,names:n,props:r,handler:i,htmlBuilder:s,mathmlBuilder:a}=t,l={type:e,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},u=0;u<n.length;++u)QM[n[u]]=l;s&&(Wg[e]=s),a&&(Kg[e]=a)}var ZM={};function B(t,e){ZM[t]=e}function A8(t){var e=[];t.consumeSpaces();var n=t.fetch().text;for(n==="\\relax"&&(t.consume(),t.consumeSpaces(),n=t.fetch().text);n==="\\hline"||n==="\\hdashline";)t.consume(),e.push(n==="\\hdashline"),t.consumeSpaces(),n=t.fetch().text;return e}var Rb=t=>{var e=t.parser.settings;if(!e.displayMode)throw new Le("{"+t.envName+"} can be used only in display mode.")};function nx(t){if(t.indexOf("ed")===-1)return t.indexOf("*")===-1}function nu(t,e,n){var{hskipBeforeAndAfter:r,addJot:i,cols:s,arraystretch:a,colSeparationType:l,autoTag:u,singleRow:d,emptySingleRow:f,maxNumCols:p,leqno:g}=e;if(t.gullet.beginGroup(),d||t.gullet.macros.set("\\cr","\\\\\\relax"),!a){var b=t.gullet.expandMacroAsText("\\arraystretch");if(b==null)a=1;else if(a=parseFloat(b),!a||a<0)throw new Le("Invalid \\arraystretch: "+b)}t.gullet.beginGroup();var v=[],E=[v],x=[],S=[],C=u!=null?[]:void 0;function O(){u&&t.gullet.macros.set("\\@eqnsw","1",!0)}function L(){C&&(t.gullet.macros.get("\\df@tag")?(C.push(t.subparse([new ds("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):C.push(!!u&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(O(),S.push(A8(t));;){var D=t.parseExpression(!1,d?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup(),D={type:"ordgroup",mode:t.mode,body:D},n&&(D={type:"styling",mode:t.mode,style:n,body:[D]}),v.push(D);var R=t.fetch().text;if(R==="&"){if(p&&v.length===p){if(d||l)throw new Le("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(R==="\\end"){L(),v.length===1&&D.type==="styling"&&D.body[0].body.length===0&&(E.length>1||!f)&&E.pop(),S.length<E.length+1&&S.push([]);break}else if(R==="\\\\"){t.consume();var F=void 0;t.gullet.future().text!==" "&&(F=t.parseSizeGroup(!0)),x.push(F?F.value:null),L(),S.push(A8(t)),v=[],E.push(v),O()}else throw new Le("Expected & or \\\\ or \\cr or \\end",t.nextToken)}return t.gullet.endGroup(),t.gullet.endGroup(),{type:"array",mode:t.mode,addJot:i,arraystretch:a,body:E,cols:s,rowGaps:x,hskipBeforeAndAfter:r,hLinesBeforeRow:S,colSeparationType:l,tags:C,leqno:g}}function rx(t){return t.slice(0,1)==="d"?"display":"text"}var Da=function(e,n){var r,i,s=e.body.length,a=e.hLinesBeforeRow,l=0,u=new Array(s),d=[],f=Math.max(n.fontMetrics().arrayRuleWidth,n.minRuleThickness),p=1/n.fontMetrics().ptPerEm,g=5*p;if(e.colSeparationType&&e.colSeparationType==="small"){var b=n.havingStyle(ft.SCRIPT).sizeMultiplier;g=.2778*(b/n.sizeMultiplier)}var v=e.colSeparationType==="CD"?Zn({number:3,unit:"ex"},n):12*p,E=3*p,x=e.arraystretch*v,S=.7*x,C=.3*x,O=0;function L(wn){for(var zt=0;zt<wn.length;++zt)zt>0&&(O+=.25),d.push({pos:O,isDashed:wn[zt]})}for(L(a[0]),r=0;r<e.body.length;++r){var D=e.body[r],R=S,F=C;l<D.length&&(l=D.length);var G=new Array(D.length);for(i=0;i<D.length;++i){var Z=Xt(D[i],n);F<Z.depth&&(F=Z.depth),R<Z.height&&(R=Z.height),G[i]=Z}var q=e.rowGaps[r],ie=0;q&&(ie=Zn(q,n),ie>0&&(ie+=C,F<ie&&(F=ie),ie=0)),e.addJot&&(F+=E),G.height=R,G.depth=F,O+=R,G.pos=O,O+=F+ie,u[r]=G,L(a[r+1])}var se=O/2+n.fontMetrics().axisHeight,Te=e.cols||[],oe=[],re,X,ee=[];if(e.tags&&e.tags.some(wn=>wn))for(r=0;r<s;++r){var ce=u[r],we=ce.pos-se,j=e.tags[r],H=void 0;j===!0?H=fe.makeSpan(["eqn-num"],[],n):j===!1?H=fe.makeSpan([],[],n):H=fe.makeSpan([],Lr(j,n,!0),n),H.depth=ce.depth,H.height=ce.height,ee.push({type:"elem",elem:H,shift:we})}for(i=0,X=0;i<l||X<Te.length;++i,++X){for(var ne=Te[X]||{},P=!0;ne.type==="separator";){if(P||(re=fe.makeSpan(["arraycolsep"],[]),re.style.width=Ue(n.fontMetrics().doubleRuleSep),oe.push(re)),ne.separator==="|"||ne.separator===":"){var Ee=ne.separator==="|"?"solid":"dashed",Fe=fe.makeSpan(["vertical-separator"],[],n);Fe.style.height=Ue(O),Fe.style.borderRightWidth=Ue(f),Fe.style.borderRightStyle=Ee,Fe.style.margin="0 "+Ue(-f/2);var He=O-se;He&&(Fe.style.verticalAlign=Ue(-He)),oe.push(Fe)}else throw new Le("Invalid separator type: "+ne.separator);X++,ne=Te[X]||{},P=!1}if(!(i>=l)){var it=void 0;(i>0||e.hskipBeforeAndAfter)&&(it=en.deflt(ne.pregap,g),it!==0&&(re=fe.makeSpan(["arraycolsep"],[]),re.style.width=Ue(it),oe.push(re)));var kt=[];for(r=0;r<s;++r){var Tt=u[r],St=Tt[i];if(St){var Jn=Tt.pos-se;St.depth=Tt.depth,St.height=Tt.height,kt.push({type:"elem",elem:St,shift:Jn})}}kt=fe.makeVList({positionType:"individualShift",children:kt},n),kt=fe.makeSpan(["col-align-"+(ne.align||"c")],[kt]),oe.push(kt),(i<l-1||e.hskipBeforeAndAfter)&&(it=en.deflt(ne.postgap,g),it!==0&&(re=fe.makeSpan(["arraycolsep"],[]),re.style.width=Ue(it),oe.push(re)))}}if(u=fe.makeSpan(["mtable"],oe),d.length>0){for(var Un=fe.makeLineSpan("hline",n,f),At=fe.makeLineSpan("hdashline",n,f),gt=[{type:"elem",elem:u,shift:0}];d.length>0;){var Yt=d.pop(),Qe=Yt.pos-se;Yt.isDashed?gt.push({type:"elem",elem:At,shift:Qe}):gt.push({type:"elem",elem:Un,shift:Qe})}u=fe.makeVList({positionType:"individualShift",children:gt},n)}if(ee.length===0)return fe.makeSpan(["mord"],[u],n);var $t=fe.makeVList({positionType:"individualShift",children:ee},n);return $t=fe.makeSpan(["tag"],[$t],n),fe.makeFragment([u,$t])},Mne={c:"center ",l:"left ",r:"right "},Ia=function(e,n){for(var r=[],i=new Me.MathNode("mtd",[],["mtr-glue"]),s=new Me.MathNode("mtd",[],["mml-eqn-num"]),a=0;a<e.body.length;a++){for(var l=e.body[a],u=[],d=0;d<l.length;d++)u.push(new Me.MathNode("mtd",[Sn(l[d],n)]));e.tags&&e.tags[a]&&(u.unshift(i),u.push(i),e.leqno?u.unshift(s):u.push(s)),r.push(new Me.MathNode("mtr",u))}var f=new Me.MathNode("mtable",r),p=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);f.setAttribute("rowspacing",Ue(p));var g="",b="";if(e.cols&&e.cols.length>0){var v=e.cols,E="",x=!1,S=0,C=v.length;v[0].type==="separator"&&(g+="top ",S=1),v[v.length-1].type==="separator"&&(g+="bottom ",C-=1);for(var O=S;O<C;O++)v[O].type==="align"?(b+=Mne[v[O].align],x&&(E+="none "),x=!0):v[O].type==="separator"&&x&&(E+=v[O].separator==="|"?"solid ":"dashed ",x=!1);f.setAttribute("columnalign",b.trim()),/[sd]/.test(E)&&f.setAttribute("columnlines",E.trim())}if(e.colSeparationType==="align"){for(var L=e.cols||[],D="",R=1;R<L.length;R++)D+=R%2?"0em ":"1em ";f.setAttribute("columnspacing",D.trim())}else e.colSeparationType==="alignat"||e.colSeparationType==="gather"?f.setAttribute("columnspacing","0em"):e.colSeparationType==="small"?f.setAttribute("columnspacing","0.2778em"):e.colSeparationType==="CD"?f.setAttribute("columnspacing","0.5em"):f.setAttribute("columnspacing","1em");var F="",G=e.hLinesBeforeRow;g+=G[0].length>0?"left ":"",g+=G[G.length-1].length>0?"right ":"";for(var Z=1;Z<G.length-1;Z++)F+=G[Z].length===0?"none ":G[Z][0]?"dashed ":"solid ";return/[sd]/.test(F)&&f.setAttribute("rowlines",F.trim()),g!==""&&(f=new Me.MathNode("menclose",[f]),f.setAttribute("notation",g.trim())),e.arraystretch&&e.arraystretch<1&&(f=new Me.MathNode("mstyle",[f]),f.setAttribute("scriptlevel","1")),f},JM=function(e,n){e.envName.indexOf("ed")===-1&&Rb(e);var r=[],i=e.envName.indexOf("at")>-1?"alignat":"align",s=e.envName==="split",a=nu(e.parser,{cols:r,addJot:!0,autoTag:s?void 0:nx(e.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:s?2:void 0,leqno:e.parser.settings.leqno},"display"),l,u=0,d={type:"ordgroup",mode:e.mode,body:[]};if(n[0]&&n[0].type==="ordgroup"){for(var f="",p=0;p<n[0].body.length;p++){var g=Rt(n[0].body[p],"textord");f+=g.text}l=Number(f),u=l*2}var b=!u;a.body.forEach(function(S){for(var C=1;C<S.length;C+=2){var O=Rt(S[C],"styling"),L=Rt(O.body[0],"ordgroup");L.body.unshift(d)}if(b)u<S.length&&(u=S.length);else{var D=S.length/2;if(l<D)throw new Le("Too many math in a row: "+("expected "+l+", but got "+D),S[0])}});for(var v=0;v<u;++v){var E="r",x=0;v%2===1?E="l":v>0&&b&&(x=1),r[v]={type:"align",align:E,pregap:x,postgap:0}}return a.colSeparationType=b?"align":"alignat",a};Ra({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var n=Nb(e[0]),r=n?[e[0]]:Rt(e[0],"ordgroup").body,i=r.map(function(a){var l=Q_(a),u=l.text;if("lcr".indexOf(u)!==-1)return{type:"align",align:u};if(u==="|")return{type:"separator",separator:"|"};if(u===":")return{type:"separator",separator:":"};throw new Le("Unknown column alignment: "+u,a)}),s={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return nu(t.parser,s,rx(t.envName))},htmlBuilder:Da,mathmlBuilder:Ia});Ra({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(t.envName.charAt(t.envName.length-1)==="*"){var i=t.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,"lcr".indexOf(n)===-1)throw new Le("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),r.cols=[{type:"align",align:n}]}}var s=nu(t.parser,r,rx(t.envName)),a=Math.max(0,...s.body.map(l=>l.length));return s.cols=new Array(a).fill({type:"align",align:n}),e?{type:"leftright",mode:t.mode,body:[s],left:e[0],right:e[1],rightColor:void 0}:s},htmlBuilder:Da,mathmlBuilder:Ia});Ra({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},n=nu(t.parser,e,"script");return n.colSeparationType="small",n},htmlBuilder:Da,mathmlBuilder:Ia});Ra({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var n=Nb(e[0]),r=n?[e[0]]:Rt(e[0],"ordgroup").body,i=r.map(function(a){var l=Q_(a),u=l.text;if("lc".indexOf(u)!==-1)return{type:"align",align:u};throw new Le("Unknown column alignment: "+u,a)});if(i.length>1)throw new Le("{subarray} can contain only one column");var s={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5};if(s=nu(t.parser,s,"script"),s.body.length>0&&s.body[0].length>1)throw new Le("{subarray} can contain only one column");return s},htmlBuilder:Da,mathmlBuilder:Ia});Ra({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=nu(t.parser,e,rx(t.envName));return{type:"leftright",mode:t.mode,body:[n],left:t.envName.indexOf("r")>-1?".":"\\{",right:t.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:Da,mathmlBuilder:Ia});Ra({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:JM,htmlBuilder:Da,mathmlBuilder:Ia});Ra({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){["gather","gather*"].includes(t.envName)&&Rb(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:nx(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return nu(t.parser,e,"display")},htmlBuilder:Da,mathmlBuilder:Ia});Ra({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:JM,htmlBuilder:Da,mathmlBuilder:Ia});Ra({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){Rb(t);var e={autoTag:nx(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return nu(t.parser,e,"display")},htmlBuilder:Da,mathmlBuilder:Ia});Ra({type:"array",names:["CD"],props:{numArgs:0},handler(t){return Rb(t),bne(t.parser)},htmlBuilder:Da,mathmlBuilder:Ia});B("\\nonumber","\\gdef\\@eqnsw{0}");B("\\notag","\\nonumber");Ye({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new Le(t.funcName+" valid only within array environment")}});var N8=QM;Ye({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:n,funcName:r}=t,i=e[0];if(i.type!=="ordgroup")throw new Le("Invalid environment name",i);for(var s="",a=0;a<i.body.length;++a)s+=Rt(i.body[a],"textord").text;if(r==="\\begin"){if(!N8.hasOwnProperty(s))throw new Le("No such environment: "+s,i);var l=N8[s],{args:u,optArgs:d}=n.parseArguments("\\begin{"+s+"}",l),f={mode:n.mode,envName:s,parser:n},p=l.handler(f,u,d);n.expect("\\end",!1);var g=n.nextToken,b=Rt(n.parseFunction(),"environment");if(b.name!==s)throw new Le("Mismatch: \\begin{"+s+"} matched by \\end{"+b.name+"}",g);return p}return{type:"environment",mode:n.mode,name:s,nameGroup:i}}});var eR=(t,e)=>{var n=t.font,r=e.withFont(n);return Xt(t.body,r)},tR=(t,e)=>{var n=t.font,r=e.withFont(n);return Sn(t.body,r)},O8={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Ye({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(t,e)=>{var{parser:n,funcName:r}=t,i=Xg(e[0]),s=r;return s in O8&&(s=O8[s]),{type:"font",mode:n.mode,font:s.slice(1),body:i}},htmlBuilder:eR,mathmlBuilder:tR});Ye({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(t,e)=>{var{parser:n}=t,r=e[0],i=en.isCharacterBox(r);return{type:"mclass",mode:n.mode,mclass:Ob(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:i}}});Ye({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{parser:n,funcName:r,breakOnTokenText:i}=t,{mode:s}=n,a=n.parseExpression(!0,i),l="math"+r.slice(1);return{type:"font",mode:s,font:l,body:{type:"ordgroup",mode:n.mode,body:a}}},htmlBuilder:eR,mathmlBuilder:tR});var nR=(t,e)=>{var n=e;return t==="display"?n=n.id>=ft.SCRIPT.id?n.text():ft.DISPLAY:t==="text"&&n.size===ft.DISPLAY.size?n=ft.TEXT:t==="script"?n=ft.SCRIPT:t==="scriptscript"&&(n=ft.SCRIPTSCRIPT),n},ix=(t,e)=>{var n=nR(t.size,e.style),r=n.fracNum(),i=n.fracDen(),s;s=e.havingStyle(r);var a=Xt(t.numer,s,e);if(t.continued){var l=8.5/e.fontMetrics().ptPerEm,u=3.5/e.fontMetrics().ptPerEm;a.height=a.height<l?l:a.height,a.depth=a.depth<u?u:a.depth}s=e.havingStyle(i);var d=Xt(t.denom,s,e),f,p,g;t.hasBarLine?(t.barSize?(p=Zn(t.barSize,e),f=fe.makeLineSpan("frac-line",e,p)):f=fe.makeLineSpan("frac-line",e),p=f.height,g=f.height):(f=null,p=0,g=e.fontMetrics().defaultRuleThickness);var b,v,E;n.size===ft.DISPLAY.size||t.size==="display"?(b=e.fontMetrics().num1,p>0?v=3*g:v=7*g,E=e.fontMetrics().denom1):(p>0?(b=e.fontMetrics().num2,v=g):(b=e.fontMetrics().num3,v=3*g),E=e.fontMetrics().denom2);var x;if(f){var C=e.fontMetrics().axisHeight;b-a.depth-(C+.5*p)<v&&(b+=v-(b-a.depth-(C+.5*p))),C-.5*p-(d.height-E)<v&&(E+=v-(C-.5*p-(d.height-E)));var O=-(C-.5*p);x=fe.makeVList({positionType:"individualShift",children:[{type:"elem",elem:d,shift:E},{type:"elem",elem:f,shift:O},{type:"elem",elem:a,shift:-b}]},e)}else{var S=b-a.depth-(d.height-E);S<v&&(b+=.5*(v-S),E+=.5*(v-S)),x=fe.makeVList({positionType:"individualShift",children:[{type:"elem",elem:d,shift:E},{type:"elem",elem:a,shift:-b}]},e)}s=e.havingStyle(n),x.height*=s.sizeMultiplier/e.sizeMultiplier,x.depth*=s.sizeMultiplier/e.sizeMultiplier;var L;n.size===ft.DISPLAY.size?L=e.fontMetrics().delim1:n.size===ft.SCRIPTSCRIPT.size?L=e.havingStyle(ft.SCRIPT).fontMetrics().delim2:L=e.fontMetrics().delim2;var D,R;return t.leftDelim==null?D=dh(e,["mopen"]):D=wo.customSizedDelim(t.leftDelim,L,!0,e.havingStyle(n),t.mode,["mopen"]),t.continued?R=fe.makeSpan([]):t.rightDelim==null?R=dh(e,["mclose"]):R=wo.customSizedDelim(t.rightDelim,L,!0,e.havingStyle(n),t.mode,["mclose"]),fe.makeSpan(["mord"].concat(s.sizingClasses(e)),[D,fe.makeSpan(["mfrac"],[x]),R],e)},sx=(t,e)=>{var n=new Me.MathNode("mfrac",[Sn(t.numer,e),Sn(t.denom,e)]);if(!t.hasBarLine)n.setAttribute("linethickness","0px");else if(t.barSize){var r=Zn(t.barSize,e);n.setAttribute("linethickness",Ue(r))}var i=nR(t.size,e.style);if(i.size!==e.style.size){n=new Me.MathNode("mstyle",[n]);var s=i.size===ft.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",s),n.setAttribute("scriptlevel","0")}if(t.leftDelim!=null||t.rightDelim!=null){var a=[];if(t.leftDelim!=null){var l=new Me.MathNode("mo",[new Me.TextNode(t.leftDelim.replace("\\",""))]);l.setAttribute("fence","true"),a.push(l)}if(a.push(n),t.rightDelim!=null){var u=new Me.MathNode("mo",[new Me.TextNode(t.rightDelim.replace("\\",""))]);u.setAttribute("fence","true"),a.push(u)}return K_(a)}return n};Ye({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(t,e)=>{var{parser:n,funcName:r}=t,i=e[0],s=e[1],a,l=null,u=null,d="auto";switch(r){case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=!1,l="(",u=")";break;case"\\\\bracefrac":a=!1,l="\\{",u="\\}";break;case"\\\\brackfrac":a=!1,l="[",u="]";break;default:throw new Error("Unrecognized genfrac command")}switch(r){case"\\dfrac":case"\\dbinom":d="display";break;case"\\tfrac":case"\\tbinom":d="text";break}return{type:"genfrac",mode:n.mode,continued:!1,numer:i,denom:s,hasBarLine:a,leftDelim:l,rightDelim:u,size:d,barSize:null}},htmlBuilder:ix,mathmlBuilder:sx});Ye({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(t,e)=>{var{parser:n,funcName:r}=t,i=e[0],s=e[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:i,denom:s,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}});Ye({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var{parser:e,funcName:n,token:r}=t,i;switch(n){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:r}}});var M8=["display","text","script","scriptscript"],R8=function(e){var n=null;return e.length>0&&(n=e,n=n==="."?null:n),n};Ye({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var{parser:n}=t,r=e[4],i=e[5],s=Xg(e[0]),a=s.type==="atom"&&s.family==="open"?R8(s.text):null,l=Xg(e[1]),u=l.type==="atom"&&l.family==="close"?R8(l.text):null,d=Rt(e[2],"size"),f,p=null;d.isBlank?f=!0:(p=d.value,f=p.number>0);var g="auto",b=e[3];if(b.type==="ordgroup"){if(b.body.length>0){var v=Rt(b.body[0],"textord");g=M8[Number(v.text)]}}else b=Rt(b,"textord"),g=M8[Number(b.text)];return{type:"genfrac",mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:f,barSize:p,leftDelim:a,rightDelim:u,size:g}},htmlBuilder:ix,mathmlBuilder:sx});Ye({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:n,funcName:r,token:i}=t;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:Rt(e[0],"size").value,token:i}}});Ye({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:n,funcName:r}=t,i=e[0],s=ote(Rt(e[1],"infix").size),a=e[2],l=s.number>0;return{type:"genfrac",mode:n.mode,numer:i,denom:a,continued:!1,hasBarLine:l,barSize:s,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:ix,mathmlBuilder:sx});var rR=(t,e)=>{var n=e.style,r,i;t.type==="supsub"?(r=t.sup?Xt(t.sup,e.havingStyle(n.sup()),e):Xt(t.sub,e.havingStyle(n.sub()),e),i=Rt(t.base,"horizBrace")):i=Rt(t,"horizBrace");var s=Xt(i.base,e.havingBaseStyle(ft.DISPLAY)),a=Do.svgSpan(i,e),l;if(i.isOver?(l=fe.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:a}]},e),l.children[0].children[0].children[1].classes.push("svg-align")):(l=fe.makeVList({positionType:"bottom",positionData:s.depth+.1+a.height,children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s}]},e),l.children[0].children[0].children[0].classes.push("svg-align")),r){var u=fe.makeSpan(["mord",i.isOver?"mover":"munder"],[l],e);i.isOver?l=fe.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:u},{type:"kern",size:.2},{type:"elem",elem:r}]},e):l=fe.makeVList({positionType:"bottom",positionData:u.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:u}]},e)}return fe.makeSpan(["mord",i.isOver?"mover":"munder"],[l],e)},Rne=(t,e)=>{var n=Do.mathMLnode(t.label);return new Me.MathNode(t.isOver?"mover":"munder",[Sn(t.base,e),n])};Ye({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t;return{type:"horizBrace",mode:n.mode,label:r,isOver:/^\\over/.test(r),base:e[0]}},htmlBuilder:rR,mathmlBuilder:Rne});Ye({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[1],i=Rt(e[0],"url").url;return n.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:n.mode,href:i,body:gr(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var n=Lr(t.body,e,!1);return fe.makeAnchor(t.href,[],n,e)},mathmlBuilder:(t,e)=>{var n=Xl(t.body,e);return n instanceof as||(n=new as("mrow",[n])),n.setAttribute("href",t.href),n}});Ye({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=Rt(e[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var i=[],s=0;s<r.length;s++){var a=r[s];a==="~"&&(a="\\textasciitilde"),i.push({type:"textord",mode:"text",text:a})}var l={type:"text",mode:n.mode,font:"\\texttt",body:i};return{type:"href",mode:n.mode,href:r,body:gr(l)}}});Ye({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(t,e){var{parser:n}=t;return{type:"hbox",mode:n.mode,body:gr(e[0])}},htmlBuilder(t,e){var n=Lr(t.body,e,!1);return fe.makeFragment(n)},mathmlBuilder(t,e){return new Me.MathNode("mrow",Wi(t.body,e))}});Ye({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(t,e)=>{var{parser:n,funcName:r,token:i}=t,s=Rt(e[0],"raw").string,a=e[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l,u={};switch(r){case"\\htmlClass":u.class=s,l={command:"\\htmlClass",class:s};break;case"\\htmlId":u.id=s,l={command:"\\htmlId",id:s};break;case"\\htmlStyle":u.style=s,l={command:"\\htmlStyle",style:s};break;case"\\htmlData":{for(var d=s.split(","),f=0;f<d.length;f++){var p=d[f],g=p.indexOf("=");if(g<0)throw new Le("\\htmlData key/value '"+p+"' missing equals sign");var b=p.slice(0,g),v=p.slice(g+1);u["data-"+b.trim()]=v}l={command:"\\htmlData",attributes:u};break}default:throw new Error("Unrecognized html command")}return n.settings.isTrusted(l)?{type:"html",mode:n.mode,attributes:u,body:gr(a)}:n.formatUnsupportedCmd(r)},htmlBuilder:(t,e)=>{var n=Lr(t.body,e,!1),r=["enclosing"];t.attributes.class&&r.push(...t.attributes.class.trim().split(/\s+/));var i=fe.makeSpan(r,n,e);for(var s in t.attributes)s!=="class"&&t.attributes.hasOwnProperty(s)&&i.setAttribute(s,t.attributes[s]);return i},mathmlBuilder:(t,e)=>Xl(t.body,e)});Ye({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t;return{type:"htmlmathml",mode:n.mode,html:gr(e[0]),mathml:gr(e[1])}},htmlBuilder:(t,e)=>{var n=Lr(t.html,e,!1);return fe.makeFragment(n)},mathmlBuilder:(t,e)=>Xl(t.mathml,e)});var lE=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!n)throw new Le("Invalid size: '"+e+"' in \\includegraphics");var r={number:+(n[1]+n[2]),unit:n[3]};if(!xM(r))throw new Le("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};Ye({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(t,e,n)=>{var{parser:r}=t,i={number:0,unit:"em"},s={number:.9,unit:"em"},a={number:0,unit:"em"},l="";if(n[0])for(var u=Rt(n[0],"raw").string,d=u.split(","),f=0;f<d.length;f++){var p=d[f].split("=");if(p.length===2){var g=p[1].trim();switch(p[0].trim()){case"alt":l=g;break;case"width":i=lE(g);break;case"height":s=lE(g);break;case"totalheight":a=lE(g);break;default:throw new Le("Invalid key: '"+p[0]+"' in \\includegraphics.")}}}var b=Rt(e[0],"url").url;return l===""&&(l=b,l=l.replace(/^.*[\\/]/,""),l=l.substring(0,l.lastIndexOf("."))),r.settings.isTrusted({command:"\\includegraphics",url:b})?{type:"includegraphics",mode:r.mode,alt:l,width:i,height:s,totalheight:a,src:b}:r.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(t,e)=>{var n=Zn(t.height,e),r=0;t.totalheight.number>0&&(r=Zn(t.totalheight,e)-n);var i=0;t.width.number>0&&(i=Zn(t.width,e));var s={height:Ue(n+r)};i>0&&(s.width=Ue(i)),r>0&&(s.verticalAlign=Ue(-r));var a=new Rte(t.src,t.alt,s);return a.height=n,a.depth=r,a},mathmlBuilder:(t,e)=>{var n=new Me.MathNode("mglyph",[]);n.setAttribute("alt",t.alt);var r=Zn(t.height,e),i=0;if(t.totalheight.number>0&&(i=Zn(t.totalheight,e)-r,n.setAttribute("valign",Ue(-i))),n.setAttribute("height",Ue(r+i)),t.width.number>0){var s=Zn(t.width,e);n.setAttribute("width",Ue(s))}return n.setAttribute("src",t.src),n}});Ye({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:n,funcName:r}=t,i=Rt(e[0],"size");if(n.settings.strict){var s=r[1]==="m",a=i.value.unit==="mu";s?(a||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+i.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:i.value}},htmlBuilder(t,e){return fe.makeGlue(t.dimension,e)},mathmlBuilder(t,e){var n=Zn(t.dimension,e);return new Me.SpaceNode(n)}});Ye({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n,funcName:r}=t,i=e[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(t,e)=>{var n;t.alignment==="clap"?(n=fe.makeSpan([],[Xt(t.body,e)]),n=fe.makeSpan(["inner"],[n],e)):n=fe.makeSpan(["inner"],[Xt(t.body,e)]);var r=fe.makeSpan(["fix"],[]),i=fe.makeSpan([t.alignment],[n,r],e),s=fe.makeSpan(["strut"]);return s.style.height=Ue(i.height+i.depth),i.depth&&(s.style.verticalAlign=Ue(-i.depth)),i.children.unshift(s),i=fe.makeSpan(["thinbox"],[i],e),fe.makeSpan(["mord","vbox"],[i],e)},mathmlBuilder:(t,e)=>{var n=new Me.MathNode("mpadded",[Sn(t.body,e)]);if(t.alignment!=="rlap"){var r=t.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}});Ye({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:n,parser:r}=t,i=r.mode;r.switchMode("math");var s=n==="\\("?"\\)":"$",a=r.parseExpression(!1,s);return r.expect(s),r.switchMode(i),{type:"styling",mode:r.mode,style:"text",body:a}}});Ye({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new Le("Mismatched "+t.funcName)}});var D8=(t,e)=>{switch(e.style.size){case ft.DISPLAY.size:return t.display;case ft.TEXT.size:return t.text;case ft.SCRIPT.size:return t.script;case ft.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};Ye({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:n}=t;return{type:"mathchoice",mode:n.mode,display:gr(e[0]),text:gr(e[1]),script:gr(e[2]),scriptscript:gr(e[3])}},htmlBuilder:(t,e)=>{var n=D8(t,e),r=Lr(n,e,!1);return fe.makeFragment(r)},mathmlBuilder:(t,e)=>{var n=D8(t,e);return Xl(n,e)}});var iR=(t,e,n,r,i,s,a)=>{t=fe.makeSpan([],[t]);var l=n&&en.isCharacterBox(n),u,d;if(e){var f=Xt(e,r.havingStyle(i.sup()),r);d={elem:f,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-f.depth)}}if(n){var p=Xt(n,r.havingStyle(i.sub()),r);u={elem:p,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-p.height)}}var g;if(d&&u){var b=r.fontMetrics().bigOpSpacing5+u.elem.height+u.elem.depth+u.kern+t.depth+a;g=fe.makeVList({positionType:"bottom",positionData:b,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:u.elem,marginLeft:Ue(-s)},{type:"kern",size:u.kern},{type:"elem",elem:t},{type:"kern",size:d.kern},{type:"elem",elem:d.elem,marginLeft:Ue(s)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else if(u){var v=t.height-a;g=fe.makeVList({positionType:"top",positionData:v,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:u.elem,marginLeft:Ue(-s)},{type:"kern",size:u.kern},{type:"elem",elem:t}]},r)}else if(d){var E=t.depth+a;g=fe.makeVList({positionType:"bottom",positionData:E,children:[{type:"elem",elem:t},{type:"kern",size:d.kern},{type:"elem",elem:d.elem,marginLeft:Ue(s)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else return t;var x=[g];if(u&&s!==0&&!l){var S=fe.makeSpan(["mspace"],[],r);S.style.marginRight=Ue(s),x.unshift(S)}return fe.makeSpan(["mop","op-limits"],x,r)},sR=["\\smallint"],Kd=(t,e)=>{var n,r,i=!1,s;t.type==="supsub"?(n=t.sup,r=t.sub,s=Rt(t.base,"op"),i=!0):s=Rt(t,"op");var a=e.style,l=!1;a.size===ft.DISPLAY.size&&s.symbol&&!sR.includes(s.name)&&(l=!0);var u;if(s.symbol){var d=l?"Size2-Regular":"Size1-Regular",f="";if((s.name==="\\oiint"||s.name==="\\oiiint")&&(f=s.name.slice(1),s.name=f==="oiint"?"\\iint":"\\iiint"),u=fe.makeSymbol(s.name,d,"math",e,["mop","op-symbol",l?"large-op":"small-op"]),f.length>0){var p=u.italic,g=fe.staticSvg(f+"Size"+(l?"2":"1"),e);u=fe.makeVList({positionType:"individualShift",children:[{type:"elem",elem:u,shift:0},{type:"elem",elem:g,shift:l?.08:0}]},e),s.name="\\"+f,u.classes.unshift("mop"),u.italic=p}}else if(s.body){var b=Lr(s.body,e,!0);b.length===1&&b[0]instanceof zs?(u=b[0],u.classes[0]="mop"):u=fe.makeSpan(["mop"],b,e)}else{for(var v=[],E=1;E<s.name.length;E++)v.push(fe.mathsym(s.name[E],s.mode,e));u=fe.makeSpan(["mop"],v,e)}var x=0,S=0;return(u instanceof zs||s.name==="\\oiint"||s.name==="\\oiiint")&&!s.suppressBaseShift&&(x=(u.height-u.depth)/2-e.fontMetrics().axisHeight,S=u.italic),i?iR(u,n,r,e,a,S,x):(x&&(u.style.position="relative",u.style.top=Ue(x)),u)},Wh=(t,e)=>{var n;if(t.symbol)n=new as("mo",[Us(t.name,t.mode)]),sR.includes(t.name)&&n.setAttribute("largeop","false");else if(t.body)n=new as("mo",Wi(t.body,e));else{n=new as("mi",[new Ea(t.name.slice(1))]);var r=new as("mo",[Us("⁡","text")]);t.parentIsSupSub?n=new as("mrow",[n,r]):n=DM([n,r])}return n},Dne={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Ye({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(t,e)=>{var{parser:n,funcName:r}=t,i=r;return i.length===1&&(i=Dne[i]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:Kd,mathmlBuilder:Wh});Ye({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:gr(r)}},htmlBuilder:Kd,mathmlBuilder:Wh});var Ine={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Ye({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(t){var{parser:e,funcName:n}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:Kd,mathmlBuilder:Wh});Ye({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:n}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:Kd,mathmlBuilder:Wh});Ye({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(t){var{parser:e,funcName:n}=t,r=n;return r.length===1&&(r=Ine[r]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:Kd,mathmlBuilder:Wh});var aR=(t,e)=>{var n,r,i=!1,s;t.type==="supsub"?(n=t.sup,r=t.sub,s=Rt(t.base,"operatorname"),i=!0):s=Rt(t,"operatorname");var a;if(s.body.length>0){for(var l=s.body.map(p=>{var g=p.text;return typeof g=="string"?{type:"textord",mode:p.mode,text:g}:p}),u=Lr(l,e.withFont("mathrm"),!0),d=0;d<u.length;d++){var f=u[d];f instanceof zs&&(f.text=f.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}a=fe.makeSpan(["mop"],u,e)}else a=fe.makeSpan(["mop"],[],e);return i?iR(a,n,r,e,e.style,0,0):a},Lne=(t,e)=>{for(var n=Wi(t.body,e.withFont("mathrm")),r=!0,i=0;i<n.length;i++){var s=n[i];if(!(s instanceof Me.SpaceNode))if(s instanceof Me.MathNode)switch(s.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":{var a=s.children[0];s.children.length===1&&a instanceof Me.TextNode?a.text=a.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):r=!1;break}default:r=!1}else r=!1}if(r){var l=n.map(f=>f.toText()).join("");n=[new Me.TextNode(l)]}var u=new Me.MathNode("mi",n);u.setAttribute("mathvariant","normal");var d=new Me.MathNode("mo",[Us("⁡","text")]);return t.parentIsSupSub?new Me.MathNode("mrow",[u,d]):Me.newDocumentFragment([u,d])};Ye({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(t,e)=>{var{parser:n,funcName:r}=t,i=e[0];return{type:"operatorname",mode:n.mode,body:gr(i),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:aR,mathmlBuilder:Lne});B("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");lc({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?fe.makeFragment(Lr(t.body,e,!1)):fe.makeSpan(["mord"],Lr(t.body,e,!0),e)},mathmlBuilder(t,e){return Xl(t.body,e,!0)}});Ye({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:n}=t,r=e[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(t,e){var n=Xt(t.body,e.havingCrampedStyle()),r=fe.makeLineSpan("overline-line",e),i=e.fontMetrics().defaultRuleThickness,s=fe.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r},{type:"kern",size:i}]},e);return fe.makeSpan(["mord","overline"],[s],e)},mathmlBuilder(t,e){var n=new Me.MathNode("mo",[new Me.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new Me.MathNode("mover",[Sn(t.body,e),n]);return r.setAttribute("accent","true"),r}});Ye({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"phantom",mode:n.mode,body:gr(r)}},htmlBuilder:(t,e)=>{var n=Lr(t.body,e.withPhantom(),!1);return fe.makeFragment(n)},mathmlBuilder:(t,e)=>{var n=Wi(t.body,e);return new Me.MathNode("mphantom",n)}});Ye({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"hphantom",mode:n.mode,body:r}},htmlBuilder:(t,e)=>{var n=fe.makeSpan([],[Xt(t.body,e.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var r=0;r<n.children.length;r++)n.children[r].height=0,n.children[r].depth=0;return n=fe.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},e),fe.makeSpan(["mord"],[n],e)},mathmlBuilder:(t,e)=>{var n=Wi(gr(t.body),e),r=new Me.MathNode("mphantom",n),i=new Me.MathNode("mpadded",[r]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i}});Ye({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(t,e)=>{var n=fe.makeSpan(["inner"],[Xt(t.body,e.withPhantom())]),r=fe.makeSpan(["fix"],[]);return fe.makeSpan(["mord","rlap"],[n,r],e)},mathmlBuilder:(t,e)=>{var n=Wi(gr(t.body),e),r=new Me.MathNode("mphantom",n),i=new Me.MathNode("mpadded",[r]);return i.setAttribute("width","0px"),i}});Ye({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:n}=t,r=Rt(e[0],"size").value,i=e[1];return{type:"raisebox",mode:n.mode,dy:r,body:i}},htmlBuilder(t,e){var n=Xt(t.body,e),r=Zn(t.dy,e);return fe.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},e)},mathmlBuilder(t,e){var n=new Me.MathNode("mpadded",[Sn(t.body,e)]),r=t.dy.number+t.dy.unit;return n.setAttribute("voffset",r),n}});Ye({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}});Ye({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(t,e,n){var{parser:r}=t,i=n[0],s=Rt(e[0],"size"),a=Rt(e[1],"size");return{type:"rule",mode:r.mode,shift:i&&Rt(i,"size").value,width:s.value,height:a.value}},htmlBuilder(t,e){var n=fe.makeSpan(["mord","rule"],[],e),r=Zn(t.width,e),i=Zn(t.height,e),s=t.shift?Zn(t.shift,e):0;return n.style.borderRightWidth=Ue(r),n.style.borderTopWidth=Ue(i),n.style.bottom=Ue(s),n.width=r,n.height=i+s,n.depth=-s,n.maxFontSize=i*1.125*e.sizeMultiplier,n},mathmlBuilder(t,e){var n=Zn(t.width,e),r=Zn(t.height,e),i=t.shift?Zn(t.shift,e):0,s=e.color&&e.getColor()||"black",a=new Me.MathNode("mspace");a.setAttribute("mathbackground",s),a.setAttribute("width",Ue(n)),a.setAttribute("height",Ue(r));var l=new Me.MathNode("mpadded",[a]);return i>=0?l.setAttribute("height",Ue(i)):(l.setAttribute("height",Ue(i)),l.setAttribute("depth",Ue(-i))),l.setAttribute("voffset",Ue(i)),l}});function oR(t,e,n){for(var r=Lr(t,e,!1),i=e.sizeMultiplier/n.sizeMultiplier,s=0;s<r.length;s++){var a=r[s].classes.indexOf("sizing");a<0?Array.prototype.push.apply(r[s].classes,e.sizingClasses(n)):r[s].classes[a+1]==="reset-size"+e.size&&(r[s].classes[a+1]="reset-size"+n.size),r[s].height*=i,r[s].depth*=i}return fe.makeFragment(r)}var I8=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],Pne=(t,e)=>{var n=e.havingSize(t.size);return oR(t.body,n,e)};Ye({type:"sizing",names:I8,props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{breakOnTokenText:n,funcName:r,parser:i}=t,s=i.parseExpression(!1,n);return{type:"sizing",mode:i.mode,size:I8.indexOf(r)+1,body:s}},htmlBuilder:Pne,mathmlBuilder:(t,e)=>{var n=e.havingSize(t.size),r=Wi(t.body,n),i=new Me.MathNode("mstyle",r);return i.setAttribute("mathsize",Ue(n.sizeMultiplier)),i}});Ye({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(t,e,n)=>{var{parser:r}=t,i=!1,s=!1,a=n[0]&&Rt(n[0],"ordgroup");if(a)for(var l="",u=0;u<a.body.length;++u){var d=a.body[u];if(l=d.text,l==="t")i=!0;else if(l==="b")s=!0;else{i=!1,s=!1;break}}else i=!0,s=!0;var f=e[0];return{type:"smash",mode:r.mode,body:f,smashHeight:i,smashDepth:s}},htmlBuilder:(t,e)=>{var n=fe.makeSpan([],[Xt(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return n;if(t.smashHeight&&(n.height=0,n.children))for(var r=0;r<n.children.length;r++)n.children[r].height=0;if(t.smashDepth&&(n.depth=0,n.children))for(var i=0;i<n.children.length;i++)n.children[i].depth=0;var s=fe.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},e);return fe.makeSpan(["mord"],[s],e)},mathmlBuilder:(t,e)=>{var n=new Me.MathNode("mpadded",[Sn(t.body,e)]);return t.smashHeight&&n.setAttribute("height","0px"),t.smashDepth&&n.setAttribute("depth","0px"),n}});Ye({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,n){var{parser:r}=t,i=n[0],s=e[0];return{type:"sqrt",mode:r.mode,body:s,index:i}},htmlBuilder(t,e){var n=Xt(t.body,e.havingCrampedStyle());n.height===0&&(n.height=e.fontMetrics().xHeight),n=fe.wrapFragment(n,e);var r=e.fontMetrics(),i=r.defaultRuleThickness,s=i;e.style.id<ft.TEXT.id&&(s=e.fontMetrics().xHeight);var a=i+s/4,l=n.height+n.depth+a+i,{span:u,ruleWidth:d,advanceWidth:f}=wo.sqrtImage(l,e),p=u.height-d;p>n.height+n.depth+a&&(a=(a+p-n.height-n.depth)/2);var g=u.height-n.height-a-d;n.style.paddingLeft=Ue(f);var b=fe.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+g)},{type:"elem",elem:u},{type:"kern",size:d}]},e);if(t.index){var v=e.havingStyle(ft.SCRIPTSCRIPT),E=Xt(t.index,v,e),x=.6*(b.height-b.depth),S=fe.makeVList({positionType:"shift",positionData:-x,children:[{type:"elem",elem:E}]},e),C=fe.makeSpan(["root"],[S]);return fe.makeSpan(["mord","sqrt"],[C,b],e)}else return fe.makeSpan(["mord","sqrt"],[b],e)},mathmlBuilder(t,e){var{body:n,index:r}=t;return r?new Me.MathNode("mroot",[Sn(n,e),Sn(r,e)]):new Me.MathNode("msqrt",[Sn(n,e)])}});var L8={display:ft.DISPLAY,text:ft.TEXT,script:ft.SCRIPT,scriptscript:ft.SCRIPTSCRIPT};Ye({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:n,funcName:r,parser:i}=t,s=i.parseExpression(!0,n),a=r.slice(1,r.length-5);return{type:"styling",mode:i.mode,style:a,body:s}},htmlBuilder(t,e){var n=L8[t.style],r=e.havingStyle(n).withFont("");return oR(t.body,r,e)},mathmlBuilder(t,e){var n=L8[t.style],r=e.havingStyle(n),i=Wi(t.body,r),s=new Me.MathNode("mstyle",i),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},l=a[t.style];return s.setAttribute("scriptlevel",l[0]),s.setAttribute("displaystyle",l[1]),s}});var Bne=function(e,n){var r=e.base;if(r)if(r.type==="op"){var i=r.limits&&(n.style.size===ft.DISPLAY.size||r.alwaysHandleSupSub);return i?Kd:null}else if(r.type==="operatorname"){var s=r.alwaysHandleSupSub&&(n.style.size===ft.DISPLAY.size||r.limits);return s?aR:null}else{if(r.type==="accent")return en.isCharacterBox(r.base)?Z_:null;if(r.type==="horizBrace"){var a=!e.sub;return a===r.isOver?rR:null}else return null}else return null};lc({type:"supsub",htmlBuilder(t,e){var n=Bne(t,e);if(n)return n(t,e);var{base:r,sup:i,sub:s}=t,a=Xt(r,e),l,u,d=e.fontMetrics(),f=0,p=0,g=r&&en.isCharacterBox(r);if(i){var b=e.havingStyle(e.style.sup());l=Xt(i,b,e),g||(f=a.height-b.fontMetrics().supDrop*b.sizeMultiplier/e.sizeMultiplier)}if(s){var v=e.havingStyle(e.style.sub());u=Xt(s,v,e),g||(p=a.depth+v.fontMetrics().subDrop*v.sizeMultiplier/e.sizeMultiplier)}var E;e.style===ft.DISPLAY?E=d.sup1:e.style.cramped?E=d.sup3:E=d.sup2;var x=e.sizeMultiplier,S=Ue(.5/d.ptPerEm/x),C=null;if(u){var O=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");(a instanceof zs||O)&&(C=Ue(-a.italic))}var L;if(l&&u){f=Math.max(f,E,l.depth+.25*d.xHeight),p=Math.max(p,d.sub2);var D=d.defaultRuleThickness,R=4*D;if(f-l.depth-(u.height-p)<R){p=R-(f-l.depth)+u.height;var F=.8*d.xHeight-(f-l.depth);F>0&&(f+=F,p-=F)}var G=[{type:"elem",elem:u,shift:p,marginRight:S,marginLeft:C},{type:"elem",elem:l,shift:-f,marginRight:S}];L=fe.makeVList({positionType:"individualShift",children:G},e)}else if(u){p=Math.max(p,d.sub1,u.height-.8*d.xHeight);var Z=[{type:"elem",elem:u,marginLeft:C,marginRight:S}];L=fe.makeVList({positionType:"shift",positionData:p,children:Z},e)}else if(l)f=Math.max(f,E,l.depth+.25*d.xHeight),L=fe.makeVList({positionType:"shift",positionData:-f,children:[{type:"elem",elem:l,marginRight:S}]},e);else throw new Error("supsub must have either sup or sub.");var q=V4(a,"right")||"mord";return fe.makeSpan([q],[a,fe.makeSpan(["msupsub"],[L])],e)},mathmlBuilder(t,e){var n=!1,r,i;t.base&&t.base.type==="horizBrace"&&(i=!!t.sup,i===t.base.isOver&&(n=!0,r=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var s=[Sn(t.base,e)];t.sub&&s.push(Sn(t.sub,e)),t.sup&&s.push(Sn(t.sup,e));var a;if(n)a=r?"mover":"munder";else if(t.sub)if(t.sup){var d=t.base;d&&d.type==="op"&&d.limits&&e.style===ft.DISPLAY||d&&d.type==="operatorname"&&d.alwaysHandleSupSub&&(e.style===ft.DISPLAY||d.limits)?a="munderover":a="msubsup"}else{var u=t.base;u&&u.type==="op"&&u.limits&&(e.style===ft.DISPLAY||u.alwaysHandleSupSub)||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(u.limits||e.style===ft.DISPLAY)?a="munder":a="msub"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===ft.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===ft.DISPLAY)?a="mover":a="msup"}return new Me.MathNode(a,s)}});lc({type:"atom",htmlBuilder(t,e){return fe.mathsym(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var n=new Me.MathNode("mo",[Us(t.text,t.mode)]);if(t.family==="bin"){var r=X_(t,e);r==="bold-italic"&&n.setAttribute("mathvariant",r)}else t.family==="punct"?n.setAttribute("separator","true"):(t.family==="open"||t.family==="close")&&n.setAttribute("stretchy","false");return n}});var lR={mi:"italic",mn:"normal",mtext:"normal"};lc({type:"mathord",htmlBuilder(t,e){return fe.makeOrd(t,e,"mathord")},mathmlBuilder(t,e){var n=new Me.MathNode("mi",[Us(t.text,t.mode,e)]),r=X_(t,e)||"italic";return r!==lR[n.type]&&n.setAttribute("mathvariant",r),n}});lc({type:"textord",htmlBuilder(t,e){return fe.makeOrd(t,e,"textord")},mathmlBuilder(t,e){var n=Us(t.text,t.mode,e),r=X_(t,e)||"normal",i;return t.mode==="text"?i=new Me.MathNode("mtext",[n]):/[0-9]/.test(t.text)?i=new Me.MathNode("mn",[n]):t.text==="\\prime"?i=new Me.MathNode("mo",[n]):i=new Me.MathNode("mi",[n]),r!==lR[i.type]&&i.setAttribute("mathvariant",r),i}});var uE={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},cE={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};lc({type:"spacing",htmlBuilder(t,e){if(cE.hasOwnProperty(t.text)){var n=cE[t.text].className||"";if(t.mode==="text"){var r=fe.makeOrd(t,e,"textord");return r.classes.push(n),r}else return fe.makeSpan(["mspace",n],[fe.mathsym(t.text,t.mode,e)],e)}else{if(uE.hasOwnProperty(t.text))return fe.makeSpan(["mspace",uE[t.text]],[],e);throw new Le('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var n;if(cE.hasOwnProperty(t.text))n=new Me.MathNode("mtext",[new Me.TextNode(" ")]);else{if(uE.hasOwnProperty(t.text))return new Me.MathNode("mspace");throw new Le('Unknown type of space "'+t.text+'"')}return n}});var P8=()=>{var t=new Me.MathNode("mtd",[]);return t.setAttribute("width","50%"),t};lc({type:"tag",mathmlBuilder(t,e){var n=new Me.MathNode("mtable",[new Me.MathNode("mtr",[P8(),new Me.MathNode("mtd",[Xl(t.body,e)]),P8(),new Me.MathNode("mtd",[Xl(t.tag,e)])])]);return n.setAttribute("width","100%"),n}});var B8={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},z8={"\\textbf":"textbf","\\textmd":"textmd"},zne={"\\textit":"textit","\\textup":"textup"},U8=(t,e)=>{var n=t.font;if(n){if(B8[n])return e.withTextFontFamily(B8[n]);if(z8[n])return e.withTextFontWeight(z8[n]);if(n==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(zne[n])};Ye({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(t,e){var{parser:n,funcName:r}=t,i=e[0];return{type:"text",mode:n.mode,body:gr(i),font:r}},htmlBuilder(t,e){var n=U8(t,e),r=Lr(t.body,n,!0);return fe.makeSpan(["mord","text"],r,n)},mathmlBuilder(t,e){var n=U8(t,e);return Xl(t.body,n)}});Ye({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"underline",mode:n.mode,body:e[0]}},htmlBuilder(t,e){var n=Xt(t.body,e),r=fe.makeLineSpan("underline-line",e),i=e.fontMetrics().defaultRuleThickness,s=fe.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:i},{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n}]},e);return fe.makeSpan(["mord","underline"],[s],e)},mathmlBuilder(t,e){var n=new Me.MathNode("mo",[new Me.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new Me.MathNode("munder",[Sn(t.body,e),n]);return r.setAttribute("accentunder","true"),r}});Ye({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:n}=t;return{type:"vcenter",mode:n.mode,body:e[0]}},htmlBuilder(t,e){var n=Xt(t.body,e),r=e.fontMetrics().axisHeight,i=.5*(n.height-r-(n.depth+r));return fe.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:n}]},e)},mathmlBuilder(t,e){return new Me.MathNode("mpadded",[Sn(t.body,e)],["vcenter"])}});Ye({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,n){throw new Le("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var n=F8(t),r=[],i=e.havingStyle(e.style.text()),s=0;s<n.length;s++){var a=n[s];a==="~"&&(a="\\textasciitilde"),r.push(fe.makeSymbol(a,"Typewriter-Regular",t.mode,i,["mord","texttt"]))}return fe.makeSpan(["mord","text"].concat(i.sizingClasses(e)),fe.tryCombineChars(r),i)},mathmlBuilder(t,e){var n=new Me.TextNode(F8(t)),r=new Me.MathNode("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var F8=t=>t.body.replace(/ /g,t.star?"␣":" "),Pl=MM,uR=`[ \r
	]`,Une="\\\\[a-zA-Z@]+",Fne="\\\\[^\uD800-\uDFFF]",Hne="("+Une+")"+uR+"*",jne=`\\\\(
|[ \r	]+
?)[ \r	]*`,K4="[̀-ͯ]",$ne=new RegExp(K4+"+$"),qne="("+uR+"+)|"+(jne+"|")+"([!-\\[\\]-‧‪-퟿豈-]"+(K4+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(K4+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+Hne)+("|"+Fne+")");class H8{constructor(e,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=n,this.tokenRegex=new RegExp(qne,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,n){this.catcodes[e]=n}lex(){var e=this.input,n=this.tokenRegex.lastIndex;if(n===e.length)return new ds("EOF",new Hi(this,n,n));var r=this.tokenRegex.exec(e);if(r===null||r.index!==n)throw new Le("Unexpected character: '"+e[n]+"'",new ds(e[n],new Hi(this,n,n+1)));var i=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[i]===14){var s=e.indexOf(`
`,this.tokenRegex.lastIndex);return s===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=s+1,this.lex()}return new ds(i,new Hi(this,n,this.tokenRegex.lastIndex))}}class Vne{constructor(e,n){e===void 0&&(e={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Le("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var n in e)e.hasOwnProperty(n)&&(e[n]==null?delete this.current[n]:this.current[n]=e[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,n,r){if(r===void 0&&(r=!1),r){for(var i=0;i<this.undefStack.length;i++)delete this.undefStack[i][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=n)}else{var s=this.undefStack[this.undefStack.length-1];s&&!s.hasOwnProperty(e)&&(s[e]=this.current[e])}n==null?delete this.current[e]:this.current[e]=n}}var Gne=ZM;B("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});B("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});B("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});B("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});B("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var n=t.future();return e[0].length===1&&e[0][0].text===n.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});B("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");B("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var j8={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};B("\\char",function(t){var e=t.popToken(),n,r="";if(e.text==="'")n=8,e=t.popToken();else if(e.text==='"')n=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")r=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new Le("\\char` missing argument");r=e.text.charCodeAt(0)}else n=10;if(n){if(r=j8[e.text],r==null||r>=n)throw new Le("Invalid base-"+n+" digit "+e.text);for(var i;(i=j8[t.future().text])!=null&&i<n;)r*=n,r+=i,t.popToken()}return"\\@char{"+r+"}"});var ax=(t,e,n,r)=>{var i=t.consumeArg().tokens;if(i.length!==1)throw new Le("\\newcommand's first argument must be a macro name");var s=i[0].text,a=t.isDefined(s);if(a&&!e)throw new Le("\\newcommand{"+s+"} attempting to redefine "+(s+"; use \\renewcommand"));if(!a&&!n)throw new Le("\\renewcommand{"+s+"} when command "+s+" does not yet exist; use \\newcommand");var l=0;if(i=t.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var u="",d=t.expandNextToken();d.text!=="]"&&d.text!=="EOF";)u+=d.text,d=t.expandNextToken();if(!u.match(/^\s*[0-9]+\s*$/))throw new Le("Invalid number of arguments: "+u);l=parseInt(u),i=t.consumeArg().tokens}return a&&r||t.macros.set(s,{tokens:i,numArgs:l}),""};B("\\newcommand",t=>ax(t,!1,!0,!1));B("\\renewcommand",t=>ax(t,!0,!1,!1));B("\\providecommand",t=>ax(t,!0,!0,!0));B("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(n=>n.text).join("")),""});B("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(n=>n.text).join("")),""});B("\\show",t=>{var e=t.popToken(),n=e.text;return console.log(e,t.macros.get(n),Pl[n],On.math[n],On.text[n]),""});B("\\bgroup","{");B("\\egroup","}");B("~","\\nobreakspace");B("\\lq","`");B("\\rq","'");B("\\aa","\\r a");B("\\AA","\\r A");B("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");B("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");B("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");B("ℬ","\\mathscr{B}");B("ℰ","\\mathscr{E}");B("ℱ","\\mathscr{F}");B("ℋ","\\mathscr{H}");B("ℐ","\\mathscr{I}");B("ℒ","\\mathscr{L}");B("ℳ","\\mathscr{M}");B("ℛ","\\mathscr{R}");B("ℭ","\\mathfrak{C}");B("ℌ","\\mathfrak{H}");B("ℨ","\\mathfrak{Z}");B("\\Bbbk","\\Bbb{k}");B("·","\\cdotp");B("\\llap","\\mathllap{\\textrm{#1}}");B("\\rlap","\\mathrlap{\\textrm{#1}}");B("\\clap","\\mathclap{\\textrm{#1}}");B("\\mathstrut","\\vphantom{(}");B("\\underbar","\\underline{\\text{#1}}");B("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');B("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");B("\\ne","\\neq");B("≠","\\neq");B("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");B("∉","\\notin");B("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");B("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");B("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");B("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");B("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");B("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");B("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");B("⟂","\\perp");B("‼","\\mathclose{!\\mkern-0.8mu!}");B("∌","\\notni");B("⌜","\\ulcorner");B("⌝","\\urcorner");B("⌞","\\llcorner");B("⌟","\\lrcorner");B("©","\\copyright");B("®","\\textregistered");B("️","\\textregistered");B("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');B("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');B("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');B("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');B("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");B("⋮","\\vdots");B("\\varGamma","\\mathit{\\Gamma}");B("\\varDelta","\\mathit{\\Delta}");B("\\varTheta","\\mathit{\\Theta}");B("\\varLambda","\\mathit{\\Lambda}");B("\\varXi","\\mathit{\\Xi}");B("\\varPi","\\mathit{\\Pi}");B("\\varSigma","\\mathit{\\Sigma}");B("\\varUpsilon","\\mathit{\\Upsilon}");B("\\varPhi","\\mathit{\\Phi}");B("\\varPsi","\\mathit{\\Psi}");B("\\varOmega","\\mathit{\\Omega}");B("\\substack","\\begin{subarray}{c}#1\\end{subarray}");B("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");B("\\boxed","\\fbox{$\\displaystyle{#1}$}");B("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");B("\\implies","\\DOTSB\\;\\Longrightarrow\\;");B("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");B("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");B("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var $8={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};B("\\dots",function(t){var e="\\dotso",n=t.expandAfterFuture().text;return n in $8?e=$8[n]:(n.slice(0,4)==="\\not"||n in On.math&&["bin","rel"].includes(On.math[n].group))&&(e="\\dotsb"),e});var ox={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};B("\\dotso",function(t){var e=t.future().text;return e in ox?"\\ldots\\,":"\\ldots"});B("\\dotsc",function(t){var e=t.future().text;return e in ox&&e!==","?"\\ldots\\,":"\\ldots"});B("\\cdots",function(t){var e=t.future().text;return e in ox?"\\@cdots\\,":"\\@cdots"});B("\\dotsb","\\cdots");B("\\dotsm","\\cdots");B("\\dotsi","\\!\\cdots");B("\\dotsx","\\ldots\\,");B("\\DOTSI","\\relax");B("\\DOTSB","\\relax");B("\\DOTSX","\\relax");B("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");B("\\,","\\tmspace+{3mu}{.1667em}");B("\\thinspace","\\,");B("\\>","\\mskip{4mu}");B("\\:","\\tmspace+{4mu}{.2222em}");B("\\medspace","\\:");B("\\;","\\tmspace+{5mu}{.2777em}");B("\\thickspace","\\;");B("\\!","\\tmspace-{3mu}{.1667em}");B("\\negthinspace","\\!");B("\\negmedspace","\\tmspace-{4mu}{.2222em}");B("\\negthickspace","\\tmspace-{5mu}{.277em}");B("\\enspace","\\kern.5em ");B("\\enskip","\\hskip.5em\\relax");B("\\quad","\\hskip1em\\relax");B("\\qquad","\\hskip2em\\relax");B("\\tag","\\@ifstar\\tag@literal\\tag@paren");B("\\tag@paren","\\tag@literal{({#1})}");B("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new Le("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});B("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");B("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");B("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");B("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");B("\\newline","\\\\\\relax");B("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var cR=Ue(ya["Main-Regular"][84][1]-.7*ya["Main-Regular"][65][1]);B("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+cR+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");B("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+cR+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");B("\\hspace","\\@ifstar\\@hspacer\\@hspace");B("\\@hspace","\\hskip #1\\relax");B("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");B("\\ordinarycolon",":");B("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");B("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');B("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');B("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');B("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');B("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');B("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');B("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');B("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');B("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');B("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');B("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');B("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');B("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');B("∷","\\dblcolon");B("∹","\\eqcolon");B("≔","\\coloneqq");B("≕","\\eqqcolon");B("⩴","\\Coloneqq");B("\\ratio","\\vcentcolon");B("\\coloncolon","\\dblcolon");B("\\colonequals","\\coloneqq");B("\\coloncolonequals","\\Coloneqq");B("\\equalscolon","\\eqqcolon");B("\\equalscoloncolon","\\Eqqcolon");B("\\colonminus","\\coloneq");B("\\coloncolonminus","\\Coloneq");B("\\minuscolon","\\eqcolon");B("\\minuscoloncolon","\\Eqcolon");B("\\coloncolonapprox","\\Colonapprox");B("\\coloncolonsim","\\Colonsim");B("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");B("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");B("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");B("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");B("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");B("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");B("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");B("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");B("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");B("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");B("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");B("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");B("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");B("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");B("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");B("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");B("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");B("\\nleqq","\\html@mathml{\\@nleqq}{≰}");B("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");B("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");B("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");B("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");B("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");B("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");B("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");B("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");B("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");B("\\imath","\\html@mathml{\\@imath}{ı}");B("\\jmath","\\html@mathml{\\@jmath}{ȷ}");B("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");B("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");B("⟦","\\llbracket");B("⟧","\\rrbracket");B("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");B("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");B("⦃","\\lBrace");B("⦄","\\rBrace");B("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");B("⦵","\\minuso");B("\\darr","\\downarrow");B("\\dArr","\\Downarrow");B("\\Darr","\\Downarrow");B("\\lang","\\langle");B("\\rang","\\rangle");B("\\uarr","\\uparrow");B("\\uArr","\\Uparrow");B("\\Uarr","\\Uparrow");B("\\N","\\mathbb{N}");B("\\R","\\mathbb{R}");B("\\Z","\\mathbb{Z}");B("\\alef","\\aleph");B("\\alefsym","\\aleph");B("\\Alpha","\\mathrm{A}");B("\\Beta","\\mathrm{B}");B("\\bull","\\bullet");B("\\Chi","\\mathrm{X}");B("\\clubs","\\clubsuit");B("\\cnums","\\mathbb{C}");B("\\Complex","\\mathbb{C}");B("\\Dagger","\\ddagger");B("\\diamonds","\\diamondsuit");B("\\empty","\\emptyset");B("\\Epsilon","\\mathrm{E}");B("\\Eta","\\mathrm{H}");B("\\exist","\\exists");B("\\harr","\\leftrightarrow");B("\\hArr","\\Leftrightarrow");B("\\Harr","\\Leftrightarrow");B("\\hearts","\\heartsuit");B("\\image","\\Im");B("\\infin","\\infty");B("\\Iota","\\mathrm{I}");B("\\isin","\\in");B("\\Kappa","\\mathrm{K}");B("\\larr","\\leftarrow");B("\\lArr","\\Leftarrow");B("\\Larr","\\Leftarrow");B("\\lrarr","\\leftrightarrow");B("\\lrArr","\\Leftrightarrow");B("\\Lrarr","\\Leftrightarrow");B("\\Mu","\\mathrm{M}");B("\\natnums","\\mathbb{N}");B("\\Nu","\\mathrm{N}");B("\\Omicron","\\mathrm{O}");B("\\plusmn","\\pm");B("\\rarr","\\rightarrow");B("\\rArr","\\Rightarrow");B("\\Rarr","\\Rightarrow");B("\\real","\\Re");B("\\reals","\\mathbb{R}");B("\\Reals","\\mathbb{R}");B("\\Rho","\\mathrm{P}");B("\\sdot","\\cdot");B("\\sect","\\S");B("\\spades","\\spadesuit");B("\\sub","\\subset");B("\\sube","\\subseteq");B("\\supe","\\supseteq");B("\\Tau","\\mathrm{T}");B("\\thetasym","\\vartheta");B("\\weierp","\\wp");B("\\Zeta","\\mathrm{Z}");B("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");B("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");B("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");B("\\bra","\\mathinner{\\langle{#1}|}");B("\\ket","\\mathinner{|{#1}\\rangle}");B("\\braket","\\mathinner{\\langle{#1}\\rangle}");B("\\Bra","\\left\\langle#1\\right|");B("\\Ket","\\left|#1\\right\\rangle");var dR=t=>e=>{var n=e.consumeArg().tokens,r=e.consumeArg().tokens,i=e.consumeArg().tokens,s=e.consumeArg().tokens,a=e.macros.get("|"),l=e.macros.get("\\|");e.macros.beginGroup();var u=p=>g=>{t&&(g.macros.set("|",a),i.length&&g.macros.set("\\|",l));var b=p;if(!p&&i.length){var v=g.future();v.text==="|"&&(g.popToken(),b=!0)}return{tokens:b?i:r,numArgs:0}};e.macros.set("|",u(!1)),i.length&&e.macros.set("\\|",u(!0));var d=e.consumeArg().tokens,f=e.expandTokens([...s,...d,...n]);return e.macros.endGroup(),{tokens:f.reverse(),numArgs:0}};B("\\bra@ket",dR(!1));B("\\bra@set",dR(!0));B("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");B("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");B("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");B("\\angln","{\\angl n}");B("\\blue","\\textcolor{##6495ed}{#1}");B("\\orange","\\textcolor{##ffa500}{#1}");B("\\pink","\\textcolor{##ff00af}{#1}");B("\\red","\\textcolor{##df0030}{#1}");B("\\green","\\textcolor{##28ae7b}{#1}");B("\\gray","\\textcolor{gray}{#1}");B("\\purple","\\textcolor{##9d38bd}{#1}");B("\\blueA","\\textcolor{##ccfaff}{#1}");B("\\blueB","\\textcolor{##80f6ff}{#1}");B("\\blueC","\\textcolor{##63d9ea}{#1}");B("\\blueD","\\textcolor{##11accd}{#1}");B("\\blueE","\\textcolor{##0c7f99}{#1}");B("\\tealA","\\textcolor{##94fff5}{#1}");B("\\tealB","\\textcolor{##26edd5}{#1}");B("\\tealC","\\textcolor{##01d1c1}{#1}");B("\\tealD","\\textcolor{##01a995}{#1}");B("\\tealE","\\textcolor{##208170}{#1}");B("\\greenA","\\textcolor{##b6ffb0}{#1}");B("\\greenB","\\textcolor{##8af281}{#1}");B("\\greenC","\\textcolor{##74cf70}{#1}");B("\\greenD","\\textcolor{##1fab54}{#1}");B("\\greenE","\\textcolor{##0d923f}{#1}");B("\\goldA","\\textcolor{##ffd0a9}{#1}");B("\\goldB","\\textcolor{##ffbb71}{#1}");B("\\goldC","\\textcolor{##ff9c39}{#1}");B("\\goldD","\\textcolor{##e07d10}{#1}");B("\\goldE","\\textcolor{##a75a05}{#1}");B("\\redA","\\textcolor{##fca9a9}{#1}");B("\\redB","\\textcolor{##ff8482}{#1}");B("\\redC","\\textcolor{##f9685d}{#1}");B("\\redD","\\textcolor{##e84d39}{#1}");B("\\redE","\\textcolor{##bc2612}{#1}");B("\\maroonA","\\textcolor{##ffbde0}{#1}");B("\\maroonB","\\textcolor{##ff92c6}{#1}");B("\\maroonC","\\textcolor{##ed5fa6}{#1}");B("\\maroonD","\\textcolor{##ca337c}{#1}");B("\\maroonE","\\textcolor{##9e034e}{#1}");B("\\purpleA","\\textcolor{##ddd7ff}{#1}");B("\\purpleB","\\textcolor{##c6b9fc}{#1}");B("\\purpleC","\\textcolor{##aa87ff}{#1}");B("\\purpleD","\\textcolor{##7854ab}{#1}");B("\\purpleE","\\textcolor{##543b78}{#1}");B("\\mintA","\\textcolor{##f5f9e8}{#1}");B("\\mintB","\\textcolor{##edf2df}{#1}");B("\\mintC","\\textcolor{##e0e5cc}{#1}");B("\\grayA","\\textcolor{##f6f7f7}{#1}");B("\\grayB","\\textcolor{##f0f1f2}{#1}");B("\\grayC","\\textcolor{##e3e5e6}{#1}");B("\\grayD","\\textcolor{##d6d8da}{#1}");B("\\grayE","\\textcolor{##babec2}{#1}");B("\\grayF","\\textcolor{##888d93}{#1}");B("\\grayG","\\textcolor{##626569}{#1}");B("\\grayH","\\textcolor{##3b3e40}{#1}");B("\\grayI","\\textcolor{##21242c}{#1}");B("\\kaBlue","\\textcolor{##314453}{#1}");B("\\kaGreen","\\textcolor{##71B307}{#1}");var fR={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Yne{constructor(e,n,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=n,this.expansionCount=0,this.feed(e),this.macros=new Vne(Gne,n.macros),this.mode=r,this.stack=[]}feed(e){this.lexer=new H8(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var n,r,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:i,end:r}=this.consumeArg(["]"])}else({tokens:i,start:n,end:r}=this.consumeArg());return this.pushToken(new ds("EOF",r.loc)),this.pushTokens(i),new ds("",Hi.range(n,r))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var n=[],r=e&&e.length>0;r||this.consumeSpaces();var i=this.future(),s,a=0,l=0;do{if(s=this.popToken(),n.push(s),s.text==="{")++a;else if(s.text==="}"){if(--a,a===-1)throw new Le("Extra }",s)}else if(s.text==="EOF")throw new Le("Unexpected end of input in a macro argument, expected '"+(e&&r?e[l]:"}")+"'",s);if(e&&r)if((a===0||a===1&&e[l]==="{")&&s.text===e[l]){if(++l,l===e.length){n.splice(-l,l);break}}else l=0}while(a!==0||r);return i.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:i,end:s}}consumeArgs(e,n){if(n){if(n.length!==e+1)throw new Le("The length of delimiters doesn't match the number of args!");for(var r=n[0],i=0;i<r.length;i++){var s=this.popToken();if(r[i]!==s.text)throw new Le("Use of the macro doesn't match its definition",s)}}for(var a=[],l=0;l<e;l++)a.push(this.consumeArg(n&&n[l+1]).tokens);return a}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new Le("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var n=this.popToken(),r=n.text,i=n.noexpand?null:this._getExpansion(r);if(i==null||e&&i.unexpandable){if(e&&i==null&&r[0]==="\\"&&!this.isDefined(r))throw new Le("Undefined control sequence: "+r);return this.pushToken(n),!1}this.countExpansion(1);var s=i.tokens,a=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){s=s.slice();for(var l=s.length-1;l>=0;--l){var u=s[l];if(u.text==="#"){if(l===0)throw new Le("Incomplete placeholder at end of macro body",u);if(u=s[--l],u.text==="#")s.splice(l+1,1);else if(/^[1-9]$/.test(u.text))s.splice(l,2,...a[+u.text-1]);else throw new Le("Not a valid argument number",u)}}}return this.pushTokens(s),s.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new ds(e)]):void 0}expandTokens(e){var n=[],r=this.stack.length;for(this.pushTokens(e);this.stack.length>r;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),n.push(i)}return this.countExpansion(n.length),n}expandMacroAsText(e){var n=this.expandMacro(e);return n&&n.map(r=>r.text).join("")}_getExpansion(e){var n=this.macros.get(e);if(n==null)return n;if(e.length===1){var r=this.lexer.catcodes[e];if(r!=null&&r!==13)return}var i=typeof n=="function"?n(this):n;if(typeof i=="string"){var s=0;if(i.indexOf("#")!==-1)for(var a=i.replace(/##/g,"");a.indexOf("#"+(s+1))!==-1;)++s;for(var l=new H8(i,this.settings),u=[],d=l.lex();d.text!=="EOF";)u.push(d),d=l.lex();u.reverse();var f={tokens:u,numArgs:s};return f}return i}isDefined(e){return this.macros.has(e)||Pl.hasOwnProperty(e)||On.math.hasOwnProperty(e)||On.text.hasOwnProperty(e)||fR.hasOwnProperty(e)}isExpandable(e){var n=this.macros.get(e);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:Pl.hasOwnProperty(e)&&!Pl[e].primitive}}var q8=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,qm=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),dE={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},V8={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Db{constructor(e,n){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new Yne(e,n,this.mode),this.settings=n,this.leftrightDepth=0}expect(e,n){if(n===void 0&&(n=!0),this.fetch().text!==e)throw new Le("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());n&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var n=this.nextToken;this.consume(),this.gullet.pushToken(new ds("}")),this.gullet.pushTokens(e);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,r}parseExpression(e,n){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(Db.endOfExpression.indexOf(i.text)!==-1||n&&i.text===n||e&&Pl[i.text]&&Pl[i.text].infix)break;var s=this.parseAtom(n);if(s){if(s.type==="internal")continue}else break;r.push(s)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var n=-1,r,i=0;i<e.length;i++)if(e[i].type==="infix"){if(n!==-1)throw new Le("only one infix operator per group",e[i].token);n=i,r=e[i].replaceWith}if(n!==-1&&r){var s,a,l=e.slice(0,n),u=e.slice(n+1);l.length===1&&l[0].type==="ordgroup"?s=l[0]:s={type:"ordgroup",mode:this.mode,body:l},u.length===1&&u[0].type==="ordgroup"?a=u[0]:a={type:"ordgroup",mode:this.mode,body:u};var d;return r==="\\\\abovefrac"?d=this.callFunction(r,[s,e[n],a],[]):d=this.callFunction(r,[s,a],[]),[d]}else return e}handleSupSubscript(e){var n=this.fetch(),r=n.text;this.consume(),this.consumeSpaces();var i;do{var s;i=this.parseGroup(e)}while(((s=i)==null?void 0:s.type)==="internal");if(!i)throw new Le("Expected group after '"+r+"'",n);return i}formatUnsupportedCmd(e){for(var n=[],r=0;r<e.length;r++)n.push({type:"textord",mode:"text",text:e[r]});var i={type:"text",mode:this.mode,body:n},s={type:"color",mode:this.mode,color:this.settings.errorColor,body:[i]};return s}parseAtom(e){var n=this.parseGroup("atom",e);if((n==null?void 0:n.type)==="internal"||this.mode==="text")return n;for(var r,i;;){this.consumeSpaces();var s=this.fetch();if(s.text==="\\limits"||s.text==="\\nolimits"){if(n&&n.type==="op"){var a=s.text==="\\limits";n.limits=a,n.alwaysHandleSupSub=!0}else if(n&&n.type==="operatorname")n.alwaysHandleSupSub&&(n.limits=s.text==="\\limits");else throw new Le("Limit controls must follow a math operator",s);this.consume()}else if(s.text==="^"){if(r)throw new Le("Double superscript",s);r=this.handleSupSubscript("superscript")}else if(s.text==="_"){if(i)throw new Le("Double subscript",s);i=this.handleSupSubscript("subscript")}else if(s.text==="'"){if(r)throw new Le("Double superscript",s);var l={type:"textord",mode:this.mode,text:"\\prime"},u=[l];for(this.consume();this.fetch().text==="'";)u.push(l),this.consume();this.fetch().text==="^"&&u.push(this.handleSupSubscript("superscript")),r={type:"ordgroup",mode:this.mode,body:u}}else if(qm[s.text]){var d=q8.test(s.text),f=[];for(f.push(new ds(qm[s.text])),this.consume();;){var p=this.fetch().text;if(!qm[p]||q8.test(p)!==d)break;f.unshift(new ds(qm[p])),this.consume()}var g=this.subparse(f);d?i={type:"ordgroup",mode:"math",body:g}:r={type:"ordgroup",mode:"math",body:g}}else break}return r||i?{type:"supsub",mode:this.mode,base:n,sup:r,sub:i}:n}parseFunction(e,n){var r=this.fetch(),i=r.text,s=Pl[i];if(!s)return null;if(this.consume(),n&&n!=="atom"&&!s.allowedInArgument)throw new Le("Got function '"+i+"' with no arguments"+(n?" as "+n:""),r);if(this.mode==="text"&&!s.allowedInText)throw new Le("Can't use function '"+i+"' in text mode",r);if(this.mode==="math"&&s.allowedInMath===!1)throw new Le("Can't use function '"+i+"' in math mode",r);var{args:a,optArgs:l}=this.parseArguments(i,s);return this.callFunction(i,a,l,r,e)}callFunction(e,n,r,i,s){var a={funcName:e,parser:this,token:i,breakOnTokenText:s},l=Pl[e];if(l&&l.handler)return l.handler(a,n,r);throw new Le("No function handler for "+e)}parseArguments(e,n){var r=n.numArgs+n.numOptionalArgs;if(r===0)return{args:[],optArgs:[]};for(var i=[],s=[],a=0;a<r;a++){var l=n.argTypes&&n.argTypes[a],u=a<n.numOptionalArgs;(n.primitive&&l==null||n.type==="sqrt"&&a===1&&s[0]==null)&&(l="primitive");var d=this.parseGroupOfType("argument to '"+e+"'",l,u);if(u)s.push(d);else if(d!=null)i.push(d);else throw new Le("Null argument, please report this as a bug")}return{args:i,optArgs:s}}parseGroupOfType(e,n,r){switch(n){case"color":return this.parseColorGroup(r);case"size":return this.parseSizeGroup(r);case"url":return this.parseUrlGroup(r);case"math":case"text":return this.parseArgumentGroup(r,n);case"hbox":{var i=this.parseArgumentGroup(r,"text");return i!=null?{type:"styling",mode:i.mode,body:[i],style:"text"}:null}case"raw":{var s=this.parseStringGroup("raw",r);return s!=null?{type:"raw",mode:"text",string:s.text}:null}case"primitive":{if(r)throw new Le("A primitive argument cannot be optional");var a=this.parseGroup(e);if(a==null)throw new Le("Expected group as "+e,this.fetch());return a}case"original":case null:case void 0:return this.parseArgumentGroup(r);default:throw new Le("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(e,n){var r=this.gullet.scanArgument(n);if(r==null)return null;for(var i="",s;(s=this.fetch()).text!=="EOF";)i+=s.text,this.consume();return this.consume(),r.text=i,r}parseRegexGroup(e,n){for(var r=this.fetch(),i=r,s="",a;(a=this.fetch()).text!=="EOF"&&e.test(s+a.text);)i=a,s+=i.text,this.consume();if(s==="")throw new Le("Invalid "+n+": '"+r.text+"'",r);return r.range(i,s)}parseColorGroup(e){var n=this.parseStringGroup("color",e);if(n==null)return null;var r=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(n.text);if(!r)throw new Le("Invalid color: '"+n.text+"'",n);var i=r[0];return/^[0-9a-f]{6}$/i.test(i)&&(i="#"+i),{type:"color-token",mode:this.mode,color:i}}parseSizeGroup(e){var n,r=!1;if(this.gullet.consumeSpaces(),!e&&this.gullet.future().text!=="{"?n=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):n=this.parseStringGroup("size",e),!n)return null;!e&&n.text.length===0&&(n.text="0pt",r=!0);var i=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n.text);if(!i)throw new Le("Invalid size: '"+n.text+"'",n);var s={number:+(i[1]+i[2]),unit:i[3]};if(!xM(s))throw new Le("Invalid unit: '"+s.unit+"'",n);return{type:"size",mode:this.mode,value:s,isBlank:r}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var n=this.parseStringGroup("url",e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),n==null)return null;var r=n.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:r}}parseArgumentGroup(e,n){var r=this.gullet.scanArgument(e);if(r==null)return null;var i=this.mode;n&&this.switchMode(n),this.gullet.beginGroup();var s=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var a={type:"ordgroup",mode:this.mode,loc:r.loc,body:s};return n&&this.switchMode(i),a}parseGroup(e,n){var r=this.fetch(),i=r.text,s;if(i==="{"||i==="\\begingroup"){this.consume();var a=i==="{"?"}":"\\endgroup";this.gullet.beginGroup();var l=this.parseExpression(!1,a),u=this.fetch();this.expect(a),this.gullet.endGroup(),s={type:"ordgroup",mode:this.mode,loc:Hi.range(r,u),body:l,semisimple:i==="\\begingroup"||void 0}}else if(s=this.parseFunction(n,e)||this.parseSymbol(),s==null&&i[0]==="\\"&&!fR.hasOwnProperty(i)){if(this.settings.throwOnError)throw new Le("Undefined control sequence: "+i,r);s=this.formatUnsupportedCmd(i),this.consume()}return s}formLigatures(e){for(var n=e.length-1,r=0;r<n;++r){var i=e[r],s=i.text;s==="-"&&e[r+1].text==="-"&&(r+1<n&&e[r+2].text==="-"?(e.splice(r,3,{type:"textord",mode:"text",loc:Hi.range(i,e[r+2]),text:"---"}),n-=2):(e.splice(r,2,{type:"textord",mode:"text",loc:Hi.range(i,e[r+1]),text:"--"}),n-=1)),(s==="'"||s==="`")&&e[r+1].text===s&&(e.splice(r,2,{type:"textord",mode:"text",loc:Hi.range(i,e[r+1]),text:s+s}),n-=1)}}parseSymbol(){var e=this.fetch(),n=e.text;if(/^\\verb[^a-zA-Z]/.test(n)){this.consume();var r=n.slice(5),i=r.charAt(0)==="*";if(i&&(r=r.slice(1)),r.length<2||r.charAt(0)!==r.slice(-1))throw new Le(`\\verb assertion failed --
                    please report what input caused this bug`);return r=r.slice(1,-1),{type:"verb",mode:"text",body:r,star:i}}V8.hasOwnProperty(n[0])&&!On[this.mode][n[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+n[0]+'" used in math mode',e),n=V8[n[0]]+n.slice(1));var s=$ne.exec(n);s&&(n=n.substring(0,s.index),n==="i"?n="ı":n==="j"&&(n="ȷ"));var a;if(On[this.mode][n]){this.settings.strict&&this.mode==="math"&&q4.indexOf(n)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',e);var l=On[this.mode][n].group,u=Hi.range(e),d;if(Lte.hasOwnProperty(l)){var f=l;d={type:"atom",mode:this.mode,family:f,loc:u,text:n}}else d={type:l,mode:this.mode,loc:u,text:n};a=d}else if(n.charCodeAt(0)>=128)this.settings.strict&&(EM(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),e)),a={type:"textord",mode:"text",loc:Hi.range(e),text:n};else return null;if(this.consume(),s)for(var p=0;p<s[0].length;p++){var g=s[0][p];if(!dE[g])throw new Le("Unknown accent ' "+g+"'",e);var b=dE[g][this.mode]||dE[g].text;if(!b)throw new Le("Accent "+g+" unsupported in "+this.mode+" mode",e);a={type:"accent",mode:this.mode,loc:Hi.range(e),label:b,isStretchy:!1,isShifty:!0,base:a}}return a}}Db.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var lx=function(e,n){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var r=new Db(e,n);delete r.gullet.macros.current["\\df@tag"];var i=r.parse();if(delete r.gullet.macros.current["\\current@color"],delete r.gullet.macros.current["\\color"],r.gullet.macros.get("\\df@tag")){if(!n.displayMode)throw new Le("\\tag works only in display equations");i=[{type:"tag",mode:"text",body:i,tag:r.subparse([new ds("\\df@tag")])}]}return i},hR=function(e,n,r){n.textContent="";var i=ux(e,r).toNode();n.appendChild(i)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),hR=function(){throw new Le("KaTeX doesn't work in quirks mode.")});var Wne=function(e,n){var r=ux(e,n).toMarkup();return r},Kne=function(e,n){var r=new q_(n);return lx(e,r)},pR=function(e,n,r){if(r.throwOnError||!(e instanceof Le))throw e;var i=fe.makeSpan(["katex-error"],[new zs(n)]);return i.setAttribute("title",e.toString()),i.setAttribute("style","color:"+r.errorColor),i},ux=function(e,n){var r=new q_(n);try{var i=lx(e,r);return ine(i,e,r)}catch(s){return pR(s,e,r)}},Xne=function(e,n){var r=new q_(n);try{var i=lx(e,r);return sne(i,e,r)}catch(s){return pR(s,e,r)}},Qne="0.16.28",Zne={Span:Yh,Anchor:Y_,SymbolNode:zs,SvgNode:Mo,PathNode:Kl,LineNode:$4},G8={version:Qne,render:hR,renderToString:Wne,ParseError:Le,SETTINGS_SCHEMA:Tg,__parse:Kne,__renderToDomTree:ux,__renderToHTMLTree:Xne,__setFontMetrics:Cte,__defineSymbol:w,__defineFunction:Ye,__defineMacro:B,__domTree:Zne};const Jne={},ere=[];function tre(t){const e=t||Jne;return function(n,r){M_(n,"element",function(i,s){const a=Array.isArray(i.properties.className)?i.properties.className:ere,l=a.includes("language-math"),u=a.includes("math-display"),d=a.includes("math-inline");let f=u;if(!l&&!u&&!d)return;let p=s[s.length-1],g=i;if(i.tagName==="code"&&l&&p&&p.type==="element"&&p.tagName==="pre"&&(g=p,p=s[s.length-2],f=!0),!p)return;const b=XO(g,{whitespace:"pre"});let v;try{v=G8.renderToString(b,{...e,displayMode:f,throwOnError:!0})}catch(x){const S=x,C=S.name.toLowerCase();r.message("Could not render math with KaTeX",{ancestors:[...s,i],cause:S,place:i.position,ruleId:C,source:"rehype-katex"});try{v=G8.renderToString(b,{...e,displayMode:f,strict:"ignore",throwOnError:!1})}catch{v=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(e.errorColor||"#cc0000"),title:String(x)},children:[{type:"text",value:b}]}]}}typeof v=="string"&&(v=Zee(v).children);const E=p.children.indexOf(g);return p.children.splice(E,1,...v),UN})}}function nre(){return{enter:{mathFlow:t,mathFlowFenceMeta:e,mathText:s},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:l,mathText:a,mathTextData:l}};function t(u){const d={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[d]}},u)}function e(){this.buffer()}function n(){const u=this.resume(),d=this.stack[this.stack.length-1];d.type,d.meta=u}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(u){const d=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),f=this.stack[this.stack.length-1];f.type,this.exit(u),f.value=d;const p=f.data.hChildren[0];p.type,p.tagName,p.children.push({type:"text",value:d}),this.data.mathFlowInside=void 0}function s(u){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},u),this.buffer()}function a(u){const d=this.resume(),f=this.stack[this.stack.length-1];f.type,this.exit(u),f.value=d,f.data.hChildren.push({type:"text",value:d})}function l(u){this.config.enter.data.call(this,u),this.config.exit.data.call(this,u)}}function rre(t){let e=(t||{}).singleDollarTextMath;return e==null&&(e=!0),r.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
`,inConstruct:"mathFlowMeta"},{character:"$",after:e?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(s,a,l,u){const d=s.value||"",f=l.createTracker(u),p="$".repeat(Math.max(GN(d,"$")+1,2)),g=l.enter("mathFlow");let b=f.move(p);if(s.meta){const v=l.enter("mathFlowMeta");b+=f.move(l.safe(s.meta,{after:`
`,before:b,encode:["$"],...f.current()})),v()}return b+=f.move(`
`),d&&(b+=f.move(d+`
`)),b+=f.move(p),g(),b}function r(s,a,l){let u=s.value||"",d=1;for(e||d++;new RegExp("(^|[^$])"+"\\$".repeat(d)+"([^$]|$)").test(u);)d++;const f="$".repeat(d);/[^ \r\n]/.test(u)&&(/^[ \r\n]/.test(u)&&/[ \r\n]$/.test(u)||/^\$|\$$/.test(u))&&(u=" "+u+" ");let p=-1;for(;++p<l.unsafe.length;){const g=l.unsafe[p];if(!g.atBreak)continue;const b=l.compilePattern(g);let v;for(;v=b.exec(u);){let E=v.index;u.codePointAt(E)===10&&u.codePointAt(E-1)===13&&E--,u=u.slice(0,E)+" "+u.slice(v.index+1)}}return f+u+f}function i(){return"$"}}const ire={tokenize:sre,concrete:!0,name:"mathFlow"},Y8={tokenize:are,partial:!0};function sre(t,e,n){const r=this,i=r.events[r.events.length-1],s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0;let a=0;return l;function l(C){return t.enter("mathFlow"),t.enter("mathFlowFence"),t.enter("mathFlowFenceSequence"),u(C)}function u(C){return C===36?(t.consume(C),a++,u):a<2?n(C):(t.exit("mathFlowFenceSequence"),Bt(t,d,"whitespace")(C))}function d(C){return C===null||rt(C)?p(C):(t.enter("mathFlowFenceMeta"),t.enter("chunkString",{contentType:"string"}),f(C))}function f(C){return C===null||rt(C)?(t.exit("chunkString"),t.exit("mathFlowFenceMeta"),p(C)):C===36?n(C):(t.consume(C),f)}function p(C){return t.exit("mathFlowFence"),r.interrupt?e(C):t.attempt(Y8,g,x)(C)}function g(C){return t.attempt({tokenize:S,partial:!0},x,b)(C)}function b(C){return(s?Bt(t,v,"linePrefix",s+1):v)(C)}function v(C){return C===null?x(C):rt(C)?t.attempt(Y8,g,x)(C):(t.enter("mathFlowValue"),E(C))}function E(C){return C===null||rt(C)?(t.exit("mathFlowValue"),v(C)):(t.consume(C),E)}function x(C){return t.exit("mathFlow"),e(C)}function S(C,O,L){let D=0;return Bt(C,R,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function R(Z){return C.enter("mathFlowFence"),C.enter("mathFlowFenceSequence"),F(Z)}function F(Z){return Z===36?(D++,C.consume(Z),F):D<a?L(Z):(C.exit("mathFlowFenceSequence"),Bt(C,G,"whitespace")(Z))}function G(Z){return Z===null||rt(Z)?(C.exit("mathFlowFence"),O(Z)):L(Z)}}}function are(t,e,n){const r=this;return i;function i(a){return a===null?e(a):(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}function ore(t){let n=(t||{}).singleDollarTextMath;return n==null&&(n=!0),{tokenize:r,resolve:lre,previous:ure,name:"mathText"};function r(i,s,a){let l=0,u,d;return f;function f(E){return i.enter("mathText"),i.enter("mathTextSequence"),p(E)}function p(E){return E===36?(i.consume(E),l++,p):l<2&&!n?a(E):(i.exit("mathTextSequence"),g(E))}function g(E){return E===null?a(E):E===36?(d=i.enter("mathTextSequence"),u=0,v(E)):E===32?(i.enter("space"),i.consume(E),i.exit("space"),g):rt(E)?(i.enter("lineEnding"),i.consume(E),i.exit("lineEnding"),g):(i.enter("mathTextData"),b(E))}function b(E){return E===null||E===32||E===36||rt(E)?(i.exit("mathTextData"),g(E)):(i.consume(E),b)}function v(E){return E===36?(i.consume(E),u++,v):u===l?(i.exit("mathTextSequence"),i.exit("mathText"),s(E)):(d.type="mathTextData",b(E))}}}function lre(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="mathTextData"){t[e][1].type="mathTextPadding",t[n][1].type="mathTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)i===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(i=r):(r===e||t[r][1].type==="lineEnding")&&(t[i][1].type="mathTextData",r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),e-=r-i-2,r=i+2),i=void 0);return t}function ure(t){return t!==36||this.events[this.events.length-1][1].type==="characterEscape"}function cre(t){return{flow:{36:ire},text:{36:ore(t)}}}const dre={};function fre(t){const e=this,n=t||dre,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(cre(n)),s.push(nre()),a.push(rre(n))}const hre=({children:t,className:e,node:n,inline:r,...i})=>{const[s,a]=z.useState(!1),l=z.useRef(null),u=async()=>{var g;try{const b=((g=l.current)==null?void 0:g.textContent)||"";await navigator.clipboard.writeText(b),a(!0),setTimeout(()=>a(!1),2e3)}catch(b){console.error("Failed to copy code:",b)}},d=g=>{var b;return typeof g=="string"?g:Array.isArray(g)?g.map(d).join(""):(b=g==null?void 0:g.props)!=null&&b.children?d(g.props.children):""},f=d(t);return r||!f.includes(`
`)?A.jsx("code",{className:e,...i,children:t}):A.jsxs("div",{className:"relative group",children:[A.jsx("button",{onClick:u,className:"absolute top-1 right-1 opacity-0 group-hover:opacity-100 transition-opacity inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium text-gray-600 hover:text-gray-900 bg-white hover:bg-gray-50 border border-gray-200 rounded-md shadow-sm z-10",title:"Copy code",children:s?A.jsxs(A.Fragment,{children:[A.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:A.jsx("polyline",{points:"20 6 9 17 4 12"})}),A.jsx("span",{children:"Copied!"})]}):A.jsx(A.Fragment,{children:A.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[A.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),A.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})}),A.jsx("code",{ref:l,className:e,...i,children:t})]})},pre=({children:t})=>A.jsx("div",{className:"not-prose",children:t}),mre=({href:t,onSend:e,...n})=>{const r=z.useCallback(i=>{e(decodeURIComponent(t.slice(23))),i.preventDefault()},[t,e]);return t.startsWith("https://cycls.com/send/")?A.jsx("a",{...n,className:n.className||"underline decoration-[var(--text-tertiary)]/40 decoration-2 hover:decoration-[var(--text-tertiary)]/60",href:"#",onClick:r}):A.jsx("a",{...n,href:t,target:"_blank",rel:"noreferrer"})},gre=({children:t,...e})=>{const n=z.useRef(null),[r,i]=z.useState(!1),s=z.useCallback(()=>{try{if(!n.current)return;const l=[],u=n.current,d=Array.from(u.querySelectorAll("thead th")).map(x=>{var S;return((S=x.textContent)==null?void 0:S.trim())||""});d.length>0&&l.push(d),Array.from(u.querySelectorAll("tbody tr")).forEach(x=>{const S=Array.from(x.querySelectorAll("td")).map(C=>{var O;return((O=C.textContent)==null?void 0:O.trim())||""});S.length>0&&l.push(S)});const p=l.map(x=>x.map(S=>{const C=String(S);return C.includes(",")||C.includes('"')||C.includes(`
`)?`"${C.replace(/"/g,'""')}"`:C}).join(",")).join(`
`),g="\uFEFF",b=new Blob([g+p],{type:"text/csv;charset=utf-8;"}),v=window.URL.createObjectURL(b),E=document.createElement("a");E.href=v,E.download=`table-export-${Date.now()}.csv`,document.body.appendChild(E),E.click(),document.body.removeChild(E),window.URL.revokeObjectURL(v)}catch(l){console.error("Failed to export table as CSV:",l)}},[]),a=z.useCallback(async()=>{try{if(!n.current)return;const l=[],u=n.current,d=Array.from(u.querySelectorAll("thead th")).map(p=>{var g;return((g=p.textContent)==null?void 0:g.trim())||""});d.length>0&&l.push(d.join("	")),Array.from(u.querySelectorAll("tbody tr")).forEach(p=>{const g=Array.from(p.querySelectorAll("td")).map(b=>{var v;return((v=b.textContent)==null?void 0:v.trim())||""});g.length>0&&l.push(g.join("	"))}),await navigator.clipboard.writeText(l.join(`
`)),i(!0),setTimeout(()=>i(!1),2e3)}catch(l){console.error("Failed to copy table:",l)}},[]);return A.jsxs("div",{className:"table-wrapper",children:[A.jsx("table",{ref:n,...e,children:t}),A.jsxs("div",{className:"!-mt-2",style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",marginTop:"8px",borderRadius:"8px",backgroundColor:"var(--bg-secondary)",border:"1px solid var(--border-primary)"},children:[A.jsxs("button",{onClick:s,style:{display:"flex",alignItems:"center",gap:"8px",fontSize:"14px",color:"var(--text-secondary)",background:"none",border:"none",cursor:"pointer",padding:"0"},"aria-label":"Export table as CSV",children:[A.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[A.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),A.jsx("line",{x1:"3",y1:"9",x2:"21",y2:"9"}),A.jsx("line",{x1:"3",y1:"15",x2:"21",y2:"15"}),A.jsx("line",{x1:"9",y1:"3",x2:"9",y2:"21"}),A.jsx("line",{x1:"15",y1:"3",x2:"15",y2:"21"})]}),A.jsx("span",{children:"Export as CSV"})]}),A.jsx("button",{onClick:a,style:{display:"flex",alignItems:"center",gap:"6px",padding:"6px",borderRadius:"4px",background:"none",border:"none",cursor:"pointer",color:r?"var(--text-success, #22c55e)":"var(--text-tertiary)"},title:r?"Copied!":"Copy table","aria-label":"Copy table",children:r?A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:A.jsx("polyline",{points:"20 6 9 17 4 12"})}):A.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[A.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),A.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})]})},Wu=le.memo(({markdown:t,onSend:e})=>{const n=z.useMemo(()=>({raw:pre,a:r=>A.jsx(mre,{...r,onSend:e}),code:hre,table:gre}),[e]);return A.jsx("div",{dir:"auto",children:A.jsx(LY,{components:n,remarkPlugins:[YK,fre],rehypePlugins:[rJ,tre,[qee,{ignoreMissing:!0,detect:!0}]],children:t})})});Wu.displayName="MarkdownRenderer";const yo={MAX_FILE_BYTES:10*1024*1024,ALLOWED_MIME:new Set(["image/jpeg","image/png","image/webp","application/pdf","text/plain","text/markdown","text/csv","video/mp4","video/webm","video/ogg","video/quicktime"]),MAX_CHATS:15};function fh(t){const e=/<!--\s*cycls:attachments\s*([\s\S]*?)\s*cycls:attachments\s*-->/m,n=t.match(e);if(!n)return{clean:t,attachments:[]};let r=[];try{r=JSON.parse(n[1])}catch{r=[]}return{clean:t.replace(e,"").trimEnd(),attachments:r}}function bre(t){return t?t.startsWith("image/")?"image":t.startsWith("video/")?"video":t==="application/pdf"?"pdf":t==="text/csv"?"csv":t==="text/markdown"?"md":t==="text/plain"?"txt":"file":"file"}async function vre(t,e="anon",n="anon"){if(t.size>yo.MAX_FILE_BYTES)throw new Error("File too large (max 10MB)");if(!yo.ALLOWED_MIME.has(t.type))throw new Error(`Type not allowed: ${t.type}`);const r=new FormData;r.append("file",t),r.append("orgId",e),r.append("userId",n);const i=await fetch("https://cfywthfcvbajcekvwajz.supabase.co/functions/v1/upload",{method:"POST",body:r});if(!i.ok)throw new Error(`Upload failed (${i.status})`);return await i.json()}const Qg=t=>t<1024?`${t}B`:t<1024*1024?`${(t/1024).toFixed(2)}kB`:`${(t/(1024*1024)).toFixed(2)}MB`,yre=t=>{if(t.size>yo.MAX_FILE_BYTES)return{valid:!1,error:`File "${t.name}" is too large (${Qg(t.size)}). Maximum size is ${Qg(yo.MAX_FILE_BYTES)}.`};if(!yo.ALLOWED_MIME.has(t.type)){const e=Array.from(yo.ALLOWED_MIME).map(n=>n.split("/")[1]).join(", ");return{valid:!1,error:`File type "${t.type}" is not supported. Allowed types: ${e}`}}return{valid:!0}},Ere=({attachments:t=[]})=>t.length?A.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:t.map((e,n)=>{const r=bre(e.mime);if(r==="image")return A.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"group relative overflow-hidden rounded-lg shadow-sm transition-all duration-200 theme-transition",style:{border:"1px solid var(--border-primary)"},children:A.jsx("img",{src:e.url,alt:"",loading:"lazy",className:"mb-1 w-40 rounded-md"})},n);const i={pdf:"📄",csv:"📊",md:"📝",txt:"📝"}[r]||"📎";return A.jsxs("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2.5 rounded-xl backdrop-blur-sm px-4 py-2.5 text-sm transition-all shadow-sm hover:bg-[var(--bg-hover)] theme-transition",style:{border:"1px solid var(--border-primary)",backgroundColor:"var(--bg-primary)"},children:[A.jsx("span",{className:"text-xl",children:i}),A.jsx("span",{className:"text-xs uppercase font-semibold tracking-wide",style:{color:"var(--text-tertiary)"},children:r||"file"})]},n)})}):null,_re=({error:t,onRetry:e,isRetrying:n})=>{const r=i=>i?i.type==="network"?"Network error. Please check your connection and try again.":i.type==="timeout"?"Request timed out. The server took too long to respond.":i.type==="rate_limit"?i.message||"Too many requests. Please wait a moment and try again.":i.type==="server"?`Server error (${i.status||"unknown"}). Please try again later.`:i.type==="abort"?"Request was cancelled.":i.message||"An error occurred while processing your request.":"An unexpected error occurred";return A.jsx("div",{className:"rounded-lg p-4 my-2 theme-transition",style:{backgroundColor:"rgba(239, 68, 68, 0.1)",border:"1px solid rgba(239, 68, 68, 0.3)"},children:A.jsxs("div",{className:"flex items-start gap-3",children:[A.jsx("div",{className:"flex-shrink-0 mt-0.5",children:A.jsxs("svg",{className:"h-5 w-5 text-red-500",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[A.jsx("circle",{cx:"12",cy:"12",r:"10"}),A.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),A.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})}),A.jsxs("div",{className:"flex-1 min-w-0",children:[A.jsx("p",{className:"text-sm font-medium text-red-500",children:"Error"}),A.jsx("p",{className:"text-sm mt-1",style:{color:"var(--text-secondary)"},children:r(t)}),e&&t.type!=="abort"&&A.jsx("button",{onClick:e,disabled:n,className:"mt-3 inline-flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium text-red-500 hover:text-red-400 border border-red-500/30 hover:border-red-500/50 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed theme-transition",style:{backgroundColor:"var(--bg-primary)"},children:n?A.jsxs(A.Fragment,{children:[A.jsxs("svg",{className:"animate-spin h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[A.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),A.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),A.jsx("span",{children:"Retrying..."})]}):A.jsxs(A.Fragment,{children:[A.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[A.jsx("polyline",{points:"23 4 23 10 17 10"}),A.jsx("polyline",{points:"1 20 1 14 7 14"}),A.jsx("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})]}),A.jsx("span",{children:"Retry"})]})})]})]})})},xre=({message:t,onCopy:e,onRegenerate:n,isLastAssistant:r})=>{const[i,s]=z.useState(!1),a=async()=>{try{const{clean:l}=fh(t.content);await navigator.clipboard.writeText(l),s(!0),setTimeout(()=>s(!1),2e3)}catch(l){console.error("Failed to copy:",l)}};return A.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200",children:[A.jsx("button",{onClick:a,className:"inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium rounded-lg transition-colors hover:bg-[var(--bg-hover)] theme-transition",style:{color:"var(--text-tertiary)"},title:"Copy message",children:i?A.jsxs(A.Fragment,{children:[A.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:A.jsx("polyline",{points:"20 6 9 17 4 12"})}),A.jsx("span",{children:"Copied!"})]}):A.jsxs(A.Fragment,{children:[A.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[A.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),A.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),A.jsx("span",{children:"Copy"})]})}),r&&A.jsxs("button",{onClick:n,className:"inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium rounded-lg transition-colors hover:bg-[var(--bg-hover)] theme-transition",style:{color:"var(--text-tertiary)"},title:"Regenerate response",children:[A.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[A.jsx("polyline",{points:"23 4 23 10 17 10"}),A.jsx("polyline",{points:"1 20 1 14 7 14"}),A.jsx("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})]}),A.jsx("span",{children:"Regenerate"})]})]})},qf={isOpen:!1,title:"",content:"",isStreaming:!1,isDone:!1,canvasType:"document"},ji={OPEN:"OPEN",OPEN_EXISTING:"OPEN_EXISTING",CLOSE:"CLOSE",APPEND_CONTENT:"APPEND_CONTENT",UPDATE_CONTENT:"UPDATE_CONTENT",DONE:"DONE",RESET:"RESET"};function Tre(t,e){var n,r,i,s,a,l;switch(e.type){case ji.OPEN:return{...qf,isOpen:!0,title:((n=e.payload)==null?void 0:n.title)||"Untitled",content:((r=e.payload)==null?void 0:r.content)||"",isStreaming:!0,isDone:!1,canvasType:((i=e.payload)==null?void 0:i.canvasType)||"document"};case ji.OPEN_EXISTING:return{...qf,isOpen:!0,title:((s=e.payload)==null?void 0:s.title)||"Untitled",content:((a=e.payload)==null?void 0:a.content)||"",isStreaming:!1,isDone:!0,canvasType:((l=e.payload)==null?void 0:l.canvasType)||"document"};case ji.CLOSE:return{...t,isOpen:!1};case ji.APPEND_CONTENT:return{...t,content:t.content+(e.payload||"")};case ji.UPDATE_CONTENT:return{...t,content:e.payload||""};case ji.DONE:return{...t,isStreaming:!1,isDone:!0};case ji.RESET:return qf;default:return t}}const mR=z.createContext({state:qf,dispatch:()=>{},openCanvas:()=>{},openExistingCanvas:()=>{},closeCanvas:()=>{},appendContent:()=>{},updateContent:()=>{},markDone:()=>{},resetCanvas:()=>{}}),Xd=()=>z.useContext(mR),Sre=({children:t})=>{const[e,n]=z.useReducer(Tre,qf),r=z.useCallback(p=>{n({type:ji.OPEN,payload:p})},[]),i=z.useCallback(p=>{n({type:ji.OPEN_EXISTING,payload:p})},[]),s=z.useCallback(()=>{n({type:ji.CLOSE})},[]),a=z.useCallback(p=>{n({type:ji.APPEND_CONTENT,payload:p})},[]),l=z.useCallback(p=>{n({type:ji.UPDATE_CONTENT,payload:p})},[]),u=z.useCallback(()=>{n({type:ji.DONE})},[]),d=z.useCallback(()=>{n({type:ji.RESET})},[]),f=z.useMemo(()=>({state:e,dispatch:n,openCanvas:r,openExistingCanvas:i,closeCanvas:s,appendContent:a,updateContent:l,markDone:u,resetCanvas:d}),[e,r,i,s,a,l,u,d]);return A.jsx(mR.Provider,{value:f,children:t})},cx=(...t)=>t.filter(Boolean).join(" ");function X4({isOpen:t}){return A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:cx("transition-transform duration-200",t?"rotate-180":"rotate-0"),children:A.jsx("path",{d:"M6 9l6 6 6-6"})})}function wre(){return A.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"var(--text-tertiary)"},children:[A.jsx("circle",{cx:"12",cy:"12",r:"10"}),A.jsx("path",{d:"M2 12h20"}),A.jsx("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]})}function kre(){return A.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:"var(--text-tertiary)"}})}function Cre(){return A.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[A.jsx("path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"}),A.jsx("polyline",{points:"14 2 14 8 20 8"}),A.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),A.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),A.jsx("line",{x1:"10",y1:"9",x2:"8",y2:"9"})]})}function Are(){return A.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[A.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),A.jsx("polyline",{points:"15 3 21 3 21 9"}),A.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]})}function Nre({title:t,content:e,isComplete:n}){const{openExistingCanvas:r}=Xd(),i=le.useCallback(()=>{r({title:t||"Untitled",content:e||""})},[t,e,r]);return A.jsx("div",{className:"my-3 rounded-lg border",style:{borderColor:"var(--border-primary)"},children:A.jsxs("button",{type:"button",onClick:i,className:"w-full flex items-center justify-between gap-3 px-4 py-3 text-left rounded-lg transition-colors hover:bg-[var(--bg-hover)]",children:[A.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[A.jsx("div",{className:"flex-shrink-0",style:{color:"var(--text-secondary)"},children:A.jsx(Cre,{})}),A.jsxs("div",{className:"min-w-0",children:[A.jsx("span",{className:"text-sm font-medium truncate block",style:{color:"var(--text-primary)"},children:t||"Untitled Document"}),A.jsx("span",{className:"text-xs",style:{color:"var(--text-tertiary)"},children:n?"Click to view document":"Generating..."})]})]}),A.jsxs("div",{className:"flex-shrink-0 flex items-center gap-1",style:{color:"var(--text-tertiary)"},children:[A.jsx("span",{className:"text-xs",children:"Open"}),A.jsx(Are,{})]})]})})}function Ore({src:t,alt:e}){const[n,r]=le.useState(!1),i=le.useCallback(async()=>{try{const a=await(await fetch(t)).blob(),l=window.URL.createObjectURL(a),u=document.createElement("a");u.href=l,u.download=e||"image",document.body.appendChild(u),u.click(),document.body.removeChild(u),window.URL.revokeObjectURL(l)}catch(s){console.error("Failed to download image:",s)}},[t,e]);return A.jsxs("div",{className:"relative md:w-[60%] inline-block group",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:[A.jsx("img",{src:t,alt:e||""}),n&&A.jsx("button",{onClick:i,className:"absolute top-6 right-2 p-2 rounded-lg transition-all duration-200",style:{backgroundColor:"var(--bg-primary)",border:"1px solid var(--border-primary)",color:"var(--text-primary)",boxShadow:"var(--shadow-md)"},title:"Download image","aria-label":"Download image",children:A.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[A.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),A.jsx("polyline",{points:"7 10 12 15 17 10"}),A.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})})]})}function Mre(t){if(t<60)return`${t}s`;const e=Math.floor(t/60),n=t%60;return`${e}m ${n}s`}function Rre({thinking:t,onSend:e,isActive:n,startTime:r,duration:i}){const[s,a]=le.useState(!1),[l,u]=le.useState(()=>i??(r&&!n?Math.round((Date.now()-r)/1e3):0));return le.useEffect(()=>{if(i!=null){u(i);return}if(!n)return;r&&u(Math.round((Date.now()-r)/1e3));const d=setInterval(()=>{r&&u(Math.round((Date.now()-r)/1e3))},1e3);return()=>clearInterval(d)},[n,r,i]),A.jsxs("div",{className:"my-3 rounded-lg border",style:{borderColor:"var(--border-primary)"},children:[A.jsxs("button",{type:"button",onClick:()=>a(d=>!d),className:"w-full flex items-center justify-between gap-3 px-4 py-3 text-left rounded-2xl transition-colors",style:{color:"var(--text-secondary)"},children:[A.jsx("span",{className:"text-sm",style:{color:"var(--text-secondary)"},children:"Thinking"}),A.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(l>0||n)&&A.jsx("span",{className:"text-xs",style:{color:"var(--text-tertiary)"},children:Mre(l)}),A.jsx("span",{style:{color:"var(--text-tertiary)"},children:A.jsx(X4,{isOpen:s})})]})]}),s&&A.jsx("div",{className:"px-4 pb-0",style:{borderTop:"1px solid var(--border-primary)"},children:A.jsx("div",{className:"mt-3 prose prose-sm max-w-none",style:{color:"var(--text-tertiary)"},children:A.jsx(Wu,{markdown:t,onSend:e})})})]})}function Dre({steps:t,onSend:e}){const[n,r]=le.useState(!1),[i,s]=le.useState({});if(!t||t.length===0)return null;const a=2,l=n?0:Math.max(0,t.length-a),u=n?t:t.slice(-a),d=p=>{s(g=>({...g,[p]:!g[p]}))},f=p=>p.result||p.type==="search"||p.step&&(p.step.toLowerCase().includes("search")||p.step.toLowerCase().includes("fetch"));return A.jsxs("div",{className:"my-3 rounded-lg border",style:{borderColor:"var(--border-primary)"},children:[A.jsxs("button",{type:"button",onClick:()=>r(p=>!p),className:"w-full flex items-center gap-2 px-4 py-3 text-left rounded-2xl transition-colors",style:{color:"var(--text-secondary)"},children:[A.jsx("span",{className:"flex-shrink-0",style:{color:"var(--text-tertiary)"},children:A.jsx(X4,{isOpen:n})}),A.jsxs("span",{className:"text-sm",style:{color:"var(--text-secondary)"},children:[t.length," step",t.length!==1?"s":""]})]}),A.jsxs("div",{className:"px-4 pb-4",children:[l>0&&A.jsxs("button",{type:"button",onClick:()=>r(!0),className:"w-full text-left py-2 pl-5 text-sm transition-opacity hover:opacity-70",style:{color:"var(--text-tertiary)"},children:["+",l," more step",l!==1?"s":""]}),A.jsx("div",{className:"relative",children:u.map((p,g)=>{const b=n?g:t.length-a+g,v=p.data!=null,E=i[b],x=g===u.length-1,S=f(p);return A.jsxs("div",{className:"relative",children:[!x&&A.jsx("div",{className:"absolute left-[7px] top-5 w-px -mt-0.5",style:{backgroundColor:"var(--border-primary)",height:"calc(100% + 1px)"}}),A.jsxs("div",{className:"flex items-start gap-3 py-1.5",children:[A.jsx("div",{className:"flex-shrink-0 mt-0.5 flex items-center justify-center w-4 h-4",children:S?A.jsx(wre,{}):A.jsx(kre,{})}),A.jsxs("div",{className:"flex-1 min-w-0 flex items-start justify-between gap-2",children:[A.jsx("button",{type:"button",onClick:v?()=>d(b):void 0,disabled:!v,className:cx("flex-1 text-left text-sm leading-relaxed",v&&"cursor-pointer hover:opacity-80"),style:{color:"var(--text-secondary)"},children:p.step}),A.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[p.result&&A.jsx("span",{className:"text-sm",style:{color:"var(--text-tertiary)"},children:p.result}),v&&A.jsx("button",{type:"button",onClick:()=>d(b),className:"p-1 -m-1 hover:opacity-70",style:{color:"var(--text-tertiary)"},children:A.jsx(X4,{isOpen:E})})]})]})]}),v&&E&&A.jsx("div",{className:"ml-7 mt-1 mb-2",children:A.jsx("div",{className:"rounded-lg border px-2 prose prose-sm max-w-none overflow-x-auto",style:{borderColor:"var(--border-primary)",color:"var(--text-tertiary)"},children:A.jsx(Wu,{markdown:typeof p.data=="string"?p.data:"```json\n"+JSON.stringify(p.data,null,2)+"\n```",onSend:e})})})]},b)})})]})]})}const Ire=le.memo(function({part:e,onSend:n,isGenerating:r}){if(!e||!e.type)return null;if(e.type==="canvas")return A.jsx(Nre,{title:e.title,content:e.content,isComplete:e._complete});if(e.type==="thinking")return A.jsx(Rre,{thinking:e.thinking||"",onSend:n,isActive:r&&!e._complete,startTime:e._startTime,duration:e._duration});if(e.type==="steps")return A.jsx(Dre,{steps:e.steps||[],onSend:n});if(e.type==="image"&&e.image)return A.jsx(Ore,{src:e.image,alt:e.alt});let i="";switch(e.type){case"text":i=e.text||"";break;case"code":i="```"+(e.language||"")+`
`+(e.code||"")+"\n```";break;case"table":e.headers&&e.headers.length>0&&(i+="| "+e.headers.join(" | ")+` |
`,i+="| "+e.headers.map(()=>"---").join(" | ")+` |
`),e.rows&&e.rows.length>0&&e.rows.forEach(l=>{i+="| "+l.join(" | ")+` |
`});break;case"callout":i=`> ${{info:"ℹ️",success:"✅",warning:"⚠️",error:"❌"}[e.style||"info"]||"ℹ️"} **${e.title||e.style||"Info"}**
>
> ${e.callout||""}`;break;case"image":i=`![${e.alt||""}](${e.src})`,e.caption&&(i+=`

*${e.caption}*`);break;default:return null}return A.jsx("div",{className:cx("prose prose-sm max-w-none","prose-headings:scroll-mt-24","prose-pre:p-0","theme-transition"),style:{color:"var(--text-primary)"},children:A.jsx(Wu,{markdown:i,onSend:n})})});function W8({className:t=""}){return A.jsxs("div",{className:`py-1 ${t}`,role:"status","aria-label":"Loading",children:[A.jsx("svg",{width:"30",height:"30",viewBox:"0 0 100 100",className:"animate-pulse-star motion-reduce:animate-none",children:A.jsx("path",{d:`M50 0
             C50 27.6, 27.6 50, 0 50
             C27.6 50, 50 72.4, 50 100
             C50 72.4, 72.4 50, 100 50
             C72.4 50, 50 27.6, 50 0Z`,fill:"#D4A574"})}),A.jsx("style",{children:`
        @keyframes pulse-star {
          0%, 100% {
            opacity: 1;
            transform: scale(1);
          }
          50% {
            opacity: 0.5;
            transform: scale(0.88);
          }
        }

        .animate-pulse-star {
          animation: pulse-star 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
        }
      `})]})}const gR=le.memo(({messages:t,onSend:e,onRegenerate:n,isGenerating:r,onRetry:i,retryingIndex:s})=>{const a=z.useMemo(()=>t.map((l,u)=>{if(l.type==="request"||l.role==="user"){const E=l.content||"",{clean:x,attachments:S}=fh(E),C=/[\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC]/.test(x);return A.jsx("div",{className:`flex mb-4 ${C?"justify-start":"justify-end"}`,children:A.jsxs("div",{className:"max-w-[85%] md:max-w-[75%]",children:[S.length>0&&A.jsx("div",{className:"mb-1",children:A.jsx(Ere,{attachments:S})}),x&&A.jsx("div",{className:"px-4 py-2 rounded-3xl shadow-sm theme-transition",style:{backgroundColor:"var(--msg-user-bg)",color:"var(--text-primary)"},children:A.jsx("div",{dir:"auto",className:"text-[15px] leading-relaxed whitespace-pre-wrap",children:x})})]})},u)}const f=(l.type==="response"||l.role==="assistant")&&u===t.length-1,p=f&&r,g=l.parts&&Array.isArray(l.parts),b=!g&&(l.content||l.content===""),v=g&&l.parts.length>0&&l.parts.some(E=>E.type==="text"&&E.text||E.type==="code"&&E.code||E.type==="table"&&E.headers)||b&&l.content&&l.content!=="";return A.jsx("div",{className:"flex mb-4 justify-start group",children:A.jsx("div",{className:"w-full",children:l.error?A.jsx(_re,{error:l.error,onRetry:()=>i(u),isRetrying:s===u}):A.jsxs(A.Fragment,{children:[g&&A.jsxs("div",{className:"space-y-2",children:[l.parts.map((E,x)=>A.jsx(Ire,{part:E,onSend:e,isGenerating:p},x)),p&&A.jsx(W8,{})]}),b&&A.jsxs("div",{className:"prose prose-sm max-w-none",children:[A.jsx(Wu,{markdown:l.content,onSend:e}),p&&A.jsx(W8,{})]}),v&&!p&&A.jsx(xre,{message:l,onRegenerate:()=>n(u),isLastAssistant:f&&!r})]})})},u)}),[t,e,n,r,i,s]);return A.jsx("div",{className:"space-y-1",children:a})});gR.displayName="MessageList";const Lre=({file:t,onRemove:e})=>{const[n,r]=z.useState(null),i=t.type.startsWith("image/");return z.useEffect(()=>{if(!i)return;const s=new FileReader;s.onloadend=()=>r(String(s.result)),s.readAsDataURL(t)},[t,i]),A.jsxs("div",{className:"group inline-flex items-start gap-2 rounded-xl shadow-sm px-2.5 py-1 theme-transition",style:{backgroundColor:"var(--bg-primary)",border:"1px solid var(--border-primary)"},title:t.name,children:[A.jsx("div",{className:"w-10 h-10 rounded-md overflow-hidden flex items-center justify-center",style:{backgroundColor:"var(--bg-tertiary)"},children:i&&n?A.jsx("img",{src:n,alt:t.name,className:"w-full h-full object-cover"}):A.jsx("span",{className:"text-xs",children:"📄"})}),A.jsxs("div",{className:"min-w-0 leading-tight",children:[A.jsx("div",{className:"text-xs font-medium truncate max-w-[100px]",style:{color:"var(--text-primary)"},children:t.name}),A.jsx("div",{className:"text-xs text-left",style:{color:"var(--text-tertiary)"},children:Qg(t.size)})]}),A.jsx("button",{onClick:e,className:"ml-1 h-5 w-5 rounded-full grid place-items-center hover:bg-[var(--bg-hover)] theme-transition",style:{backgroundColor:"var(--bg-tertiary)",color:"var(--text-secondary)"},"aria-label":"Remove attachment",children:A.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:A.jsx("path",{d:"M9 3L3 9M3 3L9 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]})},Pre=({error:t,onDismiss:e})=>(z.useEffect(()=>{const n=setTimeout(e,5e3);return()=>clearTimeout(n)},[e]),A.jsx("div",{className:"fixed bottom-40 left-1/2 transform -translate-x-1/2 bg-red-50 border border-red-200 rounded-xl shadow-lg px-4 py-3 min-w-[320px] max-w-[90vw] z-50 animate-in slide-in-from-bottom-2 duration-300",children:A.jsxs("div",{className:"flex items-start gap-3",children:[A.jsx("div",{className:"flex-shrink-0 mt-0.5",children:A.jsxs("svg",{className:"h-5 w-5 text-red-600",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[A.jsx("circle",{cx:"12",cy:"12",r:"10"}),A.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),A.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})}),A.jsxs("div",{className:"flex-1 min-w-0",children:[A.jsx("p",{className:"text-sm font-medium text-red-900",children:"Upload Error"}),A.jsx("p",{className:"text-sm text-red-700 mt-1",children:t})]}),A.jsx("button",{onClick:e,className:"flex-shrink-0 text-red-400 hover:text-red-600 transition-colors","aria-label":"Dismiss",children:A.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"currentColor",children:A.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]})})),Bre=({onSend:t,isLoading:e=!1,onStop:n,disabled:r=!1,onUpgradeClick:i,sidebarWidth:s=0,canvasOpen:a=!1,canvasWidthPercent:l=0})=>{const[u,d]=z.useState(""),[f,p]=z.useState([]),[g,b]=z.useState(!1),[v,E]=z.useState(null),[x,S]=z.useState(!1),C=z.useRef(null),O=z.useRef(null),L=z.useRef(0);z.useEffect(()=>{const ie=()=>b(window.innerWidth<=768);return ie(),window.addEventListener("resize",ie),()=>window.removeEventListener("resize",ie)},[]);const D=z.useCallback(ie=>{if(r)return;const se=[];for(const Te of ie){const oe=yre(Te);if(oe.valid)se.push(Te);else{E(oe.error);break}}se.length>0&&p(Te=>[...Te,...se])},[r]);z.useEffect(()=>{const ie=re=>{re.preventDefault(),re.stopPropagation(),!r&&(L.current++,re.dataTransfer.types.includes("Files")&&S(!0))},se=re=>{re.preventDefault(),re.stopPropagation(),L.current--,L.current===0&&S(!1)},Te=re=>{re.preventDefault(),re.stopPropagation()},oe=re=>{if(re.preventDefault(),re.stopPropagation(),S(!1),L.current=0,r)return;const X=Array.from(re.dataTransfer.files||[]);X.length>0&&D(X)};return document.addEventListener("dragenter",ie),document.addEventListener("dragleave",se),document.addEventListener("dragover",Te),document.addEventListener("drop",oe),()=>{document.removeEventListener("dragenter",ie),document.removeEventListener("dragleave",se),document.removeEventListener("dragover",Te),document.removeEventListener("drop",oe)}},[D,r]),z.useEffect(()=>{const ie=se=>{var X;if(r||!(document.activeElement===O.current))return;const re=Array.from(((X=se.clipboardData)==null?void 0:X.items)||[]).filter(ee=>ee.type.startsWith("image/"));if(re.length>0){se.preventDefault();const ee=re.map(ce=>ce.getAsFile()).filter(ce=>ce!==null);ee.length>0&&D(ee)}};return document.addEventListener("paste",ie),()=>document.removeEventListener("paste",ie)},[D,r]);const R=()=>{var ie;r||(ie=C.current)==null||ie.click()},F=ie=>{if(r)return;const se=Array.from(ie.target.files||[]);D(se),ie.target.value=""},G=ie=>p(se=>se.filter((Te,oe)=>oe!==ie)),Z=async()=>{e||r||(t({text:u,files:f}),d(""),p([]))},q=ie=>{ie.key==="Enter"&&!ie.shiftKey&&!g&&!e&&!r&&(ie.preventDefault(),Z())};return A.jsxs(A.Fragment,{children:[v&&A.jsx(Pre,{error:v,onDismiss:()=>E(null)}),x&&!r&&A.jsx("div",{className:"fixed inset-0 z-50 backdrop-blur-sm flex items-center justify-center pointer-events-none",style:{backgroundColor:"var(--bg-overlay)"},children:A.jsx("div",{className:"rounded-2xl shadow-2xl p-8 max-w-md mx-4 border-2 border-dashed theme-transition",style:{backgroundColor:"var(--bg-primary)",borderColor:"var(--text-primary)"},children:A.jsxs("div",{className:"text-center",children:[A.jsx("div",{className:"mx-auto w-16 h-16 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:"var(--bg-tertiary)"},children:A.jsx("svg",{className:"w-8 h-8",style:{color:"var(--text-primary)"},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:A.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})})}),A.jsx("h3",{className:"text-lg font-semibold mb-2",style:{color:"var(--text-primary)"},children:"Drop files to upload"}),A.jsx("p",{className:"text-sm",style:{color:"var(--text-secondary)"},children:"Images, PDFs, and text files supported"}),A.jsxs("p",{className:"text-xs mt-2",style:{color:"var(--text-tertiary)"},children:["Max ",Qg(yo.MAX_FILE_BYTES)," per file"]})]})})}),A.jsx("div",{className:"fixed z-40 transition-all duration-300 ease-in-out bottom-[max(0.75rem,env(safe-area-inset-bottom))] md:bottom-[max(1rem,env(safe-area-inset-bottom))]",style:{left:g?"0px":`${s}px`,right:a&&!g?`${l}%`:"0px"},children:A.jsxs("div",{className:"mx-auto max-w-3xl px-3 md:px-4",children:[A.jsxs("div",{className:`cursor-text rounded-3xl relative p-0 pt-1 backdrop-blur-xl w-full theme-transition ${r?"opacity-75":""}`,style:{backgroundColor:"var(--input-bg)",border:"1px solid var(--border-primary)"},children:[f.length>0&&A.jsx("div",{className:"px-3 pt-3",children:A.jsx("div",{className:"flex flex-wrap gap-2",children:f.map((ie,se)=>A.jsx(Lre,{file:ie,onRemove:()=>G(se)},se))})}),A.jsxs("div",{className:"px-3 pb-3 pt-2",children:[A.jsx("textarea",{ref:O,className:`w-full resize-none border-0 bg-transparent focus:ring-0 focus:outline-none text-base leading-6 max-h-40 mb-2 disabled:opacity-50 disabled:cursor-not-allowed ${r?"cursor-not-allowed":""}`,style:{color:"var(--text-primary)",caretColor:"var(--accent-primary)"},dir:"auto",autoFocus:!r,tabIndex:0,rows:Math.max(1,Math.min(6,u.split(`
`).length)),placeholder:r?"Upgrade to continue chatting...":e?"Waiting for response...":"What's on your mind?",onChange:ie=>d(ie.target.value),onKeyDown:q,value:u,disabled:e||r}),A.jsxs("div",{className:"flex items-center gap-2",children:[A.jsx("button",{onClick:R,disabled:r,className:`rounded-full w-8 h-8 inline-flex items-center justify-center p-1 theme-transition ${r?"opacity-50 cursor-not-allowed":"hover:bg-[var(--bg-hover)] active:scale-[0.98]"}`,style:{backgroundColor:"var(--bg-primary)",border:"1px solid var(--border-primary)",color:"var(--text-primary)"},"aria-label":"Attach file",title:r?"Upgrade to attach files":"Attach files",children:A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:A.jsx("path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551"})})}),A.jsx("input",{ref:C,type:"file",multiple:!0,className:"hidden",onChange:F,accept:".jpg,.jpeg,.png,.webp,.pdf,.txt,.md,.csv",disabled:r}),A.jsx("div",{className:"flex-1"}),e&&!r&&A.jsx("button",{onClick:n,className:"rounded-full hover:bg-[var(--bg-hover)] active:scale-95 transition-all inline-flex items-center justify-center w-8 h-8 flex-shrink-0 theme-transition",style:{backgroundColor:"var(--bg-primary)",border:"1px solid var(--border-primary)",color:"var(--text-primary)",boxShadow:"var(--shadow-sm)"},"aria-label":"Stop generating",title:"Stop",children:A.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:A.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}),r&&A.jsxs("button",{onClick:i,className:"rounded-full bg-gradient-to-r from-blue-600 to-indigo-600 text-white hover:from-blue-700 hover:to-indigo-700 active:scale-[0.98] transition-all inline-flex items-center justify-center gap-1.5 px-4 h-9 flex-shrink-0 shadow-md font-medium text-sm","aria-label":"Upgrade to continue",title:"Upgrade",children:[A.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:A.jsx("path",{fillRule:"evenodd",d:"M11.3 1.046A1 1 0 0112 2v5h4a1 1 0 01.82 1.573l-7 10A1 1 0 018 18v-5H4a1 1 0 01-.82-1.573l7-10a1 1 0 011.12-.38z",clipRule:"evenodd"})}),"Upgrade"]}),!e&&!r&&A.jsx("button",{onClick:Z,disabled:e,className:"rounded-full hover:opacity-90 active:scale-[0.98] inline-flex items-center justify-center w-9 h-9 flex-shrink-0 disabled:opacity-50 disabled:cursor-not-allowed disabled:active:scale-100 theme-transition",style:{backgroundColor:"var(--btn-primary-bg)",color:"var(--btn-primary-text)"},"aria-label":"Send message",title:"Send",children:A.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:A.jsx("path",{d:"M8.99992 16V6.41407L5.70696 9.70704C5.31643 10.0976 4.68342 10.0976 4.29289 9.70704C3.90237 9.31652 3.90237 8.6835 4.29289 8.29298L9.29289 3.29298L9.36907 3.22462C9.76184 2.90427 10.3408 2.92686 10.707 3.29298L15.707 8.29298L15.7753 8.36915C16.0957 8.76192 16.0731 9.34092 15.707 9.70704C15.3408 10.0732 14.7618 10.0958 14.3691 9.7754L14.2929 9.70704L10.9999 6.41407V16C10.9999 16.5523 10.5522 17 9.99992 17C9.44764 17 8.99992 16.5523 8.99992 16Z"})})})]})]})]}),r&&A.jsx("p",{className:"text-xs text-center mt-2",style:{color:"var(--text-tertiary)"},children:"You've reached your free message limit"})]})}),A.jsx("style",{children:`
        textarea::placeholder {
          color: var(--text-muted);
        }
      `})]})},zre=({fileName:t,progress:e})=>A.jsx("div",{className:"fixed bottom-40 left-1/2 transform -translate-x-1/2 rounded-xl shadow-lg px-4 py-3 min-w-[280px] theme-transition",style:{backgroundColor:"var(--bg-primary)",border:"1px solid var(--border-primary)",boxShadow:"var(--shadow-lg)"},children:A.jsxs("div",{className:"flex items-center gap-3",children:[A.jsx("div",{className:"flex-shrink-0",children:A.jsxs("svg",{className:"animate-spin h-5 w-5",style:{color:"var(--text-secondary)"},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[A.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),A.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),A.jsxs("div",{className:"flex-1 min-w-0",children:[A.jsx("p",{className:"text-sm font-medium truncate",style:{color:"var(--text-primary)"},children:t}),A.jsx("div",{className:"mt-1 w-full rounded-full h-1.5",style:{backgroundColor:"var(--bg-tertiary)"},children:A.jsx("div",{className:"h-1.5 rounded-full transition-all duration-300",style:{width:`${e}%`,backgroundColor:"var(--text-primary)"}})})]})]})}),Zg={collapsed:56,expanded:275},zr=(...t)=>t.filter(Boolean).join(" "),K8=({children:t})=>A.jsx("span",{className:"grid place-items-center w-5 h-5",children:t}),X8=t=>A.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:zr("w-5 h-5",t==null?void 0:t.className),fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[A.jsx("path",{d:"M12 3a9 9 0 1 1-6.22 15.5"}),A.jsx("path",{d:"M12 8v8"}),A.jsx("path",{d:"M16 12H8"})]}),Q8=t=>A.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:zr("w-[18px] h-[18px]",t==null?void 0:t.className),fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[A.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),A.jsx("path",{d:"M9 3v18"})]}),Ure=t=>A.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:zr("w-5 h-5",t==null?void 0:t.className),fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:A.jsx("path",{d:"M10 7l5 5-5 5"})}),Fre=t=>A.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:zr("w-4 h-4",t==null?void 0:t.className),fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[A.jsx("path",{d:"M3 6h18"}),A.jsx("path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),A.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}),A.jsx("path",{d:"M10 11v6"}),A.jsx("path",{d:"M14 11v6"})]}),Hre=t=>A.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:zr("lucide lucide-ellipsis-icon lucide-ellipsis",t==null?void 0:t.className),children:[A.jsx("circle",{cx:"12",cy:"12",r:"1"}),A.jsx("circle",{cx:"19",cy:"12",r:"1"}),A.jsx("circle",{cx:"5",cy:"12",r:"1"})]});function jre(t,e,n=!0){z.useEffect(()=>{if(!n)return;const r=i=>{(Array.isArray(t)?t:[t]).some(l=>(l==null?void 0:l.current)&&l.current.contains(i.target))||e(i)};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r,{passive:!0}),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r)}},[t,e,n])}const $re=({icon:t,children:e,isCollapsed:n,...r})=>A.jsxs("button",{...r,className:zr("group w-full flex items-center gap-3 rounded-xl px-2.5 py-2 text-left","hover:bg-[var(--bg-hover)] active:bg-[var(--bg-active)]","focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--text-primary)]/20","theme-transition",n&&"justify-center px-2"),style:{color:"var(--text-primary)"},children:[A.jsx("span",{className:"shrink-0",style:{color:"var(--text-primary)"},children:t}),!n&&A.jsx("span",{className:"text-sm font-medium leading-5",children:e})]}),qre=({children:t})=>A.jsx("div",{className:"px-2.5 py-1.5 text-[11px] font-semibold tracking-wide uppercase",style:{color:"var(--text-tertiary)"},children:t}),Vre=({chat:t,isActive:e,onSelect:n,onDelete:r})=>{const[i,s]=z.useState(!1),a=z.useRef(null),l=z.useRef(null),u=z.useId();return jre([a,l],()=>s(!1),i),A.jsxs("div",{className:"relative",children:[A.jsxs("button",{onClick:()=>n(t.id),className:zr("group w-full flex items-center gap-2 rounded-xl px-2.5 py-2 text-left","hover:bg-[var(--bg-hover)] active:bg-[var(--bg-active)]","focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--text-primary)]/20","theme-transition"),style:{backgroundColor:e?"var(--bg-active)":"transparent"},"aria-current":e?"page":void 0,children:[A.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",style:{color:"var(--text-primary)"},children:t.title||"Untitled"}),A.jsx("button",{ref:l,type:"button",onClick:d=>{d.stopPropagation(),s(f=>!f)},className:zr("shrink-0 rounded-lg p-1.5","hover:bg-[var(--bg-hover)] active:bg-[var(--bg-active)]","opacity-0 group-hover:opacity-100 focus:opacity-100","focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--text-primary)]/20","theme-transition"),style:{color:"var(--text-tertiary)"},"aria-label":"Chat options","aria-haspopup":"menu","aria-expanded":i,"aria-controls":u,children:A.jsx(Hre,{})})]}),i&&A.jsx("div",{id:u,ref:a,role:"menu",className:zr("absolute right-2 top-[calc(100%+6px)] z-50 min-w-[170px]","rounded-xl shadow-lg","overflow-hidden dropdown-menu"),style:{backgroundColor:"var(--bg-primary)",border:"1px solid var(--border-primary)"},children:A.jsxs("button",{role:"menuitem",onClick:d=>{d.stopPropagation(),r(t.id),s(!1)},className:zr("w-full flex items-center gap-2 px-3 py-2.5 text-sm","text-red-500 hover:bg-red-500/10 focus:bg-red-500/10","focus:outline-none theme-transition"),children:[A.jsx(Fre,{}),"Delete"]})})]})},Gre=({user:t,isOnPaidPlan:e,tierName:n,UserButtonComponent:r})=>{var a,l;const i=(t==null?void 0:t.fullName)||(t==null?void 0:t.firstName)||((l=(a=t==null?void 0:t.emailAddresses)==null?void 0:a[0])==null?void 0:l.emailAddress)||"User",s=e?n||"Pro":"Free plan";return A.jsxs("div",{className:"flex items-center gap-3 rounded-xl p-2 hover:bg-[var(--bg-hover)] transition-colors theme-transition",children:[A.jsx("div",{className:"shrink-0",children:r}),A.jsxs("div",{className:"min-w-0 flex-1",children:[A.jsx("div",{className:"truncate text-sm font-semibold",style:{color:"var(--text-primary)"},children:i}),A.jsx("div",{className:"truncate text-xs",style:{color:"var(--text-tertiary)"},children:s})]})]})},Yre=({UserButtonComponent:t})=>A.jsx("div",{className:"grid place-items-center p-1",children:t}),Wre=({isOpen:t,onClose:e,onToggle:n,chats:r,activeChat:i,onSelectChat:s,onNewChat:a,onDeleteChat:l,user:u,isOnPaidPlan:d,tierName:f,UserButtonComponent:p,isAuthenticated:g})=>{const b=z.useMemo(()=>[...r||[]].sort((x,S)=>new Date(S.updatedAt)-new Date(x.updatedAt)),[r]),v=z.useMemo(()=>{const x={today:[],yesterday:[],previous7Days:[],previous30Days:[],older:[]},S=new Date,C=new Date(S.getFullYear(),S.getMonth(),S.getDate()),O=new Date(C);O.setDate(O.getDate()-1);const L=new Date(C);L.setDate(L.getDate()-7);const D=new Date(C);return D.setDate(D.getDate()-30),b.forEach(R=>{const F=new Date(R.updatedAt);F>=C?x.today.push(R):F>=O?x.yesterday.push(R):F>=L?x.previous7Days.push(R):F>=D?x.previous30Days.push(R):x.older.push(R)}),x},[b]),E=(x,S)=>S!=null&&S.length?A.jsxs("div",{className:"mb-4",children:[A.jsx(qre,{children:x}),A.jsx("div",{className:"space-y-1",children:S.map(C=>A.jsx(Vre,{chat:C,isActive:i===C.id,onSelect:s,onDelete:l},C.id))})]}):null;return A.jsxs(A.Fragment,{children:[A.jsx("div",{className:zr("fixed inset-0 z-40 md:hidden transition-opacity duration-300 ease-in-out",t?"opacity-100":"opacity-0 pointer-events-none"),style:{backgroundColor:"var(--bg-overlay)"},onClick:e,"aria-hidden":"true"}),A.jsxs("aside",{className:zr("fixed left-0 top-0 z-50 h-full","backdrop-blur supports-[backdrop-filter]:backdrop-blur-xl","transition-all duration-300 ease-in-out","flex flex-col",t?"translate-x-0":"-translate-x-full md:translate-x-0"),style:{width:`${t?Zg.expanded:Zg.collapsed}px`,backgroundColor:"var(--bg-sidebar)",borderRight:"1px solid var(--border-primary)"},children:[A.jsxs("div",{className:zr("flex h-full w-full flex-col","transition-opacity duration-200",t?"opacity-100":"opacity-0 pointer-events-none absolute inset-0"),children:[A.jsxs("div",{className:"flex h-14 items-center justify-between px-2",children:[A.jsxs("button",{onClick:a,className:zr("inline-flex items-center gap-2 rounded-xl px-2.5 py-2","hover:bg-[var(--bg-hover)] active:bg-[var(--bg-active)]","focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--text-primary)]/20","theme-transition"),style:{color:"var(--text-primary)"},"aria-label":"New chat",title:"New chat",children:[A.jsx(K8,{children:A.jsx(X8,{})}),A.jsx("span",{className:"text-sm font-semibold",children:"New"})]}),A.jsx("button",{onClick:n,className:zr("rounded-xl p-2 hover:bg-[var(--bg-hover)] active:bg-[var(--bg-active)]","focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--text-primary)]/20","theme-transition"),style:{color:"var(--text-primary)"},"aria-label":"Collapse sidebar",title:"Collapse",children:A.jsx(Q8,{})})]}),A.jsx("div",{className:"mx-3",style:{borderTop:"1px solid var(--border-primary)"}}),A.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-3 scrollbar-thin",children:b.length===0?A.jsx("div",{className:"px-2 py-10 text-center text-sm",style:{color:"var(--text-tertiary)"},children:"No chats yet"}):A.jsxs(A.Fragment,{children:[E("Today",v.today),E("Yesterday",v.yesterday),E("Previous 7 days",v.previous7Days),E("Previous 30 days",v.previous30Days),E("Older",v.older)]})}),A.jsx("div",{className:"p-2",style:{borderTop:"1px solid var(--border-primary)"},children:g&&u?A.jsx(Gre,{user:u,isOnPaidPlan:d,tierName:f,UserButtonComponent:p}):A.jsxs("div",{className:"px-2 py-2 text-center text-xs",style:{color:"var(--text-tertiary)"},children:[r.length," / ",yo.MAX_CHATS," chats"]})})]}),A.jsxs("div",{className:zr("hidden md:flex h-full w-full flex-col","transition-opacity duration-200",t?"opacity-0 pointer-events-none absolute inset-0":"opacity-100"),children:[A.jsx("div",{className:"flex h-14 items-center justify-center",children:A.jsx("button",{onClick:n,className:zr("rounded-xl p-2 hover:bg-[var(--bg-hover)] active:bg-[var(--bg-active)]","focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--text-primary)]/20","theme-transition"),style:{color:"var(--text-primary)"},"aria-label":"Expand sidebar",title:"Expand",children:A.jsx(Q8,{})})}),A.jsx("div",{className:"px-1 py-2",children:A.jsx($re,{onClick:a,icon:A.jsx(K8,{children:A.jsx(X8,{})}),isCollapsed:!0,"aria-label":"New chat",title:"New chat"})}),A.jsx("div",{className:"flex-1"}),g&&p&&A.jsx("div",{className:"p-2",style:{borderTop:"1px solid var(--border-primary)"},children:A.jsx(Yre,{UserButtonComponent:p})})]})]}),A.jsx("button",{onClick:n,className:zr("fixed left-3 top-3 z-30 md:hidden","rounded-xl backdrop-blur","p-2 hover:bg-[var(--bg-hover)] active:bg-[var(--bg-active)]","focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--text-primary)]/20","theme-transition transition-opacity duration-300 ease-in-out",t?"opacity-0 pointer-events-none":"opacity-100"),style:{backgroundColor:"var(--bg-sidebar)",border:"1px solid var(--border-primary)",color:"var(--text-primary)"},"aria-label":"Open sidebar",title:"Open",children:A.jsx(Ure,{})})]})},Kre=({open:t,onClose:e,tier:n})=>t?A.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center backdrop-blur-md px-4",style:{backgroundColor:"var(--bg-overlay)"},children:A.jsxs("div",{className:"relative w-full max-w-xl rounded-3xl shadow-2xl overflow-hidden theme-transition",style:{background:"linear-gradient(to bottom, var(--bg-primary), var(--bg-secondary))",border:"1px solid var(--border-primary)"},children:[A.jsx("div",{className:"absolute top-0 left-0 right-0 h-32 pointer-events-none opacity-50",style:{background:"linear-gradient(to bottom right, rgba(59, 130, 246, 0.1), rgba(99, 102, 241, 0.05), transparent)"}}),A.jsx("button",{type:"button",onClick:e,className:"absolute right-4 top-4 z-10 inline-flex h-9 w-9 items-center justify-center rounded-full backdrop-blur-sm transition-all duration-200 shadow-sm theme-transition",style:{backgroundColor:"var(--bg-primary)",border:"1px solid var(--border-primary)",color:"var(--text-tertiary)"},"aria-label":"Close",children:A.jsx("span",{className:"text-xl leading-none",children:"×"})}),A.jsxs("div",{className:"relative p-8 md:p-10",children:[A.jsxs("div",{className:"space-y-3 pr-8 mb-6",children:[A.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-blue-500/10 text-blue-500 border border-blue-500/20",children:[A.jsx("svg",{className:"w-3.5 h-3.5",fill:"currentColor",viewBox:"0 0 20 20",children:A.jsx("path",{fillRule:"evenodd",d:"M11.3 1.046A1 1 0 0112 2v5h4a1 1 0 01.82 1.573l-7 10A1 1 0 018 18v-5H4a1 1 0 01-.82-1.573l7-10a1 1 0 011.12-.38z",clipRule:"evenodd"})}),A.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",children:"Upgrade Available"})]}),A.jsxs("h2",{className:"text-2xl md:text-3xl font-bold leading-tight",style:{color:"var(--text-primary)"},children:["Unlock"," ",A.jsx("span",{className:"bg-gradient-to-r from-blue-600 to-indigo-600 bg-clip-text text-transparent",children:"Cycls Pass"})," ","features"]}),A.jsxs("p",{className:"text-base leading-relaxed",style:{color:"var(--text-secondary)"},children:["You've reached your free message limit. Upgrade to access the full"," ",A.jsx("span",{className:"font-semibold",style:{color:"var(--text-primary)"},children:"Cycls Pass"})," ","experience, priority AI, and unlimited messages."]})]}),A.jsx("div",{className:"relative -mx-2 mb-6",children:A.jsx("div",{className:"max-h-[420px] overflow-y-auto rounded-2xl backdrop-blur-sm shadow-inner scrollbar-thin",style:{backgroundColor:"var(--bg-tertiary)",border:"1px solid var(--border-primary)"},children:A.jsx(Kj,{})})}),A.jsx("div",{className:"flex justify-end",children:A.jsx("button",{type:"button",onClick:e,className:"inline-flex items-center gap-2 rounded-xl px-5 py-2.5 text-sm font-medium transition-all duration-200 hover:bg-[var(--bg-hover)] theme-transition",style:{color:"var(--text-secondary)"},children:"Maybe later"})})]})]})}):null,bR=({isAuthenticated:t,isPublic:e=!1,meta:n={}})=>{const[r,i]=z.useState(window.location.pathname);return z.useEffect(()=>{const s=()=>i(window.location.pathname);window.addEventListener("popstate",s);const a=setInterval(s,100);return()=>{window.removeEventListener("popstate",s),clearInterval(a)}},[]),z.useEffect(()=>{const a=r==="/auth"||r.startsWith("/sign-in")||r.startsWith("/sign-up")||r.includes("clerk")||t&&!e;let l=document.querySelector('meta[name="robots"]');l||(l=document.createElement("meta"),l.setAttribute("name","robots"),document.head.appendChild(l)),a?l.setAttribute("content","noindex, nofollow"):l.setAttribute("content","index, follow");let u=document.querySelector('meta[name="googlebot"]');if(u||(u=document.createElement("meta"),u.setAttribute("name","googlebot"),document.head.appendChild(u)),a?u.setAttribute("content","noindex, nofollow"):u.setAttribute("content","index, follow"),n.title&&(document.title=n.title),n.description){let p=document.querySelector('meta[name="description"]');p||(p=document.createElement("meta"),p.setAttribute("name","description"),document.head.appendChild(p)),p.setAttribute("content",n.description)}let d=document.querySelector('link[rel="canonical"]');d||(d=document.createElement("link"),d.setAttribute("rel","canonical"),document.head.appendChild(d));const f=n.canonical||window.location.origin+r;return d.setAttribute("href",f),()=>{}},[r,t,e,n]),null},Xre=({afterUrl:t})=>{const e=Lo(),{resolvedTheme:n}=JA(),r=e.hash==="#sign-up/"||e.hash==="#sign-up"?"sign-up":"sign-in",i={elements:{card:"shadow-none border-none",footer:"hidden",formButtonPrimary:"py-2.5 rounded-lg transition-colors",formFieldInput:"border-gray-300 focus:border-blue-500 focus:ring-blue-500 rounded-lg",formFieldLabel:"text-gray-700 font-medium text-sm",dividerLine:"bg-gray-200",dividerText:"text-gray-500 text-sm"}};return A.jsxs("div",{className:"min-h-screen flex items-center justify-center px-4 theme-transition",style:{backgroundColor:"var(--bg-secondary)"},children:[A.jsx(bR,{isAuthenticated:!1,isPublic:!1,meta:{title:"Sign In",description:"Authentication page"}}),A.jsx("div",{className:"fixed top-4 right-4",children:A.jsx(e9,{})}),A.jsx("div",{className:"w-full max-w-md",children:r==="sign-in"?A.jsxs("div",{className:"space-y-4",children:[A.jsx(Fj,{routing:"virtual",fallbackRedirectUrl:t,signUpUrl:"#sign-up",appearance:i}),A.jsx("div",{style:{marginLeft:"-30px"},className:"text-center",children:A.jsxs("p",{className:"text-sm",style:{color:"var(--text-secondary)"},children:["Don't have an account?"," ",A.jsx("a",{href:"#sign-up/",className:"font-medium hover:underline transition-colors",style:{color:"var(--accent-primary)"},children:"Sign up"})]})})]}):A.jsxs("div",{className:"space-y-4",children:[A.jsx(Hj,{routing:"virtual",fallbackRedirectUrl:t,signInUrl:"#sign-in",appearance:i}),A.jsx("div",{style:{marginLeft:"-40px"},className:"text-center",children:A.jsxs("p",{className:"text-sm",style:{color:"var(--text-secondary)"},children:["Already have an account?"," ",A.jsx("a",{href:"#sign-in/",className:"font-medium hover:underline transition-colors",style:{color:"var(--accent-primary)"},children:"Sign in"})]})})]})})]})},Qre=({children:t})=>A.jsxs(A.Fragment,{children:[A.jsx(Oj,{children:t}),A.jsx(Mj,{children:A.jsx(m9,{to:"/auth",replace:!0})})]});dn(({clerk:t,children:e,...n})=>{const{planId:r,planPeriod:i,for:s,onSubscriptionComplete:a,newSubscriptionRedirectUrl:l,checkoutProps:u,...d}=n,{userId:f,orgId:p}=Lh();if(f===null)throw new Error("Clerk: Ensure that `<CheckoutButton />` is rendered inside a `<SignedIn />` component.");if(p===null&&s==="organization")throw new Error('Clerk: Wrap `<CheckoutButton for="organization" />` with a check for an active organization. Retrieve `orgId` from `useAuth()` and confirm it is defined. For SSR, see: https://clerk.com/docs/reference/backend/types/auth-object#how-to-access-the-auth-object');e=rc(e,"Checkout");const g=nc(e)("CheckoutButton"),b=()=>{if(t)return t.__internal_openCheckout({planId:r,planPeriod:i,for:s,onSubscriptionComplete:a,newSubscriptionRedirectUrl:l,...u})},E={...d,onClick:async x=>(g&&typeof g=="object"&&"props"in g&&await ic(g.props.onClick)(x),b())};return le.cloneElement(g,E)},{component:"CheckoutButton",renderWhileLoading:!0});dn(({clerk:t,children:e,...n})=>{const{plan:r,planId:i,initialPlanPeriod:s,planDetailsProps:a,...l}=n;e=rc(e,"Plan details");const u=nc(e)("PlanDetailsButton"),d=()=>{if(t)return t.__internal_openPlanDetails({plan:r,planId:i,initialPlanPeriod:s,...a})},p={...l,onClick:async g=>(u&&typeof u=="object"&&"props"in u&&await ic(u.props.onClick)(g),d())};return le.cloneElement(u,p)},{component:"PlanDetailsButton",renderWhileLoading:!0});dn(({clerk:t,children:e,...n})=>{const{for:r,subscriptionDetailsProps:i,onSubscriptionCancel:s,...a}=n;e=rc(e,"Subscription details");const l=nc(e)("SubscriptionDetailsButton"),{userId:u,orgId:d}=Lh();if(u===null)throw new Error("Clerk: Ensure that `<SubscriptionDetailsButton />` is rendered inside a `<SignedIn />` component.");if(d===null&&r==="organization")throw new Error('Clerk: Wrap `<SubscriptionDetailsButton for="organization" />` with a check for an active organization. Retrieve `orgId` from `useAuth()` and confirm it is defined. For SSR, see: https://clerk.com/docs/reference/backend/types/auth-object#how-to-access-the-auth-object');const f=()=>{if(t)return t.__internal_openSubscriptionDetails({for:r,onSubscriptionCancel:s,...i})},g={...a,onClick:async b=>(l&&typeof l=="object"&&"props"in l&&await ic(l.props.onClick)(b),f())};return le.cloneElement(l,g)},{component:"SubscriptionDetailsButton",renderWhileLoading:!0});const vR=z.createContext({subscription:null,isLoading:!1,error:null,revalidate:()=>{}}),Zre=()=>z.useContext(vR),Jre=({tier:t,children:e})=>{const{data:n,isLoading:r,error:i,revalidate:s}=QH({enabled:t==="cycls_pass"}),a=z.useMemo(()=>({subscription:n,isLoading:r,error:i,revalidate:s}),[n,r,i,s]);return A.jsx(vR.Provider,{value:a,children:e})},Z8={desktop:60,chat:40},yR=t=>{const[e,n]=z.useState(!1);return z.useEffect(()=>{const r=()=>n(window.innerWidth<768);return r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),t?e?{chatWidthPercent:100,canvasWidthPercent:100,isMobile:e}:{chatWidthPercent:Z8.chat,canvasWidthPercent:Z8.desktop,isMobile:e}:{chatWidthPercent:100,canvasWidthPercent:0,isMobile:e}},eie="modulepreload",tie=function(t){return"/"+t},J8={},ER=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){let a=function(d){return Promise.all(d.map(f=>Promise.resolve(f).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=a(n.map(d=>{if(d=tie(d),d in J8)return;J8[d]=!0;const f=d.endsWith(".css"),p=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const g=document.createElement("link");if(g.rel=f?"stylesheet":eie,f||(g.as="script"),g.crossOrigin="",g.href=d,u&&g.setAttribute("nonce",u),document.head.appendChild(g),f)return new Promise((b,v)=>{g.addEventListener("load",b),g.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${d}`)))})}))}function s(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return i.then(a=>{for(const l of a||[])l.status==="rejected"&&s(l.reason);return e().catch(s)})};function dx(t){return(t||"document").replace(/[^a-z0-9\s\-_]/gi,"").replace(/\s+/g,"_").substring(0,50)||"document"}function _R(t){if(!t)return"";let e=t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/^### (.+)$/gm,"<h3>$1</h3>").replace(/^## (.+)$/gm,"<h2>$1</h2>").replace(/^# (.+)$/gm,"<h1>$1</h1>").replace(/\*\*\*(.+?)\*\*\*/g,"<strong><em>$1</em></strong>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/___(.+?)___/g,"<strong><em>$1</em></strong>").replace(/__(.+?)__/g,"<strong>$1</strong>").replace(/_(.+?)_/g,"<em>$1</em>").replace(/`([^`]+)`/g,"<code>$1</code>").replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2">$1</a>').replace(/^---$/gm,"<hr>").replace(/^[\-\*] (.+)$/gm,"<li>$1</li>").replace(/^\d+\. (.+)$/gm,"<li>$1</li>").replace(/^> (.+)$/gm,"<blockquote>$1</blockquote>").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>");return e="<p>"+e+"</p>",e=e.replace(/<p><\/p>/g,""),e=e.replace(/(<li>.*?<\/li>)+/gs,n=>`<ul>${n}</ul>`),e}async function nie(t){try{return await navigator.clipboard.writeText(t),!0}catch(e){console.error("Failed to copy to clipboard:",e);try{const n=document.createElement("textarea");return n.value=t,n.style.position="fixed",n.style.opacity="0",document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n),!0}catch(n){return console.error("Fallback copy failed:",n),!1}}}function fx(t,e){const n=dx(e)+".md",r=new Blob([t],{type:"text/markdown;charset=utf-8"}),i=URL.createObjectURL(r),s=document.createElement("a");s.href=i,s.download=n,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(i)}async function rie(t,e){try{const n=(await ER(async()=>{const{default:u}=await import("./html-to-docx.esm-DbAOvYyE.js");return{default:u}},[])).default,r=`
      <!DOCTYPE html>
      <html>
        <head>
          <meta charset="utf-8">
          <title>${e||"Document"}</title>
          <style>
            body { font-family: 'Calibri', sans-serif; font-size: 11pt; line-height: 1.5; }
            h1 { font-size: 18pt; font-weight: bold; margin-top: 12pt; margin-bottom: 6pt; }
            h2 { font-size: 14pt; font-weight: bold; margin-top: 12pt; margin-bottom: 6pt; }
            h3 { font-size: 12pt; font-weight: bold; margin-top: 12pt; margin-bottom: 6pt; }
            p { margin-top: 0; margin-bottom: 6pt; }
            ul, ol { margin-left: 18pt; }
            li { margin-bottom: 3pt; }
            blockquote { margin-left: 18pt; font-style: italic; color: #666; }
            code { font-family: 'Consolas', monospace; background-color: #f5f5f5; padding: 1pt 3pt; }
          </style>
        </head>
        <body>
          ${_R(t)}
        </body>
      </html>
    `,i=await n(r,null,{table:{row:{cantSplit:!0}},footer:!1,header:!1}),s=dx(e)+".docx",a=URL.createObjectURL(i),l=document.createElement("a");l.href=a,l.download=s,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(a)}catch(n){console.error("Failed to generate DOCX:",n),fx(t,e)}}async function iie(t,e){try{const{jsPDF:n}=await ER(async()=>{const{jsPDF:g}=await import("./jspdf.es.min-eVFWSv5x.js").then(b=>b.j);return{jsPDF:g}},[]),r=new n({orientation:"portrait",unit:"mm",format:"a4"});r.setProperties({title:e||"Document",creator:"Canvas Export"}),r.setFontSize(18),r.setFont("helvetica","bold"),r.text(e||"Document",20,20),r.setFontSize(11),r.setFont("helvetica","normal");const i=r.internal.pageSize.getWidth(),s=20,a=i-s*2,l=t.split(`
`);let u=35;const d=6,f=r.internal.pageSize.getHeight();for(const g of l)if(g.startsWith("# ")){r.setFontSize(16),r.setFont("helvetica","bold");const b=g.substring(2),v=r.splitTextToSize(b,a);for(const E of v)u>f-20&&(r.addPage(),u=20),r.text(E,s,u),u+=d+2;r.setFontSize(11),r.setFont("helvetica","normal")}else if(g.startsWith("## ")){r.setFontSize(14),r.setFont("helvetica","bold");const b=g.substring(3),v=r.splitTextToSize(b,a);for(const E of v)u>f-20&&(r.addPage(),u=20),r.text(E,s,u),u+=d+1;r.setFontSize(11),r.setFont("helvetica","normal")}else if(g.startsWith("### ")){r.setFontSize(12),r.setFont("helvetica","bold");const b=g.substring(4),v=r.splitTextToSize(b,a);for(const E of v)u>f-20&&(r.addPage(),u=20),r.text(E,s,u),u+=d;r.setFontSize(11),r.setFont("helvetica","normal")}else if(g.trim()==="")u+=d/2;else{let b=g.replace(/\*\*(.+?)\*\*/g,"$1").replace(/\*(.+?)\*/g,"$1").replace(/`(.+?)`/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1");const v=r.splitTextToSize(b,a);for(const E of v)u>f-20&&(r.addPage(),u=20),r.text(E,s,u),u+=d}const p=dx(e)+".pdf";r.save(p)}catch(n){console.error("Failed to generate PDF:",n),fx(t,e)}}function sie(t,e){const n=_R(t),r=window.open("","_blank");if(!r){console.error("Failed to open print window");return}r.document.write(`
    <!DOCTYPE html>
    <html>
      <head>
        <meta charset="utf-8">
        <title>${e||"Document"}</title>
        <style>
          @media print {
            body {
              font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
              font-size: 12pt;
              line-height: 1.6;
              color: #000;
              max-width: 100%;
              margin: 0;
              padding: 20mm;
            }
            h1 { font-size: 18pt; margin-top: 12pt; margin-bottom: 6pt; }
            h2 { font-size: 14pt; margin-top: 12pt; margin-bottom: 6pt; }
            h3 { font-size: 12pt; margin-top: 12pt; margin-bottom: 6pt; }
            p { margin-bottom: 6pt; }
            ul, ol { margin-left: 18pt; }
            blockquote { margin-left: 18pt; font-style: italic; border-left: 2pt solid #ccc; padding-left: 12pt; }
            code { font-family: 'Consolas', monospace; background-color: #f5f5f5; padding: 1pt 3pt; }
            a { color: #000; text-decoration: underline; }
          }
          @page {
            margin: 20mm;
          }
        </style>
      </head>
      <body>
        <h1>${e||"Document"}</h1>
        ${n}
      </body>
    </html>
  `),r.document.close(),r.onload=()=>{r.print(),r.close()}}const aie=()=>A.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[A.jsx("circle",{cx:"12",cy:"12",r:"1"}),A.jsx("circle",{cx:"19",cy:"12",r:"1"}),A.jsx("circle",{cx:"5",cy:"12",r:"1"})]}),oie=()=>A.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[A.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),A.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),lie=()=>A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:A.jsx("polyline",{points:"20 6 9 17 4 12"})}),fE=()=>A.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[A.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),A.jsx("polyline",{points:"7 10 12 15 17 10"}),A.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}),uie=()=>A.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[A.jsx("polyline",{points:"6 9 6 2 18 2 18 9"}),A.jsx("path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"}),A.jsx("rect",{x:"6",y:"14",width:"12",height:"8"})]}),cie=()=>{const{state:t}=Xd(),[e,n]=z.useState(!1),[r,i]=z.useState(!1),s=z.useRef(null),a=z.useRef(null);z.useEffect(()=>{const g=b=>{s.current&&!s.current.contains(b.target)&&!a.current.contains(b.target)&&n(!1)};if(e)return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[e]),z.useEffect(()=>{const g=b=>{var v;b.key==="Escape"&&e&&(n(!1),(v=a.current)==null||v.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[e]);const l=async()=>{await nie(t.content)&&(i(!0),setTimeout(()=>i(!1),2e3)),n(!1)},u=()=>{fx(t.content,t.title),n(!1)},d=async()=>{await rie(t.content,t.title),n(!1)},f=async()=>{await iie(t.content,t.title),n(!1)},p=()=>{sie(t.content,t.title),n(!1)};return t.isDone?A.jsxs("div",{className:"relative",children:[A.jsx("button",{ref:a,onClick:()=>n(!e),className:"p-2 rounded-lg hover:bg-[var(--bg-hover)] active:bg-[var(--bg-active)] transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--text-primary)]/20",style:{color:"var(--text-secondary)"},"aria-label":"Export options","aria-haspopup":"true","aria-expanded":e,children:A.jsx(aie,{})}),e&&A.jsxs("div",{ref:s,className:"absolute right-0 top-full mt-1 w-48 rounded-xl shadow-lg dropdown-menu z-50",style:{backgroundColor:"var(--bg-primary)",border:"1px solid var(--border-primary)"},role:"menu",children:[A.jsxs("button",{onClick:l,className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm hover:bg-[var(--bg-hover)] transition-colors first:rounded-t-xl",style:{color:r?"var(--text-success, #22c55e)":"var(--text-primary)"},role:"menuitem",children:[r?A.jsx(lie,{}):A.jsx(oie,{}),A.jsx("span",{children:r?"Copied!":"Copy to clipboard"})]}),A.jsx("div",{className:"mx-3 my-1",style:{borderTop:"1px solid var(--border-primary)"}}),A.jsxs("button",{onClick:u,className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm hover:bg-[var(--bg-hover)] transition-colors",style:{color:"var(--text-primary)"},role:"menuitem",children:[A.jsx(fE,{}),A.jsx("span",{children:"Download as .md"})]}),A.jsxs("button",{onClick:d,className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm hover:bg-[var(--bg-hover)] transition-colors",style:{color:"var(--text-primary)"},role:"menuitem",children:[A.jsx(fE,{}),A.jsx("span",{children:"Download as .docx"})]}),A.jsxs("button",{onClick:f,className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm hover:bg-[var(--bg-hover)] transition-colors",style:{color:"var(--text-primary)"},role:"menuitem",children:[A.jsx(fE,{}),A.jsx("span",{children:"Download as .pdf"})]}),A.jsx("div",{className:"mx-3 my-1",style:{borderTop:"1px solid var(--border-primary)"}}),A.jsxs("button",{onClick:p,className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm hover:bg-[var(--bg-hover)] transition-colors last:rounded-b-xl",style:{color:"var(--text-primary)"},role:"menuitem",children:[A.jsx(uie,{}),A.jsx("span",{children:"Print"})]})]})]}):null},die=()=>A.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[A.jsx("path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"}),A.jsx("polyline",{points:"14 2 14 8 20 8"}),A.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),A.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),A.jsx("line",{x1:"10",y1:"9",x2:"8",y2:"9"})]}),fie=()=>A.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[A.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),A.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),hie=()=>A.jsxs("div",{className:"flex items-center gap-1","aria-label":"Streaming content",children:[A.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-[var(--text-tertiary)] animate-bounce motion-reduce:animate-none [animation-duration:900ms] [animation-delay:0ms] opacity-90"}),A.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-[var(--text-tertiary)] animate-bounce motion-reduce:animate-none [animation-duration:900ms] [animation-delay:140ms] opacity-90"}),A.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-[var(--text-tertiary)] animate-bounce motion-reduce:animate-none [animation-duration:900ms] [animation-delay:280ms] opacity-90"})]}),pie=({closeButtonRef:t})=>{const{state:e,closeCanvas:n,updateContent:r}=Xd(),[i,s]=z.useState(!1),[a,l]=z.useState(e.title),u=()=>{e.isDone&&(l(e.title),s(!0))},d=()=>{s(!1)},f=p=>{p.key==="Enter"?(p.preventDefault(),s(!1)):p.key==="Escape"&&(l(e.title),s(!1))};return A.jsxs("div",{className:"flex h-14 items-center justify-between px-4 flex-shrink-0",style:{borderBottom:"1px solid var(--border-primary)"},children:[A.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[A.jsx("div",{className:"flex-shrink-0",style:{color:"var(--text-secondary)"},children:A.jsx(die,{})}),i?A.jsx("input",{type:"text",value:a,onChange:p=>l(p.target.value),onBlur:d,onKeyDown:f,autoFocus:!0,className:"text-base font-medium bg-transparent border-none focus:outline-none focus:ring-1 focus:ring-[var(--accent-primary)] rounded px-1 min-w-0 flex-1",style:{color:"var(--text-primary)"}}):A.jsx("h2",{onClick:u,className:`text-base font-medium truncate ${e.isDone?"cursor-text hover:bg-[var(--bg-hover)] rounded px-1 -mx-1":""}`,style:{color:"var(--text-primary)"},title:e.title,children:e.title||"Untitled"}),e.isStreaming&&A.jsx("div",{className:"flex-shrink-0 ml-2",children:A.jsx(hie,{})})]}),A.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[A.jsx(cie,{}),A.jsx("button",{ref:t,onClick:n,className:"p-2 rounded-lg hover:bg-[var(--bg-hover)] active:bg-[var(--bg-active)] transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--text-primary)]/20",style:{color:"var(--text-secondary)"},"aria-label":"Close canvas",children:A.jsx(fie,{})})]})]})};function Kr(t){this.content=t}Kr.prototype={constructor:Kr,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),s=r.content.slice();return i==-1?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new Kr(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Kr(n)},addToStart:function(t,e){return new Kr([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Kr(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),s=r.find(t);return i.splice(s==-1?i.length:s,0,e,n),new Kr(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Kr.from(t),t.size?new Kr(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Kr.from(t),t.size?new Kr(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Kr.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};Kr.from=function(t){if(t instanceof Kr)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Kr(e)};function xR(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),s=e.child(r);if(i==s){n+=i.nodeSize;continue}if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){for(let a=0;i.text[a]==s.text[a];a++)n++;return n}if(i.content.size||s.content.size){let a=xR(i.content,s.content,n+1);if(a!=null)return a}n+=i.nodeSize}}function TR(t,e,n,r){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:r};let a=t.child(--i),l=e.child(--s),u=a.nodeSize;if(a==l){n-=u,r-=u;continue}if(!a.sameMarkup(l))return{a:n,b:r};if(a.isText&&a.text!=l.text){let d=0,f=Math.min(a.text.length,l.text.length);for(;d<f&&a.text[a.text.length-d-1]==l.text[l.text.length-d-1];)d++,n--,r--;return{a:n,b:r}}if(a.content.size||l.content.size){let d=TR(a.content,l.content,n-1,r-1);if(d)return d}n-=u,r-=u}}class ke{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,s){for(let a=0,l=0;l<n;a++){let u=this.content[a],d=l+u.nodeSize;if(d>e&&r(u,i+l,s||null,a)!==!1&&u.content.size){let f=l+1;u.nodesBetween(Math.max(0,e-f),Math.min(u.content.size,n-f),r,i+f)}l=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let s="",a=!0;return this.nodesBetween(e,n,(l,u)=>{let d=l.isText?l.text.slice(Math.max(e,u)-u,n-u):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&d||l.isTextblock)&&r&&(a?a=!1:s+=r),s+=d},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new ke(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let s=0,a=0;a<n;s++){let l=this.content[s],u=a+l.nodeSize;u>e&&((a<e||u>n)&&(l.isText?l=l.cut(Math.max(0,e-a),Math.min(l.text.length,n-a)):l=l.cut(Math.max(0,e-a-1),Math.min(l.content.size,n-a-1))),r.push(l),i+=l.nodeSize),a=u}return new ke(r,i)}cutByIndex(e,n){return e==n?ke.empty:e==0&&n==this.content.length?this:new ke(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new ke(i,s)}addToStart(e){return new ke([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new ke(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return xR(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return TR(this,e,n,r)}findIndex(e){if(e==0)return Vm(0,e);if(e==this.size)return Vm(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),s=r+i.nodeSize;if(s>=e)return s==e?Vm(n+1,s):Vm(n,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return ke.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new ke(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return ke.empty;let n,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(n||(n=e.slice(0,i)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new ke(n||e,r)}static from(e){if(!e)return ke.empty;if(e instanceof ke)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new ke([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}ke.empty=new ke([],0);const hE={index:0,offset:0};function Vm(t,e){return hE.index=t,hE.offset=e,hE}function Jg(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Jg(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Jg(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let xn=class Q4{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Jg(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Q4.none;if(e instanceof Q4)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};xn.none=[];class e1 extends Error{}class qe{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=wR(this.content,e+this.openStart,n);return r&&new qe(r,this.openStart,this.openEnd)}removeBetween(e,n){return new qe(SR(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return qe.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new qe(ke.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new qe(e,r,i)}}qe.empty=new qe(ke.empty,0,0);function SR(t,e,n){let{index:r,offset:i}=t.findIndex(e),s=t.maybeChild(r),{index:a,offset:l}=t.findIndex(n);if(i==e||s.isText){if(l!=n&&!t.child(a).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(SR(s.content,e-i-1,n-i-1)))}function wR(t,e,n,r){let{index:i,offset:s}=t.findIndex(e),a=t.maybeChild(i);if(s==e||a.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let l=wR(a.content,e-s-1,n,a);return l&&t.replaceChild(i,a.copy(l))}function mie(t,e,n){if(n.openStart>t.depth)throw new e1("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new e1("Inconsistent open depths");return kR(t,e,n,0)}function kR(t,e,n,r){let i=t.index(r),s=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let a=kR(t,e,n,r+1);return s.copy(s.content.replaceChild(i,a))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let a=t.parent,l=a.content;return $u(a,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:a,end:l}=gie(n,t);return $u(s,AR(t,a,l,e,r))}else return $u(s,t1(t,e,r))}function CR(t,e){if(!e.type.compatibleContent(t.type))throw new e1("Cannot join "+e.type.name+" onto "+t.type.name)}function Z4(t,e,n){let r=t.node(n);return CR(r,e.node(n)),r}function ju(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Vf(t,e,n,r){let i=(e||t).node(n),s=0,a=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(ju(t.nodeAfter,r),s++));for(let l=s;l<a;l++)ju(i.child(l),r);e&&e.depth==n&&e.textOffset&&ju(e.nodeBefore,r)}function $u(t,e){return t.type.checkContent(e),t.copy(e)}function AR(t,e,n,r,i){let s=t.depth>i&&Z4(t,e,i+1),a=r.depth>i&&Z4(n,r,i+1),l=[];return Vf(null,t,i,l),s&&a&&e.index(i)==n.index(i)?(CR(s,a),ju($u(s,AR(t,e,n,r,i+1)),l)):(s&&ju($u(s,t1(t,e,i+1)),l),Vf(e,n,i,l),a&&ju($u(a,t1(n,r,i+1)),l)),Vf(r,null,i,l),new ke(l)}function t1(t,e,n){let r=[];if(Vf(null,t,n,r),t.depth>n){let i=Z4(t,e,n+1);ju($u(i,t1(t,e,n+1)),r)}return Vf(e,null,n,r),new ke(r)}function gie(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)i=e.node(s).copy(ke.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class hh{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return xn.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let l=r;r=i,i=l}let s=r.marks;for(var a=0;a<s.length;a++)s[a].type.spec.inclusive===!1&&(!i||!s[a].isInSet(i.marks))&&(s=s[a--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new n1(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,s=n;for(let a=e;;){let{index:l,offset:u}=a.content.findIndex(s),d=s-u;if(r.push(a,l,i+u),!d||(a=a.child(l),a.isText))break;s=d-1,i+=u+1}return new hh(n,r,s)}static resolveCached(e,n){let r=eC.get(e);if(r)for(let s=0;s<r.elts.length;s++){let a=r.elts[s];if(a.pos==n)return a}else eC.set(e,r=new bie);let i=r.elts[r.i]=hh.resolve(e,n);return r.i=(r.i+1)%vie,i}}class bie{constructor(){this.elts=[],this.i=0}}const vie=12,eC=new WeakMap;class n1{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const yie=Object.create(null);let Hl=class J4{constructor(e,n,r,i=xn.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||ke.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Jg(this.attrs,n||e.defaultAttrs||yie)&&xn.sameSet(this.marks,r||xn.none)}copy(e=null){return e==this.content?this:new J4(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new J4(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return qe.empty;let i=this.resolve(e),s=this.resolve(n),a=r?0:i.sharedDepth(n),l=i.start(a),d=i.node(a).content.cut(i.pos-l,s.pos-l);return new qe(d,i.depth-a,s.depth-a)}replace(e,n,r){return mie(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return hh.resolveCached(this,e)}resolveNoCache(e){return hh.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),NR(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=ke.empty,i=0,s=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,i,s),l=a&&a.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let u=i;u<s;u++)if(!this.type.allowsMarks(r.child(u).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),a=s&&s.matchFragment(this.content,n);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=xn.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!xn.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=ke.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};Hl.prototype.text=void 0;class r1 extends Hl{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):NR(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new r1(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new r1(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function NR(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Ku{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new Eie(e,n);if(r.next==null)return Ku.empty;let i=OR(r);r.next&&r.err("Unexpected trailing text");let s=Cie(kie(i));return Aie(s,r),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let s=n;i&&s<r;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function s(a,l){let u=a.matchFragment(e,r);if(u&&(!n||u.validEnd))return ke.from(l.map(d=>d.createAndFill()));for(let d=0;d<a.next.length;d++){let{type:f,next:p}=a.next[d];if(!(f.isText||f.hasRequiredAttrs())&&i.indexOf(p)==-1){i.push(p);let g=s(p,l.concat(f));if(g)return g}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(e)){let a=[];for(let l=i;l.type;l=l.via)a.push(l.type);return a.reverse()}for(let a=0;a<s.next.length;a++){let{type:l,next:u}=s.next[a];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!i.type||u.validEnd)&&(r.push({match:l.contentMatch,type:l,via:i}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)s+=(a?", ":"")+r.next[a].type.name+"->"+e.indexOf(r.next[a].next);return s}).join(`
`)}}Ku.empty=new Ku(!0);class Eie{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function OR(t){let e=[];do e.push(_ie(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function _ie(t){let e=[];do e.push(xie(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function xie(t){let e=wie(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=Tie(t,e);else break;return e}function tC(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Tie(t,e){let n=tC(t),r=n;return t.eat(",")&&(t.next!="}"?r=tC(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function Sie(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let s in n){let a=n[s];a.isInGroup(e)&&i.push(a)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function wie(t){if(t.eat("(")){let e=OR(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=Sie(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function kie(t){let e=[[]];return i(s(t,0),n()),e;function n(){return e.push([])-1}function r(a,l,u){let d={term:u,to:l};return e[a].push(d),d}function i(a,l){a.forEach(u=>u.to=l)}function s(a,l){if(a.type=="choice")return a.exprs.reduce((u,d)=>u.concat(s(d,l)),[]);if(a.type=="seq")for(let u=0;;u++){let d=s(a.exprs[u],l);if(u==a.exprs.length-1)return d;i(d,l=n())}else if(a.type=="star"){let u=n();return r(l,u),i(s(a.expr,u),u),[r(u)]}else if(a.type=="plus"){let u=n();return i(s(a.expr,l),u),i(s(a.expr,u),u),[r(u)]}else{if(a.type=="opt")return[r(l)].concat(s(a.expr,l));if(a.type=="range"){let u=l;for(let d=0;d<a.min;d++){let f=n();i(s(a.expr,u),f),u=f}if(a.max==-1)i(s(a.expr,u),u);else for(let d=a.min;d<a.max;d++){let f=n();r(u,f),i(s(a.expr,u),f),u=f}return[r(u)]}else{if(a.type=="name")return[r(l,void 0,a.value)];throw new Error("Unknown expr type")}}}}function MR(t,e){return e-t}function nC(t,e){let n=[];return r(e),n.sort(MR);function r(i){let s=t[i];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(i);for(let a=0;a<s.length;a++){let{term:l,to:u}=s[a];!l&&n.indexOf(u)==-1&&r(u)}}}function Cie(t){let e=Object.create(null);return n(nC(t,0));function n(r){let i=[];r.forEach(a=>{t[a].forEach(({term:l,to:u})=>{if(!l)return;let d;for(let f=0;f<i.length;f++)i[f][0]==l&&(d=i[f][1]);nC(t,u).forEach(f=>{d||i.push([l,d=[]]),d.indexOf(f)==-1&&d.push(f)})})});let s=e[r.join(",")]=new Ku(r.indexOf(t.length-1)>-1);for(let a=0;a<i.length;a++){let l=i[a][1].sort(MR);s.next.push({type:i[a][0],next:e[l.join(",")]||n(l)})}return s}}function Aie(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],s=!i.validEnd,a=[];for(let l=0;l<i.next.length;l++){let{type:u,next:d}=i.next[l];a.push(u.name),s&&!(u.isText||u.hasRequiredAttrs())&&(s=!1),r.indexOf(d)==-1&&r.push(d)}s&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function RR(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function DR(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let s=t[r];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function IR(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let s=t[i];s.validate&&s.validate(e[i])}}function LR(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new Oie(t,r,e[r]);return n}let rC=class PR{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=LR(e,r.attrs),this.defaultAttrs=RR(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Ku.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:DR(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Hl(this,this.computeAttrs(e),ke.from(n),xn.setFrom(r))}createChecked(e=null,n,r){return n=ke.from(n),this.checkContent(n),new Hl(this,this.computeAttrs(e),n,xn.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=ke.from(n),n.size){let a=this.contentMatch.fillBefore(n);if(!a)return null;n=a.append(n)}let i=this.contentMatch.matchFragment(n),s=i&&i.fillBefore(ke.empty,!0);return s?new Hl(this,e,n.append(s),xn.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){IR(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:xn.none:e}static compile(e,n){let r=Object.create(null);e.forEach((s,a)=>r[s]=new PR(s,n,a));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function Nie(t,e,n){let r=n.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${s}`)}}class Oie{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Nie(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Ib{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=LR(e,i.attrs),this.excluded=null;let s=RR(this.attrs);this.instance=s?new xn(this,s):null}create(e=null){return!e&&this.instance?this.instance:new xn(this,DR(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((s,a)=>r[s]=new Ib(s,i++,n,a)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){IR(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class BR{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=Kr.from(e.nodes),n.marks=Kr.from(e.marks||{}),this.nodes=rC.compile(this.spec.nodes,this),this.marks=Ib.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],a=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=r[a]||(r[a]=Ku.parse(a,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=l=="_"?null:l?iC(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],a=s.spec.excludes;s.excluded=a==null?[s]:a==""?[]:iC(this,a.split(" "))}this.nodeFromJSON=i=>Hl.fromJSON(this,i),this.markFromJSON=i=>xn.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof rC){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new r1(r,r.defaultAttrs,e,xn.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function iC(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],s=t.marks[i],a=s;if(s)n.push(s);else for(let l in t.marks){let u=t.marks[l];(i=="_"||u.spec.group&&u.spec.group.split(" ").indexOf(i)>-1)&&n.push(a=u)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function Mie(t){return t.tag!=null}function Rie(t){return t.style!=null}let Gf=class e3{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(Mie(i))this.tags.push(i);else if(Rie(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,n={}){let r=new aC(this,n,!1);return r.addAll(e,xn.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new aC(this,n,!0);return r.addAll(e,xn.none,n.from,n.to),qe.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(Lie(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let a=s.getAttrs(e);if(a===!1)continue;s.attrs=a||void 0}return s}}}matchStyle(e,n,r,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let a=this.styles[s],l=a.style;if(!(l.indexOf(e)!=0||a.context&&!r.matchesContext(a.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(a.getAttrs){let u=a.getAttrs(n);if(u===!1)continue;a.attrs=u||void 0}return a}}}static schemaRules(e){let n=[];function r(i){let s=i.priority==null?50:i.priority,a=0;for(;a<n.length;a++){let l=n[a];if((l.priority==null?50:l.priority)<s)break}n.splice(a,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(a=>{r(a=oC(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(a=>{r(a=oC(a)),a.node||a.ignore||a.mark||(a.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new e3(e,e3.schemaRules(e)))}};const zR={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Die={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},UR={ol:!0,ul:!0},ph=1,t3=2,Yf=4;function sC(t,e,n){return e!=null?(e?ph:0)|(e==="full"?t3:0):t&&t.whitespace=="pre"?ph|t3:n&~Yf}class Gm{constructor(e,n,r,i,s,a){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=a,this.content=[],this.activeMarks=xn.none,this.match=s||(a&Yf?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(ke.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&ph)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let n=ke.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(ke.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!zR.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class aC{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,s,a=sC(null,n.preserveWhitespace,0)|(r?Yf:0);i?s=new Gm(i.type,i.attrs,xn.none,!0,n.topMatch||i.type.contentMatch,a):r?s=new Gm(null,null,xn.none,!0,null,a):s=new Gm(e.schema.topNodeType,null,xn.none,!0,null,a),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,s=i.options&t3?"full":this.localPreserveWS||(i.options&ph)>0,{schema:a}=this.parser;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)if(s==="full")r=r.replace(/\r\n?/g,`
`);else if(a.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(a.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let u=0;u<l.length;u++)u&&this.insertNode(a.linebreakReplacement.create(),n,!0),l[u]&&this.insertNode(a.text(l[u]),n,!/\S/.test(l[u]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let l=i.content[i.content.length-1],u=e.previousSibling;(!l||u&&u.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(a.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),l;UR.hasOwnProperty(a)&&this.parser.normalizeLists&&Iie(e);let u=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(u?u.ignore:Die.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,n);else if(!u||u.skip||u.closeParent){u&&u.closeParent?this.open=Math.max(0,this.open-1):u&&u.skip.nodeType&&(e=u.skip);let d,f=this.needsBlock;if(zR.hasOwnProperty(a))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),d=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let p=u&&u.skip?n:this.readStyles(e,n);p&&this.addAll(e,p),d&&this.sync(s),this.needsBlock=f}else{let d=this.readStyles(e,n);d&&this.addElementByRule(e,u,d,u.consuming===!1?l:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],a=r.getPropertyValue(s);if(a)for(let l=void 0;;){let u=this.parser.matchStyle(s,a,this,l);if(!u)break;if(u.ignore)return null;if(u.clearMark?n=n.filter(d=>!u.clearMark(d)):n=n.concat(this.parser.schema.marks[u.mark].create(u.attrs)),u.consuming===!1)l=u;else break}}return n}addElementByRule(e,n,r,i){let s,a;if(n.node)if(a=this.parser.schema.nodes[n.node],a.isLeaf)this.insertNode(a.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let u=this.enter(a,n.attrs||null,r,n.preserveWhitespace);u&&(s=!0,r=u)}else{let u=this.parser.schema.marks[n.mark];r=r.concat(u.create(n.attrs))}let l=this.top;if(a&&a.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(u=>this.insertNode(u,r,!1));else{let u=e;typeof n.contentElement=="string"?u=e.querySelector(n.contentElement):typeof n.contentElement=="function"?u=n.contentElement(e):n.contentElement&&(u=n.contentElement),this.findAround(e,u,!0),this.addAll(u,r),this.findAround(e,u,!1)}s&&this.sync(l)&&this.open--}addAll(e,n,r,i){let s=r||0;for(let a=r?e.childNodes[r]:e.firstChild,l=i==null?null:e.childNodes[i];a!=l;a=a.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(a,n);this.findAtPoint(e,s)}findPlace(e,n,r){let i,s;for(let a=this.open,l=0;a>=0;a--){let u=this.nodes[a],d=u.findWrapping(e);if(d&&(!i||i.length>d.length+l)&&(i=d,s=u,!d.length))break;if(u.solid){if(r)break;l+=2}}if(!i)return null;this.sync(s);for(let a=0;a<i.length;a++)n=this.enterInner(i[a],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(n=this.enterInner(s,null,n))}let i=this.findPlace(e,n,r);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let a=xn.none;for(let l of i.concat(e.marks))(s.type?s.type.allowsMarkType(l.type):lC(l.type,e.type))&&(a=l.addToSet(a));return s.content.push(e.mark(a)),!0}return!1}enter(e,n,r,i){let s=this.findPlace(e.create(n),r,!1);return s&&(s=this.enterInner(e,n,r,!0,i)),s}enterInner(e,n,r,i=!1,s){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let l=sC(e,s,a.options);a.options&Yf&&a.content.length==0&&(l|=Yf);let u=xn.none;return r=r.filter(d=>(a.type?a.type.allowsMarkType(d.type):lC(d.type,e))?(u=d.addToSet(u),!1):!0),this.nodes.push(new Gm(e,n,u,i,null,l)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=ph)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(i?0:1),a=(l,u)=>{for(;l>=0;l--){let d=n[l];if(d==""){if(l==n.length-1||l==0)continue;for(;u>=s;u--)if(a(l-1,u))return!0;return!1}else{let f=u>0||u==0&&i?this.nodes[u].type:r&&u>=s?r.node(u-s).type:null;if(!f||f.name!=d&&!f.isInGroup(d))return!1;u--}}return!0};return a(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function Iie(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&UR.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function Lie(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function oC(t){let e={};for(let n in t)e[n]=t[n];return e}function lC(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let s=[],a=l=>{s.push(l);for(let u=0;u<l.edgeCount;u++){let{type:d,next:f}=l.edge(u);if(d==e||s.indexOf(f)<0&&a(f))return!0}};if(a(i.contentMatch))return!0}}class uc{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=pE(n).createDocumentFragment());let i=r,s=[];return e.forEach(a=>{if(s.length||a.marks.length){let l=0,u=0;for(;l<s.length&&u<a.marks.length;){let d=a.marks[u];if(!this.marks[d.type.name]){u++;continue}if(!d.eq(s[l][0])||d.type.spec.spanning===!1)break;l++,u++}for(;l<s.length;)i=s.pop()[1];for(;u<a.marks.length;){let d=a.marks[u++],f=this.serializeMark(d,a.isInline,n);f&&(s.push([d,i]),i.appendChild(f.dom),i=f.contentDOM||f.dom)}}i.appendChild(this.serializeNodeInner(a,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=wg(pE(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&wg(pE(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return wg(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new uc(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=uC(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return uC(e.marks)}}function uC(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function pE(t){return t.document||window.document}const cC=new WeakMap;function Pie(t){let e=cC.get(t);return e===void 0&&cC.set(t,e=Bie(t)),e}function Bie(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function wg(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=Pie(r))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let a=i.indexOf(" ");a>0&&(n=i.slice(0,a),i=i.slice(a+1));let l,u=n?t.createElementNS(n,i):t.createElement(i),d=e[1],f=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){f=2;for(let p in d)if(d[p]!=null){let g=p.indexOf(" ");g>0?u.setAttributeNS(p.slice(0,g),p.slice(g+1),d[p]):p=="style"&&u.style?u.style.cssText=d[p]:u.setAttribute(p,d[p])}}for(let p=f;p<e.length;p++){let g=e[p];if(g===0){if(p<e.length-1||p>f)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else{let{dom:b,contentDOM:v}=wg(t,g,n,r);if(u.appendChild(b),v){if(l)throw new RangeError("Multiple content holes");l=v}}}return{dom:u,contentDOM:l}}const FR=65535,HR=Math.pow(2,16);function zie(t,e){return t+e*HR}function dC(t){return t&FR}function Uie(t){return(t-(t&FR))/HR}const jR=1,$R=2,kg=4,qR=8;class n3{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&qR)>0}get deletedBefore(){return(this.delInfo&(jR|kg))>0}get deletedAfter(){return(this.delInfo&($R|kg))>0}get deletedAcross(){return(this.delInfo&kg)>0}}class ls{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&ls.empty)return ls.empty}recover(e){let n=0,r=dC(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+Uie(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,s=this.inverted?2:1,a=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let u=this.ranges[l]-(this.inverted?i:0);if(u>e)break;let d=this.ranges[l+s],f=this.ranges[l+a],p=u+d;if(e<=p){let g=d?e==u?-1:e==p?1:n:n,b=u+i+(g<0?0:f);if(r)return b;let v=e==(n<0?u:p)?null:zie(l/3,e-u),E=e==u?$R:e==p?jR:kg;return(n<0?e!=u:e!=p)&&(E|=qR),new n3(b,E,v)}i+=f-d}return r?e+i:new n3(e+i,0,null)}touches(e,n){let r=0,i=dC(n),s=this.inverted?2:1,a=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let u=this.ranges[l]-(this.inverted?r:0);if(u>e)break;let d=this.ranges[l+s],f=u+d;if(e<=f&&l==i*3)return!0;r+=this.ranges[l+a]-d}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let a=this.ranges[i],l=a-(this.inverted?s:0),u=a+(this.inverted?0:s),d=this.ranges[i+n],f=this.ranges[i+r];e(l,l+d,u,u+f),s+=f-d}}invert(){return new ls(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?ls.empty:new ls(e<0?[0,-e,0]:[0,0,e])}}ls.empty=new ls([]);class mh{constructor(e,n,r=0,i=e?e.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new mh(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let i=e.getMirror(n);this.appendMap(e._maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new mh;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let s=this.from;s<this.to;s++){let a=this._maps[s],l=a.mapResult(e,n);if(l.recover!=null){let u=this.getMirror(s);if(u!=null&&u>s&&u<this.to){s=u,e=this._maps[u].recover(l.recover);continue}}i|=l.delInfo,e=l.pos}return r?e:new n3(e,i,null)}}const mE=Object.create(null);class fi{getMap(){return ls.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=mE[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in mE)throw new RangeError("Duplicate use of step JSON ID "+e);return mE[e]=n,n.prototype.jsonID=e,n}}class wr{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new wr(e,null)}static fail(e){return new wr(null,e)}static fromReplace(e,n,r,i){try{return wr.ok(e.replace(n,r,i))}catch(s){if(s instanceof e1)return wr.fail(s.message);throw s}}}function hx(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let s=t.child(i);s.content.size&&(s=s.copy(hx(s.content,e,s))),s.isInline&&(s=e(s,n,i)),r.push(s)}return ke.fromArray(r)}class Bl extends fi{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),s=new qe(hx(n.content,(a,l)=>!a.isAtom||!l.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return wr.fromReplace(e,this.from,this.to,s)}invert(){return new Ws(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Bl(n.pos,r.pos,this.mark)}merge(e){return e instanceof Bl&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Bl(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Bl(n.from,n.to,e.markFromJSON(n.mark))}}fi.jsonID("addMark",Bl);class Ws extends fi{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new qe(hx(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return wr.fromReplace(e,this.from,this.to,r)}invert(){return new Bl(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Ws(n.pos,r.pos,this.mark)}merge(e){return e instanceof Ws&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ws(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ws(n.from,n.to,e.markFromJSON(n.mark))}}fi.jsonID("removeMark",Ws);class zl extends fi{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return wr.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return wr.fromReplace(e,this.pos,this.pos+1,new qe(ke.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new zl(this.pos,n.marks[i]);return new zl(this.pos,this.mark)}}return new Xu(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new zl(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new zl(n.pos,e.markFromJSON(n.mark))}}fi.jsonID("addNodeMark",zl);class Xu extends fi{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return wr.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return wr.fromReplace(e,this.pos,this.pos+1,new qe(ke.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new zl(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Xu(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Xu(n.pos,e.markFromJSON(n.mark))}}fi.jsonID("removeNodeMark",Xu);class Ur extends fi{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&r3(e,this.from,this.to)?wr.fail("Structure replace would overwrite content"):wr.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new ls([this.from,this.to-this.from,this.slice.size])}invert(e){return new Ur(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Ur(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Ur)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?qe.empty:new qe(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Ur(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?qe.empty:new qe(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Ur(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Ur(n.from,n.to,qe.fromJSON(e,n.slice),!!n.structure)}}fi.jsonID("replace",Ur);class jr extends fi{constructor(e,n,r,i,s,a,l=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=a,this.structure=l}apply(e){if(this.structure&&(r3(e,this.from,this.gapFrom)||r3(e,this.gapTo,this.to)))return wr.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return wr.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?wr.fromReplace(e,this.from,this.to,r):wr.fail("Content does not fit in gap")}getMap(){return new ls([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new jr(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||s>r.pos?null:new jr(n.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new jr(n.from,n.to,n.gapFrom,n.gapTo,qe.fromJSON(e,n.slice),n.insert,!!n.structure)}}fi.jsonID("replaceAround",jr);function r3(t,e,n){let r=t.resolve(e),i=n-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let a=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function Fie(t,e,n,r){let i=[],s=[],a,l;t.doc.nodesBetween(e,n,(u,d,f)=>{if(!u.isInline)return;let p=u.marks;if(!r.isInSet(p)&&f.type.allowsMarkType(r.type)){let g=Math.max(d,e),b=Math.min(d+u.nodeSize,n),v=r.addToSet(p);for(let E=0;E<p.length;E++)p[E].isInSet(v)||(a&&a.to==g&&a.mark.eq(p[E])?a.to=b:i.push(a=new Ws(g,b,p[E])));l&&l.to==g?l.to=b:s.push(l=new Bl(g,b,r))}}),i.forEach(u=>t.step(u)),s.forEach(u=>t.step(u))}function Hie(t,e,n,r){let i=[],s=0;t.doc.nodesBetween(e,n,(a,l)=>{if(!a.isInline)return;s++;let u=null;if(r instanceof Ib){let d=a.marks,f;for(;f=r.isInSet(d);)(u||(u=[])).push(f),d=f.removeFromSet(d)}else r?r.isInSet(a.marks)&&(u=[r]):u=a.marks;if(u&&u.length){let d=Math.min(l+a.nodeSize,n);for(let f=0;f<u.length;f++){let p=u[f],g;for(let b=0;b<i.length;b++){let v=i[b];v.step==s-1&&p.eq(i[b].style)&&(g=v)}g?(g.to=d,g.step=s):i.push({style:p,from:Math.max(l,e),to:d,step:s})}}}),i.forEach(a=>t.step(new Ws(a.from,a.to,a.style)))}function px(t,e,n,r=n.contentMatch,i=!0){let s=t.doc.nodeAt(e),a=[],l=e+1;for(let u=0;u<s.childCount;u++){let d=s.child(u),f=l+d.nodeSize,p=r.matchType(d.type);if(!p)a.push(new Ur(l,f,qe.empty));else{r=p;for(let g=0;g<d.marks.length;g++)n.allowsMarkType(d.marks[g].type)||t.step(new Ws(l,f,d.marks[g]));if(i&&d.isText&&n.whitespace!="pre"){let g,b=/\r?\n|\r/g,v;for(;g=b.exec(d.text);)v||(v=new qe(ke.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),a.push(new Ur(l+g.index,l+g.index+g[0].length,v))}}l=f}if(!r.validEnd){let u=r.fillBefore(ke.empty,!0);t.replace(l,l,new qe(u,0,0))}for(let u=a.length-1;u>=0;u--)t.step(a[u])}function jie(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Qd(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,i=0,s=0;;--r){let a=t.$from.node(r),l=t.$from.index(r)+i,u=t.$to.indexAfter(r)-s;if(r<t.depth&&a.canReplace(l,u,n))return r;if(r==0||a.type.spec.isolating||!jie(a,l,u))break;l&&(i=1),u<a.childCount&&(s=1)}return null}function $ie(t,e,n){let{$from:r,$to:i,depth:s}=e,a=r.before(s+1),l=i.after(s+1),u=a,d=l,f=ke.empty,p=0;for(let v=s,E=!1;v>n;v--)E||r.index(v)>0?(E=!0,f=ke.from(r.node(v).copy(f)),p++):u--;let g=ke.empty,b=0;for(let v=s,E=!1;v>n;v--)E||i.after(v+1)<i.end(v)?(E=!0,g=ke.from(i.node(v).copy(g)),b++):d++;t.step(new jr(u,d,a,l,new qe(f.append(g),p,b),f.size-p,!0))}function mx(t,e,n=null,r=t){let i=qie(t,e),s=i&&Vie(r,e);return s?i.map(fC).concat({type:e,attrs:n}).concat(s.map(fC)):null}function fC(t){return{type:t,attrs:null}}function qie(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.contentMatchAt(r).findWrapping(e);if(!s)return null;let a=s.length?s[0]:e;return n.canReplaceWith(r,i,a)?s:null}function Vie(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.child(r),a=e.contentMatch.findWrapping(s.type);if(!a)return null;let u=(a.length?a[a.length-1]:e).contentMatch;for(let d=r;u&&d<i;d++)u=u.matchType(n.child(d).type);return!u||!u.validEnd?null:a}function Gie(t,e,n){let r=ke.empty;for(let a=n.length-1;a>=0;a--){if(r.size){let l=n[a].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=ke.from(n[a].type.create(n[a].attrs,r))}let i=e.start,s=e.end;t.step(new jr(i,s,i,s,new qe(r,0,0),n.length,!0))}function Yie(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(a,l)=>{let u=typeof i=="function"?i(a):i;if(a.isTextblock&&!a.hasMarkup(r,u)&&Wie(t.doc,t.mapping.slice(s).map(l),r)){let d=null;if(r.schema.linebreakReplacement){let b=r.whitespace=="pre",v=!!r.contentMatch.matchType(r.schema.linebreakReplacement);b&&!v?d=!1:!b&&v&&(d=!0)}d===!1&&GR(t,a,l,s),px(t,t.mapping.slice(s).map(l,1),r,void 0,d===null);let f=t.mapping.slice(s),p=f.map(l,1),g=f.map(l+a.nodeSize,1);return t.step(new jr(p,g,p+1,g-1,new qe(ke.from(r.create(u,null,a.marks)),0,0),1,!0)),d===!0&&VR(t,a,l,s),!1}})}function VR(t,e,n,r){e.forEach((i,s)=>{if(i.isText){let a,l=/\r?\n|\r/g;for(;a=l.exec(i.text);){let u=t.mapping.slice(r).map(n+1+s+a.index);t.replaceWith(u,u+1,e.type.schema.linebreakReplacement.create())}}})}function GR(t,e,n,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let a=t.mapping.slice(r).map(n+1+s);t.replaceWith(a,a+1,e.type.schema.text(`
`))}})}function Wie(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function Kie(t,e,n,r,i){let s=t.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let a=n.create(r,null,i||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,a);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new jr(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new qe(ke.from(a),0,0),1,!0))}function ko(t,e,n=1,r){let i=t.resolve(e),s=i.depth-n,a=r&&r[r.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,f=n-2;d>s;d--,f--){let p=i.node(d),g=i.index(d);if(p.type.spec.isolating)return!1;let b=p.content.cutByIndex(g,p.childCount),v=r&&r[f+1];v&&(b=b.replaceChild(0,v.type.create(v.attrs)));let E=r&&r[f]||p;if(!p.canReplace(g+1,p.childCount)||!E.type.validContent(b))return!1}let l=i.indexAfter(s),u=r&&r[0];return i.node(s).canReplaceWith(l,l,u?u.type:i.node(s+1).type)}function Xie(t,e,n=1,r){let i=t.doc.resolve(e),s=ke.empty,a=ke.empty;for(let l=i.depth,u=i.depth-n,d=n-1;l>u;l--,d--){s=ke.from(i.node(l).copy(s));let f=r&&r[d];a=ke.from(f?f.type.create(f.attrs,a):i.node(l).copy(a))}t.step(new Ur(e,e,new qe(s.append(a),n,n),!0))}function ru(t,e){let n=t.resolve(e),r=n.index();return YR(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Qie(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i<e.childCount;i++){let s=e.child(i),a=s.type==r?t.type.schema.nodes.text:s.type;if(n=n.matchType(a),!n||!t.type.allowsMarks(s.marks))return!1}return n.validEnd}function YR(t,e){return!!(t&&e&&!t.isLeaf&&Qie(t,e))}function Lb(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let s,a,l=r.index(i);if(i==r.depth?(s=r.nodeBefore,a=r.nodeAfter):n>0?(s=r.node(i+1),l++,a=r.node(i).maybeChild(l)):(s=r.node(i).maybeChild(l-1),a=r.node(i+1)),s&&!s.isTextblock&&YR(s,a)&&r.node(i).canReplace(l,l+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function Zie(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,s=t.doc.resolve(e-n),a=s.node().type;if(i&&a.inlineContent){let f=a.whitespace=="pre",p=!!a.contentMatch.matchType(i);f&&!p?r=!1:!f&&p&&(r=!0)}let l=t.steps.length;if(r===!1){let f=t.doc.resolve(e+n);GR(t,f.node(),f.before(),l)}a.inlineContent&&px(t,e+n-1,a,s.node().contentMatchAt(s.index()),r==null);let u=t.mapping.slice(l),d=u.map(e-n);if(t.step(new Ur(d,u.map(e+n,-1),qe.empty,!0)),r===!0){let f=t.doc.resolve(d);VR(t,f.node(),f.before(),t.steps.length)}return t}function Jie(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let s=r.index(i);if(r.node(i).canReplaceWith(s,s,n))return r.before(i+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let s=r.indexAfter(i);if(r.node(i).canReplaceWith(s,s,n))return r.after(i+1);if(s<r.node(i).childCount)return null}return null}function WR(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let s=0;s<n.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(n.openStart==0&&n.size?2:1);s++)for(let a=r.depth;a>=0;a--){let l=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,u=r.index(a)+(l>0?1:0),d=r.node(a),f=!1;if(s==1)f=d.canReplace(u,u,i);else{let p=d.contentMatchAt(u).findWrapping(i.firstChild.type);f=p&&d.canReplaceWith(u,u,p[0])}if(f)return l==0?r.pos:l<0?r.before(a+1):r.after(a+1)}return null}function Pb(t,e,n=e,r=qe.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),s=t.resolve(n);return KR(i,s,r)?new Ur(e,n,r):new ese(i,s,r).fit()}function KR(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class ese{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=ke.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=ke.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let s=this.placed,a=r.depth,l=i.depth;for(;a&&l&&s.childCount==1;)s=s.firstChild.content,a--,l--;let u=new qe(s,a,l);return e>-1?new jr(r.pos,e,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new Ur(r.pos,i.pos,u):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let s=n.firstChild;if(n.childCount>1&&(i=0),s.type.spec.isolating&&i<=r){e=r;break}n=s.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,s=null;r?(s=gE(this.unplaced.content,r-1).firstChild,i=s.content):i=this.unplaced.content;let a=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:u,match:d}=this.frontier[l],f,p=null;if(n==1&&(a?d.matchType(a.type)||(p=d.fillBefore(ke.from(a),!1)):s&&u.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:l,parent:s,inject:p};if(n==2&&a&&(f=d.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:l,parent:s,wrap:f};if(s&&d.matchType(s.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=gE(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new qe(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=gE(e,n);if(i.childCount<=1&&n>0){let s=e.size-n<=n+i.size;this.unplaced=new qe(Ef(e,n-1,1),n-1,s?n-1:r)}else this.unplaced=new qe(Ef(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let E=0;E<s.length;E++)this.openFrontierNode(s[E]);let a=this.unplaced,l=r?r.content:a.content,u=a.openStart-e,d=0,f=[],{match:p,type:g}=this.frontier[n];if(i){for(let E=0;E<i.childCount;E++)f.push(i.child(E));p=p.matchFragment(i)}let b=l.size+e-(a.content.size-a.openEnd);for(;d<l.childCount;){let E=l.child(d),x=p.matchType(E.type);if(!x)break;d++,(d>1||u==0||E.content.size)&&(p=x,f.push(XR(E.mark(g.allowedMarks(E.marks)),d==1?u:0,d==l.childCount?b:-1)))}let v=d==l.childCount;v||(b=-1),this.placed=_f(this.placed,n,ke.from(f)),this.frontier[n].match=p,v&&b<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let E=0,x=l;E<b;E++){let S=x.lastChild;this.frontier.push({type:S.type,match:S.contentMatchAt(S.childCount)}),x=S.content}this.unplaced=v?e==0?qe.empty:new qe(Ef(a.content,e-1,1),e-1,b<0?a.openEnd:e-1):new qe(Ef(a.content,e,d),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!bE(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],s=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),a=bE(e,n,i,r,s);if(a){for(let l=n-1;l>=0;l--){let{match:u,type:d}=this.frontier[l],f=bE(e,l,d,u,!0);if(!f||f.childCount)continue e}return{depth:n,fit:a,move:s?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=_f(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=_f(this.placed,this.depth,ke.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(ke.empty,!0);n.childCount&&(this.placed=_f(this.placed,this.frontier.length,n))}}function Ef(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Ef(t.firstChild.content,e-1,n)))}function _f(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(_f(t.lastChild.content,e-1,n)))}function gE(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function XR(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,XR(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(ke.empty,!0)))),t.copy(r)}function bE(t,e,n,r,i){let s=t.node(e),a=i?t.indexAfter(e):t.index(e);if(a==s.childCount&&!n.compatibleContent(s.type))return null;let l=r.fillBefore(s.content,!0,a);return l&&!tse(n,s.content,a)?l:null}function tse(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function nse(t){return t.spec.defining||t.spec.definingForContent}function rse(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),s=t.doc.resolve(n);if(KR(i,s,r))return t.step(new Ur(e,n,r));let a=ZR(i,s);a[a.length-1]==0&&a.pop();let l=-(i.depth+1);a.unshift(l);for(let g=i.depth,b=i.pos-1;g>0;g--,b--){let v=i.node(g).type.spec;if(v.defining||v.definingAsContext||v.isolating)break;a.indexOf(g)>-1?l=g:i.before(g)==b&&a.splice(1,0,-g)}let u=a.indexOf(l),d=[],f=r.openStart;for(let g=r.content,b=0;;b++){let v=g.firstChild;if(d.push(v),b==r.openStart)break;g=v.content}for(let g=f-1;g>=0;g--){let b=d[g],v=nse(b.type);if(v&&!b.sameMarkup(i.node(Math.abs(l)-1)))f=g;else if(v||!b.type.isTextblock)break}for(let g=r.openStart;g>=0;g--){let b=(g+f+1)%(r.openStart+1),v=d[b];if(v)for(let E=0;E<a.length;E++){let x=a[(E+u)%a.length],S=!0;x<0&&(S=!1,x=-x);let C=i.node(x-1),O=i.index(x-1);if(C.canReplaceWith(O,O,v.type,v.marks))return t.replace(i.before(x),S?s.after(x):n,new qe(QR(r.content,0,r.openStart,b),b,r.openEnd))}}let p=t.steps.length;for(let g=a.length-1;g>=0&&(t.replace(e,n,r),!(t.steps.length>p));g--){let b=a[g];b<0||(e=i.before(b),n=s.after(b))}}function QR(t,e,n,r,i){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(QR(s.content,e+1,n,r,s)))}if(e>r){let s=i.contentMatchAt(0),a=s.fillBefore(t).append(t);t=a.append(s.matchFragment(a).fillBefore(ke.empty,!0))}return t}function ise(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=Jie(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new qe(ke.from(r),0,0))}function sse(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),s=ZR(r,i);for(let a=0;a<s.length;a++){let l=s[a],u=a==s.length-1;if(u&&l==0||r.node(l).type.contentMatch.validEnd)return t.delete(r.start(l),i.end(l));if(l>0&&(u||r.node(l-1).canReplace(r.index(l-1),i.indexAfter(l-1))))return t.delete(r.before(l),i.after(l))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(e-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return t.delete(r.before(a),n);t.delete(e,n)}function ZR(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let s=t.start(i);if(s<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&n.push(i)}return n}class vd extends fi{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return wr.fail("No node at attribute step's position");let r=Object.create(null);for(let s in n.attrs)r[s]=n.attrs[s];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return wr.fromReplace(e,this.pos,this.pos+1,new qe(ke.from(i),0,n.isLeaf?0:1))}getMap(){return ls.empty}invert(e){return new vd(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new vd(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new vd(n.pos,n.attr,n.value)}}fi.jsonID("attr",vd);class gh extends fi{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return wr.ok(r)}getMap(){return ls.empty}invert(e){return new gh(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new gh(n.attr,n.value)}}fi.jsonID("docAttr",gh);let Cd=class extends Error{};Cd=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Cd.prototype=Object.create(Error.prototype);Cd.prototype.constructor=Cd;Cd.prototype.name="TransformError";class JR{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new mh}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Cd(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let i=this.mapping.maps[r];r&&(e=i.map(e,1),n=i.map(n,-1)),i.forEach((s,a,l,u)=>{e=Math.min(e,l),n=Math.max(n,u)})}return e==1e9?null:{from:e,to:n}}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=qe.empty){let i=Pb(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new qe(ke.from(r),0,0))}delete(e,n){return this.replace(e,n,qe.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return rse(this,e,n,r),this}replaceRangeWith(e,n,r){return ise(this,e,n,r),this}deleteRange(e,n){return sse(this,e,n),this}lift(e,n){return $ie(this,e,n),this}join(e,n=1){return Zie(this,e,n),this}wrap(e,n){return Gie(this,e,n),this}setBlockType(e,n=e,r,i=null){return Yie(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return Kie(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new vd(e,n,r)),this}setDocAttribute(e,n){return this.step(new gh(e,n)),this}addNodeMark(e,n){return this.step(new zl(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof xn)n.isInSet(r.marks)&&this.step(new Xu(e,n));else{let i=r.marks,s,a=[];for(;s=n.isInSet(i);)a.push(new Xu(e,s)),i=s.removeFromSet(i);for(let l=a.length-1;l>=0;l--)this.step(a[l])}return this}split(e,n=1,r){return Xie(this,e,n,r),this}addMark(e,n,r){return Fie(this,e,n,r),this}removeMark(e,n,r){return Hie(this,e,n,r),this}clearIncompatible(e,n,r){return px(this,e,n,r),this}}const vE=Object.create(null);class vt{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new eD(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=qe.empty){let r=n.content.lastChild,i=null;for(let l=0;l<n.openEnd;l++)i=r,r=r.lastChild;let s=e.steps.length,a=this.ranges;for(let l=0;l<a.length;l++){let{$from:u,$to:d}=a[l],f=e.mapping.slice(s);e.replaceRange(f.map(u.pos),f.map(d.pos),l?qe.empty:n),l==0&&mC(e,s,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:a,$to:l}=i[s],u=e.mapping.slice(r),d=u.map(a.pos),f=u.map(l.pos);s?e.deleteRange(d,f):(e.replaceRangeWith(d,f,n),mC(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new Et(e):ad(e.node(0),e.parent,e.pos,e.index(),n,r);if(i)return i;for(let s=e.depth-1;s>=0;s--){let a=n<0?ad(e.node(0),e.node(s),e.before(s+1),e.index(s),n,r):ad(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,n,r);if(a)return a}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new fs(e.node(0))}static atStart(e){return ad(e,e,0,0,1)||new fs(e)}static atEnd(e){return ad(e,e,e.content.size,e.childCount,-1)||new fs(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=vE[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in vE)throw new RangeError("Duplicate use of selection JSON ID "+e);return vE[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Et.between(this.$anchor,this.$head).getBookmark()}}vt.prototype.visible=!0;class eD{constructor(e,n){this.$from=e,this.$to=n}}let hC=!1;function pC(t){!hC&&!t.parent.inlineContent&&(hC=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Et extends vt{constructor(e,n=e){pC(e),pC(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return vt.near(r);let i=e.resolve(n.map(this.anchor));return new Et(i.parent.inlineContent?i:r,r)}replace(e,n=qe.empty){if(super.replace(e,n),n==qe.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Et&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Bb(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Et(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let s=vt.findFrom(n,r,!0)||vt.findFrom(n,-r,!0);if(s)n=s.$head;else return vt.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(vt.findFrom(e,-r,!0)||vt.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new Et(e,n)}}vt.jsonID("text",Et);class Bb{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Bb(e.map(this.anchor),e.map(this.head))}resolve(e){return Et.between(e.resolve(this.anchor),e.resolve(this.head))}}class ct extends vt{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),s=e.resolve(i);return r?vt.near(s):new ct(s)}content(){return new qe(ke.from(this.node),0,0)}eq(e){return e instanceof ct&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new gx(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ct(e.resolve(n.anchor))}static create(e,n){return new ct(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}ct.prototype.visible=!1;vt.jsonID("node",ct);class gx{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Bb(r,r):new gx(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&ct.isSelectable(r)?new ct(n):vt.near(n)}}class fs extends vt{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=qe.empty){if(n==qe.empty){e.delete(0,e.doc.content.size);let r=vt.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new fs(e)}map(e){return new fs(e)}eq(e){return e instanceof fs}getBookmark(){return ase}}vt.jsonID("all",fs);const ase={map(){return this},resolve(t){return new fs(t)}};function ad(t,e,n,r,i,s=!1){if(e.inlineContent)return Et.create(t,n);for(let a=r-(i>0?0:1);i>0?a<e.childCount:a>=0;a+=i){let l=e.child(a);if(l.isAtom){if(!s&&ct.isSelectable(l))return ct.create(t,n-(i<0?l.nodeSize:0))}else{let u=ad(t,l,n+i,i<0?l.childCount:0,i,s);if(u)return u}n+=l.nodeSize*i}return null}function mC(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof Ur||i instanceof jr))return;let s=t.mapping.maps[r],a;s.forEach((l,u,d,f)=>{a==null&&(a=f)}),t.setSelection(vt.near(t.doc.resolve(a),n))}const gC=1,Ym=2,bC=4;class ose extends JR{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|gC)&~Ym,this.storedMarks=null,this}get selectionSet(){return(this.updated&gC)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Ym,this}ensureMarks(e){return xn.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Ym)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Ym,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||xn.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),!e)return this.deleteRange(n,r);let s=this.storedMarks;if(!s){let a=this.doc.resolve(n);s=r==n?a.marks():a.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,s)),!this.selection.empty&&this.selection.to==n+e.length&&this.setSelection(vt.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=bC,this}get scrolledIntoView(){return(this.updated&bC)>0}}function vC(t,e){return!e||!t?t:t.bind(e)}class xf{constructor(e,n,r){this.name=e,this.init=vC(n.init,r),this.apply=vC(n.apply,r)}}const lse=[new xf("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new xf("selection",{init(t,e){return t.selection||vt.atStart(e.doc)},apply(t){return t.selection}}),new xf("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new xf("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class yE{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=lse.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new xf(r.key,r.spec.state,r))})}}class fd{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let s=!1;for(let a=0;a<this.config.plugins.length;a++){let l=this.config.plugins[a];if(l.spec.appendTransaction){let u=i?i[a].n:0,d=i?i[a].state:this,f=u<n.length&&l.spec.appendTransaction.call(l,u?n.slice(u):n,d,r);if(f&&r.filterTransaction(f,a)){if(f.setMeta("appendedTransaction",e),!i){i=[];for(let p=0;p<this.config.plugins.length;p++)i.push(p<a?{state:r,n:n.length}:{state:this,n:0})}n.push(f),r=r.applyInner(f),s=!0}i&&(i[a]={state:r,n:n.length})}}if(!s)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new fd(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let s=r[i];n[s.name]=s.apply(e,this[s.name],this,n)}return n}get tr(){return new ose(this)}static create(e){let n=new yE(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new fd(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}reconfigure(e){let n=new yE(this.schema,e.plugins),r=n.fields,i=new fd(n);for(let s=0;s<r.length;s++){let a=r[s].name;i[a]=this.hasOwnProperty(a)?this[a]:r[s].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],s=i.spec.state;s&&s.toJSON&&(n[r]=s.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new yE(e.schema,e.plugins),s=new fd(i);return i.fields.forEach(a=>{if(a.name=="doc")s.doc=Hl.fromJSON(e.schema,n.doc);else if(a.name=="selection")s.selection=vt.fromJSON(s.doc,n.selection);else if(a.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let u=r[l],d=u.spec.state;if(u.key==a.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){s[a.name]=d.fromJSON.call(u,e,n[l],s);return}}s[a.name]=a.init(e,s)}}),s}}function tD(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=tD(i,e,{})),n[r]=i}return n}class zn{constructor(e){this.spec=e,this.props={},e.props&&tD(e.props,this,this.props),this.key=e.key?e.key.key:nD("plugin")}getState(e){return e[this.key]}}const EE=Object.create(null);function nD(t){return t in EE?t+"$"+ ++EE[t]:(EE[t]=0,t+"$")}class Vn{constructor(e="key"){this.key=nD(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const bx=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function rD(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const iD=(t,e,n)=>{let r=rD(t,n);if(!r)return!1;let i=vx(r);if(!i){let a=r.blockRange(),l=a&&Qd(a);return l==null?!1:(e&&e(t.tr.lift(a,l).scrollIntoView()),!0)}let s=i.nodeBefore;if(hD(t,i,e,-1))return!0;if(r.parent.content.size==0&&(Ad(s,"end")||ct.isSelectable(s)))for(let a=r.depth;;a--){let l=Pb(t.doc,r.before(a),r.after(a),qe.empty);if(l&&l.slice.size<l.to-l.from){if(e){let u=t.tr.step(l);u.setSelection(Ad(s,"end")?vt.findFrom(u.doc.resolve(u.mapping.map(i.pos,-1)),-1):ct.create(u.doc,i.pos-s.nodeSize)),e(u.scrollIntoView())}return!0}if(a==1||r.node(a-1).childCount>1)break}return s.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},use=(t,e,n)=>{let r=rD(t,n);if(!r)return!1;let i=vx(r);return i?sD(t,i,e):!1},cse=(t,e,n)=>{let r=oD(t,n);if(!r)return!1;let i=yx(r);return i?sD(t,i,e):!1};function sD(t,e,n){let r=e.nodeBefore,i=r,s=e.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let f=i.lastChild;if(!f)return!1;i=f}let a=e.nodeAfter,l=a,u=e.pos+1;for(;!l.isTextblock;u++){if(l.type.spec.isolating)return!1;let f=l.firstChild;if(!f)return!1;l=f}let d=Pb(t.doc,s,u,qe.empty);if(!d||d.from!=s||d instanceof Ur&&d.slice.size>=u-s)return!1;if(n){let f=t.tr.step(d);f.setSelection(Et.create(f.doc,s)),n(f.scrollIntoView())}return!0}function Ad(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const aD=(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;s=vx(r)}let a=s&&s.nodeBefore;return!a||!ct.isSelectable(a)?!1:(e&&e(t.tr.setSelection(ct.create(t.doc,s.pos-a.nodeSize)).scrollIntoView()),!0)};function vx(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function oD(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const lD=(t,e,n)=>{let r=oD(t,n);if(!r)return!1;let i=yx(r);if(!i)return!1;let s=i.nodeAfter;if(hD(t,i,e,1))return!0;if(r.parent.content.size==0&&(Ad(s,"start")||ct.isSelectable(s))){let a=Pb(t.doc,r.before(),r.after(),qe.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(Ad(s,"start")?vt.findFrom(l.doc.resolve(l.mapping.map(i.pos)),1):ct.create(l.doc,l.mapping.map(i.pos))),e(l.scrollIntoView())}return!0}}return s.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},uD=(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;s=yx(r)}let a=s&&s.nodeAfter;return!a||!ct.isSelectable(a)?!1:(e&&e(t.tr.setSelection(ct.create(t.doc,s.pos)).scrollIntoView()),!0)};function yx(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const dse=(t,e)=>{let n=t.selection,r=n instanceof ct,i;if(r){if(n.node.isTextblock||!ru(t.doc,n.from))return!1;i=n.from}else if(i=Lb(t.doc,n.from,-1),i==null)return!1;if(e){let s=t.tr.join(i);r&&s.setSelection(ct.create(s.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},fse=(t,e)=>{let n=t.selection,r;if(n instanceof ct){if(n.node.isTextblock||!ru(t.doc,n.to))return!1;r=n.to}else if(r=Lb(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},hse=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),s=i&&Qd(i);return s==null?!1:(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)},cD=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
`).scrollIntoView()),!0)};function Ex(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const pse=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),s=n.indexAfter(-1),a=Ex(i.contentMatchAt(s));if(!a||!i.canReplaceWith(s,s,a))return!1;if(e){let l=n.after(),u=t.tr.replaceWith(l,l,a.createAndFill());u.setSelection(vt.near(u.doc.resolve(l),1)),e(u.scrollIntoView())}return!0},dD=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof fs||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=Ex(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let a=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,l=t.tr.insert(a,s.createAndFill());l.setSelection(Et.create(l.doc,a+1)),e(l.scrollIntoView())}return!0},fD=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let s=n.before();if(ko(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Qd(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function mse(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof ct&&e.selection.node.isBlock)return!r.parentOffset||!ko(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let s=[],a,l,u=!1,d=!1;for(let b=r.depth;;b--)if(r.node(b).isBlock){u=r.end(b)==r.pos+(r.depth-b),d=r.start(b)==r.pos-(r.depth-b),l=Ex(r.node(b-1).contentMatchAt(r.indexAfter(b-1))),s.unshift(u&&l?{type:l}:null),a=b;break}else{if(b==1)return!1;s.unshift(null)}let f=e.tr;(e.selection instanceof Et||e.selection instanceof fs)&&f.deleteSelection();let p=f.mapping.map(r.pos),g=ko(f.doc,p,s.length,s);if(g||(s[0]=l?{type:l}:null,g=ko(f.doc,p,s.length,s)),!g)return!1;if(f.split(p,s.length,s),!u&&d&&r.node(a).type!=l){let b=f.mapping.map(r.before(a)),v=f.doc.resolve(b);l&&r.node(a-1).canReplaceWith(v.index(),v.index()+1,l)&&f.setNodeMarkup(f.mapping.map(r.before(a)),l)}return n&&n(f.scrollIntoView()),!0}}const gse=mse(),bse=(t,e)=>{let{$from:n,to:r}=t.selection,i,s=n.sharedDepth(r);return s==0?!1:(i=n.before(s),e&&e(t.tr.setSelection(ct.create(t.doc,i))),!0)};function vse(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,s=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||ru(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function hD(t,e,n,r){let i=e.nodeBefore,s=e.nodeAfter,a,l,u=i.type.spec.isolating||s.type.spec.isolating;if(!u&&vse(t,e,n))return!0;let d=!u&&e.parent.canReplace(e.index(),e.index()+1);if(d&&(a=(l=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&l.matchType(a[0]||s.type).validEnd){if(n){let b=e.pos+s.nodeSize,v=ke.empty;for(let S=a.length-1;S>=0;S--)v=ke.from(a[S].create(null,v));v=ke.from(i.copy(v));let E=t.tr.step(new jr(e.pos-1,b,e.pos,b,new qe(v,1,0),a.length,!0)),x=E.doc.resolve(b+2*a.length);x.nodeAfter&&x.nodeAfter.type==i.type&&ru(E.doc,x.pos)&&E.join(x.pos),n(E.scrollIntoView())}return!0}let f=s.type.spec.isolating||r>0&&u?null:vt.findFrom(e,1),p=f&&f.$from.blockRange(f.$to),g=p&&Qd(p);if(g!=null&&g>=e.depth)return n&&n(t.tr.lift(p,g).scrollIntoView()),!0;if(d&&Ad(s,"start",!0)&&Ad(i,"end")){let b=i,v=[];for(;v.push(b),!b.isTextblock;)b=b.lastChild;let E=s,x=1;for(;!E.isTextblock;E=E.firstChild)x++;if(b.canReplace(b.childCount,b.childCount,E.content)){if(n){let S=ke.empty;for(let O=v.length-1;O>=0;O--)S=ke.from(v[O].copy(S));let C=t.tr.step(new jr(e.pos-v.length,e.pos+s.nodeSize,e.pos+x,e.pos+s.nodeSize-x,new qe(S,v.length,0),0,!0));n(C.scrollIntoView())}return!0}}return!1}function pD(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(n&&n(e.tr.setSelection(Et.create(e.doc,t<0?i.start(s):i.end(s)))),!0):!1}}const yse=pD(-1),Ese=pD(1);function _se(t,e=null){return function(n,r){let{$from:i,$to:s}=n.selection,a=i.blockRange(s),l=a&&mx(a,t,e);return l?(r&&r(n.tr.wrap(a,l).scrollIntoView()),!0):!1}}function yC(t,e=null){return function(n,r){let i=!1;for(let s=0;s<n.selection.ranges.length&&!i;s++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[s];n.doc.nodesBetween(a,l,(u,d)=>{if(i)return!1;if(!(!u.isTextblock||u.hasMarkup(t,e)))if(u.type==t)i=!0;else{let f=n.doc.resolve(d),p=f.index();i=f.parent.canReplaceWith(p,p+1,t)}})}if(!i)return!1;if(r){let s=n.tr;for(let a=0;a<n.selection.ranges.length;a++){let{$from:{pos:l},$to:{pos:u}}=n.selection.ranges[a];s.setBlockType(l,u,t,e)}r(s.scrollIntoView())}return!0}}function _x(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}_x(bx,iD,aD);_x(bx,lD,uD);_x(cD,dD,fD,gse);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function xse(t,e=null){return function(n,r){let{$from:i,$to:s}=n.selection,a=i.blockRange(s);if(!a)return!1;let l=r?n.tr:null;return Tse(l,a,t,e)?(r&&r(l.scrollIntoView()),!0):!1}}function Tse(t,e,n,r=null){let i=!1,s=e,a=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let u=a.resolve(e.start-2);s=new n1(u,u,e.depth),e.endIndex<e.parent.childCount&&(e=new n1(e.$from,a.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let l=mx(s,n,r,e);return l?(t&&Sse(t,e,l,i,n),!0):!1}function Sse(t,e,n,r,i){let s=ke.empty;for(let f=n.length-1;f>=0;f--)s=ke.from(n[f].type.create(n[f].attrs,s));t.step(new jr(e.start-(r?2:0),e.end,e.start,e.end,new qe(s,0,0),n.length,!0));let a=0;for(let f=0;f<n.length;f++)n[f].type==i&&(a=f+1);let l=n.length-a,u=e.start+n.length-(r?2:0),d=e.parent;for(let f=e.startIndex,p=e.endIndex,g=!0;f<p;f++,g=!1)!g&&ko(t.doc,u,l)&&(t.split(u,l),u+=2*l),u+=d.child(f).nodeSize;return t}function wse(t){return function(e,n){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,a=>a.childCount>0&&a.firstChild.type==t);return s?n?r.node(s.depth-1).type==t?kse(e,n,t,s):Cse(e,n,s):!0:!1}}function kse(t,e,n,r){let i=t.tr,s=r.end,a=r.$to.end(r.depth);s<a&&(i.step(new jr(s-1,a,s,a,new qe(ke.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new n1(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const l=Qd(r);if(l==null)return!1;i.lift(r,l);let u=i.doc.resolve(i.mapping.map(s,-1)-1);return ru(i.doc,u.pos)&&u.nodeBefore.type==u.nodeAfter.type&&i.join(u.pos),e(i.scrollIntoView()),!0}function Cse(t,e,n){let r=t.tr,i=n.parent;for(let b=n.end,v=n.endIndex-1,E=n.startIndex;v>E;v--)b-=i.child(v).nodeSize,r.delete(b-1,b+1);let s=r.doc.resolve(n.start),a=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,u=n.endIndex==i.childCount,d=s.node(-1),f=s.index(-1);if(!d.canReplace(f+(l?0:1),f+1,a.content.append(u?ke.empty:ke.from(i))))return!1;let p=s.pos,g=p+a.nodeSize;return r.step(new jr(p-(l?1:0),g+(u?1:0),p+1,g-1,new qe((l?ke.empty:ke.from(i.copy(ke.empty))).append(u?ke.empty:ke.from(i.copy(ke.empty))),l?0:1,u?0:1),l?0:1)),e(r.scrollIntoView()),!0}function Ase(t){return function(e,n){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,d=>d.childCount>0&&d.firstChild.type==t);if(!s)return!1;let a=s.startIndex;if(a==0)return!1;let l=s.parent,u=l.child(a-1);if(u.type!=t)return!1;if(n){let d=u.lastChild&&u.lastChild.type==l.type,f=ke.from(d?t.create():null),p=new qe(ke.from(t.create(null,ke.from(l.type.create(null,f)))),d?3:1,0),g=s.start,b=s.end;n(e.tr.step(new jr(g-(d?3:1),b,g,b,p,1,!0)).scrollIntoView())}return!0}}const Qr=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Nd=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let i3=null;const co=function(t,e,n){let r=i3||(i3=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},Nse=function(){i3=null},Qu=function(t,e,n,r){return n&&(EC(t,e,n,r,-1)||EC(t,e,n,r,1))},Ose=/^(img|br|input|textarea|hr)$/i;function EC(t,e,n,r,i){for(var s;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Rs(t))){let a=t.parentNode;if(!a||a.nodeType!=1||Kh(t)||Ose.test(t.nodeName)||t.contentEditable=="false")return!1;e=Qr(t)+(i<0?0:1),t=a}else if(t.nodeType==1){let a=t.childNodes[e+(i<0?-1:0)];if(a.nodeType==1&&a.contentEditable=="false")if(!((s=a.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)e+=i;else return!1;else t=a,e=i<0?Rs(t):0}else return!1}}function Rs(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Mse(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Rs(t)}else if(t.parentNode&&!Kh(t))e=Qr(t),t=t.parentNode;else return null}}function Rse(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!Kh(t))e=Qr(t)+1,t=t.parentNode;else return null}}function Dse(t,e,n){for(let r=e==0,i=e==Rs(t);r||i;){if(t==n)return!0;let s=Qr(t);if(t=t.parentNode,!t)return!1;r=r&&s==0,i=i&&s==Rs(t)}}function Kh(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const zb=function(t){return t.focusNode&&Qu(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Lu(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function Ise(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Lse(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Rs(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Rs(r.startContainer),r.startOffset)}}}const wa=typeof navigator<"u"?navigator:null,_C=typeof document<"u"?document:null,iu=wa&&wa.userAgent||"",s3=/Edge\/(\d+)/.exec(iu),mD=/MSIE \d/.exec(iu),a3=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(iu),Gi=!!(mD||a3||s3),jl=mD?document.documentMode:a3?+a3[1]:s3?+s3[1]:0,Is=!Gi&&/gecko\/(\d+)/i.test(iu);Is&&+(/Firefox\/(\d+)/.exec(iu)||[0,0])[1];const o3=!Gi&&/Chrome\/(\d+)/.exec(iu),Hr=!!o3,gD=o3?+o3[1]:0,ei=!Gi&&!!wa&&/Apple Computer/.test(wa.vendor),Od=ei&&(/Mobile\/\w+/.test(iu)||!!wa&&wa.maxTouchPoints>2),Ns=Od||(wa?/Mac/.test(wa.platform):!1),bD=wa?/Win/.test(wa.platform):!1,Eo=/Android \d/.test(iu),Xh=!!_C&&"webkitFontSmoothing"in _C.documentElement.style,Pse=Xh?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Bse(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function ro(t,e){return typeof t=="number"?t:t[e]}function zse(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function xC(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let a=n||t.dom;a;){if(a.nodeType!=1){a=Nd(a);continue}let l=a,u=l==s.body,d=u?Bse(s):zse(l),f=0,p=0;if(e.top<d.top+ro(r,"top")?p=-(d.top-e.top+ro(i,"top")):e.bottom>d.bottom-ro(r,"bottom")&&(p=e.bottom-e.top>d.bottom-d.top?e.top+ro(i,"top")-d.top:e.bottom-d.bottom+ro(i,"bottom")),e.left<d.left+ro(r,"left")?f=-(d.left-e.left+ro(i,"left")):e.right>d.right-ro(r,"right")&&(f=e.right-d.right+ro(i,"right")),f||p)if(u)s.defaultView.scrollBy(f,p);else{let b=l.scrollLeft,v=l.scrollTop;p&&(l.scrollTop+=p),f&&(l.scrollLeft+=f);let E=l.scrollLeft-b,x=l.scrollTop-v;e={left:e.left-E,top:e.top-x,right:e.right-E,bottom:e.bottom-x}}let g=u?"fixed":getComputedStyle(a).position;if(/^(fixed|sticky)$/.test(g))break;a=g=="absolute"?a.offsetParent:Nd(a)}}function Use(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let s=(e.left+e.right)/2,a=n+1;a<Math.min(innerHeight,e.bottom);a+=5){let l=t.root.elementFromPoint(s,a);if(!l||l==t.dom||!t.dom.contains(l))continue;let u=l.getBoundingClientRect();if(u.top>=n-20){r=l,i=u.top;break}}return{refDOM:r,refTop:i,stack:vD(t.dom)}}function vD(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Nd(r));return e}function Fse({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;yD(n,r==0?0:r-e)}function yD(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:s}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=s&&(r.scrollLeft=s)}}let Qc=null;function Hse(t){if(t.setActive)return t.setActive();if(Qc)return t.focus(Qc);let e=vD(t);t.focus(Qc==null?{get preventScroll(){return Qc={preventScroll:!0},!0}}:void 0),Qc||(Qc=!1,yD(e,0))}function ED(t,e){let n,r=2e8,i,s=0,a=e.top,l=e.top,u,d;for(let f=t.firstChild,p=0;f;f=f.nextSibling,p++){let g;if(f.nodeType==1)g=f.getClientRects();else if(f.nodeType==3)g=co(f).getClientRects();else continue;for(let b=0;b<g.length;b++){let v=g[b];if(v.top<=a&&v.bottom>=l){a=Math.max(v.bottom,a),l=Math.min(v.top,l);let E=v.left>e.left?v.left-e.left:v.right<e.left?e.left-v.right:0;if(E<r){n=f,r=E,i=E&&n.nodeType==3?{left:v.right<e.left?v.right:v.left,top:e.top}:e,f.nodeType==1&&E&&(s=p+(e.left>=(v.left+v.right)/2?1:0));continue}}else v.top>e.top&&!u&&v.left<=e.left&&v.right>=e.left&&(u=f,d={left:Math.max(v.left,Math.min(v.right,e.left)),top:v.top});!n&&(e.left>=v.right&&e.top>=v.top||e.left>=v.left&&e.top>=v.bottom)&&(s=p+1)}}return!n&&u&&(n=u,i=d,r=0),n&&n.nodeType==3?jse(n,i):!n||r&&n.nodeType==1?{node:t,offset:s}:ED(n,i)}function jse(t,e){let n=t.nodeValue.length,r=document.createRange(),i;for(let s=0;s<n;s++){r.setEnd(t,s+1),r.setStart(t,s);let a=kl(r,1);if(a.top!=a.bottom&&xx(e,a)){i={node:t,offset:s+(e.left>=(a.left+a.right)/2?1:0)};break}}return r.detach(),i||{node:t,offset:0}}function xx(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function $se(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function qse(t,e,n){let{node:r,offset:i}=ED(e,n),s=-1;if(r.nodeType==1&&!r.firstChild){let a=r.getBoundingClientRect();s=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return t.docView.posFromDOM(r,i,s)}function Vse(t,e,n,r){let i=-1;for(let s=e,a=!1;s!=t.dom;){let l=t.docView.nearestDesc(s,!0),u;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((u=l.dom.getBoundingClientRect()).width||u.height)&&(l.node.isBlock&&l.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(l.dom.nodeName)&&(!a&&u.left>r.left||u.top>r.top?i=l.posBefore:(!a&&u.right<r.left||u.bottom<r.top)&&(i=l.posAfter),a=!0),!l.contentDOM&&i<0&&!l.node.isText))return(l.node.isBlock?r.top<(u.top+u.bottom)/2:r.left<(u.left+u.right)/2)?l.posBefore:l.posAfter;s=l.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function _D(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),s=i;;){let a=t.childNodes[s];if(a.nodeType==1){let l=a.getClientRects();for(let u=0;u<l.length;u++){let d=l[u];if(xx(e,d))return _D(a,e,d)}}if((s=(s+1)%r)==i)break}return t}function Gse(t,e){let n=t.dom.ownerDocument,r,i=0,s=Lse(n,e.left,e.top);s&&({node:r,offset:i}=s);let a=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),l;if(!a||!t.dom.contains(a.nodeType!=1?a.parentNode:a)){let d=t.dom.getBoundingClientRect();if(!xx(e,d)||(a=_D(t.dom,e,d),!a))return null}if(ei)for(let d=a;r&&d;d=Nd(d))d.draggable&&(r=void 0);if(a=$se(a,e),r){if(Is&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let f=r.childNodes[i],p;f.nodeName=="IMG"&&(p=f.getBoundingClientRect()).right<=e.left&&p.bottom>e.top&&i++}let d;Xh&&i&&r.nodeType==1&&(d=r.childNodes[i-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(l=Vse(t,r,i,e))}l==null&&(l=qse(t,a,e));let u=t.docView.nearestDesc(a,!0);return{pos:l,inside:u?u.posAtStart-u.border:-1}}function TC(t){return t.top<t.bottom||t.left<t.right}function kl(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(TC(r))return r}return Array.prototype.find.call(n,TC)||t.getBoundingClientRect()}const Yse=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function xD(t,e,n){let{node:r,offset:i,atom:s}=t.docView.domFromPos(e,n<0?-1:1),a=Xh||Is;if(r.nodeType==3)if(a&&(Yse.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let u=kl(co(r,i,i),n);if(Is&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let d=kl(co(r,i-1,i-1),-1);if(d.top==u.top){let f=kl(co(r,i,i+1),-1);if(f.top!=u.top)return sf(f,f.left<d.left)}}return u}else{let u=i,d=i,f=n<0?1:-1;return n<0&&!i?(d++,f=-1):n>=0&&i==r.nodeValue.length?(u--,f=1):n<0?u--:d++,sf(kl(co(r,u,d),f),f<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(n<0||i==Rs(r))){let u=r.childNodes[i-1];if(u.nodeType==1)return _E(u.getBoundingClientRect(),!1)}if(s==null&&i<Rs(r)){let u=r.childNodes[i];if(u.nodeType==1)return _E(u.getBoundingClientRect(),!0)}return _E(r.getBoundingClientRect(),n>=0)}if(s==null&&i&&(n<0||i==Rs(r))){let u=r.childNodes[i-1],d=u.nodeType==3?co(u,Rs(u)-(a?0:1)):u.nodeType==1&&(u.nodeName!="BR"||!u.nextSibling)?u:null;if(d)return sf(kl(d,1),!1)}if(s==null&&i<Rs(r)){let u=r.childNodes[i];for(;u.pmViewDesc&&u.pmViewDesc.ignoreForCoords;)u=u.nextSibling;let d=u?u.nodeType==3?co(u,0,a?0:1):u.nodeType==1?u:null:null;if(d)return sf(kl(d,-1),!0)}return sf(kl(r.nodeType==3?co(r):r,-n),n>=0)}function sf(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function _E(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function TD(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function Wse(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return TD(t,e,()=>{let{node:s}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(s,!0);if(!l)break;if(l.node.isBlock){s=l.contentDOM||l.dom;break}s=l.dom.parentNode}let a=xD(t,i.pos,1);for(let l=s.firstChild;l;l=l.nextSibling){let u;if(l.nodeType==1)u=l.getClientRects();else if(l.nodeType==3)u=co(l,0,l.nodeValue.length).getClientRects();else continue;for(let d=0;d<u.length;d++){let f=u[d];if(f.bottom>f.top+1&&(n=="up"?a.top-f.top>(f.bottom-a.top)*2:f.bottom-a.bottom>(a.bottom-f.top)*2))return!1}}return!0})}const Kse=/[\u0590-\u08ac]/;function Xse(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,s=!i,a=i==r.parent.content.size,l=t.domSelection();return l?!Kse.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?s:a:TD(t,e,()=>{let{focusNode:u,focusOffset:d,anchorNode:f,anchorOffset:p}=t.domSelectionRange(),g=l.caretBidiLevel;l.modify("move",n,"character");let b=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:v,focusOffset:E}=t.domSelectionRange(),x=v&&!b.contains(v.nodeType==1?v:v.parentNode)||u==v&&d==E;try{l.collapse(f,p),u&&(u!=f||d!=p)&&l.extend&&l.extend(u,d)}catch{}return g!=null&&(l.caretBidiLevel=g),x}):r.pos==r.start()||r.pos==r.end()}let SC=null,wC=null,kC=!1;function Qse(t,e,n){return SC==e&&wC==n?kC:(SC=e,wC=n,kC=n=="up"||n=="down"?Wse(t,e,n):Xse(t,e,n))}const Ls=0,CC=1,Pu=2,ka=3;class Qh{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Ls,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let s,a;if(e==this.contentDOM)s=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((a=s.pmViewDesc)&&a.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(a)+a.size:this.posAtStart}else{let s,a;if(e==this.contentDOM)s=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((a=s.pmViewDesc)&&a.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(a):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>Qr(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let s=this.getDesc(i),a;if(s&&(!n||s.node))if(r&&(a=s.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))r=!1;else return s}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],s=r+i.size;if(r==e&&s!=r){for(;!i.border&&i.children.length;)for(let a=0;a<i.children.length;a++){let l=i.children[a];if(l.size){i=l;break}}return i}if(e<s)return i.descAt(e-r-i.border);r=s}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let s=0;r<this.children.length;r++){let a=this.children[r],l=s+a.size;if(l>e||a instanceof wD){i=e-s;break}s=l}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof SD&&s.side>=0;r--);if(n<=0){let s,a=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,a=!1);return s&&n&&a&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?Qr(s.dom)+1:0}}else{let s,a=!0;for(;s=r<this.children.length?this.children[r]:null,!(!s||s.dom.parentNode==this.contentDOM);r++,a=!1);return s&&a&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?Qr(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,s=-1;for(let a=r,l=0;;l++){let u=this.children[l],d=a+u.size;if(i==-1&&e<=d){let f=a+u.border;if(e>=f&&n<=d-u.border&&u.node&&u.contentDOM&&this.contentDOM.contains(u.contentDOM))return u.parseRange(e,n,f);e=a;for(let p=l;p>0;p--){let g=this.children[p-1];if(g.size&&g.dom.parentNode==this.contentDOM&&!g.emptyChildAt(1)){i=Qr(g.dom)+1;break}e-=g.size}i==-1&&(i=0)}if(i>-1&&(d>n||l==this.children.length-1)){n=d;for(let f=l+1;f<this.children.length;f++){let p=this.children[f];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(-1)){s=Qr(p.dom);break}n+=p.size}s==-1&&(s=this.contentDOM.childNodes.length);break}a=d}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,i=!1){let s=Math.min(e,n),a=Math.max(e,n);for(let b=0,v=0;b<this.children.length;b++){let E=this.children[b],x=v+E.size;if(s>v&&a<x)return E.setSelection(e-v-E.border,n-v-E.border,r,i);v=x}let l=this.domFromPos(e,e?-1:1),u=n==e?l:this.domFromPos(n,n?-1:1),d=r.root.getSelection(),f=r.domSelectionRange(),p=!1;if((Is||ei)&&e==n){let{node:b,offset:v}=l;if(b.nodeType==3){if(p=!!(v&&b.nodeValue[v-1]==`
`),p&&v==b.nodeValue.length)for(let E=b,x;E;E=E.parentNode){if(x=E.nextSibling){x.nodeName=="BR"&&(l=u={node:x.parentNode,offset:Qr(x)+1});break}let S=E.pmViewDesc;if(S&&S.node&&S.node.isBlock)break}}else{let E=b.childNodes[v-1];p=E&&(E.nodeName=="BR"||E.contentEditable=="false")}}if(Is&&f.focusNode&&f.focusNode!=u.node&&f.focusNode.nodeType==1){let b=f.focusNode.childNodes[f.focusOffset];b&&b.contentEditable=="false"&&(i=!0)}if(!(i||p&&ei)&&Qu(l.node,l.offset,f.anchorNode,f.anchorOffset)&&Qu(u.node,u.offset,f.focusNode,f.focusOffset))return;let g=!1;if((d.extend||e==n)&&!(p&&Is)){d.collapse(l.node,l.offset);try{e!=n&&d.extend(u.node,u.offset),g=!0}catch{}}if(!g){if(e>n){let v=l;l=u,u=v}let b=document.createRange();b.setEnd(u.node,u.offset),b.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(b)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i<this.children.length;i++){let s=this.children[i],a=r+s.size;if(r==a?e<=a&&n>=r:e<a&&n>r){let l=r+s.border,u=a-s.border;if(e>=l&&n<=u){this.dirty=e==r||n==a?Pu:CC,e==l&&n==u&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=ka:s.markDirty(e-l,n-l);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?Pu:ka}r=a}this.dirty=Pu}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Pu:CC;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class SD extends Qh{constructor(e,n,r,i){let s,a=n.type.toDOM;if(typeof a=="function"&&(a=a(r,()=>{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!n.type.spec.raw){if(a.nodeType!=1){let l=document.createElement("span");l.appendChild(a),a=l}a.contentEditable="false",a.classList.add("ProseMirror-widget")}super(e,[],a,null),this.widget=n,this.widget=n,s=this}matchesWidget(e){return this.dirty==Ls&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class Zse extends Qh{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Zu extends Qh{constructor(e,n,r,i,s){super(e,[],r,i),this.mark=n,this.spec=s}static create(e,n,r,i){let s=i.nodeViews[n.type.name],a=s&&s(n,i,r);return(!a||!a.dom)&&(a=uc.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Zu(e,n,a.dom,a.contentDOM||a.dom,a)}parseRule(){return this.dirty&ka||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=ka&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Ls){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Ls}}slice(e,n,r){let i=Zu.create(this.parent,this.mark,!0,r),s=this.children,a=this.size;n<a&&(s=u3(s,n,a,r)),e>0&&(s=u3(s,0,e,r));for(let l=0;l<s.length;l++)s[l].parent=i;return i.children=s,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class $l extends Qh{constructor(e,n,r,i,s,a,l,u,d){super(e,[],s,a),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=l}static create(e,n,r,i,s,a){let l=s.nodeViews[n.type.name],u,d=l&&l(n,s,()=>{if(!u)return a;if(u.parent)return u.parent.posBeforeChild(u)},r,i),f=d&&d.dom,p=d&&d.contentDOM;if(n.isText){if(!f)f=document.createTextNode(n.text);else if(f.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else f||({dom:f,contentDOM:p}=uc.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!p&&!n.isText&&f.nodeName!="BR"&&(f.hasAttribute("contenteditable")||(f.contentEditable="false"),n.type.spec.draggable&&(f.draggable=!0));let g=f;return f=AD(f,r,n),d?u=new Jse(e,n,r,i,f,p||null,g,d,s,a+1):n.isText?new Ub(e,n,r,i,f,g,s):new $l(e,n,r,i,f,p||null,g,s,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>ke.empty)}return e}matchesNode(e,n,r){return this.dirty==Ls&&e.eq(this.node)&&i1(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,s=e.composing?this.localCompositionInfo(e,n):null,a=s&&s.pos>-1?s:null,l=s&&s.pos<0,u=new tae(this,a&&a.node,e);iae(this.node,this.innerDeco,(d,f,p)=>{d.spec.marks?u.syncToMarks(d.spec.marks,r,e,f):d.type.side>=0&&!p&&u.syncToMarks(f==this.node.childCount?xn.none:this.node.child(f).marks,r,e,f),u.placeWidget(d,e,i)},(d,f,p,g)=>{u.syncToMarks(d.marks,r,e,g);let b;u.findNodeMatch(d,f,p,g)||l&&e.state.selection.from>i&&e.state.selection.to<i+d.nodeSize&&(b=u.findIndexWithChild(s.node))>-1&&u.updateNodeAt(d,f,p,b,e)||u.updateNextNode(d,f,p,e,g,i)||u.addNode(d,f,p,e,i),i+=d.nodeSize}),u.syncToMarks([],r,e,0),this.node.isTextblock&&u.addTextblockHacks(),u.destroyRest(),(u.changed||this.dirty==Pu)&&(a&&this.protectLocalComposition(e,a),kD(this.contentDOM,this.children,e),Od&&sae(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof Et)||r<n||i>n+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let a=s.nodeValue,l=aae(this.node.content,a,r-n,i-n);return l<0?null:{node:s,pos:l,text:a}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let a=new Zse(this,s,n,i);e.input.compositionNodes.push(a),this.children=u3(this.children,r,r+i.length,e,a)}update(e,n,r,i){return this.dirty==ka||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Ls}updateOuterDeco(e){if(i1(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=CD(this.dom,this.nodeDOM,l3(this.outerDeco,this.node,n),l3(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function AC(t,e,n,r,i){AD(r,e,t);let s=new $l(void 0,t,e,n,r,r,r,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class Ub extends $l{constructor(e,n,r,i,s,a,l){super(e,n,r,i,s,null,a,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==ka||this.dirty!=Ls&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Ls||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Ls,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),s=document.createTextNode(i.text);return new Ub(this.parent,i,this.outerDeco,this.innerDeco,s,s,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=ka)}get domAtom(){return!1}isText(e){return this.node.text==e}}class wD extends Qh{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Ls&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class Jse extends $l{constructor(e,n,r,i,s,a,l,u,d,f){super(e,n,r,i,s,a,l,d,f),this.spec=u}update(e,n,r,i){if(this.dirty==ka)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,n,r);return s&&this.updateInner(e,n,r,i),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function kD(t,e,n){let r=t.firstChild,i=!1;for(let s=0;s<e.length;s++){let a=e[s],l=a.dom;if(l.parentNode==t){for(;l!=r;)r=NC(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(l,r);if(a instanceof Zu){let u=r?r.previousSibling:t.lastChild;kD(a.contentDOM,a.children,n),r=u?u.nextSibling:t.firstChild}}for(;r;)r=NC(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const Wf=function(t){t&&(this.nodeName=t)};Wf.prototype=Object.create(null);const Bu=[new Wf];function l3(t,e,n){if(t.length==0)return Bu;let r=n?Bu[0]:new Wf,i=[r];for(let s=0;s<t.length;s++){let a=t[s].type.attrs;if(a){a.nodeName&&i.push(r=new Wf(a.nodeName));for(let l in a){let u=a[l];u!=null&&(n&&i.length==1&&i.push(r=new Wf(e.isInline?"span":"div")),l=="class"?r.class=(r.class?r.class+" ":"")+u:l=="style"?r.style=(r.style?r.style+";":"")+u:l!="nodeName"&&(r[l]=u))}}}return i}function CD(t,e,n,r){if(n==Bu&&r==Bu)return e;let i=e;for(let s=0;s<r.length;s++){let a=r[s],l=n[s];if(s){let u;l&&l.nodeName==a.nodeName&&i!=t&&(u=i.parentNode)&&u.nodeName.toLowerCase()==a.nodeName||(u=document.createElement(a.nodeName),u.pmIsDeco=!0,u.appendChild(i),l=Bu[0]),i=u}eae(i,l||Bu[0],a)}return i}function eae(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let s=0;s<r.length;s++)i.indexOf(r[s])==-1&&t.classList.remove(r[s]);for(let s=0;s<i.length;s++)r.indexOf(i[s])==-1&&t.classList.add(i[s]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)t.style.removeProperty(i[1])}n.style&&(t.style.cssText+=n.style)}}function AD(t,e,n){return CD(t,t,Bu,l3(e,n,t.nodeType!=1))}function i1(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function NC(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class tae{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=nae(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r,i){let s=0,a=this.stack.length>>1,l=Math.min(a,e.length);for(;s<l&&(s==a-1?this.top:this.stack[s+1<<1]).matchesMark(e[s])&&e[s].type.spec.spanning!==!1;)s++;for(;s<a;)this.destroyRest(),this.top.dirty=Ls,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<e.length;){this.stack.push(this.top,this.index+1);let u=-1,d=this.top.children.length;i<this.preMatch.index&&(d=Math.min(this.index+3,d));for(let f=this.index;f<d;f++){let p=this.top.children[f];if(p.matchesMark(e[a])&&!this.isLocked(p.dom)){u=f;break}}if(u>-1)u>this.index&&(this.changed=!0,this.destroyBetween(this.index,u)),this.top=this.top.children[this.index];else{let f=Zu.create(this.top,e[a],n,r);this.top.children.splice(this.index,0,f),this.top=f,this.changed=!0}this.index=0,a++}}findNodeMatch(e,n,r,i){let s=-1,a;if(i>=this.preMatch.index&&(a=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&a.matchesNode(e,n,r))s=this.top.children.indexOf(a,this.index);else for(let l=this.index,u=Math.min(this.top.children.length,l+5);l<u;l++){let d=this.top.children[l];if(d.matchesNode(e,n,r)&&!this.preMatch.matched.has(d)){s=l;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,n,r,i,s){let a=this.top.children[i];return a.dirty==ka&&a.dom==a.contentDOM&&(a.dirty=Pu),a.update(e,n,r,s)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=n}}updateNextNode(e,n,r,i,s,a){for(let l=this.index;l<this.top.children.length;l++){let u=this.top.children[l];if(u instanceof $l){let d=this.preMatch.matched.get(u);if(d!=null&&d!=s)return!1;let f=u.dom,p,g=this.isLocked(f)&&!(e.isText&&u.node&&u.node.isText&&u.nodeDOM.nodeValue==e.text&&u.dirty!=ka&&i1(n,u.outerDeco));if(!g&&u.update(e,n,r,i))return this.destroyBetween(this.index,l),u.dom!=f&&(this.changed=!0),this.index++,!0;if(!g&&(p=this.recreateWrapper(u,e,n,r,i,a)))return this.destroyBetween(this.index,l),this.top.children[this.index]=p,p.contentDOM&&(p.dirty=Pu,p.updateChildren(i,a+1),p.dirty=Ls),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,i,s,a){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!i1(r,e.outerDeco)||!i.eq(e.innerDeco))return null;let l=$l.create(this.top,n,r,i,s,a);if(l.contentDOM){l.children=e.children,e.children=[];for(let u of l.children)u.parent=l}return e.destroy(),l}addNode(e,n,r,i,s){let a=$l.create(this.top,e,n,r,i,s);a.contentDOM&&a.updateChildren(i,s+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let s=new SD(this.top,e,n,r);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof Zu;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Ub)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((ei||Hr)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new wD(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function nae(t,e){let n=e,r=n.children.length,i=t.childCount,s=new Map,a=[];e:for(;i>0;){let l;for(;;)if(r){let d=n.children[r-1];if(d instanceof Zu)n=d,r=d.children.length;else{l=d,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let u=l.node;if(u){if(u!=t.child(i-1))break;--i,s.set(l,i),a.push(l)}}return{index:i,matched:s,matches:a.reverse()}}function rae(t,e){return t.type.side-e.type.side}function iae(t,e,n,r){let i=e.locals(t),s=0;if(i.length==0){for(let d=0;d<t.childCount;d++){let f=t.child(d);r(f,i,e.forChild(s,f),d),s+=f.nodeSize}return}let a=0,l=[],u=null;for(let d=0;;){let f,p;for(;a<i.length&&i[a].to==s;){let x=i[a++];x.widget&&(f?(p||(p=[f])).push(x):f=x)}if(f)if(p){p.sort(rae);for(let x=0;x<p.length;x++)n(p[x],d,!!u)}else n(f,d,!!u);let g,b;if(u)b=-1,g=u,u=null;else if(d<t.childCount)b=d,g=t.child(d++);else break;for(let x=0;x<l.length;x++)l[x].to<=s&&l.splice(x--,1);for(;a<i.length&&i[a].from<=s&&i[a].to>s;)l.push(i[a++]);let v=s+g.nodeSize;if(g.isText){let x=v;a<i.length&&i[a].from<x&&(x=i[a].from);for(let S=0;S<l.length;S++)l[S].to<x&&(x=l[S].to);x<v&&(u=g.cut(x-s),g=g.cut(0,x-s),v=x,b=-1)}else for(;a<i.length&&i[a].to<v;)a++;let E=g.isInline&&!g.isLeaf?l.filter(x=>!x.inline):l.slice();r(g,E,e.forChild(s,g),b),s=v}}function sae(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function aae(t,e,n,r){for(let i=0,s=0;i<t.childCount&&s<=r;){let a=t.child(i++),l=s;if(s+=a.nodeSize,!a.isText)continue;let u=a.text;for(;i<t.childCount;){let d=t.child(i++);if(s+=d.nodeSize,!d.isText)break;u+=d.text}if(s>=n){if(s>=r&&u.slice(r-e.length-l,r-l)==e)return r-e.length;let d=l<r?u.lastIndexOf(e,r-l-1):-1;if(d>=0&&d+e.length+l>=n)return l+d;if(n==r&&u.length>=r+e.length-l&&u.slice(r-l,r-l+e.length)==e)return r}}return-1}function u3(t,e,n,r,i){let s=[];for(let a=0,l=0;a<t.length;a++){let u=t[a],d=l,f=l+=u.size;d>=n||f<=e?s.push(u):(d<e&&s.push(u.slice(0,e-d,r)),i&&(s.push(i),i=void 0),f>n&&s.push(u.slice(n-d,u.size,r)))}return s}function Tx(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),s=i&&i.size==0,a=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let l=r.resolve(a),u,d;if(zb(n)){for(u=a;i&&!i.node;)i=i.parent;let p=i.node;if(i&&p.isAtom&&ct.isSelectable(p)&&i.parent&&!(p.isInline&&Dse(n.focusNode,n.focusOffset,i.dom))){let g=i.posBefore;d=new ct(a==g?l:r.resolve(g))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let p=a,g=a;for(let b=0;b<n.rangeCount;b++){let v=n.getRangeAt(b);p=Math.min(p,t.docView.posFromDOM(v.startContainer,v.startOffset,1)),g=Math.max(g,t.docView.posFromDOM(v.endContainer,v.endOffset,-1))}if(p<0)return null;[u,a]=g==t.state.selection.anchor?[g,p]:[p,g],l=r.resolve(a)}else u=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(u<0)return null}let f=r.resolve(u);if(!d){let p=e=="pointer"||t.state.selection.head<l.pos&&!s?1:-1;d=Sx(t,f,l,p)}return d}function ND(t){return t.editable?t.hasFocus():MD(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Co(t,e=!1){let n=t.state.selection;if(OD(t,n),!!ND(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Hr){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Qu(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)lae(t);else{let{anchor:r,head:i}=n,s,a;OC&&!(n instanceof Et)&&(n.$from.parent.inlineContent||(s=MC(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=MC(t,n.to))),t.docView.setSelection(r,i,t,e),OC&&(s&&RC(s),a&&RC(a)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&oae(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const OC=ei||Hr&&gD<63;function MC(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(ei&&i&&i.contentEditable=="false")return xE(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return xE(i);if(s)return xE(s)}}function xE(t){return t.contentEditable="true",ei&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function RC(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function oae(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!ND(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function lae(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,Qr(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&Gi&&jl<=11&&(n.disabled=!0,n.disabled=!1)}function OD(t,e){if(e instanceof ct){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(DC(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else DC(t)}function DC(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Sx(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||Et.between(e,n,r)}function IC(t){return t.editable&&!t.hasFocus()?!1:MD(t)}function MD(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function uae(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Qu(e.node,e.offset,n.anchorNode,n.anchorOffset)}function c3(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),s=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return s&&vt.findFrom(s,e)}function Nl(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function LC(t,e,n){let r=t.state.selection;if(r instanceof Et)if(n.indexOf("s")>-1){let{$head:i}=r,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let a=t.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return Nl(t,new Et(r.$anchor,a))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=c3(t.state,e);return i&&i instanceof ct?Nl(t,i):!1}else if(!(Ns&&n.indexOf("m")>-1)){let i=r.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,a;if(!s||s.isText)return!1;let l=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(a=t.docView.descAt(l))&&!a.contentDOM?ct.isSelectable(s)?Nl(t,new ct(e<0?t.state.doc.resolve(i.pos-s.nodeSize):i)):Xh?Nl(t,new Et(t.state.doc.resolve(e<0?l:l+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof ct&&r.node.isInline)return Nl(t,new Et(e>0?r.$to:r.$from));{let i=c3(t.state,e);return i?Nl(t,i):!1}}}function s1(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Kf(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Zc(t,e){return e<0?cae(t):dae(t)}function cae(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,s,a=!1;for(Is&&n.nodeType==1&&r<s1(n)&&Kf(n.childNodes[r],-1)&&(a=!0);;)if(r>0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(Kf(l,-1))i=n,s=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(RD(n))break;{let l=n.previousSibling;for(;l&&Kf(l,-1);)i=n.parentNode,s=Qr(l),l=l.previousSibling;if(l)n=l,r=s1(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}a?d3(t,n,r):i&&d3(t,i,s)}function dae(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=s1(n),s,a;for(;;)if(r<i){if(n.nodeType!=1)break;let l=n.childNodes[r];if(Kf(l,1))s=n,a=++r;else break}else{if(RD(n))break;{let l=n.nextSibling;for(;l&&Kf(l,1);)s=l.parentNode,a=Qr(l)+1,l=l.nextSibling;if(l)n=l,r=0,i=s1(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}s&&d3(t,s,a)}function RD(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function fae(t,e){for(;t&&e==t.childNodes.length&&!Kh(t);)e=Qr(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function hae(t,e){for(;t&&!e&&!Kh(t);)e=Qr(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function d3(t,e,n){if(e.nodeType!=3){let s,a;(a=fae(e,n))?(e=a,n=0):(s=hae(e,n))&&(e=s,n=s.nodeValue.length)}let r=t.domSelection();if(!r)return;if(zb(r)){let s=document.createRange();s.setEnd(e,n),s.setStart(e,n),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&Co(t)},50)}function PC(t,e){let n=t.state.doc.resolve(e);if(!(Hr||bD)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let s=t.coordsAtPos(e-1),a=(s.top+s.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(s.left-i.left)>1)return s.left<i.left?"ltr":"rtl"}if(e<n.end()){let s=t.coordsAtPos(e+1),a=(s.top+s.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(s.left-i.left)>1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function BC(t,e,n){let r=t.state.selection;if(r instanceof Et&&!r.empty||n.indexOf("s")>-1||Ns&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let a=c3(t.state,e);if(a&&a instanceof ct)return Nl(t,a)}if(!i.parent.inlineContent){let a=e<0?i:s,l=r instanceof fs?vt.near(a,e):vt.findFrom(a,e);return l?Nl(t,l):!1}return!1}function zC(t,e){if(!(t.state.selection instanceof Et))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let a=t.state.tr;return e<0?a.delete(n.pos-s.nodeSize,n.pos):a.delete(n.pos,n.pos+s.nodeSize),t.dispatch(a),!0}return!1}function UC(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function pae(t){if(!ei||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;UC(t,r,"true"),setTimeout(()=>UC(t,r,"false"),20)}return!1}function mae(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function gae(t,e){let n=e.keyCode,r=mae(e);if(n==8||Ns&&n==72&&r=="c")return zC(t,-1)||Zc(t,-1);if(n==46&&!e.shiftKey||Ns&&n==68&&r=="c")return zC(t,1)||Zc(t,1);if(n==13||n==27)return!0;if(n==37||Ns&&n==66&&r=="c"){let i=n==37?PC(t,t.state.selection.from)=="ltr"?-1:1:-1;return LC(t,i,r)||Zc(t,i)}else if(n==39||Ns&&n==70&&r=="c"){let i=n==39?PC(t,t.state.selection.from)=="ltr"?1:-1:1;return LC(t,i,r)||Zc(t,i)}else{if(n==38||Ns&&n==80&&r=="c")return BC(t,-1,r)||Zc(t,-1);if(n==40||Ns&&n==78&&r=="c")return pae(t)||BC(t,1,r)||Zc(t,1);if(r==(Ns?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function wx(t,e){t.someProp("transformCopied",b=>{e=b(e,t)});let n=[],{content:r,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,s--;let b=r.firstChild;n.push(b.type.name,b.attrs!=b.type.defaultAttrs?b.attrs:null),r=b.content}let a=t.someProp("clipboardSerializer")||uc.fromSchema(t.state.schema),l=zD(),u=l.createElement("div");u.appendChild(a.serializeFragment(r,{document:l}));let d=u.firstChild,f,p=0;for(;d&&d.nodeType==1&&(f=BD[d.nodeName.toLowerCase()]);){for(let b=f.length-1;b>=0;b--){let v=l.createElement(f[b]);for(;u.firstChild;)v.appendChild(u.firstChild);u.appendChild(v),p++}d=u.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${i} ${s}${p?` -${p}`:""} ${JSON.stringify(n)}`);let g=t.someProp("clipboardTextSerializer",b=>b(e,t))||e.content.textBetween(0,e.content.size,`

`);return{dom:u,text:g,slice:e}}function DD(t,e,n,r,i){let s=i.parent.type.spec.code,a,l;if(!n&&!e)return null;let u=!!e&&(r||s||!n);if(u){if(t.someProp("transformPastedText",g=>{e=g(e,s||r,t)}),s)return l=new qe(ke.from(t.state.schema.text(e.replace(/\r\n?/g,`
`))),0,0),t.someProp("transformPasted",g=>{l=g(l,t,!0)}),l;let p=t.someProp("clipboardTextParser",g=>g(e,i,r,t));if(p)l=p;else{let g=i.marks(),{schema:b}=t.state,v=uc.fromSchema(b);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(E=>{let x=a.appendChild(document.createElement("p"));E&&x.appendChild(v.serializeNode(b.text(E,g)))})}}else t.someProp("transformPastedHTML",p=>{n=p(n,t)}),a=Eae(n),Xh&&_ae(a);let d=a&&a.querySelector("[data-pm-slice]"),f=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(f&&f[3])for(let p=+f[3];p>0;p--){let g=a.firstChild;for(;g&&g.nodeType!=1;)g=g.nextSibling;if(!g)break;a=g}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||Gf.fromSchema(t.state.schema)).parseSlice(a,{preserveWhitespace:!!(u||f),context:i,ruleFromNode(g){return g.nodeName=="BR"&&!g.nextSibling&&g.parentNode&&!bae.test(g.parentNode.nodeName)?{ignore:!0}:null}})),f)l=xae(FC(l,+f[1],+f[2]),f[4]);else if(l=qe.maxOpen(vae(l.content,i),!0),l.openStart||l.openEnd){let p=0,g=0;for(let b=l.content.firstChild;p<l.openStart&&!b.type.spec.isolating;p++,b=b.firstChild);for(let b=l.content.lastChild;g<l.openEnd&&!b.type.spec.isolating;g++,b=b.lastChild);l=FC(l,p,g)}return t.someProp("transformPasted",p=>{l=p(l,t,u)}),l}const bae=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function vae(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),s,a=[];if(t.forEach(l=>{if(!a)return;let u=i.findWrapping(l.type),d;if(!u)return a=null;if(d=a.length&&s.length&&LD(u,s,l,a[a.length-1],0))a[a.length-1]=d;else{a.length&&(a[a.length-1]=PD(a[a.length-1],s.length));let f=ID(l,u);a.push(f),i=i.matchType(f.type),s=u}}),a)return ke.from(a)}return t}function ID(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,ke.from(t));return t}function LD(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let s=LD(t,e,n,r.lastChild,i+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(ke.from(ID(n,t,i+1))))}}function PD(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,PD(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(ke.empty,!0);return t.copy(n.append(r))}function f3(t,e,n,r,i,s){let a=e<0?t.firstChild:t.lastChild,l=a.content;return t.childCount>1&&(s=0),i<r-1&&(l=f3(l,e,n,r,i+1,s)),i>=n&&(l=e<0?a.contentMatchAt(0).fillBefore(l,s<=i).append(l):l.append(a.contentMatchAt(a.childCount).fillBefore(ke.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(l))}function FC(t,e,n){return e<t.openStart&&(t=new qe(f3(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new qe(f3(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const BD={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let HC=null;function zD(){return HC||(HC=document.implementation.createHTMLDocument("title"))}let TE=null;function yae(t){let e=window.trustedTypes;return e?(TE||(TE=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),TE.createHTML(t)):t}function Eae(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=zD().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&BD[r[1].toLowerCase()])&&(t=i.map(s=>"<"+s+">").join("")+t+i.map(s=>"</"+s+">").reverse().join("")),n.innerHTML=yae(t),i)for(let s=0;s<i.length;s++)n=n.querySelector(i[s])||n;return n}function _ae(t){let e=t.querySelectorAll(Hr?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function xae(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:i,openStart:s,openEnd:a}=t;for(let l=r.length-2;l>=0;l-=2){let u=n.nodes[r[l]];if(!u||u.hasRequiredAttrs())break;i=ke.from(u.create(r[l+1],i)),s++,a++}return new qe(i,s,a)}const wi={},ki={},Tae={touchstart:!0,touchmove:!0};class Sae{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function wae(t){for(let e in wi){let n=wi[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{Cae(t,r)&&!kx(t,r)&&(t.editable||!(r.type in ki))&&n(t,r)},Tae[e]?{passive:!0}:void 0)}ei&&t.dom.addEventListener("input",()=>null),h3(t)}function Ul(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function kae(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function h3(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>kx(t,r))})}function kx(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function Cae(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function Aae(t,e){!kx(t,e)&&wi[e.type]&&(t.editable||!(e.type in ki))&&wi[e.type](t,e)}ki.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!FD(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Eo&&Hr&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Od&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,Lu(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||gae(t,n)?n.preventDefault():Ul(t,"key")};ki.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};ki.keypress=(t,e)=>{let n=e;if(FD(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Ns&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Et)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode),s=()=>t.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",a=>a(t,r.$from.pos,r.$to.pos,i,s))&&t.dispatch(s()),n.preventDefault()}};function Fb(t){return{left:t.clientX,top:t.clientY}}function Nae(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Cx(t,e,n,r,i){if(r==-1)return!1;let s=t.state.doc.resolve(r);for(let a=s.depth+1;a>0;a--)if(t.someProp(e,l=>a>s.depth?l(t,n,s.nodeAfter,s.before(a),i,!0):l(t,n,s.node(a),s.before(a),i,!1)))return!0;return!1}function yd(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function Oae(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&ct.isSelectable(r)?(yd(t,new ct(n)),!0):!1}function Mae(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof ct&&(r=n.node);let s=t.state.doc.resolve(e);for(let a=s.depth+1;a>0;a--){let l=a>s.depth?s.nodeAfter:s.node(a);if(ct.isSelectable(l)){r&&n.$from.depth>0&&a>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?i=s.before(n.$from.depth):i=s.before(a);break}}return i!=null?(yd(t,ct.create(t.state.doc,i)),!0):!1}function Rae(t,e,n,r,i){return Cx(t,"handleClickOn",e,n,r)||t.someProp("handleClick",s=>s(t,e,r))||(i?Mae(t,n):Oae(t,n))}function Dae(t,e,n,r){return Cx(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function Iae(t,e,n,r){return Cx(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||Lae(t,n,r)}function Lae(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(yd(t,Et.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s),l=i.before(s);if(a.inlineContent)yd(t,Et.create(r,l+1,l+1+a.content.size));else if(ct.isSelectable(a))yd(t,ct.create(r,l));else continue;return!0}}function Ax(t){return a1(t)}const UD=Ns?"metaKey":"ctrlKey";wi.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Ax(t),i=Date.now(),s="singleClick";i-t.input.lastClick.time<500&&Nae(n,t.input.lastClick)&&!n[UD]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?s="doubleClick":t.input.lastClick.type=="doubleClick"&&(s="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:s,button:n.button};let a=t.posAtCoords(Fb(n));a&&(s=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Pae(t,a,n,!!r)):(s=="doubleClick"?Dae:Iae)(t,a.pos,a.inside,n)?n.preventDefault():Ul(t,"pointer"))};class Pae{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[UD],this.allowDefault=r.shiftKey;let s,a;if(n.inside>-1)s=e.state.doc.nodeAt(n.inside),a=n.inside;else{let f=e.state.doc.resolve(n.pos);s=f.parent,a=f.depth?f.before():0}const l=i?null:r.target,u=l?e.docView.nearestDesc(l,!0):null;this.target=u&&u.nodeDOM.nodeType==1?u.nodeDOM:null;let{selection:d}=e.state;(r.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||d instanceof ct&&d.from<=a&&d.to>a)&&(this.mightDrag={node:s,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Is&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Ul(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Co(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Fb(e))),this.updateAllowDefault(e),this.allowDefault||!n?Ul(this.view,"pointer"):Rae(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||ei&&this.mightDrag&&!this.mightDrag.node.isAtom||Hr&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(yd(this.view,vt.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Ul(this.view,"pointer")}move(e){this.updateAllowDefault(e),Ul(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}wi.touchstart=t=>{t.input.lastTouch=Date.now(),Ax(t),Ul(t,"pointer")};wi.touchmove=t=>{t.input.lastTouch=Date.now(),Ul(t,"pointer")};wi.contextmenu=t=>Ax(t);function FD(t,e){return t.composing?!0:ei&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const Bae=Eo?5e3:-1;ki.compositionstart=ki.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof Et&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||Hr&&bD&&zae(t)))t.markCursor=t.state.storedMarks||n.marks(),a1(t,!0),t.markCursor=null;else if(a1(t,!e.selection.empty),Is&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,s=r.focusOffset;i&&i.nodeType==1&&s!=0;){let a=s<0?i.lastChild:i.childNodes[s-1];if(!a)break;if(a.nodeType==3){let l=t.domSelection();l&&l.collapse(a,a.nodeValue.length);break}else i=a,s=-1}}t.input.composing=!0}HD(t,Bae)};function zae(t){let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(!e||e.nodeType!=1||n>=e.childNodes.length)return!1;let r=e.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}ki.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,HD(t,20))};function HD(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>a1(t),e))}function jD(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Fae());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Uae(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=Mse(e.focusNode,e.focusOffset),r=Rse(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,s=t.domObserver.lastChangedTextNode;if(n==s||r==s)return s;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let a=n.pmViewDesc;if(!(!a||!a.isText(n.nodeValue)))return r}}return n||r}function Fae(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function a1(t,e=!1){if(!(Eo&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),jD(t),e||t.docView&&t.docView.dirty){let n=Tx(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function Hae(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const bh=Gi&&jl<15||Od&&Pse<604;wi.copy=ki.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let s=bh?null:n.clipboardData,a=r.content(),{dom:l,text:u}=wx(t,a);s?(n.preventDefault(),s.clearData(),s.setData("text/html",l.innerHTML),s.setData("text/plain",u)):Hae(t,l),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function jae(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function $ae(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?vh(t,r.value,null,i,e):vh(t,r.textContent,r.innerHTML,i,e)},50)}function vh(t,e,n,r,i){let s=DD(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",u=>u(t,i,s||qe.empty)))return!0;if(!s)return!1;let a=jae(s),l=a?t.state.tr.replaceSelectionWith(a,r):t.state.tr.replaceSelection(s);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function $D(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}ki.paste=(t,e)=>{let n=e;if(t.composing&&!Eo)return;let r=bh?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&vh(t,$D(r),r.getData("text/html"),i,n)?n.preventDefault():$ae(t,n)};class qD{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const qae=Ns?"altKey":"ctrlKey";function VD(t,e){let n=t.someProp("dragCopies",r=>!r(e));return n??!e[qae]}wi.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,s=i.empty?null:t.posAtCoords(Fb(n)),a;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof ct?i.to-1:i.to))){if(r&&r.mightDrag)a=ct.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let p=t.docView.nearestDesc(n.target,!0);p&&p.node.type.spec.draggable&&p!=t.docView&&(a=ct.create(t.state.doc,p.posBefore))}}let l=(a||t.state.selection).content(),{dom:u,text:d,slice:f}=wx(t,l);(!n.dataTransfer.files.length||!Hr||gD>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(bh?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",bh||n.dataTransfer.setData("text/plain",d),t.dragging=new qD(f,VD(t,n),a)};wi.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};ki.dragover=ki.dragenter=(t,e)=>e.preventDefault();ki.drop=(t,e)=>{try{Vae(t,e,t.dragging)}finally{t.dragging=null}};function Vae(t,e,n){if(!e.dataTransfer)return;let r=t.posAtCoords(Fb(e));if(!r)return;let i=t.state.doc.resolve(r.pos),s=n&&n.slice;s?t.someProp("transformPasted",b=>{s=b(s,t,!1)}):s=DD(t,$D(e.dataTransfer),bh?null:e.dataTransfer.getData("text/html"),!1,i);let a=!!(n&&VD(t,e));if(t.someProp("handleDrop",b=>b(t,e,s||qe.empty,a))){e.preventDefault();return}if(!s)return;e.preventDefault();let l=s?WR(t.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let u=t.state.tr;if(a){let{node:b}=n;b?b.replace(u):u.deleteSelection()}let d=u.mapping.map(l),f=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,p=u.doc;if(f?u.replaceRangeWith(d,d,s.content.firstChild):u.replaceRange(d,d,s),u.doc.eq(p))return;let g=u.doc.resolve(d);if(f&&ct.isSelectable(s.content.firstChild)&&g.nodeAfter&&g.nodeAfter.sameMarkup(s.content.firstChild))u.setSelection(new ct(g));else{let b=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach((v,E,x,S)=>b=S),u.setSelection(Sx(t,g,u.doc.resolve(b)))}t.focus(),t.dispatch(u.setMeta("uiEvent","drop"))}wi.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Co(t)},20))};wi.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};wi.beforeinput=(t,e)=>{if(Hr&&Eo&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",s=>s(t,Lu(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in ki)wi[t]=ki[t];function yh(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class o1{constructor(e,n){this.toDOM=e,this.spec=n||qu,this.side=this.spec.side||0}map(e,n,r,i){let{pos:s,deleted:a}=e.mapResult(n.from+i,this.side<0?-1:1);return a?null:new Si(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof o1&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&yh(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class ql{constructor(e,n){this.attrs=e,this.spec=n||qu}map(e,n,r,i){let s=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,a=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return s>=a?null:new Si(s,a,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof ql&&yh(this.attrs,e.attrs)&&yh(this.spec,e.spec)}static is(e){return e.type instanceof ql}destroy(){}}class Nx{constructor(e,n){this.attrs=e,this.spec=n||qu}map(e,n,r,i){let s=e.mapResult(n.from+i,1);if(s.deleted)return null;let a=e.mapResult(n.to+i,-1);return a.deleted||a.pos<=s.pos?null:new Si(s.pos-r,a.pos-r,this)}valid(e,n){let{index:r,offset:i}=e.content.findIndex(n.from),s;return i==n.from&&!(s=e.child(r)).isText&&i+s.nodeSize==n.to}eq(e){return this==e||e instanceof Nx&&yh(this.attrs,e.attrs)&&yh(this.spec,e.spec)}destroy(){}}class Si{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Si(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new Si(e,e,new o1(n,r))}static inline(e,n,r,i){return new Si(e,n,new ql(r,i))}static node(e,n,r,i){return new Si(e,n,new Nx(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof ql}get widget(){return this.type instanceof o1}}const od=[],qu={};class Qn{constructor(e,n){this.local=e.length?e:od,this.children=n.length?n:od}static create(e,n){return n.length?l1(n,e,0,qu):oi}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,s){for(let a=0;a<this.local.length;a++){let l=this.local[a];l.from<=n&&l.to>=e&&(!s||s(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<n&&this.children[a+1]>e){let l=this.children[a]+1;this.children[a+2].findInner(e-l,n-l,r,i+l,s)}}map(e,n,r){return this==oi||e.maps.length==0?this:this.mapInner(e,n,0,0,r||qu)}mapInner(e,n,r,i,s){let a;for(let l=0;l<this.local.length;l++){let u=this.local[l].map(e,r,i);u&&u.type.valid(n,u)?(a||(a=[])).push(u):s.onRemove&&s.onRemove(this.local[l].spec)}return this.children.length?Gae(this.children,a||[],e,n,r,i,s):a?new Qn(a.sort(Vu),od):oi}add(e,n){return n.length?this==oi?Qn.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,s=0;e.forEach((l,u)=>{let d=u+r,f;if(f=YD(n,l,d)){for(i||(i=this.children.slice());s<i.length&&i[s]<u;)s+=3;i[s]==u?i[s+2]=i[s+2].addInner(l,f,d+1):i.splice(s,0,u,u+l.nodeSize,l1(f,l,d+1,qu)),s+=3}});let a=GD(s?WD(n):n,-r);for(let l=0;l<a.length;l++)a[l].type.valid(e,a[l])||a.splice(l--,1);return new Qn(a.length?this.local.concat(a).sort(Vu):this.local,i||this.children)}remove(e){return e.length==0||this==oi?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let s=0;s<r.length;s+=3){let a,l=r[s]+n,u=r[s+1]+n;for(let f=0,p;f<e.length;f++)(p=e[f])&&p.from>l&&p.to<u&&(e[f]=null,(a||(a=[])).push(p));if(!a)continue;r==this.children&&(r=this.children.slice());let d=r[s+2].removeInner(a,l+1);d!=oi?r[s+2]=d:(r.splice(s,3),s-=3)}if(i.length){for(let s=0,a;s<e.length;s++)if(a=e[s])for(let l=0;l<i.length;l++)i[l].eq(a,n)&&(i==this.local&&(i=this.local.slice()),i.splice(l--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Qn(i,r):oi}forChild(e,n){if(this==oi)return this;if(n.isLeaf)return Qn.empty;let r,i;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(r=this.children[l+2]);break}let s=e+1,a=s+n.content.size;for(let l=0;l<this.local.length;l++){let u=this.local[l];if(u.from<a&&u.to>s&&u.type instanceof ql){let d=Math.max(s,u.from)-s,f=Math.min(a,u.to)-s;d<f&&(i||(i=[])).push(u.copy(d,f))}}if(i){let l=new Qn(i.sort(Vu),od);return r?new Rl([l,r]):l}return r||oi}eq(e){if(this==e)return!0;if(!(e instanceof Qn)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Ox(this.localsInner(e))}localsInner(e){if(this==oi)return od;if(e.inlineContent||!this.local.some(ql.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof ql||n.push(this.local[r]);return n}forEachSet(e){e(this)}}Qn.empty=new Qn([],[]);Qn.removeOverlap=Ox;const oi=Qn.empty;class Rl{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,qu));return Rl.from(r)}forChild(e,n){if(n.isLeaf)return Qn.empty;let r=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,n);s!=oi&&(s instanceof Rl?r=r.concat(s.members):r.push(s))}return Rl.from(r)}eq(e){if(!(e instanceof Rl)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(e);if(s.length)if(!n)n=s;else{r&&(n=n.slice(),r=!1);for(let a=0;a<s.length;a++)n.push(s[a])}}return n?Ox(r?n:n.sort(Vu)):od}static from(e){switch(e.length){case 0:return oi;case 1:return e[0];default:return new Rl(e.every(n=>n instanceof Qn)?e:e.reduce((n,r)=>n.concat(r instanceof Qn?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function Gae(t,e,n,r,i,s,a){let l=t.slice();for(let d=0,f=s;d<n.maps.length;d++){let p=0;n.maps[d].forEach((g,b,v,E)=>{let x=E-v-(b-g);for(let S=0;S<l.length;S+=3){let C=l[S+1];if(C<0||g>C+f-p)continue;let O=l[S]+f-p;b>=O?l[S+1]=g<=O?-2:-1:g>=f&&x&&(l[S]+=x,l[S+1]+=x)}p+=x}),f=n.maps[d].map(f,-1)}let u=!1;for(let d=0;d<l.length;d+=3)if(l[d+1]<0){if(l[d+1]==-2){u=!0,l[d+1]=-1;continue}let f=n.map(t[d]+s),p=f-i;if(p<0||p>=r.content.size){u=!0;continue}let g=n.map(t[d+1]+s,-1),b=g-i,{index:v,offset:E}=r.content.findIndex(p),x=r.maybeChild(v);if(x&&E==p&&E+x.nodeSize==b){let S=l[d+2].mapInner(n,x,f+1,t[d]+s+1,a);S!=oi?(l[d]=p,l[d+1]=b,l[d+2]=S):(l[d+1]=-2,u=!0)}else u=!0}if(u){let d=Yae(l,t,e,n,i,s,a),f=l1(d,r,0,a);e=f.local;for(let p=0;p<l.length;p+=3)l[p+1]<0&&(l.splice(p,3),p-=3);for(let p=0,g=0;p<f.children.length;p+=3){let b=f.children[p];for(;g<l.length&&l[g]<b;)g+=3;l.splice(g,0,f.children[p],f.children[p+1],f.children[p+2])}}return new Qn(e.sort(Vu),l)}function GD(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let i=t[r];n.push(new Si(i.from+e,i.to+e,i.type))}return n}function Yae(t,e,n,r,i,s,a){function l(u,d){for(let f=0;f<u.local.length;f++){let p=u.local[f].map(r,i,d);p?n.push(p):a.onRemove&&a.onRemove(u.local[f].spec)}for(let f=0;f<u.children.length;f+=3)l(u.children[f+2],u.children[f]+d+1)}for(let u=0;u<t.length;u+=3)t[u+1]==-1&&l(t[u+2],e[u]+s+1);return n}function YD(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let s=0,a;s<t.length;s++)(a=t[s])&&a.from>n&&a.to<r&&((i||(i=[])).push(a),t[s]=null);return i}function WD(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function l1(t,e,n,r){let i=[],s=!1;e.forEach((l,u)=>{let d=YD(t,l,u+n);if(d){s=!0;let f=l1(d,l,n+u+1,r);f!=oi&&i.push(u,u+l.nodeSize,f)}});let a=GD(s?WD(t):t,-n).sort(Vu);for(let l=0;l<a.length;l++)a[l].type.valid(e,a[l])||(r.onRemove&&r.onRemove(a[l].spec),a.splice(l--,1));return a.length||i.length?new Qn(a,i):oi}function Vu(t,e){return t.from-e.from||t.to-e.to}function Ox(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let s=e[i];if(s.from==r.from){s.to!=r.to&&(e==t&&(e=t.slice()),e[i]=s.copy(s.from,r.to),jC(e,i+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,s.from),jC(e,i,r.copy(s.from,r.to)));break}}}return e}function jC(t,e,n){for(;e<t.length&&Vu(n,t[e])>0;)e++;t.splice(e,0,n)}function SE(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=oi&&e.push(r)}),t.cursorWrapper&&e.push(Qn.create(t.state.doc,[t.cursorWrapper.deco])),Rl.from(e)}const Wae={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Kae=Gi&&jl<=11;class Xae{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class Qae{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Xae,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);Gi&&jl<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():ei&&e.composing&&r.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),Kae&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Wae)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(IC(this.view)){if(this.suppressingSelectionUpdates)return Co(this.view);if(Gi&&jl<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Qu(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let s=e.focusNode;s;s=Nd(s))n.add(s);for(let s=e.anchorNode;s;s=Nd(s))if(n.has(s)){r=s;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&IC(e)&&!this.ignoreSelectionChange(r),s=-1,a=-1,l=!1,u=[];if(e.editable)for(let f=0;f<n.length;f++){let p=this.registerMutation(n[f],u);p&&(s=s<0?p.from:Math.min(p.from,s),a=a<0?p.to:Math.max(p.to,a),p.typeOver&&(l=!0))}if(Is&&u.length){let f=u.filter(p=>p.nodeName=="BR");if(f.length==2){let[p,g]=f;p.parentNode&&p.parentNode.parentNode==g.parentNode?g.remove():p.remove()}else{let{focusNode:p}=this.currentSelection;for(let g of f){let b=g.parentNode;b&&b.nodeName=="LI"&&(!p||eoe(e,p)!=b)&&g.remove()}}}else if((Hr||ei)&&u.some(f=>f.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let f of u)if(f.nodeName=="BR"&&f.parentNode){let p=f.nextSibling;p&&p.nodeType==1&&p.contentEditable=="false"&&f.parentNode.removeChild(f)}}let d=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&zb(r)&&(d=Tx(e))&&d.eq(vt.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Co(e),this.currentSelection.set(r),e.scrollToSelection()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,a),Zae(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,toe(e,u)),this.handleDOMChange(s,a,l,u),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Co(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let f=0;f<e.addedNodes.length;f++){let p=e.addedNodes[f];n.push(p),p.nodeType==3&&(this.lastChangedTextNode=p)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,s=e.nextSibling;if(Gi&&jl<=11&&e.addedNodes.length)for(let f=0;f<e.addedNodes.length;f++){let{previousSibling:p,nextSibling:g}=e.addedNodes[f];(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(i=p),(!g||Array.prototype.indexOf.call(e.addedNodes,g)<0)&&(s=g)}let a=i&&i.parentNode==e.target?Qr(i)+1:0,l=r.localPosFromDOM(e.target,a,-1),u=s&&s.parentNode==e.target?Qr(s):e.target.childNodes.length,d=r.localPosFromDOM(e.target,u,1);return{from:l,to:d}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let $C=new WeakMap,qC=!1;function Zae(t){if(!$C.has(t)&&($C.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Is,qC)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),qC=!0}}function VC(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,a=t.domAtPos(t.state.selection.anchor);return Qu(a.node,a.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function Jae(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return VC(t,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?VC(t,n):null}function eoe(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function toe(t,e){var n;let{focusNode:r,focusOffset:i}=t.domSelectionRange();for(let s of e)if(((n=s.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let a=s.nextSibling;for(;a&&a.nodeName!="TD"&&a.nodeName!="TH";)a=a.nextSibling;if(a){let l=a;for(;;){let u=l.firstChild;if(!u||u.nodeType!=1||u.contentEditable=="false"||/^(BR|IMG)$/.test(u.nodeName))break;l=u}l.insertBefore(s,l.firstChild),r==s&&t.domSelection().collapse(s,i)}else s.parentNode.removeChild(s)}}function noe(t,e,n){let{node:r,fromOffset:i,toOffset:s,from:a,to:l}=t.docView.parseRange(e,n),u=t.domSelectionRange(),d,f=u.anchorNode;if(f&&t.dom.contains(f.nodeType==1?f:f.parentNode)&&(d=[{node:f,offset:u.anchorOffset}],zb(u)||d.push({node:u.focusNode,offset:u.focusOffset})),Hr&&t.input.lastKeyCode===8)for(let x=s;x>i;x--){let S=r.childNodes[x-1],C=S.pmViewDesc;if(S.nodeName=="BR"&&!C){s=x;break}if(!C||C.size)break}let p=t.state.doc,g=t.someProp("domParser")||Gf.fromSchema(t.state.schema),b=p.resolve(a),v=null,E=g.parse(r,{topNode:b.parent,topMatch:b.parent.contentMatchAt(b.index()),topOpen:!0,from:i,to:s,preserveWhitespace:b.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:roe,context:b});if(d&&d[0].pos!=null){let x=d[0].pos,S=d[1]&&d[1].pos;S==null&&(S=x),v={anchor:x+a,head:S+a}}return{doc:E,sel:v,from:a,to:l}}function roe(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(ei&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||ei&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const ioe=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function soe(t,e,n,r,i){let s=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let F=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,G=Tx(t,F);if(G&&!t.state.selection.eq(G)){if(Hr&&Eo&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",q=>q(t,Lu(13,"Enter"))))return;let Z=t.state.tr.setSelection(G);F=="pointer"?Z.setMeta("pointer",!0):F=="key"&&Z.scrollIntoView(),s&&Z.setMeta("composition",s),t.dispatch(Z)}return}let a=t.state.doc.resolve(e),l=a.sharedDepth(n);e=a.before(l+1),n=t.state.doc.resolve(n).after(l+1);let u=t.state.selection,d=noe(t,e,n),f=t.state.doc,p=f.slice(d.from,d.to),g,b;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(g=t.state.selection.to,b="end"):(g=t.state.selection.from,b="start"),t.input.lastKeyCode=null;let v=loe(p.content,d.doc.content,d.from,g,b);if(v&&t.input.domChangeCount++,(Od&&t.input.lastIOSEnter>Date.now()-225||Eo)&&i.some(F=>F.nodeType==1&&!ioe.test(F.nodeName))&&(!v||v.endA>=v.endB)&&t.someProp("handleKeyDown",F=>F(t,Lu(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!v)if(r&&u instanceof Et&&!u.empty&&u.$head.sameParent(u.$anchor)&&!t.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))v={start:u.from,endA:u.to,endB:u.to};else{if(d.sel){let F=GC(t,t.state.doc,d.sel);if(F&&!F.eq(t.state.selection)){let G=t.state.tr.setSelection(F);s&&G.setMeta("composition",s),t.dispatch(G)}}return}t.state.selection.from<t.state.selection.to&&v.start==v.endB&&t.state.selection instanceof Et&&(v.start>t.state.selection.from&&v.start<=t.state.selection.from+2&&t.state.selection.from>=d.from?v.start=t.state.selection.from:v.endA<t.state.selection.to&&v.endA>=t.state.selection.to-2&&t.state.selection.to<=d.to&&(v.endB+=t.state.selection.to-v.endA,v.endA=t.state.selection.to)),Gi&&jl<=11&&v.endB==v.start+1&&v.endA==v.start&&v.start>d.from&&d.doc.textBetween(v.start-d.from-1,v.start-d.from+1)=="  "&&(v.start--,v.endA--,v.endB--);let E=d.doc.resolveNoCache(v.start-d.from),x=d.doc.resolveNoCache(v.endB-d.from),S=f.resolve(v.start),C=E.sameParent(x)&&E.parent.inlineContent&&S.end()>=v.endA;if((Od&&t.input.lastIOSEnter>Date.now()-225&&(!C||i.some(F=>F.nodeName=="DIV"||F.nodeName=="P"))||!C&&E.pos<d.doc.content.size&&(!E.sameParent(x)||!E.parent.inlineContent)&&E.pos<x.pos&&!/\S/.test(d.doc.textBetween(E.pos,x.pos,"","")))&&t.someProp("handleKeyDown",F=>F(t,Lu(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>v.start&&ooe(f,v.start,v.endA,E,x)&&t.someProp("handleKeyDown",F=>F(t,Lu(8,"Backspace")))){Eo&&Hr&&t.domObserver.suppressSelectionUpdates();return}Hr&&v.endB==v.start&&(t.input.lastChromeDelete=Date.now()),Eo&&!C&&E.start()!=x.start()&&x.parentOffset==0&&E.depth==x.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==v.endA&&(v.endB-=2,x=d.doc.resolveNoCache(v.endB-d.from),setTimeout(()=>{t.someProp("handleKeyDown",function(F){return F(t,Lu(13,"Enter"))})},20));let O=v.start,L=v.endA,D=F=>{let G=F||t.state.tr.replace(O,L,d.doc.slice(v.start-d.from,v.endB-d.from));if(d.sel){let Z=GC(t,G.doc,d.sel);Z&&!(Hr&&t.composing&&Z.empty&&(v.start!=v.endB||t.input.lastChromeDelete<Date.now()-100)&&(Z.head==O||Z.head==G.mapping.map(L)-1)||Gi&&Z.empty&&Z.head==O)&&G.setSelection(Z)}return s&&G.setMeta("composition",s),G.scrollIntoView()},R;if(C)if(E.pos==x.pos){Gi&&jl<=11&&E.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Co(t),20));let F=D(t.state.tr.delete(O,L)),G=f.resolve(v.start).marksAcross(f.resolve(v.endA));G&&F.ensureMarks(G),t.dispatch(F)}else if(v.endA==v.endB&&(R=aoe(E.parent.content.cut(E.parentOffset,x.parentOffset),S.parent.content.cut(S.parentOffset,v.endA-S.start())))){let F=D(t.state.tr);R.type=="add"?F.addMark(O,L,R.mark):F.removeMark(O,L,R.mark),t.dispatch(F)}else if(E.parent.child(E.index()).isText&&E.index()==x.index()-(x.textOffset?0:1)){let F=E.parent.textBetween(E.parentOffset,x.parentOffset),G=()=>D(t.state.tr.insertText(F,O,L));t.someProp("handleTextInput",Z=>Z(t,O,L,F,G))||t.dispatch(G())}else t.dispatch(D());else t.dispatch(D())}function GC(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Sx(t,e.resolve(n.anchor),e.resolve(n.head))}function aoe(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,s=r,a,l,u;for(let f=0;f<r.length;f++)i=r[f].removeFromSet(i);for(let f=0;f<n.length;f++)s=n[f].removeFromSet(s);if(i.length==1&&s.length==0)l=i[0],a="add",u=f=>f.mark(l.addToSet(f.marks));else if(i.length==0&&s.length==1)l=s[0],a="remove",u=f=>f.mark(l.removeFromSet(f.marks));else return null;let d=[];for(let f=0;f<e.childCount;f++)d.push(u(e.child(f)));if(ke.from(d).eq(t))return{mark:l,type:a}}function ooe(t,e,n,r,i){if(n-e<=i.pos-r.pos||wE(r,!0,!1)<i.pos)return!1;let s=t.resolve(e);if(!r.parent.isTextblock){let l=s.nodeAfter;return l!=null&&n==e+l.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let a=t.resolve(wE(s,!0,!0));return!a.parent.isTextblock||a.pos>n||wE(a,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(a.parent.content)}function wE(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let s=t.node(r).maybeChild(t.indexAfter(r));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function loe(t,e,n,r,i){let s=t.findDiffStart(e,n);if(s==null)return null;let{a,b:l}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let u=Math.max(0,s-Math.min(a,l));r-=a+u-s}if(a<s&&t.size<e.size){let u=r<=s&&r>=a?s-r:0;s-=u,s&&s<e.size&&YC(e.textBetween(s-1,s+1))&&(s+=u?1:-1),l=s+(l-a),a=s}else if(l<s){let u=r<=s&&r>=l?s-r:0;s-=u,s&&s<t.size&&YC(t.textBetween(s-1,s+1))&&(s+=u?1:-1),a=s+(a-l),l=s}return{start:s,endA:a,endB:l}}function YC(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class KD{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Sae,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(ZC),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=XC(this),KC(this),this.nodeViews=QC(this),this.docView=AC(this.state.doc,WC(this),SE(this),this.dom,this),this.domObserver=new Qae(this,(r,i,s,a)=>soe(this,r,i,s,a)),this.domObserver.start(),wae(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&h3(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(ZC),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,s=!1,a=!1;e.storedMarks&&this.composing&&(jD(this),a=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let b=QC(this);coe(b,this.nodeViews)&&(this.nodeViews=b,s=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&h3(this),this.editable=XC(this),KC(this);let u=SE(this),d=WC(this),f=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",p=s||!this.docView.matchesNode(e.doc,d,u);(p||!e.selection.eq(i.selection))&&(a=!0);let g=f=="preserve"&&a&&this.dom.style.overflowAnchor==null&&Use(this);if(a){this.domObserver.stop();let b=p&&(Gi||Hr)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&uoe(i.selection,e.selection);if(p){let v=Hr?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Uae(this)),(s||!this.docView.update(e.doc,d,u,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=AC(e.doc,d,u,this.dom,this)),v&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(b=!0)}b||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&uae(this))?Co(this,b):(OD(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),f=="reset"?this.dom.scrollTop=0:f=="to selection"?this.scrollToSelection():g&&Fse(g)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof ct){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&xC(this,n.getBoundingClientRect(),e)}else xC(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let s=r.from+(this.state.doc.content.size-n.doc.content.size);(s>0&&this.state.doc.nodeAt(s))==r.node&&(i=s)}this.dragging=new qD(e.slice,e.move,i<0?void 0:ct.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let a=0;a<this.directPlugins.length;a++){let l=this.directPlugins[a].props[e];if(l!=null&&(i=n?n(l):l))return i}let s=this.state.plugins;if(s)for(let a=0;a<s.length;a++){let l=s[a].props[e];if(l!=null&&(i=n?n(l):l))return i}}hasFocus(){if(Gi){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Hse(this.dom),Co(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Gse(this,e)}coordsAtPos(e,n=1){return xD(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return Qse(this,n||this.state,e)}pasteHTML(e,n){return vh(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return vh(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return wx(this,e)}destroy(){this.docView&&(kae(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],SE(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Nse())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Aae(this,e)}domSelectionRange(){let e=this.domSelection();return e?ei&&this.root.nodeType===11&&Ise(this.dom.ownerDocument)==this.dom&&Jae(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}KD.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function WC(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Si.node(0,t.state.doc.content.size,e)]}function KC(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Si.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function XC(t){return!t.someProp("editable",e=>e(t.state)===!1)}function uoe(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function QC(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function coe(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function ZC(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Ql={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},u1={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},doe=typeof navigator<"u"&&/Mac/.test(navigator.platform),foe=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Zr=0;Zr<10;Zr++)Ql[48+Zr]=Ql[96+Zr]=String(Zr);for(var Zr=1;Zr<=24;Zr++)Ql[Zr+111]="F"+Zr;for(var Zr=65;Zr<=90;Zr++)Ql[Zr]=String.fromCharCode(Zr+32),u1[Zr]=String.fromCharCode(Zr);for(var kE in Ql)u1.hasOwnProperty(kE)||(u1[kE]=Ql[kE]);function hoe(t){var e=doe&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||foe&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?u1:Ql)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const poe=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),moe=typeof navigator<"u"&&/Win/.test(navigator.platform);function goe(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,s,a;for(let l=0;l<e.length-1;l++){let u=e[l];if(/^(cmd|meta|m)$/i.test(u))a=!0;else if(/^a(lt)?$/i.test(u))r=!0;else if(/^(c|ctrl|control)$/i.test(u))i=!0;else if(/^s(hift)?$/i.test(u))s=!0;else if(/^mod$/i.test(u))poe?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+u)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),a&&(n="Meta-"+n),s&&(n="Shift-"+n),n}function boe(t){let e=Object.create(null);for(let n in t)e[goe(n)]=t[n];return e}function CE(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function voe(t){return new zn({props:{handleKeyDown:Mx(t)}})}function Mx(t){let e=boe(t);return function(n,r){let i=hoe(r),s,a=e[CE(i,r)];if(a&&a(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let l=e[CE(i,r,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(moe&&r.ctrlKey&&r.altKey)&&(s=Ql[r.keyCode])&&s!=i){let l=e[CE(s,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}var yoe=Object.defineProperty,Rx=(t,e)=>{for(var n in e)yoe(t,n,{get:e[n],enumerable:!0})};function Hb(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:s}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,s=n.storedMarks,n}}}var jb=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:r}=e,{tr:i}=n,s=this.buildProps(i);return Object.fromEntries(Object.entries(t).map(([a,l])=>[a,(...d)=>{const f=l(...d)(s);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(i),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,a=[],l=!!t,u=t||i.tr,d=()=>(!l&&e&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(u),a.every(p=>p===!0)),f={...Object.fromEntries(Object.entries(n).map(([p,g])=>[p,(...v)=>{const E=this.buildProps(u,e),x=g(...v)(E);return a.push(x),f}])),run:d};return f}createCan(t){const{rawCommands:e,state:n}=this,r=!1,i=t||n.tr,s=this.buildProps(i,r);return{...Object.fromEntries(Object.entries(e).map(([l,u])=>[l,(...d)=>u(...d)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,r)}}buildProps(t,e=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,a={tr:t,editor:r,view:s,state:Hb({state:i,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map(([l,u])=>[l,(...d)=>u(...d)(a)]))}};return a}},XD={};Rx(XD,{blur:()=>Eoe,clearContent:()=>_oe,clearNodes:()=>xoe,command:()=>Toe,createParagraphNear:()=>Soe,cut:()=>woe,deleteCurrentNode:()=>koe,deleteNode:()=>Coe,deleteRange:()=>Aoe,deleteSelection:()=>Noe,enter:()=>Ooe,exitCode:()=>Moe,extendMarkRange:()=>Roe,first:()=>Doe,focus:()=>Loe,forEach:()=>Poe,insertContent:()=>Boe,insertContentAt:()=>Foe,joinBackward:()=>$oe,joinDown:()=>joe,joinForward:()=>qoe,joinItemBackward:()=>Voe,joinItemForward:()=>Goe,joinTextblockBackward:()=>Yoe,joinTextblockForward:()=>Woe,joinUp:()=>Hoe,keyboardShortcut:()=>Xoe,lift:()=>Qoe,liftEmptyBlock:()=>Zoe,liftListItem:()=>Joe,newlineInCode:()=>ele,resetAttributes:()=>tle,scrollIntoView:()=>nle,selectAll:()=>rle,selectNodeBackward:()=>ile,selectNodeForward:()=>sle,selectParentNode:()=>ale,selectTextblockEnd:()=>ole,selectTextblockStart:()=>lle,setContent:()=>ule,setMark:()=>Ale,setMeta:()=>Nle,setNode:()=>Ole,setNodeSelection:()=>Mle,setTextDirection:()=>Rle,setTextSelection:()=>Dle,sinkListItem:()=>Ile,splitBlock:()=>Lle,splitListItem:()=>Ple,toggleList:()=>Ble,toggleMark:()=>zle,toggleNode:()=>Ule,toggleWrap:()=>Fle,undoInputRule:()=>Hle,unsetAllMarks:()=>jle,unsetMark:()=>$le,unsetTextDirection:()=>qle,updateAttributes:()=>Vle,wrapIn:()=>Gle,wrapInList:()=>Yle});var Eoe=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),_oe=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),xoe=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:s,$to:a})=>{t.doc.nodesBetween(s.pos,a.pos,(l,u)=>{if(l.type.isText)return;const{doc:d,mapping:f}=e,p=d.resolve(f.map(u)),g=d.resolve(f.map(u+l.nodeSize)),b=p.blockRange(g);if(!b)return;const v=Qd(b);if(l.type.isTextblock){const{defaultType:E}=p.parent.contentMatchAt(p.index());e.setNodeMarkup(b.start,E)}(v||v===0)&&e.lift(b,v)})}),!0},Toe=t=>e=>t(e),Soe=()=>({state:t,dispatch:e})=>dD(t,e),woe=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,s=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const a=r.mapping.map(e);return r.insert(a,s.content),r.setSelection(new Et(r.doc.resolve(Math.max(a-1,0)))),!0},koe=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===r.type){if(e){const l=i.before(s),u=i.after(s);t.delete(l,u).scrollIntoView()}return!0}return!1};function kr(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}var Coe=t=>({tr:e,state:n,dispatch:r})=>{const i=kr(t,n.schema),s=e.selection.$anchor;for(let a=s.depth;a>0;a-=1)if(s.node(a).type===i){if(r){const u=s.before(a),d=s.after(a);e.delete(u,d).scrollIntoView()}return!0}return!1},Aoe=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},Noe=()=>({state:t,dispatch:e})=>bx(t,e),Ooe=()=>({commands:t})=>t.keyboardShortcut("Enter"),Moe=()=>({state:t,dispatch:e})=>pse(t,e);function Dx(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function c1(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Dx(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function QD(t,e,n={}){return t.find(r=>r.type===e&&c1(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function JC(t,e,n={}){return!!QD(t,e,n)}function Ix(t,e,n){var r;if(!t||!e)return;let i=t.parent.childAfter(t.parentOffset);if((!i.node||!i.node.marks.some(f=>f.type===e))&&(i=t.parent.childBefore(t.parentOffset)),!i.node||!i.node.marks.some(f=>f.type===e)||(n=n||((r=i.node.marks[0])==null?void 0:r.attrs),!QD([...i.node.marks],e,n)))return;let a=i.index,l=t.start()+i.offset,u=a+1,d=l+i.node.nodeSize;for(;a>0&&JC([...t.parent.child(a-1).marks],e,n);)a-=1,l-=t.parent.child(a).nodeSize;for(;u<t.parent.childCount&&JC([...t.parent.child(u).marks],e,n);)d+=t.parent.child(u).nodeSize,u+=1;return{from:l,to:d}}function Uo(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}var Roe=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const s=Uo(t,r.schema),{doc:a,selection:l}=n,{$from:u,from:d,to:f}=l;if(i){const p=Ix(u,s,e);if(p&&p.from<=d&&p.to>=f){const g=Et.create(a,p.from,p.to);n.setSelection(g)}}return!0},Doe=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function Lx(t){return t instanceof Et}function _o(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function ZD(t,e=null){if(!e)return null;const n=vt.atStart(t),r=vt.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,s=r.to;return e==="all"?Et.create(t,_o(0,i,s),_o(t.content.size,i,s)):Et.create(t,_o(e,i,s),_o(e,i,s))}function e7(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function d1(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Ioe(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var Loe=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const a=()=>{(d1()||e7())&&r.dom.focus(),Ioe()&&!d1()&&!e7()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&t===null||t===!1)return!0}catch{return!1}if(s&&t===null&&!Lx(n.state.selection))return a(),!0;const l=ZD(i.doc,t)||n.state.selection,u=n.state.selection.eq(l);return s&&(u||i.setSelection(l),u&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},Poe=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),Boe=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),JD=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&JD(r)}return t};function Wm(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return JD(n)}function Eh(t,e,n){if(t instanceof Hl||t instanceof ke)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return ke.fromArray(t.map(l=>e.nodeFromJSON(l)));const a=e.nodeFromJSON(t);return n.errorOnInvalidContent&&a.check(),a}catch(s){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",s),Eh("",e,n)}if(i){if(n.errorOnInvalidContent){let a=!1,l="";const u=new BR({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:d=>(a=!0,l=typeof d=="string"?d:d.outerHTML,null)}]}})});if(n.slice?Gf.fromSchema(u).parseSlice(Wm(t),n.parseOptions):Gf.fromSchema(u).parse(Wm(t),n.parseOptions),n.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const s=Gf.fromSchema(e);return n.slice?s.parseSlice(Wm(t),n.parseOptions).content:s.parse(Wm(t),n.parseOptions)}return Eh("",e,n)}function zoe(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof Ur||i instanceof jr))return;const s=t.mapping.maps[r];let a=0;s.forEach((l,u,d,f)=>{a===0&&(a=f)}),t.setSelection(vt.near(t.doc.resolve(a),n))}var Uoe=t=>!("type"in t),Foe=(t,e,n)=>({tr:r,dispatch:i,editor:s})=>{var a;if(i){n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;const u=x=>{s.emit("contentError",{editor:s,error:x,disableCollaboration:()=>{"collaboration"in s.storage&&typeof s.storage.collaboration=="object"&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},d={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{Eh(e,s.schema,{parseOptions:d,errorOnInvalidContent:!0})}catch(x){u(x)}try{l=Eh(e,s.schema,{parseOptions:d,errorOnInvalidContent:(a=n.errorOnInvalidContent)!=null?a:s.options.enableContentCheck})}catch(x){return u(x),!1}let{from:f,to:p}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},g=!0,b=!0;if((Uoe(l)?l:[l]).forEach(x=>{x.check(),g=g?x.isText&&x.marks.length===0:!1,b=b?x.isBlock:!1}),f===p&&b){const{parent:x}=r.doc.resolve(f);x.isTextblock&&!x.type.spec.code&&!x.childCount&&(f-=1,p+=1)}let E;if(g){if(Array.isArray(e))E=e.map(x=>x.text||"").join("");else if(e instanceof ke){let x="";e.forEach(S=>{S.text&&(x+=S.text)}),E=x}else typeof e=="object"&&e&&e.text?E=e.text:E=e;r.insertText(E,f,p)}else{E=l;const x=r.doc.resolve(f),S=x.node(),C=x.parentOffset===0,O=S.isText||S.isTextblock,L=S.content.size>0;C&&O&&L&&(f=Math.max(0,f-1)),r.replaceWith(f,p,E)}n.updateSelection&&zoe(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:f,text:E}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:f,text:E})}return!0},Hoe=()=>({state:t,dispatch:e})=>dse(t,e),joe=()=>({state:t,dispatch:e})=>fse(t,e),$oe=()=>({state:t,dispatch:e})=>iD(t,e),qoe=()=>({state:t,dispatch:e})=>lD(t,e),Voe=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Lb(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},Goe=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Lb(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},Yoe=()=>({state:t,dispatch:e})=>use(t,e),Woe=()=>({state:t,dispatch:e})=>cse(t,e);function eI(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function Koe(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,s,a;for(let l=0;l<e.length-1;l+=1){const u=e[l];if(/^(cmd|meta|m)$/i.test(u))a=!0;else if(/^a(lt)?$/i.test(u))r=!0;else if(/^(c|ctrl|control)$/i.test(u))i=!0;else if(/^s(hift)?$/i.test(u))s=!0;else if(/^mod$/i.test(u))d1()||eI()?a=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${u}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),a&&(n=`Meta-${n}`),s&&(n=`Shift-${n}`),n}var Xoe=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const s=Koe(t).split(/-(?!$)/),a=s.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),l=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),u=e.captureTransaction(()=>{n.someProp("handleKeyDown",d=>d(n,l))});return u==null||u.steps.forEach(d=>{const f=d.map(r.mapping);f&&i&&r.maybeStep(f)}),!0};function Zl(t,e,n={}){const{from:r,to:i,empty:s}=t.selection,a=e?kr(e,t.schema):null,l=[];t.doc.nodesBetween(r,i,(p,g)=>{if(p.isText)return;const b=Math.max(r,g),v=Math.min(i,g+p.nodeSize);l.push({node:p,from:b,to:v})});const u=i-r,d=l.filter(p=>a?a.name===p.node.type.name:!0).filter(p=>c1(p.node.attrs,n,{strict:!1}));return s?!!d.length:d.reduce((p,g)=>p+g.to-g.from,0)>=u}var Qoe=(t,e={})=>({state:n,dispatch:r})=>{const i=kr(t,n.schema);return Zl(n,i,e)?hse(n,r):!1},Zoe=()=>({state:t,dispatch:e})=>fD(t,e),Joe=t=>({state:e,dispatch:n})=>{const r=kr(t,e.schema);return wse(r)(e,n)},ele=()=>({state:t,dispatch:e})=>cD(t,e);function $b(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function t7(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}var tle=(t,e)=>({tr:n,state:r,dispatch:i})=>{let s=null,a=null;const l=$b(typeof t=="string"?t:t.name,r.schema);if(!l)return!1;l==="node"&&(s=kr(t,r.schema)),l==="mark"&&(a=Uo(t,r.schema));let u=!1;return n.selection.ranges.forEach(d=>{r.doc.nodesBetween(d.$from.pos,d.$to.pos,(f,p)=>{s&&s===f.type&&(u=!0,i&&n.setNodeMarkup(p,void 0,t7(f.attrs,e))),a&&f.marks.length&&f.marks.forEach(g=>{a===g.type&&(u=!0,i&&n.addMark(p,p+f.nodeSize,a.create(t7(g.attrs,e))))})})}),u},nle=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),rle=()=>({tr:t,dispatch:e})=>{if(e){const n=new fs(t.doc);t.setSelection(n)}return!0},ile=()=>({state:t,dispatch:e})=>aD(t,e),sle=()=>({state:t,dispatch:e})=>uD(t,e),ale=()=>({state:t,dispatch:e})=>bse(t,e),ole=()=>({state:t,dispatch:e})=>Ese(t,e),lle=()=>({state:t,dispatch:e})=>yse(t,e);function p3(t,e,n={},r={}){return Eh(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var ule=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:s,dispatch:a,commands:l})=>{const{doc:u}=s;if(r.preserveWhitespace!=="full"){const d=p3(t,i.schema,r,{errorOnInvalidContent:e??i.options.enableContentCheck});return a&&s.replaceWith(0,u.content.size,d).setMeta("preventUpdate",!n),!0}return a&&s.setMeta("preventUpdate",!n),l.insertContentAt({from:0,to:u.content.size},t,{parseOptions:r,errorOnInvalidContent:e??i.options.enableContentCheck})};function tI(t,e){const n=Uo(e,t.schema),{from:r,to:i,empty:s}=t.selection,a=[];s?(t.storedMarks&&a.push(...t.storedMarks),a.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,u=>{a.push(...u.marks)});const l=a.find(u=>u.type.name===n.name);return l?{...l.attrs}:{}}function nI(t,e){const n=new JR(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function cle(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function dle(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(i,s)=>{n(i)&&r.push({node:i,pos:s})}),r}function fle(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function qb(t){return e=>fle(e.$from,t)}function at(t,e,n){return t.config[e]===void 0&&t.parent?at(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?at(t.parent,e,n):null}):t.config[e]}function Px(t){return t.map(e=>{const n={name:e.name,options:e.options,storage:e.storage},r=at(e,"addExtensions",n);return r?[e,...Px(r())]:e}).flat(10)}function Bx(t,e){const n=uc.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function rI(t){return typeof t=="function"}function cn(t,e=void 0,...n){return rI(t)?e?t.bind(e)(...n):t(...n):t}function hle(t={}){return Object.keys(t).length===0&&t.constructor===Object}function Md(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function iI(t){const e=[],{nodeExtensions:n,markExtensions:r}=Md(t),i=[...n,...r],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(a=>{const l={name:a.name,options:a.options,storage:a.storage,extensions:i},u=at(a,"addGlobalAttributes",l);if(!u)return;u().forEach(f=>{f.types.forEach(p=>{Object.entries(f.attributes).forEach(([g,b])=>{e.push({type:p,name:g,attribute:{...s,...b}})})})})}),i.forEach(a=>{const l={name:a.name,options:a.options,storage:a.storage},u=at(a,"addAttributes",l);if(!u)return;const d=u();Object.entries(d).forEach(([f,p])=>{const g={...s,...p};typeof(g==null?void 0:g.default)=="function"&&(g.default=g.default()),g!=null&&g.isRequired&&(g==null?void 0:g.default)===void 0&&delete g.default,e.push({type:a.name,name:f,attribute:g})})}),e}function Cr(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,s])=>{if(!r[i]){r[i]=s;return}if(i==="class"){const l=s?String(s).split(" "):[],u=r[i]?r[i].split(" "):[],d=l.filter(f=>!u.includes(f));r[i]=[...u,...d].join(" ")}else if(i==="style"){const l=s?s.split(";").map(f=>f.trim()).filter(Boolean):[],u=r[i]?r[i].split(";").map(f=>f.trim()).filter(Boolean):[],d=new Map;u.forEach(f=>{const[p,g]=f.split(":").map(b=>b.trim());d.set(p,g)}),l.forEach(f=>{const[p,g]=f.split(":").map(b=>b.trim());d.set(p,g)}),r[i]=Array.from(d.entries()).map(([f,p])=>`${f}: ${p}`).join("; ")}else r[i]=s}),r},{})}function _h(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>Cr(n,r),{})}function ple(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function n7(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((s,a)=>{const l=a.attribute.parseHTML?a.attribute.parseHTML(n):ple(n.getAttribute(a.name));return l==null?s:{...s,[a.name]:l}},{});return{...r,...i}}}}function r7(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&hle(n)?!1:n!=null))}function i7(t){var e,n;const r={};return!((e=t==null?void 0:t.attribute)!=null&&e.isRequired)&&"default"in((t==null?void 0:t.attribute)||{})&&(r.default=t.attribute.default),((n=t==null?void 0:t.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=t.attribute.validate),[t.name,r]}function mle(t,e){var n;const r=iI(t),{nodeExtensions:i,markExtensions:s}=Md(t),a=(n=i.find(d=>at(d,"topNode")))==null?void 0:n.name,l=Object.fromEntries(i.map(d=>{const f=r.filter(S=>S.type===d.name),p={name:d.name,options:d.options,storage:d.storage,editor:e},g=t.reduce((S,C)=>{const O=at(C,"extendNodeSchema",p);return{...S,...O?O(d):{}}},{}),b=r7({...g,content:cn(at(d,"content",p)),marks:cn(at(d,"marks",p)),group:cn(at(d,"group",p)),inline:cn(at(d,"inline",p)),atom:cn(at(d,"atom",p)),selectable:cn(at(d,"selectable",p)),draggable:cn(at(d,"draggable",p)),code:cn(at(d,"code",p)),whitespace:cn(at(d,"whitespace",p)),linebreakReplacement:cn(at(d,"linebreakReplacement",p)),defining:cn(at(d,"defining",p)),isolating:cn(at(d,"isolating",p)),attrs:Object.fromEntries(f.map(i7))}),v=cn(at(d,"parseHTML",p));v&&(b.parseDOM=v.map(S=>n7(S,f)));const E=at(d,"renderHTML",p);E&&(b.toDOM=S=>E({node:S,HTMLAttributes:_h(S,f)}));const x=at(d,"renderText",p);return x&&(b.toText=x),[d.name,b]})),u=Object.fromEntries(s.map(d=>{const f=r.filter(x=>x.type===d.name),p={name:d.name,options:d.options,storage:d.storage,editor:e},g=t.reduce((x,S)=>{const C=at(S,"extendMarkSchema",p);return{...x,...C?C(d):{}}},{}),b=r7({...g,inclusive:cn(at(d,"inclusive",p)),excludes:cn(at(d,"excludes",p)),group:cn(at(d,"group",p)),spanning:cn(at(d,"spanning",p)),code:cn(at(d,"code",p)),attrs:Object.fromEntries(f.map(i7))}),v=cn(at(d,"parseHTML",p));v&&(b.parseDOM=v.map(x=>n7(x,f)));const E=at(d,"renderHTML",p);return E&&(b.toDOM=x=>E({mark:x,HTMLAttributes:_h(x,f)})),[d.name,b]}));return new BR({topNode:a,nodes:l,marks:u})}function gle(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function f1(t){return t.sort((n,r)=>{const i=at(n,"priority")||100,s=at(r,"priority")||100;return i>s?-1:i<s?1:0})}function sI(t){const e=f1(Px(t)),n=gle(e.map(r=>r.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function aI(t,e,n){const{from:r,to:i}=e,{blockSeparator:s=`

`,textSerializers:a={}}=n||{};let l="";return t.nodesBetween(r,i,(u,d,f,p)=>{var g;u.isBlock&&d>r&&(l+=s);const b=a==null?void 0:a[u.type.name];if(b)return f&&(l+=b({node:u,pos:d,parent:f,index:p,range:e})),!1;u.isText&&(l+=(g=u==null?void 0:u.text)==null?void 0:g.slice(Math.max(r,d)-d,i-d))}),l}function oI(t,e){const n={from:0,to:t.content.size};return aI(t,n,e)}function zx(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function ble(t,e){const n=kr(e,t.schema),{from:r,to:i}=t.selection,s=[];t.doc.nodesBetween(r,i,l=>{s.push(l)});const a=s.reverse().find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function lI(t,e){const n=$b(typeof e=="string"?e:e.name,t.schema);return n==="node"?ble(t,e):n==="mark"?tI(t,e):{}}function vle(t,e=JSON.stringify){const n={};return t.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function yle(t){const e=vle(t);return e.length===1?e:e.filter((n,r)=>!e.filter((s,a)=>a!==r).some(s=>n.oldRange.from>=s.oldRange.from&&n.oldRange.to<=s.oldRange.to&&n.newRange.from>=s.newRange.from&&n.newRange.to<=s.newRange.to))}function uI(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((i,s)=>{const a=[];if(i.ranges.length)i.forEach((l,u)=>{a.push({from:l,to:u})});else{const{from:l,to:u}=n[s];if(l===void 0||u===void 0)return;a.push({from:l,to:u})}a.forEach(({from:l,to:u})=>{const d=e.slice(s).map(l,-1),f=e.slice(s).map(u),p=e.invert().map(d,-1),g=e.invert().map(f);r.push({oldRange:{from:p,to:g},newRange:{from:d,to:f}})})}),yle(r)}function Ux(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const s=n.resolve(t),a=Ix(s,i.type);a&&r.push({mark:i,...a})}):n.nodesBetween(t,e,(i,s)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(a=>({from:s,to:s+i.nodeSize,mark:a})))}),r}var Ele=(t,e,n,r=20)=>{const i=t.doc.resolve(n);let s=r,a=null;for(;s>0&&a===null;){const l=i.node(s);(l==null?void 0:l.type.name)===e?a=l:s-=1}return[a,s]};function Km(t,e){return e.nodes[t]||e.marks[t]||null}function Cg(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(s=>s.type===e&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}var _le=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,s,a,l)=>{var u,d;const f=((d=(u=i.type.spec).toText)==null?void 0:d.call(u,{node:i,pos:s,parent:a,index:l}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?f:f.slice(0,Math.max(0,r-s))}),n};function m3(t,e,n={}){const{empty:r,ranges:i}=t.selection,s=e?Uo(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(p=>s?s.name===p.type.name:!0).find(p=>c1(p.attrs,n,{strict:!1}));let a=0;const l=[];if(i.forEach(({$from:p,$to:g})=>{const b=p.pos,v=g.pos;t.doc.nodesBetween(b,v,(E,x)=>{if(!E.isText&&!E.marks.length)return;const S=Math.max(b,x),C=Math.min(v,x+E.nodeSize),O=C-S;a+=O,l.push(...E.marks.map(L=>({mark:L,from:S,to:C})))})}),a===0)return!1;const u=l.filter(p=>s?s.name===p.mark.type.name:!0).filter(p=>c1(p.mark.attrs,n,{strict:!1})).reduce((p,g)=>p+g.to-g.from,0),d=l.filter(p=>s?p.mark.type!==s&&p.mark.type.excludes(s):!0).reduce((p,g)=>p+g.to-g.from,0);return(u>0?u+d:u)>=a}function xle(t,e,n={}){if(!e)return Zl(t,null,n)||m3(t,null,n);const r=$b(e,t.schema);return r==="node"?Zl(t,e,n):r==="mark"?m3(t,e,n):!1}var Tle=(t,e)=>{const{$from:n,$to:r,$anchor:i}=t.selection;if(e){const s=qb(l=>l.type.name===e)(t.selection);if(!s)return!1;const a=t.doc.resolve(s.pos+1);return i.pos+1===a.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},Sle=t=>{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function s7(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function a7(t,e){const{nodeExtensions:n}=Md(e),r=n.find(a=>a.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},s=cn(at(r,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function Vb(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!=null?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(s=>{i!==!1&&(Vb(s,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function cI(t){return t instanceof ct}var dI=class fI{constructor(e){this.position=e}static fromJSON(e){return new fI(e.position)}toJSON(){return{position:this.position}}};function wle(t,e){const n=e.mapping.mapResult(t.position);return{position:new dI(n.pos),mapResult:n}}function kle(t){return new dI(t)}function hI(t,e,n){const i=t.state.doc.content.size,s=_o(e,0,i),a=_o(n,0,i),l=t.coordsAtPos(s),u=t.coordsAtPos(a,-1),d=Math.min(l.top,u.top),f=Math.max(l.bottom,u.bottom),p=Math.min(l.left,u.left),g=Math.max(l.right,u.right),b=g-p,v=f-d,S={top:d,bottom:f,left:p,right:g,width:b,height:v,x:p,y:d};return{...S,toJSON:()=>S}}function Cle(t,e,n){var r;const{selection:i}=e;let s=null;if(Lx(i)&&(s=i.$cursor),s){const l=(r=t.storedMarks)!=null?r:s.marks();return s.parent.type.allowsMarkType(n)&&(!!n.isInSet(l)||!l.some(d=>d.type.excludes(n)))}const{ranges:a}=i;return a.some(({$from:l,$to:u})=>{let d=l.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(l.pos,u.pos,(f,p,g)=>{if(d)return!1;if(f.isInline){const b=!g||g.type.allowsMarkType(n),v=!!n.isInSet(f.marks)||!f.marks.some(E=>E.type.excludes(n));d=b&&v}return!d}),d})}var Ale=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=n,{empty:a,ranges:l}=s,u=Uo(t,r.schema);if(i)if(a){const d=tI(r,u);n.addStoredMark(u.create({...d,...e}))}else l.forEach(d=>{const f=d.$from.pos,p=d.$to.pos;r.doc.nodesBetween(f,p,(g,b)=>{const v=Math.max(b,f),E=Math.min(b+g.nodeSize,p);g.marks.find(S=>S.type===u)?g.marks.forEach(S=>{u===S.type&&n.addMark(v,E,u.create({...S.attrs,...e}))}):n.addMark(v,E,u.create(e))})});return Cle(r,n,u)},Nle=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),Ole=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const s=kr(t,n.schema);let a;return n.selection.$anchor.sameParent(n.selection.$head)&&(a=n.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:l})=>yC(s,{...a,...e})(n)?!0:l.clearNodes()).command(({state:l})=>yC(s,{...a,...e})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},Mle=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=_o(t,0,r.content.size),s=ct.create(r,i);e.setSelection(s)}return!0},Rle=(t,e)=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=r;let a,l;return typeof e=="number"?(a=e,l=e):e&&"from"in e&&"to"in e?(a=e.from,l=e.to):(a=s.from,l=s.to),i&&n.doc.nodesBetween(a,l,(u,d)=>{u.isText||n.setNodeMarkup(d,void 0,{...u.attrs,dir:t})}),!0},Dle=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:s}=typeof t=="number"?{from:t,to:t}:t,a=Et.atStart(r).from,l=Et.atEnd(r).to,u=_o(i,a,l),d=_o(s,a,l),f=Et.create(r,u,d);e.setSelection(f)}return!0},Ile=t=>({state:e,dispatch:n})=>{const r=kr(t,e.schema);return Ase(r)(e,n)};function o7(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}var Lle=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:s,doc:a}=e,{$from:l,$to:u}=s,d=i.extensionManager.attributes,f=Cg(d,l.node().type.name,l.node().attrs);if(s instanceof ct&&s.node.isBlock)return!l.parentOffset||!ko(a,l.pos)?!1:(r&&(t&&o7(n,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const p=u.parentOffset===u.parent.content.size,g=l.depth===0?void 0:cle(l.node(-1).contentMatchAt(l.indexAfter(-1)));let b=p&&g?[{type:g,attrs:f}]:void 0,v=ko(e.doc,e.mapping.map(l.pos),1,b);if(!b&&!v&&ko(e.doc,e.mapping.map(l.pos),1,g?[{type:g}]:void 0)&&(v=!0,b=g?[{type:g,attrs:f}]:void 0),r){if(v&&(s instanceof Et&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,b),g&&!p&&!l.parentOffset&&l.parent.type!==g)){const E=e.mapping.map(l.before()),x=e.doc.resolve(E);l.node(-1).canReplaceWith(x.index(),x.index()+1,g)&&e.setNodeMarkup(e.mapping.map(l.before()),g)}t&&o7(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return v},Ple=(t,e={})=>({tr:n,state:r,dispatch:i,editor:s})=>{var a;const l=kr(t,r.schema),{$from:u,$to:d}=r.selection,f=r.selection.node;if(f&&f.isBlock||u.depth<2||!u.sameParent(d))return!1;const p=u.node(-1);if(p.type!==l)return!1;const g=s.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==l||u.index(-2)!==u.node(-2).childCount-1)return!1;if(i){let S=ke.empty;const C=u.index(-1)?1:u.index(-2)?2:3;for(let G=u.depth-C;G>=u.depth-3;G-=1)S=ke.from(u.node(G).copy(S));const O=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,L={...Cg(g,u.node().type.name,u.node().attrs),...e},D=((a=l.contentMatch.defaultType)==null?void 0:a.createAndFill(L))||void 0;S=S.append(ke.from(l.createAndFill(null,D)||void 0));const R=u.before(u.depth-(C-1));n.replace(R,u.after(-O),new qe(S,4-C,0));let F=-1;n.doc.nodesBetween(R,n.doc.content.size,(G,Z)=>{if(F>-1)return!1;G.isTextblock&&G.content.size===0&&(F=Z+1)}),F>-1&&n.setSelection(Et.near(n.doc.resolve(F))),n.scrollIntoView()}return!0}const b=d.pos===u.end()?p.contentMatchAt(0).defaultType:null,v={...Cg(g,p.type.name,p.attrs),...e},E={...Cg(g,u.node().type.name,u.node().attrs),...e};n.delete(u.pos,d.pos);const x=b?[{type:l,attrs:v},{type:b,attrs:E}]:[{type:l,attrs:v}];if(!ko(n.doc,u.pos,2))return!1;if(i){const{selection:S,storedMarks:C}=r,{splittableMarks:O}=s.extensionManager,L=C||S.$to.parentOffset&&S.$from.marks();if(n.split(u.pos,2,x).scrollIntoView(),!L||!i)return!0;const D=L.filter(R=>O.includes(R.type.name));n.ensureMarks(D)}return!0},AE=(t,e)=>{const n=qb(a=>a.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&ru(t.doc,n.pos)&&t.join(n.pos),!0},NE=(t,e)=>{const n=qb(a=>a.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&ru(t.doc,r)&&t.join(r),!0},Ble=(t,e,n,r={})=>({editor:i,tr:s,state:a,dispatch:l,chain:u,commands:d,can:f})=>{const{extensions:p,splittableMarks:g}=i.extensionManager,b=kr(t,a.schema),v=kr(e,a.schema),{selection:E,storedMarks:x}=a,{$from:S,$to:C}=E,O=S.blockRange(C),L=x||E.$to.parentOffset&&E.$from.marks();if(!O)return!1;const D=qb(R=>a7(R.type.name,p))(E);if(O.depth>=1&&D&&O.depth-D.depth<=1){if(D.node.type===b)return d.liftListItem(v);if(a7(D.node.type.name,p)&&b.validContent(D.node.content)&&l)return u().command(()=>(s.setNodeMarkup(D.pos,b),!0)).command(()=>AE(s,b)).command(()=>NE(s,b)).run()}return!n||!L||!l?u().command(()=>f().wrapInList(b,r)?!0:d.clearNodes()).wrapInList(b,r).command(()=>AE(s,b)).command(()=>NE(s,b)).run():u().command(()=>{const R=f().wrapInList(b,r),F=L.filter(G=>g.includes(G.type.name));return s.ensureMarks(F),R?!0:d.clearNodes()}).wrapInList(b,r).command(()=>AE(s,b)).command(()=>NE(s,b)).run()},zle=(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,a=Uo(t,r.schema);return m3(r,a,e)?i.unsetMark(a,{extendEmptyMarkRange:s}):i.setMark(a,e)},Ule=(t,e,n={})=>({state:r,commands:i})=>{const s=kr(t,r.schema),a=kr(e,r.schema),l=Zl(r,s,n);let u;return r.selection.$anchor.sameParent(r.selection.$head)&&(u=r.selection.$anchor.parent.attrs),l?i.setNode(a,u):i.setNode(s,{...u,...n})},Fle=(t,e={})=>({state:n,commands:r})=>{const i=kr(t,n.schema);return Zl(n,i,e)?r.lift(i):r.wrapIn(i,e)},Hle=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let s;if(i.spec.isInputRules&&(s=i.getState(t))){if(e){const a=t.tr,l=s.transform;for(let u=l.steps.length-1;u>=0;u-=1)a.step(l.steps[u].invert(l.docs[u]));if(s.text){const u=a.doc.resolve(s.from).marks();a.replaceWith(s.from,s.to,t.schema.text(s.text,u))}else a.delete(s.from,s.to)}return!0}}return!1},jle=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(s=>{t.removeMark(s.$from.pos,s.$to.pos)}),!0},$le=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:a=!1}=e,{selection:l}=n,u=Uo(t,r.schema),{$from:d,empty:f,ranges:p}=l;if(!i)return!0;if(f&&a){let{from:g,to:b}=l;const v=(s=d.marks().find(x=>x.type===u))==null?void 0:s.attrs,E=Ix(d,u,v);E&&(g=E.from,b=E.to),n.removeMark(g,b,u)}else p.forEach(g=>{n.removeMark(g.$from.pos,g.$to.pos,u)});return n.removeStoredMark(u),!0},qle=t=>({tr:e,state:n,dispatch:r})=>{const{selection:i}=n;let s,a;return typeof t=="number"?(s=t,a=t):t&&"from"in t&&"to"in t?(s=t.from,a=t.to):(s=i.from,a=i.to),r&&e.doc.nodesBetween(s,a,(l,u)=>{if(l.isText)return;const d={...l.attrs};delete d.dir,e.setNodeMarkup(u,void 0,d)}),!0},Vle=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let s=null,a=null;const l=$b(typeof t=="string"?t:t.name,r.schema);if(!l)return!1;l==="node"&&(s=kr(t,r.schema)),l==="mark"&&(a=Uo(t,r.schema));let u=!1;return n.selection.ranges.forEach(d=>{const f=d.$from.pos,p=d.$to.pos;let g,b,v,E;n.selection.empty?r.doc.nodesBetween(f,p,(x,S)=>{s&&s===x.type&&(u=!0,v=Math.max(S,f),E=Math.min(S+x.nodeSize,p),g=S,b=x)}):r.doc.nodesBetween(f,p,(x,S)=>{S<f&&s&&s===x.type&&(u=!0,v=Math.max(S,f),E=Math.min(S+x.nodeSize,p),g=S,b=x),S>=f&&S<=p&&(s&&s===x.type&&(u=!0,i&&n.setNodeMarkup(S,void 0,{...x.attrs,...e})),a&&x.marks.length&&x.marks.forEach(C=>{if(a===C.type&&(u=!0,i)){const O=Math.max(S,f),L=Math.min(S+x.nodeSize,p);n.addMark(O,L,a.create({...C.attrs,...e}))}}))}),b&&(g!==void 0&&i&&n.setNodeMarkup(g,void 0,{...b.attrs,...e}),a&&b.marks.length&&b.marks.forEach(x=>{a===x.type&&i&&n.addMark(v,E,a.create({...x.attrs,...e}))}))}),u},Gle=(t,e={})=>({state:n,dispatch:r})=>{const i=kr(t,n.schema);return _se(i,e)(n,r)},Yle=(t,e={})=>({state:n,dispatch:r})=>{const i=kr(t,n.schema);return xse(i,e)(n,r)},Wle=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach(r=>r.apply(this,e)),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(r=>r!==e):delete this.callbacks[t]),this}once(t,e){const n=(...r)=>{this.off(t,n),e.apply(this,r)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}},Zh=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!=null?e:!0}},Kle=(t,e)=>{if(Dx(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Xm(t){var e;const{editor:n,from:r,to:i,text:s,rules:a,plugin:l}=t,{view:u}=n;if(u.composing)return!1;const d=u.state.doc.resolve(r);if(d.parent.type.spec.code||(e=d.nodeBefore||d.nodeAfter)!=null&&e.marks.find(g=>g.type.spec.code))return!1;let f=!1;const p=_le(d)+s;return a.forEach(g=>{if(f)return;const b=Kle(p,g.find);if(!b)return;const v=u.state.tr,E=Hb({state:u.state,transaction:v}),x={from:r-(b[0].length-s.length),to:i},{commands:S,chain:C,can:O}=new jb({editor:n,state:E});g.handler({state:E,range:x,match:b,commands:S,chain:C,can:O})===null||!v.steps.length||(g.undoable&&v.setMeta(l,{transform:v,from:r,to:i,text:s}),u.dispatch(v),f=!0)}),f}function Xle(t){const{editor:e,rules:n}=t,r=new zn({state:{init(){return null},apply(i,s,a){const l=i.getMeta(r);if(l)return l;const u=i.getMeta("applyInputRules");return!!u&&setTimeout(()=>{let{text:f}=u;typeof f=="string"?f=f:f=Bx(ke.from(f),a.schema);const{from:p}=u,g=p+f.length;Xm({editor:e,from:p,to:g,text:f,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,a,l){return Xm({editor:e,from:s,to:a,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&Xm({editor:e,from:s.pos,to:s.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:a}=i.state.selection;return a?Xm({editor:e,from:a.pos,to:a.pos,text:`
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function Qle(t){return Object.prototype.toString.call(t).slice(8,-1)}function Qm(t){return Qle(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function pI(t,e){const n={...t};return Qm(t)&&Qm(e)&&Object.keys(e).forEach(r=>{Qm(e[r])&&Qm(t[r])?n[r]=pI(t[r],e[r]):n[r]=e[r]}),n}var Fx=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...cn(at(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...cn(at(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>pI(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},cc=class mI extends Fx{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new mI(n)}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const a=i.marks();if(!!!a.find(d=>(d==null?void 0:d.type.name)===n.name))return!1;const u=a.find(d=>(d==null?void 0:d.type.name)===n.name);return u&&r.removeStoredMark(u),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function Zle(t){return typeof t=="number"}var Jle=class{constructor(t){this.find=t.find,this.handler=t.handler}},eue=(t,e,n)=>{if(Dx(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(i=>{const s=[i.text];return s.index=i.index,s.input=t,s.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(i.replaceWith)),s}):[]};function tue(t){const{editor:e,state:n,from:r,to:i,rule:s,pasteEvent:a,dropEvent:l}=t,{commands:u,chain:d,can:f}=new jb({editor:e,state:n}),p=[];return n.doc.nodesBetween(r,i,(b,v)=>{var E,x,S,C,O;if((x=(E=b.type)==null?void 0:E.spec)!=null&&x.code||!(b.isText||b.isTextblock||b.isInline))return;const L=(O=(C=(S=b.content)==null?void 0:S.size)!=null?C:b.nodeSize)!=null?O:0,D=Math.max(r,v),R=Math.min(i,v+L);if(D>=R)return;const F=b.isText?b.text||"":b.textBetween(D-v,R-v,void 0,"￼");eue(F,s.find,a).forEach(Z=>{if(Z.index===void 0)return;const q=D+Z.index+1,ie=q+Z[0].length,se={from:n.tr.mapping.map(q),to:n.tr.mapping.map(ie)},Te=s.handler({state:n,range:se,match:Z,commands:u,chain:d,can:f,pasteEvent:a,dropEvent:l});p.push(Te)})}),p.every(b=>b!==null)}var Zm=null,nue=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)==null||e.setData("text/html",t),n};function rue(t){const{editor:e,rules:n}=t;let r=null,i=!1,s=!1,a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}const u=({state:f,from:p,to:g,rule:b,pasteEvt:v})=>{const E=f.tr,x=Hb({state:f,transaction:E});if(!(!tue({editor:e,state:x,from:Math.max(p-1,0),to:g.b-1,rule:b,pasteEvent:v,dropEvent:l})||!E.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,E}};return n.map(f=>new zn({view(p){const g=v=>{var E;r=(E=p.dom.parentElement)!=null&&E.contains(v.target)?p.dom.parentElement:null,r&&(Zm=e)},b=()=>{Zm&&(Zm=null)};return window.addEventListener("dragstart",g),window.addEventListener("dragend",b),{destroy(){window.removeEventListener("dragstart",g),window.removeEventListener("dragend",b)}}},props:{handleDOMEvents:{drop:(p,g)=>{if(s=r===p.dom.parentElement,l=g,!s){const b=Zm;b!=null&&b.isEditable&&setTimeout(()=>{const v=b.state.selection;v&&b.commands.deleteRange({from:v.from,to:v.to})},10)}return!1},paste:(p,g)=>{var b;const v=(b=g.clipboardData)==null?void 0:b.getData("text/html");return a=g,i=!!(v!=null&&v.includes("data-pm-slice")),!1}}},appendTransaction:(p,g,b)=>{const v=p[0],E=v.getMeta("uiEvent")==="paste"&&!i,x=v.getMeta("uiEvent")==="drop"&&!s,S=v.getMeta("applyPasteRules"),C=!!S;if(!E&&!x&&!C)return;if(C){let{text:D}=S;typeof D=="string"?D=D:D=Bx(ke.from(D),b.schema);const{from:R}=S,F=R+D.length,G=nue(D);return u({rule:f,state:b,from:R,to:{b:F},pasteEvt:G})}const O=g.doc.content.findDiffStart(b.doc.content),L=g.doc.content.findDiffEnd(b.doc.content);if(!(!Zle(O)||!L||O===L.b))return u({rule:f,state:b,from:O,to:L,pasteEvt:a})}}))}var Gb=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=sI(t),this.schema=mle(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Km(e.name,this.schema)},r=at(e,"addCommands",n);return r?{...t,...r()}:t},{})}get plugins(){const{editor:t}=this;return f1([...this.extensions].reverse()).flatMap(r=>{const i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:Km(r.name,this.schema)},s=[],a=at(r,"addKeyboardShortcuts",i);let l={};if(r.type==="mark"&&at(r,"exitable",i)&&(l.ArrowRight=()=>cc.handleExit({editor:t,mark:r})),a){const g=Object.fromEntries(Object.entries(a()).map(([b,v])=>[b,()=>v({editor:t})]));l={...l,...g}}const u=voe(l);s.push(u);const d=at(r,"addInputRules",i);if(s7(r,t.options.enableInputRules)&&d){const g=d();if(g&&g.length){const b=Xle({editor:t,rules:g}),v=Array.isArray(b)?b:[b];s.push(...v)}}const f=at(r,"addPasteRules",i);if(s7(r,t.options.enablePasteRules)&&f){const g=f();if(g&&g.length){const b=rue({editor:t,rules:g});s.push(...b)}}const p=at(r,"addProseMirrorPlugins",i);if(p){const g=p();s.push(...g)}return s})}get attributes(){return iI(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=Md(this.extensions);return Object.fromEntries(e.filter(n=>!!at(n,"addNodeView")).map(n=>{const r=this.attributes.filter(u=>u.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:kr(n.name,this.schema)},s=at(n,"addNodeView",i);if(!s)return[];const a=s();if(!a)return[];const l=(u,d,f,p,g)=>{const b=_h(u,r);return a({node:u,view:d,getPos:f,decorations:p,innerDecorations:g,editor:t,extension:n,HTMLAttributes:b})};return[n.name,l]}))}dispatchTransaction(t){const{editor:e}=this;return f1([...this.extensions].reverse()).reduceRight((r,i)=>{const s={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:e,type:Km(i.name,this.schema)},a=at(i,"dispatchTransaction",s);return a?l=>{a.call(s,{transaction:l,next:r})}:r},t)}get markViews(){const{editor:t}=this,{markExtensions:e}=Md(this.extensions);return Object.fromEntries(e.filter(n=>!!at(n,"addMarkView")).map(n=>{const r=this.attributes.filter(l=>l.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Uo(n.name,this.schema)},s=at(n,"addMarkView",i);if(!s)return[];const a=(l,u,d)=>{const f=_h(l,r);return s()({mark:l,view:u,inline:d,editor:t,extension:n,HTMLAttributes:f,updateAttributes:p=>{bue(l,t,p)}})};return[n.name,a]}))}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var n;const r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Km(e.name,this.schema)};e.type==="mark"&&((n=cn(at(e,"keepOnSplit",r)))==null||n)&&this.splittableMarks.push(e.name);const i=at(e,"onBeforeCreate",r),s=at(e,"onCreate",r),a=at(e,"onUpdate",r),l=at(e,"onSelectionUpdate",r),u=at(e,"onTransaction",r),d=at(e,"onFocus",r),f=at(e,"onBlur",r),p=at(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),s&&this.editor.on("create",s),a&&this.editor.on("update",a),l&&this.editor.on("selectionUpdate",l),u&&this.editor.on("transaction",u),d&&this.editor.on("focus",d),f&&this.editor.on("blur",f),p&&this.editor.on("destroy",p)})}};Gb.resolve=sI;Gb.sort=f1;Gb.flatten=Px;var iue={};Rx(iue,{ClipboardTextSerializer:()=>bI,Commands:()=>vI,Delete:()=>yI,Drop:()=>EI,Editable:()=>_I,FocusEvents:()=>TI,Keymap:()=>SI,Paste:()=>wI,Tabindex:()=>kI,TextDirection:()=>CI,focusEventsPluginKey:()=>xI});var Gn=class gI extends Fx{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new gI(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},bI=Gn.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new zn({key:new Vn("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:s}=i,a=Math.min(...s.map(f=>f.$from.pos)),l=Math.max(...s.map(f=>f.$to.pos)),u=zx(n);return aI(r,{from:a,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:u})}}})]}}),vI=Gn.create({name:"commands",addCommands(){return{...XD}}}),yI=Gn.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r,i;const s=()=>{var a,l,u,d;if((d=(u=(l=(a=this.editor.options.coreExtensionOptions)==null?void 0:a.delete)==null?void 0:l.filterTransaction)==null?void 0:u.call(l,t))!=null?d:t.getMeta("y-sync$"))return;const f=nI(t.before,[t,...e]);uI(f).forEach(b=>{f.mapping.mapResult(b.oldRange.from).deletedAfter&&f.mapping.mapResult(b.oldRange.to).deletedBefore&&f.before.nodesBetween(b.oldRange.from,b.oldRange.to,(v,E)=>{const x=E+v.nodeSize-2,S=b.oldRange.from<=E&&x<=b.oldRange.to;this.editor.emit("delete",{type:"node",node:v,from:E,to:x,newFrom:f.mapping.map(E),newTo:f.mapping.map(x),deletedRange:b.oldRange,newRange:b.newRange,partial:!S,editor:this.editor,transaction:t,combinedTransform:f})})});const g=f.mapping;f.steps.forEach((b,v)=>{var E,x;if(b instanceof Ws){const S=g.slice(v).map(b.from,-1),C=g.slice(v).map(b.to),O=g.invert().map(S,-1),L=g.invert().map(C),D=(E=f.doc.nodeAt(S-1))==null?void 0:E.marks.some(F=>F.eq(b.mark)),R=(x=f.doc.nodeAt(C))==null?void 0:x.marks.some(F=>F.eq(b.mark));this.editor.emit("delete",{type:"mark",mark:b.mark,from:b.from,to:b.to,deletedRange:{from:O,to:L},newRange:{from:S,to:C},partial:!!(R||D),editor:this.editor,transaction:t,combinedTransform:f})}})};(i=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||i?setTimeout(s,0):s()}}),EI=Gn.create({name:"drop",addProseMirrorPlugins(){return[new zn({key:new Vn("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),_I=Gn.create({name:"editable",addProseMirrorPlugins(){return[new zn({key:new Vn("editable"),props:{editable:()=>this.editor.options.editable}})]}}),xI=new Vn("focusEvents"),TI=Gn.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new zn({key:xI,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),SI=Gn.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:l})=>{const{selection:u,doc:d}=l,{empty:f,$anchor:p}=u,{pos:g,parent:b}=p,v=p.parent.isTextblock&&g>0?l.doc.resolve(g-1):p,E=v.parent.type.spec.isolating,x=p.pos-p.parentOffset,S=E&&v.parent.childCount===1?x===p.pos:vt.atStart(d).from===g;return!f||!b.type.isTextblock||b.textContent.length||!S||S&&p.parent.type.name==="paragraph"?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},s={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return d1()||eI()?s:i},addProseMirrorPlugins(){return[new zn({key:new Vn("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(E=>E.getMeta("composition")))return;const r=t.some(E=>E.docChanged)&&!e.doc.eq(n.doc),i=t.some(E=>E.getMeta("preventClearDocument"));if(!r||i)return;const{empty:s,from:a,to:l}=e.selection,u=vt.atStart(e.doc).from,d=vt.atEnd(e.doc).to;if(s||!(a===u&&l===d)||!Vb(n.doc))return;const g=n.tr,b=Hb({state:n,transaction:g}),{commands:v}=new jb({editor:this.editor,state:b});if(v.clearNodes(),!!g.steps.length)return g}})]}}),wI=Gn.create({name:"paste",addProseMirrorPlugins(){return[new zn({key:new Vn("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),kI=Gn.create({name:"tabindex",addProseMirrorPlugins(){return[new zn({key:new Vn("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),CI=Gn.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=Md(this.extensions);return[{types:t.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const n=e.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new zn({key:new Vn("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}}),sue=class Tf{constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Tf(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Tf(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Tf(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,a=n.isInline,l=this.pos+r+(s?0:1);if(l<0||l>this.resolvedPos.doc.nodeSize-2)return;const u=this.resolvedPos.doc.resolve(l);if(!i&&!a&&u.depth<=this.depth)return;const d=new Tf(u,this.editor,i,i||a?n:null);i&&(d.actualDepth=this.depth+1),e.push(d)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const s=i.node.attrs,a=Object.keys(n);for(let l=0;l<a.length;l+=1){const u=a[l];if(s[u]!==n[u])break}}else r=i;i=i.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const s=Object.keys(n);return this.children.forEach(a=>{r&&i.length>0||(a.node.type.name===e&&s.every(u=>n[u]===a.node.attrs[u])&&i.push(a),!(r&&i.length>0)&&(i=i.concat(a.querySelectorAll(e,n,r))))}),i}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},aue=`.ProseMirror {
  position: relative;
}

.ProseMirror {
  word-wrap: break-word;
  white-space: pre-wrap;
  white-space: break-spaces;
  -webkit-font-variant-ligatures: none;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
}

.ProseMirror [contenteditable="false"] {
  white-space: normal;
}

.ProseMirror [contenteditable="false"] [contenteditable="true"] {
  white-space: pre-wrap;
}

.ProseMirror pre {
  white-space: pre-wrap;
}

img.ProseMirror-separator {
  display: inline !important;
  border: none !important;
  margin: 0 !important;
  width: 0 !important;
  height: 0 !important;
}

.ProseMirror-gapcursor {
  display: none;
  pointer-events: none;
  position: absolute;
  margin: 0;
}

.ProseMirror-gapcursor:after {
  content: "";
  display: block;
  position: absolute;
  top: -2px;
  width: 20px;
  border-top: 1px solid black;
  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
}

@keyframes ProseMirror-cursor-blink {
  to {
    visibility: hidden;
  }
}

.ProseMirror-hideselection *::selection {
  background: transparent;
}

.ProseMirror-hideselection *::-moz-selection {
  background: transparent;
}

.ProseMirror-hideselection * {
  caret-color: transparent;
}

.ProseMirror-focused .ProseMirror-gapcursor {
  display: block;
}`;function oue(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}var lue=class extends Wle{constructor(t={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:wle,createMappablePosition:kle},this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:r,slice:i,moved:s})=>this.options.onDrop(r,i,s)),this.on("paste",({event:r,slice:i})=>this.options.onPaste(r,i)),this.on("delete",this.options.onDelete);const e=this.createDoc(),n=ZD(e,this.options.autofocus);this.editorState=fd.create({doc:e,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const t=this.editorView.dom;t!=null&&t.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=oue(aue,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const n=rI(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach(i=>{const s=typeof i=="string"?`${i}$`:i.key;n=n.filter(a=>!a.key.startsWith(s))}),e.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var t,e;const r=[...this.options.enableCoreExtensions?[_I,bI.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),vI,TI,SI,kI,EI,wI,yI,CI.configure({direction:this.options.textDirection})].filter(i=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[i.name]!==!1:!0):[],...this.options.extensions].filter(i=>["extension","node","mark"].includes(i==null?void 0:i.type));this.extensionManager=new Gb(r,this)}createCommandManager(){this.commandManager=new jb({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=p3(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(n=>n.name!=="collaboration"),this.createExtensionManager()}}),t=p3(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return t}createView(t){const{editorProps:e,enableExtensionDispatchTransaction:n}=this.options,r=e.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r;this.editorView=new KD(t,{...e,attributes:{role:"textbox",...e==null?void 0:e.attributes},dispatchTransaction:i,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.prependClass(),this.injectCSS();const a=this.view.dom;a.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(d=>{var f;return(f=this.capturedTransaction)==null?void 0:f.step(d)});return}const{state:e,transactions:n}=this.state.applyTransaction(t),r=!this.state.selection.eq(e.selection),i=n.includes(t),s=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!i)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const a=n.findLast(d=>d.getMeta("focus")||d.getMeta("blur")),l=a==null?void 0:a.getMeta("focus"),u=a==null?void 0:a.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:a}),u&&this.emit("blur",{editor:this,event:u.event,transaction:a}),!(t.getMeta("preventUpdate")||!n.some(d=>d.docChanged)||s.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:t,appendedTransactions:n.slice(1)})}getAttributes(t){return lI(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return xle(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Bx(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`

`,textSerializers:n={}}=t||{};return oI(this.state.doc,{blockSeparator:e,textSerializers:{...zx(this.schema),...n}})}get isEmpty(){return Vb(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var t,e;return(e=(t=this.editorView)==null?void 0:t.isDestroyed)!=null?e:!0}$node(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t);return new sue(e,this)}get $doc(){return this.$pos(0)}};function Rd(t){return new Zh({find:t.find,handler:({state:e,range:n,match:r})=>{const i=cn(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:s}=e,a=r[r.length-1],l=r[0];if(a){const u=l.search(/\S/),d=n.from+l.indexOf(a),f=d+a.length;if(Ux(n.from,n.to,e.doc).filter(b=>b.mark.type.excluded.find(E=>E===t.type&&E!==b.mark.type)).filter(b=>b.to>d).length)return null;f<n.to&&s.delete(f,n.to),d>n.from&&s.delete(n.from+u,d);const g=n.from+u+a.length;s.addMark(n.from+u,g,t.type.create(i||{})),s.removeStoredMark(t.type)}},undoable:t.undoable})}function uue(t){return new Zh({find:t.find,handler:({state:e,range:n,match:r})=>{const i=cn(t.getAttributes,void 0,r)||{},{tr:s}=e,a=n.from;let l=n.to;const u=t.type.create(i);if(r[1]){const d=r[0].lastIndexOf(r[1]);let f=a+d;f>l?f=l:l=f+r[1].length;const p=r[0][r[0].length-1];s.insertText(p,a+r[0].length-1),s.replaceWith(f,l,u)}else if(r[0]){const d=t.type.isInline?a:a-1;s.insert(d,t.type.create(i)).delete(s.mapping.map(a),s.mapping.map(l))}s.scrollIntoView()},undoable:t.undoable})}function g3(t){return new Zh({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),s=cn(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)},undoable:t.undoable})}function ar(t){return new Zh({find:t.find,handler:({state:e,range:n,match:r})=>{let i=t.replace,s=n.from;const a=n.to;if(r[1]){const l=r[0].lastIndexOf(r[1]);i+=r[0].slice(l+r[1].length),s+=l;const u=s-a;u>0&&(i=r[0].slice(l-u,l)+i,s=a)}e.tr.insertText(i,s,a)},undoable:t.undoable})}function Dd(t){return new Zh({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const s=cn(t.getAttributes,void 0,r)||{},a=e.tr.delete(n.from,n.to),u=a.doc.resolve(n.from).blockRange(),d=u&&mx(u,t.type,s);if(!d)return null;if(a.wrap(u,d),t.keepMarks&&t.editor){const{selection:p,storedMarks:g}=e,{splittableMarks:b}=t.editor.extensionManager,v=g||p.$to.parentOffset&&p.$from.marks();if(v){const E=v.filter(x=>b.includes(x.type.name));a.ensureMarks(E)}}if(t.keepAttributes){const p=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(p,s).run()}const f=a.doc.resolve(n.from-1).nodeBefore;f&&f.type===t.type&&ru(a.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,f))&&a.join(n.from-1)},undoable:t.undoable})}function cue(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof ct){const s=r.index();return r.parent.canReplaceWith(s,s+1,e)}let i=r.depth;for(;i>=0;){const s=r.index(i);if(r.node(i).contentMatchAt(s).matchType(e))return!0;i-=1}return!1}var due={};Rx(due,{createAtomBlockMarkdownSpec:()=>fue,createBlockMarkdownSpec:()=>hue,createInlineMarkdownSpec:()=>gue,parseAttributes:()=>Hx,parseIndentedBlocks:()=>b3,renderNestedMarkdownContent:()=>$x,serializeAttributes:()=>jx});function Hx(t){if(!(t!=null&&t.trim()))return{};const e={},n=[],r=t.replace(/["']([^"']*)["']/g,d=>(n.push(d),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(i){const d=i.map(f=>f.trim().slice(1));e.class=d.join(" ")}const s=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);s&&(e.id=s[1]);const a=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(a)).forEach(([,d,f])=>{var p;const g=parseInt(((p=f.match(/__QUOTED_(\d+)__/))==null?void 0:p[1])||"0",10),b=n[g];b&&(e[d]=b.slice(1,-1))});const u=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return u&&u.split(/\s+/).filter(Boolean).forEach(f=>{f.match(/^[a-zA-Z][\w-]*$/)&&(e[f]=!0)}),e}function jx(t){if(!t||Object.keys(t).length===0)return"";const e=[];return t.class&&String(t.class).split(/\s+/).filter(Boolean).forEach(r=>e.push(`.${r}`)),t.id&&e.push(`#${t.id}`),Object.entries(t).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?e.push(n):r!==!1&&r!=null&&e.push(`${n}="${String(r)}"`))}),e.join(" ")}function fue(t){const{nodeName:e,name:n,parseAttributes:r=Hx,serializeAttributes:i=jx,defaultAttributes:s={},requiredAttributes:a=[],allowedAttributes:l}=t,u=n||e,d=f=>{if(!l)return f;const p={};return l.forEach(g=>{g in f&&(p[g]=f[g])}),p};return{parseMarkdown:(f,p)=>{const g={...s,...f.attributes};return p.createNode(e,g,[])},markdownTokenizer:{name:e,level:"block",start(f){var p;const g=new RegExp(`^:::${u}(?:\\s|$)`,"m"),b=(p=f.match(g))==null?void 0:p.index;return b!==void 0?b:-1},tokenize(f,p,g){const b=new RegExp(`^:::${u}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),v=f.match(b);if(!v)return;const E=v[1]||"",x=r(E);if(!a.find(C=>!(C in x)))return{type:e,raw:v[0],attributes:x}}},renderMarkdown:f=>{const p=d(f.attrs||{}),g=i(p),b=g?` {${g}}`:"";return`:::${u}${b} :::`}}}function hue(t){const{nodeName:e,name:n,getContent:r,parseAttributes:i=Hx,serializeAttributes:s=jx,defaultAttributes:a={},content:l="block",allowedAttributes:u}=t,d=n||e,f=p=>{if(!u)return p;const g={};return u.forEach(b=>{b in p&&(g[b]=p[b])}),g};return{parseMarkdown:(p,g)=>{let b;if(r){const E=r(p);b=typeof E=="string"?[{type:"text",text:E}]:E}else l==="block"?b=g.parseChildren(p.tokens||[]):b=g.parseInline(p.tokens||[]);const v={...a,...p.attributes};return g.createNode(e,v,b)},markdownTokenizer:{name:e,level:"block",start(p){var g;const b=new RegExp(`^:::${d}`,"m"),v=(g=p.match(b))==null?void 0:g.index;return v!==void 0?v:-1},tokenize(p,g,b){var v;const E=new RegExp(`^:::${d}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),x=p.match(E);if(!x)return;const[S,C=""]=x,O=i(C);let L=1;const D=S.length;let R="";const F=/^:::([\w-]*)(\s.*)?/gm,G=p.slice(D);for(F.lastIndex=0;;){const Z=F.exec(G);if(Z===null)break;const q=Z.index,ie=Z[1];if(!((v=Z[2])!=null&&v.endsWith(":::"))){if(ie)L+=1;else if(L-=1,L===0){const se=G.slice(0,q);R=se.trim();const Te=p.slice(0,D+q+Z[0].length);let oe=[];if(R)if(l==="block")for(oe=b.blockTokens(se),oe.forEach(re=>{re.text&&(!re.tokens||re.tokens.length===0)&&(re.tokens=b.inlineTokens(re.text))});oe.length>0;){const re=oe[oe.length-1];if(re.type==="paragraph"&&(!re.text||re.text.trim()===""))oe.pop();else break}else oe=b.inlineTokens(R);return{type:e,raw:Te,attributes:O,content:R,tokens:oe}}}}}},renderMarkdown:(p,g)=>{const b=f(p.attrs||{}),v=s(b),E=v?` {${v}}`:"",x=g.renderChildren(p.content||[],`

`);return`:::${d}${E}

${x}

:::`}}}function pue(t){if(!t.trim())return{};const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(t);for(;r!==null;){const[,i,s,a]=r;e[i]=s||a,r=n.exec(t)}return e}function mue(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}function gue(t){const{nodeName:e,name:n,getContent:r,parseAttributes:i=pue,serializeAttributes:s=mue,defaultAttributes:a={},selfClosing:l=!1,allowedAttributes:u}=t,d=n||e,f=g=>{if(!u)return g;const b={};return u.forEach(v=>{const E=typeof v=="string"?v:v.name,x=typeof v=="string"?void 0:v.skipIfDefault;if(E in g){const S=g[E];if(x!==void 0&&S===x)return;b[E]=S}}),b},p=d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(g,b)=>{const v={...a,...g.attributes};if(l)return b.createNode(e,v);const E=r?r(g):g.content||"";return E?b.createNode(e,v,[b.createTextNode(E)]):b.createNode(e,v,[])},markdownTokenizer:{name:e,level:"inline",start(g){const b=l?new RegExp(`\\[${p}\\s*[^\\]]*\\]`):new RegExp(`\\[${p}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${p}\\]`),v=g.match(b),E=v==null?void 0:v.index;return E!==void 0?E:-1},tokenize(g,b,v){const E=l?new RegExp(`^\\[${p}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${p}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${p}\\]`),x=g.match(E);if(!x)return;let S="",C="";if(l){const[,L]=x;C=L}else{const[,L,D]=x;C=L,S=D||""}const O=i(C.trim());return{type:e,raw:x[0],content:S.trim(),attributes:O}}},renderMarkdown:g=>{let b="";r?b=r(g):g.content&&g.content.length>0&&(b=g.content.filter(S=>S.type==="text").map(S=>S.text).join(""));const v=f(g.attrs||{}),E=s(v),x=E?` ${E}`:"";return l?`[${d}${x}]`:`[${d}${x}]${b}[/${d}]`}}}function b3(t,e,n){var r,i,s,a;const l=t.split(`
`),u=[];let d="",f=0;const p=e.baseIndentSize||2;for(;f<l.length;){const g=l[f],b=g.match(e.itemPattern);if(!b){if(u.length>0)break;if(g.trim()===""){f+=1,d=`${d}${g}
`;continue}else return}const v=e.extractItemData(b),{indentLevel:E,mainContent:x}=v;d=`${d}${g}
`;const S=[x];for(f+=1;f<l.length;){const D=l[f];if(D.trim()===""){const F=l.slice(f+1).findIndex(q=>q.trim()!=="");if(F===-1)break;if((((i=(r=l[f+1+F].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:i.length)||0)>E){S.push(D),d=`${d}${D}
`,f+=1;continue}else break}if((((a=(s=D.match(/^(\s*)/))==null?void 0:s[1])==null?void 0:a.length)||0)>E)S.push(D),d=`${d}${D}
`,f+=1;else break}let C;const O=S.slice(1);if(O.length>0){const D=O.map(R=>R.slice(E+p)).join(`
`);D.trim()&&(e.customNestedParser?C=e.customNestedParser(D):C=n.blockTokens(D))}const L=e.createToken(v,C);u.push(L)}if(u.length!==0)return{items:u,raw:d}}function $x(t,e,n,r){if(!t||!Array.isArray(t.content))return"";const i=typeof n=="function"?n(r):n,[s,...a]=t.content,l=e.renderChildren([s]),u=[`${i}${l}`];return a&&a.length>0&&a.forEach(d=>{const f=e.renderChildren([d]);if(f){const p=f.split(`
`).map(g=>g?e.indent(g):"").join(`
`);u.push(p)}}),u.join(`
`)}function bue(t,e,n={}){const{state:r}=e,{doc:i,tr:s}=r,a=t;i.descendants((l,u)=>{const d=s.mapping.map(u),f=s.mapping.map(u)+l.nodeSize;let p=null;if(l.marks.forEach(b=>{if(b!==a)return!1;p=b}),!p)return;let g=!1;if(Object.keys(n).forEach(b=>{n[b]!==p.attrs[b]&&(g=!0)}),g){const b=t.type.create({...t.attrs,...n});s.removeMark(d,f,t.type),s.addMark(d,f,b)}}),s.docChanged&&e.view.dispatch(s)}var gs=class AI extends Fx{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new AI(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function Ju(t){return new Jle({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const s=cn(t.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:a}=e,l=r[r.length-1],u=r[0];let d=n.to;if(l){const f=u.search(/\S/),p=n.from+u.indexOf(l),g=p+l.length;if(Ux(n.from,n.to,e.doc).filter(v=>v.mark.type.excluded.find(x=>x===t.type&&x!==v.mark.type)).filter(v=>v.to>p).length)return null;g<n.to&&a.delete(g,n.to),p>n.from&&a.delete(n.from+f,p),d=n.from+f+l.length,a.addMark(n.from+f,d,t.type.create(s||{})),a.removeStoredMark(t.type)}}})}const{getOwnPropertyNames:vue,getOwnPropertySymbols:yue}=Object,{hasOwnProperty:Eue}=Object.prototype;function OE(t,e){return function(r,i,s){return t(r,i,s)&&e(r,i,s)}}function Jm(t){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,i);const{cache:s}=i,a=s.get(n),l=s.get(r);if(a&&l)return a===r&&l===n;s.set(n,r),s.set(r,n);const u=t(n,r,i);return s.delete(n),s.delete(r),u}}function _ue(t){return t!=null?t[Symbol.toStringTag]:void 0}function l7(t){return vue(t).concat(yue(t))}const xue=Object.hasOwn||((t,e)=>Eue.call(t,e));function dc(t,e){return t===e||!t&&!e&&t!==t&&e!==e}const Tue="__v",Sue="__o",wue="_owner",{getOwnPropertyDescriptor:u7,keys:c7}=Object;function kue(t,e){return t.byteLength===e.byteLength&&h1(new Uint8Array(t),new Uint8Array(e))}function Cue(t,e,n){let r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function Aue(t,e){return t.byteLength===e.byteLength&&h1(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function Nue(t,e){return dc(t.getTime(),e.getTime())}function Oue(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function Mue(t,e){return t===e}function d7(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const i=new Array(r),s=t.entries();let a,l,u=0;for(;(a=s.next())&&!a.done;){const d=e.entries();let f=!1,p=0;for(;(l=d.next())&&!l.done;){if(i[p]){p++;continue}const g=a.value,b=l.value;if(n.equals(g[0],b[0],u,p,t,e,n)&&n.equals(g[1],b[1],g[0],b[0],t,e,n)){f=i[p]=!0;break}p++}if(!f)return!1;u++}return!0}const Rue=dc;function Due(t,e,n){const r=c7(t);let i=r.length;if(c7(e).length!==i)return!1;for(;i-- >0;)if(!NI(t,e,n,r[i]))return!1;return!0}function af(t,e,n){const r=l7(t);let i=r.length;if(l7(e).length!==i)return!1;let s,a,l;for(;i-- >0;)if(s=r[i],!NI(t,e,n,s)||(a=u7(t,s),l=u7(e,s),(a||l)&&(!a||!l||a.configurable!==l.configurable||a.enumerable!==l.enumerable||a.writable!==l.writable)))return!1;return!0}function Iue(t,e){return dc(t.valueOf(),e.valueOf())}function Lue(t,e){return t.source===e.source&&t.flags===e.flags}function f7(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const i=new Array(r),s=t.values();let a,l;for(;(a=s.next())&&!a.done;){const u=e.values();let d=!1,f=0;for(;(l=u.next())&&!l.done;){if(!i[f]&&n.equals(a.value,l.value,a.value,l.value,t,e,n)){d=i[f]=!0;break}f++}if(!d)return!1}return!0}function h1(t,e){let n=t.byteLength;if(e.byteLength!==n||t.byteOffset!==e.byteOffset)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function Pue(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function NI(t,e,n,r){return(r===wue||r===Sue||r===Tue)&&(t.$$typeof||e.$$typeof)?!0:xue(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}const Bue="[object ArrayBuffer]",zue="[object Arguments]",Uue="[object Boolean]",Fue="[object DataView]",Hue="[object Date]",jue="[object Error]",$ue="[object Map]",que="[object Number]",Vue="[object Object]",Gue="[object RegExp]",Yue="[object Set]",Wue="[object String]",Kue={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},Xue="[object URL]",Que=Object.prototype.toString;function Zue({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:s,areMapsEqual:a,areNumbersEqual:l,areObjectsEqual:u,arePrimitiveWrappersEqual:d,areRegExpsEqual:f,areSetsEqual:p,areTypedArraysEqual:g,areUrlsEqual:b,unknownTagComparators:v}){return function(x,S,C){if(x===S)return!0;if(x==null||S==null)return!1;const O=typeof x;if(O!==typeof S)return!1;if(O!=="object")return O==="number"?l(x,S,C):O==="function"?s(x,S,C):!1;const L=x.constructor;if(L!==S.constructor)return!1;if(L===Object)return u(x,S,C);if(Array.isArray(x))return e(x,S,C);if(L===Date)return r(x,S,C);if(L===RegExp)return f(x,S,C);if(L===Map)return a(x,S,C);if(L===Set)return p(x,S,C);const D=Que.call(x);if(D===Hue)return r(x,S,C);if(D===Gue)return f(x,S,C);if(D===$ue)return a(x,S,C);if(D===Yue)return p(x,S,C);if(D===Vue)return typeof x.then!="function"&&typeof S.then!="function"&&u(x,S,C);if(D===Xue)return b(x,S,C);if(D===jue)return i(x,S,C);if(D===zue)return u(x,S,C);if(Kue[D])return g(x,S,C);if(D===Bue)return t(x,S,C);if(D===Fue)return n(x,S,C);if(D===Uue||D===que||D===Wue)return d(x,S,C);if(v){let R=v[D];if(!R){const F=_ue(x);F&&(R=v[F])}if(R)return R(x,S,C)}return!1}}function Jue({circular:t,createCustomConfig:e,strict:n}){let r={areArrayBuffersEqual:kue,areArraysEqual:n?af:Cue,areDataViewsEqual:Aue,areDatesEqual:Nue,areErrorsEqual:Oue,areFunctionsEqual:Mue,areMapsEqual:n?OE(d7,af):d7,areNumbersEqual:Rue,areObjectsEqual:n?af:Due,arePrimitiveWrappersEqual:Iue,areRegExpsEqual:Lue,areSetsEqual:n?OE(f7,af):f7,areTypedArraysEqual:n?OE(h1,af):h1,areUrlsEqual:Pue,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),t){const i=Jm(r.areArraysEqual),s=Jm(r.areMapsEqual),a=Jm(r.areObjectsEqual),l=Jm(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:s,areObjectsEqual:a,areSetsEqual:l})}return r}function ece(t){return function(e,n,r,i,s,a,l){return t(e,n,l)}}function tce({circular:t,comparator:e,createState:n,equals:r,strict:i}){if(n)return function(l,u){const{cache:d=t?new WeakMap:void 0,meta:f}=n();return e(l,u,{cache:d,equals:r,meta:f,strict:i})};if(t)return function(l,u){return e(l,u,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};const s={cache:void 0,equals:r,meta:void 0,strict:i};return function(l,u){return e(l,u,s)}}const nce=su();su({strict:!0});su({circular:!0});su({circular:!0,strict:!0});su({createInternalComparator:()=>dc});su({strict:!0,createInternalComparator:()=>dc});su({circular:!0,createInternalComparator:()=>dc});su({circular:!0,createInternalComparator:()=>dc,strict:!0});function su(t={}){const{circular:e=!1,createInternalComparator:n,createState:r,strict:i=!1}=t,s=Jue(t),a=Zue(s),l=n?n(a):ece(a);return tce({circular:e,comparator:a,createState:r,equals:l,strict:i})}var ME={exports:{}},RE={};/**
 * @license React
 * use-sync-external-store-shim/with-selector.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var h7;function rce(){if(h7)return RE;h7=1;var t=Mh(),e=w9();function n(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,s=t.useRef,a=t.useEffect,l=t.useMemo,u=t.useDebugValue;return RE.useSyncExternalStoreWithSelector=function(d,f,p,g,b){var v=s(null);if(v.current===null){var E={hasValue:!1,value:null};v.current=E}else E=v.current;v=l(function(){function S(R){if(!C){if(C=!0,O=R,R=g(R),b!==void 0&&E.hasValue){var F=E.value;if(b(F,R))return L=F}return L=R}if(F=L,r(O,R))return F;var G=g(R);return b!==void 0&&b(F,G)?(O=R,F):(O=R,L=G)}var C=!1,O,L,D=p===void 0?null:p;return[function(){return S(f())},D===null?void 0:function(){return S(D())}]},[f,p,g,b]);var x=i(d,v[0],v[1]);return a(function(){E.hasValue=!0,E.value=x},[x]),u(x),x},RE}var p7;function ice(){return p7||(p7=1,ME.exports=rce()),ME.exports}var sce=ice();const OI=["top","right","bottom","left"],m7=["start","end"],g7=OI.reduce((t,e)=>t.concat(e,e+"-"+m7[0],e+"-"+m7[1]),[]),Ca=Math.min,Ei=Math.max,p1=Math.round,Ta=t=>({x:t,y:t}),ace={left:"right",right:"left",bottom:"top",top:"bottom"},oce={start:"end",end:"start"};function v3(t,e,n){return Ei(t,Ca(e,n))}function Fo(t,e){return typeof t=="function"?t(e):t}function Fs(t){return t.split("-")[0]}function Qs(t){return t.split("-")[1]}function MI(t){return t==="x"?"y":"x"}function qx(t){return t==="y"?"height":"width"}const lce=new Set(["top","bottom"]);function _a(t){return lce.has(Fs(t))?"y":"x"}function Vx(t){return MI(_a(t))}function RI(t,e,n){n===void 0&&(n=!1);const r=Qs(t),i=Vx(t),s=qx(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(a=g1(a)),[a,g1(a)]}function uce(t){const e=g1(t);return[m1(t),e,m1(e)]}function m1(t){return t.replace(/start|end/g,e=>oce[e])}const b7=["left","right"],v7=["right","left"],cce=["top","bottom"],dce=["bottom","top"];function fce(t,e,n){switch(t){case"top":case"bottom":return n?e?v7:b7:e?b7:v7;case"left":case"right":return e?cce:dce;default:return[]}}function hce(t,e,n,r){const i=Qs(t);let s=fce(Fs(t),n==="start",r);return i&&(s=s.map(a=>a+"-"+i),e&&(s=s.concat(s.map(m1)))),s}function g1(t){return t.replace(/left|right|bottom|top/g,e=>ace[e])}function pce(t){return{top:0,right:0,bottom:0,left:0,...t}}function Gx(t){return typeof t!="number"?pce(t):{top:t,right:t,bottom:t,left:t}}function Id(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function y7(t,e,n){let{reference:r,floating:i}=t;const s=_a(e),a=Vx(e),l=qx(a),u=Fs(e),d=s==="y",f=r.x+r.width/2-i.width/2,p=r.y+r.height/2-i.height/2,g=r[l]/2-i[l]/2;let b;switch(u){case"top":b={x:f,y:r.y-i.height};break;case"bottom":b={x:f,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:p};break;case"left":b={x:r.x-i.width,y:p};break;default:b={x:r.x,y:r.y}}switch(Qs(e)){case"start":b[a]-=g*(n&&d?-1:1);break;case"end":b[a]+=g*(n&&d?-1:1);break}return b}async function mce(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:a,elements:l,strategy:u}=t,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:g=!1,padding:b=0}=Fo(e,t),v=Gx(b),x=l[g?p==="floating"?"reference":"floating":p],S=Id(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(x)))==null||n?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:f,strategy:u})),C=p==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),L=await(s.isElement==null?void 0:s.isElement(O))?await(s.getScale==null?void 0:s.getScale(O))||{x:1,y:1}:{x:1,y:1},D=Id(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:C,offsetParent:O,strategy:u}):C);return{top:(S.top-D.top+v.top)/L.y,bottom:(D.bottom-S.bottom+v.bottom)/L.y,left:(S.left-D.left+v.left)/L.x,right:(D.right-S.right+v.right)/L.x}}const gce=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:a}=n,l=s.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(e));let d=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:p}=y7(d,r,u),g=r,b={},v=0;for(let x=0;x<l.length;x++){var E;const{name:S,fn:C}=l[x],{x:O,y:L,data:D,reset:R}=await C({x:f,y:p,initialPlacement:r,placement:g,strategy:i,middlewareData:b,rects:d,platform:{...a,detectOverflow:(E=a.detectOverflow)!=null?E:mce},elements:{reference:t,floating:e}});f=O??f,p=L??p,b={...b,[S]:{...b[S],...D}},R&&v<=50&&(v++,typeof R=="object"&&(R.placement&&(g=R.placement),R.rects&&(d=R.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:i}):R.rects),{x:f,y:p}=y7(d,g,u)),x=-1)}return{x:f,y:p,placement:g,strategy:i,middlewareData:b}},bce=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:a,elements:l,middlewareData:u}=e,{element:d,padding:f=0}=Fo(t,e)||{};if(d==null)return{};const p=Gx(f),g={x:n,y:r},b=Vx(i),v=qx(b),E=await a.getDimensions(d),x=b==="y",S=x?"top":"left",C=x?"bottom":"right",O=x?"clientHeight":"clientWidth",L=s.reference[v]+s.reference[b]-g[b]-s.floating[v],D=g[b]-s.reference[b],R=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let F=R?R[O]:0;(!F||!await(a.isElement==null?void 0:a.isElement(R)))&&(F=l.floating[O]||s.floating[v]);const G=L/2-D/2,Z=F/2-E[v]/2-1,q=Ca(p[S],Z),ie=Ca(p[C],Z),se=q,Te=F-E[v]-ie,oe=F/2-E[v]/2+G,re=v3(se,oe,Te),X=!u.arrow&&Qs(i)!=null&&oe!==re&&s.reference[v]/2-(oe<se?q:ie)-E[v]/2<0,ee=X?oe<se?oe-se:oe-Te:0;return{[b]:g[b]+ee,data:{[b]:re,centerOffset:oe-re-ee,...X&&{alignmentOffset:ee}},reset:X}}});function vce(t,e,n){return(t?[...n.filter(i=>Qs(i)===t),...n.filter(i=>Qs(i)!==t)]:n.filter(i=>Fs(i)===i)).filter(i=>t?Qs(i)===t||(e?m1(i)!==i:!1):!0)}const yce=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,r,i;const{rects:s,middlewareData:a,placement:l,platform:u,elements:d}=e,{crossAxis:f=!1,alignment:p,allowedPlacements:g=g7,autoAlignment:b=!0,...v}=Fo(t,e),E=p!==void 0||g===g7?vce(p||null,b,g):g,x=await u.detectOverflow(e,v),S=((n=a.autoPlacement)==null?void 0:n.index)||0,C=E[S];if(C==null)return{};const O=RI(C,s,await(u.isRTL==null?void 0:u.isRTL(d.floating)));if(l!==C)return{reset:{placement:E[0]}};const L=[x[Fs(C)],x[O[0]],x[O[1]]],D=[...((r=a.autoPlacement)==null?void 0:r.overflows)||[],{placement:C,overflows:L}],R=E[S+1];if(R)return{data:{index:S+1,overflows:D},reset:{placement:R}};const F=D.map(q=>{const ie=Qs(q.placement);return[q.placement,ie&&f?q.overflows.slice(0,2).reduce((se,Te)=>se+Te,0):q.overflows[0],q.overflows]}).sort((q,ie)=>q[1]-ie[1]),Z=((i=F.filter(q=>q[2].slice(0,Qs(q[0])?2:3).every(ie=>ie<=0))[0])==null?void 0:i[0])||F[0][0];return Z!==l?{data:{index:S+1,overflows:D},reset:{placement:Z}}:{}}}},Ece=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:s,rects:a,initialPlacement:l,platform:u,elements:d}=e,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:E=!0,...x}=Fo(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const S=Fs(i),C=_a(l),O=Fs(l)===l,L=await(u.isRTL==null?void 0:u.isRTL(d.floating)),D=g||(O||!E?[g1(l)]:uce(l)),R=v!=="none";!g&&R&&D.push(...hce(l,E,v,L));const F=[l,...D],G=await u.detectOverflow(e,x),Z=[];let q=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&Z.push(G[S]),p){const oe=RI(i,a,L);Z.push(G[oe[0]],G[oe[1]])}if(q=[...q,{placement:i,overflows:Z}],!Z.every(oe=>oe<=0)){var ie,se;const oe=(((ie=s.flip)==null?void 0:ie.index)||0)+1,re=F[oe];if(re&&(!(p==="alignment"?C!==_a(re):!1)||q.every(ce=>_a(ce.placement)===C?ce.overflows[0]>0:!0)))return{data:{index:oe,overflows:q},reset:{placement:re}};let X=(se=q.filter(ee=>ee.overflows[0]<=0).sort((ee,ce)=>ee.overflows[1]-ce.overflows[1])[0])==null?void 0:se.placement;if(!X)switch(b){case"bestFit":{var Te;const ee=(Te=q.filter(ce=>{if(R){const we=_a(ce.placement);return we===C||we==="y"}return!0}).map(ce=>[ce.placement,ce.overflows.filter(we=>we>0).reduce((we,j)=>we+j,0)]).sort((ce,we)=>ce[1]-we[1])[0])==null?void 0:Te[0];ee&&(X=ee);break}case"initialPlacement":X=l;break}if(i!==X)return{reset:{placement:X}}}return{}}}};function E7(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function _7(t){return OI.some(e=>t[e]>=0)}const _ce=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:i="referenceHidden",...s}=Fo(t,e);switch(i){case"referenceHidden":{const a=await r.detectOverflow(e,{...s,elementContext:"reference"}),l=E7(a,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:_7(l)}}}case"escaped":{const a=await r.detectOverflow(e,{...s,altBoundary:!0}),l=E7(a,n.floating);return{data:{escapedOffsets:l,escaped:_7(l)}}}default:return{}}}}};function DI(t){const e=Ca(...t.map(s=>s.left)),n=Ca(...t.map(s=>s.top)),r=Ei(...t.map(s=>s.right)),i=Ei(...t.map(s=>s.bottom));return{x:e,y:n,width:r-e,height:i-n}}function xce(t){const e=t.slice().sort((i,s)=>i.y-s.y),n=[];let r=null;for(let i=0;i<e.length;i++){const s=e[i];!r||s.y-r.y>r.height/2?n.push([s]):n[n.length-1].push(s),r=s}return n.map(i=>Id(DI(i)))}const Tce=function(t){return t===void 0&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:r,rects:i,platform:s,strategy:a}=e,{padding:l=2,x:u,y:d}=Fo(t,e),f=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(r.reference))||[]),p=xce(f),g=Id(DI(f)),b=Gx(l);function v(){if(p.length===2&&p[0].left>p[1].right&&u!=null&&d!=null)return p.find(x=>u>x.left-b.left&&u<x.right+b.right&&d>x.top-b.top&&d<x.bottom+b.bottom)||g;if(p.length>=2){if(_a(n)==="y"){const q=p[0],ie=p[p.length-1],se=Fs(n)==="top",Te=q.top,oe=ie.bottom,re=se?q.left:ie.left,X=se?q.right:ie.right,ee=X-re,ce=oe-Te;return{top:Te,bottom:oe,left:re,right:X,width:ee,height:ce,x:re,y:Te}}const x=Fs(n)==="left",S=Ei(...p.map(q=>q.right)),C=Ca(...p.map(q=>q.left)),O=p.filter(q=>x?q.left===C:q.right===S),L=O[0].top,D=O[O.length-1].bottom,R=C,F=S,G=F-R,Z=D-L;return{top:L,bottom:D,left:R,right:F,width:G,height:Z,x:R,y:L}}return g}const E=await s.getElementRects({reference:{getBoundingClientRect:v},floating:r.floating,strategy:a});return i.reference.x!==E.reference.x||i.reference.y!==E.reference.y||i.reference.width!==E.reference.width||i.reference.height!==E.reference.height?{reset:{rects:E}}:{}}}},Sce=new Set(["left","top"]);async function wce(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=Fs(n),l=Qs(n),u=_a(n)==="y",d=Sce.has(a)?-1:1,f=s&&u?-1:1,p=Fo(e,t);let{mainAxis:g,crossAxis:b,alignmentAxis:v}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof v=="number"&&(b=l==="end"?v*-1:v),u?{x:b*f,y:g*d}:{x:g*d,y:b*f}}const kce=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:a,middlewareData:l}=e,u=await wce(e,t);return a===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+u.x,y:s+u.y,data:{...u,placement:a}}}}},Cce=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i,platform:s}=e,{mainAxis:a=!0,crossAxis:l=!1,limiter:u={fn:S=>{let{x:C,y:O}=S;return{x:C,y:O}}},...d}=Fo(t,e),f={x:n,y:r},p=await s.detectOverflow(e,d),g=_a(Fs(i)),b=MI(g);let v=f[b],E=f[g];if(a){const S=b==="y"?"top":"left",C=b==="y"?"bottom":"right",O=v+p[S],L=v-p[C];v=v3(O,v,L)}if(l){const S=g==="y"?"top":"left",C=g==="y"?"bottom":"right",O=E+p[S],L=E-p[C];E=v3(O,E,L)}const x=u.fn({...e,[b]:v,[g]:E});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[b]:a,[g]:l}}}}}},Ace=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:s,platform:a,elements:l}=e,{apply:u=()=>{},...d}=Fo(t,e),f=await a.detectOverflow(e,d),p=Fs(i),g=Qs(i),b=_a(i)==="y",{width:v,height:E}=s.floating;let x,S;p==="top"||p==="bottom"?(x=p,S=g===(await(a.isRTL==null?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(S=p,x=g==="end"?"top":"bottom");const C=E-f.top-f.bottom,O=v-f.left-f.right,L=Ca(E-f[x],C),D=Ca(v-f[S],O),R=!e.middlewareData.shift;let F=L,G=D;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(G=O),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(F=C),R&&!g){const q=Ei(f.left,0),ie=Ei(f.right,0),se=Ei(f.top,0),Te=Ei(f.bottom,0);b?G=v-2*(q!==0||ie!==0?q+ie:Ei(f.left,f.right)):F=E-2*(se!==0||Te!==0?se+Te:Ei(f.top,f.bottom))}await u({...e,availableWidth:G,availableHeight:F});const Z=await a.getDimensions(l.floating);return v!==Z.width||E!==Z.height?{reset:{rects:!0}}:{}}}};function Yb(){return typeof window<"u"}function Zd(t){return II(t)?(t.nodeName||"").toLowerCase():"#document"}function hs(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Ho(t){var e;return(e=(II(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function II(t){return Yb()?t instanceof Node||t instanceof hs(t).Node:!1}function Js(t){return Yb()?t instanceof Element||t instanceof hs(t).Element:!1}function Aa(t){return Yb()?t instanceof HTMLElement||t instanceof hs(t).HTMLElement:!1}function x7(t){return!Yb()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof hs(t).ShadowRoot}const Nce=new Set(["inline","contents"]);function Jh(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=ea(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!Nce.has(i)}const Oce=new Set(["table","td","th"]);function Mce(t){return Oce.has(Zd(t))}const Rce=[":popover-open",":modal"];function Wb(t){return Rce.some(e=>{try{return t.matches(e)}catch{return!1}})}const Dce=["transform","translate","scale","rotate","perspective"],Ice=["transform","translate","scale","rotate","perspective","filter"],Lce=["paint","layout","strict","content"];function Yx(t){const e=Wx(),n=Js(t)?ea(t):t;return Dce.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||Ice.some(r=>(n.willChange||"").includes(r))||Lce.some(r=>(n.contain||"").includes(r))}function Pce(t){let e=Jl(t);for(;Aa(e)&&!Ld(e);){if(Yx(e))return e;if(Wb(e))return null;e=Jl(e)}return null}function Wx(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Bce=new Set(["html","body","#document"]);function Ld(t){return Bce.has(Zd(t))}function ea(t){return hs(t).getComputedStyle(t)}function Kb(t){return Js(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Jl(t){if(Zd(t)==="html")return t;const e=t.assignedSlot||t.parentNode||x7(t)&&t.host||Ho(t);return x7(e)?e.host:e}function LI(t){const e=Jl(t);return Ld(e)?t.ownerDocument?t.ownerDocument.body:t.body:Aa(e)&&Jh(e)?e:LI(e)}function PI(t,e,n){var r;e===void 0&&(e=[]);const i=LI(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),a=hs(i);return s?(y3(a),e.concat(a,a.visualViewport||[],Jh(i)?i:[],[])):e.concat(i,PI(i,[]))}function y3(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function BI(t){const e=ea(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Aa(t),s=i?t.offsetWidth:n,a=i?t.offsetHeight:r,l=p1(n)!==s||p1(r)!==a;return l&&(n=s,r=a),{width:n,height:r,$:l}}function zI(t){return Js(t)?t:t.contextElement}function Ed(t){const e=zI(t);if(!Aa(e))return Ta(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=BI(e);let a=(s?p1(n.width):n.width)/r,l=(s?p1(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const zce=Ta(0);function UI(t){const e=hs(t);return!Wx()||!e.visualViewport?zce:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Uce(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==hs(t)?!1:e}function xh(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=zI(t);let a=Ta(1);e&&(r?Js(r)&&(a=Ed(r)):a=Ed(t));const l=Uce(s,n,r)?UI(s):Ta(0);let u=(i.left+l.x)/a.x,d=(i.top+l.y)/a.y,f=i.width/a.x,p=i.height/a.y;if(s){const g=hs(s),b=r&&Js(r)?hs(r):r;let v=g,E=y3(v);for(;E&&r&&b!==v;){const x=Ed(E),S=E.getBoundingClientRect(),C=ea(E),O=S.left+(E.clientLeft+parseFloat(C.paddingLeft))*x.x,L=S.top+(E.clientTop+parseFloat(C.paddingTop))*x.y;u*=x.x,d*=x.y,f*=x.x,p*=x.y,u+=O,d+=L,v=hs(E),E=y3(v)}}return Id({width:f,height:p,x:u,y:d})}function Xb(t,e){const n=Kb(t).scrollLeft;return e?e.left+n:xh(Ho(t)).left+n}function FI(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-Xb(t,n),i=n.top+e.scrollTop;return{x:r,y:i}}function Fce(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",a=Ho(r),l=e?Wb(e.floating):!1;if(r===a||l&&s)return n;let u={scrollLeft:0,scrollTop:0},d=Ta(1);const f=Ta(0),p=Aa(r);if((p||!p&&!s)&&((Zd(r)!=="body"||Jh(a))&&(u=Kb(r)),Aa(r))){const b=xh(r);d=Ed(r),f.x=b.x+r.clientLeft,f.y=b.y+r.clientTop}const g=a&&!p&&!s?FI(a,u):Ta(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+f.x+g.x,y:n.y*d.y-u.scrollTop*d.y+f.y+g.y}}function Hce(t){return Array.from(t.getClientRects())}function jce(t){const e=Ho(t),n=Kb(t),r=t.ownerDocument.body,i=Ei(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=Ei(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Xb(t);const l=-n.scrollTop;return ea(r).direction==="rtl"&&(a+=Ei(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:a,y:l}}const T7=25;function $ce(t,e){const n=hs(t),r=Ho(t),i=n.visualViewport;let s=r.clientWidth,a=r.clientHeight,l=0,u=0;if(i){s=i.width,a=i.height;const f=Wx();(!f||f&&e==="fixed")&&(l=i.offsetLeft,u=i.offsetTop)}const d=Xb(r);if(d<=0){const f=r.ownerDocument,p=f.body,g=getComputedStyle(p),b=f.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,v=Math.abs(r.clientWidth-p.clientWidth-b);v<=T7&&(s-=v)}else d<=T7&&(s+=d);return{width:s,height:a,x:l,y:u}}const qce=new Set(["absolute","fixed"]);function Vce(t,e){const n=xh(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=Aa(t)?Ed(t):Ta(1),a=t.clientWidth*s.x,l=t.clientHeight*s.y,u=i*s.x,d=r*s.y;return{width:a,height:l,x:u,y:d}}function S7(t,e,n){let r;if(e==="viewport")r=$ce(t,n);else if(e==="document")r=jce(Ho(t));else if(Js(e))r=Vce(e,n);else{const i=UI(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Id(r)}function HI(t,e){const n=Jl(t);return n===e||!Js(n)||Ld(n)?!1:ea(n).position==="fixed"||HI(n,e)}function Gce(t,e){const n=e.get(t);if(n)return n;let r=PI(t,[]).filter(l=>Js(l)&&Zd(l)!=="body"),i=null;const s=ea(t).position==="fixed";let a=s?Jl(t):t;for(;Js(a)&&!Ld(a);){const l=ea(a),u=Yx(a);!u&&l.position==="fixed"&&(i=null),(s?!u&&!i:!u&&l.position==="static"&&!!i&&qce.has(i.position)||Jh(a)&&!u&&HI(t,a))?r=r.filter(f=>f!==a):i=l,a=Jl(a)}return e.set(t,r),r}function Yce(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const a=[...n==="clippingAncestors"?Wb(e)?[]:Gce(e,this._c):[].concat(n),r],l=a[0],u=a.reduce((d,f)=>{const p=S7(e,f,i);return d.top=Ei(p.top,d.top),d.right=Ca(p.right,d.right),d.bottom=Ca(p.bottom,d.bottom),d.left=Ei(p.left,d.left),d},S7(e,l,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Wce(t){const{width:e,height:n}=BI(t);return{width:e,height:n}}function Kce(t,e,n){const r=Aa(e),i=Ho(e),s=n==="fixed",a=xh(t,!0,s,e);let l={scrollLeft:0,scrollTop:0};const u=Ta(0);function d(){u.x=Xb(i)}if(r||!r&&!s)if((Zd(e)!=="body"||Jh(i))&&(l=Kb(e)),r){const b=xh(e,!0,s,e);u.x=b.x+e.clientLeft,u.y=b.y+e.clientTop}else i&&d();s&&!r&&i&&d();const f=i&&!r&&!s?FI(i,l):Ta(0),p=a.left+l.scrollLeft-u.x-f.x,g=a.top+l.scrollTop-u.y-f.y;return{x:p,y:g,width:a.width,height:a.height}}function DE(t){return ea(t).position==="static"}function w7(t,e){if(!Aa(t)||ea(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Ho(t)===n&&(n=n.ownerDocument.body),n}function jI(t,e){const n=hs(t);if(Wb(t))return n;if(!Aa(t)){let i=Jl(t);for(;i&&!Ld(i);){if(Js(i)&&!DE(i))return i;i=Jl(i)}return n}let r=w7(t,e);for(;r&&Mce(r)&&DE(r);)r=w7(r,e);return r&&Ld(r)&&DE(r)&&!Yx(r)?n:r||Pce(t)||n}const Xce=async function(t){const e=this.getOffsetParent||jI,n=this.getDimensions,r=await n(t.floating);return{reference:Kce(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Qce(t){return ea(t).direction==="rtl"}const Zce={convertOffsetParentRelativeRectToViewportRelativeRect:Fce,getDocumentElement:Ho,getClippingRect:Yce,getOffsetParent:jI,getElementRects:Xce,getClientRects:Hce,getDimensions:Wce,getScale:Ed,isElement:Js,isRTL:Qce},$I=kce,qI=yce,VI=Cce,GI=Ece,YI=Ace,WI=_ce,KI=bce,XI=Tce,QI=(t,e,n)=>{const r=new Map,i={platform:Zce,...n},s={...i.platform,_c:r};return gce(t,e,{...i,platform:s})};let E3,_3;if(typeof WeakMap<"u"){let t=new WeakMap;E3=e=>t.get(e),_3=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;E3=r=>{for(let i=0;i<t.length;i+=2)if(t[i]==r)return t[i+1]},_3=(r,i)=>(n==10&&(n=0),t[n++]=r,t[n++]=i)}var mo=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const r=e%this.width,i=e/this.width|0;let s=r+1,a=i+1;for(let l=1;s<this.width&&this.map[e+l]==n;l++)s++;for(let l=1;a<this.height&&this.map[e+this.width*l]==n;l++)a++;return{left:r,top:i,right:s,bottom:a}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){const{left:r,right:i,top:s,bottom:a}=this.findCell(t);return e=="horiz"?(n<0?r==0:i==this.width)?null:this.map[s*this.width+(n<0?r-1:i)]:(n<0?s==0:a==this.height)?null:this.map[r+this.width*(n<0?s-1:a)]}rectBetween(t,e){const{left:n,right:r,top:i,bottom:s}=this.findCell(t),{left:a,right:l,top:u,bottom:d}=this.findCell(e);return{left:Math.min(n,a),top:Math.min(i,u),right:Math.max(r,l),bottom:Math.max(s,d)}}cellsInRect(t){const e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let i=t.left;i<t.right;i++){const s=r*this.width+i,a=this.map[s];n[a]||(n[a]=!0,!(i==t.left&&i&&this.map[s-1]==a||r==t.top&&r&&this.map[s-this.width]==a)&&e.push(a))}return e}positionAt(t,e,n){for(let r=0,i=0;;r++){const s=i+n.child(r).nodeSize;if(r==t){let a=e+t*this.width;const l=(t+1)*this.width;for(;a<l&&this.map[a]<i;)a++;return a==l?s-1:this.map[a]}i=s}}static get(t){return E3(t)||_3(t,Jce(t))}};function Jce(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=ede(t),n=t.childCount,r=[];let i=0,s=null;const a=[];for(let d=0,f=e*n;d<f;d++)r[d]=0;for(let d=0,f=0;d<n;d++){const p=t.child(d);f++;for(let v=0;;v++){for(;i<r.length&&r[i]!=0;)i++;if(v==p.childCount)break;const E=p.child(v),{colspan:x,rowspan:S,colwidth:C}=E.attrs;for(let O=0;O<S;O++){if(O+d>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:f,n:S-O});break}const L=i+O*e;for(let D=0;D<x;D++){r[L+D]==0?r[L+D]=f:(s||(s=[])).push({type:"collision",row:d,pos:f,n:x-D});const R=C&&C[D];if(R){const F=(L+D)%e*2,G=a[F];G==null||G!=R&&a[F+1]==1?(a[F]=R,a[F+1]=1):G==R&&a[F+1]++}}}i+=x,f+=E.nodeSize}const g=(d+1)*e;let b=0;for(;i<g;)r[i++]==0&&b++;b&&(s||(s=[])).push({type:"missing",row:d,n:b}),f++}(e===0||n===0)&&(s||(s=[])).push({type:"zero_sized"});const l=new mo(e,n,r,s);let u=!1;for(let d=0;!u&&d<a.length;d+=2)a[d]!=null&&a[d+1]<n&&(u=!0);return u&&tde(l,a,t),l}function ede(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const i=t.child(r);let s=0;if(n)for(let a=0;a<r;a++){const l=t.child(a);for(let u=0;u<l.childCount;u++){const d=l.child(u);a+d.attrs.rowspan>r&&(s+=d.attrs.colspan)}}for(let a=0;a<i.childCount;a++){const l=i.child(a);s+=l.attrs.colspan,l.attrs.rowspan>1&&(n=!0)}e==-1?e=s:e!=s&&(e=Math.max(e,s))}return e}function tde(t,e,n){t.problems||(t.problems=[]);const r={};for(let i=0;i<t.map.length;i++){const s=t.map[i];if(r[s])continue;r[s]=!0;const a=n.nodeAt(s);if(!a)throw new RangeError(`No cell with offset ${s} found`);let l=null;const u=a.attrs;for(let d=0;d<u.colspan;d++){const f=e[(i+d)%t.width*2];f!=null&&(!u.colwidth||u.colwidth[d]!=f)&&((l||(l=nde(u)))[d]=f)}l&&t.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:l})}}function nde(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function Kx(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],i=r.spec.tableRole;i&&(e[i]=r)}}return e}new Vn("selectingCells");function rde(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function ZI(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function ide(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=rde(e.$head)||sde(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function sde(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function k7(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function JI(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function eL(t,e,n){const r=t.node(-1),i=mo.get(r),s=t.start(-1),a=i.nextCell(t.pos-s,e,n);return a==null?null:t.node(0).resolve(s+a)}function C7(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}var Sa=class lo extends vt{constructor(e,n=e){const r=e.node(-1),i=mo.get(r),s=e.start(-1),a=i.rectBetween(e.pos-s,n.pos-s),l=e.node(0),u=i.cellsInRect(a).filter(f=>f!=n.pos-s);u.unshift(n.pos-s);const d=u.map(f=>{const p=r.nodeAt(f);if(!p)throw new RangeError(`No cell with offset ${f} found`);const g=s+f+1;return new eD(l.resolve(g),l.resolve(g+p.content.size))});super(d[0].$from,d[0].$to,d),this.$anchorCell=e,this.$headCell=n}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),i=e.resolve(n.map(this.$headCell.pos));if(k7(r)&&k7(i)&&JI(r,i)){const s=this.$anchorCell.node(-1)!=r.node(-1);return s&&this.isRowSelection()?lo.rowSelection(r,i):s&&this.isColSelection()?lo.colSelection(r,i):new lo(r,i)}return Et.between(r,i)}content(){const e=this.$anchorCell.node(-1),n=mo.get(e),r=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),s={},a=[];for(let u=i.top;u<i.bottom;u++){const d=[];for(let f=u*n.width+i.left,p=i.left;p<i.right;p++,f++){const g=n.map[f];if(s[g])continue;s[g]=!0;const b=n.findCell(g);let v=e.nodeAt(g);if(!v)throw new RangeError(`No cell with offset ${g} found`);const E=i.left-b.left,x=b.right-i.right;if(E>0||x>0){let S=v.attrs;if(E>0&&(S=C7(S,0,E)),x>0&&(S=C7(S,S.colspan-x,x)),b.left<i.left){if(v=v.type.createAndFill(S),!v)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(S)}`)}else v=v.type.create(S,v.content)}if(b.top<i.top||b.bottom>i.bottom){const S={...v.attrs,rowspan:Math.min(b.bottom,i.bottom)-Math.max(b.top,i.top)};b.top<i.top?v=v.type.createAndFill(S):v=v.type.create(S,v.content)}d.push(v)}a.push(e.child(u).copy(ke.from(d)))}const l=this.isColSelection()&&this.isRowSelection()?e:a;return new qe(ke.from(l),1,1)}replace(e,n=qe.empty){const r=e.steps.length,i=this.ranges;for(let a=0;a<i.length;a++){const{$from:l,$to:u}=i[a],d=e.mapping.slice(r);e.replace(d.map(l.pos),d.map(u.pos),a?qe.empty:n)}const s=vt.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);s&&e.setSelection(s)}replaceWith(e,n){this.replace(e,new qe(ke.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=mo.get(n),i=this.$anchorCell.start(-1),s=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let a=0;a<s.length;a++)e(n.nodeAt(s[a]),i+s[a])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),i=mo.get(r),s=e.start(-1),a=i.findCell(e.pos-s),l=i.findCell(n.pos-s),u=e.node(0);return a.top<=l.top?(a.top>0&&(e=u.resolve(s+i.map[a.left])),l.bottom<i.height&&(n=u.resolve(s+i.map[i.width*(i.height-1)+l.right-1]))):(l.top>0&&(n=u.resolve(s+i.map[l.left])),a.bottom<i.height&&(e=u.resolve(s+i.map[i.width*(i.height-1)+a.right-1]))),new lo(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=mo.get(e),r=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-r),s=n.colCount(this.$headCell.pos-r);if(Math.min(i,s)>0)return!1;const a=i+this.$anchorCell.nodeAfter.attrs.colspan,l=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,l)==n.width}eq(e){return e instanceof lo&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),i=mo.get(r),s=e.start(-1),a=i.findCell(e.pos-s),l=i.findCell(n.pos-s),u=e.node(0);return a.left<=l.left?(a.left>0&&(e=u.resolve(s+i.map[a.top*i.width])),l.right<i.width&&(n=u.resolve(s+i.map[i.width*(l.top+1)-1]))):(l.left>0&&(n=u.resolve(s+i.map[l.top*i.width])),a.right<i.width&&(e=u.resolve(s+i.map[i.width*(a.top+1)-1]))),new lo(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new lo(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new lo(e.resolve(n),e.resolve(r))}getBookmark(){return new ade(this.$anchorCell.pos,this.$headCell.pos)}};Sa.prototype.visible=!1;vt.jsonID("cell",Sa);var ade=class tL{constructor(e,n){this.anchor=e,this.head=n}map(e){return new tL(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&JI(n,r)?new Sa(n,r):vt.near(r,1)}};new Vn("fix-tables");function nL(t){const e=t.selection,n=ide(t),r=n.node(-1),i=n.start(-1),s=mo.get(r);return{...e instanceof Sa?s.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):s.findCell(n.pos-i),tableStart:i,map:s,table:r}}function ode(t){return function(e,n){if(!ZI(e))return!1;if(n){const r=Kx(e.schema),i=nL(e),s=e.tr,a=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),l=a.map(u=>i.table.nodeAt(u));for(let u=0;u<a.length;u++)l[u].type==r.header_cell&&s.setNodeMarkup(i.tableStart+a[u],r.cell,l[u].attrs);if(s.steps.length===0)for(let u=0;u<a.length;u++)s.setNodeMarkup(i.tableStart+a[u],r.header_cell,l[u].attrs);n(s)}return!0}}function A7(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let i=0;i<r.length;i++){const s=e.table.nodeAt(r[i]);if(s&&s.type!==n.header_cell)return!1}return!0}function Xx(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?ode(t):function(n,r){if(!ZI(n))return!1;if(r){const i=Kx(n.schema),s=nL(n),a=n.tr,l=A7("row",s,i),u=A7("column",s,i),d=(t==="column"?l:t==="row"&&u)?1:0,f=t=="column"?{left:0,top:d,right:1,bottom:s.map.height}:t=="row"?{left:d,top:0,right:s.map.width,bottom:1}:s,p=t=="column"?u?i.cell:i.header_cell:t=="row"?l?i.cell:i.header_cell:i.cell;s.map.cellsInRect(f).forEach(g=>{const b=g+s.tableStart,v=a.doc.nodeAt(b);v&&a.setNodeMarkup(b,p,v.attrs)}),r(a)}return!0}}Xx("row",{useDeprecatedLogic:!0});Xx("column",{useDeprecatedLogic:!0});Xx("cell",{useDeprecatedLogic:!0});function eg(t,e){const n=t.selection;if(!(n instanceof Sa))return!1;if(e){const r=t.tr,i=Kx(t.schema).cell.createAndFill().content;n.forEachCell((s,a)=>{s.content.eq(i)||r.replace(r.mapping.map(a+1),r.mapping.map(a+s.nodeSize-1),new qe(i,0,0))}),r.docChanged&&e(r)}return!0}Mx({ArrowLeft:tg("horiz",-1),ArrowRight:tg("horiz",1),ArrowUp:tg("vert",-1),ArrowDown:tg("vert",1),"Shift-ArrowLeft":ng("horiz",-1),"Shift-ArrowRight":ng("horiz",1),"Shift-ArrowUp":ng("vert",-1),"Shift-ArrowDown":ng("vert",1),Backspace:eg,"Mod-Backspace":eg,Delete:eg,"Mod-Delete":eg});function Ag(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function tg(t,e){return(n,r,i)=>{if(!i)return!1;const s=n.selection;if(s instanceof Sa)return Ag(n,r,vt.near(s.$headCell,e));if(t!="horiz"&&!s.empty)return!1;const a=rL(i,t,e);if(a==null)return!1;if(t=="horiz")return Ag(n,r,vt.near(n.doc.resolve(s.head+e),e));{const l=n.doc.resolve(a),u=eL(l,t,e);let d;return u?d=vt.near(u,1):e<0?d=vt.near(n.doc.resolve(l.before(-1)),-1):d=vt.near(n.doc.resolve(l.after(-1)),1),Ag(n,r,d)}}}function ng(t,e){return(n,r,i)=>{if(!i)return!1;const s=n.selection;let a;if(s instanceof Sa)a=s;else{const u=rL(i,t,e);if(u==null)return!1;a=new Sa(n.doc.resolve(u))}const l=eL(a.$headCell,t,e);return l?Ag(n,r,new Sa(a.$anchorCell,l)):!1}}function rL(t,e,n){if(!(t.state.selection instanceof Et))return null;const{$head:r}=t.state.selection;for(let i=r.depth-1;i>=0;i--){const s=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const a=r.before(i),l=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(l)?a:null}}return null}new Vn("tableColumnResizing");function lde(t,e){const n=Math.min(t.top,e.top),r=Math.max(t.bottom,e.bottom),i=Math.min(t.left,e.left),a=Math.max(t.right,e.right)-i,l=r-n,u=i,d=n;return new DOMRect(u,d,a,l)}var ude=class{constructor({editor:t,element:e,view:n,updateDelay:r=250,resizeDelay:i=60,shouldShow:s,appendTo:a,getReferencedVirtualElement:l,options:u}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:f,state:p,from:g,to:b})=>{const{doc:v,selection:E}=p,{empty:x}=E,S=!v.textBetween(g,b).length&&Lx(p.selection),C=this.element.contains(document.activeElement);return!(!(f.hasFocus()||C)||x||S||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:f})=>{var p;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}f!=null&&f.relatedTarget&&((p=this.element.parentNode)!=null&&p.contains(f.relatedTarget))||(f==null?void 0:f.relatedTarget)!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(f,p)=>{const g=!(p!=null&&p.selection.eq(f.state.selection)),b=!(p!=null&&p.doc.eq(f.state.doc));!g&&!b||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(f,g,b,p)},this.updateDelay))},this.updateHandler=(f,p,g,b)=>{const{composing:v}=f;if(v||!p&&!g)return;if(!this.getShouldShow(b)){this.hide();return}this.updatePosition(),this.show()},this.transactionHandler=({transaction:f})=>{const p=f.getMeta("bubbleMenu");p==="updatePosition"?this.updatePosition():p&&typeof p=="object"&&p.type==="updateOptions"&&this.updateOptions(p.options)};var d;this.editor=t,this.element=e,this.view=n,this.updateDelay=r,this.resizeDelay=i,this.appendTo=a,this.scrollTarget=(d=u==null?void 0:u.scrollTarget)!=null?d:window,this.getReferencedVirtualElement=l,this.floatingUIOptions={...this.floatingUIOptions,...u},this.element.tabIndex=0,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){const t=[];return this.floatingUIOptions.flip&&t.push(GI(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(VI(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push($I(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(KI(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(YI(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(qI(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(WI(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push(XI(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),t}get virtualElement(){var t,e,n;const{selection:r}=this.editor.state,i=(t=this.getReferencedVirtualElement)==null?void 0:t.call(this);if(i)return i;if(!((n=(e=this.view)==null?void 0:e.dom)!=null&&n.parentNode))return;const s=hI(this.view,r.from,r.to);let a={getBoundingClientRect:()=>s,getClientRects:()=>[s]};if(r instanceof ct){let l=this.view.nodeDOM(r.from);const u=l.dataset.nodeViewWrapper?l:l.querySelector("[data-node-view-wrapper]");u&&(l=u),l&&(a={getBoundingClientRect:()=>l.getBoundingClientRect(),getClientRects:()=>[l.getBoundingClientRect()]})}if(r instanceof Sa){const{$anchorCell:l,$headCell:u}=r,d=l?l.pos:u.pos,f=u?u.pos:l.pos,p=this.view.nodeDOM(d),g=this.view.nodeDOM(f);if(!p||!g)return;const b=p===g?p.getBoundingClientRect():lde(p.getBoundingClientRect(),g.getBoundingClientRect());a={getBoundingClientRect:()=>b,getClientRects:()=>[b]}}return a}updatePosition(){const t=this.virtualElement;t&&QI(t,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:n,strategy:r,middlewareData:i})=>{var s,a;if((s=i.hide)!=null&&s.referenceHidden||(a=i.hide)!=null&&a.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=r,this.element.style.left=`${e}px`,this.element.style.top=`${n}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(t,e){const{state:n}=t,r=n.selection.from!==n.selection.to;if(this.updateDelay>0&&r){this.handleDebouncedUpdate(t,e);return}const i=!(e!=null&&e.selection.eq(t.state.selection)),s=!(e!=null&&e.doc.eq(t.state.doc));this.updateHandler(t,i,s,e)}getShouldShow(t){var e;const{state:n}=this.view,{selection:r}=n,{ranges:i}=r,s=Math.min(...i.map(u=>u.$from.pos)),a=Math.max(...i.map(u=>u.$to.pos));return((e=this.shouldShow)==null?void 0:e.call(this,{editor:this.editor,element:this.element,view:this.view,state:n,oldState:t,from:s,to:a}))||!1}show(){var t;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(t=e??this.view.dom.parentElement)==null||t.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}updateOptions(t){var e;if(t.updateDelay!==void 0&&(this.updateDelay=t.updateDelay),t.resizeDelay!==void 0&&(this.resizeDelay=t.resizeDelay),t.appendTo!==void 0&&(this.appendTo=t.appendTo),t.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=t.getReferencedVirtualElement),t.shouldShow!==void 0&&t.shouldShow&&(this.shouldShow=t.shouldShow),t.options!==void 0){const n=(e=t.options.scrollTarget)!=null?e:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...t.options}}}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},iL=t=>new zn({key:typeof t.pluginKey=="string"?new Vn(t.pluginKey):t.pluginKey,view:e=>new ude({view:e,...t})});Gn.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[iL({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var cde=class{constructor({editor:t,element:e,view:n,updateDelay:r=250,resizeDelay:i=60,options:s,appendTo:a,shouldShow:l}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:d,state:f})=>{const{selection:p}=f,{$anchor:g,empty:b}=p,v=g.depth===1,E=g.parent.isTextblock&&!g.parent.type.spec.code&&!g.parent.textContent&&g.parent.childCount===0&&!this.getTextContent(g.parent);return!(!d.hasFocus()||!b||!v||!E||!this.editor.isEditable)},this.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(d,f,p,g)=>{const{composing:b}=d;if(b||!f&&!p)return;if(!this.getShouldShow(g)){this.hide();return}this.updatePosition(),this.show()},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:d})=>{var f;if(this.preventHide){this.preventHide=!1;return}d!=null&&d.relatedTarget&&((f=this.element.parentNode)!=null&&f.contains(d.relatedTarget))||(d==null?void 0:d.relatedTarget)!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:d})=>{const f=d.getMeta("floatingMenu");f==="updatePosition"?this.updatePosition():f&&typeof f=="object"&&f.type==="updateOptions"&&this.updateOptions(f.options)},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)};var u;this.editor=t,this.element=e,this.view=n,this.updateDelay=r,this.resizeDelay=i,this.appendTo=a,this.scrollTarget=(u=s==null?void 0:s.scrollTarget)!=null?u:window,this.floatingUIOptions={...this.floatingUIOptions,...s},this.element.tabIndex=0,l&&(this.shouldShow=l),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getTextContent(t){return oI(t,{textSerializers:zx(this.editor.schema)})}get middlewares(){const t=[];return this.floatingUIOptions.flip&&t.push(GI(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(VI(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push($I(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(KI(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(YI(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(qI(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(WI(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push(XI(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),t}getShouldShow(t){var e;const{state:n}=this.view,{selection:r}=n,{ranges:i}=r,s=Math.min(...i.map(u=>u.$from.pos)),a=Math.max(...i.map(u=>u.$to.pos));return(e=this.shouldShow)==null?void 0:e.call(this,{editor:this.editor,view:this.view,state:n,oldState:t,from:s,to:a})}updateOptions(t){var e;if(t.updateDelay!==void 0&&(this.updateDelay=t.updateDelay),t.resizeDelay!==void 0&&(this.resizeDelay=t.resizeDelay),t.appendTo!==void 0&&(this.appendTo=t.appendTo),t.shouldShow!==void 0&&t.shouldShow&&(this.shouldShow=t.shouldShow),t.options!==void 0){const n=(e=t.options.scrollTarget)!=null?e:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...t.options}}}updatePosition(){const{selection:t}=this.editor.state,e=hI(this.view,t.from,t.to);QI({getBoundingClientRect:()=>e,getClientRects:()=>[e]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:r,y:i,strategy:s,middlewareData:a})=>{var l,u;if((l=a.hide)!=null&&l.referenceHidden||(u=a.hide)!=null&&u.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=s,this.element.style.left=`${r}px`,this.element.style.top=`${i}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(t,e){const n=!(e!=null&&e.selection.eq(t.state.selection)),r=!(e!=null&&e.doc.eq(t.state.doc));this.updateHandler(t,n,r,e)}show(){var t;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(t=e??this.view.dom.parentElement)==null||t.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},sL=t=>new zn({key:typeof t.pluginKey=="string"?new Vn(t.pluginKey):t.pluginKey,view:e=>new cde({view:e,...t})});Gn.create({name:"floatingMenu",addOptions(){return{element:null,options:{},pluginKey:"floatingMenu",updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:t,dispatch:e})=>(e&&t.setMeta("floatingMenu","updatePosition"),!0)}},addProseMirrorPlugins(){return this.options.element?[sL({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});var dde=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},fde=({contentComponent:t})=>{const e=p_.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return A.jsx(A.Fragment,{children:Object.values(e)})};function hde(){const t=new Set;let e={};return{subscribe(n){return t.add(n),()=>{t.delete(n)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(n,r){e={...e,[n]:Rj.createPortal(r.reactElement,r.element,n)},t.forEach(i=>i())},removeRenderer(n){const r={...e};delete r[n],e=r,t.forEach(i=>i())}}}var pde=class extends le.Component{constructor(t){var e;super(t),this.editorContentRef=le.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!((e=t.editor)!=null&&e.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var t;const e=this.props.editor;if(e&&!e.isDestroyed&&((t=e.view.dom)!=null&&t.parentNode)){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n}),e.contentComponent=hde(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var t;const e=this.props.editor;if(e){this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null;try{if(!((t=e.view.dom)!=null&&t.parentNode))return;const n=document.createElement("div");n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n})}catch{}}}render(){const{editor:t,innerRef:e,...n}=this.props;return A.jsxs(A.Fragment,{children:[A.jsx("div",{ref:dde(e,this.editorContentRef),...n}),(t==null?void 0:t.contentComponent)&&A.jsx(fde,{contentComponent:t.contentComponent})]})}},mde=z.forwardRef((t,e)=>{const n=le.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return le.createElement(pde,{key:n,innerRef:e,...t})}),aL=le.memo(mde),gde=typeof window<"u"?z.useLayoutEffect:z.useEffect,bde=class{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},n=this.editor;return n.on("transaction",e),()=>{n.off("transaction",e)}}}};function vde(t){var e;const[n]=z.useState(()=>new bde(t.editor)),r=sce.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!=null?e:nce);return gde(()=>n.watch(t.editor),[t.editor,n]),z.useDebugValue(r),r}var yde=!1,x3=typeof window>"u",Ede=x3||!!(typeof window<"u"&&window.next),_de=class oL{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){return this.options.current.immediatelyRender===void 0?x3||Ede?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null)}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onBeforeCreate)==null?void 0:s.call(i,...r)},onBlur:(...r)=>{var i,s;return(s=(i=this.options.current).onBlur)==null?void 0:s.call(i,...r)},onCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onCreate)==null?void 0:s.call(i,...r)},onDestroy:(...r)=>{var i,s;return(s=(i=this.options.current).onDestroy)==null?void 0:s.call(i,...r)},onFocus:(...r)=>{var i,s;return(s=(i=this.options.current).onFocus)==null?void 0:s.call(i,...r)},onSelectionUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onSelectionUpdate)==null?void 0:s.call(i,...r)},onTransaction:(...r)=>{var i,s;return(s=(i=this.options.current).onTransaction)==null?void 0:s.call(i,...r)},onUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onUpdate)==null?void 0:s.call(i,...r)},onContentError:(...r)=>{var i,s;return(s=(i=this.options.current).onContentError)==null?void 0:s.call(i,...r)},onDrop:(...r)=>{var i,s;return(s=(i=this.options.current).onDrop)==null?void 0:s.call(i,...r)},onPaste:(...r)=>{var i,s;return(s=(i=this.options.current).onPaste)==null?void 0:s.call(i,...r)},onDelete:(...r)=>{var i,s;return(s=(i=this.options.current).onDelete)==null?void 0:s.call(i,...r)}};return new lue(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,n){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&n.extensions?e.extensions.length!==n.extensions.length?!1:e.extensions.every((i,s)=>{var a;return i===((a=n.extensions)==null?void 0:a[s])}):e[r]===n[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?oL.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,i)=>r===e[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function xde(t={},e=[]){const n=z.useRef(t);n.current=t;const[r]=z.useState(()=>new _de(n)),i=p_.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return z.useDebugValue(i),z.useEffect(r.onRender(e)),vde({editor:i,selector:({transactionNumber:s})=>t.shouldRerenderOnTransaction===!1||t.shouldRerenderOnTransaction===void 0?null:t.immediatelyRender&&s===0?0:s+1}),i}var Qx=z.createContext({editor:null});Qx.Consumer;var lL=()=>z.useContext(Qx),Tde=z.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),Sde=()=>z.useContext(Tde);le.forwardRef((t,e)=>{const{onDragStart:n}=Sde(),r=t.as||"div";return A.jsx(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});le.createContext({markViewContentRef:()=>{}});var wde=le.forwardRef(({pluginKey:t="bubbleMenu",editor:e,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:s=null,getReferencedVirtualElement:a,options:l,children:u,...d},f)=>{const p=z.useRef(document.createElement("div"));typeof f=="function"?f(p.current):f&&(f.current=p.current);const{editor:g}=lL(),b=e||g,v={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:t,shouldShow:s,getReferencedVirtualElement:a,options:l},E=z.useRef(v);E.current=v;const[x,S]=z.useState(!1),C=z.useRef(!0);return z.useEffect(()=>{if(b!=null&&b.isDestroyed)return;if(!b){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const O=p.current;O.style.visibility="hidden",O.style.position="absolute";const L=iL({...E.current,editor:b,element:O});b.registerPlugin(L);const D=E.current.pluginKey;return C.current=!0,S(!0),()=>{S(!1),b.unregisterPlugin(D),window.requestAnimationFrame(()=>{O.parentNode&&O.parentNode.removeChild(O)})}},[b]),z.useEffect(()=>{if(!(!x||!b||b.isDestroyed)){if(C.current){C.current=!1;return}b.view.dispatch(b.state.tr.setMeta("bubbleMenu",{type:"updateOptions",options:E.current}))}},[x,b,n,r,s,l,i,a]),fb.createPortal(A.jsx("div",{...d,children:u}),p.current)}),kde=le.forwardRef(({pluginKey:t="floatingMenu",editor:e,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:s=null,options:a,children:l,...u},d)=>{const f=z.useRef(document.createElement("div"));typeof d=="function"?d(f.current):d&&(d.current=f.current);const{editor:p}=lL(),g=e||p,b={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:t,shouldShow:s,options:a},v=z.useRef(b);v.current=b;const[E,x]=z.useState(!1),S=z.useRef(!0);return z.useEffect(()=>{if(g!=null&&g.isDestroyed)return;if(!g){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const C=f.current;C.style.visibility="hidden",C.style.position="absolute";const O=sL({...v.current,editor:g,element:C});g.registerPlugin(O);const L=v.current.pluginKey;return S.current=!0,x(!0),()=>{x(!1),g.unregisterPlugin(L),window.requestAnimationFrame(()=>{C.parentNode&&C.parentNode.removeChild(C)})}},[g]),z.useEffect(()=>{if(!(!E||!g||g.isDestroyed)){if(S.current){S.current=!1;return}g.view.dispatch(g.state.tr.setMeta("floatingMenu",{type:"updateOptions",options:v.current}))}},[E,g,n,r,s,a,i]),fb.createPortal(A.jsx("div",{...u,children:l}),f.current)}),Zx=z.createContext({editor:null,isReady:!1});Zx.displayName="TiptapContext";var Qb=()=>z.useContext(Zx);function uL({instance:t,children:e}){var n;const[r,i]=z.useState((n=t==null?void 0:t.isInitialized)!=null?n:!1);z.useEffect(()=>{if(!t){i(!1);return}if(t.isInitialized){i(!0);return}const l=()=>{i(!0)};return t.on("create",l),()=>{t.off("create",l)}},[t]);const s=z.useMemo(()=>({editor:t,isReady:r}),[t,r]),a=z.useMemo(()=>({editor:t}),[t]);return A.jsx(Qx.Provider,{value:a,children:A.jsx(Zx.Provider,{value:s,children:e})})}uL.displayName="Tiptap";function cL({...t}){const{editor:e}=Qb();return A.jsx(aL,{editor:e,...t})}cL.displayName="Tiptap.Content";function dL({children:t}){const{isReady:e}=Qb();return e?null:t}dL.displayName="Tiptap.Loading";function fL({children:t,...e}){const{editor:n}=Qb();return n?A.jsx(wde,{editor:n,...e,children:t}):null}fL.displayName="Tiptap.BubbleMenu";function hL({children:t,...e}){const{editor:n}=Qb();return n?A.jsx(kde,{...e,editor:n,children:t}):null}hL.displayName="Tiptap.FloatingMenu";Object.assign(uL,{Content:cL,Loading:dL,BubbleMenu:fL,FloatingMenu:hL});var b1=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);const{children:n,...r}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,r,n]},Cde=/^\s*>\s$/,Ade=gs.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return b1("blockquote",{...Cr(this.options.HTMLAttributes,t),children:b1("slot",{})})},parseMarkdown:(t,e)=>e.createNode("blockquote",void 0,e.parseChildren(t.tokens||[])),renderMarkdown:(t,e)=>{if(!t.content)return"";const n=">",r=[];return t.content.forEach(i=>{const l=e.renderChildren([i]).split(`
`).map(u=>u.trim()===""?n:`${n} ${u}`);r.push(l.join(`
`))}),r.join(`
${n}
`)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Dd({find:Cde,type:this.type})]}}),Nde=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Ode=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Mde=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Rde=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Dde=cc.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return b1("strong",{...Cr(this.options.HTMLAttributes,t),children:b1("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Rd({find:Nde,type:this.type}),Rd({find:Mde,type:this.type})]},addPasteRules(){return[Ju({find:Ode,type:this.type}),Ju({find:Rde,type:this.type})]}}),Ide=/(^|[^`])`([^`]+)`(?!`)$/,Lde=/(^|[^`])`([^`]+)`(?!`)/g,Pde=cc.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",Cr(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Rd({find:Ide,type:this.type})]},addPasteRules(){return[Ju({find:Lde,type:this.type})]}}),IE=4,Bde=/^```([a-z]+)?[\s\n]$/,zde=/^~~~([a-z]+)?[\s\n]$/,Ude=gs.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:IE,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options;if(!n)return null;const s=[...((e=t.firstElementChild)==null?void 0:e.classList)||[]].filter(a=>a.startsWith(n)).map(a=>a.replace(n,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",Cr(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>{var n;return((n=t.raw)==null?void 0:n.startsWith("```"))===!1&&t.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:(t,e)=>{var n;let r="";const i=((n=t.attrs)==null?void 0:n.language)||"";return t.content?r=[`\`\`\`${i}`,e.renderChildren(t.content),"```"].join(`
`):r=`\`\`\`${i}

\`\`\``,r},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:IE,{state:r}=t,{selection:i}=r,{$from:s,empty:a}=i;if(s.parent.type!==this.type)return!1;const l=" ".repeat(n);return a?t.commands.insertContent(l):t.commands.command(({tr:u})=>{const{from:d,to:f}=i,b=r.doc.textBetween(d,f,`
`,`
`).split(`
`).map(v=>l+v).join(`
`);return u.replaceWith(d,f,r.schema.text(b)),!0})},"Shift-Tab":({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:IE,{state:r}=t,{selection:i}=r,{$from:s,empty:a}=i;return s.parent.type!==this.type?!1:a?t.commands.command(({tr:l})=>{var u;const{pos:d}=s,f=s.start(),p=s.end(),b=r.doc.textBetween(f,p,`
`,`
`).split(`
`);let v=0,E=0;const x=d-f;for(let R=0;R<b.length;R+=1){if(E+b[R].length>=x){v=R;break}E+=b[R].length+1}const C=((u=b[v].match(/^ */))==null?void 0:u[0])||"",O=Math.min(C.length,n);if(O===0)return!0;let L=f;for(let R=0;R<v;R+=1)L+=b[R].length+1;return l.delete(L,L+O),d-L<=O&&l.setSelection(Et.create(l.doc,L)),!0}):t.commands.command(({tr:l})=>{const{from:u,to:d}=i,g=r.doc.textBetween(u,d,`
`,`
`).split(`
`).map(b=>{var v;const E=((v=b.match(/^ */))==null?void 0:v[0])||"",x=Math.min(E.length,n);return b.slice(x)}).join(`
`);return l.replaceWith(u,d,r.schema.text(g)),!0})},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,a=r.parent.textContent.endsWith(`

`);return!s||!a?!1:t.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:s}=n;if(!s||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const l=i.after();return l===void 0?!1:r.nodeAt(l)?t.commands.command(({tr:d})=>(d.setSelection(vt.near(r.resolve(l))),!0)):t.commands.exitCode()}}},addInputRules(){return[g3({find:Bde,type:this.type,getAttributes:t=>({language:t[1]})}),g3({find:zde,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new zn({key:new Vn("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,s=i==null?void 0:i.mode;if(!n||!s)return!1;const{tr:a,schema:l}=t.state,u=l.text(n.replace(/\r\n?/g,`
`));return a.replaceSelectionWith(this.type.create({language:s},u)),a.selection.$from.parent.type!==this.type&&a.setSelection(Et.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta("paste",!0),t.dispatch(a),!0}}})]}}),Fde=gs.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`

`):""}),Hde=gs.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",Cr(this.options.HTMLAttributes,t)]},renderText(){return`
`},renderMarkdown:()=>`  
`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:s}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:l}=r.extensionManager,u=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:f})=>{if(f&&u&&a){const p=u.filter(g=>l.includes(g.type.name));d.ensureMarks(p)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),jde=gs.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,Cr(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;const r=(n=t.attrs)!=null&&n.level?parseInt(t.attrs.level,10):1,i="#".repeat(r);return t.content?`${i} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>g3({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),$de=gs.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",Cr(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!cue(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$to:r}=n,i=t();return cI(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:s,tr:a,dispatch:l})=>{if(l){const{$to:u}=a.selection,d=u.end();if(u.nodeAfter)u.nodeAfter.isTextblock?a.setSelection(Et.create(a.doc,u.pos+1)):u.nodeAfter.isBlock?a.setSelection(ct.create(a.doc,u.pos)):a.setSelection(Et.create(a.doc,u.pos));else{const f=s.schema.nodes[this.options.nextNodeType]||u.parent.type.contentMatch.defaultType,p=f==null?void 0:f.create();p&&(a.insert(d,p),a.setSelection(Et.create(a.doc,d+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[uue({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),qde=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Vde=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Gde=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Yde=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Wde=cc.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",Cr(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Rd({find:qde,type:this.type}),Rd({find:Gde,type:this.type})]},addPasteRules(){return[Ju({find:Vde,type:this.type}),Ju({find:Yde,type:this.type})]}});const Kde=" ögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Xde="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",T3="numeric",S3="ascii",w3="alpha",Xf="asciinumeric",Sf="alphanumeric",k3="domain",pL="emoji",Qde="scheme",Zde="slashscheme",LE="whitespace";function Jde(t,e){return t in e||(e[t]=[]),e[t]}function zu(t,e,n){e[T3]&&(e[Xf]=!0,e[Sf]=!0),e[S3]&&(e[Xf]=!0,e[w3]=!0),e[Xf]&&(e[Sf]=!0),e[w3]&&(e[Sf]=!0),e[Sf]&&(e[k3]=!0),e[pL]&&(e[k3]=!0);for(const r in e){const i=Jde(r,n);i.indexOf(t)<0&&i.push(t)}}function e0e(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function $i(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}$i.groups={};$i.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const i=e.jr[r][0],s=e.jr[r][1];if(s&&i.test(t))return s}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let i=0;i<t.length;i++)this.tt(t[i],e,n,r)},tr(t,e,n,r){r=r||$i.groups;let i;return e&&e.j?i=e:(i=new $i(e),n&&r&&zu(e,n,r)),this.jr.push([t,i]),i},ts(t,e,n,r){let i=this;const s=t.length;if(!s)return i;for(let a=0;a<s-1;a++)i=i.tt(t[a]);return i.tt(t[s-1],e,n,r)},tt(t,e,n,r){r=r||$i.groups;const i=this;if(e&&e.j)return i.j[t]=e,e;const s=e;let a,l=i.go(t);if(l?(a=new $i,Object.assign(a.j,l.j),a.jr.push.apply(a.jr,l.jr),a.jd=l.jd,a.t=l.t):a=new $i,s){if(r)if(a.t&&typeof a.t=="string"){const u=Object.assign(e0e(a.t,r),n);zu(s,u,r)}else n&&zu(s,n,r);a.t=s}return i.j[t]=a,a}};const Dt=(t,e,n,r,i)=>t.ta(e,n,r,i),ir=(t,e,n,r,i)=>t.tr(e,n,r,i),N7=(t,e,n,r,i)=>t.ts(e,n,r,i),Ie=(t,e,n,r,i)=>t.tt(e,n,r,i),uo="WORD",C3="UWORD",mL="ASCIINUMERICAL",gL="ALPHANUMERICAL",Th="LOCALHOST",A3="TLD",N3="UTLD",Ng="SCHEME",ld="SLASH_SCHEME",Jx="NUM",O3="WS",e6="NL",Qf="OPENBRACE",Zf="CLOSEBRACE",v1="OPENBRACKET",y1="CLOSEBRACKET",E1="OPENPAREN",_1="CLOSEPAREN",x1="OPENANGLEBRACKET",T1="CLOSEANGLEBRACKET",S1="FULLWIDTHLEFTPAREN",w1="FULLWIDTHRIGHTPAREN",k1="LEFTCORNERBRACKET",C1="RIGHTCORNERBRACKET",A1="LEFTWHITECORNERBRACKET",N1="RIGHTWHITECORNERBRACKET",O1="FULLWIDTHLESSTHAN",M1="FULLWIDTHGREATERTHAN",R1="AMPERSAND",D1="APOSTROPHE",I1="ASTERISK",Ol="AT",L1="BACKSLASH",P1="BACKTICK",B1="CARET",Dl="COLON",t6="COMMA",z1="DOLLAR",fa="DOT",U1="EQUALS",n6="EXCLAMATION",As="HYPHEN",Jf="PERCENT",F1="PIPE",H1="PLUS",j1="POUND",eh="QUERY",r6="QUOTE",bL="FULLWIDTHMIDDLEDOT",i6="SEMI",ha="SLASH",th="TILDE",$1="UNDERSCORE",vL="EMOJI",q1="SYM";var yL=Object.freeze({__proto__:null,ALPHANUMERICAL:gL,AMPERSAND:R1,APOSTROPHE:D1,ASCIINUMERICAL:mL,ASTERISK:I1,AT:Ol,BACKSLASH:L1,BACKTICK:P1,CARET:B1,CLOSEANGLEBRACKET:T1,CLOSEBRACE:Zf,CLOSEBRACKET:y1,CLOSEPAREN:_1,COLON:Dl,COMMA:t6,DOLLAR:z1,DOT:fa,EMOJI:vL,EQUALS:U1,EXCLAMATION:n6,FULLWIDTHGREATERTHAN:M1,FULLWIDTHLEFTPAREN:S1,FULLWIDTHLESSTHAN:O1,FULLWIDTHMIDDLEDOT:bL,FULLWIDTHRIGHTPAREN:w1,HYPHEN:As,LEFTCORNERBRACKET:k1,LEFTWHITECORNERBRACKET:A1,LOCALHOST:Th,NL:e6,NUM:Jx,OPENANGLEBRACKET:x1,OPENBRACE:Qf,OPENBRACKET:v1,OPENPAREN:E1,PERCENT:Jf,PIPE:F1,PLUS:H1,POUND:j1,QUERY:eh,QUOTE:r6,RIGHTCORNERBRACKET:C1,RIGHTWHITECORNERBRACKET:N1,SCHEME:Ng,SEMI:i6,SLASH:ha,SLASH_SCHEME:ld,SYM:q1,TILDE:th,TLD:A3,UNDERSCORE:$1,UTLD:N3,UWORD:C3,WORD:uo,WS:O3});const io=/[a-z]/,of=new RegExp("\\p{L}","u"),PE=new RegExp("\\p{Emoji}","u"),so=/\d/,BE=/\s/,O7="\r",zE=`
`,t0e="️",n0e="‍",UE="￼";let rg=null,ig=null;function r0e(t=[]){const e={};$i.groups=e;const n=new $i;rg==null&&(rg=M7(Kde)),ig==null&&(ig=M7(Xde)),Ie(n,"'",D1),Ie(n,"{",Qf),Ie(n,"}",Zf),Ie(n,"[",v1),Ie(n,"]",y1),Ie(n,"(",E1),Ie(n,")",_1),Ie(n,"<",x1),Ie(n,">",T1),Ie(n,"（",S1),Ie(n,"）",w1),Ie(n,"「",k1),Ie(n,"」",C1),Ie(n,"『",A1),Ie(n,"』",N1),Ie(n,"＜",O1),Ie(n,"＞",M1),Ie(n,"&",R1),Ie(n,"*",I1),Ie(n,"@",Ol),Ie(n,"`",P1),Ie(n,"^",B1),Ie(n,":",Dl),Ie(n,",",t6),Ie(n,"$",z1),Ie(n,".",fa),Ie(n,"=",U1),Ie(n,"!",n6),Ie(n,"-",As),Ie(n,"%",Jf),Ie(n,"|",F1),Ie(n,"+",H1),Ie(n,"#",j1),Ie(n,"?",eh),Ie(n,'"',r6),Ie(n,"/",ha),Ie(n,";",i6),Ie(n,"~",th),Ie(n,"_",$1),Ie(n,"\\",L1),Ie(n,"・",bL);const r=ir(n,so,Jx,{[T3]:!0});ir(r,so,r);const i=ir(r,io,mL,{[Xf]:!0}),s=ir(r,of,gL,{[Sf]:!0}),a=ir(n,io,uo,{[S3]:!0});ir(a,so,i),ir(a,io,a),ir(i,so,i),ir(i,io,i);const l=ir(n,of,C3,{[w3]:!0});ir(l,io),ir(l,so,s),ir(l,of,l),ir(s,so,s),ir(s,io),ir(s,of,s);const u=Ie(n,zE,e6,{[LE]:!0}),d=Ie(n,O7,O3,{[LE]:!0}),f=ir(n,BE,O3,{[LE]:!0});Ie(n,UE,f),Ie(d,zE,u),Ie(d,UE,f),ir(d,BE,f),Ie(f,O7),Ie(f,zE),ir(f,BE,f),Ie(f,UE,f);const p=ir(n,PE,vL,{[pL]:!0});Ie(p,"#"),ir(p,PE,p),Ie(p,t0e,p);const g=Ie(p,n0e);Ie(g,"#"),ir(g,PE,p);const b=[[io,a],[so,i]],v=[[io,null],[of,l],[so,s]];for(let E=0;E<rg.length;E++)yl(n,rg[E],A3,uo,b);for(let E=0;E<ig.length;E++)yl(n,ig[E],N3,C3,v);zu(A3,{tld:!0,ascii:!0},e),zu(N3,{utld:!0,alpha:!0},e),yl(n,"file",Ng,uo,b),yl(n,"mailto",Ng,uo,b),yl(n,"http",ld,uo,b),yl(n,"https",ld,uo,b),yl(n,"ftp",ld,uo,b),yl(n,"ftps",ld,uo,b),zu(Ng,{scheme:!0,ascii:!0},e),zu(ld,{slashscheme:!0,ascii:!0},e),t=t.sort((E,x)=>E[0]>x[0]?1:-1);for(let E=0;E<t.length;E++){const x=t[E][0],C=t[E][1]?{[Qde]:!0}:{[Zde]:!0};x.indexOf("-")>=0?C[k3]=!0:io.test(x)?so.test(x)?C[Xf]=!0:C[S3]=!0:C[T3]=!0,N7(n,x,x,C)}return N7(n,"localhost",Th,{ascii:!0}),n.jd=new $i(q1),{start:n,tokens:Object.assign({groups:e},yL)}}function EL(t,e){const n=i0e(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,i=[];let s=0,a=0;for(;a<r;){let l=t,u=null,d=0,f=null,p=-1,g=-1;for(;a<r&&(u=l.go(n[a]));)l=u,l.accepts()?(p=0,g=0,f=l):p>=0&&(p+=n[a].length,g++),d+=n[a].length,s+=n[a].length,a++;s-=p,a-=g,d-=p,i.push({t:f.t,v:e.slice(s-d,s),s:s-d,e:s})}return i}function i0e(t){const e=[],n=t.length;let r=0;for(;r<n;){let i=t.charCodeAt(r),s,a=i<55296||i>56319||r+1===n||(s=t.charCodeAt(r+1))<56320||s>57343?t[r]:t.slice(r,r+2);e.push(a),r+=a.length}return e}function yl(t,e,n,r,i){let s;const a=e.length;for(let l=0;l<a-1;l++){const u=e[l];t.j[u]?s=t.j[u]:(s=new $i(r),s.jr=i.slice(),t.j[u]=s),t=s}return s=new $i(n),s.jr=i.slice(),t.j[e[a-1]]=s,s}function M7(t){const e=[],n=[];let r=0,i="0123456789";for(;r<t.length;){let s=0;for(;i.indexOf(t[r+s])>=0;)s++;if(s>0){e.push(n.join(""));for(let a=parseInt(t.substring(r,r+s),10);a>0;a--)n.pop();r+=s}else n.push(t[r]),r++}return e}const Sh={defaultProtocol:"http",events:null,format:R7,formatHref:R7,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function s6(t,e=null){let n=Object.assign({},Sh);t&&(n=Object.assign(n,t instanceof s6?t.o:t));const r=n.ignoreTags,i=[];for(let s=0;s<r.length;s++)i.push(r[s].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=i}s6.prototype={o:Sh,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let i=this.o[t];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:Sh[t],typeof i=="function"&&r&&(i=i(e,n))):typeof i=="function"&&r&&(i=i(e,n.t,n)),i)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function R7(t){return t}function _L(t,e){this.t="token",this.v=t,this.tk=e}_L.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=Sh.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,e),s=this.toFormattedString(t),a={},l=t.get("className",n,e),u=t.get("target",n,e),d=t.get("rel",n,e),f=t.getObj("attributes",n,e),p=t.getObj("events",n,e);return a.href=r,l&&(a.class=l),u&&(a.target=u),d&&(a.rel=d),f&&Object.assign(a,f),{tagName:i,attributes:a,content:s,eventListeners:p}}};function Zb(t,e){class n extends _L{constructor(i,s){super(i,s),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const D7=Zb("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),I7=Zb("text"),s0e=Zb("nl"),sg=Zb("url",{isLink:!0,toHref(t=Sh.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Th&&t[1].t===Dl}}),ks=t=>new $i(t);function a0e({groups:t}){const e=t.domain.concat([R1,I1,Ol,L1,P1,B1,z1,U1,As,Jx,Jf,F1,H1,j1,ha,q1,th,$1]),n=[D1,Dl,t6,fa,n6,Jf,eh,r6,i6,x1,T1,Qf,Zf,y1,v1,E1,_1,S1,w1,k1,C1,A1,N1,O1,M1],r=[R1,D1,I1,L1,P1,B1,z1,U1,As,Qf,Zf,Jf,F1,H1,j1,eh,ha,q1,th,$1],i=ks(),s=Ie(i,th);Dt(s,r,s),Dt(s,t.domain,s);const a=ks(),l=ks(),u=ks();Dt(i,t.domain,a),Dt(i,t.scheme,l),Dt(i,t.slashscheme,u),Dt(a,r,s),Dt(a,t.domain,a);const d=Ie(a,Ol);Ie(s,Ol,d),Ie(l,Ol,d),Ie(u,Ol,d);const f=Ie(s,fa);Dt(f,r,s),Dt(f,t.domain,s);const p=ks();Dt(d,t.domain,p),Dt(p,t.domain,p);const g=Ie(p,fa);Dt(g,t.domain,p);const b=ks(D7);Dt(g,t.tld,b),Dt(g,t.utld,b),Ie(d,Th,b);const v=Ie(p,As);Ie(v,As,v),Dt(v,t.domain,p),Dt(b,t.domain,p),Ie(b,fa,g),Ie(b,As,v);const E=Ie(b,Dl);Dt(E,t.numeric,D7);const x=Ie(a,As),S=Ie(a,fa);Ie(x,As,x),Dt(x,t.domain,a),Dt(S,r,s),Dt(S,t.domain,a);const C=ks(sg);Dt(S,t.tld,C),Dt(S,t.utld,C),Dt(C,t.domain,a),Dt(C,r,s),Ie(C,fa,S),Ie(C,As,x),Ie(C,Ol,d);const O=Ie(C,Dl),L=ks(sg);Dt(O,t.numeric,L);const D=ks(sg),R=ks();Dt(D,e,D),Dt(D,n,R),Dt(R,e,D),Dt(R,n,R),Ie(C,ha,D),Ie(L,ha,D);const F=Ie(l,Dl),G=Ie(u,Dl),Z=Ie(G,ha),q=Ie(Z,ha);Dt(l,t.domain,a),Ie(l,fa,S),Ie(l,As,x),Dt(u,t.domain,a),Ie(u,fa,S),Ie(u,As,x),Dt(F,t.domain,D),Ie(F,ha,D),Ie(F,eh,D),Dt(q,t.domain,D),Dt(q,e,D),Ie(q,ha,D);const ie=[[Qf,Zf],[v1,y1],[E1,_1],[x1,T1],[S1,w1],[k1,C1],[A1,N1],[O1,M1]];for(let se=0;se<ie.length;se++){const[Te,oe]=ie[se],re=Ie(D,Te);Ie(R,Te,re),Ie(re,oe,D);const X=ks(sg);Dt(re,e,X);const ee=ks();Dt(re,n),Dt(X,e,X),Dt(X,n,ee),Dt(ee,e,X),Dt(ee,n,ee),Ie(X,oe,D),Ie(ee,oe,D)}return Ie(i,Th,C),Ie(i,e6,s0e),{start:i,tokens:yL}}function o0e(t,e,n){let r=n.length,i=0,s=[],a=[];for(;i<r;){let l=t,u=null,d=null,f=0,p=null,g=-1;for(;i<r&&!(u=l.go(n[i].t));)a.push(n[i++]);for(;i<r&&(d=u||l.go(n[i].t));)u=null,l=d,l.accepts()?(g=0,p=l):g>=0&&g++,i++,f++;if(g<0)i-=f,i<r&&(a.push(n[i]),i++);else{a.length>0&&(s.push(FE(I7,e,a)),a=[]),i-=g,f-=g;const b=p.t,v=n.slice(i-f,i);s.push(FE(b,e,v))}}return a.length>0&&s.push(FE(I7,e,a)),s}function FE(t,e,n){const r=n[0].s,i=n[n.length-1].e,s=e.slice(r,i);return new t(s,n)}const l0e=typeof console<"u"&&console&&console.warn||(()=>{}),u0e="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Pn={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function c0e(){return $i.groups={},Pn.scanner=null,Pn.parser=null,Pn.tokenQueue=[],Pn.pluginQueue=[],Pn.customSchemes=[],Pn.initialized=!1,Pn}function L7(t,e=!1){if(Pn.initialized&&l0e(`linkifyjs: already initialized - will not register custom scheme "${t}" ${u0e}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
1. Must only contain digits, lowercase ASCII letters or "-"
2. Cannot start or end with "-"
3. "-" cannot repeat`);Pn.customSchemes.push([t,e])}function d0e(){Pn.scanner=r0e(Pn.customSchemes);for(let t=0;t<Pn.tokenQueue.length;t++)Pn.tokenQueue[t][1]({scanner:Pn.scanner});Pn.parser=a0e(Pn.scanner.tokens);for(let t=0;t<Pn.pluginQueue.length;t++)Pn.pluginQueue[t][1]({scanner:Pn.scanner,parser:Pn.parser});return Pn.initialized=!0,Pn}function a6(t){return Pn.initialized||d0e(),o0e(Pn.parser.start,t,EL(Pn.scanner.start,t))}a6.scan=EL;function xL(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new s6(n),i=a6(t),s=[];for(let a=0;a<i.length;a++){const l=i[a];l.isLink&&(!e||l.t===e)&&r.check(l)&&s.push(l.toFormattedObject(r))}return s}var o6="[\0-   ᠎ -\u2029 　]",f0e=new RegExp(o6),h0e=new RegExp(`${o6}$`),p0e=new RegExp(o6,"g");function m0e(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function g0e(t){return new zn({key:new Vn("autolink"),appendTransaction:(e,n,r)=>{const i=e.some(d=>d.docChanged)&&!n.doc.eq(r.doc),s=e.some(d=>d.getMeta("preventAutolink"));if(!i||s)return;const{tr:a}=r,l=nI(n.doc,[...e]);if(uI(l).forEach(({newRange:d})=>{const f=dle(r.doc,d,b=>b.isTextblock);let p,g;if(f.length>1)p=f[0],g=r.doc.textBetween(p.pos,p.pos+p.node.nodeSize,void 0," ");else if(f.length){const b=r.doc.textBetween(d.from,d.to," "," ");if(!h0e.test(b))return;p=f[0],g=r.doc.textBetween(p.pos,d.to,void 0," ")}if(p&&g){const b=g.split(f0e).filter(Boolean);if(b.length<=0)return!1;const v=b[b.length-1],E=p.pos+g.lastIndexOf(v);if(!v)return!1;const x=a6(v).map(S=>S.toObject(t.defaultProtocol));if(!m0e(x))return!1;x.filter(S=>S.isLink).map(S=>({...S,from:E+S.start+1,to:E+S.end+1})).filter(S=>r.schema.marks.code?!r.doc.rangeHasMark(S.from,S.to,r.schema.marks.code):!0).filter(S=>t.validate(S.value)).filter(S=>t.shouldAutoLink(S.value)).forEach(S=>{Ux(S.from,S.to,r.doc).some(C=>C.mark.type===t.type)||a.addMark(S.from,S.to,t.type.create({href:S.href}))})}}),!!a.steps.length)return a}})}function b0e(t){return new zn({key:new Vn("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,s;if(r.button!==0||!e.editable)return!1;let a=null;if(r.target instanceof HTMLAnchorElement)a=r.target;else{const u=r.target;if(!u)return!1;const d=t.editor.view.dom;a=u.closest("a"),a&&!d.contains(a)&&(a=null)}if(!a)return!1;let l=!1;if(t.enableClickSelection&&(l=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){const u=lI(e.state,t.type.name),d=(i=a.href)!=null?i:u.href,f=(s=a.target)!=null?s:u.target;d&&(window.open(d,f),l=!0)}return l}}})}function v0e(t){return new zn({key:new Vn("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{shouldAutoLink:i}=t,{state:s}=e,{selection:a}=s,{empty:l}=a;if(l)return!1;let u="";r.content.forEach(f=>{u+=f.textContent});const d=xL(u,{defaultProtocol:t.defaultProtocol}).find(f=>f.isLink&&f.value===u);return!u||!d||i!==void 0&&!i(d.value)?!1:t.editor.commands.setMark(t.type,{href:d.href})}}})}function Nu(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!t||t.replace(p0e,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var y0e=cc.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){L7(t);return}L7(t.scheme,t.optionalSlashes)})},onDestroy(){c0e()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!Nu(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(t),n=/^[a-z][a-z0-9+.-]*:/i.test(t);if(e||n&&!t.includes("@"))return!0;const i=(t.includes("@")?t.split("@").pop():t).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(i)||!/\./.test(i))}}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!Nu(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!Nu(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Cr(this.options.HTMLAttributes,t),0]:["a",Cr(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var n;const r=((n=t.attrs)==null?void 0:n.href)||"";return`[${e.renderChildren(t)}](${r})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Nu(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!Nu(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Ju({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,i=xL(t).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:a=>!!Nu(a,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(s=>{this.options.shouldAutoLink(s.value)&&e.push({text:s.value,data:{href:s.href},index:s.start})})}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(g0e({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!Nu(i,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),t.push(b0e({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(v0e({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),E0e=Object.defineProperty,_0e=(t,e)=>{for(var n in e)E0e(t,n,{get:e[n],enumerable:!0})},x0e="listItem",P7="textStyle",B7=/^\s*([-+*])\s$/,TL=gs.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",Cr(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(x0e,this.editor.getAttributes(P7)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Dd({find:B7,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Dd({find:B7,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(P7),editor:this.editor})),[t]}}),SL=gs.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Cr(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:(t,e)=>{if(t.type!=="list_item")return[];let n=[];if(t.tokens&&t.tokens.length>0)if(t.tokens.some(i=>i.type==="paragraph"))n=e.parseChildren(t.tokens);else{const i=t.tokens[0];if(i&&i.type==="text"&&i.tokens&&i.tokens.length>0){if(n=[{type:"paragraph",content:e.parseInline(i.tokens)}],t.tokens.length>1){const a=t.tokens.slice(1),l=e.parseChildren(a);n.push(...l)}}else n=e.parseChildren(t.tokens)}return n.length===0&&(n=[{type:"paragraph",content:[]}]),{type:"listItem",content:n}},renderMarkdown:(t,e,n)=>$x(t,e,r=>{var i,s;return r.parentType==="bulletList"?"- ":r.parentType==="orderedList"?`${(((s=(i=r.meta)==null?void 0:i.parentAttrs)==null?void 0:s.start)||1)+r.index}. `:"- "},n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),T0e={};_0e(T0e,{findListItemPos:()=>ep,getNextListDepth:()=>l6,handleBackspace:()=>M3,handleDelete:()=>R3,hasListBefore:()=>wL,hasListItemAfter:()=>S0e,hasListItemBefore:()=>kL,listItemHasSubList:()=>CL,nextListIsDeeper:()=>AL,nextListIsHigher:()=>NL});var ep=(t,e)=>{const{$from:n}=e.selection,r=kr(t,e.schema);let i=null,s=n.depth,a=n.pos,l=null;for(;s>0&&l===null;)i=n.node(s),i.type===r?l=s:(s-=1,a-=1);return l===null?null:{$pos:e.doc.resolve(a),depth:l}},l6=(t,e)=>{const n=ep(t,e);if(!n)return!1;const[,r]=Ele(e,t,n.$pos.pos+4);return r},wL=(t,e,n)=>{const{$anchor:r}=t.selection,i=Math.max(0,r.pos-2),s=t.doc.resolve(i).node();return!(!s||!n.includes(s.type.name))},kL=(t,e)=>{var n;const{$anchor:r}=e.selection,i=e.doc.resolve(r.pos-2);return!(i.index()===0||((n=i.nodeBefore)==null?void 0:n.type.name)!==t)},CL=(t,e,n)=>{if(!n)return!1;const r=kr(t,e.schema);let i=!1;return n.descendants(s=>{s.type===r&&(i=!0)}),i},M3=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!Zl(t.state,e)&&wL(t.state,e,n)){const{$anchor:l}=t.state.selection,u=t.state.doc.resolve(l.before()-1),d=[];u.node().descendants((g,b)=>{g.type.name===e&&d.push({node:g,pos:b})});const f=d.at(-1);if(!f)return!1;const p=t.state.doc.resolve(u.start()+f.pos+1);return t.chain().cut({from:l.start()-1,to:l.end()+1},p.end()).joinForward().run()}if(!Zl(t.state,e)||!Sle(t.state))return!1;const r=ep(e,t.state);if(!r)return!1;const s=t.state.doc.resolve(r.$pos.pos-2).node(r.depth),a=CL(e,t.state,s);return kL(e,t.state)&&!a?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},AL=(t,e)=>{const n=l6(t,e),r=ep(t,e);return!r||!n?!1:n>r.depth},NL=(t,e)=>{const n=l6(t,e),r=ep(t,e);return!r||!n?!1:n<r.depth},R3=(t,e)=>{if(!Zl(t.state,e)||!Tle(t.state,e))return!1;const{selection:n}=t.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:AL(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():NL(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},S0e=(t,e)=>{var n;const{$anchor:r}=e.selection,i=e.doc.resolve(r.pos-r.parentOffset-2);return!(i.index()===i.parent.childCount-1||((n=i.nodeAfter)==null?void 0:n.type.name)!==t)},OL=Gn.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&R3(t,n)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&R3(t,n)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&M3(t,n,r)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&M3(t,n,r)&&(e=!0)}),e}}}}),z7=/^(\s*)(\d+)\.\s+(.*)$/,w0e=/^\s/;function k0e(t){const e=[];let n=0,r=0;for(;n<t.length;){const i=t[n],s=i.match(z7);if(!s)break;const[,a,l,u]=s,d=a.length;let f=u,p=n+1;const g=[i];for(;p<t.length;){const b=t[p];if(b.match(z7))break;if(b.trim()==="")g.push(b),f+=`
`,p+=1;else if(b.match(w0e))g.push(b),f+=`
${b.slice(d+2)}`,p+=1;else break}e.push({indent:d,number:parseInt(l,10),content:f.trim(),raw:g.join(`
`)}),r=p,n=p}return[e,r]}function ML(t,e,n){var r;const i=[];let s=0;for(;s<t.length;){const a=t[s];if(a.indent===e){const l=a.content.split(`
`),u=((r=l[0])==null?void 0:r.trim())||"",d=[];u&&d.push({type:"paragraph",raw:u,tokens:n.inlineTokens(u)});const f=l.slice(1).join(`
`).trim();if(f){const b=n.blockTokens(f);d.push(...b)}let p=s+1;const g=[];for(;p<t.length&&t[p].indent>e;)g.push(t[p]),p+=1;if(g.length>0){const b=Math.min(...g.map(E=>E.indent)),v=ML(g,b,n);d.push({type:"list",ordered:!0,start:g[0].number,items:v,raw:g.map(E=>E.raw).join(`
`)})}i.push({type:"list_item",raw:a.raw,tokens:d}),s=p}else s+=1}return i}function C0e(t,e){return t.map(n=>{if(n.type!=="list_item")return e.parseChildren([n])[0];const r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(i=>{if(i.type==="paragraph"||i.type==="list"||i.type==="blockquote"||i.type==="code")r.push(...e.parseChildren([i]));else if(i.type==="text"&&i.tokens){const s=e.parseChildren([i]);r.push({type:"paragraph",content:s})}else{const s=e.parseChildren([i]);s.length>0&&r.push(...s)}}),{type:"listItem",content:r}})}var A0e="listItem",U7="textStyle",F7=/^(\d+)\.\s$/,RL=gs.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",Cr(this.options.HTMLAttributes,n),0]:["ol",Cr(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if(t.type!=="list"||!t.ordered)return[];const n=t.start||1,r=t.items?C0e(t.items,e):[];return n!==1?{type:"orderedList",attrs:{start:n},content:r}:{type:"orderedList",content:r}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
`):"",markdownTokenizer:{name:"orderedList",level:"block",start:t=>{const e=t.match(/^(\s*)(\d+)\.\s+/),n=e==null?void 0:e.index;return n!==void 0?n:-1},tokenize:(t,e,n)=>{var r;const i=t.split(`
`),[s,a]=k0e(i);if(s.length===0)return;const l=ML(s,0,n);return l.length===0?void 0:{type:"list",ordered:!0,start:((r=s[0])==null?void 0:r.number)||1,items:l,raw:i.slice(0,a).join(`
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(A0e,this.editor.getAttributes(U7)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Dd({find:F7,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Dd({find:F7,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(U7)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),N0e=/^\s*(\[([( |x])?\])\s$/,O0e=gs.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",Cr(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{const n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):n.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){const r=e.parseChildren(t.nestedTokens);n.push(...r)}return e.createNode("taskItem",{checked:t.checked||!1},n)},renderMarkdown:(t,e)=>{var n;const i=`- [${(n=t.attrs)!=null&&n.checked?"x":" "}] `;return $x(t,e,i)},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const i=document.createElement("li"),s=document.createElement("label"),a=document.createElement("span"),l=document.createElement("input"),u=document.createElement("div"),d=p=>{var g,b;l.ariaLabel=((b=(g=this.options.a11y)==null?void 0:g.checkboxLabel)==null?void 0:b.call(g,p,l.checked))||`Task item checkbox for ${p.textContent||"empty task item"}`};d(t),s.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",p=>p.preventDefault()),l.addEventListener("change",p=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:g}=p.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:b})=>{const v=n();if(typeof v!="number")return!1;const E=b.doc.nodeAt(v);return b.setNodeMarkup(v,void 0,{...E==null?void 0:E.attrs,checked:g}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,g)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([p,g])=>{i.setAttribute(p,g)}),i.dataset.checked=t.attrs.checked,l.checked=t.attrs.checked,s.append(l,a),i.append(s,u),Object.entries(e).forEach(([p,g])=>{i.setAttribute(p,g)});let f=new Set(Object.keys(e));return{dom:i,contentDOM:u,update:p=>{if(p.type!==this.type)return!1;i.dataset.checked=p.attrs.checked,l.checked=p.attrs.checked,d(p);const g=r.extensionManager.attributes,b=_h(p,g),v=new Set(Object.keys(b)),E=this.options.HTMLAttributes;return f.forEach(x=>{v.has(x)||(x in E?i.setAttribute(x,E[x]):i.removeAttribute(x))}),Object.entries(b).forEach(([x,S])=>{S==null?x in E?i.setAttribute(x,E[x]):i.removeAttribute(x):i.setAttribute(x,S)}),f=v,!0}}}},addInputRules(){return[Dd({find:N0e,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),M0e=gs.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",Cr(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
`):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const n=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){const r=s=>{const a=b3(s,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,u)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:n.inlineTokens(l.mainContent),nestedTokens:u}),customNestedParser:r},n);return a?[{type:"taskList",raw:a.raw,items:a.items}]:n.blockTokens(s)},i=b3(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:s=>({indentLevel:s[1].length,mainContent:s[4],checked:s[3].toLowerCase()==="x"}),createToken:(s,a)=>({type:"taskItem",raw:"",mainContent:s.mainContent,indentLevel:s.indentLevel,checked:s.checked,text:s.mainContent,tokens:n.inlineTokens(s.mainContent),nestedTokens:a}),customNestedParser:r},n);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Gn.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(TL.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(SL.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(OL.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(RL.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(O0e.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(M0e.configure(this.options.taskList)),t}});var H7="&nbsp;",R0e=" ",D0e=gs.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Cr(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];if(n.length===1&&n[0].type==="image")return e.parseChildren([n[0]]);const r=e.parseInline(n);return r.length===1&&r[0].type==="text"&&(r[0].text===H7||r[0].text===R0e)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(t,e)=>{if(!t)return"";const n=Array.isArray(t.content)?t.content:[];return n.length===0?H7:e.renderChildren(n)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),I0e=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,L0e=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,P0e=cc.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",Cr(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Rd({find:I0e,type:this.type})]},addPasteRules(){return[Ju({find:L0e,type:this.type})]}}),B0e=gs.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),z0e=cc.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",Cr(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,n){const i=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!i)return;const s=i[2].trim();return{type:"underline",raw:i[0],text:s,tokens:n.inlineTokens(s)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function U0e(t={}){return new zn({view(e){return new F0e(e,t)}})}class F0e{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=a=>{this[i](a)};return e.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r,i=this.editorView.dom,s=i.getBoundingClientRect(),a=s.width/i.offsetWidth,l=s.height/i.offsetHeight;if(n){let p=e.nodeBefore,g=e.nodeAfter;if(p||g){let b=this.editorView.nodeDOM(this.cursorPos-(p?p.nodeSize:0));if(b){let v=b.getBoundingClientRect(),E=p?v.bottom:v.top;p&&g&&(E=(E+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let x=this.width/2*l;r={left:v.left,right:v.right,top:E-x,bottom:E+x}}}}if(!r){let p=this.editorView.coordsAtPos(this.cursorPos),g=this.width/2*a;r={left:p.left-g,right:p.left+g,top:p.top,bottom:p.bottom}}let u=this.editorView.dom.offsetParent;this.element||(this.element=u.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let d,f;if(!u||u==document.body&&getComputedStyle(u).position=="static")d=-pageXOffset,f=-pageYOffset;else{let p=u.getBoundingClientRect(),g=p.width/u.offsetWidth,b=p.height/u.offsetHeight;d=p.left-u.scrollLeft*g,f=p.top-u.scrollTop*b}this.element.style.left=(r.left-d)/a+"px",this.element.style.top=(r.top-f)/l+"px",this.element.style.width=(r.right-r.left)/a+"px",this.element.style.height=(r.bottom-r.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!s){let a=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=WR(this.editorView.state.doc,a,this.editorView.dragging.slice);l!=null&&(a=l)}this.setCursor(a),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class sr extends vt{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return sr.valid(r)?new sr(r):vt.near(r)}content(){return qe.empty}eq(e){return e instanceof sr&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new sr(e.resolve(n.pos))}getBookmark(){return new u6(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!H0e(e)||!j0e(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&sr.valid(e))return e;let i=e.pos,s=null;for(let a=e.depth;;a--){let l=e.node(a);if(n>0?e.indexAfter(a)<l.childCount:e.index(a)>0){s=l.child(n>0?e.indexAfter(a):e.index(a)-1);break}else if(a==0)return null;i+=n;let u=e.doc.resolve(i);if(sr.valid(u))return u}for(;;){let a=n>0?s.firstChild:s.lastChild;if(!a){if(s.isAtom&&!s.isText&&!ct.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*n),r=!1;continue e}break}s=a,i+=n;let l=e.doc.resolve(i);if(sr.valid(l))return l}return null}}}sr.prototype.visible=!1;sr.findFrom=sr.findGapCursorFrom;vt.jsonID("gapcursor",sr);class u6{constructor(e){this.pos=e}map(e){return new u6(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return sr.valid(n)?new sr(n):vt.near(n)}}function DL(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function H0e(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||DL(i.type))return!0;if(i.inlineContent)return!1}}return!0}function j0e(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||DL(i.type))return!0;if(i.inlineContent)return!1}}return!0}function $0e(){return new zn({props:{decorations:Y0e,createSelectionBetween(t,e,n){return e.pos==n.pos&&sr.valid(n)?new sr(n):null},handleClick:V0e,handleKeyDown:q0e,handleDOMEvents:{beforeinput:G0e}}})}const q0e=Mx({ArrowLeft:ag("horiz",-1),ArrowRight:ag("horiz",1),ArrowUp:ag("vert",-1),ArrowDown:ag("vert",1)});function ag(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,s){let a=r.selection,l=e>0?a.$to:a.$from,u=a.empty;if(a instanceof Et){if(!s.endOfTextblock(n)||l.depth==0)return!1;u=!1,l=r.doc.resolve(e>0?l.after():l.before())}let d=sr.findGapCursorFrom(l,e,u);return d?(i&&i(r.tr.setSelection(new sr(d))),!0):!1}}function V0e(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!sr.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&ct.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new sr(r))),!0)}function G0e(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof sr))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=ke.empty;for(let a=r.length-1;a>=0;a--)i=ke.from(r[a].createAndFill(null,i));let s=t.state.tr.replace(n.pos,n.pos,new qe(i,0,0));return s.setSelection(Et.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function Y0e(t){if(!(t.selection instanceof sr))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Qn.create(t.doc,[Si.widget(t.selection.head,e,{key:"gapcursor"})])}var V1=200,$r=function(){};$r.prototype.append=function(e){return e.length?(e=$r.from(e),!this.length&&e||e.length<V1&&this.leafAppend(e)||this.length<V1&&e.leafPrepend(this)||this.appendInner(e)):this};$r.prototype.prepend=function(e){return e.length?$r.from(e).append(this):this};$r.prototype.appendInner=function(e){return new W0e(this,e)};$r.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?$r.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};$r.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};$r.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};$r.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(s,a){return i.push(e(s,a))},n,r),i};$r.from=function(e){return e instanceof $r?e:e&&e.length?new IL(e):$r.empty};var IL=(function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,a,l){for(var u=s;u<a;u++)if(i(this.values[u],l+u)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,a,l){for(var u=s-1;u>=a;u--)if(i(this.values[u],l+u)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=V1)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=V1)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e})($r);$r.empty=new IL([]);var W0e=(function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,s,a){var l=this.left.length;if(i<l&&this.left.forEachInner(r,i,Math.min(s,l),a)===!1||s>l&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,s)-l,a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,s,a){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(s,l)-l,a+l)===!1||s<l&&this.left.forEachInvertedInner(r,Math.min(i,l),s,a)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(r,i):r>=s?this.right.slice(r-s,i-s):this.left.slice(r,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e})($r);const K0e=500;class Ys{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,s;n&&(i=this.remapping(r,this.items.length),s=i.maps.length);let a=e.tr,l,u,d=[],f=[];return this.items.forEach((p,g)=>{if(!p.step){i||(i=this.remapping(r,g+1),s=i.maps.length),s--,f.push(p);return}if(i){f.push(new pa(p.map));let b=p.step.map(i.slice(s)),v;b&&a.maybeStep(b).doc&&(v=a.mapping.maps[a.mapping.maps.length-1],d.push(new pa(v,void 0,void 0,d.length+f.length))),s--,v&&i.appendMap(v,s)}else a.maybeStep(p.step);if(p.selection)return l=i?p.selection.map(i.slice(s)):p.selection,u=new Ys(this.items.slice(0,r).append(f.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:u,transform:a,selection:l}}addTransform(e,n,r,i){let s=[],a=this.eventCount,l=this.items,u=!i&&l.length?l.get(l.length-1):null;for(let f=0;f<e.steps.length;f++){let p=e.steps[f].invert(e.docs[f]),g=new pa(e.mapping.maps[f],p,n),b;(b=u&&u.merge(g))&&(g=b,f?s.pop():l=l.slice(0,l.length-1)),s.push(g),n&&(a++,n=void 0),i||(u=g)}let d=a-r.depth;return d>Q0e&&(l=X0e(l,d),a-=d),new Ys(l.append(s),a)}remapping(e,n){let r=new mh;return this.items.forEach((i,s)=>{let a=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},e,n),r}addMaps(e){return this.eventCount==0?this:new Ys(this.items.append(e.map(n=>new pa(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),s=e.mapping,a=e.steps.length,l=this.eventCount;this.items.forEach(g=>{g.selection&&l--},i);let u=n;this.items.forEach(g=>{let b=s.getMirror(--u);if(b==null)return;a=Math.min(a,b);let v=s.maps[b];if(g.step){let E=e.steps[b].invert(e.docs[b]),x=g.selection&&g.selection.map(s.slice(u+1,b));x&&l++,r.push(new pa(v,E,x))}else r.push(new pa(v))},i);let d=[];for(let g=n;g<a;g++)d.push(new pa(s.maps[g]));let f=this.items.slice(0,i).append(d).append(r),p=new Ys(f,l);return p.emptyItemCount()>K0e&&(p=p.compress(this.items.length-r.length)),p}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],s=0;return this.items.forEach((a,l)=>{if(l>=e)i.push(a),a.selection&&s++;else if(a.step){let u=a.step.map(n.slice(r)),d=u&&u.getMap();if(r--,d&&n.appendMap(d,r),u){let f=a.selection&&a.selection.map(n.slice(r));f&&s++;let p=new pa(d.invert(),u,f),g,b=i.length-1;(g=i.length&&i[b].merge(p))?i[b]=g:i.push(p)}}else a.map&&r--},this.items.length,0),new Ys($r.from(i.reverse()),s)}}Ys.empty=new Ys($r.empty,0);function X0e(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class pa{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new pa(n.getMap().invert(),n,this.selection)}}}class Ml{constructor(e,n,r,i,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const Q0e=20;function Z0e(t,e,n,r){let i=n.getMeta(Gu),s;if(i)return i.historyState;n.getMeta(tfe)&&(t=new Ml(t.done,t.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(a&&a.getMeta(Gu))return a.getMeta(Gu).redo?new Ml(t.done.addTransform(n,void 0,r,Og(e)),t.undone,j7(n.mapping.maps),t.prevTime,t.prevComposition):new Ml(t.done,t.undone.addTransform(n,void 0,r,Og(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),u=t.prevTime==0||!a&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!J0e(n,t.prevRanges)),d=a?HE(t.prevRanges,n.mapping):j7(n.mapping.maps);return new Ml(t.done.addTransform(n,u?e.selection.getBookmark():void 0,r,Og(e)),Ys.empty,d,n.time,l??t.prevComposition)}else return(s=n.getMeta("rebased"))?new Ml(t.done.rebased(n,s),t.undone.rebased(n,s),HE(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Ml(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),HE(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function J0e(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&i>=e[s]&&(n=!0)}),n}function j7(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,s,a)=>e.push(s,a));return e}function HE(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),s=e.map(t[r+1],-1);i<=s&&n.push(i,s)}return n}function efe(t,e,n){let r=Og(e),i=Gu.get(e).spec.config,s=(n?t.undone:t.done).popEvent(e,r);if(!s)return null;let a=s.selection.resolve(s.transform.doc),l=(n?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,r),u=new Ml(n?l:s.remaining,n?s.remaining:l,null,0,-1);return s.transform.setSelection(a).setMeta(Gu,{redo:n,historyState:u})}let jE=!1,$7=null;function Og(t){let e=t.plugins;if($7!=e){jE=!1,$7=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){jE=!0;break}}return jE}const Gu=new Vn("history"),tfe=new Vn("closeHistory");function nfe(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new zn({key:Gu,state:{init(){return new Ml(Ys.empty,Ys.empty,null,0,-1)},apply(e,n,r){return Z0e(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?PL:r=="historyRedo"?BL:null;return!i||!e.editable?!1:(n.preventDefault(),i(e.state,e.dispatch))}}}})}function LL(t,e){return(n,r)=>{let i=Gu.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let s=efe(i,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}const PL=LL(!1,!0),BL=LL(!0,!0);Gn.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new zn({key:new Vn("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const i=this.options.limit;if(i==null||i===0){t=!0;return}const s=this.storage.characters({node:r.doc});if(s>i){const a=s-i,l=0,u=a;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const d=r.tr.deleteRange(l,u);return t=!0,d}t=!0},filterTransaction:(e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const i=this.storage.characters({node:n.doc}),s=this.storage.characters({node:e.doc});if(s<=r||i>r&&s>r&&s<=i)return!0;if(i>r&&s>r&&s>i||!e.getMeta("paste"))return!1;const l=e.selection.$head.pos,u=s-r,d=l-u,f=l;return e.deleteRange(d,f),!(this.storage.characters({node:e.doc})>r)}})]}});var rfe=Gn.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[U0e(this.options)]}});Gn.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new zn({key:new Vn("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:i}=e,s=[];if(!n||!r)return Qn.create(t,[]);let a=0;this.options.mode==="deepest"&&t.descendants((u,d)=>{if(u.isText)return;if(!(i>=d&&i<=d+u.nodeSize-1))return!1;a+=1});let l=0;return t.descendants((u,d)=>{if(u.isText||!(i>=d&&i<=d+u.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&a-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";s.push(Si.node(d,d+u.nodeSize,{class:this.options.className}))}),Qn.create(t,s)}}})]}});var ife=Gn.create({name:"gapCursor",addProseMirrorPlugins(){return[$0e()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=cn(at(t,"allowGapCursor",n)))!=null?e:null}}}),q7="placeholder";function sfe(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}var afe=Gn.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:q7,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){const t=this.options.dataAttribute?`data-${sfe(this.options.dataAttribute)}`:`data-${q7}`;return[new zn({key:new Vn("placeholder"),props:{decorations:({doc:e,selection:n})=>{const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,s=[];if(!r)return null;const a=this.editor.isEmpty;return e.descendants((l,u)=>{const d=i>=u&&i<=u+l.nodeSize,f=!l.isLeaf&&Vb(l);if((d||!this.options.showOnlyCurrent)&&f){const p=[this.options.emptyNodeClass];a&&p.push(this.options.emptyEditorClass);const g=Si.node(u,u+l.nodeSize,{class:p.join(" "),[t]:typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:l,pos:u,hasAnchor:d}):this.options.placeholder});s.push(g)}return this.options.includeChildren}),Qn.create(e,s)}}})]}});Gn.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new zn({key:new Vn("selection"),props:{decorations(n){return n.selection.empty||t.isFocused||!t.isEditable||cI(n.selection)||t.view.dragging?null:Qn.create(n.doc,[Si.inline(n.selection.from,n.selection.to,{class:e.className})])}}})]}});function V7({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(e==null?void 0:e.type)===t}var ofe=Gn.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new Vn(this.name),n=this.options.node||((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(n).includes(i.name));return[new zn({key:e,appendTransaction:(i,s,a)=>{const{doc:l,tr:u,schema:d}=a,f=e.getState(a),p=l.content.size,g=d.nodes[n];if(f)return u.insert(p,g.create())},state:{init:(i,s)=>{const a=s.tr.doc.lastChild;return!V7({node:a,types:r})},apply:(i,s)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return s;const a=i.doc.lastChild;return!V7({node:a,types:r})}}})]}}),lfe=Gn.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>PL(t,e),redo:()=>({state:t,dispatch:e})=>BL(t,e)}},addProseMirrorPlugins(){return[nfe(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),ufe=Gn.create({name:"starterKit",addExtensions(){var t,e,n,r;const i=[];return this.options.bold!==!1&&i.push(Dde.configure(this.options.bold)),this.options.blockquote!==!1&&i.push(Ade.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(TL.configure(this.options.bulletList)),this.options.code!==!1&&i.push(Pde.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(Ude.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(Fde.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(rfe.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(ife.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(Hde.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(jde.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(lfe.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push($de.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(Wde.configure(this.options.italic)),this.options.listItem!==!1&&i.push(SL.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(OL.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&i.push(y0e.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&i.push(RL.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(D0e.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(P0e.configure(this.options.strike)),this.options.text!==!1&&i.push(B0e.configure(this.options.text)),this.options.underline!==!1&&i.push(z0e.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&i.push(ofe.configure((r=this.options)==null?void 0:r.trailingNode)),i}}),cfe=ufe,dfe=afe,ffe=t=>ar({find:/--$/,replace:t??"—"}),hfe=t=>ar({find:/\.\.\.$/,replace:t??"…"}),pfe=t=>ar({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:t??"“"}),mfe=t=>ar({find:/"$/,replace:t??"”"}),gfe=t=>ar({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:t??"‘"}),bfe=t=>ar({find:/'$/,replace:t??"’"}),vfe=t=>ar({find:/<-$/,replace:t??"←"}),yfe=t=>ar({find:/->$/,replace:t??"→"}),Efe=t=>ar({find:/\(c\)$/,replace:t??"©"}),_fe=t=>ar({find:/\(tm\)$/,replace:t??"™"}),xfe=t=>ar({find:/\(sm\)$/,replace:t??"℠"}),Tfe=t=>ar({find:/\(r\)$/,replace:t??"®"}),Sfe=t=>ar({find:/(?:^|\s)(1\/2)\s$/,replace:t??"½"}),wfe=t=>ar({find:/\+\/-$/,replace:t??"±"}),kfe=t=>ar({find:/!=$/,replace:t??"≠"}),Cfe=t=>ar({find:/<<$/,replace:t??"«"}),Afe=t=>ar({find:/>>$/,replace:t??"»"}),Nfe=t=>ar({find:/\d+\s?([*x])\s?\d+$/,replace:t??"×"}),Ofe=t=>ar({find:/\^2$/,replace:t??"²"}),Mfe=t=>ar({find:/\^3$/,replace:t??"³"}),Rfe=t=>ar({find:/(?:^|\s)(1\/4)\s$/,replace:t??"¼"}),Dfe=t=>ar({find:/(?:^|\s)(3\/4)\s$/,replace:t??"¾"}),Ife=Gn.create({name:"typography",addOptions(){return{closeDoubleQuote:"”",closeSingleQuote:"’",copyright:"©",ellipsis:"…",emDash:"—",laquo:"«",leftArrow:"←",multiplication:"×",notEqual:"≠",oneHalf:"½",oneQuarter:"¼",openDoubleQuote:"“",openSingleQuote:"‘",plusMinus:"±",raquo:"»",registeredTrademark:"®",rightArrow:"→",servicemark:"℠",superscriptThree:"³",superscriptTwo:"²",threeQuarters:"¾",trademark:"™"}},addInputRules(){const t=[];return this.options.emDash!==!1&&t.push(ffe(this.options.emDash)),this.options.ellipsis!==!1&&t.push(hfe(this.options.ellipsis)),this.options.openDoubleQuote!==!1&&t.push(pfe(this.options.openDoubleQuote)),this.options.closeDoubleQuote!==!1&&t.push(mfe(this.options.closeDoubleQuote)),this.options.openSingleQuote!==!1&&t.push(gfe(this.options.openSingleQuote)),this.options.closeSingleQuote!==!1&&t.push(bfe(this.options.closeSingleQuote)),this.options.leftArrow!==!1&&t.push(vfe(this.options.leftArrow)),this.options.rightArrow!==!1&&t.push(yfe(this.options.rightArrow)),this.options.copyright!==!1&&t.push(Efe(this.options.copyright)),this.options.trademark!==!1&&t.push(_fe(this.options.trademark)),this.options.servicemark!==!1&&t.push(xfe(this.options.servicemark)),this.options.registeredTrademark!==!1&&t.push(Tfe(this.options.registeredTrademark)),this.options.oneHalf!==!1&&t.push(Sfe(this.options.oneHalf)),this.options.plusMinus!==!1&&t.push(wfe(this.options.plusMinus)),this.options.notEqual!==!1&&t.push(kfe(this.options.notEqual)),this.options.laquo!==!1&&t.push(Cfe(this.options.laquo)),this.options.raquo!==!1&&t.push(Afe(this.options.raquo)),this.options.multiplication!==!1&&t.push(Nfe(this.options.multiplication)),this.options.superscriptTwo!==!1&&t.push(Ofe(this.options.superscriptTwo)),this.options.superscriptThree!==!1&&t.push(Mfe(this.options.superscriptThree)),this.options.oneQuarter!==!1&&t.push(Rfe(this.options.oneQuarter)),this.options.threeQuarters!==!1&&t.push(Dfe(this.options.threeQuarters)),t}}),Lfe=Ife;function G7(t){if(!t)return"";let e=t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/^### (.+)$/gm,"<h3>$1</h3>").replace(/^## (.+)$/gm,"<h2>$1</h2>").replace(/^# (.+)$/gm,"<h1>$1</h1>").replace(/\*\*\*(.+?)\*\*\*/g,"<strong><em>$1</em></strong>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/___(.+?)___/g,"<strong><em>$1</em></strong>").replace(/__(.+?)__/g,"<strong>$1</strong>").replace(/_(.+?)_/g,"<em>$1</em>").replace(/`([^`]+)`/g,"<code>$1</code>").replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener">$1</a>').replace(/^---$/gm,"<hr>").replace(/^\*\*\*$/gm,"<hr>").replace(/^[\-\*] (.+)$/gm,"<li>$1</li>").replace(/^\d+\. (.+)$/gm,"<li>$1</li>").replace(/^> (.+)$/gm,"<blockquote>$1</blockquote>").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>");return!e.startsWith("<h")&&!e.startsWith("<ul")&&!e.startsWith("<ol")&&!e.startsWith("<blockquote")&&(e="<p>"+e+"</p>"),e=e.replace(/<p><\/p>/g,""),e=e.replace(/(<li>.*?<\/li>)+/gs,n=>`<ul>${n}</ul>`),e}function Pfe(t){if(!t)return!1;const e=t.replace(/\s/g,"").slice(0,100);return/[\u0600-\u06FF\u0590-\u05FF]/.test(e)}const Bfe=()=>{const{state:t,updateContent:e}=Xd(),n=z.useRef(t.content),r=z.useMemo(()=>Pfe(t.content),[t.content]),i=xde({extensions:[cfe.configure({heading:{levels:[1,2,3]}}),dfe.configure({placeholder:"Document content will appear here..."}),Lfe],content:G7(t.content),editable:!t.isStreaming,editorProps:{attributes:{class:"prose prose-sm max-w-none focus:outline-none min-h-full",dir:r?"rtl":"ltr"}},onUpdate:({editor:s})=>{!t.isStreaming&&t.isDone&&s.getHTML()}});return z.useEffect(()=>{if(i&&t.isStreaming&&t.content!==n.current){const s=G7(t.content);i.commands.setContent(s),n.current=t.content;const a=i.view.dom;a&&(a.scrollTop=a.scrollHeight)}},[i,t.content,t.isStreaming]),z.useEffect(()=>{i&&i.setEditable(!t.isStreaming)},[i,t.isStreaming]),z.useEffect(()=>{i&&i.view.dom.setAttribute("dir",r?"rtl":"ltr")},[i,r]),A.jsx("div",{className:"flex-1 overflow-y-auto scrollbar-thin canvas-editor",style:{backgroundColor:"var(--bg-primary)"},children:A.jsxs("div",{className:"p-6 max-w-3xl mx-auto",children:[A.jsx(aL,{editor:i,className:"min-h-[calc(100vh-120px)]"}),t.isStreaming&&A.jsx("span",{className:"inline-block w-0.5 h-5 ml-0.5 animate-pulse",style:{backgroundColor:"var(--text-primary)"},"aria-hidden":"true"})]})})},zfe=()=>{const{state:t,closeCanvas:e}=Xd(),{canvasWidthPercent:n,isMobile:r}=yR(t.isOpen),i=z.useRef(null),s=z.useRef(null);return z.useEffect(()=>{const a=l=>{l.key==="Escape"&&t.isOpen&&e()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[t.isOpen,e]),z.useEffect(()=>{t.isOpen&&s.current&&setTimeout(()=>{var a;(a=s.current)==null||a.focus()},100)},[t.isOpen]),t.isOpen?A.jsxs(A.Fragment,{children:[r&&A.jsx("div",{className:"fixed inset-0 z-40 transition-opacity duration-300 ease-in-out",style:{backgroundColor:"var(--bg-overlay)"},onClick:e,"aria-hidden":"true"}),A.jsxs("aside",{ref:i,role:r?"dialog":"complementary","aria-label":"Document Canvas","aria-modal":r?"true":void 0,className:`
          fixed top-0 right-0 h-full z-50
          flex flex-col
          canvas-panel
          ${t.isOpen?"canvas-panel-open":""}
        `,style:{width:r?"100%":`${n}%`,backgroundColor:"var(--bg-primary)",borderLeft:r?"none":"1px solid var(--border-primary)",boxShadow:"var(--shadow-lg)"},children:[A.jsx(pie,{closeButtonRef:s}),A.jsx(Bfe,{})]})]}):null};async function Ufe(t,e,{signal:n}={}){const r=t.body.getReader(),i=new TextDecoder;let s="";for(;;){if(n!=null&&n.aborted)throw new DOMException("Aborted","AbortError");const{value:a,done:l}=await r.read();if(l)break;if(a){const u=i.decode(a,{stream:!0});s+=u;let d;for(;(d=s.indexOf(`
`))!==-1;){const f=s.slice(0,d).trim();if(s=s.slice(d+1),!f||!f.startsWith("data: "))continue;const p=f.slice(6);if(p==="[DONE]")return;try{const g=JSON.parse(p);e(g)}catch(g){console.error("Failed to parse SSE payload:",g,p)}}}}}async function Ffe(t){const e=await fetch("/config",{method:"GET",credentials:"include",signal:t});if(!e.ok)throw new Error("Metadata request failed: "+e.status);return e.json()}async function D3({messages:t,auth:e,getToken:n,setActive:r,org:i,onPart:s,signal:a}){const l=t.map(({role:f,content:p,parts:g})=>{if(f){if(g)return{role:f,parts:g};const{clean:S,attachments:C}=fh(p);if(C.length===0)return{role:f,content:S};const O=[];S.trim()&&O.push({type:"text",text:S});for(const L of C)L.mime&&L.mime.startsWith("image/")?O.push({type:"image_url",image_url:{url:L.url}}):O.push({type:"file",text:"[File attached: "+L.name+`]
File URL: `+L.url+`
File type: `+(L.mime||"unknown")});return{role:f,content:O}}const b=f||(t.type==="request"?"user":"assistant"),{clean:v,attachments:E}=fh(p);if(E.length===0)return{role:b,content:v};const x=[];v.trim()&&x.push({type:"text",text:v});for(const S of E)S.mime&&S.mime.startsWith("image/")?x.push({type:"image_url",image_url:{url:S.url}}):x.push({type:"file",text:"[File attached: "+S.name+`]
File URL: `+S.url+`
File type: `+(S.mime||"unknown")});return{role:b,content:x}}),u={"Content-Type":"application/json"};if(e&&n)try{const f=await n({template:"template"});if(f&&(u.Authorization="Bearer "+f),r&&i)try{await r({organization:i})}catch{}}catch{}const d=await fetch("/chat/cycls",{method:"POST",headers:u,body:JSON.stringify({messages:l}),signal:a});if(!d.ok){let f="server",p="Server returned "+d.status;if(d.status===429){f="rate_limit";const g=d.headers.get("Retry-After");p=g?"Too many requests. Please try again in "+g+" seconds.":"Too many requests. Please wait a moment and try again."}else d.status>=500?p="Server error. Please try again later.":(d.status===401||d.status===403)&&(p="Authentication error. Please refresh and try again.");throw{type:f,status:d.status,message:p}}await Ufe(d,s,{signal:a})}const $E="cycls_chat_history",og="cycls_active_chat",c6="cycls_message_count";function zL(){try{const t=localStorage.getItem(c6);return t?parseInt(t,10):0}catch{return 0}}function Hfe(){try{const t=zL();return localStorage.setItem(c6,String(t+1)),t+1}catch{return 0}}function jfe(){try{localStorage.removeItem(c6)}catch{}}class Rr{static getAllChats(){try{const e=localStorage.getItem($E);return e?JSON.parse(e):[]}catch(e){return console.error("Error loading chat history:",e),[]}}static saveAllChats(e){try{localStorage.setItem($E,JSON.stringify(e))}catch(n){console.error("Error saving chat history:",n)}}static getActiveChat(){try{return localStorage.getItem(og)}catch{return null}}static setActiveChat(e){try{localStorage.setItem(og,e)}catch(n){console.error("Error saving active chat:",n)}}static createChat(e=[]){const n=this.getAllChats(),r={id:Date.now().toString(),title:this.generateTitle(e),messages:e,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};return n.length>=yo.MAX_CHATS&&(n.sort((i,s)=>new Date(i.createdAt)-new Date(s.createdAt)),n.shift()),n.push(r),this.saveAllChats(n),this.setActiveChat(r.id),r}static updateChat(e,n){const r=this.getAllChats(),i=r.findIndex(s=>s.id===e);i!==-1&&(r[i].messages=n,r[i].updatedAt=new Date().toISOString(),r[i].title=this.generateTitle(n),this.saveAllChats(r))}static deleteChat(e){const r=this.getAllChats().filter(i=>i.id!==e);this.saveAllChats(r),this.getActiveChat()===e&&localStorage.removeItem(og)}static getChat(e){return this.getAllChats().find(r=>r.id===e)}static generateTitle(e){if(!e||e.length===0)return"New Chat";const n=e.find(s=>s.type==="request"||s.role==="user");if(!n)return"New Chat";const{clean:r}=fh(n.content);return r.trim().slice(0,50)||"New Chat"}static clearAll(){try{localStorage.removeItem($E),localStorage.removeItem(og)}catch(e){console.error("Error clearing chat history:",e)}}}var be=typeof window<"u"?window:void 0,Jr=typeof globalThis<"u"?globalThis:be;typeof self>"u"&&(Jr.self=Jr),typeof File>"u"&&(Jr.File=function(){});var UL=Array.prototype,Y7=UL.forEach,W7=UL.indexOf,us=Jr==null?void 0:Jr.navigator,Ve=Jr==null?void 0:Jr.document,qi=Jr==null?void 0:Jr.location,I3=Jr==null?void 0:Jr.fetch,L3=Jr!=null&&Jr.XMLHttpRequest&&"withCredentials"in new Jr.XMLHttpRequest?Jr.XMLHttpRequest:void 0,K7=Jr==null?void 0:Jr.AbortController,Fi=us==null?void 0:us.userAgent,ot=be??{},fo={DEBUG:!1,LIB_VERSION:"1.335.5"};function X7(t,e,n,r,i,s,a){try{var l=t[s](a),u=l.value}catch(d){return void n(d)}l.done?e(u):Promise.resolve(u).then(r,i)}function hd(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var s=t.apply(e,n);function a(u){X7(s,r,i,a,l,"next",u)}function l(u){X7(s,r,i,a,l,"throw",u)}a(void 0)}))}}function We(){return We=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},We.apply(null,arguments)}function FL(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}var $fe=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],Q7=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return $fe.concat(e).some((r=>{var i=r.toLowerCase();return n.indexOf(i)!==-1}))},qfe=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];function Ht(t,e){return t.indexOf(e)!==-1}var Jb=function(t){return t.trim()},P3=function(t){return t.replace(/^\$/,"")},Vfe=Array.isArray,HL=Object.prototype,jL=HL.hasOwnProperty,ev=HL.toString,rn=Vfe||function(t){return ev.call(t)==="[object Array]"},Vl=t=>typeof t=="function",Dr=t=>t===Object(t)&&!rn(t),pd=t=>{if(Dr(t)){for(var e in t)if(jL.call(t,e))return!1;return!0}return!1},$e=t=>t===void 0,Ir=t=>ev.call(t)=="[object String]",B3=t=>Ir(t)&&t.trim().length===0,na=t=>t===null,nn=t=>$e(t)||na(t),Io=t=>ev.call(t)=="[object Number]"&&t==t,ud=t=>Io(t)&&t>0,Ao=t=>ev.call(t)==="[object Boolean]",Gfe=t=>t instanceof FormData,Yfe=t=>Ht(qfe,t);function z3(t){return t===null||typeof t!="object"}function G1(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function $L(t){return!$e(Event)&&(function(e,n){try{return e instanceof n}catch{return!1}})(t,Event)}var Wfe=[!0,"true",1,"1","yes"],qE=t=>Ht(Wfe,t),Kfe=[!1,"false",0,"0","no"];function xa(t,e,n,r,i){return e>n&&(r.warn("min cannot be greater than max."),e=n),Io(t)?t>n?(r.warn(" cannot be  greater than max: "+n+". Using max value instead."),n):t<e?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+i),xa(i||n,e,n,r))}class Xfe{constructor(e){this.t={},this.i=e.i,this.o=xa(e.bucketSize,0,100,e.h),this.m=xa(e.refillRate,0,this.o,e.h),this.$=xa(e.refillInterval,0,864e5,e.h)}S(e,n){var r=n-e.lastAccess,i=Math.floor(r/this.$);if(i>0){var s=i*this.m;e.tokens=Math.min(e.tokens+s,this.o),e.lastAccess=e.lastAccess+i*this.$}}consumeRateLimit(e){var n,r=Date.now(),i=String(e),s=this.t[i];return s?this.S(s,r):(s={tokens:this.o,lastAccess:r},this.t[i]=s),s.tokens===0||(s.tokens--,s.tokens===0&&((n=this.i)==null||n.call(this,e)),s.tokens===0)}stop(){this.t={}}}var Ps="Mobile",Y1="iOS",xo="Android",wh="Tablet",qL=xo+" "+wh,VL="iPad",GL="Apple",YL=GL+" Watch",kh="Safari",Pd="BlackBerry",WL="Samsung",KL=WL+"Browser",XL=WL+" Internet",ec="Chrome",Qfe=ec+" OS",QL=ec+" "+Y1,d6="Internet Explorer",ZL=d6+" "+Ps,f6="Opera",Zfe=f6+" Mini",h6="Edge",JL="Microsoft "+h6,_d="Firefox",eP=_d+" "+Y1,Ch="Nintendo",Ah="PlayStation",xd="Xbox",tP=xo+" "+Ps,nP=Ps+" "+kh,wf="Windows",U3=wf+" Phone",Z7="Nokia",F3="Ouya",rP="Generic",Jfe=rP+" "+Ps.toLowerCase(),iP=rP+" "+wh.toLowerCase(),H3="Konqueror",bi="(\\d+(\\.\\d+)?)",VE=new RegExp("Version/"+bi),ehe=new RegExp(xd,"i"),the=new RegExp(Ah+" \\w+","i"),nhe=new RegExp(Ch+" \\w+","i"),p6=new RegExp(Pd+"|PlayBook|BB10","i"),rhe={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},lg,J7,GE,ihe=(t,e)=>e&&Ht(e,GL)||(function(n){return Ht(n,kh)&&!Ht(n,ec)&&!Ht(n,xo)})(t),sP=function(t,e){return e=e||"",Ht(t," OPR/")&&Ht(t,"Mini")?Zfe:Ht(t," OPR/")?f6:p6.test(t)?Pd:Ht(t,"IE"+Ps)||Ht(t,"WPDesktop")?ZL:Ht(t,KL)?XL:Ht(t,h6)||Ht(t,"Edg/")?JL:Ht(t,"FBIOS")?"Facebook "+Ps:Ht(t,"UCWEB")||Ht(t,"UCBrowser")?"UC Browser":Ht(t,"CriOS")?QL:Ht(t,"CrMo")||Ht(t,ec)?ec:Ht(t,xo)&&Ht(t,kh)?tP:Ht(t,"FxiOS")?eP:Ht(t.toLowerCase(),H3.toLowerCase())?H3:ihe(t,e)?Ht(t,Ps)?nP:kh:Ht(t,_d)?_d:Ht(t,"MSIE")||Ht(t,"Trident/")?d6:Ht(t,"Gecko")?_d:""},she={[ZL]:[new RegExp("rv:"+bi)],[JL]:[new RegExp(h6+"?\\/"+bi)],[ec]:[new RegExp("("+ec+"|CrMo)\\/"+bi)],[QL]:[new RegExp("CriOS\\/"+bi)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+bi)],[kh]:[VE],[nP]:[VE],[f6]:[new RegExp("(Opera|OPR)\\/"+bi)],[_d]:[new RegExp(_d+"\\/"+bi)],[eP]:[new RegExp("FxiOS\\/"+bi)],[H3]:[new RegExp("Konqueror[:/]?"+bi,"i")],[Pd]:[new RegExp(Pd+" "+bi),VE],[tP]:[new RegExp("android\\s"+bi,"i")],[XL]:[new RegExp(KL+"\\/"+bi)],[d6]:[new RegExp("(rv:|MSIE )"+bi)],Mozilla:[new RegExp("rv:"+bi)]},ahe=function(t,e){var n=sP(t,e),r=she[n];if($e(r))return null;for(var i=0;i<r.length;i++){var s=r[i],a=t.match(s);if(a)return parseFloat(a[a.length-2])}return null},eA=[[new RegExp(xd+"; "+xd+" (.*?)[);]","i"),t=>[xd,t&&t[1]||""]],[new RegExp(Ch,"i"),[Ch,""]],[new RegExp(Ah,"i"),[Ah,""]],[p6,[Pd,""]],[new RegExp(wf,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[U3,""];if(new RegExp(Ps).test(e)&&!/IEMobile\b/.test(e))return[wf+" "+Ps,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var r=n[1],i=rhe[r]||"";return/arm/i.test(e)&&(i="RT"),[wf,i]}return[wf,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[Y1,e.join(".")]}return[Y1,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=$e(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+xo+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+xo+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[xo,e.join(".")]}return[xo,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var n=[t[1],t[2],t[3]||"0"];e[1]=n.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Qfe,""]],[/Linux|debian/i,["Linux",""]]],tA=function(t){return nhe.test(t)?Ch:the.test(t)?Ah:ehe.test(t)?xd:new RegExp(F3,"i").test(t)?F3:new RegExp("("+U3+"|WPDesktop)","i").test(t)?U3:/iPad/.test(t)?VL:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?YL:p6.test(t)?Pd:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Z7,"i").test(t)?Z7:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(Ps).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?xo:qL:new RegExp("(pda|"+Ps+")","i").test(t)?Jfe:new RegExp(wh,"i").test(t)&&!new RegExp(wh+" pc","i").test(t)?iP:""},ohe=t=>t instanceof Error;function lhe(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return GE&&n.length===J7||(J7=n.length,GE=n.reduce(((r,i)=>{lg||(lg={});var s=lg[i];if(s)r[s[0]]=s[1];else for(var a=t(i),l=a.length-1;l>=0;l--){var u=a[l],d=u==null?void 0:u.filename,f=e[i];if(d&&f){r[d]=f,lg[i]=[d,f];break}}return r}),{})),GE}}class uhe{constructor(e,n,r){r===void 0&&(r=[]),this.coercers=e,this.stackParser=n,this.modifiers=r}buildFromUnknown(e,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,n,0).apply(e),s=this.buildParsingContext(),a=this.parseStacktrace(i,s);return{$exception_list:this.convertToExceptionList(a,r),$exception_level:"error"}}modifyFrames(e){var n=this;return hd((function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&rn(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.stacktrace.frames));return e}))()}coerceFallback(e){var n;return{type:"Error",value:"Unknown error",stack:(n=e.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(e,n){var r,i;return e.cause!=null&&(r=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null&&(i=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?1:0),n.chunkIdMap)),We({},e,{cause:r,stack:i})}applyChunkIds(e,n){return e.map((r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r)))}applyCoercers(e,n){for(var r of this.coercers)if(r.match(e))return r.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return hd((function*(){var r=e;for(var i of n.modifiers)r=yield i(r);return r}))()}convertToExceptionList(e,n){var r,i,s,a={type:e.type,value:e.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(i=n.handled)===null||i===void 0||i,synthetic:(s=e.synthetic)!==null&&s!==void 0&&s}};e.stack&&(a.stacktrace={type:"raw",frames:e.stack});var l=[a];return e.cause!=null&&l.push(...this.convertToExceptionList(e.cause,We({},n,{handled:!0}))),l}buildParsingContext(){return{chunkIdMap:lhe(this.stackParser)}}buildCoercingContext(e,n,r){r===void 0&&(r=0);var i=(s,a)=>{if(a<=4){var l=this.buildCoercingContext(e,n,a);return this.applyCoercers(s,l)}};return We({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:e,apply:s=>i(s,r),next:s=>i(s,r+1)})}}var Bd="?";function j3(t,e,n,r,i){var s={platform:t,filename:e,function:n==="<anonymous>"?Bd:n,in_app:!0};return $e(r)||(s.lineno=r),$e(i)||(s.colno=i),s}var aP=(t,e)=>{var n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:Bd,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},che=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,dhe=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,fhe=/\((\S*)(?::(\d+))(?::(\d+))\)/,hhe=(t,e)=>{var n=che.exec(t);if(n){var[,r,i,s]=n;return j3(e,r,Bd,+i,+s)}var a=dhe.exec(t);if(a){if(a[2]&&a[2].indexOf("eval")===0){var l=fhe.exec(a[2]);l&&(a[2]=l[1],a[3]=l[2],a[4]=l[3])}var[u,d]=aP(a[1]||Bd,a[2]);return j3(e,d,u,a[3]?+a[3]:void 0,a[4]?+a[4]:void 0)}},phe=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,mhe=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,ghe=(t,e)=>{var n=phe.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=mhe.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var i=n[3],s=n[1]||Bd;return[s,i]=aP(s,i),j3(e,i,s,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},nA=/\(error: (.*)\)/,rA=50;function bhe(){return(function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return function(i,s){s===void 0&&(s=0);for(var a=[],l=i.split(`
`),u=s;u<l.length;u++){var d=l[u];if(!(d.length>1024)){var f=nA.test(d)?d.replace(nA,"$1"):d;if(!f.match(/\S*Error: /)){for(var p of n){var g=p(f,t);if(g){a.push(g);break}}if(a.length>=rA)break}}}return(function(b){if(!b.length)return[];var v=Array.from(b);return v.reverse(),v.slice(0,rA).map((E=>{return We({},E,{filename:E.filename||(x=v,x[x.length-1]||{}).filename,function:E.function||Bd});var x}))})(a)}})("web:javascript",hhe,ghe)}class vhe{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var r=Ir(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var n=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?n+": "+e.message:n}isDOMException(e){return G1(e,"DOMException")}isDOMError(e){return G1(e,"DOMError")}}class yhe{match(e){return(n=>n instanceof Error)(e)}coerce(e,n){return{type:this.getType(e),value:this.getMessage(e,n),stack:this.getStack(e),cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,n){var r=e.message;return r.error&&typeof r.error.message=="string"?String(r.error.message):String(r)}getStack(e){return e.stacktrace||e.stack||void 0}}class Ehe{constructor(){}match(e){return G1(e,"ErrorEvent")&&e.error!=null}coerce(e,n){var r,i=n.apply(e.error);return i||{type:"ErrorEvent",value:e.message,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}var _he=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class xhe{match(e){return typeof e=="string"}coerce(e,n){var r,[i,s]=this.getInfos(e);return{type:i??"Error",value:s??e,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(e){var n="Error",r=e,i=e.match(_he);return i&&(n=i[1],r=i[2]),[n,r]}}var The=["fatal","error","warning","log","info","debug"];function oP(t,e){e===void 0&&(e=40);var n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(", ");if(!(i.length>e))return r===n.length||i.length<=e?i:i.slice(0,e)+"..."}return""}class She{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var r,i=this.getErrorPropertyFromObject(e);return i?n.apply(i):{type:this.getType(e),value:this.getValue(e),stack:(r=n.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return $L(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var n="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(n+=" with message: '"+e.message+"'"),n}if("message"in e&&typeof e.message=="string")return e.message;var r=this.getObjectClassName(e);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+oP(e)}isSeverityLevel(e){return Ir(e)&&!B3(e)&&The.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];if(ohe(r))return r}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}}class whe{match(e){return $L(e)}coerce(e,n){var r,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+oP(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class khe{match(e){return z3(e)}coerce(e,n){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class Che{match(e){return G1(e,"PromiseRejectionEvent")}coerce(e,n){var r,i=this.getUnhandledRejectionReason(e);return z3(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(i)}getUnhandledRejectionReason(e){if(z3(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}}var lP=function(t,e){var{debugEnabled:n}=e===void 0?{}:e,r={k:function(i){if(be&&(fo.DEBUG||ot.POSTHOG_DEBUG||n)&&!$e(be.console)&&be.console){for(var s=("__rrweb_original__"in be.console[i])?be.console[i].__rrweb_original__:be.console[i],a=arguments.length,l=new Array(a>1?a-1:0),u=1;u<a;u++)l[u-1]=arguments[u];s(t,...l)}},info:function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];r.k("log",...s)},warn:function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];r.k("warn",...s)},error:function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];r.k("error",...s)},critical:function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];console.error(t,...s)},uninitializedWarning:i=>{r.error("You must initialize PostHog before calling "+i)},createLogger:(i,s)=>lP(t+" "+i,s)};return r},Ge=lP("[PostHog.js]"),or=Ge.createLogger,Ahe=or("[ExternalScriptsLoader]"),iA=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return Ahe.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=Ve==null?void 0:Ve.querySelectorAll("script");if(r){for(var i,s=function(){if(r[a].src===e){var u=r[a];return u.__posthog_loading_callback_fired?{v:n()}:(u.addEventListener("load",(d=>{u.__posthog_loading_callback_fired=!0,n(void 0,d)})),u.onerror=d=>n(d),{v:void 0})}},a=0;a<r.length;a++)if(i=s())return i.v}var l=()=>{if(!Ve)return n("document not found");var u=Ve.createElement("script");if(u.type="text/javascript",u.crossOrigin="anonymous",u.src=e,u.onload=p=>{u.__posthog_loading_callback_fired=!0,n(void 0,p)},u.onerror=p=>n(p),t.config.prepare_external_dependency_script&&(u=t.config.prepare_external_dependency_script(u)),!u)return n("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")Ve.head.appendChild(u);else{var d,f=Ve.querySelectorAll("body > script");f.length>0?(d=f[0].parentNode)==null||d.insertBefore(u,f[0]):Ve.body.appendChild(u)}};Ve!=null&&Ve.body?l():Ve==null||Ve.addEventListener("DOMContentLoaded",l)};ot.__PosthogExtensions__=ot.__PosthogExtensions__||{},ot.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{var r="/static/"+e+".js?v="+t.version;if(e==="remote-config"&&(r="/array/"+t.config.token+"/config.js"),e==="toolbar"){var i=3e5;r=r+"&t="+Math.floor(Date.now()/i)*i}var s=t.requestRouter.endpointFor("assets",r);iA(t,s,n)},ot.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var r=t.requestRouter.endpointFor("api",e);iA(t,r,n)};var W1={};function Gl(t,e,n){if(rn(t)){if(Y7&&t.forEach===Y7)t.forEach(e,n);else if("length"in t&&t.length===+t.length){for(var r=0,i=t.length;r<i;r++)if(r in t&&e.call(n,t[r],r)===W1)return}}}function Nn(t,e,n){if(!nn(t)){if(rn(t))return Gl(t,e,n);if(Gfe(t)){for(var r of t.entries())if(e.call(n,r[1],r[0])===W1)return}else for(var i in t)if(jL.call(t,i)&&e.call(n,t[i],i)===W1)return}}var pr=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Gl(n,(function(i){for(var s in i)i[s]!==void 0&&(t[s]=i[s])})),t},Jd=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Gl(n,(function(i){Gl(i,(function(s){t.push(s)}))})),t};function Mg(t){for(var e=Object.keys(t),n=e.length,r=new Array(n);n--;)r[n]=[e[n],t[e[n]]];return r}var sA=function(t){try{return t()}catch{return}},Nhe=function(t){return function(){try{for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.apply(this,n)}catch(i){Ge.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Ge.critical(i)}}},m6=function(t){var e={};return Nn(t,(function(n,r){(Ir(n)&&n.length>0||Io(n))&&(e[r]=n)})),e};function Ohe(t,e){return n=t,r=s=>Ir(s)&&!na(e)?s.slice(0,e):s,i=new Set,(function s(a,l){return a!==Object(a)?r?r(a,l):a:i.has(a)?void 0:(i.add(a),rn(a)?(u=[],Gl(a,(d=>{u.push(s(d))}))):(u={},Nn(a,((d,f)=>{i.has(d)||(u[f]=s(d,f))}))),u);var u})(n);var n,r,i}var Mhe=["herokuapp.com","vercel.app","netlify.app"];function Rhe(t){var e=t==null?void 0:t.hostname;if(!Ir(e))return!1;var n=e.split(".").slice(-2).join(".");for(var r of Mhe)if(n===r)return!1;return!0}function uP(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return t[n]}function Sr(t,e,n,r){var{capture:i=!1,passive:s=!0}=r??{};t==null||t.addEventListener(e,n,{capture:i,passive:s})}var cP="$people_distinct_id",kf="__alias",Cf="__timers",aA="$autocapture_disabled_server_side",$3="$heatmaps_enabled_server_side",oA="$exception_capture_enabled_server_side",q3="$error_tracking_suppression_rules",lA="$error_tracking_capture_extension_exceptions",uA="$web_vitals_enabled_server_side",dP="$dead_clicks_enabled_server_side",cA="$product_tours_enabled_server_side",dA="$web_vitals_allowed_metrics",YE="$session_recording_remote_config",K1="$sesid",fP="$session_is_sampled",md="$enabled_feature_flags",Af="$early_access_features",V3="$feature_flag_details",Nf="$stored_person_properties",Iu="$stored_group_properties",G3="$surveys",X1="$flag_call_reported",ho="$user_state",Y3="$client_session_props",W3="$capture_rate_limit",K3="$initial_campaign_params",X3="$initial_referrer_info",Q1="$initial_person_info",Z1="$epp",hP="__POSTHOG_TOOLBAR__",lf="$posthog_cookieless",Dhe=[cP,kf,"__cmpns",Cf,"$session_recording_enabled_server_side",$3,K1,md,q3,ho,Af,V3,Iu,Nf,G3,X1,Y3,W3,K3,X3,Z1,Q1,"$conversations_widget_session_id","$conversations_ticket_id","$conversations_widget_state","$conversations_user_traits"];function fA(t){return t instanceof Element&&(t.id===hP||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function tv(t){return!!t&&t.nodeType===1}function Yl(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function pP(t){return!!t&&t.nodeType===3}function mP(t){return!!t&&t.nodeType===11}function g6(t){return t?Jb(t).split(/\s+/):[]}function hA(t){var e=be==null?void 0:be.location.href;return!!(e&&t&&t.some((n=>e.match(n))))}function J1(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return g6(e)}function gP(t){return nn(t)?null:Jb(t).split(/(\s+)/).filter((e=>Nh(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function tp(t){var e="";return Q3(t)&&!_P(t)&&t.childNodes&&t.childNodes.length&&Nn(t.childNodes,(function(n){var r;pP(n)&&n.textContent&&(e+=(r=gP(n.textContent))!==null&&r!==void 0?r:"")})),Jb(e)}function bP(t){return $e(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var b6=["a","button","form","input","select","textarea","label"];function vP(t,e){if($e(e))return!0;var n,r=function(s){if(e.some((a=>s.matches(a))))return{v:!0}};for(var i of t)if(n=r(i))return n.v;return!1}function yP(t){var e=t.parentNode;return!(!e||!tv(e))&&e}var Ihe=["next","previous","prev",">","<"],pA=10,mA=[".ph-no-rageclick",".ph-no-capture"];function Lhe(t,e){if(!be||v6(t))return!1;var n,r,i;if(Ao(e)?(n=!!e&&mA,r=void 0):(n=(i=e==null?void 0:e.css_selector_ignorelist)!==null&&i!==void 0?i:mA,r=e==null?void 0:e.content_ignorelist),n===!1)return!1;var{targetElementList:s}=EP(t,!1);return!(function(a,l){if(a===!1||$e(a))return!1;var u;if(a===!0)u=Ihe;else{if(!rn(a))return!1;if(a.length>pA)return Ge.error("[PostHog] content_ignorelist array cannot exceed "+pA+" items. Use css_selector_ignorelist for more complex matching."),!1;u=a.map((d=>d.toLowerCase()))}return l.some((d=>{var{safeText:f,ariaLabel:p}=d;return u.some((g=>f.includes(g)||p.includes(g)))}))})(r,s.map((a=>{var l;return{safeText:tp(a).toLowerCase(),ariaLabel:((l=a.getAttribute("aria-label"))==null?void 0:l.toLowerCase().trim())||""}})))&&!vP(s,n)}var v6=t=>!t||Yl(t,"html")||!tv(t),EP=(t,e)=>{if(!be||v6(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[t],i=t;i.parentNode&&!Yl(i,"body");)if(mP(i.parentNode))r.push(i.parentNode.host),i=i.parentNode.host;else{var s=yP(i);if(!s)break;if(e||b6.indexOf(s.tagName.toLowerCase())>-1)n=!0;else{var a=be.getComputedStyle(s);a&&a.getPropertyValue("cursor")==="pointer"&&(n=!0)}r.push(s),i=s}return{parentIsUsefulElement:n,targetElementList:r}};function Phe(t,e,n,r,i){var s,a,l,u;if(n===void 0&&(n=void 0),!be||v6(t)||(s=n)!=null&&s.url_allowlist&&!hA(n.url_allowlist)||(a=n)!=null&&a.url_ignorelist&&hA(n.url_ignorelist))return!1;if((l=n)!=null&&l.dom_event_allowlist){var d=n.dom_event_allowlist;if(d&&!d.some((v=>e.type===v)))return!1}var{parentIsUsefulElement:f,targetElementList:p}=EP(t,r);if(!(function(v,E){var x=E==null?void 0:E.element_allowlist;if($e(x))return!0;var S,C=function(L){if(x.some((D=>L.tagName.toLowerCase()===D)))return{v:!0}};for(var O of v)if(S=C(O))return S.v;return!1})(p,n)||!vP(p,(u=n)==null?void 0:u.css_selector_allowlist))return!1;var g=be.getComputedStyle(t);if(g&&g.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var b=t.tagName.toLowerCase();switch(b){case"html":return!1;case"form":return(i||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(i||["change","click"]).indexOf(e.type)>=0;default:return f?(i||["click"]).indexOf(e.type)>=0:(i||["click"]).indexOf(e.type)>=0&&(b6.indexOf(b)>-1||t.getAttribute("contenteditable")==="true")}}function Q3(t){for(var e=t;e.parentNode&&!Yl(e,"body");e=e.parentNode){var n=J1(e);if(Ht(n,"ph-sensitive")||Ht(n,"ph-no-capture"))return!1}if(Ht(J1(t),"ph-include"))return!0;var r=t.type||"";if(Ir(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=t.name||t.id||"";return!(Ir(i)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))}function _P(t){return!!(Yl(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Yl(t,"select")||Yl(t,"textarea")||t.getAttribute("contenteditable")==="true")}var xP="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",Bhe=new RegExp("^(?:"+xP+")$"),zhe=new RegExp(xP),TP="\\d{3}-?\\d{2}-?\\d{4}",Uhe=new RegExp("^("+TP+")$"),Fhe=new RegExp("("+TP+")");function Nh(t,e){return e===void 0&&(e=!0),!(nn(t)||Ir(t)&&(t=Jb(t),(e?Bhe:zhe).test((t||"").replace(/[- ]/g,""))||(e?Uhe:Fhe).test(t)))}function SP(t){var e=tp(t);return Nh(e=(e+" "+wP(t)).trim())?e:""}function wP(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Nn(t.childNodes,(function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var i=tp(n);e=(e+" "+i).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+wP(n)).trim())}catch(s){Ge.error("[AutoCapture]",s)}})),e}function Hhe(t){return(function(e){var n=e.map((r=>{var i,s,a="";if(r.tag_name&&(a+=r.tag_name),r.attr_class)for(var l of(r.attr_class.sort(),r.attr_class))a+="."+l.replace(/"/g,"");var u=We({},r.text?{text:r.text}:{},{"nth-child":(i=r.nth_child)!==null&&i!==void 0?i:0,"nth-of-type":(s=r.nth_of_type)!==null&&s!==void 0?s:0},r.href?{href:r.href}:{},r.attr_id?{attr_id:r.attr_id}:{},r.attributes),d={};return Mg(u).sort(((f,p)=>{var[g]=f,[b]=p;return g.localeCompare(b)})).forEach((f=>{var[p,g]=f;return d[gA(p.toString())]=gA(g.toString())})),a+=":",a+=Mg(d).map((f=>{var[p,g]=f;return p+'="'+g+'"'})).join("")}));return n.join(";")})((function(e){return e.map((n=>{var r,i,s={text:(r=n.$el_text)==null?void 0:r.slice(0,400),tag_name:n.tag_name,href:(i=n.attr__href)==null?void 0:i.slice(0,2048),attr_class:jhe(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return Mg(n).filter((a=>{var[l]=a;return l.indexOf("attr__")===0})).forEach((a=>{var[l,u]=a;return s.attributes[l]=u})),s}))})(t))}function gA(t){return t.replace(/"|\\"/g,'\\"')}function jhe(t){var e=t.attr__class;return e?rn(e)?e:g6(e):void 0}class kP{constructor(e){this.disabled=e===!1;var n=Dr(e)?e:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(e,n,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(n-i.y)<this.thresholdPx&&r-i.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:n,timestamp:r}];return!1}}var eb=t=>{var e=Ve==null?void 0:Ve.createElement("a");return $e(e)?null:(e.href=t,e)},$he=function(t,e){var n,r;e===void 0&&(e="&");var i=[];return Nn(t,(function(s,a){$e(s)||$e(a)||a==="undefined"||(n=encodeURIComponent((l=>l instanceof File)(s)?s.name:s.toString()),r=encodeURIComponent(a),i[i.length]=r+"="+n)})),i.join(e)},tb=function(t,e){for(var n,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;i<r.length;i++){var s=r[i].split("=");if(s[0]===e){n=s;break}}if(!rn(n)||n.length<2)return"";var a=n[1];try{a=decodeURIComponent(a)}catch{Ge.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},np=function(t,e,n){if(!t||!e||!e.length)return t;for(var r=t.split("#"),i=r[0]||"",s=r[1],a=i.split("?"),l=a[1],u=a[0],d=(l||"").split("&"),f=[],p=0;p<d.length;p++){var g=d[p].split("=");rn(g)&&(e.includes(g[0])?f.push(g[0]+"="+n):f.push(d[p]))}var b=u;return l!=null&&(b+="?"+f.join("&")),s!=null&&(b+="#"+s),b},nb=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},WE="$copy_autocapture",bA=or("[AutoCapture]");function KE(t,e){return e.length>t?e.slice(0,t)+"...":e}function qhe(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!tv(e));return e}function Vhe(t,e,n,r){var i=t.tagName.toLowerCase(),s={tag_name:i};b6.indexOf(i)>-1&&!n&&(i.toLowerCase()==="a"||i.toLowerCase()==="button"?s.$el_text=KE(1024,SP(t)):s.$el_text=KE(1024,tp(t)));var a=J1(t);a.length>0&&(s.classes=a.filter((function(f){return f!==""}))),Nn(t.attributes,(function(f){var p;if((!_P(t)||["name","id","class","aria-label"].indexOf(f.name)!==-1)&&(r==null||!r.includes(f.name))&&!e&&Nh(f.value)&&(p=f.name,!Ir(p)||p.substring(0,10)!=="_ngcontent"&&p.substring(0,7)!=="_nghost")){var g=f.value;f.name==="class"&&(g=g6(g).join(" ")),s["attr__"+f.name]=KE(1024,g)}}));for(var l=1,u=1,d=t;d=qhe(d);)l++,d.tagName===t.tagName&&u++;return s.nth_child=l,s.nth_of_type=u,s}function Ghe(t,e){for(var n,r,{e:i,maskAllElementAttributes:s,maskAllText:a,elementAttributeIgnoreList:l,elementsChainAsString:u}=e,d=[t],f=t;f.parentNode&&!Yl(f,"body");)mP(f.parentNode)?(d.push(f.parentNode.host),f=f.parentNode.host):(d.push(f.parentNode),f=f.parentNode);var p,g=[],b={},v=!1,E=!1;if(Nn(d,(L=>{var D=Q3(L);L.tagName.toLowerCase()==="a"&&(v=L.getAttribute("href"),v=D&&v&&Nh(v)&&v),Ht(J1(L),"ph-no-capture")&&(E=!0),g.push(Vhe(L,s,a,l));var R=(function(F){if(!Q3(F))return{};var G={};return Nn(F.attributes,(function(Z){if(Z.name&&Z.name.indexOf("data-ph-capture-attribute")===0){var q=Z.name.replace("data-ph-capture-attribute-",""),ie=Z.value;q&&ie&&Nh(ie)&&(G[q]=ie)}})),G})(L);pr(b,R)})),E)return{props:{},explicitNoCapture:E};if(a||(t.tagName.toLowerCase()==="a"||t.tagName.toLowerCase()==="button"?g[0].$el_text=SP(t):g[0].$el_text=tp(t)),v){var x,S;g[0].attr__href=v;var C=(x=eb(v))==null?void 0:x.host,O=be==null||(S=be.location)==null?void 0:S.host;C&&O&&C!==O&&(p=v)}return{props:pr({$event_type:i.type,$ce_version:1},u?{}:{$elements:g},{$elements_chain:Hhe(g)},(n=g[0])!=null&&n.$el_text?{$el_text:(r=g[0])==null?void 0:r.$el_text}:{},p&&i.type==="click"?{$external_click_url:p}:{},b)}}class Yhe{constructor(e){this.P=!1,this.T=null,this.I=!1,this.instance=e,this.rageclicks=new kP(e.config.rageclick),this.C=null}get R(){var e,n,r=Dr(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=(e=r.url_allowlist)==null?void 0:e.map((i=>new RegExp(i))),r.url_ignorelist=(n=r.url_ignorelist)==null?void 0:n.map((i=>new RegExp(i))),r}F(){if(this.isBrowserSupported()){if(be&&Ve){var e=r=>{r=r||(be==null?void 0:be.event);try{this.M(r)}catch(i){bA.error("Failed to capture event",i)}};if(Sr(Ve,"submit",e,{capture:!0}),Sr(Ve,"change",e,{capture:!0}),Sr(Ve,"click",e,{capture:!0}),this.R.capture_copied_text){var n=r=>{r=r||(be==null?void 0:be.event),this.M(r,WE)};Sr(Ve,"copy",n,{capture:!0}),Sr(Ve,"cut",n,{capture:!0})}}}else bA.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.P&&(this.F(),this.P=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.I=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[aA]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.C=e}getElementSelectors(e){var n,r=[];return(n=this.C)==null||n.forEach((i=>{var s=Ve==null?void 0:Ve.querySelectorAll(i);s==null||s.forEach((a=>{e===a&&r.push(i)}))})),r}get isEnabled(){var e,n,r=(e=this.instance.persistence)==null?void 0:e.props[aA],i=this.T;if(na(i)&&!Ao(r)&&!this.instance.O())return!1;var s=(n=this.T)!==null&&n!==void 0?n:!!r;return!!this.instance.config.autocapture&&!s}M(e,n){if(n===void 0&&(n="$autocapture"),this.isEnabled){var r,i=bP(e);pP(i)&&(i=i.parentNode||null),n==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(r=this.rageclicks)!=null&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&Lhe(i,this.instance.config.rageclick)&&this.M(e,"$rageclick");var s=n===WE;if(i&&Phe(i,e,this.R,s,s?["copy","cut"]:void 0)){var{props:a,explicitNoCapture:l}=Ghe(i,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.R.element_attribute_ignorelist,elementsChainAsString:this.I});if(l)return!1;var u=this.getElementSelectors(i);if(u&&u.length>0&&(a.$element_selectors=u),n===WE){var d,f=gP(be==null||(d=be.getSelection())==null?void 0:d.toString()),p=e.type||"clipboard";if(!f)return!1;a.$selected_content=f,a.$copy_type=p}return this.instance.capture(n,a),!0}}}isBrowserSupported(){return Vl(Ve==null?void 0:Ve.querySelectorAll)}}Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return Io(t)&&isFinite(t)&&Math.floor(t)===t});var vA="0123456789abcdef";class rb{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,r,i){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||e<0||n<0||r<0||i<0||e>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/Math.pow(2,40),s[1]=e/Math.pow(2,32),s[2]=e/Math.pow(2,24),s[3]=e/Math.pow(2,16),s[4]=e/Math.pow(2,8),s[5]=e,s[6]=112|n>>>8,s[7]=n,s[8]=128|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=i>>>24,s[13]=i>>>16,s[14]=i>>>8,s[15]=i,new rb(s)}toString(){for(var e="",n=0;n<this.bytes.length;n++)e=e+vA.charAt(this.bytes[n]>>>4)+vA.charAt(15&this.bytes[n]),n!==3&&n!==5&&n!==7&&n!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new rb(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var n=0;n<16;n++){var r=this.bytes[n]-e.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class Whe{constructor(){this.A=0,this.D=0,this.j=new Khe}generate(){var e=this.generateOrAbort();if($e(e)){this.A=0;var n=this.generateOrAbort();if($e(n))throw new Error("Could not generate UUID after timestamp reset");return n}return e}generateOrAbort(){var e=Date.now();if(e>this.A)this.A=e,this.L();else{if(!(e+1e4>this.A))return;this.D++,this.D>4398046511103&&(this.A++,this.L())}return rb.fromFieldsV7(this.A,Math.trunc(this.D/Math.pow(2,30)),this.D&Math.pow(2,30)-1,this.j.nextUint32())}L(){this.D=1024*this.j.nextUint32()+(1023&this.j.nextUint32())}}var yA,CP=t=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};be&&!$e(be.crypto)&&crypto.getRandomValues&&(CP=t=>crypto.getRandomValues(t));class Khe{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(CP(this.N),this.U=0),this.N[this.U++]}}var Fl=()=>Xhe().toString(),Xhe=()=>(yA||(yA=new Whe)).generate(),uf="",Qhe=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Zhe(t,e){if(e){var n=(function(i,s){if(s===void 0&&(s=Ve),uf)return uf;if(!s||["localhost","127.0.0.1"].includes(i))return"";for(var a=i.split("."),l=Math.min(a.length,8),u="dmn_chk_"+Fl();!uf&&l--;){var d=a.slice(l).join("."),f=u+"=1;domain=."+d+";path=/";s.cookie=f+";max-age=3",s.cookie.includes(u)&&(s.cookie=f+";max-age=0",uf=d)}return uf})(t);if(!n){var r=(i=>{var s=i.match(Qhe);return s?s[0]:""})(t);r!==n&&Ge.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var ba={H:()=>!!Ve,B:function(t){Ge.error("cookieStore error: "+t)},q:function(t){if(Ve){try{for(var e=t+"=",n=Ve.cookie.split(";").filter((s=>s.length)),r=0;r<n.length;r++){for(var i=n[r];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return decodeURIComponent(i.substring(e.length,i.length))}}catch{}return null}},W:function(t){var e;try{e=JSON.parse(ba.q(t))||{}}catch{}return e},G:function(t,e,n,r,i){if(Ve)try{var s="",a="",l=Zhe(Ve.location.hostname,r);if(n){var u=new Date;u.setTime(u.getTime()+24*n*60*60*1e3),s="; expires="+u.toUTCString()}i&&(a="; secure");var d=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+l+a;return d.length>3686.4&&Ge.warn("cookieStore warning: large cookie, len="+d.length),Ve.cookie=d,d}catch{return}},V:function(t,e){if(Ve!=null&&Ve.cookie)try{ba.G(t,"",-1,e)}catch{return}}},XE=null,Xn={H:function(){if(!na(XE))return XE;var t=!0;if($e(be))t=!1;else try{var e="__mplssupport__";Xn.G(e,"xyz"),Xn.q(e)!=='"xyz"'&&(t=!1),Xn.V(e)}catch{t=!1}return t||Ge.error("localStorage unsupported; falling back to cookie store"),XE=t,t},B:function(t){Ge.error("localStorage error: "+t)},q:function(t){try{return be==null?void 0:be.localStorage.getItem(t)}catch(e){Xn.B(e)}return null},W:function(t){try{return JSON.parse(Xn.q(t))||{}}catch{}return null},G:function(t,e){try{be==null||be.localStorage.setItem(t,JSON.stringify(e))}catch(n){Xn.B(n)}},V:function(t){try{be==null||be.localStorage.removeItem(t)}catch(e){Xn.B(e)}}},Jhe=["$device_id","distinct_id",K1,fP,Z1,Q1],ug={},epe={H:function(){return!0},B:function(t){Ge.error("memoryStorage error: "+t)},q:function(t){return ug[t]||null},W:function(t){return ug[t]||null},G:function(t,e){ug[t]=e},V:function(t){delete ug[t]}},Ou=null,Xr={H:function(){if(!na(Ou))return Ou;if(Ou=!0,$e(be))Ou=!1;else try{var t="__support__";Xr.G(t,"xyz"),Xr.q(t)!=='"xyz"'&&(Ou=!1),Xr.V(t)}catch{Ou=!1}return Ou},B:function(t){Ge.error("sessionStorage error: ",t)},q:function(t){try{return be==null?void 0:be.sessionStorage.getItem(t)}catch(e){Xr.B(e)}return null},W:function(t){try{return JSON.parse(Xr.q(t))||null}catch{}return null},G:function(t,e){try{be==null||be.sessionStorage.setItem(t,JSON.stringify(e))}catch(n){Xr.B(n)}},V:function(t){try{be==null||be.sessionStorage.removeItem(t)}catch(e){Xr.B(e)}}},po=(function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t})({});class tpe{constructor(e){this._instance=e}get R(){return this._instance.config}get consent(){return this.J()?po.DENIED:this.K}isOptedOut(){return this.R.cookieless_mode==="always"||this.consent===po.DENIED||this.consent===po.PENDING&&(this.R.opt_out_capturing_by_default||this.R.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===po.DENIED}optInOut(e){this.Y.G(this.X,e?1:0,this.R.cookie_expiration,this.R.cross_subdomain_cookie,this.R.secure_cookie)}reset(){this.Y.V(this.X,this.R.cross_subdomain_cookie)}get X(){var{token:e,opt_out_capturing_cookie_prefix:n,consent_persistence_name:r}=this._instance.config;return r||(n?n+e:"__ph_opt_in_out_"+e)}get K(){var e=this.Y.q(this.X);return qE(e)?po.GRANTED:Ht(Kfe,e)?po.DENIED:po.PENDING}get Y(){if(!this.Z){var e=this.R.opt_out_capturing_persistence_type;this.Z=e==="localStorage"?Xn:ba;var n=e==="localStorage"?ba:Xn;n.q(this.X)&&(this.Z.q(this.X)||this.optInOut(qE(n.q(this.X))),n.V(this.X,this.R.cross_subdomain_cookie))}return this.Z}J(){return!!this.R.respect_dnt&&!!uP([us==null?void 0:us.doNotTrack,us==null?void 0:us.msDoNotTrack,ot.doNotTrack],(e=>qE(e)))}}var cg=or("[Dead Clicks]"),npe=()=>!0,rpe=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(dP)),r=t.instance.config.capture_dead_clicks;return Ao(r)?r:!!Dr(r)||n};class AP{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(e,n,r){this.instance=e,this.isEnabled=n,this.onCapture=r,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[dP]:e==null?void 0:e.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it((()=>{this.et()}))}it(e){var n,r;(n=ot.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&e(),(r=ot.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(i=>{i?cg.error("failed to load script",i):e()}))}et(){var e;if(Ve){if(!this.tt&&(e=ot.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=Dr(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.tt=ot.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.tt.start(Ve),cg.info("starting...")}}else cg.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,cg.info("stopping..."))}}var cf=or("[ExceptionAutocapture]");class ipe{constructor(e){var n,r,i;this.rt=()=>{var s;if(be&&this.isEnabled&&(s=ot.__PosthogExtensions__)!=null&&s.errorWrappingFunctions){var a=ot.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,l=ot.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,u=ot.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.R.capture_unhandled_errors&&(this.st=a(this.captureException.bind(this))),!this.nt&&this.R.capture_unhandled_rejections&&(this.nt=l(this.captureException.bind(this))),!this.ot&&this.R.capture_console_errors&&(this.ot=u(this.captureException.bind(this)))}catch(d){cf.error("failed to start",d),this.ut()}}},this._instance=e,this.ht=!((n=this._instance.persistence)==null||!n.props[oA]),this.dt=new Xfe({refillRate:(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(i=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&i!==void 0?i:10,refillInterval:1e4,h:cf}),this.R=this.vt(),this.startIfEnabledOrStop()}vt(){var e=this._instance.config.capture_exceptions,n={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Dr(e)?n=We({},n,e):($e(e)?this.ht:e)&&(n=We({},n,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),n}get isEnabled(){return this.R.capture_console_errors||this.R.capture_unhandled_errors||this.R.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(cf.info("enabled"),this.ut(),this.it(this.rt)):this.ut()}it(e){var n,r;(n=ot.__PosthogExtensions__)!=null&&n.errorWrappingFunctions&&e(),(r=ot.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"exception-autocapture",(i=>{if(i)return cf.error("failed to load script",i);e()}))}ut(){var e,n,r;(e=this.st)==null||e.call(this),this.st=void 0,(n=this.nt)==null||n.call(this),this.nt=void 0,(r=this.ot)==null||r.call(this),this.ot=void 0}onRemoteConfig(e){var n=e.autocaptureExceptions;this.ht=!!n||!1,this._instance.persistence&&this._instance.persistence.register({[oA]:this.ht}),this.R=this.vt(),this.startIfEnabledOrStop()}onConfigChange(){this.R=this.vt()}captureException(e){var n,r,i=(n=e==null||(r=e.$exception_list)==null||(r=r[0])==null?void 0:r.type)!==null&&n!==void 0?n:"Exception";this.dt.consumeRateLimit(i)?cf.info("Skipping exception capture because of client rate limiting.",{exception:i}):this._instance.exceptions.sendExceptionEvent(e)}}function EA(t,e,n){try{if(!(e in t))return()=>{};var r=t[e],i=n(r);return Vl(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=i,()=>{t[e]=r}}catch{return()=>{}}}class spe{constructor(e){var n;this._instance=e,this.ct=(be==null||(n=be.location)==null?void 0:n.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(Ge.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ft&&this.ft(),this.ft=void 0,Ge.info("History API monitoring stopped")}monitorHistoryChanges(){var e,n;if(be&&be.history){var r=this;(e=be.history.pushState)!=null&&e.__posthog_wrapped__||EA(be.history,"pushState",(i=>function(s,a,l){i.call(this,s,a,l),r._t("pushState")})),(n=be.history.replaceState)!=null&&n.__posthog_wrapped__||EA(be.history,"replaceState",(i=>function(s,a,l){i.call(this,s,a,l),r._t("replaceState")})),this.yt()}}_t(e){try{var n,r=be==null||(n=be.location)==null?void 0:n.pathname;if(!r)return;r!==this.ct&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.ct=r}catch(i){Ge.error("Error capturing "+e+" pageview",i)}}yt(){if(!this.ft){var e=()=>{this._t("popstate")};Sr(be,"popstate",e),this.ft=()=>{be&&be.removeEventListener("popstate",e)}}}}var QE=or("[SegmentIntegration]");function ape(t,e){var n=t.config.segment;if(!n)return e();(function(r,i){var s=r.config.segment;if(!s)return i();var a=u=>{var d=()=>u.anonymousId()||Fl();r.config.get_device_id=d,u.id()&&(r.register({distinct_id:u.id(),$device_id:d()}),r.persistence.set_property(ho,"identified")),i()},l=s.user();"then"in l&&Vl(l.then)?l.then(a):a(l)})(t,(()=>{n.register((r=>{Promise&&Promise.resolve||QE.warn("This browser does not have Promise support, and can not use the segment integration");var i=(s,a)=>{if(!a)return s;s.event.userId||s.event.anonymousId===r.get_distinct_id()||(QE.info("No userId set, resetting PostHog"),r.reset()),s.event.userId&&s.event.userId!==r.get_distinct_id()&&(QE.info("UserId set, identifying with PostHog"),r.identify(s.event.userId));var l=r.calculateEventProperties(a,s.event.properties);return s.event.properties=Object.assign({},l,s.event.properties),s};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:s=>i(s,s.event.event),page:s=>i(s,"$pageview"),identify:s=>i(s,"$identify"),screen:s=>i(s,"$screen")}})(t)).then((()=>{e()}))}))}var NP="posthog-js";function OP(t,e){var{organization:n,projectId:r,prefix:i,severityAllowList:s=["error"],sendExceptionsToPostHog:a=!0}=e===void 0?{}:e;return l=>{var u,d,f,p,g;if(!(s==="*"||s.includes(l.level))||!t.__loaded)return l;l.tags||(l.tags={});var b=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());l.tags["PostHog Person URL"]=b,t.sessionRecordingStarted()&&(l.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var v=((u=l.exception)==null?void 0:u.values)||[],E=v.map((S=>We({},S,{stacktrace:S.stacktrace?We({},S.stacktrace,{type:"raw",frames:(S.stacktrace.frames||[]).map((C=>We({},C,{platform:"web:javascript"})))}):void 0}))),x={$exception_message:((d=v[0])==null?void 0:d.value)||l.message,$exception_type:(f=v[0])==null?void 0:f.type,$exception_level:l.level,$exception_list:E,$sentry_event_id:l.event_id,$sentry_exception:l.exception,$sentry_exception_message:((p=v[0])==null?void 0:p.value)||l.message,$sentry_exception_type:(g=v[0])==null?void 0:g.type,$sentry_tags:l.tags};return n&&r&&(x.$sentry_url=(i||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+l.event_id),a&&t.exceptions.sendExceptionEvent(x),l}}class ope{constructor(e,n,r,i,s,a){this.name=NP,this.setupOnce=function(l){l(OP(e,{organization:n,projectId:r,prefix:i,severityAllowList:s,sendExceptionsToPostHog:a==null||a}))}}}var lpe=be!=null&&be.location?nb(be.location.hash,"__posthog")||nb(location.hash,"state"):null,_A="_postHogToolbarParams",xA=or("[Toolbar]"),Cl=(function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t})(Cl||{});class upe{constructor(e){this.instance=e}bt(e){ot.ph_toolbar_state=e}wt(){var e;return(e=ot.ph_toolbar_state)!==null&&e!==void 0?e:Cl.UNINITIALIZED}maybeLoadToolbar(e,n,r){if(e===void 0&&(e=void 0),n===void 0&&(n=void 0),r===void 0&&(r=void 0),!be||!Ve)return!1;e=e??be.location,r=r??be.history;try{if(!n){try{be.localStorage.setItem("test","test"),be.localStorage.removeItem("test")}catch{return!1}n=be==null?void 0:be.localStorage}var i,s=lpe||nb(e.hash,"__posthog")||nb(e.hash,"state"),a=s?sA((()=>JSON.parse(atob(decodeURIComponent(s)))))||sA((()=>JSON.parse(decodeURIComponent(s)))):null;return a&&a.action==="ph_authorize"?((i=a).source="url",i&&Object.keys(i).length>0&&(a.desiredHash?e.hash=a.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):((i=JSON.parse(n.getItem(_A)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token)&&(this.loadToolbar(i),!0)}catch{return!1}}xt(e){var n=ot.ph_load_toolbar||ot.ph_load_editor;!nn(n)&&Vl(n)?n(e,this.instance):xA.warn("No toolbar load function found")}loadToolbar(e){var n=!(Ve==null||!Ve.getElementById(hP));if(!be||n)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,i=We({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(be.localStorage.setItem(_A,JSON.stringify(We({},i,{source:void 0}))),this.wt()===Cl.LOADED)this.xt(i);else if(this.wt()===Cl.UNINITIALIZED){var s;this.bt(Cl.LOADING),(s=ot.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this.instance,"toolbar",(a=>{if(a)return xA.error("[Toolbar] Failed to load",a),void this.bt(Cl.UNINITIALIZED);this.bt(Cl.LOADED),this.xt(i)})),Sr(be,"turbolinks:load",(()=>{this.bt(Cl.UNINITIALIZED),this.loadToolbar(i)}))}return!0}Et(e){return this.loadToolbar(e)}maybeLoadEditor(e,n,r){return e===void 0&&(e=void 0),n===void 0&&(n=void 0),r===void 0&&(r=void 0),this.maybeLoadToolbar(e,n,r)}}var cpe=or("[TracingHeaders]");class dpe{constructor(e){this.$t=void 0,this.St=void 0,this.rt=()=>{var n,r;$e(this.$t)&&((n=ot.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),$e(this.St)&&((r=ot.__PosthogExtensions__)==null||(r=r.tracingHeadersPatchFns)==null||r._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}it(e){var n,r;(n=ot.__PosthogExtensions__)!=null&&n.tracingHeadersPatchFns&&e(),(r=ot.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"tracing-headers",(i=>{if(i)return cpe.error("failed to load script",i);e()}))}startIfEnabledOrStop(){var e,n;this._instance.config.__add_tracing_headers?this.it(this.rt):((e=this.$t)==null||e.call(this),(n=this.St)==null||n.call(this),this.$t=void 0,this.St=void 0)}}var dg="https?://(.*)",e0=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],fpe=Jd(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],e0),rp="<masked>",hpe=["li_fat_id"];function MP(t,e,n){if(!Ve)return{};var r,i=e?Jd([],e0,n||[]):[],s=RP(np(Ve.URL,i,rp),t),a=(r={},Nn(hpe,(function(l){var u=ba.q(l);r[l]=u||null})),r);return pr(a,s)}function RP(t,e){var n=fpe.concat(e||[]),r={};return Nn(n,(function(i){var s=tb(t,i);r[i]=s||null})),r}function DP(t){var e=(function(s){return s?s.search(dg+"google.([^/?]*)")===0?"google":s.search(dg+"bing.com")===0?"bing":s.search(dg+"yahoo.com")===0?"yahoo":s.search(dg+"duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",r={};if(!na(e)){r.$search_engine=e;var i=Ve?tb(Ve.referrer,n):"";i.length&&(r.ph_keyword=i)}return r}function TA(){return navigator.language||navigator.userLanguage}function IP(){return(Ve==null?void 0:Ve.referrer)||"$direct"}function LP(t,e){var n=t?Jd([],e0,e||[]):[],r=qi==null?void 0:qi.href.substring(0,1e3);return{r:IP().substring(0,1e3),u:r?np(r,n,rp):void 0}}function PP(t){var e,{r:n,u:r}=t,i={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(e=eb(n))==null?void 0:e.host};if(r){i.$current_url=r;var s=eb(r);i.$host=s==null?void 0:s.host,i.$pathname=s==null?void 0:s.pathname;var a=RP(r);pr(i,a)}if(n){var l=DP(n);pr(i,l)}return i}function BP(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function ppe(){try{return new Date().getTimezoneOffset()}catch{return}}function mpe(t,e){if(!Fi)return{};var n,r,i,s=t?Jd([],e0,e||[]):[],[a,l]=(function(u){for(var d=0;d<eA.length;d++){var[f,p]=eA[d],g=f.exec(u),b=g&&(Vl(p)?p(g,u):p);if(b)return b}return["",""]})(Fi);return pr(m6({$os:a,$os_version:l,$browser:sP(Fi,navigator.vendor),$device:tA(Fi),$device_type:(r=Fi,i=tA(r),i===VL||i===qL||i==="Kobo"||i==="Kindle Fire"||i===iP?wh:i===Ch||i===xd||i===Ah||i===F3?"Console":i===YL?"Wearable":i?Ps:"Desktop"),$timezone:BP(),$timezone_offset:ppe()}),{$current_url:np(qi==null?void 0:qi.href,s,rp),$host:qi==null?void 0:qi.host,$pathname:qi==null?void 0:qi.pathname,$raw_user_agent:Fi.length>1e3?Fi.substring(0,997)+"...":Fi,$browser_version:ahe(Fi,navigator.vendor),$browser_language:TA(),$browser_language_prefix:(n=TA(),typeof n=="string"?n.split("-")[0]:void 0),$screen_height:be==null?void 0:be.screen.height,$screen_width:be==null?void 0:be.screen.width,$viewport_height:be==null?void 0:be.innerHeight,$viewport_width:be==null?void 0:be.innerWidth,$lib:"web",$lib_version:fo.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var El=or("[Web Vitals]"),SA=9e5;class gpe{constructor(e){var n;this.kt=!1,this.P=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Pt=()=>{clearTimeout(this.Tt),this.N.metrics.length!==0&&(this._instance.capture("$web_vitals",this.N.metrics.reduce(((r,i)=>We({},r,{["$web_vitals_"+i.name+"_event"]:We({},i),["$web_vitals_"+i.name+"_value"]:i.value})),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.It=r=>{var i,s=(i=this._instance.sessionManager)==null?void 0:i.checkAndGetSessionAndWindowId(!0);if($e(s))El.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var a=this.Ct();$e(a)||(nn(r==null?void 0:r.name)||nn(r==null?void 0:r.value)?El.error("Invalid metric received",r):this.Rt&&r.value>=this.Rt?El.error("Ignoring metric with value >= "+this.Rt,r):(this.N.url!==a&&(this.Pt(),this.Tt=setTimeout(this.Pt,this.flushToCaptureTimeoutMs)),$e(this.N.url)&&(this.N.url=a),this.N.firstMetricTimestamp=$e(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,r.attribution&&r.attribution.interactionTargetElement&&(r.attribution.interactionTargetElement=void 0),this.N.metrics.push(We({},r,{$current_url:a,$session_id:s.sessionId,$window_id:s.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.Pt()))}},this.rt=()=>{if(!this.P){var r,i,s,a,l=ot.__PosthogExtensions__;$e(l)||$e(l.postHogWebVitalsCallbacks)||({onLCP:r,onCLS:i,onFCP:s,onINP:a}=l.postHogWebVitalsCallbacks),r&&i&&s&&a?(this.allowedMetrics.indexOf("LCP")>-1&&r(this.It.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&i(this.It.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&s(this.It.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&a(this.It.bind(this)),this.P=!0):El.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.kt=!((n=this._instance.persistence)==null||!n.props[uA]),this.startIfEnabled()}get allowedMetrics(){var e,n,r=Dr(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return $e(r)?((n=this._instance.persistence)==null?void 0:n.props[dA])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(Dr(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=Dr(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_attribution:void 0;return e==null||e}get Rt(){var e=Dr(this._instance.config.capture_performance)&&Io(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:SA;return 0<e&&e<=6e4?SA:e}get isEnabled(){var e=qi==null?void 0:qi.protocol;if(e!=="http:"&&e!=="https:")return El.info("Web Vitals are disabled on non-http/https protocols"),!1;var n=Dr(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:Ao(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return Ao(n)?n:this.kt}startIfEnabled(){this.isEnabled&&!this.P&&(El.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var n=Dr(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=Dr(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[uA]:n}),this._instance.persistence.register({[dA]:r})),this.kt=n,this.startIfEnabled()}it(e){var n,r;(n=ot.__PosthogExtensions__)!=null&&n.postHogWebVitalsCallbacks?e():(r=ot.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"web-vitals",(i=>{var s;if(i)El.error("failed to load script",i);else{var a=(s=ot.__PosthogExtensions__)==null?void 0:s.loadWebVitalsCallbacks;a&&a(this.useAttribution),e()}}))}Ct(){var e=be?be.location.href:void 0;if(e){var n=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties,i=n?Jd([],e0,r||[]):[];return np(e,i,rp)}El.error("Could not determine current URL")}}var bpe=or("[Heatmaps]");function wA(t){return Dr(t)&&"clientX"in t&&"clientY"in t&&Io(t.clientX)&&Io(t.clientY)}class vpe{constructor(e){var n;this.kt=!1,this.P=!1,this.Ft=null,this.instance=e,this.kt=!((n=this.instance.persistence)==null||!n.props[$3]),this.rageclicks=new kP(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return Dr(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return $e(this.instance.config.capture_heatmaps)?$e(this.instance.config.enable_heatmaps)?this.kt:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.P)return;bpe.info("starting..."),this.Mt(),this.Ot()}else{var e;clearInterval((e=this.Ft)!==null&&e!==void 0?e:void 0),this.At(),this.getAndClearBuffer()}}onRemoteConfig(e){var n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[$3]:n}),this.kt=n,this.startIfEnabled()}getAndClearBuffer(){var e=this.N;return this.N=void 0,e}Dt(e){this.jt(e.originalEvent,"deadclick")}Ot(){this.Ft&&clearInterval(this.Ft),this.Ft=(function(e){return(e==null?void 0:e.visibilityState)==="visible"})(Ve)?setInterval(this.Lt.bind(this),this.flushIntervalMilliseconds):null}Mt(){be&&Ve&&(this.Nt=this.Lt.bind(this),Sr(be,"beforeunload",this.Nt),this.Ut=e=>this.jt(e||(be==null?void 0:be.event)),Sr(Ve,"click",this.Ut,{capture:!0}),this.zt=e=>this.Ht(e||(be==null?void 0:be.event)),Sr(Ve,"mousemove",this.zt,{capture:!0}),this.Bt=new AP(this.instance,npe,this.Dt.bind(this)),this.Bt.startIfEnabled(),this.qt=this.Ot.bind(this),Sr(Ve,"visibilitychange",this.qt),this.P=!0)}At(){var e;be&&Ve&&(this.Nt&&be.removeEventListener("beforeunload",this.Nt),this.Ut&&Ve.removeEventListener("click",this.Ut,{capture:!0}),this.zt&&Ve.removeEventListener("mousemove",this.zt,{capture:!0}),this.qt&&Ve.removeEventListener("visibilitychange",this.qt),clearTimeout(this.Wt),(e=this.Bt)==null||e.stop(),this.P=!1)}Gt(e,n){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),a=(function(l,u,d){for(var f=l;f&&tv(f)&&!Yl(f,"body");){if(f===d)return!1;if(Ht(u,be==null?void 0:be.getComputedStyle(f).position))return!0;f=yP(f)}return!1})(bP(e),["fixed","sticky"],s);return{x:e.clientX+(a?0:i),y:e.clientY+(a?0:r),target_fixed:a,type:n}}jt(e,n){var r;if(n===void 0&&(n="click"),!fA(e.target)&&wA(e)){var i=this.Gt(e,n);(r=this.rageclicks)!=null&&r.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Vt(We({},i,{type:"rageclick"})),this.Vt(i)}}Ht(e){!fA(e.target)&&wA(e)&&(clearTimeout(this.Wt),this.Wt=setTimeout((()=>{this.Vt(this.Gt(e,"mousemove"))}),500))}Vt(e){if(be){var n=be.location.href,r=this.instance.config.mask_personal_data_properties,i=this.instance.config.custom_personal_data_properties,s=r?Jd([],e0,i||[]):[],a=np(n,s,rp);this.N=this.N||{},this.N[a]||(this.N[a]=[]),this.N[a].push(e)}}Lt(){this.N&&!pd(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class kA{constructor(e){this.Jt=(n,r,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength)&&(Ge.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:i}),this.Kt=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Yt()}Yt(){var e;this.Xt=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.Jt)}destroy(){var e;(e=this.Xt)==null||e.call(this),this.Xt=void 0}doPageView(e,n){var r,i=this.Qt(e,n);return this.Kt={pathname:(r=be==null?void 0:be.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),i}doPageLeave(e){var n;return this.Qt(e,(n=this.Kt)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Kt)==null?void 0:e.pageViewId}}Qt(e,n){var r=this.Kt;if(!r)return{$pageview_id:n};var i={$pageview_id:n,$prev_pageview_id:r.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:a,lastScrollY:l,maxScrollY:u,maxContentHeight:d,lastContentY:f,maxContentY:p}=s;if(!($e(a)||$e(l)||$e(u)||$e(d)||$e(f)||$e(p))){a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),d=Math.ceil(d),f=Math.ceil(f),p=Math.ceil(p);var g=a<=1?1:xa(l/a,0,1,Ge),b=a<=1?1:xa(u/a,0,1,Ge),v=d<=1?1:xa(f/d,0,1,Ge),E=d<=1?1:xa(p/d,0,1,Ge);i=pr(i,{$prev_pageview_last_scroll:l,$prev_pageview_last_scroll_percentage:g,$prev_pageview_max_scroll:u,$prev_pageview_max_scroll_percentage:b,$prev_pageview_last_content:f,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:p,$prev_pageview_max_content_percentage:E})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),i}}var vo=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({}),Bs=Uint8Array,Vi=Uint16Array,zd=Uint32Array,y6=new Bs([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),E6=new Bs([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),CA=new Bs([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),zP=function(t,e){for(var n=new Vi(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];var i=new zd(n[30]);for(r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)i[s]=s-n[r]<<5|r;return[n,i]},UP=zP(y6,2),ype=UP[0],Z3=UP[1];ype[28]=258,Z3[258]=28;for(var AA=zP(E6,0)[1],FP=new Vi(32768),Bn=0;Bn<32768;++Bn){var Mu=(43690&Bn)>>>1|(21845&Bn)<<1;Mu=(61680&(Mu=(52428&Mu)>>>2|(13107&Mu)<<2))>>>4|(3855&Mu)<<4,FP[Bn]=((65280&Mu)>>>8|(255&Mu)<<8)>>>1}var nh=function(t,e,n){for(var r=t.length,i=0,s=new Vi(e);i<r;++i)++s[t[i]-1];var a,l=new Vi(e);for(i=0;i<e;++i)l[i]=l[i-1]+s[i-1]<<1;for(a=new Vi(r),i=0;i<r;++i)a[i]=FP[l[t[i]-1]++]>>>15-t[i];return a},tc=new Bs(288);for(Bn=0;Bn<144;++Bn)tc[Bn]=8;for(Bn=144;Bn<256;++Bn)tc[Bn]=9;for(Bn=256;Bn<280;++Bn)tc[Bn]=7;for(Bn=280;Bn<288;++Bn)tc[Bn]=8;var ib=new Bs(32);for(Bn=0;Bn<32;++Bn)ib[Bn]=5;var Epe=nh(tc,9),_pe=nh(ib,5),HP=function(t){return(t/8>>0)+(7&t&&1)},jP=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof Vi?Vi:t instanceof zd?zd:Bs)(n-e);return r.set(t.subarray(e,n)),r},ao=function(t,e,n){n<<=7&e;var r=e/8>>0;t[r]|=n,t[r+1]|=n>>>8},df=function(t,e,n){n<<=7&e;var r=e/8>>0;t[r]|=n,t[r+1]|=n>>>8,t[r+2]|=n>>>16},ZE=function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var i=n.length,s=n.slice();if(!i)return[new Bs(0),0];if(i==1){var a=new Bs(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort((function(D,R){return D.f-R.f})),n.push({s:-1,f:25001});var l=n[0],u=n[1],d=0,f=1,p=2;for(n[0]={s:-1,f:l.f+u.f,l,r:u};f!=i-1;)l=n[n[d].f<n[p].f?d++:p++],u=n[d!=f&&n[d].f<n[p].f?d++:p++],n[f++]={s:-1,f:l.f+u.f,l,r:u};var g=s[0].s;for(r=1;r<i;++r)s[r].s>g&&(g=s[r].s);var b=new Vi(g+1),v=J3(n[f-1],b,0);if(v>e){r=0;var E=0,x=v-e,S=1<<x;for(s.sort((function(D,R){return b[R.s]-b[D.s]||D.f-R.f}));r<i;++r){var C=s[r].s;if(!(b[C]>e))break;E+=S-(1<<v-b[C]),b[C]=e}for(E>>>=x;E>0;){var O=s[r].s;b[O]<e?E-=1<<e-b[O]++-1:++r}for(;r>=0&&E;--r){var L=s[r].s;b[L]==e&&(--b[L],++E)}v=e}return[new Bs(b),v]},J3=function(t,e,n){return t.s==-1?Math.max(J3(t.l,e,n+1),J3(t.r,e,n+1)):e[t.s]=n},NA=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Vi(++e),r=0,i=t[0],s=1,a=function(u){n[r++]=u},l=1;l<=e;++l)if(t[l]==i&&l!=e)++s;else{if(!i&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(i),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(i);s=1,i=t[l]}return[n.subarray(0,r),e]},ff=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},e_=function(t,e,n){var r=n.length,i=HP(e+2);t[i]=255&r,t[i+1]=r>>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var s=0;s<r;++s)t[i+s+4]=n[s];return 8*(i+4+r)},OA=function(t,e,n,r,i,s,a,l,u,d,f){ao(e,f++,n),++i[256];for(var p=ZE(i,15),g=p[0],b=p[1],v=ZE(s,15),E=v[0],x=v[1],S=NA(g),C=S[0],O=S[1],L=NA(E),D=L[0],R=L[1],F=new Vi(19),G=0;G<C.length;++G)F[31&C[G]]++;for(G=0;G<D.length;++G)F[31&D[G]]++;for(var Z=ZE(F,7),q=Z[0],ie=Z[1],se=19;se>4&&!q[CA[se-1]];--se);var Te,oe,re,X,ee=d+5<<3,ce=ff(i,tc)+ff(s,ib)+a,we=ff(i,g)+ff(s,E)+a+14+3*se+ff(F,q)+(2*F[16]+3*F[17]+7*F[18]);if(ee<=ce&&ee<=we)return e_(e,f,t.subarray(u,u+d));if(ao(e,f,1+(we<ce)),f+=2,we<ce){Te=nh(g,b),oe=g,re=nh(E,x),X=E;var j=nh(q,ie);for(ao(e,f,O-257),ao(e,f+5,R-1),ao(e,f+10,se-4),f+=14,G=0;G<se;++G)ao(e,f+3*G,q[CA[G]]);f+=3*se;for(var H=[C,D],ne=0;ne<2;++ne){var P=H[ne];for(G=0;G<P.length;++G){var Ee=31&P[G];ao(e,f,j[Ee]),f+=q[Ee],Ee>15&&(ao(e,f,P[G]>>>5&127),f+=P[G]>>>12)}}}else Te=Epe,oe=tc,re=_pe,X=ib;for(G=0;G<l;++G)if(r[G]>255){Ee=r[G]>>>18&31,df(e,f,Te[Ee+257]),f+=oe[Ee+257],Ee>7&&(ao(e,f,r[G]>>>23&31),f+=y6[Ee]);var Fe=31&r[G];df(e,f,re[Fe]),f+=X[Fe],Fe>3&&(df(e,f,r[G]>>>5&8191),f+=E6[Fe])}else df(e,f,Te[r[G]]),f+=oe[r[G]];return df(e,f,Te[256]),f+oe[256]},xpe=new zd([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Tpe=(function(){for(var t=new zd(256),e=0;e<256;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),Spe=function(t,e,n,r,i){return(function(s,a,l,u,d,f){var p=s.length,g=new Bs(u+p+5*(1+Math.floor(p/7e3))+d),b=g.subarray(u,g.length-d),v=0;if(!a||p<8)for(var E=0;E<=p;E+=65535){var x=E+65535;x<p?v=e_(b,v,s.subarray(E,x)):(b[E]=f,v=e_(b,v,s.subarray(E,p)))}else{for(var S=xpe[a-1],C=S>>>13,O=8191&S,L=(1<<l)-1,D=new Vi(32768),R=new Vi(L+1),F=Math.ceil(l/3),G=2*F,Z=function($t){return(s[$t]^s[$t+1]<<F^s[$t+2]<<G)&L},q=new zd(25e3),ie=new Vi(288),se=new Vi(32),Te=0,oe=0,re=(E=0,0),X=0,ee=0;E<p;++E){var ce=Z(E),we=32767&E,j=R[ce];if(D[we]=j,R[ce]=we,X<=E){var H=p-E;if((Te>7e3||re>24576)&&H>423){v=OA(s,b,0,q,ie,se,oe,re,ee,E-ee,v),re=Te=oe=0,ee=E;for(var ne=0;ne<286;++ne)ie[ne]=0;for(ne=0;ne<30;++ne)se[ne]=0}var P=2,Ee=0,Fe=O,He=we-j&32767;if(H>2&&ce==Z(E-He))for(var it=Math.min(C,H)-1,kt=Math.min(32767,E),Tt=Math.min(258,H);He<=kt&&--Fe&&we!=j;){if(s[E+P]==s[E+P-He]){for(var St=0;St<Tt&&s[E+St]==s[E+St-He];++St);if(St>P){if(P=St,Ee=He,St>it)break;var Jn=Math.min(He,St-2),Un=0;for(ne=0;ne<Jn;++ne){var At=E-He+ne+32768&32767,gt=At-D[At]+32768&32767;gt>Un&&(Un=gt,j=At)}}}He+=(we=j)-(j=D[we])+32768&32767}if(Ee){q[re++]=268435456|Z3[P]<<18|AA[Ee];var Yt=31&Z3[P],Qe=31&AA[Ee];oe+=y6[Yt]+E6[Qe],++ie[257+Yt],++se[Qe],X=E+P,++Te}else q[re++]=s[E],++ie[s[E]]}}v=OA(s,b,f,q,ie,se,oe,re,ee,E-ee,v)}return jP(g,0,u+HP(v)+d)})(t,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,n,r,!0)},JE=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function wpe(t,e){e===void 0&&(e={});var n=(function(){var l=4294967295;return{p:function(u){for(var d=l,f=0;f<u.length;++f)d=Tpe[255&d^u[f]]^d>>>8;l=d},d:function(){return 4294967295^l}}})(),r=t.length;n.p(t);var i,s=Spe(t,e,10+((i=e).filename&&i.filename.length+1||0),8),a=s.length;return(function(l,u){var d=u.filename;if(l[0]=31,l[1]=139,l[2]=8,l[8]=u.level<2?4:u.level==9?2:0,l[9]=3,u.mtime!=0&&JE(l,4,Math.floor(new Date(u.mtime||Date.now())/1e3)),d){l[3]=8;for(var f=0;f<=d.length;++f)l[f+10]=d.charCodeAt(f)}})(s,e),JE(s,a-8,n.d()),JE(s,a-4,r),s}var kpe=function(t){var e,n,r,i,s="";for(e=n=0,r=(t=(t+"").replace(/\r\n/g,`
`).replace(/\r/g,`
`)).length,i=0;i<r;i++){var a=t.charCodeAt(i),l=null;a<128?n++:l=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),na(l)||(n>e&&(s+=t.substring(e,n)),s+=l,e=n=i+1)}return n>e&&(s+=t.substring(e,t.length)),s},Cpe=!!L3||!!I3,MA="text/plain",sb=function(t,e,n){var r;n===void 0&&(n=!0);var[i,s]=t.split("?"),a=We({},e),l=(r=s==null?void 0:s.split("&").map((d=>{var f,[p,g]=d.split("="),b=n&&(f=a[p])!==null&&f!==void 0?f:g;return delete a[p],p+"="+b})))!==null&&r!==void 0?r:[],u=$he(a);return u&&l.push(u),i+"?"+l.join("&")},Of=(t,e)=>JSON.stringify(t,((n,r)=>typeof r=="bigint"?r.toString():r),e),e4=t=>{var{data:e,compression:n}=t;if(e){if(n===vo.GZipJS){var r=wpe((function(u,d){var f=u.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(u);for(var p=new Bs(u.length+(u.length>>>1)),g=0,b=function(S){p[g++]=S},v=0;v<f;++v){if(g+5>p.length){var E=new Bs(g+8+(f-v<<1));E.set(p),p=E}var x=u.charCodeAt(v);x<128||d?b(x):x<2048?(b(192|x>>>6),b(128|63&x)):x>55295&&x<57344?(b(240|(x=65536+(1047552&x)|1023&u.charCodeAt(++v))>>>18),b(128|x>>>12&63),b(128|x>>>6&63),b(128|63&x)):(b(224|x>>>12),b(128|x>>>6&63),b(128|63&x))}return jP(p,0,g)})(Of(e)),{mtime:0}),i=new Blob([r],{type:MA});return{contentType:MA,body:i,estimatedSize:i.size}}if(n===vo.Base64){var s=(function(u){var d,f,p,g,b,v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",E=0,x=0,S="",C=[];if(!u)return u;u=kpe(u);do d=(b=u.charCodeAt(E++)<<16|u.charCodeAt(E++)<<8|u.charCodeAt(E++))>>18&63,f=b>>12&63,p=b>>6&63,g=63&b,C[x++]=v.charAt(d)+v.charAt(f)+v.charAt(p)+v.charAt(g);while(E<u.length);switch(S=C.join(""),u.length%3){case 1:S=S.slice(0,-2)+"==";break;case 2:S=S.slice(0,-1)+"="}return S})(Of(e)),a=(u=>"data="+encodeURIComponent(typeof u=="string"?u:Of(u)))(s);return{contentType:"application/x-www-form-urlencoded",body:a,estimatedSize:new Blob([a]).size}}var l=Of(e);return{contentType:"application/json",body:l,estimatedSize:new Blob([l]).size}}},Rg=[];I3&&Rg.push({transport:"fetch",method:t=>{var e,n,{contentType:r,body:i,estimatedSize:s}=(e=e4(t))!==null&&e!==void 0?e:{},a=new Headers;Nn(t.headers,(function(f,p){a.append(p,f)})),r&&a.append("Content-Type",r);var l=t.url,u=null;if(K7){var d=new K7;u={signal:d.signal,timeout:setTimeout((()=>d.abort()),t.timeout)}}I3(l,We({method:(t==null?void 0:t.method)||"GET",headers:a,keepalive:t.method==="POST"&&(s||0)<52428.8,body:i,signal:(n=u)==null?void 0:n.signal},t.fetchOptions)).then((f=>f.text().then((p=>{var g={statusCode:f.status,text:p};if(f.status===200)try{g.json=JSON.parse(p)}catch(b){Ge.error(b)}t.callback==null||t.callback(g)})))).catch((f=>{Ge.error(f),t.callback==null||t.callback({statusCode:0,text:f})})).finally((()=>u?clearTimeout(u.timeout):null))}}),L3&&Rg.push({transport:"XHR",method:t=>{var e,n=new L3;n.open(t.method||"GET",t.url,!0);var{contentType:r,body:i}=(e=e4(t))!==null&&e!==void 0?e:{};Nn(t.headers,(function(s,a){n.setRequestHeader(a,s)})),r&&n.setRequestHeader("Content-Type",r),t.timeout&&(n.timeout=t.timeout),t.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(n.readyState===4){var s={statusCode:n.status,text:n.responseText};if(n.status===200)try{s.json=JSON.parse(n.responseText)}catch{}t.callback==null||t.callback(s)}},n.send(i)}}),us!=null&&us.sendBeacon&&Rg.push({transport:"sendBeacon",method:t=>{var e=sb(t.url,{beacon:"1"});try{var n,{contentType:r,body:i}=(n=e4(t))!==null&&n!==void 0?n:{},s=typeof i=="string"?new Blob([i],{type:r}):i;us.sendBeacon(e,s)}catch{}}});var ab=function(t,e){if(!(function(n){try{new RegExp(n)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function RA(t,e,n){return Of({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var $P={exact:(t,e)=>e.some((n=>t.some((r=>n===r)))),is_not:(t,e)=>e.every((n=>t.every((r=>n!==r)))),regex:(t,e)=>e.some((n=>t.some((r=>ab(n,r))))),not_regex:(t,e)=>e.every((n=>t.every((r=>!ab(n,r))))),icontains:(t,e)=>e.map(fg).some((n=>t.map(fg).some((r=>n.includes(r))))),not_icontains:(t,e)=>e.map(fg).every((n=>t.map(fg).every((r=>!n.includes(r))))),gt:(t,e)=>e.some((n=>{var r=parseFloat(n);return!isNaN(r)&&t.some((i=>r>parseFloat(i)))})),lt:(t,e)=>e.some((n=>{var r=parseFloat(n);return!isNaN(r)&&t.some((i=>r<parseFloat(i)))}))},fg=t=>t.toLowerCase();function qP(t,e){return!t||Object.entries(t).every((n=>{var[r,i]=n,s=e==null?void 0:e[r];if($e(s)||na(s))return!1;var a=[String(s)],l=$P[i.operator];return!!l&&l(i.values,a)}))}var t4=or("[Error tracking]");class Ape{constructor(e){var n,r;this.Zt=[],this.ti=new uhe([new vhe,new Che,new Ehe,new yhe,new whe,new She,new xhe,new khe],bhe()),this._instance=e,this.Zt=(n=(r=this._instance.persistence)==null?void 0:r.get_property(q3))!==null&&n!==void 0?n:[]}onRemoteConfig(e){var n,r,i,s=(n=(r=e.errorTracking)==null?void 0:r.suppressionRules)!==null&&n!==void 0?n:[],a=(i=e.errorTracking)==null?void 0:i.captureExtensionExceptions;this.Zt=s,this._instance.persistence&&this._instance.persistence.register({[q3]:this.Zt,[lA]:a})}get ii(){var e,n=!!this._instance.get_property(lA),r=this._instance.config.error_tracking.captureExtensionExceptions;return(e=r??n)!==null&&e!==void 0&&e}buildProperties(e,n){return this.ti.buildFromUnknown(e,{syntheticException:n==null?void 0:n.syntheticException,mechanism:{handled:n==null?void 0:n.handled}})}sendExceptionEvent(e){var n=e.$exception_list;if(this.ei(n)){if(this.ri(n))return void t4.info("Skipping exception capture because a suppression rule matched");if(!this.ii&&this.si(n))return void t4.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ni(n))return void t4.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}ri(e){if(e.length===0)return!1;var n=e.reduce(((r,i)=>{var{type:s,value:a}=i;return Ir(s)&&s.length>0&&r.$exception_types.push(s),Ir(a)&&a.length>0&&r.$exception_values.push(a),r}),{$exception_types:[],$exception_values:[]});return this.Zt.some((r=>{var i=r.values.map((s=>{var a,l=$P[s.operator],u=rn(s.value)?s.value:[s.value],d=(a=n[s.key])!==null&&a!==void 0?a:[];return u.length>0&&l(u,d)}));return r.type==="OR"?i.some(Boolean):i.every(Boolean)}))}si(e){return e.flatMap((n=>{var r,i;return(r=(i=n.stacktrace)==null?void 0:i.frames)!==null&&r!==void 0?r:[]})).some((n=>n.filename&&n.filename.startsWith("chrome-extension://")))}ni(e){if(e.length>0){var n,r,i,s,a=(n=(r=e[0].stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[],l=a[a.length-1];return(i=l==null||(s=l.filename)==null?void 0:s.includes("posthog.com/static"))!==null&&i!==void 0&&i}return!1}ei(e){return!nn(e)&&rn(e)}}var Cs=or("[FeatureFlags]"),hf=or("[FeatureFlags]",{debugEnabled:!0}),n4="$active_feature_flags",Jc="$override_feature_flags",DA="$feature_flag_payloads",pf="$override_feature_flag_payloads",IA="$feature_flag_request_id",LA="$feature_flag_evaluated_at",PA=t=>{var e={};for(var[n,r]of Mg(t||{}))r&&(e[n]=r);return e},Npe=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((n=>{var r;return[n,(r=e[n].variant)!==null&&r!==void 0?r:e[n].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((n=>e[n].enabled)).filter((n=>{var r;return(r=e[n].metadata)==null?void 0:r.payload})).map((n=>{var r;return[n,(r=e[n].metadata)==null?void 0:r.payload]})))):Cs.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},Ope=(function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t})({});class Mpe{constructor(e){this.oi=!1,this.ai=!1,this.li=!1,this.ui=!1,this.hi=!1,this.di=!1,this.vi=!1,this.ci=!1,this._instance=e,this.featureFlagEventHandlers=[]}fi(){var e,n=(e=this._instance.config.evaluation_contexts)!==null&&e!==void 0?e:this._instance.config.evaluation_environments;return!this._instance.config.evaluation_environments||this._instance.config.evaluation_contexts||this.ci||(Cs.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.ci=!0),n!=null&&n.length?n.filter((r=>{var i=r&&typeof r=="string"&&r.trim().length>0;return i||Cs.error("Invalid evaluation context found:",r,"Expected non-empty string"),i})):[]}pi(){return this.fi().length>0}flags(){if(this._instance.config.__preview_remote_config)this.di=!0;else{var e=!this.gi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.mi({disableFlags:e})}}get hasLoadedFlags(){return this.ai}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(V3),n=this._instance.get_property(Jc),r=this._instance.get_property(pf);if(!r&&!n)return e||{};var i=pr({},e||{}),s=[...new Set([...Object.keys(r||{}),...Object.keys(n||{})])];for(var a of s){var l,u,d=i[a],f=n==null?void 0:n[a],p=$e(f)?(l=d==null?void 0:d.enabled)!==null&&l!==void 0&&l:!!f,g=$e(f)?d.variant:typeof f=="string"?f:void 0,b=r==null?void 0:r[a],v=We({},d,{enabled:p,variant:p?g??(d==null?void 0:d.variant):void 0});p!==(d==null?void 0:d.enabled)&&(v.original_enabled=d==null?void 0:d.enabled),g!==(d==null?void 0:d.variant)&&(v.original_variant=d==null?void 0:d.variant),b&&(v.metadata=We({},d==null?void 0:d.metadata,{payload:b,original_payload:d==null||(u=d.metadata)==null?void 0:u.payload})),i[a]=v}return this.oi||(Cs.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:r,finalDetails:i}),this.oi=!0),i}getFlagVariants(){var e=this._instance.get_property(md),n=this._instance.get_property(Jc);if(!n)return e||{};for(var r=pr({},e),i=Object.keys(n),s=0;s<i.length;s++)r[i[s]]=n[i[s]];return this.oi||(Cs.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:n,finalFlags:r}),this.oi=!0),r}getFlagPayloads(){var e=this._instance.get_property(DA),n=this._instance.get_property(pf);if(!n)return e||{};for(var r=pr({},e||{}),i=Object.keys(n),s=0;s<i.length;s++)r[i[s]]=n[i[s]];return this.oi||(Cs.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:n,finalPayloads:r}),this.oi=!0),r}reloadFeatureFlags(){this.ui||this._instance.config.advanced_disable_feature_flags||this.gi||(this.gi=setTimeout((()=>{this.mi()}),5))}yi(){clearTimeout(this.gi),this.gi=void 0}ensureFlagsLoaded(){this.ai||this.li||this.gi||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.ui=e}mi(e){var n;if(this.yi(),!this._instance.O())if(this.li)this.hi=!0;else{var r=this._instance.config.token,i=this._instance.get_property("$device_id"),s={token:r,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:We({},((n=this._instance.persistence)==null?void 0:n.get_initial_props())||{},this._instance.get_property(Nf)||{}),group_properties:this._instance.get_property(Iu)};na(i)||$e(i)||(s.$device_id=i),(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.pi()&&(s.evaluation_contexts=this.fi());var a=this._instance.config.__preview_remote_config,l=a?"/flags/?v=2":"/flags/?v=2&config=true",u=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",d=this._instance.requestRouter.endpointFor("flags",l+u);a&&(s.timezone=BP()),this.li=!0,this._instance._send_request({method:"POST",url:d,data:s,compression:this._instance.config.disable_compression?void 0:vo.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:f=>{var p,g,b=!0;if(f.statusCode===200&&(this.hi||(this.$anon_distinct_id=void 0),b=!1),this.li=!1,this.di||(this.di=!0,this._instance.bi((g=f.json)!==null&&g!==void 0?g:{})),!s.disable_flags||this.hi)if(this.vi=!b,f.json&&(p=f.json.quotaLimited)!=null&&p.includes(Ope.FeatureFlags))Cs.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset.  Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var v;s.disable_flags||this.receivedFeatureFlags((v=f.json)!==null&&v!==void 0?v:{},b),this.hi&&(this.hi=!1,this.mi())}}})}}getFeatureFlag(e,n){if(n===void 0&&(n={}),this.ai||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants()[e],i=""+r,s=this._instance.get_property(IA)||void 0,a=this._instance.get_property(LA)||void 0,l=this._instance.get_property(X1)||{};if((n.send_event||!("send_event"in n))&&(!(e in l)||!l[e].includes(i))){var u,d,f,p,g,b,v,E,x;rn(l[e])?l[e].push(i):l[e]=[i],(u=this._instance.persistence)==null||u.register({[X1]:l});var S=this.getFeatureFlagDetails(e),C={$feature_flag:e,$feature_flag_response:r,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:s,$feature_flag_evaluated_at:a,$feature_flag_bootstrapped_response:((d=this._instance.config.bootstrap)==null||(d=d.featureFlags)==null?void 0:d[e])||null,$feature_flag_bootstrapped_payload:((f=this._instance.config.bootstrap)==null||(f=f.featureFlagPayloads)==null?void 0:f[e])||null,$used_bootstrap_value:!this.vi};$e(S==null||(p=S.metadata)==null?void 0:p.version)||(C.$feature_flag_version=S.metadata.version);var O,L=(g=S==null||(b=S.reason)==null?void 0:b.description)!==null&&g!==void 0?g:S==null||(v=S.reason)==null?void 0:v.code;L&&(C.$feature_flag_reason=L),S!=null&&(E=S.metadata)!=null&&E.id&&(C.$feature_flag_id=S.metadata.id),$e(S==null?void 0:S.original_variant)&&$e(S==null?void 0:S.original_enabled)||(C.$feature_flag_original_response=$e(S.original_variant)?S.original_enabled:S.original_variant),S!=null&&(x=S.metadata)!=null&&x.original_payload&&(C.$feature_flag_original_payload=S==null||(O=S.metadata)==null?void 0:O.original_payload),this._instance.capture("$feature_flag_called",C)}return r}Cs.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,n){var r=this._instance.config.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this.pi()&&(i.evaluation_contexts=this.fi()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:i,compression:this._instance.config.disable_compression?void 0:vo.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:s=>{var a,l=(a=s.json)==null?void 0:a.featureFlagPayloads;n((l==null?void 0:l[e])||void 0)}})}isFeatureEnabled(e,n){if(n===void 0&&(n={}),this.ai||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(e,n);return $e(r)?void 0:!!r}Cs.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((n=>n!==e))}receivedFeatureFlags(e,n){if(this._instance.persistence){this.ai=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads(),s=this.getFlagsWithDetails();(function(a,l,u,d,f){u===void 0&&(u={}),d===void 0&&(d={}),f===void 0&&(f={});var p=Npe(a),g=p.flags,b=p.featureFlags,v=p.featureFlagPayloads;if(b){var E=a.requestId,x=a.evaluatedAt;if(rn(b)){Cs.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var S={};if(b)for(var C=0;C<b.length;C++)S[b[C]]=!0;l&&l.register({[n4]:b,[md]:S})}else{var O=b,L=v,D=g;a.errorsWhileComputingFlags&&(O=We({},u,O),L=We({},d,L),D=We({},f,D)),l&&l.register(We({[n4]:Object.keys(PA(O)),[md]:O||{},[DA]:L||{},[V3]:D||{}},E?{[IA]:E}:{},x?{[LA]:x}:{}))}}})(e,this._instance.persistence,r,i,s),this.wi(n)}}override(e,n){n===void 0&&(n=!1),Cs.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:n})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return Cs.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(Jc),this._instance.persistence.unregister(pf),this.wi(),hf.info("All overrides cleared");if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var n,r=e;if(this.oi=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this._instance.persistence.unregister(Jc),hf.info("Flag overrides cleared");else if(r.flags){if(rn(r.flags)){for(var i={},s=0;s<r.flags.length;s++)i[r.flags[s]]=!0;this._instance.persistence.register({[Jc]:i})}else this._instance.persistence.register({[Jc]:r.flags});hf.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this._instance.persistence.unregister(pf),hf.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[pf]:r.payloads}),hf.info("Payload overrides set",{payloads:r.payloads}))),void this.wi()}this.wi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ai){var{flags:n,flagVariants:r}=this.xi();e(n,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,n,r){var i,s=(this._instance.get_property(Af)||[]).find((d=>d.flagKey===e)),a={["$feature_enrollment/"+e]:n},l={$feature_flag:e,$feature_enrollment:n,$set:a};s&&(l.$early_access_feature_name=s.name),r&&(l.$feature_enrollment_stage=r),this._instance.capture("$feature_enrollment_update",l),this.setPersonPropertiesForFlags(a,!1);var u=We({},this.getFlagVariants(),{[e]:n});(i=this._instance.persistence)==null||i.register({[n4]:Object.keys(PA(u)),[md]:u}),this.wi()}getEarlyAccessFeatures(e,n,r){n===void 0&&(n=!1);var i=this._instance.get_property(Af),s=r?"&"+r.map((a=>"stage="+a)).join("&"):"";if(i&&!n)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+s),method:"GET",callback:a=>{var l,u;if(a.json){var d=a.json.earlyAccessFeatures;return(l=this._instance.persistence)==null||l.unregister(Af),(u=this._instance.persistence)==null||u.register({[Af]:d}),e(d)}}})}xi(){var e=this.getFlags(),n=this.getFlagVariants();return{flags:e.filter((r=>n[r])),flagVariants:Object.keys(n).filter((r=>n[r])).reduce(((r,i)=>(r[i]=n[i],r)),{})}}wi(e){var{flags:n,flagVariants:r}=this.xi();this.featureFlagEventHandlers.forEach((i=>i(n,r,{errorsLoading:e})))}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0);var r=this._instance.get_property(Nf)||{};this._instance.register({[Nf]:We({},r,e)}),n&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Nf)}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0);var r=this._instance.get_property(Iu)||{};Object.keys(r).length!==0&&Object.keys(r).forEach((i=>{r[i]=We({},r[i],e[i]),delete e[i]})),this._instance.register({[Iu]:We({},r,e)}),n&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var n=this._instance.get_property(Iu)||{};this._instance.register({[Iu]:We({},n,{[e]:{}})})}else this._instance.unregister(Iu)}reset(){this.ai=!1,this.li=!1,this.ui=!1,this.hi=!1,this.di=!1,this.vi=!1,this.$anon_distinct_id=void 0,this.yi(),this.oi=!1}}var Rpe=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class r4{constructor(e,n){this.R=e,this.props={},this.Ei=!1,this.$i=(r=>{var i="";return r.token&&(i=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+i+"_posthog"})(e),this.Y=this.Si(e),this.load(),e.debug&&Ge.info("Persistence loaded",e.persistence,We({},this.props)),this.update_config(e,e,n),this.save()}isDisabled(){return!!this.ki}Si(e){Rpe.indexOf(e.persistence.toLowerCase())===-1&&(Ge.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n=(function(i){i===void 0&&(i=[]);var s=[...Jhe,...i];return We({},Xn,{W:function(a){try{var l={};try{l=ba.W(a)||{}}catch{}var u=pr(l,JSON.parse(Xn.q(a)||"{}"));return Xn.G(a,u),u}catch{}return null},G:function(a,l,u,d,f,p){try{Xn.G(a,l,void 0,void 0,p);var g={};s.forEach((b=>{l[b]&&(g[b]=l[b])})),Object.keys(g).length&&ba.G(a,g,u,d,f,p)}catch(b){Xn.B(b)}},V:function(a,l){try{be==null||be.localStorage.removeItem(a),ba.V(a,l)}catch(u){Xn.B(u)}}})})(e.cookie_persisted_properties||[]),r=e.persistence.toLowerCase();return r==="localstorage"&&Xn.H()?Xn:r==="localstorage+cookie"&&n.H()?n:r==="sessionstorage"&&Xr.H()?Xr:r==="memory"?epe:r==="cookie"?ba:n.H()?n:ba}properties(){var e={};return Nn(this.props,(function(n,r){if(r===md&&Dr(n))for(var i=Object.keys(n),s=0;s<i.length;s++)e["$feature/"+i[s]]=n[i[s]];else l=r,u=!1,(na(a=Dhe)?u:W7&&a.indexOf===W7?a.indexOf(l)!=-1:(Nn(a,(function(d){if(u||(u=d===l))return W1})),u))||(e[r]=n);var a,l,u})),e}load(){if(!this.ki){var e=this.Y.W(this.$i);e&&(this.props=pr({},e))}}save(){this.ki||this.Y.G(this.$i,this.props,this.Pi,this.Ti,this.Ii,this.R.debug)}remove(){this.Y.V(this.$i,!1),this.Y.V(this.$i,!0)}clear(){this.remove(),this.props={}}register_once(e,n,r){if(Dr(e)){$e(n)&&(n="None"),this.Pi=$e(r)?this.Ci:r;var i=!1;if(Nn(e,((s,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==n||(this.props[a]=s,i=!0)})),i)return this.save(),!0}return!1}register(e,n){if(Dr(e)){this.Pi=$e(n)?this.Ci:n;var r=!1;if(Nn(e,((i,s)=>{e.hasOwnProperty(s)&&this.props[s]!==i&&(this.props[s]=i,r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.Ei){var e=MP(this.R.custom_campaign_params,this.R.mask_personal_data_properties,this.R.custom_personal_data_properties);pd(m6(e))||this.register(e),this.Ei=!0}}update_search_keyword(){var e;this.register((e=Ve==null?void 0:Ve.referrer)?DP(e):{})}update_referrer_info(){var e;this.register_once({$referrer:IP(),$referring_domain:Ve!=null&&Ve.referrer&&((e=eb(Ve.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[K3]||this.props[X3]||this.register_once({[Q1]:LP(this.R.mask_personal_data_properties,this.R.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};Nn([X3,K3],(a=>{var l=this.props[a];l&&Nn(l,(function(u,d){e["$initial_"+P3(d)]=u}))}));var n,r,i=this.props[Q1];if(i){var s=(n=PP(i),r={},Nn(n,(function(a,l){r["$initial_"+P3(l)]=a})),r);pr(e,s)}return e}safe_merge(e){return Nn(this.props,(function(n,r){r in e||(e[r]=n)})),e}update_config(e,n,r){if(this.Ci=this.Pi=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==n.persistence||!((a,l)=>{if(a.length!==l.length)return!1;var u=[...a].sort(),d=[...l].sort();return u.every(((f,p)=>f===d[p]))})(e.cookie_persisted_properties||[],n.cookie_persisted_properties||[])){var i=this.Si(e),s=this.props;this.clear(),this.Y=i,this.props=s,this.save()}}set_disabled(e){this.ki=e,this.ki?this.remove():this.save()}set_cross_subdomain(e){e!==this.Ti&&(this.Ti=e,this.remove(),this.save())}set_secure(e){e!==this.Ii&&(this.Ii=e,this.remove(),this.save())}set_event_timer(e,n){var r=this.props[Cf]||{};r[e]=n,this.props[Cf]=r,this.save()}remove_event_timer(e){var n=(this.props[Cf]||{})[e];return $e(n)||(delete this.props[Cf][e],this.save()),n}get_property(e){return this.props[e]}set_property(e,n){this.props[e]=n,this.save()}}var BA=or("[Product Tours]"),i4="ph_product_tours";class Dpe{constructor(e){this.Ri=null,this.Fi=null,this._instance=e}onRemoteConfig(e){this._instance.persistence&&this._instance.persistence.register({[cA]:!(e==null||!e.productTours)}),this.loadIfEnabled()}loadIfEnabled(){var e,n;this.Ri||(e=this._instance).config.disable_product_tours||(n=e.persistence)==null||!n.get_property(cA)||this.it((()=>this.Mi()))}it(e){var n,r;(n=ot.__PosthogExtensions__)!=null&&n.generateProductTours?e():(r=ot.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"product-tours",(i=>{i?BA.error("Could not load product tours script",i):e()}))}Mi(){var e;!this.Ri&&(e=ot.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.Ri=ot.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,n){if(n===void 0&&(n=!1),!rn(this.Fi)||n){var r=this._instance.persistence;if(r){var i=r.props[i4];if(rn(i)&&!n)return this.Fi=i,void e(i,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:s=>{var a=s.statusCode;if(a!==200||!s.json){var l="Product Tours API could not be loaded, status: "+a;return BA.error(l),void e([],{isLoaded:!1,error:l})}var u=rn(s.json.product_tours)?s.json.product_tours:[];this.Fi=u,r&&r.register({[i4]:u}),e(u,{isLoaded:!0})}})}else e(this.Fi,{isLoaded:!0})}getActiveProductTours(e){nn(this.Ri)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Ri.getActiveProductTours(e)}showProductTour(e){var n;(n=this.Ri)==null||n.showTourById(e)}previewTour(e){this.Ri?this.Ri.previewTour(e):this.it((()=>{var n;this.Mi(),(n=this.Ri)==null||n.previewTour(e)}))}dismissProductTour(){var e;(e=this.Ri)==null||e.dismissTour("user_clicked_skip")}nextStep(){var e;(e=this.Ri)==null||e.nextStep()}previousStep(){var e;(e=this.Ri)==null||e.previousStep()}clearCache(){var e;this.Fi=null,(e=this._instance.persistence)==null||e.unregister(i4)}resetTour(e){var n;(n=this.Ri)==null||n.resetTour(e)}resetAllTours(){var e;(e=this.Ri)==null||e.resetAllTours()}cancelPendingTour(e){var n;(n=this.Ri)==null||n.cancelPendingTour(e)}}var mf=(function(t){return t.Activation="events",t.Cancellation="cancelEvents",t})({});(function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t})({});(function(t){return t.TopLeft="top_left",t.TopRight="top_right",t.TopCenter="top_center",t.MiddleLeft="middle_left",t.MiddleRight="middle_right",t.MiddleCenter="middle_center",t.Left="left",t.Center="center",t.Right="right",t.NextToTrigger="next_to_trigger",t})({});(function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t})({});var s4=(function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t})({});(function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t})({});(function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t})({});(function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t})({});var Mf=(function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t.ABANDONED="survey abandoned",t})({}),a4=(function(t){return t.SURVEY_ID="$survey_id",t.SURVEY_NAME="$survey_name",t.SURVEY_RESPONSE="$survey_response",t.SURVEY_ITERATION="$survey_iteration",t.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",t.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",t.SURVEY_SUBMISSION_ID="$survey_submission_id",t.SURVEY_QUESTIONS="$survey_questions",t.SURVEY_COMPLETED="$survey_completed",t.PRODUCT_TOUR_ID="$product_tour_id",t.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",t})({}),t_=(function(t){return t.Popover="popover",t.Inline="inline",t})({}),_n=or("[Surveys]"),VP="seenSurvey_",Ipe=(t,e)=>{var n="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(n="$survey_"+e+"/"+t.id+"/"+t.current_iteration),n},zA=t=>((e,n)=>{var r=""+e+n.id;return n.current_iteration&&n.current_iteration>0&&(r=""+e+n.id+"_"+n.current_iteration),r})(VP,t),Lpe=[s4.Popover,s4.Widget,s4.API],Ppe={ignoreConditions:!1,ignoreDelay:!1,displayType:t_.Popover};class _6{constructor(){this.Oi={},this.Oi={}}on(e,n){return this.Oi[e]||(this.Oi[e]=[]),this.Oi[e].push(n),()=>{this.Oi[e]=this.Oi[e].filter((r=>r!==n))}}emit(e,n){for(var r of this.Oi[e]||[])r(n);for(var i of this.Oi["*"]||[])i(e,n)}}function ed(t,e,n){if(nn(t))return!1;switch(n){case"exact":return t===e;case"contains":var r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}class Bpe{constructor(e){this.Ai=new _6,this.Di=(n,r)=>this.ji(n,r)&&this.Li(n,r)&&this.Ni(n,r)&&this.Ui(n,r),this.ji=(n,r)=>r==null||!r.event||(n==null?void 0:n.event)===(r==null?void 0:r.event),this._instance=e,this.zi=new Set,this.Hi=new Set}init(){var e;if(!$e((e=this._instance)==null?void 0:e._addCaptureHook)){var n;(n=this._instance)==null||n._addCaptureHook(((r,i)=>{this.on(r,i)}))}}register(e){var n,r;if(!$e((n=this._instance)==null?void 0:n._addCaptureHook)&&(e.forEach((a=>{var l,u;(l=this.Hi)==null||l.add(a),(u=a.steps)==null||u.forEach((d=>{var f;(f=this.zi)==null||f.add((d==null?void 0:d.event)||"")}))})),(r=this._instance)!=null&&r.autocapture)){var i,s=new Set;e.forEach((a=>{var l;(l=a.steps)==null||l.forEach((u=>{u!=null&&u.selector&&s.add(u==null?void 0:u.selector)}))})),(i=this._instance)==null||i.autocapture.setElementSelectors(s)}}on(e,n){var r;n!=null&&e.length!=0&&(this.zi.has(e)||this.zi.has(n==null?void 0:n.event))&&this.Hi&&((r=this.Hi)==null?void 0:r.size)>0&&this.Hi.forEach((i=>{this.Bi(n,i)&&this.Ai.emit("actionCaptured",i.name)}))}qi(e){this.onAction("actionCaptured",(n=>e(n)))}Bi(e,n){if((n==null?void 0:n.steps)==null)return!1;for(var r of n.steps)if(this.Di(e,r))return!0;return!1}onAction(e,n){return this.Ai.on(e,n)}Li(e,n){if(n!=null&&n.url){var r,i=e==null||(r=e.properties)==null?void 0:r.$current_url;if(!i||typeof i!="string"||!ed(i,n.url,n.url_matching||"contains"))return!1}return!0}Ni(e,n){return!!this.Wi(e,n)&&!!this.Gi(e,n)&&!!this.Vi(e,n)}Wi(e,n){var r;if(n==null||!n.href)return!0;var i=this.Ji(e);if(i.length>0)return i.some((l=>ed(l.href,n.href,n.href_matching||"exact")));var s,a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!a&&ed((s=a.match(/(?::|")href="(.*?)"/))?s[1]:"",n.href,n.href_matching||"exact")}Gi(e,n){var r;if(n==null||!n.text)return!0;var i=this.Ji(e);if(i.length>0)return i.some((d=>ed(d.text,n.text,n.text_matching||"exact")||ed(d.$el_text,n.text,n.text_matching||"exact")));var s,a,l,u=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!u&&(s=(function(d){for(var f,p=[],g=/(?::|")text="(.*?)"/g;!nn(f=g.exec(d));)p.includes(f[1])||p.push(f[1]);return p})(u),a=n.text,l=n.text_matching||"exact",s.some((d=>ed(d,a,l))))}Vi(e,n){var r,i;if(n==null||!n.selector)return!0;var s=e==null||(r=e.properties)==null?void 0:r.$element_selectors;if(s!=null&&s.includes(n.selector))return!0;var a=(e==null||(i=e.properties)==null?void 0:i.$elements_chain)||"";if(n.selector_regex&&a)try{return new RegExp(n.selector_regex).test(a)}catch{return!1}return!1}Ji(e){var n;return(e==null||(n=e.properties)==null?void 0:n.$elements)==null?[]:e==null?void 0:e.properties.$elements}Ui(e,n){return n==null||!n.properties||n.properties.length===0||qP(n.properties.reduce(((r,i)=>{var s=rn(i.value)?i.value.map(String):i.value!=null?[String(i.value)]:[];return r[i.key]={values:s,operator:i.operator||"exact"},r}),{}),e==null?void 0:e.properties)}}class zpe{constructor(e){this._instance=e,this.Ki=new Map,this.Yi=new Map,this.Xi=new Map}Qi(e,n){return!!e&&qP(e.propertyFilters,n==null?void 0:n.properties)}Zi(e,n){var r=new Map;return e.forEach((i=>{var s;(s=i.conditions)==null||(s=s[n])==null||(s=s.values)==null||s.forEach((a=>{if(a!=null&&a.name){var l=r.get(a.name)||[];l.push(i.id),r.set(a.name,l)}}))})),r}te(e,n,r){var i=(r===mf.Activation?this.Ki:this.Yi).get(e),s=[];return this.ie((a=>{s=a.filter((l=>i==null?void 0:i.includes(l.id)))})),s.filter((a=>{var l,u=(l=a.conditions)==null||(l=l[r])==null||(l=l.values)==null?void 0:l.find((d=>d.name===e));return this.Qi(u,n)}))}register(e){var n;$e((n=this._instance)==null?void 0:n._addCaptureHook)||(this.ee(e),this.re(e))}re(e){var n=e.filter((r=>{var i,s;return((i=r.conditions)==null?void 0:i.actions)&&((s=r.conditions)==null||(s=s.actions)==null||(s=s.values)==null?void 0:s.length)>0}));n.length!==0&&(this.se==null&&(this.se=new Bpe(this._instance),this.se.init(),this.se.qi((r=>{this.onAction(r)}))),n.forEach((r=>{var i,s,a,l,u;r.conditions&&(i=r.conditions)!=null&&i.actions&&(s=r.conditions)!=null&&(s=s.actions)!=null&&s.values&&((a=r.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0&&((l=this.se)==null||l.register(r.conditions.actions.values),(u=r.conditions)==null||(u=u.actions)==null||(u=u.values)==null||u.forEach((d=>{if(d&&d.name){var f=this.Xi.get(d.name);f&&f.push(r.id),this.Xi.set(d.name,f||[r.id])}})))})))}ee(e){var n,r=e.filter((s=>{var a,l;return((a=s.conditions)==null?void 0:a.events)&&((l=s.conditions)==null||(l=l.events)==null||(l=l.values)==null?void 0:l.length)>0})),i=e.filter((s=>{var a,l;return((a=s.conditions)==null?void 0:a.cancelEvents)&&((l=s.conditions)==null||(l=l.cancelEvents)==null||(l=l.values)==null?void 0:l.length)>0}));(r.length!==0||i.length!==0)&&((n=this._instance)==null||n._addCaptureHook(((s,a)=>{this.onEvent(s,a)})),this.Ki=this.Zi(e,mf.Activation),this.Yi=this.Zi(e,mf.Cancellation))}onEvent(e,n){var r,i=this.ne(),s=this.oe(),a=this.ae(),l=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[s])||[];if(a===e&&n&&l.length>0){var u,d;i.info("event matched, removing item from activated items",{event:e,eventPayload:n,existingActivatedItems:l});var f=(n==null||(u=n.properties)==null?void 0:u.$survey_id)||(n==null||(d=n.properties)==null?void 0:d.$product_tour_id);if(f){var p=l.indexOf(f);p>=0&&(l.splice(p,1),this.le(l))}}else{if(this.Yi.has(e)){var g=this.te(e,n,mf.Cancellation);g.length>0&&(i.info("cancel event matched, cancelling items",{event:e,itemsToCancel:g.map((v=>v.id))}),g.forEach((v=>{var E=l.indexOf(v.id);E>=0&&l.splice(E,1),this.ue(v.id)})),this.le(l))}if(this.Ki.has(e)){i.info("event name matched",{event:e,eventPayload:n,items:this.Ki.get(e)});var b=this.te(e,n,mf.Activation);this.le(l.concat(b.map((v=>v.id))||[]))}}}onAction(e){var n,r=this.oe(),i=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[r])||[];this.Xi.has(e)&&this.le(i.concat(this.Xi.get(e)||[]))}le(e){var n,r=this.ne(),i=this.oe(),s=[...new Set(e)].filter((a=>!this.he(a)));r.info("updating activated items",{activatedItems:s}),(n=this._instance)==null||(n=n.persistence)==null||n.register({[i]:s})}getActivatedIds(){var e,n=this.oe(),r=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[n];return r||[]}getEventToItemsMap(){return this.Ki}de(){return this.se}}class Upe extends zpe{constructor(e){super(e)}oe(){return"$surveys_activated"}ae(){return Mf.SHOWN}ie(e){var n;(n=this._instance)==null||n.getSurveys(e)}ue(e){var n;(n=this._instance)==null||n.cancelPendingSurvey(e)}ne(){return _n}he(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class Fpe{constructor(e){this.ve=void 0,this._surveyManager=null,this.ce=!1,this.fe=[],this.pe=null,this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var n=e.surveys;if(nn(n))return _n.warn("Flags not loaded yet. Not loading surveys.");var r=rn(n);this.ve=r?n.length>0:n,_n.info("flags response received, isSurveysEnabled: "+this.ve),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],n=0;n<localStorage.length;n++){var r=localStorage.key(n);(r!=null&&r.startsWith(VP)||r!=null&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach((i=>localStorage.removeItem(i)))}loadIfEnabled(){if(!this._surveyManager)if(this.ce)_n.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)_n.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())_n.info("Not loading surveys in cookieless mode without consent.");else{var e=ot==null?void 0:ot.__PosthogExtensions__;if(e){if(!$e(this.ve)||this._instance.config.advanced_enable_surveys){var n=this.ve||this._instance.config.advanced_enable_surveys;this.ce=!0;try{var r=e.generateSurveys;if(r)return void this.ge(r,n);var i=e.loadExternalDependency;if(!i)return void this._e("PostHog loadExternalDependency extension not found.");i(this._instance,"surveys",(s=>{s||!e.generateSurveys?this._e("Could not load surveys script",s):this.ge(e.generateSurveys,n)}))}catch(s){throw this._e("Error initializing surveys",s),s}finally{this.ce=!1}}}else _n.error("PostHog Extensions not found.")}}ge(e,n){this._surveyManager=e(this._instance,n),this._surveyEventReceiver=new Upe(this._instance),_n.info("Surveys loaded successfully"),this.me({isLoaded:!0})}_e(e,n){_n.error(e,n),this.me({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.fe.push(e),this._surveyManager&&this.me({isLoaded:!0}),()=>{this.fe=this.fe.filter((n=>n!==e))}}getSurveys(e,n){if(n===void 0&&(n=!1),this._instance.config.disable_surveys)return _n.info("Disabled. Not loading surveys."),e([]);var r,i=this._instance.get_property(G3);if(i&&!n)return e(i,{isLoaded:!0});typeof Promise<"u"&&this.pe?this.pe.then((s=>{var{surveys:a,context:l}=s;return e(a,l)})):(typeof Promise<"u"&&(this.pe=new Promise((s=>{r=s}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:s=>{var a;this.pe=null;var l=s.statusCode;if(l!==200||!s.json){var u="Surveys API could not be loaded, status: "+l;_n.error(u);var d={isLoaded:!1,error:u};return e([],d),void(r==null||r({surveys:[],context:d}))}var f,p=s.json.surveys||[],g=p.filter((v=>(function(E){return!(!E.start_date||E.end_date)})(v)&&((function(E){var x;return!((x=E.conditions)==null||(x=x.events)==null||(x=x.values)==null||!x.length)})(v)||(function(E){var x;return!((x=E.conditions)==null||(x=x.actions)==null||(x=x.values)==null||!x.length)})(v))));g.length>0&&((f=this._surveyEventReceiver)==null||f.register(g)),(a=this._instance.persistence)==null||a.register({[G3]:p});var b={isLoaded:!0};e(p,b),r==null||r({surveys:p,context:b})}}))}me(e){for(var n of this.fe)try{if(!e.isLoaded)return n([],e);this.getSurveys(n)}catch(r){_n.error("Error in survey callback",r)}}getActiveMatchingSurveys(e,n){if(n===void 0&&(n=!1),!nn(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,n);_n.warn("init was not called")}ye(e){var n=null;return this.getSurveys((r=>{var i;n=(i=r.find((s=>s.id===e)))!==null&&i!==void 0?i:null})),n}be(e){if(nn(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var n=typeof e=="string"?this.ye(e):e;return n?this._surveyManager.checkSurveyEligibility(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(nn(this._surveyManager))return _n.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var n=this.be(e);return{visible:n.eligible,disabledReason:n.reason}}canRenderSurveyAsync(e,n){return nn(this._surveyManager)?(_n.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((r=>{this.getSurveys((i=>{var s,a=(s=i.find((u=>u.id===e)))!==null&&s!==void 0?s:null;if(a){var l=this.be(a);r({visible:l.eligible,disabledReason:l.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),n)}))}renderSurvey(e,n,r){var i;if(nn(this._surveyManager))_n.warn("init was not called");else{var s=typeof e=="string"?this.ye(e):e;if(s!=null&&s.id)if(Lpe.includes(s.type)){var a=Ve==null?void 0:Ve.querySelector(n);if(a)return(i=s.appearance)!=null&&i.surveyPopupDelaySeconds?(_n.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var l,u;_n.info("Rendering survey "+s.id+" with delay of "+((l=s.appearance)==null?void 0:l.surveyPopupDelaySeconds)+" seconds"),(u=this._surveyManager)==null||u.renderSurvey(s,a,r),_n.info("Survey "+s.id+" rendered")}),1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,a,r);_n.warn("Survey element not found")}else _n.warn("Surveys of type "+s.type+" cannot be rendered in the app");else _n.warn("Survey not found")}}displaySurvey(e,n){var r;if(nn(this._surveyManager))_n.warn("init was not called");else{var i=this.ye(e);if(i){var s=i;if((r=i.appearance)!=null&&r.surveyPopupDelaySeconds&&n.ignoreDelay&&(s=We({},i,{appearance:We({},i.appearance,{surveyPopupDelaySeconds:0})})),n.displayType!==t_.Popover&&n.initialResponses&&_n.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),n.ignoreConditions===!1){var a=this.canRenderSurvey(i);if(!a.visible)return void _n.warn("Survey is not eligible to be displayed: ",a.disabledReason)}n.displayType!==t_.Inline?this._surveyManager.handlePopoverSurvey(s,n):this.renderSurvey(s,n.selector,n.properties)}else _n.warn("Survey not found")}}cancelPendingSurvey(e){nn(this._surveyManager)?_n.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload()}}var oo=or("[Conversations]");class Hpe{constructor(e){this.we=void 0,this._conversationsManager=null,this.xe=!1,this.Ee=null,this._instance=e}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var n=e.conversations;nn(n)||(Ao(n)?this.we=n:(this.we=n.enabled,this.Ee=n),this.loadIfEnabled())}}reset(){var e;(e=this._conversationsManager)==null||e.reset(),this._conversationsManager=null,this.we=void 0,this.Ee=null}loadIfEnabled(){if(!this._conversationsManager&&!this.xe&&!(this._instance.config.disable_conversations||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=ot==null?void 0:ot.__PosthogExtensions__;if(e&&!$e(this.we)&&this.we)if(this.Ee&&this.Ee.token){this.xe=!0;try{var n=e.initConversations;if(n)return this.$e(n),void(this.xe=!1);var r=e.loadExternalDependency;if(!r)return void this.Se("PostHog loadExternalDependency extension not found.");r(this._instance,"conversations",(i=>{i||!e.initConversations?this.Se("Could not load conversations script",i):this.$e(e.initConversations),this.xe=!1}))}catch(i){this.Se("Error initializing conversations",i),this.xe=!1}}else oo.error("Conversations enabled but missing token in remote config.")}}$e(e){if(this.Ee)try{this._conversationsManager=e(this.Ee,this._instance),oo.info("Conversations loaded successfully")}catch(n){this.Se("Error completing conversations initialization",n)}else oo.error("Cannot complete initialization: remote config is null")}Se(e,n){oo.error(e,n),this._conversationsManager=null,this.xe=!1}show(){this._conversationsManager?this._conversationsManager.show():oo.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.we===!0&&!na(this._conversationsManager)}isVisible(){var e,n;return(e=(n=this._conversationsManager)==null?void 0:n.isVisible())!==null&&e!==void 0&&e}sendMessage(e,n,r){var i=this;return hd((function*(){return i._conversationsManager?i._conversationsManager.sendMessage(e,n,r):(oo.warn("Conversations not available yet."),null)}))()}getMessages(e,n){var r=this;return hd((function*(){return r._conversationsManager?r._conversationsManager.getMessages(e,n):(oo.warn("Conversations not available yet."),null)}))()}markAsRead(e){var n=this;return hd((function*(){return n._conversationsManager?n._conversationsManager.markAsRead(e):(oo.warn("Conversations not available yet."),null)}))()}getTickets(e){var n=this;return hd((function*(){return n._conversationsManager?n._conversationsManager.getTickets(e):(oo.warn("Conversations not available yet."),null)}))()}getCurrentTicketId(){var e,n;return(e=(n=this._conversationsManager)==null?void 0:n.getCurrentTicketId())!==null&&e!==void 0?e:null}getWidgetSessionId(){var e,n;return(e=(n=this._conversationsManager)==null?void 0:n.getWidgetSessionId())!==null&&e!==void 0?e:null}}class jpe{constructor(e){var n;this.ke=!1,this.Pe=!1,this._instance=e,this._instance&&(n=this._instance.config.logs)!=null&&n.captureConsoleLogs&&(this.ke=!0)}onRemoteConfig(e){var n,r=(n=e.logs)==null?void 0:n.captureConsoleLogs;!nn(r)&&r&&(this.ke=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.ke&&!this.Pe){var e=or("[logs]"),n=ot==null?void 0:ot.__PosthogExtensions__;if(n){var r=n.loadExternalDependency;r?r(this._instance,"logs",(i=>{var s;i||(s=n.logs)==null||!s.initializeLogs?e.error("Could not load logs script",i):(n.logs.initializeLogs(this._instance),this.Pe=!0)})):e.error("PostHog loadExternalDependency extension not found.")}else e.error("PostHog Extensions not found.")}}}var UA=or("[RateLimiter]");class $pe{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var r=n.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach((i=>{UA.info((i||"events")+" is quota limited."),this.serverLimits[i]=new Date().getTime()+6e4}))}catch(i){return void UA.warn('could not rate limit - continuing. Error: "'+(i==null?void 0:i.message)+'"',{text:r})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)==null?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)==null?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var n,r,i;e===void 0&&(e=!1);var{captureEventsBurstLimit:s,captureEventsPerSecond:a}=this,l=new Date().getTime(),u=(n=(r=this.instance.persistence)==null?void 0:r.get_property(W3))!==null&&n!==void 0?n:{tokens:s,last:l};u.tokens+=(l-u.last)/1e3*a,u.last=l,u.tokens>s&&(u.tokens=s);var d=u.tokens<1;return d||e||(u.tokens=Math.max(0,u.tokens-1)),!d||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+a+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=d,(i=this.instance.persistence)==null||i.set_property(W3,u),{isRateLimited:d,remainingTokens:u.tokens}}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var Ru=or("[RemoteConfig]");class qpe{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=ot._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}Te(e){var n,r;(n=ot.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=ot.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(Ru.error("PostHog Extensions not found. Cannot load remote config."),e())}Ie(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:n=>{e(n.json)}})}load(){try{if(this.remoteConfig)return Ru.info("Using preloaded remote config",this.remoteConfig),void this.bi(this.remoteConfig);if(this._instance.O())return void Ru.warn("Remote config is disabled. Falling back to local config.");this.Te((e=>{if(!e)return Ru.info("No config found after loading remote JS config. Falling back to JSON."),void this.Ie((n=>{this.bi(n)}));this.bi(e)}))}catch(e){Ru.error("Error loading remote config",e)}}bi(e){e?this._instance.config.__preview_remote_config?(this._instance.bi(e),e.hasFeatureFlags!==!1&&this._instance.featureFlags.ensureFlagsLoaded()):Ru.info("__preview_remote_config is disabled. Logging config instead",e):Ru.error("Failed to fetch remote config from PostHog.")}}var n_=3e3;class Vpe{constructor(e,n){this.Ce=!0,this.Re=[],this.Fe=xa((n==null?void 0:n.flush_interval_ms)||n_,250,5e3,Ge.createLogger("flush interval"),n_),this.Me=e}enqueue(e){this.Re.push(e),this.Oe||this.Ae()}unload(){this.De();var e=this.Re.length>0?this.je():{},n=Object.values(e);[...n.filter((r=>r.url.indexOf("/e")===0)),...n.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.Me(We({},r,{transport:"sendBeacon"}))}))}enable(){this.Ce=!1,this.Ae()}Ae(){var e=this;this.Ce||(this.Oe=setTimeout((()=>{if(this.De(),this.Re.length>0){var n=this.je(),r=function(){var s=n[i],a=new Date().getTime();s.data&&rn(s.data)&&Nn(s.data,(l=>{l.offset=Math.abs(l.timestamp-a),delete l.timestamp})),e.Me(s)};for(var i in n)r()}}),this.Fe))}De(){clearTimeout(this.Oe),this.Oe=void 0}je(){var e={};return Nn(this.Re,(n=>{var r,i=n,s=(i?i.batchKey:null)||i.url;$e(e[s])&&(e[s]=We({},i,{data:[]})),(r=e[s].data)==null||r.push(i.data)})),this.Re=[],e}}var Gpe=["retriesPerformedSoFar"];class Ype{constructor(e){this.Le=!1,this.Ne=3e3,this.Re=[],this._instance=e,this.Re=[],this.Ue=!0,!$e(be)&&"onLine"in be.navigator&&(this.Ue=be.navigator.onLine,this.ze=()=>{this.Ue=!0,this.Lt()},this.He=()=>{this.Ue=!1},Sr(be,"online",this.ze),Sr(be,"offline",this.He))}get length(){return this.Re.length}retriableRequest(e){var{retriesPerformedSoFar:n}=e,r=FL(e,Gpe);ud(n)&&(r.url=sb(r.url,{retry_count:n})),this._instance._send_request(We({},r,{callback:i=>{i.statusCode!==200&&(i.statusCode<400||i.statusCode>=500)&&(n??0)<10?this.Be(We({retriesPerformedSoFar:n},r)):r.callback==null||r.callback(i)}}))}Be(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var r=(function(a){var l=3e3*Math.pow(2,a),u=l/2,d=Math.min(18e5,l),f=(Math.random()-.5)*(d-u);return Math.ceil(d+f)})(n),i=Date.now()+r;this.Re.push({retryAt:i,requestOptions:e});var s="Enqueued failed request for retry in "+r;navigator.onLine||(s+=" (Browser is offline)"),Ge.warn(s),this.Le||(this.Le=!0,this.qe())}qe(){if(this.We&&clearTimeout(this.We),this.Re.length===0)return this.Le=!1,void(this.We=void 0);this.We=setTimeout((()=>{this.Ue&&this.Re.length>0&&this.Lt(),this.qe()}),this.Ne)}Lt(){var e=Date.now(),n=[],r=this.Re.filter((s=>s.retryAt<e||(n.push(s),!1)));if(this.Re=n,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:e}of(this.We&&(clearTimeout(this.We),this.We=void 0),this.Le=!1,$e(be)||(this.ze&&(be.removeEventListener("online",this.ze),this.ze=void 0),this.He&&(be.removeEventListener("offline",this.He),this.He=void 0)),this.Re))try{this._instance._send_request(We({},e,{transport:"sendBeacon"}))}catch(n){Ge.error(n)}this.Re=[]}}class Wpe{constructor(e){this.Ge=()=>{var n,r,i,s;this.Ve||(this.Ve={});var a=this.scrollElement(),l=this.scrollY(),u=a?Math.max(0,a.scrollHeight-a.clientHeight):0,d=l+((a==null?void 0:a.clientHeight)||0),f=(a==null?void 0:a.scrollHeight)||0;this.Ve.lastScrollY=Math.ceil(l),this.Ve.maxScrollY=Math.max(l,(n=this.Ve.maxScrollY)!==null&&n!==void 0?n:0),this.Ve.maxScrollHeight=Math.max(u,(r=this.Ve.maxScrollHeight)!==null&&r!==void 0?r:0),this.Ve.lastContentY=d,this.Ve.maxContentY=Math.max(d,(i=this.Ve.maxContentY)!==null&&i!==void 0?i:0),this.Ve.maxContentHeight=Math.max(f,(s=this.Ve.maxContentHeight)!==null&&s!==void 0?s:0)},this._instance=e}getContext(){return this.Ve}resetContext(){var e=this.Ve;return setTimeout(this.Ge,0),e}startMeasuringScrollPosition(){Sr(be,"scroll",this.Ge,{capture:!0}),Sr(be,"scrollend",this.Ge,{capture:!0}),Sr(be,"resize",this.Ge)}scrollElement(){if(!this._instance.config.scroll_root_selector)return be==null?void 0:be.document.documentElement;var e=rn(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var n of e){var r=be==null?void 0:be.document.querySelector(n);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return be&&(be.scrollY||be.pageYOffset||be.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return be&&(be.scrollX||be.pageXOffset||be.document.documentElement.scrollLeft)||0}}var Kpe=t=>LP(t==null?void 0:t.config.mask_personal_data_properties,t==null?void 0:t.config.custom_personal_data_properties);class FA{constructor(e,n,r,i){this.Je=s=>{var a=this.Ke();if(!a||a.sessionId!==s){var l={sessionId:s,props:this.Ye(this._instance)};this.Xe.register({[Y3]:l})}},this._instance=e,this.Qe=n,this.Xe=r,this.Ye=i||Kpe,this.Qe.onSessionId(this.Je)}Ke(){return this.Xe.props[Y3]}getSetOnceProps(){var e,n=(e=this.Ke())==null?void 0:e.props;return n?"r"in n?PP(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var e={};return Nn(m6(this.getSetOnceProps()),((n,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+P3(r)]=n})),e}}var o4=or("[SessionId]");class HA{on(e,n){return this.Ze.on(e,n)}constructor(e,n,r){var i;if(this.tr=[],this.ir=void 0,this.Ze=new _6,this.er=(f,p)=>!(!ud(f)||!ud(p))&&Math.abs(f-p)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.R=e.config,this.Xe=e.persistence,this.rr=void 0,this.sr=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.nr=n||Fl,this.ar=r||Fl;var s=this.R.persistence_name||this.R.token,a=this.R.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*xa(a,60,36e3,o4.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.lr(),this.ur="ph_"+s+"_window_id",this.hr="ph_"+s+"_primary_window_exists",this.dr()){var l=Xr.W(this.ur),u=Xr.W(this.hr);l&&!u?this.rr=l:Xr.V(this.ur),Xr.G(this.hr,!0)}if((i=this.R.bootstrap)!=null&&i.sessionID)try{var d=(f=>{var p=f.replace(/-/g,"");if(p.length!==32)throw new Error("Not a valid UUID");if(p[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(p.substring(0,12),16)})(this.R.bootstrap.sessionID);this.vr(this.R.bootstrap.sessionID,new Date().getTime(),d)}catch(f){o4.error("Invalid sessionID in bootstrap",f)}this.cr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return $e(this.tr)&&(this.tr=[]),this.tr.push(e),this.sr&&e(this.sr,this.rr),()=>{this.tr=this.tr.filter((n=>n!==e))}}dr(){return this.R.persistence!=="memory"&&!this.Xe.ki&&Xr.H()}pr(e){e!==this.rr&&(this.rr=e,this.dr()&&Xr.G(this.ur,e))}gr(){return this.rr?this.rr:this.dr()?Xr.W(this.ur):null}vr(e,n,r){e===this.sr&&n===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.sr=e,this.Xe.register({[K1]:[n,e,r]}))}_r(){var e=this.Xe.props[K1];return rn(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.vr(null,null,null)}destroy(){clearTimeout(this.mr),this.mr=void 0,this.ir&&be&&(be.removeEventListener("beforeunload",this.ir,{capture:!1}),this.ir=void 0),this.tr=[]}cr(){this.ir=()=>{this.dr()&&Xr.V(this.hr)},Sr(be,"beforeunload",this.ir,{capture:!1})}checkAndGetSessionAndWindowId(e,n){if(e===void 0&&(e=!1),n===void 0&&(n=null),this.R.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=n||new Date().getTime(),[i,s,a]=this._r(),l=this.gr(),u=ud(a)&&Math.abs(r-a)>864e5,d=!1,f=!s,p=!f&&!e&&this.er(r,i);f||p||u?(s=this.nr(),l=this.ar(),o4.info("new session ID generated",{sessionId:s,windowId:l,changeReason:{noSessionId:f,activityTimeout:p,sessionPastMaximumLength:u}}),a=r,d=!0):l||(l=this.ar(),d=!0);var g=ud(i)&&e&&!u?i:r,b=ud(a)?a:new Date().getTime();return this.pr(l),this.vr(s,g,b),e||this.lr(),d&&this.tr.forEach((v=>v(s,l,d?{noSessionId:f,activityTimeout:p,sessionPastMaximumLength:u}:void 0))),{sessionId:s,windowId:l,sessionStartTimestamp:b,changeReason:d?{noSessionId:f,activityTimeout:p,sessionPastMaximumLength:u}:void 0,lastActivityTimestamp:i}}lr(){clearTimeout(this.mr),this.mr=setTimeout((()=>{var[e]=this._r();if(this.er(new Date().getTime(),e)){var n=this.sr;this.resetSessionId(),this.Ze.emit("forcedIdleReset",{idleSessionId:n})}}),1.1*this.sessionTimeoutMs)}}var Xpe=["$set_once","$set"],_l=or("[SiteApps]");class Qpe{constructor(e){this._instance=e,this.yr=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}br(e,n){if(n){var r=this.globalsForEvent(n);this.yr.push(r),this.yr.length>1e3&&(this.yr=this.yr.slice(10))}}get siteAppLoaders(){var e;return(e=ot._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.br.bind(this));this.wr=()=>{e(),this.yr=[],this.wr=void 0}}}globalsForEvent(e){var n,r,i,s,a,l,u;if(!e)throw new Error("Event payload is required");var d={},f=this._instance.get_property("$groups")||[],p=this._instance.get_property("$stored_group_properties")||{};for(var[g,b]of Object.entries(p))d[g]={id:f[g],type:g,properties:b};var{$set_once:v,$set:E}=e;return{event:We({},FL(e,Xpe),{properties:We({},e.properties,E?{$set:We({},(n=(r=e.properties)==null?void 0:r.$set)!==null&&n!==void 0?n:{},E)}:{},v?{$set_once:We({},(i=(s=e.properties)==null?void 0:s.$set_once)!==null&&i!==void 0?i:{},v)}:{}),elements_chain:(a=(l=e.properties)==null?void 0:l.$elements_chain)!==null&&a!==void 0?a:"",distinct_id:(u=e.properties)==null?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:d}}setupSiteApp(e){var n=this.apps[e.id],r=()=>{var l;!n.errored&&this.yr.length&&(_l.info("Processing "+this.yr.length+" events for site app with id "+e.id),this.yr.forEach((u=>n.processEvent==null?void 0:n.processEvent(u))),n.processedBuffer=!0),Object.values(this.apps).every((u=>u.processedBuffer||u.errored))&&((l=this.wr)==null||l.call(this))},i=!1,s=l=>{n.errored=!l,n.loaded=!0,_l.info("Site app with id "+e.id+" "+(l?"loaded":"errored")),i&&r()};try{var{processEvent:a}=e.init({posthog:this._instance,callback:l=>{s(l)}});a&&(n.processEvent=a),i=!0}catch(l){_l.error("Error while initializing PostHog app with config id "+e.id,l),s(!1)}if(i&&n.loaded)try{r()}catch(l){_l.error("Error while processing buffered events PostHog app with config id "+e.id,l),n.errored=!0}}Er(){var e=this.siteAppLoaders||[];for(var n of e)this.apps[n.id]={id:n.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of e)this.setupSiteApp(r)}$r(e){if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(e);for(var r of Object.values(this.apps))try{r.processEvent==null||r.processEvent(n)}catch(i){_l.error("Error while processing event "+e.event+" for site app "+r.id,i)}}}onRemoteConfig(e){var n,r,i,s=this;if((n=this.siteAppLoaders)!=null&&n.length)return this.isEnabled?(this.Er(),void this._instance.on("eventCaptured",(d=>this.$r(d)))):void _l.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((r=this.wr)==null||r.call(this),(i=e.siteApps)!=null&&i.length)if(this.isEnabled){var a=function(d){var f;ot["__$$ph_site_app_"+d]=s._instance,(f=ot.__PosthogExtensions__)==null||f.loadSiteApp==null||f.loadSiteApp(s._instance,u,(p=>{if(p)return _l.error("Error while initializing PostHog app with config id "+d,p)}))};for(var{id:l,url:u}of e.siteApps)a(l)}else _l.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var GP=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&Q7(n,e))return!0;try{var r=t==null?void 0:t.userAgentData;if(r!=null&&r.brands&&r.brands.some((i=>Q7(i==null?void 0:i.brand,e))))return!0}catch{}return!!t.webdriver},Rf=(function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t})({}),jA="i.posthog.com";class Zpe{constructor(e){this.Sr={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,n=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+jA,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.Sr[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Sr[this.apiHost]=Rf.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Sr[this.apiHost]=Rf.EU:this.Sr[this.apiHost]=Rf.CUSTOM),this.Sr[this.apiHost]}endpointFor(e,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),e==="ui")return this.uiHost+n;if(e==="flags")return this.flagsApiHost+n;if(this.region===Rf.CUSTOM)return this.apiHost+n;var r=jA+n;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var Jpe={icontains:(t,e)=>!!be&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!be&&e.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>!!be&&ab(e.href,t),not_regex:(t,e)=>!!be&&!ab(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t};class ai{constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments((i=>{ai.kr("retrieved web experiments from the server"),n.Pr=new Map,i.forEach((s=>{if(s.feature_flag_key){var a;n.Pr&&(ai.kr("setting flag key ",s.feature_flag_key," to web experiment ",s),(a=n.Pr)==null||a.set(s.feature_flag_key,s));var l=n._instance.getFeatureFlag(s.feature_flag_key);Ir(l)&&s.variants[l]&&n.Tr(s.name,l,s.variants[l].transforms)}else if(s.variants)for(var u in s.variants){var d=s.variants[u];ai.Ir(d)&&n.Tr(s.name,u,d.transforms)}}))}),r)},this._instance=e,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}onFeatureFlags(e){if(this._is_bot())ai.kr("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(nn(this.Pr))return this.Pr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();ai.kr("applying feature flags",e),e.forEach((n=>{var r;if(this.Pr&&(r=this.Pr)!=null&&r.has(n)){var i,s=this._instance.getFeatureFlag(n),a=(i=this.Pr)==null?void 0:i.get(n);s&&a!=null&&a.variants[s]&&this.Tr(a.name,s,a.variants[s].transforms)}}))}}previewWebExperiment(){var e=ai.getWindowLocation();if(e!=null&&e.search){var n=tb(e==null?void 0:e.search,"__experiment_id"),r=tb(e==null?void 0:e.search,"__experiment_variant");n&&r&&(ai.kr("previewing web experiments "+n+" && "+r),this.getWebExperiments((i=>{this.Cr(parseInt(n),r,i)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,r){if(this._instance.config.disable_web_experiments&&!r)return e([]);var i=this._instance.get_property("$web_experiments");if(i&&!n)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:s=>{if(s.statusCode!==200||!s.json)return e([]);var a=s.json.experiments||[];return e(a)}})}Cr(e,n,r){var i=r.filter((s=>s.id===e));i&&i.length>0&&(ai.kr("Previewing web experiment ["+i[0].name+"] with variant ["+n+"]"),this.Tr(i[0].name,n,i[0].variants[n].transforms))}static Ir(e){return!nn(e.conditions)&&ai.Rr(e)&&ai.Fr(e)}static Rr(e){var n;if(nn(e.conditions)||nn((n=e.conditions)==null?void 0:n.url))return!0;var r,i,s,a=ai.getWindowLocation();return!!a&&((r=e.conditions)==null||!r.url||Jpe[(i=(s=e.conditions)==null?void 0:s.urlMatchType)!==null&&i!==void 0?i:"icontains"](e.conditions.url,a))}static getWindowLocation(){return be==null?void 0:be.location}static Fr(e){var n;if(nn(e.conditions)||nn((n=e.conditions)==null?void 0:n.utm))return!0;var r=MP();if(r.utm_source){var i,s,a,l,u,d,f,p,g=(i=e.conditions)==null||(i=i.utm)==null||!i.utm_campaign||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_campaign)==r.utm_campaign,b=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((l=e.conditions)==null||(l=l.utm)==null?void 0:l.utm_source)==r.utm_source,v=(u=e.conditions)==null||(u=u.utm)==null||!u.utm_medium||((d=e.conditions)==null||(d=d.utm)==null?void 0:d.utm_medium)==r.utm_medium,E=(f=e.conditions)==null||(f=f.utm)==null||!f.utm_term||((p=e.conditions)==null||(p=p.utm)==null?void 0:p.utm_term)==r.utm_term;return g&&v&&E&&b}return!1}static kr(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];Ge.info("[WebExperiments] "+e,r)}Tr(e,n,r){this._is_bot()?ai.kr("Refusing to render web experiment since the viewer is a likely bot"):n!=="control"?r.forEach((i=>{if(i.selector){var s;ai.kr("applying transform of variant "+n+" for experiment "+e+" ",i);var a=(s=document)==null?void 0:s.querySelectorAll(i.selector);a==null||a.forEach((l=>{var u=l;i.html&&(u.innerHTML=i.html),i.css&&u.setAttribute("style",i.css)}))}})):ai.kr("Control variants leave the page unmodified.")}_is_bot(){return us&&this._instance?GP(us,this._instance.config.custom_blocked_useragents):void 0}}var eme=or("[PostHog ExternalIntegrations]"),tme={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class nme{constructor(e){this._instance=e}it(e,n){var r;(r=ot.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,(i=>{if(i)return eme.error("failed to load script",i);n()}))}startIfEnabledOrStop(){var e=this,n=function(a){var l,u,d;!i||(l=ot.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[a]||e.it(tme[a],(()=>{var f;(f=ot.__PosthogExtensions__)==null||(f=f.integrations)==null||(f=f[a])==null||f.start(e._instance)})),!i&&(u=ot.__PosthogExtensions__)!=null&&(u=u.integrations)!=null&&u[a]&&((d=ot.__PosthogExtensions__)==null||(d=d.integrations)==null||(d=d[a])==null||d.stop())};for(var[r,i]of Object.entries((s=this._instance.config.integrations)!==null&&s!==void 0?s:{})){var s;n(r)}}}var r_="[SessionRecording]",gf=or(r_);class $A{get started(){var e;return!((e=this.Mr)==null||!e.isStarted)}get status(){return this.Mr?this.Mr.status:this.Or&&!this.Ar?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.Or=!1,this.Dr=void 0,this._instance=e,!this._instance.sessionManager)throw gf.error("started without valid sessionManager"),new Error(r_+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(r_+' cannot be used with cookieless_mode="always"')}get Ar(){var e,n=!((e=this._instance.get_property(YE))==null||!e.enabled),r=!this._instance.config.disable_session_recording,i=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return be&&n&&r&&!i}startIfEnabledOrStop(e){var n;if(!this.Ar||(n=this.Mr)==null||!n.isStarted){var r=!$e(Object.assign)&&!$e(Array.from);this.Ar&&r?(this.jr(e),gf.info("starting")):this.stopRecording()}}jr(e){var n,r,i;this.Ar&&(ot!=null&&(n=ot.__PosthogExtensions__)!=null&&(n=n.rrweb)!=null&&n.record&&(r=ot.__PosthogExtensions__)!=null&&r.initSessionRecording?this.Lr(e):(i=ot.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,this.Nr,(s=>{if(s)return gf.error("could not load recorder",s);this.Lr(e)})))}stopRecording(){var e,n;(e=this.Dr)==null||e.call(this),this.Dr=void 0,(n=this.Mr)==null||n.stop()}Ur(){var e;(e=this._instance.persistence)==null||e.unregister(fP)}zr(e){if(this._instance.persistence){var n,r,i=this._instance.persistence,s=()=>{var a=e.sessionRecording===!1?void 0:e.sessionRecording,l=a==null?void 0:a.sampleRate,u=nn(l)?null:parseFloat(l);nn(u)&&this.Ur();var d=a==null?void 0:a.minimumDurationMilliseconds;i.register({[YE]:We({enabled:!!a},a,{networkPayloadCapture:We({capturePerformance:e.capturePerformance},a==null?void 0:a.networkPayloadCapture),canvasRecording:{enabled:a==null?void 0:a.recordCanvas,fps:a==null?void 0:a.canvasFps,quality:a==null?void 0:a.canvasQuality},sampleRate:u,minimumDurationMilliseconds:$e(d)?null:d,endpoint:a==null?void 0:a.endpoint,triggerMatchType:a==null?void 0:a.triggerMatchType,masking:a==null?void 0:a.masking,urlTriggers:a==null?void 0:a.urlTriggers})})};s(),(n=this.Dr)==null||n.call(this),this.Dr=(r=this._instance.sessionManager)==null?void 0:r.onSessionId(s)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==!1?(this.zr(e),this.Or=!0,this.startIfEnabledOrStop()):this.Or=!0:gf.info("skipping remote config with no sessionRecording",e)}log(e,n){var r;n===void 0&&(n="log"),(r=this.Mr)!=null&&r.log?this.Mr.log(e,n):gf.warn("log called before recorder was ready")}get Nr(){var e,n,r=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(YE);return(r==null||(n=r.scriptConfig)==null?void 0:n.script)||"lazy-recorder"}Lr(e){var n,r;if((n=ot.__PosthogExtensions__)==null||!n.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.Mr||(this.Mr=(r=ot.__PosthogExtensions__)==null?void 0:r.initSessionRecording(this._instance),this.Mr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.Mr.start(e)}onRRwebEmit(e){var n;(n=this.Mr)==null||n.onRRwebEmit==null||n.onRRwebEmit(e)}overrideLinkedFlag(){var e,n;this.Mr||(n=this._instance.persistence)==null||n.register({$replay_override_linked_flag:!0}),(e=this.Mr)==null||e.overrideLinkedFlag()}overrideSampling(){var e,n;this.Mr||(n=this._instance.persistence)==null||n.register({$replay_override_sampling:!0}),(e=this.Mr)==null||e.overrideSampling()}overrideTrigger(e){var n,r;this.Mr||(r=this._instance.persistence)==null||r.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(n=this.Mr)==null||n.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.Mr)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,n){var r;return!((r=this.Mr)==null||!r.tryAddCustomEvent(e,n))}}var rh={},i_=()=>{},cd="posthog",YP=!Cpe&&(Fi==null?void 0:Fi.indexOf("MSIE"))===-1&&(Fi==null?void 0:Fi.indexOf("Mozilla"))===-1,qA=t=>{var e;return We({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Rhe(Ve==null?void 0:Ve.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:i_,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,debug:qi&&Ir(qi==null?void 0:qi.search)&&qi.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!0,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(be==null||(e=be.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:n=>{var r="Bad HTTP status: "+n.statusCode+" "+n.text;Ge.error(r)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:n_},error_tracking:{},_onCapture:i_,__preview_eager_load_replay:!1},(n=>({rageclick:!(n&&n>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(n&&n>="2025-05-24")||"history_change",session_recording:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body"}))(t))},VA=t=>{var e={};$e(t.process_person)||(e.person_profiles=t.process_person),$e(t.xhr_headers)||(e.request_headers=t.xhr_headers),$e(t.cookie_name)||(e.persistence_name=t.cookie_name),$e(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),$e(t.store_google)||(e.save_campaign_params=t.store_google),$e(t.verbose)||(e.debug=t.verbose);var n=pr({},e,t);return rn(t.property_blacklist)&&($e(t.property_denylist)?n.property_denylist=t.property_blacklist:rn(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:Ge.error("Invalid value for property_denylist config: "+t.property_denylist)),n};class rme{constructor(){this.__forceAllowLocalhost=!1}get Hr(){return this.__forceAllowLocalhost}set Hr(e){Ge.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class nv{get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new rme,this.Br=!1,this.version=fo.LIB_VERSION,this.qr=new _6,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=qA(),this.SentryIntegration=ope,this.sentryIntegration=e=>(function(n,r){var i=OP(n,r);return{name:NP,processEvent:s=>i(s)}})(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Wr=!1,this.Gr=null,this.Vr=null,this.Jr=null,this.featureFlags=new Mpe(this),this.toolbar=new upe(this),this.scrollManager=new Wpe(this),this.pageViewManager=new kA(this),this.surveys=new Fpe(this),this.conversations=new Hpe(this),this.logs=new jpe(this),this.experiments=new ai(this),this.exceptions=new Ape(this),this.rateLimiter=new $pe(this),this.requestRouter=new Zpe(this),this.consent=new tpe(this),this.externalIntegrations=new nme(this),this.people={set:(e,n,r)=>{var i=Ir(e)?{[e]:n}:e;this.setPersonProperties(i),r==null||r({})},set_once:(e,n,r)=>{var i=Ir(e)?{[e]:n}:e;this.setPersonProperties(void 0,i),r==null||r({})}},this.on("eventCaptured",(e=>Ge.info('send "'+(e==null?void 0:e.event)+'"',e)))}init(e,n,r){if(r&&r!==cd){var i,s=(i=rh[r])!==null&&i!==void 0?i:new nv;return s._init(e,n,r),rh[r]=s,rh[cd][r]=s,s}return this._init(e,n,r)}_init(e,n,r){var i;if(n===void 0&&(n={}),$e(e)||B3(e))return Ge.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},n.debug=this.Kr(n.debug),this.Yr=n,this.Xr=[],n.person_profiles&&(this.Vr=n.person_profiles),this.set_config(pr({},qA(n.defaults),VA(n),{name:r,token:e})),this.config.on_xhr_error&&Ge.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:vo.GZipJS;var s=this.Qr();this.persistence=new r4(this.config,s),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new r4(We({},this.config,{persistence:"sessionStorage"}),s);var a=We({},this.persistence.props),l=We({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Zr=new Vpe((C=>this.ts(C)),this.config.request_queue_config),this.es=new Ype(this),this.__request_queue=[];var u=this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut();if(u||(this.sessionManager=new HA(this),this.sessionPropsManager=new FA(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(Ge.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.rs(u)}),0)):(Ge.info("Initializing extensions synchronously"),this.rs(u)),fo.DEBUG=fo.DEBUG||this.config.debug,fo.DEBUG&&Ge.info("Starting in debug mode",{this:this,config:n,thisC:We({},this.config),p:a,s:l}),((i=n.bootstrap)==null?void 0:i.distinctID)!==void 0){var d,f,p=this.config.get_device_id(Fl()),g=(d=n.bootstrap)!=null&&d.isIdentifiedID?p:n.bootstrap.distinctID;this.persistence.set_property(ho,(f=n.bootstrap)!=null&&f.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:n.bootstrap.distinctID,$device_id:g})}if(this.ss()){var b,v,E=Object.keys(((b=n.bootstrap)==null?void 0:b.featureFlags)||{}).filter((C=>{var O;return!((O=n.bootstrap)==null||(O=O.featureFlags)==null||!O[C])})).reduce(((C,O)=>{var L;return C[O]=((L=n.bootstrap)==null||(L=L.featureFlags)==null?void 0:L[O])||!1,C}),{}),x=Object.keys(((v=n.bootstrap)==null?void 0:v.featureFlagPayloads)||{}).filter((C=>E[C])).reduce(((C,O)=>{var L,D;return(L=n.bootstrap)!=null&&(L=L.featureFlagPayloads)!=null&&L[O]&&(C[O]=(D=n.bootstrap)==null||(D=D.featureFlagPayloads)==null?void 0:D[O]),C}),{});this.featureFlags.receivedFeatureFlags({featureFlags:E,featureFlagPayloads:x})}if(u)this.register_once({distinct_id:lf,$device_id:null},"");else if(!this.get_distinct_id()){var S=this.config.get_device_id(Fl());this.register_once({distinct_id:S,$device_id:S},""),this.persistence.set_property(ho,"anonymous")}return Sr(be,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),n.segment?ape(this,(()=>this.ns())):this.ns(),Vl(this.config._onCapture)&&this.config._onCapture!==i_&&(Ge.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(C=>this.config._onCapture(C.event,C)))),this.config.ip&&Ge.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}rs(e){var n=performance.now();this.historyAutocapture=new spe(this),this.historyAutocapture.startIfEnabled();var r=[];r.push((()=>{new dpe(this).startIfEnabledOrStop()})),r.push((()=>{var i;this.siteApps=new Qpe(this),(i=this.siteApps)==null||i.init()})),e||r.push((()=>{this.sessionRecording=new $A(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||r.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.push((()=>{this.autocapture=new Yhe(this),this.autocapture.startIfEnabled()})),r.push((()=>{this.surveys.loadIfEnabled()})),r.push((()=>{this.logs.loadIfEnabled()})),r.push((()=>{this.conversations.loadIfEnabled()})),r.push((()=>{this.productTours=new Dpe(this),this.productTours.loadIfEnabled()})),r.push((()=>{this.heatmaps=new vpe(this),this.heatmaps.startIfEnabled()})),r.push((()=>{this.webVitalsAutocapture=new gpe(this)})),r.push((()=>{this.exceptionObserver=new ipe(this),this.exceptionObserver.startIfEnabledOrStop()})),r.push((()=>{this.deadClicksAutocapture=new AP(this,rpe),this.deadClicksAutocapture.startIfEnabled()})),r.push((()=>{if(this.os){var i=this.os;this.os=void 0,this.bi(i)}})),this.ls(r,n)}ls(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout((()=>{this.ls(e,n)}),0);var r=e.shift();if(r)try{r()}catch(s){Ge.error("Error initializing extension:",s)}}var i=Math.round(performance.now()-n);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:i}),this.config.__preview_deferred_init_extensions&&Ge.info("PostHog extensions initialized ("+i+"ms)")}bi(e){var n,r,i,s,a,l,u,d,f;if(!Ve||!Ve.body)return Ge.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.bi(e)}),500);this.config.__preview_deferred_init_extensions&&(this.os=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=Ht(e.supportedCompression,vo.GZipJS)?vo.GZipJS:Ht(e.supportedCompression,vo.Base64)?vo.Base64:void 0),(n=e.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Vr?this.Vr:"identified_only"}),(r=this.siteApps)==null||r.onRemoteConfig(e),(i=this.sessionRecording)==null||i.onRemoteConfig(e),(s=this.autocapture)==null||s.onRemoteConfig(e),(a=this.heatmaps)==null||a.onRemoteConfig(e),this.surveys.onRemoteConfig(e),this.logs.onRemoteConfig(e),this.conversations.onRemoteConfig(e),(l=this.productTours)==null||l.onRemoteConfig(e),(u=this.webVitalsAutocapture)==null||u.onRemoteConfig(e),(d=this.exceptionObserver)==null||d.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(f=this.deadClicksAutocapture)==null||f.onRemoteConfig(e)}ns(){try{this.config.loaded(this)}catch(e){Ge.critical("`loaded` function failed",e)}this.us(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.hs()}),1),new qpe(this).load(),this.featureFlags.flags()}us(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Zr)==null||e.enable())}_dom_loaded(){this.is_capturing()&&Gl(this.__request_queue,(e=>this.ts(e))),this.__request_queue=[],this.us()}_handle_unload(){var e,n;this.surveys.handlePageUnload(),this.config.request_batching?(this.ds()&&this.capture("$pageleave"),(e=this.Zr)==null||e.unload(),(n=this.es)==null||n.unload()):this.ds()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(YP?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=sb(e.url,{ip:this.config.ip?1:0}),e.headers=We({},this.config.request_headers,e.headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(n=>{var r,i,s,a=We({},n);a.timeout=a.timeout||6e4,a.url=sb(a.url,{_:new Date().getTime().toString(),ver:fo.LIB_VERSION,compression:a.compression});var l=(r=a.transport)!==null&&r!==void 0?r:"fetch",u=Rg.filter((f=>!a.disableTransport||!f.transport||!a.disableTransport.includes(f.transport))),d=(i=(s=uP(u,(f=>f.transport===l)))==null?void 0:s.method)!==null&&i!==void 0?i:u[0].method;if(!d)throw new Error("No available transport method");d(a)})(We({},e,{callback:n=>{var r,i;this.rateLimiter.checkForLimiting(n),n.statusCode>=400&&((r=(i=this.config).on_request_error)==null||r.call(i,n)),e.callback==null||e.callback(n)}}))))}ts(e){this.es?this.es.retriableRequest(e):this._send_request(e)}_execute_array(e){var n,r=[],i=[],s=[];Gl(e,(l=>{l&&(n=l[0],rn(n)?s.push(l):Vl(l)?l.call(this):rn(l)&&n==="alias"?r.push(l):rn(l)&&n.indexOf("capture")!==-1&&Vl(this[n])?s.push(l):i.push(l))}));var a=function(l,u){Gl(l,(function(d){if(rn(d[0])){var f=u;Nn(d,(function(p){f=f[p[0]].apply(f,p.slice(1))}))}else this[d[0]].apply(this,d.slice(1))}),u)};a(r,this),a(i,this),a(s,this)}ss(){var e,n;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((n=this.config.bootstrap)==null?void 0:n.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,n,r){var i;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Zr){if(this.is_capturing())if(!$e(e)&&Ir(e)){var s=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(s&&!this.config.__preview_capture_bot_pageviews)){var a=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(a==null||!a.isRateLimited){n!=null&&n.$current_url&&!Ir(n==null?void 0:n.$current_url)&&(Ge.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var l=new Date,u=(r==null?void 0:r.timestamp)||l,d=Fl(),f={uuid:d,event:e,properties:this.calculateEventProperties(e,n||{},u,d)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&s&&(f.event="$bot_pageview",f.properties.$browser_type="bot"),a&&(f.properties.$lib_rate_limit_remaining_tokens=a.remainingTokens),r!=null&&r.$set&&(f.$set=r==null?void 0:r.$set);var p,g=e!=="$groupidentify",b=this.vs(r==null?void 0:r.$set_once,g);if(b&&(f.$set_once=b),(f=Ohe(f,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=u,$e(r==null?void 0:r.timestamp)||(f.properties.$event_time_override_provided=!0,f.properties.$event_time_override_system_time=l),e===Mf.DISMISSED||e===Mf.SENT){var v=n==null?void 0:n[a4.SURVEY_ID],E=n==null?void 0:n[a4.SURVEY_ITERATION];p={id:v,current_iteration:E},localStorage.getItem(zA(p))||localStorage.setItem(zA(p),"true"),f.$set=We({},f.$set,{[Ipe({id:v,current_iteration:E},e===Mf.SENT?"responded":"dismissed")]:!0})}else e===Mf.SHOWN&&(f.$set=We({},f.$set,{[a4.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));var x=We({},f.properties.$set,f.$set);if(pd(x)||this.setPersonPropertiesForFlags(x),!nn(this.config.before_send)){var S=this.cs(f);if(!S)return;f=S}this.qr.emit("eventCaptured",f);var C={method:"POST",url:(i=r==null?void 0:r._url)!==null&&i!==void 0?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:f,compression:"best-available",batchKey:r==null?void 0:r._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.ts(C):this.Zr.enqueue(C),f}Ge.critical("This capture call is ignored due to client rate limiting.")}}else Ge.error("No event name provided to posthog.capture")}else Ge.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(n=>e(n.event,n)))}calculateEventProperties(e,n,r,i,s){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var a=s?void 0:this.persistence.remove_event_timer(e),l=We({},n);if(l.token=this.config.token,l.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(l.$cookieless_mode=!0),e==="$snapshot"){var u=We({},this.persistence.properties(),this.sessionPersistence.properties());return l.distinct_id=u.distinct_id,(!Ir(l.distinct_id)&&!Io(l.distinct_id)||B3(l.distinct_id))&&Ge.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),l}var d,f=mpe(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:p,windowId:g}=this.sessionManager.checkAndGetSessionAndWindowId(s,r.getTime());l.$session_id=p,l.$window_id=g}this.sessionPropsManager&&pr(l,this.sessionPropsManager.getSessionProps());try{var b;this.sessionRecording&&pr(l,this.sessionRecording.sdkDebugProperties),l.$sdk_debug_retry_queue_size=(b=this.es)==null?void 0:b.length}catch(S){l.$sdk_debug_error_capturing_properties=String(S)}if(this.requestRouter.region===Rf.CUSTOM&&(l.$lib_custom_api_host=this.config.api_host),d=e!=="$pageview"||s?e!=="$pageleave"||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,i),l=pr(l,d),e==="$pageview"&&Ve&&(l.title=Ve.title),!$e(a)){var v=r.getTime()-a;l.$duration=parseFloat((v/1e3).toFixed(3))}Fi&&this.config.opt_out_useragent_filter&&(l.$browser_type=this._is_bot()?"bot":"browser"),(l=pr({},f,this.persistence.properties(),this.sessionPersistence.properties(),l)).$is_identified=this._isIdentified(),rn(this.config.property_denylist)?Nn(this.config.property_denylist,(function(S){delete l[S]})):Ge.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var E=this.config.sanitize_properties;E&&(Ge.error("sanitize_properties is deprecated. Use before_send instead"),l=E(l,e));var x=this.fs();return l.$process_person_profile=x,x&&!s&&this.ps("_calculate_event_properties"),l}vs(e,n){var r;if(n===void 0&&(n=!0),!this.persistence||!this.fs()||this.Br)return e;var i=this.persistence.get_initial_props(),s=(r=this.sessionPropsManager)==null?void 0:r.getSetOnceProps(),a=pr({},i,s||{},e||{}),l=this.config.sanitize_properties;return l&&(Ge.error("sanitize_properties is deprecated. Use before_send instead"),a=l(a,"$set_once")),n&&(this.Br=!0),pd(a)?void 0:a}register(e,n){var r;(r=this.persistence)==null||r.register(e,n)}register_once(e,n,r){var i;(i=this.persistence)==null||i.register_once(e,n,r)}register_for_session(e){var n;(n=this.sessionPersistence)==null||n.register(e)}unregister(e){var n;(n=this.persistence)==null||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)==null||n.unregister(e)}gs(e,n){this.register({[e]:n})}getFeatureFlag(e,n){return this.featureFlags.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(n)}catch{return n}}isFeatureEnabled(e,n){return this.featureFlags.isFeatureEnabled(e,n)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateFlags(e,n,r){var i=r!=null&&r.merge?this.featureFlags.getFlagVariants():{},s=r!=null&&r.merge?this.featureFlags.getFlagPayloads():{},a=We({},i,e),l=We({},s,n),u={};for(var[d,f]of Object.entries(a)){var p=typeof f=="string";u[d]={key:d,enabled:!!p||!!f,variant:p?f:void 0,reason:void 0,metadata:$e(l==null?void 0:l[d])?void 0:{id:0,version:void 0,description:void 0,payload:l[d]}}}this.featureFlags.receivedFeatureFlags({flags:u})}updateEarlyAccessFeatureEnrollment(e,n,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,n,r)}getEarlyAccessFeatures(e,n,r){return n===void 0&&(n=!1),this.featureFlags.getEarlyAccessFeatures(e,n,r)}on(e,n){return this.qr.on(e,n)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n){n===void 0&&(n=!1),this.surveys.getSurveys(e,n)}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys.getActiveMatchingSurveys(e,n)}renderSurvey(e,n){this.surveys.renderSurvey(e,n)}displaySurvey(e,n){n===void 0&&(n=Ppe),this.surveys.displaySurvey(e,n)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,n){return n===void 0&&(n=!1),this.surveys.canRenderSurveyAsync(e,n)}identify(e,n,r){if(!this.__loaded||!this.persistence)return Ge.uninitializedWarning("posthog.identify");if(Io(e)&&(e=e.toString(),Ge.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))Ge.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==lf){if(this.ps("posthog.identify")){var i=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var s=i;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}e!==i&&e!==this.get_property(kf)&&(this.unregister(kf),this.register({distinct_id:e}));var a=(this.persistence.get_property(ho)||"anonymous")==="anonymous";e!==i&&a?(this.persistence.set_property(ho,"identified"),this.setPersonPropertiesForFlags(We({},r||{},n||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:i},{$set:n||{},$set_once:r||{}}),this.Jr=RA(e,n,r),this.featureFlags.setAnonymousDistinctId(i)):(n||r)&&this.setPersonProperties(n,r),e!==i&&(this.reloadFeatureFlags(),this.unregister(X1))}}else Ge.critical('The string "'+lf+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else Ge.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,n){if((e||n)&&this.ps("posthog.setPersonProperties")){var r=RA(this.get_distinct_id(),e,n);this.Jr!==r?(this.setPersonPropertiesForFlags(We({},n||{},e||{})),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.Jr=r):Ge.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,n,r){if(e&&n){var i=this.getGroups();i[e]!==n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:We({},i,{[e]:n})}),r&&(this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags({[e]:r})),i[e]===n||r||this.reloadFeatureFlags()}else Ge.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0),this.featureFlags.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0),this.ps("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,n)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var n,r,i,s;if(Ge.info("reset"),!this.__loaded)return Ge.uninitializedWarning("posthog.reset");var a=this.get_property("$device_id");if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),this.surveys.reset(),this.featureFlags.reset(),(i=this.persistence)==null||i.set_property(ho,"anonymous"),(s=this.sessionManager)==null||s.resetSessionId(),this.Jr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:lf,$device_id:null},"");else{var l=this.config.get_device_id(Fl());this.register_once({distinct_id:l,$device_id:e?l:a},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(e!=null&&e.withTimestamp&&r){var s,a=(s=e.timestampLookBack)!==null&&s!==void 0?s:10;if(!r)return i;i+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-a,0)}return i}alias(e,n){return e===this.get_property(cP)?(Ge.critical("Attempting to create alias for existing People user - aborting."),-2):this.ps("posthog.alias")?($e(n)&&(n=this.get_distinct_id()),e!==n?(this.gs(kf,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(Ge.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=We({},this.config);if(Dr(e)){var r,i,s,a,l,u,d;pr(this.config,VA(e));var f=this.Qr();(r=this.persistence)==null||r.update_config(this.config,n,f),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new r4(We({},this.config,{persistence:"sessionStorage"}),f);var p=this.Kr(this.config.debug);Ao(p)&&(this.config.debug=p),Ao(this.config.debug)&&(this.config.debug?(fo.DEBUG=!0,Xn.H()&&Xn.G("ph_debug","true"),Ge.info("set_config",{config:e,oldConfig:n,newConfig:We({},this.config)})):(fo.DEBUG=!1,Xn.H()&&Xn.V("ph_debug"))),(i=this.exceptionObserver)==null||i.onConfigChange(),(s=this.sessionRecording)==null||s.startIfEnabledOrStop(),(a=this.autocapture)==null||a.startIfEnabled(),(l=this.heatmaps)==null||l.startIfEnabled(),(u=this.exceptionObserver)==null||u.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this._s(),(d=this.externalIntegrations)==null||d.startIfEnabledOrStop()}}startSessionRecording(e){var n=e===!0,r={sampling:n||!(e==null||!e.sampling),linked_flag:n||!(e==null||!e.linked_flag),url_trigger:n||!(e==null||!e.url_trigger),event_trigger:n||!(e==null||!e.event_trigger)};if(Object.values(r).some(Boolean)){var i,s,a,l,u;(i=this.sessionManager)==null||i.checkAndGetSessionAndWindowId(),r.sampling&&((s=this.sessionRecording)==null||s.overrideSampling()),r.linked_flag&&((a=this.sessionRecording)==null||a.overrideLinkedFlag()),r.url_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("url")),r.event_trigger&&((u=this.sessionRecording)==null||u.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,n){var r=new Error("PostHog syntheticException"),i=this.exceptions.buildProperties(e,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(We({},i,n))}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var n;return(n=this.persistence)==null?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)==null?void 0:n.props[e]}toString(){var e,n=(e=this.config.name)!==null&&e!==void 0?e:cd;return n!==cd&&(n=cd+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(ho))==="identified"||((n=this.sessionPersistence)==null?void 0:n.get_property(ho))==="identified"}fs(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&pd(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[kf])&&((n=this.persistence)==null||(n=n.props)==null||!n[Z1]))}ds(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.fs()||this.ps("posthog.createPersonProfile")&&this.setPersonProperties({},{})}ps(e){return this.config.person_profiles==="never"?(Ge.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.gs(Z1,!0),!0)}Qr(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut(),n=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||e&&!!n}_s(){var e,n,r,i,s=this.Qr();return((e=this.persistence)==null?void 0:e.ki)!==s&&((r=this.persistence)==null||r.set_disabled(s)),((n=this.sessionPersistence)==null?void 0:n.ki)!==s&&((i=this.sessionPersistence)==null||i.set_disabled(s)),s}opt_in_capturing(e){var n;if(this.config.cookieless_mode!=="always"){var r,i,s;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(i=this.pageViewManager)==null||i.destroy(),this.sessionManager=new HA(this),this.pageViewManager=new kA(this),this.persistence&&(this.sessionPropsManager=new FA(this,this.sessionManager,this.persistence)),this.sessionRecording=new $A(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this._s(),this.us(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),($e(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((s=e==null?void 0:e.captureEventName)!==null&&s!==void 0?s:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.hs()}else Ge.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,n,r;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this._s(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:lf,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),(n=this.pageViewManager)==null||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(r=this.sessionRecording)==null||r.stopRecording(),this.sessionRecording=void 0,this.hs())):Ge.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===po.GRANTED?"granted":e===po.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this._s()}_is_bot(){return us?GP(us,this.config.custom_blocked_useragents):void 0}hs(){Ve&&(Ve.visibilityState==="visible"?this.Wr||(this.Wr=!0,this.capture("$pageview",{title:Ve.title},{send_instantly:!0}),this.Gr&&(Ve.removeEventListener("visibilitychange",this.Gr),this.Gr=null)):this.Gr||(this.Gr=this.hs.bind(this),Sr(Ve,"visibilitychange",this.Gr)))}debug(e){e===!1?(be==null||be.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(be==null||be.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}O(){var e,n,r,i,s,a,l,u=this.Yr||{};return"advanced_disable_flags"in u?!!u.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(Ge.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",i=!1,s=Ge,a=(n="advanced_disable_flags")in(e=u)&&!$e(e[n]),l=r in e&&!$e(e[r]),a?e[n]:l?(s&&s.warn("Config field '"+r+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),e[r]):i)}cs(e){if(nn(this.config.before_send))return e;var n=rn(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var i of n){if(r=i(r),nn(r)){var s="Event '"+e.event+"' was rejected in beforeSend function";return Yfe(e.event)?Ge.warn(s+". This can cause unexpected behavior."):Ge.info(s),null}r.properties&&!pd(r.properties)||Ge.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var e;return(e=this.pageViewManager.Kt)==null?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(r)})}Kr(e){var n=Ao(e)&&!e,r=Xn.H()&&Xn.q("ph_debug")==="true";return!n&&(!!r||e)}}(function(t,e){for(var n=0;n<e.length;n++)t.prototype[e[n]]=Nhe(t.prototype[e[n]])})(nv,["identify"]);var GA,ip=(GA=rh[cd]=new nv,(function(){function t(){t.done||(t.done=!0,YP=!1,Nn(rh,(function(e){e._dom_loaded()})))}Ve!=null&&Ve.addEventListener?Ve.readyState==="complete"?t():Sr(Ve,"DOMContentLoaded",t,{capture:!1}):be&&Ge.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),GA);let Ud=!1;function ime(){Ud||(ip.init("phc_2qafhOCTgCnygXsPEHOA0RBtJf5nvVsi7yIene4DWaF",{api_host:"https://us.i.posthog.com",person_profiles:"identified_only",capture_pageview:!0,capture_pageleave:!0,autocapture:!1,persistence:"localStorage",loaded:t=>{var e,n;(n=(e=import.meta)==null?void 0:e.env)!=null&&n.DEV&&console.log("[PostHog] Initialized in development mode")}}),Ud=!0)}function sme(t,e={}){var i,s,a,l,u;if(!t||!Ud)return;const n={email:((i=t.primaryEmailAddress)==null?void 0:i.emailAddress)||((a=(s=t.emailAddresses)==null?void 0:s[0])==null?void 0:a.emailAddress),name:t.fullName||`${t.firstName||""} ${t.lastName||""}`.trim(),first_name:t.firstName,last_name:t.lastName,avatar_url:t.imageUrl,created_at:t.createdAt,...e},r=Object.fromEntries(Object.entries(n).filter(([d,f])=>f!=null&&f!==""));ip.identify(t.id,r),(u=(l=import.meta)==null?void 0:l.env)!=null&&u.DEV&&console.log("[PostHog] User identified:",t.id,r)}function ame(){var t,e;Ud&&(ip.reset(),(e=(t=import.meta)==null?void 0:t.env)!=null&&e.DEV&&console.log("[PostHog] User reset"))}function WP(){return typeof window>"u"?"unknown":window.location.hostname}function ome(){var e,n;if(!Ud)return;const t=WP();ip.register({agent_domain:t,agent_subdomain:t.split(".")[0]}),(n=(e=import.meta)==null?void 0:e.env)!=null&&n.DEV&&console.log("[PostHog] Agent domain set:",t)}function Nr(t,e={}){var n,r;Ud&&(ip.capture(t,{...e,agent_domain:WP()}),(r=(n=import.meta)==null?void 0:n.env)!=null&&r.DEV&&console.log("[PostHog] Event:",t,e))}function lme(){Nr("user_signed_in")}function ume(){Nr("user_signed_out")}function cme(t={}){Nr("message_sent",{has_attachments:t.hasAttachments||!1,attachment_count:t.attachmentCount||0,message_length:t.messageLength||0,chat_id:t.chatId,is_new_chat:t.isNewChat||!1})}function dme(t){Nr("chat_created",{chat_id:t})}function fme(t){Nr("chat_selected",{chat_id:t})}function hme(t){Nr("chat_deleted",{chat_id:t})}function pme(){Nr("new_chat_started")}function mme(t){Nr("message_regenerated",{message_index:t})}function gme(t){Nr("message_retried",{message_index:t})}function s_(){Nr("generation_stopped")}function bme(t,e){Nr("file_upload_started",{file_name:t,file_type:e})}function vme(t,e){Nr("file_upload_completed",{file_name:t,file_type:e})}function yme(t,e){Nr("file_upload_failed",{file_name:t,error_message:e})}function YA(t){Nr("tier_modal_shown",{tier:t})}function Eme(t){Nr("tier_modal_dismissed",{tier:t})}function _me(t){Nr("upgrade_clicked",{tier:t})}function xme(t){Nr("free_limit_reached",{message_count:t})}function l4(t,e,n={}){Nr("error_occurred",{error_type:t,error_message:e,...n})}function Tme(){Nr("sidebar_opened")}function WA(){Nr("sidebar_closed")}const Sme=({messages:t,setMessages:e,setShouldFocus:n,setIsLoading:r,setUploadProgress:i,setIsUserScrolled:s,onFirstSend:a,auth:l,org:u,getToken:d,setActive:f,activeChatId:p,setActiveChatId:g,onMessageSuccess:b,analyticsEnabled:v,onCanvasEvent:E})=>{const x=z.useRef(null),S=z.useCallback(async O=>{const L=typeof O=="object"&&O!==null,D=L?O.text||"":String(O||""),R=L?O.files||[]:[];if(!D.trim()&&R.length===0){n(!0);return}if(D===":clear"&&R.length===0){e([]),g(null),Rr.setActiveChat(""),window.scrollTo(0,0);return}t.length===0&&a(),r(!0),s(!1);const F=[];for(let ee=0;ee<R.length;ee++){const ce=R[ee];try{i({fileName:ce.name,progress:0}),v&&bme(ce.name,ce.type);const we=await vre(ce);i({fileName:ce.name,progress:100}),v&&vme(ce.name,ce.type),F.push(we),setTimeout(()=>i(null),500)}catch(we){console.error("Upload error:",we),v&&yme(ce.name,we.message),i(null),r(!1),e(j=>[...j,{role:"user",content:D},{role:"assistant",parts:[],error:{type:"server",message:"Failed to upload "+ce.name+": "+we.message,status:null}}]);return}}let G=D;if(F.length>0){const ee=`<!--cycls:attachments
`+JSON.stringify(F)+`
cycls:attachments-->`;G=D+`

`+ee}const Z={role:"user",content:G},q={role:"assistant",parts:[]};e(ee=>[...ee,Z,q]);const ie=[...t,Z];let se=p;const Te=!se;se?Rr.updateChat(se,ie):(se=Rr.createChat(ie).id,g(se),v&&dme(se)),v&&cme({hasAttachments:F.length>0,attachmentCount:F.length,messageLength:D.length,chatId:se,isNewChat:Te}),x.current=new AbortController;let oe=!1,re=null;const X=()=>{re&&clearTimeout(re),re=setTimeout(()=>{x.current&&(oe=!0,x.current.abort())},3e5)};X();try{let ee=null,ce=null,we=null;await D3({messages:ie,auth:l,getToken:d,setActive:f,org:u,onPart:H=>{if(X(),H.type==="canvas"){E&&E(H),e(ne=>{const P=[...ne],Ee=P[P.length-1];return Ee.parts||(Ee.parts=[]),H.open===!0&&(we={type:"canvas",title:H.title||"Untitled",content:"",_complete:!1},Ee.parts.push(we)),H.content&&we&&(we.content+=H.content),H.done===!0&&we&&(we._complete=!0),P});return}e(ne=>{const P=[...ne],Ee=P[P.length-1];return Ee.parts||(Ee.parts=[]),H.type==="step"?(ce||(ce={type:"steps",steps:[]},Ee.parts.push(ce)),(H.step||H.data!==void 0)&&ce.steps.push({step:H.step||"",data:H.data!==void 0?H.data:null,result:H.result,_complete:!0}),ee=null,P):(ce=null,ee&&ee.type===H.type?H.row?ee.rows.push(H.row):H.type==="text"&&H.text?ee.text+=H.text:H.type==="thinking"&&H.thinking?ee.thinking+=H.thinking:H.type==="code"&&H.code&&(ee.code+=H.code):(ee&&ee.type==="thinking"&&(ee._complete=!0,ee._startTime&&(ee._duration=Math.round((Date.now()-ee._startTime)/1e3))),ee={...H},H.headers&&(ee.rows=[]),H.type==="thinking"&&(ee._startTime=Date.now()),Ee.parts.push(ee)),P)})},signal:x.current.signal}),re&&clearTimeout(re),e(H=>{const ne=[...H],P=ne[ne.length-1];return P!=null&&P.parts&&P.parts.forEach(Ee=>{Ee.type==="thinking"&&!Ee._complete&&(Ee._complete=!0,Ee._startTime&&(Ee._duration=Math.round((Date.now()-Ee._startTime)/1e3)))}),ne});const j=[...ie,q];Rr.updateChat(se,j),b&&b(),r(!1),n(!0)}catch(ee){re&&clearTimeout(re);let ce={type:"server",message:"An unexpected error occurred",status:null};if(ee.name==="AbortError")if(oe)ce={type:"timeout",message:"Request timed out. The server took too long to respond."},v&&l4("timeout",ce.message);else{console.log("Generation stopped by user"),v&&s_(),e(we=>{const j=[...we],H=j[j.length-1];if((H==null?void 0:H.role)==="assistant"&&H.parts){H.parts.push({type:"text",text:`

*[Generation stopped]*`});const ne=t.concat([Z,H]);se&&Rr.updateChat(se,ne)}return j}),r(!1),n(!0);return}else ee instanceof TypeError&&ee.message.includes("fetch")?(ce={type:"network",message:"Network error. Please check your connection and try again."},v&&l4("network",ce.message)):ee.type&&(ce=ee,v&&l4(ee.type,ee.message,{status:ee.status}));console.error("Request error:",ee),e(we=>{const j=[...we],H=j[j.length-1];return(H==null?void 0:H.role)==="assistant"&&(H.error=ce),j}),r(!1),n(!0)}},[t,l,u,d,f,p,g,b,v,e,n,r,i,s,a,E]),C=z.useCallback(()=>{x.current&&(x.current.abort(),x.current=null)},[]);return{send:S,handleStop:C}},wme=t=>{const[e,n]=z.useState(!1);return z.useEffect(()=>{const r=()=>n(window.innerWidth<768);return r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),e?0:t?Zg.expanded:Zg.collapsed},kme=(t,e,n=null,r=!0)=>{const i=z.useRef(null);z.useEffect(()=>{!e||!r||(n?i.current!==n.id&&(sme(n,{subscription_status:t?"paid":"free"}),i.current===null&&lme(),i.current=n.id):i.current!==null&&(ume(),ame(),i.current=null))},[n,r,t,e])},Cme=({HEADER:t,INTRO:e,AUTH:n,ORG:r,TITLE:i,TIER:s})=>A.jsx(KP,{HEADER:t,INTRO:e,AUTH:n,ORG:r,TITLE:i,TIER:s,authApi:null,clerkApi:null,userApi:{user:null,isLoaded:!0},subscription:null,isSubscriptionLoading:!1,subscriptionError:null}),Ame=({HEADER:t,INTRO:e,AUTH:n,ORG:r,TITLE:i,TIER:s})=>{const a=Lh(),l=WH(),u=KH(),{subscription:d,isLoading:f,error:p}=Zre();return A.jsx(KP,{HEADER:t,INTRO:e,AUTH:n,ORG:r,TITLE:i,TIER:s,authApi:a,clerkApi:l,userApi:u,subscription:d,isSubscriptionLoading:f,subscriptionError:p})},KA=t=>A.jsx(Sre,{children:t.AUTH?A.jsx(Ame,{...t}):A.jsx(Cme,{...t})}),KP=({HEADER:t,INTRO:e,AUTH:n,ORG:r,TITLE:i,TIER:s,authApi:a,clerkApi:l,userApi:u,subscription:d,isSubscriptionLoading:f,subscriptionError:p})=>{const g=uU(),{state:b,openCanvas:v,appendContent:E,markDone:x,closeCanvas:S}=Xd(),{chatWidthPercent:C,isMobile:O}=yR(b.isOpen),[L,D]=z.useState([]),[R,F]=z.useState(!1),[G,Z]=z.useState(!1),[q,ie]=z.useState(null),[se,Te]=z.useState(!1),[oe,re]=z.useState(!1),[X,ee]=z.useState(null),ce=z.useRef(null),[we,j]=z.useState(!1),[H,ne]=z.useState([]),[P,Ee]=z.useState(null),Fe=wme(we),[He,it]=z.useState(!1),[kt,Tt]=z.useState(0),St=5,Jn=z.useCallback(()=>{it(!1),g&&Eme(s)},[s,g]),Un=z.useMemo(()=>{var Ae,pt,sn;return d?((sn=(pt=(Ae=d==null?void 0:d.subscriptionItems)==null?void 0:Ae[0])==null?void 0:pt.plan)==null?void 0:sn.name)==="Cycls Pass":!1},[d]),At=z.useMemo(()=>{var Ae,pt,sn;return d&&((sn=(pt=(Ae=d==null?void 0:d.subscriptionItems)==null?void 0:Ae[0])==null?void 0:pt.plan)==null?void 0:sn.name)||null},[d]);kme(n&&Un,g&&n,(u==null?void 0:u.user)||null,(u==null?void 0:u.isLoaded)??!0);const gt=z.useMemo(()=>!n||s!=="cycls_pass"||Un?!1:kt>=St,[n,s,Un,kt,St]);z.useEffect(()=>{Un&&(jfe(),Tt(0),it(!1))},[Un]),z.useEffect(()=>{const Ae=Rr.getAllChats();ne(Ae),Tt(zL())},[]),z.useEffect(()=>{L.length>0&&P&&(Rr.updateChat(P,L),ne(Rr.getAllChats()))},[L,P]),z.useEffect(()=>{document.title=i},[i]),z.useEffect(()=>{const Ae=()=>{const pt=window.scrollY||document.documentElement.scrollTop,sn=document.documentElement.scrollHeight,hi=window.innerHeight,Yn=sn-pt-hi<100;re(!Yn)};return window.addEventListener("scroll",Ae),()=>window.removeEventListener("scroll",Ae)},[]),z.useEffect(()=>{!oe&&ce.current&&ce.current.scrollIntoView({behavior:"smooth"})},[L,oe]),z.useEffect(()=>{if(R){const Ae=document.querySelector("textarea");Ae==null||Ae.focus(),F(!1)}},[R]);const Yt=z.useCallback(()=>{if(!n||s!=="cycls_pass"||Un)return;const Ae=Hfe();Tt(Ae),Ae>=St&&(it(!0),g&&xme(Ae),g&&YA(s))},[n,s,Un,St,g]),Qe=z.useCallback(Ae=>{Ae.open===!0&&v({title:Ae.title||"Untitled"}),Ae.content&&E(Ae.content),Ae.done===!0&&x(),Ae.open===!1&&S()},[v,E,x,S]),{send:$t,handleStop:wn}=Sme({messages:L,setMessages:D,setShouldFocus:F,setIsLoading:Z,setUploadProgress:ie,setIsUserScrolled:re,onFirstSend:()=>Te(!0),auth:n,org:r,getToken:a==null?void 0:a.getToken,setActive:l==null?void 0:l.setActive,activeChatId:P,setActiveChatId:Ee,onMessageSuccess:Yt,analyticsEnabled:g,onCanvasEvent:Qe}),zt=z.useCallback(()=>{D([]),Ee(null),Te(!1),Rr.setActiveChat(""),window.scrollTo(0,0),g&&pme()},[g]),vn=z.useCallback(Ae=>{const pt=Rr.getChat(Ae);pt&&(D(pt.messages),Ee(Ae),Te(pt.messages.length>0),Rr.setActiveChat(Ae),window.innerWidth<768&&j(!1),window.scrollTo(0,0),g&&fme(Ae))},[g]),Or=z.useCallback(Ae=>{Rr.deleteChat(Ae),ne(Rr.getAllChats()),g&&hme(Ae),Ae===P&&zt()},[P,zt,g]),ra=z.useCallback(()=>{const Ae=!we;j(Ae),g&&(Ae?Tme():WA())},[we,g]),Hs=z.useCallback(()=>{j(!1),g&&WA()},[g]),fn=z.useCallback(async Ae=>{const pt=Ae-1;if(pt<0)return;g&&mme(Ae),D(Je=>{const Qt=[...Je],Pe=Qt[Ae];return((Pe==null?void 0:Pe.type)==="response"||(Pe==null?void 0:Pe.role)==="assistant")&&(Qt[Ae]={role:"assistant",parts:[]}),Qt});const sn=L[pt];if(!(sn.type==="request"||sn.role==="user"))return;const Yn=L.slice(0,Ae);Z(!0),re(!1);const hn=new AbortController;let er=!1,xt=null;const ni=()=>{xt&&clearTimeout(xt),xt=setTimeout(()=>{er=!0,hn.abort()},3e5)};ni();try{let Je=null,Qt=null;await D3({messages:Yn,auth:n,getToken:a==null?void 0:a.getToken,setActive:l==null?void 0:l.setActive,org:r,onPart:Pe=>{ni(),D(kn=>{const Mn=[...kn],It=Mn[Ae];return It.parts||(It.parts=[]),Pe.type==="step"?(Qt||(Qt={type:"steps",steps:[]},It.parts.push(Qt)),(Pe.step||Pe.data!==void 0)&&Qt.steps.push({step:Pe.step||"",data:Pe.data!==void 0?Pe.data:null,result:Pe.result,_complete:!0}),Je=null,Mn):(Qt=null,Je&&Je.type===Pe.type?Pe.row?Je.rows.push(Pe.row):Pe.type==="text"&&Pe.text?Je.text+=Pe.text:Pe.type==="thinking"&&Pe.thinking?Je.thinking+=Pe.thinking:Pe.type==="code"&&Pe.code&&(Je.code+=Pe.code):(Je&&Je.type==="thinking"&&(Je._complete=!0,Je._startTime&&(Je._duration=Math.round((Date.now()-Je._startTime)/1e3))),Je={...Pe},Pe.headers&&(Je.rows=[]),Pe.type==="thinking"&&(Je._startTime=Date.now()),It.parts.push(Je)),Mn)})},signal:hn.signal}),xt&&clearTimeout(xt),D(Pe=>{const kn=[...Pe],Mn=kn[Ae];return Mn!=null&&Mn.parts&&Mn.parts.forEach(It=>{It.type==="thinking"&&!It._complete&&(It._complete=!0,It._startTime&&(It._duration=Math.round((Date.now()-It._startTime)/1e3)))}),kn}),P&&D(Pe=>(Rr.updateChat(P,Pe),ne(Rr.getAllChats()),Pe)),Z(!1),F(!0)}catch(Je){if(xt&&clearTimeout(xt),Je.name==="AbortError"&&!er){g&&s_(),D(Qt=>{const Pe=[...Qt],kn=Pe[Ae];return kn!=null&&kn.parts&&kn.parts.push({type:"text",text:`

*[Generation stopped]*`}),P&&Rr.updateChat(P,Pe),Pe}),Z(!1),F(!0);return}console.error("Regeneration error:",Je),D(Qt=>{const Pe=[...Qt];return Pe[Ae].error={type:"server",message:Je.message||"Error"},Pe}),Z(!1)}},[L,n,r,a==null?void 0:a.getToken,l==null?void 0:l.setActive,P,g]),lr=z.useCallback(async Ae=>{const pt=Ae-1;if(pt<0)return;g&&gme(Ae),ee(Ae),D(Je=>{const Qt=[...Je],Pe=Qt[Ae];return((Pe==null?void 0:Pe.type)==="response"||(Pe==null?void 0:Pe.role)==="assistant")&&(Qt[Ae]={role:"assistant",parts:[]}),Qt});const sn=L[pt];if(!(sn.type==="request"||sn.role==="user")){ee(null);return}const Yn=L.slice(0,Ae);Z(!0),re(!1);const hn=new AbortController;let er=!1,xt=null;const ni=()=>{xt&&clearTimeout(xt),xt=setTimeout(()=>{er=!0,hn.abort()},3e5)};ni();try{let Je=null,Qt=null;await D3({messages:Yn,auth:n,getToken:a==null?void 0:a.getToken,setActive:l==null?void 0:l.setActive,org:r,onPart:Pe=>{ni(),D(kn=>{const Mn=[...kn],It=Mn[Ae];return It.parts||(It.parts=[]),Pe.type==="step"?(Qt||(Qt={type:"steps",steps:[]},It.parts.push(Qt)),(Pe.step||Pe.data!==void 0)&&Qt.steps.push({step:Pe.step||"",data:Pe.data!==void 0?Pe.data:null,result:Pe.result,_complete:!0}),Je=null,Mn):(Qt=null,Je&&Je.type===Pe.type?Pe.row?Je.rows.push(Pe.row):Pe.type==="text"&&Pe.text?Je.text+=Pe.text:Pe.type==="thinking"&&Pe.thinking?Je.thinking+=Pe.thinking:Pe.type==="code"&&Pe.code&&(Je.code+=Pe.code):(Je&&Je.type==="thinking"&&(Je._complete=!0,Je._startTime&&(Je._duration=Math.round((Date.now()-Je._startTime)/1e3))),Je={...Pe},Pe.headers&&(Je.rows=[]),Pe.type==="thinking"&&(Je._startTime=Date.now()),It.parts.push(Je)),Mn)})},signal:hn.signal}),xt&&clearTimeout(xt),D(Pe=>{const kn=[...Pe],Mn=kn[Ae];return Mn!=null&&Mn.parts&&Mn.parts.forEach(It=>{It.type==="thinking"&&!It._complete&&(It._complete=!0,It._startTime&&(It._duration=Math.round((Date.now()-It._startTime)/1e3)))}),kn}),P&&D(Pe=>(Rr.updateChat(P,Pe),ne(Rr.getAllChats()),Pe)),Z(!1),ee(null),F(!0)}catch(Je){if(xt&&clearTimeout(xt),Je.name==="AbortError"&&!er){g&&s_(),D(Qt=>{const Pe=[...Qt],kn=Pe[Ae];return kn!=null&&kn.parts&&kn.parts.push({type:"text",text:`

*[Generation stopped]*`}),P&&Rr.updateChat(P,Pe),Pe}),Z(!1),ee(null),F(!0);return}console.error("Retry error:",Je),D(Qt=>{const Pe=[...Qt];return Pe[Ae].error={type:"server",message:Je.message||"Error"},Pe}),Z(!1),ee(null)}},[L,n,r,a==null?void 0:a.getToken,l==null?void 0:l.setActive,P,g]),ge=z.useCallback(()=>{it(!0),g&&(_me(s),YA(s))},[s,g]),Re=L.length===0,lt=n?A.jsx(Vj,{appearance:{elements:{avatarBox:"w-6 h-6",userButtonTrigger:"focus:shadow-none"}}}):null;return A.jsxs("div",{className:"min-h-screen theme-transition",style:{backgroundColor:"var(--bg-primary)"},children:[A.jsx(bR,{isAuthenticated:n&&(a==null?void 0:a.isSignedIn),isPublic:!n,meta:{title:i,description:t}}),A.jsx(Wre,{isOpen:we,onClose:Hs,onToggle:ra,chats:H,activeChat:P,onSelectChat:vn,onNewChat:zt,onDeleteChat:Or,user:u==null?void 0:u.user,isOnPaidPlan:Un,tierName:At,UserButtonComponent:lt,isAuthenticated:n}),A.jsx(Kre,{open:He&&s==="cycls_pass",onClose:Jn,tier:s||"Pro"}),A.jsxs("main",{className:"min-h-screen transition-all duration-300 ease-in-out",style:{marginLeft:`${Fe}px`,width:b.isOpen&&!O?`calc(${C}% - ${Fe}px)`:`calc(100% - ${Fe}px)`},children:[A.jsx("div",{className:"p-10",children:A.jsxs("div",{className:"fixed max-sm:top-[2%] max-sm:right-1 top-1 right-4 flex items-center gap-1 z-20",children:[A.jsx(e9,{}),n&&A.jsxs("a",{href:"https://cycls.ai/",type:"button",className:`
                inline-flex items-center gap-2
                rounded-xl px-3 py-2
                text-sm font-medium
                hover:bg-[var(--bg-hover)]
                active:bg-[var(--bg-active)]
                transition-colors
                focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--text-primary)]/20
              `,style:{color:"var(--text-primary)"},children:[A.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[A.jsx("path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8"}),A.jsx("path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"})]}),A.jsx("span",{children:"Home"})]})]})}),A.jsxs("div",{className:"mx-auto max-w-3xl min-h-screen px-4 pb-[200px] md:pb-[180px]",children:[q&&A.jsx(zre,{fileName:q.fileName,progress:q.progress}),A.jsx("div",{className:"prose m-2 mx-auto max-w-3xl p-2 prose-pre:p-0 pt-14 md:pt-2",children:A.jsx(Wu,{markdown:t,onSend:$t})}),!Re&&A.jsxs("div",{className:`transition-opacity duration-500 ${se?"opacity-100":"opacity-0"}`,children:[A.jsx(gR,{messages:L,onSend:$t,onRegenerate:fn,onRetry:lr,retryingIndex:X,isGenerating:G}),A.jsx("div",{ref:ce})]}),Re&&!se&&e&&e.trim()!==""&&A.jsx("div",{className:"mx-auto max-w-3xl prose prose-sm prose-pre:p-0",children:A.jsx(Wu,{markdown:e,onSend:$t})})]})]}),A.jsx(zfe,{}),A.jsx(Bre,{onSend:$t,isLoading:G,onStop:wn,disabled:gt,onUpgradeClick:ge,sidebarWidth:Fe,canvasOpen:b.isOpen,canvasWidthPercent:b.isOpen&&!O?100-C:0})]})},XA=({meta:t})=>{const e=!!t.prod,n=!!t.auth,r=String(t.header??""),i=String(t.intro??""),s=String(t.title??"AI Agent"),a=t.tier||null,l=t.pk,u=t.org||void 0,d=typeof window<"u"?window.location.origin+"/":"/";if(!n)return A.jsx(KA,{HEADER:r,INTRO:i,AUTH:n,ORG:u,TITLE:s,TIER:a});const f=e?{isSatellite:!1,domain:"cycls.ai",fallbackRedirectUrl:d,forceRedirectUrl:d}:{fallbackRedirectUrl:d,forceRedirectUrl:d};return A.jsx(iN,{publishableKey:l,...f,children:A.jsx(Jre,{tier:a,children:A.jsx(OF,{children:A.jsxs(aF,{children:[A.jsx(hg,{path:"/auth",element:A.jsx(Xre,{afterUrl:d})}),A.jsx(hg,{path:"/",element:A.jsx(Qre,{children:A.jsx(KA,{HEADER:r,INTRO:i,AUTH:n,ORG:u,TITLE:s,TIER:a})})}),A.jsx(hg,{path:"*",element:A.jsx(m9,{to:"/",replace:!0})})]})})})})};function Nme(){const[t,e]=le.useState({status:"loading"});return le.useEffect(()=>{const n=new AbortController;return(async()=>{try{const r=await Ffe(n.signal);e({status:"ready",data:r})}catch(r){e({status:"error",error:r})}})(),()=>n.abort()},[]),t}const Ome=()=>{var n,r,i,s;const t=Nme();if(z.useEffect(()=>{var a;t.status==="ready"&&((a=t.data)==null?void 0:a.analytics)===!0&&(ime(),ome())},[t.status,(n=t.data)==null?void 0:n.analytics]),t.status==="loading")return A.jsx(c2,{children:A.jsx("div",{className:"min-h-screen grid place-items-center text-sm",style:{backgroundColor:"var(--bg-primary)",color:"var(--text-tertiary)"},children:"Loading…"})});if(t.status==="error"){console.error("Failed to load /metadata:",t.error);const a={header:"",intro:"",prod:((i=(r=import.meta)==null?void 0:r.env)==null?void 0:i.PROD)||!1,auth:!1,title:"AI Agent",tier:null,analytics:!1};return A.jsx(c2,{children:A.jsx(c4.Provider,{value:!1,children:A.jsx(XA,{meta:a})})})}const e=((s=t.data)==null?void 0:s.analytics)===!0;return A.jsx(c2,{children:A.jsx(c4.Provider,{value:e,children:A.jsx(XA,{meta:t.data})})})},Dg=document.getElementById("root");Dg._reactRoot||(Dg._reactRoot=lU.createRoot(Dg));Dg._reactRoot.render(A.jsx(Ome,{}));export{ER as _,Dme as a,Rme as c,Oh as g};
