yamchart 0.4.16 → 0.4.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-WHBVCIPG.js → chunk-3RYZTXPH.js} +2 -2
- package/dist/{chunk-2LNDAMKT.js → chunk-45SP26I2.js} +2 -2
- package/dist/{chunk-YL6BW3HW.js → chunk-UDRJFEJU.js} +3 -2
- package/dist/chunk-UDRJFEJU.js.map +1 -0
- package/dist/{connection-utils-Y7AWIC5M.js → connection-utils-26ZE4KUZ.js} +3 -3
- package/dist/{describe-ZAEVM3XT.js → describe-SYP5GZ3H.js} +3 -3
- package/dist/{dev-XC47BMBS.js → dev-OHAXDNXA.js} +51 -26
- package/dist/dev-OHAXDNXA.js.map +1 -0
- package/dist/index.js +11 -11
- package/dist/public/assets/LoginPage-CxndtZJm.js +1 -0
- package/dist/public/assets/PublicViewer-DChSzHTJ.js +1 -0
- package/dist/public/assets/SetupWizard-7MTCsUPb.js +1 -0
- package/dist/public/assets/ShareManagement-BWUH63Ps.js +1 -0
- package/dist/public/assets/UserManagement-DjFfUMg8.js +1 -0
- package/dist/public/assets/{index-CLYPNLML.css → index-CVBWIBuV.css} +1 -1
- package/dist/public/assets/index-_hAEavHQ.js +165 -0
- package/dist/public/assets/{index.es-DOh98lYb.js → index.es-BBtc9P44.js} +1 -1
- package/dist/public/assets/{jspdf.es.min-C599hpR0.js → jspdf.es.min-DG8sO809.js} +3 -3
- package/dist/public/index.html +2 -2
- package/dist/{query-3KIMOYUD.js → query-LRPR6YRE.js} +3 -3
- package/dist/{sample-PR4P7ZXF.js → sample-D4HDOJWP.js} +3 -3
- package/dist/{search-E53W6CR5.js → search-CXBNM2KK.js} +3 -3
- package/dist/{tables-X2GY5AVA.js → tables-ZY3NRC6E.js} +3 -3
- package/dist/templates/default/docs/yamchart-reference.md +14 -0
- package/dist/{test-7R7EGFOI.js → test-NKYO32Y5.js} +3 -3
- package/package.json +2 -2
- package/dist/chunk-YL6BW3HW.js.map +0 -1
- package/dist/dev-XC47BMBS.js.map +0 -1
- package/dist/public/assets/LoginPage-OqFkz_X-.js +0 -1
- package/dist/public/assets/PublicViewer-bqV4skXX.js +0 -1
- package/dist/public/assets/SetupWizard-tGgbMxMZ.js +0 -1
- package/dist/public/assets/ShareManagement-T_AFVxIm.js +0 -1
- package/dist/public/assets/UserManagement-tXhwFzPz.js +0 -1
- package/dist/public/assets/index-zwep09NU.js +0 -164
- /package/dist/{chunk-WHBVCIPG.js.map → chunk-3RYZTXPH.js.map} +0 -0
- /package/dist/{chunk-2LNDAMKT.js.map → chunk-45SP26I2.js.map} +0 -0
- /package/dist/{connection-utils-Y7AWIC5M.js.map → connection-utils-26ZE4KUZ.js.map} +0 -0
- /package/dist/{describe-ZAEVM3XT.js.map → describe-SYP5GZ3H.js.map} +0 -0
- /package/dist/{query-3KIMOYUD.js.map → query-LRPR6YRE.js.map} +0 -0
- /package/dist/{sample-PR4P7ZXF.js.map → sample-D4HDOJWP.js.map} +0 -0
- /package/dist/{search-E53W6CR5.js.map → search-CXBNM2KK.js.map} +0 -0
- /package/dist/{tables-X2GY5AVA.js.map → tables-ZY3NRC6E.js.map} +0 -0
- /package/dist/{test-7R7EGFOI.js.map → test-NKYO32Y5.js.map} +0 -0
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LoginPage-OqFkz_X-.js","assets/echarts-DtOYsfLX.js","assets/SetupWizard-tGgbMxMZ.js","assets/UserManagement-tXhwFzPz.js","assets/ShareManagement-T_AFVxIm.js","assets/PublicViewer-bqV4skXX.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var Pv=Object.defineProperty;var Wg=e=>{throw TypeError(e)};var Fv=(e,t,n)=>t in e?Pv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ve=(e,t,n)=>Fv(e,typeof t!="symbol"?t+"":t,n),qf=(e,t,n)=>t.has(e)||Wg("Cannot "+n);var W=(e,t,n)=>(qf(e,t,"read from private field"),n?n.call(e):t.get(e)),we=(e,t,n)=>t.has(e)?Wg("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ye=(e,t,n,r)=>(qf(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),je=(e,t,n)=>(qf(e,t,"access private method"),n);var ac=(e,t,n,r)=>({set _(a){ye(e,t,a,n)},get _(){return W(e,t,r)}});import{r as ti,a as L,R as Ee,E as jv,g as wb}from"./echarts-DtOYsfLX.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(a){if(a.ep)return;a.ep=!0;const o=n(a);fetch(a.href,o)}})();var $f={exports:{}},Zo={};/**
|
|
3
|
-
* @license React
|
|
4
|
-
* react-jsx-runtime.production.min.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var Yg;function Bv(){if(Yg)return Zo;Yg=1;var e=ti(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function l(c,d,h){var m,g={},E=null,x=null;h!==void 0&&(E=""+h),d.key!==void 0&&(E=""+d.key),d.ref!==void 0&&(x=d.ref);for(m in d)r.call(d,m)&&!o.hasOwnProperty(m)&&(g[m]=d[m]);if(c&&c.defaultProps)for(m in d=c.defaultProps,d)g[m]===void 0&&(g[m]=d[m]);return{$$typeof:t,type:c,key:E,ref:x,props:g,_owner:a.current}}return Zo.Fragment=n,Zo.jsx=l,Zo.jsxs=l,Zo}var qg;function Hv(){return qg||(qg=1,$f.exports=Bv()),$f.exports}var p=Hv(),ic={},Vf={exports:{}},Qn={},Qf={exports:{}},Gf={};/**
|
|
11
|
-
* @license React
|
|
12
|
-
* scheduler.production.min.js
|
|
13
|
-
*
|
|
14
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the MIT license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var $g;function Uv(){return $g||($g=1,(function(e){function t(Z,K){var R=Z.length;Z.push(K);e:for(;0<R;){var ae=R-1>>>1,ue=Z[ae];if(0<a(ue,K))Z[ae]=K,Z[R]=ue,R=ae;else break e}}function n(Z){return Z.length===0?null:Z[0]}function r(Z){if(Z.length===0)return null;var K=Z[0],R=Z.pop();if(R!==K){Z[0]=R;e:for(var ae=0,ue=Z.length,z=ue>>>1;ae<z;){var Oe=2*(ae+1)-1,Be=Z[Oe],Te=Oe+1,Ze=Z[Te];if(0>a(Be,R))Te<ue&&0>a(Ze,Be)?(Z[ae]=Ze,Z[Te]=R,ae=Te):(Z[ae]=Be,Z[Oe]=R,ae=Oe);else if(Te<ue&&0>a(Ze,R))Z[ae]=Ze,Z[Te]=R,ae=Te;else break e}}return K}function a(Z,K){var R=Z.sortIndex-K.sortIndex;return R!==0?R:Z.id-K.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var d=[],h=[],m=1,g=null,E=3,x=!1,C=!1,S=!1,w=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function O(Z){for(var K=n(h);K!==null;){if(K.callback===null)r(h);else if(K.startTime<=Z)r(h),K.sortIndex=K.expirationTime,t(d,K);else break;K=n(h)}}function A(Z){if(S=!1,O(Z),!C)if(n(d)!==null)C=!0,Q(P);else{var K=n(h);K!==null&&re(A,K.startTime-Z)}}function P(Z,K){C=!1,S&&(S=!1,v(I),I=-1),x=!0;var R=E;try{for(O(K),g=n(d);g!==null&&(!(g.expirationTime>K)||Z&&!M());){var ae=g.callback;if(typeof ae=="function"){g.callback=null,E=g.priorityLevel;var ue=ae(g.expirationTime<=K);K=e.unstable_now(),typeof ue=="function"?g.callback=ue:g===n(d)&&r(d),O(K)}else r(d);g=n(d)}if(g!==null)var z=!0;else{var Oe=n(h);Oe!==null&&re(A,Oe.startTime-K),z=!1}return z}finally{g=null,E=R,x=!1}}var _=!1,N=null,I=-1,F=5,j=-1;function M(){return!(e.unstable_now()-j<F)}function H(){if(N!==null){var Z=e.unstable_now();j=Z;var K=!0;try{K=N(!0,Z)}finally{K?$():(_=!1,N=null)}}else _=!1}var $;if(typeof k=="function")$=function(){k(H)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,J=G.port2;G.port1.onmessage=H,$=function(){J.postMessage(null)}}else $=function(){w(H,0)};function Q(Z){N=Z,_||(_=!0,$())}function re(Z,K){I=w(function(){Z(e.unstable_now())},K)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(Z){Z.callback=null},e.unstable_continueExecution=function(){C||x||(C=!0,Q(P))},e.unstable_forceFrameRate=function(Z){0>Z||125<Z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<Z?Math.floor(1e3/Z):5},e.unstable_getCurrentPriorityLevel=function(){return E},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(Z){switch(E){case 1:case 2:case 3:var K=3;break;default:K=E}var R=E;E=K;try{return Z()}finally{E=R}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(Z,K){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var R=E;E=Z;try{return K()}finally{E=R}},e.unstable_scheduleCallback=function(Z,K,R){var ae=e.unstable_now();switch(typeof R=="object"&&R!==null?(R=R.delay,R=typeof R=="number"&&0<R?ae+R:ae):R=ae,Z){case 1:var ue=-1;break;case 2:ue=250;break;case 5:ue=1073741823;break;case 4:ue=1e4;break;default:ue=5e3}return ue=R+ue,Z={id:m++,callback:K,priorityLevel:Z,startTime:R,expirationTime:ue,sortIndex:-1},R>ae?(Z.sortIndex=R,t(h,Z),n(d)===null&&Z===n(h)&&(S?(v(I),I=-1):S=!0,re(A,R-ae))):(Z.sortIndex=ue,t(d,Z),C||x||(C=!0,Q(P))),Z},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(Z){var K=E;return function(){var R=E;E=K;try{return Z.apply(this,arguments)}finally{E=R}}}})(Gf)),Gf}var Vg;function zv(){return Vg||(Vg=1,Qf.exports=Uv()),Qf.exports}/**
|
|
19
|
-
* @license React
|
|
20
|
-
* react-dom.production.min.js
|
|
21
|
-
*
|
|
22
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the MIT license found in the
|
|
25
|
-
* LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/var Qg;function Wv(){if(Qg)return Qn;Qg=1;var e=ti(),t=zv();function n(s){for(var i="https://reactjs.org/docs/error-decoder.html?invariant="+s,u=1;u<arguments.length;u++)i+="&args[]="+encodeURIComponent(arguments[u]);return"Minified React error #"+s+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,a={};function o(s,i){l(s,i),l(s+"Capture",i)}function l(s,i){for(a[s]=i,s=0;s<i.length;s++)r.add(i[s])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,h=/^[: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]*$/,m={},g={};function E(s){return d.call(g,s)?!0:d.call(m,s)?!1:h.test(s)?g[s]=!0:(m[s]=!0,!1)}function x(s,i,u,f){if(u!==null&&u.type===0)return!1;switch(typeof i){case"function":case"symbol":return!0;case"boolean":return f?!1:u!==null?!u.acceptsBooleans:(s=s.toLowerCase().slice(0,5),s!=="data-"&&s!=="aria-");default:return!1}}function C(s,i,u,f){if(i===null||typeof i>"u"||x(s,i,u,f))return!0;if(f)return!1;if(u!==null)switch(u.type){case 3:return!i;case 4:return i===!1;case 5:return isNaN(i);case 6:return isNaN(i)||1>i}return!1}function S(s,i,u,f,b,T,D){this.acceptsBooleans=i===2||i===3||i===4,this.attributeName=f,this.attributeNamespace=b,this.mustUseProperty=u,this.propertyName=s,this.type=i,this.sanitizeURL=T,this.removeEmptyString=D}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(s){w[s]=new S(s,0,!1,s,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(s){var i=s[0];w[i]=new S(i,1,!1,s[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(s){w[s]=new S(s,2,!1,s.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(s){w[s]=new S(s,2,!1,s,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(s){w[s]=new S(s,3,!1,s.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(s){w[s]=new S(s,3,!0,s,null,!1,!1)}),["capture","download"].forEach(function(s){w[s]=new S(s,4,!1,s,null,!1,!1)}),["cols","rows","size","span"].forEach(function(s){w[s]=new S(s,6,!1,s,null,!1,!1)}),["rowSpan","start"].forEach(function(s){w[s]=new S(s,5,!1,s.toLowerCase(),null,!1,!1)});var v=/[\-:]([a-z])/g;function k(s){return s[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(s){var i=s.replace(v,k);w[i]=new S(i,1,!1,s,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(s){var i=s.replace(v,k);w[i]=new S(i,1,!1,s,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(s){var i=s.replace(v,k);w[i]=new S(i,1,!1,s,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(s){w[s]=new S(s,1,!1,s.toLowerCase(),null,!1,!1)}),w.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(s){w[s]=new S(s,1,!1,s.toLowerCase(),null,!0,!0)});function O(s,i,u,f){var b=w.hasOwnProperty(i)?w[i]:null;(b!==null?b.type!==0:f||!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(C(i,u,b,f)&&(u=null),f||b===null?E(i)&&(u===null?s.removeAttribute(i):s.setAttribute(i,""+u)):b.mustUseProperty?s[b.propertyName]=u===null?b.type===3?!1:"":u:(i=b.attributeName,f=b.attributeNamespace,u===null?s.removeAttribute(i):(b=b.type,u=b===3||b===4&&u===!0?"":""+u,f?s.setAttributeNS(f,i,u):s.setAttribute(i,u))))}var A=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,P=Symbol.for("react.element"),_=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),j=Symbol.for("react.provider"),M=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),re=Symbol.for("react.offscreen"),Z=Symbol.iterator;function K(s){return s===null||typeof s!="object"?null:(s=Z&&s[Z]||s["@@iterator"],typeof s=="function"?s:null)}var R=Object.assign,ae;function ue(s){if(ae===void 0)try{throw Error()}catch(u){var i=u.stack.trim().match(/\n( *(at )?)/);ae=i&&i[1]||""}return`
|
|
27
|
-
`+ae+s}var z=!1;function Oe(s,i){if(!s||z)return"";z=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(i)if(i=function(){throw Error()},Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(se){var f=se}Reflect.construct(s,[],i)}else{try{i.call()}catch(se){f=se}s.call(i.prototype)}else{try{throw Error()}catch(se){f=se}s()}}catch(se){if(se&&f&&typeof se.stack=="string"){for(var b=se.stack.split(`
|
|
28
|
-
`),T=f.stack.split(`
|
|
29
|
-
`),D=b.length-1,Y=T.length-1;1<=D&&0<=Y&&b[D]!==T[Y];)Y--;for(;1<=D&&0<=Y;D--,Y--)if(b[D]!==T[Y]){if(D!==1||Y!==1)do if(D--,Y--,0>Y||b[D]!==T[Y]){var V=`
|
|
30
|
-
`+b[D].replace(" at new "," at ");return s.displayName&&V.includes("<anonymous>")&&(V=V.replace("<anonymous>",s.displayName)),V}while(1<=D&&0<=Y);break}}}finally{z=!1,Error.prepareStackTrace=u}return(s=s?s.displayName||s.name:"")?ue(s):""}function Be(s){switch(s.tag){case 5:return ue(s.type);case 16:return ue("Lazy");case 13:return ue("Suspense");case 19:return ue("SuspenseList");case 0:case 2:case 15:return s=Oe(s.type,!1),s;case 11:return s=Oe(s.type.render,!1),s;case 1:return s=Oe(s.type,!0),s;default:return""}}function Te(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case N:return"Fragment";case _:return"Portal";case F:return"Profiler";case I:return"StrictMode";case $:return"Suspense";case G:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case M:return(s.displayName||"Context")+".Consumer";case j:return(s._context.displayName||"Context")+".Provider";case H:var i=s.render;return s=s.displayName,s||(s=i.displayName||i.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case J:return i=s.displayName||null,i!==null?i:Te(s.type)||"Memo";case Q:i=s._payload,s=s._init;try{return Te(s(i))}catch{}}return null}function Ze(s){var i=s.type;switch(s.tag){case 24:return"Cache";case 9:return(i.displayName||"Context")+".Consumer";case 10:return(i._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return s=i.render,s=s.displayName||s.name||"",i.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return i;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Te(i);case 8:return i===I?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i}return null}function $e(s){switch(typeof s){case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Ge(s){var i=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function tt(s){var i=Ge(s)?"checked":"value",u=Object.getOwnPropertyDescriptor(s.constructor.prototype,i),f=""+s[i];if(!s.hasOwnProperty(i)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var b=u.get,T=u.set;return Object.defineProperty(s,i,{configurable:!0,get:function(){return b.call(this)},set:function(D){f=""+D,T.call(this,D)}}),Object.defineProperty(s,i,{enumerable:u.enumerable}),{getValue:function(){return f},setValue:function(D){f=""+D},stopTracking:function(){s._valueTracker=null,delete s[i]}}}}function We(s){s._valueTracker||(s._valueTracker=tt(s))}function pn(s){if(!s)return!1;var i=s._valueTracker;if(!i)return!0;var u=i.getValue(),f="";return s&&(f=Ge(s)?s.checked?"true":"false":s.value),s=f,s!==u?(i.setValue(s),!0):!1}function Gt(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}function Hn(s,i){var u=i.checked;return R({},i,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??s._wrapperState.initialChecked})}function tn(s,i){var u=i.defaultValue==null?"":i.defaultValue,f=i.checked!=null?i.checked:i.defaultChecked;u=$e(i.value!=null?i.value:u),s._wrapperState={initialChecked:f,initialValue:u,controlled:i.type==="checkbox"||i.type==="radio"?i.checked!=null:i.value!=null}}function nn(s,i){i=i.checked,i!=null&&O(s,"checked",i,!1)}function mn(s,i){nn(s,i);var u=$e(i.value),f=i.type;if(u!=null)f==="number"?(u===0&&s.value===""||s.value!=u)&&(s.value=""+u):s.value!==""+u&&(s.value=""+u);else if(f==="submit"||f==="reset"){s.removeAttribute("value");return}i.hasOwnProperty("value")?it(s,i.type,u):i.hasOwnProperty("defaultValue")&&it(s,i.type,$e(i.defaultValue)),i.checked==null&&i.defaultChecked!=null&&(s.defaultChecked=!!i.defaultChecked)}function tr(s,i,u){if(i.hasOwnProperty("value")||i.hasOwnProperty("defaultValue")){var f=i.type;if(!(f!=="submit"&&f!=="reset"||i.value!==void 0&&i.value!==null))return;i=""+s._wrapperState.initialValue,u||i===s.value||(s.value=i),s.defaultValue=i}u=s.name,u!==""&&(s.name=""),s.defaultChecked=!!s._wrapperState.initialChecked,u!==""&&(s.name=u)}function it(s,i,u){(i!=="number"||Gt(s.ownerDocument)!==s)&&(u==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+u&&(s.defaultValue=""+u))}var nt=Array.isArray;function Et(s,i,u,f){if(s=s.options,i){i={};for(var b=0;b<u.length;b++)i["$"+u[b]]=!0;for(u=0;u<s.length;u++)b=i.hasOwnProperty("$"+s[u].value),s[u].selected!==b&&(s[u].selected=b),b&&f&&(s[u].defaultSelected=!0)}else{for(u=""+$e(u),i=null,b=0;b<s.length;b++){if(s[b].value===u){s[b].selected=!0,f&&(s[b].defaultSelected=!0);return}i!==null||s[b].disabled||(i=s[b])}i!==null&&(i.selected=!0)}}function Nt(s,i){if(i.dangerouslySetInnerHTML!=null)throw Error(n(91));return R({},i,{value:void 0,defaultValue:void 0,children:""+s._wrapperState.initialValue})}function on(s,i){var u=i.value;if(u==null){if(u=i.children,i=i.defaultValue,u!=null){if(i!=null)throw Error(n(92));if(nt(u)){if(1<u.length)throw Error(n(93));u=u[0]}i=u}i==null&&(i=""),u=i}s._wrapperState={initialValue:$e(u)}}function nr(s,i){var u=$e(i.value),f=$e(i.defaultValue);u!=null&&(u=""+u,u!==s.value&&(s.value=u),i.defaultValue==null&&s.defaultValue!==u&&(s.defaultValue=u)),f!=null&&(s.defaultValue=""+f)}function un(s){var i=s.textContent;i===s._wrapperState.initialValue&&i!==""&&i!==null&&(s.value=i)}function oe(s){switch(s){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function pe(s,i){return s==null||s==="http://www.w3.org/1999/xhtml"?oe(i):s==="http://www.w3.org/2000/svg"&&i==="foreignObject"?"http://www.w3.org/1999/xhtml":s}var De,He=(function(s){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(i,u,f,b){MSApp.execUnsafeLocalFunction(function(){return s(i,u,f,b)})}:s})(function(s,i){if(s.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in s)s.innerHTML=i;else{for(De=De||document.createElement("div"),De.innerHTML="<svg>"+i.valueOf().toString()+"</svg>",i=De.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;i.firstChild;)s.appendChild(i.firstChild)}});function Ve(s,i){if(i){var u=s.firstChild;if(u&&u===s.lastChild&&u.nodeType===3){u.nodeValue=i;return}}s.textContent=i}var gt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},zt=["Webkit","ms","Moz","O"];Object.keys(gt).forEach(function(s){zt.forEach(function(i){i=i+s.charAt(0).toUpperCase()+s.substring(1),gt[i]=gt[s]})});function rn(s,i,u){return i==null||typeof i=="boolean"||i===""?"":u||typeof i!="number"||i===0||gt.hasOwnProperty(s)&>[s]?(""+i).trim():i+"px"}function _n(s,i){s=s.style;for(var u in i)if(i.hasOwnProperty(u)){var f=u.indexOf("--")===0,b=rn(u,i[u],f);u==="float"&&(u="cssFloat"),f?s.setProperty(u,b):s[u]=b}}var Un=R({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function At(s,i){if(i){if(Un[s]&&(i.children!=null||i.dangerouslySetInnerHTML!=null))throw Error(n(137,s));if(i.dangerouslySetInnerHTML!=null){if(i.children!=null)throw Error(n(60));if(typeof i.dangerouslySetInnerHTML!="object"||!("__html"in i.dangerouslySetInnerHTML))throw Error(n(61))}if(i.style!=null&&typeof i.style!="object")throw Error(n(62))}}function yt(s,i){if(s.indexOf("-")===-1)return typeof i.is=="string";switch(s){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 ln=null;function _r(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Le=null,Qe=null,be=null;function _e(s){if(s=jo(s)){if(typeof Le!="function")throw Error(n(280));var i=s.stateNode;i&&(i=xl(i),Le(s.stateNode,s.type,i))}}function Je(s){Qe?be?be.push(s):be=[s]:Qe=s}function Ce(){if(Qe){var s=Qe,i=be;if(be=Qe=null,_e(s),i)for(s=0;s<i.length;s++)_e(i[s])}}function It(s,i){return s(i)}function Wt(){}var Yt=!1;function Rt(s,i,u){if(Yt)return s(i,u);Yt=!0;try{return It(s,i,u)}finally{Yt=!1,(Qe!==null||be!==null)&&(Wt(),Ce())}}function qt(s,i){var u=s.stateNode;if(u===null)return null;var f=xl(u);if(f===null)return null;u=f[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(s=s.type,f=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!f;break e;default:s=!1}if(s)return null;if(u&&typeof u!="function")throw Error(n(231,i,typeof u));return u}var Cn=!1;if(c)try{var zn={};Object.defineProperty(zn,"passive",{get:function(){Cn=!0}}),window.addEventListener("test",zn,zn),window.removeEventListener("test",zn,zn)}catch{Cn=!1}function Ur(s,i,u,f,b,T,D,Y,V){var se=Array.prototype.slice.call(arguments,3);try{i.apply(u,se)}catch(de){this.onError(de)}}var ke=!1,Ye=null,Me=!1,rt=null,dt={onError:function(s){ke=!0,Ye=s}};function ot(s,i,u,f,b,T,D,Y,V){ke=!1,Ye=null,Ur.apply(dt,arguments)}function xt(s,i,u,f,b,T,D,Y,V){if(ot.apply(this,arguments),ke){if(ke){var se=Ye;ke=!1,Ye=null}else throw Error(n(198));Me||(Me=!0,rt=se)}}function Tt(s){var i=s,u=s;if(s.alternate)for(;i.return;)i=i.return;else{s=i;do i=s,(i.flags&4098)!==0&&(u=i.return),s=i.return;while(s)}return i.tag===3?u:null}function bt(s){if(s.tag===13){var i=s.memoizedState;if(i===null&&(s=s.alternate,s!==null&&(i=s.memoizedState)),i!==null)return i.dehydrated}return null}function cn(s){if(Tt(s)!==s)throw Error(n(188))}function oi(s){var i=s.alternate;if(!i){if(i=Tt(s),i===null)throw Error(n(188));return i!==s?null:s}for(var u=s,f=i;;){var b=u.return;if(b===null)break;var T=b.alternate;if(T===null){if(f=b.return,f!==null){u=f;continue}break}if(b.child===T.child){for(T=b.child;T;){if(T===u)return cn(b),s;if(T===f)return cn(b),i;T=T.sibling}throw Error(n(188))}if(u.return!==f.return)u=b,f=T;else{for(var D=!1,Y=b.child;Y;){if(Y===u){D=!0,u=b,f=T;break}if(Y===f){D=!0,f=b,u=T;break}Y=Y.sibling}if(!D){for(Y=T.child;Y;){if(Y===u){D=!0,u=T,f=b;break}if(Y===f){D=!0,f=T,u=b;break}Y=Y.sibling}if(!D)throw Error(n(189))}}if(u.alternate!==f)throw Error(n(190))}if(u.tag!==3)throw Error(n(188));return u.stateNode.current===u?s:i}function fr(s){return s=oi(s),s!==null?Os(s):null}function Os(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var i=Os(s);if(i!==null)return i;s=s.sibling}return null}var ba=t.unstable_scheduleCallback,vt=t.unstable_cancelCallback,Eo=t.unstable_shouldYield,ui=t.unstable_requestPaint,wt=t.unstable_now,Zu=t.unstable_getCurrentPriorityLevel,Ea=t.unstable_ImmediatePriority,bp=t.unstable_UserBlockingPriority,el=t.unstable_NormalPriority,X2=t.unstable_LowPriority,Ep=t.unstable_IdlePriority,tl=null,zr=null;function K2(s){if(zr&&typeof zr.onCommitFiberRoot=="function")try{zr.onCommitFiberRoot(tl,s,void 0,(s.current.flags&128)===128)}catch{}}var Cr=Math.clz32?Math.clz32:eT,J2=Math.log,Z2=Math.LN2;function eT(s){return s>>>=0,s===0?32:31-(J2(s)/Z2|0)|0}var nl=64,rl=4194304;function xo(s){switch(s&-s){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: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 s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function sl(s,i){var u=s.pendingLanes;if(u===0)return 0;var f=0,b=s.suspendedLanes,T=s.pingedLanes,D=u&268435455;if(D!==0){var Y=D&~b;Y!==0?f=xo(Y):(T&=D,T!==0&&(f=xo(T)))}else D=u&~b,D!==0?f=xo(D):T!==0&&(f=xo(T));if(f===0)return 0;if(i!==0&&i!==f&&(i&b)===0&&(b=f&-f,T=i&-i,b>=T||b===16&&(T&4194240)!==0))return i;if((f&4)!==0&&(f|=u&16),i=s.entangledLanes,i!==0)for(s=s.entanglements,i&=f;0<i;)u=31-Cr(i),b=1<<u,f|=s[u],i&=~b;return f}function tT(s,i){switch(s){case 1:case 2:case 4:return i+250;case 8:case 16:case 32:case 64: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 i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function nT(s,i){for(var u=s.suspendedLanes,f=s.pingedLanes,b=s.expirationTimes,T=s.pendingLanes;0<T;){var D=31-Cr(T),Y=1<<D,V=b[D];V===-1?((Y&u)===0||(Y&f)!==0)&&(b[D]=tT(Y,i)):V<=i&&(s.expiredLanes|=Y),T&=~Y}}function dd(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function xp(){var s=nl;return nl<<=1,(nl&4194240)===0&&(nl=64),s}function fd(s){for(var i=[],u=0;31>u;u++)i.push(s);return i}function To(s,i,u){s.pendingLanes|=i,i!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,i=31-Cr(i),s[i]=u}function rT(s,i){var u=s.pendingLanes&~i;s.pendingLanes=i,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=i,s.mutableReadLanes&=i,s.entangledLanes&=i,i=s.entanglements;var f=s.eventTimes;for(s=s.expirationTimes;0<u;){var b=31-Cr(u),T=1<<b;i[b]=0,f[b]=-1,s[b]=-1,u&=~T}}function hd(s,i){var u=s.entangledLanes|=i;for(s=s.entanglements;u;){var f=31-Cr(u),b=1<<f;b&i|s[f]&i&&(s[f]|=i),u&=~b}}var pt=0;function Tp(s){return s&=-s,1<s?4<s?(s&268435455)!==0?16:536870912:4:1}var vp,pd,wp,Sp,_p,md=!1,al=[],Ds=null,As=null,Is=null,vo=new Map,wo=new Map,Rs=[],sT="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 submit".split(" ");function Cp(s,i){switch(s){case"focusin":case"focusout":Ds=null;break;case"dragenter":case"dragleave":As=null;break;case"mouseover":case"mouseout":Is=null;break;case"pointerover":case"pointerout":vo.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":wo.delete(i.pointerId)}}function So(s,i,u,f,b,T){return s===null||s.nativeEvent!==T?(s={blockedOn:i,domEventName:u,eventSystemFlags:f,nativeEvent:T,targetContainers:[b]},i!==null&&(i=jo(i),i!==null&&pd(i)),s):(s.eventSystemFlags|=f,i=s.targetContainers,b!==null&&i.indexOf(b)===-1&&i.push(b),s)}function aT(s,i,u,f,b){switch(i){case"focusin":return Ds=So(Ds,s,i,u,f,b),!0;case"dragenter":return As=So(As,s,i,u,f,b),!0;case"mouseover":return Is=So(Is,s,i,u,f,b),!0;case"pointerover":var T=b.pointerId;return vo.set(T,So(vo.get(T)||null,s,i,u,f,b)),!0;case"gotpointercapture":return T=b.pointerId,wo.set(T,So(wo.get(T)||null,s,i,u,f,b)),!0}return!1}function kp(s){var i=xa(s.target);if(i!==null){var u=Tt(i);if(u!==null){if(i=u.tag,i===13){if(i=bt(u),i!==null){s.blockedOn=i,_p(s.priority,function(){wp(u)});return}}else if(i===3&&u.stateNode.current.memoizedState.isDehydrated){s.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}s.blockedOn=null}function il(s){if(s.blockedOn!==null)return!1;for(var i=s.targetContainers;0<i.length;){var u=yd(s.domEventName,s.eventSystemFlags,i[0],s.nativeEvent);if(u===null){u=s.nativeEvent;var f=new u.constructor(u.type,u);ln=f,u.target.dispatchEvent(f),ln=null}else return i=jo(u),i!==null&&pd(i),s.blockedOn=u,!1;i.shift()}return!0}function Np(s,i,u){il(s)&&u.delete(i)}function iT(){md=!1,Ds!==null&&il(Ds)&&(Ds=null),As!==null&&il(As)&&(As=null),Is!==null&&il(Is)&&(Is=null),vo.forEach(Np),wo.forEach(Np)}function _o(s,i){s.blockedOn===i&&(s.blockedOn=null,md||(md=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,iT)))}function Co(s){function i(b){return _o(b,s)}if(0<al.length){_o(al[0],s);for(var u=1;u<al.length;u++){var f=al[u];f.blockedOn===s&&(f.blockedOn=null)}}for(Ds!==null&&_o(Ds,s),As!==null&&_o(As,s),Is!==null&&_o(Is,s),vo.forEach(i),wo.forEach(i),u=0;u<Rs.length;u++)f=Rs[u],f.blockedOn===s&&(f.blockedOn=null);for(;0<Rs.length&&(u=Rs[0],u.blockedOn===null);)kp(u),u.blockedOn===null&&Rs.shift()}var li=A.ReactCurrentBatchConfig,ol=!0;function oT(s,i,u,f){var b=pt,T=li.transition;li.transition=null;try{pt=1,gd(s,i,u,f)}finally{pt=b,li.transition=T}}function uT(s,i,u,f){var b=pt,T=li.transition;li.transition=null;try{pt=4,gd(s,i,u,f)}finally{pt=b,li.transition=T}}function gd(s,i,u,f){if(ol){var b=yd(s,i,u,f);if(b===null)Ld(s,i,f,ul,u),Cp(s,f);else if(aT(b,s,i,u,f))f.stopPropagation();else if(Cp(s,f),i&4&&-1<sT.indexOf(s)){for(;b!==null;){var T=jo(b);if(T!==null&&vp(T),T=yd(s,i,u,f),T===null&&Ld(s,i,f,ul,u),T===b)break;b=T}b!==null&&f.stopPropagation()}else Ld(s,i,f,null,u)}}var ul=null;function yd(s,i,u,f){if(ul=null,s=_r(f),s=xa(s),s!==null)if(i=Tt(s),i===null)s=null;else if(u=i.tag,u===13){if(s=bt(i),s!==null)return s;s=null}else if(u===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;s=null}else i!==s&&(s=null);return ul=s,null}function Op(s){switch(s){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Zu()){case Ea:return 1;case bp:return 4;case el:case X2:return 16;case Ep:return 536870912;default:return 16}default:return 16}}var Ls=null,bd=null,ll=null;function Dp(){if(ll)return ll;var s,i=bd,u=i.length,f,b="value"in Ls?Ls.value:Ls.textContent,T=b.length;for(s=0;s<u&&i[s]===b[s];s++);var D=u-s;for(f=1;f<=D&&i[u-f]===b[T-f];f++);return ll=b.slice(s,1<f?1-f:void 0)}function cl(s){var i=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&i===13&&(s=13)):s=i,s===10&&(s=13),32<=s||s===13?s:0}function dl(){return!0}function Ap(){return!1}function rr(s){function i(u,f,b,T,D){this._reactName=u,this._targetInst=b,this.type=f,this.nativeEvent=T,this.target=D,this.currentTarget=null;for(var Y in s)s.hasOwnProperty(Y)&&(u=s[Y],this[Y]=u?u(T):T[Y]);return this.isDefaultPrevented=(T.defaultPrevented!=null?T.defaultPrevented:T.returnValue===!1)?dl:Ap,this.isPropagationStopped=Ap,this}return R(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=dl)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=dl)},persist:function(){},isPersistent:dl}),i}var ci={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ed=rr(ci),ko=R({},ci,{view:0,detail:0}),lT=rr(ko),xd,Td,No,fl=R({},ko,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:wd,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==No&&(No&&s.type==="mousemove"?(xd=s.screenX-No.screenX,Td=s.screenY-No.screenY):Td=xd=0,No=s),xd)},movementY:function(s){return"movementY"in s?s.movementY:Td}}),Ip=rr(fl),cT=R({},fl,{dataTransfer:0}),dT=rr(cT),fT=R({},ko,{relatedTarget:0}),vd=rr(fT),hT=R({},ci,{animationName:0,elapsedTime:0,pseudoElement:0}),pT=rr(hT),mT=R({},ci,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),gT=rr(mT),yT=R({},ci,{data:0}),Rp=rr(yT),bT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ET={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"},xT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function TT(s){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(s):(s=xT[s])?!!i[s]:!1}function wd(){return TT}var vT=R({},ko,{key:function(s){if(s.key){var i=bT[s.key]||s.key;if(i!=="Unidentified")return i}return s.type==="keypress"?(s=cl(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?ET[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:wd,charCode:function(s){return s.type==="keypress"?cl(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?cl(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),wT=rr(vT),ST=R({},fl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Lp=rr(ST),_T=R({},ko,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:wd}),CT=rr(_T),kT=R({},ci,{propertyName:0,elapsedTime:0,pseudoElement:0}),NT=rr(kT),OT=R({},fl,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),DT=rr(OT),AT=[9,13,27,32],Sd=c&&"CompositionEvent"in window,Oo=null;c&&"documentMode"in document&&(Oo=document.documentMode);var IT=c&&"TextEvent"in window&&!Oo,Mp=c&&(!Sd||Oo&&8<Oo&&11>=Oo),Pp=" ",Fp=!1;function jp(s,i){switch(s){case"keyup":return AT.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bp(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var di=!1;function RT(s,i){switch(s){case"compositionend":return Bp(i);case"keypress":return i.which!==32?null:(Fp=!0,Pp);case"textInput":return s=i.data,s===Pp&&Fp?null:s;default:return null}}function LT(s,i){if(di)return s==="compositionend"||!Sd&&jp(s,i)?(s=Dp(),ll=bd=Ls=null,di=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Mp&&i.locale!=="ko"?null:i.data;default:return null}}var MT={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 Hp(s){var i=s&&s.nodeName&&s.nodeName.toLowerCase();return i==="input"?!!MT[s.type]:i==="textarea"}function Up(s,i,u,f){Je(f),i=yl(i,"onChange"),0<i.length&&(u=new Ed("onChange","change",null,u,f),s.push({event:u,listeners:i}))}var Do=null,Ao=null;function PT(s){am(s,0)}function hl(s){var i=gi(s);if(pn(i))return s}function FT(s,i){if(s==="change")return i}var zp=!1;if(c){var _d;if(c){var Cd="oninput"in document;if(!Cd){var Wp=document.createElement("div");Wp.setAttribute("oninput","return;"),Cd=typeof Wp.oninput=="function"}_d=Cd}else _d=!1;zp=_d&&(!document.documentMode||9<document.documentMode)}function Yp(){Do&&(Do.detachEvent("onpropertychange",qp),Ao=Do=null)}function qp(s){if(s.propertyName==="value"&&hl(Ao)){var i=[];Up(i,Ao,s,_r(s)),Rt(PT,i)}}function jT(s,i,u){s==="focusin"?(Yp(),Do=i,Ao=u,Do.attachEvent("onpropertychange",qp)):s==="focusout"&&Yp()}function BT(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return hl(Ao)}function HT(s,i){if(s==="click")return hl(i)}function UT(s,i){if(s==="input"||s==="change")return hl(i)}function zT(s,i){return s===i&&(s!==0||1/s===1/i)||s!==s&&i!==i}var kr=typeof Object.is=="function"?Object.is:zT;function Io(s,i){if(kr(s,i))return!0;if(typeof s!="object"||s===null||typeof i!="object"||i===null)return!1;var u=Object.keys(s),f=Object.keys(i);if(u.length!==f.length)return!1;for(f=0;f<u.length;f++){var b=u[f];if(!d.call(i,b)||!kr(s[b],i[b]))return!1}return!0}function $p(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function Vp(s,i){var u=$p(s);s=0;for(var f;u;){if(u.nodeType===3){if(f=s+u.textContent.length,s<=i&&f>=i)return{node:u,offset:i-s};s=f}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=$p(u)}}function Qp(s,i){return s&&i?s===i?!0:s&&s.nodeType===3?!1:i&&i.nodeType===3?Qp(s,i.parentNode):"contains"in s?s.contains(i):s.compareDocumentPosition?!!(s.compareDocumentPosition(i)&16):!1:!1}function Gp(){for(var s=window,i=Gt();i instanceof s.HTMLIFrameElement;){try{var u=typeof i.contentWindow.location.href=="string"}catch{u=!1}if(u)s=i.contentWindow;else break;i=Gt(s.document)}return i}function kd(s){var i=s&&s.nodeName&&s.nodeName.toLowerCase();return i&&(i==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||i==="textarea"||s.contentEditable==="true")}function WT(s){var i=Gp(),u=s.focusedElem,f=s.selectionRange;if(i!==u&&u&&u.ownerDocument&&Qp(u.ownerDocument.documentElement,u)){if(f!==null&&kd(u)){if(i=f.start,s=f.end,s===void 0&&(s=i),"selectionStart"in u)u.selectionStart=i,u.selectionEnd=Math.min(s,u.value.length);else if(s=(i=u.ownerDocument||document)&&i.defaultView||window,s.getSelection){s=s.getSelection();var b=u.textContent.length,T=Math.min(f.start,b);f=f.end===void 0?T:Math.min(f.end,b),!s.extend&&T>f&&(b=f,f=T,T=b),b=Vp(u,T);var D=Vp(u,f);b&&D&&(s.rangeCount!==1||s.anchorNode!==b.node||s.anchorOffset!==b.offset||s.focusNode!==D.node||s.focusOffset!==D.offset)&&(i=i.createRange(),i.setStart(b.node,b.offset),s.removeAllRanges(),T>f?(s.addRange(i),s.extend(D.node,D.offset)):(i.setEnd(D.node,D.offset),s.addRange(i)))}}for(i=[],s=u;s=s.parentNode;)s.nodeType===1&&i.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<i.length;u++)s=i[u],s.element.scrollLeft=s.left,s.element.scrollTop=s.top}}var YT=c&&"documentMode"in document&&11>=document.documentMode,fi=null,Nd=null,Ro=null,Od=!1;function Xp(s,i,u){var f=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Od||fi==null||fi!==Gt(f)||(f=fi,"selectionStart"in f&&kd(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),Ro&&Io(Ro,f)||(Ro=f,f=yl(Nd,"onSelect"),0<f.length&&(i=new Ed("onSelect","select",null,i,u),s.push({event:i,listeners:f}),i.target=fi)))}function pl(s,i){var u={};return u[s.toLowerCase()]=i.toLowerCase(),u["Webkit"+s]="webkit"+i,u["Moz"+s]="moz"+i,u}var hi={animationend:pl("Animation","AnimationEnd"),animationiteration:pl("Animation","AnimationIteration"),animationstart:pl("Animation","AnimationStart"),transitionend:pl("Transition","TransitionEnd")},Dd={},Kp={};c&&(Kp=document.createElement("div").style,"AnimationEvent"in window||(delete hi.animationend.animation,delete hi.animationiteration.animation,delete hi.animationstart.animation),"TransitionEvent"in window||delete hi.transitionend.transition);function ml(s){if(Dd[s])return Dd[s];if(!hi[s])return s;var i=hi[s],u;for(u in i)if(i.hasOwnProperty(u)&&u in Kp)return Dd[s]=i[u];return s}var Jp=ml("animationend"),Zp=ml("animationiteration"),em=ml("animationstart"),tm=ml("transitionend"),nm=new Map,rm="abort auxClick 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(" ");function Ms(s,i){nm.set(s,i),o(i,[s])}for(var Ad=0;Ad<rm.length;Ad++){var Id=rm[Ad],qT=Id.toLowerCase(),$T=Id[0].toUpperCase()+Id.slice(1);Ms(qT,"on"+$T)}Ms(Jp,"onAnimationEnd"),Ms(Zp,"onAnimationIteration"),Ms(em,"onAnimationStart"),Ms("dblclick","onDoubleClick"),Ms("focusin","onFocus"),Ms("focusout","onBlur"),Ms(tm,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Lo="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(" "),VT=new Set("cancel close invalid load scroll toggle".split(" ").concat(Lo));function sm(s,i,u){var f=s.type||"unknown-event";s.currentTarget=u,xt(f,i,void 0,s),s.currentTarget=null}function am(s,i){i=(i&4)!==0;for(var u=0;u<s.length;u++){var f=s[u],b=f.event;f=f.listeners;e:{var T=void 0;if(i)for(var D=f.length-1;0<=D;D--){var Y=f[D],V=Y.instance,se=Y.currentTarget;if(Y=Y.listener,V!==T&&b.isPropagationStopped())break e;sm(b,Y,se),T=V}else for(D=0;D<f.length;D++){if(Y=f[D],V=Y.instance,se=Y.currentTarget,Y=Y.listener,V!==T&&b.isPropagationStopped())break e;sm(b,Y,se),T=V}}}if(Me)throw s=rt,Me=!1,rt=null,s}function Ot(s,i){var u=i[Hd];u===void 0&&(u=i[Hd]=new Set);var f=s+"__bubble";u.has(f)||(im(i,s,2,!1),u.add(f))}function Rd(s,i,u){var f=0;i&&(f|=4),im(u,s,f,i)}var gl="_reactListening"+Math.random().toString(36).slice(2);function Mo(s){if(!s[gl]){s[gl]=!0,r.forEach(function(u){u!=="selectionchange"&&(VT.has(u)||Rd(u,!1,s),Rd(u,!0,s))});var i=s.nodeType===9?s:s.ownerDocument;i===null||i[gl]||(i[gl]=!0,Rd("selectionchange",!1,i))}}function im(s,i,u,f){switch(Op(i)){case 1:var b=oT;break;case 4:b=uT;break;default:b=gd}u=b.bind(null,i,u,s),b=void 0,!Cn||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(b=!0),f?b!==void 0?s.addEventListener(i,u,{capture:!0,passive:b}):s.addEventListener(i,u,!0):b!==void 0?s.addEventListener(i,u,{passive:b}):s.addEventListener(i,u,!1)}function Ld(s,i,u,f,b){var T=f;if((i&1)===0&&(i&2)===0&&f!==null)e:for(;;){if(f===null)return;var D=f.tag;if(D===3||D===4){var Y=f.stateNode.containerInfo;if(Y===b||Y.nodeType===8&&Y.parentNode===b)break;if(D===4)for(D=f.return;D!==null;){var V=D.tag;if((V===3||V===4)&&(V=D.stateNode.containerInfo,V===b||V.nodeType===8&&V.parentNode===b))return;D=D.return}for(;Y!==null;){if(D=xa(Y),D===null)return;if(V=D.tag,V===5||V===6){f=T=D;continue e}Y=Y.parentNode}}f=f.return}Rt(function(){var se=T,de=_r(u),fe=[];e:{var le=nm.get(s);if(le!==void 0){var xe=Ed,Ne=s;switch(s){case"keypress":if(cl(u)===0)break e;case"keydown":case"keyup":xe=wT;break;case"focusin":Ne="focus",xe=vd;break;case"focusout":Ne="blur",xe=vd;break;case"beforeblur":case"afterblur":xe=vd;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":xe=Ip;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":xe=dT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":xe=CT;break;case Jp:case Zp:case em:xe=pT;break;case tm:xe=NT;break;case"scroll":xe=lT;break;case"wheel":xe=DT;break;case"copy":case"cut":case"paste":xe=gT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":xe=Lp}var Ae=(i&4)!==0,Xt=!Ae&&s==="scroll",ee=Ae?le!==null?le+"Capture":null:le;Ae=[];for(var X=se,ne;X!==null;){ne=X;var ge=ne.stateNode;if(ne.tag===5&&ge!==null&&(ne=ge,ee!==null&&(ge=qt(X,ee),ge!=null&&Ae.push(Po(X,ge,ne)))),Xt)break;X=X.return}0<Ae.length&&(le=new xe(le,Ne,null,u,de),fe.push({event:le,listeners:Ae}))}}if((i&7)===0){e:{if(le=s==="mouseover"||s==="pointerover",xe=s==="mouseout"||s==="pointerout",le&&u!==ln&&(Ne=u.relatedTarget||u.fromElement)&&(xa(Ne)||Ne[ls]))break e;if((xe||le)&&(le=de.window===de?de:(le=de.ownerDocument)?le.defaultView||le.parentWindow:window,xe?(Ne=u.relatedTarget||u.toElement,xe=se,Ne=Ne?xa(Ne):null,Ne!==null&&(Xt=Tt(Ne),Ne!==Xt||Ne.tag!==5&&Ne.tag!==6)&&(Ne=null)):(xe=null,Ne=se),xe!==Ne)){if(Ae=Ip,ge="onMouseLeave",ee="onMouseEnter",X="mouse",(s==="pointerout"||s==="pointerover")&&(Ae=Lp,ge="onPointerLeave",ee="onPointerEnter",X="pointer"),Xt=xe==null?le:gi(xe),ne=Ne==null?le:gi(Ne),le=new Ae(ge,X+"leave",xe,u,de),le.target=Xt,le.relatedTarget=ne,ge=null,xa(de)===se&&(Ae=new Ae(ee,X+"enter",Ne,u,de),Ae.target=ne,Ae.relatedTarget=Xt,ge=Ae),Xt=ge,xe&&Ne)t:{for(Ae=xe,ee=Ne,X=0,ne=Ae;ne;ne=pi(ne))X++;for(ne=0,ge=ee;ge;ge=pi(ge))ne++;for(;0<X-ne;)Ae=pi(Ae),X--;for(;0<ne-X;)ee=pi(ee),ne--;for(;X--;){if(Ae===ee||ee!==null&&Ae===ee.alternate)break t;Ae=pi(Ae),ee=pi(ee)}Ae=null}else Ae=null;xe!==null&&om(fe,le,xe,Ae,!1),Ne!==null&&Xt!==null&&om(fe,Xt,Ne,Ae,!0)}}e:{if(le=se?gi(se):window,xe=le.nodeName&&le.nodeName.toLowerCase(),xe==="select"||xe==="input"&&le.type==="file")var Ie=FT;else if(Hp(le))if(zp)Ie=UT;else{Ie=BT;var Pe=jT}else(xe=le.nodeName)&&xe.toLowerCase()==="input"&&(le.type==="checkbox"||le.type==="radio")&&(Ie=HT);if(Ie&&(Ie=Ie(s,se))){Up(fe,Ie,u,de);break e}Pe&&Pe(s,le,se),s==="focusout"&&(Pe=le._wrapperState)&&Pe.controlled&&le.type==="number"&&it(le,"number",le.value)}switch(Pe=se?gi(se):window,s){case"focusin":(Hp(Pe)||Pe.contentEditable==="true")&&(fi=Pe,Nd=se,Ro=null);break;case"focusout":Ro=Nd=fi=null;break;case"mousedown":Od=!0;break;case"contextmenu":case"mouseup":case"dragend":Od=!1,Xp(fe,u,de);break;case"selectionchange":if(YT)break;case"keydown":case"keyup":Xp(fe,u,de)}var Fe;if(Sd)e:{switch(s){case"compositionstart":var Ue="onCompositionStart";break e;case"compositionend":Ue="onCompositionEnd";break e;case"compositionupdate":Ue="onCompositionUpdate";break e}Ue=void 0}else di?jp(s,u)&&(Ue="onCompositionEnd"):s==="keydown"&&u.keyCode===229&&(Ue="onCompositionStart");Ue&&(Mp&&u.locale!=="ko"&&(di||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&di&&(Fe=Dp()):(Ls=de,bd="value"in Ls?Ls.value:Ls.textContent,di=!0)),Pe=yl(se,Ue),0<Pe.length&&(Ue=new Rp(Ue,s,null,u,de),fe.push({event:Ue,listeners:Pe}),Fe?Ue.data=Fe:(Fe=Bp(u),Fe!==null&&(Ue.data=Fe)))),(Fe=IT?RT(s,u):LT(s,u))&&(se=yl(se,"onBeforeInput"),0<se.length&&(de=new Rp("onBeforeInput","beforeinput",null,u,de),fe.push({event:de,listeners:se}),de.data=Fe))}am(fe,i)})}function Po(s,i,u){return{instance:s,listener:i,currentTarget:u}}function yl(s,i){for(var u=i+"Capture",f=[];s!==null;){var b=s,T=b.stateNode;b.tag===5&&T!==null&&(b=T,T=qt(s,u),T!=null&&f.unshift(Po(s,T,b)),T=qt(s,i),T!=null&&f.push(Po(s,T,b))),s=s.return}return f}function pi(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5);return s||null}function om(s,i,u,f,b){for(var T=i._reactName,D=[];u!==null&&u!==f;){var Y=u,V=Y.alternate,se=Y.stateNode;if(V!==null&&V===f)break;Y.tag===5&&se!==null&&(Y=se,b?(V=qt(u,T),V!=null&&D.unshift(Po(u,V,Y))):b||(V=qt(u,T),V!=null&&D.push(Po(u,V,Y)))),u=u.return}D.length!==0&&s.push({event:i,listeners:D})}var QT=/\r\n?/g,GT=/\u0000|\uFFFD/g;function um(s){return(typeof s=="string"?s:""+s).replace(QT,`
|
|
31
|
-
`).replace(GT,"")}function bl(s,i,u){if(i=um(i),um(s)!==i&&u)throw Error(n(425))}function El(){}var Md=null,Pd=null;function Fd(s,i){return s==="textarea"||s==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var jd=typeof setTimeout=="function"?setTimeout:void 0,XT=typeof clearTimeout=="function"?clearTimeout:void 0,lm=typeof Promise=="function"?Promise:void 0,KT=typeof queueMicrotask=="function"?queueMicrotask:typeof lm<"u"?function(s){return lm.resolve(null).then(s).catch(JT)}:jd;function JT(s){setTimeout(function(){throw s})}function Bd(s,i){var u=i,f=0;do{var b=u.nextSibling;if(s.removeChild(u),b&&b.nodeType===8)if(u=b.data,u==="/$"){if(f===0){s.removeChild(b),Co(i);return}f--}else u!=="$"&&u!=="$?"&&u!=="$!"||f++;u=b}while(u);Co(i)}function Ps(s){for(;s!=null;s=s.nextSibling){var i=s.nodeType;if(i===1||i===3)break;if(i===8){if(i=s.data,i==="$"||i==="$!"||i==="$?")break;if(i==="/$")return null}}return s}function cm(s){s=s.previousSibling;for(var i=0;s;){if(s.nodeType===8){var u=s.data;if(u==="$"||u==="$!"||u==="$?"){if(i===0)return s;i--}else u==="/$"&&i++}s=s.previousSibling}return null}var mi=Math.random().toString(36).slice(2),Wr="__reactFiber$"+mi,Fo="__reactProps$"+mi,ls="__reactContainer$"+mi,Hd="__reactEvents$"+mi,ZT="__reactListeners$"+mi,ev="__reactHandles$"+mi;function xa(s){var i=s[Wr];if(i)return i;for(var u=s.parentNode;u;){if(i=u[ls]||u[Wr]){if(u=i.alternate,i.child!==null||u!==null&&u.child!==null)for(s=cm(s);s!==null;){if(u=s[Wr])return u;s=cm(s)}return i}s=u,u=s.parentNode}return null}function jo(s){return s=s[Wr]||s[ls],!s||s.tag!==5&&s.tag!==6&&s.tag!==13&&s.tag!==3?null:s}function gi(s){if(s.tag===5||s.tag===6)return s.stateNode;throw Error(n(33))}function xl(s){return s[Fo]||null}var Ud=[],yi=-1;function Fs(s){return{current:s}}function Dt(s){0>yi||(s.current=Ud[yi],Ud[yi]=null,yi--)}function St(s,i){yi++,Ud[yi]=s.current,s.current=i}var js={},kn=Fs(js),Wn=Fs(!1),Ta=js;function bi(s,i){var u=s.type.contextTypes;if(!u)return js;var f=s.stateNode;if(f&&f.__reactInternalMemoizedUnmaskedChildContext===i)return f.__reactInternalMemoizedMaskedChildContext;var b={},T;for(T in u)b[T]=i[T];return f&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=i,s.__reactInternalMemoizedMaskedChildContext=b),b}function Yn(s){return s=s.childContextTypes,s!=null}function Tl(){Dt(Wn),Dt(kn)}function dm(s,i,u){if(kn.current!==js)throw Error(n(168));St(kn,i),St(Wn,u)}function fm(s,i,u){var f=s.stateNode;if(i=i.childContextTypes,typeof f.getChildContext!="function")return u;f=f.getChildContext();for(var b in f)if(!(b in i))throw Error(n(108,Ze(s)||"Unknown",b));return R({},u,f)}function vl(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||js,Ta=kn.current,St(kn,s),St(Wn,Wn.current),!0}function hm(s,i,u){var f=s.stateNode;if(!f)throw Error(n(169));u?(s=fm(s,i,Ta),f.__reactInternalMemoizedMergedChildContext=s,Dt(Wn),Dt(kn),St(kn,s)):Dt(Wn),St(Wn,u)}var cs=null,wl=!1,zd=!1;function pm(s){cs===null?cs=[s]:cs.push(s)}function tv(s){wl=!0,pm(s)}function Bs(){if(!zd&&cs!==null){zd=!0;var s=0,i=pt;try{var u=cs;for(pt=1;s<u.length;s++){var f=u[s];do f=f(!0);while(f!==null)}cs=null,wl=!1}catch(b){throw cs!==null&&(cs=cs.slice(s+1)),ba(Ea,Bs),b}finally{pt=i,zd=!1}}return null}var Ei=[],xi=0,Sl=null,_l=0,hr=[],pr=0,va=null,ds=1,fs="";function wa(s,i){Ei[xi++]=_l,Ei[xi++]=Sl,Sl=s,_l=i}function mm(s,i,u){hr[pr++]=ds,hr[pr++]=fs,hr[pr++]=va,va=s;var f=ds;s=fs;var b=32-Cr(f)-1;f&=~(1<<b),u+=1;var T=32-Cr(i)+b;if(30<T){var D=b-b%5;T=(f&(1<<D)-1).toString(32),f>>=D,b-=D,ds=1<<32-Cr(i)+b|u<<b|f,fs=T+s}else ds=1<<T|u<<b|f,fs=s}function Wd(s){s.return!==null&&(wa(s,1),mm(s,1,0))}function Yd(s){for(;s===Sl;)Sl=Ei[--xi],Ei[xi]=null,_l=Ei[--xi],Ei[xi]=null;for(;s===va;)va=hr[--pr],hr[pr]=null,fs=hr[--pr],hr[pr]=null,ds=hr[--pr],hr[pr]=null}var sr=null,ar=null,Lt=!1,Nr=null;function gm(s,i){var u=br(5,null,null,0);u.elementType="DELETED",u.stateNode=i,u.return=s,i=s.deletions,i===null?(s.deletions=[u],s.flags|=16):i.push(u)}function ym(s,i){switch(s.tag){case 5:var u=s.type;return i=i.nodeType!==1||u.toLowerCase()!==i.nodeName.toLowerCase()?null:i,i!==null?(s.stateNode=i,sr=s,ar=Ps(i.firstChild),!0):!1;case 6:return i=s.pendingProps===""||i.nodeType!==3?null:i,i!==null?(s.stateNode=i,sr=s,ar=null,!0):!1;case 13:return i=i.nodeType!==8?null:i,i!==null?(u=va!==null?{id:ds,overflow:fs}:null,s.memoizedState={dehydrated:i,treeContext:u,retryLane:1073741824},u=br(18,null,null,0),u.stateNode=i,u.return=s,s.child=u,sr=s,ar=null,!0):!1;default:return!1}}function qd(s){return(s.mode&1)!==0&&(s.flags&128)===0}function $d(s){if(Lt){var i=ar;if(i){var u=i;if(!ym(s,i)){if(qd(s))throw Error(n(418));i=Ps(u.nextSibling);var f=sr;i&&ym(s,i)?gm(f,u):(s.flags=s.flags&-4097|2,Lt=!1,sr=s)}}else{if(qd(s))throw Error(n(418));s.flags=s.flags&-4097|2,Lt=!1,sr=s}}}function bm(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;sr=s}function Cl(s){if(s!==sr)return!1;if(!Lt)return bm(s),Lt=!0,!1;var i;if((i=s.tag!==3)&&!(i=s.tag!==5)&&(i=s.type,i=i!=="head"&&i!=="body"&&!Fd(s.type,s.memoizedProps)),i&&(i=ar)){if(qd(s))throw Em(),Error(n(418));for(;i;)gm(s,i),i=Ps(i.nextSibling)}if(bm(s),s.tag===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(n(317));e:{for(s=s.nextSibling,i=0;s;){if(s.nodeType===8){var u=s.data;if(u==="/$"){if(i===0){ar=Ps(s.nextSibling);break e}i--}else u!=="$"&&u!=="$!"&&u!=="$?"||i++}s=s.nextSibling}ar=null}}else ar=sr?Ps(s.stateNode.nextSibling):null;return!0}function Em(){for(var s=ar;s;)s=Ps(s.nextSibling)}function Ti(){ar=sr=null,Lt=!1}function Vd(s){Nr===null?Nr=[s]:Nr.push(s)}var nv=A.ReactCurrentBatchConfig;function Bo(s,i,u){if(s=u.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(u._owner){if(u=u._owner,u){if(u.tag!==1)throw Error(n(309));var f=u.stateNode}if(!f)throw Error(n(147,s));var b=f,T=""+s;return i!==null&&i.ref!==null&&typeof i.ref=="function"&&i.ref._stringRef===T?i.ref:(i=function(D){var Y=b.refs;D===null?delete Y[T]:Y[T]=D},i._stringRef=T,i)}if(typeof s!="string")throw Error(n(284));if(!u._owner)throw Error(n(290,s))}return s}function kl(s,i){throw s=Object.prototype.toString.call(i),Error(n(31,s==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":s))}function xm(s){var i=s._init;return i(s._payload)}function Tm(s){function i(ee,X){if(s){var ne=ee.deletions;ne===null?(ee.deletions=[X],ee.flags|=16):ne.push(X)}}function u(ee,X){if(!s)return null;for(;X!==null;)i(ee,X),X=X.sibling;return null}function f(ee,X){for(ee=new Map;X!==null;)X.key!==null?ee.set(X.key,X):ee.set(X.index,X),X=X.sibling;return ee}function b(ee,X){return ee=Vs(ee,X),ee.index=0,ee.sibling=null,ee}function T(ee,X,ne){return ee.index=ne,s?(ne=ee.alternate,ne!==null?(ne=ne.index,ne<X?(ee.flags|=2,X):ne):(ee.flags|=2,X)):(ee.flags|=1048576,X)}function D(ee){return s&&ee.alternate===null&&(ee.flags|=2),ee}function Y(ee,X,ne,ge){return X===null||X.tag!==6?(X=Bf(ne,ee.mode,ge),X.return=ee,X):(X=b(X,ne),X.return=ee,X)}function V(ee,X,ne,ge){var Ie=ne.type;return Ie===N?de(ee,X,ne.props.children,ge,ne.key):X!==null&&(X.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===Q&&xm(Ie)===X.type)?(ge=b(X,ne.props),ge.ref=Bo(ee,X,ne),ge.return=ee,ge):(ge=Kl(ne.type,ne.key,ne.props,null,ee.mode,ge),ge.ref=Bo(ee,X,ne),ge.return=ee,ge)}function se(ee,X,ne,ge){return X===null||X.tag!==4||X.stateNode.containerInfo!==ne.containerInfo||X.stateNode.implementation!==ne.implementation?(X=Hf(ne,ee.mode,ge),X.return=ee,X):(X=b(X,ne.children||[]),X.return=ee,X)}function de(ee,X,ne,ge,Ie){return X===null||X.tag!==7?(X=Aa(ne,ee.mode,ge,Ie),X.return=ee,X):(X=b(X,ne),X.return=ee,X)}function fe(ee,X,ne){if(typeof X=="string"&&X!==""||typeof X=="number")return X=Bf(""+X,ee.mode,ne),X.return=ee,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case P:return ne=Kl(X.type,X.key,X.props,null,ee.mode,ne),ne.ref=Bo(ee,null,X),ne.return=ee,ne;case _:return X=Hf(X,ee.mode,ne),X.return=ee,X;case Q:var ge=X._init;return fe(ee,ge(X._payload),ne)}if(nt(X)||K(X))return X=Aa(X,ee.mode,ne,null),X.return=ee,X;kl(ee,X)}return null}function le(ee,X,ne,ge){var Ie=X!==null?X.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number")return Ie!==null?null:Y(ee,X,""+ne,ge);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case P:return ne.key===Ie?V(ee,X,ne,ge):null;case _:return ne.key===Ie?se(ee,X,ne,ge):null;case Q:return Ie=ne._init,le(ee,X,Ie(ne._payload),ge)}if(nt(ne)||K(ne))return Ie!==null?null:de(ee,X,ne,ge,null);kl(ee,ne)}return null}function xe(ee,X,ne,ge,Ie){if(typeof ge=="string"&&ge!==""||typeof ge=="number")return ee=ee.get(ne)||null,Y(X,ee,""+ge,Ie);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case P:return ee=ee.get(ge.key===null?ne:ge.key)||null,V(X,ee,ge,Ie);case _:return ee=ee.get(ge.key===null?ne:ge.key)||null,se(X,ee,ge,Ie);case Q:var Pe=ge._init;return xe(ee,X,ne,Pe(ge._payload),Ie)}if(nt(ge)||K(ge))return ee=ee.get(ne)||null,de(X,ee,ge,Ie,null);kl(X,ge)}return null}function Ne(ee,X,ne,ge){for(var Ie=null,Pe=null,Fe=X,Ue=X=0,bn=null;Fe!==null&&Ue<ne.length;Ue++){Fe.index>Ue?(bn=Fe,Fe=null):bn=Fe.sibling;var ut=le(ee,Fe,ne[Ue],ge);if(ut===null){Fe===null&&(Fe=bn);break}s&&Fe&&ut.alternate===null&&i(ee,Fe),X=T(ut,X,Ue),Pe===null?Ie=ut:Pe.sibling=ut,Pe=ut,Fe=bn}if(Ue===ne.length)return u(ee,Fe),Lt&&wa(ee,Ue),Ie;if(Fe===null){for(;Ue<ne.length;Ue++)Fe=fe(ee,ne[Ue],ge),Fe!==null&&(X=T(Fe,X,Ue),Pe===null?Ie=Fe:Pe.sibling=Fe,Pe=Fe);return Lt&&wa(ee,Ue),Ie}for(Fe=f(ee,Fe);Ue<ne.length;Ue++)bn=xe(Fe,ee,Ue,ne[Ue],ge),bn!==null&&(s&&bn.alternate!==null&&Fe.delete(bn.key===null?Ue:bn.key),X=T(bn,X,Ue),Pe===null?Ie=bn:Pe.sibling=bn,Pe=bn);return s&&Fe.forEach(function(Qs){return i(ee,Qs)}),Lt&&wa(ee,Ue),Ie}function Ae(ee,X,ne,ge){var Ie=K(ne);if(typeof Ie!="function")throw Error(n(150));if(ne=Ie.call(ne),ne==null)throw Error(n(151));for(var Pe=Ie=null,Fe=X,Ue=X=0,bn=null,ut=ne.next();Fe!==null&&!ut.done;Ue++,ut=ne.next()){Fe.index>Ue?(bn=Fe,Fe=null):bn=Fe.sibling;var Qs=le(ee,Fe,ut.value,ge);if(Qs===null){Fe===null&&(Fe=bn);break}s&&Fe&&Qs.alternate===null&&i(ee,Fe),X=T(Qs,X,Ue),Pe===null?Ie=Qs:Pe.sibling=Qs,Pe=Qs,Fe=bn}if(ut.done)return u(ee,Fe),Lt&&wa(ee,Ue),Ie;if(Fe===null){for(;!ut.done;Ue++,ut=ne.next())ut=fe(ee,ut.value,ge),ut!==null&&(X=T(ut,X,Ue),Pe===null?Ie=ut:Pe.sibling=ut,Pe=ut);return Lt&&wa(ee,Ue),Ie}for(Fe=f(ee,Fe);!ut.done;Ue++,ut=ne.next())ut=xe(Fe,ee,Ue,ut.value,ge),ut!==null&&(s&&ut.alternate!==null&&Fe.delete(ut.key===null?Ue:ut.key),X=T(ut,X,Ue),Pe===null?Ie=ut:Pe.sibling=ut,Pe=ut);return s&&Fe.forEach(function(Mv){return i(ee,Mv)}),Lt&&wa(ee,Ue),Ie}function Xt(ee,X,ne,ge){if(typeof ne=="object"&&ne!==null&&ne.type===N&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case P:e:{for(var Ie=ne.key,Pe=X;Pe!==null;){if(Pe.key===Ie){if(Ie=ne.type,Ie===N){if(Pe.tag===7){u(ee,Pe.sibling),X=b(Pe,ne.props.children),X.return=ee,ee=X;break e}}else if(Pe.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===Q&&xm(Ie)===Pe.type){u(ee,Pe.sibling),X=b(Pe,ne.props),X.ref=Bo(ee,Pe,ne),X.return=ee,ee=X;break e}u(ee,Pe);break}else i(ee,Pe);Pe=Pe.sibling}ne.type===N?(X=Aa(ne.props.children,ee.mode,ge,ne.key),X.return=ee,ee=X):(ge=Kl(ne.type,ne.key,ne.props,null,ee.mode,ge),ge.ref=Bo(ee,X,ne),ge.return=ee,ee=ge)}return D(ee);case _:e:{for(Pe=ne.key;X!==null;){if(X.key===Pe)if(X.tag===4&&X.stateNode.containerInfo===ne.containerInfo&&X.stateNode.implementation===ne.implementation){u(ee,X.sibling),X=b(X,ne.children||[]),X.return=ee,ee=X;break e}else{u(ee,X);break}else i(ee,X);X=X.sibling}X=Hf(ne,ee.mode,ge),X.return=ee,ee=X}return D(ee);case Q:return Pe=ne._init,Xt(ee,X,Pe(ne._payload),ge)}if(nt(ne))return Ne(ee,X,ne,ge);if(K(ne))return Ae(ee,X,ne,ge);kl(ee,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"?(ne=""+ne,X!==null&&X.tag===6?(u(ee,X.sibling),X=b(X,ne),X.return=ee,ee=X):(u(ee,X),X=Bf(ne,ee.mode,ge),X.return=ee,ee=X),D(ee)):u(ee,X)}return Xt}var vi=Tm(!0),vm=Tm(!1),Nl=Fs(null),Ol=null,wi=null,Qd=null;function Gd(){Qd=wi=Ol=null}function Xd(s){var i=Nl.current;Dt(Nl),s._currentValue=i}function Kd(s,i,u){for(;s!==null;){var f=s.alternate;if((s.childLanes&i)!==i?(s.childLanes|=i,f!==null&&(f.childLanes|=i)):f!==null&&(f.childLanes&i)!==i&&(f.childLanes|=i),s===u)break;s=s.return}}function Si(s,i){Ol=s,Qd=wi=null,s=s.dependencies,s!==null&&s.firstContext!==null&&((s.lanes&i)!==0&&(qn=!0),s.firstContext=null)}function mr(s){var i=s._currentValue;if(Qd!==s)if(s={context:s,memoizedValue:i,next:null},wi===null){if(Ol===null)throw Error(n(308));wi=s,Ol.dependencies={lanes:0,firstContext:s}}else wi=wi.next=s;return i}var Sa=null;function Jd(s){Sa===null?Sa=[s]:Sa.push(s)}function wm(s,i,u,f){var b=i.interleaved;return b===null?(u.next=u,Jd(i)):(u.next=b.next,b.next=u),i.interleaved=u,hs(s,f)}function hs(s,i){s.lanes|=i;var u=s.alternate;for(u!==null&&(u.lanes|=i),u=s,s=s.return;s!==null;)s.childLanes|=i,u=s.alternate,u!==null&&(u.childLanes|=i),u=s,s=s.return;return u.tag===3?u.stateNode:null}var Hs=!1;function Zd(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Sm(s,i){s=s.updateQueue,i.updateQueue===s&&(i.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,effects:s.effects})}function ps(s,i){return{eventTime:s,lane:i,tag:0,payload:null,callback:null,next:null}}function Us(s,i,u){var f=s.updateQueue;if(f===null)return null;if(f=f.shared,(at&2)!==0){var b=f.pending;return b===null?i.next=i:(i.next=b.next,b.next=i),f.pending=i,hs(s,u)}return b=f.interleaved,b===null?(i.next=i,Jd(f)):(i.next=b.next,b.next=i),f.interleaved=i,hs(s,u)}function Dl(s,i,u){if(i=i.updateQueue,i!==null&&(i=i.shared,(u&4194240)!==0)){var f=i.lanes;f&=s.pendingLanes,u|=f,i.lanes=u,hd(s,u)}}function _m(s,i){var u=s.updateQueue,f=s.alternate;if(f!==null&&(f=f.updateQueue,u===f)){var b=null,T=null;if(u=u.firstBaseUpdate,u!==null){do{var D={eventTime:u.eventTime,lane:u.lane,tag:u.tag,payload:u.payload,callback:u.callback,next:null};T===null?b=T=D:T=T.next=D,u=u.next}while(u!==null);T===null?b=T=i:T=T.next=i}else b=T=i;u={baseState:f.baseState,firstBaseUpdate:b,lastBaseUpdate:T,shared:f.shared,effects:f.effects},s.updateQueue=u;return}s=u.lastBaseUpdate,s===null?u.firstBaseUpdate=i:s.next=i,u.lastBaseUpdate=i}function Al(s,i,u,f){var b=s.updateQueue;Hs=!1;var T=b.firstBaseUpdate,D=b.lastBaseUpdate,Y=b.shared.pending;if(Y!==null){b.shared.pending=null;var V=Y,se=V.next;V.next=null,D===null?T=se:D.next=se,D=V;var de=s.alternate;de!==null&&(de=de.updateQueue,Y=de.lastBaseUpdate,Y!==D&&(Y===null?de.firstBaseUpdate=se:Y.next=se,de.lastBaseUpdate=V))}if(T!==null){var fe=b.baseState;D=0,de=se=V=null,Y=T;do{var le=Y.lane,xe=Y.eventTime;if((f&le)===le){de!==null&&(de=de.next={eventTime:xe,lane:0,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null});e:{var Ne=s,Ae=Y;switch(le=i,xe=u,Ae.tag){case 1:if(Ne=Ae.payload,typeof Ne=="function"){fe=Ne.call(xe,fe,le);break e}fe=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=Ae.payload,le=typeof Ne=="function"?Ne.call(xe,fe,le):Ne,le==null)break e;fe=R({},fe,le);break e;case 2:Hs=!0}}Y.callback!==null&&Y.lane!==0&&(s.flags|=64,le=b.effects,le===null?b.effects=[Y]:le.push(Y))}else xe={eventTime:xe,lane:le,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null},de===null?(se=de=xe,V=fe):de=de.next=xe,D|=le;if(Y=Y.next,Y===null){if(Y=b.shared.pending,Y===null)break;le=Y,Y=le.next,le.next=null,b.lastBaseUpdate=le,b.shared.pending=null}}while(!0);if(de===null&&(V=fe),b.baseState=V,b.firstBaseUpdate=se,b.lastBaseUpdate=de,i=b.shared.interleaved,i!==null){b=i;do D|=b.lane,b=b.next;while(b!==i)}else T===null&&(b.shared.lanes=0);ka|=D,s.lanes=D,s.memoizedState=fe}}function Cm(s,i,u){if(s=i.effects,i.effects=null,s!==null)for(i=0;i<s.length;i++){var f=s[i],b=f.callback;if(b!==null){if(f.callback=null,f=u,typeof b!="function")throw Error(n(191,b));b.call(f)}}}var Ho={},Yr=Fs(Ho),Uo=Fs(Ho),zo=Fs(Ho);function _a(s){if(s===Ho)throw Error(n(174));return s}function ef(s,i){switch(St(zo,i),St(Uo,s),St(Yr,Ho),s=i.nodeType,s){case 9:case 11:i=(i=i.documentElement)?i.namespaceURI:pe(null,"");break;default:s=s===8?i.parentNode:i,i=s.namespaceURI||null,s=s.tagName,i=pe(i,s)}Dt(Yr),St(Yr,i)}function _i(){Dt(Yr),Dt(Uo),Dt(zo)}function km(s){_a(zo.current);var i=_a(Yr.current),u=pe(i,s.type);i!==u&&(St(Uo,s),St(Yr,u))}function tf(s){Uo.current===s&&(Dt(Yr),Dt(Uo))}var Ft=Fs(0);function Il(s){for(var i=s;i!==null;){if(i.tag===13){var u=i.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||u.data==="$!"))return i}else if(i.tag===19&&i.memoizedProps.revealOrder!==void 0){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break;for(;i.sibling===null;){if(i.return===null||i.return===s)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var nf=[];function rf(){for(var s=0;s<nf.length;s++)nf[s]._workInProgressVersionPrimary=null;nf.length=0}var Rl=A.ReactCurrentDispatcher,sf=A.ReactCurrentBatchConfig,Ca=0,jt=null,dn=null,gn=null,Ll=!1,Wo=!1,Yo=0,rv=0;function Nn(){throw Error(n(321))}function af(s,i){if(i===null)return!1;for(var u=0;u<i.length&&u<s.length;u++)if(!kr(s[u],i[u]))return!1;return!0}function of(s,i,u,f,b,T){if(Ca=T,jt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,Rl.current=s===null||s.memoizedState===null?ov:uv,s=u(f,b),Wo){T=0;do{if(Wo=!1,Yo=0,25<=T)throw Error(n(301));T+=1,gn=dn=null,i.updateQueue=null,Rl.current=lv,s=u(f,b)}while(Wo)}if(Rl.current=Fl,i=dn!==null&&dn.next!==null,Ca=0,gn=dn=jt=null,Ll=!1,i)throw Error(n(300));return s}function uf(){var s=Yo!==0;return Yo=0,s}function qr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return gn===null?jt.memoizedState=gn=s:gn=gn.next=s,gn}function gr(){if(dn===null){var s=jt.alternate;s=s!==null?s.memoizedState:null}else s=dn.next;var i=gn===null?jt.memoizedState:gn.next;if(i!==null)gn=i,dn=s;else{if(s===null)throw Error(n(310));dn=s,s={memoizedState:dn.memoizedState,baseState:dn.baseState,baseQueue:dn.baseQueue,queue:dn.queue,next:null},gn===null?jt.memoizedState=gn=s:gn=gn.next=s}return gn}function qo(s,i){return typeof i=="function"?i(s):i}function lf(s){var i=gr(),u=i.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=s;var f=dn,b=f.baseQueue,T=u.pending;if(T!==null){if(b!==null){var D=b.next;b.next=T.next,T.next=D}f.baseQueue=b=T,u.pending=null}if(b!==null){T=b.next,f=f.baseState;var Y=D=null,V=null,se=T;do{var de=se.lane;if((Ca&de)===de)V!==null&&(V=V.next={lane:0,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),f=se.hasEagerState?se.eagerState:s(f,se.action);else{var fe={lane:de,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null};V===null?(Y=V=fe,D=f):V=V.next=fe,jt.lanes|=de,ka|=de}se=se.next}while(se!==null&&se!==T);V===null?D=f:V.next=Y,kr(f,i.memoizedState)||(qn=!0),i.memoizedState=f,i.baseState=D,i.baseQueue=V,u.lastRenderedState=f}if(s=u.interleaved,s!==null){b=s;do T=b.lane,jt.lanes|=T,ka|=T,b=b.next;while(b!==s)}else b===null&&(u.lanes=0);return[i.memoizedState,u.dispatch]}function cf(s){var i=gr(),u=i.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=s;var f=u.dispatch,b=u.pending,T=i.memoizedState;if(b!==null){u.pending=null;var D=b=b.next;do T=s(T,D.action),D=D.next;while(D!==b);kr(T,i.memoizedState)||(qn=!0),i.memoizedState=T,i.baseQueue===null&&(i.baseState=T),u.lastRenderedState=T}return[T,f]}function Nm(){}function Om(s,i){var u=jt,f=gr(),b=i(),T=!kr(f.memoizedState,b);if(T&&(f.memoizedState=b,qn=!0),f=f.queue,df(Im.bind(null,u,f,s),[s]),f.getSnapshot!==i||T||gn!==null&&gn.memoizedState.tag&1){if(u.flags|=2048,$o(9,Am.bind(null,u,f,b,i),void 0,null),yn===null)throw Error(n(349));(Ca&30)!==0||Dm(u,i,b)}return b}function Dm(s,i,u){s.flags|=16384,s={getSnapshot:i,value:u},i=jt.updateQueue,i===null?(i={lastEffect:null,stores:null},jt.updateQueue=i,i.stores=[s]):(u=i.stores,u===null?i.stores=[s]:u.push(s))}function Am(s,i,u,f){i.value=u,i.getSnapshot=f,Rm(i)&&Lm(s)}function Im(s,i,u){return u(function(){Rm(i)&&Lm(s)})}function Rm(s){var i=s.getSnapshot;s=s.value;try{var u=i();return!kr(s,u)}catch{return!0}}function Lm(s){var i=hs(s,1);i!==null&&Ir(i,s,1,-1)}function Mm(s){var i=qr();return typeof s=="function"&&(s=s()),i.memoizedState=i.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:qo,lastRenderedState:s},i.queue=s,s=s.dispatch=iv.bind(null,jt,s),[i.memoizedState,s]}function $o(s,i,u,f){return s={tag:s,create:i,destroy:u,deps:f,next:null},i=jt.updateQueue,i===null?(i={lastEffect:null,stores:null},jt.updateQueue=i,i.lastEffect=s.next=s):(u=i.lastEffect,u===null?i.lastEffect=s.next=s:(f=u.next,u.next=s,s.next=f,i.lastEffect=s)),s}function Pm(){return gr().memoizedState}function Ml(s,i,u,f){var b=qr();jt.flags|=s,b.memoizedState=$o(1|i,u,void 0,f===void 0?null:f)}function Pl(s,i,u,f){var b=gr();f=f===void 0?null:f;var T=void 0;if(dn!==null){var D=dn.memoizedState;if(T=D.destroy,f!==null&&af(f,D.deps)){b.memoizedState=$o(i,u,T,f);return}}jt.flags|=s,b.memoizedState=$o(1|i,u,T,f)}function Fm(s,i){return Ml(8390656,8,s,i)}function df(s,i){return Pl(2048,8,s,i)}function jm(s,i){return Pl(4,2,s,i)}function Bm(s,i){return Pl(4,4,s,i)}function Hm(s,i){if(typeof i=="function")return s=s(),i(s),function(){i(null)};if(i!=null)return s=s(),i.current=s,function(){i.current=null}}function Um(s,i,u){return u=u!=null?u.concat([s]):null,Pl(4,4,Hm.bind(null,i,s),u)}function ff(){}function zm(s,i){var u=gr();i=i===void 0?null:i;var f=u.memoizedState;return f!==null&&i!==null&&af(i,f[1])?f[0]:(u.memoizedState=[s,i],s)}function Wm(s,i){var u=gr();i=i===void 0?null:i;var f=u.memoizedState;return f!==null&&i!==null&&af(i,f[1])?f[0]:(s=s(),u.memoizedState=[s,i],s)}function Ym(s,i,u){return(Ca&21)===0?(s.baseState&&(s.baseState=!1,qn=!0),s.memoizedState=u):(kr(u,i)||(u=xp(),jt.lanes|=u,ka|=u,s.baseState=!0),i)}function sv(s,i){var u=pt;pt=u!==0&&4>u?u:4,s(!0);var f=sf.transition;sf.transition={};try{s(!1),i()}finally{pt=u,sf.transition=f}}function qm(){return gr().memoizedState}function av(s,i,u){var f=qs(s);if(u={lane:f,action:u,hasEagerState:!1,eagerState:null,next:null},$m(s))Vm(i,u);else if(u=wm(s,i,u,f),u!==null){var b=Fn();Ir(u,s,f,b),Qm(u,i,f)}}function iv(s,i,u){var f=qs(s),b={lane:f,action:u,hasEagerState:!1,eagerState:null,next:null};if($m(s))Vm(i,b);else{var T=s.alternate;if(s.lanes===0&&(T===null||T.lanes===0)&&(T=i.lastRenderedReducer,T!==null))try{var D=i.lastRenderedState,Y=T(D,u);if(b.hasEagerState=!0,b.eagerState=Y,kr(Y,D)){var V=i.interleaved;V===null?(b.next=b,Jd(i)):(b.next=V.next,V.next=b),i.interleaved=b;return}}catch{}finally{}u=wm(s,i,b,f),u!==null&&(b=Fn(),Ir(u,s,f,b),Qm(u,i,f))}}function $m(s){var i=s.alternate;return s===jt||i!==null&&i===jt}function Vm(s,i){Wo=Ll=!0;var u=s.pending;u===null?i.next=i:(i.next=u.next,u.next=i),s.pending=i}function Qm(s,i,u){if((u&4194240)!==0){var f=i.lanes;f&=s.pendingLanes,u|=f,i.lanes=u,hd(s,u)}}var Fl={readContext:mr,useCallback:Nn,useContext:Nn,useEffect:Nn,useImperativeHandle:Nn,useInsertionEffect:Nn,useLayoutEffect:Nn,useMemo:Nn,useReducer:Nn,useRef:Nn,useState:Nn,useDebugValue:Nn,useDeferredValue:Nn,useTransition:Nn,useMutableSource:Nn,useSyncExternalStore:Nn,useId:Nn,unstable_isNewReconciler:!1},ov={readContext:mr,useCallback:function(s,i){return qr().memoizedState=[s,i===void 0?null:i],s},useContext:mr,useEffect:Fm,useImperativeHandle:function(s,i,u){return u=u!=null?u.concat([s]):null,Ml(4194308,4,Hm.bind(null,i,s),u)},useLayoutEffect:function(s,i){return Ml(4194308,4,s,i)},useInsertionEffect:function(s,i){return Ml(4,2,s,i)},useMemo:function(s,i){var u=qr();return i=i===void 0?null:i,s=s(),u.memoizedState=[s,i],s},useReducer:function(s,i,u){var f=qr();return i=u!==void 0?u(i):i,f.memoizedState=f.baseState=i,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:i},f.queue=s,s=s.dispatch=av.bind(null,jt,s),[f.memoizedState,s]},useRef:function(s){var i=qr();return s={current:s},i.memoizedState=s},useState:Mm,useDebugValue:ff,useDeferredValue:function(s){return qr().memoizedState=s},useTransition:function(){var s=Mm(!1),i=s[0];return s=sv.bind(null,s[1]),qr().memoizedState=s,[i,s]},useMutableSource:function(){},useSyncExternalStore:function(s,i,u){var f=jt,b=qr();if(Lt){if(u===void 0)throw Error(n(407));u=u()}else{if(u=i(),yn===null)throw Error(n(349));(Ca&30)!==0||Dm(f,i,u)}b.memoizedState=u;var T={value:u,getSnapshot:i};return b.queue=T,Fm(Im.bind(null,f,T,s),[s]),f.flags|=2048,$o(9,Am.bind(null,f,T,u,i),void 0,null),u},useId:function(){var s=qr(),i=yn.identifierPrefix;if(Lt){var u=fs,f=ds;u=(f&~(1<<32-Cr(f)-1)).toString(32)+u,i=":"+i+"R"+u,u=Yo++,0<u&&(i+="H"+u.toString(32)),i+=":"}else u=rv++,i=":"+i+"r"+u.toString(32)+":";return s.memoizedState=i},unstable_isNewReconciler:!1},uv={readContext:mr,useCallback:zm,useContext:mr,useEffect:df,useImperativeHandle:Um,useInsertionEffect:jm,useLayoutEffect:Bm,useMemo:Wm,useReducer:lf,useRef:Pm,useState:function(){return lf(qo)},useDebugValue:ff,useDeferredValue:function(s){var i=gr();return Ym(i,dn.memoizedState,s)},useTransition:function(){var s=lf(qo)[0],i=gr().memoizedState;return[s,i]},useMutableSource:Nm,useSyncExternalStore:Om,useId:qm,unstable_isNewReconciler:!1},lv={readContext:mr,useCallback:zm,useContext:mr,useEffect:df,useImperativeHandle:Um,useInsertionEffect:jm,useLayoutEffect:Bm,useMemo:Wm,useReducer:cf,useRef:Pm,useState:function(){return cf(qo)},useDebugValue:ff,useDeferredValue:function(s){var i=gr();return dn===null?i.memoizedState=s:Ym(i,dn.memoizedState,s)},useTransition:function(){var s=cf(qo)[0],i=gr().memoizedState;return[s,i]},useMutableSource:Nm,useSyncExternalStore:Om,useId:qm,unstable_isNewReconciler:!1};function Or(s,i){if(s&&s.defaultProps){i=R({},i),s=s.defaultProps;for(var u in s)i[u]===void 0&&(i[u]=s[u]);return i}return i}function hf(s,i,u,f){i=s.memoizedState,u=u(f,i),u=u==null?i:R({},i,u),s.memoizedState=u,s.lanes===0&&(s.updateQueue.baseState=u)}var jl={isMounted:function(s){return(s=s._reactInternals)?Tt(s)===s:!1},enqueueSetState:function(s,i,u){s=s._reactInternals;var f=Fn(),b=qs(s),T=ps(f,b);T.payload=i,u!=null&&(T.callback=u),i=Us(s,T,b),i!==null&&(Ir(i,s,b,f),Dl(i,s,b))},enqueueReplaceState:function(s,i,u){s=s._reactInternals;var f=Fn(),b=qs(s),T=ps(f,b);T.tag=1,T.payload=i,u!=null&&(T.callback=u),i=Us(s,T,b),i!==null&&(Ir(i,s,b,f),Dl(i,s,b))},enqueueForceUpdate:function(s,i){s=s._reactInternals;var u=Fn(),f=qs(s),b=ps(u,f);b.tag=2,i!=null&&(b.callback=i),i=Us(s,b,f),i!==null&&(Ir(i,s,f,u),Dl(i,s,f))}};function Gm(s,i,u,f,b,T,D){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(f,T,D):i.prototype&&i.prototype.isPureReactComponent?!Io(u,f)||!Io(b,T):!0}function Xm(s,i,u){var f=!1,b=js,T=i.contextType;return typeof T=="object"&&T!==null?T=mr(T):(b=Yn(i)?Ta:kn.current,f=i.contextTypes,T=(f=f!=null)?bi(s,b):js),i=new i(u,T),s.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=jl,s.stateNode=i,i._reactInternals=s,f&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=b,s.__reactInternalMemoizedMaskedChildContext=T),i}function Km(s,i,u,f){s=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(u,f),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(u,f),i.state!==s&&jl.enqueueReplaceState(i,i.state,null)}function pf(s,i,u,f){var b=s.stateNode;b.props=u,b.state=s.memoizedState,b.refs={},Zd(s);var T=i.contextType;typeof T=="object"&&T!==null?b.context=mr(T):(T=Yn(i)?Ta:kn.current,b.context=bi(s,T)),b.state=s.memoizedState,T=i.getDerivedStateFromProps,typeof T=="function"&&(hf(s,i,T,u),b.state=s.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(i=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),i!==b.state&&jl.enqueueReplaceState(b,b.state,null),Al(s,u,b,f),b.state=s.memoizedState),typeof b.componentDidMount=="function"&&(s.flags|=4194308)}function Ci(s,i){try{var u="",f=i;do u+=Be(f),f=f.return;while(f);var b=u}catch(T){b=`
|
|
32
|
-
Error generating stack: `+T.message+`
|
|
33
|
-
`+T.stack}return{value:s,source:i,stack:b,digest:null}}function mf(s,i,u){return{value:s,source:null,stack:u??null,digest:i??null}}function gf(s,i){try{console.error(i.value)}catch(u){setTimeout(function(){throw u})}}var cv=typeof WeakMap=="function"?WeakMap:Map;function Jm(s,i,u){u=ps(-1,u),u.tag=3,u.payload={element:null};var f=i.value;return u.callback=function(){ql||(ql=!0,Af=f),gf(s,i)},u}function Zm(s,i,u){u=ps(-1,u),u.tag=3;var f=s.type.getDerivedStateFromError;if(typeof f=="function"){var b=i.value;u.payload=function(){return f(b)},u.callback=function(){gf(s,i)}}var T=s.stateNode;return T!==null&&typeof T.componentDidCatch=="function"&&(u.callback=function(){gf(s,i),typeof f!="function"&&(Ws===null?Ws=new Set([this]):Ws.add(this));var D=i.stack;this.componentDidCatch(i.value,{componentStack:D!==null?D:""})}),u}function eg(s,i,u){var f=s.pingCache;if(f===null){f=s.pingCache=new cv;var b=new Set;f.set(i,b)}else b=f.get(i),b===void 0&&(b=new Set,f.set(i,b));b.has(u)||(b.add(u),s=Sv.bind(null,s,i,u),i.then(s,s))}function tg(s){do{var i;if((i=s.tag===13)&&(i=s.memoizedState,i=i!==null?i.dehydrated!==null:!0),i)return s;s=s.return}while(s!==null);return null}function ng(s,i,u,f,b){return(s.mode&1)===0?(s===i?s.flags|=65536:(s.flags|=128,u.flags|=131072,u.flags&=-52805,u.tag===1&&(u.alternate===null?u.tag=17:(i=ps(-1,1),i.tag=2,Us(u,i,1))),u.lanes|=1),s):(s.flags|=65536,s.lanes=b,s)}var dv=A.ReactCurrentOwner,qn=!1;function Pn(s,i,u,f){i.child=s===null?vm(i,null,u,f):vi(i,s.child,u,f)}function rg(s,i,u,f,b){u=u.render;var T=i.ref;return Si(i,b),f=of(s,i,u,f,T,b),u=uf(),s!==null&&!qn?(i.updateQueue=s.updateQueue,i.flags&=-2053,s.lanes&=~b,ms(s,i,b)):(Lt&&u&&Wd(i),i.flags|=1,Pn(s,i,f,b),i.child)}function sg(s,i,u,f,b){if(s===null){var T=u.type;return typeof T=="function"&&!jf(T)&&T.defaultProps===void 0&&u.compare===null&&u.defaultProps===void 0?(i.tag=15,i.type=T,ag(s,i,T,f,b)):(s=Kl(u.type,null,f,i,i.mode,b),s.ref=i.ref,s.return=i,i.child=s)}if(T=s.child,(s.lanes&b)===0){var D=T.memoizedProps;if(u=u.compare,u=u!==null?u:Io,u(D,f)&&s.ref===i.ref)return ms(s,i,b)}return i.flags|=1,s=Vs(T,f),s.ref=i.ref,s.return=i,i.child=s}function ag(s,i,u,f,b){if(s!==null){var T=s.memoizedProps;if(Io(T,f)&&s.ref===i.ref)if(qn=!1,i.pendingProps=f=T,(s.lanes&b)!==0)(s.flags&131072)!==0&&(qn=!0);else return i.lanes=s.lanes,ms(s,i,b)}return yf(s,i,u,f,b)}function ig(s,i,u){var f=i.pendingProps,b=f.children,T=s!==null?s.memoizedState:null;if(f.mode==="hidden")if((i.mode&1)===0)i.memoizedState={baseLanes:0,cachePool:null,transitions:null},St(Ni,ir),ir|=u;else{if((u&1073741824)===0)return s=T!==null?T.baseLanes|u:u,i.lanes=i.childLanes=1073741824,i.memoizedState={baseLanes:s,cachePool:null,transitions:null},i.updateQueue=null,St(Ni,ir),ir|=s,null;i.memoizedState={baseLanes:0,cachePool:null,transitions:null},f=T!==null?T.baseLanes:u,St(Ni,ir),ir|=f}else T!==null?(f=T.baseLanes|u,i.memoizedState=null):f=u,St(Ni,ir),ir|=f;return Pn(s,i,b,u),i.child}function og(s,i){var u=i.ref;(s===null&&u!==null||s!==null&&s.ref!==u)&&(i.flags|=512,i.flags|=2097152)}function yf(s,i,u,f,b){var T=Yn(u)?Ta:kn.current;return T=bi(i,T),Si(i,b),u=of(s,i,u,f,T,b),f=uf(),s!==null&&!qn?(i.updateQueue=s.updateQueue,i.flags&=-2053,s.lanes&=~b,ms(s,i,b)):(Lt&&f&&Wd(i),i.flags|=1,Pn(s,i,u,b),i.child)}function ug(s,i,u,f,b){if(Yn(u)){var T=!0;vl(i)}else T=!1;if(Si(i,b),i.stateNode===null)Hl(s,i),Xm(i,u,f),pf(i,u,f,b),f=!0;else if(s===null){var D=i.stateNode,Y=i.memoizedProps;D.props=Y;var V=D.context,se=u.contextType;typeof se=="object"&&se!==null?se=mr(se):(se=Yn(u)?Ta:kn.current,se=bi(i,se));var de=u.getDerivedStateFromProps,fe=typeof de=="function"||typeof D.getSnapshotBeforeUpdate=="function";fe||typeof D.UNSAFE_componentWillReceiveProps!="function"&&typeof D.componentWillReceiveProps!="function"||(Y!==f||V!==se)&&Km(i,D,f,se),Hs=!1;var le=i.memoizedState;D.state=le,Al(i,f,D,b),V=i.memoizedState,Y!==f||le!==V||Wn.current||Hs?(typeof de=="function"&&(hf(i,u,de,f),V=i.memoizedState),(Y=Hs||Gm(i,u,Y,f,le,V,se))?(fe||typeof D.UNSAFE_componentWillMount!="function"&&typeof D.componentWillMount!="function"||(typeof D.componentWillMount=="function"&&D.componentWillMount(),typeof D.UNSAFE_componentWillMount=="function"&&D.UNSAFE_componentWillMount()),typeof D.componentDidMount=="function"&&(i.flags|=4194308)):(typeof D.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=f,i.memoizedState=V),D.props=f,D.state=V,D.context=se,f=Y):(typeof D.componentDidMount=="function"&&(i.flags|=4194308),f=!1)}else{D=i.stateNode,Sm(s,i),Y=i.memoizedProps,se=i.type===i.elementType?Y:Or(i.type,Y),D.props=se,fe=i.pendingProps,le=D.context,V=u.contextType,typeof V=="object"&&V!==null?V=mr(V):(V=Yn(u)?Ta:kn.current,V=bi(i,V));var xe=u.getDerivedStateFromProps;(de=typeof xe=="function"||typeof D.getSnapshotBeforeUpdate=="function")||typeof D.UNSAFE_componentWillReceiveProps!="function"&&typeof D.componentWillReceiveProps!="function"||(Y!==fe||le!==V)&&Km(i,D,f,V),Hs=!1,le=i.memoizedState,D.state=le,Al(i,f,D,b);var Ne=i.memoizedState;Y!==fe||le!==Ne||Wn.current||Hs?(typeof xe=="function"&&(hf(i,u,xe,f),Ne=i.memoizedState),(se=Hs||Gm(i,u,se,f,le,Ne,V)||!1)?(de||typeof D.UNSAFE_componentWillUpdate!="function"&&typeof D.componentWillUpdate!="function"||(typeof D.componentWillUpdate=="function"&&D.componentWillUpdate(f,Ne,V),typeof D.UNSAFE_componentWillUpdate=="function"&&D.UNSAFE_componentWillUpdate(f,Ne,V)),typeof D.componentDidUpdate=="function"&&(i.flags|=4),typeof D.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof D.componentDidUpdate!="function"||Y===s.memoizedProps&&le===s.memoizedState||(i.flags|=4),typeof D.getSnapshotBeforeUpdate!="function"||Y===s.memoizedProps&&le===s.memoizedState||(i.flags|=1024),i.memoizedProps=f,i.memoizedState=Ne),D.props=f,D.state=Ne,D.context=V,f=se):(typeof D.componentDidUpdate!="function"||Y===s.memoizedProps&&le===s.memoizedState||(i.flags|=4),typeof D.getSnapshotBeforeUpdate!="function"||Y===s.memoizedProps&&le===s.memoizedState||(i.flags|=1024),f=!1)}return bf(s,i,u,f,T,b)}function bf(s,i,u,f,b,T){og(s,i);var D=(i.flags&128)!==0;if(!f&&!D)return b&&hm(i,u,!1),ms(s,i,T);f=i.stateNode,dv.current=i;var Y=D&&typeof u.getDerivedStateFromError!="function"?null:f.render();return i.flags|=1,s!==null&&D?(i.child=vi(i,s.child,null,T),i.child=vi(i,null,Y,T)):Pn(s,i,Y,T),i.memoizedState=f.state,b&&hm(i,u,!0),i.child}function lg(s){var i=s.stateNode;i.pendingContext?dm(s,i.pendingContext,i.pendingContext!==i.context):i.context&&dm(s,i.context,!1),ef(s,i.containerInfo)}function cg(s,i,u,f,b){return Ti(),Vd(b),i.flags|=256,Pn(s,i,u,f),i.child}var Ef={dehydrated:null,treeContext:null,retryLane:0};function xf(s){return{baseLanes:s,cachePool:null,transitions:null}}function dg(s,i,u){var f=i.pendingProps,b=Ft.current,T=!1,D=(i.flags&128)!==0,Y;if((Y=D)||(Y=s!==null&&s.memoizedState===null?!1:(b&2)!==0),Y?(T=!0,i.flags&=-129):(s===null||s.memoizedState!==null)&&(b|=1),St(Ft,b&1),s===null)return $d(i),s=i.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?((i.mode&1)===0?i.lanes=1:s.data==="$!"?i.lanes=8:i.lanes=1073741824,null):(D=f.children,s=f.fallback,T?(f=i.mode,T=i.child,D={mode:"hidden",children:D},(f&1)===0&&T!==null?(T.childLanes=0,T.pendingProps=D):T=Jl(D,f,0,null),s=Aa(s,f,u,null),T.return=i,s.return=i,T.sibling=s,i.child=T,i.child.memoizedState=xf(u),i.memoizedState=Ef,s):Tf(i,D));if(b=s.memoizedState,b!==null&&(Y=b.dehydrated,Y!==null))return fv(s,i,D,f,Y,b,u);if(T){T=f.fallback,D=i.mode,b=s.child,Y=b.sibling;var V={mode:"hidden",children:f.children};return(D&1)===0&&i.child!==b?(f=i.child,f.childLanes=0,f.pendingProps=V,i.deletions=null):(f=Vs(b,V),f.subtreeFlags=b.subtreeFlags&14680064),Y!==null?T=Vs(Y,T):(T=Aa(T,D,u,null),T.flags|=2),T.return=i,f.return=i,f.sibling=T,i.child=f,f=T,T=i.child,D=s.child.memoizedState,D=D===null?xf(u):{baseLanes:D.baseLanes|u,cachePool:null,transitions:D.transitions},T.memoizedState=D,T.childLanes=s.childLanes&~u,i.memoizedState=Ef,f}return T=s.child,s=T.sibling,f=Vs(T,{mode:"visible",children:f.children}),(i.mode&1)===0&&(f.lanes=u),f.return=i,f.sibling=null,s!==null&&(u=i.deletions,u===null?(i.deletions=[s],i.flags|=16):u.push(s)),i.child=f,i.memoizedState=null,f}function Tf(s,i){return i=Jl({mode:"visible",children:i},s.mode,0,null),i.return=s,s.child=i}function Bl(s,i,u,f){return f!==null&&Vd(f),vi(i,s.child,null,u),s=Tf(i,i.pendingProps.children),s.flags|=2,i.memoizedState=null,s}function fv(s,i,u,f,b,T,D){if(u)return i.flags&256?(i.flags&=-257,f=mf(Error(n(422))),Bl(s,i,D,f)):i.memoizedState!==null?(i.child=s.child,i.flags|=128,null):(T=f.fallback,b=i.mode,f=Jl({mode:"visible",children:f.children},b,0,null),T=Aa(T,b,D,null),T.flags|=2,f.return=i,T.return=i,f.sibling=T,i.child=f,(i.mode&1)!==0&&vi(i,s.child,null,D),i.child.memoizedState=xf(D),i.memoizedState=Ef,T);if((i.mode&1)===0)return Bl(s,i,D,null);if(b.data==="$!"){if(f=b.nextSibling&&b.nextSibling.dataset,f)var Y=f.dgst;return f=Y,T=Error(n(419)),f=mf(T,f,void 0),Bl(s,i,D,f)}if(Y=(D&s.childLanes)!==0,qn||Y){if(f=yn,f!==null){switch(D&-D){case 4:b=2;break;case 16:b=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:b=32;break;case 536870912:b=268435456;break;default:b=0}b=(b&(f.suspendedLanes|D))!==0?0:b,b!==0&&b!==T.retryLane&&(T.retryLane=b,hs(s,b),Ir(f,s,b,-1))}return Ff(),f=mf(Error(n(421))),Bl(s,i,D,f)}return b.data==="$?"?(i.flags|=128,i.child=s.child,i=_v.bind(null,s),b._reactRetry=i,null):(s=T.treeContext,ar=Ps(b.nextSibling),sr=i,Lt=!0,Nr=null,s!==null&&(hr[pr++]=ds,hr[pr++]=fs,hr[pr++]=va,ds=s.id,fs=s.overflow,va=i),i=Tf(i,f.children),i.flags|=4096,i)}function fg(s,i,u){s.lanes|=i;var f=s.alternate;f!==null&&(f.lanes|=i),Kd(s.return,i,u)}function vf(s,i,u,f,b){var T=s.memoizedState;T===null?s.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:f,tail:u,tailMode:b}:(T.isBackwards=i,T.rendering=null,T.renderingStartTime=0,T.last=f,T.tail=u,T.tailMode=b)}function hg(s,i,u){var f=i.pendingProps,b=f.revealOrder,T=f.tail;if(Pn(s,i,f.children,u),f=Ft.current,(f&2)!==0)f=f&1|2,i.flags|=128;else{if(s!==null&&(s.flags&128)!==0)e:for(s=i.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&fg(s,u,i);else if(s.tag===19)fg(s,u,i);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}f&=1}if(St(Ft,f),(i.mode&1)===0)i.memoizedState=null;else switch(b){case"forwards":for(u=i.child,b=null;u!==null;)s=u.alternate,s!==null&&Il(s)===null&&(b=u),u=u.sibling;u=b,u===null?(b=i.child,i.child=null):(b=u.sibling,u.sibling=null),vf(i,!1,b,u,T);break;case"backwards":for(u=null,b=i.child,i.child=null;b!==null;){if(s=b.alternate,s!==null&&Il(s)===null){i.child=b;break}s=b.sibling,b.sibling=u,u=b,b=s}vf(i,!0,u,null,T);break;case"together":vf(i,!1,null,null,void 0);break;default:i.memoizedState=null}return i.child}function Hl(s,i){(i.mode&1)===0&&s!==null&&(s.alternate=null,i.alternate=null,i.flags|=2)}function ms(s,i,u){if(s!==null&&(i.dependencies=s.dependencies),ka|=i.lanes,(u&i.childLanes)===0)return null;if(s!==null&&i.child!==s.child)throw Error(n(153));if(i.child!==null){for(s=i.child,u=Vs(s,s.pendingProps),i.child=u,u.return=i;s.sibling!==null;)s=s.sibling,u=u.sibling=Vs(s,s.pendingProps),u.return=i;u.sibling=null}return i.child}function hv(s,i,u){switch(i.tag){case 3:lg(i),Ti();break;case 5:km(i);break;case 1:Yn(i.type)&&vl(i);break;case 4:ef(i,i.stateNode.containerInfo);break;case 10:var f=i.type._context,b=i.memoizedProps.value;St(Nl,f._currentValue),f._currentValue=b;break;case 13:if(f=i.memoizedState,f!==null)return f.dehydrated!==null?(St(Ft,Ft.current&1),i.flags|=128,null):(u&i.child.childLanes)!==0?dg(s,i,u):(St(Ft,Ft.current&1),s=ms(s,i,u),s!==null?s.sibling:null);St(Ft,Ft.current&1);break;case 19:if(f=(u&i.childLanes)!==0,(s.flags&128)!==0){if(f)return hg(s,i,u);i.flags|=128}if(b=i.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),St(Ft,Ft.current),f)break;return null;case 22:case 23:return i.lanes=0,ig(s,i,u)}return ms(s,i,u)}var pg,wf,mg,gg;pg=function(s,i){for(var u=i.child;u!==null;){if(u.tag===5||u.tag===6)s.appendChild(u.stateNode);else if(u.tag!==4&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===i)break;for(;u.sibling===null;){if(u.return===null||u.return===i)return;u=u.return}u.sibling.return=u.return,u=u.sibling}},wf=function(){},mg=function(s,i,u,f){var b=s.memoizedProps;if(b!==f){s=i.stateNode,_a(Yr.current);var T=null;switch(u){case"input":b=Hn(s,b),f=Hn(s,f),T=[];break;case"select":b=R({},b,{value:void 0}),f=R({},f,{value:void 0}),T=[];break;case"textarea":b=Nt(s,b),f=Nt(s,f),T=[];break;default:typeof b.onClick!="function"&&typeof f.onClick=="function"&&(s.onclick=El)}At(u,f);var D;u=null;for(se in b)if(!f.hasOwnProperty(se)&&b.hasOwnProperty(se)&&b[se]!=null)if(se==="style"){var Y=b[se];for(D in Y)Y.hasOwnProperty(D)&&(u||(u={}),u[D]="")}else se!=="dangerouslySetInnerHTML"&&se!=="children"&&se!=="suppressContentEditableWarning"&&se!=="suppressHydrationWarning"&&se!=="autoFocus"&&(a.hasOwnProperty(se)?T||(T=[]):(T=T||[]).push(se,null));for(se in f){var V=f[se];if(Y=b!=null?b[se]:void 0,f.hasOwnProperty(se)&&V!==Y&&(V!=null||Y!=null))if(se==="style")if(Y){for(D in Y)!Y.hasOwnProperty(D)||V&&V.hasOwnProperty(D)||(u||(u={}),u[D]="");for(D in V)V.hasOwnProperty(D)&&Y[D]!==V[D]&&(u||(u={}),u[D]=V[D])}else u||(T||(T=[]),T.push(se,u)),u=V;else se==="dangerouslySetInnerHTML"?(V=V?V.__html:void 0,Y=Y?Y.__html:void 0,V!=null&&Y!==V&&(T=T||[]).push(se,V)):se==="children"?typeof V!="string"&&typeof V!="number"||(T=T||[]).push(se,""+V):se!=="suppressContentEditableWarning"&&se!=="suppressHydrationWarning"&&(a.hasOwnProperty(se)?(V!=null&&se==="onScroll"&&Ot("scroll",s),T||Y===V||(T=[])):(T=T||[]).push(se,V))}u&&(T=T||[]).push("style",u);var se=T;(i.updateQueue=se)&&(i.flags|=4)}},gg=function(s,i,u,f){u!==f&&(i.flags|=4)};function Vo(s,i){if(!Lt)switch(s.tailMode){case"hidden":i=s.tail;for(var u=null;i!==null;)i.alternate!==null&&(u=i),i=i.sibling;u===null?s.tail=null:u.sibling=null;break;case"collapsed":u=s.tail;for(var f=null;u!==null;)u.alternate!==null&&(f=u),u=u.sibling;f===null?i||s.tail===null?s.tail=null:s.tail.sibling=null:f.sibling=null}}function On(s){var i=s.alternate!==null&&s.alternate.child===s.child,u=0,f=0;if(i)for(var b=s.child;b!==null;)u|=b.lanes|b.childLanes,f|=b.subtreeFlags&14680064,f|=b.flags&14680064,b.return=s,b=b.sibling;else for(b=s.child;b!==null;)u|=b.lanes|b.childLanes,f|=b.subtreeFlags,f|=b.flags,b.return=s,b=b.sibling;return s.subtreeFlags|=f,s.childLanes=u,i}function pv(s,i,u){var f=i.pendingProps;switch(Yd(i),i.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return On(i),null;case 1:return Yn(i.type)&&Tl(),On(i),null;case 3:return f=i.stateNode,_i(),Dt(Wn),Dt(kn),rf(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(s===null||s.child===null)&&(Cl(i)?i.flags|=4:s===null||s.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Nr!==null&&(Lf(Nr),Nr=null))),wf(s,i),On(i),null;case 5:tf(i);var b=_a(zo.current);if(u=i.type,s!==null&&i.stateNode!=null)mg(s,i,u,f,b),s.ref!==i.ref&&(i.flags|=512,i.flags|=2097152);else{if(!f){if(i.stateNode===null)throw Error(n(166));return On(i),null}if(s=_a(Yr.current),Cl(i)){f=i.stateNode,u=i.type;var T=i.memoizedProps;switch(f[Wr]=i,f[Fo]=T,s=(i.mode&1)!==0,u){case"dialog":Ot("cancel",f),Ot("close",f);break;case"iframe":case"object":case"embed":Ot("load",f);break;case"video":case"audio":for(b=0;b<Lo.length;b++)Ot(Lo[b],f);break;case"source":Ot("error",f);break;case"img":case"image":case"link":Ot("error",f),Ot("load",f);break;case"details":Ot("toggle",f);break;case"input":tn(f,T),Ot("invalid",f);break;case"select":f._wrapperState={wasMultiple:!!T.multiple},Ot("invalid",f);break;case"textarea":on(f,T),Ot("invalid",f)}At(u,T),b=null;for(var D in T)if(T.hasOwnProperty(D)){var Y=T[D];D==="children"?typeof Y=="string"?f.textContent!==Y&&(T.suppressHydrationWarning!==!0&&bl(f.textContent,Y,s),b=["children",Y]):typeof Y=="number"&&f.textContent!==""+Y&&(T.suppressHydrationWarning!==!0&&bl(f.textContent,Y,s),b=["children",""+Y]):a.hasOwnProperty(D)&&Y!=null&&D==="onScroll"&&Ot("scroll",f)}switch(u){case"input":We(f),tr(f,T,!0);break;case"textarea":We(f),un(f);break;case"select":case"option":break;default:typeof T.onClick=="function"&&(f.onclick=El)}f=b,i.updateQueue=f,f!==null&&(i.flags|=4)}else{D=b.nodeType===9?b:b.ownerDocument,s==="http://www.w3.org/1999/xhtml"&&(s=oe(u)),s==="http://www.w3.org/1999/xhtml"?u==="script"?(s=D.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild)):typeof f.is=="string"?s=D.createElement(u,{is:f.is}):(s=D.createElement(u),u==="select"&&(D=s,f.multiple?D.multiple=!0:f.size&&(D.size=f.size))):s=D.createElementNS(s,u),s[Wr]=i,s[Fo]=f,pg(s,i,!1,!1),i.stateNode=s;e:{switch(D=yt(u,f),u){case"dialog":Ot("cancel",s),Ot("close",s),b=f;break;case"iframe":case"object":case"embed":Ot("load",s),b=f;break;case"video":case"audio":for(b=0;b<Lo.length;b++)Ot(Lo[b],s);b=f;break;case"source":Ot("error",s),b=f;break;case"img":case"image":case"link":Ot("error",s),Ot("load",s),b=f;break;case"details":Ot("toggle",s),b=f;break;case"input":tn(s,f),b=Hn(s,f),Ot("invalid",s);break;case"option":b=f;break;case"select":s._wrapperState={wasMultiple:!!f.multiple},b=R({},f,{value:void 0}),Ot("invalid",s);break;case"textarea":on(s,f),b=Nt(s,f),Ot("invalid",s);break;default:b=f}At(u,b),Y=b;for(T in Y)if(Y.hasOwnProperty(T)){var V=Y[T];T==="style"?_n(s,V):T==="dangerouslySetInnerHTML"?(V=V?V.__html:void 0,V!=null&&He(s,V)):T==="children"?typeof V=="string"?(u!=="textarea"||V!=="")&&Ve(s,V):typeof V=="number"&&Ve(s,""+V):T!=="suppressContentEditableWarning"&&T!=="suppressHydrationWarning"&&T!=="autoFocus"&&(a.hasOwnProperty(T)?V!=null&&T==="onScroll"&&Ot("scroll",s):V!=null&&O(s,T,V,D))}switch(u){case"input":We(s),tr(s,f,!1);break;case"textarea":We(s),un(s);break;case"option":f.value!=null&&s.setAttribute("value",""+$e(f.value));break;case"select":s.multiple=!!f.multiple,T=f.value,T!=null?Et(s,!!f.multiple,T,!1):f.defaultValue!=null&&Et(s,!!f.multiple,f.defaultValue,!0);break;default:typeof b.onClick=="function"&&(s.onclick=El)}switch(u){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}}f&&(i.flags|=4)}i.ref!==null&&(i.flags|=512,i.flags|=2097152)}return On(i),null;case 6:if(s&&i.stateNode!=null)gg(s,i,s.memoizedProps,f);else{if(typeof f!="string"&&i.stateNode===null)throw Error(n(166));if(u=_a(zo.current),_a(Yr.current),Cl(i)){if(f=i.stateNode,u=i.memoizedProps,f[Wr]=i,(T=f.nodeValue!==u)&&(s=sr,s!==null))switch(s.tag){case 3:bl(f.nodeValue,u,(s.mode&1)!==0);break;case 5:s.memoizedProps.suppressHydrationWarning!==!0&&bl(f.nodeValue,u,(s.mode&1)!==0)}T&&(i.flags|=4)}else f=(u.nodeType===9?u:u.ownerDocument).createTextNode(f),f[Wr]=i,i.stateNode=f}return On(i),null;case 13:if(Dt(Ft),f=i.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(Lt&&ar!==null&&(i.mode&1)!==0&&(i.flags&128)===0)Em(),Ti(),i.flags|=98560,T=!1;else if(T=Cl(i),f!==null&&f.dehydrated!==null){if(s===null){if(!T)throw Error(n(318));if(T=i.memoizedState,T=T!==null?T.dehydrated:null,!T)throw Error(n(317));T[Wr]=i}else Ti(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;On(i),T=!1}else Nr!==null&&(Lf(Nr),Nr=null),T=!0;if(!T)return i.flags&65536?i:null}return(i.flags&128)!==0?(i.lanes=u,i):(f=f!==null,f!==(s!==null&&s.memoizedState!==null)&&f&&(i.child.flags|=8192,(i.mode&1)!==0&&(s===null||(Ft.current&1)!==0?fn===0&&(fn=3):Ff())),i.updateQueue!==null&&(i.flags|=4),On(i),null);case 4:return _i(),wf(s,i),s===null&&Mo(i.stateNode.containerInfo),On(i),null;case 10:return Xd(i.type._context),On(i),null;case 17:return Yn(i.type)&&Tl(),On(i),null;case 19:if(Dt(Ft),T=i.memoizedState,T===null)return On(i),null;if(f=(i.flags&128)!==0,D=T.rendering,D===null)if(f)Vo(T,!1);else{if(fn!==0||s!==null&&(s.flags&128)!==0)for(s=i.child;s!==null;){if(D=Il(s),D!==null){for(i.flags|=128,Vo(T,!1),f=D.updateQueue,f!==null&&(i.updateQueue=f,i.flags|=4),i.subtreeFlags=0,f=u,u=i.child;u!==null;)T=u,s=f,T.flags&=14680066,D=T.alternate,D===null?(T.childLanes=0,T.lanes=s,T.child=null,T.subtreeFlags=0,T.memoizedProps=null,T.memoizedState=null,T.updateQueue=null,T.dependencies=null,T.stateNode=null):(T.childLanes=D.childLanes,T.lanes=D.lanes,T.child=D.child,T.subtreeFlags=0,T.deletions=null,T.memoizedProps=D.memoizedProps,T.memoizedState=D.memoizedState,T.updateQueue=D.updateQueue,T.type=D.type,s=D.dependencies,T.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),u=u.sibling;return St(Ft,Ft.current&1|2),i.child}s=s.sibling}T.tail!==null&&wt()>Oi&&(i.flags|=128,f=!0,Vo(T,!1),i.lanes=4194304)}else{if(!f)if(s=Il(D),s!==null){if(i.flags|=128,f=!0,u=s.updateQueue,u!==null&&(i.updateQueue=u,i.flags|=4),Vo(T,!0),T.tail===null&&T.tailMode==="hidden"&&!D.alternate&&!Lt)return On(i),null}else 2*wt()-T.renderingStartTime>Oi&&u!==1073741824&&(i.flags|=128,f=!0,Vo(T,!1),i.lanes=4194304);T.isBackwards?(D.sibling=i.child,i.child=D):(u=T.last,u!==null?u.sibling=D:i.child=D,T.last=D)}return T.tail!==null?(i=T.tail,T.rendering=i,T.tail=i.sibling,T.renderingStartTime=wt(),i.sibling=null,u=Ft.current,St(Ft,f?u&1|2:u&1),i):(On(i),null);case 22:case 23:return Pf(),f=i.memoizedState!==null,s!==null&&s.memoizedState!==null!==f&&(i.flags|=8192),f&&(i.mode&1)!==0?(ir&1073741824)!==0&&(On(i),i.subtreeFlags&6&&(i.flags|=8192)):On(i),null;case 24:return null;case 25:return null}throw Error(n(156,i.tag))}function mv(s,i){switch(Yd(i),i.tag){case 1:return Yn(i.type)&&Tl(),s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 3:return _i(),Dt(Wn),Dt(kn),rf(),s=i.flags,(s&65536)!==0&&(s&128)===0?(i.flags=s&-65537|128,i):null;case 5:return tf(i),null;case 13:if(Dt(Ft),s=i.memoizedState,s!==null&&s.dehydrated!==null){if(i.alternate===null)throw Error(n(340));Ti()}return s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 19:return Dt(Ft),null;case 4:return _i(),null;case 10:return Xd(i.type._context),null;case 22:case 23:return Pf(),null;case 24:return null;default:return null}}var Ul=!1,Dn=!1,gv=typeof WeakSet=="function"?WeakSet:Set,Se=null;function ki(s,i){var u=s.ref;if(u!==null)if(typeof u=="function")try{u(null)}catch(f){$t(s,i,f)}else u.current=null}function Sf(s,i,u){try{u()}catch(f){$t(s,i,f)}}var yg=!1;function yv(s,i){if(Md=ol,s=Gp(),kd(s)){if("selectionStart"in s)var u={start:s.selectionStart,end:s.selectionEnd};else e:{u=(u=s.ownerDocument)&&u.defaultView||window;var f=u.getSelection&&u.getSelection();if(f&&f.rangeCount!==0){u=f.anchorNode;var b=f.anchorOffset,T=f.focusNode;f=f.focusOffset;try{u.nodeType,T.nodeType}catch{u=null;break e}var D=0,Y=-1,V=-1,se=0,de=0,fe=s,le=null;t:for(;;){for(var xe;fe!==u||b!==0&&fe.nodeType!==3||(Y=D+b),fe!==T||f!==0&&fe.nodeType!==3||(V=D+f),fe.nodeType===3&&(D+=fe.nodeValue.length),(xe=fe.firstChild)!==null;)le=fe,fe=xe;for(;;){if(fe===s)break t;if(le===u&&++se===b&&(Y=D),le===T&&++de===f&&(V=D),(xe=fe.nextSibling)!==null)break;fe=le,le=fe.parentNode}fe=xe}u=Y===-1||V===-1?null:{start:Y,end:V}}else u=null}u=u||{start:0,end:0}}else u=null;for(Pd={focusedElem:s,selectionRange:u},ol=!1,Se=i;Se!==null;)if(i=Se,s=i.child,(i.subtreeFlags&1028)!==0&&s!==null)s.return=i,Se=s;else for(;Se!==null;){i=Se;try{var Ne=i.alternate;if((i.flags&1024)!==0)switch(i.tag){case 0:case 11:case 15:break;case 1:if(Ne!==null){var Ae=Ne.memoizedProps,Xt=Ne.memoizedState,ee=i.stateNode,X=ee.getSnapshotBeforeUpdate(i.elementType===i.type?Ae:Or(i.type,Ae),Xt);ee.__reactInternalSnapshotBeforeUpdate=X}break;case 3:var ne=i.stateNode.containerInfo;ne.nodeType===1?ne.textContent="":ne.nodeType===9&&ne.documentElement&&ne.removeChild(ne.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ge){$t(i,i.return,ge)}if(s=i.sibling,s!==null){s.return=i.return,Se=s;break}Se=i.return}return Ne=yg,yg=!1,Ne}function Qo(s,i,u){var f=i.updateQueue;if(f=f!==null?f.lastEffect:null,f!==null){var b=f=f.next;do{if((b.tag&s)===s){var T=b.destroy;b.destroy=void 0,T!==void 0&&Sf(i,u,T)}b=b.next}while(b!==f)}}function zl(s,i){if(i=i.updateQueue,i=i!==null?i.lastEffect:null,i!==null){var u=i=i.next;do{if((u.tag&s)===s){var f=u.create;u.destroy=f()}u=u.next}while(u!==i)}}function _f(s){var i=s.ref;if(i!==null){var u=s.stateNode;switch(s.tag){case 5:s=u;break;default:s=u}typeof i=="function"?i(s):i.current=s}}function bg(s){var i=s.alternate;i!==null&&(s.alternate=null,bg(i)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(i=s.stateNode,i!==null&&(delete i[Wr],delete i[Fo],delete i[Hd],delete i[ZT],delete i[ev])),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function Eg(s){return s.tag===5||s.tag===3||s.tag===4}function xg(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||Eg(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Cf(s,i,u){var f=s.tag;if(f===5||f===6)s=s.stateNode,i?u.nodeType===8?u.parentNode.insertBefore(s,i):u.insertBefore(s,i):(u.nodeType===8?(i=u.parentNode,i.insertBefore(s,u)):(i=u,i.appendChild(s)),u=u._reactRootContainer,u!=null||i.onclick!==null||(i.onclick=El));else if(f!==4&&(s=s.child,s!==null))for(Cf(s,i,u),s=s.sibling;s!==null;)Cf(s,i,u),s=s.sibling}function kf(s,i,u){var f=s.tag;if(f===5||f===6)s=s.stateNode,i?u.insertBefore(s,i):u.appendChild(s);else if(f!==4&&(s=s.child,s!==null))for(kf(s,i,u),s=s.sibling;s!==null;)kf(s,i,u),s=s.sibling}var vn=null,Dr=!1;function zs(s,i,u){for(u=u.child;u!==null;)Tg(s,i,u),u=u.sibling}function Tg(s,i,u){if(zr&&typeof zr.onCommitFiberUnmount=="function")try{zr.onCommitFiberUnmount(tl,u)}catch{}switch(u.tag){case 5:Dn||ki(u,i);case 6:var f=vn,b=Dr;vn=null,zs(s,i,u),vn=f,Dr=b,vn!==null&&(Dr?(s=vn,u=u.stateNode,s.nodeType===8?s.parentNode.removeChild(u):s.removeChild(u)):vn.removeChild(u.stateNode));break;case 18:vn!==null&&(Dr?(s=vn,u=u.stateNode,s.nodeType===8?Bd(s.parentNode,u):s.nodeType===1&&Bd(s,u),Co(s)):Bd(vn,u.stateNode));break;case 4:f=vn,b=Dr,vn=u.stateNode.containerInfo,Dr=!0,zs(s,i,u),vn=f,Dr=b;break;case 0:case 11:case 14:case 15:if(!Dn&&(f=u.updateQueue,f!==null&&(f=f.lastEffect,f!==null))){b=f=f.next;do{var T=b,D=T.destroy;T=T.tag,D!==void 0&&((T&2)!==0||(T&4)!==0)&&Sf(u,i,D),b=b.next}while(b!==f)}zs(s,i,u);break;case 1:if(!Dn&&(ki(u,i),f=u.stateNode,typeof f.componentWillUnmount=="function"))try{f.props=u.memoizedProps,f.state=u.memoizedState,f.componentWillUnmount()}catch(Y){$t(u,i,Y)}zs(s,i,u);break;case 21:zs(s,i,u);break;case 22:u.mode&1?(Dn=(f=Dn)||u.memoizedState!==null,zs(s,i,u),Dn=f):zs(s,i,u);break;default:zs(s,i,u)}}function vg(s){var i=s.updateQueue;if(i!==null){s.updateQueue=null;var u=s.stateNode;u===null&&(u=s.stateNode=new gv),i.forEach(function(f){var b=Cv.bind(null,s,f);u.has(f)||(u.add(f),f.then(b,b))})}}function Ar(s,i){var u=i.deletions;if(u!==null)for(var f=0;f<u.length;f++){var b=u[f];try{var T=s,D=i,Y=D;e:for(;Y!==null;){switch(Y.tag){case 5:vn=Y.stateNode,Dr=!1;break e;case 3:vn=Y.stateNode.containerInfo,Dr=!0;break e;case 4:vn=Y.stateNode.containerInfo,Dr=!0;break e}Y=Y.return}if(vn===null)throw Error(n(160));Tg(T,D,b),vn=null,Dr=!1;var V=b.alternate;V!==null&&(V.return=null),b.return=null}catch(se){$t(b,i,se)}}if(i.subtreeFlags&12854)for(i=i.child;i!==null;)wg(i,s),i=i.sibling}function wg(s,i){var u=s.alternate,f=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(Ar(i,s),$r(s),f&4){try{Qo(3,s,s.return),zl(3,s)}catch(Ae){$t(s,s.return,Ae)}try{Qo(5,s,s.return)}catch(Ae){$t(s,s.return,Ae)}}break;case 1:Ar(i,s),$r(s),f&512&&u!==null&&ki(u,u.return);break;case 5:if(Ar(i,s),$r(s),f&512&&u!==null&&ki(u,u.return),s.flags&32){var b=s.stateNode;try{Ve(b,"")}catch(Ae){$t(s,s.return,Ae)}}if(f&4&&(b=s.stateNode,b!=null)){var T=s.memoizedProps,D=u!==null?u.memoizedProps:T,Y=s.type,V=s.updateQueue;if(s.updateQueue=null,V!==null)try{Y==="input"&&T.type==="radio"&&T.name!=null&&nn(b,T),yt(Y,D);var se=yt(Y,T);for(D=0;D<V.length;D+=2){var de=V[D],fe=V[D+1];de==="style"?_n(b,fe):de==="dangerouslySetInnerHTML"?He(b,fe):de==="children"?Ve(b,fe):O(b,de,fe,se)}switch(Y){case"input":mn(b,T);break;case"textarea":nr(b,T);break;case"select":var le=b._wrapperState.wasMultiple;b._wrapperState.wasMultiple=!!T.multiple;var xe=T.value;xe!=null?Et(b,!!T.multiple,xe,!1):le!==!!T.multiple&&(T.defaultValue!=null?Et(b,!!T.multiple,T.defaultValue,!0):Et(b,!!T.multiple,T.multiple?[]:"",!1))}b[Fo]=T}catch(Ae){$t(s,s.return,Ae)}}break;case 6:if(Ar(i,s),$r(s),f&4){if(s.stateNode===null)throw Error(n(162));b=s.stateNode,T=s.memoizedProps;try{b.nodeValue=T}catch(Ae){$t(s,s.return,Ae)}}break;case 3:if(Ar(i,s),$r(s),f&4&&u!==null&&u.memoizedState.isDehydrated)try{Co(i.containerInfo)}catch(Ae){$t(s,s.return,Ae)}break;case 4:Ar(i,s),$r(s);break;case 13:Ar(i,s),$r(s),b=s.child,b.flags&8192&&(T=b.memoizedState!==null,b.stateNode.isHidden=T,!T||b.alternate!==null&&b.alternate.memoizedState!==null||(Df=wt())),f&4&&vg(s);break;case 22:if(de=u!==null&&u.memoizedState!==null,s.mode&1?(Dn=(se=Dn)||de,Ar(i,s),Dn=se):Ar(i,s),$r(s),f&8192){if(se=s.memoizedState!==null,(s.stateNode.isHidden=se)&&!de&&(s.mode&1)!==0)for(Se=s,de=s.child;de!==null;){for(fe=Se=de;Se!==null;){switch(le=Se,xe=le.child,le.tag){case 0:case 11:case 14:case 15:Qo(4,le,le.return);break;case 1:ki(le,le.return);var Ne=le.stateNode;if(typeof Ne.componentWillUnmount=="function"){f=le,u=le.return;try{i=f,Ne.props=i.memoizedProps,Ne.state=i.memoizedState,Ne.componentWillUnmount()}catch(Ae){$t(f,u,Ae)}}break;case 5:ki(le,le.return);break;case 22:if(le.memoizedState!==null){Cg(fe);continue}}xe!==null?(xe.return=le,Se=xe):Cg(fe)}de=de.sibling}e:for(de=null,fe=s;;){if(fe.tag===5){if(de===null){de=fe;try{b=fe.stateNode,se?(T=b.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none"):(Y=fe.stateNode,V=fe.memoizedProps.style,D=V!=null&&V.hasOwnProperty("display")?V.display:null,Y.style.display=rn("display",D))}catch(Ae){$t(s,s.return,Ae)}}}else if(fe.tag===6){if(de===null)try{fe.stateNode.nodeValue=se?"":fe.memoizedProps}catch(Ae){$t(s,s.return,Ae)}}else if((fe.tag!==22&&fe.tag!==23||fe.memoizedState===null||fe===s)&&fe.child!==null){fe.child.return=fe,fe=fe.child;continue}if(fe===s)break e;for(;fe.sibling===null;){if(fe.return===null||fe.return===s)break e;de===fe&&(de=null),fe=fe.return}de===fe&&(de=null),fe.sibling.return=fe.return,fe=fe.sibling}}break;case 19:Ar(i,s),$r(s),f&4&&vg(s);break;case 21:break;default:Ar(i,s),$r(s)}}function $r(s){var i=s.flags;if(i&2){try{e:{for(var u=s.return;u!==null;){if(Eg(u)){var f=u;break e}u=u.return}throw Error(n(160))}switch(f.tag){case 5:var b=f.stateNode;f.flags&32&&(Ve(b,""),f.flags&=-33);var T=xg(s);kf(s,T,b);break;case 3:case 4:var D=f.stateNode.containerInfo,Y=xg(s);Cf(s,Y,D);break;default:throw Error(n(161))}}catch(V){$t(s,s.return,V)}s.flags&=-3}i&4096&&(s.flags&=-4097)}function bv(s,i,u){Se=s,Sg(s)}function Sg(s,i,u){for(var f=(s.mode&1)!==0;Se!==null;){var b=Se,T=b.child;if(b.tag===22&&f){var D=b.memoizedState!==null||Ul;if(!D){var Y=b.alternate,V=Y!==null&&Y.memoizedState!==null||Dn;Y=Ul;var se=Dn;if(Ul=D,(Dn=V)&&!se)for(Se=b;Se!==null;)D=Se,V=D.child,D.tag===22&&D.memoizedState!==null?kg(b):V!==null?(V.return=D,Se=V):kg(b);for(;T!==null;)Se=T,Sg(T),T=T.sibling;Se=b,Ul=Y,Dn=se}_g(s)}else(b.subtreeFlags&8772)!==0&&T!==null?(T.return=b,Se=T):_g(s)}}function _g(s){for(;Se!==null;){var i=Se;if((i.flags&8772)!==0){var u=i.alternate;try{if((i.flags&8772)!==0)switch(i.tag){case 0:case 11:case 15:Dn||zl(5,i);break;case 1:var f=i.stateNode;if(i.flags&4&&!Dn)if(u===null)f.componentDidMount();else{var b=i.elementType===i.type?u.memoizedProps:Or(i.type,u.memoizedProps);f.componentDidUpdate(b,u.memoizedState,f.__reactInternalSnapshotBeforeUpdate)}var T=i.updateQueue;T!==null&&Cm(i,T,f);break;case 3:var D=i.updateQueue;if(D!==null){if(u=null,i.child!==null)switch(i.child.tag){case 5:u=i.child.stateNode;break;case 1:u=i.child.stateNode}Cm(i,D,u)}break;case 5:var Y=i.stateNode;if(u===null&&i.flags&4){u=Y;var V=i.memoizedProps;switch(i.type){case"button":case"input":case"select":case"textarea":V.autoFocus&&u.focus();break;case"img":V.src&&(u.src=V.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(i.memoizedState===null){var se=i.alternate;if(se!==null){var de=se.memoizedState;if(de!==null){var fe=de.dehydrated;fe!==null&&Co(fe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Dn||i.flags&512&&_f(i)}catch(le){$t(i,i.return,le)}}if(i===s){Se=null;break}if(u=i.sibling,u!==null){u.return=i.return,Se=u;break}Se=i.return}}function Cg(s){for(;Se!==null;){var i=Se;if(i===s){Se=null;break}var u=i.sibling;if(u!==null){u.return=i.return,Se=u;break}Se=i.return}}function kg(s){for(;Se!==null;){var i=Se;try{switch(i.tag){case 0:case 11:case 15:var u=i.return;try{zl(4,i)}catch(V){$t(i,u,V)}break;case 1:var f=i.stateNode;if(typeof f.componentDidMount=="function"){var b=i.return;try{f.componentDidMount()}catch(V){$t(i,b,V)}}var T=i.return;try{_f(i)}catch(V){$t(i,T,V)}break;case 5:var D=i.return;try{_f(i)}catch(V){$t(i,D,V)}}}catch(V){$t(i,i.return,V)}if(i===s){Se=null;break}var Y=i.sibling;if(Y!==null){Y.return=i.return,Se=Y;break}Se=i.return}}var Ev=Math.ceil,Wl=A.ReactCurrentDispatcher,Nf=A.ReactCurrentOwner,yr=A.ReactCurrentBatchConfig,at=0,yn=null,sn=null,wn=0,ir=0,Ni=Fs(0),fn=0,Go=null,ka=0,Yl=0,Of=0,Xo=null,$n=null,Df=0,Oi=1/0,gs=null,ql=!1,Af=null,Ws=null,$l=!1,Ys=null,Vl=0,Ko=0,If=null,Ql=-1,Gl=0;function Fn(){return(at&6)!==0?wt():Ql!==-1?Ql:Ql=wt()}function qs(s){return(s.mode&1)===0?1:(at&2)!==0&&wn!==0?wn&-wn:nv.transition!==null?(Gl===0&&(Gl=xp()),Gl):(s=pt,s!==0||(s=window.event,s=s===void 0?16:Op(s.type)),s)}function Ir(s,i,u,f){if(50<Ko)throw Ko=0,If=null,Error(n(185));To(s,u,f),((at&2)===0||s!==yn)&&(s===yn&&((at&2)===0&&(Yl|=u),fn===4&&$s(s,wn)),Vn(s,f),u===1&&at===0&&(i.mode&1)===0&&(Oi=wt()+500,wl&&Bs()))}function Vn(s,i){var u=s.callbackNode;nT(s,i);var f=sl(s,s===yn?wn:0);if(f===0)u!==null&&vt(u),s.callbackNode=null,s.callbackPriority=0;else if(i=f&-f,s.callbackPriority!==i){if(u!=null&&vt(u),i===1)s.tag===0?tv(Og.bind(null,s)):pm(Og.bind(null,s)),KT(function(){(at&6)===0&&Bs()}),u=null;else{switch(Tp(f)){case 1:u=Ea;break;case 4:u=bp;break;case 16:u=el;break;case 536870912:u=Ep;break;default:u=el}u=Fg(u,Ng.bind(null,s))}s.callbackPriority=i,s.callbackNode=u}}function Ng(s,i){if(Ql=-1,Gl=0,(at&6)!==0)throw Error(n(327));var u=s.callbackNode;if(Di()&&s.callbackNode!==u)return null;var f=sl(s,s===yn?wn:0);if(f===0)return null;if((f&30)!==0||(f&s.expiredLanes)!==0||i)i=Xl(s,f);else{i=f;var b=at;at|=2;var T=Ag();(yn!==s||wn!==i)&&(gs=null,Oi=wt()+500,Oa(s,i));do try{vv();break}catch(Y){Dg(s,Y)}while(!0);Gd(),Wl.current=T,at=b,sn!==null?i=0:(yn=null,wn=0,i=fn)}if(i!==0){if(i===2&&(b=dd(s),b!==0&&(f=b,i=Rf(s,b))),i===1)throw u=Go,Oa(s,0),$s(s,f),Vn(s,wt()),u;if(i===6)$s(s,f);else{if(b=s.current.alternate,(f&30)===0&&!xv(b)&&(i=Xl(s,f),i===2&&(T=dd(s),T!==0&&(f=T,i=Rf(s,T))),i===1))throw u=Go,Oa(s,0),$s(s,f),Vn(s,wt()),u;switch(s.finishedWork=b,s.finishedLanes=f,i){case 0:case 1:throw Error(n(345));case 2:Da(s,$n,gs);break;case 3:if($s(s,f),(f&130023424)===f&&(i=Df+500-wt(),10<i)){if(sl(s,0)!==0)break;if(b=s.suspendedLanes,(b&f)!==f){Fn(),s.pingedLanes|=s.suspendedLanes&b;break}s.timeoutHandle=jd(Da.bind(null,s,$n,gs),i);break}Da(s,$n,gs);break;case 4:if($s(s,f),(f&4194240)===f)break;for(i=s.eventTimes,b=-1;0<f;){var D=31-Cr(f);T=1<<D,D=i[D],D>b&&(b=D),f&=~T}if(f=b,f=wt()-f,f=(120>f?120:480>f?480:1080>f?1080:1920>f?1920:3e3>f?3e3:4320>f?4320:1960*Ev(f/1960))-f,10<f){s.timeoutHandle=jd(Da.bind(null,s,$n,gs),f);break}Da(s,$n,gs);break;case 5:Da(s,$n,gs);break;default:throw Error(n(329))}}}return Vn(s,wt()),s.callbackNode===u?Ng.bind(null,s):null}function Rf(s,i){var u=Xo;return s.current.memoizedState.isDehydrated&&(Oa(s,i).flags|=256),s=Xl(s,i),s!==2&&(i=$n,$n=u,i!==null&&Lf(i)),s}function Lf(s){$n===null?$n=s:$n.push.apply($n,s)}function xv(s){for(var i=s;;){if(i.flags&16384){var u=i.updateQueue;if(u!==null&&(u=u.stores,u!==null))for(var f=0;f<u.length;f++){var b=u[f],T=b.getSnapshot;b=b.value;try{if(!kr(T(),b))return!1}catch{return!1}}}if(u=i.child,i.subtreeFlags&16384&&u!==null)u.return=i,i=u;else{if(i===s)break;for(;i.sibling===null;){if(i.return===null||i.return===s)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function $s(s,i){for(i&=~Of,i&=~Yl,s.suspendedLanes|=i,s.pingedLanes&=~i,s=s.expirationTimes;0<i;){var u=31-Cr(i),f=1<<u;s[u]=-1,i&=~f}}function Og(s){if((at&6)!==0)throw Error(n(327));Di();var i=sl(s,0);if((i&1)===0)return Vn(s,wt()),null;var u=Xl(s,i);if(s.tag!==0&&u===2){var f=dd(s);f!==0&&(i=f,u=Rf(s,f))}if(u===1)throw u=Go,Oa(s,0),$s(s,i),Vn(s,wt()),u;if(u===6)throw Error(n(345));return s.finishedWork=s.current.alternate,s.finishedLanes=i,Da(s,$n,gs),Vn(s,wt()),null}function Mf(s,i){var u=at;at|=1;try{return s(i)}finally{at=u,at===0&&(Oi=wt()+500,wl&&Bs())}}function Na(s){Ys!==null&&Ys.tag===0&&(at&6)===0&&Di();var i=at;at|=1;var u=yr.transition,f=pt;try{if(yr.transition=null,pt=1,s)return s()}finally{pt=f,yr.transition=u,at=i,(at&6)===0&&Bs()}}function Pf(){ir=Ni.current,Dt(Ni)}function Oa(s,i){s.finishedWork=null,s.finishedLanes=0;var u=s.timeoutHandle;if(u!==-1&&(s.timeoutHandle=-1,XT(u)),sn!==null)for(u=sn.return;u!==null;){var f=u;switch(Yd(f),f.tag){case 1:f=f.type.childContextTypes,f!=null&&Tl();break;case 3:_i(),Dt(Wn),Dt(kn),rf();break;case 5:tf(f);break;case 4:_i();break;case 13:Dt(Ft);break;case 19:Dt(Ft);break;case 10:Xd(f.type._context);break;case 22:case 23:Pf()}u=u.return}if(yn=s,sn=s=Vs(s.current,null),wn=ir=i,fn=0,Go=null,Of=Yl=ka=0,$n=Xo=null,Sa!==null){for(i=0;i<Sa.length;i++)if(u=Sa[i],f=u.interleaved,f!==null){u.interleaved=null;var b=f.next,T=u.pending;if(T!==null){var D=T.next;T.next=b,f.next=D}u.pending=f}Sa=null}return s}function Dg(s,i){do{var u=sn;try{if(Gd(),Rl.current=Fl,Ll){for(var f=jt.memoizedState;f!==null;){var b=f.queue;b!==null&&(b.pending=null),f=f.next}Ll=!1}if(Ca=0,gn=dn=jt=null,Wo=!1,Yo=0,Nf.current=null,u===null||u.return===null){fn=1,Go=i,sn=null;break}e:{var T=s,D=u.return,Y=u,V=i;if(i=wn,Y.flags|=32768,V!==null&&typeof V=="object"&&typeof V.then=="function"){var se=V,de=Y,fe=de.tag;if((de.mode&1)===0&&(fe===0||fe===11||fe===15)){var le=de.alternate;le?(de.updateQueue=le.updateQueue,de.memoizedState=le.memoizedState,de.lanes=le.lanes):(de.updateQueue=null,de.memoizedState=null)}var xe=tg(D);if(xe!==null){xe.flags&=-257,ng(xe,D,Y,T,i),xe.mode&1&&eg(T,se,i),i=xe,V=se;var Ne=i.updateQueue;if(Ne===null){var Ae=new Set;Ae.add(V),i.updateQueue=Ae}else Ne.add(V);break e}else{if((i&1)===0){eg(T,se,i),Ff();break e}V=Error(n(426))}}else if(Lt&&Y.mode&1){var Xt=tg(D);if(Xt!==null){(Xt.flags&65536)===0&&(Xt.flags|=256),ng(Xt,D,Y,T,i),Vd(Ci(V,Y));break e}}T=V=Ci(V,Y),fn!==4&&(fn=2),Xo===null?Xo=[T]:Xo.push(T),T=D;do{switch(T.tag){case 3:T.flags|=65536,i&=-i,T.lanes|=i;var ee=Jm(T,V,i);_m(T,ee);break e;case 1:Y=V;var X=T.type,ne=T.stateNode;if((T.flags&128)===0&&(typeof X.getDerivedStateFromError=="function"||ne!==null&&typeof ne.componentDidCatch=="function"&&(Ws===null||!Ws.has(ne)))){T.flags|=65536,i&=-i,T.lanes|=i;var ge=Zm(T,Y,i);_m(T,ge);break e}}T=T.return}while(T!==null)}Rg(u)}catch(Ie){i=Ie,sn===u&&u!==null&&(sn=u=u.return);continue}break}while(!0)}function Ag(){var s=Wl.current;return Wl.current=Fl,s===null?Fl:s}function Ff(){(fn===0||fn===3||fn===2)&&(fn=4),yn===null||(ka&268435455)===0&&(Yl&268435455)===0||$s(yn,wn)}function Xl(s,i){var u=at;at|=2;var f=Ag();(yn!==s||wn!==i)&&(gs=null,Oa(s,i));do try{Tv();break}catch(b){Dg(s,b)}while(!0);if(Gd(),at=u,Wl.current=f,sn!==null)throw Error(n(261));return yn=null,wn=0,fn}function Tv(){for(;sn!==null;)Ig(sn)}function vv(){for(;sn!==null&&!Eo();)Ig(sn)}function Ig(s){var i=Pg(s.alternate,s,ir);s.memoizedProps=s.pendingProps,i===null?Rg(s):sn=i,Nf.current=null}function Rg(s){var i=s;do{var u=i.alternate;if(s=i.return,(i.flags&32768)===0){if(u=pv(u,i,ir),u!==null){sn=u;return}}else{if(u=mv(u,i),u!==null){u.flags&=32767,sn=u;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{fn=6,sn=null;return}}if(i=i.sibling,i!==null){sn=i;return}sn=i=s}while(i!==null);fn===0&&(fn=5)}function Da(s,i,u){var f=pt,b=yr.transition;try{yr.transition=null,pt=1,wv(s,i,u,f)}finally{yr.transition=b,pt=f}return null}function wv(s,i,u,f){do Di();while(Ys!==null);if((at&6)!==0)throw Error(n(327));u=s.finishedWork;var b=s.finishedLanes;if(u===null)return null;if(s.finishedWork=null,s.finishedLanes=0,u===s.current)throw Error(n(177));s.callbackNode=null,s.callbackPriority=0;var T=u.lanes|u.childLanes;if(rT(s,T),s===yn&&(sn=yn=null,wn=0),(u.subtreeFlags&2064)===0&&(u.flags&2064)===0||$l||($l=!0,Fg(el,function(){return Di(),null})),T=(u.flags&15990)!==0,(u.subtreeFlags&15990)!==0||T){T=yr.transition,yr.transition=null;var D=pt;pt=1;var Y=at;at|=4,Nf.current=null,yv(s,u),wg(u,s),WT(Pd),ol=!!Md,Pd=Md=null,s.current=u,bv(u),ui(),at=Y,pt=D,yr.transition=T}else s.current=u;if($l&&($l=!1,Ys=s,Vl=b),T=s.pendingLanes,T===0&&(Ws=null),K2(u.stateNode),Vn(s,wt()),i!==null)for(f=s.onRecoverableError,u=0;u<i.length;u++)b=i[u],f(b.value,{componentStack:b.stack,digest:b.digest});if(ql)throw ql=!1,s=Af,Af=null,s;return(Vl&1)!==0&&s.tag!==0&&Di(),T=s.pendingLanes,(T&1)!==0?s===If?Ko++:(Ko=0,If=s):Ko=0,Bs(),null}function Di(){if(Ys!==null){var s=Tp(Vl),i=yr.transition,u=pt;try{if(yr.transition=null,pt=16>s?16:s,Ys===null)var f=!1;else{if(s=Ys,Ys=null,Vl=0,(at&6)!==0)throw Error(n(331));var b=at;for(at|=4,Se=s.current;Se!==null;){var T=Se,D=T.child;if((Se.flags&16)!==0){var Y=T.deletions;if(Y!==null){for(var V=0;V<Y.length;V++){var se=Y[V];for(Se=se;Se!==null;){var de=Se;switch(de.tag){case 0:case 11:case 15:Qo(8,de,T)}var fe=de.child;if(fe!==null)fe.return=de,Se=fe;else for(;Se!==null;){de=Se;var le=de.sibling,xe=de.return;if(bg(de),de===se){Se=null;break}if(le!==null){le.return=xe,Se=le;break}Se=xe}}}var Ne=T.alternate;if(Ne!==null){var Ae=Ne.child;if(Ae!==null){Ne.child=null;do{var Xt=Ae.sibling;Ae.sibling=null,Ae=Xt}while(Ae!==null)}}Se=T}}if((T.subtreeFlags&2064)!==0&&D!==null)D.return=T,Se=D;else e:for(;Se!==null;){if(T=Se,(T.flags&2048)!==0)switch(T.tag){case 0:case 11:case 15:Qo(9,T,T.return)}var ee=T.sibling;if(ee!==null){ee.return=T.return,Se=ee;break e}Se=T.return}}var X=s.current;for(Se=X;Se!==null;){D=Se;var ne=D.child;if((D.subtreeFlags&2064)!==0&&ne!==null)ne.return=D,Se=ne;else e:for(D=X;Se!==null;){if(Y=Se,(Y.flags&2048)!==0)try{switch(Y.tag){case 0:case 11:case 15:zl(9,Y)}}catch(Ie){$t(Y,Y.return,Ie)}if(Y===D){Se=null;break e}var ge=Y.sibling;if(ge!==null){ge.return=Y.return,Se=ge;break e}Se=Y.return}}if(at=b,Bs(),zr&&typeof zr.onPostCommitFiberRoot=="function")try{zr.onPostCommitFiberRoot(tl,s)}catch{}f=!0}return f}finally{pt=u,yr.transition=i}}return!1}function Lg(s,i,u){i=Ci(u,i),i=Jm(s,i,1),s=Us(s,i,1),i=Fn(),s!==null&&(To(s,1,i),Vn(s,i))}function $t(s,i,u){if(s.tag===3)Lg(s,s,u);else for(;i!==null;){if(i.tag===3){Lg(i,s,u);break}else if(i.tag===1){var f=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(Ws===null||!Ws.has(f))){s=Ci(u,s),s=Zm(i,s,1),i=Us(i,s,1),s=Fn(),i!==null&&(To(i,1,s),Vn(i,s));break}}i=i.return}}function Sv(s,i,u){var f=s.pingCache;f!==null&&f.delete(i),i=Fn(),s.pingedLanes|=s.suspendedLanes&u,yn===s&&(wn&u)===u&&(fn===4||fn===3&&(wn&130023424)===wn&&500>wt()-Df?Oa(s,0):Of|=u),Vn(s,i)}function Mg(s,i){i===0&&((s.mode&1)===0?i=1:(i=rl,rl<<=1,(rl&130023424)===0&&(rl=4194304)));var u=Fn();s=hs(s,i),s!==null&&(To(s,i,u),Vn(s,u))}function _v(s){var i=s.memoizedState,u=0;i!==null&&(u=i.retryLane),Mg(s,u)}function Cv(s,i){var u=0;switch(s.tag){case 13:var f=s.stateNode,b=s.memoizedState;b!==null&&(u=b.retryLane);break;case 19:f=s.stateNode;break;default:throw Error(n(314))}f!==null&&f.delete(i),Mg(s,u)}var Pg;Pg=function(s,i,u){if(s!==null)if(s.memoizedProps!==i.pendingProps||Wn.current)qn=!0;else{if((s.lanes&u)===0&&(i.flags&128)===0)return qn=!1,hv(s,i,u);qn=(s.flags&131072)!==0}else qn=!1,Lt&&(i.flags&1048576)!==0&&mm(i,_l,i.index);switch(i.lanes=0,i.tag){case 2:var f=i.type;Hl(s,i),s=i.pendingProps;var b=bi(i,kn.current);Si(i,u),b=of(null,i,f,s,b,u);var T=uf();return i.flags|=1,typeof b=="object"&&b!==null&&typeof b.render=="function"&&b.$$typeof===void 0?(i.tag=1,i.memoizedState=null,i.updateQueue=null,Yn(f)?(T=!0,vl(i)):T=!1,i.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,Zd(i),b.updater=jl,i.stateNode=b,b._reactInternals=i,pf(i,f,s,u),i=bf(null,i,f,!0,T,u)):(i.tag=0,Lt&&T&&Wd(i),Pn(null,i,b,u),i=i.child),i;case 16:f=i.elementType;e:{switch(Hl(s,i),s=i.pendingProps,b=f._init,f=b(f._payload),i.type=f,b=i.tag=Nv(f),s=Or(f,s),b){case 0:i=yf(null,i,f,s,u);break e;case 1:i=ug(null,i,f,s,u);break e;case 11:i=rg(null,i,f,s,u);break e;case 14:i=sg(null,i,f,Or(f.type,s),u);break e}throw Error(n(306,f,""))}return i;case 0:return f=i.type,b=i.pendingProps,b=i.elementType===f?b:Or(f,b),yf(s,i,f,b,u);case 1:return f=i.type,b=i.pendingProps,b=i.elementType===f?b:Or(f,b),ug(s,i,f,b,u);case 3:e:{if(lg(i),s===null)throw Error(n(387));f=i.pendingProps,T=i.memoizedState,b=T.element,Sm(s,i),Al(i,f,null,u);var D=i.memoizedState;if(f=D.element,T.isDehydrated)if(T={element:f,isDehydrated:!1,cache:D.cache,pendingSuspenseBoundaries:D.pendingSuspenseBoundaries,transitions:D.transitions},i.updateQueue.baseState=T,i.memoizedState=T,i.flags&256){b=Ci(Error(n(423)),i),i=cg(s,i,f,u,b);break e}else if(f!==b){b=Ci(Error(n(424)),i),i=cg(s,i,f,u,b);break e}else for(ar=Ps(i.stateNode.containerInfo.firstChild),sr=i,Lt=!0,Nr=null,u=vm(i,null,f,u),i.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(Ti(),f===b){i=ms(s,i,u);break e}Pn(s,i,f,u)}i=i.child}return i;case 5:return km(i),s===null&&$d(i),f=i.type,b=i.pendingProps,T=s!==null?s.memoizedProps:null,D=b.children,Fd(f,b)?D=null:T!==null&&Fd(f,T)&&(i.flags|=32),og(s,i),Pn(s,i,D,u),i.child;case 6:return s===null&&$d(i),null;case 13:return dg(s,i,u);case 4:return ef(i,i.stateNode.containerInfo),f=i.pendingProps,s===null?i.child=vi(i,null,f,u):Pn(s,i,f,u),i.child;case 11:return f=i.type,b=i.pendingProps,b=i.elementType===f?b:Or(f,b),rg(s,i,f,b,u);case 7:return Pn(s,i,i.pendingProps,u),i.child;case 8:return Pn(s,i,i.pendingProps.children,u),i.child;case 12:return Pn(s,i,i.pendingProps.children,u),i.child;case 10:e:{if(f=i.type._context,b=i.pendingProps,T=i.memoizedProps,D=b.value,St(Nl,f._currentValue),f._currentValue=D,T!==null)if(kr(T.value,D)){if(T.children===b.children&&!Wn.current){i=ms(s,i,u);break e}}else for(T=i.child,T!==null&&(T.return=i);T!==null;){var Y=T.dependencies;if(Y!==null){D=T.child;for(var V=Y.firstContext;V!==null;){if(V.context===f){if(T.tag===1){V=ps(-1,u&-u),V.tag=2;var se=T.updateQueue;if(se!==null){se=se.shared;var de=se.pending;de===null?V.next=V:(V.next=de.next,de.next=V),se.pending=V}}T.lanes|=u,V=T.alternate,V!==null&&(V.lanes|=u),Kd(T.return,u,i),Y.lanes|=u;break}V=V.next}}else if(T.tag===10)D=T.type===i.type?null:T.child;else if(T.tag===18){if(D=T.return,D===null)throw Error(n(341));D.lanes|=u,Y=D.alternate,Y!==null&&(Y.lanes|=u),Kd(D,u,i),D=T.sibling}else D=T.child;if(D!==null)D.return=T;else for(D=T;D!==null;){if(D===i){D=null;break}if(T=D.sibling,T!==null){T.return=D.return,D=T;break}D=D.return}T=D}Pn(s,i,b.children,u),i=i.child}return i;case 9:return b=i.type,f=i.pendingProps.children,Si(i,u),b=mr(b),f=f(b),i.flags|=1,Pn(s,i,f,u),i.child;case 14:return f=i.type,b=Or(f,i.pendingProps),b=Or(f.type,b),sg(s,i,f,b,u);case 15:return ag(s,i,i.type,i.pendingProps,u);case 17:return f=i.type,b=i.pendingProps,b=i.elementType===f?b:Or(f,b),Hl(s,i),i.tag=1,Yn(f)?(s=!0,vl(i)):s=!1,Si(i,u),Xm(i,f,b),pf(i,f,b,u),bf(null,i,f,!0,s,u);case 19:return hg(s,i,u);case 22:return ig(s,i,u)}throw Error(n(156,i.tag))};function Fg(s,i){return ba(s,i)}function kv(s,i,u,f){this.tag=s,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function br(s,i,u,f){return new kv(s,i,u,f)}function jf(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Nv(s){if(typeof s=="function")return jf(s)?1:0;if(s!=null){if(s=s.$$typeof,s===H)return 11;if(s===J)return 14}return 2}function Vs(s,i){var u=s.alternate;return u===null?(u=br(s.tag,i,s.key,s.mode),u.elementType=s.elementType,u.type=s.type,u.stateNode=s.stateNode,u.alternate=s,s.alternate=u):(u.pendingProps=i,u.type=s.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=s.flags&14680064,u.childLanes=s.childLanes,u.lanes=s.lanes,u.child=s.child,u.memoizedProps=s.memoizedProps,u.memoizedState=s.memoizedState,u.updateQueue=s.updateQueue,i=s.dependencies,u.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},u.sibling=s.sibling,u.index=s.index,u.ref=s.ref,u}function Kl(s,i,u,f,b,T){var D=2;if(f=s,typeof s=="function")jf(s)&&(D=1);else if(typeof s=="string")D=5;else e:switch(s){case N:return Aa(u.children,b,T,i);case I:D=8,b|=8;break;case F:return s=br(12,u,i,b|2),s.elementType=F,s.lanes=T,s;case $:return s=br(13,u,i,b),s.elementType=$,s.lanes=T,s;case G:return s=br(19,u,i,b),s.elementType=G,s.lanes=T,s;case re:return Jl(u,b,T,i);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case j:D=10;break e;case M:D=9;break e;case H:D=11;break e;case J:D=14;break e;case Q:D=16,f=null;break e}throw Error(n(130,s==null?s:typeof s,""))}return i=br(D,u,i,b),i.elementType=s,i.type=f,i.lanes=T,i}function Aa(s,i,u,f){return s=br(7,s,f,i),s.lanes=u,s}function Jl(s,i,u,f){return s=br(22,s,f,i),s.elementType=re,s.lanes=u,s.stateNode={isHidden:!1},s}function Bf(s,i,u){return s=br(6,s,null,i),s.lanes=u,s}function Hf(s,i,u){return i=br(4,s.children!==null?s.children:[],s.key,i),i.lanes=u,i.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},i}function Ov(s,i,u,f,b){this.tag=i,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=fd(0),this.expirationTimes=fd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fd(0),this.identifierPrefix=f,this.onRecoverableError=b,this.mutableSourceEagerHydrationData=null}function Uf(s,i,u,f,b,T,D,Y,V){return s=new Ov(s,i,u,Y,V),i===1?(i=1,T===!0&&(i|=8)):i=0,T=br(3,null,null,i),s.current=T,T.stateNode=s,T.memoizedState={element:f,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},Zd(T),s}function Dv(s,i,u){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:_,key:f==null?null:""+f,children:s,containerInfo:i,implementation:u}}function jg(s){if(!s)return js;s=s._reactInternals;e:{if(Tt(s)!==s||s.tag!==1)throw Error(n(170));var i=s;do{switch(i.tag){case 3:i=i.stateNode.context;break e;case 1:if(Yn(i.type)){i=i.stateNode.__reactInternalMemoizedMergedChildContext;break e}}i=i.return}while(i!==null);throw Error(n(171))}if(s.tag===1){var u=s.type;if(Yn(u))return fm(s,u,i)}return i}function Bg(s,i,u,f,b,T,D,Y,V){return s=Uf(u,f,!0,s,b,T,D,Y,V),s.context=jg(null),u=s.current,f=Fn(),b=qs(u),T=ps(f,b),T.callback=i??null,Us(u,T,b),s.current.lanes=b,To(s,b,f),Vn(s,f),s}function Zl(s,i,u,f){var b=i.current,T=Fn(),D=qs(b);return u=jg(u),i.context===null?i.context=u:i.pendingContext=u,i=ps(T,D),i.payload={element:s},f=f===void 0?null:f,f!==null&&(i.callback=f),s=Us(b,i,D),s!==null&&(Ir(s,b,D,T),Dl(s,b,D)),D}function ec(s){if(s=s.current,!s.child)return null;switch(s.child.tag){case 5:return s.child.stateNode;default:return s.child.stateNode}}function Hg(s,i){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var u=s.retryLane;s.retryLane=u!==0&&u<i?u:i}}function zf(s,i){Hg(s,i),(s=s.alternate)&&Hg(s,i)}function Av(){return null}var Ug=typeof reportError=="function"?reportError:function(s){console.error(s)};function Wf(s){this._internalRoot=s}tc.prototype.render=Wf.prototype.render=function(s){var i=this._internalRoot;if(i===null)throw Error(n(409));Zl(s,i,null,null)},tc.prototype.unmount=Wf.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var i=s.containerInfo;Na(function(){Zl(null,s,null,null)}),i[ls]=null}};function tc(s){this._internalRoot=s}tc.prototype.unstable_scheduleHydration=function(s){if(s){var i=Sp();s={blockedOn:null,target:s,priority:i};for(var u=0;u<Rs.length&&i!==0&&i<Rs[u].priority;u++);Rs.splice(u,0,s),u===0&&kp(s)}};function Yf(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function nc(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11&&(s.nodeType!==8||s.nodeValue!==" react-mount-point-unstable "))}function zg(){}function Iv(s,i,u,f,b){if(b){if(typeof f=="function"){var T=f;f=function(){var se=ec(D);T.call(se)}}var D=Bg(i,f,s,0,null,!1,!1,"",zg);return s._reactRootContainer=D,s[ls]=D.current,Mo(s.nodeType===8?s.parentNode:s),Na(),D}for(;b=s.lastChild;)s.removeChild(b);if(typeof f=="function"){var Y=f;f=function(){var se=ec(V);Y.call(se)}}var V=Uf(s,0,!1,null,null,!1,!1,"",zg);return s._reactRootContainer=V,s[ls]=V.current,Mo(s.nodeType===8?s.parentNode:s),Na(function(){Zl(i,V,u,f)}),V}function rc(s,i,u,f,b){var T=u._reactRootContainer;if(T){var D=T;if(typeof b=="function"){var Y=b;b=function(){var V=ec(D);Y.call(V)}}Zl(i,D,s,b)}else D=Iv(u,i,s,b,f);return ec(D)}vp=function(s){switch(s.tag){case 3:var i=s.stateNode;if(i.current.memoizedState.isDehydrated){var u=xo(i.pendingLanes);u!==0&&(hd(i,u|1),Vn(i,wt()),(at&6)===0&&(Oi=wt()+500,Bs()))}break;case 13:Na(function(){var f=hs(s,1);if(f!==null){var b=Fn();Ir(f,s,1,b)}}),zf(s,1)}},pd=function(s){if(s.tag===13){var i=hs(s,134217728);if(i!==null){var u=Fn();Ir(i,s,134217728,u)}zf(s,134217728)}},wp=function(s){if(s.tag===13){var i=qs(s),u=hs(s,i);if(u!==null){var f=Fn();Ir(u,s,i,f)}zf(s,i)}},Sp=function(){return pt},_p=function(s,i){var u=pt;try{return pt=s,i()}finally{pt=u}},Le=function(s,i,u){switch(i){case"input":if(mn(s,u),i=u.name,u.type==="radio"&&i!=null){for(u=s;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll("input[name="+JSON.stringify(""+i)+'][type="radio"]'),i=0;i<u.length;i++){var f=u[i];if(f!==s&&f.form===s.form){var b=xl(f);if(!b)throw Error(n(90));pn(f),mn(f,b)}}}break;case"textarea":nr(s,u);break;case"select":i=u.value,i!=null&&Et(s,!!u.multiple,i,!1)}},It=Mf,Wt=Na;var Rv={usingClientEntryPoint:!1,Events:[jo,gi,xl,Je,Ce,Mf]},Jo={findFiberByHostInstance:xa,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Lv={bundleType:Jo.bundleType,version:Jo.version,rendererPackageName:Jo.rendererPackageName,rendererConfig:Jo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:A.ReactCurrentDispatcher,findHostInstanceByFiber:function(s){return s=fr(s),s===null?null:s.stateNode},findFiberByHostInstance:Jo.findFiberByHostInstance||Av,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var sc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!sc.isDisabled&&sc.supportsFiber)try{tl=sc.inject(Lv),zr=sc}catch{}}return Qn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Rv,Qn.createPortal=function(s,i){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Yf(i))throw Error(n(200));return Dv(s,i,null,u)},Qn.createRoot=function(s,i){if(!Yf(s))throw Error(n(299));var u=!1,f="",b=Ug;return i!=null&&(i.unstable_strictMode===!0&&(u=!0),i.identifierPrefix!==void 0&&(f=i.identifierPrefix),i.onRecoverableError!==void 0&&(b=i.onRecoverableError)),i=Uf(s,1,!1,null,null,u,!1,f,b),s[ls]=i.current,Mo(s.nodeType===8?s.parentNode:s),new Wf(i)},Qn.findDOMNode=function(s){if(s==null)return null;if(s.nodeType===1)return s;var i=s._reactInternals;if(i===void 0)throw typeof s.render=="function"?Error(n(188)):(s=Object.keys(s).join(","),Error(n(268,s)));return s=fr(i),s=s===null?null:s.stateNode,s},Qn.flushSync=function(s){return Na(s)},Qn.hydrate=function(s,i,u){if(!nc(i))throw Error(n(200));return rc(null,s,i,!0,u)},Qn.hydrateRoot=function(s,i,u){if(!Yf(s))throw Error(n(405));var f=u!=null&&u.hydratedSources||null,b=!1,T="",D=Ug;if(u!=null&&(u.unstable_strictMode===!0&&(b=!0),u.identifierPrefix!==void 0&&(T=u.identifierPrefix),u.onRecoverableError!==void 0&&(D=u.onRecoverableError)),i=Bg(i,null,s,1,u??null,b,!1,T,D),s[ls]=i.current,Mo(s),f)for(s=0;s<f.length;s++)u=f[s],b=u._getVersion,b=b(u._source),i.mutableSourceEagerHydrationData==null?i.mutableSourceEagerHydrationData=[u,b]:i.mutableSourceEagerHydrationData.push(u,b);return new tc(i)},Qn.render=function(s,i,u){if(!nc(i))throw Error(n(200));return rc(null,s,i,!1,u)},Qn.unmountComponentAtNode=function(s){if(!nc(s))throw Error(n(40));return s._reactRootContainer?(Na(function(){rc(null,null,s,!1,function(){s._reactRootContainer=null,s[ls]=null})}),!0):!1},Qn.unstable_batchedUpdates=Mf,Qn.unstable_renderSubtreeIntoContainer=function(s,i,u,f){if(!nc(u))throw Error(n(200));if(s==null||s._reactInternals===void 0)throw Error(n(38));return rc(s,i,u,!1,f)},Qn.version="18.3.1-next-f1338f8080-20240426",Qn}var Gg;function Bc(){if(Gg)return Vf.exports;Gg=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Vf.exports=Wv(),Vf.exports}var Xg;function Yv(){if(Xg)return ic;Xg=1;var e=Bc();return ic.createRoot=e.createRoot,ic.hydrateRoot=e.hydrateRoot,ic}var qv=Yv(),ni=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},$v={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},na,y0,db,Vv=(db=class{constructor(){we(this,na,$v);we(this,y0,!1)}setTimeoutProvider(e){ye(this,na,e)}setTimeout(e,t){return W(this,na).setTimeout(e,t)}clearTimeout(e){W(this,na).clearTimeout(e)}setInterval(e,t){return W(this,na).setInterval(e,t)}clearInterval(e){W(this,na).clearInterval(e)}},na=new WeakMap,y0=new WeakMap,db),Ma=new Vv;function Qv(e){setTimeout(e,0)}var Xa=typeof window>"u"||"Deno"in globalThis;function In(){}function Gv(e,t){return typeof e=="function"?e(t):e}function Nh(e){return typeof e=="number"&&e>=0&&e!==1/0}function Sb(e,t){return Math.max(e+(t||0)-Date.now(),0)}function pa(e,t){return typeof e=="function"?e(t):e}function vr(e,t){return typeof e=="function"?e(t):e}function Kg(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:o,queryKey:l,stale:c}=e;if(l){if(r){if(t.queryHash!==b0(l,t.options))return!1}else if(!Nu(t.queryKey,l))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||a&&a!==t.state.fetchStatus||o&&!o(t))}function Jg(e,t){const{exact:n,status:r,predicate:a,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Ka(t.options.mutationKey)!==Ka(o))return!1}else if(!Nu(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function b0(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ka)(e)}function Ka(e){return JSON.stringify(e,(t,n)=>Oh(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function Nu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Nu(e[n],t[n])):!1}var Xv=Object.prototype.hasOwnProperty;function E0(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Zg(e)&&Zg(t);if(!r&&!(Oh(e)&&Oh(t)))return t;const o=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),c=l.length,d=r?new Array(c):{};let h=0;for(let m=0;m<c;m++){const g=r?m:l[m],E=e[g],x=t[g];if(E===x){d[g]=E,(r?m<o:Xv.call(e,g))&&h++;continue}if(E===null||x===null||typeof E!="object"||typeof x!="object"){d[g]=x;continue}const C=E0(E,x,n+1);d[g]=C,C===E&&h++}return o===c&&h===o?e:d}function Ou(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Zg(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Oh(e){if(!e1(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!e1(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function e1(e){return Object.prototype.toString.call(e)==="[object Object]"}function Kv(e){return new Promise(t=>{Ma.setTimeout(t,e)})}function Dh(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?E0(e,t):t}function Jv(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Zv(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var x0=Symbol();function _b(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===x0?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function T0(e,t){return typeof e=="function"?e(...t):!!e}function ew(e,t,n){let r=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??(a=t()),r||(r=!0,a.aborted?n():a.addEventListener("abort",n,{once:!0})),a)}),e}var Ba,ra,Bi,fb,tw=(fb=class extends ni{constructor(){super();we(this,Ba);we(this,ra);we(this,Bi);ye(this,Bi,t=>{if(!Xa&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){W(this,ra)||this.setEventListener(W(this,Bi))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,ra))==null||t.call(this),ye(this,ra,void 0))}setEventListener(t){var n;ye(this,Bi,t),(n=W(this,ra))==null||n.call(this),ye(this,ra,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){W(this,Ba)!==t&&(ye(this,Ba,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof W(this,Ba)=="boolean"?W(this,Ba):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ba=new WeakMap,ra=new WeakMap,Bi=new WeakMap,fb),v0=new tw;function Ah(){let e,t;const n=new Promise((a,o)=>{e=a,t=o});n.status="pending",n.catch(()=>{});function r(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},n.reject=a=>{r({status:"rejected",reason:a}),t(a)},n}var nw=Qv;function rw(){let e=[],t=0,n=c=>{c()},r=c=>{c()},a=nw;const o=c=>{t?e.push(c):a(()=>{n(c)})},l=()=>{const c=e;e=[],c.length&&a(()=>{r(()=>{c.forEach(d=>{n(d)})})})};return{batch:c=>{let d;t++;try{d=c()}finally{t--,t||l()}return d},batchCalls:c=>(...d)=>{o(()=>{c(...d)})},schedule:o,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{a=c}}}var Ht=rw(),Hi,sa,Ui,hb,sw=(hb=class extends ni{constructor(){super();we(this,Hi,!0);we(this,sa);we(this,Ui);ye(this,Ui,t=>{if(!Xa&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){W(this,sa)||this.setEventListener(W(this,Ui))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,sa))==null||t.call(this),ye(this,sa,void 0))}setEventListener(t){var n;ye(this,Ui,t),(n=W(this,sa))==null||n.call(this),ye(this,sa,t(this.setOnline.bind(this)))}setOnline(t){W(this,Hi)!==t&&(ye(this,Hi,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return W(this,Hi)}},Hi=new WeakMap,sa=new WeakMap,Ui=new WeakMap,hb),_c=new sw;function aw(e){return Math.min(1e3*2**e,3e4)}function Cb(e){return(e??"online")==="online"?_c.isOnline():!0}var Ih=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function kb(e){let t=!1,n=0,r;const a=Ah(),o=()=>a.status!=="pending",l=S=>{var w;if(!o()){const v=new Ih(S);E(v),(w=e.onCancel)==null||w.call(e,v)}},c=()=>{t=!0},d=()=>{t=!1},h=()=>v0.isFocused()&&(e.networkMode==="always"||_c.isOnline())&&e.canRun(),m=()=>Cb(e.networkMode)&&e.canRun(),g=S=>{o()||(r==null||r(),a.resolve(S))},E=S=>{o()||(r==null||r(),a.reject(S))},x=()=>new Promise(S=>{var w;r=v=>{(o()||h())&&S(v)},(w=e.onPause)==null||w.call(e)}).then(()=>{var S;r=void 0,o()||(S=e.onContinue)==null||S.call(e)}),C=()=>{if(o())return;let S;const w=n===0?e.initialPromise:void 0;try{S=w??e.fn()}catch(v){S=Promise.reject(v)}Promise.resolve(S).then(g).catch(v=>{var _;if(o())return;const k=e.retry??(Xa?0:3),O=e.retryDelay??aw,A=typeof O=="function"?O(n,v):O,P=k===!0||typeof k=="number"&&n<k||typeof k=="function"&&k(n,v);if(t||!P){E(v);return}n++,(_=e.onFail)==null||_.call(e,n,v),Kv(A).then(()=>h()?void 0:x()).then(()=>{t?E(v):C()})})};return{promise:a,status:()=>a.status,cancel:l,continue:()=>(r==null||r(),a),cancelRetry:c,continueRetry:d,canStart:m,start:()=>(m()?C():x().then(C),a)}}var Ha,pb,Nb=(pb=class{constructor(){we(this,Ha)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Nh(this.gcTime)&&ye(this,Ha,Ma.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Xa?1/0:300*1e3))}clearGcTimeout(){W(this,Ha)&&(Ma.clearTimeout(W(this,Ha)),ye(this,Ha,void 0))}},Ha=new WeakMap,pb),Ua,zi,xr,za,xn,Lu,Wa,Mr,bs,mb,iw=(mb=class extends Nb{constructor(t){super();we(this,Mr);we(this,Ua);we(this,zi);we(this,xr);we(this,za);we(this,xn);we(this,Lu);we(this,Wa);ye(this,Wa,!1),ye(this,Lu,t.defaultOptions),this.setOptions(t.options),this.observers=[],ye(this,za,t.client),ye(this,xr,W(this,za).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ye(this,Ua,n1(this.options)),this.state=t.state??W(this,Ua),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=W(this,xn))==null?void 0:t.promise}setOptions(t){if(this.options={...W(this,Lu),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=n1(this.options);n.data!==void 0&&(this.setState(t1(n.data,n.dataUpdatedAt)),ye(this,Ua,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&W(this,xr).remove(this)}setData(t,n){const r=Dh(this.state.data,t,this.options);return je(this,Mr,bs).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){je(this,Mr,bs).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,a;const n=(r=W(this,xn))==null?void 0:r.promise;return(a=W(this,xn))==null||a.cancel(t),n?n.then(In).catch(In):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(W(this,Ua))}isActive(){return this.observers.some(t=>vr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===x0||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>pa(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Sb(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,xn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,xn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),W(this,xr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(W(this,xn)&&(W(this,Wa)?W(this,xn).cancel({revert:!0}):W(this,xn).cancelRetry()),this.scheduleGc()),W(this,xr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||je(this,Mr,bs).call(this,{type:"invalidate"})}async fetch(t,n){var d,h,m,g,E,x,C,S,w,v,k,O;if(this.state.fetchStatus!=="idle"&&((d=W(this,xn))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(W(this,xn))return W(this,xn).continueRetry(),W(this,xn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const A=this.observers.find(P=>P.options.queryFn);A&&this.setOptions(A.options)}const r=new AbortController,a=A=>{Object.defineProperty(A,"signal",{enumerable:!0,get:()=>(ye(this,Wa,!0),r.signal)})},o=()=>{const A=_b(this.options,n),_=(()=>{const N={client:W(this,za),queryKey:this.queryKey,meta:this.meta};return a(N),N})();return ye(this,Wa,!1),this.options.persister?this.options.persister(A,_,this):A(_)},c=(()=>{const A={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:W(this,za),state:this.state,fetchFn:o};return a(A),A})();(h=this.options.behavior)==null||h.onFetch(c,this),ye(this,zi,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=c.fetchOptions)==null?void 0:m.meta))&&je(this,Mr,bs).call(this,{type:"fetch",meta:(g=c.fetchOptions)==null?void 0:g.meta}),ye(this,xn,kb({initialPromise:n==null?void 0:n.initialPromise,fn:c.fetchFn,onCancel:A=>{A instanceof Ih&&A.revert&&this.setState({...W(this,zi),fetchStatus:"idle"}),r.abort()},onFail:(A,P)=>{je(this,Mr,bs).call(this,{type:"failed",failureCount:A,error:P})},onPause:()=>{je(this,Mr,bs).call(this,{type:"pause"})},onContinue:()=>{je(this,Mr,bs).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0}));try{const A=await W(this,xn).start();if(A===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(A),(x=(E=W(this,xr).config).onSuccess)==null||x.call(E,A,this),(S=(C=W(this,xr).config).onSettled)==null||S.call(C,A,this.state.error,this),A}catch(A){if(A instanceof Ih){if(A.silent)return W(this,xn).promise;if(A.revert){if(this.state.data===void 0)throw A;return this.state.data}}throw je(this,Mr,bs).call(this,{type:"error",error:A}),(v=(w=W(this,xr).config).onError)==null||v.call(w,A,this),(O=(k=W(this,xr).config).onSettled)==null||O.call(k,this.state.data,A,this),A}finally{this.scheduleGc()}}},Ua=new WeakMap,zi=new WeakMap,xr=new WeakMap,za=new WeakMap,xn=new WeakMap,Lu=new WeakMap,Wa=new WeakMap,Mr=new WeakSet,bs=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Ob(r.data,this.options),fetchMeta:t.meta??null};case"success":const a={...r,...t1(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ye(this,zi,t.manual?a:void 0),a;case"error":const o=t.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Ht.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),W(this,xr).notify({query:this,type:"updated",action:t})})},mb);function Ob(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Cb(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function t1(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function n1(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Kn,st,Mu,jn,Ya,Wi,Es,aa,Pu,Yi,qi,qa,$a,ia,$i,ft,yu,Rh,Lh,Mh,Ph,Fh,jh,Bh,Db,gb,w0=(gb=class extends ni{constructor(t,n){super();we(this,ft);we(this,Kn);we(this,st);we(this,Mu);we(this,jn);we(this,Ya);we(this,Wi);we(this,Es);we(this,aa);we(this,Pu);we(this,Yi);we(this,qi);we(this,qa);we(this,$a);we(this,ia);we(this,$i,new Set);this.options=n,ye(this,Kn,t),ye(this,aa,null),ye(this,Es,Ah()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(W(this,st).addObserver(this),r1(W(this,st),this.options)?je(this,ft,yu).call(this):this.updateResult(),je(this,ft,Ph).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Hh(W(this,st),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Hh(W(this,st),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,je(this,ft,Fh).call(this),je(this,ft,jh).call(this),W(this,st).removeObserver(this)}setOptions(t){const n=this.options,r=W(this,st);if(this.options=W(this,Kn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof vr(this.options.enabled,W(this,st))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");je(this,ft,Bh).call(this),W(this,st).setOptions(this.options),n._defaulted&&!Ou(this.options,n)&&W(this,Kn).getQueryCache().notify({type:"observerOptionsUpdated",query:W(this,st),observer:this});const a=this.hasListeners();a&&s1(W(this,st),r,this.options,n)&&je(this,ft,yu).call(this),this.updateResult(),a&&(W(this,st)!==r||vr(this.options.enabled,W(this,st))!==vr(n.enabled,W(this,st))||pa(this.options.staleTime,W(this,st))!==pa(n.staleTime,W(this,st)))&&je(this,ft,Rh).call(this);const o=je(this,ft,Lh).call(this);a&&(W(this,st)!==r||vr(this.options.enabled,W(this,st))!==vr(n.enabled,W(this,st))||o!==W(this,ia))&&je(this,ft,Mh).call(this,o)}getOptimisticResult(t){const n=W(this,Kn).getQueryCache().build(W(this,Kn),t),r=this.createResult(n,t);return uw(this,r)&&(ye(this,jn,r),ye(this,Wi,this.options),ye(this,Ya,W(this,st).state)),r}getCurrentResult(){return W(this,jn)}trackResult(t,n){return new Proxy(t,{get:(r,a)=>(this.trackProp(a),n==null||n(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&W(this,Es).status==="pending"&&W(this,Es).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,a))})}trackProp(t){W(this,$i).add(t)}getCurrentQuery(){return W(this,st)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=W(this,Kn).defaultQueryOptions(t),r=W(this,Kn).getQueryCache().build(W(this,Kn),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return je(this,ft,yu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),W(this,jn)))}createResult(t,n){var F;const r=W(this,st),a=this.options,o=W(this,jn),l=W(this,Ya),c=W(this,Wi),h=t!==r?t.state:W(this,Mu),{state:m}=t;let g={...m},E=!1,x;if(n._optimisticResults){const j=this.hasListeners(),M=!j&&r1(t,n),H=j&&s1(t,r,n,a);(M||H)&&(g={...g,...Ob(m.data,t.options)}),n._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:C,errorUpdatedAt:S,status:w}=g;x=g.data;let v=!1;if(n.placeholderData!==void 0&&x===void 0&&w==="pending"){let j;o!=null&&o.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData)?(j=o.data,v=!0):j=typeof n.placeholderData=="function"?n.placeholderData((F=W(this,qi))==null?void 0:F.state.data,W(this,qi)):n.placeholderData,j!==void 0&&(w="success",x=Dh(o==null?void 0:o.data,j,n),E=!0)}if(n.select&&x!==void 0&&!v)if(o&&x===(l==null?void 0:l.data)&&n.select===W(this,Pu))x=W(this,Yi);else try{ye(this,Pu,n.select),x=n.select(x),x=Dh(o==null?void 0:o.data,x,n),ye(this,Yi,x),ye(this,aa,null)}catch(j){ye(this,aa,j)}W(this,aa)&&(C=W(this,aa),x=W(this,Yi),S=Date.now(),w="error");const k=g.fetchStatus==="fetching",O=w==="pending",A=w==="error",P=O&&k,_=x!==void 0,I={status:w,fetchStatus:g.fetchStatus,isPending:O,isSuccess:w==="success",isError:A,isInitialLoading:P,isLoading:P,data:x,dataUpdatedAt:g.dataUpdatedAt,error:C,errorUpdatedAt:S,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>h.dataUpdateCount||g.errorUpdateCount>h.errorUpdateCount,isFetching:k,isRefetching:k&&!O,isLoadingError:A&&!_,isPaused:g.fetchStatus==="paused",isPlaceholderData:E,isRefetchError:A&&_,isStale:S0(t,n),refetch:this.refetch,promise:W(this,Es),isEnabled:vr(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const j=I.data!==void 0,M=I.status==="error"&&!j,H=J=>{M?J.reject(I.error):j&&J.resolve(I.data)},$=()=>{const J=ye(this,Es,I.promise=Ah());H(J)},G=W(this,Es);switch(G.status){case"pending":t.queryHash===r.queryHash&&H(G);break;case"fulfilled":(M||I.data!==G.value)&&$();break;case"rejected":(!M||I.error!==G.reason)&&$();break}}return I}updateResult(){const t=W(this,jn),n=this.createResult(W(this,st),this.options);if(ye(this,Ya,W(this,st).state),ye(this,Wi,this.options),W(this,Ya).data!==void 0&&ye(this,qi,W(this,st)),Ou(n,t))return;ye(this,jn,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,o=typeof a=="function"?a():a;if(o==="all"||!o&&!W(this,$i).size)return!0;const l=new Set(o??W(this,$i));return this.options.throwOnError&&l.add("error"),Object.keys(W(this,jn)).some(c=>{const d=c;return W(this,jn)[d]!==t[d]&&l.has(d)})};je(this,ft,Db).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&je(this,ft,Ph).call(this)}},Kn=new WeakMap,st=new WeakMap,Mu=new WeakMap,jn=new WeakMap,Ya=new WeakMap,Wi=new WeakMap,Es=new WeakMap,aa=new WeakMap,Pu=new WeakMap,Yi=new WeakMap,qi=new WeakMap,qa=new WeakMap,$a=new WeakMap,ia=new WeakMap,$i=new WeakMap,ft=new WeakSet,yu=function(t){je(this,ft,Bh).call(this);let n=W(this,st).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(In)),n},Rh=function(){je(this,ft,Fh).call(this);const t=pa(this.options.staleTime,W(this,st));if(Xa||W(this,jn).isStale||!Nh(t))return;const r=Sb(W(this,jn).dataUpdatedAt,t)+1;ye(this,qa,Ma.setTimeout(()=>{W(this,jn).isStale||this.updateResult()},r))},Lh=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(W(this,st)):this.options.refetchInterval)??!1},Mh=function(t){je(this,ft,jh).call(this),ye(this,ia,t),!(Xa||vr(this.options.enabled,W(this,st))===!1||!Nh(W(this,ia))||W(this,ia)===0)&&ye(this,$a,Ma.setInterval(()=>{(this.options.refetchIntervalInBackground||v0.isFocused())&&je(this,ft,yu).call(this)},W(this,ia)))},Ph=function(){je(this,ft,Rh).call(this),je(this,ft,Mh).call(this,je(this,ft,Lh).call(this))},Fh=function(){W(this,qa)&&(Ma.clearTimeout(W(this,qa)),ye(this,qa,void 0))},jh=function(){W(this,$a)&&(Ma.clearInterval(W(this,$a)),ye(this,$a,void 0))},Bh=function(){const t=W(this,Kn).getQueryCache().build(W(this,Kn),this.options);if(t===W(this,st))return;const n=W(this,st);ye(this,st,t),ye(this,Mu,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Db=function(t){Ht.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(W(this,jn))}),W(this,Kn).getQueryCache().notify({query:W(this,st),type:"observerResultsUpdated"})})},gb);function ow(e,t){return vr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function r1(e,t){return ow(e,t)||e.state.data!==void 0&&Hh(e,t,t.refetchOnMount)}function Hh(e,t,n){if(vr(t.enabled,e)!==!1&&pa(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&S0(e,t)}return!1}function s1(e,t,n,r){return(e!==t||vr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&S0(e,n)}function S0(e,t){return vr(t.enabled,e)!==!1&&e.isStaleByTime(pa(t.staleTime,e))}function uw(e,t){return!Ou(e.getCurrentResult(),t)}function a1(e){return{onFetch:(t,n)=>{var m,g,E,x,C;const r=t.options,a=(E=(g=(m=t.fetchOptions)==null?void 0:m.meta)==null?void 0:g.fetchMore)==null?void 0:E.direction,o=((x=t.state.data)==null?void 0:x.pages)||[],l=((C=t.state.data)==null?void 0:C.pageParams)||[];let c={pages:[],pageParams:[]},d=0;const h=async()=>{let S=!1;const w=O=>{ew(O,()=>t.signal,()=>S=!0)},v=_b(t.options,t.fetchOptions),k=async(O,A,P)=>{if(S)return Promise.reject();if(A==null&&O.pages.length)return Promise.resolve(O);const N=(()=>{const M={client:t.client,queryKey:t.queryKey,pageParam:A,direction:P?"backward":"forward",meta:t.options.meta};return w(M),M})(),I=await v(N),{maxPages:F}=t.options,j=P?Zv:Jv;return{pages:j(O.pages,I,F),pageParams:j(O.pageParams,A,F)}};if(a&&o.length){const O=a==="backward",A=O?lw:i1,P={pages:o,pageParams:l},_=A(r,P);c=await k(P,_,O)}else{const O=e??o.length;do{const A=d===0?l[0]??r.initialPageParam:i1(r,c);if(d>0&&A==null)break;c=await k(c,A),d++}while(d<O)}return c};t.options.persister?t.fetchFn=()=>{var S,w;return(w=(S=t.options).persister)==null?void 0:w.call(S,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=h}}}function i1(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function lw(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Fu,Xr,An,Va,Kr,Zs,yb,cw=(yb=class extends Nb{constructor(t){super();we(this,Kr);we(this,Fu);we(this,Xr);we(this,An);we(this,Va);ye(this,Fu,t.client),this.mutationId=t.mutationId,ye(this,An,t.mutationCache),ye(this,Xr,[]),this.state=t.state||Ab(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){W(this,Xr).includes(t)||(W(this,Xr).push(t),this.clearGcTimeout(),W(this,An).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ye(this,Xr,W(this,Xr).filter(n=>n!==t)),this.scheduleGc(),W(this,An).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){W(this,Xr).length||(this.state.status==="pending"?this.scheduleGc():W(this,An).remove(this))}continue(){var t;return((t=W(this,Va))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,c,d,h,m,g,E,x,C,S,w,v,k,O,A,P,_,N;const n=()=>{je(this,Kr,Zs).call(this,{type:"continue"})},r={client:W(this,Fu),meta:this.options.meta,mutationKey:this.options.mutationKey};ye(this,Va,kb({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(I,F)=>{je(this,Kr,Zs).call(this,{type:"failed",failureCount:I,error:F})},onPause:()=>{je(this,Kr,Zs).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>W(this,An).canRun(this)}));const a=this.state.status==="pending",o=!W(this,Va).canStart();try{if(a)n();else{je(this,Kr,Zs).call(this,{type:"pending",variables:t,isPaused:o}),W(this,An).config.onMutate&&await W(this,An).config.onMutate(t,this,r);const F=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t,r));F!==this.state.context&&je(this,Kr,Zs).call(this,{type:"pending",context:F,variables:t,isPaused:o})}const I=await W(this,Va).start();return await((h=(d=W(this,An).config).onSuccess)==null?void 0:h.call(d,I,t,this.state.context,this,r)),await((g=(m=this.options).onSuccess)==null?void 0:g.call(m,I,t,this.state.context,r)),await((x=(E=W(this,An).config).onSettled)==null?void 0:x.call(E,I,null,this.state.variables,this.state.context,this,r)),await((S=(C=this.options).onSettled)==null?void 0:S.call(C,I,null,t,this.state.context,r)),je(this,Kr,Zs).call(this,{type:"success",data:I}),I}catch(I){try{await((v=(w=W(this,An).config).onError)==null?void 0:v.call(w,I,t,this.state.context,this,r))}catch(F){Promise.reject(F)}try{await((O=(k=this.options).onError)==null?void 0:O.call(k,I,t,this.state.context,r))}catch(F){Promise.reject(F)}try{await((P=(A=W(this,An).config).onSettled)==null?void 0:P.call(A,void 0,I,this.state.variables,this.state.context,this,r))}catch(F){Promise.reject(F)}try{await((N=(_=this.options).onSettled)==null?void 0:N.call(_,void 0,I,t,this.state.context,r))}catch(F){Promise.reject(F)}throw je(this,Kr,Zs).call(this,{type:"error",error:I}),I}finally{W(this,An).runNext(this)}}},Fu=new WeakMap,Xr=new WeakMap,An=new WeakMap,Va=new WeakMap,Kr=new WeakSet,Zs=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Ht.batch(()=>{W(this,Xr).forEach(r=>{r.onMutationUpdate(t)}),W(this,An).notify({mutation:this,type:"updated",action:t})})},yb);function Ab(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var xs,Pr,ju,bb,dw=(bb=class extends ni{constructor(t={}){super();we(this,xs);we(this,Pr);we(this,ju);this.config=t,ye(this,xs,new Set),ye(this,Pr,new Map),ye(this,ju,0)}build(t,n,r){const a=new cw({client:t,mutationCache:this,mutationId:++ac(this,ju)._,options:t.defaultMutationOptions(n),state:r});return this.add(a),a}add(t){W(this,xs).add(t);const n=oc(t);if(typeof n=="string"){const r=W(this,Pr).get(n);r?r.push(t):W(this,Pr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(W(this,xs).delete(t)){const n=oc(t);if(typeof n=="string"){const r=W(this,Pr).get(n);if(r)if(r.length>1){const a=r.indexOf(t);a!==-1&&r.splice(a,1)}else r[0]===t&&W(this,Pr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=oc(t);if(typeof n=="string"){const r=W(this,Pr).get(n),a=r==null?void 0:r.find(o=>o.state.status==="pending");return!a||a===t}else return!0}runNext(t){var r;const n=oc(t);if(typeof n=="string"){const a=(r=W(this,Pr).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ht.batch(()=>{W(this,xs).forEach(t=>{this.notify({type:"removed",mutation:t})}),W(this,xs).clear(),W(this,Pr).clear()})}getAll(){return Array.from(W(this,xs))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Jg(n,r))}findAll(t={}){return this.getAll().filter(n=>Jg(t,n))}notify(t){Ht.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Ht.batch(()=>Promise.all(t.map(n=>n.continue().catch(In))))}},xs=new WeakMap,Pr=new WeakMap,ju=new WeakMap,bb);function oc(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Ts,oa,Jn,vs,Cs,Tc,Uh,Eb,fw=(Eb=class extends ni{constructor(n,r){super();we(this,Cs);we(this,Ts);we(this,oa);we(this,Jn);we(this,vs);ye(this,Ts,n),this.setOptions(r),this.bindMethods(),je(this,Cs,Tc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var a;const r=this.options;this.options=W(this,Ts).defaultMutationOptions(n),Ou(this.options,r)||W(this,Ts).getMutationCache().notify({type:"observerOptionsUpdated",mutation:W(this,Jn),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Ka(r.mutationKey)!==Ka(this.options.mutationKey)?this.reset():((a=W(this,Jn))==null?void 0:a.state.status)==="pending"&&W(this,Jn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=W(this,Jn))==null||n.removeObserver(this)}onMutationUpdate(n){je(this,Cs,Tc).call(this),je(this,Cs,Uh).call(this,n)}getCurrentResult(){return W(this,oa)}reset(){var n;(n=W(this,Jn))==null||n.removeObserver(this),ye(this,Jn,void 0),je(this,Cs,Tc).call(this),je(this,Cs,Uh).call(this)}mutate(n,r){var a;return ye(this,vs,r),(a=W(this,Jn))==null||a.removeObserver(this),ye(this,Jn,W(this,Ts).getMutationCache().build(W(this,Ts),this.options)),W(this,Jn).addObserver(this),W(this,Jn).execute(n)}},Ts=new WeakMap,oa=new WeakMap,Jn=new WeakMap,vs=new WeakMap,Cs=new WeakSet,Tc=function(){var r;const n=((r=W(this,Jn))==null?void 0:r.state)??Ab();ye(this,oa,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Uh=function(n){Ht.batch(()=>{var r,a,o,l,c,d,h,m;if(W(this,vs)&&this.hasListeners()){const g=W(this,oa).variables,E=W(this,oa).context,x={client:W(this,Ts),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(a=(r=W(this,vs)).onSuccess)==null||a.call(r,n.data,g,E,x)}catch(C){Promise.reject(C)}try{(l=(o=W(this,vs)).onSettled)==null||l.call(o,n.data,null,g,E,x)}catch(C){Promise.reject(C)}}else if((n==null?void 0:n.type)==="error"){try{(d=(c=W(this,vs)).onError)==null||d.call(c,n.error,g,E,x)}catch(C){Promise.reject(C)}try{(m=(h=W(this,vs)).onSettled)==null||m.call(h,void 0,n.error,g,E,x)}catch(C){Promise.reject(C)}}}this.listeners.forEach(g=>{g(W(this,oa))})})},Eb);function o1(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function hw(e,t,n){const r=e.slice(0);return r[t]=n,r}var Vi,ur,Qi,Gi,Tr,ua,Bu,Hu,Uu,zu,Sn,zh,Wh,Yh,qh,$h,xb,pw=(xb=class extends ni{constructor(t,n,r){super();we(this,Sn);we(this,Vi);we(this,ur);we(this,Qi);we(this,Gi);we(this,Tr);we(this,ua);we(this,Bu);we(this,Hu);we(this,Uu);we(this,zu,[]);ye(this,Vi,t),ye(this,Gi,r),ye(this,Qi,[]),ye(this,Tr,[]),ye(this,ur,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&W(this,Tr).forEach(t=>{t.subscribe(n=>{je(this,Sn,qh).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,W(this,Tr).forEach(t=>{t.destroy()})}setQueries(t,n){ye(this,Qi,t),ye(this,Gi,n),Ht.batch(()=>{const r=W(this,Tr),a=je(this,Sn,Yh).call(this,W(this,Qi));a.forEach(g=>g.observer.setOptions(g.defaultedQueryOptions));const o=a.map(g=>g.observer),l=o.map(g=>g.getCurrentResult()),c=r.length!==o.length,d=o.some((g,E)=>g!==r[E]),h=c||d,m=h?!0:l.some((g,E)=>{const x=W(this,ur)[E];return!x||!Ou(g,x)});!h&&!m||(h&&(ye(this,zu,a),ye(this,Tr,o)),ye(this,ur,l),this.hasListeners()&&(h&&(o1(r,o).forEach(g=>{g.destroy()}),o1(o,r).forEach(g=>{g.subscribe(E=>{je(this,Sn,qh).call(this,g,E)})})),je(this,Sn,$h).call(this)))})}getCurrentResult(){return W(this,ur)}getQueries(){return W(this,Tr).map(t=>t.getCurrentQuery())}getObservers(){return W(this,Tr)}getOptimisticResult(t,n){const r=je(this,Sn,Yh).call(this,t),a=r.map(l=>l.observer.getOptimisticResult(l.defaultedQueryOptions)),o=r.map(l=>l.defaultedQueryOptions.queryHash);return[a,l=>je(this,Sn,Wh).call(this,l??a,n,o),()=>je(this,Sn,zh).call(this,a,r)]}},Vi=new WeakMap,ur=new WeakMap,Qi=new WeakMap,Gi=new WeakMap,Tr=new WeakMap,ua=new WeakMap,Bu=new WeakMap,Hu=new WeakMap,Uu=new WeakMap,zu=new WeakMap,Sn=new WeakSet,zh=function(t,n){return n.map((r,a)=>{const o=t[a];return r.defaultedQueryOptions.notifyOnChangeProps?o:r.observer.trackResult(o,l=>{n.forEach(c=>{c.observer.trackProp(l)})})})},Wh=function(t,n,r){if(n){const a=W(this,Uu),o=r!==void 0&&a!==void 0&&(a.length!==r.length||r.some((l,c)=>l!==a[c]));return(!W(this,ua)||W(this,ur)!==W(this,Hu)||o||n!==W(this,Bu))&&(ye(this,Bu,n),ye(this,Hu,W(this,ur)),r!==void 0&&ye(this,Uu,r),ye(this,ua,E0(W(this,ua),n(t)))),W(this,ua)}return t},Yh=function(t){const n=new Map;W(this,Tr).forEach(a=>{const o=a.options.queryHash;if(!o)return;const l=n.get(o);l?l.push(a):n.set(o,[a])});const r=[];return t.forEach(a=>{var d;const o=W(this,Vi).defaultQueryOptions(a),c=((d=n.get(o.queryHash))==null?void 0:d.shift())??new w0(W(this,Vi),o);r.push({defaultedQueryOptions:o,observer:c})}),r},qh=function(t,n){const r=W(this,Tr).indexOf(t);r!==-1&&(ye(this,ur,hw(W(this,ur),r,n)),je(this,Sn,$h).call(this))},$h=function(){var t;if(this.hasListeners()){const n=W(this,ua),r=je(this,Sn,zh).call(this,W(this,ur),W(this,zu)),a=je(this,Sn,Wh).call(this,r,(t=W(this,Gi))==null?void 0:t.combine);n!==a&&Ht.batch(()=>{this.listeners.forEach(o=>{o(W(this,ur))})})}},xb),Jr,Tb,mw=(Tb=class extends ni{constructor(t={}){super();we(this,Jr);this.config=t,ye(this,Jr,new Map)}build(t,n,r){const a=n.queryKey,o=n.queryHash??b0(a,n);let l=this.get(o);return l||(l=new iw({client:t,queryKey:a,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(a)}),this.add(l)),l}add(t){W(this,Jr).has(t.queryHash)||(W(this,Jr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=W(this,Jr).get(t.queryHash);n&&(t.destroy(),n===t&&W(this,Jr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ht.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return W(this,Jr).get(t)}getAll(){return[...W(this,Jr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Kg(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Kg(t,r)):n}notify(t){Ht.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Ht.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ht.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Jr=new WeakMap,Tb),Vt,la,ca,Xi,Ki,da,Ji,Zi,vb,gw=(vb=class{constructor(e={}){we(this,Vt);we(this,la);we(this,ca);we(this,Xi);we(this,Ki);we(this,da);we(this,Ji);we(this,Zi);ye(this,Vt,e.queryCache||new mw),ye(this,la,e.mutationCache||new dw),ye(this,ca,e.defaultOptions||{}),ye(this,Xi,new Map),ye(this,Ki,new Map),ye(this,da,0)}mount(){ac(this,da)._++,W(this,da)===1&&(ye(this,Ji,v0.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,Vt).onFocus())})),ye(this,Zi,_c.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,Vt).onOnline())})))}unmount(){var e,t;ac(this,da)._--,W(this,da)===0&&((e=W(this,Ji))==null||e.call(this),ye(this,Ji,void 0),(t=W(this,Zi))==null||t.call(this),ye(this,Zi,void 0))}isFetching(e){return W(this,Vt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return W(this,la).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=W(this,Vt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=W(this,Vt).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(pa(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return W(this,Vt).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=W(this,Vt).get(r.queryHash),o=a==null?void 0:a.state.data,l=Gv(t,o);if(l!==void 0)return W(this,Vt).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return Ht.batch(()=>W(this,Vt).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=W(this,Vt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=W(this,Vt);Ht.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=W(this,Vt);return Ht.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Ht.batch(()=>W(this,Vt).findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(In).catch(In)}invalidateQueries(e,t={}){return Ht.batch(()=>(W(this,Vt).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Ht.batch(()=>W(this,Vt).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let o=a.fetch(void 0,n);return n.throwOnError||(o=o.catch(In)),a.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(In)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=W(this,Vt).build(this,t);return n.isStaleByTime(pa(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(In).catch(In)}fetchInfiniteQuery(e){return e.behavior=a1(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(In).catch(In)}ensureInfiniteQueryData(e){return e.behavior=a1(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return _c.isOnline()?W(this,la).resumePausedMutations():Promise.resolve()}getQueryCache(){return W(this,Vt)}getMutationCache(){return W(this,la)}getDefaultOptions(){return W(this,ca)}setDefaultOptions(e){ye(this,ca,e)}setQueryDefaults(e,t){W(this,Xi).set(Ka(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...W(this,Xi).values()],n={};return t.forEach(r=>{Nu(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){W(this,Ki).set(Ka(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...W(this,Ki).values()],n={};return t.forEach(r=>{Nu(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...W(this,ca).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=b0(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===x0&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...W(this,ca).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){W(this,Vt).clear(),W(this,la).clear()}},Vt=new WeakMap,la=new WeakMap,ca=new WeakMap,Xi=new WeakMap,Ki=new WeakMap,da=new WeakMap,Ji=new WeakMap,Zi=new WeakMap,vb),Ib=L.createContext(void 0),jr=e=>{const t=L.useContext(Ib);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},yw=({client:e,children:t})=>(L.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),p.jsx(Ib.Provider,{value:e,children:t})),Rb=L.createContext(!1),Lb=()=>L.useContext(Rb);Rb.Provider;function bw(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ew=L.createContext(bw()),Mb=()=>L.useContext(Ew),Pb=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?T0(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Fb=e=>{L.useEffect(()=>{e.clearReset()},[e])},jb=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||T0(n,[e.error,r])),Bb=e=>{if(e.suspense){const n=a=>a==="static"?a:Math.max(a??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...a)=>n(r(...a)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Hb=(e,t)=>e.isLoading&&e.isFetching&&!t,Vh=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Cc=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function u1({queries:e,...t},n){const r=jr(),a=Lb(),o=Mb(),l=L.useMemo(()=>e.map(S=>{const w=r.defaultQueryOptions(S);return w._optimisticResults=a?"isRestoring":"optimistic",w}),[e,r,a]);l.forEach(S=>{Bb(S);const w=r.getQueryCache().get(S.queryHash);Pb(S,o,w)}),Fb(o);const[c]=L.useState(()=>new pw(r,l,t)),[d,h,m]=c.getOptimisticResult(l,t.combine),g=!a&&t.subscribed!==!1;L.useSyncExternalStore(L.useCallback(S=>g?c.subscribe(Ht.batchCalls(S)):In,[c,g]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),L.useEffect(()=>{c.setQueries(l,t)},[l,t,c]);const x=d.some((S,w)=>Vh(l[w],S))?d.flatMap((S,w)=>{const v=l[w];if(v){const k=new w0(r,v);if(Vh(v,S))return Cc(v,k,o);Hb(S,a)&&Cc(v,k,o)}return[]}):[];if(x.length>0)throw Promise.all(x);const C=d.find((S,w)=>{const v=l[w];return v&&jb({result:S,errorResetBoundary:o,throwOnError:v.throwOnError,query:r.getQueryCache().get(v.queryHash),suspense:v.suspense})});if(C!=null&&C.error)throw C.error;return h(m())}function xw(e,t,n){var E,x,C,S;const r=Lb(),a=Mb(),o=jr(),l=o.defaultQueryOptions(e);(x=(E=o.getDefaultOptions().queries)==null?void 0:E._experimental_beforeQuery)==null||x.call(E,l);const c=o.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",Bb(l),Pb(l,a,c),Fb(a);const d=!o.getQueryCache().get(l.queryHash),[h]=L.useState(()=>new t(o,l)),m=h.getOptimisticResult(l),g=!r&&e.subscribed!==!1;if(L.useSyncExternalStore(L.useCallback(w=>{const v=g?h.subscribe(Ht.batchCalls(w)):In;return h.updateResult(),v},[h,g]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),L.useEffect(()=>{h.setOptions(l)},[l,h]),Vh(l,m))throw Cc(l,h,a);if(jb({result:m,errorResetBoundary:a,throwOnError:l.throwOnError,query:c,suspense:l.suspense}))throw m.error;if((S=(C=o.getDefaultOptions().queries)==null?void 0:C._experimental_afterQuery)==null||S.call(C,l,m),l.experimental_prefetchInRender&&!Xa&&Hb(m,r)){const w=d?Cc(l,h,a):c==null?void 0:c.promise;w==null||w.catch(In).finally(()=>{h.updateResult()})}return l.notifyOnChangeProps?m:h.trackResult(m)}function is(e,t){return xw(e,w0)}function Tw(e,t){const n=jr(),r=n.getQueryCache();return L.useSyncExternalStore(L.useCallback(a=>r.subscribe(Ht.batchCalls(a)),[r]),()=>n.isFetching(e),()=>n.isFetching(e))}function vw(e,t){const n=jr(),[r]=L.useState(()=>new fw(n,e));L.useEffect(()=>{r.setOptions(e)},[r,e]);const a=L.useSyncExternalStore(L.useCallback(l=>r.subscribe(Ht.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=L.useCallback((l,c)=>{r.mutate(l,c).catch(In)},[r]);if(a.error&&T0(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:o,mutateAsync:a.mutate}}function ww({children:e}){const[t]=L.useState(()=>new gw({defaultOptions:{queries:{staleTime:3e5,gcTime:18e5,refetchOnWindowFocus:!1,retry:1}}}));return p.jsx(yw,{client:t,children:e})}const Sw="modulepreload",_w=function(e){return"/"+e},l1={},ks=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let l=function(h){return Promise.all(h.map(m=>Promise.resolve(m).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),d=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));a=l(n.map(h=>{if(h=_w(h),h in l1)return;l1[h]=!0;const m=h.endsWith(".css"),g=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${g}`))return;const E=document.createElement("link");if(E.rel=m?"stylesheet":Sw,m||(E.as="script"),E.crossOrigin="",E.href=h,d&&E.setAttribute("nonce",d),document.head.appendChild(E),m)return new Promise((x,C)=>{E.addEventListener("load",x),E.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${h}`)))})}))}function o(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return a.then(l=>{for(const c of l||[])c.status==="rejected"&&o(c.reason);return t().catch(o)})};function Ub(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=Ub(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Bn(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=Ub(e))&&(r&&(r+=" "),r+=t);return r}const _0="/api";class Wu extends Error{constructor(t,n){super(n),this.status=t,this.name="ApiError"}}async function _t(e,t){const n=await fetch(`${_0}${e}`,{credentials:"include",...t,headers:{"Content-Type":"application/json",...t==null?void 0:t.headers}});if(!n.ok){const r=await n.json().catch(()=>({error:"Unknown error"}));throw new Wu(n.status,r.error||`HTTP ${n.status}`)}return n.json()}async function uc(e,t){const n=await fetch(`${_0}${e}`,{credentials:"omit",...t,headers:{"Content-Type":"application/json",...t==null?void 0:t.headers}});if(!n.ok){const r=await n.json().catch(()=>({error:"Unknown error"}));throw new Wu(n.status,r.error||`HTTP ${n.status}`)}return n.json()}const Pt={getHealth:()=>_t("/health"),getConfig:()=>_t("/config"),getChart:e=>_t(`/charts/${encodeURIComponent(e)}`),queryChart:(e,t={},n={})=>_t(`/charts/${encodeURIComponent(e)}/query${n.includeConfig?"?includeConfig=true":""}`,{method:"POST",body:JSON.stringify(t)}),queryChartsBatch:(e,t={})=>_t("/charts/batch",{method:"POST",body:JSON.stringify({charts:e,includeConfig:t.includeConfig})}),invalidateChart:e=>_t(`/charts/${encodeURIComponent(e)}/invalidate`,{method:"POST"}),getParameterOptions:(e,t)=>_t(`/charts/${encodeURIComponent(e)}/parameters/${encodeURIComponent(t)}/options`),getModelOptions:(e,t,n)=>_t(`/models/${encodeURIComponent(e)}/options?value_field=${encodeURIComponent(t)}&label_field=${encodeURIComponent(n)}`),getDashboards:()=>_t("/dashboards"),getDashboard:(e,t)=>{const n=t?`/dashboards/${encodeURIComponent(e)}?branch=${encodeURIComponent(t)}`:`/dashboards/${encodeURIComponent(e)}`;return _t(n)},saveDashboard:(e,t,n,r)=>_t(`/dashboards/${encodeURIComponent(e)}`,{method:"POST",body:JSON.stringify(r?{tab:r,tabLayout:t,message:n}:{layout:t,message:n})}),warmDashboardCache:(e,t={},n)=>_t(`/dashboards/${encodeURIComponent(e)}/warm-cache`,{method:"POST",body:JSON.stringify({params:t,...n?{tab:n}:{}})}),getBranches:()=>_t("/git/branches"),createBranch:(e,t)=>_t("/git/branches",{method:"POST",body:JSON.stringify({name:e,from:t})}),checkoutBranch:e=>_t("/git/checkout",{method:"POST",body:JSON.stringify({branch:e})}),getAuthMe:async()=>{const e=await fetch(`${_0}/auth/me`,{credentials:"include",headers:{"Content-Type":"application/json"}});if(e.status===401)return{providers:(await e.json().catch(()=>({}))).providers};if(!e.ok)throw new Wu(e.status,`HTTP ${e.status}`);return e.json()},authSetup:e=>_t("/auth/setup",{method:"POST",body:JSON.stringify(e)}),authLogin:e=>_t("/auth/login",{method:"POST",body:JSON.stringify(e)}),authLogout:()=>_t("/auth/logout",{method:"POST"}),authChangePassword:e=>_t("/auth/me/password",{method:"PUT",body:JSON.stringify(e)}),authListUsers:()=>_t("/auth/users"),authCreateUser:e=>_t("/auth/users",{method:"POST",body:JSON.stringify(e)}),authUpdateUser:(e,t)=>_t(`/auth/users/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)}),authDeleteUser:e=>_t(`/auth/users/${encodeURIComponent(e)}`,{method:"DELETE"}),createShareLink:e=>_t("/shares",{method:"POST",body:JSON.stringify(e)}),listShareLinks:()=>_t("/shares"),revokeShareLink:e=>_t(`/shares/${encodeURIComponent(e)}`,{method:"DELETE"}),getPublicConfig:e=>uc(`/public/config?share_token=${encodeURIComponent(e)}`),getPublicDashboard:(e,t)=>uc(`/public/dashboards/${encodeURIComponent(e)}?share_token=${encodeURIComponent(t)}`),queryPublicChart:(e,t,n,r=!1)=>{const a=new URLSearchParams({share_token:n});return r&&a.set("includeConfig","true"),uc(`/public/charts/${encodeURIComponent(e)}/query?${a}`,{method:"POST",body:JSON.stringify(t)})},queryPublicChartBatch:(e,t,n=!1)=>uc(`/public/charts/batch?share_token=${encodeURIComponent(t)}`,{method:"POST",body:JSON.stringify({charts:e,includeConfig:n})})};function io(){return is({queryKey:["config"],queryFn:Pt.getConfig,staleTime:1/0})}function Cw(){return is({queryKey:["health"],queryFn:Pt.getHealth,refetchInterval:3e4})}const zb=new Set(["system-ui","serif","sans-serif","monospace","ui-monospace","cursive"]),kw={compact:"13px",default:"14px",comfortable:"16px"},Nw={modern:{colors:{primary:"#3B82F6",background:"#f1f5f9",surface:"#ffffff",sidebar:"#ffffff",text:"#111827"},fonts:{heading:"Inter",body:"Inter",mono:"JetBrains Mono",size:"default"},palette:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#EC4899","#06B6D4","#F97316","#84CC16","#14B8A6"],radius:"8px",shadow:"0 1px 3px rgba(0,0,0,0.1)",cardPadding:"20px",cardBorder:"none",sidebarShow:!0},executive:{colors:{primary:"#0ea5e9",background:"#f8fafc",surface:"#ffffff",sidebar:"#1e293b",text:"#0f172a"},fonts:{heading:"system-ui",body:"system-ui",mono:"ui-monospace",size:"compact"},palette:["#1e3a5f","#0d9488","#d97706","#64748b","#9f1239","#4338ca","#0369a1","#b45309","#475569","#7c3aed"],radius:"2px",shadow:"none",cardPadding:"16px",cardBorder:"1px solid #e2e8f0",sidebarShow:!0},minimal:{colors:{primary:"#6366f1",background:"#f8fafc",surface:"#ffffff",sidebar:"#f1f5f9",text:"#1e293b"},fonts:{heading:"system-ui",body:"system-ui",mono:"JetBrains Mono",size:"comfortable"},palette:["#3b82f6","#2563eb","#1d4ed8","#1e40af","#10b981","#059669","#047857","#065f46","#6366f1","#4f46e5"],radius:"0px",shadow:"none",cardPadding:"12px",cardBorder:"none",sidebarShow:!1}};function Ow(e){const t=parseInt(e.replace("#",""),16),n=(t>>16)/255,r=(t>>8&255)/255,a=(t&255)/255,o=l=>l<=.03928?l/12.92:((l+.055)/1.055)**2.4;return .2126*o(n)+.7152*o(r)+.0722*o(a)}function c1(e,t){const n=parseInt(e.replace("#",""),16),r=Math.min(255,Math.max(0,(n>>16)+Math.round(2.55*t))),a=Math.min(255,Math.max(0,(n>>8&255)+Math.round(2.55*t))),o=Math.min(255,Math.max(0,(n&255)+Math.round(2.55*t)));return`#${((1<<24)+(r<<16)+(a<<8)+o).toString(16).slice(1)}`}function Xf(e){return zb.has(e)?`${e}, sans-serif`:e.toLowerCase().includes("mono")?`'${e}', monospace`:`'${e}', system-ui, sans-serif`}function Dw(e){var A,P,_,N,I,F,j,M,H,$,G,J;const t=e.base??"modern",n=Nw[t],r=((A=e.colors)==null?void 0:A.primary)??n.colors.primary,a=((P=e.colors)==null?void 0:P.background)??n.colors.background,o=((_=e.colors)==null?void 0:_.surface)??n.colors.surface,l=((N=e.colors)==null?void 0:N.sidebar)??n.colors.sidebar,c=((I=e.colors)==null?void 0:I.text)??n.colors.text,d=((F=e.fonts)==null?void 0:F.heading)??n.fonts.heading,h=((j=e.fonts)==null?void 0:j.body)??n.fonts.body,m=((M=e.fonts)==null?void 0:M.mono)??n.fonts.mono,g=kw[((H=e.fonts)==null?void 0:H.size)??n.fonts.size]??"14px",E=e.palette??n.palette,x=new Set;for(const Q of[d,h,m])!zb.has(Q)&&Q!=="ui-monospace"&&x.add(Q);const C=x.size>0?`https://fonts.googleapis.com/css2?${[...x].map(Q=>`family=${encodeURIComponent(Q)}:wght@400;500;600;700`).join("&")}&display=swap`:null,S=Ow(l)<.2,w=S?"#f1f5f9":c,v=S?"#94a3b8":"#6b7280",k=S?"rgba(255,255,255,0.1)":"#e5e7eb",O={"--yc-color-primary":r,"--yc-color-primary-light":c1(r,20),"--yc-color-primary-dark":c1(r,-15),"--yc-color-background":a,"--yc-color-surface":o,"--yc-color-sidebar":l,"--yc-color-text":c,"--yc-color-text-secondary":"#6b7280","--yc-color-border":"#e5e7eb","--yc-color-sidebar-text":w,"--yc-color-sidebar-text-secondary":v,"--yc-color-sidebar-border":k,"--yc-font-heading":Xf(d),"--yc-font-body":Xf(h),"--yc-font-mono":Xf(m),"--yc-font-size-base":g,"--yc-radius":n.radius,"--yc-shadow":n.shadow,"--yc-card-padding":n.cardPadding,"--yc-card-border":n.cardBorder,"--yc-grid-gap":"16px","--yc-topbar-height":"40px"};return{base:t,cssVars:O,palette:E,sidebarShow:(($=e.sidebar)==null?void 0:$.show)??n.sidebarShow,sidebarLinks:(G=e.sidebar)==null?void 0:G.links,sidebarSections:(J=e.sidebar)==null?void 0:J.sections,logo:e.logo,favicon:e.favicon,title:e.title,customCss:e.customCss,googleFontsUrl:C}}const Wb=L.createContext(null);function Aw({children:e}){const{data:t}=io(),n=L.useMemo(()=>Dw((t==null?void 0:t.theme)??{}),[t==null?void 0:t.theme]);return L.useEffect(()=>{const r=document.documentElement;for(const[a,o]of Object.entries(n.cssVars))r.style.setProperty(a,o);return()=>{for(const a of Object.keys(n.cssVars))r.style.removeProperty(a)}},[n.cssVars]),L.useEffect(()=>{if(!n.googleFontsUrl)return;const r="yc-google-fonts";let a=document.getElementById(r);return a||(a=document.createElement("link"),a.id=r,a.rel="stylesheet",document.head.appendChild(a)),a.href=n.googleFontsUrl,()=>{a==null||a.remove()}},[n.googleFontsUrl]),L.useEffect(()=>{if(!n.customCss)return;const r="yc-custom-css";let a=document.getElementById(r);return a||(a=document.createElement("link"),a.id=r,a.rel="stylesheet",document.head.appendChild(a)),a.href="/api/theme/custom.css",()=>{a==null||a.remove()}},[n.customCss]),L.useEffect(()=>{const r=n.title||(t==null?void 0:t.name)||"Yamchart";document.title=r},[n.title,t==null?void 0:t.name]),L.useEffect(()=>{if(!n.favicon)return;const r="yc-favicon";let a=document.querySelector(`link#${r}`);a||(a=document.createElement("link"),a.id=r,a.rel="icon",document.head.appendChild(a)),a.href=`/api/assets/${n.favicon.replace(/^\.\/assets\//,"")}`},[n.favicon]),p.jsx(Wb.Provider,{value:n,children:e})}function C0(){const e=L.useContext(Wb);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const d1="yamchart-sidebar-folders";function Iw(e){return e?e.replace(/[-_]/g," ").replace(/\b\w/g,t=>t.toUpperCase()):"Ungrouped"}function f1(e){const t=new Map;for(const r of e){const a=r.folder??"";t.has(a)||t.set(a,[]),t.get(a).push(r)}const n=[];for(const[r,a]of t)a.sort((o,l)=>{const c=o.title||o.name,d=l.title||l.name;return c.localeCompare(d)}),n.push({folder:r,label:Iw(r),items:a});return n.sort((r,a)=>!r.folder&&!a.folder?0:r.folder?a.folder?r.label.localeCompare(a.label):-1:1),n}function h1({type:e,className:t,style:n}){const r={className:t,style:n,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},a={strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5};switch(e){case"bar":return p.jsx("svg",{...r,children:p.jsx("path",{...a,d:"M3 20h18M5 20V10h3v10M10 20V4h3v16M15 20v-8h3v8"})});case"line":return p.jsx("svg",{...r,children:p.jsx("path",{...a,d:"M3 20h18M4 16l4-6 4 4 4-8 4 6"})});case"area":return p.jsxs("svg",{...r,children:[p.jsx("path",{...a,d:"M3 20h18"}),p.jsx("path",{...a,d:"M4 16l4-6 4 4 4-8 4 6v8H4z",fill:"currentColor",opacity:.15}),p.jsx("path",{...a,d:"M4 16l4-6 4 4 4-8 4 6"})]});case"pie":return p.jsxs("svg",{...r,children:[p.jsx("path",{...a,d:"M12 2a10 10 0 110 20 10 10 0 010-20z"}),p.jsx("path",{...a,d:"M12 2v10l8.66 5"})]});case"donut":return p.jsxs("svg",{...r,children:[p.jsx("circle",{...a,cx:"12",cy:"12",r:"10"}),p.jsx("circle",{...a,cx:"12",cy:"12",r:"5"}),p.jsx("path",{...a,d:"M12 2v5M22 12h-5"})]});case"scatter":return p.jsxs("svg",{...r,children:[p.jsx("path",{...a,d:"M3 20h18M3 20V4"}),p.jsx("circle",{cx:"7",cy:"15",r:"1.5",fill:"currentColor"}),p.jsx("circle",{cx:"10",cy:"10",r:"1.5",fill:"currentColor"}),p.jsx("circle",{cx:"13",cy:"13",r:"1.5",fill:"currentColor"}),p.jsx("circle",{cx:"15",cy:"7",r:"1.5",fill:"currentColor"}),p.jsx("circle",{cx:"18",cy:"9",r:"1.5",fill:"currentColor"})]});case"combo":return p.jsxs("svg",{...r,children:[p.jsx("path",{...a,d:"M3 20h18"}),p.jsx("path",{...a,d:"M5 20v-6h3v6M10 20v-10h3v10"}),p.jsx("path",{...a,d:"M5 10l4-3 4 2 5-5"})]});case"heatmap":return p.jsxs("svg",{...r,children:[p.jsx("rect",{...a,x:"3",y:"3",width:"5",height:"5",rx:"1",fill:"currentColor",opacity:.2}),p.jsx("rect",{...a,x:"10",y:"3",width:"5",height:"5",rx:"1",fill:"currentColor",opacity:.6}),p.jsx("rect",{...a,x:"17",y:"3",width:"4",height:"5",rx:"1",fill:"currentColor",opacity:.4}),p.jsx("rect",{...a,x:"3",y:"10",width:"5",height:"5",rx:"1",fill:"currentColor",opacity:.8}),p.jsx("rect",{...a,x:"10",y:"10",width:"5",height:"5",rx:"1",fill:"currentColor",opacity:.3}),p.jsx("rect",{...a,x:"17",y:"10",width:"4",height:"5",rx:"1",fill:"currentColor",opacity:.9}),p.jsx("rect",{...a,x:"3",y:"17",width:"5",height:"4",rx:"1",fill:"currentColor",opacity:.5}),p.jsx("rect",{...a,x:"10",y:"17",width:"5",height:"4",rx:"1",fill:"currentColor",opacity:.7}),p.jsx("rect",{...a,x:"17",y:"17",width:"4",height:"4",rx:"1",fill:"currentColor",opacity:.1})]});case"funnel":return p.jsx("svg",{...r,children:p.jsx("path",{...a,d:"M3 4h18l-3 5H6L3 4zM6 9h12l-2 5H8L6 9zM8 14h8l-2 5h-4l-2-5z"})});case"waterfall":return p.jsxs("svg",{...r,children:[p.jsx("path",{...a,d:"M3 20h18"}),p.jsx("path",{...a,d:"M5 8h3v4H5zM9 6h3v2H9zM13 10h3v4h-3zM17 6h3v8h-3"}),p.jsx("path",{...a,d:"M8 10h1M12 8h1",strokeDasharray:"2 1"})]});case"gauge":return p.jsxs("svg",{...r,children:[p.jsx("path",{...a,d:"M4.93 17.07A10 10 0 0112 2a10 10 0 017.07 15.07"}),p.jsx("path",{...a,d:"M12 12l-3-6",strokeWidth:2}),p.jsx("circle",{cx:"12",cy:"12",r:"2",fill:"currentColor"})]});case"kpi":case"metric":return p.jsxs("svg",{...r,children:[p.jsx("path",{...a,d:"M4 6h16M4 6v12a2 2 0 002 2h12a2 2 0 002-2V6"}),p.jsx("path",{...a,d:"M9 11h6M12 11v5",strokeWidth:2})]});case"table":return p.jsx("svg",{...r,children:p.jsx("path",{...a,d:"M3 5h18M3 10h18M3 15h18M3 20h18M8 5v15M15 5v15"})});default:return p.jsx("svg",{...r,children:p.jsx("path",{...a,d:"M7 12l3-3 3 3 4-4M8 21l4-4 4 4M3 4h18M4 4h16v12a1 1 0 01-1 1H5a1 1 0 01-1-1V4z"})})}}function p1({expanded:e,className:t,style:n}){return p.jsx("svg",{className:Bn("w-3.5 h-3.5 transition-transform",e&&"rotate-90",t),style:n,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}function Rw({dashboards:e,charts:t,currentPath:n,onNavigate:r}){var A,P;const a=C0(),o=n.split("?")[0],l=_=>o===_,c=((A=a.sidebarSections)==null?void 0:A.dashboards)!==!1,d=((P=a.sidebarSections)==null?void 0:P.charts)!==!1,h={backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",color:"var(--yc-color-primary)",borderColor:"var(--yc-color-primary)"},m=L.useMemo(()=>f1(e),[e]),g=L.useMemo(()=>f1(t),[t]),E=L.useMemo(()=>{for(const _ of e)if(l(`/dashboards/${_.name}`))return _.folder??"";return null},[e,o]),x=L.useMemo(()=>{for(const _ of t)if(l(`/charts/${_.name}`))return _.folder??"";return null},[t,o]),[C,S]=L.useState(()=>{try{const _=localStorage.getItem(d1);return _?JSON.parse(_):{}}catch{return{}}});L.useEffect(()=>{try{localStorage.setItem(d1,JSON.stringify(C))}catch{}},[C]);const w=L.useCallback((_,N)=>{const I=`${_}:${N}`;return _==="dashboards"&&E===N||_==="charts"&&x===N?!0:C[I]??!1},[C,E,x]),v=L.useCallback((_,N)=>{const I=`${_}:${N}`,F=_==="dashboards"&&E===N||_==="charts"&&x===N;S(j=>{const M=j[I]??F;return{...j,[I]:!M}})},[E,x]),k=m.length>1||m.some(_=>_.folder!==""),O=g.length>1||g.some(_=>_.folder!=="");return p.jsxs("aside",{className:"yc-sidebar w-56 border-r flex flex-col",style:{backgroundColor:"var(--yc-color-sidebar)",borderColor:"var(--yc-color-sidebar-border)"},children:[c&&e.length>0&&p.jsxs("div",{className:"py-2",children:[p.jsx("div",{className:"px-4 py-2 text-xs font-medium uppercase tracking-wider",style:{color:"var(--yc-color-sidebar-text-secondary)"},children:"Dashboards"}),k?m.map(_=>{const N=w("dashboards",_.folder);return p.jsxs("div",{children:[p.jsxs("button",{onClick:()=>v("dashboards",_.folder),className:"w-full flex items-center gap-2 px-4 py-1.5 text-xs font-medium hover:bg-white/5 transition-colors",style:{color:"var(--yc-color-sidebar-text-secondary)"},children:[p.jsx(p1,{expanded:N}),p.jsx("span",{className:"truncate",children:_.label}),p.jsx("span",{className:"ml-auto opacity-50",children:_.items.length})]}),N&&_.items.map(I=>{const F=`/dashboards/${I.name}`,j=l(F);return p.jsxs("button",{onClick:()=>r(F),className:Bn("w-full flex items-center gap-3 pl-8 pr-4 py-2 text-sm transition-colors",j&&"border-r-2"),style:j?h:{color:"var(--yc-color-sidebar-text)"},title:I.title,children:[p.jsx("svg",{className:"w-5 h-5 flex-shrink-0",style:{color:j?"var(--yc-color-primary)":"var(--yc-color-sidebar-text-secondary)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"})}),p.jsx("span",{className:"truncate",children:I.title})]},I.name)})]},_.folder)}):e.map(_=>{const N=`/dashboards/${_.name}`,I=l(N);return p.jsxs("button",{onClick:()=>r(N),className:Bn("w-full flex items-center gap-3 px-4 py-2 text-sm transition-colors",I&&"border-r-2"),style:I?h:{color:"var(--yc-color-sidebar-text)"},title:_.title,children:[p.jsx("svg",{className:"w-5 h-5 flex-shrink-0",style:{color:I?"var(--yc-color-primary)":"var(--yc-color-sidebar-text-secondary)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"})}),p.jsx("span",{className:"truncate",children:_.title})]},_.name)})]}),c&&d&&e.length>0&&t.length>0&&p.jsx("div",{className:"mx-4 border-t",style:{borderColor:"var(--yc-color-sidebar-border)"}}),d&&t.length>0&&p.jsxs("div",{className:"py-2 flex-1 overflow-y-auto",children:[p.jsx("div",{className:"px-4 py-2 text-xs font-medium uppercase tracking-wider",style:{color:"var(--yc-color-sidebar-text-secondary)"},children:"Charts"}),O?g.map(_=>{const N=w("charts",_.folder);return p.jsxs("div",{children:[p.jsxs("button",{onClick:()=>v("charts",_.folder),className:"w-full flex items-center gap-2 px-4 py-1.5 text-xs font-medium hover:bg-white/5 transition-colors",style:{color:"var(--yc-color-sidebar-text-secondary)"},children:[p.jsx(p1,{expanded:N}),p.jsx("span",{className:"truncate",children:_.label}),p.jsx("span",{className:"ml-auto opacity-50",children:_.items.length})]}),N&&_.items.map(I=>{const F=`/charts/${I.name}`,j=l(F);return p.jsxs("button",{onClick:()=>r(F),className:Bn("w-full flex items-center gap-3 pl-8 pr-4 py-2 text-sm transition-colors",j&&"border-r-2"),style:j?h:{color:"var(--yc-color-sidebar-text)"},title:I.title,children:[p.jsx(h1,{type:I.type,className:"w-5 h-5 flex-shrink-0",style:{color:j?"var(--yc-color-primary)":"var(--yc-color-sidebar-text-secondary)"}}),p.jsx("span",{className:"truncate",children:I.title})]},I.name)})]},_.folder)}):t.map(_=>{const N=`/charts/${_.name}`,I=l(N);return p.jsxs("button",{onClick:()=>r(N),className:Bn("w-full flex items-center gap-3 px-4 py-2 text-sm transition-colors",I&&"border-r-2"),style:I?h:{color:"var(--yc-color-sidebar-text)"},title:_.title,children:[p.jsx(h1,{type:_.type,className:"w-5 h-5 flex-shrink-0",style:{color:I?"var(--yc-color-primary)":"var(--yc-color-sidebar-text-secondary)"}}),p.jsx("span",{className:"truncate",children:_.title})]},_.name)})]}),a.sidebarLinks&&a.sidebarLinks.length>0&&p.jsx("div",{className:"py-2 border-t",style:{borderColor:"var(--yc-color-sidebar-border)"},children:a.sidebarLinks.map(_=>p.jsxs("a",{href:_.url,target:"_blank",rel:"noopener noreferrer",className:"w-full flex items-center gap-3 px-4 py-2 text-sm transition-colors hover:bg-white/10",style:{color:"var(--yc-color-sidebar-text-secondary)"},children:[p.jsx("svg",{className:"w-5 h-5 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})}),p.jsx("span",{className:"truncate",children:_.label})]},_.url))})]})}function Yb(e){return is({queryKey:["chart",e],queryFn:()=>Pt.getChart(e),enabled:!!e,staleTime:1e3*60*10})}const m1=e=>{let t;const n=new Set,r=(h,m)=>{const g=typeof h=="function"?h(t):h;if(!Object.is(g,t)){const E=t;t=m??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(x=>x(t,E))}},a=()=>t,c={setState:r,getState:a,getInitialState:()=>d,subscribe:h=>(n.add(h),()=>n.delete(h))},d=t=e(r,a,c);return c},Lw=(e=>e?m1(e):m1),Mw=e=>e;function Pw(e,t=Mw){const n=Ee.useSyncExternalStore(e.subscribe,Ee.useCallback(()=>t(e.getState()),[e,t]),Ee.useCallback(()=>t(e.getInitialState()),[e,t]));return Ee.useDebugValue(n),n}const g1=e=>{const t=Lw(e),n=r=>Pw(t,r);return Object.assign(n,t),n},qb=(e=>e?g1(e):g1),qe=qb((e,t)=>({globalFilters:{},chartFilters:{},crossFilters:{},setGlobalFilter:(n,r)=>e(a=>({globalFilters:{...a.globalFilters,[n]:r}})),setChartFilter:(n,r,a)=>e(o=>({chartFilters:{...o.chartFilters,[n]:{...o.chartFilters[n],[r]:a}}})),setCrossFilter:(n,r,a)=>e(o=>{const l=o.crossFilters[n];if(l&&l.value===r){const{[n]:c,...d}=o.crossFilters;return{crossFilters:d}}return{crossFilters:{...o.crossFilters,[n]:{field:n,value:r,sourceChart:a}}}}),clearCrossFilter:n=>e(r=>{const{[n]:a,...o}=r.crossFilters;return{crossFilters:o}}),clearAllCrossFilters:()=>e({crossFilters:{}}),getEffectiveFilters:n=>{const{globalFilters:r,crossFilters:a,chartFilters:o}=t(),l={};for(const c of Object.values(a))c.sourceChart!==n&&(l[c.field]=c.value);return{...r,...l,...o[n]}},resetFilters:()=>e({globalFilters:{},chartFilters:{},crossFilters:{}}),resetChartFilters:n=>e(r=>{const{[n]:a,...o}=r.chartFilters;return{chartFilters:o}})}));function $b(e){const t=qe(l=>l.globalFilters),n=qe(l=>l.chartFilters),r=qe(l=>l.crossFilters),a=qe(l=>l.getEffectiveFilters),o=L.useMemo(()=>Object.fromEntries(Object.entries(a(e)).filter(([l,c])=>c!=null)),[t,n,r,e]);return is({queryKey:["chartData",e,o],queryFn:()=>Pt.queryChart(e,o),enabled:!!e})}function Fw(e){const t=qe(l=>l.globalFilters),n=qe(l=>l.chartFilters),r=qe(l=>l.crossFilters),a=qe(l=>l.getEffectiveFilters),o=L.useMemo(()=>Object.fromEntries(Object.entries(a(e)).filter(([l,c])=>c!=null)),[t,n,r,e]);return is({queryKey:["chartWithData",e,o],queryFn:()=>Pt.queryChart(e,o,{includeConfig:!0}),enabled:!!e})}function k0(){const e=jr();return t=>{e.invalidateQueries({queryKey:["chartData",t]}),e.invalidateQueries({queryKey:["chartWithData",t]})}}function Vb(){return is({queryKey:["dashboards"],queryFn:()=>Pt.getDashboards()})}function y1(e){const t=[];for(const n of e.rows)for(const r of n.widgets)r.type==="chart"&&r.ref&&t.push(r.ref);return t}function jw(e){return e.tabs?e.tabs[0]?y1(e.tabs[0].layout):[]:e.layout?y1(e.layout):[]}function Bw(e,t){var o,l,c;const n=jr(),r=qe(d=>d.globalFilters),a=is({queryKey:["dashboard",e,t],queryFn:()=>Pt.getDashboard(e,t),enabled:!!e});return L.useEffect(()=>{var d,h,m,g,E;if((d=a.data)!=null&&d.name&&((h=a.data)!=null&&h.layout||(m=a.data)!=null&&m.tabs)){const x=jw(a.data);(E=(g=a.data.tabs)==null?void 0:g[0])==null||E.name;const C=Object.fromEntries(Object.entries(r).filter(([S,w])=>w!=null));x.forEach(S=>{n.prefetchQuery({queryKey:["chartWithData",S,C],queryFn:()=>Pt.queryChart(S,C,{includeConfig:!0}),staleTime:1e3*60*5})})}},[(o=a.data)==null?void 0:o.layout,(l=a.data)==null?void 0:l.tabs,(c=a.data)==null?void 0:c.name,r,n]),a}function Hw(e){const t=jr();return vw({mutationFn:({layout:n,message:r,tab:a})=>Pt.saveDashboard(e,n,r,a),onSuccess:()=>{t.invalidateQueries({queryKey:["dashboard",e]})}})}function Uw(){const e=jr();return()=>{e.invalidateQueries({queryKey:["chartData"]}),e.invalidateQueries({queryKey:["chartWithData"]})}}function zw(){const e=jr();L.useRef(1e3),L.useEffect(()=>{},[e])}function Ww({connection:e}){return p.jsxs("div",{className:"absolute right-0 top-full mt-2 z-50 min-w-[200px] bg-gray-900 text-white text-xs rounded-lg shadow-lg p-3 opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-200",children:[p.jsx("div",{className:"absolute -top-1 right-4 w-2 h-2 bg-gray-900 rotate-45"}),p.jsxs("div",{className:"space-y-1.5",children:[p.jsxs("div",{className:"flex justify-between gap-4",children:[p.jsx("span",{className:"text-gray-400",children:"Name"}),p.jsx("span",{className:"font-medium",children:e.name})]}),p.jsxs("div",{className:"flex justify-between gap-4",children:[p.jsx("span",{className:"text-gray-400",children:"Type"}),p.jsx("span",{className:"font-medium capitalize",children:e.type})]}),(e.type==="duckdb"||e.type==="sqlite")&&e.path&&p.jsxs("div",{className:"flex justify-between gap-4",children:[p.jsx("span",{className:"text-gray-400",children:"Path"}),p.jsx("span",{className:"font-medium truncate max-w-[120px]",title:e.path,children:e.path})]}),(e.type==="postgres"||e.type==="mysql")&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"flex justify-between gap-4",children:[p.jsx("span",{className:"text-gray-400",children:"Host"}),p.jsxs("span",{className:"font-medium",children:[e.host,":",e.port]})]}),p.jsxs("div",{className:"flex justify-between gap-4",children:[p.jsx("span",{className:"text-gray-400",children:"Database"}),p.jsx("span",{className:"font-medium",children:e.database})]}),e.schema&&p.jsxs("div",{className:"flex justify-between gap-4",children:[p.jsx("span",{className:"text-gray-400",children:"Schema"}),p.jsx("span",{className:"font-medium",children:e.schema})]})]}),e.type==="snowflake"&&p.jsxs(p.Fragment,{children:[e.account&&p.jsxs("div",{className:"flex justify-between gap-4",children:[p.jsx("span",{className:"text-gray-400",children:"Account"}),p.jsx("span",{className:"font-medium truncate max-w-[120px]",title:e.account,children:e.account})]}),e.warehouse&&p.jsxs("div",{className:"flex justify-between gap-4",children:[p.jsx("span",{className:"text-gray-400",children:"Warehouse"}),p.jsx("span",{className:"font-medium",children:e.warehouse})]}),e.database&&p.jsxs("div",{className:"flex justify-between gap-4",children:[p.jsx("span",{className:"text-gray-400",children:"Database"}),p.jsx("span",{className:"font-medium",children:e.database})]}),e.schema&&p.jsxs("div",{className:"flex justify-between gap-4",children:[p.jsx("span",{className:"text-gray-400",children:"Schema"}),p.jsx("span",{className:"font-medium",children:e.schema})]}),e.role&&p.jsxs("div",{className:"flex justify-between gap-4",children:[p.jsx("span",{className:"text-gray-400",children:"Role"}),p.jsx("span",{className:"font-medium",children:e.role})]})]})]})]})}function Yw({status:e,connection:t}){return p.jsxs("div",{className:"relative group",children:[p.jsxs("div",{className:"flex items-center gap-2 cursor-default",children:[p.jsx("span",{className:`w-2 h-2 rounded-full ${e==="ok"?"bg-green-500":"bg-red-500"}`}),p.jsx("span",{className:"text-sm text-gray-600",children:e==="ok"?"Connected":"Disconnected"})]}),t&&p.jsx(Ww,{connection:t})]})}const eo=qb(e=>({auth:{status:"loading"},providers:[],checkAuth:async()=>{try{const t=await Pt.getAuthMe(),n=t.providers??[];t.needsSetup?e({auth:{status:"needs_setup"},providers:n}):t.user?e({auth:{status:"authenticated",user:t.user},providers:n}):e({auth:{status:"unauthenticated"},providers:n})}catch(t){t instanceof Wu?t.status===404?e({auth:{status:"disabled"},providers:[]}):e({auth:{status:"disabled"},providers:[]}):e({auth:{status:"disabled"},providers:[]})}},login:async(t,n)=>{const{user:r}=await Pt.authLogin({email:t,password:n});e({auth:{status:"authenticated",user:r}})},setup:async(t,n,r)=>{const{user:a}=await Pt.authSetup({email:t,name:n,password:r});e({auth:{status:"authenticated",user:a}})},logout:async()=>{await Pt.authLogout(),e({auth:{status:"unauthenticated"}})}}));function qw({onClose:e}){const[t,n]=L.useState(""),[r,a]=L.useState(""),[o,l]=L.useState(""),[c,d]=L.useState(""),[h,m]=L.useState(!1),[g,E]=L.useState(!1),x=async C=>{if(C.preventDefault(),d(""),r!==o){d("New passwords do not match");return}if(r.length<8){d("Password must be at least 8 characters");return}E(!0);try{await Pt.authChangePassword({current_password:t,new_password:r}),m(!0),setTimeout(e,1500)}catch(S){d(S instanceof Wu?S.message:"An error occurred")}finally{E(!1)}};return p.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:e,children:p.jsxs("div",{className:"bg-white rounded-lg shadow-lg p-6 w-full max-w-md",onClick:C=>C.stopPropagation(),children:[p.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Change Password"}),h?p.jsx("div",{className:"bg-green-50 border border-green-200 text-green-700 text-sm rounded-md px-4 py-3",children:"Password changed successfully."}):p.jsxs("form",{onSubmit:x,className:"space-y-4",children:[c&&p.jsx("div",{className:"bg-red-50 border border-red-200 text-red-700 text-sm rounded-md px-4 py-3",children:c}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Current Password"}),p.jsx("input",{type:"password",value:t,onChange:C=>n(C.target.value),required:!0,className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"New Password"}),p.jsx("input",{type:"password",value:r,onChange:C=>a(C.target.value),required:!0,minLength:8,className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Confirm New Password"}),p.jsx("input",{type:"password",value:o,onChange:C=>l(C.target.value),required:!0,className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),p.jsxs("div",{className:"flex justify-end gap-3",children:[p.jsx("button",{type:"button",onClick:e,className:"px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-md",children:"Cancel"}),p.jsx("button",{type:"submit",disabled:g,className:"px-4 py-2 text-sm bg-blue-600 text-white rounded-md hover:bg-blue-700 disabled:opacity-50",children:g?"Saving...":"Change Password"})]})]})]})})}function $w({onNavigateToUsers:e,onNavigateToShares:t}){const n=eo(h=>h.auth),r=eo(h=>h.logout),[a,o]=L.useState(!1),[l,c]=L.useState(!1),d=L.useRef(null);return L.useEffect(()=>{const h=m=>{d.current&&!d.current.contains(m.target)&&o(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[]),n.status!=="authenticated"?null:p.jsxs("div",{className:"relative",ref:d,children:[p.jsxs("button",{onClick:()=>o(!a),className:"flex items-center gap-2 text-sm text-gray-700 hover:text-gray-900 px-2 py-1 rounded-md hover:bg-gray-100",children:[p.jsx("span",{className:"w-7 h-7 bg-blue-100 text-blue-700 rounded-full flex items-center justify-center text-xs font-medium",children:n.user.name.charAt(0).toUpperCase()}),p.jsx("span",{children:n.user.name})]}),a&&p.jsxs("div",{className:"absolute right-0 mt-1 w-48 bg-white border border-gray-200 rounded-md shadow-lg py-1 z-50",children:[p.jsx("div",{className:"px-4 py-2 text-xs text-gray-500 border-b border-gray-100",children:n.user.email}),n.user.role==="admin"&&p.jsxs(p.Fragment,{children:[p.jsx("button",{onClick:()=>{o(!1),e()},className:"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100",children:"User Management"}),t&&p.jsx("button",{onClick:()=>{o(!1),t()},className:"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100",children:"Shared Links"})]}),p.jsx("button",{onClick:()=>{o(!1),c(!0)},className:"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100",children:"Change Password"}),p.jsx("button",{onClick:()=>{o(!1),r()},className:"w-full text-left px-4 py-2 text-sm text-red-600 hover:bg-gray-100",children:"Sign Out"})]}),l&&p.jsx(qw,{onClose:()=>c(!1)})]})}function Vw({onToggleSidebar:e,currentPath:t,onNavigateToUsers:n,onNavigateToShares:r}){const a=C0(),{data:o}=Cw(),l=eo(h=>h.auth),c=t.replace(/\?.*$/,"").replace(/^\//,"").split("/").filter(Boolean).map(h=>decodeURIComponent(h).replace(/-/g," ").replace(/\b\w/g,m=>m.toUpperCase())),d=typeof a.logo=="string"?`/api/assets/${a.logo.replace(/^\.\/assets\//,"")}`:a.logo?`/api/assets/${a.logo.light.replace(/^\.\/assets\//,"")}`:null;return p.jsxs("header",{className:"yc-topbar flex items-center justify-between px-4 border-b flex-shrink-0",style:{height:"var(--yc-topbar-height)",backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx("button",{onClick:e,className:"p-1.5 rounded hover:bg-black/5 transition-colors",title:"Toggle sidebar",children:p.jsx("svg",{className:"w-5 h-5",style:{color:"var(--yc-color-text-secondary)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),d&&p.jsx("img",{src:d,alt:"",className:"h-6 w-auto"}),p.jsx("nav",{className:"flex items-center gap-1.5 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:c.map((h,m)=>p.jsxs("span",{className:"flex items-center gap-1.5",children:[m>0&&p.jsx("span",{children:"/"}),p.jsx("span",{className:m===c.length-1?"font-medium":"",style:m===c.length-1?{color:"var(--yc-color-text)"}:void 0,children:h})]},m))})]}),p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(Yw,{status:o==null?void 0:o.status,connection:o==null?void 0:o.connection}),p.jsxs("span",{className:"text-xs",style:{color:"var(--yc-color-text-secondary)"},children:["v",o==null?void 0:o.version]}),l.status==="authenticated"&&n&&p.jsx($w,{onNavigateToUsers:n,onNavigateToShares:r})]})]})}const b1="yamchart-sidebar-hidden";function Qw({children:e,currentPath:t,onNavigate:n,onNavigateToUsers:r,onNavigateToShares:a}){const{data:o}=io(),{data:l}=Vb(),c=C0(),d=(o==null?void 0:o.charts)||[],h=l||[],[m,g]=L.useState(()=>c.sidebarShow?localStorage.getItem(b1)==="true":!0),E=L.useCallback(()=>{g(x=>{const C=!x;return localStorage.setItem(b1,String(C)),C})},[]);return p.jsxs("div",{className:"flex h-screen",style:{backgroundColor:"var(--yc-color-background)"},children:[!m&&p.jsx(Rw,{dashboards:h,charts:d,currentPath:t,onNavigate:n}),p.jsxs("div",{className:"flex-1 flex flex-col min-w-0 overflow-hidden",children:[p.jsx(Vw,{onToggleSidebar:E,currentPath:t,onNavigateToUsers:r,onNavigateToShares:a}),p.jsx("main",{className:"flex-1 overflow-auto",children:e})]})]})}function Gw(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const Kf={},bu={};function Pa(e,t){try{const r=(Kf[e]||(Kf[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return r in bu?bu[r]:E1(r,r.split(":"))}catch{if(e in bu)return bu[e];const n=e==null?void 0:e.match(Xw);return n?E1(e,n.slice(1)):NaN}}const Xw=/([+-]\d\d):?(\d\d)?/;function E1(e,t){const n=+(t[0]||0),r=+(t[1]||0),a=+(t[2]||0)/60;return bu[e]=n*60+r>0?n*60+r+a:n*60-r-a}class rs extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Pa(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),Qb(this),Qh(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new rs(...n,t):new rs(Date.now(),t)}withTimeZone(t){return new rs(+this,t)}getTimezoneOffset(){const t=-Pa(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Qh(this),+this}[Symbol.for("constructDateFrom")](t){return new rs(+new Date(t),this.timeZone)}}const x1=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!x1.test(e))return;const t=e.replace(x1,"$1UTC");rs.prototype[t]&&(e.startsWith("get")?rs.prototype[e]=function(){return this.internal[t]()}:(rs.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),Kw(this),+this},rs.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Qh(this),+this}))});function Qh(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-Pa(e.timeZone,e)*60))}function Kw(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),Qb(e)}function Qb(e){const t=Pa(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const a=-new Date(+e).getTimezoneOffset(),o=-new Date(+r).getTimezoneOffset(),l=a-o,c=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();l&&c&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+l);const d=a-n;d&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+d);const h=new Date(+e);h.setUTCSeconds(0);const m=a>0?h.getSeconds():(h.getSeconds()-60)%60,g=Math.round(-(Pa(e.timeZone,e)*60))%60;(g||m)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+g),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+g+m));const E=Pa(e.timeZone,e),x=E>0?Math.floor(E):Math.ceil(E),S=-new Date(+e).getTimezoneOffset()-x,w=x!==n,v=S-d;if(w&&v){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+v);const k=Pa(e.timeZone,e),O=k>0?Math.floor(k):Math.ceil(k),A=x-O;A&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+A),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+A))}}class Rn extends rs{static tz(t,...n){return n.length?new Rn(...n,t):new Rn(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),a=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+a}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,a]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${r} ${n} ${a}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,a]=this.tzComponents();return`${t} GMT${n}${r}${a} (${Gw(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),a=String(Math.abs(t)%60).padStart(2,"0");return[n,r,a]}withTimeZone(t){return new Rn(+this,t)}[Symbol.for("constructDateFrom")](t){return new Rn(+new Date(t),this.timeZone)}}const Gb=6048e5,Jw=864e5,N0=6e4,O0=36e5,Zw=1e3,T1=Symbol.for("constructDateFrom");function ht(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&T1 in e?e[T1](t):e instanceof Date?new e.constructor(t):new Date(t)}function Ke(e,t){return ht(t||e,e)}function Ja(e,t,n){const r=Ke(e,n==null?void 0:n.in);return isNaN(t)?ht((n==null?void 0:n.in)||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function Yu(e,t,n){const r=Ke(e,n==null?void 0:n.in);if(isNaN(t))return ht((n==null?void 0:n.in)||e,NaN);if(!t)return r;const a=r.getDate(),o=ht((n==null?void 0:n.in)||e,r.getTime());o.setMonth(r.getMonth()+t+1,0);const l=o.getDate();return a>=l?o:(r.setFullYear(o.getFullYear(),o.getMonth(),a),r)}let eS={};function ri(){return eS}function ss(e,t){var c,d,h,m;const n=ri(),r=(t==null?void 0:t.weekStartsOn)??((d=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:d.weekStartsOn)??n.weekStartsOn??((m=(h=n.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??0,a=Ke(e,t==null?void 0:t.in),o=a.getDay(),l=(o<r?7:0)+o-r;return a.setDate(a.getDate()-l),a.setHours(0,0,0,0),a}function Za(e,t){return ss(e,{...t,weekStartsOn:1})}function Xb(e,t){const n=Ke(e,t==null?void 0:t.in),r=n.getFullYear(),a=ht(n,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const o=Za(a),l=ht(n,0);l.setFullYear(r,0,4),l.setHours(0,0,0,0);const c=Za(l);return n.getTime()>=o.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function kc(e){const t=Ke(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function oo(e,...t){const n=ht.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function to(e,t){const n=Ke(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function D0(e,t,n){const[r,a]=oo(n==null?void 0:n.in,e,t),o=to(r),l=to(a),c=+o-kc(o),d=+l-kc(l);return Math.round((c-d)/Jw)}function tS(e,t){const n=Xb(e,t),r=ht(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Za(r)}function Kb(e,t,n){return Yu(e,t*3,n)}function A0(e,t,n){return Ja(e,t*7,n)}function I0(e,t,n){return Yu(e,t*12,n)}function nS(e,t){let n,r=t==null?void 0:t.in;return e.forEach(a=>{!r&&typeof a=="object"&&(r=ht.bind(null,a));const o=Ke(a,r);(!n||n<o||isNaN(+o))&&(n=o)}),ht(r,n||NaN)}function rS(e,t){let n,r=t==null?void 0:t.in;return e.forEach(a=>{!r&&typeof a=="object"&&(r=ht.bind(null,a));const o=Ke(a,r);(!n||n>o||isNaN(+o))&&(n=o)}),ht(r,n||NaN)}function sS(e,t,n){const[r,a]=oo(n==null?void 0:n.in,e,t);return+to(r)==+to(a)}function Jb(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function aS(e){return!(!Jb(e)&&typeof e!="number"||isNaN(+Ke(e)))}function Zb(e,t,n){const[r,a]=oo(n==null?void 0:n.in,e,t),o=r.getFullYear()-a.getFullYear(),l=r.getMonth()-a.getMonth();return o*12+l}function iS(e,t){const n=Ke(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function eE(e,t){const n=Ke(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function tE(e,t){const[n,r]=oo(e,t.start,t.end);return{start:n,end:r}}function oS(e,t){const{start:n,end:r}=tE(t==null?void 0:t.in,e);let a=+n>+r;const o=a?+n:+r,l=a?r:n;l.setHours(0,0,0,0),l.setDate(1);let c=1;const d=[];for(;+l<=o;)d.push(ht(n,l)),l.setMonth(l.getMonth()+c);return a?d.reverse():d}function uS(e,t){const n=Ke(e,t==null?void 0:t.in),r=n.getMonth(),a=r-r%3;return n.setMonth(a,1),n.setHours(0,0,0,0),n}function nE(e,t){const n=Ke(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function rE(e,t){const n=Ke(e,t==null?void 0:t.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function R0(e,t){const n=Ke(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function lS(e,t){const{start:n,end:r}=tE(t==null?void 0:t.in,e);let a=+n>+r;const o=a?+n:+r,l=a?r:n;l.setHours(0,0,0,0),l.setMonth(0,1);let c=1;const d=[];for(;+l<=o;)d.push(ht(n,l)),l.setFullYear(l.getFullYear()+c);return a?d.reverse():d}function L0(e,t){var c,d,h,m;const n=ri(),r=(t==null?void 0:t.weekStartsOn)??((d=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:d.weekStartsOn)??n.weekStartsOn??((m=(h=n.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??0,a=Ke(e,t==null?void 0:t.in),o=a.getDay(),l=(o<r?-7:0)+6-(o-r);return a.setDate(a.getDate()+l),a.setHours(23,59,59,999),a}function cS(e,t){return L0(e,{...t,weekStartsOn:1})}function dS(e,t){const n=Ke(e,t==null?void 0:t.in),r=n.getMonth(),a=r-r%3+3;return n.setMonth(a,0),n.setHours(23,59,59,999),n}const fS={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},hS=(e,t,n)=>{let r;const a=fS[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Jf(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const pS={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},mS={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},gS={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},yS={date:Jf({formats:pS,defaultWidth:"full"}),time:Jf({formats:mS,defaultWidth:"full"}),dateTime:Jf({formats:gS,defaultWidth:"full"})},bS={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ES=(e,t,n,r)=>bS[e];function eu(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&e.formattingValues){const l=e.defaultFormattingWidth||e.defaultWidth,c=n!=null&&n.width?String(n.width):l;a=e.formattingValues[c]||e.formattingValues[l]}else{const l=e.defaultWidth,c=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[c]||e.values[l]}const o=e.argumentCallback?e.argumentCallback(t):t;return a[o]}}const xS={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},TS={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},vS={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},wS={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},SS={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},_S={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},CS=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},kS={ordinalNumber:CS,era:eu({values:xS,defaultWidth:"wide"}),quarter:eu({values:TS,defaultWidth:"wide",argumentCallback:e=>e-1}),month:eu({values:vS,defaultWidth:"wide"}),day:eu({values:wS,defaultWidth:"wide"}),dayPeriod:eu({values:SS,defaultWidth:"wide",formattingValues:_S,defaultFormattingWidth:"wide"})};function tu(e){return(t,n={})=>{const r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(a);if(!o)return null;const l=o[0],c=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(c)?OS(c,g=>g.test(l)):NS(c,g=>g.test(l));let h;h=e.valueCallback?e.valueCallback(d):d,h=n.valueCallback?n.valueCallback(h):h;const m=t.slice(l.length);return{value:h,rest:m}}}function NS(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function OS(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function DS(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const a=r[0],o=t.match(e.parsePattern);if(!o)return null;let l=e.valueCallback?e.valueCallback(o[0]):o[0];l=n.valueCallback?n.valueCallback(l):l;const c=t.slice(a.length);return{value:l,rest:c}}}const AS=/^(\d+)(th|st|nd|rd)?/i,IS=/\d+/i,RS={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},LS={any:[/^b/i,/^(a|c)/i]},MS={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},PS={any:[/1/i,/2/i,/3/i,/4/i]},FS={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},jS={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},BS={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},HS={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},US={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},zS={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},WS={ordinalNumber:DS({matchPattern:AS,parsePattern:IS,valueCallback:e=>parseInt(e,10)}),era:tu({matchPatterns:RS,defaultMatchWidth:"wide",parsePatterns:LS,defaultParseWidth:"any"}),quarter:tu({matchPatterns:MS,defaultMatchWidth:"wide",parsePatterns:PS,defaultParseWidth:"any",valueCallback:e=>e+1}),month:tu({matchPatterns:FS,defaultMatchWidth:"wide",parsePatterns:jS,defaultParseWidth:"any"}),day:tu({matchPatterns:BS,defaultMatchWidth:"wide",parsePatterns:HS,defaultParseWidth:"any"}),dayPeriod:tu({matchPatterns:US,defaultMatchWidth:"any",parsePatterns:zS,defaultParseWidth:"any"})},La={code:"en-US",formatDistance:hS,formatLong:yS,formatRelative:ES,localize:kS,match:WS,options:{weekStartsOn:0,firstWeekContainsDate:1}};function YS(e,t){const n=Ke(e,t==null?void 0:t.in);return D0(n,R0(n))+1}function Hc(e,t){const n=Ke(e,t==null?void 0:t.in),r=+Za(n)-+tS(n);return Math.round(r/Gb)+1}function M0(e,t){var m,g,E,x;const n=Ke(e,t==null?void 0:t.in),r=n.getFullYear(),a=ri(),o=(t==null?void 0:t.firstWeekContainsDate)??((g=(m=t==null?void 0:t.locale)==null?void 0:m.options)==null?void 0:g.firstWeekContainsDate)??a.firstWeekContainsDate??((x=(E=a.locale)==null?void 0:E.options)==null?void 0:x.firstWeekContainsDate)??1,l=ht((t==null?void 0:t.in)||e,0);l.setFullYear(r+1,0,o),l.setHours(0,0,0,0);const c=ss(l,t),d=ht((t==null?void 0:t.in)||e,0);d.setFullYear(r,0,o),d.setHours(0,0,0,0);const h=ss(d,t);return+n>=+c?r+1:+n>=+h?r:r-1}function qS(e,t){var c,d,h,m;const n=ri(),r=(t==null?void 0:t.firstWeekContainsDate)??((d=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??n.firstWeekContainsDate??((m=(h=n.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,a=M0(e,t),o=ht((t==null?void 0:t.in)||e,0);return o.setFullYear(a,0,r),o.setHours(0,0,0,0),ss(o,t)}function Uc(e,t){const n=Ke(e,t==null?void 0:t.in),r=+ss(n,t)-+qS(n,t);return Math.round(r/Gb)+1}function mt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Gs={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return mt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):mt(n+1,2)},d(e,t){return mt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return mt(e.getHours()%12||12,t.length)},H(e,t){return mt(e.getHours(),t.length)},m(e,t){return mt(e.getMinutes(),t.length)},s(e,t){return mt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return mt(a,t.length)}},Ai={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},v1={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return Gs.y(e,t)},Y:function(e,t,n,r){const a=M0(e,r),o=a>0?a:1-a;if(t==="YY"){const l=o%100;return mt(l,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):mt(o,t.length)},R:function(e,t){const n=Xb(e);return mt(n,t.length)},u:function(e,t){const n=e.getFullYear();return mt(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return mt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return mt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Gs.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return mt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const a=Uc(e,r);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):mt(a,t.length)},I:function(e,t,n){const r=Hc(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):mt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Gs.d(e,t)},D:function(e,t,n){const r=YS(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):mt(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const a=e.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return mt(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const a=e.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return mt(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return mt(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let a;switch(r===12?a=Ai.noon:r===0?a=Ai.midnight:a=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let a;switch(r>=17?a=Ai.evening:r>=12?a=Ai.afternoon:r>=4?a=Ai.morning:a=Ai.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Gs.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Gs.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):mt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):mt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Gs.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Gs.s(e,t)},S:function(e,t){return Gs.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return S1(r);case"XXXX":case"XX":return Ia(r);case"XXXXX":case"XXX":default:return Ia(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return S1(r);case"xxxx":case"xx":return Ia(r);case"xxxxx":case"xxx":default:return Ia(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+w1(r,":");case"OOOO":default:return"GMT"+Ia(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+w1(r,":");case"zzzz":default:return"GMT"+Ia(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return mt(r,t.length)},T:function(e,t,n){return mt(+e,t.length)}};function w1(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.trunc(r/60),o=r%60;return o===0?n+String(a):n+String(a)+t+mt(o,2)}function S1(e,t){return e%60===0?(e>0?"-":"+")+mt(Math.abs(e)/60,2):Ia(e,t)}function Ia(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=mt(Math.trunc(r/60),2),o=mt(r%60,2);return n+a+t+o}const _1=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},sE=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},$S=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return _1(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",_1(r,t)).replace("{{time}}",sE(a,t))},Gh={p:sE,P:$S},VS=/^D+$/,QS=/^Y+$/,GS=["D","DD","YY","YYYY"];function aE(e){return VS.test(e)}function iE(e){return QS.test(e)}function Xh(e,t,n){const r=XS(e,t,n);if(console.warn(r),GS.includes(e))throw new RangeError(r)}function XS(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const KS=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,JS=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ZS=/^'([^]*?)'?$/,e_=/''/g,t_=/[a-zA-Z]/;function hn(e,t,n){var m,g,E,x,C,S,w,v;const r=ri(),a=(n==null?void 0:n.locale)??r.locale??La,o=(n==null?void 0:n.firstWeekContainsDate)??((g=(m=n==null?void 0:n.locale)==null?void 0:m.options)==null?void 0:g.firstWeekContainsDate)??r.firstWeekContainsDate??((x=(E=r.locale)==null?void 0:E.options)==null?void 0:x.firstWeekContainsDate)??1,l=(n==null?void 0:n.weekStartsOn)??((S=(C=n==null?void 0:n.locale)==null?void 0:C.options)==null?void 0:S.weekStartsOn)??r.weekStartsOn??((v=(w=r.locale)==null?void 0:w.options)==null?void 0:v.weekStartsOn)??0,c=Ke(e,n==null?void 0:n.in);if(!aS(c))throw new RangeError("Invalid time value");let d=t.match(JS).map(k=>{const O=k[0];if(O==="p"||O==="P"){const A=Gh[O];return A(k,a.formatLong)}return k}).join("").match(KS).map(k=>{if(k==="''")return{isToken:!1,value:"'"};const O=k[0];if(O==="'")return{isToken:!1,value:n_(k)};if(v1[O])return{isToken:!0,value:k};if(O.match(t_))throw new RangeError("Format string contains an unescaped latin alphabet character `"+O+"`");return{isToken:!1,value:k}});a.localize.preprocessor&&(d=a.localize.preprocessor(c,d));const h={firstWeekContainsDate:o,weekStartsOn:l,locale:a};return d.map(k=>{if(!k.isToken)return k.value;const O=k.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&iE(O)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&aE(O))&&Xh(O,t,String(e));const A=v1[O[0]];return A(c,O,a.localize,h)}).join("")}function n_(e){const t=e.match(ZS);return t?t[1].replace(e_,"'"):e}function r_(e,t){const n=Ke(e,t==null?void 0:t.in),r=n.getFullYear(),a=n.getMonth(),o=ht(n,0);return o.setFullYear(r,a+1,0),o.setHours(0,0,0,0),o.getDate()}function s_(){return Object.assign({},ri())}function a_(e,t){const n=Ke(e,t==null?void 0:t.in).getDay();return n===0?7:n}function i_(e,t){return Ke(e,t==null?void 0:t.in).getMonth()}function o_(e,t){return Ke(e,t==null?void 0:t.in).getFullYear()}function u_(e,t){return+Ke(e)>+Ke(t)}function l_(e,t){return+Ke(e)<+Ke(t)}function c_(e,t){const n=d_(t)?new t(0):ht(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function d_(e){var t;return typeof e=="function"&&((t=e.prototype)==null?void 0:t.constructor)===e}const f_=10;class oE{constructor(){ve(this,"subPriority",0)}validate(t,n){return!0}}class h_ extends oE{constructor(t,n,r,a,o){super(),this.value=t,this.validateValue=n,this.setValue=r,this.priority=a,o&&(this.subPriority=o)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,r){return this.setValue(t,n,this.value,r)}}class p_ extends oE{constructor(n,r){super();ve(this,"priority",f_);ve(this,"subPriority",-1);this.context=n||(a=>ht(r,a))}set(n,r){return r.timestampIsSet?n:ht(n,c_(n,this.context))}}let ct=class{run(t,n,r,a){const o=this.parse(t,n,r,a);return o?{setter:new h_(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(t,n,r){return!0}};class m_ extends ct{constructor(){super(...arguments);ve(this,"priority",140);ve(this,"incompatibleTokens",["R","u","t","T"])}parse(n,r,a){switch(r){case"G":case"GG":case"GGG":return a.era(n,{width:"abbreviated"})||a.era(n,{width:"narrow"});case"GGGGG":return a.era(n,{width:"narrow"});case"GGGG":default:return a.era(n,{width:"wide"})||a.era(n,{width:"abbreviated"})||a.era(n,{width:"narrow"})}}set(n,r,a){return r.era=a,n.setFullYear(a,0,1),n.setHours(0,0,0,0),n}}const Zt={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},es={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function en(e,t){return e&&{value:t(e.value),rest:e.rest}}function Ut(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function ts(e,t){const n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};const r=n[1]==="+"?1:-1,a=n[2]?parseInt(n[2],10):0,o=n[3]?parseInt(n[3],10):0,l=n[5]?parseInt(n[5],10):0;return{value:r*(a*O0+o*N0+l*Zw),rest:t.slice(n[0].length)}}function uE(e){return Ut(Zt.anyDigitsSigned,e)}function Qt(e,t){switch(e){case 1:return Ut(Zt.singleDigit,t);case 2:return Ut(Zt.twoDigits,t);case 3:return Ut(Zt.threeDigits,t);case 4:return Ut(Zt.fourDigits,t);default:return Ut(new RegExp("^\\d{1,"+e+"}"),t)}}function Nc(e,t){switch(e){case 1:return Ut(Zt.singleDigitSigned,t);case 2:return Ut(Zt.twoDigitsSigned,t);case 3:return Ut(Zt.threeDigitsSigned,t);case 4:return Ut(Zt.fourDigitsSigned,t);default:return Ut(new RegExp("^-?\\d{1,"+e+"}"),t)}}function P0(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function lE(e,t){const n=t>0,r=n?t:1-t;let a;if(r<=50)a=e||100;else{const o=r+50,l=Math.trunc(o/100)*100,c=e>=o%100;a=e+l-(c?100:0)}return n?a:1-a}function cE(e){return e%400===0||e%4===0&&e%100!==0}class g_ extends ct{constructor(){super(...arguments);ve(this,"priority",130);ve(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(n,r,a){const o=l=>({year:l,isTwoDigitYear:r==="yy"});switch(r){case"y":return en(Qt(4,n),o);case"yo":return en(a.ordinalNumber(n,{unit:"year"}),o);default:return en(Qt(r.length,n),o)}}validate(n,r){return r.isTwoDigitYear||r.year>0}set(n,r,a){const o=n.getFullYear();if(a.isTwoDigitYear){const c=lE(a.year,o);return n.setFullYear(c,0,1),n.setHours(0,0,0,0),n}const l=!("era"in r)||r.era===1?a.year:1-a.year;return n.setFullYear(l,0,1),n.setHours(0,0,0,0),n}}class y_ extends ct{constructor(){super(...arguments);ve(this,"priority",130);ve(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(n,r,a){const o=l=>({year:l,isTwoDigitYear:r==="YY"});switch(r){case"Y":return en(Qt(4,n),o);case"Yo":return en(a.ordinalNumber(n,{unit:"year"}),o);default:return en(Qt(r.length,n),o)}}validate(n,r){return r.isTwoDigitYear||r.year>0}set(n,r,a,o){const l=M0(n,o);if(a.isTwoDigitYear){const d=lE(a.year,l);return n.setFullYear(d,0,o.firstWeekContainsDate),n.setHours(0,0,0,0),ss(n,o)}const c=!("era"in r)||r.era===1?a.year:1-a.year;return n.setFullYear(c,0,o.firstWeekContainsDate),n.setHours(0,0,0,0),ss(n,o)}}class b_ extends ct{constructor(){super(...arguments);ve(this,"priority",130);ve(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(n,r){return Nc(r==="R"?4:r.length,n)}set(n,r,a){const o=ht(n,0);return o.setFullYear(a,0,4),o.setHours(0,0,0,0),Za(o)}}class E_ extends ct{constructor(){super(...arguments);ve(this,"priority",130);ve(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(n,r){return Nc(r==="u"?4:r.length,n)}set(n,r,a){return n.setFullYear(a,0,1),n.setHours(0,0,0,0),n}}class x_ extends ct{constructor(){super(...arguments);ve(this,"priority",120);ve(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,r,a){switch(r){case"Q":case"QQ":return Qt(r.length,n);case"Qo":return a.ordinalNumber(n,{unit:"quarter"});case"QQQ":return a.quarter(n,{width:"abbreviated",context:"formatting"})||a.quarter(n,{width:"narrow",context:"formatting"});case"QQQQQ":return a.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(n,{width:"wide",context:"formatting"})||a.quarter(n,{width:"abbreviated",context:"formatting"})||a.quarter(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=1&&r<=4}set(n,r,a){return n.setMonth((a-1)*3,1),n.setHours(0,0,0,0),n}}class T_ extends ct{constructor(){super(...arguments);ve(this,"priority",120);ve(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,r,a){switch(r){case"q":case"qq":return Qt(r.length,n);case"qo":return a.ordinalNumber(n,{unit:"quarter"});case"qqq":return a.quarter(n,{width:"abbreviated",context:"standalone"})||a.quarter(n,{width:"narrow",context:"standalone"});case"qqqqq":return a.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(n,{width:"wide",context:"standalone"})||a.quarter(n,{width:"abbreviated",context:"standalone"})||a.quarter(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=1&&r<=4}set(n,r,a){return n.setMonth((a-1)*3,1),n.setHours(0,0,0,0),n}}class v_ extends ct{constructor(){super(...arguments);ve(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);ve(this,"priority",110)}parse(n,r,a){const o=l=>l-1;switch(r){case"M":return en(Ut(Zt.month,n),o);case"MM":return en(Qt(2,n),o);case"Mo":return en(a.ordinalNumber(n,{unit:"month"}),o);case"MMM":return a.month(n,{width:"abbreviated",context:"formatting"})||a.month(n,{width:"narrow",context:"formatting"});case"MMMMM":return a.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(n,{width:"wide",context:"formatting"})||a.month(n,{width:"abbreviated",context:"formatting"})||a.month(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=11}set(n,r,a){return n.setMonth(a,1),n.setHours(0,0,0,0),n}}class w_ extends ct{constructor(){super(...arguments);ve(this,"priority",110);ve(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(n,r,a){const o=l=>l-1;switch(r){case"L":return en(Ut(Zt.month,n),o);case"LL":return en(Qt(2,n),o);case"Lo":return en(a.ordinalNumber(n,{unit:"month"}),o);case"LLL":return a.month(n,{width:"abbreviated",context:"standalone"})||a.month(n,{width:"narrow",context:"standalone"});case"LLLLL":return a.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(n,{width:"wide",context:"standalone"})||a.month(n,{width:"abbreviated",context:"standalone"})||a.month(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=0&&r<=11}set(n,r,a){return n.setMonth(a,1),n.setHours(0,0,0,0),n}}function S_(e,t,n){const r=Ke(e,n==null?void 0:n.in),a=Uc(r,n)-t;return r.setDate(r.getDate()-a*7),Ke(r,n==null?void 0:n.in)}class __ extends ct{constructor(){super(...arguments);ve(this,"priority",100);ve(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(n,r,a){switch(r){case"w":return Ut(Zt.week,n);case"wo":return a.ordinalNumber(n,{unit:"week"});default:return Qt(r.length,n)}}validate(n,r){return r>=1&&r<=53}set(n,r,a,o){return ss(S_(n,a,o),o)}}function C_(e,t,n){const r=Ke(e,n==null?void 0:n.in),a=Hc(r,n)-t;return r.setDate(r.getDate()-a*7),r}class k_ extends ct{constructor(){super(...arguments);ve(this,"priority",100);ve(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(n,r,a){switch(r){case"I":return Ut(Zt.week,n);case"Io":return a.ordinalNumber(n,{unit:"week"});default:return Qt(r.length,n)}}validate(n,r){return r>=1&&r<=53}set(n,r,a){return Za(C_(n,a))}}const N_=[31,28,31,30,31,30,31,31,30,31,30,31],O_=[31,29,31,30,31,30,31,31,30,31,30,31];class D_ extends ct{constructor(){super(...arguments);ve(this,"priority",90);ve(this,"subPriority",1);ve(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(n,r,a){switch(r){case"d":return Ut(Zt.date,n);case"do":return a.ordinalNumber(n,{unit:"date"});default:return Qt(r.length,n)}}validate(n,r){const a=n.getFullYear(),o=cE(a),l=n.getMonth();return o?r>=1&&r<=O_[l]:r>=1&&r<=N_[l]}set(n,r,a){return n.setDate(a),n.setHours(0,0,0,0),n}}class A_ extends ct{constructor(){super(...arguments);ve(this,"priority",90);ve(this,"subpriority",1);ve(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(n,r,a){switch(r){case"D":case"DD":return Ut(Zt.dayOfYear,n);case"Do":return a.ordinalNumber(n,{unit:"date"});default:return Qt(r.length,n)}}validate(n,r){const a=n.getFullYear();return cE(a)?r>=1&&r<=366:r>=1&&r<=365}set(n,r,a){return n.setMonth(0,a),n.setHours(0,0,0,0),n}}function F0(e,t,n){var g,E,x,C;const r=ri(),a=(n==null?void 0:n.weekStartsOn)??((E=(g=n==null?void 0:n.locale)==null?void 0:g.options)==null?void 0:E.weekStartsOn)??r.weekStartsOn??((C=(x=r.locale)==null?void 0:x.options)==null?void 0:C.weekStartsOn)??0,o=Ke(e,n==null?void 0:n.in),l=o.getDay(),d=(t%7+7)%7,h=7-a,m=t<0||t>6?t-(l+h)%7:(d+h)%7-(l+h)%7;return Ja(o,m,n)}class I_ extends ct{constructor(){super(...arguments);ve(this,"priority",90);ve(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(n,r,a){switch(r){case"E":case"EE":case"EEE":return a.day(n,{width:"abbreviated",context:"formatting"})||a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"});case"EEEEE":return a.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"});case"EEEE":default:return a.day(n,{width:"wide",context:"formatting"})||a.day(n,{width:"abbreviated",context:"formatting"})||a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=6}set(n,r,a,o){return n=F0(n,a,o),n.setHours(0,0,0,0),n}}class R_ extends ct{constructor(){super(...arguments);ve(this,"priority",90);ve(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(n,r,a,o){const l=c=>{const d=Math.floor((c-1)/7)*7;return(c+o.weekStartsOn+6)%7+d};switch(r){case"e":case"ee":return en(Qt(r.length,n),l);case"eo":return en(a.ordinalNumber(n,{unit:"day"}),l);case"eee":return a.day(n,{width:"abbreviated",context:"formatting"})||a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"});case"eeeee":return a.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"});case"eeee":default:return a.day(n,{width:"wide",context:"formatting"})||a.day(n,{width:"abbreviated",context:"formatting"})||a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=6}set(n,r,a,o){return n=F0(n,a,o),n.setHours(0,0,0,0),n}}class L_ extends ct{constructor(){super(...arguments);ve(this,"priority",90);ve(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(n,r,a,o){const l=c=>{const d=Math.floor((c-1)/7)*7;return(c+o.weekStartsOn+6)%7+d};switch(r){case"c":case"cc":return en(Qt(r.length,n),l);case"co":return en(a.ordinalNumber(n,{unit:"day"}),l);case"ccc":return a.day(n,{width:"abbreviated",context:"standalone"})||a.day(n,{width:"short",context:"standalone"})||a.day(n,{width:"narrow",context:"standalone"});case"ccccc":return a.day(n,{width:"narrow",context:"standalone"});case"cccccc":return a.day(n,{width:"short",context:"standalone"})||a.day(n,{width:"narrow",context:"standalone"});case"cccc":default:return a.day(n,{width:"wide",context:"standalone"})||a.day(n,{width:"abbreviated",context:"standalone"})||a.day(n,{width:"short",context:"standalone"})||a.day(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=0&&r<=6}set(n,r,a,o){return n=F0(n,a,o),n.setHours(0,0,0,0),n}}function M_(e,t,n){const r=Ke(e,n==null?void 0:n.in),a=a_(r,n),o=t-a;return Ja(r,o,n)}class P_ extends ct{constructor(){super(...arguments);ve(this,"priority",90);ve(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(n,r,a){const o=l=>l===0?7:l;switch(r){case"i":case"ii":return Qt(r.length,n);case"io":return a.ordinalNumber(n,{unit:"day"});case"iii":return en(a.day(n,{width:"abbreviated",context:"formatting"})||a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"}),o);case"iiiii":return en(a.day(n,{width:"narrow",context:"formatting"}),o);case"iiiiii":return en(a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"}),o);case"iiii":default:return en(a.day(n,{width:"wide",context:"formatting"})||a.day(n,{width:"abbreviated",context:"formatting"})||a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"}),o)}}validate(n,r){return r>=1&&r<=7}set(n,r,a){return n=M_(n,a),n.setHours(0,0,0,0),n}}class F_ extends ct{constructor(){super(...arguments);ve(this,"priority",80);ve(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(n,r,a){switch(r){case"a":case"aa":case"aaa":return a.dayPeriod(n,{width:"abbreviated",context:"formatting"})||a.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaaa":return a.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(n,{width:"wide",context:"formatting"})||a.dayPeriod(n,{width:"abbreviated",context:"formatting"})||a.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,a){return n.setHours(P0(a),0,0,0),n}}class j_ extends ct{constructor(){super(...arguments);ve(this,"priority",80);ve(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(n,r,a){switch(r){case"b":case"bb":case"bbb":return a.dayPeriod(n,{width:"abbreviated",context:"formatting"})||a.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbbb":return a.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(n,{width:"wide",context:"formatting"})||a.dayPeriod(n,{width:"abbreviated",context:"formatting"})||a.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,a){return n.setHours(P0(a),0,0,0),n}}class B_ extends ct{constructor(){super(...arguments);ve(this,"priority",80);ve(this,"incompatibleTokens",["a","b","t","T"])}parse(n,r,a){switch(r){case"B":case"BB":case"BBB":return a.dayPeriod(n,{width:"abbreviated",context:"formatting"})||a.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBBB":return a.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(n,{width:"wide",context:"formatting"})||a.dayPeriod(n,{width:"abbreviated",context:"formatting"})||a.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,a){return n.setHours(P0(a),0,0,0),n}}class H_ extends ct{constructor(){super(...arguments);ve(this,"priority",70);ve(this,"incompatibleTokens",["H","K","k","t","T"])}parse(n,r,a){switch(r){case"h":return Ut(Zt.hour12h,n);case"ho":return a.ordinalNumber(n,{unit:"hour"});default:return Qt(r.length,n)}}validate(n,r){return r>=1&&r<=12}set(n,r,a){const o=n.getHours()>=12;return o&&a<12?n.setHours(a+12,0,0,0):!o&&a===12?n.setHours(0,0,0,0):n.setHours(a,0,0,0),n}}class U_ extends ct{constructor(){super(...arguments);ve(this,"priority",70);ve(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(n,r,a){switch(r){case"H":return Ut(Zt.hour23h,n);case"Ho":return a.ordinalNumber(n,{unit:"hour"});default:return Qt(r.length,n)}}validate(n,r){return r>=0&&r<=23}set(n,r,a){return n.setHours(a,0,0,0),n}}class z_ extends ct{constructor(){super(...arguments);ve(this,"priority",70);ve(this,"incompatibleTokens",["h","H","k","t","T"])}parse(n,r,a){switch(r){case"K":return Ut(Zt.hour11h,n);case"Ko":return a.ordinalNumber(n,{unit:"hour"});default:return Qt(r.length,n)}}validate(n,r){return r>=0&&r<=11}set(n,r,a){return n.getHours()>=12&&a<12?n.setHours(a+12,0,0,0):n.setHours(a,0,0,0),n}}class W_ extends ct{constructor(){super(...arguments);ve(this,"priority",70);ve(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(n,r,a){switch(r){case"k":return Ut(Zt.hour24h,n);case"ko":return a.ordinalNumber(n,{unit:"hour"});default:return Qt(r.length,n)}}validate(n,r){return r>=1&&r<=24}set(n,r,a){const o=a<=24?a%24:a;return n.setHours(o,0,0,0),n}}class Y_ extends ct{constructor(){super(...arguments);ve(this,"priority",60);ve(this,"incompatibleTokens",["t","T"])}parse(n,r,a){switch(r){case"m":return Ut(Zt.minute,n);case"mo":return a.ordinalNumber(n,{unit:"minute"});default:return Qt(r.length,n)}}validate(n,r){return r>=0&&r<=59}set(n,r,a){return n.setMinutes(a,0,0),n}}class q_ extends ct{constructor(){super(...arguments);ve(this,"priority",50);ve(this,"incompatibleTokens",["t","T"])}parse(n,r,a){switch(r){case"s":return Ut(Zt.second,n);case"so":return a.ordinalNumber(n,{unit:"second"});default:return Qt(r.length,n)}}validate(n,r){return r>=0&&r<=59}set(n,r,a){return n.setSeconds(a,0),n}}class $_ extends ct{constructor(){super(...arguments);ve(this,"priority",30);ve(this,"incompatibleTokens",["t","T"])}parse(n,r){const a=o=>Math.trunc(o*Math.pow(10,-r.length+3));return en(Qt(r.length,n),a)}set(n,r,a){return n.setMilliseconds(a),n}}class V_ extends ct{constructor(){super(...arguments);ve(this,"priority",10);ve(this,"incompatibleTokens",["t","T","x"])}parse(n,r){switch(r){case"X":return ts(es.basicOptionalMinutes,n);case"XX":return ts(es.basic,n);case"XXXX":return ts(es.basicOptionalSeconds,n);case"XXXXX":return ts(es.extendedOptionalSeconds,n);case"XXX":default:return ts(es.extended,n)}}set(n,r,a){return r.timestampIsSet?n:ht(n,n.getTime()-kc(n)-a)}}class Q_ extends ct{constructor(){super(...arguments);ve(this,"priority",10);ve(this,"incompatibleTokens",["t","T","X"])}parse(n,r){switch(r){case"x":return ts(es.basicOptionalMinutes,n);case"xx":return ts(es.basic,n);case"xxxx":return ts(es.basicOptionalSeconds,n);case"xxxxx":return ts(es.extendedOptionalSeconds,n);case"xxx":default:return ts(es.extended,n)}}set(n,r,a){return r.timestampIsSet?n:ht(n,n.getTime()-kc(n)-a)}}class G_ extends ct{constructor(){super(...arguments);ve(this,"priority",40);ve(this,"incompatibleTokens","*")}parse(n){return uE(n)}set(n,r,a){return[ht(n,a*1e3),{timestampIsSet:!0}]}}class X_ extends ct{constructor(){super(...arguments);ve(this,"priority",20);ve(this,"incompatibleTokens","*")}parse(n){return uE(n)}set(n,r,a){return[ht(n,a),{timestampIsSet:!0}]}}const K_={G:new m_,y:new g_,Y:new y_,R:new b_,u:new E_,Q:new x_,q:new T_,M:new v_,L:new w_,w:new __,I:new k_,d:new D_,D:new A_,E:new I_,e:new R_,c:new L_,i:new P_,a:new F_,b:new j_,B:new B_,h:new H_,H:new U_,K:new z_,k:new W_,m:new Y_,s:new q_,S:new $_,X:new V_,x:new Q_,t:new G_,T:new X_},J_=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Z_=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,eC=/^'([^]*?)'?$/,tC=/''/g,nC=/\S/,rC=/[a-zA-Z]/;function Zf(e,t,n,r){var w,v,k,O;const a=()=>ht(n,NaN),o=s_(),l=o.locale??La,c=o.firstWeekContainsDate??((v=(w=o.locale)==null?void 0:w.options)==null?void 0:v.firstWeekContainsDate)??1,d=o.weekStartsOn??((O=(k=o.locale)==null?void 0:k.options)==null?void 0:O.weekStartsOn)??0,h={firstWeekContainsDate:c,weekStartsOn:d,locale:l},m=[new p_(r==null?void 0:r.in,n)],g=t.match(Z_).map(A=>{const P=A[0];if(P in Gh){const _=Gh[P];return _(A,l.formatLong)}return A}).join("").match(J_),E=[];for(let A of g){iE(A)&&Xh(A,t,e),aE(A)&&Xh(A,t,e);const P=A[0],_=K_[P];if(_){const{incompatibleTokens:N}=_;if(Array.isArray(N)){const F=E.find(j=>N.includes(j.token)||j.token===P);if(F)throw new RangeError(`The format string mustn't contain \`${F.fullToken}\` and \`${A}\` at the same time`)}else if(_.incompatibleTokens==="*"&&E.length>0)throw new RangeError(`The format string mustn't contain \`${A}\` and any other token at the same time`);E.push({token:P,fullToken:A});const I=_.run(e,A,l.match,h);if(!I)return a();m.push(I.setter),e=I.rest}else{if(P.match(rC))throw new RangeError("Format string contains an unescaped latin alphabet character `"+P+"`");if(A==="''"?A="'":P==="'"&&(A=sC(A)),e.indexOf(A)===0)e=e.slice(A.length);else return a()}}if(e.length>0&&nC.test(e))return a();const x=m.map(A=>A.priority).sort((A,P)=>P-A).filter((A,P,_)=>_.indexOf(A)===P).map(A=>m.filter(P=>P.priority===A).sort((P,_)=>_.subPriority-P.subPriority)).map(A=>A[0]);let C=Ke(n,r==null?void 0:r.in);if(isNaN(+C))return a();const S={};for(const A of x){if(!A.validate(C,h))return a();const P=A.set(C,S,h);Array.isArray(P)?(C=P[0],Object.assign(S,P[1])):C=P}return C}function sC(e){return e.match(eC)[1].replace(tC,"'")}function aC(e,t,n){const[r,a]=oo(n==null?void 0:n.in,e,t);return r.getFullYear()===a.getFullYear()&&r.getMonth()===a.getMonth()}function iC(e,t,n){const[r,a]=oo(n==null?void 0:n.in,e,t);return r.getFullYear()===a.getFullYear()}function C1(e,t,n){return Ja(e,-t,n)}function Oc(e,t){const n=()=>ht(t==null?void 0:t.in,NaN),a=cC(e);let o;if(a.date){const h=dC(a.date,2);o=fC(h.restDateString,h.year)}if(!o||isNaN(+o))return n();const l=+o;let c=0,d;if(a.time&&(c=hC(a.time),isNaN(c)))return n();if(a.timezone){if(d=pC(a.timezone),isNaN(d))return n()}else{const h=new Date(l+c),m=Ke(0,t==null?void 0:t.in);return m.setFullYear(h.getUTCFullYear(),h.getUTCMonth(),h.getUTCDate()),m.setHours(h.getUTCHours(),h.getUTCMinutes(),h.getUTCSeconds(),h.getUTCMilliseconds()),m}return Ke(l+c+d,t==null?void 0:t.in)}const lc={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},oC=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,uC=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,lC=/^([+-])(\d{2})(?::?(\d{2}))?$/;function cC(e){const t={},n=e.split(lc.dateTimeDelimiter);let r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],lc.timeZoneDelimiter.test(t.date)&&(t.date=e.split(lc.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){const a=lc.timezone.exec(r);a?(t.time=r.replace(a[1],""),t.timezone=a[1]):t.time=r}return t}function dC(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};const a=r[1]?parseInt(r[1]):null,o=r[2]?parseInt(r[2]):null;return{year:o===null?a:o*100,restDateString:e.slice((r[1]||r[2]).length)}}function fC(e,t){if(t===null)return new Date(NaN);const n=e.match(oC);if(!n)return new Date(NaN);const r=!!n[4],a=nu(n[1]),o=nu(n[2])-1,l=nu(n[3]),c=nu(n[4]),d=nu(n[5])-1;if(r)return EC(t,c,d)?mC(t,c,d):new Date(NaN);{const h=new Date(0);return!yC(t,o,l)||!bC(t,a)?new Date(NaN):(h.setUTCFullYear(t,o,Math.max(a,l)),h)}}function nu(e){return e?parseInt(e):1}function hC(e){const t=e.match(uC);if(!t)return NaN;const n=eh(t[1]),r=eh(t[2]),a=eh(t[3]);return xC(n,r,a)?n*O0+r*N0+a*1e3:NaN}function eh(e){return e&&parseFloat(e.replace(",","."))||0}function pC(e){if(e==="Z")return 0;const t=e.match(lC);if(!t)return 0;const n=t[1]==="+"?-1:1,r=parseInt(t[2]),a=t[3]&&parseInt(t[3])||0;return TC(r,a)?n*(r*O0+a*N0):NaN}function mC(e,t,n){const r=new Date(0);r.setUTCFullYear(e,0,4);const a=r.getUTCDay()||7,o=(t-1)*7+n+1-a;return r.setUTCDate(r.getUTCDate()+o),r}const gC=[31,null,31,30,31,30,31,31,30,31,30,31];function dE(e){return e%400===0||e%4===0&&e%100!==0}function yC(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(gC[t]||(dE(e)?29:28))}function bC(e,t){return t>=1&&t<=(dE(e)?366:365)}function EC(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function xC(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function TC(e,t){return t>=0&&t<=59}function vC(e,t,n){const r=Ke(e,n==null?void 0:n.in),a=r.getFullYear(),o=r.getDate(),l=ht(e,0);l.setFullYear(a,t,15),l.setHours(0,0,0,0);const c=r_(l);return r.setMonth(t,Math.min(o,c)),r}function wC(e,t,n){const r=Ke(e,n==null?void 0:n.in);return isNaN(+r)?ht(e,NaN):(r.setFullYear(t),r)}function SC(e,t,n){return Yu(e,-t,n)}function _C(e,t,n){return Kb(e,-t,n)}function CC(e,t,n){return A0(e,-t,n)}function kC(e,t,n){return I0(e,-t,n)}const k1=5,NC=4;function OC(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,a=t.addDays(e,-r+1),o=t.addDays(a,k1*7-1);return t.getMonth(e)===t.getMonth(o)?k1:NC}function fE(e,t){const n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-6):t.addDays(n,-1*(r-1))}function DC(e,t){const n=fE(e,t),r=OC(e,t);return t.addDays(n,r*7-1)}const hE={...La,labels:{labelDayButton:(e,t,n,r)=>{let a;r&&typeof r.format=="function"?a=r.format.bind(r):a=(l,c)=>hn(l,c,{locale:La,...n});let o=a(e,"PPPP");return t.today&&(o=`Today, ${o}`),t.selected&&(o=`${o}, selected`),o},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:e=>`Week ${e}`,labelYearDropdown:"Choose the Year",labelGrid:(e,t,n)=>{let r;return n&&typeof n.format=="function"?r=n.format.bind(n):r=(a,o)=>hn(a,o,{locale:La,...t}),r(e,"LLLL yyyy")},labelGridcell:(e,t,n,r)=>{let a;r&&typeof r.format=="function"?a=r.format.bind(r):a=(l,c)=>hn(l,c,{locale:La,...n});let o=a(e,"PPPP");return t!=null&&t.today&&(o=`Today, ${o}`),o},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(e,t,n)=>{let r;return n&&typeof n.format=="function"?r=n.format.bind(n):r=(a,o)=>hn(a,o,{locale:La,...t}),r(e,"cccc")}}};class dr{constructor(t,n){this.Date=Date,this.today=()=>{var r;return(r=this.overrides)!=null&&r.today?this.overrides.today():this.options.timeZone?Rn.tz(this.options.timeZone):new this.Date},this.newDate=(r,a,o)=>{var l;return(l=this.overrides)!=null&&l.newDate?this.overrides.newDate(r,a,o):this.options.timeZone?new Rn(r,a,o,this.options.timeZone):new Date(r,a,o)},this.addDays=(r,a)=>{var o;return(o=this.overrides)!=null&&o.addDays?this.overrides.addDays(r,a):Ja(r,a)},this.addMonths=(r,a)=>{var o;return(o=this.overrides)!=null&&o.addMonths?this.overrides.addMonths(r,a):Yu(r,a)},this.addWeeks=(r,a)=>{var o;return(o=this.overrides)!=null&&o.addWeeks?this.overrides.addWeeks(r,a):A0(r,a)},this.addYears=(r,a)=>{var o;return(o=this.overrides)!=null&&o.addYears?this.overrides.addYears(r,a):I0(r,a)},this.differenceInCalendarDays=(r,a)=>{var o;return(o=this.overrides)!=null&&o.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,a):D0(r,a)},this.differenceInCalendarMonths=(r,a)=>{var o;return(o=this.overrides)!=null&&o.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,a):Zb(r,a)},this.eachMonthOfInterval=r=>{var a;return(a=this.overrides)!=null&&a.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):oS(r)},this.eachYearOfInterval=r=>{var c;const a=(c=this.overrides)!=null&&c.eachYearOfInterval?this.overrides.eachYearOfInterval(r):lS(r),o=new Set(a.map(d=>this.getYear(d)));if(o.size===a.length)return a;const l=[];return o.forEach(d=>{l.push(new Date(d,0,1))}),l},this.endOfBroadcastWeek=r=>{var a;return(a=this.overrides)!=null&&a.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):DC(r,this)},this.endOfISOWeek=r=>{var a;return(a=this.overrides)!=null&&a.endOfISOWeek?this.overrides.endOfISOWeek(r):cS(r)},this.endOfMonth=r=>{var a;return(a=this.overrides)!=null&&a.endOfMonth?this.overrides.endOfMonth(r):eE(r)},this.endOfWeek=(r,a)=>{var o;return(o=this.overrides)!=null&&o.endOfWeek?this.overrides.endOfWeek(r,a):L0(r,this.options)},this.endOfYear=r=>{var a;return(a=this.overrides)!=null&&a.endOfYear?this.overrides.endOfYear(r):rE(r)},this.format=(r,a,o)=>{var c;const l=(c=this.overrides)!=null&&c.format?this.overrides.format(r,a,this.options):hn(r,a,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(l):l},this.getISOWeek=r=>{var a;return(a=this.overrides)!=null&&a.getISOWeek?this.overrides.getISOWeek(r):Hc(r)},this.getMonth=(r,a)=>{var o;return(o=this.overrides)!=null&&o.getMonth?this.overrides.getMonth(r,this.options):i_(r,this.options)},this.getYear=(r,a)=>{var o;return(o=this.overrides)!=null&&o.getYear?this.overrides.getYear(r,this.options):o_(r,this.options)},this.getWeek=(r,a)=>{var o;return(o=this.overrides)!=null&&o.getWeek?this.overrides.getWeek(r,this.options):Uc(r,this.options)},this.isAfter=(r,a)=>{var o;return(o=this.overrides)!=null&&o.isAfter?this.overrides.isAfter(r,a):u_(r,a)},this.isBefore=(r,a)=>{var o;return(o=this.overrides)!=null&&o.isBefore?this.overrides.isBefore(r,a):l_(r,a)},this.isDate=r=>{var a;return(a=this.overrides)!=null&&a.isDate?this.overrides.isDate(r):Jb(r)},this.isSameDay=(r,a)=>{var o;return(o=this.overrides)!=null&&o.isSameDay?this.overrides.isSameDay(r,a):sS(r,a)},this.isSameMonth=(r,a)=>{var o;return(o=this.overrides)!=null&&o.isSameMonth?this.overrides.isSameMonth(r,a):aC(r,a)},this.isSameYear=(r,a)=>{var o;return(o=this.overrides)!=null&&o.isSameYear?this.overrides.isSameYear(r,a):iC(r,a)},this.max=r=>{var a;return(a=this.overrides)!=null&&a.max?this.overrides.max(r):nS(r)},this.min=r=>{var a;return(a=this.overrides)!=null&&a.min?this.overrides.min(r):rS(r)},this.setMonth=(r,a)=>{var o;return(o=this.overrides)!=null&&o.setMonth?this.overrides.setMonth(r,a):vC(r,a)},this.setYear=(r,a)=>{var o;return(o=this.overrides)!=null&&o.setYear?this.overrides.setYear(r,a):wC(r,a)},this.startOfBroadcastWeek=(r,a)=>{var o;return(o=this.overrides)!=null&&o.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):fE(r,this)},this.startOfDay=r=>{var a;return(a=this.overrides)!=null&&a.startOfDay?this.overrides.startOfDay(r):to(r)},this.startOfISOWeek=r=>{var a;return(a=this.overrides)!=null&&a.startOfISOWeek?this.overrides.startOfISOWeek(r):Za(r)},this.startOfMonth=r=>{var a;return(a=this.overrides)!=null&&a.startOfMonth?this.overrides.startOfMonth(r):nE(r)},this.startOfWeek=(r,a)=>{var o;return(o=this.overrides)!=null&&o.startOfWeek?this.overrides.startOfWeek(r,this.options):ss(r,this.options)},this.startOfYear=r=>{var a;return(a=this.overrides)!=null&&a.startOfYear?this.overrides.startOfYear(r):R0(r)},this.options={locale:hE,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),r={};for(let a=0;a<10;a++)r[a.toString()]=n.format(a);return r}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,r=>n[r]||r)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){var n;const t=(n=this.options.locale)==null?void 0:n.code;return t&&dr.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:r,numerals:a}=this.options,o=n==null?void 0:n.code;if(o&&dr.yearFirstLocales.has(o))try{return new Intl.DateTimeFormat(o,{month:"long",year:"numeric",timeZone:r,numberingSystem:a}).format(t)}catch{}const l=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,l)}}dr.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const os=new dr;class pE{constructor(t,n,r=os){this.date=t,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(t,n)),this.dateLib=r,this.isoDate=r.format(t,"yyyy-MM-dd"),this.displayMonthId=r.format(n,"yyyy-MM"),this.dateMonthId=r.format(t,"yyyy-MM")}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class AC{constructor(t,n){this.date=t,this.weeks=n}}class IC{constructor(t,n){this.days=n,this.weekNumber=t}}function RC(e){return Ee.createElement("button",{...e})}function LC(e){return Ee.createElement("span",{...e})}function MC(e){const{size:t=24,orientation:n="left",className:r}=e;return Ee.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&Ee.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&Ee.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&Ee.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&Ee.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function PC(e){const{day:t,modifiers:n,...r}=e;return Ee.createElement("td",{...r})}function FC(e){const{day:t,modifiers:n,...r}=e,a=Ee.useRef(null);return Ee.useEffect(()=>{var o;n.focused&&((o=a.current)==null||o.focus())},[n.focused]),Ee.createElement("button",{ref:a,...r})}var Re;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(Re||(Re={}));var Bt;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(Bt||(Bt={}));var Fr;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(Fr||(Fr={}));var lr;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(lr||(lr={}));function jC(e){const{options:t,className:n,components:r,classNames:a,...o}=e,l=[a[Re.Dropdown],n].join(" "),c=t==null?void 0:t.find(({value:d})=>d===o.value);return Ee.createElement("span",{"data-disabled":o.disabled,className:a[Re.DropdownRoot]},Ee.createElement(r.Select,{className:l,...o},t==null?void 0:t.map(({value:d,label:h,disabled:m})=>Ee.createElement(r.Option,{key:d,value:d,disabled:m},h))),Ee.createElement("span",{className:a[Re.CaptionLabel],"aria-hidden":!0},c==null?void 0:c.label,Ee.createElement(r.Chevron,{orientation:"down",size:18,className:a[Re.Chevron]})))}function BC(e){return Ee.createElement("div",{...e})}function HC(e){return Ee.createElement("div",{...e})}function UC(e){const{calendarMonth:t,displayIndex:n,...r}=e;return Ee.createElement("div",{...r},e.children)}function zC(e){const{calendarMonth:t,displayIndex:n,...r}=e;return Ee.createElement("div",{...r})}function WC(e){return Ee.createElement("table",{...e})}function YC(e){return Ee.createElement("div",{...e})}const mE=L.createContext(void 0);function qu(){const e=L.useContext(mE);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function qC(e){const{components:t}=qu();return Ee.createElement(t.Dropdown,{...e})}function $C(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:a,...o}=e,{components:l,classNames:c,labels:{labelPrevious:d,labelNext:h}}=qu(),m=L.useCallback(E=>{a&&(n==null||n(E))},[a,n]),g=L.useCallback(E=>{r&&(t==null||t(E))},[r,t]);return Ee.createElement("nav",{...o},Ee.createElement(l.PreviousMonthButton,{type:"button",className:c[Re.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":d(r),onClick:g},Ee.createElement(l.Chevron,{disabled:r?void 0:!0,className:c[Re.Chevron],orientation:"left"})),Ee.createElement(l.NextMonthButton,{type:"button",className:c[Re.NextMonthButton],tabIndex:a?void 0:-1,"aria-disabled":a?void 0:!0,"aria-label":h(a),onClick:m},Ee.createElement(l.Chevron,{disabled:a?void 0:!0,orientation:"right",className:c[Re.Chevron]})))}function VC(e){const{components:t}=qu();return Ee.createElement(t.Button,{...e})}function QC(e){return Ee.createElement("option",{...e})}function GC(e){const{components:t}=qu();return Ee.createElement(t.Button,{...e})}function XC(e){const{rootRef:t,...n}=e;return Ee.createElement("div",{...n,ref:t})}function KC(e){return Ee.createElement("select",{...e})}function JC(e){const{week:t,...n}=e;return Ee.createElement("tr",{...n})}function ZC(e){return Ee.createElement("th",{...e})}function ek(e){return Ee.createElement("thead",{"aria-hidden":!0},Ee.createElement("tr",{...e}))}function tk(e){const{week:t,...n}=e;return Ee.createElement("th",{...n})}function nk(e){return Ee.createElement("th",{...e})}function rk(e){return Ee.createElement("tbody",{...e})}function sk(e){const{components:t}=qu();return Ee.createElement(t.Dropdown,{...e})}const ak=Object.freeze(Object.defineProperty({__proto__:null,Button:RC,CaptionLabel:LC,Chevron:MC,Day:PC,DayButton:FC,Dropdown:jC,DropdownNav:BC,Footer:HC,Month:UC,MonthCaption:zC,MonthGrid:WC,Months:YC,MonthsDropdown:qC,Nav:$C,NextMonthButton:VC,Option:QC,PreviousMonthButton:GC,Root:XC,Select:KC,Week:JC,WeekNumber:tk,WeekNumberHeader:nk,Weekday:ZC,Weekdays:ek,Weeks:rk,YearsDropdown:sk},Symbol.toStringTag,{value:"Module"}));function Ss(e,t,n=!1,r=os){let{from:a,to:o}=e;const{differenceInCalendarDays:l,isSameDay:c}=r;return a&&o?(l(o,a)<0&&([a,o]=[o,a]),l(t,a)>=(n?1:0)&&l(o,t)>=(n?1:0)):!n&&o?c(o,t):!n&&a?c(a,t):!1}function j0(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function zc(e){return!!(e&&typeof e=="object"&&"from"in e)}function B0(e){return!!(e&&typeof e=="object"&&"after"in e)}function H0(e){return!!(e&&typeof e=="object"&&"before"in e)}function gE(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function yE(e,t){return Array.isArray(e)&&e.every(t.isDate)}function _s(e,t,n=os){const r=Array.isArray(t)?t:[t],{isSameDay:a,differenceInCalendarDays:o,isAfter:l}=n;return r.some(c=>{if(typeof c=="boolean")return c;if(n.isDate(c))return a(e,c);if(yE(c,n))return c.some(d=>a(e,d));if(zc(c))return Ss(c,e,!1,n);if(gE(c))return Array.isArray(c.dayOfWeek)?c.dayOfWeek.includes(e.getDay()):c.dayOfWeek===e.getDay();if(j0(c)){const d=o(c.before,e),h=o(c.after,e),m=d>0,g=h<0;return l(c.before,c.after)?g&&m:m||g}return B0(c)?o(e,c.after)>0:H0(c)?o(c.before,e)>0:typeof c=="function"?c(e):!1})}function ik(e,t,n,r,a){const{disabled:o,hidden:l,modifiers:c,showOutsideDays:d,broadcastCalendar:h,today:m=a.today()}=t,{isSameDay:g,isSameMonth:E,startOfMonth:x,isBefore:C,endOfMonth:S,isAfter:w}=a,v=n&&x(n),k=r&&S(r),O={[Bt.focused]:[],[Bt.outside]:[],[Bt.disabled]:[],[Bt.hidden]:[],[Bt.today]:[]},A={};for(const P of e){const{date:_,displayMonth:N}=P,I=!!(N&&!E(_,N)),F=!!(v&&C(_,v)),j=!!(k&&w(_,k)),M=!!(o&&_s(_,o,a)),H=!!(l&&_s(_,l,a))||F||j||!h&&!d&&I||h&&d===!1&&I,$=g(_,m);I&&O.outside.push(P),M&&O.disabled.push(P),H&&O.hidden.push(P),$&&O.today.push(P),c&&Object.keys(c).forEach(G=>{const J=c==null?void 0:c[G];J&&_s(_,J,a)&&(A[G]?A[G].push(P):A[G]=[P])})}return P=>{const _={[Bt.focused]:!1,[Bt.disabled]:!1,[Bt.hidden]:!1,[Bt.outside]:!1,[Bt.today]:!1},N={};for(const I in O){const F=O[I];_[I]=F.some(j=>j===P)}for(const I in A)N[I]=A[I].some(F=>F===P);return{..._,...N}}}function ok(e,t,n={}){return Object.entries(e).filter(([,a])=>a===!0).reduce((a,[o])=>(n[o]?a.push(n[o]):t[Bt[o]]?a.push(t[Bt[o]]):t[Fr[o]]&&a.push(t[Fr[o]]),a),[t[Re.Day]])}function uk(e){return{...ak,...e}}function lk(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,r])=>{n.startsWith("data-")&&(t[n]=r)}),t}function ck(){const e={};for(const t in Re)e[Re[t]]=`rdp-${Re[t]}`;for(const t in Bt)e[Bt[t]]=`rdp-${Bt[t]}`;for(const t in Fr)e[Fr[t]]=`rdp-${Fr[t]}`;for(const t in lr)e[lr[t]]=`rdp-${lr[t]}`;return e}function bE(e,t,n){return(n??new dr(t)).formatMonthYear(e)}const dk=bE;function fk(e,t,n){return(n??new dr(t)).format(e,"d")}function hk(e,t=os){return t.format(e,"LLLL")}function pk(e,t,n){return(n??new dr(t)).format(e,"cccccc")}function mk(e,t=os){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function gk(){return""}function EE(e,t=os){return t.format(e,"yyyy")}const yk=EE,bk=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:bE,formatDay:fk,formatMonthCaption:dk,formatMonthDropdown:hk,formatWeekNumber:mk,formatWeekNumberHeader:gk,formatWeekdayName:pk,formatYearCaption:yk,formatYearDropdown:EE},Symbol.toStringTag,{value:"Module"}));function Ek(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...bk,...e}}function U0(e,t,n,r){let a=(r??new dr(n)).format(e,"PPPP");return t.today&&(a=`Today, ${a}`),t.selected&&(a=`${a}, selected`),a}const xk=U0;function z0(e,t,n){return(n??new dr(t)).formatMonthYear(e)}const Tk=z0;function xE(e,t,n,r){let a=(r??new dr(n)).format(e,"PPPP");return t!=null&&t.today&&(a=`Today, ${a}`),a}function TE(e){return"Choose the Month"}function vE(){return""}const vk="Go to the Next Month";function wE(e,t){return vk}function SE(e){return"Go to the Previous Month"}function _E(e,t,n){return(n??new dr(t)).format(e,"cccc")}function CE(e,t){return`Week ${e}`}function kE(e){return"Week Number"}function NE(e){return"Choose the Year"}const wk=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:Tk,labelDay:xk,labelDayButton:U0,labelGrid:z0,labelGridcell:xE,labelMonthDropdown:TE,labelNav:vE,labelNext:wE,labelPrevious:SE,labelWeekNumber:CE,labelWeekNumberHeader:kE,labelWeekday:_E,labelYearDropdown:NE},Symbol.toStringTag,{value:"Module"})),Rr=(e,t,n)=>t||(n?typeof n=="function"?n:(...r)=>n:e);function Sk(e,t){var r;const n=((r=t.locale)==null?void 0:r.labels)??{};return{...wk,...e??{},labelDayButton:Rr(U0,e==null?void 0:e.labelDayButton,n.labelDayButton),labelMonthDropdown:Rr(TE,e==null?void 0:e.labelMonthDropdown,n.labelMonthDropdown),labelNext:Rr(wE,e==null?void 0:e.labelNext,n.labelNext),labelPrevious:Rr(SE,e==null?void 0:e.labelPrevious,n.labelPrevious),labelWeekNumber:Rr(CE,e==null?void 0:e.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:Rr(NE,e==null?void 0:e.labelYearDropdown,n.labelYearDropdown),labelGrid:Rr(z0,e==null?void 0:e.labelGrid,n.labelGrid),labelGridcell:Rr(xE,e==null?void 0:e.labelGridcell,n.labelGridcell),labelNav:Rr(vE,e==null?void 0:e.labelNav,n.labelNav),labelWeekNumberHeader:Rr(kE,e==null?void 0:e.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:Rr(_E,e==null?void 0:e.labelWeekday,n.labelWeekday)}}function _k(e,t,n,r,a){const{startOfMonth:o,startOfYear:l,endOfYear:c,eachMonthOfInterval:d,getMonth:h}=a;return d({start:l(e),end:c(e)}).map(E=>{const x=r.formatMonthDropdown(E,a),C=h(E),S=t&&E<o(t)||n&&E>o(n)||!1;return{value:C,label:x,disabled:S}})}function Ck(e,t={},n={}){let r={...t==null?void 0:t[Re.Day]};return Object.entries(e).filter(([,a])=>a===!0).forEach(([a])=>{r={...r,...n==null?void 0:n[a]}}),r}function kk(e,t,n,r){const a=r??e.today(),o=n?e.startOfBroadcastWeek(a,e):t?e.startOfISOWeek(a):e.startOfWeek(a),l=[];for(let c=0;c<7;c++){const d=e.addDays(o,c);l.push(d)}return l}function Nk(e,t,n,r,a=!1){if(!e||!t)return;const{startOfYear:o,endOfYear:l,eachYearOfInterval:c,getYear:d}=r,h=o(e),m=l(t),g=c({start:h,end:m});return a&&g.reverse(),g.map(E=>{const x=n.formatYearDropdown(E,r);return{value:d(E),label:x,disabled:!1}})}function Ok(e,t={}){var c;const{weekStartsOn:n,locale:r}=t,a=n??((c=r==null?void 0:r.options)==null?void 0:c.weekStartsOn)??0,o=d=>{const h=typeof d=="number"||typeof d=="string"?new Date(d):d;return new Rn(h.getFullYear(),h.getMonth(),h.getDate(),12,0,0,e)},l=d=>{const h=o(d);return new Date(h.getFullYear(),h.getMonth(),h.getDate(),0,0,0,0)};return{today:()=>o(Rn.tz(e)),newDate:(d,h,m)=>new Rn(d,h,m,12,0,0,e),startOfDay:d=>o(d),startOfWeek:(d,h)=>{const m=o(d),g=(h==null?void 0:h.weekStartsOn)??a,E=(m.getDay()-g+7)%7;return m.setDate(m.getDate()-E),m},startOfISOWeek:d=>{const h=o(d),m=(h.getDay()-1+7)%7;return h.setDate(h.getDate()-m),h},startOfMonth:d=>{const h=o(d);return h.setDate(1),h},startOfYear:d=>{const h=o(d);return h.setMonth(0,1),h},endOfWeek:(d,h)=>{const m=o(d),x=((((h==null?void 0:h.weekStartsOn)??a)+6)%7-m.getDay()+7)%7;return m.setDate(m.getDate()+x),m},endOfISOWeek:d=>{const h=o(d),m=(7-h.getDay())%7;return h.setDate(h.getDate()+m),h},endOfMonth:d=>{const h=o(d);return h.setMonth(h.getMonth()+1,0),h},endOfYear:d=>{const h=o(d);return h.setMonth(11,31),h},eachMonthOfInterval:d=>{const h=o(d.start),m=o(d.end),g=[],E=new Rn(h.getFullYear(),h.getMonth(),1,12,0,0,e),x=m.getFullYear()*12+m.getMonth();for(;E.getFullYear()*12+E.getMonth()<=x;)g.push(new Rn(E,e)),E.setMonth(E.getMonth()+1,1);return g},addDays:(d,h)=>{const m=o(d);return m.setDate(m.getDate()+h),m},addWeeks:(d,h)=>{const m=o(d);return m.setDate(m.getDate()+h*7),m},addMonths:(d,h)=>{const m=o(d);return m.setMonth(m.getMonth()+h),m},addYears:(d,h)=>{const m=o(d);return m.setFullYear(m.getFullYear()+h),m},eachYearOfInterval:d=>{const h=o(d.start),m=o(d.end),g=[],E=new Rn(h.getFullYear(),0,1,12,0,0,e);for(;E.getFullYear()<=m.getFullYear();)g.push(new Rn(E,e)),E.setFullYear(E.getFullYear()+1,0,1);return g},getWeek:(d,h)=>{var g;const m=l(d);return Uc(m,{weekStartsOn:(h==null?void 0:h.weekStartsOn)??a,firstWeekContainsDate:(h==null?void 0:h.firstWeekContainsDate)??((g=r==null?void 0:r.options)==null?void 0:g.firstWeekContainsDate)??1})},getISOWeek:d=>{const h=l(d);return Hc(h)},differenceInCalendarDays:(d,h)=>{const m=l(d),g=l(h);return D0(m,g)},differenceInCalendarMonths:(d,h)=>{const m=l(d),g=l(h);return Zb(m,g)}}}const $u=e=>e instanceof HTMLElement?e:null,th=e=>[...e.querySelectorAll("[data-animated-month]")??[]],Dk=e=>$u(e.querySelector("[data-animated-month]")),nh=e=>$u(e.querySelector("[data-animated-caption]")),rh=e=>$u(e.querySelector("[data-animated-weeks]")),Ak=e=>$u(e.querySelector("[data-animated-nav]")),Ik=e=>$u(e.querySelector("[data-animated-weekdays]"));function Rk(e,t,{classNames:n,months:r,focused:a,dateLib:o}){const l=L.useRef(null),c=L.useRef(r),d=L.useRef(!1);L.useLayoutEffect(()=>{const h=c.current;if(c.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||h.length===0||r.length!==h.length)return;const m=o.isSameMonth(r[0].date,h[0].date),g=o.isAfter(r[0].date,h[0].date),E=g?n[lr.caption_after_enter]:n[lr.caption_before_enter],x=g?n[lr.weeks_after_enter]:n[lr.weeks_before_enter],C=l.current,S=e.current.cloneNode(!0);if(S instanceof HTMLElement?(th(S).forEach(O=>{if(!(O instanceof HTMLElement))return;const A=Dk(O);A&&O.contains(A)&&O.removeChild(A);const P=nh(O);P&&P.classList.remove(E);const _=rh(O);_&&_.classList.remove(x)}),l.current=S):l.current=null,d.current||m||a)return;const w=C instanceof HTMLElement?th(C):[],v=th(e.current);if(v!=null&&v.every(k=>k instanceof HTMLElement)&&w&&w.every(k=>k instanceof HTMLElement)){d.current=!0,e.current.style.isolation="isolate";const k=Ak(e.current);k&&(k.style.zIndex="1"),v.forEach((O,A)=>{const P=w[A];if(!P)return;O.style.position="relative",O.style.overflow="hidden";const _=nh(O);_&&_.classList.add(E);const N=rh(O);N&&N.classList.add(x);const I=()=>{d.current=!1,e.current&&(e.current.style.isolation=""),k&&(k.style.zIndex=""),_&&_.classList.remove(E),N&&N.classList.remove(x),O.style.position="",O.style.overflow="",O.contains(P)&&O.removeChild(P)};P.style.pointerEvents="none",P.style.position="absolute",P.style.overflow="hidden",P.setAttribute("aria-hidden","true");const F=Ik(P);F&&(F.style.opacity="0");const j=nh(P);j&&(j.classList.add(g?n[lr.caption_before_exit]:n[lr.caption_after_exit]),j.addEventListener("animationend",I));const M=rh(P);M&&M.classList.add(g?n[lr.weeks_before_exit]:n[lr.weeks_after_exit]),O.insertBefore(P,O.firstChild)})}})}function Lk(e,t,n,r){const a=e[0],o=e[e.length-1],{ISOWeek:l,fixedWeeks:c,broadcastCalendar:d}=n??{},{addDays:h,differenceInCalendarDays:m,differenceInCalendarMonths:g,endOfBroadcastWeek:E,endOfISOWeek:x,endOfMonth:C,endOfWeek:S,isAfter:w,startOfBroadcastWeek:v,startOfISOWeek:k,startOfWeek:O}=r,A=d?v(a,r):l?k(a):O(a),P=d?E(o):l?x(C(o)):S(C(o)),_=t&&(d?E(t):l?x(t):S(t)),N=_&&w(P,_)?_:P,I=m(N,A),F=g(o,a)+1,j=[];for(let $=0;$<=I;$++){const G=h(A,$);j.push(G)}const H=(d?35:42)*F;if(c&&j.length<H){const $=H-j.length;for(let G=0;G<$;G++){const J=h(j[j.length-1],1);j.push(J)}}return j}function Mk(e){const t=[];return e.reduce((n,r)=>{const a=r.weeks.reduce((o,l)=>o.concat(l.days.slice()),t.slice());return n.concat(a.slice())},t.slice())}function Pk(e,t,n,r){const{numberOfMonths:a=1}=n,o=[];for(let l=0;l<a;l++){const c=r.addMonths(e,l);if(t&&c>t)break;o.push(c)}return o}function N1(e,t,n,r){const{month:a,defaultMonth:o,today:l=r.today(),numberOfMonths:c=1}=e;let d=a||o||l;const{differenceInCalendarMonths:h,addMonths:m,startOfMonth:g}=r;if(n&&h(n,d)<c-1){const E=-1*(c-1);d=m(n,E)}return t&&h(d,t)<0&&(d=t),g(d)}function Fk(e,t,n,r){const{addDays:a,endOfBroadcastWeek:o,endOfISOWeek:l,endOfMonth:c,endOfWeek:d,getISOWeek:h,getWeek:m,startOfBroadcastWeek:g,startOfISOWeek:E,startOfWeek:x}=r,C=e.reduce((S,w)=>{const v=n.broadcastCalendar?g(w,r):n.ISOWeek?E(w):x(w),k=n.broadcastCalendar?o(w):n.ISOWeek?l(c(w)):d(c(w)),O=t.filter(N=>N>=v&&N<=k),A=n.broadcastCalendar?35:42;if(n.fixedWeeks&&O.length<A){const N=t.filter(I=>{const F=A-O.length;return I>k&&I<=a(k,F)});O.push(...N)}const P=O.reduce((N,I)=>{const F=n.ISOWeek?h(I):m(I),j=N.find(H=>H.weekNumber===F),M=new pE(I,w,r);return j?j.days.push(M):N.push(new IC(F,[M])),N},[]),_=new AC(w,P);return S.push(_),S},[]);return n.reverseMonths?C.reverse():C}function jk(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:a,startOfDay:o,startOfMonth:l,endOfMonth:c,addYears:d,endOfYear:h,newDate:m,today:g}=t,{fromYear:E,toYear:x,fromMonth:C,toMonth:S}=e;!n&&C&&(n=C),!n&&E&&(n=t.newDate(E,0,1)),!r&&S&&(r=S),!r&&x&&(r=m(x,11,31));const w=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=l(n):E?n=m(E,0,1):!n&&w&&(n=a(d(e.today??g(),-100))),r?r=c(r):x?r=m(x,11,31):!r&&w&&(r=h(e.today??g())),[n&&o(n),r&&o(r)]}function Bk(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:o=1}=n,{startOfMonth:l,addMonths:c,differenceInCalendarMonths:d}=r,h=a?o:1,m=l(e);if(!t)return c(m,h);if(!(d(t,e)<o))return c(m,h)}function Hk(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:o}=n,{startOfMonth:l,addMonths:c,differenceInCalendarMonths:d}=r,h=a?o??1:1,m=l(e);if(!t)return c(m,-h);if(!(d(m,t)<=0))return c(m,-h)}function Uk(e){const t=[];return e.reduce((n,r)=>n.concat(r.weeks.slice()),t.slice())}function Wc(e,t){const[n,r]=L.useState(e);return[t===void 0?n:t,r]}function zk(e,t){var A;const[n,r]=jk(e,t),{startOfMonth:a,endOfMonth:o}=t,l=N1(e,n,r,t),[c,d]=Wc(l,e.month?l:void 0);L.useEffect(()=>{const P=N1(e,n,r,t);d(P)},[e.timeZone]);const{months:h,weeks:m,days:g,previousMonth:E,nextMonth:x}=L.useMemo(()=>{const P=Pk(c,r,{numberOfMonths:e.numberOfMonths},t),_=Lk(P,e.endMonth?o(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),N=Fk(P,_,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t),I=Uk(N),F=Mk(N),j=Hk(c,n,e,t),M=Bk(c,r,e,t);return{months:N,weeks:I,days:F,previousMonth:j,nextMonth:M}},[t,c.getTime(),r==null?void 0:r.getTime(),n==null?void 0:n.getTime(),e.disableNavigation,e.broadcastCalendar,(A=e.endMonth)==null?void 0:A.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:C,onMonthChange:S}=e,w=P=>m.some(_=>_.days.some(N=>N.isEqualTo(P))),v=P=>{if(C)return;let _=a(P);n&&_<a(n)&&(_=a(n)),r&&_>a(r)&&(_=a(r)),d(_),S==null||S(_)};return{months:h,weeks:m,days:g,navStart:n,navEnd:r,previousMonth:E,nextMonth:x,goToMonth:v,goToDay:P=>{w(P)||v(P.date)}}}var Qr;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(Qr||(Qr={}));function O1(e){return!e[Bt.disabled]&&!e[Bt.hidden]&&!e[Bt.outside]}function Wk(e,t,n,r){let a,o=-1;for(const l of e){const c=t(l);O1(c)&&(c[Bt.focused]&&o<Qr.FocusedModifier?(a=l,o=Qr.FocusedModifier):r!=null&&r.isEqualTo(l)&&o<Qr.LastFocused?(a=l,o=Qr.LastFocused):n(l.date)&&o<Qr.Selected?(a=l,o=Qr.Selected):c[Bt.today]&&o<Qr.Today&&(a=l,o=Qr.Today))}return a||(a=e.find(l=>O1(t(l)))),a}function Yk(e,t,n,r,a,o,l){const{ISOWeek:c,broadcastCalendar:d}=o,{addDays:h,addMonths:m,addWeeks:g,addYears:E,endOfBroadcastWeek:x,endOfISOWeek:C,endOfWeek:S,max:w,min:v,startOfBroadcastWeek:k,startOfISOWeek:O,startOfWeek:A}=l;let _={day:h,week:g,month:m,year:E,startOfWeek:N=>d?k(N,l):c?O(N):A(N),endOfWeek:N=>d?x(N):c?C(N):S(N)}[e](n,t==="after"?1:-1);return t==="before"&&r?_=w([r,_]):t==="after"&&a&&(_=v([a,_])),_}function OE(e,t,n,r,a,o,l,c=0){if(c>365)return;const d=Yk(e,t,n.date,r,a,o,l),h=!!(o.disabled&&_s(d,o.disabled,l)),m=!!(o.hidden&&_s(d,o.hidden,l)),g=d,E=new pE(d,g,l);return!h&&!m?E:OE(e,t,E,r,a,o,l,c+1)}function qk(e,t,n,r,a){const{autoFocus:o}=e,[l,c]=L.useState(),d=Wk(t.days,n,r||(()=>!1),l),[h,m]=L.useState(o?d:void 0);return{isFocusTarget:S=>!!(d!=null&&d.isEqualTo(S)),setFocused:m,focused:h,blur:()=>{c(h),m(void 0)},moveFocus:(S,w)=>{if(!h)return;const v=OE(S,w,h,t.navStart,t.navEnd,e,a);v&&(e.disableNavigation&&!t.days.some(O=>O.isEqualTo(v))||(t.goToDay(v),m(v)))}}}function $k(e,t){const{selected:n,required:r,onSelect:a}=e,[o,l]=Wc(n,a?n:void 0),c=a?n:o,{isSameDay:d}=t,h=x=>(c==null?void 0:c.some(C=>d(C,x)))??!1,{min:m,max:g}=e;return{selected:c,select:(x,C,S)=>{let w=[...c??[]];if(h(x)){if((c==null?void 0:c.length)===m||r&&(c==null?void 0:c.length)===1)return;w=c==null?void 0:c.filter(v=>!d(v,x))}else(c==null?void 0:c.length)===g?w=[x]:w=[...w,x];return a||l(w),a==null||a(w,x,C,S),w},isSelected:h}}function Vk(e,t,n=0,r=0,a=!1,o=os){const{from:l,to:c}=t||{},{isSameDay:d,isAfter:h,isBefore:m}=o;let g;if(!l&&!c)g={from:e,to:n>0?void 0:e};else if(l&&!c)d(l,e)?n===0?g={from:l,to:e}:a?g={from:l,to:void 0}:g=void 0:m(e,l)?g={from:e,to:l}:g={from:l,to:e};else if(l&&c)if(d(l,e)&&d(c,e))a?g={from:l,to:c}:g=void 0;else if(d(l,e))g={from:l,to:n>0?void 0:e};else if(d(c,e))g={from:e,to:n>0?void 0:e};else if(m(e,l))g={from:e,to:c};else if(h(e,l))g={from:l,to:e};else if(h(e,c))g={from:l,to:e};else throw new Error("Invalid range");if(g!=null&&g.from&&(g!=null&&g.to)){const E=o.differenceInCalendarDays(g.to,g.from);r>0&&E>r?g={from:e,to:void 0}:n>1&&E<n&&(g={from:e,to:void 0})}return g}function Qk(e,t,n=os){const r=Array.isArray(t)?t:[t];let a=e.from;const o=n.differenceInCalendarDays(e.to,e.from),l=Math.min(o,6);for(let c=0;c<=l;c++){if(r.includes(a.getDay()))return!0;a=n.addDays(a,1)}return!1}function D1(e,t,n=os){return Ss(e,t.from,!1,n)||Ss(e,t.to,!1,n)||Ss(t,e.from,!1,n)||Ss(t,e.to,!1,n)}function Gk(e,t,n=os){const r=Array.isArray(t)?t:[t];if(r.filter(c=>typeof c!="function").some(c=>typeof c=="boolean"?c:n.isDate(c)?Ss(e,c,!1,n):yE(c,n)?c.some(d=>Ss(e,d,!1,n)):zc(c)?c.from&&c.to?D1(e,{from:c.from,to:c.to},n):!1:gE(c)?Qk(e,c.dayOfWeek,n):j0(c)?n.isAfter(c.before,c.after)?D1(e,{from:n.addDays(c.after,1),to:n.addDays(c.before,-1)},n):_s(e.from,c,n)||_s(e.to,c,n):B0(c)||H0(c)?_s(e.from,c,n)||_s(e.to,c,n):!1))return!0;const l=r.filter(c=>typeof c=="function");if(l.length){let c=e.from;const d=n.differenceInCalendarDays(e.to,e.from);for(let h=0;h<=d;h++){if(l.some(m=>m(c)))return!0;c=n.addDays(c,1)}}return!1}function Xk(e,t){const{disabled:n,excludeDisabled:r,selected:a,required:o,onSelect:l}=e,[c,d]=Wc(a,l?a:void 0),h=l?a:c;return{selected:h,select:(E,x,C)=>{const{min:S,max:w}=e,v=E?Vk(E,h,S,w,o,t):void 0;return r&&n&&(v!=null&&v.from)&&v.to&&Gk({from:v.from,to:v.to},n,t)&&(v.from=E,v.to=void 0),l||d(v),l==null||l(v,E,x,C),v},isSelected:E=>h&&Ss(h,E,!1,t)}}function Kk(e,t){const{selected:n,required:r,onSelect:a}=e,[o,l]=Wc(n,a?n:void 0),c=a?n:o,{isSameDay:d}=t;return{selected:c,select:(g,E,x)=>{let C=g;return!r&&c&&c&&d(g,c)&&(C=void 0),a||l(C),a==null||a(C,g,E,x),C},isSelected:g=>c?d(c,g):!1}}function Jk(e,t){const n=Kk(e,t),r=$k(e,t),a=Xk(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return a;default:return}}function Er(e,t){return e instanceof Rn&&e.timeZone===t?e:new Rn(e,t)}function Ii(e,t,n){return Er(e,t)}function A1(e,t,n){return typeof e=="boolean"||typeof e=="function"?e:e instanceof Date?Ii(e,t):Array.isArray(e)?e.map(r=>r instanceof Date?Ii(r,t):r):zc(e)?{...e,from:e.from?Er(e.from,t):e.from,to:e.to?Er(e.to,t):e.to}:j0(e)?{before:Ii(e.before,t),after:Ii(e.after,t)}:B0(e)?{after:Ii(e.after,t)}:H0(e)?{before:Ii(e.before,t)}:e}function sh(e,t,n){return e&&(Array.isArray(e)?e.map(r=>A1(r,t)):A1(e,t))}function I1(e){var _r;let t=e;const n=t.timeZone;if(n&&(t={...e,timeZone:n},t.today&&(t.today=Er(t.today,n)),t.month&&(t.month=Er(t.month,n)),t.defaultMonth&&(t.defaultMonth=Er(t.defaultMonth,n)),t.startMonth&&(t.startMonth=Er(t.startMonth,n)),t.endMonth&&(t.endMonth=Er(t.endMonth,n)),t.mode==="single"&&t.selected?t.selected=Er(t.selected,n):t.mode==="multiple"&&t.selected?t.selected=(_r=t.selected)==null?void 0:_r.map(Le=>Er(Le,n)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?Er(t.selected.from,n):t.selected.from,to:t.selected.to?Er(t.selected.to,n):t.selected.to}),t.disabled!==void 0&&(t.disabled=sh(t.disabled,n)),t.hidden!==void 0&&(t.hidden=sh(t.hidden,n)),t.modifiers)){const Le={};Object.keys(t.modifiers).forEach(Qe=>{var be;Le[Qe]=sh((be=t.modifiers)==null?void 0:be[Qe],n)}),t.modifiers=Le}const{components:r,formatters:a,labels:o,dateLib:l,locale:c,classNames:d}=L.useMemo(()=>{const Le={...hE,...t.locale},Qe=t.broadcastCalendar?1:t.weekStartsOn,be=t.noonSafe&&t.timeZone?Ok(t.timeZone,{weekStartsOn:Qe,locale:Le}):void 0,_e=t.dateLib&&be?{...be,...t.dateLib}:t.dateLib??be,Je=new dr({locale:Le,weekStartsOn:Qe,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},_e);return{dateLib:Je,components:uk(t.components),formatters:Ek(t.formatters),labels:Sk(t.labels,Je.options),locale:Le,classNames:{...ck(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.noonSafe,t.components,t.formatters,t.labels,t.classNames]);t.today||(t={...t,today:l.today()});const{captionLayout:h,mode:m,navLayout:g,numberOfMonths:E=1,onDayBlur:x,onDayClick:C,onDayFocus:S,onDayKeyDown:w,onDayMouseEnter:v,onDayMouseLeave:k,onNextClick:O,onPrevClick:A,showWeekNumber:P,styles:_}=t,{formatCaption:N,formatDay:I,formatMonthDropdown:F,formatWeekNumber:j,formatWeekNumberHeader:M,formatWeekdayName:H,formatYearDropdown:$}=a,G=zk(t,l),{days:J,months:Q,navStart:re,navEnd:Z,previousMonth:K,nextMonth:R,goToMonth:ae}=G,ue=ik(J,t,re,Z,l),{isSelected:z,select:Oe,selected:Be}=Jk(t,l)??{},{blur:Te,focused:Ze,isFocusTarget:$e,moveFocus:Ge,setFocused:tt}=qk(t,G,ue,z??(()=>!1),l),{labelDayButton:We,labelGridcell:pn,labelGrid:Gt,labelMonthDropdown:Hn,labelNav:tn,labelPrevious:nn,labelNext:mn,labelWeekday:tr,labelWeekNumber:it,labelWeekNumberHeader:nt,labelYearDropdown:Et}=o,Nt=L.useMemo(()=>kk(l,t.ISOWeek,t.broadcastCalendar,t.today),[l,t.ISOWeek,t.broadcastCalendar,t.today]),on=m!==void 0||C!==void 0,nr=L.useCallback(()=>{K&&(ae(K),A==null||A(K))},[K,ae,A]),un=L.useCallback(()=>{R&&(ae(R),O==null||O(R))},[ae,R,O]),oe=L.useCallback((Le,Qe)=>be=>{be.preventDefault(),be.stopPropagation(),tt(Le),!Qe.disabled&&(Oe==null||Oe(Le.date,Qe,be),C==null||C(Le.date,Qe,be))},[Oe,C,tt]),pe=L.useCallback((Le,Qe)=>be=>{tt(Le),S==null||S(Le.date,Qe,be)},[S,tt]),De=L.useCallback((Le,Qe)=>be=>{Te(),x==null||x(Le.date,Qe,be)},[Te,x]),He=L.useCallback((Le,Qe)=>be=>{const _e={ArrowLeft:[be.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[be.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[be.shiftKey?"year":"week","after"],ArrowUp:[be.shiftKey?"year":"week","before"],PageUp:[be.shiftKey?"year":"month","before"],PageDown:[be.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(_e[be.key]){be.preventDefault(),be.stopPropagation();const[Je,Ce]=_e[be.key];Ge(Je,Ce)}w==null||w(Le.date,Qe,be)},[Ge,w,t.dir]),Ve=L.useCallback((Le,Qe)=>be=>{v==null||v(Le.date,Qe,be)},[v]),gt=L.useCallback((Le,Qe)=>be=>{k==null||k(Le.date,Qe,be)},[k]),zt=L.useCallback(Le=>Qe=>{const be=Number(Qe.target.value),_e=l.setMonth(l.startOfMonth(Le),be);ae(_e)},[l,ae]),rn=L.useCallback(Le=>Qe=>{const be=Number(Qe.target.value),_e=l.setYear(l.startOfMonth(Le),be);ae(_e)},[l,ae]),{className:_n,style:Un}=L.useMemo(()=>({className:[d[Re.Root],t.className].filter(Boolean).join(" "),style:{..._==null?void 0:_[Re.Root],...t.style}}),[d,t.className,t.style,_]),At=lk(t),yt=L.useRef(null);Rk(yt,!!t.animate,{classNames:d,months:Q,focused:Ze,dateLib:l});const ln={dayPickerProps:t,selected:Be,select:Oe,isSelected:z,months:Q,nextMonth:R,previousMonth:K,goToMonth:ae,getModifiers:ue,components:r,classNames:d,styles:_,labels:o,formatters:a};return Ee.createElement(mE.Provider,{value:ln},Ee.createElement(r.Root,{rootRef:t.animate?yt:void 0,className:_n,style:Un,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...At},Ee.createElement(r.Months,{className:d[Re.Months],style:_==null?void 0:_[Re.Months]},!t.hideNavigation&&!g&&Ee.createElement(r.Nav,{"data-animated-nav":t.animate?"true":void 0,className:d[Re.Nav],style:_==null?void 0:_[Re.Nav],"aria-label":tn(),onPreviousClick:nr,onNextClick:un,previousMonth:K,nextMonth:R}),Q.map((Le,Qe)=>Ee.createElement(r.Month,{"data-animated-month":t.animate?"true":void 0,className:d[Re.Month],style:_==null?void 0:_[Re.Month],key:Qe,displayIndex:Qe,calendarMonth:Le},g==="around"&&!t.hideNavigation&&Qe===0&&Ee.createElement(r.PreviousMonthButton,{type:"button",className:d[Re.PreviousMonthButton],tabIndex:K?void 0:-1,"aria-disabled":K?void 0:!0,"aria-label":nn(K),onClick:nr,"data-animated-button":t.animate?"true":void 0},Ee.createElement(r.Chevron,{disabled:K?void 0:!0,className:d[Re.Chevron],orientation:t.dir==="rtl"?"right":"left"})),Ee.createElement(r.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:d[Re.MonthCaption],style:_==null?void 0:_[Re.MonthCaption],calendarMonth:Le,displayIndex:Qe},h!=null&&h.startsWith("dropdown")?Ee.createElement(r.DropdownNav,{className:d[Re.Dropdowns],style:_==null?void 0:_[Re.Dropdowns]},(()=>{const be=h==="dropdown"||h==="dropdown-months"?Ee.createElement(r.MonthsDropdown,{key:"month",className:d[Re.MonthsDropdown],"aria-label":Hn(),classNames:d,components:r,disabled:!!t.disableNavigation,onChange:zt(Le.date),options:_k(Le.date,re,Z,a,l),style:_==null?void 0:_[Re.Dropdown],value:l.getMonth(Le.date)}):Ee.createElement("span",{key:"month"},F(Le.date,l)),_e=h==="dropdown"||h==="dropdown-years"?Ee.createElement(r.YearsDropdown,{key:"year",className:d[Re.YearsDropdown],"aria-label":Et(l.options),classNames:d,components:r,disabled:!!t.disableNavigation,onChange:rn(Le.date),options:Nk(re,Z,a,l,!!t.reverseYears),style:_==null?void 0:_[Re.Dropdown],value:l.getYear(Le.date)}):Ee.createElement("span",{key:"year"},$(Le.date,l));return l.getMonthYearOrder()==="year-first"?[_e,be]:[be,_e]})(),Ee.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},N(Le.date,l.options,l))):Ee.createElement(r.CaptionLabel,{className:d[Re.CaptionLabel],role:"status","aria-live":"polite"},N(Le.date,l.options,l))),g==="around"&&!t.hideNavigation&&Qe===E-1&&Ee.createElement(r.NextMonthButton,{type:"button",className:d[Re.NextMonthButton],tabIndex:R?void 0:-1,"aria-disabled":R?void 0:!0,"aria-label":mn(R),onClick:un,"data-animated-button":t.animate?"true":void 0},Ee.createElement(r.Chevron,{disabled:R?void 0:!0,className:d[Re.Chevron],orientation:t.dir==="rtl"?"left":"right"})),Qe===E-1&&g==="after"&&!t.hideNavigation&&Ee.createElement(r.Nav,{"data-animated-nav":t.animate?"true":void 0,className:d[Re.Nav],style:_==null?void 0:_[Re.Nav],"aria-label":tn(),onPreviousClick:nr,onNextClick:un,previousMonth:K,nextMonth:R}),Ee.createElement(r.MonthGrid,{role:"grid","aria-multiselectable":m==="multiple"||m==="range","aria-label":Gt(Le.date,l.options,l)||void 0,className:d[Re.MonthGrid],style:_==null?void 0:_[Re.MonthGrid]},!t.hideWeekdays&&Ee.createElement(r.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:d[Re.Weekdays],style:_==null?void 0:_[Re.Weekdays]},P&&Ee.createElement(r.WeekNumberHeader,{"aria-label":nt(l.options),className:d[Re.WeekNumberHeader],style:_==null?void 0:_[Re.WeekNumberHeader],scope:"col"},M()),Nt.map(be=>Ee.createElement(r.Weekday,{"aria-label":tr(be,l.options,l),className:d[Re.Weekday],key:String(be),style:_==null?void 0:_[Re.Weekday],scope:"col"},H(be,l.options,l)))),Ee.createElement(r.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:d[Re.Weeks],style:_==null?void 0:_[Re.Weeks]},Le.weeks.map(be=>Ee.createElement(r.Week,{className:d[Re.Week],key:be.weekNumber,style:_==null?void 0:_[Re.Week],week:be},P&&Ee.createElement(r.WeekNumber,{week:be,style:_==null?void 0:_[Re.WeekNumber],"aria-label":it(be.weekNumber,{locale:c}),className:d[Re.WeekNumber],scope:"row",role:"rowheader"},j(be.weekNumber,l)),be.days.map(_e=>{const{date:Je}=_e,Ce=ue(_e);if(Ce[Bt.focused]=!Ce.hidden&&!!(Ze!=null&&Ze.isEqualTo(_e)),Ce[Fr.selected]=(z==null?void 0:z(Je))||Ce.selected,zc(Be)){const{from:Rt,to:qt}=Be;Ce[Fr.range_start]=!!(Rt&&qt&&l.isSameDay(Je,Rt)),Ce[Fr.range_end]=!!(Rt&&qt&&l.isSameDay(Je,qt)),Ce[Fr.range_middle]=Ss(Be,Je,!0,l)}const It=Ck(Ce,_,t.modifiersStyles),Wt=ok(Ce,d,t.modifiersClassNames),Yt=!on&&!Ce.hidden?pn(Je,Ce,l.options,l):void 0;return Ee.createElement(r.Day,{key:`${_e.isoDate}_${_e.displayMonthId}`,day:_e,modifiers:Ce,className:Wt.join(" "),style:It,role:"gridcell","aria-selected":Ce.selected||void 0,"aria-label":Yt,"data-day":_e.isoDate,"data-month":_e.outside?_e.dateMonthId:void 0,"data-selected":Ce.selected||void 0,"data-disabled":Ce.disabled||void 0,"data-hidden":Ce.hidden||void 0,"data-outside":_e.outside||void 0,"data-focused":Ce.focused||void 0,"data-today":Ce.today||void 0},!Ce.hidden&&on?Ee.createElement(r.DayButton,{className:d[Re.DayButton],style:_==null?void 0:_[Re.DayButton],type:"button",day:_e,modifiers:Ce,disabled:!Ce.focused&&Ce.disabled||void 0,"aria-disabled":Ce.focused&&Ce.disabled||void 0,tabIndex:$e(_e)?0:-1,"aria-label":We(Je,Ce,l.options,l),onClick:oe(_e,Ce),onBlur:De(_e,Ce),onFocus:pe(_e,Ce),onKeyDown:He(_e,Ce),onMouseEnter:Ve(_e,Ce),onMouseLeave:gt(_e,Ce)},I(Je,l.options,l)):!Ce.hidden&&I(_e.date,l.options,l))})))))))),t.footer&&Ee.createElement(r.Footer,{className:d[Re.Footer],style:_==null?void 0:_[Re.Footer],role:"status","aria-live":"polite"},t.footer)))}function uo({trigger:e,children:t,isOpen:n,onOpenChange:r,width:a=340}){const[o,l]=L.useState(!1),c=L.useRef(null),d=L.useRef(null),h=n!==void 0?n:o,m=L.useCallback(E=>{r?r(E):l(E)},[r]),g=L.useCallback(()=>m(!1),[m]);return L.useEffect(()=>{if(!h)return;function E(x){const C=x.target;c.current&&!c.current.contains(C)&&d.current&&!d.current.contains(C)&&g()}return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[h,g]),L.useEffect(()=>{if(!h)return;function E(x){x.key==="Escape"&&g()}return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[h,g]),p.jsxs("div",{className:"relative",style:{display:"inline-flex"},children:[p.jsx("div",{ref:d,onClick:()=>m(!h),children:e}),h&&p.jsx("div",{ref:c,className:"absolute top-full left-0 mt-1 bg-white rounded-lg shadow-lg border z-50",style:{borderColor:"var(--yc-color-border, #e5e7eb)",width:a},children:t})]})}function lo(){const[e,t]=L.useState(!1);return{isOpen:e,open:()=>t(!0),close:()=>t(!1),toggle:()=>t(n=>!n),onOpenChange:t}}function co({label:e,value:t,active:n,icon:r,onClick:a}){return p.jsxs("button",{type:"button",onClick:a,className:"flex items-center gap-1.5 border rounded-full px-3 py-1.5 text-sm cursor-pointer transition-colors hover:border-blue-300",style:{borderColor:n?"#93c5fd":"var(--yc-color-border, #e5e7eb)",backgroundColor:n?"#eff6ff":"white"},children:[r&&p.jsx("span",{className:"flex-shrink-0 text-gray-400",children:r}),t?p.jsx("span",{style:{color:n?"#2563eb":"var(--yc-color-text, #111)"},className:"font-medium",children:t}):p.jsx("span",{className:"text-gray-500",children:e}),p.jsx("svg",{className:"w-3 h-3 text-gray-400 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})}function si({title:e,onBack:t}){return p.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:[t&&p.jsx("button",{type:"button",onClick:t,className:"flex items-center justify-center w-6 h-6 rounded hover:bg-gray-100 text-gray-500",children:p.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),p.jsx("span",{className:"text-sm font-medium",style:{color:"var(--yc-color-text, #111)"},children:e})]})}const DE=[{value:"today",label:"Today"},{value:"yesterday",label:"Yesterday"},{value:"last_7_days",label:"Previous 7 days"},{value:"last_30_days",label:"Previous 30 days"},{value:"last_90_days",label:"Previous 90 days"},{divider:!0},{value:"previous_month",label:"Previous month"},{value:"previous_quarter",label:"Previous quarter"},{value:"previous_year",label:"Previous year"},{divider:!0},{value:"month_to_date",label:"Month to date"},{value:"quarter_to_date",label:"Quarter to date"},{value:"year_to_date",label:"Year to date"},{value:"last_12_months",label:"Last 12 months"}],Zk=`
|
|
34
|
-
.rdp-root {
|
|
35
|
-
--rdp-accent-color: #2563eb;
|
|
36
|
-
--rdp-accent-background-color: #dbeafe;
|
|
37
|
-
--rdp-range_start-color: white;
|
|
38
|
-
--rdp-range_start-background: #2563eb;
|
|
39
|
-
--rdp-range_end-color: white;
|
|
40
|
-
--rdp-range_end-background: #2563eb;
|
|
41
|
-
--rdp-range_middle-background: #dbeafe;
|
|
42
|
-
--rdp-range_middle-color: #1e40af;
|
|
43
|
-
}
|
|
44
|
-
.rdp-day { border-radius: 6px; }
|
|
45
|
-
.rdp-selected .rdp-day_button { font-weight: 600; }
|
|
46
|
-
.rdp-range_start .rdp-day_button,
|
|
47
|
-
.rdp-range_end .rdp-day_button {
|
|
48
|
-
background-color: #2563eb !important;
|
|
49
|
-
color: white !important;
|
|
50
|
-
font-weight: 600;
|
|
51
|
-
}
|
|
52
|
-
.rdp-range_middle .rdp-day_button {
|
|
53
|
-
background-color: #dbeafe !important;
|
|
54
|
-
color: #1e40af !important;
|
|
55
|
-
}
|
|
56
|
-
.rdp-today .rdp-day_button {
|
|
57
|
-
font-weight: 700;
|
|
58
|
-
border: 2px solid #2563eb;
|
|
59
|
-
}
|
|
60
|
-
.rdp-day_button:hover { background-color: #e5e7eb !important; }
|
|
61
|
-
.rdp-range_start .rdp-day_button:hover,
|
|
62
|
-
.rdp-range_end .rdp-day_button:hover {
|
|
63
|
-
background-color: #1d4ed8 !important;
|
|
64
|
-
}
|
|
65
|
-
`;function Kh(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="custom"}function AE(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="relative"}function IE(e){const n=to(new Date);if(e.direction==="current")switch(e.unit){case"day":return{start:n,end:iS(n)};case"week":return{start:ss(n,{weekStartsOn:1}),end:L0(n,{weekStartsOn:1})};case"month":return{start:nE(n),end:eE(n)};case"quarter":return{start:uS(n),end:dS(n)};case"year":return{start:R0(n),end:rE(n)}}const r=e.value??1,a=e.direction==="previous",l=(a?{day:C1,week:CC,month:SC,quarter:_C,year:kC}:{day:Ja,week:A0,month:Yu,quarter:Kb,year:I0})[e.unit];if(a){const c=e.includeToday?n:C1(n,1),d=l((e.includeToday,n),r);return{start:d<c?d:c,end:d<c?c:d}}else{const c=e.includeToday?n:Ja(n,1),d=l(c,r);return{start:c<d?c:d,end:c<d?d:c}}}function eN(e){if(Kh(e))return`${e.start} to ${e.end}`;if(AE(e)){const t=IE(e);return`${hn(t.start,"MMM d")} – ${hn(t.end,"MMM d, yyyy")}`}if(typeof e=="string"){const t=DE.find(r=>"value"in r&&r.value===e);return t&&"label"in t?t.label:{last_7_days:"Previous 7 days",last_30_days:"Previous 30 days",last_90_days:"Previous 90 days",last_12_months:"Last 12 months"}[e]||e.replace(/_/g," ").replace(/\b\w/g,r=>r.toUpperCase())}return String(e)}const tN=p.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})});function RE({name:e,label:t="Date",chartName:n,defaultValue:r="last_30_days"}){var x;const a=lo(),o=qe(C=>C.globalFilters),l=qe(C=>C.chartFilters),c=qe(C=>C.setGlobalFilter),d=qe(C=>C.setChartFilter),h=n?((x=l[n])==null?void 0:x[e])??o[e]??r:o[e]??r;L.useEffect(()=>{var S;(n?((S=l[n])==null?void 0:S[e])??o[e]:o[e])===void 0&&r&&(n?d(n,e,r):c(e,r))},[n,e,r,o,l,c,d]);const m=C=>{const S=C;n?d(n,e,S):c(e,S),a.close()},g=typeof h=="string"?h!==r:!0,E=eN(h);return p.jsx(uo,{isOpen:a.isOpen,onOpenChange:a.onOpenChange,width:520,trigger:p.jsx(co,{label:t,value:E,active:g,icon:tN}),children:p.jsx(nN,{currentValue:h,onApply:m,onClose:a.close})})}function nN({currentValue:e,onApply:t,onClose:n}){const[r,a]=L.useState("presets");return p.jsxs("div",{children:[r==="presets"&&p.jsx(rN,{currentValue:e,onSelectPreset:o=>{t(o),n()},onNavigate:a}),r==="fixed"&&p.jsx(sN,{currentValue:e,onApply:t,onBack:()=>a("presets")}),r==="relative"&&p.jsx(aN,{currentValue:e,onApply:t,onBack:()=>a("presets")})]})}function rN({currentValue:e,onSelectPreset:t,onNavigate:n}){return p.jsxs("div",{className:"py-1",children:[DE.map((r,a)=>{if("divider"in r)return p.jsx("div",{className:"border-t my-1",style:{borderColor:"var(--yc-color-border, #e5e7eb)"}},`divider-${a}`);const o=typeof e=="string"&&e===r.value;return p.jsxs("button",{type:"button",onClick:()=>t(r.value),className:"w-full text-left px-4 py-2 text-sm hover:bg-gray-50 flex items-center justify-between",style:{color:o?"#2563eb":"var(--yc-color-text, #111)"},children:[p.jsx("span",{className:o?"font-medium":"",children:r.label}),o&&p.jsx("svg",{className:"w-4 h-4 text-blue-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})]},r.value)}),p.jsx("div",{className:"border-t my-1",style:{borderColor:"var(--yc-color-border, #e5e7eb)"}}),p.jsxs("button",{type:"button",onClick:()=>n("fixed"),className:"w-full text-left px-4 py-2 text-sm hover:bg-gray-50 flex items-center justify-between",style:{color:"var(--yc-color-text, #111)"},children:[p.jsx("span",{children:"Fixed date range..."}),p.jsx("svg",{className:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]}),p.jsxs("button",{type:"button",onClick:()=>n("relative"),className:"w-full text-left px-4 py-2 text-sm hover:bg-gray-50 flex items-center justify-between",style:{color:"var(--yc-color-text, #111)"},children:[p.jsx("span",{children:"Relative date range..."}),p.jsx("svg",{className:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})]})}function sN({currentValue:e,onApply:t,onBack:n}){const[r,a]=L.useState("between"),[o,l]=L.useState(()=>{if(Kh(e)){const E=Zf(e.start,"yyyy-MM-dd",new Date),x=Zf(e.end,"yyyy-MM-dd",new Date);return{from:E,to:x}}}),[c,d]=L.useState(()=>{if(Kh(e)&&r!=="between")return Zf(e.start,"yyyy-MM-dd",new Date)}),h=()=>{if(r==="between"&&(o!=null&&o.from)&&(o!=null&&o.to))t({type:"custom",start:hn(o.from,"yyyy-MM-dd"),end:hn(o.to,"yyyy-MM-dd")});else if(r==="on"&&c){const E=hn(c,"yyyy-MM-dd");t({type:"custom",start:E,end:E})}else r==="before"&&c?t({type:"custom",start:"1970-01-01",end:hn(c,"yyyy-MM-dd")}):r==="after"&&c&&t({type:"custom",start:hn(c,"yyyy-MM-dd"),end:hn(new Date(2099,11,31),"yyyy-MM-dd")})},m=r==="between"?!!(o!=null&&o.from&&(o!=null&&o.to)):!!c,g=[{key:"between",label:"Between"},{key:"before",label:"Before"},{key:"on",label:"On"},{key:"after",label:"After"}];return p.jsxs("div",{children:[p.jsx(si,{title:"Fixed date range",onBack:n}),p.jsx("div",{className:"px-4 pt-3",children:p.jsx("div",{className:"flex gap-1 mb-3",children:g.map(E=>p.jsx("button",{type:"button",onClick:()=>a(E.key),className:`px-3 py-1 text-xs rounded-full font-medium transition-colors ${r===E.key?"bg-blue-100 text-blue-700":"text-gray-500 hover:bg-gray-100"}`,children:E.label},E.key))})}),p.jsxs("div",{className:"px-4 flex justify-center",children:[p.jsx("style",{children:Zk}),r==="between"?p.jsx(I1,{mode:"range",selected:o,onSelect:l,numberOfMonths:2,defaultMonth:(o==null?void 0:o.from)||new Date}):p.jsx(I1,{mode:"single",selected:c,onSelect:d,numberOfMonths:2,defaultMonth:c||new Date})]}),p.jsx("div",{className:"flex justify-end px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:p.jsx("button",{type:"button",onClick:h,disabled:!m,className:"px-4 py-1.5 text-sm font-medium bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-40 disabled:cursor-not-allowed",children:"Update filter"})})]})}function aN({currentValue:e,onApply:t,onBack:n}){const r=AE(e)?e:{direction:"previous",value:30,unit:"day",includeToday:!1},[a,o]=L.useState(r.direction),[l,c]=L.useState(r.value??30),[d,h]=L.useState(r.unit),[m,g]=L.useState(r.includeToday??!1),E=L.useMemo(()=>{const k=IE({direction:a,value:a==="current"?void 0:l,unit:d,includeToday:m}),O=k.start.getFullYear(),A=k.end.getFullYear();return O===A?`${hn(k.start,"MMM d")} – ${hn(k.end,"MMM d, yyyy")}`:`${hn(k.start,"MMM d, yyyy")} – ${hn(k.end,"MMM d, yyyy")}`},[a,l,d,m]),x=()=>{t({type:"relative",direction:a,value:a==="current"?void 0:l,unit:d,includeToday:m})},C=[{key:"previous",label:"Previous"},{key:"current",label:"Current"},{key:"next",label:"Next"}],S=[{value:"day",label:"days"},{value:"week",label:"weeks"},{value:"month",label:"months"},{value:"quarter",label:"quarters"},{value:"year",label:"years"}],w=[{value:"day",label:"Day"},{value:"week",label:"Week"},{value:"month",label:"Month"},{value:"quarter",label:"Quarter"},{value:"year",label:"Year"}];return p.jsxs("div",{children:[p.jsx(si,{title:"Relative date range",onBack:n}),p.jsxs("div",{className:"p-4 space-y-4",children:[p.jsx("div",{className:"flex gap-1",children:C.map(v=>p.jsx("button",{type:"button",onClick:()=>o(v.key),className:`px-3 py-1 text-xs rounded-full font-medium transition-colors ${a===v.key?"bg-blue-100 text-blue-700":"text-gray-500 hover:bg-gray-100"}`,children:v.label},v.key))}),a==="current"?p.jsx("div",{className:"flex gap-2",children:w.map(v=>p.jsx("button",{type:"button",onClick:()=>h(v.value),className:`px-3 py-1.5 text-sm rounded border transition-colors ${d===v.value?"bg-blue-50 border-blue-300 text-blue-700 font-medium":"border-gray-200 text-gray-600 hover:bg-gray-50"}`,children:v.label},v.value))}):p.jsxs("div",{className:"flex gap-2",children:[p.jsx("input",{type:"number",min:1,value:l,onChange:v=>c(Math.max(1,parseInt(v.target.value)||1)),className:"w-20 px-3 py-1.5 border rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-400",style:{borderColor:"var(--yc-color-border, #e5e7eb)"}}),p.jsx("select",{value:d,onChange:v=>h(v.target.value),className:"px-3 py-1.5 border rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-400 bg-white",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:S.map(v=>p.jsx("option",{value:v.value,children:v.label},v.value))})]}),a!=="current"&&p.jsxs("label",{className:"flex items-center gap-2 text-sm text-gray-600 cursor-pointer",children:[p.jsx("input",{type:"checkbox",checked:m,onChange:v=>g(v.target.checked),className:"rounded border-gray-300"}),"Include today"]}),p.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[p.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),p.jsx("span",{children:E})]})]}),p.jsx("div",{className:"flex justify-end px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:p.jsx("button",{type:"button",onClick:x,className:"px-4 py-1.5 text-sm font-medium bg-blue-600 text-white rounded hover:bg-blue-700",children:"Update filter"})})]})}function Dc({name:e,label:t=e,options:n,chartName:r,defaultValue:a,source:o}){var I,F;const l=lo(),c=qe(j=>j.globalFilters),d=qe(j=>j.chartFilters),h=qe(j=>j.setGlobalFilter),m=qe(j=>j.setChartFilter),g=!!o,{data:E,isLoading:x}=is({queryKey:g?r?["parameterOptions",r,e]:["modelOptions",o.model,o.value_field,o.label_field]:["noop"],queryFn:()=>r?Pt.getParameterOptions(r,e):Pt.getModelOptions(o.model,o.value_field,o.label_field),enabled:g,staleTime:300*1e3}),C=g?[{value:"",label:"All"},...(E==null?void 0:E.options)??[]]:[{value:"",label:"All"},...n??[]],S=r?((I=d[r])==null?void 0:I[e])??c[e]??a??"":c[e]??a??"",[w,v]=L.useState(S),[k,O]=L.useState("");L.useEffect(()=>{l.isOpen&&(v(S),O(""))},[l.isOpen,S]),L.useEffect(()=>{var M;(r?((M=d[r])==null?void 0:M[e])??c[e]:c[e])===void 0&&a&&(r?m(r,e,a):h(e,a))},[r,e,a,c,d,h,m]);const A=()=>{r?m(r,e,w):h(e,w),l.close()},P=k?C.filter(j=>j.label.toLowerCase().includes(k.toLowerCase())):C,_=S?((F=C.find(j=>j.value===S))==null?void 0:F.label)||S:void 0,N=!!S&&S!==a;return g&&x?p.jsx("div",{className:"flex items-center border rounded-full px-3 py-1.5 text-sm bg-white gap-1.5",style:{borderColor:"var(--yc-color-border)"},children:p.jsx("span",{className:"text-gray-400 text-sm",children:"Loading..."})}):p.jsxs(uo,{isOpen:l.isOpen,onOpenChange:l.onOpenChange,trigger:p.jsx(co,{label:t,value:_||t,active:N}),children:[p.jsx(si,{title:t}),p.jsxs("div",{className:"p-3",children:[C.length>6&&p.jsx("div",{className:"mb-2",children:p.jsx("input",{type:"text",placeholder:"Search...",value:k,onChange:j=>O(j.target.value),className:"w-full px-3 py-1.5 border rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-400",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},autoFocus:!0})}),p.jsxs("div",{className:"max-h-60 overflow-y-auto",children:[P.map(j=>p.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-gray-50 cursor-pointer text-sm",children:[p.jsx("input",{type:"radio",name:`select-${e}`,checked:w===j.value,onChange:()=>v(j.value),className:"text-blue-600"}),p.jsx("span",{style:{color:"var(--yc-color-text, #111)"},children:j.label})]},j.value)),P.length===0&&p.jsx("div",{className:"text-sm text-gray-400 px-2 py-3 text-center",children:"No matches"})]})]}),p.jsx("div",{className:"flex justify-end px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:p.jsx("button",{type:"button",onClick:A,className:"px-4 py-1.5 text-sm font-medium bg-blue-600 text-white rounded hover:bg-blue-700",children:"Update filter"})})]})}function LE({name:e,label:t=e,options:n,chartName:r,defaultValue:a,source:o}){const l=lo(),c=qe(M=>M.globalFilters),d=qe(M=>M.chartFilters),h=qe(M=>M.setGlobalFilter),m=qe(M=>M.setChartFilter),g=!!o,{data:E,isLoading:x}=is({queryKey:g?r?["parameterOptions",r,e]:["modelOptions",o.model,o.value_field,o.label_field]:["noop"],queryFn:()=>r?Pt.getParameterOptions(r,e):Pt.getModelOptions(o.model,o.value_field,o.label_field),enabled:g,staleTime:300*1e3}),C=g?(E==null?void 0:E.options)??[]:n??[],S=(()=>{var H;const M=r?((H=d[r])==null?void 0:H[e])??c[e]??a??[]:c[e]??a??[];return Array.isArray(M)?M:[]})(),[w,v]=L.useState(S),[k,O]=L.useState("");L.useEffect(()=>{l.isOpen&&(v(S),O(""))},[l.isOpen]),L.useEffect(()=>{var H;(r?((H=d[r])==null?void 0:H[e])??c[e]:c[e])===void 0&&a&&(r?m(r,e,a):h(e,a))},[r,e,a,c,d,h,m]);const A=M=>{v(H=>H.includes(M)?H.filter($=>$!==M):[...H,M])},P=()=>{w.length===C.length?v([]):v(C.map(M=>M.value))},_=()=>{r?m(r,e,w):h(e,w),l.close()},N=k?C.filter(M=>M.label.toLowerCase().includes(k.toLowerCase())):C,I=S.length===0?void 0:S.length<=2?S.map(M=>{var H;return((H=C.find($=>$.value===M))==null?void 0:H.label)||M}).join(", "):`${S.length} selected`,F=S.length>0,j=w.length===C.length&&C.length>0;return g&&x?p.jsx("div",{className:"flex items-center border rounded-full px-3 py-1.5 text-sm bg-white gap-1.5",style:{borderColor:"var(--yc-color-border)"},children:p.jsx("span",{className:"text-gray-400 text-sm",children:"Loading..."})}):p.jsxs(uo,{isOpen:l.isOpen,onOpenChange:l.onOpenChange,trigger:p.jsx(co,{label:t,value:I||t,active:F}),children:[p.jsx(si,{title:t}),p.jsxs("div",{className:"p-3",children:[C.length>6&&p.jsx("div",{className:"mb-2",children:p.jsx("input",{type:"text",placeholder:"Search...",value:k,onChange:M=>O(M.target.value),className:"w-full px-3 py-1.5 border rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-400",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},autoFocus:!0})}),p.jsxs("div",{className:"max-h-60 overflow-y-auto",children:[!k&&p.jsxs(p.Fragment,{children:[p.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-gray-50 cursor-pointer text-sm font-medium",children:[p.jsx("input",{type:"checkbox",checked:j,onChange:P,className:"text-blue-600 rounded"}),p.jsx("span",{style:{color:"var(--yc-color-text, #111)"},children:"Select all"})]}),p.jsx("div",{className:"border-t my-1",style:{borderColor:"var(--yc-color-border, #e5e7eb)"}})]}),N.map(M=>p.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-gray-50 cursor-pointer text-sm",children:[p.jsx("input",{type:"checkbox",checked:w.includes(M.value),onChange:()=>A(M.value),className:"text-blue-600 rounded"}),p.jsx("span",{style:{color:"var(--yc-color-text, #111)"},children:M.label})]},M.value)),N.length===0&&p.jsx("div",{className:"text-sm text-gray-400 px-2 py-3 text-center",children:"No matches"})]})]}),p.jsx("div",{className:"flex justify-end px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:p.jsx("button",{type:"button",onClick:_,className:"px-4 py-1.5 text-sm font-medium bg-blue-600 text-white rounded hover:bg-blue-700",children:"Update filter"})})]})}const Jh=[{value:"is",label:"is"},{value:"is_not",label:"is not"},{value:"contains",label:"contains"},{value:"does_not_contain",label:"does not contain"},{value:"starts_with",label:"starts with"},{value:"ends_with",label:"ends with"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],ME=["is_empty","is_not_empty"];function PE(e){return typeof e=="object"&&e!==null&&"operator"in e&&"value"in e}function iN(e){var t,n;if(PE(e))return ME.includes(e.operator)?(t=Jh.find(a=>a.value===e.operator))==null?void 0:t.label:`${((n=Jh.find(a=>a.value===e.operator))==null?void 0:n.label)||e.operator} "${e.value}"`;if(typeof e=="string"&&e)return e}function FE({name:e,label:t=e,chartName:n,defaultValue:r}){var O;const a=lo(),o=qe(A=>A.globalFilters),l=qe(A=>A.chartFilters),c=qe(A=>A.setGlobalFilter),d=qe(A=>A.setChartFilter),h=n?((O=l[n])==null?void 0:O[e])??o[e]??r??null:o[e]??r??null,[m,g]=L.useState("contains"),[E,x]=L.useState("");L.useEffect(()=>{a.isOpen&&(PE(h)?(g(h.operator),x(h.value)):typeof h=="string"?(g("is"),x(h)):(g("contains"),x("")))},[a.isOpen]);const C=()=>{const A={operator:m,value:E};n?d(n,e,A):c(e,A),a.close()},S=!ME.includes(m),w=!S||E.trim().length>0,v=iN(h),k=!!v;return p.jsxs(uo,{isOpen:a.isOpen,onOpenChange:a.onOpenChange,trigger:p.jsx(co,{label:t,value:v||t,active:k}),children:[p.jsx(si,{title:t}),p.jsxs("div",{className:"p-4 space-y-3",children:[p.jsx("select",{value:m,onChange:A=>g(A.target.value),className:"w-full px-3 py-1.5 border rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-400 bg-white",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:Jh.map(A=>p.jsx("option",{value:A.value,children:A.label},A.value))}),S&&p.jsx("input",{type:"text",value:E,onChange:A=>x(A.target.value),placeholder:"Enter value...",className:"w-full px-3 py-1.5 border rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-400",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},autoFocus:!0,onKeyDown:A=>{A.key==="Enter"&&w&&C()}})]}),p.jsx("div",{className:"flex justify-end px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:p.jsx("button",{type:"button",onClick:C,disabled:!w,className:"px-4 py-1.5 text-sm font-medium bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-40 disabled:cursor-not-allowed",children:"Update filter"})})]})}const Zh=[{value:"equal",label:"equal to"},{value:"not_equal",label:"not equal to"},{value:"greater",label:"greater than"},{value:"less",label:"less than"},{value:"greater_or_equal",label:"greater than or equal to"},{value:"less_or_equal",label:"less than or equal to"},{value:"between",label:"between"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],jE=["is_empty","is_not_empty"];function BE(e){return typeof e=="object"&&e!==null&&"operator"in e&&"value"in e&&typeof e.value=="number"}function oN(e){var t,n;if(BE(e)){if(jE.includes(e.operator))return(t=Zh.find(a=>a.value===e.operator))==null?void 0:t.label;const r=((n=Zh.find(a=>a.value===e.operator))==null?void 0:n.label)||e.operator;return e.operator==="between"&&e.value2!==void 0?`${e.value} – ${e.value2}`:`${r} ${e.value}`}if(typeof e=="number")return String(e)}function HE({name:e,label:t=e,chartName:n,defaultValue:r}){var _;const a=lo(),o=qe(N=>N.globalFilters),l=qe(N=>N.chartFilters),c=qe(N=>N.setGlobalFilter),d=qe(N=>N.setChartFilter),h=n?((_=l[n])==null?void 0:_[e])??o[e]??r??null:o[e]??r??null,[m,g]=L.useState("equal"),[E,x]=L.useState(""),[C,S]=L.useState("");L.useEffect(()=>{a.isOpen&&(BE(h)?(g(h.operator),x(String(h.value)),S(h.value2!==void 0?String(h.value2):"")):typeof h=="number"?(g("equal"),x(String(h)),S("")):(g("equal"),x(""),S("")))},[a.isOpen]);const w=()=>{const N={operator:m,value:parseFloat(E)||0,...m==="between"?{value2:parseFloat(C)||0}:{}};n?d(n,e,N):c(e,N),a.close()},v=!jE.includes(m),k=m==="between",O=!v||E!==""&&(!k||C!==""),A=oN(h),P=!!A;return p.jsxs(uo,{isOpen:a.isOpen,onOpenChange:a.onOpenChange,trigger:p.jsx(co,{label:t,value:A||t,active:P}),children:[p.jsx(si,{title:t}),p.jsxs("div",{className:"p-4 space-y-3",children:[p.jsx("select",{value:m,onChange:N=>g(N.target.value),className:"w-full px-3 py-1.5 border rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-400 bg-white",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:Zh.map(N=>p.jsx("option",{value:N.value,children:N.label},N.value))}),v&&p.jsxs("div",{className:"flex gap-2",children:[p.jsx("input",{type:"number",value:E,onChange:N=>x(N.target.value),placeholder:k?"Min":"Enter value...",className:"w-full px-3 py-1.5 border rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-400",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},autoFocus:!0,onKeyDown:N=>{N.key==="Enter"&&O&&w()}}),k&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-sm text-gray-400 self-center",children:"and"}),p.jsx("input",{type:"number",value:C,onChange:N=>S(N.target.value),placeholder:"Max",className:"w-full px-3 py-1.5 border rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-400",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},onKeyDown:N=>{N.key==="Enter"&&O&&w()}})]})]})]}),p.jsx("div",{className:"flex justify-end px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:p.jsx("button",{type:"button",onClick:w,disabled:!O,className:"px-4 py-1.5 text-sm font-medium bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-40 disabled:cursor-not-allowed",children:"Update filter"})})]})}function UE({name:e,label:t=e,chartName:n}){var C;const r=lo(),a=qe(S=>S.globalFilters),o=qe(S=>S.chartFilters),l=qe(S=>S.setGlobalFilter),c=qe(S=>S.setChartFilter),d=n?((C=o[n])==null?void 0:C[e])??a[e]??null:a[e]??null,[h,m]=L.useState(typeof d=="boolean"?d:null);L.useEffect(()=>{r.isOpen&&m(typeof d=="boolean"?d:null)},[r.isOpen]);const g=()=>{n?c(n,e,h):l(e,h),r.close()},E=typeof d=="boolean"?d?"True":"False":void 0,x=typeof d=="boolean";return p.jsxs(uo,{isOpen:r.isOpen,onOpenChange:r.onOpenChange,width:240,trigger:p.jsx(co,{label:t,value:E||t,active:x}),children:[p.jsx(si,{title:t}),p.jsxs("div",{className:"p-4 space-y-1",children:[[{value:!0,label:"True"},{value:!1,label:"False"}].map(S=>p.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-gray-50 cursor-pointer text-sm",children:[p.jsx("input",{type:"radio",name:`bool-${e}`,checked:h===S.value,onChange:()=>m(S.value),className:"text-blue-600"}),p.jsx("span",{style:{color:"var(--yc-color-text, #111)"},children:S.label})]},String(S.value))),p.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-gray-50 cursor-pointer text-sm text-gray-400",children:[p.jsx("input",{type:"radio",name:`bool-${e}`,checked:h===null,onChange:()=>m(null),className:"text-blue-600"}),p.jsx("span",{children:"Any"})]})]}),p.jsx("div",{className:"flex justify-end px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:p.jsx("button",{type:"button",onClick:g,className:"px-4 py-1.5 text-sm font-medium bg-blue-600 text-white rounded hover:bg-blue-700",children:"Update filter"})})]})}function Du(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[_-]/g," ").replace(/\b\w/g,t=>t.toUpperCase()).trim()}function zE({parameters:e,chartName:t}){return e.length===0?null:p.jsx("div",{className:"flex flex-wrap items-center gap-2",children:e.map(n=>{const r=n.label||Du(n.name),a=typeof n.default=="string"?n.default:void 0;switch(n.type){case"date_range":return p.jsx(RE,{name:n.name,label:r,chartName:t,defaultValue:a},n.name);case"select":{const o=(n.options||[]).map(l=>typeof l=="string"?{value:l,label:l}:l);return p.jsx(Dc,{name:n.name,label:r,options:o,chartName:t,defaultValue:a},n.name)}case"dynamic_select":return!t&&!n.source?p.jsxs("div",{className:"text-sm text-gray-500",children:[r,": dynamic_select requires chartName or source"]},n.name):p.jsx(Dc,{name:n.name,label:r,chartName:t,defaultValue:a,source:n.source},n.name);case"multi_select":{const o=(n.options||[]).map(l=>typeof l=="string"?{value:l,label:l}:l);return p.jsx(LE,{name:n.name,label:r,options:o,chartName:t,defaultValue:Array.isArray(n.default)?n.default:void 0,source:n.source},n.name)}case"text":return p.jsx(FE,{name:n.name,label:r,chartName:t,defaultValue:a},n.name);case"number":return p.jsx(HE,{name:n.name,label:r,chartName:t,defaultValue:typeof n.default=="number"?n.default:void 0},n.name);case"boolean":return p.jsx(UE,{name:n.name,label:r,chartName:t},n.name);default:return p.jsxs("div",{className:"text-sm text-gray-500",children:[r,": ",n.type," (not supported)"]},n.name)}})})}function uN({resourceType:e,resourceName:t}){const n=eo(S=>S.auth),[r,a]=L.useState(!1),[o,l]=L.useState(null),[c,d]=L.useState(null),[h,m]=L.useState(!1),g=L.useRef(null);if(n.status!=="authenticated")return null;const E=n.user.role==="admin"||n.user.role==="editor";L.useEffect(()=>{if(!r)return;const S=w=>{g.current&&!g.current.contains(w.target)&&a(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[r]);const x=async()=>{const S=e==="dashboard"?`#/dashboards/${t}`:`#/charts/${t}`,w=`${window.location.origin}/${S}`;await navigator.clipboard.writeText(w),d("link"),setTimeout(()=>d(null),2e3)},C=async()=>{m(!0);try{const S=await Pt.createShareLink({resourceType:e,resourceName:t}),w=e==="dashboard"?`#/public/dashboards/${t}?token=${S.token}`:`#/public/charts/${t}?token=${S.token}`,v=`${window.location.origin}/${w}`;l(v),await navigator.clipboard.writeText(v),d("public"),setTimeout(()=>d(null),2e3)}catch(S){console.error("Failed to create share link:",S)}finally{m(!1)}};return p.jsxs("div",{className:"relative",ref:g,children:[p.jsxs("button",{onClick:()=>a(!r),className:"text-sm text-gray-500 hover:text-gray-700 flex items-center gap-1.5 px-2 py-1 rounded hover:bg-gray-100 transition-colors",title:"Share",children:[p.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z"})}),p.jsx("span",{children:"Share"})]}),r&&p.jsxs("div",{className:"absolute right-0 top-full mt-1 bg-white border border-gray-200 rounded-lg shadow-lg py-1 w-64 z-50",children:[p.jsxs("button",{onClick:x,className:"w-full text-left px-3 py-2 text-sm hover:bg-gray-50 flex items-center gap-2",children:[p.jsx("svg",{className:"w-4 h-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})}),c==="link"?p.jsx("span",{className:"text-green-600",children:"Copied!"}):p.jsx("span",{children:"Copy link (requires login)"})]}),E&&p.jsxs("button",{onClick:C,disabled:h,className:"w-full text-left px-3 py-2 text-sm hover:bg-gray-50 flex items-center gap-2",children:[p.jsx("svg",{className:"w-4 h-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),h?p.jsx("span",{className:"text-gray-400",children:"Creating..."}):c==="public"?p.jsx("span",{className:"text-green-600",children:"Public link copied!"}):p.jsx("span",{children:"Create public link"})]}),o&&p.jsxs("div",{className:"px-3 py-2 border-t border-gray-100",children:[p.jsx("div",{className:"text-xs text-gray-400 mb-1",children:"Public URL:"}),p.jsx("div",{className:"text-xs text-gray-600 break-all font-mono bg-gray-50 p-1.5 rounded",children:o})]})]})]})}function lN({rowCount:e,durationMs:t,cached:n,view:r,onToggleView:a,onExportCSV:o,onExportPNG:l,onShowSql:c}){const[d,h]=L.useState(!1);return p.jsxs("div",{className:"yc-chart-footer flex items-center justify-between px-4 py-2 border-t text-xs",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)",color:"var(--yc-color-text-secondary)"},children:[p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx("button",{onClick:()=>a("chart"),className:`p-1.5 rounded transition-colors ${r==="chart"?"bg-black/5":"hover:bg-black/5"}`,title:"Chart view",children:p.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M7 12l3-3 3 3 4-4M8 21l4-4 4 4M3 4h18M4 4h16v12a1 1 0 01-1 1H5a1 1 0 01-1-1V4z"})})}),p.jsx("button",{onClick:()=>a("table"),className:`p-1.5 rounded transition-colors ${r==="table"?"bg-black/5":"hover:bg-black/5"}`,title:"Table view",children:p.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M3 10h18M3 14h18m-9-4v8m-7 0h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]}),p.jsxs("div",{className:"flex items-center gap-3",children:[e!=null&&p.jsxs("span",{children:[e.toLocaleString()," rows"]}),t!=null&&p.jsxs("span",{children:[n&&p.jsx("span",{className:"text-green-600 mr-1",title:"Served from cache",children:"cached"}),t,"ms"]}),c&&p.jsx("button",{onClick:c,className:"px-2 py-0.5 rounded border hover:bg-black/5 transition-colors font-mono",style:{borderColor:"var(--yc-color-border)"},children:"SQL"}),(o||l)&&p.jsxs("div",{className:"relative",children:[p.jsx("button",{onClick:()=>h(!d),className:"px-2 py-0.5 rounded border hover:bg-black/5 transition-colors",style:{borderColor:"var(--yc-color-border)"},children:"Export"}),d&&p.jsxs("div",{className:"absolute right-0 bottom-full mb-1 w-32 rounded-md shadow-lg border py-1 z-50",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:[o&&p.jsx("button",{onClick:()=>{o(),h(!1)},className:"w-full text-left px-3 py-1.5 text-xs hover:bg-black/5",style:{color:"var(--yc-color-text)"},children:"Export CSV"}),l&&p.jsx("button",{onClick:()=>{l(),h(!1)},className:"w-full text-left px-3 py-1.5 text-xs hover:bg-black/5",style:{color:"var(--yc-color-text)"},children:"Export PNG"})]})]})]})]})}const cN=new Set(["SELECT","FROM","WHERE","AND","OR","NOT","IN","IS","NULL","AS","ON","JOIN","LEFT","RIGHT","INNER","OUTER","FULL","CROSS","GROUP","BY","ORDER","HAVING","LIMIT","OFFSET","UNION","ALL","INSERT","INTO","VALUES","UPDATE","SET","DELETE","CREATE","DROP","ALTER","TABLE","INDEX","VIEW","WITH","RECURSIVE","DISTINCT","CASE","WHEN","THEN","ELSE","END","BETWEEN","LIKE","ILIKE","EXISTS","ANY","SOME","ASC","DESC","NULLS","FIRST","LAST","TRUE","FALSE","OVER","PARTITION","ROWS","RANGE","PRECEDING","FOLLOWING","UNBOUNDED","CURRENT","ROW","FILTER","WITHIN","LATERAL","NATURAL","USING","EXCEPT","INTERSECT","FETCH","NEXT","ONLY","FOR","IF","REPLACE","CASCADE","RESTRICT","TEMPORARY","TEMP","MATERIALIZED","EXPLAIN","ANALYZE","WINDOW"]),dN=new Set(["COUNT","SUM","AVG","MIN","MAX","COALESCE","NULLIF","CAST","CONVERT","IFNULL","NVL","TRIM","LTRIM","RTRIM","UPPER","LOWER","LENGTH","SUBSTRING","SUBSTR","REPLACE","CONCAT","CONCAT_WS","DATE_TRUNC","DATE_PART","EXTRACT","NOW","CURRENT_DATE","CURRENT_TIMESTAMP","DATEADD","DATEDIFF","TO_DATE","TO_CHAR","TO_NUMBER","TO_TIMESTAMP","ROUND","FLOOR","CEIL","CEILING","ABS","MOD","POWER","SQRT","LOG","LN","EXP","SIGN","ROW_NUMBER","RANK","DENSE_RANK","NTILE","LAG","LEAD","FIRST_VALUE","LAST_VALUE","NTH_VALUE","LISTAGG","STRING_AGG","ARRAY_AGG","JSON_AGG","BOOL_OR","BOOL_AND","GREATEST","LEAST","DECODE","IFF","ZEROIFNULL","TRY_CAST"]);function Lr(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function fN(e){const t=[];let n=0;const r=a=>e.charAt(a);for(;n<e.length;){if(r(n)==="-"&&r(n+1)==="-"){const a=e.indexOf(`
|
|
66
|
-
`,n),o=a===-1?e.slice(n):e.slice(n,a);t.push(`<span class="sql-comment">${Lr(o)}</span>`),n+=o.length;continue}if(r(n)==="/"&&r(n+1)==="*"){const a=e.indexOf("*/",n+2),o=a===-1?e.slice(n):e.slice(n,a+2);t.push(`<span class="sql-comment">${Lr(o)}</span>`),n+=o.length;continue}if(r(n)==="'"){let a=n+1;for(;a<e.length;)if(r(a)==="'"&&r(a+1)==="'")a+=2;else if(r(a)==="'"){a++;break}else a++;t.push(`<span class="sql-string">${Lr(e.slice(n,a))}</span>`),n=a;continue}if(r(n)==='"'){const a=e.indexOf('"',n+1),o=a===-1?e.slice(n):e.slice(n,a+1);t.push(`<span class="sql-identifier">${Lr(o)}</span>`),n+=o.length;continue}if(/\d/.test(r(n))&&(n===0||/[\s,=(]/.test(r(n-1)))){let a=n;for(;a<e.length&&/[\d.]/.test(r(a));)a++;t.push(`<span class="sql-number">${Lr(e.slice(n,a))}</span>`),n=a;continue}if(/[a-zA-Z_]/.test(r(n))){let a=n;for(;a<e.length&&/[a-zA-Z0-9_]/.test(r(a));)a++;const o=e.slice(n,a),l=o.toUpperCase(),c=e.slice(a);/^\s*\(/.test(c)&&dN.has(l)?t.push(`<span class="sql-function">${Lr(o)}</span>`):cN.has(l)?t.push(`<span class="sql-keyword">${Lr(o)}</span>`):t.push(Lr(o)),n=a;continue}if(r(n)===":"&&r(n+1)===":"){let a=n+2;for(;a<e.length&&/[a-zA-Z0-9_]/.test(r(a));)a++;t.push(`<span class="sql-type">${Lr(e.slice(n,a))}</span>`),n=a;continue}if("=<>!+-*/%".includes(r(n))){t.push(`<span class="sql-operator">${Lr(r(n))}</span>`),n++;continue}t.push(Lr(r(n))),n++}return t.join("")}function hN({isOpen:e,onClose:t,compiledSql:n,modelName:r,connection:a,durationMs:o,rowCount:l,cached:c}){const[d,h]=L.useState(!1),m=L.useMemo(()=>n?fN(n):"",[n]);if(!e)return null;const g=async()=>{if(n)try{await navigator.clipboard.writeText(n),h(!0),setTimeout(()=>h(!1),2e3)}catch{}};return p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"fixed inset-0 bg-black/20 z-40",onClick:t}),p.jsxs("div",{className:"fixed top-0 right-0 bottom-0 w-[480px] max-w-[90vw] z-50 flex flex-col shadow-xl border-l",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:[p.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b flex-shrink-0",style:{borderColor:"var(--yc-color-border)"},children:[p.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--yc-color-text)",fontFamily:"var(--yc-font-heading)"},children:"Query Details"}),p.jsx("button",{onClick:t,className:"p-1.5 rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)"},children:p.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),p.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-5",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx("h3",{className:"text-xs font-medium uppercase tracking-wider",style:{color:"var(--yc-color-text-secondary)"},children:"Metadata"}),p.jsxs("div",{className:"text-sm space-y-1.5 p-3 rounded",style:{backgroundColor:"var(--yc-color-background)",border:"1px solid var(--yc-color-border)"},children:[r&&p.jsxs("div",{className:"flex justify-between",children:[p.jsx("span",{style:{color:"var(--yc-color-text-secondary)"},children:"Model"}),p.jsx("span",{className:"font-mono text-xs",style:{color:"var(--yc-color-text)"},children:r})]}),a&&p.jsxs("div",{className:"flex justify-between",children:[p.jsx("span",{style:{color:"var(--yc-color-text-secondary)"},children:"Connection"}),p.jsx("span",{style:{color:"var(--yc-color-text)"},children:a})]}),l!=null&&p.jsxs("div",{className:"flex justify-between",children:[p.jsx("span",{style:{color:"var(--yc-color-text-secondary)"},children:"Rows"}),p.jsx("span",{style:{color:"var(--yc-color-text)"},children:l.toLocaleString()})]}),o!=null&&p.jsxs("div",{className:"flex justify-between",children:[p.jsx("span",{style:{color:"var(--yc-color-text-secondary)"},children:"Duration"}),p.jsxs("span",{style:{color:"var(--yc-color-text)"},children:[o,"ms",c&&p.jsx("span",{className:"ml-2 text-green-600 text-xs",children:"(cached)"})]})]})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("h3",{className:"text-xs font-medium uppercase tracking-wider",style:{color:"var(--yc-color-text-secondary)"},children:"Compiled SQL"}),p.jsx("button",{onClick:g,className:"text-xs px-2 py-1 rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-primary)"},children:d?"Copied!":"Copy"})]}),n?p.jsx("pre",{className:"text-xs p-4 rounded overflow-x-auto whitespace-pre-wrap break-words leading-relaxed",style:{fontFamily:"var(--yc-font-mono)",backgroundColor:"var(--yc-color-background)",color:"var(--yc-color-text)",border:"1px solid var(--yc-color-border)"},dangerouslySetInnerHTML:{__html:m}}):p.jsx("p",{className:"text-sm italic",style:{color:"var(--yc-color-text-secondary)"},children:"No SQL available."})]})]})]})]})}async function pN(e,t,n="png"){const{default:r}=await ks(async()=>{const{default:l}=await import("./html2canvas.esm-QH1iLAAe.js");return{default:l}},[]),o=(await r(e,{backgroundColor:"#f9fafb",scale:2,useCORS:!0,logging:!1})).toDataURL(`image/${n}`,n==="jpeg"?.9:void 0);Ac(o,`${t}.${n}`)}async function mN(e,t,n){const[{default:r},{jsPDF:a}]=await Promise.all([ks(()=>import("./html2canvas.esm-QH1iLAAe.js"),[]),ks(()=>import("./jspdf.es.min-C599hpR0.js").then(A=>A.j),[])]),o=await r(e,{backgroundColor:"#f9fafb",scale:2,useCORS:!0,logging:!1}),l=o.toDataURL("image/png"),c=o.width,d=o.height,m=c/d>1,g=new a({orientation:m?"landscape":"portrait",unit:"mm"}),E=g.internal.pageSize.getWidth(),x=g.internal.pageSize.getHeight();let C=10;n&&(g.setFontSize(16),g.text(n,E/2,C,{align:"center"}),C=20);const S=E-20,w=x-C-10;let v=S,k=d/c*v;k>w&&(k=w,v=c/d*k);const O=(E-v)/2;g.addImage(l,"PNG",O,C,v,k),g.save(`${t}.pdf`)}async function gN(e,t,n){const{jsPDF:r}=await ks(async()=>{const{jsPDF:w}=await import("./jspdf.es.min-C599hpR0.js").then(v=>v.j);return{jsPDF:w}},[]),a=new Image;a.src=e,await new Promise(w=>{a.onload=w});const l=a.width/a.height>1.2,c=new r({orientation:l?"landscape":"portrait",unit:"mm"}),d=c.internal.pageSize.getWidth(),h=c.internal.pageSize.getHeight();let m=15;n&&(c.setFontSize(14),c.text(n,d/2,10,{align:"center"}));const g=d-20,E=h-m-15;let x=g,C=a.height/a.width*x;C>E&&(C=E,x=a.width/a.height*C);const S=(d-x)/2;c.addImage(e,"PNG",S,m,x,C),c.save(`${t}.pdf`)}function Yc(e,t,n){if(e.length===0)return;const r=t.map(l=>l.name),a=e.map(l=>t.map(c=>{const d=l[c.name];if(d==null)return"";const h=String(d);return h.includes(",")||h.includes('"')||h.includes(`
|
|
67
|
-
`)?`"${h.replace(/"/g,'""')}"`:h})),o=[r.join(","),...a.map(l=>l.join(","))].join(`
|
|
68
|
-
`);WE(o,`${n}.csv`,"text/csv;charset=utf-8;")}function yN(e,t){const n=JSON.stringify(e,null,2);WE(n,`${t}.json`,"application/json;charset=utf-8;")}function Ac(e,t){const n=document.createElement("a");n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}function WE(e,t,n){const r=new Blob([e],{type:n}),a=URL.createObjectURL(r),o=document.createElement("a");o.href=a,o.download=t,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(a)}const ru=50;function bN({data:e,columns:t,drillDownColumns:n,filterDisplay:r,chartName:a}){const[o,l]=L.useState(null),[c,d]=L.useState(0),h=L.useMemo(()=>n&&n.length>0?n.map(k=>({field:k.field,label:k.label??k.field,format:k.format})):t.map(k=>({field:k.name,label:k.name,format:void 0})),[n,t]),m=L.useMemo(()=>{if(!o)return e;const{field:k,direction:O}=o;return[...e].sort((A,P)=>{const _=A[k],N=P[k];if(_==null&&N==null)return 0;if(_==null)return 1;if(N==null)return-1;if(typeof _=="number"&&typeof N=="number")return O==="asc"?_-N:N-_;const I=String(_),F=String(N);return O==="asc"?I.localeCompare(F):F.localeCompare(I)})},[e,o]),g=Math.ceil(m.length/ru),E=m.slice(c*ru,(c+1)*ru),x=c*ru+1,C=Math.min((c+1)*ru,m.length),S=k=>{l(O=>!O||O.field!==k?{field:k,direction:"asc"}:O.direction==="asc"?{field:k,direction:"desc"}:null),d(0)},w=(k,O)=>k==null?"":O&&typeof k=="number"?O.includes("$")?`$${k.toLocaleString()}`:O.includes("%")?`${k.toFixed(1)}%`:k.toLocaleString():String(k),v=k=>!o||o.field!==k?"":o.direction==="asc"?" ↑":" ↓";return p.jsxs("div",{className:"bg-white border border-gray-200 rounded-lg overflow-hidden",children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200 bg-gray-50",children:[p.jsxs("div",{className:"text-sm text-gray-600",children:["Showing ",m.length," rows filtered by ",r]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("button",{onClick:()=>Yc(e,t,`${a}-drill-down`),className:"text-sm px-3 py-1 text-gray-600 hover:text-gray-900 border border-gray-300 rounded hover:bg-gray-100 transition-colors",children:"Export CSV"}),p.jsx("button",{onClick:()=>yN(e,`${a}-drill-down`),className:"text-sm px-3 py-1 text-gray-600 hover:text-gray-900 border border-gray-300 rounded hover:bg-gray-100 transition-colors",children:"Export JSON"})]})]}),p.jsx("div",{className:"overflow-x-auto",children:p.jsxs("table",{className:"w-full text-sm",children:[p.jsx("thead",{children:p.jsx("tr",{className:"border-b border-gray-200 bg-gray-50",children:h.map(k=>p.jsxs("th",{className:"px-4 py-2 text-left font-medium text-gray-700 cursor-pointer hover:bg-gray-100 select-none",onClick:()=>S(k.field),children:[k.label,v(k.field)]},k.field))})}),p.jsx("tbody",{children:E.map((k,O)=>p.jsx("tr",{className:O%2===0?"bg-white":"bg-gray-50",children:h.map(A=>p.jsx("td",{className:"px-4 py-2 text-gray-600",children:w(k[A.field],A.format)},A.field))},O))})]})}),g>1&&p.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t border-gray-200 bg-gray-50",children:[p.jsxs("div",{className:"text-sm text-gray-600",children:["Showing ",x,"-",C," of ",m.length]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("button",{onClick:()=>d(k=>Math.max(0,k-1)),disabled:c===0,className:"text-sm px-3 py-1 border border-gray-300 rounded disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-100 transition-colors",children:"Previous"}),p.jsx("button",{onClick:()=>d(k=>Math.min(g-1,k+1)),disabled:c>=g-1,className:"text-sm px-3 py-1 border border-gray-300 rounded disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-100 transition-colors",children:"Next"})]})]})]})}const Br=L.forwardRef(function({option:t,height:n=400,loading:r=!1,onEvents:a},o){const l=L.useRef(null);return L.useImperativeHandle(o,()=>({getDataURL:c=>{var h;const d=(h=l.current)==null?void 0:h.getEchartsInstance();if(d)try{return d.getDataURL({type:c==="png"?"png":"svg",pixelRatio:2,backgroundColor:"#fff"})}catch{return d.getDataURL({type:"svg",pixelRatio:2,backgroundColor:"#fff"})}},getInstance:()=>{var c;return(c=l.current)==null?void 0:c.getEchartsInstance()}})),L.useEffect(()=>{const c=()=>{var d,h;(h=(d=l.current)==null?void 0:d.getEchartsInstance())==null||h.resize()};return window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[]),p.jsx(jv,{ref:l,option:t,style:{height:n,width:"100%"},showLoading:r,onEvents:a,opts:{renderer:"canvas"}})}),EN=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#EC4899","#06B6D4","#F97316","#84CC16","#14B8A6"];function no(e,t,n){if(t)return t;const r=(n==null?void 0:n.palette)??EN;return r[e%r.length]}function xN(e,t,n,r){return n!=null&&n[e]?n[e]:no(t,void 0,r)}function TN(e){return"field"in e}function vN(e){return"columns"in e}function ah(e){if(e.length===0)return e;const t=e[0].data.length;for(let n=0;n<t;n++){let r=0;for(const a of e)r+=a.data[n]??0;for(const a of e)a.data[n]=r===0?0:(a.data[n]??0)/r*100}return e}function qc(e,t,n){var a,o;const r=t.stacking?"total":void 0;if(!t.series){const l=((a=t.y)==null?void 0:a.field)??"",c=e.map(h=>{const m=h[l];return typeof m=="number"?m:parseFloat(String(m))||0}),d=[{name:l,data:c,color:no(0,void 0,n),stack:r}];return t.stacking==="percent"?ah(d):d}if(TN(t.series)){const l=t.series.field,c=t.series.colors,d=((o=t.y)==null?void 0:o.field)??"",h=[],m=new Map;e.forEach(E=>{const x=String(E[l]??"");m.has(x)||(h.push(x),m.set(x,[]));const C=E[d];m.get(x).push(typeof C=="number"?C:parseFloat(String(C))||0)});const g=h.map((E,x)=>({name:E,data:m.get(E),color:xN(E,x,c,n),stack:r}));return t.stacking==="percent"?ah(g):g}if(vN(t.series)){const l=t.series.columns.map((c,d)=>{const h=e.map(m=>{const g=m[c.field];return typeof g=="number"?g:parseFloat(String(g))||0});return{name:c.name??c.field,data:h,color:no(d,c.color,n),opacity:c.opacity,style:c.style,gradient:c.gradient,stack:r,chartType:c.type,yAxisIndex:c.axis==="right"?1:c.axis==="left"?0:void 0}});return t.stacking==="percent"?ah(l):l}return[]}function wN(e){return e.replace(/'/g,"''").replace(/%Y/g,"yyyy").replace(/%y/g,"yy").replace(/%m/g,"MM").replace(/%b/g,"MMM").replace(/%B/g,"MMMM").replace(/%d/g,"dd").replace(/%H/g,"HH").replace(/%I/g,"hh").replace(/%M/g,"mm").replace(/%S/g,"ss").replace(/%p/g,"a").replace(/%P/g,"a")}function YE(e){const t=Math.floor(e.getMonth()/3)+1,n=e.getFullYear().toString().slice(-2);return`Q${t} '${n}`}function SN(e){if(e.length<2)return"MMM dd, yyyy";const t=e.map(c=>c.getTime()).sort((c,d)=>c-d),n=t[0],r=t[t.length-1],a=(r-n)/(1e3*60*60*24);return a<2?"MMM dd, h:mm a":a<=90||(r-n)/(t.length-1)/(1e3*60*60*24)<28?"MMM dd":a<=730?"MMM yyyy":"yyyy"}function _N(e){if(e.length<2)return"MMM dd, yyyy";const t=e.map(r=>r.getTime()).sort((r,a)=>r-a),n=(t[t.length-1]-t[0])/((t.length-1)*864e5);return n<1?"MMM dd, yyyy h:mm a":n<28?"MMM dd, yyyy":"MMM yyyy"}function $c(e,t){const n=new Set,r=e.filter(l=>{const c=l[t.field];return n.has(c)?!1:(n.add(c),!0)});if(t.type!=="temporal")return r.map(l=>String(l[t.field]??""));const a=[];for(const l of r){const c=l[t.field];if(typeof c=="string")try{a.push(Oc(c))}catch{}}const o=a.length>0?_N(a):"MMM dd, yyyy";return r.map(l=>{const c=l[t.field];if(typeof c=="string")try{const d=Oc(c);return t.format==="quarter"?YE(d):hn(d,o)}catch{return String(c??"")}return String(c??"")})}function Vc(e,t){const n=new Set,r=e.filter(a=>{const o=a[t.field];return n.has(o)?!1:(n.add(o),!0)});return Vu(r,t)}function Vu(e,t){let n;if(t.type==="temporal"&&!t.format){const r=[];for(const a of e){const o=a[t.field];if(typeof o=="string")try{r.push(Oc(o))}catch{}}r.length>0&&(n=SN(r))}return e.map(r=>{const a=r[t.field];if(t.type==="temporal"&&typeof a=="string")try{const o=Oc(a);if(t.format==="quarter")return YE(o);const l=t.format?wN(t.format):n??"MMM yyyy";return hn(o,l)}catch{return String(a??"")}return String(a??"")})}function ma(e,t){if(t){if(t.includes("$"))return`$${e.toLocaleString()}`;if(t.includes("%"))return`${e.toFixed(1)}%`}return e.toLocaleString()}function CN(e){const t=e.replace("#","").match(/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}function Qc(e,t){if(!t)return null;if(typeof t=="object")return{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:t.from},{offset:1,color:t.to}]};const n=CN(e);return n?{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:`rgba(${n.r}, ${n.g}, ${n.b}, 0.4)`},{offset:1,color:`rgba(${n.r}, ${n.g}, ${n.b}, 0.05)`}]}:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:e},{offset:1,color:"rgba(0,0,0,0)"}]}}function Ns(e){return((e==null?void 0:e.base)??"modern")==="modern"?{smooth:!0,barBorderRadius:[4,4,0,0],pieBorderRadius:4}:{smooth:!1,barBorderRadius:[0,0,0,0],pieBorderRadius:0}}const qE=L.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:a,theme:o,height:l=400,loading:c=!1,onCrossFilter:d,onDrillDown:h},m){var O,A,P,_,N,I;const E=(a==null?void 0:a.series)&&"field"in a.series?Vc(t,n):Vu(t,n),x=n.type==="temporal"?$c(t,n):E,C=L.useMemo(()=>{const F={};return d&&(F.click=j=>{const M=j;if(M.componentType!=="series")return;const H=M.name;H==null||H===""||d(n.field,String(H))}),h&&(F.contextmenu=(j,M)=>{var Q,re,Z,K,R,ae,ue;const H=j;if(H.componentType!=="series")return;const $=H.name;if($==null||$==="")return;(re=(Q=H.event)==null?void 0:Q.event)==null||re.preventDefault(),(Z=M==null?void 0:M.dispatchAction)==null||Z.call(M,{type:"hideTip"});const G=((R=(K=H.event)==null?void 0:K.event)==null?void 0:R.clientX)??0,J=((ue=(ae=H.event)==null?void 0:ae.event)==null?void 0:ue.clientY)??0;h(n.field,String($),{x:G,y:J})}),Object.keys(F).length>0?F:void 0},[d,h,n.field]);let S,w,v;if(a){const F=qc(t,{type:a.type,y:r?{field:r.field,type:r.type}:void 0,series:a.series,stacking:a.stacking},o),j=Ns(o);S=F.map(M=>{const H=Qc(M.color,M.gradient??a.gradient);return{type:"line",name:M.name,data:M.data,smooth:j.smooth,symbol:"circle",symbolSize:6,lineStyle:{width:2,color:M.color,type:M.style==="dashed"?"dashed":M.style==="dotted"?"dotted":"solid"},itemStyle:{color:M.color},areaStyle:H?{color:H}:void 0,stack:M.stack,...M.opacity!==void 0?{opacity:M.opacity}:{}}}),F.length>1&&(w={show:((O=a.legend)==null?void 0:O.show)!==!1,...((A=a.legend)==null?void 0:A.position)==="top"?{top:0}:((P=a.legend)==null?void 0:P.position)==="left"?{left:0,orient:"vertical"}:((_=a.legend)==null?void 0:_.position)==="right"?{right:0,orient:"vertical"}:{bottom:0},textStyle:{color:"#6B7280",fontSize:12}}),(N=a.interactions)!=null&&N.zoom&&(v=[{type:"inside",start:0,end:100},{type:"slider",start:0,end:100,bottom:0}])}else{const F=(r==null?void 0:r.field)??"";S=[{type:"line",data:t.map(M=>{const H=M[F];return typeof H=="number"?H:parseFloat(String(H))||0}),smooth:Ns(o).smooth,symbol:"circle",symbolSize:6,lineStyle:{width:2,color:"#3B82F6"},itemStyle:{color:"#3B82F6"},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(59, 130, 246, 0.2)"},{offset:1,color:"rgba(59, 130, 246, 0)"}]}}}]}const k={tooltip:{trigger:"axis",formatter:F=>{const j=F;if(!Array.isArray(j)||j.length===0)return"";let H=`<div style="padding: 8px;"><div style="font-weight: 600; margin-bottom: 4px;">${x[j[0].dataIndex]??j[0].name}</div>`;for(const $ of j)H+=`<div>${$.marker} ${$.seriesName}: ${ma($.value,r==null?void 0:r.format)}</div>`;return H+="</div>",H}},legend:w,grid:{left:"3%",right:"4%",bottom:"10%",top:"10%",containLabel:!0},xAxis:{type:"category",data:E,name:n.label,nameLocation:"middle",nameGap:30,nameTextStyle:{color:"#6B7280",fontSize:12},axisLabel:{color:"#6B7280",fontSize:12,hideOverlap:!0},axisLine:{lineStyle:{color:"#E5E7EB"}},axisTick:{show:!1}},yAxis:{type:((I=a==null?void 0:a.y)==null?void 0:I.scale)==="log"?"log":"value",name:r==null?void 0:r.label,nameLocation:"middle",nameGap:80,nameTextStyle:{color:"#6B7280",fontSize:12},axisLabel:{color:"#6B7280",fontSize:12,formatter:F=>ma(F,r==null?void 0:r.format)},axisLine:{show:!1},splitLine:{lineStyle:{color:"#E5E7EB",type:"dashed"}}},series:S,...v?{dataZoom:v}:{},animation:!0,animationDuration:300};return p.jsx(Br,{ref:m,option:k,height:l,loading:c,onEvents:C})}),$E=L.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:a,theme:o,height:l=400,loading:c=!1,horizontal:d=!1,onCrossFilter:h,activeCrossFilter:m,onDrillDown:g},E){var F,j,M,H,$,G;const C=(a==null?void 0:a.series)&&"field"in a.series?Vc(t,n):Vu(t,n),S=n.type==="temporal"?$c(t,n):C,w=(m==null?void 0:m.field)===n.field,v=d||(a==null?void 0:a.orientation)==="horizontal",k=L.useMemo(()=>{const J={};return h&&(J.click=Q=>{const re=Q;if(re.componentType!=="series")return;const Z=re.name;Z==null||Z===""||h(n.field,String(Z))}),g&&(J.contextmenu=(Q,re)=>{var ue,z,Oe,Be,Te,Ze,$e;const Z=Q;if(Z.componentType!=="series")return;const K=Z.name;if(K==null||K==="")return;(z=(ue=Z.event)==null?void 0:ue.event)==null||z.preventDefault(),(Oe=re==null?void 0:re.dispatchAction)==null||Oe.call(re,{type:"hideTip"});const R=((Te=(Be=Z.event)==null?void 0:Be.event)==null?void 0:Te.clientX)??0,ae=(($e=(Ze=Z.event)==null?void 0:Ze.event)==null?void 0:$e.clientY)??0;g(n.field,String(K),{x:R,y:ae})}),Object.keys(J).length>0?J:void 0},[h,g,n.field]),O=(a==null?void 0:a.stacking)==="percent",A=J=>O?`${J.toFixed(1)}%`:ma(J,r==null?void 0:r.format);let P,_=!1;if(a){const J=qc(t,{type:a.type,y:r?{field:r.field,type:r.type}:void 0,series:a.series,stacking:a.stacking},o),Q=J.length>1,re=!!a.stacking;_=Q;const Z=Ns(o);P=J.map(K=>{const R=Qc(K.color,K.gradient??a.gradient);return{type:"bar",name:K.name,data:w?K.data.map((ae,ue)=>({value:ae,itemStyle:{opacity:C[ue]===(m==null?void 0:m.value)?1:.3}})):K.data,barWidth:Q&&!re?void 0:"60%",itemStyle:{color:R??K.color,borderRadius:Z.barBorderRadius},stack:K.stack,...K.opacity!==void 0?{opacity:K.opacity}:{}}})}else{const J=(r==null?void 0:r.field)??"",Q=t.map(Z=>{const K=Z[J];return typeof K=="number"?K:parseFloat(String(K))||0}),re=Ns(o);P=[{type:"bar",data:w?Q.map((Z,K)=>({value:Z,itemStyle:{opacity:C[K]===(m==null?void 0:m.value)?1:.3}})):Q,barWidth:"60%",itemStyle:{color:"#3B82F6",borderRadius:re.barBorderRadius},emphasis:{itemStyle:{color:"#2563EB"}}}]}const I={tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:J=>{const Q=J;if(!Array.isArray(Q)||Q.length===0)return"";const re=S[Q[0].dataIndex]??Q[0].name;if(Q.length===1){const K=Q[0];return`
|
|
69
|
-
<div style="padding: 8px;">
|
|
70
|
-
<div style="font-weight: 600; margin-bottom: 4px;">${re}</div>
|
|
71
|
-
<div>${K.marker} ${(r==null?void 0:r.label)||(r==null?void 0:r.field)||K.seriesName}: ${A(K.value)}</div>
|
|
72
|
-
</div>
|
|
73
|
-
`}const Z=Q.map(K=>`<div>${K.marker} ${K.seriesName}: ${A(K.value)}</div>`).join("");return`
|
|
74
|
-
<div style="padding: 8px;">
|
|
75
|
-
<div style="font-weight: 600; margin-bottom: 4px;">${re}</div>
|
|
76
|
-
${Z}
|
|
77
|
-
</div>
|
|
78
|
-
`}},legend:_?{show:((F=a==null?void 0:a.legend)==null?void 0:F.show)!==!1,...((j=a==null?void 0:a.legend)==null?void 0:j.position)==="top"?{top:0}:((M=a==null?void 0:a.legend)==null?void 0:M.position)==="left"?{left:0,orient:"vertical"}:((H=a==null?void 0:a.legend)==null?void 0:H.position)==="right"?{right:0,orient:"vertical"}:{bottom:0},textStyle:{color:"#6B7280",fontSize:12}}:void 0,grid:{left:"3%",right:"4%",bottom:_?"15%":"10%",top:"10%",containLabel:!0},xAxis:v?{type:(($=a==null?void 0:a.y)==null?void 0:$.scale)==="log"?"log":"value",axisLabel:{color:"#6B7280",fontSize:12,formatter:J=>A(J)},axisLine:{show:!1},splitLine:{lineStyle:{color:"#E5E7EB",type:"dashed"}}}:{type:"category",data:C,name:n.label,nameLocation:"middle",nameGap:30,nameTextStyle:{color:"#6B7280",fontSize:12},axisLabel:{color:"#6B7280",fontSize:12,hideOverlap:!0},axisLine:{lineStyle:{color:"#E5E7EB"}},axisTick:{show:!1}},yAxis:v?{type:"category",data:C,axisLabel:{color:"#6B7280",fontSize:12},axisLine:{show:!1},axisTick:{show:!1}}:{type:((G=a==null?void 0:a.y)==null?void 0:G.scale)==="log"?"log":"value",name:r==null?void 0:r.label,nameLocation:"middle",nameGap:80,nameTextStyle:{color:"#6B7280",fontSize:12},...O?{max:100}:{},axisLabel:{color:"#6B7280",fontSize:12,formatter:J=>A(J)},axisLine:{show:!1},splitLine:{lineStyle:{color:"#E5E7EB",type:"dashed"}}},series:P,animation:!0,animationDuration:300};return p.jsx(Br,{ref:E,option:I,height:l,loading:c,onEvents:k})}),VE=L.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:a,theme:o,height:l=400,loading:c=!1,onCrossFilter:d,onDrillDown:h},m){var A,P,_,N,I,F;const E=(a==null?void 0:a.series)&&"field"in a.series?Vc(t,n):Vu(t,n),x=n.type==="temporal"?$c(t,n):E,C=(a==null?void 0:a.stacking)==="percent",S=L.useMemo(()=>{const j={};return d&&(j.click=M=>{const H=M;if(H.componentType!=="series")return;const $=H.name;$==null||$===""||d(n.field,String($))}),h&&(j.contextmenu=(M,H)=>{var re,Z,K,R,ae,ue,z;const $=M;if($.componentType!=="series")return;const G=$.name;if(G==null||G==="")return;(Z=(re=$.event)==null?void 0:re.event)==null||Z.preventDefault(),(K=H==null?void 0:H.dispatchAction)==null||K.call(H,{type:"hideTip"});const J=((ae=(R=$.event)==null?void 0:R.event)==null?void 0:ae.clientX)??0,Q=((z=(ue=$.event)==null?void 0:ue.event)==null?void 0:z.clientY)??0;h(n.field,String(G),{x:J,y:Q})}),Object.keys(j).length>0?j:void 0},[d,h,n.field]);let w,v,k;if(a){const j=qc(t,{type:a.type,y:r?{field:r.field,type:r.type}:void 0,series:a.series,stacking:a.stacking},o),M=Ns(o);w=j.map(H=>{const $=Qc(H.color,H.gradient??a.gradient??!0);return{type:"line",name:H.name,data:H.data,smooth:M.smooth,symbol:"none",lineStyle:{width:2,color:H.color,type:H.style==="dashed"?"dashed":H.style==="dotted"?"dotted":"solid"},itemStyle:{color:H.color},areaStyle:{color:$??H.color},stack:H.stack,...H.opacity!==void 0?{opacity:H.opacity}:{}}}),j.length>1&&(v={show:((A=a.legend)==null?void 0:A.show)!==!1,...((P=a.legend)==null?void 0:P.position)==="top"?{top:0}:((_=a.legend)==null?void 0:_.position)==="left"?{left:0,orient:"vertical"}:((N=a.legend)==null?void 0:N.position)==="right"?{right:0,orient:"vertical"}:{bottom:0},textStyle:{color:"#6B7280",fontSize:12}}),(I=a.interactions)!=null&&I.zoom&&(k=[{type:"inside",start:0,end:100},{type:"slider",start:0,end:100,bottom:0}])}else{const j=(r==null?void 0:r.field)??"";w=[{type:"line",data:t.map(H=>{const $=H[j];return typeof $=="number"?$:parseFloat(String($))||0}),smooth:Ns(o).smooth,symbol:"none",lineStyle:{width:2,color:"#10B981"},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(16, 185, 129, 0.4)"},{offset:1,color:"rgba(16, 185, 129, 0.05)"}]}}}]}const O={tooltip:{trigger:"axis",formatter:j=>{const M=j;if(!Array.isArray(M)||M.length===0)return"";let $=`<div style="padding: 8px;"><div style="font-weight: 600; margin-bottom: 4px;">${x[M[0].dataIndex]??M[0].name}</div>`;for(const G of M){const J=C?`${G.value.toFixed(1)}%`:ma(G.value,r==null?void 0:r.format);$+=`<div>${G.marker} ${G.seriesName}: ${J}</div>`}return $+="</div>",$}},legend:v,grid:{left:"3%",right:"4%",bottom:"10%",top:"10%",containLabel:!0},xAxis:{type:"category",data:E,boundaryGap:!1,name:n.label,nameLocation:"middle",nameGap:30,nameTextStyle:{color:"#6B7280",fontSize:12},axisLabel:{color:"#6B7280",fontSize:12,hideOverlap:!0},axisLine:{lineStyle:{color:"#E5E7EB"}},axisTick:{show:!1}},yAxis:{type:((F=a==null?void 0:a.y)==null?void 0:F.scale)==="log"?"log":"value",name:r==null?void 0:r.label,nameLocation:"middle",nameGap:80,nameTextStyle:{color:"#6B7280",fontSize:12},...C?{max:100}:{},axisLabel:{color:"#6B7280",fontSize:12,formatter:j=>C?`${j}%`:ma(j,r==null?void 0:r.format)},axisLine:{show:!1},splitLine:{lineStyle:{color:"#E5E7EB",type:"dashed"}}},series:w,...k?{dataZoom:k}:{},animation:!0,animationDuration:300};return p.jsx(Br,{ref:m,option:O,height:l,loading:c,onEvents:S})}),QE=L.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:a,theme:o,height:l=400,loading:c=!1,onCrossFilter:d,activeCrossFilter:h,onDrillDown:m},g){var v,k,O,A;const E=(h==null?void 0:h.field)===n.field,x=L.useMemo(()=>{const P={};return d&&(P.click=_=>{const N=_;if(N.componentType!=="series")return;const I=N.name;I==null||I===""||d(n.field,String(I))}),m&&(P.contextmenu=(_,N)=>{var H,$,G,J,Q,re,Z;const I=_;if(I.componentType!=="series")return;const F=I.name;if(F==null||F==="")return;($=(H=I.event)==null?void 0:H.event)==null||$.preventDefault(),(G=N==null?void 0:N.dispatchAction)==null||G.call(N,{type:"hideTip"});const j=((Q=(J=I.event)==null?void 0:J.event)==null?void 0:Q.clientX)??0,M=((Z=(re=I.event)==null?void 0:re.event)==null?void 0:Z.clientY)??0;m(n.field,String(F),{x:j,y:M})}),Object.keys(P).length>0?P:void 0},[d,m,n.field]),C=t.map((P,_)=>{const N=P[r.field],I=typeof N=="number"?N:parseFloat(String(N))||0;return{name:String(P[n.field]??""),value:I,itemStyle:{color:no(_,void 0,o)}}}),S=P=>{if(r.format){if(r.format.includes("$"))return`$${P.toLocaleString()}`;if(r.format.includes("%"))return`${P.toFixed(1)}%`}return P.toLocaleString()},w={tooltip:{trigger:"item",formatter:P=>{const _=P;return`
|
|
79
|
-
<div style="padding: 8px;">
|
|
80
|
-
<div style="font-weight: 600; margin-bottom: 4px;">${_.name}</div>
|
|
81
|
-
<div>${_.marker} ${r.label||r.field}: ${S(_.value)}</div>
|
|
82
|
-
<div style="color: #6B7280; font-size: 12px;">${_.percent.toFixed(1)}%</div>
|
|
83
|
-
</div>
|
|
84
|
-
`}},legend:{show:((v=a==null?void 0:a.legend)==null?void 0:v.show)!==!1,...((k=a==null?void 0:a.legend)==null?void 0:k.position)==="top"?{top:0}:((O=a==null?void 0:a.legend)==null?void 0:O.position)==="bottom"?{bottom:0}:((A=a==null?void 0:a.legend)==null?void 0:A.position)==="left"?{left:0,orient:"vertical",top:"center"}:{orient:"vertical",right:"5%",top:"center"},textStyle:{color:"#6B7280",fontSize:12}},series:[{type:"pie",radius:["40%","70%"],center:["40%","50%"],avoidLabelOverlap:!0,itemStyle:{borderRadius:Ns(o).pieBorderRadius,borderColor:"#fff",borderWidth:2},label:{show:!1},emphasis:{label:{show:!0,fontSize:14,fontWeight:"bold"}},labelLine:{show:!1},data:C.map(P=>({...P,itemStyle:{...P.itemStyle,...E&&(h==null?void 0:h.value)!==P.name?{opacity:.3}:{}}}))}],animation:!0,animationDuration:300};return p.jsx(Br,{ref:g,option:w,height:l,loading:c,onEvents:x})}),GE=L.forwardRef(function({data:t,xAxis:n,yAxis:r,centerValue:a,chartConfig:o,theme:l,height:c=400,loading:d=!1,onCrossFilter:h,activeCrossFilter:m,onDrillDown:g},E){var A,P,_,N,I;const x=(m==null?void 0:m.field)===n.field,C=L.useMemo(()=>{const F={};return h&&(F.click=j=>{const M=j;if(M.componentType!=="series")return;const H=M.name;H==null||H===""||h(n.field,String(H))}),g&&(F.contextmenu=(j,M)=>{var Q,re,Z,K,R,ae,ue;const H=j;if(H.componentType!=="series")return;const $=H.name;if($==null||$==="")return;(re=(Q=H.event)==null?void 0:Q.event)==null||re.preventDefault(),(Z=M==null?void 0:M.dispatchAction)==null||Z.call(M,{type:"hideTip"});const G=((R=(K=H.event)==null?void 0:K.event)==null?void 0:R.clientX)??0,J=((ue=(ae=H.event)==null?void 0:ae.event)==null?void 0:ue.clientY)??0;g(n.field,String($),{x:G,y:J})}),Object.keys(F).length>0?F:void 0},[h,g,n.field]),S=t.map((F,j)=>{const M=F[r.field],H=typeof M=="number"?M:parseFloat(String(M))||0;return{name:String(F[n.field]??""),value:H,itemStyle:{color:no(j,void 0,l)}}});let w=null;if(a)if(a.field==="total"||!a.field)w=S.reduce((F,j)=>F+j.value,0);else{const F=(A=t[0])==null?void 0:A[a.field];w=typeof F=="number"?F:parseFloat(String(F))||null}const v=(F,j)=>{if(j){if(j.includes("$"))return`$${F.toLocaleString()}`;if(j.includes("%"))return`${F.toFixed(1)}%`}return F.toLocaleString()},k=w!==null?a!=null&&a.label?`{value|${v(w,(a==null?void 0:a.format)||r.format)}}
|
|
85
|
-
{label|${a.label}}`:`{value|${v(w,(a==null?void 0:a.format)||r.format)}}`:"",O={tooltip:{trigger:"item",formatter:F=>{const j=F;return`
|
|
86
|
-
<div style="padding: 8px;">
|
|
87
|
-
<div style="font-weight: 600; margin-bottom: 4px;">${j.name}</div>
|
|
88
|
-
<div>${j.marker} ${r.label||r.field}: ${v(j.value,r.format)}</div>
|
|
89
|
-
<div style="color: #6B7280; font-size: 12px;">${j.percent.toFixed(1)}%</div>
|
|
90
|
-
</div>
|
|
91
|
-
`}},legend:{show:((P=o==null?void 0:o.legend)==null?void 0:P.show)!==!1,...((_=o==null?void 0:o.legend)==null?void 0:_.position)==="top"?{top:0}:((N=o==null?void 0:o.legend)==null?void 0:N.position)==="bottom"?{bottom:0}:((I=o==null?void 0:o.legend)==null?void 0:I.position)==="left"?{left:0,orient:"vertical",top:"center"}:{orient:"vertical",right:"5%",top:"center"},textStyle:{color:"#6B7280",fontSize:12}},series:[{type:"pie",radius:["45%","70%"],center:["40%","50%"],avoidLabelOverlap:!0,itemStyle:{borderRadius:Ns(l).pieBorderRadius,borderColor:"#fff",borderWidth:2},label:{show:w!==null,position:"center",formatter:k,rich:{value:{fontSize:22,fontWeight:"bold",color:"#1F2937",lineHeight:30},label:{fontSize:12,color:"#6B7280",lineHeight:20}}},emphasis:{label:{show:!0,fontSize:14,fontWeight:"bold"},scaleSize:5},labelLine:{show:!1},data:S.map(F=>({...F,itemStyle:{...F.itemStyle,...x&&(m==null?void 0:m.value)!==F.name?{opacity:.3}:{}}}))}],animation:!0,animationDuration:300};return p.jsx(Br,{ref:E,option:O,height:c,loading:d,onEvents:C})}),kN=5,NN=50;function ih(e){if(e==null)return null;const t=typeof e=="number"?e:parseFloat(String(e));return isNaN(t)?null:t}function ON(e,t,n,r,a){return n===t?(r+a)/2:r+(e-t)/(n-t)*(a-r)}function DN(e,t,n,r){const{size:a,group:o}=r,l=(a==null?void 0:a.min)??kN,c=(a==null?void 0:a.max)??NN,d=[];for(const x of e){const C=ih(x[t]),S=ih(x[n]);if(C===null||S===null)continue;let w=null;if(a&&(w=ih(x[a.field]),w===null))continue;const v=o?String(x[o.field]??"Other"):"data";d.push({x:C,y:S,sizeVal:w,groupVal:v})}let h=1/0,m=-1/0;if(a){for(const x of d)x.sizeVal!==null&&(h=Math.min(h,x.sizeVal),m=Math.max(m,x.sizeVal));isFinite(h)||(h=0,m=0)}const g=new Map;for(const x of d){const C=g.get(x.groupVal);C?C.push(x):g.set(x.groupVal,[x])}if(g.size===0)return{series:[{name:"data",data:[],symbolSizes:a?[]:void 0}]};const E=[];for(const[x,C]of g){const S=[],w=[];for(const v of C)a&&v.sizeVal!==null?(S.push([v.x,v.y,v.sizeVal]),w.push(ON(v.sizeVal,h,m,l,c))):S.push([v.x,v.y]);E.push({name:x,data:S,symbolSizes:a?w:void 0})}return{series:E}}function AN(e){const t=e.length;if(t<2)return null;let n=0,r=0,a=0,o=0;for(const[w,v]of e)n+=w,r+=v,a+=w*v,o+=w*w;const l=t*o-n*n;if(l===0)return null;const c=(t*a-n*r)/l,d=(r-c*n)/t,h=r/t;let m=0,g=0;for(const[w,v]of e){const k=c*w+d;m+=(v-k)**2,g+=(v-h)**2}const E=g===0?1:1-m/g,x=e.map(([w])=>w),C=Math.min(...x),S=Math.max(...x);return{slope:c,intercept:d,rSquared:E,line:[[C,c*C+d],[S,c*S+d]]}}const XE=L.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:a,theme:o,height:l=400,loading:c=!1},d){const h=L.useMemo(()=>{var v,k,O;const m={size:a==null?void 0:a.size,group:a==null?void 0:a.group},{series:g}=DN(t,n.field,r.field,m),E=(A,P)=>{if(P.format){if(P.format.includes("$"))return`$${A.toLocaleString()}`;if(P.format.includes("%"))return`${A.toFixed(1)}%`}return A.toLocaleString()},x=[],C=[];g.forEach((A,P)=>{const _=no(P,g.length===1&&typeof(a==null?void 0:a.color)=="string"?a.color:void 0,o),N=A.symbolSizes;if(x.push({type:"scatter",name:A.name,data:A.data,symbolSize:N?(I,F)=>N[F.dataIndex]??10:10,itemStyle:{color:_},emphasis:{itemStyle:{shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.3)"}}}),a!=null&&a.regression&&A.data.length>=2){const I=A.data.map(j=>[j[0],j[1]]),F=AN(I);if(F){x.push({type:"line",name:`${A.name} trend`,data:F.line,showSymbol:!1,lineStyle:{color:_,type:"dashed",opacity:.6,width:2},itemStyle:{color:_},tooltip:{show:!1},silent:!0});const j=[];if(a.regression.show_equation){const M=F.intercept>=0?"+":"-";j.push(`y = ${F.slope.toFixed(2)}x ${M} ${Math.abs(F.intercept).toFixed(2)}`)}if(a.regression.show_r_squared&&j.push(`R² = ${F.rSquared.toFixed(3)}`),j.length>0){const M=P*20;C.push({type:"text",left:"70%",top:`${12+M}%`,style:{text:j.join(" "),fill:_,fontSize:11,fontFamily:"monospace"}})}}}});const S=((v=a==null?void 0:a.size)==null?void 0:v.label)??((k=a==null?void 0:a.size)==null?void 0:k.field);return{tooltip:{trigger:"item",formatter:A=>{const P=A,_=P.value[0]??0,N=P.value[1]??0,I=P.value[2];let F='<div style="padding: 8px;">';return g.length>1&&(F+=`<div style="font-weight: 600; margin-bottom: 4px;">${P.seriesName}</div>`),F+=`<div>${P.marker} ${n.label||n.field}: ${E(_,n)}</div>`,F+=`<div>${P.marker} ${r.label||r.field}: ${E(N,r)}</div>`,S&&I!=null&&(F+=`<div>${P.marker} ${S}: ${I.toLocaleString()}</div>`),F+="</div>",F}},legend:g.length>1?{show:((O=a==null?void 0:a.legend)==null?void 0:O.show)!==!1,top:0,data:g.map(A=>A.name)}:void 0,grid:{left:"3%",right:"4%",bottom:"3%",top:g.length>1?"15%":"10%",containLabel:!0},xAxis:{type:"value",name:n.label,nameLocation:"middle",nameGap:30,nameTextStyle:{color:"#6B7280",fontSize:12},axisLabel:{color:"#6B7280",fontSize:12,formatter:A=>E(A,n)},axisLine:{lineStyle:{color:"#E5E7EB"}},splitLine:{lineStyle:{color:"#E5E7EB",type:"dashed"}}},yAxis:{type:"value",name:r.label,nameLocation:"middle",nameGap:50,nameTextStyle:{color:"#6B7280",fontSize:12},axisLabel:{color:"#6B7280",fontSize:12,formatter:A=>E(A,r)},axisLine:{show:!1},splitLine:{lineStyle:{color:"#E5E7EB",type:"dashed"}}},series:x,graphic:C.length>0?C:void 0,animation:!0,animationDuration:300}},[t,n,r,a,o]);return p.jsx(Br,{ref:d,option:h,height:l,loading:c})});function R1(e,t){return e==null?"-":typeof e=="number"?t!=null&&t.includes("$")?`$${e.toLocaleString()}`:t!=null&&t.includes("%")?`${e.toFixed(1)}%`:e.toLocaleString():String(e)}function e0({data:e,columns:t,chartConfig:n,height:r=400,loading:a=!1}){var N,I,F;const[o,l]=L.useState(((N=n==null?void 0:n.sort)==null?void 0:N.field)??null),[c,d]=L.useState(((I=n==null?void 0:n.sort)==null?void 0:I.direction)??(n!=null&&n.sort?"asc":null)),[h,m]=L.useState([]),g=L.useRef([]),E=L.useMemo(()=>{let j;n!=null&&n.columns&&n.columns.length>0?j=n.columns.map(H=>({field:H.field,label:H.label??Du(H.field),format:H.format,sticky:H.sticky??!1,stickyIndex:-1,summary:H.summary})):j=t.map(H=>({field:H.name,label:Du(H.name),format:void 0,sticky:!1,stickyIndex:-1,summary:void 0}));let M=0;return j.map(H=>H.sticky&&M<3?{...H,stickyIndex:M++}:{...H,sticky:!1,stickyIndex:-1})},[n==null?void 0:n.columns,t]),x=L.useMemo(()=>E.filter(j=>j.sticky).length,[E]),C=L.useCallback(j=>M=>{g.current[j]=M},[]);L.useLayoutEffect(()=>{if(x===0){m([]);return}const j=()=>{var G;const H=[];let $=0;for(let J=0;J<x;J++)H.push($),$+=((G=g.current[J])==null?void 0:G.offsetWidth)??0;m(H)};if(j(),typeof ResizeObserver>"u")return;const M=new ResizeObserver(j);for(let H=0;H<x;H++){const $=g.current[H];$&&M.observe($)}return()=>M.disconnect()},[x,E,a]);const S=j=>{o===j?c==="asc"?d("desc"):c==="desc"?(l(null),d(null)):d("asc"):(l(j),d("asc"))},w=L.useMemo(()=>!o||!c?e:[...e].sort((j,M)=>{const H=j[o],$=M[o];if(H==null)return 1;if($==null)return-1;let G=0;return typeof H=="number"&&typeof $=="number"?G=H-$:G=String(H).localeCompare(String($)),c==="asc"?G:-G}),[e,o,c]),v=L.useMemo(()=>{const j=E.filter(H=>H.summary);if(j.length===0)return null;const M={};for(const H of j){const $=e.map(G=>G[H.field]).filter(G=>typeof G=="number");if(H.summary==="count"){M[H.field]=e.filter(G=>G[H.field]!=null).length;continue}if($.length===0){M[H.field]=null;continue}switch(H.summary){case"sum":M[H.field]=$.reduce((G,J)=>G+J,0);break;case"avg":M[H.field]=$.reduce((G,J)=>G+J,0)/$.length;break;case"min":M[H.field]=Math.min(...$);break;case"max":M[H.field]=Math.max(...$);break}}return M},[e,E]),k=((F=n==null?void 0:n.summary)==null?void 0:F.label)??"Total",O=E.findIndex(j=>!j.summary);if(a)return p.jsx("div",{className:"h-full flex items-center justify-center",children:p.jsx("div",{className:"animate-pulse bg-gray-100 w-full h-full rounded"})});const A=typeof r=="number"?`${r}px`:r,P=(j,M)=>j.sticky?{position:"sticky",left:`${h[j.stickyIndex]??0}px`,zIndex:M?3:1}:{},_=j=>j.sticky&&j.stickyIndex===x-1?"shadow-[2px_0_4px_rgba(0,0,0,0.08)]":"";return p.jsxs("div",{className:"h-full overflow-auto",style:{maxHeight:A},children:[p.jsxs("table",{className:"w-full text-sm",children:[p.jsx("thead",{className:"sticky top-0 z-[2] bg-gray-50 border-b border-gray-200",children:p.jsx("tr",{children:E.map((j,M)=>p.jsx("th",{ref:j.sticky?C(j.stickyIndex):void 0,className:`px-4 py-3 text-left font-medium text-gray-600 cursor-pointer hover:bg-gray-100 select-none bg-gray-50 ${_(j)}`,style:P(j,!0),onClick:()=>S(j.field),children:p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx("span",{children:j.label}),p.jsx("span",{className:`w-4 text-center text-gray-400 ${o===j.field?"visible":"invisible"}`,children:o===j.field&&c==="asc"?"↑":"↓"})]})},j.field))})}),p.jsx("tbody",{children:w.map((j,M)=>p.jsx("tr",{className:"border-b border-gray-100 hover:bg-gray-50",children:E.map(H=>p.jsx("td",{className:`px-4 py-3 text-gray-700 bg-white ${_(H)}`,style:P(H,!1),children:R1(j[H.field],H.format)},H.field))},M))}),v&&p.jsx("tfoot",{className:"sticky bottom-0 z-[2]",children:p.jsx("tr",{className:"border-t-2 border-gray-300 bg-gray-50 font-medium",children:E.map((j,M)=>{const H=v[j.field],$=O>=0&&M===O;return p.jsx("td",{className:`px-4 py-3 text-gray-700 bg-gray-50 ${_(j)}`,style:P(j,!1),children:$?k:H!=null?R1(H,j.format):""},j.field)})})})]}),w.length===0&&p.jsx("div",{className:"text-center py-8 text-gray-400",children:"No data"})]})}function IN(e,t){return t!=null&&t.includes("$")?`$${e.toLocaleString()}`:t!=null&&t.includes("%")?`${e.toFixed(1)}%`:e>=1e9?`${(e/1e9).toFixed(1)}B`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function RN({data:e,yAxis:t,loading:n=!1,title:r}){if(n)return p.jsx("div",{className:"h-full flex items-center justify-center",children:p.jsx("div",{className:"animate-pulse bg-gray-200 h-16 w-32 rounded"})});if(!e||e.length===0)return p.jsx("div",{className:"h-full flex items-center justify-center text-gray-400",children:"No data"});const a=e[0],o=a==null?void 0:a[t.field],l=typeof o=="number"?o:parseFloat(String(o))||0,c=IN(l,t.format),d=t.label||t.field;return p.jsxs("div",{className:"h-full flex flex-col items-center justify-center p-4",children:[p.jsx("div",{className:"text-4xl font-bold text-gray-900 tabular-nums",children:c}),(r||d)&&p.jsx("div",{className:"text-sm text-gray-500 mt-2 text-center",children:r||d})]})}const KE=L.forwardRef(function({data:t,xAxis:n,chartConfig:r,theme:a,height:o=400,loading:l=!1,onCrossFilter:c,onDrillDown:d},h){var P,_,N,I,F,j;const g=(r==null?void 0:r.series)&&"field"in r.series?Vc(t,n):Vu(t,n),E=n.type==="temporal"?$c(t,n):g,x=L.useMemo(()=>{const M={};return c&&(M.click=H=>{const $=H;if($.componentType!=="series")return;const G=$.name;G==null||G===""||c(n.field,String(G))}),d&&(M.contextmenu=(H,$)=>{var Z,K,R,ae,ue,z,Oe;const G=H;if(G.componentType!=="series")return;const J=G.name;if(J==null||J==="")return;(K=(Z=G.event)==null?void 0:Z.event)==null||K.preventDefault(),(R=$==null?void 0:$.dispatchAction)==null||R.call($,{type:"hideTip"});const Q=((ue=(ae=G.event)==null?void 0:ae.event)==null?void 0:ue.clientX)??0,re=((Oe=(z=G.event)==null?void 0:z.event)==null?void 0:Oe.clientY)??0;d(n.field,String(J),{x:Q,y:re})}),Object.keys(M).length>0?M:void 0},[c,d,n.field]),C=qc(t,{series:r.series},a),S=(P=r.axes)==null?void 0:P.left,w=(_=r.axes)==null?void 0:_.right,v=[];v.push({type:(S==null?void 0:S.scale)==="log"?"log":"value",name:S==null?void 0:S.label,nameLocation:"middle",nameGap:80,nameTextStyle:{color:"#6B7280",fontSize:12},axisLabel:{color:"#6B7280",fontSize:12,formatter:M=>ma(M,S==null?void 0:S.format)},axisLine:{show:!1},splitLine:{lineStyle:{color:"#E5E7EB",type:"dashed"}}}),w&&v.push({type:w.scale==="log"?"log":"value",name:w.label,nameLocation:"middle",nameGap:60,nameTextStyle:{color:"#6B7280",fontSize:12},axisLabel:{color:"#6B7280",fontSize:12,formatter:M=>ma(M,w.format)},axisLine:{show:!1},splitLine:{show:!1}});const k=Ns(a),O=C.map(M=>{const H=Qc(M.color,M.gradient??r.gradient),$=M.chartType??"bar",G={name:M.name,data:M.data,yAxisIndex:M.yAxisIndex??0,itemStyle:{color:H??M.color},...M.opacity!==void 0?{opacity:M.opacity}:{}};return $==="line"?{...G,type:"line",smooth:k.smooth,symbol:"circle",symbolSize:6,lineStyle:{width:2,color:M.color,type:M.style==="dashed"?"dashed":M.style==="dotted"?"dotted":"solid"}}:$==="area"?{...G,type:"line",smooth:k.smooth,symbol:"none",lineStyle:{width:2,color:M.color},areaStyle:{color:H??M.color}}:{...G,type:"bar",barWidth:"60%",itemStyle:{color:H??M.color,borderRadius:k.barBorderRadius}}}),A={tooltip:{trigger:"axis",axisPointer:{type:"cross"},formatter:M=>{const H=M;if(!Array.isArray(H)||H.length===0)return"";let G=`<div style="padding: 8px;"><div style="font-weight: 600; margin-bottom: 4px;">${E[H[0].dataIndex]??H[0].name}</div>`;for(const J of H){const Q=C.find(Z=>Z.name===J.seriesName),re=(Q==null?void 0:Q.yAxisIndex)===1?w:S;G+=`<div>${J.marker} ${J.seriesName}: ${ma(J.value,re==null?void 0:re.format)}</div>`}return G+="</div>",G}},legend:{show:((N=r.legend)==null?void 0:N.show)!==!1,...((I=r.legend)==null?void 0:I.position)==="top"?{top:0}:((F=r.legend)==null?void 0:F.position)==="left"?{left:0,orient:"vertical"}:((j=r.legend)==null?void 0:j.position)==="right"?{right:0,orient:"vertical"}:{bottom:0},textStyle:{color:"#6B7280",fontSize:12}},grid:{left:"3%",right:w?"8%":"4%",bottom:"15%",top:"10%",containLabel:!0},xAxis:{type:"category",data:g,name:n.label,nameLocation:"middle",nameGap:30,nameTextStyle:{color:"#6B7280",fontSize:12},axisLabel:{color:"#6B7280",fontSize:12,hideOverlap:!0},axisLine:{lineStyle:{color:"#E5E7EB"}},axisTick:{show:!1}},yAxis:v,series:O,animation:!0,animationDuration:300};return p.jsx(Br,{ref:h,option:A,height:o,loading:l,onEvents:x})}),JE=L.forwardRef(function({data:t,chartConfig:n,height:r=400,loading:a=!1},o){const l=L.useMemo(()=>{var k,O;const c=n.x.field,d=n.y.field,h=n.value.field,m=[...new Set(t.map(A=>String(A[c]??"")))],g=[...new Set(t.map(A=>String(A[d]??"")))],E=[];let x=1/0,C=-1/0;for(const A of t){const P=String(A[c]??""),_=String(A[d]??""),N=Number(A[h]??0),I=m.indexOf(P),F=g.indexOf(_);I>=0&&F>=0&&(E.push([I,F,N]),N<x&&(x=N),N>C&&(C=N))}x===1/0&&(x=0),C===-1/0&&(C=0);const S=((k=n.color_range)==null?void 0:k.min)??"#EBF5FB",w=((O=n.color_range)==null?void 0:O.max)??"#1A5276",v=n.show_values??!0;return{tooltip:{position:"top",formatter:A=>{const P=A,_=m[P.value[0]]??"",N=g[P.value[1]]??"",I=P.value[2],F=n.value.label??h;return`${_}, ${N}<br/>${F}: <b>${I}</b>`}},grid:{left:"3%",right:"8%",bottom:"10%",top:"6%",containLabel:!0},xAxis:{type:"category",data:m,name:n.x.label,splitArea:{show:!0}},yAxis:{type:"category",data:g,name:n.y.label,splitArea:{show:!0}},visualMap:{min:x,max:C,calculable:!0,orient:"horizontal",left:"center",bottom:"0%",inRange:{color:[S,w]}},series:[{type:"heatmap",data:E,label:{show:v},emphasis:{itemStyle:{shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]}},[t,n]);return p.jsx(Br,{ref:o,option:l,height:r,loading:a})}),ZE=L.forwardRef(function({data:t,chartConfig:n,theme:r,height:a=400,loading:o=!1},l){const c=L.useMemo(()=>{var C;const d=n.stage.field,h=n.value.field,m=n.show_conversion??!0,g=t.map(S=>({name:String(S[d]??""),value:Number(S[h]??0)})),E={};for(let S=1;S<g.length;S++){const w=g[S-1],v=g[S];if(w&&v&&w.value>0){const k=(v.value/w.value*100).toFixed(1);E[v.name]=`${k}% of ${w.name}`}}const x=n.color??((C=r==null?void 0:r.palette)==null?void 0:C[0])??"#3B82F6";return{tooltip:{trigger:"item",formatter:S=>{const w=S;let v=`${w.name}: <b>${w.value.toLocaleString()}</b>`;return m&&E[w.name]&&(v+=`<br/><span style="color:#999">${E[w.name]}</span>`),v}},series:[{type:"funnel",left:"10%",top:"10%",bottom:"10%",width:"80%",sort:"descending",gap:2,label:{show:!0,position:"inside",formatter:S=>{const w=S;return`${w.name}
|
|
92
|
-
${w.value.toLocaleString()}`}},itemStyle:{borderColor:"#fff",borderWidth:1,color:S=>{const v=1-S.dataIndex*.15;return`${x}${Math.round(Math.max(v,.3)*255).toString(16).padStart(2,"0")}`}},data:g}]}},[t,n,r]);return p.jsx(Br,{ref:l,option:c,height:a,loading:o})}),ex=L.forwardRef(function({data:t,chartConfig:n,height:r=400,loading:a=!1},o){const l=L.useMemo(()=>{var k,O,A;const c=n.category.field,d=n.value.field,h=n.total_field,m=((k=n.colors)==null?void 0:k.increase)??"#22C55E",g=((O=n.colors)==null?void 0:O.decrease)??"#EF4444",E=((A=n.colors)==null?void 0:A.total)??"#3B82F6",x=[],C=[],S=[],w=[];let v=0;for(const P of t){const _=String(P[c]??""),N=Number(P[d]??0),I=h?!!P[h]:!1;x.push(_),I?(C.push(Math.min(0,N)),S.push(Math.abs(N)),w.push(E),v=N):(N>=0?(C.push(v),S.push(N),w.push(m)):(C.push(v+N),S.push(Math.abs(N)),w.push(g)),v+=N)}return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:P=>{var M,H;const _=P;if(!_[0])return"";const N=_[0].dataIndex,I=Number(((M=t[N])==null?void 0:M[d])??0),j=!(h?!!((H=t[N])!=null&&H[h]):!1)&&I>=0?"+":"";return`${_[0].name}<br/><b>${j}${I.toLocaleString()}</b>`}},grid:{left:"3%",right:"4%",bottom:"10%",containLabel:!0},xAxis:{type:"category",data:x,axisLabel:{rotate:x.length>6?30:0}},yAxis:{type:"value"},series:[{type:"bar",stack:"waterfall",data:C,itemStyle:{color:"transparent",borderColor:"transparent"},emphasis:{itemStyle:{color:"transparent",borderColor:"transparent"}},tooltip:{show:!1}},{type:"bar",stack:"waterfall",data:S.map((P,_)=>({value:P,itemStyle:{color:w[_]}})),label:{show:!0,position:"top",formatter:P=>{var j,M;const _=P,N=Number(((j=t[_.dataIndex])==null?void 0:j[d])??0);return(h?!!((M=t[_.dataIndex])!=null&&M[h]):!1)?N.toLocaleString():`${N>=0?"+":""}${N.toLocaleString()}`}}}]}},[t,n]);return p.jsx(Br,{ref:o,option:l,height:r,loading:a})}),tx=L.forwardRef(function({data:t,chartConfig:n,theme:r,height:a=400,loading:o=!1},l){const c=L.useMemo(()=>{var S;const d=n.value.field,h=n.min??0,m=n.max??100,g=n.format??"",E=t[0]?Number(t[0][d]??0):0,x=Math.min(Math.max(E,h),m);let C;if(n.thresholds&&n.thresholds.length>0){const w=m-h||1;C=n.thresholds.map(v=>[(v.value-h)/w,v.color])}else C=[[1,((S=r==null?void 0:r.palette)==null?void 0:S[0])??"#3B82F6"]];return{series:[{type:"gauge",min:h,max:m,progress:{show:!0,width:18},axisLine:{lineStyle:{width:18,color:C}},axisTick:{show:!1},splitLine:{length:10,lineStyle:{width:2,color:"#999"}},axisLabel:{distance:25,color:"#999",fontSize:12},pointer:{itemStyle:{color:"auto"}},anchor:{show:!0,showAbove:!0,size:20,itemStyle:{borderWidth:8}},title:{show:!1},detail:{valueAnimation:!0,fontSize:28,offsetCenter:[0,"70%"],formatter:`{value}${g}`},data:[{value:x}]}]}},[t,n,r]);return p.jsx(Br,{ref:l,option:c,height:a,loading:o})});function nx({onRefresh:e,onExportCSV:t,onExportPNG:n,onExportSVG:r,onExportPDF:a,isRefreshing:o=!1,hideImageExport:l=!1}){const[c,d]=L.useState(!1),h=L.useRef(null);return L.useEffect(()=>{const m=g=>{h.current&&!h.current.contains(g.target)&&d(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[]),p.jsxs("div",{className:"relative",ref:h,children:[p.jsx("button",{onClick:()=>d(!c),className:"p-1.5 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded transition-colors",title:"Chart actions",children:p.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"})})}),c&&p.jsxs("div",{className:"absolute right-0 top-full mt-1 w-40 bg-white rounded-md shadow-lg border border-gray-200 z-50 py-1",children:[p.jsxs("button",{onClick:()=>{e(),d(!1)},disabled:o,className:"w-full text-left px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 flex items-center gap-2 disabled:opacity-50",children:[p.jsx("svg",{className:`w-4 h-4 ${o?"animate-spin":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Refresh"]}),p.jsx("div",{className:"border-t border-gray-100 my-1"}),p.jsxs("button",{onClick:()=>{t(),d(!1)},className:"w-full text-left px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 flex items-center gap-2",children:[p.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),"Export CSV"]}),!l&&p.jsxs(p.Fragment,{children:[p.jsxs("button",{onClick:()=>{n(),d(!1)},className:"w-full text-left px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 flex items-center gap-2",children:[p.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),"Export PNG"]}),p.jsxs("button",{onClick:()=>{r(),d(!1)},className:"w-full text-left px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 flex items-center gap-2",children:[p.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})}),"Export SVG"]}),a&&p.jsxs("button",{onClick:()=>{a(),d(!1)},className:"w-full text-left px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 flex items-center gap-2",children:[p.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})}),"Export PDF"]})]})]})]})}function rx({x:e,y:t,targetChartTitle:n,onDrillDown:r,onClose:a}){const o=L.useRef(null);return L.useEffect(()=>{const l=d=>{o.current&&!o.current.contains(d.target)&&a()},c=d=>{d.key==="Escape"&&a()};return document.addEventListener("mousedown",l),document.addEventListener("keydown",c),()=>{document.removeEventListener("mousedown",l),document.removeEventListener("keydown",c)}},[a]),p.jsx("div",{ref:o,className:"fixed z-[9999] bg-white border border-gray-200 rounded-lg shadow-lg py-1 min-w-[200px]",style:{left:e,top:t},children:p.jsxs("button",{className:"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 transition-colors",onClick:r,children:["Drill down to ",n]})})}const LN={day:{label:"Date",format:"%b %d, %Y"},week:{label:"Week Starting",format:"%b %d"},month:{label:"Month",format:"%b '%y"},quarter:{label:"Quarter",format:"quarter"},year:{label:"Year",format:"%Y"}};function oh(e,t){if(!t)return e.toLocaleString();const n=t.decimals??0;switch(t.type){case"currency":return new Intl.NumberFormat("en-US",{style:"currency",currency:t.currency||"USD",minimumFractionDigits:n,maximumFractionDigits:n}).format(e);case"percent":return new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:n,maximumFractionDigits:n}).format(e/100);default:return e.toLocaleString(void 0,{minimumFractionDigits:n,maximumFractionDigits:n})}}function MN(e,t){const n=e>=0?"+":"";return t==="percent_change"?`${n}${e.toFixed(1)}%`:`${n}${e.toLocaleString()}`}function PN({chartName:e,drillParams:t}){var Q,re,Z,K;const{data:n,isLoading:r}=Yb(e),{data:a,isLoading:o,error:l}=$b(e),{data:c}=io(),d=k0(),h=qe(R=>R.getEffectiveFilters),m=L.useRef(null),[g,E]=L.useState("chart"),[x,C]=L.useState(!1),S=(()=>{try{const R=sessionStorage.getItem("yamchart-last-dashboard");if(R)return JSON.parse(R)}catch{}return null})(),w=t==null?void 0:t._from,v=t?Object.fromEntries(Object.entries(t).filter(([R])=>!R.startsWith("_"))):{},k=Object.keys(v).length>0,O=Object.entries(v).map(([R,ae])=>`${R}: ${ae}`).join(", "),P=h(e).granularity,_=P?LN[P]:void 0,[N,I]=L.useState(null),F=L.useCallback((R,ae,ue)=>{var z;(z=n==null?void 0:n.drillDown)!=null&&z.chart&&I({x:ue.x,y:ue.y,field:R,value:ae})},[(Q=n==null?void 0:n.drillDown)==null?void 0:Q.chart]),j=L.useCallback(()=>{var ue,z;if(!N||!((ue=n==null?void 0:n.drillDown)!=null&&ue.chart))return;const R=n.drillDown.field??((z=n.chart.x)==null?void 0:z.field)??N.field,ae=new URLSearchParams({[R]:N.value,_from:e});window.location.hash=`/charts/${n.drillDown.chart}?${ae.toString()}`,I(null)},[N,n,e]),M=()=>{!a||!n||Yc(a.rows,a.columns,n.name||e)},H=()=>{var ae;const R=(ae=m.current)==null?void 0:ae.getDataURL("png");R&&n&&Ac(R,`${n.name||e}.png`)};if(r)return p.jsx("div",{className:"h-full flex items-center justify-center",style:{color:"var(--yc-color-text-secondary)"},children:"Loading chart..."});if(!n)return p.jsxs("div",{className:"h-full flex items-center justify-center",style:{color:"var(--yc-color-text-secondary)"},children:["Chart not found: ",e]});const $=(re=n.drillDown)!=null&&re.chart?F:void 0,G=_?{...n.chart.x,label:_.label,format:_.format}:n.chart.x,J=()=>{var R,ae;if(!a)return p.jsx("div",{className:"h-full animate-pulse",style:{background:"var(--yc-color-background)"}});if(g==="table"&&a)return p.jsx(e0,{data:a.rows,columns:a.columns,height:"100%",loading:o});switch(n.chart.type){case"line":return n.chart.x&&(n.chart.y||n.chart.series)?p.jsx(qE,{ref:m,data:a.rows,columns:a.columns,xAxis:G,yAxis:n.chart.y,chartConfig:n.chart,theme:c==null?void 0:c.theme,loading:o,onDrillDown:$}):null;case"bar":return n.chart.x&&(n.chart.y||n.chart.series)?p.jsx($E,{ref:m,data:a.rows,xAxis:G,yAxis:n.chart.y,chartConfig:n.chart,theme:c==null?void 0:c.theme,loading:o,onDrillDown:$}):null;case"area":return n.chart.x&&(n.chart.y||n.chart.series)?p.jsx(VE,{ref:m,data:a.rows,xAxis:G,yAxis:n.chart.y,chartConfig:n.chart,theme:c==null?void 0:c.theme,loading:o,onDrillDown:$}):null;case"pie":return n.chart.x&&n.chart.y?p.jsx(QE,{ref:m,data:a.rows,xAxis:n.chart.x,yAxis:n.chart.y,theme:c==null?void 0:c.theme,loading:o,onDrillDown:$}):null;case"donut":return n.chart.x&&n.chart.y?p.jsx(GE,{ref:m,data:a.rows,xAxis:n.chart.x,yAxis:n.chart.y,centerValue:n.chart.centerValue,theme:c==null?void 0:c.theme,loading:o,onDrillDown:$}):null;case"scatter":return n.chart.x&&n.chart.y?p.jsx(XE,{ref:m,data:a.rows,xAxis:n.chart.x,yAxis:n.chart.y,chartConfig:n.chart,theme:c==null?void 0:c.theme,loading:o}):null;case"combo":return n.chart.x?p.jsx(KE,{ref:m,data:a.rows,xAxis:G,chartConfig:n.chart,theme:c==null?void 0:c.theme,loading:o,onDrillDown:$}):null;case"heatmap":return p.jsx(JE,{ref:m,data:a.rows,chartConfig:n.chart,theme:c==null?void 0:c.theme,loading:o});case"funnel":return p.jsx(ZE,{ref:m,data:a.rows,chartConfig:n.chart,theme:c==null?void 0:c.theme,loading:o});case"waterfall":return p.jsx(ex,{ref:m,data:a.rows,chartConfig:n.chart,theme:c==null?void 0:c.theme,loading:o});case"gauge":return p.jsx(tx,{ref:m,data:a.rows,chartConfig:n.chart,theme:c==null?void 0:c.theme,loading:o});case"table":return p.jsx(e0,{data:a.rows,columns:a.columns,chartConfig:n.chart,height:"100%",loading:o});case"kpi":{const ue=n.chart;if(!((R=ue.value)!=null&&R.field)||!a.rows[0])return p.jsx("div",{className:"h-full flex items-center justify-center",style:{color:"var(--yc-color-text-secondary)"},children:"No data available"});const z=a.rows[0],Oe=z[ue.value.field],Be=oh(Oe,ue.format);let Te=null,Ze="percent_change",$e,Ge,tt;if(a.comparison)Te=a.comparison.change,Ze=a.comparison.changeType,$e=a.comparison.currentPeriodLabel,Ge=a.comparison.previousPeriodLabel,tt=oh(a.comparison.previousValue,ue.format);else if((ae=ue.comparison)!=null&&ae.enabled&&ue.comparison.field){const We=z[ue.comparison.field];Ze=ue.comparison.type,We&&We!==0&&(Te=Ze==="percent_change"?(Oe-We)/We*100:Oe-We,tt=oh(We,ue.format))}return p.jsxs("div",{className:"h-full flex flex-col items-center justify-center p-8",children:[p.jsxs("div",{className:"text-6xl font-bold tabular-nums",style:{color:"var(--yc-color-text)"},children:[Be,ue.unit&&p.jsx("span",{className:"text-3xl font-normal ml-2",style:{color:"var(--yc-color-text-secondary)"},children:ue.unit})]}),$e&&p.jsx("div",{className:"text-sm mt-2",style:{color:"var(--yc-color-text-secondary)"},children:$e}),Te!==null&&p.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[p.jsx("span",{className:Bn("text-sm font-medium px-2 py-0.5 rounded",Te>=0?"bg-green-100 text-green-700":"bg-red-100 text-red-700"),children:MN(Te,Ze)}),tt&&p.jsxs("span",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:["vs ",tt]}),Ge&&p.jsxs("span",{className:"text-xs",style:{color:"var(--yc-color-text-secondary)"},children:["(",Ge,")"]})]})]})}default:return p.jsxs("div",{className:"h-full flex items-center justify-center",style:{color:"var(--yc-color-text-secondary)"},children:['Chart type "',n.chart.type,'" not yet implemented']})}};return p.jsxs("div",{className:"h-full flex flex-col",children:[p.jsxs("div",{className:"px-6 pt-4 pb-3 space-y-3",children:[!w&&S&&p.jsxs("div",{className:"flex items-center gap-1.5 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:[p.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})}),p.jsx("a",{href:`#/dashboards/${S.name}`,className:"hover:underline",style:{color:"var(--yc-color-primary)"},children:S.title})]}),w&&p.jsxs("div",{className:"flex items-center gap-2 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:[p.jsx("button",{onClick:()=>{window.location.hash=`/charts/${w}`},className:"hover:underline",style:{color:"var(--yc-color-primary)"},children:w}),p.jsx("span",{children:"/"}),p.jsx("span",{style:{color:"var(--yc-color-text)"},className:"font-medium",children:n.title}),O&&p.jsxs("span",{children:["(",O,")"]})]}),p.jsxs("div",{className:"flex items-start justify-between gap-4",children:[p.jsxs("div",{children:[p.jsx("h1",{className:"text-xl font-semibold",style:{color:"var(--yc-color-text)",fontFamily:"var(--yc-font-heading)"},children:n.title}),n.description&&p.jsx("p",{className:"text-sm mt-1",style:{color:"var(--yc-color-text-secondary)"},children:n.description})]}),p.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[p.jsx("button",{onClick:()=>d(e),className:"p-2 rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)"},title:"Refresh",children:p.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}),p.jsx(uN,{resourceType:"chart",resourceName:e})]})]}),n.parameters.length>0&&p.jsx(zE,{parameters:n.parameters,chartName:e}),k&&p.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[p.jsx("span",{className:"text-xs font-medium",style:{color:"var(--yc-color-text-secondary)"},children:"Filtered:"}),Object.entries(v).map(([R,ae])=>p.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs rounded-full",style:{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",color:"var(--yc-color-primary)"},children:[R,": ",ae]},R))]})]}),p.jsx("div",{className:"flex-1 min-h-0 px-6",children:p.jsx("div",{className:"h-full rounded-lg overflow-hidden",style:{background:"var(--yc-color-surface)",border:"var(--yc-card-border)",boxShadow:"var(--yc-shadow)",borderRadius:"var(--yc-radius)"},children:l?p.jsx("div",{className:"h-full flex items-center justify-center text-red-500 text-sm",children:l.message}):J()})}),p.jsx("div",{className:"px-6 pb-2",children:p.jsx(lN,{rowCount:a==null?void 0:a.meta.rowCount,durationMs:a==null?void 0:a.meta.durationMs,cached:a==null?void 0:a.meta.cached,view:g,onToggleView:E,onExportCSV:M,onExportPNG:H,onShowSql:()=>C(!x)})}),k&&a&&p.jsx("div",{className:"px-6 pb-4",children:p.jsx(bN,{data:a.rows,columns:a.columns,drillDownColumns:(Z=n.drillDown)==null?void 0:Z.columns,filterDisplay:O,chartName:e})}),N&&((K=n.drillDown)==null?void 0:K.chart)&&p.jsx(rx,{x:N.x,y:N.y,targetChartTitle:n.drillDown.chart,onDrillDown:j,onClose:()=>I(null)}),p.jsx(hN,{isOpen:x,onClose:()=>C(!1),compiledSql:a==null?void 0:a.meta.compiledSql,modelName:e,durationMs:a==null?void 0:a.meta.durationMs,rowCount:a==null?void 0:a.meta.rowCount,cached:a==null?void 0:a.meta.cached})]})}function FN(e=50){const t=[],n=[];return{push(r){t.push(r),t.length>e&&t.shift(),n.length=0},undo(){if(t.length===0)return null;const r=t.pop();return n.push(r),r},redo(){if(n.length===0)return null;const r=n.pop();return t.push(r),r},canUndo(){return t.length>0},canRedo(){return n.length>0},clear(){t.length=0,n.length=0}}}const sx=L.createContext(null);function jN({children:e}){const[t,n]=L.useState(!1),[r,a]=L.useState(null),[o,l]=L.useState(null),[c,d]=L.useState(null),h=L.useRef(FN()),[m,g]=L.useState(!1),[E,x]=L.useState(!1),C=r!==null,S=L.useMemo(()=>r||o,[r,o]),w=L.useCallback(N=>{l(N)},[]),v=L.useCallback(N=>{if(N===null){a(null);return}const I=r||o;I&&h.current.push(I),a(N),g(h.current.canUndo()),x(h.current.canRedo())},[r,o]),k=L.useCallback(()=>{const N=h.current.undo();N&&(a(N),g(h.current.canUndo()),x(h.current.canRedo()))},[]),O=L.useCallback(()=>{const N=h.current.redo();N&&(a(N),g(h.current.canUndo()),x(h.current.canRedo()))},[]);L.useEffect(()=>{h.current.clear(),g(!1),x(!1),d(null)},[t]),L.useEffect(()=>{if(!t)return;const N=I=>{const F=I.metaKey||I.ctrlKey;F&&I.key==="z"&&!I.shiftKey&&(I.preventDefault(),k()),F&&I.key==="z"&&I.shiftKey&&(I.preventDefault(),O())};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[t,k,O]);const A=L.useCallback(N=>{var G;const I=r||o;if(!I)return;const j=N.type==="chart"&&((G=N.ref)==null?void 0:G.toLowerCase().includes("kpi"))?3:6,H={height:100,widgets:[{...N,cols:j}]},$={...I,rows:[...I.rows,H]};v($)},[r,o,v]),P=L.useCallback((N,I)=>{const F=r||o;if(!F)return;const j=F.rows.map((H,$)=>{if($!==N)return H;const G=H.widgets.filter((J,Q)=>Q!==I);return{...H,widgets:G}}).filter(H=>H.widgets.length>0),M={...F,rows:j};v(M)},[r,o,v]),_=L.useCallback((N,I,F)=>{const j=r||o;if(!j)return;const M=j.rows.map(($,G)=>{if(G!==N)return $;const J=$.widgets.map((Q,re)=>re!==I?Q:{...Q,...F});return{...$,widgets:J}}),H={...j,rows:M};v(H)},[r,o,v]);return p.jsx(sx.Provider,{value:{isEditing:t,setIsEditing:n,pendingLayout:r,setPendingLayout:v,hasChanges:C,originalLayout:o,setOriginalLayout:w,currentLayout:S,addWidget:A,removeWidget:P,updateWidget:_,pendingFilters:c,setPendingFilters:d,undo:k,redo:O,canUndo:m,canRedo:E},children:e})}function fo(){const e=L.useContext(sx);if(!e)throw new Error("useEditMode must be used within EditModeProvider");return e}function ho(e){const{margin:t,containerPadding:n,containerWidth:r,cols:a}=e;return(r-t[0]*(a-1)-n[0]*2)/a}function ro(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function su(e,t,n,r,a,o,l){const{margin:c,containerPadding:d,rowHeight:h}=e,m=ho(e);let g,E,x,C;if(l?(g=Math.round(l.width),E=Math.round(l.height)):(g=ro(r,m,c[0]),E=ro(a,h,c[1])),o?(x=Math.round(o.top),C=Math.round(o.left)):l?(x=Math.round(l.top),C=Math.round(l.left)):(x=Math.round((h+c[1])*n+d[1]),C=Math.round((m+c[0])*t+d[0])),!o&&!l){if(Number.isFinite(r)){const w=Math.round((m+c[0])*(t+r)+d[0])-C-g;w!==c[0]&&(g+=w-c[0])}if(Number.isFinite(a)){const w=Math.round((h+c[1])*(n+a)+d[1])-x-E;w!==c[1]&&(E+=w-c[1])}}return{top:x,left:C,width:g,height:E}}function BN(e,t,n,r,a){const{margin:o,containerPadding:l,cols:c,rowHeight:d,maxRows:h}=e,m=ho(e);let g=Math.round((n-l[0])/(m+o[0])),E=Math.round((t-l[1])/(d+o[1]));return g=Ic(g,0,c-r),E=Ic(E,0,h-a),{x:g,y:E}}function cc(e,t,n){const{margin:r,containerPadding:a,rowHeight:o}=e,l=ho(e),c=Math.round((n-a[0])/(l+r[0])),d=Math.round((t-a[1])/(o+r[1]));return{x:c,y:d}}function HN(e,t,n){const{margin:r,rowHeight:a}=e,o=ho(e),l=Math.max(1,Math.round((t+r[0])/(o+r[0]))),c=Math.max(1,Math.round((n+r[1])/(a+r[1])));return{w:l,h:c}}function Ic(e,t,n){return Math.max(Math.min(e,n),t)}function W0(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function Qa(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(r!==void 0&&W0(r,t))return r}}function ax(e,t){return e.filter(n=>W0(n,t))}function UN(e,t){return t==="horizontal"?ix(e):t==="vertical"||t==="wrap"?t0(e):[...e]}function t0(e){return[...e].sort((t,n)=>t.y!==n.y?t.y-n.y:t.x-n.x)}function ix(e){return[...e].sort((t,n)=>t.x!==n.x?t.x-n.x:t.y-n.y)}function Y0(e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];if(r!==void 0){const a=r.y+r.h;a>t&&(t=a)}}return t}function Ra(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(r!==void 0&&r.i===t)return r}}function Gc(e){return e.filter(t=>t.static===!0)}function ei(e){return{i:e.i,x:e.x,y:e.y,w:e.w,h:e.h,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,constraints:e.constraints,isBounded:e.isBounded}}function Xc(e){const t=new Array(e.length);for(let n=0;n<e.length;n++){const r=e[n];r!==void 0&&(t[n]=ei(r))}return t}function zN(e,t){const n=new Array(e.length);for(let r=0;r<e.length;r++){const a=e[r];a!==void 0&&(t.i===a.i?n[r]=t:n[r]=a)}return n}function WN(e,t,n){let r=Ra(e,t);return r?(r=n(ei(r)),[zN(e,r),r]):[[...e],null]}function YN(e,t){const n=Gc(e);for(let r=0;r<e.length;r++){const a=e[r];if(a!==void 0)if(a.x+a.w>t.cols&&(a.x=t.cols-a.w),a.x<0&&(a.x=0,a.w=t.cols),!a.static)n.push(a);else for(;Qa(n,a);)a.y++}return e}function Fa(e,t,n,r,a,o,l,c,d){if(t.static&&t.isDraggable!==!0)return[...e];if(t.y===r&&t.x===n)return[...e];const h=t.x,m=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let g=UN(e,l);(l==="vertical"&&typeof r=="number"?m>=r:l==="horizontal"&&typeof n=="number"?h>=n:!1)&&(g=g.reverse());const x=ax(g,t),C=x.length>0;if(C&&d)return Xc(e);if(C&&o)return t.x=h,t.y=m,t.moved=!1,e;let S=[...e];for(let w=0;w<x.length;w++){const v=x[w];v!==void 0&&(v.moved||(v.static?S=L1(S,v,t,a,l):S=L1(S,t,v,a,l)))}return S}function L1(e,t,n,r,a,o){const l=a==="horizontal",c=a==="vertical",d=t.static;if(r){r=!1;const g={x:l?Math.max(t.x-n.w,0):n.x,y:c?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},E=Qa(e,g),x=E!==void 0&&E.y+E.h>t.y,C=E!==void 0&&t.x+t.w>E.x;if(!E)return Fa(e,n,l?g.x:void 0,c?g.y:void 0,r,d,a);if(x&&c)return Fa(e,n,void 0,n.y+1,r,d,a);if(x&&a===null)return t.y=n.y,n.y=n.y+n.h,[...e];if(C&&l)return Fa(e,t,n.x,void 0,r,d,a)}const h=l?n.x+1:void 0,m=c?n.y+1:void 0;return h===void 0&&m===void 0?[...e]:Fa(e,n,h,m,r,d,a)}function fa(e,t,n){return Math.max(t,Math.min(n,e))}var qN={name:"gridBounds",constrainPosition(e,t,n,{cols:r,maxRows:a}){return{x:fa(t,0,Math.max(0,r-e.w)),y:fa(n,0,Math.max(0,a-e.h))}},constrainSize(e,t,n,r,{cols:a,maxRows:o}){const l=r==="w"||r==="nw"||r==="sw"?e.x+e.w:a-e.x,c=r==="n"||r==="nw"||r==="ne"?e.y+e.h:o-e.y;return{w:fa(t,1,Math.max(1,l)),h:fa(n,1,Math.max(1,c))}}},$N={name:"minMaxSize",constrainSize(e,t,n){return{w:fa(t,e.minW??1,e.maxW??1/0),h:fa(n,e.minH??1,e.maxH??1/0)}}},VN={name:"containerBounds",constrainPosition(e,t,n,{cols:r,maxRows:a,containerHeight:o,rowHeight:l,margin:c}){const d=o>0?Math.floor((o+c[1])/(l+c[1])):a;return{x:fa(t,0,Math.max(0,r-e.w)),y:fa(n,0,Math.max(0,d-e.h))}}},Rc=[qN,$N];function dc(e,t,n,r,a){let o={x:n,y:r};for(const l of e)l.constrainPosition&&(o=l.constrainPosition(t,o.x,o.y,a));if(t.constraints)for(const l of t.constraints)l.constrainPosition&&(o=l.constrainPosition(t,o.x,o.y,a));return o}function QN(e,t,n,r,a,o){let l={w:n,h:r};for(const c of e)c.constrainSize&&(l=c.constrainSize(t,l.w,l.h,a,o));if(t.constraints)for(const c of t.constraints)c.constrainSize&&(l=c.constrainSize(t,l.w,l.h,a,o));return l}function q0({top:e,left:t,width:n,height:r}){const a=`translate(${t}px,${e}px)`;return{transform:a,WebkitTransform:a,MozTransform:a,msTransform:a,OTransform:a,width:`${n}px`,height:`${r}px`,position:"absolute"}}function ox({top:e,left:t,width:n,height:r}){return{top:`${e}px`,left:`${t}px`,width:`${n}px`,height:`${r}px`,position:"absolute"}}function M1(e){return e*100+"%"}function GN(e,t,n,r){return e+n>r?t:n}function ux(e,t,n){return e<0?t:n}function XN(e){return Math.max(0,e)}function Lc(e){return Math.max(0,e)}var $0=(e,t,n)=>{const{left:r,height:a,width:o}=t,l=e.top-(a-e.height);return{left:r,width:o,height:ux(l,e.height,a),top:Lc(l)}},V0=(e,t,n)=>{const{top:r,left:a,height:o,width:l}=t;return{top:r,height:o,width:GN(e.left,e.width,l,n),left:XN(a)}},Q0=(e,t,n)=>{const{top:r,height:a,width:o}=t,l=e.left+e.width-o;return l<0?{height:a,width:e.left+e.width,top:Lc(r),left:0}:{height:a,width:o,top:Lc(r),left:l}},G0=(e,t,n)=>{const{top:r,left:a,height:o,width:l}=t;return{width:l,left:a,height:ux(r,e.height,o),top:Lc(r)}},KN=(e,t,n)=>$0(e,V0(e,t,n)),JN=(e,t,n)=>$0(e,Q0(e,t)),ZN=(e,t,n)=>G0(e,V0(e,t,n)),e3=(e,t,n)=>G0(e,Q0(e,t)),t3={n:$0,ne:KN,e:V0,se:ZN,s:G0,sw:e3,w:Q0,nw:JN};function n3(e,t,n,r){const a=t3[e];return a?a(t,{...t,...n},r):n}var lx={type:"transform",scale:1,calcStyle(e){return q0(e)}},r3={type:"absolute",scale:1,calcStyle(e){return ox(e)}};function s3(e){return{type:"transform",scale:e,calcStyle(t){return q0(t)},calcDragPosition(t,n,r,a){return{left:(t-r)/e,top:(n-a)/e}}}}var a3=lx,i3={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},o3={enabled:!0,bounded:!1,threshold:3},u3={enabled:!0,handles:["se"]},l3={enabled:!1,defaultItem:{w:1,h:1}};function X0(e,t,n,r,a){const o=r==="x"?"w":"h";t[r]+=1;const l=e.findIndex(d=>d.i===t.i),c=a??Gc(e).length>0;for(let d=l+1;d<e.length;d++){const h=e[d];if(h!==void 0&&!h.static){if(!c&&h.y>t.y+t.h)break;W0(t,h)&&X0(e,h,n+t[o],r,c)}}t[r]=n}function c3(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0),t.y=Math.min(r,t.y);t.y>0&&!Qa(e,t);)t.y--;let a;for(;(a=Qa(e,t))!==void 0;)X0(n,t,a.y+a.h,"y");return t.y=Math.max(t.y,0),t}function d3(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0);t.x>0&&!Qa(e,t);)t.x--;let a;for(;(a=Qa(e,t))!==void 0;)if(X0(r,t,a.x+a.w,"x"),t.x+t.w>n)for(t.x=n-t.w,t.y++;t.x>0&&!Qa(e,t);)t.x--;return t.x=Math.max(t.x,0),t}var cx={type:"vertical",allowOverlap:!1,compact(e,t){const n=Gc(e);let r=Y0(n);const a=t0(e),o=new Array(e.length);for(let l=0;l<a.length;l++){const c=a[l];if(c===void 0)continue;let d=ei(c);d.static||(d=c3(n,d,a,r),r=Math.max(r,d.y+d.h),n.push(d));const h=e.indexOf(c);o[h]=d,d.moved=!1}return o}},dx={type:"horizontal",allowOverlap:!1,compact(e,t){const n=Gc(e),r=ix(e),a=new Array(e.length);for(let o=0;o<r.length;o++){const l=r[o];if(l===void 0)continue;let c=ei(l);c.static||(c=d3(n,c,t,r),n.push(c));const d=e.indexOf(l);a[d]=c,c.moved=!1}return a}},fx={type:null,allowOverlap:!1,compact(e,t){return Xc(e)}},f3={...cx,allowOverlap:!0,compact(e,t){return Xc(e)}},h3={...dx,allowOverlap:!0,compact(e,t){return Xc(e)}},p3={...fx,allowOverlap:!0};function hx(e,t=!1,n=!1){let r;return t?e==="vertical"?r=f3:e==="horizontal"?r=h3:r=p3:e==="vertical"?r=cx:e==="horizontal"?r=dx:r=fx,n?{...r,preventCollision:n}:r}var au={exports:{}},uh={},lh={exports:{}},ch,P1;function m3(){if(P1)return ch;P1=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ch=e,ch}var dh,F1;function g3(){if(F1)return dh;F1=1;var e=m3();function t(){}function n(){}return n.resetWarningCache=t,dh=function(){function r(l,c,d,h,m,g){if(g!==e){var E=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw E.name="Invariant Violation",E}}r.isRequired=r;function a(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},dh}var j1;function Kc(){return j1||(j1=1,lh.exports=g3()()),lh.exports}var fc={exports:{}},B1;function y3(){if(B1)return fc.exports;B1=1;function e(n){var r,a,o="";if(typeof n=="string"||typeof n=="number")o+=n;else if(typeof n=="object")if(Array.isArray(n)){var l=n.length;for(r=0;r<l;r++)n[r]&&(a=e(n[r]))&&(o&&(o+=" "),o+=a)}else for(a in n)n[a]&&(o&&(o+=" "),o+=a);return o}function t(){for(var n,r,a=0,o="",l=arguments.length;a<l;a++)(n=arguments[a])&&(r=e(n))&&(o&&(o+=" "),o+=r);return o}return fc.exports=t,fc.exports.clsx=t,fc.exports}var Kt={},Xs={},H1;function Jc(){if(H1)return Xs;H1=1,Object.defineProperty(Xs,"__esModule",{value:!0}),Xs.dontSetMe=a,Xs.findInArray=e,Xs.int=r,Xs.isFunction=t,Xs.isNum=n;function e(o,l){for(let c=0,d=o.length;c<d;c++)if(l.apply(l,[o[c],c,o]))return o[c]}function t(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Function]"}function n(o){return typeof o=="number"&&!isNaN(o)}function r(o){return parseInt(o,10)}function a(o,l,c){if(o[l])return new Error(`Invalid prop ${l} passed to ${c} - do not set this, set it on the child.`)}return Xs}var Ks={},U1;function b3(){if(U1)return Ks;U1=1,Object.defineProperty(Ks,"__esModule",{value:!0}),Ks.browserPrefixToKey=n,Ks.browserPrefixToStyle=r,Ks.default=void 0,Ks.getPrefix=t;const e=["Moz","Webkit","O","ms"];function t(){var c,d;let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const l=(d=(c=window.document)==null?void 0:c.documentElement)==null?void 0:d.style;if(!l||o in l)return"";for(let h=0;h<e.length;h++)if(n(o,e[h])in l)return e[h];return""}function n(o,l){return l?`${l}${a(o)}`:o}function r(o,l){return l?`-${l.toLowerCase()}-${o}`:o}function a(o){let l="",c=!0;for(let d=0;d<o.length;d++)c?(l+=o[d].toUpperCase(),c=!1):o[d]==="-"?c=!0:l+=o[d];return l}return Ks.default=t(),Ks}var z1;function K0(){if(z1)return Kt;z1=1,Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.addClassName=P,Kt.addEvent=l,Kt.addUserSelectStyles=k,Kt.createCSSTransform=x,Kt.createSVGTransform=C,Kt.getTouch=w,Kt.getTouchIdentifier=v,Kt.getTranslation=S,Kt.innerHeight=m,Kt.innerWidth=g,Kt.matchesSelector=a,Kt.matchesSelectorAndParentsTo=o,Kt.offsetXYFromParent=E,Kt.outerHeight=d,Kt.outerWidth=h,Kt.removeClassName=_,Kt.removeEvent=c,Kt.scheduleRemoveUserSelectStyles=O;var e=Jc(),t=n(b3());function n(N,I){if(typeof WeakMap=="function")var F=new WeakMap,j=new WeakMap;return(n=function(M,H){if(!H&&M&&M.__esModule)return M;var $,G,J={__proto__:null,default:M};if(M===null||typeof M!="object"&&typeof M!="function")return J;if($=H?j:F){if($.has(M))return $.get(M);$.set(M,J)}for(const Q in M)Q!=="default"&&{}.hasOwnProperty.call(M,Q)&&((G=($=Object.defineProperty)&&Object.getOwnPropertyDescriptor(M,Q))&&(G.get||G.set)?$(J,Q,G):J[Q]=M[Q]);return J})(N,I)}let r="";function a(N,I){return r||(r=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(F){return(0,e.isFunction)(N[F])})),(0,e.isFunction)(N[r])?N[r](I):!1}function o(N,I,F){let j=N;do{if(a(j,I))return!0;if(j===F)return!1;j=j.parentNode}while(j);return!1}function l(N,I,F,j){if(!N)return;const M={capture:!0,...j};N.addEventListener?N.addEventListener(I,F,M):N.attachEvent?N.attachEvent("on"+I,F):N["on"+I]=F}function c(N,I,F,j){if(!N)return;const M={capture:!0,...j};N.removeEventListener?N.removeEventListener(I,F,M):N.detachEvent?N.detachEvent("on"+I,F):N["on"+I]=null}function d(N){let I=N.clientHeight;const F=N.ownerDocument.defaultView.getComputedStyle(N);return I+=(0,e.int)(F.borderTopWidth),I+=(0,e.int)(F.borderBottomWidth),I}function h(N){let I=N.clientWidth;const F=N.ownerDocument.defaultView.getComputedStyle(N);return I+=(0,e.int)(F.borderLeftWidth),I+=(0,e.int)(F.borderRightWidth),I}function m(N){let I=N.clientHeight;const F=N.ownerDocument.defaultView.getComputedStyle(N);return I-=(0,e.int)(F.paddingTop),I-=(0,e.int)(F.paddingBottom),I}function g(N){let I=N.clientWidth;const F=N.ownerDocument.defaultView.getComputedStyle(N);return I-=(0,e.int)(F.paddingLeft),I-=(0,e.int)(F.paddingRight),I}function E(N,I,F){const M=I===I.ownerDocument.body?{left:0,top:0}:I.getBoundingClientRect(),H=(N.clientX+I.scrollLeft-M.left)/F,$=(N.clientY+I.scrollTop-M.top)/F;return{x:H,y:$}}function x(N,I){const F=S(N,I,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:F}}function C(N,I){return S(N,I,"")}function S(N,I,F){let{x:j,y:M}=N,H=`translate(${j}${F},${M}${F})`;if(I){const $=`${typeof I.x=="string"?I.x:I.x+F}`,G=`${typeof I.y=="string"?I.y:I.y+F}`;H=`translate(${$}, ${G})`+H}return H}function w(N,I){return N.targetTouches&&(0,e.findInArray)(N.targetTouches,F=>I===F.identifier)||N.changedTouches&&(0,e.findInArray)(N.changedTouches,F=>I===F.identifier)}function v(N){if(N.targetTouches&&N.targetTouches[0])return N.targetTouches[0].identifier;if(N.changedTouches&&N.changedTouches[0])return N.changedTouches[0].identifier}function k(N){if(!N)return;let I=N.getElementById("react-draggable-style-el");I||(I=N.createElement("style"),I.type="text/css",I.id="react-draggable-style-el",I.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
93
|
-
`,I.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
94
|
-
`,N.getElementsByTagName("head")[0].appendChild(I)),N.body&&P(N.body,"react-draggable-transparent-selection")}function O(N){window.requestAnimationFrame?window.requestAnimationFrame(()=>{A(N)}):A(N)}function A(N){if(N)try{if(N.body&&_(N.body,"react-draggable-transparent-selection"),N.selection)N.selection.empty();else{const I=(N.defaultView||window).getSelection();I&&I.type!=="Caret"&&I.removeAllRanges()}}catch{}}function P(N,I){N.classList?N.classList.add(I):N.className.match(new RegExp(`(?:^|\\s)${I}(?!\\S)`))||(N.className+=` ${I}`)}function _(N,I){N.classList?N.classList.remove(I):N.className=N.className.replace(new RegExp(`(?:^|\\s)${I}(?!\\S)`,"g"),"")}return Kt}var Vr={},W1;function px(){if(W1)return Vr;W1=1,Object.defineProperty(Vr,"__esModule",{value:!0}),Vr.canDragX=a,Vr.canDragY=o,Vr.createCoreData=c,Vr.createDraggableData=d,Vr.getBoundPosition=n,Vr.getControlPosition=l,Vr.snapToGrid=r;var e=Jc(),t=K0();function n(g,E,x){if(!g.props.bounds)return[E,x];let{bounds:C}=g.props;C=typeof C=="string"?C:h(C);const S=m(g);if(typeof C=="string"){const{ownerDocument:w}=S,v=w.defaultView;let k;if(C==="parent"?k=S.parentNode:k=S.getRootNode().querySelector(C),!(k instanceof v.HTMLElement))throw new Error('Bounds selector "'+C+'" could not find an element.');const O=k,A=v.getComputedStyle(S),P=v.getComputedStyle(O);C={left:-S.offsetLeft+(0,e.int)(P.paddingLeft)+(0,e.int)(A.marginLeft),top:-S.offsetTop+(0,e.int)(P.paddingTop)+(0,e.int)(A.marginTop),right:(0,t.innerWidth)(O)-(0,t.outerWidth)(S)-S.offsetLeft+(0,e.int)(P.paddingRight)-(0,e.int)(A.marginRight),bottom:(0,t.innerHeight)(O)-(0,t.outerHeight)(S)-S.offsetTop+(0,e.int)(P.paddingBottom)-(0,e.int)(A.marginBottom)}}return(0,e.isNum)(C.right)&&(E=Math.min(E,C.right)),(0,e.isNum)(C.bottom)&&(x=Math.min(x,C.bottom)),(0,e.isNum)(C.left)&&(E=Math.max(E,C.left)),(0,e.isNum)(C.top)&&(x=Math.max(x,C.top)),[E,x]}function r(g,E,x){const C=Math.round(E/g[0])*g[0],S=Math.round(x/g[1])*g[1];return[C,S]}function a(g){return g.props.axis==="both"||g.props.axis==="x"}function o(g){return g.props.axis==="both"||g.props.axis==="y"}function l(g,E,x){const C=typeof E=="number"?(0,t.getTouch)(g,E):null;if(typeof E=="number"&&!C)return null;const S=m(x),w=x.props.offsetParent||S.offsetParent||S.ownerDocument.body;return(0,t.offsetXYFromParent)(C||g,w,x.props.scale)}function c(g,E,x){const C=!(0,e.isNum)(g.lastX),S=m(g);return C?{node:S,deltaX:0,deltaY:0,lastX:E,lastY:x,x:E,y:x}:{node:S,deltaX:E-g.lastX,deltaY:x-g.lastY,lastX:g.lastX,lastY:g.lastY,x:E,y:x}}function d(g,E){const x=g.props.scale;return{node:E.node,x:g.state.x+E.deltaX/x,y:g.state.y+E.deltaY/x,deltaX:E.deltaX/x,deltaY:E.deltaY/x,lastX:g.state.x,lastY:g.state.y}}function h(g){return{left:g.left,top:g.top,right:g.right,bottom:g.bottom}}function m(g){const E=g.findDOMNode();if(!E)throw new Error("<DraggableCore>: Unmounted during event!");return E}return Vr}var iu={},hc={},Y1;function mx(){if(Y1)return hc;Y1=1,Object.defineProperty(hc,"__esModule",{value:!0}),hc.default=e;function e(){}return hc}var q1;function E3(){if(q1)return iu;q1=1,Object.defineProperty(iu,"__esModule",{value:!0}),iu.default=void 0;var e=d(ti()),t=c(Kc()),n=c(Bc()),r=K0(),a=px(),o=Jc(),l=c(mx());function c(S){return S&&S.__esModule?S:{default:S}}function d(S,w){if(typeof WeakMap=="function")var v=new WeakMap,k=new WeakMap;return(d=function(O,A){if(!A&&O&&O.__esModule)return O;var P,_,N={__proto__:null,default:O};if(O===null||typeof O!="object"&&typeof O!="function")return N;if(P=A?k:v){if(P.has(O))return P.get(O);P.set(O,N)}for(const I in O)I!=="default"&&{}.hasOwnProperty.call(O,I)&&((_=(P=Object.defineProperty)&&Object.getOwnPropertyDescriptor(O,I))&&(_.get||_.set)?P(N,I,_):N[I]=O[I]);return N})(S,w)}function h(S,w,v){return(w=m(w))in S?Object.defineProperty(S,w,{value:v,enumerable:!0,configurable:!0,writable:!0}):S[w]=v,S}function m(S){var w=g(S,"string");return typeof w=="symbol"?w:w+""}function g(S,w){if(typeof S!="object"||!S)return S;var v=S[Symbol.toPrimitive];if(v!==void 0){var k=v.call(S,w);if(typeof k!="object")return k;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(S)}const E={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let x=E.mouse,C=class extends e.Component{constructor(){super(...arguments),h(this,"dragging",!1),h(this,"lastX",NaN),h(this,"lastY",NaN),h(this,"touchIdentifier",null),h(this,"mounted",!1),h(this,"handleDragStart",w=>{if(this.props.onMouseDown(w),!this.props.allowAnyClick&&typeof w.button=="number"&&w.button!==0)return!1;const v=this.findDOMNode();if(!v||!v.ownerDocument||!v.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:k}=v;if(this.props.disabled||!(w.target instanceof k.defaultView.Node)||this.props.handle&&!(0,r.matchesSelectorAndParentsTo)(w.target,this.props.handle,v)||this.props.cancel&&(0,r.matchesSelectorAndParentsTo)(w.target,this.props.cancel,v))return;w.type==="touchstart"&&!this.props.allowMobileScroll&&w.preventDefault();const O=(0,r.getTouchIdentifier)(w);this.touchIdentifier=O;const A=(0,a.getControlPosition)(w,O,this);if(A==null)return;const{x:P,y:_}=A,N=(0,a.createCoreData)(this,P,_);(0,l.default)("DraggableCore: handleDragStart: %j",N),(0,l.default)("calling",this.props.onStart),!(this.props.onStart(w,N)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,r.addUserSelectStyles)(k),this.dragging=!0,this.lastX=P,this.lastY=_,(0,r.addEvent)(k,x.move,this.handleDrag),(0,r.addEvent)(k,x.stop,this.handleDragStop))}),h(this,"handleDrag",w=>{const v=(0,a.getControlPosition)(w,this.touchIdentifier,this);if(v==null)return;let{x:k,y:O}=v;if(Array.isArray(this.props.grid)){let _=k-this.lastX,N=O-this.lastY;if([_,N]=(0,a.snapToGrid)(this.props.grid,_,N),!_&&!N)return;k=this.lastX+_,O=this.lastY+N}const A=(0,a.createCoreData)(this,k,O);if((0,l.default)("DraggableCore: handleDrag: %j",A),this.props.onDrag(w,A)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const N=document.createEvent("MouseEvents");N.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(N)}return}this.lastX=k,this.lastY=O}),h(this,"handleDragStop",w=>{if(!this.dragging)return;const v=(0,a.getControlPosition)(w,this.touchIdentifier,this);if(v==null)return;let{x:k,y:O}=v;if(Array.isArray(this.props.grid)){let N=k-this.lastX||0,I=O-this.lastY||0;[N,I]=(0,a.snapToGrid)(this.props.grid,N,I),k=this.lastX+N,O=this.lastY+I}const A=(0,a.createCoreData)(this,k,O);if(this.props.onStop(w,A)===!1||this.mounted===!1)return!1;const _=this.findDOMNode();_&&this.props.enableUserSelectHack&&(0,r.scheduleRemoveUserSelectStyles)(_.ownerDocument),(0,l.default)("DraggableCore: handleDragStop: %j",A),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,_&&((0,l.default)("DraggableCore: Removing handlers"),(0,r.removeEvent)(_.ownerDocument,x.move,this.handleDrag),(0,r.removeEvent)(_.ownerDocument,x.stop,this.handleDragStop))}),h(this,"onMouseDown",w=>(x=E.mouse,this.handleDragStart(w))),h(this,"onMouseUp",w=>(x=E.mouse,this.handleDragStop(w))),h(this,"onTouchStart",w=>(x=E.touch,this.handleDragStart(w))),h(this,"onTouchEnd",w=>(x=E.touch,this.handleDragStop(w)))}componentDidMount(){this.mounted=!0;const w=this.findDOMNode();w&&(0,r.addEvent)(w,E.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const w=this.findDOMNode();if(w){const{ownerDocument:v}=w;(0,r.removeEvent)(v,E.mouse.move,this.handleDrag),(0,r.removeEvent)(v,E.touch.move,this.handleDrag),(0,r.removeEvent)(v,E.mouse.stop,this.handleDragStop),(0,r.removeEvent)(v,E.touch.stop,this.handleDragStop),(0,r.removeEvent)(w,E.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,r.scheduleRemoveUserSelectStyles)(v)}}findDOMNode(){var w,v,k;return(w=this.props)!=null&&w.nodeRef?(k=(v=this.props)==null?void 0:v.nodeRef)==null?void 0:k.current:n.default.findDOMNode(this)}render(){return e.cloneElement(e.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return iu.default=C,h(C,"displayName","DraggableCore"),h(C,"propTypes",{allowAnyClick:t.default.bool,allowMobileScroll:t.default.bool,children:t.default.node.isRequired,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:function(S,w){if(S[w]&&S[w].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:t.default.arrayOf(t.default.number),handle:t.default.string,cancel:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number,className:o.dontSetMe,style:o.dontSetMe,transform:o.dontSetMe}),h(C,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),iu}var $1;function x3(){return $1||($1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return d.default}}),e.default=void 0;var t=g(ti()),n=m(Kc()),r=m(Bc()),a=y3(),o=K0(),l=px(),c=Jc(),d=m(E3()),h=m(mx());function m(v){return v&&v.__esModule?v:{default:v}}function g(v,k){if(typeof WeakMap=="function")var O=new WeakMap,A=new WeakMap;return(g=function(P,_){if(!_&&P&&P.__esModule)return P;var N,I,F={__proto__:null,default:P};if(P===null||typeof P!="object"&&typeof P!="function")return F;if(N=_?A:O){if(N.has(P))return N.get(P);N.set(P,F)}for(const j in P)j!=="default"&&{}.hasOwnProperty.call(P,j)&&((I=(N=Object.defineProperty)&&Object.getOwnPropertyDescriptor(P,j))&&(I.get||I.set)?N(F,j,I):F[j]=P[j]);return F})(v,k)}function E(){return E=Object.assign?Object.assign.bind():function(v){for(var k=1;k<arguments.length;k++){var O=arguments[k];for(var A in O)({}).hasOwnProperty.call(O,A)&&(v[A]=O[A])}return v},E.apply(null,arguments)}function x(v,k,O){return(k=C(k))in v?Object.defineProperty(v,k,{value:O,enumerable:!0,configurable:!0,writable:!0}):v[k]=O,v}function C(v){var k=S(v,"string");return typeof k=="symbol"?k:k+""}function S(v,k){if(typeof v!="object"||!v)return v;var O=v[Symbol.toPrimitive];if(O!==void 0){var A=O.call(v,k);if(typeof A!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(k==="string"?String:Number)(v)}class w extends t.Component{static getDerivedStateFromProps(k,O){let{position:A}=k,{prevPropsPosition:P}=O;return A&&(!P||A.x!==P.x||A.y!==P.y)?((0,h.default)("Draggable: getDerivedStateFromProps %j",{position:A,prevPropsPosition:P}),{x:A.x,y:A.y,prevPropsPosition:{...A}}):null}constructor(k){super(k),x(this,"onDragStart",(O,A)=>{if((0,h.default)("Draggable: onDragStart: %j",A),this.props.onStart(O,(0,l.createDraggableData)(this,A))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),x(this,"onDrag",(O,A)=>{if(!this.state.dragging)return!1;(0,h.default)("Draggable: onDrag: %j",A);const P=(0,l.createDraggableData)(this,A),_={x:P.x,y:P.y,slackX:0,slackY:0};if(this.props.bounds){const{x:I,y:F}=_;_.x+=this.state.slackX,_.y+=this.state.slackY;const[j,M]=(0,l.getBoundPosition)(this,_.x,_.y);_.x=j,_.y=M,_.slackX=this.state.slackX+(I-_.x),_.slackY=this.state.slackY+(F-_.y),P.x=_.x,P.y=_.y,P.deltaX=_.x-this.state.x,P.deltaY=_.y-this.state.y}if(this.props.onDrag(O,P)===!1)return!1;this.setState(_)}),x(this,"onDragStop",(O,A)=>{if(!this.state.dragging||this.props.onStop(O,(0,l.createDraggableData)(this,A))===!1)return!1;(0,h.default)("Draggable: onDragStop: %j",A);const _={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:I,y:F}=this.props.position;_.x=I,_.y=F}this.setState(_)}),this.state={dragging:!1,dragged:!1,x:k.position?k.position.x:k.defaultPosition.x,y:k.position?k.position.y:k.defaultPosition.y,prevPropsPosition:{...k.position},slackX:0,slackY:0,isElementSVG:!1},k.position&&!(k.onDrag||k.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){var k,O;return((O=(k=this.props)==null?void 0:k.nodeRef)==null?void 0:O.current)??r.default.findDOMNode(this)}render(){const{axis:k,bounds:O,children:A,defaultPosition:P,defaultClassName:_,defaultClassNameDragging:N,defaultClassNameDragged:I,position:F,positionOffset:j,scale:M,...H}=this.props;let $={},G=null;const Q=!!!F||this.state.dragging,re=F||P,Z={x:(0,l.canDragX)(this)&&Q?this.state.x:re.x,y:(0,l.canDragY)(this)&&Q?this.state.y:re.y};this.state.isElementSVG?G=(0,o.createSVGTransform)(Z,j):$=(0,o.createCSSTransform)(Z,j);const K=(0,a.clsx)(A.props.className||"",_,{[N]:this.state.dragging,[I]:this.state.dragged});return t.createElement(d.default,E({},H,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(A),{className:K,style:{...A.props.style,...$},transform:G}))}}e.default=w,x(w,"displayName","Draggable"),x(w,"propTypes",{...d.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:c.dontSetMe,style:c.dontSetMe,transform:c.dontSetMe}),x(w,"defaultProps",{...d.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(uh)),uh}var V1;function J0(){if(V1)return au.exports;V1=1;const{default:e,DraggableCore:t}=x3();return au.exports=e,au.exports.default=e,au.exports.DraggableCore=t,au.exports}var T3=J0(),ou={exports:{}},uu={},pc={},Q1;function v3(){if(Q1)return pc;Q1=1,pc.__esModule=!0,pc.cloneElement=c;var e=t(ti());function t(d){return d&&d.__esModule?d:{default:d}}function n(d,h){var m=Object.keys(d);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(d);h&&(g=g.filter(function(E){return Object.getOwnPropertyDescriptor(d,E).enumerable})),m.push.apply(m,g)}return m}function r(d){for(var h=1;h<arguments.length;h++){var m=arguments[h]!=null?arguments[h]:{};h%2?n(Object(m),!0).forEach(function(g){a(d,g,m[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(m)):n(Object(m)).forEach(function(g){Object.defineProperty(d,g,Object.getOwnPropertyDescriptor(m,g))})}return d}function a(d,h,m){return(h=o(h))in d?Object.defineProperty(d,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):d[h]=m,d}function o(d){var h=l(d,"string");return typeof h=="symbol"?h:h+""}function l(d,h){if(typeof d!="object"||!d)return d;var m=d[Symbol.toPrimitive];if(m!==void 0){var g=m.call(d,h);if(typeof g!="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(d)}function c(d,h){return h.style&&d.props.style&&(h.style=r(r({},d.props.style),h.style)),h.className&&d.props.className&&(h.className=`${d.props.className} ${h.className}`),e.default.cloneElement(d,h)}return pc}var lu={},G1;function gx(){if(G1)return lu;G1=1,lu.__esModule=!0,lu.resizableProps=void 0;var e=t(Kc());J0();function t(n){return n&&n.__esModule?n:{default:n}}return lu.resizableProps={axis:e.default.oneOf(["both","x","y","none"]),className:e.default.string,children:e.default.element.isRequired,draggableOpts:e.default.shape({allowAnyClick:e.default.bool,cancel:e.default.string,children:e.default.node,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:typeof Element<"u"?e.default.instanceOf(Element):e.default.any,grid:e.default.arrayOf(e.default.number),handle:e.default.string,nodeRef:e.default.object,onStart:e.default.func,onDrag:e.default.func,onStop:e.default.func,onMouseDown:e.default.func,scale:e.default.number}),height:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];const[o]=r;return o.axis==="both"||o.axis==="y"?e.default.number.isRequired(...r):e.default.number(...r)},handle:e.default.oneOfType([e.default.node,e.default.func]),handleSize:e.default.arrayOf(e.default.number),lockAspectRatio:e.default.bool,maxConstraints:e.default.arrayOf(e.default.number),minConstraints:e.default.arrayOf(e.default.number),onResizeStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,resizeHandles:e.default.arrayOf(e.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:e.default.number,width:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];const[o]=r;return o.axis==="both"||o.axis==="x"?e.default.number.isRequired(...r):e.default.number(...r)}},lu}var X1;function yx(){if(X1)return uu;X1=1,uu.__esModule=!0,uu.default=void 0;var e=o(ti()),t=J0(),n=v3(),r=gx();const a=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function o(S,w){if(typeof WeakMap=="function")var v=new WeakMap,k=new WeakMap;return(o=function(O,A){if(!A&&O&&O.__esModule)return O;var P,_,N={__proto__:null,default:O};if(O===null||typeof O!="object"&&typeof O!="function")return N;if(P=A?k:v){if(P.has(O))return P.get(O);P.set(O,N)}for(const I in O)I!=="default"&&{}.hasOwnProperty.call(O,I)&&((_=(P=Object.defineProperty)&&Object.getOwnPropertyDescriptor(O,I))&&(_.get||_.set)?P(N,I,_):N[I]=O[I]);return N})(S,w)}function l(){return l=Object.assign?Object.assign.bind():function(S){for(var w=1;w<arguments.length;w++){var v=arguments[w];for(var k in v)({}).hasOwnProperty.call(v,k)&&(S[k]=v[k])}return S},l.apply(null,arguments)}function c(S,w){if(S==null)return{};var v,k,O=d(S,w);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(S);for(k=0;k<A.length;k++)v=A[k],w.indexOf(v)===-1&&{}.propertyIsEnumerable.call(S,v)&&(O[v]=S[v])}return O}function d(S,w){if(S==null)return{};var v={};for(var k in S)if({}.hasOwnProperty.call(S,k)){if(w.indexOf(k)!==-1)continue;v[k]=S[k]}return v}function h(S,w){var v=Object.keys(S);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(S);w&&(k=k.filter(function(O){return Object.getOwnPropertyDescriptor(S,O).enumerable})),v.push.apply(v,k)}return v}function m(S){for(var w=1;w<arguments.length;w++){var v=arguments[w]!=null?arguments[w]:{};w%2?h(Object(v),!0).forEach(function(k){g(S,k,v[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(S,Object.getOwnPropertyDescriptors(v)):h(Object(v)).forEach(function(k){Object.defineProperty(S,k,Object.getOwnPropertyDescriptor(v,k))})}return S}function g(S,w,v){return(w=E(w))in S?Object.defineProperty(S,w,{value:v,enumerable:!0,configurable:!0,writable:!0}):S[w]=v,S}function E(S){var w=x(S,"string");return typeof w=="symbol"?w:w+""}function x(S,w){if(typeof S!="object"||!S)return S;var v=S[Symbol.toPrimitive];if(v!==void 0){var k=v.call(S,w);if(typeof k!="object")return k;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(S)}let C=class extends e.Component{constructor(){super(...arguments),this.handleRefs={},this.lastHandleRect=null,this.slack=null,this.lastSize=null}componentWillUnmount(){this.resetData()}resetData(){this.lastHandleRect=this.slack=this.lastSize=null}runConstraints(w,v){const{minConstraints:k,maxConstraints:O,lockAspectRatio:A}=this.props;if(!k&&!O&&!A)return[w,v];if(A){const F=this.props.width/this.props.height,j=w-this.props.width,M=v-this.props.height;Math.abs(j)>Math.abs(M*F)?v=w/F:w=v*F}const[P,_]=[w,v];let[N,I]=this.slack||[0,0];return w+=N,v+=I,k&&(w=Math.max(k[0],w),v=Math.max(k[1],v)),O&&(w=Math.min(O[0],w),v=Math.min(O[1],v)),this.slack=[N+(P-w),I+(_-v)],[w,v]}resizeHandler(w,v){return(k,O)=>{var re;let{node:A,deltaX:P,deltaY:_}=O;w==="onResizeStart"&&this.resetData();const N=(this.props.axis==="both"||this.props.axis==="x")&&v!=="n"&&v!=="s",I=(this.props.axis==="both"||this.props.axis==="y")&&v!=="e"&&v!=="w";if(!N&&!I)return;const F=v[0],j=v[v.length-1],M=A.getBoundingClientRect();if(this.lastHandleRect!=null){if(j==="w"){const Z=M.left-this.lastHandleRect.left;P+=Z}if(F==="n"){const Z=M.top-this.lastHandleRect.top;_+=Z}}this.lastHandleRect=M,j==="w"&&(P=-P),F==="n"&&(_=-_);let H=this.props.width+(N?P/this.props.transformScale:0),$=this.props.height+(I?_/this.props.transformScale:0);[H,$]=this.runConstraints(H,$),w==="onResizeStop"&&this.lastSize&&({width:H,height:$}=this.lastSize);const G=H!==this.props.width||$!==this.props.height;w!=="onResizeStop"&&(this.lastSize={width:H,height:$});const J=typeof this.props[w]=="function"?this.props[w]:null;J&&!(w==="onResize"&&!G)&&((re=k.persist)==null||re.call(k),J(k,{node:A,size:{width:H,height:$},handle:v})),w==="onResizeStop"&&this.resetData()}}renderResizeHandle(w,v){const{handle:k}=this.props;if(!k)return e.createElement("span",{className:`react-resizable-handle react-resizable-handle-${w}`,ref:v});if(typeof k=="function")return k(w,v);const O=typeof k.type=="string",A=m({ref:v},O?{}:{handleAxis:w});return e.cloneElement(k,A)}render(){const w=this.props,{children:v,className:k,draggableOpts:O,width:A,height:P,handle:_,handleSize:N,lockAspectRatio:I,axis:F,minConstraints:j,maxConstraints:M,onResize:H,onResizeStop:$,onResizeStart:G,resizeHandles:J,transformScale:Q}=w,re=c(w,a);return(0,n.cloneElement)(v,m(m({},re),{},{className:`${k?`${k} `:""}react-resizable`,children:[...e.Children.toArray(v.props.children),...J.map(Z=>{const K=this.handleRefs[Z]??(this.handleRefs[Z]=e.createRef());return e.createElement(t.DraggableCore,l({},O,{nodeRef:K,key:`resizableHandle-${Z}`,onStop:this.resizeHandler("onResizeStop",Z),onStart:this.resizeHandler("onResizeStart",Z),onDrag:this.resizeHandler("onResize",Z)}),this.renderResizeHandle(Z,K))})]}))}};return uu.default=C,C.propTypes=r.resizableProps,C.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},uu}var cu={},K1;function w3(){if(K1)return cu;K1=1,cu.__esModule=!0,cu.default=void 0;var e=l(ti()),t=o(Kc()),n=o(yx()),r=gx();const a=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function o(w){return w&&w.__esModule?w:{default:w}}function l(w,v){if(typeof WeakMap=="function")var k=new WeakMap,O=new WeakMap;return(l=function(A,P){if(!P&&A&&A.__esModule)return A;var _,N,I={__proto__:null,default:A};if(A===null||typeof A!="object"&&typeof A!="function")return I;if(_=P?O:k){if(_.has(A))return _.get(A);_.set(A,I)}for(const F in A)F!=="default"&&{}.hasOwnProperty.call(A,F)&&((N=(_=Object.defineProperty)&&Object.getOwnPropertyDescriptor(A,F))&&(N.get||N.set)?_(I,F,N):I[F]=A[F]);return I})(w,v)}function c(){return c=Object.assign?Object.assign.bind():function(w){for(var v=1;v<arguments.length;v++){var k=arguments[v];for(var O in k)({}).hasOwnProperty.call(k,O)&&(w[O]=k[O])}return w},c.apply(null,arguments)}function d(w,v){var k=Object.keys(w);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(w);v&&(O=O.filter(function(A){return Object.getOwnPropertyDescriptor(w,A).enumerable})),k.push.apply(k,O)}return k}function h(w){for(var v=1;v<arguments.length;v++){var k=arguments[v]!=null?arguments[v]:{};v%2?d(Object(k),!0).forEach(function(O){m(w,O,k[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(k)):d(Object(k)).forEach(function(O){Object.defineProperty(w,O,Object.getOwnPropertyDescriptor(k,O))})}return w}function m(w,v,k){return(v=g(v))in w?Object.defineProperty(w,v,{value:k,enumerable:!0,configurable:!0,writable:!0}):w[v]=k,w}function g(w){var v=E(w,"string");return typeof v=="symbol"?v:v+""}function E(w,v){if(typeof w!="object"||!w)return w;var k=w[Symbol.toPrimitive];if(k!==void 0){var O=k.call(w,v);if(typeof O!="object")return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return(v==="string"?String:Number)(w)}function x(w,v){if(w==null)return{};var k,O,A=C(w,v);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(w);for(O=0;O<P.length;O++)k=P[O],v.indexOf(k)===-1&&{}.propertyIsEnumerable.call(w,k)&&(A[k]=w[k])}return A}function C(w,v){if(w==null)return{};var k={};for(var O in w)if({}.hasOwnProperty.call(w,O)){if(v.indexOf(O)!==-1)continue;k[O]=w[O]}return k}let S=class extends e.Component{constructor(){super(...arguments),this.state={width:this.props.width,height:this.props.height,propsWidth:this.props.width,propsHeight:this.props.height},this.onResize=(v,k)=>{var A;const{size:O}=k;this.props.onResize?((A=v.persist)==null||A.call(v),this.setState(O,()=>this.props.onResize&&this.props.onResize(v,k))):this.setState(O)}}static getDerivedStateFromProps(v,k){return k.propsWidth!==v.width||k.propsHeight!==v.height?{width:v.width,height:v.height,propsWidth:v.width,propsHeight:v.height}:null}render(){const v=this.props,{handle:k,handleSize:O,onResize:A,onResizeStart:P,onResizeStop:_,draggableOpts:N,minConstraints:I,maxConstraints:F,lockAspectRatio:j,axis:M,width:H,height:$,resizeHandles:G,style:J,transformScale:Q}=v,re=x(v,a);return e.createElement(n.default,{axis:M,draggableOpts:N,handle:k,handleSize:O,height:this.state.height,lockAspectRatio:j,maxConstraints:F,minConstraints:I,onResizeStart:P,onResize:this.onResize,onResizeStop:_,resizeHandles:G,transformScale:Q,width:this.state.width},e.createElement("div",c({},re,{style:h(h({},J),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}};return cu.default=S,S.propTypes=h(h({},r.resizableProps),{},{children:t.default.element}),cu}var J1;function S3(){return J1||(J1=1,ou.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},ou.exports.Resizable=yx().default,ou.exports.ResizableBox=w3().default),ou.exports}var _3=S3();function bx(e){return function(n,r,a,o,l,c,d){return e(n,r,d)}}function Zc(e){return function(n,r,a,o){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,a,o);var l=o.get(n),c=o.get(r);if(l&&c)return l===r&&c===n;o.set(n,r),o.set(r,n);var d=e(n,r,a,o);return o.delete(n),o.delete(r),d}}function Ex(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}function Z1(e){return e.constructor===Object||e.constructor==null}function ey(e){return typeof e.then=="function"}function ed(e,t){return e===t||e!==e&&t!==t}var C3="[object Arguments]",k3="[object Boolean]",N3="[object Date]",O3="[object RegExp]",D3="[object Map]",A3="[object Number]",I3="[object Object]",R3="[object Set]",L3="[object String]",ty=Object.prototype.toString;function td(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,a=e.areObjectsEqual,o=e.areRegExpsEqual,l=e.areSetsEqual,c=e.createIsNestedEqual,d=c(h);function h(m,g,E){if(m===g)return!0;if(!m||!g||typeof m!="object"||typeof g!="object")return m!==m&&g!==g;if(Z1(m)&&Z1(g))return a(m,g,d,E);var x=Array.isArray(m),C=Array.isArray(g);if(x||C)return x===C&&t(m,g,d,E);var S=ty.call(m);return S!==ty.call(g)?!1:S===N3?n(m,g,d,E):S===O3?o(m,g,d,E):S===D3?r(m,g,d,E):S===R3?l(m,g,d,E):S===I3||S===C3?ey(m)||ey(g)?!1:a(m,g,d,E):S===k3||S===A3||S===L3?ed(m.valueOf(),g.valueOf()):!1}return h}function xx(e,t,n,r){var a=e.length;if(t.length!==a)return!1;for(;a-- >0;)if(!n(e[a],t[a],a,a,e,t,r))return!1;return!0}var M3=Zc(xx);function Tx(e,t){return ed(e.valueOf(),t.valueOf())}function vx(e,t,n,r){var a=e.size===t.size;if(!a)return!1;if(!e.size)return!0;var o={},l=0;return e.forEach(function(c,d){if(a){var h=!1,m=0;t.forEach(function(g,E){!h&&!o[m]&&(h=n(d,E,l,m,e,t,r)&&n(c,g,d,E,e,t,r))&&(o[m]=!0),m++}),l++,a=h}}),a}var P3=Zc(vx),F3="_owner",j3=Object.prototype.hasOwnProperty;function wx(e,t,n,r){var a=Object.keys(e),o=a.length;if(Object.keys(t).length!==o)return!1;for(var l;o-- >0;){if(l=a[o],l===F3){var c=!!e.$$typeof,d=!!t.$$typeof;if((c||d)&&c!==d)return!1}if(!j3.call(t,l)||!n(e[l],t[l],l,l,e,t,r))return!1}return!0}var B3=Zc(wx);function Sx(e,t){return e.source===t.source&&e.flags===t.flags}function _x(e,t,n,r){var a=e.size===t.size;if(!a)return!1;if(!e.size)return!0;var o={};return e.forEach(function(l,c){if(a){var d=!1,h=0;t.forEach(function(m,g){!d&&!o[h]&&(d=n(l,m,c,g,e,t,r))&&(o[h]=!0),h++}),a=d}}),a}var H3=Zc(_x),Cx=Object.freeze({areArraysEqual:xx,areDatesEqual:Tx,areMapsEqual:vx,areObjectsEqual:wx,areRegExpsEqual:Sx,areSetsEqual:_x,createIsNestedEqual:bx}),kx=Object.freeze({areArraysEqual:M3,areDatesEqual:Tx,areMapsEqual:P3,areObjectsEqual:B3,areRegExpsEqual:Sx,areSetsEqual:H3,createIsNestedEqual:bx}),U3=td(Cx);function Ri(e,t){return U3(e,t,void 0)}td(Ex(Cx,{createIsNestedEqual:function(){return ed}}));td(kx);td(Ex(kx,{createIsNestedEqual:function(){return ed}}));function ny(e){const{children:t,cols:n,containerWidth:r,margin:a,containerPadding:o,rowHeight:l,maxRows:c,isDraggable:d,isResizable:h,isBounded:m,static:g,useCSSTransforms:E=!0,usePercentages:x=!1,transformScale:C=1,positionStrategy:S,dragThreshold:w=0,droppingPosition:v,className:k="",style:O,handle:A="",cancel:P="",x:_,y:N,w:I,h:F,minW:j=1,maxW:M=1/0,minH:H=1,maxH:$=1/0,i:G,resizeHandles:J,resizeHandle:Q,constraints:re=Rc,layoutItem:Z,layout:K=[],onDragStart:R,onDrag:ae,onDragStop:ue,onResizeStart:z,onResize:Oe,onResizeStop:Be}=e,[Te,Ze]=L.useState(!1),[$e,Ge]=L.useState(!1),tt=L.useRef(null),We=L.useRef({left:0,top:0}),pn=L.useRef({top:0,left:0,width:0,height:0}),Gt=L.useRef(void 0),Hn=L.useRef(K);Hn.current=K;const tn=L.useRef(null),nn=L.useRef(null),mn=L.useRef(!1),tr=L.useRef({x:0,y:0}),it=L.useRef(!1),nt=L.useMemo(()=>({cols:n,containerPadding:o,containerWidth:r,margin:a,maxRows:c,rowHeight:l}),[n,o,r,a,c,l]),Et=L.useMemo(()=>({cols:n,maxRows:c,containerWidth:r,containerHeight:0,rowHeight:l,margin:a,layout:[]}),[n,c,r,l,a]),Nt=L.useCallback(()=>({...Et,layout:Hn.current}),[Et]),on=L.useMemo(()=>Z??{i:G,x:_,y:N,w:I,h:F,minW:j,maxW:M,minH:H,maxH:$},[Z,G,_,N,I,F,j,M,H,$]),nr=L.useCallback(be=>{if(S!=null&&S.calcStyle)return S.calcStyle(be);if(E)return q0(be);const _e=ox(be);return x?{..._e,left:M1(be.left/r),width:M1(be.width/r)}:_e},[S,E,x,r]),un=L.useCallback((be,{node:_e})=>{if(!R)return;const{offsetParent:Je}=_e;if(!Je)return;const Ce=Je.getBoundingClientRect(),It=_e.getBoundingClientRect(),Wt=It.left/C,Yt=Ce.left/C,Rt=It.top/C,qt=Ce.top/C;let Cn;if(S!=null&&S.calcDragPosition){const Ye=be;Cn=S.calcDragPosition(Ye.clientX,Ye.clientY,Ye.clientX-It.left,Ye.clientY-It.top)}else Cn={left:Wt-Yt+Je.scrollLeft,top:Rt-qt+Je.scrollTop};if(We.current=Cn,w>0){const Ye=be;tr.current={x:Ye.clientX,y:Ye.clientY},mn.current=!0,it.current=!1,Ze(!0);return}Ze(!0);const zn=cc(nt,Cn.top,Cn.left),{x:Ur,y:ke}=dc(re,on,zn.x,zn.y,Nt());R(G,Ur,ke,{e:be,node:_e,newPosition:Cn})},[R,C,nt,S,w,re,on,Nt,G]),oe=L.useCallback((be,{node:_e,deltaX:Je,deltaY:Ce})=>{if(!ae||!Te)return;const It=be;if(mn.current&&!it.current){const Ur=It.clientX-tr.current.x,ke=It.clientY-tr.current.y;if(Math.hypot(Ur,ke)<w)return;if(it.current=!0,mn.current=!1,R){const Me=cc(nt,We.current.top,We.current.left),{x:rt,y:dt}=dc(re,on,Me.x,Me.y,Nt());R(G,rt,dt,{e:be,node:_e,newPosition:We.current})}}let Wt=We.current.top+Ce,Yt=We.current.left+Je;if(m){const{offsetParent:Ur}=_e;if(Ur){const ke=Ur.clientHeight-ro(F,l,a[1]);Wt=Ic(Wt,0,ke);const Ye=ho(nt),Me=r-ro(I,Ye,a[0]);Yt=Ic(Yt,0,Me)}}const Rt={top:Wt,left:Yt};We.current=Rt;const qt=cc(nt,Wt,Yt),{x:Cn,y:zn}=dc(re,on,qt.x,qt.y,Nt());ae(G,Cn,zn,{e:be,node:_e,newPosition:Rt})},[ae,R,Te,w,m,F,l,a,nt,r,I,G,re,on,Nt]),pe=L.useCallback((be,{node:_e})=>{if(!ue||!Te)return;const Je=mn.current;if(mn.current=!1,it.current=!1,tr.current={x:0,y:0},Je){Ze(!1),We.current={left:0,top:0};return}const{left:Ce,top:It}=We.current,Wt={top:It,left:Ce};Ze(!1),We.current={left:0,top:0};const Yt=cc(nt,It,Ce),{x:Rt,y:qt}=dc(re,on,Yt.x,Yt.y,Nt());ue(G,Rt,qt,{e:be,node:_e,newPosition:Wt})},[ue,Te,nt,re,on,Nt,G]);tn.current=un,nn.current=oe;const De=L.useCallback((be,{node:_e,size:Je,handle:Ce},It,Wt)=>{const Yt=Wt==="onResizeStart"?z:Wt==="onResize"?Oe:Be;if(!Yt)return;let Rt;_e?Rt=n3(Ce,It,Je,r):Rt={...Je,top:It.top,left:It.left},pn.current=Rt;const qt=HN(nt,Rt.width,Rt.height),{w:Cn,h:zn}=QN(re,on,qt.w,qt.h,Ce,Nt());Yt(G,Cn,zn,{e:be.nativeEvent,node:_e,size:Rt,handle:Ce})},[z,Oe,Be,r,nt,G,re,on,Nt]),He=L.useCallback((be,_e)=>{Ge(!0);const Je=su(nt,_,N,I,F),Ce={..._e,handle:_e.handle};De(be,Ce,Je,"onResizeStart")},[De,nt,_,N,I,F]),Ve=L.useCallback((be,_e)=>{const Je=su(nt,_,N,I,F),Ce={..._e,handle:_e.handle};De(be,Ce,Je,"onResize")},[De,nt,_,N,I,F]),gt=L.useCallback((be,_e)=>{Ge(!1),pn.current={top:0,left:0,width:0,height:0};const Je=su(nt,_,N,I,F),Ce={..._e,handle:_e.handle};De(be,Ce,Je,"onResizeStop")},[De,nt,_,N,I,F]);L.useEffect(()=>{var Ce,It;if(!v)return;const be=tt.current;if(!be)return;const _e=Gt.current||{left:0,top:0},Je=Te&&(v.left!==_e.left||v.top!==_e.top);if(Te){if(Je){const Wt=v.left-We.current.left,Yt=v.top-We.current.top,Rt={node:be,deltaX:Wt,deltaY:Yt,lastX:We.current.left,lastY:We.current.top,x:v.left,y:v.top};(It=nn.current)==null||It.call(nn,v.e,Rt)}}else{const Wt={node:be,deltaX:v.left,deltaY:v.top,lastX:0,lastY:0,x:v.left,y:v.top};(Ce=tn.current)==null||Ce.call(tn,v.e,Wt)}Gt.current=v},[v,Te,G]);const zt=su(nt,_,N,I,F,Te?We.current:null,$e?pn.current:null),rn=Ee.Children.only(t),_n=su(nt,0,0,1,1),Un=[_n.width,_n.height],At=[1/0,1/0],yt=rn.props,ln=yt.className,_r=yt.style;let Le=Ee.cloneElement(rn,{ref:tt,className:Bn("react-grid-item",ln,k,{static:g,resizing:$e,"react-draggable":d,"react-draggable-dragging":Te,dropping:!!v,cssTransforms:E}),style:{...O,..._r,...nr(zt)}});const Qe=Q;return Le=p.jsx(_3.Resizable,{draggableOpts:{disabled:!h},className:h?void 0:"react-resizable-hide",width:zt.width,height:zt.height,minConstraints:Un,maxConstraints:At,onResizeStart:He,onResize:Ve,onResizeStop:gt,transformScale:C,resizeHandles:J,handle:Qe,children:Le}),Le=p.jsx(T3.DraggableCore,{disabled:!d,onStart:un,onDrag:oe,onStop:pe,handle:A,cancel:".react-resizable-handle"+(P?","+P:""),scale:C,nodeRef:tt,children:Le}),Le}var ys=()=>{},ry="react-grid-layout",Nx=!1;try{Nx=/firefox/i.test(navigator.userAgent)}catch{}function z3(e,t){const n=Ee.Children.toArray(e),r=Ee.Children.toArray(t);if(n.length!==r.length)return!1;for(let a=0;a<n.length;a++){const o=n[a],l=r[a];if((o==null?void 0:o.key)!==(l==null?void 0:l.key))return!1}return!0}function sy(e,t,n,r){const a=[],o=new Set;Ee.Children.forEach(t,c=>{if(!Ee.isValidElement(c)||c.key===null)return;const d=String(c.key);o.add(d);const h=e.find(m=>m.i===d);if(h)a.push(ei(h));else{const g=c.props["data-grid"];g?a.push({i:d,x:g.x??0,y:g.y??0,w:g.w??1,h:g.h??1,minW:g.minW,maxW:g.maxW,minH:g.minH,maxH:g.maxH,static:g.static,isDraggable:g.isDraggable,isResizable:g.isResizable,resizeHandles:g.resizeHandles,isBounded:g.isBounded}):a.push({i:d,x:0,y:Y0(a),w:1,h:1})}});const l=YN(a,{cols:n});return r.compact(l,n)}function W3(e){const{children:t,width:n,gridConfig:r,dragConfig:a,resizeConfig:o,dropConfig:l,positionStrategy:c=a3,compactor:d,constraints:h=Rc,layout:m=[],droppingItem:g,autoSize:E=!0,className:x="",style:C={},innerRef:S,onLayoutChange:w=ys,onDragStart:v=ys,onDrag:k=ys,onDragStop:O=ys,onResizeStart:A=ys,onResize:P=ys,onResizeStop:_=ys,onDrop:N=ys,onDropDragOver:I=ys}=e,F=L.useMemo(()=>({...i3,...r}),[r]),j=L.useMemo(()=>({...o3,...a}),[a]),M=L.useMemo(()=>({...u3,...o}),[o]),H=L.useMemo(()=>({...l3,...l}),[l]),{cols:$,rowHeight:G,maxRows:J,margin:Q,containerPadding:re}=F,{enabled:Z,bounded:K,handle:R,cancel:ae,threshold:ue}=j,{enabled:z,handles:Oe,handleComponent:Be}=M,{enabled:Te,defaultItem:Ze,onDragOver:$e}=H,Ge=d??hx("vertical"),tt=Ge.type,We=Ge.allowOverlap,pn=Ge.preventCollision??!1,Gt=L.useMemo(()=>g??{i:"__dropping-elem__",...Ze},[g,Ze]),Hn=c.type==="transform",tn=c.scale,nn=re??Q,[mn,tr]=L.useState(!1),[it,nt]=L.useState(()=>sy(m,t,$,Ge)),[Et,Nt]=L.useState(null),[on,nr]=L.useState(!1),[un,oe]=L.useState(null),[pe,De]=L.useState(),He=L.useRef(null),Ve=L.useRef(null),gt=L.useRef(null),zt=L.useRef(0),rn=L.useRef(it),_n=L.useRef(m),Un=L.useRef(t),At=L.useRef(tt),yt=L.useRef(it);yt.current=it,L.useEffect(()=>{tr(!0),Ri(it,m)||w(it)},[]),L.useEffect(()=>{if(Et||un)return;const ke=!Ri(m,_n.current),Ye=!z3(t,Un.current),Me=tt!==At.current;if(ke||Ye||Me){const dt=sy(ke?m:it,t,$,Ge);Ri(dt,it)||nt(dt)}_n.current=m,Un.current=t,At.current=tt},[m,t,$,tt,Ge,Et,un,it]),L.useEffect(()=>{if(!Et&&!Ri(it,rn.current)){rn.current=it;const ke=it.filter(Ye=>Ye.i!==Gt.i);w(ke)}},[it,Et,w,Gt.i]);const ln=L.useMemo(()=>{if(!E)return;const ke=Y0(it),Ye=nn[1];return ke*G+(ke-1)*Q[1]+Ye*2+"px"},[E,it,G,Q,nn]),_r=L.useCallback((ke,Ye,Me,rt)=>{const dt=yt.current,ot=Ra(dt,ke);if(!ot)return;const xt={w:ot.w,h:ot.h,x:ot.x,y:ot.y,i:ke};He.current=ei(ot),gt.current=dt,Nt(xt),v(dt,ot,ot,null,rt.e,rt.node)},[v]),Le=L.useCallback((ke,Ye,Me,rt)=>{const dt=yt.current,ot=He.current,xt=Ra(dt,ke);if(!xt)return;const Tt={w:xt.w,h:xt.h,x:xt.x,y:xt.y,i:ke},bt=Fa(dt,xt,Ye,Me,!0,pn,tt,$,We);k(bt,ot,xt,Tt,rt.e,rt.node),nt(Ge.compact(bt,$)),Nt(Tt)},[pn,tt,$,We,Ge,k]),Qe=L.useCallback((ke,Ye,Me,rt)=>{if(!Et)return;const dt=yt.current,ot=He.current,xt=Ra(dt,ke);if(!xt)return;const Tt=Fa(dt,xt,Ye,Me,!0,pn,tt,$,We),bt=Ge.compact(Tt,$);O(bt,ot,xt,null,rt.e,rt.node);const cn=gt.current;He.current=null,gt.current=null,Nt(null),nt(bt),cn&&!Ri(cn,bt)&&w(bt)},[Et,pn,tt,$,We,Ge,O,w]),be=L.useCallback((ke,Ye,Me,rt)=>{const dt=yt.current,ot=Ra(dt,ke);ot&&(Ve.current=ei(ot),gt.current=dt,nr(!0),A(dt,ot,ot,null,rt.e,rt.node))},[A]),_e=L.useCallback((ke,Ye,Me,rt)=>{const dt=yt.current,ot=Ve.current,{handle:xt}=rt;let Tt=!1,bt,cn;const[oi,fr]=WN(dt,ke,vt=>(bt=vt.x,cn=vt.y,["sw","w","nw","n","ne"].includes(xt)&&(["sw","nw","w"].includes(xt)&&(bt=vt.x+(vt.w-Ye),Ye=vt.x!==bt&&bt<0?vt.w:Ye,bt=bt<0?0:bt),["ne","n","nw"].includes(xt)&&(cn=vt.y+(vt.h-Me),Me=vt.y!==cn&&cn<0?vt.h:Me,cn=cn<0?0:cn),Tt=!0),pn&&!We&&ax(dt,{...vt,w:Ye,h:Me,x:bt??vt.x,y:cn??vt.y}).filter(ui=>ui.i!==vt.i).length>0&&(cn=vt.y,Me=vt.h,bt=vt.x,Ye=vt.w,Tt=!1),vt.w=Ye,vt.h=Me,vt));if(!fr)return;let Os=oi;Tt&&bt!==void 0&&cn!==void 0&&(Os=Fa(oi,fr,bt,cn,!0,pn,tt,$,We));const ba={w:fr.w,h:fr.h,x:fr.x,y:fr.y,i:ke,static:!0};P(Os,ot,fr,ba,rt.e,rt.node),nt(Ge.compact(Os,$)),Nt(ba)},[pn,tt,$,We,Ge,P]),Je=L.useCallback((ke,Ye,Me,rt)=>{const dt=yt.current,ot=Ve.current,xt=Ra(dt,ke),Tt=Ge.compact(dt,$);_(Tt,ot,xt??null,null,rt.e,rt.node);const bt=gt.current;Ve.current=null,gt.current=null,Nt(null),nr(!1),nt(Tt),bt&&!Ri(bt,Tt)&&w(Tt)},[$,Ge,_,w]),Ce=L.useCallback(()=>{const ke=yt.current;if(!ke.some(rt=>rt.i===Gt.i)){oe(null),Nt(null),De(void 0);return}const Me=Ge.compact(ke.filter(rt=>rt.i!==Gt.i),$);nt(Me),oe(null),Nt(null),De(void 0)},[Gt.i,$,Ge]),It=L.useCallback(ke=>{var Zu;if(ke.preventDefault(),ke.stopPropagation(),Nx&&!((Zu=ke.nativeEvent.target)!=null&&Zu.classList.contains(ry)))return!1;const Ye=$e?$e(ke.nativeEvent):I(ke);if(Ye===!1)return un&&Ce(),!1;const{dragOffsetX:Me=0,dragOffsetY:rt=0,...dt}=Ye??{},ot={...Gt,...dt},xt=ke.currentTarget.getBoundingClientRect(),Tt={cols:$,margin:Q,maxRows:J,rowHeight:G,containerWidth:n,containerPadding:nn},bt=ho(Tt),cn=ro(ot.w,bt,Q[0]),oi=ro(ot.h,G,Q[1]),fr=cn/2,Os=oi/2,ba=ke.clientX-xt.left+Me-fr,vt=ke.clientY-xt.top+rt-Os,Eo=Math.max(0,ba),ui=Math.max(0,vt),wt={left:Eo/tn,top:ui/tn,e:ke.nativeEvent};if(un)pe&&(pe.left!==wt.left||pe.top!==wt.top)&&De(wt);else{const Ea=BN(Tt,ui,Eo,ot.w,ot.h);oe(p.jsx("div",{},ot.i)),De(wt),nt([...yt.current,{...ot,x:Ea.x,y:Ea.y,static:!1,isDraggable:!0}])}},[un,pe,Gt,$e,I,Ce,tn,$,Q,J,G,n,nn]),Wt=L.useCallback(ke=>{ke.preventDefault(),ke.stopPropagation(),zt.current--,zt.current<0&&(zt.current=0),zt.current===0&&Ce()},[Ce]),Yt=L.useCallback(ke=>{ke.preventDefault(),ke.stopPropagation(),zt.current++},[]),Rt=L.useCallback(ke=>{ke.preventDefault(),ke.stopPropagation();const Ye=yt.current,Me=Ye.find(rt=>rt.i===Gt.i);zt.current=0,Ce(),N(Ye,Me,ke.nativeEvent)},[Gt.i,Ce,N]),qt=L.useCallback((ke,Ye)=>{if(!ke||!ke.key)return null;const Me=Ra(it,String(ke.key));if(!Me)return null;const rt=typeof Me.isDraggable=="boolean"?Me.isDraggable:!Me.static&&Z,dt=typeof Me.isResizable=="boolean"?Me.isResizable:!Me.static&&z,ot=Me.resizeHandles||[...Oe],xt=rt&&K&&Me.isBounded!==!1,Tt=Be;return p.jsx(ny,{containerWidth:n,cols:$,margin:Q,containerPadding:nn,maxRows:J,rowHeight:G,cancel:ae,handle:R,onDragStart:_r,onDrag:Le,onDragStop:Qe,onResizeStart:be,onResize:_e,onResizeStop:Je,isDraggable:rt,isResizable:dt,isBounded:xt,useCSSTransforms:Hn&&mn,usePercentages:!mn,transformScale:tn,positionStrategy:c,dragThreshold:ue,w:Me.w,h:Me.h,x:Me.x,y:Me.y,i:Me.i,minH:Me.minH,minW:Me.minW,maxH:Me.maxH,maxW:Me.maxW,static:Me.static,droppingPosition:Ye?pe:void 0,resizeHandles:ot,resizeHandle:Tt,constraints:h,layoutItem:Me,layout:it,children:ke},Me.i)},[it,n,$,Q,nn,J,G,ae,R,_r,Le,Qe,be,_e,Je,Z,z,K,Hn,mn,tn,c,ue,pe,Oe,Be,h]),Cn=()=>Et?p.jsx(ny,{w:Et.w,h:Et.h,x:Et.x,y:Et.y,i:Et.i,className:`react-grid-placeholder ${on?"placeholder-resizing":""}`,containerWidth:n,cols:$,margin:Q,containerPadding:nn,maxRows:J,rowHeight:G,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:Hn,transformScale:tn,constraints:h,layout:it,children:p.jsx("div",{})}):null,zn=Bn(ry,x),Ur={height:ln,...C};return p.jsxs("div",{ref:S,className:zn,style:Ur,onDrop:Te?Rt:void 0,onDragLeave:Te?Wt:void 0,onDragEnter:Te?Yt:void 0,onDragOver:Te?It:void 0,children:[Ee.Children.map(t,ke=>Ee.isValidElement(ke)?qt(ke):null),Te&&un&&qt(un,!0),Cn()]})}function Ox(e){const{children:t,width:n,cols:r=12,rowHeight:a=150,maxRows:o=1/0,margin:l=[10,10],containerPadding:c=null,layout:d,droppingItem:h,compactType:m,preventCollision:g=!1,allowOverlap:E=!1,verticalCompact:x,isDraggable:C=!0,isBounded:S=!1,draggableHandle:w,draggableCancel:v,isResizable:k=!0,resizeHandles:O=["se"],resizeHandle:A,isDroppable:P=!1,useCSSTransforms:_=!0,transformScale:N=1,autoSize:I,className:F,style:j,innerRef:M,onLayoutChange:H,onDragStart:$,onDrag:G,onDragStop:J,onResizeStart:Q,onResize:re,onResizeStop:Z,onDrop:K,onDropDragOver:R}=e;let ae=m===void 0?"vertical":m;x===!1&&(ae=null);const ue={cols:r,rowHeight:a,maxRows:o,margin:l,containerPadding:c},z={enabled:C,bounded:S,handle:w,cancel:v,threshold:0},Oe={enabled:k,handles:O,handleComponent:A},Be={enabled:P};let Te;_?N!==1?Te=s3(N):Te=lx:Te=r3;const Ze=hx(ae,E,g),$e=S?[...Rc,VN]:Rc;return p.jsx(W3,{width:n,gridConfig:ue,dragConfig:z,resizeConfig:Oe,dropConfig:Be,positionStrategy:Te,compactor:Ze,constraints:$e,layout:d,droppingItem:h,autoSize:I,className:F,style:j,innerRef:M,onLayoutChange:H,onDragStart:$,onDrag:G,onDragStop:J,onResizeStart:Q,onResize:re,onResizeStop:Z,onDrop:K,onDropDragOver:R,children:t})}Ox.displayName="ReactGridLayout";var ay=Ox;function fh(e,t){if(!t)return e.toLocaleString();const n=t.decimals??0;switch(t.type){case"currency":return new Intl.NumberFormat("en-US",{style:"currency",currency:t.currency||"USD",minimumFractionDigits:n,maximumFractionDigits:n}).format(e);case"percent":return new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:n,maximumFractionDigits:n}).format(e/100);default:return e.toLocaleString(void 0,{minimumFractionDigits:n,maximumFractionDigits:n})}}function Y3(e,t){const n=e>=0?"+":"";return t==="percent_change"?`${n}${e.toFixed(1)}%`:`${n}${e.toLocaleString()}`}function q3({chartRef:e}){var k,O,A,P;const{data:t}=Yb(e),{data:n,isLoading:r,error:a,isFetching:o}=$b(e),l=k0(),c=()=>{l(e)},d=()=>{if(!n||!t)return;const _=t.name||e;Yc(n.rows,n.columns,_)};if(r)return p.jsx("div",{className:"h-full flex items-center justify-center",children:p.jsx("div",{className:"animate-pulse bg-gray-200 h-12 w-24 rounded"})});if(a||!((k=n==null?void 0:n.rows)!=null&&k[0]))return p.jsx("div",{className:"h-full flex items-center justify-center text-red-500 text-sm",children:"Failed to load"});const h=n.rows[0],m=t==null?void 0:t.chart;if(!((O=m==null?void 0:m.value)!=null&&O.field))return p.jsx("div",{className:"h-full flex items-center justify-center text-gray-400 text-sm",children:"Invalid KPI config"});const g=h[m.value.field],E=fh(g,m.format);let x=null,C="percent_change",S,w,v;if(n.comparison)x=n.comparison.change,C=n.comparison.changeType,S=n.comparison.currentPeriodLabel,w=n.comparison.previousPeriodLabel,v=fh(n.comparison.previousValue,m.format);else if((A=m.comparison)!=null&&A.enabled&&m.comparison.field){const _=h[m.comparison.field];C=m.comparison.type,_&&_!==0&&(C==="percent_change"?x=(g-_)/_*100:x=g-_,v=fh(_,m.format))}return p.jsxs("div",{className:"h-full flex flex-col p-4 group relative",style:{containerType:"size"},children:[p.jsx("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:p.jsx(nx,{onRefresh:c,onExportCSV:d,onExportPNG:d,onExportSVG:d,isRefreshing:o,hideImageExport:!0})}),p.jsxs("div",{className:"flex-1 flex flex-col justify-center min-h-0",children:[p.jsxs("div",{className:"font-bold text-gray-900 leading-tight",style:{fontSize:"clamp(1.125rem, min(14cqh, 8cqw), 2rem)"},children:[E,m.unit&&p.jsx("span",{className:"font-normal text-gray-400 ml-1",style:{fontSize:"0.6em"},children:m.unit})]}),S&&p.jsx("div",{className:"text-xs text-gray-400 mt-0.5 truncate",children:S}),p.jsx("a",{href:`#/charts/${e}`,className:"text-sm text-gray-500 mt-1 hover:text-gray-700 hover:underline line-clamp-2",children:t==null?void 0:t.title}),x!==null&&p.jsxs("div",{className:"mt-1.5 flex items-center gap-2 flex-wrap relative group/comparison",children:[p.jsx("span",{className:Bn("text-sm font-medium px-2 py-0.5 rounded",x>=0?"bg-green-100 text-green-700":"bg-red-100 text-red-700"),children:Y3(x,C)}),v&&p.jsxs("span",{className:"text-xs text-gray-400",children:["vs ",v]}),!v&&((P=m.comparison)==null?void 0:P.label)&&p.jsx("span",{className:"text-xs text-gray-400",children:m.comparison.label}),w&&p.jsx("div",{className:"absolute bottom-full left-0 mb-1.5 hidden group-hover/comparison:block z-10 pointer-events-none",children:p.jsxs("div",{className:"bg-gray-800 text-white text-xs rounded-md px-3 py-2 shadow-lg whitespace-nowrap",children:[p.jsx("div",{className:"font-medium",children:w}),v&&p.jsxs("div",{className:"text-gray-300 mt-0.5",children:["Previous: ",v]})]})})]})]})]})}function $3({chartRef:e}){var Q,re,Z,K,R;const{data:t,isLoading:n,isFetching:r}=Fw(e),{data:a}=io(),o=t==null?void 0:t.config,l=t,c=k0(),d=L.useRef(null),[h,m]=L.useState(!1),g=qe(ae=>ae.chartFilters),E=qe(ae=>ae.resetChartFilters),x=qe(ae=>ae.crossFilters),C=qe(ae=>ae.setCrossFilter),S=g[e]&&Object.keys(g[e]).length>0,w=L.useCallback((ae,ue)=>{C(ae,ue,e)},[C,e]),v=L.useMemo(()=>{for(const ae of Object.values(x))if(ae.sourceChart===e)return{field:ae.field,value:ae.value};return null},[x,e]),[k,O]=L.useState(null),A=L.useCallback((ae,ue,z)=>{var Oe;(Oe=o==null?void 0:o.drillDown)!=null&&Oe.chart&&O({x:z.x,y:z.y,field:ae,value:ue})},[(Q=o==null?void 0:o.drillDown)==null?void 0:Q.chart]),P=L.useCallback(()=>{var z,Oe;if(!k||!((z=o==null?void 0:o.drillDown)!=null&&z.chart))return;const ae=o.drillDown.field??((Oe=o.chart.x)==null?void 0:Oe.field)??k.field,ue=new URLSearchParams({[ae]:k.value,_from:e});window.location.hash=`/charts/${o.drillDown.chart}?${ue.toString()}`,O(null)},[k,o,e]),_=()=>{c(e)},N=()=>{E(e),m(!1)},I=()=>{if(!l||!o)return;const ae=o.name||e;Yc(l.rows,l.columns,ae)},F=()=>{var ue;const ae=(ue=d.current)==null?void 0:ue.getDataURL("png");ae&&o&&Ac(ae,`${o.name||e}.png`)},j=()=>{var ue;const ae=(ue=d.current)==null?void 0:ue.getDataURL("svg");ae&&o&&Ac(ae,`${o.name||e}.svg`)},M=async()=>{var ue;const ae=(ue=d.current)==null?void 0:ue.getDataURL("png");ae&&o&&await gN(ae,o.name||e,o.title)};if(n)return p.jsx("div",{className:"h-full flex items-center justify-center",children:p.jsx("div",{className:"animate-pulse bg-gray-100 w-full h-full rounded"})});if(!o||!l)return p.jsxs("div",{className:"h-full flex items-center justify-center text-gray-400 text-sm",children:["Chart not found: ",e]});if(((re=o.chart)==null?void 0:re.type)==="kpi")return p.jsx(q3,{chartRef:e});const H=["line","bar","area","pie","donut","scatter","combo","heatmap","funnel","waterfall","gauge"].includes(o.chart.type),$=(Z=o==null?void 0:o.drillDown)!=null&&Z.chart?A:void 0,G=()=>{switch(o.chart.type){case"line":return!o.chart.x||!o.chart.y&&!o.chart.series?p.jsx("div",{className:"h-full flex items-center justify-center text-gray-400 text-sm",children:"Missing axis configuration"}):p.jsx(qE,{ref:d,data:l.rows,columns:l.columns,xAxis:o.chart.x,yAxis:o.chart.y,chartConfig:o.chart,theme:a==null?void 0:a.theme,height:"100%",loading:r,onCrossFilter:w,activeCrossFilter:v,onDrillDown:$});case"bar":return!o.chart.x||!o.chart.y&&!o.chart.series?p.jsx("div",{className:"h-full flex items-center justify-center text-gray-400 text-sm",children:"Missing axis configuration"}):p.jsx($E,{ref:d,data:l.rows,xAxis:o.chart.x,yAxis:o.chart.y,chartConfig:o.chart,theme:a==null?void 0:a.theme,height:"100%",loading:r,onCrossFilter:w,activeCrossFilter:v,onDrillDown:$});case"area":return!o.chart.x||!o.chart.y&&!o.chart.series?p.jsx("div",{className:"h-full flex items-center justify-center text-gray-400 text-sm",children:"Missing axis configuration"}):p.jsx(VE,{ref:d,data:l.rows,xAxis:o.chart.x,yAxis:o.chart.y,chartConfig:o.chart,theme:a==null?void 0:a.theme,height:"100%",loading:r,onCrossFilter:w,activeCrossFilter:v,onDrillDown:$});case"pie":return!o.chart.x||!o.chart.y?p.jsx("div",{className:"h-full flex items-center justify-center text-gray-400 text-sm",children:"Missing axis configuration"}):p.jsx(QE,{ref:d,data:l.rows,xAxis:o.chart.x,yAxis:o.chart.y,chartConfig:o.chart,theme:a==null?void 0:a.theme,height:"100%",loading:r,onCrossFilter:w,activeCrossFilter:v,onDrillDown:$});case"donut":return!o.chart.x||!o.chart.y?p.jsx("div",{className:"h-full flex items-center justify-center text-gray-400 text-sm",children:"Missing axis configuration"}):p.jsx(GE,{ref:d,data:l.rows,xAxis:o.chart.x,yAxis:o.chart.y,centerValue:o.chart.centerValue,chartConfig:o.chart,theme:a==null?void 0:a.theme,height:"100%",loading:r,onCrossFilter:w,activeCrossFilter:v,onDrillDown:$});case"scatter":return!o.chart.x||!o.chart.y?p.jsx("div",{className:"h-full flex items-center justify-center text-gray-400 text-sm",children:"Missing axis configuration"}):p.jsx(XE,{ref:d,data:l.rows,xAxis:o.chart.x,yAxis:o.chart.y,chartConfig:o.chart,theme:a==null?void 0:a.theme,height:"100%",loading:r});case"table":return p.jsx(e0,{data:l.rows,columns:l.columns,chartConfig:o.chart,height:"100%",loading:r});case"metric":return o.chart.y?p.jsx(RN,{data:l.rows,yAxis:o.chart.y,title:o.title,loading:r}):p.jsx("div",{className:"h-full flex items-center justify-center text-gray-400 text-sm",children:"Missing value configuration"});case"combo":return o.chart.x?p.jsx(KE,{ref:d,data:l.rows,xAxis:o.chart.x,chartConfig:o.chart,theme:a==null?void 0:a.theme,height:"100%",loading:r,onCrossFilter:w,activeCrossFilter:v,onDrillDown:$}):p.jsx("div",{className:"h-full flex items-center justify-center text-gray-400 text-sm",children:"Missing axis configuration"});case"heatmap":return!o.chart.x||!o.chart.y?p.jsx("div",{className:"h-full flex items-center justify-center text-gray-400 text-sm",children:"Missing axis configuration"}):p.jsx(JE,{ref:d,data:l.rows,chartConfig:o.chart,height:"100%",loading:r});case"funnel":return p.jsx(ZE,{ref:d,data:l.rows,chartConfig:o.chart,height:"100%",loading:r});case"waterfall":return p.jsx(ex,{ref:d,data:l.rows,chartConfig:o.chart,height:"100%",loading:r});case"gauge":return p.jsx(tx,{ref:d,data:l.rows,chartConfig:o.chart,height:"100%",loading:r});default:return p.jsxs("div",{className:"h-full flex items-center justify-center text-gray-500 text-sm",children:['Chart type "',o.chart.type,'" not yet implemented']})}},J=o.parameters&&o.parameters.length>0;return p.jsxs("div",{className:"h-full p-2 flex flex-col group",children:[p.jsxs("div",{className:"flex items-center justify-between mb-2 px-2 flex-shrink-0",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("a",{href:`#/charts/${e}`,className:"text-sm font-medium text-gray-700 hover:text-gray-900 hover:underline",children:o.title}),((K=o==null?void 0:o.drillDown)==null?void 0:K.chart)&&p.jsxs("svg",{className:"w-3.5 h-3.5 text-gray-400 flex-shrink-0",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:[p.jsx("title",{children:"Right-click to drill down"}),p.jsx("path",{fillRule:"evenodd",d:"M5.22 14.78a.75.75 0 001.06 0l7.22-7.22v5.69a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75h-7.5a.75.75 0 000 1.5h5.69l-7.22 7.22a.75.75 0 000 1.06z",clipRule:"evenodd"})]}),S&&p.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-blue-100 text-blue-700 rounded",children:"Filtered"})]}),p.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[J&&p.jsx("button",{onClick:()=>m(!h),className:`p-1.5 rounded hover:bg-gray-100 ${h?"bg-gray-100":""}`,title:h?"Hide filters":"Override filters",children:p.jsx("svg",{className:"w-4 h-4 text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})})}),p.jsx(nx,{onRefresh:_,onExportCSV:I,onExportPNG:H?F:I,onExportSVG:H?j:I,onExportPDF:H?M:void 0,isRefreshing:r})]})]}),h&&J&&p.jsx("div",{className:"mb-2 px-2 flex-shrink-0",children:p.jsxs("div",{className:"flex items-end gap-2 flex-wrap",children:[p.jsx(zE,{parameters:o.parameters,chartName:e}),S&&p.jsx("button",{onClick:N,className:"px-2 py-1.5 text-xs text-gray-600 hover:text-gray-800 hover:bg-gray-100 rounded",children:"Reset to dashboard"})]})}),p.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:G()}),k&&((R=o==null?void 0:o.drillDown)==null?void 0:R.chart)&&p.jsx(rx,{x:k.x,y:k.y,targetChartTitle:o.drillDown.chart,onDrillDown:P,onClose:()=>O(null)})]})}var Dx=Bc();function iy(e){const t=[],n=String(e||"");let r=n.indexOf(","),a=0,o=!1;for(;!o;){r===-1&&(r=n.length,o=!0);const l=n.slice(a,r).trim();(l||!o)&&t.push(l),a=r+1,r=n.indexOf(",",a)}return t}function Ax(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const V3=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Q3=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,G3={};function oy(e,t){return(G3.jsx?Q3:V3).test(e)}const X3=/[ \t\n\f\r]/g;function K3(e){return typeof e=="object"?e.type==="text"?uy(e.value):!1:uy(e)}function uy(e){return e.replace(X3,"")===""}class Qu{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Qu.prototype.normal={};Qu.prototype.property={};Qu.prototype.space=void 0;function Ix(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new Qu(n,r,t)}function Au(e){return e.toLowerCase()}class er{constructor(t,n){this.attribute=n,this.property=t}}er.prototype.attribute="";er.prototype.booleanish=!1;er.prototype.boolean=!1;er.prototype.commaOrSpaceSeparated=!1;er.prototype.commaSeparated=!1;er.prototype.defined=!1;er.prototype.mustUseProperty=!1;er.prototype.number=!1;er.prototype.overloadedBoolean=!1;er.prototype.property="";er.prototype.spaceSeparated=!1;er.prototype.space=void 0;let J3=0;const Xe=ai(),an=ai(),n0=ai(),me=ai(),Ct=ai(),Fi=ai(),or=ai();function ai(){return 2**++J3}const r0=Object.freeze(Object.defineProperty({__proto__:null,boolean:Xe,booleanish:an,commaOrSpaceSeparated:or,commaSeparated:Fi,number:me,overloadedBoolean:n0,spaceSeparated:Ct},Symbol.toStringTag,{value:"Module"})),hh=Object.keys(r0);class Z0 extends er{constructor(t,n,r,a){let o=-1;if(super(t,n),ly(this,"space",a),typeof r=="number")for(;++o<hh.length;){const l=hh[o];ly(this,hh[o],(r&r0[l])===r0[l])}}}Z0.prototype.defined=!0;function ly(e,t,n){n&&(e[t]=n)}function po(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const o=new Z0(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Au(r)]=r,n[Au(o.attribute)]=r}return new Qu(t,n,e.space)}const Rx=po({properties:{ariaActiveDescendant:null,ariaAtomic:an,ariaAutoComplete:null,ariaBusy:an,ariaChecked:an,ariaColCount:me,ariaColIndex:me,ariaColSpan:me,ariaControls:Ct,ariaCurrent:null,ariaDescribedBy:Ct,ariaDetails:null,ariaDisabled:an,ariaDropEffect:Ct,ariaErrorMessage:null,ariaExpanded:an,ariaFlowTo:Ct,ariaGrabbed:an,ariaHasPopup:null,ariaHidden:an,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ct,ariaLevel:me,ariaLive:null,ariaModal:an,ariaMultiLine:an,ariaMultiSelectable:an,ariaOrientation:null,ariaOwns:Ct,ariaPlaceholder:null,ariaPosInSet:me,ariaPressed:an,ariaReadOnly:an,ariaRelevant:null,ariaRequired:an,ariaRoleDescription:Ct,ariaRowCount:me,ariaRowIndex:me,ariaRowSpan:me,ariaSelected:an,ariaSetSize:me,ariaSort:null,ariaValueMax:me,ariaValueMin:me,ariaValueNow:me,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Lx(e,t){return t in e?e[t]:t}function Mx(e,t){return Lx(e,t.toLowerCase())}const Z3=po({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Fi,acceptCharset:Ct,accessKey:Ct,action:null,allow:null,allowFullScreen:Xe,allowPaymentRequest:Xe,allowUserMedia:Xe,alt:null,as:null,async:Xe,autoCapitalize:null,autoComplete:Ct,autoFocus:Xe,autoPlay:Xe,blocking:Ct,capture:null,charSet:null,checked:Xe,cite:null,className:Ct,cols:me,colSpan:null,content:null,contentEditable:an,controls:Xe,controlsList:Ct,coords:me|Fi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Xe,defer:Xe,dir:null,dirName:null,disabled:Xe,download:n0,draggable:an,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Xe,formTarget:null,headers:Ct,height:me,hidden:n0,high:me,href:null,hrefLang:null,htmlFor:Ct,httpEquiv:Ct,id:null,imageSizes:null,imageSrcSet:null,inert:Xe,inputMode:null,integrity:null,is:null,isMap:Xe,itemId:null,itemProp:Ct,itemRef:Ct,itemScope:Xe,itemType:Ct,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Xe,low:me,manifest:null,max:null,maxLength:me,media:null,method:null,min:null,minLength:me,multiple:Xe,muted:Xe,name:null,nonce:null,noModule:Xe,noValidate:Xe,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:Xe,optimum:me,pattern:null,ping:Ct,placeholder:null,playsInline:Xe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Xe,referrerPolicy:null,rel:Ct,required:Xe,reversed:Xe,rows:me,rowSpan:me,sandbox:Ct,scope:null,scoped:Xe,seamless:Xe,selected:Xe,shadowRootClonable:Xe,shadowRootDelegatesFocus:Xe,shadowRootMode:null,shape:null,size:me,sizes:null,slot:null,span:me,spellCheck:an,src:null,srcDoc:null,srcLang:null,srcSet:null,start:me,step:null,style:null,tabIndex:me,target:null,title:null,translate:null,type:null,typeMustMatch:Xe,useMap:null,value:an,width:me,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ct,axis:null,background:null,bgColor:null,border:me,borderColor:null,bottomMargin:me,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Xe,declare:Xe,event:null,face:null,frame:null,frameBorder:null,hSpace:me,leftMargin:me,link:null,longDesc:null,lowSrc:null,marginHeight:me,marginWidth:me,noResize:Xe,noHref:Xe,noShade:Xe,noWrap:Xe,object:null,profile:null,prompt:null,rev:null,rightMargin:me,rules:null,scheme:null,scrolling:an,standby:null,summary:null,text:null,topMargin:me,valueType:null,version:null,vAlign:null,vLink:null,vSpace:me,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Xe,disableRemotePlayback:Xe,prefix:null,property:null,results:me,security:null,unselectable:null},space:"html",transform:Mx}),eO=po({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:or,accentHeight:me,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:me,amplitude:me,arabicForm:null,ascent:me,attributeName:null,attributeType:null,azimuth:me,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:me,by:null,calcMode:null,capHeight:me,className:Ct,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:me,diffuseConstant:me,direction:null,display:null,dur:null,divisor:me,dominantBaseline:null,download:Xe,dx:null,dy:null,edgeMode:null,editable:null,elevation:me,enableBackground:null,end:null,event:null,exponent:me,externalResourcesRequired:null,fill:null,fillOpacity:me,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:Fi,g2:Fi,glyphName:Fi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:me,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:me,horizOriginX:me,horizOriginY:me,id:null,ideographic:me,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:me,k:me,k1:me,k2:me,k3:me,k4:me,kernelMatrix:or,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:me,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:me,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:me,overlineThickness:me,paintOrder:null,panose1:null,path:null,pathLength:me,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ct,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:me,pointsAtY:me,pointsAtZ:me,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:or,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:or,rev:or,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:or,requiredFeatures:or,requiredFonts:or,requiredFormats:or,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:me,specularExponent:me,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:me,strikethroughThickness:me,string:null,stroke:null,strokeDashArray:or,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:me,strokeOpacity:me,strokeWidth:null,style:null,surfaceScale:me,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:or,tabIndex:me,tableValues:null,target:null,targetX:me,targetY:me,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:or,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:me,underlineThickness:me,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:me,values:null,vAlphabetic:me,vMathematical:me,vectorEffect:null,vHanging:me,vIdeographic:me,version:null,vertAdvY:me,vertOriginX:me,vertOriginY:me,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:me,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Lx}),Px=po({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Fx=po({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Mx}),jx=po({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),tO={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"},nO=/[A-Z]/g,cy=/-[a-z]/g,rO=/^data[-\w.:]+$/i;function nd(e,t){const n=Au(t);let r=t,a=er;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&rO.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(cy,aO);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!cy.test(o)){let l=o.replace(nO,sO);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}a=Z0}return new a(r,t)}function sO(e){return"-"+e.toLowerCase()}function aO(e){return e.charAt(1).toUpperCase()}const Gu=Ix([Rx,Z3,Px,Fx,jx],"html"),ga=Ix([Rx,eO,Px,Fx,jx],"svg");function dy(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Bx(e){return e.join(" ").trim()}var Li={},ph,fy;function iO(){if(fy)return ph;fy=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
|
|
95
|
-
`,h="/",m="*",g="",E="comment",x="declaration";function C(w,v){if(typeof w!="string")throw new TypeError("First argument must be a string");if(!w)return[];v=v||{};var k=1,O=1;function A(G){var J=G.match(t);J&&(k+=J.length);var Q=G.lastIndexOf(d);O=~Q?G.length-Q:O+G.length}function P(){var G={line:k,column:O};return function(J){return J.position=new _(G),F(),J}}function _(G){this.start=G,this.end={line:k,column:O},this.source=v.source}_.prototype.content=w;function N(G){var J=new Error(v.source+":"+k+":"+O+": "+G);if(J.reason=G,J.filename=v.source,J.line=k,J.column=O,J.source=w,!v.silent)throw J}function I(G){var J=G.exec(w);if(J){var Q=J[0];return A(Q),w=w.slice(Q.length),J}}function F(){I(n)}function j(G){var J;for(G=G||[];J=M();)J!==!1&&G.push(J);return G}function M(){var G=P();if(!(h!=w.charAt(0)||m!=w.charAt(1))){for(var J=2;g!=w.charAt(J)&&(m!=w.charAt(J)||h!=w.charAt(J+1));)++J;if(J+=2,g===w.charAt(J-1))return N("End of comment missing");var Q=w.slice(2,J-2);return O+=2,A(Q),w=w.slice(J),O+=2,G({type:E,comment:Q})}}function H(){var G=P(),J=I(r);if(J){if(M(),!I(a))return N("property missing ':'");var Q=I(o),re=G({type:x,property:S(J[0].replace(e,g)),value:Q?S(Q[0].replace(e,g)):g});return I(l),re}}function $(){var G=[];j(G);for(var J;J=H();)J!==!1&&(G.push(J),j(G));return G}return F(),$()}function S(w){return w?w.replace(c,g):g}return ph=C,ph}var hy;function oO(){if(hy)return Li;hy=1;var e=Li&&Li.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Li,"__esModule",{value:!0}),Li.default=n;const t=e(iO());function n(r,a){let o=null;if(!r||typeof r!="string")return o;const l=(0,t.default)(r),c=typeof a=="function";return l.forEach(d=>{if(d.type!=="declaration")return;const{property:h,value:m}=d;c?a(h,m,d):m&&(o=o||{},o[h]=m)}),o}return Li}var du={},py;function uO(){if(py)return du;py=1,Object.defineProperty(du,"__esModule",{value:!0}),du.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(h){return!h||n.test(h)||e.test(h)},l=function(h,m){return m.toUpperCase()},c=function(h,m){return"".concat(m,"-")},d=function(h,m){return m===void 0&&(m={}),o(h)?h:(h=h.toLowerCase(),m.reactCompat?h=h.replace(a,c):h=h.replace(r,c),h.replace(t,l))};return du.camelCase=d,du}var fu,my;function lO(){if(my)return fu;my=1;var e=fu&&fu.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(oO()),n=uO();function r(a,o){var l={};return!a||typeof a!="string"||(0,t.default)(a,function(c,d){c&&d&&(l[(0,n.camelCase)(c,o)]=d)}),l}return r.default=r,fu=r,fu}var cO=lO();const dO=wb(cO),rd=Hx("end"),us=Hx("start");function Hx(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};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 fO(e){const t=us(e),n=rd(e);if(t&&n)return{start:t,end:n}}function xu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?gy(e.position):"start"in e||"end"in e?gy(e):"line"in e||"column"in e?s0(e):""}function s0(e){return yy(e&&e.line)+":"+yy(e&&e.column)}function gy(e){return s0(e&&e.start)+"-"+s0(e&&e.end)}function yy(e){return e&&typeof e=="number"?e:1}class Ln extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?a=t:!o.cause&&t&&(l=!0,a=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?o.ruleId=r:(o.source=r.slice(0,d),o.ruleId=r.slice(d+1))}if(!o.place&&o.ancestors&&o.ancestors){const d=o.ancestors[o.ancestors.length-1];d&&(o.place=d.position)}const c=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=c?c.line:void 0,this.name=xu(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ln.prototype.file="";Ln.prototype.name="";Ln.prototype.reason="";Ln.prototype.message="";Ln.prototype.stack="";Ln.prototype.column=void 0;Ln.prototype.line=void 0;Ln.prototype.ancestors=void 0;Ln.prototype.cause=void 0;Ln.prototype.fatal=void 0;Ln.prototype.place=void 0;Ln.prototype.ruleId=void 0;Ln.prototype.source=void 0;const ep={}.hasOwnProperty,hO=new Map,pO=/[A-Z]/g,mO=new Set(["table","tbody","thead","tfoot","tr"]),gO=new Set(["td","th"]),Ux="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function yO(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=_O(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=SO(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?ga:Gu,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=zx(a,e,void 0);return o&&typeof o!="string"?o:a.create(e,a.Fragment,{children:o||void 0},void 0)}function zx(e,t,n){if(t.type==="element")return bO(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return EO(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return TO(e,t,n);if(t.type==="mdxjsEsm")return xO(e,t);if(t.type==="root")return vO(e,t,n);if(t.type==="text")return wO(e,t)}function bO(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=ga,e.schema=a),e.ancestors.push(t);const o=Yx(e,t.tagName,!1),l=CO(e,t);let c=np(e,t);return mO.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!K3(d):!0})),Wx(e,l,o,t),tp(l,c),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function EO(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Iu(e,t.position)}function xO(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Iu(e,t.position)}function TO(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=ga,e.schema=a),e.ancestors.push(t);const o=t.name===null?e.Fragment:Yx(e,t.name,!0),l=kO(e,t),c=np(e,t);return Wx(e,l,o,t),tp(l,c),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function vO(e,t,n){const r={};return tp(r,np(e,t)),e.create(t,e.Fragment,r,n)}function wO(e,t){return t.value}function Wx(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function tp(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function SO(e,t,n){return r;function r(a,o,l,c){const h=Array.isArray(l.children)?n:t;return c?h(o,l,c):h(o,l)}}function _O(e,t){return n;function n(r,a,o,l){const c=Array.isArray(o.children),d=us(r);return t(a,o,l,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function CO(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&ep.call(t.properties,a)){const o=NO(e,a,t.properties[a]);if(o){const[l,c]=o;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&gO.has(t.tagName)?r=c:n[l]=c}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function kO(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const c=l.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else Iu(e,t.position);else{const a=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,o=e.evaluater.evaluateExpression(c.expression)}else Iu(e,t.position);else o=r.value===null?!0:r.value;n[a]=o}return n}function np(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:hO;for(;++r<t.children.length;){const o=t.children[r];let l;if(e.passKeys){const d=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(d){const h=a.get(d)||0;l=d+"-"+h,a.set(d,h+1)}}const c=zx(e,o,l);c!==void 0&&n.push(c)}return n}function NO(e,t,n){const r=nd(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Ax(n):Bx(n)),r.property==="style"){let a=typeof n=="object"?n:OO(e,String(n));return e.stylePropertyNameCase==="css"&&(a=DO(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?tO[r.property]||r.property:r.attribute,n]}}function OO(e,t){try{return dO(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,a=new Ln("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=Ux+"#cannot-parse-style-attribute",a}}function Yx(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let o=-1,l;for(;++o<a.length;){const c=oy(a[o])?{type:"Identifier",name:a[o]}:{type:"Literal",value:a[o]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(o&&c.type==="Literal"),optional:!1}:c}r=l}else r=oy(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return ep.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);Iu(e)}function Iu(e,t){const n=new Ln("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Ux+"#cannot-handle-mdx-estrees-without-createevaluater",n}function DO(e){const t={};let n;for(n in e)ep.call(e,n)&&(t[AO(n)]=e[n]);return t}function AO(e){let t=e.replace(pO,IO);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function IO(e){return"-"+e.toLowerCase()}const mh={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"]},RO={};function LO(e,t){const n=RO,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return qx(e,r,a)}function qx(e,t,n){if(MO(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return by(e.children,t,n)}return Array.isArray(e)?by(e,t,n):""}function by(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=qx(e[a],t,n);return r.join("")}function MO(e){return!!(e&&typeof e=="object")}const Ey=document.createElement("i");function rp(e){const t="&"+e+";";Ey.innerHTML=t;const n=Ey.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function as(e,t,n,r){const a=e.length;let o=0,l;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o<r.length;)l=r.slice(o,o+1e4),l.unshift(t,0),e.splice(...l),o+=1e4,t+=1e4}function wr(e,t){return e.length>0?(as(e,e.length,0,t),e):t}const xy={}.hasOwnProperty;function PO(e){const t={};let n=-1;for(;++n<e.length;)FO(t,e[n]);return t}function FO(e,t){let n;for(n in t){const a=(xy.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let l;if(o)for(l in o){xy.call(a,l)||(a[l]=[]);const c=o[l];jO(a[l],Array.isArray(c)?c:c?[c]:[])}}}function jO(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);as(e,0,0,r)}function $x(e,t){const n=Number.parseInt(e,t);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 ji(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ns=ya(/[A-Za-z]/),cr=ya(/[\dA-Za-z]/),BO=ya(/[#-'*+\--9=?A-Z^-~]/);function a0(e){return e!==null&&(e<32||e===127)}const i0=ya(/\d/),HO=ya(/[\dA-Fa-f]/),UO=ya(/[!-/:-@[-`{-~]/);function ze(e){return e!==null&&e<-2}function Zn(e){return e!==null&&(e<0||e===32)}function lt(e){return e===-2||e===-1||e===32}const zO=ya(new RegExp("\\p{P}|\\p{S}","u")),WO=ya(/\s/);function ya(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function mo(e){const t=[];let n=-1,r=0,a=0;for(;++n<e.length;){const o=e.charCodeAt(n);let l="";if(o===37&&cr(e.charCodeAt(n+1))&&cr(e.charCodeAt(n+2)))a=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const c=e.charCodeAt(n+1);o<56320&&c>56319&&c<57344?(l=String.fromCharCode(o,c),a=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+a+1,l=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function kt(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(d){return lt(d)?(e.enter(n),c(d)):t(d)}function c(d){return lt(d)&&o++<a?(e.consume(d),c):(e.exit(n),t(d))}}const YO={tokenize:qO};function qO(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),kt(e,t,"linePrefix")}function a(c){return e.enter("paragraph"),o(c)}function o(c){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,l(c)}function l(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return ze(c)?(e.consume(c),e.exit("chunkText"),o):(e.consume(c),l)}}const $O={tokenize:VO},Ty={tokenize:QO};function VO(e){const t=this,n=[];let r=0,a,o,l;return c;function c(O){if(r<n.length){const A=n[r];return t.containerState=A[1],e.attempt(A[0].continuation,d,h)(O)}return h(O)}function d(O){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&k();const A=t.events.length;let P=A,_;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){_=t.events[P][1].end;break}v(r);let N=A;for(;N<t.events.length;)t.events[N][1].end={..._},N++;return as(t.events,P+1,0,t.events.slice(A)),t.events.length=N,h(O)}return c(O)}function h(O){if(r===n.length){if(!a)return E(O);if(a.currentConstruct&&a.currentConstruct.concrete)return C(O);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Ty,m,g)(O)}function m(O){return a&&k(),v(r),E(O)}function g(O){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,C(O)}function E(O){return t.containerState={},e.attempt(Ty,x,C)(O)}function x(O){return r++,n.push([t.currentConstruct,t.containerState]),E(O)}function C(O){if(O===null){a&&k(),v(0),e.consume(O);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:o}),S(O)}function S(O){if(O===null){w(e.exit("chunkFlow"),!0),v(0),e.consume(O);return}return ze(O)?(e.consume(O),w(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(O),S)}function w(O,A){const P=t.sliceStream(O);if(A&&P.push(null),O.previous=o,o&&(o.next=O),o=O,a.defineSkip(O.start),a.write(P),t.parser.lazy[O.start.line]){let _=a.events.length;for(;_--;)if(a.events[_][1].start.offset<l&&(!a.events[_][1].end||a.events[_][1].end.offset>l))return;const N=t.events.length;let I=N,F,j;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){if(F){j=t.events[I][1].end;break}F=!0}for(v(r),_=N;_<t.events.length;)t.events[_][1].end={...j},_++;as(t.events,I+1,0,t.events.slice(N)),t.events.length=_}}function v(O){let A=n.length;for(;A-- >O;){const P=n[A];t.containerState=P[1],P[0].exit.call(t,e)}n.length=O}function k(){a.write([null]),o=void 0,a=void 0,t.containerState._closeFlow=void 0}}function QO(e,t,n){return kt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function vy(e){if(e===null||Zn(e)||WO(e))return 1;if(zO(e))return 2}function sp(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const o=e[a].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const o0={name:"attention",resolveAll:GO,tokenize:XO};function GO(e,t){let n=-1,r,a,o,l,c,d,h,m;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const g={...e[r][1].end},E={...e[n][1].start};wy(g,-d),wy(E,d),l={type:d>1?"strongSequence":"emphasisSequence",start:g,end:{...e[r][1].end}},c={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:E},o={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:d>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},e[r][1].end={...l.start},e[n][1].start={...c.end},h=[],e[r][1].end.offset-e[r][1].start.offset&&(h=wr(h,[["enter",e[r][1],t],["exit",e[r][1],t]])),h=wr(h,[["enter",a,t],["enter",l,t],["exit",l,t],["enter",o,t]]),h=wr(h,sp(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),h=wr(h,[["exit",o,t],["enter",c,t],["exit",c,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,h=wr(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,as(e,r-1,n-r+3,h),n=r+h.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function XO(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=vy(r);let o;return l;function l(d){return o=d,e.enter("attentionSequence"),c(d)}function c(d){if(d===o)return e.consume(d),c;const h=e.exit("attentionSequence"),m=vy(d),g=!m||m===2&&a||n.includes(d),E=!a||a===2&&m||n.includes(r);return h._open=!!(o===42?g:g&&(a||!E)),h._close=!!(o===42?E:E&&(m||!g)),t(d)}}function wy(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const KO={name:"autolink",tokenize:JO};function JO(e,t,n){let r=0;return a;function a(x){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(x){return ns(x)?(e.consume(x),l):x===64?n(x):h(x)}function l(x){return x===43||x===45||x===46||cr(x)?(r=1,c(x)):h(x)}function c(x){return x===58?(e.consume(x),r=0,d):(x===43||x===45||x===46||cr(x))&&r++<32?(e.consume(x),c):(r=0,h(x))}function d(x){return x===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):x===null||x===32||x===60||a0(x)?n(x):(e.consume(x),d)}function h(x){return x===64?(e.consume(x),m):BO(x)?(e.consume(x),h):n(x)}function m(x){return cr(x)?g(x):n(x)}function g(x){return x===46?(e.consume(x),r=0,m):x===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):E(x)}function E(x){if((x===45||cr(x))&&r++<63){const C=x===45?E:g;return e.consume(x),C}return n(x)}}const sd={partial:!0,tokenize:ZO};function ZO(e,t,n){return r;function r(o){return lt(o)?kt(e,a,"linePrefix")(o):a(o)}function a(o){return o===null||ze(o)?t(o):n(o)}}const Vx={continuation:{tokenize:tD},exit:nD,name:"blockQuote",tokenize:eD};function eD(e,t,n){const r=this;return a;function a(l){if(l===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return n(l)}function o(l){return lt(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function tD(e,t,n){const r=this;return a;function a(l){return lt(l)?kt(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(Vx,t,n)(l)}}function nD(e){e.exit("blockQuote")}const Qx={name:"characterEscape",tokenize:rD};function rD(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),a}function a(o){return UO(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Gx={name:"characterReference",tokenize:sD};function sD(e,t,n){const r=this;let a=0,o,l;return c;function c(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),d}function d(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),o=31,l=cr,m(g))}function h(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=HO,m):(e.enter("characterReferenceValue"),o=7,l=i0,m(g))}function m(g){if(g===59&&a){const E=e.exit("characterReferenceValue");return l===cr&&!rp(r.sliceSerialize(E))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(g)&&a++<o?(e.consume(g),m):n(g)}}const Sy={partial:!0,tokenize:iD},_y={concrete:!0,name:"codeFenced",tokenize:aD};function aD(e,t,n){const r=this,a={partial:!0,tokenize:P};let o=0,l=0,c;return d;function d(_){return h(_)}function h(_){const N=r.events[r.events.length-1];return o=N&&N[1].type==="linePrefix"?N[2].sliceSerialize(N[1],!0).length:0,c=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(_)}function m(_){return _===c?(l++,e.consume(_),m):l<3?n(_):(e.exit("codeFencedFenceSequence"),lt(_)?kt(e,g,"whitespace")(_):g(_))}function g(_){return _===null||ze(_)?(e.exit("codeFencedFence"),r.interrupt?t(_):e.check(Sy,S,A)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),E(_))}function E(_){return _===null||ze(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(_)):lt(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),kt(e,x,"whitespace")(_)):_===96&&_===c?n(_):(e.consume(_),E)}function x(_){return _===null||ze(_)?g(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),C(_))}function C(_){return _===null||ze(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(_)):_===96&&_===c?n(_):(e.consume(_),C)}function S(_){return e.attempt(a,A,w)(_)}function w(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),v}function v(_){return o>0&<(_)?kt(e,k,"linePrefix",o+1)(_):k(_)}function k(_){return _===null||ze(_)?e.check(Sy,S,A)(_):(e.enter("codeFlowValue"),O(_))}function O(_){return _===null||ze(_)?(e.exit("codeFlowValue"),k(_)):(e.consume(_),O)}function A(_){return e.exit("codeFenced"),t(_)}function P(_,N,I){let F=0;return j;function j(J){return _.enter("lineEnding"),_.consume(J),_.exit("lineEnding"),M}function M(J){return _.enter("codeFencedFence"),lt(J)?kt(_,H,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(J):H(J)}function H(J){return J===c?(_.enter("codeFencedFenceSequence"),$(J)):I(J)}function $(J){return J===c?(F++,_.consume(J),$):F>=l?(_.exit("codeFencedFenceSequence"),lt(J)?kt(_,G,"whitespace")(J):G(J)):I(J)}function G(J){return J===null||ze(J)?(_.exit("codeFencedFence"),N(J)):I(J)}}}function iD(e,t,n){const r=this;return a;function a(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const gh={name:"codeIndented",tokenize:uD},oD={partial:!0,tokenize:lD};function uD(e,t,n){const r=this;return a;function a(h){return e.enter("codeIndented"),kt(e,o,"linePrefix",5)(h)}function o(h){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(h):n(h)}function l(h){return h===null?d(h):ze(h)?e.attempt(oD,l,d)(h):(e.enter("codeFlowValue"),c(h))}function c(h){return h===null||ze(h)?(e.exit("codeFlowValue"),l(h)):(e.consume(h),c)}function d(h){return e.exit("codeIndented"),t(h)}}function lD(e,t,n){const r=this;return a;function a(l){return r.parser.lazy[r.now().line]?n(l):ze(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):kt(e,o,"linePrefix",5)(l)}function o(l){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):ze(l)?a(l):n(l)}}const cD={name:"codeText",previous:fD,resolve:dD,tokenize:hD};function dD(e){let t=e.length-4,n=3,r,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function fD(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function hD(e,t,n){let r=0,a,o;return l;function l(g){return e.enter("codeText"),e.enter("codeTextSequence"),c(g)}function c(g){return g===96?(e.consume(g),r++,c):(e.exit("codeTextSequence"),d(g))}function d(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),d):g===96?(o=e.enter("codeTextSequence"),a=0,m(g)):ze(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),d):(e.enter("codeTextData"),h(g))}function h(g){return g===null||g===32||g===96||ze(g)?(e.exit("codeTextData"),d(g)):(e.consume(g),h)}function m(g){return g===96?(e.consume(g),a++,m):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(o.type="codeTextData",h(g))}}class pD{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const a=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&hu(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),hu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),hu(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);hu(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);hu(this.left,n.reverse())}}}function hu(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Xx(e){const t={};let n=-1,r,a,o,l,c,d,h;const m=new pD(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(r=m.get(n),n&&r[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,o=0,o<d.length&&d[o][1].type==="lineEndingBlank"&&(o+=2),o<d.length&&d[o][1].type==="content"))for(;++o<d.length&&d[o][1].type!=="content";)d[o][1].type==="chunkText"&&(d[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,mD(m,n)),n=t[n],h=!0);else if(r[1]._container){for(o=n,a=void 0;o--;)if(l=m.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(a&&(m.get(a)[1].type="lineEndingBlank"),l[1].type="lineEnding",a=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;a&&(r[1].end={...m.get(a)[1].start},c=m.slice(a,n),c.unshift(r),m.splice(a,n-a+1,c))}}return as(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!h}function mD(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const o=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const c=l.events,d=[],h={};let m,g,E=-1,x=n,C=0,S=0;const w=[S];for(;x;){for(;e.get(++a)[1]!==x;);o.push(a),x._tokenizer||(m=r.sliceStream(x),x.next||m.push(null),g&&l.defineSkip(x.start),x._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(m),x._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),g=x,x=x.next}for(x=n;++E<c.length;)c[E][0]==="exit"&&c[E-1][0]==="enter"&&c[E][1].type===c[E-1][1].type&&c[E][1].start.line!==c[E][1].end.line&&(S=E+1,w.push(S),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(l.events=[],x?(x._tokenizer=void 0,x.previous=void 0):w.pop(),E=w.length;E--;){const v=c.slice(w[E],w[E+1]),k=o.pop();d.push([k,k+v.length-1]),e.splice(k,2,v)}for(d.reverse(),E=-1;++E<d.length;)h[C+d[E][0]]=C+d[E][1],C+=d[E][1]-d[E][0]-1;return h}const gD={resolve:bD,tokenize:ED},yD={partial:!0,tokenize:xD};function bD(e){return Xx(e),e}function ED(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(c)}function a(c){return c===null?o(c):ze(c)?e.check(yD,l,o)(c):(e.consume(c),a)}function o(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function l(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function xD(e,t,n){const r=this;return a;function a(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),kt(e,o,"linePrefix")}function o(l){if(l===null||ze(l))return n(l);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function Kx(e,t,n,r,a,o,l,c,d){const h=d||Number.POSITIVE_INFINITY;let m=0;return g;function g(v){return v===60?(e.enter(r),e.enter(a),e.enter(o),e.consume(v),e.exit(o),E):v===null||v===32||v===41||a0(v)?n(v):(e.enter(r),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),S(v))}function E(v){return v===62?(e.enter(o),e.consume(v),e.exit(o),e.exit(a),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),x(v))}function x(v){return v===62?(e.exit("chunkString"),e.exit(c),E(v)):v===null||v===60||ze(v)?n(v):(e.consume(v),v===92?C:x)}function C(v){return v===60||v===62||v===92?(e.consume(v),x):x(v)}function S(v){return!m&&(v===null||v===41||Zn(v))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(r),t(v)):m<h&&v===40?(e.consume(v),m++,S):v===41?(e.consume(v),m--,S):v===null||v===32||v===40||a0(v)?n(v):(e.consume(v),v===92?w:S)}function w(v){return v===40||v===41||v===92?(e.consume(v),S):S(v)}}function Jx(e,t,n,r,a,o){const l=this;let c=0,d;return h;function h(x){return e.enter(r),e.enter(a),e.consume(x),e.exit(a),e.enter(o),m}function m(x){return c>999||x===null||x===91||x===93&&!d||x===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(x):x===93?(e.exit(o),e.enter(a),e.consume(x),e.exit(a),e.exit(r),t):ze(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===null||x===91||x===93||ze(x)||c++>999?(e.exit("chunkString"),m(x)):(e.consume(x),d||(d=!lt(x)),x===92?E:g)}function E(x){return x===91||x===92||x===93?(e.consume(x),c++,g):g(x)}}function Zx(e,t,n,r,a,o){let l;return c;function c(E){return E===34||E===39||E===40?(e.enter(r),e.enter(a),e.consume(E),e.exit(a),l=E===40?41:E,d):n(E)}function d(E){return E===l?(e.enter(a),e.consume(E),e.exit(a),e.exit(r),t):(e.enter(o),h(E))}function h(E){return E===l?(e.exit(o),d(l)):E===null?n(E):ze(E)?(e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),kt(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(E))}function m(E){return E===l||E===null||ze(E)?(e.exit("chunkString"),h(E)):(e.consume(E),E===92?g:m)}function g(E){return E===l||E===92?(e.consume(E),m):m(E)}}function Tu(e,t){let n;return r;function r(a){return ze(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):lt(a)?kt(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const TD={name:"definition",tokenize:wD},vD={partial:!0,tokenize:SD};function wD(e,t,n){const r=this;let a;return o;function o(x){return e.enter("definition"),l(x)}function l(x){return Jx.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function c(x){return a=ji(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),d):n(x)}function d(x){return Zn(x)?Tu(e,h)(x):h(x)}function h(x){return Kx(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function m(x){return e.attempt(vD,g,g)(x)}function g(x){return lt(x)?kt(e,E,"whitespace")(x):E(x)}function E(x){return x===null||ze(x)?(e.exit("definition"),r.parser.defined.push(a),t(x)):n(x)}}function SD(e,t,n){return r;function r(c){return Zn(c)?Tu(e,a)(c):n(c)}function a(c){return Zx(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function o(c){return lt(c)?kt(e,l,"whitespace")(c):l(c)}function l(c){return c===null||ze(c)?t(c):n(c)}}const _D={name:"hardBreakEscape",tokenize:CD};function CD(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),a}function a(o){return ze(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const kD={name:"headingAtx",resolve:ND,tokenize:OD};function ND(e,t){let n=e.length-2,r=3,a,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},as(e,r,n-r+1,[["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t]])),e}function OD(e,t,n){let r=0;return a;function a(m){return e.enter("atxHeading"),o(m)}function o(m){return e.enter("atxHeadingSequence"),l(m)}function l(m){return m===35&&r++<6?(e.consume(m),l):m===null||Zn(m)?(e.exit("atxHeadingSequence"),c(m)):n(m)}function c(m){return m===35?(e.enter("atxHeadingSequence"),d(m)):m===null||ze(m)?(e.exit("atxHeading"),t(m)):lt(m)?kt(e,c,"whitespace")(m):(e.enter("atxHeadingText"),h(m))}function d(m){return m===35?(e.consume(m),d):(e.exit("atxHeadingSequence"),c(m))}function h(m){return m===null||m===35||Zn(m)?(e.exit("atxHeadingText"),c(m)):(e.consume(m),h)}}const DD=["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"],Cy=["pre","script","style","textarea"],AD={concrete:!0,name:"htmlFlow",resolveTo:LD,tokenize:MD},ID={partial:!0,tokenize:FD},RD={partial:!0,tokenize:PD};function LD(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function MD(e,t,n){const r=this;let a,o,l,c,d;return h;function h(z){return m(z)}function m(z){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(z),g}function g(z){return z===33?(e.consume(z),E):z===47?(e.consume(z),o=!0,S):z===63?(e.consume(z),a=3,r.interrupt?t:R):ns(z)?(e.consume(z),l=String.fromCharCode(z),w):n(z)}function E(z){return z===45?(e.consume(z),a=2,x):z===91?(e.consume(z),a=5,c=0,C):ns(z)?(e.consume(z),a=4,r.interrupt?t:R):n(z)}function x(z){return z===45?(e.consume(z),r.interrupt?t:R):n(z)}function C(z){const Oe="CDATA[";return z===Oe.charCodeAt(c++)?(e.consume(z),c===Oe.length?r.interrupt?t:H:C):n(z)}function S(z){return ns(z)?(e.consume(z),l=String.fromCharCode(z),w):n(z)}function w(z){if(z===null||z===47||z===62||Zn(z)){const Oe=z===47,Be=l.toLowerCase();return!Oe&&!o&&Cy.includes(Be)?(a=1,r.interrupt?t(z):H(z)):DD.includes(l.toLowerCase())?(a=6,Oe?(e.consume(z),v):r.interrupt?t(z):H(z)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(z):o?k(z):O(z))}return z===45||cr(z)?(e.consume(z),l+=String.fromCharCode(z),w):n(z)}function v(z){return z===62?(e.consume(z),r.interrupt?t:H):n(z)}function k(z){return lt(z)?(e.consume(z),k):j(z)}function O(z){return z===47?(e.consume(z),j):z===58||z===95||ns(z)?(e.consume(z),A):lt(z)?(e.consume(z),O):j(z)}function A(z){return z===45||z===46||z===58||z===95||cr(z)?(e.consume(z),A):P(z)}function P(z){return z===61?(e.consume(z),_):lt(z)?(e.consume(z),P):O(z)}function _(z){return z===null||z===60||z===61||z===62||z===96?n(z):z===34||z===39?(e.consume(z),d=z,N):lt(z)?(e.consume(z),_):I(z)}function N(z){return z===d?(e.consume(z),d=null,F):z===null||ze(z)?n(z):(e.consume(z),N)}function I(z){return z===null||z===34||z===39||z===47||z===60||z===61||z===62||z===96||Zn(z)?P(z):(e.consume(z),I)}function F(z){return z===47||z===62||lt(z)?O(z):n(z)}function j(z){return z===62?(e.consume(z),M):n(z)}function M(z){return z===null||ze(z)?H(z):lt(z)?(e.consume(z),M):n(z)}function H(z){return z===45&&a===2?(e.consume(z),Q):z===60&&a===1?(e.consume(z),re):z===62&&a===4?(e.consume(z),ae):z===63&&a===3?(e.consume(z),R):z===93&&a===5?(e.consume(z),K):ze(z)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(ID,ue,$)(z)):z===null||ze(z)?(e.exit("htmlFlowData"),$(z)):(e.consume(z),H)}function $(z){return e.check(RD,G,ue)(z)}function G(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),J}function J(z){return z===null||ze(z)?$(z):(e.enter("htmlFlowData"),H(z))}function Q(z){return z===45?(e.consume(z),R):H(z)}function re(z){return z===47?(e.consume(z),l="",Z):H(z)}function Z(z){if(z===62){const Oe=l.toLowerCase();return Cy.includes(Oe)?(e.consume(z),ae):H(z)}return ns(z)&&l.length<8?(e.consume(z),l+=String.fromCharCode(z),Z):H(z)}function K(z){return z===93?(e.consume(z),R):H(z)}function R(z){return z===62?(e.consume(z),ae):z===45&&a===2?(e.consume(z),R):H(z)}function ae(z){return z===null||ze(z)?(e.exit("htmlFlowData"),ue(z)):(e.consume(z),ae)}function ue(z){return e.exit("htmlFlow"),t(z)}}function PD(e,t,n){const r=this;return a;function a(l){return ze(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function FD(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(sd,t,n)}}const jD={name:"htmlText",tokenize:BD};function BD(e,t,n){const r=this;let a,o,l;return c;function c(R){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(R),d}function d(R){return R===33?(e.consume(R),h):R===47?(e.consume(R),P):R===63?(e.consume(R),O):ns(R)?(e.consume(R),I):n(R)}function h(R){return R===45?(e.consume(R),m):R===91?(e.consume(R),o=0,C):ns(R)?(e.consume(R),k):n(R)}function m(R){return R===45?(e.consume(R),x):n(R)}function g(R){return R===null?n(R):R===45?(e.consume(R),E):ze(R)?(l=g,re(R)):(e.consume(R),g)}function E(R){return R===45?(e.consume(R),x):g(R)}function x(R){return R===62?Q(R):R===45?E(R):g(R)}function C(R){const ae="CDATA[";return R===ae.charCodeAt(o++)?(e.consume(R),o===ae.length?S:C):n(R)}function S(R){return R===null?n(R):R===93?(e.consume(R),w):ze(R)?(l=S,re(R)):(e.consume(R),S)}function w(R){return R===93?(e.consume(R),v):S(R)}function v(R){return R===62?Q(R):R===93?(e.consume(R),v):S(R)}function k(R){return R===null||R===62?Q(R):ze(R)?(l=k,re(R)):(e.consume(R),k)}function O(R){return R===null?n(R):R===63?(e.consume(R),A):ze(R)?(l=O,re(R)):(e.consume(R),O)}function A(R){return R===62?Q(R):O(R)}function P(R){return ns(R)?(e.consume(R),_):n(R)}function _(R){return R===45||cr(R)?(e.consume(R),_):N(R)}function N(R){return ze(R)?(l=N,re(R)):lt(R)?(e.consume(R),N):Q(R)}function I(R){return R===45||cr(R)?(e.consume(R),I):R===47||R===62||Zn(R)?F(R):n(R)}function F(R){return R===47?(e.consume(R),Q):R===58||R===95||ns(R)?(e.consume(R),j):ze(R)?(l=F,re(R)):lt(R)?(e.consume(R),F):Q(R)}function j(R){return R===45||R===46||R===58||R===95||cr(R)?(e.consume(R),j):M(R)}function M(R){return R===61?(e.consume(R),H):ze(R)?(l=M,re(R)):lt(R)?(e.consume(R),M):F(R)}function H(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),a=R,$):ze(R)?(l=H,re(R)):lt(R)?(e.consume(R),H):(e.consume(R),G)}function $(R){return R===a?(e.consume(R),a=void 0,J):R===null?n(R):ze(R)?(l=$,re(R)):(e.consume(R),$)}function G(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===47||R===62||Zn(R)?F(R):(e.consume(R),G)}function J(R){return R===47||R===62||Zn(R)?F(R):n(R)}function Q(R){return R===62?(e.consume(R),e.exit("htmlTextData"),e.exit("htmlText"),t):n(R)}function re(R){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),Z}function Z(R){return lt(R)?kt(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):K(R)}function K(R){return e.enter("htmlTextData"),l(R)}}const ap={name:"labelEnd",resolveAll:WD,resolveTo:YD,tokenize:qD},HD={tokenize:$D},UD={tokenize:VD},zD={tokenize:QD};function WD(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const a=r.type==="labelImage"?4:2;r.type="data",t+=a}}return e.length!==n.length&&as(e,0,e.length,n),e}function YD(e,t){let n=e.length,r=0,a,o,l,c;for(;n--;)if(a=e[n][1],o){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(o=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(l=n);const d={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},m={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return c=[["enter",d,t],["enter",h,t]],c=wr(c,e.slice(o+1,o+r+3)),c=wr(c,[["enter",m,t]]),c=wr(c,sp(t.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),t)),c=wr(c,[["exit",m,t],e[l-2],e[l-1],["exit",h,t]]),c=wr(c,e.slice(l+1)),c=wr(c,[["exit",d,t]]),as(e,o,e.length,c),e}function qD(e,t,n){const r=this;let a=r.events.length,o,l;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){o=r.events[a][1];break}return c;function c(E){return o?o._inactive?g(E):(l=r.parser.defined.includes(ji(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(E),e.exit("labelMarker"),e.exit("labelEnd"),d):n(E)}function d(E){return E===40?e.attempt(HD,m,l?m:g)(E):E===91?e.attempt(UD,m,l?h:g)(E):l?m(E):g(E)}function h(E){return e.attempt(zD,m,g)(E)}function m(E){return t(E)}function g(E){return o._balanced=!0,n(E)}}function $D(e,t,n){return r;function r(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),a}function a(g){return Zn(g)?Tu(e,o)(g):o(g)}function o(g){return g===41?m(g):Kx(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function l(g){return Zn(g)?Tu(e,d)(g):m(g)}function c(g){return n(g)}function d(g){return g===34||g===39||g===40?Zx(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):m(g)}function h(g){return Zn(g)?Tu(e,m)(g):m(g)}function m(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function VD(e,t,n){const r=this;return a;function a(c){return Jx.call(r,e,o,l,"reference","referenceMarker","referenceString")(c)}function o(c){return r.parser.defined.includes(ji(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function QD(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),a}function a(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const GD={name:"labelStartImage",resolveAll:ap.resolveAll,tokenize:XD};function XD(e,t,n){const r=this;return a;function a(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),o}function o(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const KD={name:"labelStartLink",resolveAll:ap.resolveAll,tokenize:JD};function JD(e,t,n){const r=this;return a;function a(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const yh={name:"lineEnding",tokenize:ZD};function ZD(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),kt(e,t,"linePrefix")}}const vc={name:"thematicBreak",tokenize:e4};function e4(e,t,n){let r=0,a;return o;function o(h){return e.enter("thematicBreak"),l(h)}function l(h){return a=h,c(h)}function c(h){return h===a?(e.enter("thematicBreakSequence"),d(h)):r>=3&&(h===null||ze(h))?(e.exit("thematicBreak"),t(h)):n(h)}function d(h){return h===a?(e.consume(h),r++,d):(e.exit("thematicBreakSequence"),lt(h)?kt(e,c,"whitespace")(h):c(h))}}const Xn={continuation:{tokenize:s4},exit:i4,name:"list",tokenize:r4},t4={partial:!0,tokenize:o4},n4={partial:!0,tokenize:a4};function r4(e,t,n){const r=this,a=r.events[r.events.length-1];let o=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,l=0;return c;function c(x){const C=r.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(C==="listUnordered"?!r.containerState.marker||x===r.containerState.marker:i0(x)){if(r.containerState.type||(r.containerState.type=C,e.enter(C,{_container:!0})),C==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(vc,n,h)(x):h(x);if(!r.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(x)}return n(x)}function d(x){return i0(x)&&++l<10?(e.consume(x),d):(!r.interrupt||l<2)&&(r.containerState.marker?x===r.containerState.marker:x===41||x===46)?(e.exit("listItemValue"),h(x)):n(x)}function h(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||x,e.check(sd,r.interrupt?n:m,e.attempt(t4,E,g))}function m(x){return r.containerState.initialBlankLine=!0,o++,E(x)}function g(x){return lt(x)?(e.enter("listItemPrefixWhitespace"),e.consume(x),e.exit("listItemPrefixWhitespace"),E):n(x)}function E(x){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(x)}}function s4(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(sd,a,o);function a(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,kt(e,t,"listItemIndent",r.containerState.size+1)(c)}function o(c){return r.containerState.furtherBlankLines||!lt(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(n4,t,l)(c))}function l(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,kt(e,e.attempt(Xn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function a4(e,t,n){const r=this;return kt(e,a,"listItemIndent",r.containerState.size+1);function a(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function i4(e){e.exit(this.containerState.type)}function o4(e,t,n){const r=this;return kt(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(o){const l=r.events[r.events.length-1];return!lt(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const ky={name:"setextUnderline",resolveTo:u4,tokenize:l4};function u4(e,t){let n=e.length,r,a,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",o?(e.splice(a,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function l4(e,t,n){const r=this;let a;return o;function o(h){let m=r.events.length,g;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){g=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||g)?(e.enter("setextHeadingLine"),a=h,l(h)):n(h)}function l(h){return e.enter("setextHeadingLineSequence"),c(h)}function c(h){return h===a?(e.consume(h),c):(e.exit("setextHeadingLineSequence"),lt(h)?kt(e,d,"lineSuffix")(h):d(h))}function d(h){return h===null||ze(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const c4={tokenize:d4};function d4(e){const t=this,n=e.attempt(sd,r,e.attempt(this.parser.constructs.flowInitial,a,kt(e,e.attempt(this.parser.constructs.flow,a,e.attempt(gD,a)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const f4={resolveAll:t2()},h4=e2("string"),p4=e2("text");function e2(e){return{resolveAll:t2(e==="text"?m4:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],o=n.attempt(a,l,c);return l;function l(m){return h(m)?o(m):c(m)}function c(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),d}function d(m){return h(m)?(n.exit("data"),o(m)):(n.consume(m),d)}function h(m){if(m===null)return!0;const g=a[m];let E=-1;if(g)for(;++E<g.length;){const x=g[E];if(!x.previous||x.previous.call(r,r.previous))return!0}return!1}}}function t2(e){return t;function t(n,r){let a=-1,o;for(;++a<=n.length;)o===void 0?n[a]&&n[a][1].type==="data"&&(o=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==o+2&&(n[o][1].end=n[a-1][1].end,n.splice(o+2,a-o-2),a=o+2),o=void 0);return e?e(n,r):n}}function m4(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],a=t.sliceStream(r);let o=a.length,l=-1,c=0,d;for(;o--;){const h=a[o];if(typeof h=="string"){for(l=h.length;h.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(h===-2)d=!0,c++;else if(h!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const h={type:n===e.length||d||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...h.start},r.start.offset===r.end.offset?Object.assign(r,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const g4={42:Xn,43:Xn,45:Xn,48:Xn,49:Xn,50:Xn,51:Xn,52:Xn,53:Xn,54:Xn,55:Xn,56:Xn,57:Xn,62:Vx},y4={91:TD},b4={[-2]:gh,[-1]:gh,32:gh},E4={35:kD,42:vc,45:[ky,vc],60:AD,61:ky,95:vc,96:_y,126:_y},x4={38:Gx,92:Qx},T4={[-5]:yh,[-4]:yh,[-3]:yh,33:GD,38:Gx,42:o0,60:[KO,jD],91:KD,92:[_D,Qx],93:ap,95:o0,96:cD},v4={null:[o0,f4]},w4={null:[42,95]},S4={null:[]},_4=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:w4,contentInitial:y4,disable:S4,document:g4,flow:E4,flowInitial:b4,insideSpan:v4,string:x4,text:T4},Symbol.toStringTag,{value:"Module"}));function C4(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},o=[];let l=[],c=[];const d={attempt:N(P),check:N(_),consume:k,enter:O,exit:A,interrupt:N(_,{interrupt:!0})},h={code:null,containerState:{},defineSkip:S,events:[],now:C,parser:e,previous:null,sliceSerialize:E,sliceStream:x,write:g};let m=t.tokenize.call(h,d);return t.resolveAll&&o.push(t),h;function g(M){return l=wr(l,M),w(),l[l.length-1]!==null?[]:(I(t,0),h.events=sp(o,h.events,h),h.events)}function E(M,H){return N4(x(M),H)}function x(M){return k4(l,M)}function C(){const{_bufferIndex:M,_index:H,line:$,column:G,offset:J}=r;return{_bufferIndex:M,_index:H,line:$,column:G,offset:J}}function S(M){a[M.line]=M.column,j()}function w(){let M;for(;r._index<l.length;){const H=l[r._index];if(typeof H=="string")for(M=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===M&&r._bufferIndex<H.length;)v(H.charCodeAt(r._bufferIndex));else v(H)}}function v(M){m=m(M)}function k(M){ze(M)?(r.line++,r.column=1,r.offset+=M===-3?2:1,j()):M!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),h.previous=M}function O(M,H){const $=H||{};return $.type=M,$.start=C(),h.events.push(["enter",$,h]),c.push($),$}function A(M){const H=c.pop();return H.end=C(),h.events.push(["exit",H,h]),H}function P(M,H){I(M,H.from)}function _(M,H){H.restore()}function N(M,H){return $;function $(G,J,Q){let re,Z,K,R;return Array.isArray(G)?ue(G):"tokenize"in G?ue([G]):ae(G);function ae(Te){return Ze;function Ze($e){const Ge=$e!==null&&Te[$e],tt=$e!==null&&Te.null,We=[...Array.isArray(Ge)?Ge:Ge?[Ge]:[],...Array.isArray(tt)?tt:tt?[tt]:[]];return ue(We)($e)}}function ue(Te){return re=Te,Z=0,Te.length===0?Q:z(Te[Z])}function z(Te){return Ze;function Ze($e){return R=F(),K=Te,Te.partial||(h.currentConstruct=Te),Te.name&&h.parser.constructs.disable.null.includes(Te.name)?Be():Te.tokenize.call(H?Object.assign(Object.create(h),H):h,d,Oe,Be)($e)}}function Oe(Te){return M(K,R),J}function Be(Te){return R.restore(),++Z<re.length?z(re[Z]):Q}}}function I(M,H){M.resolveAll&&!o.includes(M)&&o.push(M),M.resolve&&as(h.events,H,h.events.length-H,M.resolve(h.events.slice(H),h)),M.resolveTo&&(h.events=M.resolveTo(h.events,h))}function F(){const M=C(),H=h.previous,$=h.currentConstruct,G=h.events.length,J=Array.from(c);return{from:G,restore:Q};function Q(){r=M,h.previous=H,h.currentConstruct=$,h.events.length=G,c=J,j()}}function j(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function k4(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,o=t.end._bufferIndex;let l;if(n===a)l=[e[n].slice(r,o)];else{if(l=e.slice(n,a),r>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(r):l.shift()}o>0&&l.push(e[a].slice(0,o))}return l}function N4(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const o=e[n];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
|
|
96
|
-
`;break}case-3:{l=`\r
|
|
97
|
-
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&a)continue;l=" ";break}default:l=String.fromCharCode(o)}a=o===-2,r.push(l)}return r.join("")}function O4(e){const r={constructs:PO([_4,...(e||{}).extensions||[]]),content:a(YO),defined:[],document:a($O),flow:a(c4),lazy:{},string:a(h4),text:a(p4)};return r;function a(o){return l;function l(c){return C4(r,o,c)}}}function D4(e){for(;!Xx(e););return e}const Ny=/[\0\t\n\r]/g;function A4(){let e=1,t="",n=!0,r;return a;function a(o,l,c){const d=[];let h,m,g,E,x;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),g=0,t="",n&&(o.charCodeAt(0)===65279&&g++,n=void 0);g<o.length;){if(Ny.lastIndex=g,h=Ny.exec(o),E=h&&h.index!==void 0?h.index:o.length,x=o.charCodeAt(E),!h){t=o.slice(g);break}if(x===10&&g===E&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),g<E&&(d.push(o.slice(g,E)),e+=E-g),x){case 0:{d.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,d.push(-2);e++<m;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}g=E+1}return c&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const I4=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function R4(e){return e.replace(I4,L4)}function L4(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),o=a===120||a===88;return $x(n.slice(o?2:1),o?16:10)}return rp(n)||e}const n2={}.hasOwnProperty;function M4(e,t,n){return typeof t!="string"&&(n=t,t=void 0),P4(n)(D4(O4(n).document().write(A4()(e,t,!0))))}function P4(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(it),autolinkProtocol:F,autolinkEmail:F,atxHeading:o(tn),blockQuote:o(tt),characterEscape:F,characterReference:F,codeFenced:o(We),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(We,l),codeText:o(pn,l),codeTextData:F,data:F,codeFlowValue:F,definition:o(Gt),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(Hn),hardBreakEscape:o(nn),hardBreakTrailing:o(nn),htmlFlow:o(mn,l),htmlFlowData:F,htmlText:o(mn,l),htmlTextData:F,image:o(tr),label:l,link:o(it),listItem:o(Et),listItemValue:E,listOrdered:o(nt,g),listUnordered:o(nt),paragraph:o(Nt),reference:z,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(tn),strong:o(on),thematicBreak:o(un)},exit:{atxHeading:d(),atxHeadingSequence:P,autolink:d(),autolinkEmail:Ge,autolinkProtocol:$e,blockQuote:d(),characterEscapeValue:j,characterReferenceMarkerHexadecimal:Be,characterReferenceMarkerNumeric:Be,characterReferenceValue:Te,characterReference:Ze,codeFenced:d(w),codeFencedFence:S,codeFencedFenceInfo:x,codeFencedFenceMeta:C,codeFlowValue:j,codeIndented:d(v),codeText:d(J),codeTextData:j,data:j,definition:d(),definitionDestinationString:A,definitionLabelString:k,definitionTitleString:O,emphasis:d(),hardBreakEscape:d(H),hardBreakTrailing:d(H),htmlFlow:d($),htmlFlowData:j,htmlText:d(G),htmlTextData:j,image:d(re),label:K,labelText:Z,lineEnding:M,link:d(Q),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:Oe,resourceDestinationString:R,resourceTitleString:ae,resource:ue,setextHeading:d(I),setextHeadingLineSequence:N,setextHeadingText:_,strong:d(),thematicBreak:d()}};r2(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(oe){let pe={type:"root",children:[]};const De={stack:[pe],tokenStack:[],config:t,enter:c,exit:h,buffer:l,resume:m,data:n},He=[];let Ve=-1;for(;++Ve<oe.length;)if(oe[Ve][1].type==="listOrdered"||oe[Ve][1].type==="listUnordered")if(oe[Ve][0]==="enter")He.push(Ve);else{const gt=He.pop();Ve=a(oe,gt,Ve)}for(Ve=-1;++Ve<oe.length;){const gt=t[oe[Ve][0]];n2.call(gt,oe[Ve][1].type)&>[oe[Ve][1].type].call(Object.assign({sliceSerialize:oe[Ve][2].sliceSerialize},De),oe[Ve][1])}if(De.tokenStack.length>0){const gt=De.tokenStack[De.tokenStack.length-1];(gt[1]||Oy).call(De,void 0,gt[0])}for(pe.position={start:Js(oe.length>0?oe[0][1].start:{line:1,column:1,offset:0}),end:Js(oe.length>0?oe[oe.length-2][1].end:{line:1,column:1,offset:0})},Ve=-1;++Ve<t.transforms.length;)pe=t.transforms[Ve](pe)||pe;return pe}function a(oe,pe,De){let He=pe-1,Ve=-1,gt=!1,zt,rn,_n,Un;for(;++He<=De;){const At=oe[He];switch(At[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{At[0]==="enter"?Ve++:Ve--,Un=void 0;break}case"lineEndingBlank":{At[0]==="enter"&&(zt&&!Un&&!Ve&&!_n&&(_n=He),Un=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Un=void 0}if(!Ve&&At[0]==="enter"&&At[1].type==="listItemPrefix"||Ve===-1&&At[0]==="exit"&&(At[1].type==="listUnordered"||At[1].type==="listOrdered")){if(zt){let yt=He;for(rn=void 0;yt--;){const ln=oe[yt];if(ln[1].type==="lineEnding"||ln[1].type==="lineEndingBlank"){if(ln[0]==="exit")continue;rn&&(oe[rn][1].type="lineEndingBlank",gt=!0),ln[1].type="lineEnding",rn=yt}else if(!(ln[1].type==="linePrefix"||ln[1].type==="blockQuotePrefix"||ln[1].type==="blockQuotePrefixWhitespace"||ln[1].type==="blockQuoteMarker"||ln[1].type==="listItemIndent"))break}_n&&(!rn||_n<rn)&&(zt._spread=!0),zt.end=Object.assign({},rn?oe[rn][1].start:At[1].end),oe.splice(rn||He,0,["exit",zt,At[2]]),He++,De++}if(At[1].type==="listItemPrefix"){const yt={type:"listItem",_spread:!1,start:Object.assign({},At[1].start),end:void 0};zt=yt,oe.splice(He,0,["enter",yt,At[2]]),He++,De++,_n=void 0,Un=!0}}}return oe[pe][1]._spread=gt,De}function o(oe,pe){return De;function De(He){c.call(this,oe(He),He),pe&&pe.call(this,He)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(oe,pe,De){this.stack[this.stack.length-1].children.push(oe),this.stack.push(oe),this.tokenStack.push([pe,De||void 0]),oe.position={start:Js(pe.start),end:void 0}}function d(oe){return pe;function pe(De){oe&&oe.call(this,De),h.call(this,De)}}function h(oe,pe){const De=this.stack.pop(),He=this.tokenStack.pop();if(He)He[0].type!==oe.type&&(pe?pe.call(this,oe,He[0]):(He[1]||Oy).call(this,oe,He[0]));else throw new Error("Cannot close `"+oe.type+"` ("+xu({start:oe.start,end:oe.end})+"): it’s not open");De.position.end=Js(oe.end)}function m(){return LO(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function E(oe){if(this.data.expectingFirstListItemValue){const pe=this.stack[this.stack.length-2];pe.start=Number.parseInt(this.sliceSerialize(oe),10),this.data.expectingFirstListItemValue=void 0}}function x(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.lang=oe}function C(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.meta=oe}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.value=oe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.value=oe.replace(/(\r?\n|\r)$/g,"")}function k(oe){const pe=this.resume(),De=this.stack[this.stack.length-1];De.label=pe,De.identifier=ji(this.sliceSerialize(oe)).toLowerCase()}function O(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.title=oe}function A(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.url=oe}function P(oe){const pe=this.stack[this.stack.length-1];if(!pe.depth){const De=this.sliceSerialize(oe).length;pe.depth=De}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function N(oe){const pe=this.stack[this.stack.length-1];pe.depth=this.sliceSerialize(oe).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function F(oe){const De=this.stack[this.stack.length-1].children;let He=De[De.length-1];(!He||He.type!=="text")&&(He=nr(),He.position={start:Js(oe.start),end:void 0},De.push(He)),this.stack.push(He)}function j(oe){const pe=this.stack.pop();pe.value+=this.sliceSerialize(oe),pe.position.end=Js(oe.end)}function M(oe){const pe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const De=pe.children[pe.children.length-1];De.position.end=Js(oe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(pe.type)&&(F.call(this,oe),j.call(this,oe))}function H(){this.data.atHardBreak=!0}function $(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.value=oe}function G(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.value=oe}function J(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.value=oe}function Q(){const oe=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=pe,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function re(){const oe=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=pe,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function Z(oe){const pe=this.sliceSerialize(oe),De=this.stack[this.stack.length-2];De.label=R4(pe),De.identifier=ji(pe).toLowerCase()}function K(){const oe=this.stack[this.stack.length-1],pe=this.resume(),De=this.stack[this.stack.length-1];if(this.data.inReference=!0,De.type==="link"){const He=oe.children;De.children=He}else De.alt=pe}function R(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.url=oe}function ae(){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.title=oe}function ue(){this.data.inReference=void 0}function z(){this.data.referenceType="collapsed"}function Oe(oe){const pe=this.resume(),De=this.stack[this.stack.length-1];De.label=pe,De.identifier=ji(this.sliceSerialize(oe)).toLowerCase(),this.data.referenceType="full"}function Be(oe){this.data.characterReferenceType=oe.type}function Te(oe){const pe=this.sliceSerialize(oe),De=this.data.characterReferenceType;let He;De?(He=$x(pe,De==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):He=rp(pe);const Ve=this.stack[this.stack.length-1];Ve.value+=He}function Ze(oe){const pe=this.stack.pop();pe.position.end=Js(oe.end)}function $e(oe){j.call(this,oe);const pe=this.stack[this.stack.length-1];pe.url=this.sliceSerialize(oe)}function Ge(oe){j.call(this,oe);const pe=this.stack[this.stack.length-1];pe.url="mailto:"+this.sliceSerialize(oe)}function tt(){return{type:"blockquote",children:[]}}function We(){return{type:"code",lang:null,meta:null,value:""}}function pn(){return{type:"inlineCode",value:""}}function Gt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Hn(){return{type:"emphasis",children:[]}}function tn(){return{type:"heading",depth:0,children:[]}}function nn(){return{type:"break"}}function mn(){return{type:"html",value:""}}function tr(){return{type:"image",title:null,url:"",alt:null}}function it(){return{type:"link",title:null,url:"",children:[]}}function nt(oe){return{type:"list",ordered:oe.type==="listOrdered",start:null,spread:oe._spread,children:[]}}function Et(oe){return{type:"listItem",spread:oe._spread,checked:null,children:[]}}function Nt(){return{type:"paragraph",children:[]}}function on(){return{type:"strong",children:[]}}function nr(){return{type:"text",value:""}}function un(){return{type:"thematicBreak"}}}function Js(e){return{line:e.line,column:e.column,offset:e.offset}}function r2(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?r2(e,r):F4(e,r)}}function F4(e,t){let n;for(n in t)if(n2.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Oy(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+xu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+xu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+xu({start:t.start,end:t.end})+") is still open")}function j4(e){const t=this;t.parser=n;function n(r){return M4(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function B4(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function H4(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
98
|
-
`}]}function U4(e,t){const n=t.value?t.value+`
|
|
99
|
-
`:"",r={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(r.className=["language-"+a[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function z4(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function W4(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Y4(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),a=mo(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let l,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=o+1,c+=1,e.footnoteCounts.set(r,c);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,d);const h={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,h),e.applyData(t,h)}function q4(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $4(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function s2(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const a=e.all(t),o=a[0];o&&o.type==="text"?o.value="["+o.value:a.unshift({type:"text",value:"["});const l=a[a.length-1];return l&&l.type==="text"?l.value+=r:a.push({type:"text",value:r}),a}function V4(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return s2(e,t);const a={src:mo(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(a.title=r.title);const o={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,o),e.applyData(t,o)}function Q4(e,t){const n={src:mo(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function G4(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function X4(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return s2(e,t);const a={href:mo(r.url||"")};r.title!==null&&r.title!==void 0&&(a.title=r.title);const o={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function K4(e,t){const n={href:mo(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function J4(e,t,n){const r=e.all(t),a=n?Z4(n):a2(t),o={},l=[];if(typeof t.checked=="boolean"){const m=r[0];let g;m&&m.type==="element"&&m.tagName==="p"?g=m:(g={type:"element",tagName:"p",properties:{},children:[]},r.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const m=r[c];(a||c!==0||m.type!=="element"||m.tagName!=="p")&&l.push({type:"text",value:`
|
|
100
|
-
`}),m.type==="element"&&m.tagName==="p"&&!a?l.push(...m.children):l.push(m)}const d=r[r.length-1];d&&(a||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
|
|
101
|
-
`});const h={type:"element",tagName:"li",properties:o,children:l};return e.patch(t,h),e.applyData(t,h)}function Z4(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=a2(n[r])}return t}function a2(e){const t=e.spread;return t??e.children.length>1}function e6(e,t){const n={},r=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<r.length;){const l=r[a];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function t6(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function n6(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function r6(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function s6(e,t){const n=e.all(t),r=n.shift(),a=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),a.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=us(t.children[1]),d=rd(t.children[t.children.length-1]);c&&d&&(l.position={start:c,end:d}),a.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,o),e.applyData(t,o)}function a6(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,c=l?l.length:t.children.length;let d=-1;const h=[];for(;++d<c;){const g=t.children[d],E={},x=l?l[d]:void 0;x&&(E.align=x);let C={type:"element",tagName:o,properties:E,children:[]};g&&(C.children=e.all(g),e.patch(g,C),C=e.applyData(g,C)),h.push(C)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,m),e.applyData(t,m)}function i6(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Dy=9,Ay=32;function o6(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),a=0;const o=[];for(;r;)o.push(Iy(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return o.push(Iy(t.slice(a),a>0,!1)),o.join("")}function Iy(e,t,n){let r=0,a=e.length;if(t){let o=e.codePointAt(r);for(;o===Dy||o===Ay;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(a-1);for(;o===Dy||o===Ay;)a--,o=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function u6(e,t){const n={type:"text",value:o6(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function l6(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const c6={blockquote:B4,break:H4,code:U4,delete:z4,emphasis:W4,footnoteReference:Y4,heading:q4,html:$4,imageReference:V4,image:Q4,inlineCode:G4,linkReference:X4,link:K4,listItem:J4,list:e6,paragraph:t6,root:n6,strong:r6,table:s6,tableCell:i6,tableRow:a6,text:u6,thematicBreak:l6,toml:mc,yaml:mc,definition:mc,footnoteDefinition:mc};function mc(){}const i2=-1,ad=0,vu=1,Mc=2,ip=3,op=4,up=5,lp=6,o2=7,u2=8,Ry=typeof self=="object"?self:globalThis,d6=(e,t)=>{const n=(a,o)=>(e.set(o,a),a),r=a=>{if(e.has(a))return e.get(a);const[o,l]=t[a];switch(o){case ad:case i2:return n(l,a);case vu:{const c=n([],a);for(const d of l)c.push(r(d));return c}case Mc:{const c=n({},a);for(const[d,h]of l)c[r(d)]=r(h);return c}case ip:return n(new Date(l),a);case op:{const{source:c,flags:d}=l;return n(new RegExp(c,d),a)}case up:{const c=n(new Map,a);for(const[d,h]of l)c.set(r(d),r(h));return c}case lp:{const c=n(new Set,a);for(const d of l)c.add(r(d));return c}case o2:{const{name:c,message:d}=l;return n(new Ry[c](d),a)}case u2:return n(BigInt(l),a);case"BigInt":return n(Object(BigInt(l)),a);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:c}=new Uint8Array(l);return n(new DataView(c),l)}}return n(new Ry[o](l),a)};return r},Ly=e=>d6(new Map,e)(0),Mi="",{toString:f6}={},{keys:h6}=Object,pu=e=>{const t=typeof e;if(t!=="object"||!e)return[ad,t];const n=f6.call(e).slice(8,-1);switch(n){case"Array":return[vu,Mi];case"Object":return[Mc,Mi];case"Date":return[ip,Mi];case"RegExp":return[op,Mi];case"Map":return[up,Mi];case"Set":return[lp,Mi];case"DataView":return[vu,n]}return n.includes("Array")?[vu,n]:n.includes("Error")?[o2,n]:[Mc,n]},gc=([e,t])=>e===ad&&(t==="function"||t==="symbol"),p6=(e,t,n,r)=>{const a=(l,c)=>{const d=r.push(l)-1;return n.set(c,d),d},o=l=>{if(n.has(l))return n.get(l);let[c,d]=pu(l);switch(c){case ad:{let m=l;switch(d){case"bigint":c=u2,m=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);m=null;break;case"undefined":return a([i2],l)}return a([c,m],l)}case vu:{if(d){let E=l;return d==="DataView"?E=new Uint8Array(l.buffer):d==="ArrayBuffer"&&(E=new Uint8Array(l)),a([d,[...E]],l)}const m=[],g=a([c,m],l);for(const E of l)m.push(o(E));return g}case Mc:{if(d)switch(d){case"BigInt":return a([d,l.toString()],l);case"Boolean":case"Number":case"String":return a([d,l.valueOf()],l)}if(t&&"toJSON"in l)return o(l.toJSON());const m=[],g=a([c,m],l);for(const E of h6(l))(e||!gc(pu(l[E])))&&m.push([o(E),o(l[E])]);return g}case ip:return a([c,l.toISOString()],l);case op:{const{source:m,flags:g}=l;return a([c,{source:m,flags:g}],l)}case up:{const m=[],g=a([c,m],l);for(const[E,x]of l)(e||!(gc(pu(E))||gc(pu(x))))&&m.push([o(E),o(x)]);return g}case lp:{const m=[],g=a([c,m],l);for(const E of l)(e||!gc(pu(E)))&&m.push(o(E));return g}}const{message:h}=l;return a([c,{name:d,message:h}],l)};return o},My=(e,{json:t,lossy:n}={})=>{const r=[];return p6(!(t||n),!!t,new Map,r)(e),r},so=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Ly(My(e,t)):structuredClone(e):(e,t)=>Ly(My(e,t));function m6(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function g6(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function y6(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||m6,r=e.options.footnoteBackLabel||g6,a=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let d=-1;for(;++d<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[d]);if(!h)continue;const m=e.all(h),g=String(h.identifier).toUpperCase(),E=mo(g.toLowerCase());let x=0;const C=[],S=e.footnoteCounts.get(g);for(;S!==void 0&&++x<=S;){C.length>0&&C.push({type:"text",value:" "});let k=typeof n=="string"?n:n(d,x);typeof k=="string"&&(k={type:"text",value:k}),C.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+E+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,x),className:["data-footnote-backref"]},children:Array.isArray(k)?k:[k]})}const w=m[m.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const k=w.children[w.children.length-1];k&&k.type==="text"?k.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...C)}else m.push(...C);const v={type:"element",tagName:"li",properties:{id:t+"fn-"+E},children:e.wrap(m,!0)};e.patch(h,v),c.push(v)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...so(l),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
|
|
102
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
|
|
103
|
-
`}]}}const l2=(function(e){if(e==null)return T6;if(typeof e=="function")return id(e);if(typeof e=="object")return Array.isArray(e)?b6(e):E6(e);if(typeof e=="string")return x6(e);throw new Error("Expected function, string, or object as test")});function b6(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=l2(e[n]);return id(r);function r(...a){let o=-1;for(;++o<t.length;)if(t[o].apply(this,a))return!0;return!1}}function E6(e){const t=e;return id(n);function n(r){const a=r;let o;for(o in e)if(a[o]!==t[o])return!1;return!0}}function x6(e){return id(t);function t(n){return n&&n.type===e}}function id(e){return t;function t(n,r,a){return!!(v6(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function T6(){return!0}function v6(e){return e!==null&&typeof e=="object"&&"type"in e}const c2=[],w6=!0,Py=!1,S6="skip";function _6(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const o=l2(a),l=r?-1:1;c(e,void 0,[])();function c(d,h,m){const g=d&&typeof d=="object"?d:{};if(typeof g.type=="string"){const x=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(E,"name",{value:"node ("+(d.type+(x?"<"+x+">":""))+")"})}return E;function E(){let x=c2,C,S,w;if((!t||o(d,h,m[m.length-1]||void 0))&&(x=C6(n(d,m)),x[0]===Py))return x;if("children"in d&&d.children){const v=d;if(v.children&&x[0]!==S6)for(S=(r?v.children.length:-1)+l,w=m.concat(v);S>-1&&S<v.children.length;){const k=v.children[S];if(C=c(k,S,w)(),C[0]===Py)return C;S=typeof C[1]=="number"?C[1]:S+l}}return x}}}function C6(e){return Array.isArray(e)?e:typeof e=="number"?[w6,e]:e==null?c2:[e]}function cp(e,t,n,r){let a,o,l;typeof t=="function"&&typeof n!="function"?(o=void 0,l=t,a=n):(o=t,l=n,a=r),_6(e,o,c,a);function c(d,h){const m=h[h.length-1],g=m?m.children.indexOf(d):void 0;return l(d,g,m)}}const u0={}.hasOwnProperty,k6={};function N6(e,t){const n=t||k6,r=new Map,a=new Map,o=new Map,l={...c6,...n.handlers},c={all:h,applyData:D6,definitionById:r,footnoteById:a,footnoteCounts:o,footnoteOrder:[],handlers:l,one:d,options:n,patch:O6,wrap:I6};return cp(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const g=m.type==="definition"?r:a,E=String(m.identifier).toUpperCase();g.has(E)||g.set(E,m)}}),c;function d(m,g){const E=m.type,x=c.handlers[E];if(u0.call(c.handlers,E)&&x)return x(c,m,g);if(c.options.passThrough&&c.options.passThrough.includes(E)){if("children"in m){const{children:S,...w}=m,v=so(w);return v.children=c.all(m),v}return so(m)}return(c.options.unknownHandler||A6)(c,m,g)}function h(m){const g=[];if("children"in m){const E=m.children;let x=-1;for(;++x<E.length;){const C=c.one(E[x],m);if(C){if(x&&E[x-1].type==="break"&&(!Array.isArray(C)&&C.type==="text"&&(C.value=Fy(C.value)),!Array.isArray(C)&&C.type==="element")){const S=C.children[0];S&&S.type==="text"&&(S.value=Fy(S.value))}Array.isArray(C)?g.push(...C):g.push(C)}}}return g}}function O6(e,t){e.position&&(t.position=fO(e))}function D6(e,t){let n=t;if(e&&e.data){const r=e.data.hName,a=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&o&&Object.assign(n.properties,so(o)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function A6(e,t){const n=t.data||{},r="value"in t&&!(u0.call(n,"hProperties")||u0.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function I6(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
104
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
105
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
106
|
-
`}),n}function Fy(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function jy(e,t){const n=N6(e,t),r=n.one(e,void 0),a=y6(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&o.children.push({type:"text",value:`
|
|
107
|
-
`},a),o}function R6(e,t){return e&&"run"in e?async function(n,r){const a=jy(n,{file:r,...t});await e.run(a,r)}:function(n,r){return jy(n,{file:r,...e||t})}}function By(e){if(e)throw e}var bh,Hy;function L6(){if(Hy)return bh;Hy=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},o=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var m=e.call(h,"constructor"),g=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!m&&!g)return!1;var E;for(E in h);return typeof E>"u"||e.call(h,E)},l=function(h,m){n&&m.name==="__proto__"?n(h,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):h[m.name]=m.newValue},c=function(h,m){if(m==="__proto__")if(e.call(h,m)){if(r)return r(h,m).value}else return;return h[m]};return bh=function d(){var h,m,g,E,x,C,S=arguments[0],w=1,v=arguments.length,k=!1;for(typeof S=="boolean"&&(k=S,S=arguments[1]||{},w=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});w<v;++w)if(h=arguments[w],h!=null)for(m in h)g=c(S,m),E=c(h,m),S!==E&&(k&&E&&(o(E)||(x=a(E)))?(x?(x=!1,C=g&&a(g)?g:[]):C=g&&o(g)?g:{},l(S,{name:m,newValue:d(k,C,E)})):typeof E<"u"&&l(S,{name:m,newValue:E}));return S},bh}var M6=L6();const Eh=wb(M6);function l0(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function P6(){const e=[],t={run:n,use:r};return t;function n(...a){let o=-1;const l=a.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...a);function c(d,...h){const m=e[++o];let g=-1;if(d){l(d);return}for(;++g<a.length;)(h[g]===null||h[g]===void 0)&&(h[g]=a[g]);a=h,m?F6(m,c)(...h):l(null,...h)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function F6(e,t){let n;return r;function r(...l){const c=e.length>l.length;let d;c&&l.push(a);try{d=e.apply(this,l)}catch(h){const m=h;if(c&&n)throw m;return a(m)}c||(d&&d.then&&typeof d.then=="function"?d.then(o,a):d instanceof Error?a(d):o(d))}function a(l,...c){n||(n=!0,t(l,...c))}function o(l){a(null,l)}}const Gr={basename:j6,dirname:B6,extname:H6,join:U6,sep:"/"};function j6(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Xu(e);let n=0,r=-1,a=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(o){n=a+1;break}}else r<0&&(o=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,c=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(o){n=a+1;break}}else l<0&&(o=!0,l=a+1),c>-1&&(e.codePointAt(a)===t.codePointAt(c--)?c<0&&(r=a):(c=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function B6(e){if(Xu(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function H6(e){Xu(e);let t=e.length,n=-1,r=0,a=-1,o=0,l;for(;t--;){const c=e.codePointAt(t);if(c===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),c===46?a<0?a=t:o!==1&&(o=1):a>-1&&(o=-1)}return a<0||n<0||o===0||o===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function U6(...e){let t=-1,n;for(;++t<e.length;)Xu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":z6(n)}function z6(e){Xu(e);const t=e.codePointAt(0)===47;let n=W6(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function W6(e,t){let n="",r=0,a=-1,o=0,l=-1,c,d;for(;++l<=e.length;){if(l<e.length)c=e.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(a===l-1||o===1))if(a!==l-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),a=l,o=0;continue}}else if(n.length>0){n="",r=0,a=l,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,l):n=e.slice(a+1,l),r=l-a-1;a=l,o=0}else c===46&&o>-1?o++:o=-1}return n}function Xu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Y6={cwd:q6};function q6(){return"/"}function c0(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function $6(e){if(typeof e=="string")e=new URL(e);else if(!c0(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return V6(e)}function V6(e){if(e.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 t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const xh=["history","path","basename","stem","extname","dirname"];class d2{constructor(t){let n;t?c0(t)?n={path:t}:typeof t=="string"||Q6(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Y6.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<xh.length;){const o=xh[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let a;for(a in n)xh.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?Gr.basename(this.path):void 0}set basename(t){vh(t,"basename"),Th(t,"basename"),this.path=Gr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Gr.dirname(this.path):void 0}set dirname(t){Uy(this.basename,"dirname"),this.path=Gr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Gr.extname(this.path):void 0}set extname(t){if(Th(t,"extname"),Uy(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Gr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){c0(t)&&(t=$6(t)),vh(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Gr.basename(this.path,this.extname):void 0}set stem(t){vh(t,"stem"),Th(t,"stem"),this.path=Gr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){const a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){const a=new Ln(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Th(e,t){if(e&&e.includes(Gr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Gr.sep+"`")}function vh(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Uy(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Q6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const G6=(function(e){const r=this.constructor.prototype,a=r[e],o=function(){return a.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),X6={}.hasOwnProperty;class dp extends G6{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=P6()}copy(){const t=new dp;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Eh(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(_h("data",this.frozen),this.namespace[t]=n,this):X6.call(this.namespace,t)&&this.namespace[t]||void 0:t?(_h("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=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 a=n.call(t,...r);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=yc(t),r=this.parser||this.Parser;return wh("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),wh("process",this.parser||this.Parser),Sh("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(o,l){const c=yc(t),d=r.parse(c);r.run(d,c,function(m,g,E){if(m||!g||!E)return h(m);const x=g,C=r.stringify(x,E);Z6(C)?E.value=C:E.result=C,h(m,E)});function h(m,g){m||!g?l(m):o?o(g):n(void 0,g)}}}processSync(t){let n=!1,r;return this.freeze(),wh("processSync",this.parser||this.Parser),Sh("processSync",this.compiler||this.Compiler),this.process(t,a),Wy("processSync","process",n),r;function a(o,l){n=!0,By(o),r=l}}run(t,n,r){zy(t),this.freeze();const a=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(l,c){const d=yc(n);a.run(t,d,h);function h(m,g,E){const x=g||t;m?c(m):l?l(x):r(void 0,x,E)}}}runSync(t,n){let r=!1,a;return this.run(t,n,o),Wy("runSync","run",r),a;function o(l,c){By(l),a=c,r=!0}}stringify(t,n){this.freeze();const r=yc(n),a=this.compiler||this.Compiler;return Sh("stringify",a),zy(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(_h("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(h){if(typeof h=="function")d(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[m,...g]=h;d(m,g)}else l(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function l(h){if(!("plugins"in h)&&!("settings"in h))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");c(h.plugins),h.settings&&(a.settings=Eh(!0,a.settings,h.settings))}function c(h){let m=-1;if(h!=null)if(Array.isArray(h))for(;++m<h.length;){const g=h[m];o(g)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function d(h,m){let g=-1,E=-1;for(;++g<r.length;)if(r[g][0]===h){E=g;break}if(E===-1)r.push([h,...m]);else if(m.length>0){let[x,...C]=m;const S=r[E][1];l0(S)&&l0(x)&&(x=Eh(!0,S,x)),r[E]=[h,x,...C]}}}}const K6=new dp().freeze();function wh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Sh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function _h(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function zy(e){if(!l0(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Wy(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function yc(e){return J6(e)?e:new d2(e)}function J6(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Z6(e){return typeof e=="string"||eA(e)}function eA(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const tA="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Yy=[],qy={allowDangerousHtml:!0},nA=/^(https?|ircs?|mailto|xmpp)$/i,rA=[{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 sA(e){const t=aA(e),n=iA(e);return oA(t.runSync(t.parse(n),n),e)}function aA(e){const t=e.rehypePlugins||Yy,n=e.remarkPlugins||Yy,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...qy}:qy;return K6().use(j4).use(n).use(R6,r).use(t)}function iA(e){const t=e.children||"",n=new d2;return typeof t=="string"&&(n.value=t),n}function oA(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,o=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,d=t.urlTransform||uA;for(const m of rA)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+tA+m.id,void 0);return cp(e,h),yO(e,{Fragment:p.Fragment,components:a,ignoreInvalidStyle:!0,jsx:p.jsx,jsxs:p.jsxs,passKeys:!0,passNode:!0});function h(m,g,E){if(m.type==="raw"&&E&&typeof g=="number")return l?E.children.splice(g,1):E.children[g]={type:"text",value:m.value},g;if(m.type==="element"){let x;for(x in mh)if(Object.hasOwn(mh,x)&&Object.hasOwn(m.properties,x)){const C=m.properties[x],S=mh[x];(S===null||S.includes(m.tagName))&&(m.properties[x]=d(String(C||""),x,m))}}if(m.type==="element"){let x=n?!n.includes(m.tagName):o?o.includes(m.tagName):!1;if(!x&&r&&typeof g=="number"&&(x=!r(m,g,E)),x&&E&&typeof g=="number")return c&&m.children?E.children.splice(g,1,...m.children):E.children.splice(g,1),g}}}function uA(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||r!==-1&&t>r||nA.test(e.slice(0,t))?e:""}const $y=/[#.]/g;function lA(e,t){const n=e||"",r={};let a=0,o,l;for(;a<n.length;){$y.lastIndex=a;const c=$y.exec(n),d=n.slice(a,c?c.index:n.length);d&&(o?o==="#"?r.id=d:Array.isArray(r.className)?r.className.push(d):r.className=[d]:l=d,a+=d.length),c&&(o=c[0],a++)}return{type:"element",tagName:l||t||"div",properties:r,children:[]}}function f2(e,t,n){const r=n?hA(n):void 0;function a(o,l,...c){let d;if(o==null){d={type:"root",children:[]};const h=l;c.unshift(h)}else{d=lA(o,t);const h=d.tagName.toLowerCase(),m=r?r.get(h):void 0;if(d.tagName=m||h,cA(l))c.unshift(l);else for(const[g,E]of Object.entries(l))dA(e,d.properties,g,E)}for(const h of c)d0(d.children,h);return d.type==="element"&&d.tagName==="template"&&(d.content={type:"root",children:d.children},d.children=[]),d}return a}function cA(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const a=t[r];if(a&&typeof a=="object"){if(!Array.isArray(a))return!0;const o=a;for(const l of o)if(typeof l!="number"&&typeof l!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function dA(e,t,n,r){const a=nd(e,n);let o;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;o=r}else typeof r=="boolean"?o=r:typeof r=="string"?a.spaceSeparated?o=dy(r):a.commaSeparated?o=iy(r):a.commaOrSpaceSeparated?o=dy(iy(r).join(" ")):o=Vy(a,a.property,r):Array.isArray(r)?o=[...r]:o=a.property==="style"?fA(r):String(r);if(Array.isArray(o)){const l=[];for(const c of o)l.push(Vy(a,a.property,c));o=l}a.property==="className"&&Array.isArray(t.className)&&(o=t.className.concat(o)),t[a.property]=o}}function d0(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)d0(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?d0(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function Vy(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Au(n)===Au(t)))return!0}return n}function fA(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function hA(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const pA=["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"],mA=f2(Gu,"div"),gA=f2(ga,"g",pA);function yA(e){const t=String(e),n=[];return{toOffset:a,toPoint:r};function r(o){if(typeof o=="number"&&o>-1&&o<=t.length){let l=0;for(;;){let c=n[l];if(c===void 0){const d=Qy(t,n[l-1]);c=d===-1?t.length+1:d+1,n[l]=c}if(c>o)return{line:l+1,column:o-(l>0?n[l-1]:0)+1,offset:o};l++}}}function a(o){if(o&&typeof o.line=="number"&&typeof o.column=="number"&&!Number.isNaN(o.line)&&!Number.isNaN(o.column)){for(;n.length<o.line;){const c=n[n.length-1],d=Qy(t,c),h=d===-1?t.length+1:d+1;if(c===h)break;n.push(h)}const l=(o.line>1?n[o.line-2]:0)+o.column-1;if(l<n[o.line-1])return l}}}function Qy(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
|
|
108
|
-
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const ja={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/"},h2={}.hasOwnProperty,bA=Object.prototype;function EA(e,t){const n=t||{};return fp({file:n.file||void 0,location:!1,schema:n.space==="svg"?ga:Gu,verbose:n.verbose||!1},e)}function fp(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},wc(e,r,n),n}case"#document":case"#document-fragment":{const r=t,a="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:p2(e,t.childNodes),data:{quirksMode:a}},e.file&&e.location){const o=String(e.file),l=yA(o),c=l.toPoint(0),d=l.toPoint(o.length);n.position={start:c,end:d}}return n}case"#documentType":{const r=t;return n={type:"doctype"},wc(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},wc(e,r,n),n}default:return n=xA(e,t),n}}function p2(e,t){let n=-1;const r=[];for(;++n<t.length;){const a=fp(e,t[n]);r.push(a)}return r}function xA(e,t){const n=e.schema;e.schema=t.namespaceURI===ja.svg?ga:Gu;let r=-1;const a={};for(;++r<t.attrs.length;){const c=t.attrs[r],d=(c.prefix?c.prefix+":":"")+c.name;h2.call(bA,d)||(a[d]=c.value)}const l=(e.schema.space==="svg"?gA:mA)(t.tagName,a,p2(e,t.childNodes));if(wc(e,t,l),l.tagName==="template"){const c=t,d=c.sourceCodeLocation,h=d&&d.startTag&&Pi(d.startTag),m=d&&d.endTag&&Pi(d.endTag),g=fp(e,c.content);h&&m&&e.file&&(g.position={start:h.end,end:m.start}),l.content=g}return e.schema=n,l}function wc(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=TA(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function TA(e,t,n){const r=Pi(n);if(t.type==="element"){const a=t.children[t.children.length-1];if(r&&!n.endTag&&a&&a.position&&a.position.end&&(r.end=Object.assign({},a.position.end)),e.verbose){const o={};let l;if(n.attrs)for(l in n.attrs)h2.call(n.attrs,l)&&(o[nd(e.schema,l).property]=Pi(n.attrs[l]));n.startTag;const c=Pi(n.startTag),d=n.endTag?Pi(n.endTag):void 0,h={opening:c};d&&(h.closing=d),h.properties=o,t.data={position:h}}}return r}function Pi(e){const t=Gy({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=Gy({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function Gy(e){return e.line&&e.column?e:void 0}const Xy={}.hasOwnProperty;function m2(e,t){const n=t||{};function r(a,...o){let l=r.invalid;const c=r.handlers;if(a&&Xy.call(a,e)){const d=String(a[e]);l=Xy.call(c,d)?c[d]:r.unknown}if(l)return l.call(this,a,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const vA={},wA={}.hasOwnProperty,g2=m2("type",{handlers:{root:_A,element:DA,text:NA,comment:OA,doctype:kA}});function SA(e,t){const r=(t||vA).space;return g2(e,r==="svg"?ga:Gu)}function _A(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=hp(e.children,n,t),go(e,n),n}function CA(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=hp(e.children,n,t),go(e,n),n}function kA(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return go(e,t),t}function NA(e){const t={nodeName:"#text",value:e.value,parentNode:null};return go(e,t),t}function OA(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return go(e,t),t}function DA(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=ga);const a=[];let o;if(e.properties){for(o in e.properties)if(o!=="children"&&wA.call(e.properties,o)){const d=AA(r,o,e.properties[o]);d&&a.push(d)}}const l=r.space,c={nodeName:e.tagName,tagName:e.tagName,attrs:a,namespaceURI:ja[l],childNodes:[],parentNode:null};return c.childNodes=hp(e.children,c,r),go(e,c),e.tagName==="template"&&e.content&&(c.content=CA(e.content,r)),c}function AA(e,t,n){const r=nd(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?Ax(n):Bx(n));const a={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const o=a.name.indexOf(":");o<0?a.prefix="":(a.name=a.name.slice(o+1),a.prefix=r.attribute.slice(0,o)),a.namespace=ja[r.space]}return a}function hp(e,t,n){let r=-1;const a=[];if(e)for(;++r<e.length;){const o=g2(e[r],n);o.parentNode=t,a.push(o)}return a}function go(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.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 IA=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],RA=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]),Mt="�";var B;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(B||(B={}));const Gn={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function y2(e){return e>=55296&&e<=57343}function LA(e){return e>=56320&&e<=57343}function MA(e,t){return(e-55296)*1024+9216+t}function b2(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function E2(e){return e>=64976&&e<=65007||RA.has(e)}var ie;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(ie||(ie={}));const PA=65536;class FA{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=PA,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(t,n){const{line:r,col:a,offset:o}=this,l=a+n,c=o+n;return{code:t,startLine:r,endLine:r,startCol:l,endCol:l,startOffset:c,endOffset:c}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(LA(n))return this.pos++,this._addGap(),MA(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,B.EOF;return this._err(ie.surrogateInInputStream),t}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(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,B.EOF;const r=this.html.charCodeAt(n);return r===B.CARRIAGE_RETURN?B.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,B.EOF;let t=this.html.charCodeAt(this.pos);return t===B.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,B.LINE_FEED):t===B.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,y2(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===B.LINE_FEED||t===B.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){b2(t)?this._err(ie.controlCharacterInInputStream):E2(t)&&this._err(ie.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var et;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(et||(et={}));function x2(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const jA=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ȀDMPTLJNjǑǖ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;扐blè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;戥ǹ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୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢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;怳Ādpuct;戏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ቻDzኀ\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ǣጓ\0y;䐎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;䅻Dzᕔ\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Ā;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀ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Ā;elƀ;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\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»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ƀ;oș᳔ndĀ;ș᳑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;ẝẤijạả;怄;怅怃Ā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;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱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ↄⅪ←ٖ↛ǰ↉\0proø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⧓ସdz⧟\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᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\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\0m;櫳;櫽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㚆㚝㚵㚼Dz㚋\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(e=>e.charCodeAt(0))),BA=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 HA(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=BA.get(e))!==null&&t!==void 0?t:e}var Tn;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Tn||(Tn={}));const UA=32;var ha;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(ha||(ha={}));function f0(e){return e>=Tn.ZERO&&e<=Tn.NINE}function zA(e){return e>=Tn.UPPER_A&&e<=Tn.UPPER_F||e>=Tn.LOWER_A&&e<=Tn.LOWER_F}function WA(e){return e>=Tn.UPPER_A&&e<=Tn.UPPER_Z||e>=Tn.LOWER_A&&e<=Tn.LOWER_Z||f0(e)}function YA(e){return e===Tn.EQUALS||WA(e)}var En;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(En||(En={}));var ws;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(ws||(ws={}));class qA{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=En.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ws.Strict}startEntity(t){this.decodeMode=t,this.state=En.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case En.EntityStart:return t.charCodeAt(n)===Tn.NUM?(this.state=En.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=En.NamedEntity,this.stateNamedEntity(t,n));case En.NumericStart:return this.stateNumericStart(t,n);case En.NumericDecimal:return this.stateNumericDecimal(t,n);case En.NumericHex:return this.stateNumericHex(t,n);case En.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|UA)===Tn.LOWER_X?(this.state=En.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=En.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,a){if(n!==r){const o=r-n;this.result=this.result*Math.pow(a,o)+Number.parseInt(t.substr(n,o),a),this.consumed+=o}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const a=t.charCodeAt(n);if(f0(a)||zA(a))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(a,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const a=t.charCodeAt(n);if(f0(a))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(a,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===Tn.SEMI)this.consumed+=1;else if(this.decodeMode===ws.Strict)return 0;return this.emitCodePoint(HA(this.result),this.consumed),this.errors&&(t!==Tn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let a=r[this.treeIndex],o=(a&ha.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const l=t.charCodeAt(n);if(this.treeIndex=$A(r,a,this.treeIndex+Math.max(1,o),l),this.treeIndex<0)return this.result===0||this.decodeMode===ws.Attribute&&(o===0||YA(l))?0:this.emitNotTerminatedNamedEntity();if(a=r[this.treeIndex],o=(a&ha.VALUE_LENGTH)>>14,o!==0){if(l===Tn.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==ws.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,a=(r[n]&ha.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,a,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:a}=this;return this.emitCodePoint(n===1?a[t]&~ha.VALUE_LENGTH:a[t+1],r),n===3&&this.emitCodePoint(a[t+2],r),r}end(){var t;switch(this.state){case En.NamedEntity:return this.result!==0&&(this.decodeMode!==ws.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case En.NumericDecimal:return this.emitNumericEntity(0,2);case En.NumericHex:return this.emitNumericEntity(0,3);case En.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case En.EntityStart:return 0}}}function $A(e,t,n,r){const a=(t&ha.BRANCH_LENGTH)>>7,o=t&ha.JUMP_TABLE;if(a===0)return o!==0&&r===o?n:-1;if(o){const d=r-o;return d<0||d>=a?-1:e[n+d]-1}let l=n,c=l+a-1;for(;l<=c;){const d=l+c>>>1,h=e[d];if(h<r)l=d+1;else if(h>r)c=d-1;else return e[d+a]}return-1}var ce;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(ce||(ce={}));var Ga;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Ga||(Ga={}));var Sr;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Sr||(Sr={}));var te;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(te||(te={}));var y;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(y||(y={}));const VA=new Map([[te.A,y.A],[te.ADDRESS,y.ADDRESS],[te.ANNOTATION_XML,y.ANNOTATION_XML],[te.APPLET,y.APPLET],[te.AREA,y.AREA],[te.ARTICLE,y.ARTICLE],[te.ASIDE,y.ASIDE],[te.B,y.B],[te.BASE,y.BASE],[te.BASEFONT,y.BASEFONT],[te.BGSOUND,y.BGSOUND],[te.BIG,y.BIG],[te.BLOCKQUOTE,y.BLOCKQUOTE],[te.BODY,y.BODY],[te.BR,y.BR],[te.BUTTON,y.BUTTON],[te.CAPTION,y.CAPTION],[te.CENTER,y.CENTER],[te.CODE,y.CODE],[te.COL,y.COL],[te.COLGROUP,y.COLGROUP],[te.DD,y.DD],[te.DESC,y.DESC],[te.DETAILS,y.DETAILS],[te.DIALOG,y.DIALOG],[te.DIR,y.DIR],[te.DIV,y.DIV],[te.DL,y.DL],[te.DT,y.DT],[te.EM,y.EM],[te.EMBED,y.EMBED],[te.FIELDSET,y.FIELDSET],[te.FIGCAPTION,y.FIGCAPTION],[te.FIGURE,y.FIGURE],[te.FONT,y.FONT],[te.FOOTER,y.FOOTER],[te.FOREIGN_OBJECT,y.FOREIGN_OBJECT],[te.FORM,y.FORM],[te.FRAME,y.FRAME],[te.FRAMESET,y.FRAMESET],[te.H1,y.H1],[te.H2,y.H2],[te.H3,y.H3],[te.H4,y.H4],[te.H5,y.H5],[te.H6,y.H6],[te.HEAD,y.HEAD],[te.HEADER,y.HEADER],[te.HGROUP,y.HGROUP],[te.HR,y.HR],[te.HTML,y.HTML],[te.I,y.I],[te.IMG,y.IMG],[te.IMAGE,y.IMAGE],[te.INPUT,y.INPUT],[te.IFRAME,y.IFRAME],[te.KEYGEN,y.KEYGEN],[te.LABEL,y.LABEL],[te.LI,y.LI],[te.LINK,y.LINK],[te.LISTING,y.LISTING],[te.MAIN,y.MAIN],[te.MALIGNMARK,y.MALIGNMARK],[te.MARQUEE,y.MARQUEE],[te.MATH,y.MATH],[te.MENU,y.MENU],[te.META,y.META],[te.MGLYPH,y.MGLYPH],[te.MI,y.MI],[te.MO,y.MO],[te.MN,y.MN],[te.MS,y.MS],[te.MTEXT,y.MTEXT],[te.NAV,y.NAV],[te.NOBR,y.NOBR],[te.NOFRAMES,y.NOFRAMES],[te.NOEMBED,y.NOEMBED],[te.NOSCRIPT,y.NOSCRIPT],[te.OBJECT,y.OBJECT],[te.OL,y.OL],[te.OPTGROUP,y.OPTGROUP],[te.OPTION,y.OPTION],[te.P,y.P],[te.PARAM,y.PARAM],[te.PLAINTEXT,y.PLAINTEXT],[te.PRE,y.PRE],[te.RB,y.RB],[te.RP,y.RP],[te.RT,y.RT],[te.RTC,y.RTC],[te.RUBY,y.RUBY],[te.S,y.S],[te.SCRIPT,y.SCRIPT],[te.SEARCH,y.SEARCH],[te.SECTION,y.SECTION],[te.SELECT,y.SELECT],[te.SOURCE,y.SOURCE],[te.SMALL,y.SMALL],[te.SPAN,y.SPAN],[te.STRIKE,y.STRIKE],[te.STRONG,y.STRONG],[te.STYLE,y.STYLE],[te.SUB,y.SUB],[te.SUMMARY,y.SUMMARY],[te.SUP,y.SUP],[te.TABLE,y.TABLE],[te.TBODY,y.TBODY],[te.TEMPLATE,y.TEMPLATE],[te.TEXTAREA,y.TEXTAREA],[te.TFOOT,y.TFOOT],[te.TD,y.TD],[te.TH,y.TH],[te.THEAD,y.THEAD],[te.TITLE,y.TITLE],[te.TR,y.TR],[te.TRACK,y.TRACK],[te.TT,y.TT],[te.U,y.U],[te.UL,y.UL],[te.SVG,y.SVG],[te.VAR,y.VAR],[te.WBR,y.WBR],[te.XMP,y.XMP]]);function yo(e){var t;return(t=VA.get(e))!==null&&t!==void 0?t:y.UNKNOWN}const he=y,QA={[ce.HTML]:new Set([he.ADDRESS,he.APPLET,he.AREA,he.ARTICLE,he.ASIDE,he.BASE,he.BASEFONT,he.BGSOUND,he.BLOCKQUOTE,he.BODY,he.BR,he.BUTTON,he.CAPTION,he.CENTER,he.COL,he.COLGROUP,he.DD,he.DETAILS,he.DIR,he.DIV,he.DL,he.DT,he.EMBED,he.FIELDSET,he.FIGCAPTION,he.FIGURE,he.FOOTER,he.FORM,he.FRAME,he.FRAMESET,he.H1,he.H2,he.H3,he.H4,he.H5,he.H6,he.HEAD,he.HEADER,he.HGROUP,he.HR,he.HTML,he.IFRAME,he.IMG,he.INPUT,he.LI,he.LINK,he.LISTING,he.MAIN,he.MARQUEE,he.MENU,he.META,he.NAV,he.NOEMBED,he.NOFRAMES,he.NOSCRIPT,he.OBJECT,he.OL,he.P,he.PARAM,he.PLAINTEXT,he.PRE,he.SCRIPT,he.SECTION,he.SELECT,he.SOURCE,he.STYLE,he.SUMMARY,he.TABLE,he.TBODY,he.TD,he.TEMPLATE,he.TEXTAREA,he.TFOOT,he.TH,he.THEAD,he.TITLE,he.TR,he.TRACK,he.UL,he.WBR,he.XMP]),[ce.MATHML]:new Set([he.MI,he.MO,he.MN,he.MS,he.MTEXT,he.ANNOTATION_XML]),[ce.SVG]:new Set([he.TITLE,he.FOREIGN_OBJECT,he.DESC]),[ce.XLINK]:new Set,[ce.XML]:new Set,[ce.XMLNS]:new Set},h0=new Set([he.H1,he.H2,he.H3,he.H4,he.H5,he.H6]);te.STYLE,te.SCRIPT,te.XMP,te.IFRAME,te.NOEMBED,te.NOFRAMES,te.PLAINTEXT;var U;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(U||(U={}));const Jt={DATA:U.DATA,RCDATA:U.RCDATA,RAWTEXT:U.RAWTEXT,SCRIPT_DATA:U.SCRIPT_DATA,PLAINTEXT:U.PLAINTEXT,CDATA_SECTION:U.CDATA_SECTION};function GA(e){return e>=B.DIGIT_0&&e<=B.DIGIT_9}function Eu(e){return e>=B.LATIN_CAPITAL_A&&e<=B.LATIN_CAPITAL_Z}function XA(e){return e>=B.LATIN_SMALL_A&&e<=B.LATIN_SMALL_Z}function ea(e){return XA(e)||Eu(e)}function Ky(e){return ea(e)||GA(e)}function bc(e){return e+32}function T2(e){return e===B.SPACE||e===B.LINE_FEED||e===B.TABULATION||e===B.FORM_FEED}function Jy(e){return T2(e)||e===B.SOLIDUS||e===B.GREATER_THAN_SIGN}function KA(e){return e===B.NULL?ie.nullCharacterReference:e>1114111?ie.characterReferenceOutsideUnicodeRange:y2(e)?ie.surrogateCharacterReference:E2(e)?ie.noncharacterCharacterReference:b2(e)||e===B.CARRIAGE_RETURN?ie.controlCharacterReference:null}class JA{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=U.DATA,this.returnState=U.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new FA(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new qA(jA,(r,a)=>{this.preprocessor.pos=this.entityStartPos+a-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(ie.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(ie.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const a=KA(r);a&&this._err(a,1)}}:void 0)}_err(t,n=0){var r,a;(a=(r=this.handler).onParseError)===null||a===void 0||a.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r==null||r()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),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(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:et.START_TAG,tagName:"",tagID:y.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:et.END_TAG,tagName:"",tagID:y.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:et.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:et.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const r=this.currentToken;if(x2(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const a=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);a[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(ie.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=yo(t.tagName),t.type===et.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(ie.endTagWithAttributes),t.selfClosing&&this._err(ie.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case et.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case et.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case et.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:et.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=T2(t)?et.WHITESPACE_CHARACTER:t===B.NULL?et.NULL_CHARACTER:et.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(et.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=U.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?ws.Attribute:ws.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===U.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===U.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===U.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case U.DATA:{this._stateData(t);break}case U.RCDATA:{this._stateRcdata(t);break}case U.RAWTEXT:{this._stateRawtext(t);break}case U.SCRIPT_DATA:{this._stateScriptData(t);break}case U.PLAINTEXT:{this._statePlaintext(t);break}case U.TAG_OPEN:{this._stateTagOpen(t);break}case U.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case U.TAG_NAME:{this._stateTagName(t);break}case U.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case U.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case U.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case U.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case U.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case U.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case U.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case U.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case U.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case U.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case U.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case U.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case U.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case U.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case U.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case U.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case U.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case U.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case U.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case U.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case U.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case U.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case U.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case U.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case U.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case U.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case U.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case U.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case U.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case U.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case U.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case U.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case U.BOGUS_COMMENT:{this._stateBogusComment(t);break}case U.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case U.COMMENT_START:{this._stateCommentStart(t);break}case U.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case U.COMMENT:{this._stateComment(t);break}case U.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case U.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case U.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case U.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case U.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case U.COMMENT_END:{this._stateCommentEnd(t);break}case U.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case U.DOCTYPE:{this._stateDoctype(t);break}case U.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case U.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case U.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case U.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case U.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case U.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case U.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case U.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case U.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case U.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case U.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case U.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case U.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case U.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case U.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case U.CDATA_SECTION:{this._stateCdataSection(t);break}case U.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case U.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case U.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case U.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case B.LESS_THAN_SIGN:{this.state=U.TAG_OPEN;break}case B.AMPERSAND:{this._startCharacterReference();break}case B.NULL:{this._err(ie.unexpectedNullCharacter),this._emitCodePoint(t);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case B.AMPERSAND:{this._startCharacterReference();break}case B.LESS_THAN_SIGN:{this.state=U.RCDATA_LESS_THAN_SIGN;break}case B.NULL:{this._err(ie.unexpectedNullCharacter),this._emitChars(Mt);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case B.LESS_THAN_SIGN:{this.state=U.RAWTEXT_LESS_THAN_SIGN;break}case B.NULL:{this._err(ie.unexpectedNullCharacter),this._emitChars(Mt);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case B.LESS_THAN_SIGN:{this.state=U.SCRIPT_DATA_LESS_THAN_SIGN;break}case B.NULL:{this._err(ie.unexpectedNullCharacter),this._emitChars(Mt);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case B.NULL:{this._err(ie.unexpectedNullCharacter),this._emitChars(Mt);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(ea(t))this._createStartTagToken(),this.state=U.TAG_NAME,this._stateTagName(t);else switch(t){case B.EXCLAMATION_MARK:{this.state=U.MARKUP_DECLARATION_OPEN;break}case B.SOLIDUS:{this.state=U.END_TAG_OPEN;break}case B.QUESTION_MARK:{this._err(ie.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=U.BOGUS_COMMENT,this._stateBogusComment(t);break}case B.EOF:{this._err(ie.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(ie.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=U.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(ea(t))this._createEndTagToken(),this.state=U.TAG_NAME,this._stateTagName(t);else switch(t){case B.GREATER_THAN_SIGN:{this._err(ie.missingEndTagName),this.state=U.DATA;break}case B.EOF:{this._err(ie.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(ie.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=U.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this.state=U.BEFORE_ATTRIBUTE_NAME;break}case B.SOLIDUS:{this.state=U.SELF_CLOSING_START_TAG;break}case B.GREATER_THAN_SIGN:{this.state=U.DATA,this.emitCurrentTagToken();break}case B.NULL:{this._err(ie.unexpectedNullCharacter),n.tagName+=Mt;break}case B.EOF:{this._err(ie.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Eu(t)?bc(t):t)}}_stateRcdataLessThanSign(t){t===B.SOLIDUS?this.state=U.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=U.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){ea(t)?(this.state=U.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=U.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){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 B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=U.BEFORE_ATTRIBUTE_NAME,!1;case B.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=U.SELF_CLOSING_START_TAG,!1;case B.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=U.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=U.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===B.SOLIDUS?this.state=U.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=U.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){ea(t)?(this.state=U.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=U.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=U.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case B.SOLIDUS:{this.state=U.SCRIPT_DATA_END_TAG_OPEN;break}case B.EXCLAMATION_MARK:{this.state=U.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=U.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){ea(t)?(this.state=U.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=U.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=U.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===B.HYPHEN_MINUS?(this.state=U.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=U.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===B.HYPHEN_MINUS?(this.state=U.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=U.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case B.HYPHEN_MINUS:{this.state=U.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=U.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case B.NULL:{this._err(ie.unexpectedNullCharacter),this._emitChars(Mt);break}case B.EOF:{this._err(ie.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case B.HYPHEN_MINUS:{this.state=U.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=U.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case B.NULL:{this._err(ie.unexpectedNullCharacter),this.state=U.SCRIPT_DATA_ESCAPED,this._emitChars(Mt);break}case B.EOF:{this._err(ie.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=U.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case B.HYPHEN_MINUS:{this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=U.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case B.GREATER_THAN_SIGN:{this.state=U.SCRIPT_DATA,this._emitChars(">");break}case B.NULL:{this._err(ie.unexpectedNullCharacter),this.state=U.SCRIPT_DATA_ESCAPED,this._emitChars(Mt);break}case B.EOF:{this._err(ie.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=U.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===B.SOLIDUS?this.state=U.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:ea(t)?(this._emitChars("<"),this.state=U.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=U.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){ea(t)?(this.state=U.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=U.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=U.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(Gn.SCRIPT,!1)&&Jy(this.preprocessor.peek(Gn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Gn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=U.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case B.HYPHEN_MINUS:{this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case B.NULL:{this._err(ie.unexpectedNullCharacter),this._emitChars(Mt);break}case B.EOF:{this._err(ie.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case B.HYPHEN_MINUS:{this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case B.NULL:{this._err(ie.unexpectedNullCharacter),this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Mt);break}case B.EOF:{this._err(ie.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case B.HYPHEN_MINUS:{this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case B.GREATER_THAN_SIGN:{this.state=U.SCRIPT_DATA,this._emitChars(">");break}case B.NULL:{this._err(ie.unexpectedNullCharacter),this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Mt);break}case B.EOF:{this._err(ie.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===B.SOLIDUS?(this.state=U.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Gn.SCRIPT,!1)&&Jy(this.preprocessor.peek(Gn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Gn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=U.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.SOLIDUS:case B.GREATER_THAN_SIGN:case B.EOF:{this.state=U.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case B.EQUALS_SIGN:{this._err(ie.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=U.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=U.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:case B.SOLIDUS:case B.GREATER_THAN_SIGN:case B.EOF:{this._leaveAttrName(),this.state=U.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case B.EQUALS_SIGN:{this._leaveAttrName(),this.state=U.BEFORE_ATTRIBUTE_VALUE;break}case B.QUOTATION_MARK:case B.APOSTROPHE:case B.LESS_THAN_SIGN:{this._err(ie.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case B.NULL:{this._err(ie.unexpectedNullCharacter),this.currentAttr.name+=Mt;break}default:this.currentAttr.name+=String.fromCodePoint(Eu(t)?bc(t):t)}}_stateAfterAttributeName(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.SOLIDUS:{this.state=U.SELF_CLOSING_START_TAG;break}case B.EQUALS_SIGN:{this.state=U.BEFORE_ATTRIBUTE_VALUE;break}case B.GREATER_THAN_SIGN:{this.state=U.DATA,this.emitCurrentTagToken();break}case B.EOF:{this._err(ie.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=U.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.QUOTATION_MARK:{this.state=U.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case B.APOSTROPHE:{this.state=U.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case B.GREATER_THAN_SIGN:{this._err(ie.missingAttributeValue),this.state=U.DATA,this.emitCurrentTagToken();break}default:this.state=U.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case B.QUOTATION_MARK:{this.state=U.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case B.AMPERSAND:{this._startCharacterReference();break}case B.NULL:{this._err(ie.unexpectedNullCharacter),this.currentAttr.value+=Mt;break}case B.EOF:{this._err(ie.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case B.APOSTROPHE:{this.state=U.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case B.AMPERSAND:{this._startCharacterReference();break}case B.NULL:{this._err(ie.unexpectedNullCharacter),this.currentAttr.value+=Mt;break}case B.EOF:{this._err(ie.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this._leaveAttrValue(),this.state=U.BEFORE_ATTRIBUTE_NAME;break}case B.AMPERSAND:{this._startCharacterReference();break}case B.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=U.DATA,this.emitCurrentTagToken();break}case B.NULL:{this._err(ie.unexpectedNullCharacter),this.currentAttr.value+=Mt;break}case B.QUOTATION_MARK:case B.APOSTROPHE:case B.LESS_THAN_SIGN:case B.EQUALS_SIGN:case B.GRAVE_ACCENT:{this._err(ie.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case B.EOF:{this._err(ie.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this._leaveAttrValue(),this.state=U.BEFORE_ATTRIBUTE_NAME;break}case B.SOLIDUS:{this._leaveAttrValue(),this.state=U.SELF_CLOSING_START_TAG;break}case B.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=U.DATA,this.emitCurrentTagToken();break}case B.EOF:{this._err(ie.eofInTag),this._emitEOFToken();break}default:this._err(ie.missingWhitespaceBetweenAttributes),this.state=U.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case B.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=U.DATA,this.emitCurrentTagToken();break}case B.EOF:{this._err(ie.eofInTag),this._emitEOFToken();break}default:this._err(ie.unexpectedSolidusInTag),this.state=U.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case B.GREATER_THAN_SIGN:{this.state=U.DATA,this.emitCurrentComment(n);break}case B.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case B.NULL:{this._err(ie.unexpectedNullCharacter),n.data+=Mt;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Gn.DASH_DASH,!0)?(this._createCommentToken(Gn.DASH_DASH.length+1),this.state=U.COMMENT_START):this._consumeSequenceIfMatch(Gn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Gn.DOCTYPE.length+1),this.state=U.DOCTYPE):this._consumeSequenceIfMatch(Gn.CDATA_START,!0)?this.inForeignNode?this.state=U.CDATA_SECTION:(this._err(ie.cdataInHtmlContent),this._createCommentToken(Gn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=U.BOGUS_COMMENT):this._ensureHibernation()||(this._err(ie.incorrectlyOpenedComment),this._createCommentToken(2),this.state=U.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case B.HYPHEN_MINUS:{this.state=U.COMMENT_START_DASH;break}case B.GREATER_THAN_SIGN:{this._err(ie.abruptClosingOfEmptyComment),this.state=U.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=U.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case B.HYPHEN_MINUS:{this.state=U.COMMENT_END;break}case B.GREATER_THAN_SIGN:{this._err(ie.abruptClosingOfEmptyComment),this.state=U.DATA,this.emitCurrentComment(n);break}case B.EOF:{this._err(ie.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=U.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case B.HYPHEN_MINUS:{this.state=U.COMMENT_END_DASH;break}case B.LESS_THAN_SIGN:{n.data+="<",this.state=U.COMMENT_LESS_THAN_SIGN;break}case B.NULL:{this._err(ie.unexpectedNullCharacter),n.data+=Mt;break}case B.EOF:{this._err(ie.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case B.EXCLAMATION_MARK:{n.data+="!",this.state=U.COMMENT_LESS_THAN_SIGN_BANG;break}case B.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=U.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===B.HYPHEN_MINUS?this.state=U.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=U.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===B.HYPHEN_MINUS?this.state=U.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=U.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==B.GREATER_THAN_SIGN&&t!==B.EOF&&this._err(ie.nestedComment),this.state=U.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case B.HYPHEN_MINUS:{this.state=U.COMMENT_END;break}case B.EOF:{this._err(ie.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=U.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case B.GREATER_THAN_SIGN:{this.state=U.DATA,this.emitCurrentComment(n);break}case B.EXCLAMATION_MARK:{this.state=U.COMMENT_END_BANG;break}case B.HYPHEN_MINUS:{n.data+="-";break}case B.EOF:{this._err(ie.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=U.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case B.HYPHEN_MINUS:{n.data+="--!",this.state=U.COMMENT_END_DASH;break}case B.GREATER_THAN_SIGN:{this._err(ie.incorrectlyClosedComment),this.state=U.DATA,this.emitCurrentComment(n);break}case B.EOF:{this._err(ie.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=U.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this.state=U.BEFORE_DOCTYPE_NAME;break}case B.GREATER_THAN_SIGN:{this.state=U.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case B.EOF:{this._err(ie.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ie.missingWhitespaceBeforeDoctypeName),this.state=U.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(Eu(t))this._createDoctypeToken(String.fromCharCode(bc(t))),this.state=U.DOCTYPE_NAME;else switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.NULL:{this._err(ie.unexpectedNullCharacter),this._createDoctypeToken(Mt),this.state=U.DOCTYPE_NAME;break}case B.GREATER_THAN_SIGN:{this._err(ie.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=U.DATA;break}case B.EOF:{this._err(ie.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=U.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this.state=U.AFTER_DOCTYPE_NAME;break}case B.GREATER_THAN_SIGN:{this.state=U.DATA,this.emitCurrentDoctype(n);break}case B.NULL:{this._err(ie.unexpectedNullCharacter),n.name+=Mt;break}case B.EOF:{this._err(ie.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Eu(t)?bc(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.GREATER_THAN_SIGN:{this.state=U.DATA,this.emitCurrentDoctype(n);break}case B.EOF:{this._err(ie.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Gn.PUBLIC,!1)?this.state=U.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Gn.SYSTEM,!1)?this.state=U.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(ie.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this.state=U.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case B.QUOTATION_MARK:{this._err(ie.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=U.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{this._err(ie.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=U.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case B.GREATER_THAN_SIGN:{this._err(ie.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=U.DATA,this.emitCurrentDoctype(n);break}case B.EOF:{this._err(ie.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ie.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.QUOTATION_MARK:{n.publicId="",this.state=U.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{n.publicId="",this.state=U.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case B.GREATER_THAN_SIGN:{this._err(ie.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=U.DATA,this.emitCurrentDoctype(n);break}case B.EOF:{this._err(ie.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ie.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case B.QUOTATION_MARK:{this.state=U.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case B.NULL:{this._err(ie.unexpectedNullCharacter),n.publicId+=Mt;break}case B.GREATER_THAN_SIGN:{this._err(ie.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=U.DATA;break}case B.EOF:{this._err(ie.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case B.APOSTROPHE:{this.state=U.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case B.NULL:{this._err(ie.unexpectedNullCharacter),n.publicId+=Mt;break}case B.GREATER_THAN_SIGN:{this._err(ie.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=U.DATA;break}case B.EOF:{this._err(ie.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this.state=U.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case B.GREATER_THAN_SIGN:{this.state=U.DATA,this.emitCurrentDoctype(n);break}case B.QUOTATION_MARK:{this._err(ie.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{this._err(ie.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case B.EOF:{this._err(ie.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ie.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=U.DATA;break}case B.QUOTATION_MARK:{n.systemId="",this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{n.systemId="",this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case B.EOF:{this._err(ie.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ie.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this.state=U.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case B.QUOTATION_MARK:{this._err(ie.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{this._err(ie.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case B.GREATER_THAN_SIGN:{this._err(ie.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=U.DATA,this.emitCurrentDoctype(n);break}case B.EOF:{this._err(ie.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ie.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.QUOTATION_MARK:{n.systemId="",this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{n.systemId="",this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case B.GREATER_THAN_SIGN:{this._err(ie.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=U.DATA,this.emitCurrentDoctype(n);break}case B.EOF:{this._err(ie.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ie.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case B.QUOTATION_MARK:{this.state=U.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case B.NULL:{this._err(ie.unexpectedNullCharacter),n.systemId+=Mt;break}case B.GREATER_THAN_SIGN:{this._err(ie.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=U.DATA;break}case B.EOF:{this._err(ie.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case B.APOSTROPHE:{this.state=U.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case B.NULL:{this._err(ie.unexpectedNullCharacter),n.systemId+=Mt;break}case B.GREATER_THAN_SIGN:{this._err(ie.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=U.DATA;break}case B.EOF:{this._err(ie.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=U.DATA;break}case B.EOF:{this._err(ie.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ie.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case B.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=U.DATA;break}case B.NULL:{this._err(ie.unexpectedNullCharacter);break}case B.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case B.RIGHT_SQUARE_BRACKET:{this.state=U.CDATA_SECTION_BRACKET;break}case B.EOF:{this._err(ie.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===B.RIGHT_SQUARE_BRACKET?this.state=U.CDATA_SECTION_END:(this._emitChars("]"),this.state=U.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case B.GREATER_THAN_SIGN:{this.state=U.DATA;break}case B.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=U.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(B.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&Ky(this.preprocessor.peek(1))?U.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){Ky(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===B.SEMICOLON&&this._err(ie.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const v2=new Set([y.DD,y.DT,y.LI,y.OPTGROUP,y.OPTION,y.P,y.RB,y.RP,y.RT,y.RTC]),Zy=new Set([...v2,y.CAPTION,y.COLGROUP,y.TBODY,y.TD,y.TFOOT,y.TH,y.THEAD,y.TR]),Pc=new Set([y.APPLET,y.CAPTION,y.HTML,y.MARQUEE,y.OBJECT,y.TABLE,y.TD,y.TEMPLATE,y.TH]),ZA=new Set([...Pc,y.OL,y.UL]),eI=new Set([...Pc,y.BUTTON]),eb=new Set([y.ANNOTATION_XML,y.MI,y.MN,y.MO,y.MS,y.MTEXT]),tb=new Set([y.DESC,y.FOREIGN_OBJECT,y.TITLE]),tI=new Set([y.TR,y.TEMPLATE,y.HTML]),nI=new Set([y.TBODY,y.TFOOT,y.THEAD,y.TEMPLATE,y.HTML]),rI=new Set([y.TABLE,y.TEMPLATE,y.HTML]),sI=new Set([y.TD,y.TH]);class aI{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=y.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===y.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===ce.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const a=this._indexOf(t)+1;this.items.splice(a,0,n),this.tagIDs.splice(a,0,r),this.stackTop++,a===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,a===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==ce.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(Math.max(n,0))}popUntilPopped(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(h0,ce.HTML)}popUntilTableCellPopped(){this.popUntilPopped(sI,ce.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(rI,ce.HTML)}clearBackToTableBodyContext(){this.clearBackTo(nI,ce.HTML)}clearBackToTableRowContext(){this.clearBackTo(tI,ce.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===y.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===y.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const a=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case ce.HTML:{if(a===t)return!0;if(n.has(a))return!1;break}case ce.SVG:{if(tb.has(a))return!1;break}case ce.MATHML:{if(eb.has(a))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Pc)}hasInListItemScope(t){return this.hasInDynamicScope(t,ZA)}hasInButtonScope(t){return this.hasInDynamicScope(t,eI)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case ce.HTML:{if(h0.has(n))return!0;if(Pc.has(n))return!1;break}case ce.SVG:{if(tb.has(n))return!1;break}case ce.MATHML:{if(eb.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ce.HTML)switch(this.tagIDs[n]){case t:return!0;case y.TABLE:case y.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===ce.HTML)switch(this.tagIDs[t]){case y.TBODY:case y.THEAD:case y.TFOOT:return!0;case y.TABLE:case y.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ce.HTML)switch(this.tagIDs[n]){case t:return!0;case y.OPTION:case y.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&v2.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Zy.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&Zy.has(this.currentTagId);)this.pop()}}const Ch=3;var Zr;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Zr||(Zr={}));const nb={type:Zr.Marker};class iI{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],a=n.length,o=this.treeAdapter.getTagName(t),l=this.treeAdapter.getNamespaceURI(t);for(let c=0;c<this.entries.length;c++){const d=this.entries[c];if(d.type===Zr.Marker)break;const{element:h}=d;if(this.treeAdapter.getTagName(h)===o&&this.treeAdapter.getNamespaceURI(h)===l){const m=this.treeAdapter.getAttrList(h);m.length===a&&r.push({idx:c,attrs:m})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<Ch)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<Ch)return;const a=new Map(n.map(l=>[l.name,l.value]));let o=0;for(let l=0;l<r.length;l++){const c=r[l];c.attrs.every(d=>a.get(d.name)===d.value)&&(o+=1,o>=Ch&&this.entries.splice(c.idx,1))}}insertMarker(){this.entries.unshift(nb)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Zr.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Zr.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(nb);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===Zr.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===Zr.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Zr.Element&&n.element===t)}}const ta={createDocument(){return{nodeName:"#document",mode:Sr.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const a=e.childNodes.find(o=>o.nodeName==="#documentType");if(a)a.name=t,a.publicId=n,a.systemId=r;else{const o={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};ta.appendChild(e,o)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(ta.isTextNode(n)){n.value+=t;return}}ta.appendChild(e,ta.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&ta.isTextNode(r)?r.value+=t:ta.insertBefore(e,ta.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},w2="html",oI="about:legacy-compat",uI="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",S2=["+//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//"],lI=[...S2,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],cI=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),_2=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],dI=[..._2,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function rb(e,t){return t.some(n=>e.startsWith(n))}function fI(e){return e.name===w2&&e.publicId===null&&(e.systemId===null||e.systemId===oI)}function hI(e){if(e.name!==w2)return Sr.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===uI)return Sr.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),cI.has(n))return Sr.QUIRKS;let r=t===null?lI:S2;if(rb(n,r))return Sr.QUIRKS;if(r=t===null?_2:dI,rb(n,r))return Sr.LIMITED_QUIRKS}return Sr.NO_QUIRKS}const sb={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},pI="definitionurl",mI="definitionURL",gI=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(e=>[e.toLowerCase(),e])),yI=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:ce.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:ce.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:ce.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:ce.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:ce.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:ce.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:ce.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:ce.XML}],["xml:space",{prefix:"xml",name:"space",namespace:ce.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:ce.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:ce.XMLNS}]]),bI=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(e=>[e.toLowerCase(),e])),EI=new Set([y.B,y.BIG,y.BLOCKQUOTE,y.BODY,y.BR,y.CENTER,y.CODE,y.DD,y.DIV,y.DL,y.DT,y.EM,y.EMBED,y.H1,y.H2,y.H3,y.H4,y.H5,y.H6,y.HEAD,y.HR,y.I,y.IMG,y.LI,y.LISTING,y.MENU,y.META,y.NOBR,y.OL,y.P,y.PRE,y.RUBY,y.S,y.SMALL,y.SPAN,y.STRONG,y.STRIKE,y.SUB,y.SUP,y.TABLE,y.TT,y.U,y.UL,y.VAR]);function xI(e){const t=e.tagID;return t===y.FONT&&e.attrs.some(({name:r})=>r===Ga.COLOR||r===Ga.SIZE||r===Ga.FACE)||EI.has(t)}function C2(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===pI){e.attrs[t].name=mI;break}}function k2(e){for(let t=0;t<e.attrs.length;t++){const n=gI.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function pp(e){for(let t=0;t<e.attrs.length;t++){const n=yI.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function TI(e){const t=bI.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=yo(e.tagName))}function vI(e,t){return t===ce.MATHML&&(e===y.MI||e===y.MO||e===y.MN||e===y.MS||e===y.MTEXT)}function wI(e,t,n){if(t===ce.MATHML&&e===y.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===Ga.ENCODING){const a=n[r].value.toLowerCase();return a===sb.TEXT_HTML||a===sb.APPLICATION_XML}}return t===ce.SVG&&(e===y.FOREIGN_OBJECT||e===y.DESC||e===y.TITLE)}function SI(e,t,n,r){return(!r||r===ce.HTML)&&wI(e,t,n)||(!r||r===ce.MATHML)&&vI(e,t)}const _I="hidden",CI=8,kI=3;var q;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(q||(q={}));const NI={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},N2=new Set([y.TABLE,y.TBODY,y.TFOOT,y.THEAD,y.TR]),ab={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:ta,onParseError:null};class ib{constructor(t,n,r=null,a=null){this.fragmentContext=r,this.scriptHandler=a,this.currentToken=null,this.stopped=!1,this.insertionMode=q.INITIAL,this.originalInsertionMode=q.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={...ab,...t},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 JA(this.options,this),this.activeFormattingElements=new iI(this.treeAdapter),this.fragmentContextID=r?yo(this.treeAdapter.getTagName(r)):y.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new aI(this.document,this.treeAdapter,this)}static parse(t,n){const r=new this(n);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,n){const r={...ab,...n};t??(t=r.treeAdapter.createElement(te.TEMPLATE,ce.HTML,[]));const a=r.treeAdapter.createElement("documentmock",ce.HTML,[]),o=new this(r,a,t);return o.fragmentContextID===y.TEMPLATE&&o.tmplInsertionModeStack.unshift(q.IN_TEMPLATE),o._initTokenizerForFragmentParsing(),o._insertFakeRootElement(),o._resetInsertionMode(),o._findFormInFragmentContext(),o}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var a;if(!this.onParseError)return;const o=(a=t.location)!==null&&a!==void 0?a:NI,l={code:n,startLine:o.startLine,startCol:o.startCol,startOffset:o.startOffset,endLine:r?o.startLine:o.endLine,endCol:r?o.startCol:o.endCol,endOffset:r?o.startOffset:o.endOffset};this.onParseError(l)}onItemPush(t,n,r){var a,o;(o=(a=this.treeAdapter).onItemPush)===null||o===void 0||o.call(a,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,a;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(a=(r=this.treeAdapter).onItemPop)===null||a===void 0||a.call(r,t,this.openElements.current),n){let o,l;this.openElements.stackTop===0&&this.fragmentContext?(o=this.fragmentContext,l=this.fragmentContextID):{current:o,currentTagId:l}=this.openElements,this._setContextModes(o,l)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===ce.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,ce.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=q.TEXT}switchToPlaintextParsing(){this.insertionMode=q.TEXT,this.originalInsertionMode=q.IN_BODY,this.tokenizer.state=Jt.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===te.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==ce.HTML))switch(this.fragmentContextID){case y.TITLE:case y.TEXTAREA:{this.tokenizer.state=Jt.RCDATA;break}case y.STYLE:case y.XMP:case y.IFRAME:case y.NOEMBED:case y.NOFRAMES:case y.NOSCRIPT:{this.tokenizer.state=Jt.RAWTEXT;break}case y.SCRIPT:{this.tokenizer.state=Jt.SCRIPT_DATA;break}case y.PLAINTEXT:{this.tokenizer.state=Jt.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",a=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,a),t.location){const l=this.treeAdapter.getChildNodes(this.document).find(c=>this.treeAdapter.isDocumentTypeNode(c));l&&this.treeAdapter.setNodeSourceCodeLocation(l,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,ce.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,ce.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(te.HTML,ce.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,y.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const a=this.treeAdapter.getChildNodes(n),o=r?a.lastIndexOf(r):a.length,l=a[o-1];if(this.treeAdapter.getNodeSourceCodeLocation(l)){const{endLine:d,endCol:h,endOffset:m}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(l,{endLine:d,endCol:h,endOffset:m})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(l,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,a=this.treeAdapter.getTagName(t),o=n.type===et.END_TAG&&a===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(t,o)}}shouldProcessStartTagTokenInForeignContent(t){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,t.tagID===y.SVG&&this.treeAdapter.getTagName(n)===te.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===ce.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===y.MGLYPH||t.tagID===y.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,ce.HTML)}_processToken(t){switch(t.type){case et.CHARACTER:{this.onCharacter(t);break}case et.NULL_CHARACTER:{this.onNullCharacter(t);break}case et.COMMENT:{this.onComment(t);break}case et.DOCTYPE:{this.onDoctype(t);break}case et.START_TAG:{this._processStartTag(t);break}case et.END_TAG:{this.onEndTag(t);break}case et.EOF:{this.onEof(t);break}case et.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const a=this.treeAdapter.getNamespaceURI(n),o=this.treeAdapter.getAttrList(n);return SI(t,a,o,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(a=>a.type===Zr.Marker||this.openElements.contains(a.element)),r=n===-1?t-1:n-1;for(let a=r;a>=0;a--){const o=this.activeFormattingElements.entries[a];this._insertElement(o.token,this.treeAdapter.getNamespaceURI(o.element)),o.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=q.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(y.P),this.openElements.popUntilTagNamePopped(y.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case y.TR:{this.insertionMode=q.IN_ROW;return}case y.TBODY:case y.THEAD:case y.TFOOT:{this.insertionMode=q.IN_TABLE_BODY;return}case y.CAPTION:{this.insertionMode=q.IN_CAPTION;return}case y.COLGROUP:{this.insertionMode=q.IN_COLUMN_GROUP;return}case y.TABLE:{this.insertionMode=q.IN_TABLE;return}case y.BODY:{this.insertionMode=q.IN_BODY;return}case y.FRAMESET:{this.insertionMode=q.IN_FRAMESET;return}case y.SELECT:{this._resetInsertionModeForSelect(t);return}case y.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case y.HTML:{this.insertionMode=this.headElement?q.AFTER_HEAD:q.BEFORE_HEAD;return}case y.TD:case y.TH:{if(t>0){this.insertionMode=q.IN_CELL;return}break}case y.HEAD:{if(t>0){this.insertionMode=q.IN_HEAD;return}break}}this.insertionMode=q.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===y.TEMPLATE)break;if(r===y.TABLE){this.insertionMode=q.IN_SELECT_IN_TABLE;return}}this.insertionMode=q.IN_SELECT}_isElementCausesFosterParenting(t){return N2.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case y.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===ce.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case y.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return QA[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){sL(this,t);return}switch(this.insertionMode){case q.INITIAL:{mu(this,t);break}case q.BEFORE_HTML:{wu(this,t);break}case q.BEFORE_HEAD:{Su(this,t);break}case q.IN_HEAD:{_u(this,t);break}case q.IN_HEAD_NO_SCRIPT:{Cu(this,t);break}case q.AFTER_HEAD:{ku(this,t);break}case q.IN_BODY:case q.IN_CAPTION:case q.IN_CELL:case q.IN_TEMPLATE:{D2(this,t);break}case q.TEXT:case q.IN_SELECT:case q.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case q.IN_TABLE:case q.IN_TABLE_BODY:case q.IN_ROW:{kh(this,t);break}case q.IN_TABLE_TEXT:{P2(this,t);break}case q.IN_COLUMN_GROUP:{Fc(this,t);break}case q.AFTER_BODY:{jc(this,t);break}case q.AFTER_AFTER_BODY:{Sc(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){rL(this,t);return}switch(this.insertionMode){case q.INITIAL:{mu(this,t);break}case q.BEFORE_HTML:{wu(this,t);break}case q.BEFORE_HEAD:{Su(this,t);break}case q.IN_HEAD:{_u(this,t);break}case q.IN_HEAD_NO_SCRIPT:{Cu(this,t);break}case q.AFTER_HEAD:{ku(this,t);break}case q.TEXT:{this._insertCharacters(t);break}case q.IN_TABLE:case q.IN_TABLE_BODY:case q.IN_ROW:{kh(this,t);break}case q.IN_COLUMN_GROUP:{Fc(this,t);break}case q.AFTER_BODY:{jc(this,t);break}case q.AFTER_AFTER_BODY:{Sc(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){p0(this,t);return}switch(this.insertionMode){case q.INITIAL:case q.BEFORE_HTML:case q.BEFORE_HEAD:case q.IN_HEAD:case q.IN_HEAD_NO_SCRIPT:case q.AFTER_HEAD:case q.IN_BODY:case q.IN_TABLE:case q.IN_CAPTION:case q.IN_COLUMN_GROUP:case q.IN_TABLE_BODY:case q.IN_ROW:case q.IN_CELL:case q.IN_SELECT:case q.IN_SELECT_IN_TABLE:case q.IN_TEMPLATE:case q.IN_FRAMESET:case q.AFTER_FRAMESET:{p0(this,t);break}case q.IN_TABLE_TEXT:{gu(this,t);break}case q.AFTER_BODY:{MI(this,t);break}case q.AFTER_AFTER_BODY:case q.AFTER_AFTER_FRAMESET:{PI(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case q.INITIAL:{FI(this,t);break}case q.BEFORE_HEAD:case q.IN_HEAD:case q.IN_HEAD_NO_SCRIPT:case q.AFTER_HEAD:{this._err(t,ie.misplacedDoctype);break}case q.IN_TABLE_TEXT:{gu(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,ie.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?aL(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case q.INITIAL:{mu(this,t);break}case q.BEFORE_HTML:{jI(this,t);break}case q.BEFORE_HEAD:{HI(this,t);break}case q.IN_HEAD:{Hr(this,t);break}case q.IN_HEAD_NO_SCRIPT:{WI(this,t);break}case q.AFTER_HEAD:{qI(this,t);break}case q.IN_BODY:{Mn(this,t);break}case q.IN_TABLE:{ao(this,t);break}case q.IN_TABLE_TEXT:{gu(this,t);break}case q.IN_CAPTION:{UR(this,t);break}case q.IN_COLUMN_GROUP:{yp(this,t);break}case q.IN_TABLE_BODY:{ld(this,t);break}case q.IN_ROW:{cd(this,t);break}case q.IN_CELL:{YR(this,t);break}case q.IN_SELECT:{B2(this,t);break}case q.IN_SELECT_IN_TABLE:{$R(this,t);break}case q.IN_TEMPLATE:{QR(this,t);break}case q.AFTER_BODY:{XR(this,t);break}case q.IN_FRAMESET:{KR(this,t);break}case q.AFTER_FRAMESET:{ZR(this,t);break}case q.AFTER_AFTER_BODY:{tL(this,t);break}case q.AFTER_AFTER_FRAMESET:{nL(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?iL(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case q.INITIAL:{mu(this,t);break}case q.BEFORE_HTML:{BI(this,t);break}case q.BEFORE_HEAD:{UI(this,t);break}case q.IN_HEAD:{zI(this,t);break}case q.IN_HEAD_NO_SCRIPT:{YI(this,t);break}case q.AFTER_HEAD:{$I(this,t);break}case q.IN_BODY:{ud(this,t);break}case q.TEXT:{AR(this,t);break}case q.IN_TABLE:{Ru(this,t);break}case q.IN_TABLE_TEXT:{gu(this,t);break}case q.IN_CAPTION:{zR(this,t);break}case q.IN_COLUMN_GROUP:{WR(this,t);break}case q.IN_TABLE_BODY:{m0(this,t);break}case q.IN_ROW:{j2(this,t);break}case q.IN_CELL:{qR(this,t);break}case q.IN_SELECT:{H2(this,t);break}case q.IN_SELECT_IN_TABLE:{VR(this,t);break}case q.IN_TEMPLATE:{GR(this,t);break}case q.AFTER_BODY:{z2(this,t);break}case q.IN_FRAMESET:{JR(this,t);break}case q.AFTER_FRAMESET:{eL(this,t);break}case q.AFTER_AFTER_BODY:{Sc(this,t);break}}}onEof(t){switch(this.insertionMode){case q.INITIAL:{mu(this,t);break}case q.BEFORE_HTML:{wu(this,t);break}case q.BEFORE_HEAD:{Su(this,t);break}case q.IN_HEAD:{_u(this,t);break}case q.IN_HEAD_NO_SCRIPT:{Cu(this,t);break}case q.AFTER_HEAD:{ku(this,t);break}case q.IN_BODY:case q.IN_TABLE:case q.IN_CAPTION:case q.IN_COLUMN_GROUP:case q.IN_TABLE_BODY:case q.IN_ROW:case q.IN_CELL:case q.IN_SELECT:case q.IN_SELECT_IN_TABLE:{L2(this,t);break}case q.TEXT:{IR(this,t);break}case q.IN_TABLE_TEXT:{gu(this,t);break}case q.IN_TEMPLATE:{U2(this,t);break}case q.AFTER_BODY:case q.IN_FRAMESET:case q.AFTER_FRAMESET:case q.AFTER_AFTER_BODY:case q.AFTER_AFTER_FRAMESET:{gp(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===B.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case q.IN_HEAD:case q.IN_HEAD_NO_SCRIPT:case q.AFTER_HEAD:case q.TEXT:case q.IN_COLUMN_GROUP:case q.IN_SELECT:case q.IN_SELECT_IN_TABLE:case q.IN_FRAMESET:case q.AFTER_FRAMESET:{this._insertCharacters(t);break}case q.IN_BODY:case q.IN_CAPTION:case q.IN_CELL:case q.IN_TEMPLATE:case q.AFTER_BODY:case q.AFTER_AFTER_BODY:case q.AFTER_AFTER_FRAMESET:{O2(this,t);break}case q.IN_TABLE:case q.IN_TABLE_BODY:case q.IN_ROW:{kh(this,t);break}case q.IN_TABLE_TEXT:{M2(this,t);break}}}}function OI(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):R2(e,t),n}function DI(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const a=e.openElements.items[r];if(a===t.element)break;e._isSpecialElement(a,e.openElements.tagIDs[r])&&(n=a)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function AI(e,t,n){let r=t,a=e.openElements.getCommonAncestor(t);for(let o=0,l=a;l!==n;o++,l=a){a=e.openElements.getCommonAncestor(l);const c=e.activeFormattingElements.getElementEntry(l),d=c&&o>=kI;!c||d?(d&&e.activeFormattingElements.removeEntry(c),e.openElements.remove(l)):(l=II(e,c),r===t&&(e.activeFormattingElements.bookmark=c),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(l,r),r=l)}return r}function II(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function RI(e,t,n){const r=e.treeAdapter.getTagName(t),a=yo(r);if(e._isElementCausesFosterParenting(a))e._fosterParentElement(n);else{const o=e.treeAdapter.getNamespaceURI(t);a===y.TEMPLATE&&o===ce.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function LI(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:a}=n,o=e.treeAdapter.createElement(a.tagName,r,a.attrs);e._adoptNodes(t,o),e.treeAdapter.appendChild(t,o),e.activeFormattingElements.insertElementAfterBookmark(o,a),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,o,a.tagID)}function mp(e,t){for(let n=0;n<CI;n++){const r=OI(e,t);if(!r)break;const a=DI(e,r);if(!a)break;e.activeFormattingElements.bookmark=r;const o=AI(e,a,r.element),l=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(o),l&&RI(e,l,o),LI(e,a,r)}}function p0(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function MI(e,t){e._appendCommentNode(t,e.openElements.items[0])}function PI(e,t){e._appendCommentNode(t,e.document)}function gp(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],a=e.treeAdapter.getNodeSourceCodeLocation(r);if(a&&!a.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const o=e.openElements.items[1],l=e.treeAdapter.getNodeSourceCodeLocation(o);l&&!l.endTag&&e._setEndLocation(o,t)}}}}function FI(e,t){e._setDocumentType(t);const n=t.forceQuirks?Sr.QUIRKS:hI(t);fI(t)||e._err(t,ie.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=q.BEFORE_HTML}function mu(e,t){e._err(t,ie.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Sr.QUIRKS),e.insertionMode=q.BEFORE_HTML,e._processToken(t)}function jI(e,t){t.tagID===y.HTML?(e._insertElement(t,ce.HTML),e.insertionMode=q.BEFORE_HEAD):wu(e,t)}function BI(e,t){const n=t.tagID;(n===y.HTML||n===y.HEAD||n===y.BODY||n===y.BR)&&wu(e,t)}function wu(e,t){e._insertFakeRootElement(),e.insertionMode=q.BEFORE_HEAD,e._processToken(t)}function HI(e,t){switch(t.tagID){case y.HTML:{Mn(e,t);break}case y.HEAD:{e._insertElement(t,ce.HTML),e.headElement=e.openElements.current,e.insertionMode=q.IN_HEAD;break}default:Su(e,t)}}function UI(e,t){const n=t.tagID;n===y.HEAD||n===y.BODY||n===y.HTML||n===y.BR?Su(e,t):e._err(t,ie.endTagWithoutMatchingOpenElement)}function Su(e,t){e._insertFakeElement(te.HEAD,y.HEAD),e.headElement=e.openElements.current,e.insertionMode=q.IN_HEAD,e._processToken(t)}function Hr(e,t){switch(t.tagID){case y.HTML:{Mn(e,t);break}case y.BASE:case y.BASEFONT:case y.BGSOUND:case y.LINK:case y.META:{e._appendElement(t,ce.HTML),t.ackSelfClosing=!0;break}case y.TITLE:{e._switchToTextParsing(t,Jt.RCDATA);break}case y.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Jt.RAWTEXT):(e._insertElement(t,ce.HTML),e.insertionMode=q.IN_HEAD_NO_SCRIPT);break}case y.NOFRAMES:case y.STYLE:{e._switchToTextParsing(t,Jt.RAWTEXT);break}case y.SCRIPT:{e._switchToTextParsing(t,Jt.SCRIPT_DATA);break}case y.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=q.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(q.IN_TEMPLATE);break}case y.HEAD:{e._err(t,ie.misplacedStartTagForHeadElement);break}default:_u(e,t)}}function zI(e,t){switch(t.tagID){case y.HEAD:{e.openElements.pop(),e.insertionMode=q.AFTER_HEAD;break}case y.BODY:case y.BR:case y.HTML:{_u(e,t);break}case y.TEMPLATE:{ii(e,t);break}default:e._err(t,ie.endTagWithoutMatchingOpenElement)}}function ii(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==y.TEMPLATE&&e._err(t,ie.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(y.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,ie.endTagWithoutMatchingOpenElement)}function _u(e,t){e.openElements.pop(),e.insertionMode=q.AFTER_HEAD,e._processToken(t)}function WI(e,t){switch(t.tagID){case y.HTML:{Mn(e,t);break}case y.BASEFONT:case y.BGSOUND:case y.HEAD:case y.LINK:case y.META:case y.NOFRAMES:case y.STYLE:{Hr(e,t);break}case y.NOSCRIPT:{e._err(t,ie.nestedNoscriptInHead);break}default:Cu(e,t)}}function YI(e,t){switch(t.tagID){case y.NOSCRIPT:{e.openElements.pop(),e.insertionMode=q.IN_HEAD;break}case y.BR:{Cu(e,t);break}default:e._err(t,ie.endTagWithoutMatchingOpenElement)}}function Cu(e,t){const n=t.type===et.EOF?ie.openElementsLeftAfterEof:ie.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=q.IN_HEAD,e._processToken(t)}function qI(e,t){switch(t.tagID){case y.HTML:{Mn(e,t);break}case y.BODY:{e._insertElement(t,ce.HTML),e.framesetOk=!1,e.insertionMode=q.IN_BODY;break}case y.FRAMESET:{e._insertElement(t,ce.HTML),e.insertionMode=q.IN_FRAMESET;break}case y.BASE:case y.BASEFONT:case y.BGSOUND:case y.LINK:case y.META:case y.NOFRAMES:case y.SCRIPT:case y.STYLE:case y.TEMPLATE:case y.TITLE:{e._err(t,ie.abandonedHeadElementChild),e.openElements.push(e.headElement,y.HEAD),Hr(e,t),e.openElements.remove(e.headElement);break}case y.HEAD:{e._err(t,ie.misplacedStartTagForHeadElement);break}default:ku(e,t)}}function $I(e,t){switch(t.tagID){case y.BODY:case y.HTML:case y.BR:{ku(e,t);break}case y.TEMPLATE:{ii(e,t);break}default:e._err(t,ie.endTagWithoutMatchingOpenElement)}}function ku(e,t){e._insertFakeElement(te.BODY,y.BODY),e.insertionMode=q.IN_BODY,od(e,t)}function od(e,t){switch(t.type){case et.CHARACTER:{D2(e,t);break}case et.WHITESPACE_CHARACTER:{O2(e,t);break}case et.COMMENT:{p0(e,t);break}case et.START_TAG:{Mn(e,t);break}case et.END_TAG:{ud(e,t);break}case et.EOF:{L2(e,t);break}}}function O2(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function D2(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function VI(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function QI(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function GI(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,ce.HTML),e.insertionMode=q.IN_FRAMESET)}function XI(e,t){e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._insertElement(t,ce.HTML)}function KI(e,t){e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&h0.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,ce.HTML)}function JI(e,t){e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._insertElement(t,ce.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function ZI(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._insertElement(t,ce.HTML),n||(e.formElement=e.openElements.current))}function eR(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const a=e.openElements.tagIDs[r];if(n===y.LI&&a===y.LI||(n===y.DD||n===y.DT)&&(a===y.DD||a===y.DT)){e.openElements.generateImpliedEndTagsWithExclusion(a),e.openElements.popUntilTagNamePopped(a);break}if(a!==y.ADDRESS&&a!==y.DIV&&a!==y.P&&e._isSpecialElement(e.openElements.items[r],a))break}e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._insertElement(t,ce.HTML)}function tR(e,t){e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._insertElement(t,ce.HTML),e.tokenizer.state=Jt.PLAINTEXT}function nR(e,t){e.openElements.hasInScope(y.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(y.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,ce.HTML),e.framesetOk=!1}function rR(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(te.A);n&&(mp(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,ce.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function sR(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ce.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function aR(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(y.NOBR)&&(mp(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,ce.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function iR(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ce.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function oR(e,t){e.treeAdapter.getDocumentMode(e.document)!==Sr.QUIRKS&&e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._insertElement(t,ce.HTML),e.framesetOk=!1,e.insertionMode=q.IN_TABLE}function A2(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ce.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function I2(e){const t=x2(e,Ga.TYPE);return t!=null&&t.toLowerCase()===_I}function uR(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ce.HTML),I2(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function lR(e,t){e._appendElement(t,ce.HTML),t.ackSelfClosing=!0}function cR(e,t){e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._appendElement(t,ce.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function dR(e,t){t.tagName=te.IMG,t.tagID=y.IMG,A2(e,t)}function fR(e,t){e._insertElement(t,ce.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Jt.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=q.TEXT}function hR(e,t){e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Jt.RAWTEXT)}function pR(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Jt.RAWTEXT)}function ob(e,t){e._switchToTextParsing(t,Jt.RAWTEXT)}function mR(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ce.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===q.IN_TABLE||e.insertionMode===q.IN_CAPTION||e.insertionMode===q.IN_TABLE_BODY||e.insertionMode===q.IN_ROW||e.insertionMode===q.IN_CELL?q.IN_SELECT_IN_TABLE:q.IN_SELECT}function gR(e,t){e.openElements.currentTagId===y.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,ce.HTML)}function yR(e,t){e.openElements.hasInScope(y.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,ce.HTML)}function bR(e,t){e.openElements.hasInScope(y.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(y.RTC),e._insertElement(t,ce.HTML)}function ER(e,t){e._reconstructActiveFormattingElements(),C2(t),pp(t),t.selfClosing?e._appendElement(t,ce.MATHML):e._insertElement(t,ce.MATHML),t.ackSelfClosing=!0}function xR(e,t){e._reconstructActiveFormattingElements(),k2(t),pp(t),t.selfClosing?e._appendElement(t,ce.SVG):e._insertElement(t,ce.SVG),t.ackSelfClosing=!0}function ub(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ce.HTML)}function Mn(e,t){switch(t.tagID){case y.I:case y.S:case y.B:case y.U:case y.EM:case y.TT:case y.BIG:case y.CODE:case y.FONT:case y.SMALL:case y.STRIKE:case y.STRONG:{sR(e,t);break}case y.A:{rR(e,t);break}case y.H1:case y.H2:case y.H3:case y.H4:case y.H5:case y.H6:{KI(e,t);break}case y.P:case y.DL:case y.OL:case y.UL:case y.DIV:case y.DIR:case y.NAV:case y.MAIN:case y.MENU:case y.ASIDE:case y.CENTER:case y.FIGURE:case y.FOOTER:case y.HEADER:case y.HGROUP:case y.DIALOG:case y.DETAILS:case y.ADDRESS:case y.ARTICLE:case y.SEARCH:case y.SECTION:case y.SUMMARY:case y.FIELDSET:case y.BLOCKQUOTE:case y.FIGCAPTION:{XI(e,t);break}case y.LI:case y.DD:case y.DT:{eR(e,t);break}case y.BR:case y.IMG:case y.WBR:case y.AREA:case y.EMBED:case y.KEYGEN:{A2(e,t);break}case y.HR:{cR(e,t);break}case y.RB:case y.RTC:{yR(e,t);break}case y.RT:case y.RP:{bR(e,t);break}case y.PRE:case y.LISTING:{JI(e,t);break}case y.XMP:{hR(e,t);break}case y.SVG:{xR(e,t);break}case y.HTML:{VI(e,t);break}case y.BASE:case y.LINK:case y.META:case y.STYLE:case y.TITLE:case y.SCRIPT:case y.BGSOUND:case y.BASEFONT:case y.TEMPLATE:{Hr(e,t);break}case y.BODY:{QI(e,t);break}case y.FORM:{ZI(e,t);break}case y.NOBR:{aR(e,t);break}case y.MATH:{ER(e,t);break}case y.TABLE:{oR(e,t);break}case y.INPUT:{uR(e,t);break}case y.PARAM:case y.TRACK:case y.SOURCE:{lR(e,t);break}case y.IMAGE:{dR(e,t);break}case y.BUTTON:{nR(e,t);break}case y.APPLET:case y.OBJECT:case y.MARQUEE:{iR(e,t);break}case y.IFRAME:{pR(e,t);break}case y.SELECT:{mR(e,t);break}case y.OPTION:case y.OPTGROUP:{gR(e,t);break}case y.NOEMBED:case y.NOFRAMES:{ob(e,t);break}case y.FRAMESET:{GI(e,t);break}case y.TEXTAREA:{fR(e,t);break}case y.NOSCRIPT:{e.options.scriptingEnabled?ob(e,t):ub(e,t);break}case y.PLAINTEXT:{tR(e,t);break}case y.COL:case y.TH:case y.TD:case y.TR:case y.HEAD:case y.FRAME:case y.TBODY:case y.TFOOT:case y.THEAD:case y.CAPTION:case y.COLGROUP:break;default:ub(e,t)}}function TR(e,t){if(e.openElements.hasInScope(y.BODY)&&(e.insertionMode=q.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function vR(e,t){e.openElements.hasInScope(y.BODY)&&(e.insertionMode=q.AFTER_BODY,z2(e,t))}function wR(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function SR(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(y.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(y.FORM):n&&e.openElements.remove(n))}function _R(e){e.openElements.hasInButtonScope(y.P)||e._insertFakeElement(te.P,y.P),e._closePElement()}function CR(e){e.openElements.hasInListItemScope(y.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(y.LI),e.openElements.popUntilTagNamePopped(y.LI))}function kR(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function NR(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function OR(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function DR(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(te.BR,y.BR),e.openElements.pop(),e.framesetOk=!1}function R2(e,t){const n=t.tagName,r=t.tagID;for(let a=e.openElements.stackTop;a>0;a--){const o=e.openElements.items[a],l=e.openElements.tagIDs[a];if(r===l&&(r!==y.UNKNOWN||e.treeAdapter.getTagName(o)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=a&&e.openElements.shortenToLength(a);break}if(e._isSpecialElement(o,l))break}}function ud(e,t){switch(t.tagID){case y.A:case y.B:case y.I:case y.S:case y.U:case y.EM:case y.TT:case y.BIG:case y.CODE:case y.FONT:case y.NOBR:case y.SMALL:case y.STRIKE:case y.STRONG:{mp(e,t);break}case y.P:{_R(e);break}case y.DL:case y.UL:case y.OL:case y.DIR:case y.DIV:case y.NAV:case y.PRE:case y.MAIN:case y.MENU:case y.ASIDE:case y.BUTTON:case y.CENTER:case y.FIGURE:case y.FOOTER:case y.HEADER:case y.HGROUP:case y.DIALOG:case y.ADDRESS:case y.ARTICLE:case y.DETAILS:case y.SEARCH:case y.SECTION:case y.SUMMARY:case y.LISTING:case y.FIELDSET:case y.BLOCKQUOTE:case y.FIGCAPTION:{wR(e,t);break}case y.LI:{CR(e);break}case y.DD:case y.DT:{kR(e,t);break}case y.H1:case y.H2:case y.H3:case y.H4:case y.H5:case y.H6:{NR(e);break}case y.BR:{DR(e);break}case y.BODY:{TR(e,t);break}case y.HTML:{vR(e,t);break}case y.FORM:{SR(e);break}case y.APPLET:case y.OBJECT:case y.MARQUEE:{OR(e,t);break}case y.TEMPLATE:{ii(e,t);break}default:R2(e,t)}}function L2(e,t){e.tmplInsertionModeStack.length>0?U2(e,t):gp(e,t)}function AR(e,t){var n;t.tagID===y.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function IR(e,t){e._err(t,ie.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function kh(e,t){if(e.openElements.currentTagId!==void 0&&N2.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=q.IN_TABLE_TEXT,t.type){case et.CHARACTER:{P2(e,t);break}case et.WHITESPACE_CHARACTER:{M2(e,t);break}}else Ku(e,t)}function RR(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,ce.HTML),e.insertionMode=q.IN_CAPTION}function LR(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ce.HTML),e.insertionMode=q.IN_COLUMN_GROUP}function MR(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(te.COLGROUP,y.COLGROUP),e.insertionMode=q.IN_COLUMN_GROUP,yp(e,t)}function PR(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ce.HTML),e.insertionMode=q.IN_TABLE_BODY}function FR(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(te.TBODY,y.TBODY),e.insertionMode=q.IN_TABLE_BODY,ld(e,t)}function jR(e,t){e.openElements.hasInTableScope(y.TABLE)&&(e.openElements.popUntilTagNamePopped(y.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function BR(e,t){I2(t)?e._appendElement(t,ce.HTML):Ku(e,t),t.ackSelfClosing=!0}function HR(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,ce.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function ao(e,t){switch(t.tagID){case y.TD:case y.TH:case y.TR:{FR(e,t);break}case y.STYLE:case y.SCRIPT:case y.TEMPLATE:{Hr(e,t);break}case y.COL:{MR(e,t);break}case y.FORM:{HR(e,t);break}case y.TABLE:{jR(e,t);break}case y.TBODY:case y.TFOOT:case y.THEAD:{PR(e,t);break}case y.INPUT:{BR(e,t);break}case y.CAPTION:{RR(e,t);break}case y.COLGROUP:{LR(e,t);break}default:Ku(e,t)}}function Ru(e,t){switch(t.tagID){case y.TABLE:{e.openElements.hasInTableScope(y.TABLE)&&(e.openElements.popUntilTagNamePopped(y.TABLE),e._resetInsertionMode());break}case y.TEMPLATE:{ii(e,t);break}case y.BODY:case y.CAPTION:case y.COL:case y.COLGROUP:case y.HTML:case y.TBODY:case y.TD:case y.TFOOT:case y.TH:case y.THEAD:case y.TR:break;default:Ku(e,t)}}function Ku(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,od(e,t),e.fosterParentingEnabled=n}function M2(e,t){e.pendingCharacterTokens.push(t)}function P2(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function gu(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)Ku(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const F2=new Set([y.CAPTION,y.COL,y.COLGROUP,y.TBODY,y.TD,y.TFOOT,y.TH,y.THEAD,y.TR]);function UR(e,t){const n=t.tagID;F2.has(n)?e.openElements.hasInTableScope(y.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(y.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=q.IN_TABLE,ao(e,t)):Mn(e,t)}function zR(e,t){const n=t.tagID;switch(n){case y.CAPTION:case y.TABLE:{e.openElements.hasInTableScope(y.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(y.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=q.IN_TABLE,n===y.TABLE&&Ru(e,t));break}case y.BODY:case y.COL:case y.COLGROUP:case y.HTML:case y.TBODY:case y.TD:case y.TFOOT:case y.TH:case y.THEAD:case y.TR:break;default:ud(e,t)}}function yp(e,t){switch(t.tagID){case y.HTML:{Mn(e,t);break}case y.COL:{e._appendElement(t,ce.HTML),t.ackSelfClosing=!0;break}case y.TEMPLATE:{Hr(e,t);break}default:Fc(e,t)}}function WR(e,t){switch(t.tagID){case y.COLGROUP:{e.openElements.currentTagId===y.COLGROUP&&(e.openElements.pop(),e.insertionMode=q.IN_TABLE);break}case y.TEMPLATE:{ii(e,t);break}case y.COL:break;default:Fc(e,t)}}function Fc(e,t){e.openElements.currentTagId===y.COLGROUP&&(e.openElements.pop(),e.insertionMode=q.IN_TABLE,e._processToken(t))}function ld(e,t){switch(t.tagID){case y.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,ce.HTML),e.insertionMode=q.IN_ROW;break}case y.TH:case y.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(te.TR,y.TR),e.insertionMode=q.IN_ROW,cd(e,t);break}case y.CAPTION:case y.COL:case y.COLGROUP:case y.TBODY:case y.TFOOT:case y.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE,ao(e,t));break}default:ao(e,t)}}function m0(e,t){const n=t.tagID;switch(t.tagID){case y.TBODY:case y.TFOOT:case y.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE);break}case y.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE,Ru(e,t));break}case y.BODY:case y.CAPTION:case y.COL:case y.COLGROUP:case y.HTML:case y.TD:case y.TH:case y.TR:break;default:Ru(e,t)}}function cd(e,t){switch(t.tagID){case y.TH:case y.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,ce.HTML),e.insertionMode=q.IN_CELL,e.activeFormattingElements.insertMarker();break}case y.CAPTION:case y.COL:case y.COLGROUP:case y.TBODY:case y.TFOOT:case y.THEAD:case y.TR:{e.openElements.hasInTableScope(y.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE_BODY,ld(e,t));break}default:ao(e,t)}}function j2(e,t){switch(t.tagID){case y.TR:{e.openElements.hasInTableScope(y.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE_BODY);break}case y.TABLE:{e.openElements.hasInTableScope(y.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE_BODY,m0(e,t));break}case y.TBODY:case y.TFOOT:case y.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(y.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE_BODY,m0(e,t));break}case y.BODY:case y.CAPTION:case y.COL:case y.COLGROUP:case y.HTML:case y.TD:case y.TH:break;default:Ru(e,t)}}function YR(e,t){const n=t.tagID;F2.has(n)?(e.openElements.hasInTableScope(y.TD)||e.openElements.hasInTableScope(y.TH))&&(e._closeTableCell(),cd(e,t)):Mn(e,t)}function qR(e,t){const n=t.tagID;switch(n){case y.TD:case y.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=q.IN_ROW);break}case y.TABLE:case y.TBODY:case y.TFOOT:case y.THEAD:case y.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),j2(e,t));break}case y.BODY:case y.CAPTION:case y.COL:case y.COLGROUP:case y.HTML:break;default:ud(e,t)}}function B2(e,t){switch(t.tagID){case y.HTML:{Mn(e,t);break}case y.OPTION:{e.openElements.currentTagId===y.OPTION&&e.openElements.pop(),e._insertElement(t,ce.HTML);break}case y.OPTGROUP:{e.openElements.currentTagId===y.OPTION&&e.openElements.pop(),e.openElements.currentTagId===y.OPTGROUP&&e.openElements.pop(),e._insertElement(t,ce.HTML);break}case y.HR:{e.openElements.currentTagId===y.OPTION&&e.openElements.pop(),e.openElements.currentTagId===y.OPTGROUP&&e.openElements.pop(),e._appendElement(t,ce.HTML),t.ackSelfClosing=!0;break}case y.INPUT:case y.KEYGEN:case y.TEXTAREA:case y.SELECT:{e.openElements.hasInSelectScope(y.SELECT)&&(e.openElements.popUntilTagNamePopped(y.SELECT),e._resetInsertionMode(),t.tagID!==y.SELECT&&e._processStartTag(t));break}case y.SCRIPT:case y.TEMPLATE:{Hr(e,t);break}}}function H2(e,t){switch(t.tagID){case y.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===y.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===y.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===y.OPTGROUP&&e.openElements.pop();break}case y.OPTION:{e.openElements.currentTagId===y.OPTION&&e.openElements.pop();break}case y.SELECT:{e.openElements.hasInSelectScope(y.SELECT)&&(e.openElements.popUntilTagNamePopped(y.SELECT),e._resetInsertionMode());break}case y.TEMPLATE:{ii(e,t);break}}}function $R(e,t){const n=t.tagID;n===y.CAPTION||n===y.TABLE||n===y.TBODY||n===y.TFOOT||n===y.THEAD||n===y.TR||n===y.TD||n===y.TH?(e.openElements.popUntilTagNamePopped(y.SELECT),e._resetInsertionMode(),e._processStartTag(t)):B2(e,t)}function VR(e,t){const n=t.tagID;n===y.CAPTION||n===y.TABLE||n===y.TBODY||n===y.TFOOT||n===y.THEAD||n===y.TR||n===y.TD||n===y.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(y.SELECT),e._resetInsertionMode(),e.onEndTag(t)):H2(e,t)}function QR(e,t){switch(t.tagID){case y.BASE:case y.BASEFONT:case y.BGSOUND:case y.LINK:case y.META:case y.NOFRAMES:case y.SCRIPT:case y.STYLE:case y.TEMPLATE:case y.TITLE:{Hr(e,t);break}case y.CAPTION:case y.COLGROUP:case y.TBODY:case y.TFOOT:case y.THEAD:{e.tmplInsertionModeStack[0]=q.IN_TABLE,e.insertionMode=q.IN_TABLE,ao(e,t);break}case y.COL:{e.tmplInsertionModeStack[0]=q.IN_COLUMN_GROUP,e.insertionMode=q.IN_COLUMN_GROUP,yp(e,t);break}case y.TR:{e.tmplInsertionModeStack[0]=q.IN_TABLE_BODY,e.insertionMode=q.IN_TABLE_BODY,ld(e,t);break}case y.TD:case y.TH:{e.tmplInsertionModeStack[0]=q.IN_ROW,e.insertionMode=q.IN_ROW,cd(e,t);break}default:e.tmplInsertionModeStack[0]=q.IN_BODY,e.insertionMode=q.IN_BODY,Mn(e,t)}}function GR(e,t){t.tagID===y.TEMPLATE&&ii(e,t)}function U2(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(y.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):gp(e,t)}function XR(e,t){t.tagID===y.HTML?Mn(e,t):jc(e,t)}function z2(e,t){var n;if(t.tagID===y.HTML){if(e.fragmentContext||(e.insertionMode=q.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===y.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else jc(e,t)}function jc(e,t){e.insertionMode=q.IN_BODY,od(e,t)}function KR(e,t){switch(t.tagID){case y.HTML:{Mn(e,t);break}case y.FRAMESET:{e._insertElement(t,ce.HTML);break}case y.FRAME:{e._appendElement(t,ce.HTML),t.ackSelfClosing=!0;break}case y.NOFRAMES:{Hr(e,t);break}}}function JR(e,t){t.tagID===y.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==y.FRAMESET&&(e.insertionMode=q.AFTER_FRAMESET))}function ZR(e,t){switch(t.tagID){case y.HTML:{Mn(e,t);break}case y.NOFRAMES:{Hr(e,t);break}}}function eL(e,t){t.tagID===y.HTML&&(e.insertionMode=q.AFTER_AFTER_FRAMESET)}function tL(e,t){t.tagID===y.HTML?Mn(e,t):Sc(e,t)}function Sc(e,t){e.insertionMode=q.IN_BODY,od(e,t)}function nL(e,t){switch(t.tagID){case y.HTML:{Mn(e,t);break}case y.NOFRAMES:{Hr(e,t);break}}}function rL(e,t){t.chars=Mt,e._insertCharacters(t)}function sL(e,t){e._insertCharacters(t),e.framesetOk=!1}function W2(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==ce.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function aL(e,t){if(xI(t))W2(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===ce.MATHML?C2(t):r===ce.SVG&&(TI(t),k2(t)),pp(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function iL(e,t){if(t.tagID===y.P||t.tagID===y.BR){W2(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===ce.HTML){e._endTagOutsideForeignContent(t);break}const a=e.treeAdapter.getTagName(r);if(a.toLowerCase()===t.tagName){t.tagName=a,e.openElements.shortenToLength(n);break}}}te.AREA,te.BASE,te.BASEFONT,te.BGSOUND,te.BR,te.COL,te.EMBED,te.FRAME,te.HR,te.IMG,te.INPUT,te.KEYGEN,te.LINK,te.META,te.PARAM,te.SOURCE,te.TRACK,te.WBR;const oL=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,uL=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),lb={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function Y2(e,t){const n=bL(e),r=m2("type",{handlers:{root:lL,element:cL,text:dL,comment:$2,doctype:fL,raw:pL},unknown:mL}),a={parser:n?new ib(lb):ib.getFragmentParser(void 0,lb),handle(c){r(c,a)},stitches:!1,options:t||{}};r(e,a),bo(a,us());const o=n?a.parser.document:a.parser.getFragment(),l=EA(o,{file:a.options.file});return a.stitches&&cp(l,"comment",function(c,d,h){const m=c;if(m.value.stitch&&h&&d!==void 0){const g=h.children;return g[d]=m.value.stitch,d}}),l.type==="root"&&l.children.length===1&&l.children[0].type===e.type?l.children[0]:l}function q2(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function lL(e,t){q2(e.children,t)}function cL(e,t){gL(e,t),q2(e.children,t),yL(e,t)}function dL(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:et.CHARACTER,chars:e.value,location:Ju(e)};bo(t,us(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function fL(e,t){const n={type:et.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Ju(e)};bo(t,us(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function hL(e,t){t.stitches=!0;const n=EL(e);if("children"in e&&"children"in n){const r=Y2({type:"root",children:e.children},t.options);n.children=r.children}$2({type:"comment",value:{stitch:n}},t)}function $2(e,t){const n=e.value,r={type:et.COMMENT,data:n,location:Ju(e)};bo(t,us(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function pL(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,V2(t,us(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(oL,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function mL(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))hL(n,t);else{let r="";throw uL.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 bo(e,t){V2(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Jt.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function V2(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function gL(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Jt.PLAINTEXT)return;bo(t,us(e));const r=t.parser.openElements.current;let a="namespaceURI"in r?r.namespaceURI:ja.html;a===ja.html&&n==="svg"&&(a=ja.svg);const o=SA({...e,children:[]},{space:a===ja.svg?"svg":"html"}),l={type:et.START_TAG,tagName:n,tagID:yo(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in o?o.attrs:[],location:Ju(e)};t.parser.currentToken=l,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function yL(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&IA.includes(n)||t.parser.tokenizer.state===Jt.PLAINTEXT)return;bo(t,rd(e));const r={type:et.END_TAG,tagName:n,tagID:yo(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Ju(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Jt.RCDATA||t.parser.tokenizer.state===Jt.RAWTEXT||t.parser.tokenizer.state===Jt.SCRIPT_DATA)&&(t.parser.tokenizer.state=Jt.DATA)}function bL(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function Ju(e){const t=us(e)||{line:void 0,column:void 0,offset:void 0},n=rd(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function EL(e){return"children"in e?so({...e,children:[]}):so(e)}function xL(e){return function(t,n){return Y2(t,{...e,file:n})}}function TL({chartName:e,chartTitle:t,displayValue:n,field:r,change:a,previousValue:o,lockedPreset:l,lockedRange:c,format:d}){const[h,m]=L.useState(!1),[g,E]=L.useState({top:0,left:0,placement:"below"}),x=L.useRef(null),C=L.useRef(null);L.useEffect(()=>{if(!h||!C.current)return;const k=()=>{var $,G;if(!C.current)return;const O=C.current.getBoundingClientRect(),A=(($=x.current)==null?void 0:$.offsetHeight)||180,_=window.innerHeight-O.bottom,N=O.top,I=8;let F="below",j;_<A+I&&N>_?(F="above",j=O.top+window.scrollY-A-I):j=O.bottom+window.scrollY+I;let M=O.left+window.scrollX;const H=((G=x.current)==null?void 0:G.offsetWidth)||220;M+H>window.innerWidth-I&&(M=window.innerWidth-H-I),M<I&&(M=I),E({top:j,left:M,placement:F})};k(),requestAnimationFrame(k)},[h]),L.useEffect(()=>{if(!h)return;function k(O){x.current&&!x.current.contains(O.target)&&C.current&&!C.current.contains(O.target)&&m(!1)}return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[h]),L.useEffect(()=>{if(!h)return;function k(O){O.key==="Escape"&&m(!1)}return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[h]);const S=l?l.replace(/_/g," ").replace(/\b\w/g,k=>k.toUpperCase()):c?c.replace(".."," to "):null,w=a!==void 0?`${a>=0?"+":""}${a.toFixed(1)}%`:null,v=a!==void 0?a>=0?"text-green-600":"text-red-600":"";return p.jsxs(p.Fragment,{children:[p.jsx("span",{ref:C,onClick:()=>m(!h),className:"text-blue-600 font-semibold border-b border-dashed border-blue-300 cursor-pointer hover:bg-blue-50 px-0.5 rounded transition-colors",children:n}),h&&Dx.createPortal(p.jsxs("div",{ref:x,className:"fixed z-[9999] bg-white rounded-lg shadow-xl border border-gray-200 p-3 min-w-[220px] text-sm",style:{top:g.top,left:g.left},children:[p.jsx("div",{className:"font-medium text-gray-900 mb-2",children:t}),p.jsxs("div",{className:"flex items-baseline gap-2 mb-2",children:[p.jsx("span",{className:"text-2xl font-bold text-gray-900",children:n}),r&&r!=="value"&&r!=="formatted"&&p.jsxs("span",{className:"text-xs text-gray-500",children:["(",r,")"]})]}),w&&p.jsxs("div",{className:Bn("text-sm mb-2",v),children:[w," vs previous period",o!==void 0&&p.jsxs("span",{className:"text-gray-500 ml-1",children:["(",(d==null?void 0:d.type)==="currency"?"$":"",o.toLocaleString(),")"]})]}),p.jsx("div",{className:"border-t border-gray-100 my-2"}),p.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500",children:[p.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),S?p.jsx("span",{children:S}):p.jsx("span",{className:"italic",children:"Follows dashboard filter"})]}),p.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-400 mt-1",children:[p.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})}),p.jsx("span",{children:e})]})]}),document.body)]})}function vL(e){const t=/\{\{([a-zA-Z0-9_-]+)(?:\.([a-zA-Z0-9_]+))?(?:@([a-zA-Z0-9_-]+|\d{4}-\d{2}-\d{2}\.\.\d{4}-\d{2}-\d{2}))?\}\}/g,n=new Map;let r;for(;(r=t.exec(e))!==null;){const a=r[1],o=r[2],l=r[3];if(!a)continue;let c;if(l){const h=l.match(/^(\d{4}-\d{2}-\d{2})\.\.(\d{4}-\d{2}-\d{2})$/);h?c={startDate:h[1],endDate:h[2]}:c={preset:l}}const d=`${a}:${o||""}:${l||""}`;n.has(d)||n.set(d,{chartName:a,field:o,locked:c})}return Array.from(n.values())}function wL(e){return Array.from(new Set(e.map(t=>t.chartName)))}function SL(e,t){if(!t)return e.toLocaleString();const n=t.decimals??0;switch(t.type){case"currency":return new Intl.NumberFormat("en-US",{style:"currency",currency:t.currency||"USD",minimumFractionDigits:n,maximumFractionDigits:n}).format(e);case"percent":return new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:n,maximumFractionDigits:n}).format(e/100);default:return e.toLocaleString(void 0,{minimumFractionDigits:n,maximumFractionDigits:n})}}function _L(e,t){if(e.locked){if(e.locked.preset)return{date_range:e.locked.preset};if(e.locked.startDate&&e.locked.endDate)return{date_range:{type:"custom",start:e.locked.startDate,end:e.locked.endDate}}}return t}function g0(e){const t=e.locked?e.locked.preset||`${e.locked.startDate}..${e.locked.endDate}`:"current";return`${e.chartName}:${e.field||"value"}:${t}`}function CL(e,t){const n=wL(e),r=L.useMemo(()=>{const m=new Map;return e.forEach(g=>{const E=_L(g,t),x=`${g.chartName}:${JSON.stringify(E)}`;m.has(x)||m.set(x,{chartName:g.chartName,params:E,refs:[]}),m.get(x).refs.push(g)}),Array.from(m.values())},[e,t]),a=u1({queries:r.map(m=>({queryKey:["chartData",m.chartName,m.params],queryFn:()=>Pt.queryChart(m.chartName,m.params),enabled:r.length>0}))}),o=u1({queries:n.map(m=>({queryKey:["chart",m],queryFn:()=>Pt.getChart(m),enabled:n.length>0}))}),l=L.useMemo(()=>{const m={};return n.forEach((g,E)=>{const x=o[E];x!=null&&x.data&&(m[g]=x.data)}),m},[n,o]),c=L.useMemo(()=>{const m={};return r.forEach((g,E)=>{var w,v,k;const x=a[E],C=(w=l[g.chartName])==null?void 0:w.chart;if(!((k=(v=x==null?void 0:x.data)==null?void 0:v.rows)!=null&&k[0])||!C)return;const S=x.data.rows[0];g.refs.forEach(O=>{var P,_;const A=g0(O);if(C.type==="kpi"&&((P=C.value)!=null&&P.field)){const N=C.value.field,I=S[N]??0,F={value:I,formatted:SL(I,C.format),fields:{}};if(Object.entries(S).forEach(([j,M])=>{typeof M=="number"&&(F.fields[j]=M)}),(_=C.comparison)!=null&&_.enabled&&C.comparison.field){const j=S[C.comparison.field];j&&j!==0&&(C.comparison.type==="percent_change"?F.change=(I-j)/j*100:F.change=I-j)}m[A]=F}})}),m},[r,a,l]),d=a.some(m=>m.isLoading)||o.some(m=>m.isLoading),h=L.useMemo(()=>{const m={};return n.forEach((g,E)=>{var C;const x=o[E];(C=x==null?void 0:x.data)!=null&&C.title&&(m[g]=x.data.title)}),m},[n,o]);return{values:c,isLoading:d,getRefKey:g0,chartTitles:h}}function kL(e,t,n){const r={};let a=0;return{content:e.replace(/\{\{([a-zA-Z0-9_-]+)(?:\.([a-zA-Z0-9_]+))?(?:@([a-zA-Z0-9_-]+|\d{4}-\d{2}-\d{2}\.\.\d{4}-\d{2}-\d{2}))?\}\}/g,(l,c,d,h)=>{let m,g,E;if(h){const k=h.match(/^(\d{4}-\d{2}-\d{2})\.\.(\d{4}-\d{2}-\d{2})$/);k?(m={startDate:k[1],endDate:k[2]},E=h):(m={preset:h},g=h)}const C=g0({chartName:c,field:d,locked:m}),S=t[C];if(!S)return l;let w;if(d)if(d==="formatted"||d==="value")w=S.formatted;else if(d==="change"&&S.change!==void 0)w=`${S.change>=0?"+":""}${S.change.toFixed(1)}%`;else if(S.fields[d]!==void 0)w=S.fields[d].toLocaleString();else return l;else w=S.formatted;const v=`kpi-ref-${a++}`;return r[v]={chartName:c,chartTitle:n[c]||c,displayValue:w,field:d,change:S.change,previousValue:S.fields.previous_value,lockedPreset:g,lockedRange:E},`<kpi-ref data-ref-id="${v}">${w}</kpi-ref>`}),refData:r}}function NL({filter:e,kpiCharts:t,selectedIndex:n,position:r,onSelect:a,onClose:o}){const l=L.useRef(null),c=L.useMemo(()=>{const d=e.toLowerCase();return t.filter(h=>h.name.toLowerCase().includes(d)||h.title.toLowerCase().includes(d))},[e,t]);return L.useEffect(()=>{function d(h){l.current&&!l.current.contains(h.target)&&o()}return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[o]),L.useEffect(()=>{var h;const d=(h=l.current)==null?void 0:h.querySelector('[data-selected="true"]');d==null||d.scrollIntoView({block:"nearest"})},[n]),c.length===0?null:Dx.createPortal(p.jsx("div",{ref:l,className:"fixed z-[9999] bg-white rounded-lg shadow-xl border border-gray-200 py-1 max-h-48 overflow-y-auto min-w-[200px]",style:{top:r.top,left:r.left},children:c.map((d,h)=>p.jsxs("button",{"data-selected":h===n,onMouseDown:m=>{m.preventDefault(),a(d.name)},className:Bn("w-full text-left px-3 py-1.5 text-sm flex flex-col",h===n?"bg-blue-50 text-blue-700":"text-gray-700 hover:bg-gray-50"),children:[p.jsx("span",{className:"font-medium truncate",children:d.title}),p.jsx("span",{className:"text-xs text-gray-400 font-mono truncate",children:`{{${d.name}}}`})]},d.name))}),document.body)}function OL({content:e,onUpdate:t,isContentEditing:n,onEditStart:r,onEditEnd:a}){const{isEditing:o}=fo(),[l,c]=L.useState(e),d=L.useRef(null),[h,m]=L.useState(null),[g,E]=L.useState({top:0,left:0}),x=L.useRef(null),C=qe(Q=>Q.globalFilters),{data:S}=is({queryKey:["config"],queryFn:()=>Pt.getConfig()}),w=L.useMemo(()=>(S==null?void 0:S.charts.filter(Q=>Q.type==="kpi"))||[],[S]),v=L.useMemo(()=>vL(e),[e]),{values:k,isLoading:O,chartTitles:A}=CL(v,C),{content:P,refData:_}=L.useMemo(()=>O||Object.keys(k).length===0?{content:e,refData:{}}:kL(e,k,A),[e,k,O,A]),N=L.useMemo(()=>({"kpi-ref":({children:Q,...re})=>{const Z=re["data-ref-id"],K=Z?_[Z]:null;return K?p.jsx(TL,{chartName:K.chartName,chartTitle:K.chartTitle,displayValue:K.displayValue,field:K.field,change:K.change,previousValue:K.previousValue,lockedPreset:K.lockedPreset,lockedRange:K.lockedRange}):p.jsx("span",{children:Q})}}),[_]);L.useEffect(()=>{n||c(e)},[e,n]),L.useEffect(()=>{n&&d.current&&d.current.focus()},[n]);const I=()=>{t==null||t(l),m(null),a==null||a()},F=()=>{c(e),m(null),a==null||a()},j=()=>{const Q=d.current,re=x.current;if(!Q||!re)return;const Z=Q.selectionStart,K=Q.value.substring(0,Z);re.textContent=K;const R=Q.getBoundingClientRect(),ae=re.offsetWidth,ue=parseFloat(getComputedStyle(Q).lineHeight)||18,z=Q.clientWidth-16,Oe=K.split(`
|
|
109
|
-
`),Be=Oe[Oe.length-1]||"";re.textContent=Be;const Te=Math.min(re.offsetWidth,z),$e=(Oe.length-1+Math.floor(ae/z))*ue;E({top:R.top+$e+ue+4-Q.scrollTop,left:R.left+Te+8})},M=L.useMemo(()=>{if(!(h!=null&&h.active))return[];const Q=h.filter.toLowerCase();return w.filter(re=>re.name.toLowerCase().includes(Q)||re.title.toLowerCase().includes(Q))},[h,w]),H=Q=>{if(!h||!d.current)return;const re=d.current,Z=l.substring(0,h.startPos),K=l.substring(re.selectionStart),R=`{{${Q}}}`,ae=Z+R+K;c(ae),m(null);const ue=Z.length+R.length;setTimeout(()=>{re.selectionStart=re.selectionEnd=ue,re.focus()},0)},$=Q=>{if(h!=null&&h.active){if(Q.key==="ArrowDown"){Q.preventDefault(),m(Be=>Be?{...Be,selectedIndex:Math.min(Be.selectedIndex+1,M.length-1)}:null);return}if(Q.key==="ArrowUp"){Q.preventDefault(),m(Be=>Be?{...Be,selectedIndex:Math.max(Be.selectedIndex-1,0)}:null);return}if(Q.key==="Enter"||Q.key==="Tab"){Q.preventDefault();const Be=M[h.selectedIndex];Be&&H(Be.name);return}if(Q.key==="Escape"){Q.preventDefault(),m(null);return}}if(Q.key==="Escape"){Q.preventDefault(),F();return}if(Q.key!=="Enter")return;const re=Q.currentTarget,{selectionStart:Z,value:K}=re,R=K.substring(0,Z),ae=R.lastIndexOf(`
|
|
110
|
-
`)+1,ue=R.substring(ae),z=ue.match(/^(\s*)([-*])\s(.*)$/);if(z){const Be=z[1]??"",Te=z[2]??"-";if(!(z[3]??"").trim()){Q.preventDefault();const tt=K.substring(0,ae)+K.substring(Z);c(tt),setTimeout(()=>{re.selectionStart=re.selectionEnd=ae},0);return}Q.preventDefault();const $e=`
|
|
111
|
-
${Be}${Te} `,Ge=K.substring(0,Z)+$e+K.substring(Z);c(Ge),setTimeout(()=>{re.selectionStart=re.selectionEnd=Z+$e.length},0);return}const Oe=ue.match(/^(\s*)(\d+)\.\s(.*)$/);if(Oe){const Be=Oe[1]??"",Te=Oe[2]??"1";if(!(Oe[3]??"").trim()){Q.preventDefault();const We=K.substring(0,ae)+K.substring(Z);c(We),setTimeout(()=>{re.selectionStart=re.selectionEnd=ae},0);return}Q.preventDefault();const $e=parseInt(Te,10)+1,Ge=`
|
|
112
|
-
${Be}${$e}. `,tt=K.substring(0,Z)+Ge+K.substring(Z);c(tt),setTimeout(()=>{re.selectionStart=re.selectionEnd=Z+Ge.length},0);return}},G=Q=>{const re=Q.target.value,Z=Q.target.selectionStart;c(re);const K=re.substring(0,Z),R=K.lastIndexOf("{");if(R>=0){const ae=K.substring(R+1);if(!ae.includes("}")&&!ae.includes(`
|
|
113
|
-
`)){const ue=ae.replace(/^\{/,"");m({active:!0,startPos:R,filter:ue,selectedIndex:0}),setTimeout(j,0);return}}m(null)},J=Q=>{const re=Q.relatedTarget;re!=null&&re.closest("[data-kpi-autocomplete]")||I()};return n?p.jsxs("div",{className:"h-full relative",children:[p.jsx("textarea",{ref:d,value:l,onChange:G,onKeyDown:$,onBlur:J,className:"h-full w-full p-4 resize-none font-mono text-sm focus:outline-none bg-transparent",placeholder:"Type markdown here... Use {{ to insert KPI references"}),p.jsx("span",{ref:x,className:"invisible fixed top-0 left-0 font-mono text-sm whitespace-pre","aria-hidden":"true"}),(h==null?void 0:h.active)&&M.length>0&&p.jsx(NL,{filter:h.filter,kpiCharts:w,selectedIndex:h.selectedIndex,position:g,onSelect:H,onClose:()=>m(null)})]}):p.jsxs("div",{className:"h-full p-4 overflow-auto",children:[p.jsx("div",{className:"prose prose-sm max-w-none prose-headings:mt-2 prose-headings:mb-2 prose-p:my-1 prose-ul:my-1 prose-ol:my-1 prose-li:my-0",children:p.jsx(sA,{rehypePlugins:[xL],components:N,children:P})}),o&&t&&!e&&p.jsx("div",{className:"text-gray-400 text-sm italic",children:"Double-click to edit"})]})}function DL({children:e,onRemove:t,widgetType:n,onDoubleClick:r,isContentEditing:a}){const{isEditing:o}=fo();return p.jsxs("div",{className:Bn("h-full relative",o&&"ring-2 ring-blue-200",o&&!a&&"select-none"),style:{background:"var(--yc-color-surface)",borderRadius:"var(--yc-radius)",boxShadow:"var(--yc-shadow)",border:"var(--yc-card-border)"},children:[o&&p.jsxs(p.Fragment,{children:[!(n==="text"&&a)&&p.jsx("div",{className:"absolute inset-0 z-[5] cursor-grab active:cursor-grabbing",style:{pointerEvents:"all"},onMouseDown:l=>l.preventDefault(),onDoubleClick:l=>{r&&(l.stopPropagation(),r())}}),t&&p.jsx("div",{className:"absolute top-1 right-1 z-10",children:p.jsx("button",{onClick:l=>{l.stopPropagation(),t()},className:"w-5 h-5 bg-white/70 hover:bg-red-100 rounded flex items-center justify-center transition-colors",title:"Remove widget",children:p.jsx("svg",{className:"w-3 h-3 text-red-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})})]}),p.jsx("div",{className:"h-full",children:e})]})}const Ec=38,Q2=12;function AL(e){return e.type==="chart"&&e.ref?`chart-${e.ref}`:e.type==="text"?`text-${(e.content||"empty").slice(0,50).replace(/[^a-zA-Z0-9]/g,"_").replace(/_+/g,"_")}`:"widget-unknown"}const IL=40;function RL(e){const t=[];for(let n=0;n<e;n++)for(let r=0;r<Q2;r++)t.push({i:`bg-${n}-${r}`,x:r,y:n,w:1,h:1,static:!0});return t}const G2=RL(IL),LL=G2.map(e=>p.jsx("div",{style:{boxSizing:"border-box",background:"rgba(59, 130, 246, 0.04)",borderRadius:4,border:"1px solid rgba(59, 130, 246, 0.06)"}},e.i));function ML({layout:e,onLayoutChange:t}){const{isEditing:n,setPendingLayout:r,setOriginalLayout:a,currentLayout:o,removeWidget:l,updateWidget:c}=fo(),d=L.useRef(""),h=L.useRef(""),m=L.useRef(null),[g,E]=L.useState(0),[x,C]=L.useState(null);L.useEffect(()=>{const I=m.current;if(!I)return;const F=new ResizeObserver(j=>{var H;const M=(H=j[0])==null?void 0:H.contentRect.width;M&&M>0&&E(Math.floor(M))});return F.observe(I),()=>F.disconnect()},[]),L.useEffect(()=>{const I=JSON.stringify(e);I!==d.current&&(d.current=I,a(e))},[e,a]),L.useEffect(()=>{n||C(null)},[n]);const S=o||e,w=S.gap??16,{gridLayout:v,widgetMap:k,widgetList:O}=L.useMemo(()=>{const I=[],F=new Map,j=[];let M=0;const H=new Set;return S.rows.forEach(($,G)=>{let J=0,Q=0;$.widgets.forEach((re,Z)=>{let K=AL(re);if(H.has(K)){let z=2;for(;H.has(`${K}-${z}`);)z++;K=`${K}-${z}`}H.add(K);const R=re.height??$.height,ae=Math.ceil(R/Ec),ue={i:K,x:re.x??J,y:re.y??M,w:re.cols,h:ae,minW:1,minH:1,static:!n||x===K};I.push(ue),F.set(K,{widget:re,rowIndex:G,widgetIndex:Z}),j.push({id:K,widget:re,rowIndex:G,widgetIndex:Z}),J+=re.cols,Q=Math.max(Q,ae)}),M+=Q}),{gridLayout:I,widgetMap:F,widgetList:j}},[S,n,x]),A=L.useCallback(I=>{if(!n)return;const j=[...I.filter(Q=>k.has(Q.i))].sort((Q,re)=>Q.y-re.y||Q.x-re.x),M=j.map(Q=>`${Q.i}:${Q.x},${Q.y},${Q.w},${Q.h}`).join("|");if(M===h.current)return;h.current=M;const H=new Map;j.forEach(Q=>{const re=k.get(Q.i);if(!re)return;let Z=H.get(Q.y);Z||(Z={items:[]},H.set(Q.y,Z));const K=Q.h*Ec;Z.items.push({item:Q,widget:{...re.widget,cols:Q.w,height:K,x:Q.x,y:Q.y}})});const $=[],G=[...H.keys()].sort((Q,re)=>Q-re);for(const Q of G){const re=H.get(Q),Z=Math.max(...re.items.map(K=>K.item.h));$.push({height:Z*Ec,widgets:re.items.map(K=>K.widget)})}const J={gap:S.gap,rows:$};r(J),t==null||t(J)},[n,k,S.gap,r,t]),P=L.useCallback((I,F)=>{l(I,F)},[l]),_=L.useCallback((I,F,j)=>{c(I,F,{content:j})},[c]),N={cols:Q2,rowHeight:Ec,width:g,margin:[w,w],useCSSTransforms:!0};return p.jsxs(p.Fragment,{children:[!n&&p.jsx("style",{children:".react-resizable-handle { display: none !important; }"}),n&&p.jsx("style",{children:`
|
|
114
|
-
.react-grid-placeholder {
|
|
115
|
-
background: rgba(59, 130, 246, 0.15) !important;
|
|
116
|
-
border: 2px dashed rgba(59, 130, 246, 0.4) !important;
|
|
117
|
-
border-radius: var(--yc-radius) !important;
|
|
118
|
-
opacity: 1 !important;
|
|
119
|
-
}
|
|
120
|
-
.yc-edit-grid .react-grid-item {
|
|
121
|
-
transition: all 200ms ease !important;
|
|
122
|
-
}
|
|
123
|
-
.yc-edit-grid .react-grid-item.react-draggable-dragging {
|
|
124
|
-
transition: none !important;
|
|
125
|
-
z-index: 100;
|
|
126
|
-
box-shadow: 0 8px 25px rgba(0,0,0,0.15);
|
|
127
|
-
}
|
|
128
|
-
.yc-edit-grid .react-resizable-handle {
|
|
129
|
-
background: none !important;
|
|
130
|
-
width: 24px !important;
|
|
131
|
-
height: 24px !important;
|
|
132
|
-
z-index: 10 !important;
|
|
133
|
-
}
|
|
134
|
-
.yc-edit-grid .react-resizable-handle::after {
|
|
135
|
-
content: '' !important;
|
|
136
|
-
position: absolute !important;
|
|
137
|
-
right: 4px !important;
|
|
138
|
-
bottom: 4px !important;
|
|
139
|
-
width: 10px !important;
|
|
140
|
-
height: 10px !important;
|
|
141
|
-
border-right: 2px solid rgba(59,130,246,0.4) !important;
|
|
142
|
-
border-bottom: 2px solid rgba(59,130,246,0.4) !important;
|
|
143
|
-
border-radius: 0 0 2px 0 !important;
|
|
144
|
-
}
|
|
145
|
-
.yc-edit-grid .react-resizable-handle:hover::after {
|
|
146
|
-
border-color: rgba(59,130,246,0.8) !important;
|
|
147
|
-
}
|
|
148
|
-
.yc-bg-grid {
|
|
149
|
-
position: absolute !important;
|
|
150
|
-
inset: 0 !important;
|
|
151
|
-
pointer-events: none !important;
|
|
152
|
-
z-index: 0 !important;
|
|
153
|
-
overflow: hidden !important;
|
|
154
|
-
}
|
|
155
|
-
.yc-bg-grid .react-grid-item {
|
|
156
|
-
transition: none !important;
|
|
157
|
-
}
|
|
158
|
-
.yc-edit-grid {
|
|
159
|
-
position: relative;
|
|
160
|
-
}
|
|
161
|
-
.yc-edit-grid > .react-grid-item {
|
|
162
|
-
z-index: 1;
|
|
163
|
-
}
|
|
164
|
-
`}),p.jsxs("div",{ref:m,style:{position:"relative"},children:[g>0&&n&&p.jsx(ay,{className:"yc-bg-grid",layout:G2,...N,compactType:null,isDraggable:!1,isResizable:!1,autoSize:!1,children:LL}),g>0&&p.jsx(ay,{className:n?"layout yc-edit-grid":"layout",layout:v,...N,isDraggable:n,isResizable:n,onDragStop:I=>A(I),onResizeStop:I=>A(I),compactType:"vertical",autoSize:!0,children:O.map(({id:I,widget:F,rowIndex:j,widgetIndex:M})=>p.jsx("div",{className:"h-full",children:p.jsxs(DL,{onRemove:()=>P(j,M),widgetType:F.type,isContentEditing:x===I,onDoubleClick:F.type==="text"?()=>C(I):void 0,children:[F.type==="chart"&&F.ref&&p.jsx($3,{chartRef:F.ref}),F.type==="text"&&p.jsx(OL,{content:F.content||"",onUpdate:H=>_(j,M,H),isContentEditing:x===I,onEditStart:()=>C(I),onEditEnd:()=>C(null)})]})},I))})]})]})}function PL({isOpen:e,onClose:t,onAdd:n,existingCharts:r}){const{data:a}=io(),[o,l]=L.useState(""),c=L.useRef(null);if(L.useEffect(()=>{const g=x=>{x.key==="Escape"&&t()},E=x=>{c.current&&!c.current.contains(x.target)&&t()};return e&&(document.addEventListener("keydown",g),document.addEventListener("mousedown",E)),()=>{document.removeEventListener("keydown",g),document.removeEventListener("mousedown",E)}},[e,t]),!e)return null;const h=((a==null?void 0:a.charts)||[]).filter(g=>g.title.toLowerCase().includes(o.toLowerCase())||g.name.toLowerCase().includes(o.toLowerCase())),m=g=>{n({type:"chart",ref:g,cols:6}),t()};return p.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:p.jsxs("div",{ref:c,className:"bg-white rounded-lg shadow-xl w-full max-w-md mx-4",children:[p.jsxs("div",{className:"p-4 border-b border-gray-200",children:[p.jsxs("div",{className:"flex items-center justify-between mb-3",children:[p.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Add Chart"}),p.jsx("button",{onClick:t,className:"p-1 text-gray-400 hover:text-gray-600",children:p.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),p.jsx("input",{type:"text",placeholder:"Search charts...",value:o,onChange:g=>l(g.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",autoFocus:!0})]}),p.jsx("div",{className:"max-h-80 overflow-y-auto",children:h.length===0?p.jsx("div",{className:"p-4 text-center text-gray-500 text-sm",children:"No charts found"}):p.jsx("div",{className:"p-2",children:h.map(g=>{const E=r.includes(g.name);return p.jsxs("button",{onClick:()=>m(g.name),disabled:E,className:"w-full text-left px-3 py-3 rounded-md hover:bg-gray-100 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-between group",children:[p.jsxs("div",{children:[p.jsx("div",{className:"font-medium text-gray-900",children:g.title}),p.jsx("div",{className:"text-sm text-gray-500",children:g.name}),g.description&&p.jsx("div",{className:"text-xs text-gray-400 mt-1",children:g.description})]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"text-xs text-gray-400 bg-gray-100 px-2 py-1 rounded",children:g.type}),E?p.jsx("span",{className:"text-xs text-green-600",children:"Added"}):p.jsx("svg",{className:"w-5 h-5 text-gray-400 opacity-0 group-hover:opacity-100",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})]})]},g.name)})})})]})})}function FL(e){const t=Math.floor((Date.now()-e)/1e3);if(t<10)return"just now";if(t<60)return`${t}s ago`;const n=Math.floor(t/60);if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:new Date(e).toLocaleDateString()}function jL({dashboardId:e,title:t,description:n,contentRef:r,activeTab:a}){const{isEditing:o,setIsEditing:l,pendingLayout:c,setPendingLayout:d,setOriginalLayout:h,hasChanges:m,addWidget:g,currentLayout:E,undo:x,redo:C,canUndo:S,canRedo:w}=fo(),v=Hw(e),k=Uw(),O=Tw({queryKey:["chartData"]}),A=jr(),P=(()=>{const K=A.getQueryCache();let R=0;for(const ae of K.getAll()){const ue=ae.queryKey[0];(ue==="chartData"||ue==="chartWithData")&&ae.state.dataUpdatedAt>R&&(R=ae.state.dataUpdatedAt)}return R>0?R:null})(),[_,N]=L.useState(!1),[I,F]=L.useState(!1),[j,M]=L.useState(!1),[H,$]=L.useState(!1),G=(E==null?void 0:E.rows.flatMap(K=>K.widgets.filter(R=>R.type==="chart"&&R.ref).map(R=>R.ref)))||[],J=()=>{k()},Q=async K=>{if(r.current){$(!0),N(!1);try{K==="pdf"?await mN(r.current,`${e}-dashboard`,t):await pN(r.current,`${e}-dashboard`,K)}finally{$(!1)}}},re=async()=>{if(c)try{await v.mutateAsync({layout:c,tab:a}),h(c),d(null),l(!1)}catch(K){console.error("Failed to save:",K)}},Z=()=>{d(null),l(!1)};return p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"border-b border-gray-200 bg-white",children:[p.jsxs("div",{className:"flex items-center justify-between p-4",children:[p.jsx("div",{children:p.jsx("h1",{className:"text-xl font-semibold text-gray-900",children:t})}),p.jsx("div",{className:"flex items-center gap-2",children:o?p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"relative",children:[p.jsxs("button",{onClick:()=>M(!j),className:"flex items-center gap-2 px-3 py-2 text-sm font-medium text-blue-600 bg-blue-50 rounded-md hover:bg-blue-100",children:[p.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),"Add Widget",p.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),j&&p.jsxs("div",{className:"absolute left-0 top-full mt-1 w-40 bg-white rounded-md shadow-lg border border-gray-200 z-50 py-1",children:[p.jsxs("button",{onClick:()=>{M(!1),F(!0)},className:"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 flex items-center gap-2",children:[p.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})}),"Chart"]}),p.jsxs("button",{onClick:()=>{M(!1),g({type:"text",content:"",cols:6})},className:"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 flex items-center gap-2",children:[p.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h7"})}),"Text"]})]})]}),p.jsxs("div",{className:"flex items-center",children:[p.jsx("button",{onClick:x,disabled:!S,className:"p-2 text-gray-500 hover:text-gray-700 hover:bg-gray-100 rounded-md disabled:opacity-30 disabled:cursor-not-allowed",title:"Undo (Cmd+Z)",children:p.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 10h10a5 5 0 015 5v2M3 10l4-4m-4 4l4 4"})})}),p.jsx("button",{onClick:C,disabled:!w,className:"p-2 text-gray-500 hover:text-gray-700 hover:bg-gray-100 rounded-md disabled:opacity-30 disabled:cursor-not-allowed",title:"Redo (Cmd+Shift+Z)",children:p.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 10H11a5 5 0 00-5 5v2m15-7l-4-4m4 4l-4 4"})})})]}),p.jsx("div",{className:"w-px h-6 bg-gray-200 mx-2"}),p.jsx("button",{onClick:Z,className:"px-4 py-2 text-sm text-gray-600 hover:text-gray-800",children:"Cancel"}),p.jsx("button",{onClick:re,disabled:!m||v.isPending,className:Bn("px-4 py-2 text-sm font-medium rounded-md",m?"bg-blue-600 text-white hover:bg-blue-700":"bg-gray-200 text-gray-400 cursor-not-allowed"),children:v.isPending?"Saving...":"Save & Push"})]}):p.jsxs(p.Fragment,{children:[P&&O===0&&p.jsxs("span",{className:"text-xs text-gray-400",title:new Date(P).toLocaleString(),children:["Updated ",FL(P)]}),p.jsx("button",{onClick:J,disabled:O>0,className:"p-2 text-gray-500 hover:text-gray-700 hover:bg-gray-100 rounded-md disabled:opacity-50",title:"Refresh all charts",children:p.jsx("svg",{className:Bn("w-5 h-5",O>0&&"animate-spin"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}),p.jsxs("div",{className:"relative",children:[p.jsx("button",{onClick:()=>N(!_),disabled:H,className:"p-2 text-gray-500 hover:text-gray-700 hover:bg-gray-100 rounded-md disabled:opacity-50",title:"Export dashboard",children:H?p.jsxs("svg",{className:"w-5 h-5 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[p.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),p.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"})]}):p.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})})}),_&&p.jsxs("div",{className:"absolute right-0 top-full mt-1 w-40 bg-white rounded-md shadow-lg border border-gray-200 z-50 py-1",children:[p.jsxs("button",{onClick:()=>Q("png"),className:"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 flex items-center gap-2",children:[p.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),"Export PNG"]}),p.jsxs("button",{onClick:()=>Q("jpeg"),className:"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 flex items-center gap-2",children:[p.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),"Export JPEG"]}),p.jsxs("button",{onClick:()=>Q("pdf"),className:"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 flex items-center gap-2",children:[p.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})}),"Export PDF"]})]})]}),p.jsx("button",{onClick:()=>l(!0),className:"p-2 text-gray-500 hover:text-gray-700 hover:bg-gray-100 rounded-md",title:"Edit layout",children:p.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})})]})})]}),n&&p.jsx("p",{className:"px-4 pb-3 text-sm text-gray-500",children:n})]}),p.jsx(PL,{isOpen:I,onClose:()=>F(!1),onAdd:g,existingCharts:G})]})}function BL({filters:e,isEditing:t,onReorder:n,onRename:r}){const[a,o]=L.useState(null),[l,c]=L.useState(null);if(e.length===0)return null;function d(E,x){o(x),E.dataTransfer.effectAllowed="move"}function h(E,x){E.preventDefault(),E.dataTransfer.dropEffect="move",c(x)}function m(E,x){if(E.preventDefault(),a===null||a===x)return;const C=[...e],S=C.splice(a,1)[0];C.splice(x,0,S),n==null||n(C),o(null),c(null)}function g(){o(null),c(null)}return t?p.jsx("div",{className:"flex flex-wrap items-end gap-3",children:e.map((E,x)=>{const C=E.label||Du(E.name),S=l===x?"border-blue-400 bg-blue-50":"border-gray-200 bg-gray-50",w=a===x?"opacity-50":"";return p.jsxs("div",{draggable:!0,onDragStart:v=>d(v,x),onDragOver:v=>h(v,x),onDrop:v=>m(v,x),onDragEnd:g,className:`flex items-center gap-2 px-3 py-2 rounded-md border cursor-grab active:cursor-grabbing transition-all ${S} ${w}`,children:[p.jsx("svg",{className:"w-3 h-3 text-gray-400 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:p.jsx("path",{d:"M7 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 2zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 14zm6-8a2 2 0 1 0-.001-4.001A2 2 0 0 0 13 6zm0 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 14z"})}),p.jsx(HL,{value:C,onChange:v=>r==null?void 0:r(x,v)}),p.jsx("span",{className:"text-xs text-gray-400",children:E.type.replace("_"," ")})]},E.name)})}):p.jsx("div",{className:"flex flex-wrap items-center gap-2",children:e.map(E=>{const x=E.label||Du(E.name),C=typeof E.default=="string"?E.default:void 0;switch(E.type){case"date_range":return p.jsx(RE,{name:E.name,label:x,defaultValue:C},E.name);case"select":{const S=(E.options||[]).map(w=>typeof w=="string"?{value:w,label:w}:w);return p.jsx(Dc,{name:E.name,label:x,options:S,defaultValue:C},E.name)}case"dynamic_select":return E.source?p.jsx(Dc,{name:E.name,label:x,source:E.source,defaultValue:C},E.name):p.jsxs("div",{className:"text-sm text-gray-500",children:[x,": dynamic_select requires source"]},E.name);case"multi_select":{const S=(E.options||[]).map(w=>typeof w=="string"?{value:w,label:w}:w);return p.jsx(LE,{name:E.name,label:x,options:S,defaultValue:Array.isArray(E.default)?E.default:void 0,source:E.source},E.name)}case"text":return p.jsx(FE,{name:E.name,label:x,defaultValue:C},E.name);case"number":return p.jsx(HE,{name:E.name,label:x,defaultValue:typeof E.default=="number"?E.default:void 0},E.name);case"boolean":return p.jsx(UE,{name:E.name,label:x},E.name);default:return p.jsxs("div",{className:"text-sm text-gray-500",children:[x,": ",E.type," (not supported)"]},E.name)}})})}function HL({value:e,onChange:t}){const[n,r]=L.useState(!1),[a,o]=L.useState(e);if(!n)return p.jsx("span",{className:"text-sm font-medium text-gray-700 cursor-text hover:text-blue-600 hover:underline",onClick:c=>{c.stopPropagation(),r(!0),o(e)},title:"Click to rename",children:e});function l(){a.trim()&&a!==e&&t(a.trim()),r(!1)}return p.jsx("input",{autoFocus:!0,value:a,onChange:c=>o(c.target.value),onBlur:l,onKeyDown:c=>{c.key==="Enter"&&l(),c.key==="Escape"&&r(!1)},className:"text-sm font-medium text-gray-700 bg-white border border-blue-300 rounded px-1 py-0 outline-none w-32",onClick:c=>c.stopPropagation()})}function UL({tabs:e,activeTab:t,onTabChange:n}){const{isEditing:r}=fo();return p.jsx("div",{className:"flex border-b border-gray-200 mb-4 mt-2",children:e.map(a=>p.jsx("button",{onClick:()=>n(a.name),disabled:r&&a.name!==t,className:Bn("px-4 py-2 text-sm font-medium border-b-2 transition-colors",a.name===t?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300",r&&a.name!==t&&"opacity-50 cursor-not-allowed hover:text-gray-500 hover:border-transparent"),children:a.label},a.name))})}function zL(){const e=qe(a=>a.crossFilters),t=qe(a=>a.clearCrossFilter),n=qe(a=>a.clearAllCrossFilters),r=Object.values(e);return r.length===0?null:p.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-4 py-2 mb-4",children:[p.jsx("span",{className:"text-xs text-gray-500 font-medium",children:"Filtered by:"}),r.map(a=>p.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs bg-blue-50 text-blue-700 rounded-md border border-blue-200",children:[a.field,": ",a.value,p.jsx("button",{onClick:()=>t(a.field),className:"ml-0.5 hover:text-blue-900","aria-label":`Clear ${a.field} filter`,children:p.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",children:p.jsx("path",{d:"M3 3l6 6M9 3l-6 6"})})})]},a.field)),r.length>1&&p.jsx("button",{onClick:n,className:"text-xs text-gray-500 hover:text-gray-700 underline",children:"Clear all"})]})}function WL({dashboardId:e,title:t,description:n,contentRef:r,tabs:a,activeTab:o,onTabChange:l,filters:c}){const{isEditing:d,pendingFilters:h,setPendingFilters:m}=fo();L.useEffect(()=>{d&&!h&&m([...c])},[d]);const g=d&&h?h:c;return p.jsxs(p.Fragment,{children:[p.jsx(jL,{dashboardId:e,title:t,description:n,contentRef:r,activeTab:a?o:void 0}),a&&o&&l&&p.jsx(UL,{tabs:a,activeTab:o,onTabChange:l}),g.length>0&&p.jsxs("div",{className:"yc-filter-bar sticky top-0 z-10 border-b px-6 py-3",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:[p.jsx(BL,{filters:g,isEditing:d,onReorder:E=>m(E),onRename:(E,x)=>{const C=[...g];C[E]={...C[E],label:x},m(C)}}),!d&&p.jsx(zL,{})]})]})}function YL({dashboardId:e,branch:t,initialTab:n}){const{data:r,isLoading:a,error:o}=Bw(e,t),l=L.useRef(null),c=jr(),d=qe(C=>C.globalFilters),[h,m]=L.useState(n||"");L.useEffect(()=>{r&&sessionStorage.setItem("yamchart-last-dashboard",JSON.stringify({name:r.name,title:r.title}))},[r==null?void 0:r.name,r==null?void 0:r.title]),L.useEffect(()=>{if(!(r!=null&&r.tabs))return;const C=r.tabs.map(w=>w.name);if(h&&C.includes(h))return;const S=n&&C.includes(n)?n:C[0];S&&m(S)},[r==null?void 0:r.tabs,n]);const g=L.useCallback(C=>{var w;m(C);const S=`#/dashboards/${e}`;if(window.history.replaceState(null,"",`${S}?tab=${encodeURIComponent(C)}`),r!=null&&r.name){const v=Object.fromEntries(Object.entries(d).filter(([O,A])=>A!=null));Pt.warmDashboardCache(r.name,v,C).catch(()=>{});const k=(w=r.tabs)==null?void 0:w.find(O=>O.name===C);if(k)for(const O of k.layout.rows)for(const A of O.widgets)A.type==="chart"&&A.ref&&c.prefetchQuery({queryKey:["chartWithData",A.ref,v],queryFn:()=>Pt.queryChart(A.ref,v,{includeConfig:!0}),staleTime:1e3*60*5})}},[e,r==null?void 0:r.name,r==null?void 0:r.tabs,d,c]),E=L.useMemo(()=>{if(r){if(r.tabs){const C=r.tabs.find(S=>S.name===h);return C==null?void 0:C.layout}return r.layout}},[r,h]),x=L.useMemo(()=>{if(!r)return[];const C=r.filters||[];if(r.tabs){const S=r.tabs.find(v=>v.name===h),w=(S==null?void 0:S.filters)||[];return[...C,...w]}return C},[r,h]);return a?p.jsx("div",{className:"flex items-center justify-center h-64",children:p.jsx("div",{className:"text-gray-500",children:"Loading dashboard..."})}):o||!r?p.jsx("div",{className:"flex items-center justify-center h-64",children:p.jsxs("div",{className:"text-red-500",children:["Failed to load dashboard: ",(o==null?void 0:o.message)||"Unknown error"]})}):E?p.jsx(jN,{children:p.jsxs("div",{style:{backgroundColor:"var(--yc-color-background)"},children:[p.jsx(WL,{dashboardId:e,title:r.title,description:r.description,contentRef:l,tabs:r.tabs,activeTab:h,onTabChange:r.tabs?g:void 0,filters:x}),p.jsx("div",{ref:l,className:"p-6",children:p.jsx(ML,{layout:E})})]})}):p.jsx("div",{className:"flex items-center justify-center h-64",children:p.jsx("div",{className:"text-gray-500",children:"No layout available"})})}const qL=L.lazy(()=>ks(()=>import("./LoginPage-OqFkz_X-.js"),__vite__mapDeps([0,1])).then(e=>({default:e.LoginPage}))),$L=L.lazy(()=>ks(()=>import("./SetupWizard-tGgbMxMZ.js"),__vite__mapDeps([2,1])).then(e=>({default:e.SetupWizard}))),VL=L.lazy(()=>ks(()=>import("./UserManagement-tXhwFzPz.js"),__vite__mapDeps([3,1])).then(e=>({default:e.UserManagement}))),QL=L.lazy(()=>ks(()=>import("./ShareManagement-T_AFVxIm.js"),__vite__mapDeps([4,1])).then(e=>({default:e.ShareManagement}))),GL=L.lazy(()=>ks(()=>import("./PublicViewer-bqV4skXX.js"),__vite__mapDeps([5,1])).then(e=>({default:e.PublicViewer}))),xc=()=>p.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:p.jsx("div",{className:"text-gray-500",children:"Loading..."})});function cb(e){const t=e.replace(/^#?/,""),n=t.match(/^\/settings\/(.+)$/);if(n&&n[1])return{type:"settings",name:n[1],params:{}};const[r,a]=t.split("?"),o=r==null?void 0:r.match(/^\/public\/(charts|dashboards)\/(.+)$/);if(o&&o[1]&&o[2]){const m={};if(a)for(const[g,E]of new URLSearchParams(a).entries())m[g]=E;return{type:o[1]==="dashboards"?"public_dashboard":"public_chart",name:decodeURIComponent(o[2]),params:m}}const[l,c]=t.split("?"),d=l==null?void 0:l.match(/^\/(dashboards|charts)\/(.+)$/);if(!d||!d[1]||!d[2])return null;const h={};if(c)for(const[m,g]of new URLSearchParams(c).entries())h[m]=g;return{type:d[1]==="dashboards"?"dashboard":"chart",name:decodeURIComponent(d[2]),params:h}}function XL(){zw();const e=eo(x=>x.auth),t=eo(x=>x.checkAuth);L.useEffect(()=>{t()},[t]);const{data:n,isLoading:r}=io(),{data:a,isLoading:o}=Vb(),l=qe(x=>x.clearAllCrossFilters),[c,d]=L.useState(()=>window.location.hash.replace(/^#/,"")||"");L.useEffect(()=>{const x=()=>{d(window.location.hash.replace(/^#/,"")||""),l()};return window.addEventListener("hashchange",x),()=>window.removeEventListener("hashchange",x)},[l]);const h=L.useCallback(x=>{window.location.hash=x,d(x),l()},[l]);L.useEffect(()=>{r||o||c||(a&&a.length>0&&a[0]?h(`/dashboards/${a[0].name}`):n!=null&&n.charts&&n.charts.length>0&&n.charts[0]&&h(`/charts/${n.charts[0].name}`))},[r,o,a,n,c,h]);const m=cb(c);if(m&&(m.type==="public_chart"||m.type==="public_dashboard"))return p.jsx(L.Suspense,{fallback:p.jsx(xc,{}),children:p.jsx(GL,{parsed:{type:m.type,name:m.name,params:m.params}})});if(e.status==="loading")return p.jsx(xc,{});if(e.status==="needs_setup")return p.jsx(L.Suspense,{fallback:p.jsx(xc,{}),children:p.jsx($L,{})});if(e.status==="unauthenticated")return p.jsx(L.Suspense,{fallback:p.jsx(xc,{}),children:p.jsx(qL,{})});if(r||o)return p.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:p.jsx("div",{className:"text-gray-500",children:"Loading..."})});const g=cb(c),E=()=>g?g.type==="settings"&&g.name==="users"?p.jsx(L.Suspense,{fallback:p.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Loading..."}),children:p.jsx(VL,{})}):g.type==="settings"&&g.name==="shares"?p.jsx(L.Suspense,{fallback:p.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Loading..."}),children:p.jsx(QL,{})}):g.type==="dashboard"?p.jsx(YL,{dashboardId:g.name,initialTab:g.params.tab}):p.jsx(PN,{chartName:g.name,drillParams:g.params}):p.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Select a dashboard or chart from the sidebar"});return p.jsx(Aw,{children:p.jsx(Qw,{currentPath:c,onNavigate:h,onNavigateToUsers:()=>h("/settings/users"),onNavigateToShares:()=>h("/settings/shares"),children:E()})})}qv.createRoot(document.getElementById("root")).render(p.jsx(L.StrictMode,{children:p.jsx(ww,{children:p.jsx(XL,{})})}));export{Wu as A,$E as B,rx as C,bN as D,zE as F,tx as G,JE as H,qE as L,QE as P,uN as S,e0 as T,ex as W,ks as _,Pt as a,Yb as b,Bn as c,$b as d,io as e,k0 as f,qe as g,ZE as h,KE as i,p as j,XE as k,GE as l,VE as m,YL as n,eo as u};
|