yamchart 0.4.17 → 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-XXQU2TZ2.js → chunk-3RYZTXPH.js} +2 -2
- package/dist/{chunk-QMGKVN2X.js → chunk-45SP26I2.js} +2 -2
- package/dist/{chunk-3I5PUINM.js → chunk-UDRJFEJU.js} +2 -1
- package/dist/chunk-UDRJFEJU.js.map +1 -0
- package/dist/{connection-utils-T7DZL6MI.js → connection-utils-26ZE4KUZ.js} +3 -3
- package/dist/{describe-G3YXRE7X.js → describe-SYP5GZ3H.js} +3 -3
- package/dist/{dev-BUMIVTPN.js → dev-OHAXDNXA.js} +3 -3
- 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-Csxcdlds.css → index-CVBWIBuV.css} +1 -1
- package/dist/public/assets/index-_hAEavHQ.js +165 -0
- package/dist/public/assets/{index.es-hreeCzNo.js → index.es-BBtc9P44.js} +1 -1
- package/dist/public/assets/{jspdf.es.min-C6Vul2EZ.js → jspdf.es.min-DG8sO809.js} +3 -3
- package/dist/public/index.html +2 -2
- package/dist/{query-OEEQA6RQ.js → query-LRPR6YRE.js} +3 -3
- package/dist/{sample-UV4GM2D4.js → sample-D4HDOJWP.js} +3 -3
- package/dist/{search-AV6NW2KG.js → search-CXBNM2KK.js} +3 -3
- package/dist/{tables-MPSCAUHL.js → tables-ZY3NRC6E.js} +3 -3
- package/dist/templates/default/docs/yamchart-reference.md +14 -0
- package/dist/{test-HE5MDTTX.js → test-NKYO32Y5.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-3I5PUINM.js.map +0 -1
- package/dist/public/assets/LoginPage-OByqHc4n.js +0 -1
- package/dist/public/assets/PublicViewer-DUhQW5m5.js +0 -1
- package/dist/public/assets/SetupWizard-DG46QOHB.js +0 -1
- package/dist/public/assets/ShareManagement-DAsSD-YD.js +0 -1
- package/dist/public/assets/UserManagement-DZfM0Ovz.js +0 -1
- package/dist/public/assets/index-DDmMI9nF.js +0 -164
- /package/dist/{chunk-XXQU2TZ2.js.map → chunk-3RYZTXPH.js.map} +0 -0
- /package/dist/{chunk-QMGKVN2X.js.map → chunk-45SP26I2.js.map} +0 -0
- /package/dist/{connection-utils-T7DZL6MI.js.map → connection-utils-26ZE4KUZ.js.map} +0 -0
- /package/dist/{describe-G3YXRE7X.js.map → describe-SYP5GZ3H.js.map} +0 -0
- /package/dist/{dev-BUMIVTPN.js.map → dev-OHAXDNXA.js.map} +0 -0
- /package/dist/{query-OEEQA6RQ.js.map → query-LRPR6YRE.js.map} +0 -0
- /package/dist/{sample-UV4GM2D4.js.map → sample-D4HDOJWP.js.map} +0 -0
- /package/dist/{search-AV6NW2KG.js.map → search-CXBNM2KK.js.map} +0 -0
- /package/dist/{tables-MPSCAUHL.js.map → tables-ZY3NRC6E.js.map} +0 -0
- /package/dist/{test-HE5MDTTX.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-OByqHc4n.js","assets/echarts-DtOYsfLX.js","assets/SetupWizard-DG46QOHB.js","assets/UserManagement-DZfM0Ovz.js","assets/ShareManagement-DAsSD-YD.js","assets/PublicViewer-DUhQW5m5.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var jv=Object.defineProperty;var qg=e=>{throw TypeError(e)};var Bv=(e,t,n)=>t in e?jv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ve=(e,t,n)=>Bv(e,typeof t!="symbol"?t+"":t,n),$f=(e,t,n)=>t.has(e)||qg("Cannot "+n);var W=(e,t,n)=>($f(e,t,"read from private field"),n?n.call(e):t.get(e)),we=(e,t,n)=>t.has(e)?qg("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ye=(e,t,n,r)=>($f(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Be=(e,t,n)=>($f(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 Hv,g as _b}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 u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&r(u)}).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 Vf={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 $g;function Uv(){if($g)return Zo;$g=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 u(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=u,Zo.jsxs=u,Zo}var Vg;function zv(){return Vg||(Vg=1,Vf.exports=Uv()),Vf.exports}var p=zv(),ic={},Qf={exports:{}},Qn={},Gf={exports:{}},Xf={};/**
|
|
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 Qg;function Wv(){return Qg||(Qg=1,(function(e){function t(Z,K){var R=Z.length;Z.push(K);e:for(;0<R;){var ue=R-1>>>1,oe=Z[ue];if(0<a(oe,K))Z[ue]=K,Z[R]=oe,R=ue;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 ue=0,oe=Z.length,U=oe>>>1;ue<U;){var Oe=2*(ue+1)-1,Le=Z[Oe],Te=Oe+1,Ze=Z[Te];if(0>a(Le,R))Te<oe&&0>a(Ze,Le)?(Z[ue]=Ze,Z[Te]=R,ue=Te):(Z[ue]=Le,Z[Oe]=R,ue=Oe);else if(Te<oe&&0>a(Ze,R))Z[ue]=Ze,Z[Te]=R,ue=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 u=Date,c=u.now();e.unstable_now=function(){return u.now()-c}}var d=[],h=[],m=1,g=null,E=3,x=!1,k=!1,S=!1,w=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,C=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),!k)if(n(d)!==null)k=!0,G(P);else{var K=n(h);K!==null&&re(A,K.startTime-Z)}}function P(Z,K){k=!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 ue=g.callback;if(typeof ue=="function"){g.callback=null,E=g.priorityLevel;var oe=ue(g.expirationTime<=K);K=e.unstable_now(),typeof oe=="function"?g.callback=oe:g===n(d)&&r(d),O(K)}else r(d);g=n(d)}if(g!==null)var U=!0;else{var Oe=n(h);Oe!==null&&re(A,Oe.startTime-K),U=!1}return U}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 C=="function")$=function(){C(H)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,J=Q.port2;Q.port1.onmessage=H,$=function(){J.postMessage(null)}}else $=function(){w(H,0)};function G(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(){k||x||(k=!0,G(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 ue=e.unstable_now();switch(typeof R=="object"&&R!==null?(R=R.delay,R=typeof R=="number"&&0<R?ue+R:ue):R=ue,Z){case 1:var oe=-1;break;case 2:oe=250;break;case 5:oe=1073741823;break;case 4:oe=1e4;break;default:oe=5e3}return oe=R+oe,Z={id:m++,callback:K,priorityLevel:Z,startTime:R,expirationTime:oe,sortIndex:-1},R>ue?(Z.sortIndex=R,t(h,Z),n(d)===null&&Z===n(h)&&(S?(v(I),I=-1):S=!0,re(A,R-ue))):(Z.sortIndex=oe,t(d,Z),k||x||(k=!0,G(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}}}})(Xf)),Xf}var Gg;function Yv(){return Gg||(Gg=1,Gf.exports=Wv()),Gf.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 Xg;function qv(){if(Xg)return Qn;Xg=1;var e=ti(),t=Yv();function n(s){for(var i="https://reactjs.org/docs/error-decoder.html?invariant="+s,l=1;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l]);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){u(s,i),u(s+"Capture",i)}function u(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,l,f){if(l!==null&&l.type===0)return!1;switch(typeof i){case"function":case"symbol":return!0;case"boolean":return f?!1:l!==null?!l.acceptsBooleans:(s=s.toLowerCase().slice(0,5),s!=="data-"&&s!=="aria-");default:return!1}}function k(s,i,l,f){if(i===null||typeof i>"u"||x(s,i,l,f))return!0;if(f)return!1;if(l!==null)switch(l.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,l,f,b,T,D){this.acceptsBooleans=i===2||i===3||i===4,this.attributeName=f,this.attributeNamespace=b,this.mustUseProperty=l,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 C(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,C);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,C);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,C);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,l,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")&&(k(i,l,b,f)&&(l=null),f||b===null?E(i)&&(l===null?s.removeAttribute(i):s.setAttribute(i,""+l)):b.mustUseProperty?s[b.propertyName]=l===null?b.type===3?!1:"":l:(i=b.attributeName,f=b.attributeNamespace,l===null?s.removeAttribute(i):(b=b.type,l=b===3||b===4&&l===!0?"":""+l,f?s.setAttributeNS(f,i,l):s.setAttribute(i,l))))}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"),Q=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),G=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,ue;function oe(s){if(ue===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);ue=i&&i[1]||""}return`
|
|
27
|
-
`+ue+s}var U=!1;function Oe(s,i){if(!s||U)return"";U=!0;var l=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{U=!1,Error.prepareStackTrace=l}return(s=s?s.displayName||s.name:"")?oe(s):""}function Le(s){switch(s.tag){case 5:return oe(s.type);case 16:return oe("Lazy");case 13:return oe("Suspense");case 19:return oe("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 Q: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 G: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",l=Object.getOwnPropertyDescriptor(s.constructor.prototype,i),f=""+s[i];if(!s.hasOwnProperty(i)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var b=l.get,T=l.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:l.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 l=i.getValue(),f="";return s&&(f=Ge(s)?s.checked?"true":"false":s.value),s=f,s!==l?(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 l=i.checked;return R({},i,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:l??s._wrapperState.initialChecked})}function tn(s,i){var l=i.defaultValue==null?"":i.defaultValue,f=i.checked!=null?i.checked:i.defaultChecked;l=$e(i.value!=null?i.value:l),s._wrapperState={initialChecked:f,initialValue:l,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 l=$e(i.value),f=i.type;if(l!=null)f==="number"?(l===0&&s.value===""||s.value!=l)&&(s.value=""+l):s.value!==""+l&&(s.value=""+l);else if(f==="submit"||f==="reset"){s.removeAttribute("value");return}i.hasOwnProperty("value")?it(s,i.type,l):i.hasOwnProperty("defaultValue")&&it(s,i.type,$e(i.defaultValue)),i.checked==null&&i.defaultChecked!=null&&(s.defaultChecked=!!i.defaultChecked)}function tr(s,i,l){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,l||i===s.value||(s.value=i),s.defaultValue=i}l=s.name,l!==""&&(s.name=""),s.defaultChecked=!!s._wrapperState.initialChecked,l!==""&&(s.name=l)}function it(s,i,l){(i!=="number"||Gt(s.ownerDocument)!==s)&&(l==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+l&&(s.defaultValue=""+l))}var nt=Array.isArray;function Et(s,i,l,f){if(s=s.options,i){i={};for(var b=0;b<l.length;b++)i["$"+l[b]]=!0;for(l=0;l<s.length;l++)b=i.hasOwnProperty("$"+s[l].value),s[l].selected!==b&&(s[l].selected=b),b&&f&&(s[l].defaultSelected=!0)}else{for(l=""+$e(l),i=null,b=0;b<s.length;b++){if(s[b].value===l){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 l=i.value;if(l==null){if(l=i.children,i=i.defaultValue,l!=null){if(i!=null)throw Error(n(92));if(nt(l)){if(1<l.length)throw Error(n(93));l=l[0]}i=l}i==null&&(i=""),l=i}s._wrapperState={initialValue:$e(l)}}function nr(s,i){var l=$e(i.value),f=$e(i.defaultValue);l!=null&&(l=""+l,l!==s.value&&(s.value=l),i.defaultValue==null&&s.defaultValue!==l&&(s.defaultValue=l)),f!=null&&(s.defaultValue=""+f)}function un(s){var i=s.textContent;i===s._wrapperState.initialValue&&i!==""&&i!==null&&(s.value=i)}function ie(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"?ie(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,l,f,b){MSApp.execUnsafeLocalFunction(function(){return s(i,l,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 l=s.firstChild;if(l&&l===s.lastChild&&l.nodeType===3){l.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,l){return i==null||typeof i=="boolean"||i===""?"":l||typeof i!="number"||i===0||gt.hasOwnProperty(s)&>[s]?(""+i).trim():i+"px"}function _n(s,i){s=s.style;for(var l in i)if(i.hasOwnProperty(l)){var f=l.indexOf("--")===0,b=rn(l,i[l],f);l==="float"&&(l="cssFloat"),f?s.setProperty(l,b):s[l]=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 Me=null,Qe=null,be=null;function _e(s){if(s=jo(s)){if(typeof Me!="function")throw Error(n(280));var i=s.stateNode;i&&(i=xl(i),Me(s.stateNode,s.type,i))}}function Je(s){Qe?be?be.push(s):be=[s]:Qe=s}function ke(){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,l){if(Yt)return s(i,l);Yt=!0;try{return It(s,i,l)}finally{Yt=!1,(Qe!==null||be!==null)&&(Wt(),ke())}}function qt(s,i){var l=s.stateNode;if(l===null)return null;var f=xl(l);if(f===null)return null;l=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(l&&typeof l!="function")throw Error(n(231,i,typeof l));return l}var kn=!1;if(c)try{var zn={};Object.defineProperty(zn,"passive",{get:function(){kn=!0}}),window.addEventListener("test",zn,zn),window.removeEventListener("test",zn,zn)}catch{kn=!1}function Ur(s,i,l,f,b,T,D,Y,V){var se=Array.prototype.slice.call(arguments,3);try{i.apply(l,se)}catch(de){this.onError(de)}}var Ce=!1,Ye=null,Pe=!1,rt=null,dt={onError:function(s){Ce=!0,Ye=s}};function ot(s,i,l,f,b,T,D,Y,V){Ce=!1,Ye=null,Ur.apply(dt,arguments)}function xt(s,i,l,f,b,T,D,Y,V){if(ot.apply(this,arguments),Ce){if(Ce){var se=Ye;Ce=!1,Ye=null}else throw Error(n(198));Pe||(Pe=!0,rt=se)}}function Tt(s){var i=s,l=s;if(s.alternate)for(;i.return;)i=i.return;else{s=i;do i=s,(i.flags&4098)!==0&&(l=i.return),s=i.return;while(s)}return i.tag===3?l: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 l=s,f=i;;){var b=l.return;if(b===null)break;var T=b.alternate;if(T===null){if(f=b.return,f!==null){l=f;continue}break}if(b.child===T.child){for(T=b.child;T;){if(T===l)return cn(b),s;if(T===f)return cn(b),i;T=T.sibling}throw Error(n(188))}if(l.return!==f.return)l=b,f=T;else{for(var D=!1,Y=b.child;Y;){if(Y===l){D=!0,l=b,f=T;break}if(Y===f){D=!0,f=b,l=T;break}Y=Y.sibling}if(!D){for(Y=T.child;Y;){if(Y===l){D=!0,l=T,f=b;break}if(Y===f){D=!0,f=T,l=b;break}Y=Y.sibling}if(!D)throw Error(n(189))}}if(l.alternate!==f)throw Error(n(190))}if(l.tag!==3)throw Error(n(188));return l.stateNode.current===l?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,xp=t.unstable_UserBlockingPriority,el=t.unstable_NormalPriority,J2=t.unstable_LowPriority,Tp=t.unstable_IdlePriority,tl=null,zr=null;function Z2(s){if(zr&&typeof zr.onCommitFiberRoot=="function")try{zr.onCommitFiberRoot(tl,s,void 0,(s.current.flags&128)===128)}catch{}}var kr=Math.clz32?Math.clz32:nT,eT=Math.log,tT=Math.LN2;function nT(s){return s>>>=0,s===0?32:31-(eT(s)/tT|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 l=s.pendingLanes;if(l===0)return 0;var f=0,b=s.suspendedLanes,T=s.pingedLanes,D=l&268435455;if(D!==0){var Y=D&~b;Y!==0?f=xo(Y):(T&=D,T!==0&&(f=xo(T)))}else D=l&~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|=l&16),i=s.entangledLanes,i!==0)for(s=s.entanglements,i&=f;0<i;)l=31-kr(i),b=1<<l,f|=s[l],i&=~b;return f}function rT(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 sT(s,i){for(var l=s.suspendedLanes,f=s.pingedLanes,b=s.expirationTimes,T=s.pendingLanes;0<T;){var D=31-kr(T),Y=1<<D,V=b[D];V===-1?((Y&l)===0||(Y&f)!==0)&&(b[D]=rT(Y,i)):V<=i&&(s.expiredLanes|=Y),T&=~Y}}function fd(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function vp(){var s=nl;return nl<<=1,(nl&4194240)===0&&(nl=64),s}function hd(s){for(var i=[],l=0;31>l;l++)i.push(s);return i}function To(s,i,l){s.pendingLanes|=i,i!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,i=31-kr(i),s[i]=l}function aT(s,i){var l=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<l;){var b=31-kr(l),T=1<<b;i[b]=0,f[b]=-1,s[b]=-1,l&=~T}}function pd(s,i){var l=s.entangledLanes|=i;for(s=s.entanglements;l;){var f=31-kr(l),b=1<<f;b&i|s[f]&i&&(s[f]|=i),l&=~b}}var pt=0;function wp(s){return s&=-s,1<s?4<s?(s&268435455)!==0?16:536870912:4:1}var Sp,md,_p,kp,Cp,gd=!1,al=[],Ds=null,As=null,Is=null,vo=new Map,wo=new Map,Rs=[],iT="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 Np(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,l,f,b,T){return s===null||s.nativeEvent!==T?(s={blockedOn:i,domEventName:l,eventSystemFlags:f,nativeEvent:T,targetContainers:[b]},i!==null&&(i=jo(i),i!==null&&md(i)),s):(s.eventSystemFlags|=f,i=s.targetContainers,b!==null&&i.indexOf(b)===-1&&i.push(b),s)}function oT(s,i,l,f,b){switch(i){case"focusin":return Ds=So(Ds,s,i,l,f,b),!0;case"dragenter":return As=So(As,s,i,l,f,b),!0;case"mouseover":return Is=So(Is,s,i,l,f,b),!0;case"pointerover":var T=b.pointerId;return vo.set(T,So(vo.get(T)||null,s,i,l,f,b)),!0;case"gotpointercapture":return T=b.pointerId,wo.set(T,So(wo.get(T)||null,s,i,l,f,b)),!0}return!1}function Op(s){var i=xa(s.target);if(i!==null){var l=Tt(i);if(l!==null){if(i=l.tag,i===13){if(i=bt(l),i!==null){s.blockedOn=i,Cp(s.priority,function(){_p(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){s.blockedOn=l.tag===3?l.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 l=bd(s.domEventName,s.eventSystemFlags,i[0],s.nativeEvent);if(l===null){l=s.nativeEvent;var f=new l.constructor(l.type,l);ln=f,l.target.dispatchEvent(f),ln=null}else return i=jo(l),i!==null&&md(i),s.blockedOn=l,!1;i.shift()}return!0}function Dp(s,i,l){il(s)&&l.delete(i)}function uT(){gd=!1,Ds!==null&&il(Ds)&&(Ds=null),As!==null&&il(As)&&(As=null),Is!==null&&il(Is)&&(Is=null),vo.forEach(Dp),wo.forEach(Dp)}function _o(s,i){s.blockedOn===i&&(s.blockedOn=null,gd||(gd=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,uT)))}function ko(s){function i(b){return _o(b,s)}if(0<al.length){_o(al[0],s);for(var l=1;l<al.length;l++){var f=al[l];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),l=0;l<Rs.length;l++)f=Rs[l],f.blockedOn===s&&(f.blockedOn=null);for(;0<Rs.length&&(l=Rs[0],l.blockedOn===null);)Op(l),l.blockedOn===null&&Rs.shift()}var li=A.ReactCurrentBatchConfig,ol=!0;function lT(s,i,l,f){var b=pt,T=li.transition;li.transition=null;try{pt=1,yd(s,i,l,f)}finally{pt=b,li.transition=T}}function cT(s,i,l,f){var b=pt,T=li.transition;li.transition=null;try{pt=4,yd(s,i,l,f)}finally{pt=b,li.transition=T}}function yd(s,i,l,f){if(ol){var b=bd(s,i,l,f);if(b===null)Md(s,i,f,ul,l),Np(s,f);else if(oT(b,s,i,l,f))f.stopPropagation();else if(Np(s,f),i&4&&-1<iT.indexOf(s)){for(;b!==null;){var T=jo(b);if(T!==null&&Sp(T),T=bd(s,i,l,f),T===null&&Md(s,i,f,ul,l),T===b)break;b=T}b!==null&&f.stopPropagation()}else Md(s,i,f,null,l)}}var ul=null;function bd(s,i,l,f){if(ul=null,s=_r(f),s=xa(s),s!==null)if(i=Tt(s),i===null)s=null;else if(l=i.tag,l===13){if(s=bt(i),s!==null)return s;s=null}else if(l===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 Ap(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 xp:return 4;case el:case J2:return 16;case Tp:return 536870912;default:return 16}default:return 16}}var Ls=null,Ed=null,ll=null;function Ip(){if(ll)return ll;var s,i=Ed,l=i.length,f,b="value"in Ls?Ls.value:Ls.textContent,T=b.length;for(s=0;s<l&&i[s]===b[s];s++);var D=l-s;for(f=1;f<=D&&i[l-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 Rp(){return!1}function rr(s){function i(l,f,b,T,D){this._reactName=l,this._targetInst=b,this.type=f,this.nativeEvent=T,this.target=D,this.currentTarget=null;for(var Y in s)s.hasOwnProperty(Y)&&(l=s[Y],this[Y]=l?l(T):T[Y]);return this.isDefaultPrevented=(T.defaultPrevented!=null?T.defaultPrevented:T.returnValue===!1)?dl:Rp,this.isPropagationStopped=Rp,this}return R(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=dl)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.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},xd=rr(ci),Co=R({},ci,{view:0,detail:0}),dT=rr(Co),Td,vd,No,fl=R({},Co,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sd,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"?(Td=s.screenX-No.screenX,vd=s.screenY-No.screenY):vd=Td=0,No=s),Td)},movementY:function(s){return"movementY"in s?s.movementY:vd}}),Lp=rr(fl),fT=R({},fl,{dataTransfer:0}),hT=rr(fT),pT=R({},Co,{relatedTarget:0}),wd=rr(pT),mT=R({},ci,{animationName:0,elapsedTime:0,pseudoElement:0}),gT=rr(mT),yT=R({},ci,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),bT=rr(yT),ET=R({},ci,{data:0}),Mp=rr(ET),xT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},TT={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"},vT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function wT(s){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(s):(s=vT[s])?!!i[s]:!1}function Sd(){return wT}var ST=R({},Co,{key:function(s){if(s.key){var i=xT[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"?TT[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sd,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}}),_T=rr(ST),kT=R({},fl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Pp=rr(kT),CT=R({},Co,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sd}),NT=rr(CT),OT=R({},ci,{propertyName:0,elapsedTime:0,pseudoElement:0}),DT=rr(OT),AT=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}),IT=rr(AT),RT=[9,13,27,32],_d=c&&"CompositionEvent"in window,Oo=null;c&&"documentMode"in document&&(Oo=document.documentMode);var LT=c&&"TextEvent"in window&&!Oo,Fp=c&&(!_d||Oo&&8<Oo&&11>=Oo),jp=" ",Bp=!1;function Hp(s,i){switch(s){case"keyup":return RT.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Up(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var di=!1;function MT(s,i){switch(s){case"compositionend":return Up(i);case"keypress":return i.which!==32?null:(Bp=!0,jp);case"textInput":return s=i.data,s===jp&&Bp?null:s;default:return null}}function PT(s,i){if(di)return s==="compositionend"||!_d&&Hp(s,i)?(s=Ip(),ll=Ed=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 Fp&&i.locale!=="ko"?null:i.data;default:return null}}var FT={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 zp(s){var i=s&&s.nodeName&&s.nodeName.toLowerCase();return i==="input"?!!FT[s.type]:i==="textarea"}function Wp(s,i,l,f){Je(f),i=yl(i,"onChange"),0<i.length&&(l=new xd("onChange","change",null,l,f),s.push({event:l,listeners:i}))}var Do=null,Ao=null;function jT(s){om(s,0)}function hl(s){var i=gi(s);if(pn(i))return s}function BT(s,i){if(s==="change")return i}var Yp=!1;if(c){var kd;if(c){var Cd="oninput"in document;if(!Cd){var qp=document.createElement("div");qp.setAttribute("oninput","return;"),Cd=typeof qp.oninput=="function"}kd=Cd}else kd=!1;Yp=kd&&(!document.documentMode||9<document.documentMode)}function $p(){Do&&(Do.detachEvent("onpropertychange",Vp),Ao=Do=null)}function Vp(s){if(s.propertyName==="value"&&hl(Ao)){var i=[];Wp(i,Ao,s,_r(s)),Rt(jT,i)}}function HT(s,i,l){s==="focusin"?($p(),Do=i,Ao=l,Do.attachEvent("onpropertychange",Vp)):s==="focusout"&&$p()}function UT(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return hl(Ao)}function zT(s,i){if(s==="click")return hl(i)}function WT(s,i){if(s==="input"||s==="change")return hl(i)}function YT(s,i){return s===i&&(s!==0||1/s===1/i)||s!==s&&i!==i}var Cr=typeof Object.is=="function"?Object.is:YT;function Io(s,i){if(Cr(s,i))return!0;if(typeof s!="object"||s===null||typeof i!="object"||i===null)return!1;var l=Object.keys(s),f=Object.keys(i);if(l.length!==f.length)return!1;for(f=0;f<l.length;f++){var b=l[f];if(!d.call(i,b)||!Cr(s[b],i[b]))return!1}return!0}function Qp(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function Gp(s,i){var l=Qp(s);s=0;for(var f;l;){if(l.nodeType===3){if(f=s+l.textContent.length,s<=i&&f>=i)return{node:l,offset:i-s};s=f}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Qp(l)}}function Xp(s,i){return s&&i?s===i?!0:s&&s.nodeType===3?!1:i&&i.nodeType===3?Xp(s,i.parentNode):"contains"in s?s.contains(i):s.compareDocumentPosition?!!(s.compareDocumentPosition(i)&16):!1:!1}function Kp(){for(var s=window,i=Gt();i instanceof s.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)s=i.contentWindow;else break;i=Gt(s.document)}return i}function Nd(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 qT(s){var i=Kp(),l=s.focusedElem,f=s.selectionRange;if(i!==l&&l&&l.ownerDocument&&Xp(l.ownerDocument.documentElement,l)){if(f!==null&&Nd(l)){if(i=f.start,s=f.end,s===void 0&&(s=i),"selectionStart"in l)l.selectionStart=i,l.selectionEnd=Math.min(s,l.value.length);else if(s=(i=l.ownerDocument||document)&&i.defaultView||window,s.getSelection){s=s.getSelection();var b=l.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=Gp(l,T);var D=Gp(l,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=l;s=s.parentNode;)s.nodeType===1&&i.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<i.length;l++)s=i[l],s.element.scrollLeft=s.left,s.element.scrollTop=s.top}}var $T=c&&"documentMode"in document&&11>=document.documentMode,fi=null,Od=null,Ro=null,Dd=!1;function Jp(s,i,l){var f=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Dd||fi==null||fi!==Gt(f)||(f=fi,"selectionStart"in f&&Nd(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(Od,"onSelect"),0<f.length&&(i=new xd("onSelect","select",null,i,l),s.push({event:i,listeners:f}),i.target=fi)))}function pl(s,i){var l={};return l[s.toLowerCase()]=i.toLowerCase(),l["Webkit"+s]="webkit"+i,l["Moz"+s]="moz"+i,l}var hi={animationend:pl("Animation","AnimationEnd"),animationiteration:pl("Animation","AnimationIteration"),animationstart:pl("Animation","AnimationStart"),transitionend:pl("Transition","TransitionEnd")},Ad={},Zp={};c&&(Zp=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(Ad[s])return Ad[s];if(!hi[s])return s;var i=hi[s],l;for(l in i)if(i.hasOwnProperty(l)&&l in Zp)return Ad[s]=i[l];return s}var em=ml("animationend"),tm=ml("animationiteration"),nm=ml("animationstart"),rm=ml("transitionend"),sm=new Map,am="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){sm.set(s,i),o(i,[s])}for(var Id=0;Id<am.length;Id++){var Rd=am[Id],VT=Rd.toLowerCase(),QT=Rd[0].toUpperCase()+Rd.slice(1);Ms(VT,"on"+QT)}Ms(em,"onAnimationEnd"),Ms(tm,"onAnimationIteration"),Ms(nm,"onAnimationStart"),Ms("dblclick","onDoubleClick"),Ms("focusin","onFocus"),Ms("focusout","onBlur"),Ms(rm,"onTransitionEnd"),u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("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(" "),GT=new Set("cancel close invalid load scroll toggle".split(" ").concat(Lo));function im(s,i,l){var f=s.type||"unknown-event";s.currentTarget=l,xt(f,i,void 0,s),s.currentTarget=null}function om(s,i){i=(i&4)!==0;for(var l=0;l<s.length;l++){var f=s[l],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;im(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;im(b,Y,se),T=V}}}if(Pe)throw s=rt,Pe=!1,rt=null,s}function Ot(s,i){var l=i[Ud];l===void 0&&(l=i[Ud]=new Set);var f=s+"__bubble";l.has(f)||(um(i,s,2,!1),l.add(f))}function Ld(s,i,l){var f=0;i&&(f|=4),um(l,s,f,i)}var gl="_reactListening"+Math.random().toString(36).slice(2);function Mo(s){if(!s[gl]){s[gl]=!0,r.forEach(function(l){l!=="selectionchange"&&(GT.has(l)||Ld(l,!1,s),Ld(l,!0,s))});var i=s.nodeType===9?s:s.ownerDocument;i===null||i[gl]||(i[gl]=!0,Ld("selectionchange",!1,i))}}function um(s,i,l,f){switch(Ap(i)){case 1:var b=lT;break;case 4:b=cT;break;default:b=yd}l=b.bind(null,i,l,s),b=void 0,!kn||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(b=!0),f?b!==void 0?s.addEventListener(i,l,{capture:!0,passive:b}):s.addEventListener(i,l,!0):b!==void 0?s.addEventListener(i,l,{passive:b}):s.addEventListener(i,l,!1)}function Md(s,i,l,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(l),fe=[];e:{var le=sm.get(s);if(le!==void 0){var xe=xd,Ne=s;switch(s){case"keypress":if(cl(l)===0)break e;case"keydown":case"keyup":xe=_T;break;case"focusin":Ne="focus",xe=wd;break;case"focusout":Ne="blur",xe=wd;break;case"beforeblur":case"afterblur":xe=wd;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":xe=Lp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":xe=hT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":xe=NT;break;case em:case tm:case nm:xe=gT;break;case rm:xe=DT;break;case"scroll":xe=dT;break;case"wheel":xe=IT;break;case"copy":case"cut":case"paste":xe=bT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":xe=Pp}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,l,de),fe.push({event:le,listeners:Ae}))}}if((i&7)===0){e:{if(le=s==="mouseover"||s==="pointerover",xe=s==="mouseout"||s==="pointerout",le&&l!==ln&&(Ne=l.relatedTarget||l.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=l.relatedTarget||l.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=Lp,ge="onMouseLeave",ee="onMouseEnter",X="mouse",(s==="pointerout"||s==="pointerover")&&(Ae=Pp,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,l,de),le.target=Xt,le.relatedTarget=ne,ge=null,xa(de)===se&&(Ae=new Ae(ee,X+"enter",Ne,l,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&&lm(fe,le,xe,Ae,!1),Ne!==null&&Xt!==null&&lm(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=BT;else if(zp(le))if(Yp)Ie=WT;else{Ie=UT;var Fe=HT}else(xe=le.nodeName)&&xe.toLowerCase()==="input"&&(le.type==="checkbox"||le.type==="radio")&&(Ie=zT);if(Ie&&(Ie=Ie(s,se))){Wp(fe,Ie,l,de);break e}Fe&&Fe(s,le,se),s==="focusout"&&(Fe=le._wrapperState)&&Fe.controlled&&le.type==="number"&&it(le,"number",le.value)}switch(Fe=se?gi(se):window,s){case"focusin":(zp(Fe)||Fe.contentEditable==="true")&&(fi=Fe,Od=se,Ro=null);break;case"focusout":Ro=Od=fi=null;break;case"mousedown":Dd=!0;break;case"contextmenu":case"mouseup":case"dragend":Dd=!1,Jp(fe,l,de);break;case"selectionchange":if($T)break;case"keydown":case"keyup":Jp(fe,l,de)}var je;if(_d)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?Hp(s,l)&&(Ue="onCompositionEnd"):s==="keydown"&&l.keyCode===229&&(Ue="onCompositionStart");Ue&&(Fp&&l.locale!=="ko"&&(di||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&di&&(je=Ip()):(Ls=de,Ed="value"in Ls?Ls.value:Ls.textContent,di=!0)),Fe=yl(se,Ue),0<Fe.length&&(Ue=new Mp(Ue,s,null,l,de),fe.push({event:Ue,listeners:Fe}),je?Ue.data=je:(je=Up(l),je!==null&&(Ue.data=je)))),(je=LT?MT(s,l):PT(s,l))&&(se=yl(se,"onBeforeInput"),0<se.length&&(de=new Mp("onBeforeInput","beforeinput",null,l,de),fe.push({event:de,listeners:se}),de.data=je))}om(fe,i)})}function Po(s,i,l){return{instance:s,listener:i,currentTarget:l}}function yl(s,i){for(var l=i+"Capture",f=[];s!==null;){var b=s,T=b.stateNode;b.tag===5&&T!==null&&(b=T,T=qt(s,l),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 lm(s,i,l,f,b){for(var T=i._reactName,D=[];l!==null&&l!==f;){var Y=l,V=Y.alternate,se=Y.stateNode;if(V!==null&&V===f)break;Y.tag===5&&se!==null&&(Y=se,b?(V=qt(l,T),V!=null&&D.unshift(Po(l,V,Y))):b||(V=qt(l,T),V!=null&&D.push(Po(l,V,Y)))),l=l.return}D.length!==0&&s.push({event:i,listeners:D})}var XT=/\r\n?/g,KT=/\u0000|\uFFFD/g;function cm(s){return(typeof s=="string"?s:""+s).replace(XT,`
|
|
31
|
-
`).replace(KT,"")}function bl(s,i,l){if(i=cm(i),cm(s)!==i&&l)throw Error(n(425))}function El(){}var Pd=null,Fd=null;function jd(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 Bd=typeof setTimeout=="function"?setTimeout:void 0,JT=typeof clearTimeout=="function"?clearTimeout:void 0,dm=typeof Promise=="function"?Promise:void 0,ZT=typeof queueMicrotask=="function"?queueMicrotask:typeof dm<"u"?function(s){return dm.resolve(null).then(s).catch(ev)}:Bd;function ev(s){setTimeout(function(){throw s})}function Hd(s,i){var l=i,f=0;do{var b=l.nextSibling;if(s.removeChild(l),b&&b.nodeType===8)if(l=b.data,l==="/$"){if(f===0){s.removeChild(b),ko(i);return}f--}else l!=="$"&&l!=="$?"&&l!=="$!"||f++;l=b}while(l);ko(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 fm(s){s=s.previousSibling;for(var i=0;s;){if(s.nodeType===8){var l=s.data;if(l==="$"||l==="$!"||l==="$?"){if(i===0)return s;i--}else l==="/$"&&i++}s=s.previousSibling}return null}var mi=Math.random().toString(36).slice(2),Wr="__reactFiber$"+mi,Fo="__reactProps$"+mi,ls="__reactContainer$"+mi,Ud="__reactEvents$"+mi,tv="__reactListeners$"+mi,nv="__reactHandles$"+mi;function xa(s){var i=s[Wr];if(i)return i;for(var l=s.parentNode;l;){if(i=l[ls]||l[Wr]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(s=fm(s);s!==null;){if(l=s[Wr])return l;s=fm(s)}return i}s=l,l=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 zd=[],yi=-1;function Fs(s){return{current:s}}function Dt(s){0>yi||(s.current=zd[yi],zd[yi]=null,yi--)}function St(s,i){yi++,zd[yi]=s.current,s.current=i}var js={},Cn=Fs(js),Wn=Fs(!1),Ta=js;function bi(s,i){var l=s.type.contextTypes;if(!l)return js;var f=s.stateNode;if(f&&f.__reactInternalMemoizedUnmaskedChildContext===i)return f.__reactInternalMemoizedMaskedChildContext;var b={},T;for(T in l)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(Cn)}function hm(s,i,l){if(Cn.current!==js)throw Error(n(168));St(Cn,i),St(Wn,l)}function pm(s,i,l){var f=s.stateNode;if(i=i.childContextTypes,typeof f.getChildContext!="function")return l;f=f.getChildContext();for(var b in f)if(!(b in i))throw Error(n(108,Ze(s)||"Unknown",b));return R({},l,f)}function vl(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||js,Ta=Cn.current,St(Cn,s),St(Wn,Wn.current),!0}function mm(s,i,l){var f=s.stateNode;if(!f)throw Error(n(169));l?(s=pm(s,i,Ta),f.__reactInternalMemoizedMergedChildContext=s,Dt(Wn),Dt(Cn),St(Cn,s)):Dt(Wn),St(Wn,l)}var cs=null,wl=!1,Wd=!1;function gm(s){cs===null?cs=[s]:cs.push(s)}function rv(s){wl=!0,gm(s)}function Bs(){if(!Wd&&cs!==null){Wd=!0;var s=0,i=pt;try{var l=cs;for(pt=1;s<l.length;s++){var f=l[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,Wd=!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 ym(s,i,l){hr[pr++]=ds,hr[pr++]=fs,hr[pr++]=va,va=s;var f=ds;s=fs;var b=32-kr(f)-1;f&=~(1<<b),l+=1;var T=32-kr(i)+b;if(30<T){var D=b-b%5;T=(f&(1<<D)-1).toString(32),f>>=D,b-=D,ds=1<<32-kr(i)+b|l<<b|f,fs=T+s}else ds=1<<T|l<<b|f,fs=s}function Yd(s){s.return!==null&&(wa(s,1),ym(s,1,0))}function qd(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 bm(s,i){var l=br(5,null,null,0);l.elementType="DELETED",l.stateNode=i,l.return=s,i=s.deletions,i===null?(s.deletions=[l],s.flags|=16):i.push(l)}function Em(s,i){switch(s.tag){case 5:var l=s.type;return i=i.nodeType!==1||l.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?(l=va!==null?{id:ds,overflow:fs}:null,s.memoizedState={dehydrated:i,treeContext:l,retryLane:1073741824},l=br(18,null,null,0),l.stateNode=i,l.return=s,s.child=l,sr=s,ar=null,!0):!1;default:return!1}}function $d(s){return(s.mode&1)!==0&&(s.flags&128)===0}function Vd(s){if(Lt){var i=ar;if(i){var l=i;if(!Em(s,i)){if($d(s))throw Error(n(418));i=Ps(l.nextSibling);var f=sr;i&&Em(s,i)?bm(f,l):(s.flags=s.flags&-4097|2,Lt=!1,sr=s)}}else{if($d(s))throw Error(n(418));s.flags=s.flags&-4097|2,Lt=!1,sr=s}}}function xm(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;sr=s}function kl(s){if(s!==sr)return!1;if(!Lt)return xm(s),Lt=!0,!1;var i;if((i=s.tag!==3)&&!(i=s.tag!==5)&&(i=s.type,i=i!=="head"&&i!=="body"&&!jd(s.type,s.memoizedProps)),i&&(i=ar)){if($d(s))throw Tm(),Error(n(418));for(;i;)bm(s,i),i=Ps(i.nextSibling)}if(xm(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 l=s.data;if(l==="/$"){if(i===0){ar=Ps(s.nextSibling);break e}i--}else l!=="$"&&l!=="$!"&&l!=="$?"||i++}s=s.nextSibling}ar=null}}else ar=sr?Ps(s.stateNode.nextSibling):null;return!0}function Tm(){for(var s=ar;s;)s=Ps(s.nextSibling)}function Ti(){ar=sr=null,Lt=!1}function Qd(s){Nr===null?Nr=[s]:Nr.push(s)}var sv=A.ReactCurrentBatchConfig;function Bo(s,i,l){if(s=l.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(l._owner){if(l=l._owner,l){if(l.tag!==1)throw Error(n(309));var f=l.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(!l._owner)throw Error(n(290,s))}return s}function Cl(s,i){throw s=Object.prototype.toString.call(i),Error(n(31,s==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":s))}function vm(s){var i=s._init;return i(s._payload)}function wm(s){function i(ee,X){if(s){var ne=ee.deletions;ne===null?(ee.deletions=[X],ee.flags|=16):ne.push(X)}}function l(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=Hf(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===G&&vm(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=Uf(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=Hf(""+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=Uf(X,ee.mode,ne),X.return=ee,X;case G: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;Cl(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 G: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);Cl(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 G:var Fe=ge._init;return xe(ee,X,ne,Fe(ge._payload),Ie)}if(nt(ge)||K(ge))return ee=ee.get(ne)||null,de(X,ee,ge,Ie,null);Cl(X,ge)}return null}function Ne(ee,X,ne,ge){for(var Ie=null,Fe=null,je=X,Ue=X=0,bn=null;je!==null&&Ue<ne.length;Ue++){je.index>Ue?(bn=je,je=null):bn=je.sibling;var ut=le(ee,je,ne[Ue],ge);if(ut===null){je===null&&(je=bn);break}s&&je&&ut.alternate===null&&i(ee,je),X=T(ut,X,Ue),Fe===null?Ie=ut:Fe.sibling=ut,Fe=ut,je=bn}if(Ue===ne.length)return l(ee,je),Lt&&wa(ee,Ue),Ie;if(je===null){for(;Ue<ne.length;Ue++)je=fe(ee,ne[Ue],ge),je!==null&&(X=T(je,X,Ue),Fe===null?Ie=je:Fe.sibling=je,Fe=je);return Lt&&wa(ee,Ue),Ie}for(je=f(ee,je);Ue<ne.length;Ue++)bn=xe(je,ee,Ue,ne[Ue],ge),bn!==null&&(s&&bn.alternate!==null&&je.delete(bn.key===null?Ue:bn.key),X=T(bn,X,Ue),Fe===null?Ie=bn:Fe.sibling=bn,Fe=bn);return s&&je.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 Fe=Ie=null,je=X,Ue=X=0,bn=null,ut=ne.next();je!==null&&!ut.done;Ue++,ut=ne.next()){je.index>Ue?(bn=je,je=null):bn=je.sibling;var Qs=le(ee,je,ut.value,ge);if(Qs===null){je===null&&(je=bn);break}s&&je&&Qs.alternate===null&&i(ee,je),X=T(Qs,X,Ue),Fe===null?Ie=Qs:Fe.sibling=Qs,Fe=Qs,je=bn}if(ut.done)return l(ee,je),Lt&&wa(ee,Ue),Ie;if(je===null){for(;!ut.done;Ue++,ut=ne.next())ut=fe(ee,ut.value,ge),ut!==null&&(X=T(ut,X,Ue),Fe===null?Ie=ut:Fe.sibling=ut,Fe=ut);return Lt&&wa(ee,Ue),Ie}for(je=f(ee,je);!ut.done;Ue++,ut=ne.next())ut=xe(je,ee,Ue,ut.value,ge),ut!==null&&(s&&ut.alternate!==null&&je.delete(ut.key===null?Ue:ut.key),X=T(ut,X,Ue),Fe===null?Ie=ut:Fe.sibling=ut,Fe=ut);return s&&je.forEach(function(Fv){return i(ee,Fv)}),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,Fe=X;Fe!==null;){if(Fe.key===Ie){if(Ie=ne.type,Ie===N){if(Fe.tag===7){l(ee,Fe.sibling),X=b(Fe,ne.props.children),X.return=ee,ee=X;break e}}else if(Fe.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===G&&vm(Ie)===Fe.type){l(ee,Fe.sibling),X=b(Fe,ne.props),X.ref=Bo(ee,Fe,ne),X.return=ee,ee=X;break e}l(ee,Fe);break}else i(ee,Fe);Fe=Fe.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(Fe=ne.key;X!==null;){if(X.key===Fe)if(X.tag===4&&X.stateNode.containerInfo===ne.containerInfo&&X.stateNode.implementation===ne.implementation){l(ee,X.sibling),X=b(X,ne.children||[]),X.return=ee,ee=X;break e}else{l(ee,X);break}else i(ee,X);X=X.sibling}X=Uf(ne,ee.mode,ge),X.return=ee,ee=X}return D(ee);case G:return Fe=ne._init,Xt(ee,X,Fe(ne._payload),ge)}if(nt(ne))return Ne(ee,X,ne,ge);if(K(ne))return Ae(ee,X,ne,ge);Cl(ee,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"?(ne=""+ne,X!==null&&X.tag===6?(l(ee,X.sibling),X=b(X,ne),X.return=ee,ee=X):(l(ee,X),X=Hf(ne,ee.mode,ge),X.return=ee,ee=X),D(ee)):l(ee,X)}return Xt}var vi=wm(!0),Sm=wm(!1),Nl=Fs(null),Ol=null,wi=null,Gd=null;function Xd(){Gd=wi=Ol=null}function Kd(s){var i=Nl.current;Dt(Nl),s._currentValue=i}function Jd(s,i,l){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===l)break;s=s.return}}function Si(s,i){Ol=s,Gd=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(Gd!==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 Zd(s){Sa===null?Sa=[s]:Sa.push(s)}function _m(s,i,l,f){var b=i.interleaved;return b===null?(l.next=l,Zd(i)):(l.next=b.next,b.next=l),i.interleaved=l,hs(s,f)}function hs(s,i){s.lanes|=i;var l=s.alternate;for(l!==null&&(l.lanes|=i),l=s,s=s.return;s!==null;)s.childLanes|=i,l=s.alternate,l!==null&&(l.childLanes|=i),l=s,s=s.return;return l.tag===3?l.stateNode:null}var Hs=!1;function ef(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function km(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,l){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,l)}return b=f.interleaved,b===null?(i.next=i,Zd(f)):(i.next=b.next,b.next=i),f.interleaved=i,hs(s,l)}function Dl(s,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194240)!==0)){var f=i.lanes;f&=s.pendingLanes,l|=f,i.lanes=l,pd(s,l)}}function Cm(s,i){var l=s.updateQueue,f=s.alternate;if(f!==null&&(f=f.updateQueue,l===f)){var b=null,T=null;if(l=l.firstBaseUpdate,l!==null){do{var D={eventTime:l.eventTime,lane:l.lane,tag:l.tag,payload:l.payload,callback:l.callback,next:null};T===null?b=T=D:T=T.next=D,l=l.next}while(l!==null);T===null?b=T=i:T=T.next=i}else b=T=i;l={baseState:f.baseState,firstBaseUpdate:b,lastBaseUpdate:T,shared:f.shared,effects:f.effects},s.updateQueue=l;return}s=l.lastBaseUpdate,s===null?l.firstBaseUpdate=i:s.next=i,l.lastBaseUpdate=i}function Al(s,i,l,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=l,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);Ca|=D,s.lanes=D,s.memoizedState=fe}}function Nm(s,i,l){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=l,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 tf(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 Om(s){_a(zo.current);var i=_a(Yr.current),l=pe(i,s.type);i!==l&&(St(Uo,s),St(Yr,l))}function nf(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 l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||l.data==="$?"||l.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 rf=[];function sf(){for(var s=0;s<rf.length;s++)rf[s]._workInProgressVersionPrimary=null;rf.length=0}var Rl=A.ReactCurrentDispatcher,af=A.ReactCurrentBatchConfig,ka=0,jt=null,dn=null,gn=null,Ll=!1,Wo=!1,Yo=0,av=0;function Nn(){throw Error(n(321))}function of(s,i){if(i===null)return!1;for(var l=0;l<i.length&&l<s.length;l++)if(!Cr(s[l],i[l]))return!1;return!0}function uf(s,i,l,f,b,T){if(ka=T,jt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,Rl.current=s===null||s.memoizedState===null?lv:cv,s=l(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=dv,s=l(f,b)}while(Wo)}if(Rl.current=Fl,i=dn!==null&&dn.next!==null,ka=0,gn=dn=jt=null,Ll=!1,i)throw Error(n(300));return s}function lf(){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 cf(s){var i=gr(),l=i.queue;if(l===null)throw Error(n(311));l.lastRenderedReducer=s;var f=dn,b=f.baseQueue,T=l.pending;if(T!==null){if(b!==null){var D=b.next;b.next=T.next,T.next=D}f.baseQueue=b=T,l.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((ka&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,Ca|=de}se=se.next}while(se!==null&&se!==T);V===null?D=f:V.next=Y,Cr(f,i.memoizedState)||(qn=!0),i.memoizedState=f,i.baseState=D,i.baseQueue=V,l.lastRenderedState=f}if(s=l.interleaved,s!==null){b=s;do T=b.lane,jt.lanes|=T,Ca|=T,b=b.next;while(b!==s)}else b===null&&(l.lanes=0);return[i.memoizedState,l.dispatch]}function df(s){var i=gr(),l=i.queue;if(l===null)throw Error(n(311));l.lastRenderedReducer=s;var f=l.dispatch,b=l.pending,T=i.memoizedState;if(b!==null){l.pending=null;var D=b=b.next;do T=s(T,D.action),D=D.next;while(D!==b);Cr(T,i.memoizedState)||(qn=!0),i.memoizedState=T,i.baseQueue===null&&(i.baseState=T),l.lastRenderedState=T}return[T,f]}function Dm(){}function Am(s,i){var l=jt,f=gr(),b=i(),T=!Cr(f.memoizedState,b);if(T&&(f.memoizedState=b,qn=!0),f=f.queue,ff(Lm.bind(null,l,f,s),[s]),f.getSnapshot!==i||T||gn!==null&&gn.memoizedState.tag&1){if(l.flags|=2048,$o(9,Rm.bind(null,l,f,b,i),void 0,null),yn===null)throw Error(n(349));(ka&30)!==0||Im(l,i,b)}return b}function Im(s,i,l){s.flags|=16384,s={getSnapshot:i,value:l},i=jt.updateQueue,i===null?(i={lastEffect:null,stores:null},jt.updateQueue=i,i.stores=[s]):(l=i.stores,l===null?i.stores=[s]:l.push(s))}function Rm(s,i,l,f){i.value=l,i.getSnapshot=f,Mm(i)&&Pm(s)}function Lm(s,i,l){return l(function(){Mm(i)&&Pm(s)})}function Mm(s){var i=s.getSnapshot;s=s.value;try{var l=i();return!Cr(s,l)}catch{return!0}}function Pm(s){var i=hs(s,1);i!==null&&Ir(i,s,1,-1)}function Fm(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=uv.bind(null,jt,s),[i.memoizedState,s]}function $o(s,i,l,f){return s={tag:s,create:i,destroy:l,deps:f,next:null},i=jt.updateQueue,i===null?(i={lastEffect:null,stores:null},jt.updateQueue=i,i.lastEffect=s.next=s):(l=i.lastEffect,l===null?i.lastEffect=s.next=s:(f=l.next,l.next=s,s.next=f,i.lastEffect=s)),s}function jm(){return gr().memoizedState}function Ml(s,i,l,f){var b=qr();jt.flags|=s,b.memoizedState=$o(1|i,l,void 0,f===void 0?null:f)}function Pl(s,i,l,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&&of(f,D.deps)){b.memoizedState=$o(i,l,T,f);return}}jt.flags|=s,b.memoizedState=$o(1|i,l,T,f)}function Bm(s,i){return Ml(8390656,8,s,i)}function ff(s,i){return Pl(2048,8,s,i)}function Hm(s,i){return Pl(4,2,s,i)}function Um(s,i){return Pl(4,4,s,i)}function zm(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 Wm(s,i,l){return l=l!=null?l.concat([s]):null,Pl(4,4,zm.bind(null,i,s),l)}function hf(){}function Ym(s,i){var l=gr();i=i===void 0?null:i;var f=l.memoizedState;return f!==null&&i!==null&&of(i,f[1])?f[0]:(l.memoizedState=[s,i],s)}function qm(s,i){var l=gr();i=i===void 0?null:i;var f=l.memoizedState;return f!==null&&i!==null&&of(i,f[1])?f[0]:(s=s(),l.memoizedState=[s,i],s)}function $m(s,i,l){return(ka&21)===0?(s.baseState&&(s.baseState=!1,qn=!0),s.memoizedState=l):(Cr(l,i)||(l=vp(),jt.lanes|=l,Ca|=l,s.baseState=!0),i)}function iv(s,i){var l=pt;pt=l!==0&&4>l?l:4,s(!0);var f=af.transition;af.transition={};try{s(!1),i()}finally{pt=l,af.transition=f}}function Vm(){return gr().memoizedState}function ov(s,i,l){var f=qs(s);if(l={lane:f,action:l,hasEagerState:!1,eagerState:null,next:null},Qm(s))Gm(i,l);else if(l=_m(s,i,l,f),l!==null){var b=Fn();Ir(l,s,f,b),Xm(l,i,f)}}function uv(s,i,l){var f=qs(s),b={lane:f,action:l,hasEagerState:!1,eagerState:null,next:null};if(Qm(s))Gm(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,l);if(b.hasEagerState=!0,b.eagerState=Y,Cr(Y,D)){var V=i.interleaved;V===null?(b.next=b,Zd(i)):(b.next=V.next,V.next=b),i.interleaved=b;return}}catch{}finally{}l=_m(s,i,b,f),l!==null&&(b=Fn(),Ir(l,s,f,b),Xm(l,i,f))}}function Qm(s){var i=s.alternate;return s===jt||i!==null&&i===jt}function Gm(s,i){Wo=Ll=!0;var l=s.pending;l===null?i.next=i:(i.next=l.next,l.next=i),s.pending=i}function Xm(s,i,l){if((l&4194240)!==0){var f=i.lanes;f&=s.pendingLanes,l|=f,i.lanes=l,pd(s,l)}}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},lv={readContext:mr,useCallback:function(s,i){return qr().memoizedState=[s,i===void 0?null:i],s},useContext:mr,useEffect:Bm,useImperativeHandle:function(s,i,l){return l=l!=null?l.concat([s]):null,Ml(4194308,4,zm.bind(null,i,s),l)},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 l=qr();return i=i===void 0?null:i,s=s(),l.memoizedState=[s,i],s},useReducer:function(s,i,l){var f=qr();return i=l!==void 0?l(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=ov.bind(null,jt,s),[f.memoizedState,s]},useRef:function(s){var i=qr();return s={current:s},i.memoizedState=s},useState:Fm,useDebugValue:hf,useDeferredValue:function(s){return qr().memoizedState=s},useTransition:function(){var s=Fm(!1),i=s[0];return s=iv.bind(null,s[1]),qr().memoizedState=s,[i,s]},useMutableSource:function(){},useSyncExternalStore:function(s,i,l){var f=jt,b=qr();if(Lt){if(l===void 0)throw Error(n(407));l=l()}else{if(l=i(),yn===null)throw Error(n(349));(ka&30)!==0||Im(f,i,l)}b.memoizedState=l;var T={value:l,getSnapshot:i};return b.queue=T,Bm(Lm.bind(null,f,T,s),[s]),f.flags|=2048,$o(9,Rm.bind(null,f,T,l,i),void 0,null),l},useId:function(){var s=qr(),i=yn.identifierPrefix;if(Lt){var l=fs,f=ds;l=(f&~(1<<32-kr(f)-1)).toString(32)+l,i=":"+i+"R"+l,l=Yo++,0<l&&(i+="H"+l.toString(32)),i+=":"}else l=av++,i=":"+i+"r"+l.toString(32)+":";return s.memoizedState=i},unstable_isNewReconciler:!1},cv={readContext:mr,useCallback:Ym,useContext:mr,useEffect:ff,useImperativeHandle:Wm,useInsertionEffect:Hm,useLayoutEffect:Um,useMemo:qm,useReducer:cf,useRef:jm,useState:function(){return cf(qo)},useDebugValue:hf,useDeferredValue:function(s){var i=gr();return $m(i,dn.memoizedState,s)},useTransition:function(){var s=cf(qo)[0],i=gr().memoizedState;return[s,i]},useMutableSource:Dm,useSyncExternalStore:Am,useId:Vm,unstable_isNewReconciler:!1},dv={readContext:mr,useCallback:Ym,useContext:mr,useEffect:ff,useImperativeHandle:Wm,useInsertionEffect:Hm,useLayoutEffect:Um,useMemo:qm,useReducer:df,useRef:jm,useState:function(){return df(qo)},useDebugValue:hf,useDeferredValue:function(s){var i=gr();return dn===null?i.memoizedState=s:$m(i,dn.memoizedState,s)},useTransition:function(){var s=df(qo)[0],i=gr().memoizedState;return[s,i]},useMutableSource:Dm,useSyncExternalStore:Am,useId:Vm,unstable_isNewReconciler:!1};function Or(s,i){if(s&&s.defaultProps){i=R({},i),s=s.defaultProps;for(var l in s)i[l]===void 0&&(i[l]=s[l]);return i}return i}function pf(s,i,l,f){i=s.memoizedState,l=l(f,i),l=l==null?i:R({},i,l),s.memoizedState=l,s.lanes===0&&(s.updateQueue.baseState=l)}var jl={isMounted:function(s){return(s=s._reactInternals)?Tt(s)===s:!1},enqueueSetState:function(s,i,l){s=s._reactInternals;var f=Fn(),b=qs(s),T=ps(f,b);T.payload=i,l!=null&&(T.callback=l),i=Us(s,T,b),i!==null&&(Ir(i,s,b,f),Dl(i,s,b))},enqueueReplaceState:function(s,i,l){s=s._reactInternals;var f=Fn(),b=qs(s),T=ps(f,b);T.tag=1,T.payload=i,l!=null&&(T.callback=l),i=Us(s,T,b),i!==null&&(Ir(i,s,b,f),Dl(i,s,b))},enqueueForceUpdate:function(s,i){s=s._reactInternals;var l=Fn(),f=qs(s),b=ps(l,f);b.tag=2,i!=null&&(b.callback=i),i=Us(s,b,f),i!==null&&(Ir(i,s,f,l),Dl(i,s,f))}};function Km(s,i,l,f,b,T,D){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(f,T,D):i.prototype&&i.prototype.isPureReactComponent?!Io(l,f)||!Io(b,T):!0}function Jm(s,i,l){var f=!1,b=js,T=i.contextType;return typeof T=="object"&&T!==null?T=mr(T):(b=Yn(i)?Ta:Cn.current,f=i.contextTypes,T=(f=f!=null)?bi(s,b):js),i=new i(l,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 Zm(s,i,l,f){s=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,f),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,f),i.state!==s&&jl.enqueueReplaceState(i,i.state,null)}function mf(s,i,l,f){var b=s.stateNode;b.props=l,b.state=s.memoizedState,b.refs={},ef(s);var T=i.contextType;typeof T=="object"&&T!==null?b.context=mr(T):(T=Yn(i)?Ta:Cn.current,b.context=bi(s,T)),b.state=s.memoizedState,T=i.getDerivedStateFromProps,typeof T=="function"&&(pf(s,i,T,l),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,l,b,f),b.state=s.memoizedState),typeof b.componentDidMount=="function"&&(s.flags|=4194308)}function ki(s,i){try{var l="",f=i;do l+=Le(f),f=f.return;while(f);var b=l}catch(T){b=`
|
|
32
|
-
Error generating stack: `+T.message+`
|
|
33
|
-
`+T.stack}return{value:s,source:i,stack:b,digest:null}}function gf(s,i,l){return{value:s,source:null,stack:l??null,digest:i??null}}function yf(s,i){try{console.error(i.value)}catch(l){setTimeout(function(){throw l})}}var fv=typeof WeakMap=="function"?WeakMap:Map;function eg(s,i,l){l=ps(-1,l),l.tag=3,l.payload={element:null};var f=i.value;return l.callback=function(){ql||(ql=!0,If=f),yf(s,i)},l}function tg(s,i,l){l=ps(-1,l),l.tag=3;var f=s.type.getDerivedStateFromError;if(typeof f=="function"){var b=i.value;l.payload=function(){return f(b)},l.callback=function(){yf(s,i)}}var T=s.stateNode;return T!==null&&typeof T.componentDidCatch=="function"&&(l.callback=function(){yf(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:""})}),l}function ng(s,i,l){var f=s.pingCache;if(f===null){f=s.pingCache=new fv;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(l)||(b.add(l),s=kv.bind(null,s,i,l),i.then(s,s))}function rg(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 sg(s,i,l,f,b){return(s.mode&1)===0?(s===i?s.flags|=65536:(s.flags|=128,l.flags|=131072,l.flags&=-52805,l.tag===1&&(l.alternate===null?l.tag=17:(i=ps(-1,1),i.tag=2,Us(l,i,1))),l.lanes|=1),s):(s.flags|=65536,s.lanes=b,s)}var hv=A.ReactCurrentOwner,qn=!1;function Pn(s,i,l,f){i.child=s===null?Sm(i,null,l,f):vi(i,s.child,l,f)}function ag(s,i,l,f,b){l=l.render;var T=i.ref;return Si(i,b),f=uf(s,i,l,f,T,b),l=lf(),s!==null&&!qn?(i.updateQueue=s.updateQueue,i.flags&=-2053,s.lanes&=~b,ms(s,i,b)):(Lt&&l&&Yd(i),i.flags|=1,Pn(s,i,f,b),i.child)}function ig(s,i,l,f,b){if(s===null){var T=l.type;return typeof T=="function"&&!Bf(T)&&T.defaultProps===void 0&&l.compare===null&&l.defaultProps===void 0?(i.tag=15,i.type=T,og(s,i,T,f,b)):(s=Kl(l.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(l=l.compare,l=l!==null?l:Io,l(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 og(s,i,l,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 bf(s,i,l,f,b)}function ug(s,i,l){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|=l;else{if((l&1073741824)===0)return s=T!==null?T.baseLanes|l:l,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:l,St(Ni,ir),ir|=f}else T!==null?(f=T.baseLanes|l,i.memoizedState=null):f=l,St(Ni,ir),ir|=f;return Pn(s,i,b,l),i.child}function lg(s,i){var l=i.ref;(s===null&&l!==null||s!==null&&s.ref!==l)&&(i.flags|=512,i.flags|=2097152)}function bf(s,i,l,f,b){var T=Yn(l)?Ta:Cn.current;return T=bi(i,T),Si(i,b),l=uf(s,i,l,f,T,b),f=lf(),s!==null&&!qn?(i.updateQueue=s.updateQueue,i.flags&=-2053,s.lanes&=~b,ms(s,i,b)):(Lt&&f&&Yd(i),i.flags|=1,Pn(s,i,l,b),i.child)}function cg(s,i,l,f,b){if(Yn(l)){var T=!0;vl(i)}else T=!1;if(Si(i,b),i.stateNode===null)Hl(s,i),Jm(i,l,f),mf(i,l,f,b),f=!0;else if(s===null){var D=i.stateNode,Y=i.memoizedProps;D.props=Y;var V=D.context,se=l.contextType;typeof se=="object"&&se!==null?se=mr(se):(se=Yn(l)?Ta:Cn.current,se=bi(i,se));var de=l.getDerivedStateFromProps,fe=typeof de=="function"||typeof D.getSnapshotBeforeUpdate=="function";fe||typeof D.UNSAFE_componentWillReceiveProps!="function"&&typeof D.componentWillReceiveProps!="function"||(Y!==f||V!==se)&&Zm(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"&&(pf(i,l,de,f),V=i.memoizedState),(Y=Hs||Km(i,l,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,km(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=l.contextType,typeof V=="object"&&V!==null?V=mr(V):(V=Yn(l)?Ta:Cn.current,V=bi(i,V));var xe=l.getDerivedStateFromProps;(de=typeof xe=="function"||typeof D.getSnapshotBeforeUpdate=="function")||typeof D.UNSAFE_componentWillReceiveProps!="function"&&typeof D.componentWillReceiveProps!="function"||(Y!==fe||le!==V)&&Zm(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"&&(pf(i,l,xe,f),Ne=i.memoizedState),(se=Hs||Km(i,l,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 Ef(s,i,l,f,T,b)}function Ef(s,i,l,f,b,T){lg(s,i);var D=(i.flags&128)!==0;if(!f&&!D)return b&&mm(i,l,!1),ms(s,i,T);f=i.stateNode,hv.current=i;var Y=D&&typeof l.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&&mm(i,l,!0),i.child}function dg(s){var i=s.stateNode;i.pendingContext?hm(s,i.pendingContext,i.pendingContext!==i.context):i.context&&hm(s,i.context,!1),tf(s,i.containerInfo)}function fg(s,i,l,f,b){return Ti(),Qd(b),i.flags|=256,Pn(s,i,l,f),i.child}var xf={dehydrated:null,treeContext:null,retryLane:0};function Tf(s){return{baseLanes:s,cachePool:null,transitions:null}}function hg(s,i,l){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 Vd(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,l,null),T.return=i,s.return=i,T.sibling=s,i.child=T,i.child.memoizedState=Tf(l),i.memoizedState=xf,s):vf(i,D));if(b=s.memoizedState,b!==null&&(Y=b.dehydrated,Y!==null))return pv(s,i,D,f,Y,b,l);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,l,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?Tf(l):{baseLanes:D.baseLanes|l,cachePool:null,transitions:D.transitions},T.memoizedState=D,T.childLanes=s.childLanes&~l,i.memoizedState=xf,f}return T=s.child,s=T.sibling,f=Vs(T,{mode:"visible",children:f.children}),(i.mode&1)===0&&(f.lanes=l),f.return=i,f.sibling=null,s!==null&&(l=i.deletions,l===null?(i.deletions=[s],i.flags|=16):l.push(s)),i.child=f,i.memoizedState=null,f}function vf(s,i){return i=Jl({mode:"visible",children:i},s.mode,0,null),i.return=s,s.child=i}function Bl(s,i,l,f){return f!==null&&Qd(f),vi(i,s.child,null,l),s=vf(i,i.pendingProps.children),s.flags|=2,i.memoizedState=null,s}function pv(s,i,l,f,b,T,D){if(l)return i.flags&256?(i.flags&=-257,f=gf(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=Tf(D),i.memoizedState=xf,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=gf(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 jf(),f=gf(Error(n(421))),Bl(s,i,D,f)}return b.data==="$?"?(i.flags|=128,i.child=s.child,i=Cv.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=vf(i,f.children),i.flags|=4096,i)}function pg(s,i,l){s.lanes|=i;var f=s.alternate;f!==null&&(f.lanes|=i),Jd(s.return,i,l)}function wf(s,i,l,f,b){var T=s.memoizedState;T===null?s.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:f,tail:l,tailMode:b}:(T.isBackwards=i,T.rendering=null,T.renderingStartTime=0,T.last=f,T.tail=l,T.tailMode=b)}function mg(s,i,l){var f=i.pendingProps,b=f.revealOrder,T=f.tail;if(Pn(s,i,f.children,l),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&&pg(s,l,i);else if(s.tag===19)pg(s,l,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(l=i.child,b=null;l!==null;)s=l.alternate,s!==null&&Il(s)===null&&(b=l),l=l.sibling;l=b,l===null?(b=i.child,i.child=null):(b=l.sibling,l.sibling=null),wf(i,!1,b,l,T);break;case"backwards":for(l=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=l,l=b,b=s}wf(i,!0,l,null,T);break;case"together":wf(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,l){if(s!==null&&(i.dependencies=s.dependencies),Ca|=i.lanes,(l&i.childLanes)===0)return null;if(s!==null&&i.child!==s.child)throw Error(n(153));if(i.child!==null){for(s=i.child,l=Vs(s,s.pendingProps),i.child=l,l.return=i;s.sibling!==null;)s=s.sibling,l=l.sibling=Vs(s,s.pendingProps),l.return=i;l.sibling=null}return i.child}function mv(s,i,l){switch(i.tag){case 3:dg(i),Ti();break;case 5:Om(i);break;case 1:Yn(i.type)&&vl(i);break;case 4:tf(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):(l&i.child.childLanes)!==0?hg(s,i,l):(St(Ft,Ft.current&1),s=ms(s,i,l),s!==null?s.sibling:null);St(Ft,Ft.current&1);break;case 19:if(f=(l&i.childLanes)!==0,(s.flags&128)!==0){if(f)return mg(s,i,l);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,ug(s,i,l)}return ms(s,i,l)}var gg,Sf,yg,bg;gg=function(s,i){for(var l=i.child;l!==null;){if(l.tag===5||l.tag===6)s.appendChild(l.stateNode);else if(l.tag!==4&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return;l=l.return}l.sibling.return=l.return,l=l.sibling}},Sf=function(){},yg=function(s,i,l,f){var b=s.memoizedProps;if(b!==f){s=i.stateNode,_a(Yr.current);var T=null;switch(l){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(l,f);var D;l=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)&&(l||(l={}),l[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)||(l||(l={}),l[D]="");for(D in V)V.hasOwnProperty(D)&&Y[D]!==V[D]&&(l||(l={}),l[D]=V[D])}else l||(T||(T=[]),T.push(se,l)),l=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))}l&&(T=T||[]).push("style",l);var se=T;(i.updateQueue=se)&&(i.flags|=4)}},bg=function(s,i,l,f){l!==f&&(i.flags|=4)};function Vo(s,i){if(!Lt)switch(s.tailMode){case"hidden":i=s.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?s.tail=null:l.sibling=null;break;case"collapsed":l=s.tail;for(var f=null;l!==null;)l.alternate!==null&&(f=l),l=l.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,l=0,f=0;if(i)for(var b=s.child;b!==null;)l|=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;)l|=b.lanes|b.childLanes,f|=b.subtreeFlags,f|=b.flags,b.return=s,b=b.sibling;return s.subtreeFlags|=f,s.childLanes=l,i}function gv(s,i,l){var f=i.pendingProps;switch(qd(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(Cn),sf(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(s===null||s.child===null)&&(kl(i)?i.flags|=4:s===null||s.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Nr!==null&&(Mf(Nr),Nr=null))),Sf(s,i),On(i),null;case 5:nf(i);var b=_a(zo.current);if(l=i.type,s!==null&&i.stateNode!=null)yg(s,i,l,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),kl(i)){f=i.stateNode,l=i.type;var T=i.memoizedProps;switch(f[Wr]=i,f[Fo]=T,s=(i.mode&1)!==0,l){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(l,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(l){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=ie(l)),s==="http://www.w3.org/1999/xhtml"?l==="script"?(s=D.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild)):typeof f.is=="string"?s=D.createElement(l,{is:f.is}):(s=D.createElement(l),l==="select"&&(D=s,f.multiple?D.multiple=!0:f.size&&(D.size=f.size))):s=D.createElementNS(s,l),s[Wr]=i,s[Fo]=f,gg(s,i,!1,!1),i.stateNode=s;e:{switch(D=yt(l,f),l){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(l,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"?(l!=="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(l){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(l){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)bg(s,i,s.memoizedProps,f);else{if(typeof f!="string"&&i.stateNode===null)throw Error(n(166));if(l=_a(zo.current),_a(Yr.current),kl(i)){if(f=i.stateNode,l=i.memoizedProps,f[Wr]=i,(T=f.nodeValue!==l)&&(s=sr,s!==null))switch(s.tag){case 3:bl(f.nodeValue,l,(s.mode&1)!==0);break;case 5:s.memoizedProps.suppressHydrationWarning!==!0&&bl(f.nodeValue,l,(s.mode&1)!==0)}T&&(i.flags|=4)}else f=(l.nodeType===9?l:l.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)Tm(),Ti(),i.flags|=98560,T=!1;else if(T=kl(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&&(Mf(Nr),Nr=null),T=!0;if(!T)return i.flags&65536?i:null}return(i.flags&128)!==0?(i.lanes=l,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):jf())),i.updateQueue!==null&&(i.flags|=4),On(i),null);case 4:return _i(),Sf(s,i),s===null&&Mo(i.stateNode.containerInfo),On(i),null;case 10:return Kd(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=l,l=i.child;l!==null;)T=l,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}),l=l.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,l=s.updateQueue,l!==null&&(i.updateQueue=l,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&&l!==1073741824&&(i.flags|=128,f=!0,Vo(T,!1),i.lanes=4194304);T.isBackwards?(D.sibling=i.child,i.child=D):(l=T.last,l!==null?l.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,l=Ft.current,St(Ft,f?l&1|2:l&1),i):(On(i),null);case 22:case 23:return Ff(),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 yv(s,i){switch(qd(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(Cn),sf(),s=i.flags,(s&65536)!==0&&(s&128)===0?(i.flags=s&-65537|128,i):null;case 5:return nf(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 Kd(i.type._context),null;case 22:case 23:return Ff(),null;case 24:return null;default:return null}}var Ul=!1,Dn=!1,bv=typeof WeakSet=="function"?WeakSet:Set,Se=null;function Ci(s,i){var l=s.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(f){$t(s,i,f)}else l.current=null}function _f(s,i,l){try{l()}catch(f){$t(s,i,f)}}var Eg=!1;function Ev(s,i){if(Pd=ol,s=Kp(),Nd(s)){if("selectionStart"in s)var l={start:s.selectionStart,end:s.selectionEnd};else e:{l=(l=s.ownerDocument)&&l.defaultView||window;var f=l.getSelection&&l.getSelection();if(f&&f.rangeCount!==0){l=f.anchorNode;var b=f.anchorOffset,T=f.focusNode;f=f.focusOffset;try{l.nodeType,T.nodeType}catch{l=null;break e}var D=0,Y=-1,V=-1,se=0,de=0,fe=s,le=null;t:for(;;){for(var xe;fe!==l||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===l&&++se===b&&(Y=D),le===T&&++de===f&&(V=D),(xe=fe.nextSibling)!==null)break;fe=le,le=fe.parentNode}fe=xe}l=Y===-1||V===-1?null:{start:Y,end:V}}else l=null}l=l||{start:0,end:0}}else l=null;for(Fd={focusedElem:s,selectionRange:l},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=Eg,Eg=!1,Ne}function Qo(s,i,l){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&&_f(i,l,T)}b=b.next}while(b!==f)}}function zl(s,i){if(i=i.updateQueue,i=i!==null?i.lastEffect:null,i!==null){var l=i=i.next;do{if((l.tag&s)===s){var f=l.create;l.destroy=f()}l=l.next}while(l!==i)}}function kf(s){var i=s.ref;if(i!==null){var l=s.stateNode;switch(s.tag){case 5:s=l;break;default:s=l}typeof i=="function"?i(s):i.current=s}}function xg(s){var i=s.alternate;i!==null&&(s.alternate=null,xg(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[Ud],delete i[tv],delete i[nv])),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 Tg(s){return s.tag===5||s.tag===3||s.tag===4}function vg(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||Tg(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,l){var f=s.tag;if(f===5||f===6)s=s.stateNode,i?l.nodeType===8?l.parentNode.insertBefore(s,i):l.insertBefore(s,i):(l.nodeType===8?(i=l.parentNode,i.insertBefore(s,l)):(i=l,i.appendChild(s)),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=El));else if(f!==4&&(s=s.child,s!==null))for(Cf(s,i,l),s=s.sibling;s!==null;)Cf(s,i,l),s=s.sibling}function Nf(s,i,l){var f=s.tag;if(f===5||f===6)s=s.stateNode,i?l.insertBefore(s,i):l.appendChild(s);else if(f!==4&&(s=s.child,s!==null))for(Nf(s,i,l),s=s.sibling;s!==null;)Nf(s,i,l),s=s.sibling}var vn=null,Dr=!1;function zs(s,i,l){for(l=l.child;l!==null;)wg(s,i,l),l=l.sibling}function wg(s,i,l){if(zr&&typeof zr.onCommitFiberUnmount=="function")try{zr.onCommitFiberUnmount(tl,l)}catch{}switch(l.tag){case 5:Dn||Ci(l,i);case 6:var f=vn,b=Dr;vn=null,zs(s,i,l),vn=f,Dr=b,vn!==null&&(Dr?(s=vn,l=l.stateNode,s.nodeType===8?s.parentNode.removeChild(l):s.removeChild(l)):vn.removeChild(l.stateNode));break;case 18:vn!==null&&(Dr?(s=vn,l=l.stateNode,s.nodeType===8?Hd(s.parentNode,l):s.nodeType===1&&Hd(s,l),ko(s)):Hd(vn,l.stateNode));break;case 4:f=vn,b=Dr,vn=l.stateNode.containerInfo,Dr=!0,zs(s,i,l),vn=f,Dr=b;break;case 0:case 11:case 14:case 15:if(!Dn&&(f=l.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)&&_f(l,i,D),b=b.next}while(b!==f)}zs(s,i,l);break;case 1:if(!Dn&&(Ci(l,i),f=l.stateNode,typeof f.componentWillUnmount=="function"))try{f.props=l.memoizedProps,f.state=l.memoizedState,f.componentWillUnmount()}catch(Y){$t(l,i,Y)}zs(s,i,l);break;case 21:zs(s,i,l);break;case 22:l.mode&1?(Dn=(f=Dn)||l.memoizedState!==null,zs(s,i,l),Dn=f):zs(s,i,l);break;default:zs(s,i,l)}}function Sg(s){var i=s.updateQueue;if(i!==null){s.updateQueue=null;var l=s.stateNode;l===null&&(l=s.stateNode=new bv),i.forEach(function(f){var b=Nv.bind(null,s,f);l.has(f)||(l.add(f),f.then(b,b))})}}function Ar(s,i){var l=i.deletions;if(l!==null)for(var f=0;f<l.length;f++){var b=l[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));wg(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;)_g(i,s),i=i.sibling}function _g(s,i){var l=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&&l!==null&&Ci(l,l.return);break;case 5:if(Ar(i,s),$r(s),f&512&&l!==null&&Ci(l,l.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=l!==null?l.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&&l!==null&&l.memoizedState.isDehydrated)try{ko(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||(Af=wt())),f&4&&Sg(s);break;case 22:if(de=l!==null&&l.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:Ci(le,le.return);var Ne=le.stateNode;if(typeof Ne.componentWillUnmount=="function"){f=le,l=le.return;try{i=f,Ne.props=i.memoizedProps,Ne.state=i.memoizedState,Ne.componentWillUnmount()}catch(Ae){$t(f,l,Ae)}}break;case 5:Ci(le,le.return);break;case 22:if(le.memoizedState!==null){Ng(fe);continue}}xe!==null?(xe.return=le,Se=xe):Ng(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&&Sg(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 l=s.return;l!==null;){if(Tg(l)){var f=l;break e}l=l.return}throw Error(n(160))}switch(f.tag){case 5:var b=f.stateNode;f.flags&32&&(Ve(b,""),f.flags&=-33);var T=vg(s);Nf(s,T,b);break;case 3:case 4:var D=f.stateNode.containerInfo,Y=vg(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 xv(s,i,l){Se=s,kg(s)}function kg(s,i,l){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?Og(b):V!==null?(V.return=D,Se=V):Og(b);for(;T!==null;)Se=T,kg(T),T=T.sibling;Se=b,Ul=Y,Dn=se}Cg(s)}else(b.subtreeFlags&8772)!==0&&T!==null?(T.return=b,Se=T):Cg(s)}}function Cg(s){for(;Se!==null;){var i=Se;if((i.flags&8772)!==0){var l=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(l===null)f.componentDidMount();else{var b=i.elementType===i.type?l.memoizedProps:Or(i.type,l.memoizedProps);f.componentDidUpdate(b,l.memoizedState,f.__reactInternalSnapshotBeforeUpdate)}var T=i.updateQueue;T!==null&&Nm(i,T,f);break;case 3:var D=i.updateQueue;if(D!==null){if(l=null,i.child!==null)switch(i.child.tag){case 5:l=i.child.stateNode;break;case 1:l=i.child.stateNode}Nm(i,D,l)}break;case 5:var Y=i.stateNode;if(l===null&&i.flags&4){l=Y;var V=i.memoizedProps;switch(i.type){case"button":case"input":case"select":case"textarea":V.autoFocus&&l.focus();break;case"img":V.src&&(l.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&&ko(fe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Dn||i.flags&512&&kf(i)}catch(le){$t(i,i.return,le)}}if(i===s){Se=null;break}if(l=i.sibling,l!==null){l.return=i.return,Se=l;break}Se=i.return}}function Ng(s){for(;Se!==null;){var i=Se;if(i===s){Se=null;break}var l=i.sibling;if(l!==null){l.return=i.return,Se=l;break}Se=i.return}}function Og(s){for(;Se!==null;){var i=Se;try{switch(i.tag){case 0:case 11:case 15:var l=i.return;try{zl(4,i)}catch(V){$t(i,l,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{kf(i)}catch(V){$t(i,T,V)}break;case 5:var D=i.return;try{kf(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 Tv=Math.ceil,Wl=A.ReactCurrentDispatcher,Of=A.ReactCurrentOwner,yr=A.ReactCurrentBatchConfig,at=0,yn=null,sn=null,wn=0,ir=0,Ni=Fs(0),fn=0,Go=null,Ca=0,Yl=0,Df=0,Xo=null,$n=null,Af=0,Oi=1/0,gs=null,ql=!1,If=null,Ws=null,$l=!1,Ys=null,Vl=0,Ko=0,Rf=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:sv.transition!==null?(Gl===0&&(Gl=vp()),Gl):(s=pt,s!==0||(s=window.event,s=s===void 0?16:Ap(s.type)),s)}function Ir(s,i,l,f){if(50<Ko)throw Ko=0,Rf=null,Error(n(185));To(s,l,f),((at&2)===0||s!==yn)&&(s===yn&&((at&2)===0&&(Yl|=l),fn===4&&$s(s,wn)),Vn(s,f),l===1&&at===0&&(i.mode&1)===0&&(Oi=wt()+500,wl&&Bs()))}function Vn(s,i){var l=s.callbackNode;sT(s,i);var f=sl(s,s===yn?wn:0);if(f===0)l!==null&&vt(l),s.callbackNode=null,s.callbackPriority=0;else if(i=f&-f,s.callbackPriority!==i){if(l!=null&&vt(l),i===1)s.tag===0?rv(Ag.bind(null,s)):gm(Ag.bind(null,s)),ZT(function(){(at&6)===0&&Bs()}),l=null;else{switch(wp(f)){case 1:l=Ea;break;case 4:l=xp;break;case 16:l=el;break;case 536870912:l=Tp;break;default:l=el}l=Bg(l,Dg.bind(null,s))}s.callbackPriority=i,s.callbackNode=l}}function Dg(s,i){if(Ql=-1,Gl=0,(at&6)!==0)throw Error(n(327));var l=s.callbackNode;if(Di()&&s.callbackNode!==l)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=Rg();(yn!==s||wn!==i)&&(gs=null,Oi=wt()+500,Oa(s,i));do try{Sv();break}catch(Y){Ig(s,Y)}while(!0);Xd(),Wl.current=T,at=b,sn!==null?i=0:(yn=null,wn=0,i=fn)}if(i!==0){if(i===2&&(b=fd(s),b!==0&&(f=b,i=Lf(s,b))),i===1)throw l=Go,Oa(s,0),$s(s,f),Vn(s,wt()),l;if(i===6)$s(s,f);else{if(b=s.current.alternate,(f&30)===0&&!vv(b)&&(i=Xl(s,f),i===2&&(T=fd(s),T!==0&&(f=T,i=Lf(s,T))),i===1))throw l=Go,Oa(s,0),$s(s,f),Vn(s,wt()),l;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=Af+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=Bd(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-kr(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*Tv(f/1960))-f,10<f){s.timeoutHandle=Bd(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===l?Dg.bind(null,s):null}function Lf(s,i){var l=Xo;return s.current.memoizedState.isDehydrated&&(Oa(s,i).flags|=256),s=Xl(s,i),s!==2&&(i=$n,$n=l,i!==null&&Mf(i)),s}function Mf(s){$n===null?$n=s:$n.push.apply($n,s)}function vv(s){for(var i=s;;){if(i.flags&16384){var l=i.updateQueue;if(l!==null&&(l=l.stores,l!==null))for(var f=0;f<l.length;f++){var b=l[f],T=b.getSnapshot;b=b.value;try{if(!Cr(T(),b))return!1}catch{return!1}}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;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&=~Df,i&=~Yl,s.suspendedLanes|=i,s.pingedLanes&=~i,s=s.expirationTimes;0<i;){var l=31-kr(i),f=1<<l;s[l]=-1,i&=~f}}function Ag(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 l=Xl(s,i);if(s.tag!==0&&l===2){var f=fd(s);f!==0&&(i=f,l=Lf(s,f))}if(l===1)throw l=Go,Oa(s,0),$s(s,i),Vn(s,wt()),l;if(l===6)throw Error(n(345));return s.finishedWork=s.current.alternate,s.finishedLanes=i,Da(s,$n,gs),Vn(s,wt()),null}function Pf(s,i){var l=at;at|=1;try{return s(i)}finally{at=l,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 l=yr.transition,f=pt;try{if(yr.transition=null,pt=1,s)return s()}finally{pt=f,yr.transition=l,at=i,(at&6)===0&&Bs()}}function Ff(){ir=Ni.current,Dt(Ni)}function Oa(s,i){s.finishedWork=null,s.finishedLanes=0;var l=s.timeoutHandle;if(l!==-1&&(s.timeoutHandle=-1,JT(l)),sn!==null)for(l=sn.return;l!==null;){var f=l;switch(qd(f),f.tag){case 1:f=f.type.childContextTypes,f!=null&&Tl();break;case 3:_i(),Dt(Wn),Dt(Cn),sf();break;case 5:nf(f);break;case 4:_i();break;case 13:Dt(Ft);break;case 19:Dt(Ft);break;case 10:Kd(f.type._context);break;case 22:case 23:Ff()}l=l.return}if(yn=s,sn=s=Vs(s.current,null),wn=ir=i,fn=0,Go=null,Df=Yl=Ca=0,$n=Xo=null,Sa!==null){for(i=0;i<Sa.length;i++)if(l=Sa[i],f=l.interleaved,f!==null){l.interleaved=null;var b=f.next,T=l.pending;if(T!==null){var D=T.next;T.next=b,f.next=D}l.pending=f}Sa=null}return s}function Ig(s,i){do{var l=sn;try{if(Xd(),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(ka=0,gn=dn=jt=null,Wo=!1,Yo=0,Of.current=null,l===null||l.return===null){fn=1,Go=i,sn=null;break}e:{var T=s,D=l.return,Y=l,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=rg(D);if(xe!==null){xe.flags&=-257,sg(xe,D,Y,T,i),xe.mode&1&&ng(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){ng(T,se,i),jf();break e}V=Error(n(426))}}else if(Lt&&Y.mode&1){var Xt=rg(D);if(Xt!==null){(Xt.flags&65536)===0&&(Xt.flags|=256),sg(Xt,D,Y,T,i),Qd(ki(V,Y));break e}}T=V=ki(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=eg(T,V,i);Cm(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=tg(T,Y,i);Cm(T,ge);break e}}T=T.return}while(T!==null)}Mg(l)}catch(Ie){i=Ie,sn===l&&l!==null&&(sn=l=l.return);continue}break}while(!0)}function Rg(){var s=Wl.current;return Wl.current=Fl,s===null?Fl:s}function jf(){(fn===0||fn===3||fn===2)&&(fn=4),yn===null||(Ca&268435455)===0&&(Yl&268435455)===0||$s(yn,wn)}function Xl(s,i){var l=at;at|=2;var f=Rg();(yn!==s||wn!==i)&&(gs=null,Oa(s,i));do try{wv();break}catch(b){Ig(s,b)}while(!0);if(Xd(),at=l,Wl.current=f,sn!==null)throw Error(n(261));return yn=null,wn=0,fn}function wv(){for(;sn!==null;)Lg(sn)}function Sv(){for(;sn!==null&&!Eo();)Lg(sn)}function Lg(s){var i=jg(s.alternate,s,ir);s.memoizedProps=s.pendingProps,i===null?Mg(s):sn=i,Of.current=null}function Mg(s){var i=s;do{var l=i.alternate;if(s=i.return,(i.flags&32768)===0){if(l=gv(l,i,ir),l!==null){sn=l;return}}else{if(l=yv(l,i),l!==null){l.flags&=32767,sn=l;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,l){var f=pt,b=yr.transition;try{yr.transition=null,pt=1,_v(s,i,l,f)}finally{yr.transition=b,pt=f}return null}function _v(s,i,l,f){do Di();while(Ys!==null);if((at&6)!==0)throw Error(n(327));l=s.finishedWork;var b=s.finishedLanes;if(l===null)return null;if(s.finishedWork=null,s.finishedLanes=0,l===s.current)throw Error(n(177));s.callbackNode=null,s.callbackPriority=0;var T=l.lanes|l.childLanes;if(aT(s,T),s===yn&&(sn=yn=null,wn=0),(l.subtreeFlags&2064)===0&&(l.flags&2064)===0||$l||($l=!0,Bg(el,function(){return Di(),null})),T=(l.flags&15990)!==0,(l.subtreeFlags&15990)!==0||T){T=yr.transition,yr.transition=null;var D=pt;pt=1;var Y=at;at|=4,Of.current=null,Ev(s,l),_g(l,s),qT(Fd),ol=!!Pd,Fd=Pd=null,s.current=l,xv(l),ui(),at=Y,pt=D,yr.transition=T}else s.current=l;if($l&&($l=!1,Ys=s,Vl=b),T=s.pendingLanes,T===0&&(Ws=null),Z2(l.stateNode),Vn(s,wt()),i!==null)for(f=s.onRecoverableError,l=0;l<i.length;l++)b=i[l],f(b.value,{componentStack:b.stack,digest:b.digest});if(ql)throw ql=!1,s=If,If=null,s;return(Vl&1)!==0&&s.tag!==0&&Di(),T=s.pendingLanes,(T&1)!==0?s===Rf?Ko++:(Ko=0,Rf=s):Ko=0,Bs(),null}function Di(){if(Ys!==null){var s=wp(Vl),i=yr.transition,l=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(xg(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=l,yr.transition=i}}return!1}function Pg(s,i,l){i=ki(l,i),i=eg(s,i,1),s=Us(s,i,1),i=Fn(),s!==null&&(To(s,1,i),Vn(s,i))}function $t(s,i,l){if(s.tag===3)Pg(s,s,l);else for(;i!==null;){if(i.tag===3){Pg(i,s,l);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=ki(l,s),s=tg(i,s,1),i=Us(i,s,1),s=Fn(),i!==null&&(To(i,1,s),Vn(i,s));break}}i=i.return}}function kv(s,i,l){var f=s.pingCache;f!==null&&f.delete(i),i=Fn(),s.pingedLanes|=s.suspendedLanes&l,yn===s&&(wn&l)===l&&(fn===4||fn===3&&(wn&130023424)===wn&&500>wt()-Af?Oa(s,0):Df|=l),Vn(s,i)}function Fg(s,i){i===0&&((s.mode&1)===0?i=1:(i=rl,rl<<=1,(rl&130023424)===0&&(rl=4194304)));var l=Fn();s=hs(s,i),s!==null&&(To(s,i,l),Vn(s,l))}function Cv(s){var i=s.memoizedState,l=0;i!==null&&(l=i.retryLane),Fg(s,l)}function Nv(s,i){var l=0;switch(s.tag){case 13:var f=s.stateNode,b=s.memoizedState;b!==null&&(l=b.retryLane);break;case 19:f=s.stateNode;break;default:throw Error(n(314))}f!==null&&f.delete(i),Fg(s,l)}var jg;jg=function(s,i,l){if(s!==null)if(s.memoizedProps!==i.pendingProps||Wn.current)qn=!0;else{if((s.lanes&l)===0&&(i.flags&128)===0)return qn=!1,mv(s,i,l);qn=(s.flags&131072)!==0}else qn=!1,Lt&&(i.flags&1048576)!==0&&ym(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,Cn.current);Si(i,l),b=uf(null,i,f,s,b,l);var T=lf();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,ef(i),b.updater=jl,i.stateNode=b,b._reactInternals=i,mf(i,f,s,l),i=Ef(null,i,f,!0,T,l)):(i.tag=0,Lt&&T&&Yd(i),Pn(null,i,b,l),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=Dv(f),s=Or(f,s),b){case 0:i=bf(null,i,f,s,l);break e;case 1:i=cg(null,i,f,s,l);break e;case 11:i=ag(null,i,f,s,l);break e;case 14:i=ig(null,i,f,Or(f.type,s),l);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),bf(s,i,f,b,l);case 1:return f=i.type,b=i.pendingProps,b=i.elementType===f?b:Or(f,b),cg(s,i,f,b,l);case 3:e:{if(dg(i),s===null)throw Error(n(387));f=i.pendingProps,T=i.memoizedState,b=T.element,km(s,i),Al(i,f,null,l);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=ki(Error(n(423)),i),i=fg(s,i,f,l,b);break e}else if(f!==b){b=ki(Error(n(424)),i),i=fg(s,i,f,l,b);break e}else for(ar=Ps(i.stateNode.containerInfo.firstChild),sr=i,Lt=!0,Nr=null,l=Sm(i,null,f,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Ti(),f===b){i=ms(s,i,l);break e}Pn(s,i,f,l)}i=i.child}return i;case 5:return Om(i),s===null&&Vd(i),f=i.type,b=i.pendingProps,T=s!==null?s.memoizedProps:null,D=b.children,jd(f,b)?D=null:T!==null&&jd(f,T)&&(i.flags|=32),lg(s,i),Pn(s,i,D,l),i.child;case 6:return s===null&&Vd(i),null;case 13:return hg(s,i,l);case 4:return tf(i,i.stateNode.containerInfo),f=i.pendingProps,s===null?i.child=vi(i,null,f,l):Pn(s,i,f,l),i.child;case 11:return f=i.type,b=i.pendingProps,b=i.elementType===f?b:Or(f,b),ag(s,i,f,b,l);case 7:return Pn(s,i,i.pendingProps,l),i.child;case 8:return Pn(s,i,i.pendingProps.children,l),i.child;case 12:return Pn(s,i,i.pendingProps.children,l),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(Cr(T.value,D)){if(T.children===b.children&&!Wn.current){i=ms(s,i,l);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,l&-l),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|=l,V=T.alternate,V!==null&&(V.lanes|=l),Jd(T.return,l,i),Y.lanes|=l;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|=l,Y=D.alternate,Y!==null&&(Y.lanes|=l),Jd(D,l,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,l),i=i.child}return i;case 9:return b=i.type,f=i.pendingProps.children,Si(i,l),b=mr(b),f=f(b),i.flags|=1,Pn(s,i,f,l),i.child;case 14:return f=i.type,b=Or(f,i.pendingProps),b=Or(f.type,b),ig(s,i,f,b,l);case 15:return og(s,i,i.type,i.pendingProps,l);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,l),Jm(i,f,b),mf(i,f,b,l),Ef(null,i,f,!0,s,l);case 19:return mg(s,i,l);case 22:return ug(s,i,l)}throw Error(n(156,i.tag))};function Bg(s,i){return ba(s,i)}function Ov(s,i,l,f){this.tag=s,this.key=l,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,l,f){return new Ov(s,i,l,f)}function Bf(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Dv(s){if(typeof s=="function")return Bf(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 l=s.alternate;return l===null?(l=br(s.tag,i,s.key,s.mode),l.elementType=s.elementType,l.type=s.type,l.stateNode=s.stateNode,l.alternate=s,s.alternate=l):(l.pendingProps=i,l.type=s.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=s.flags&14680064,l.childLanes=s.childLanes,l.lanes=s.lanes,l.child=s.child,l.memoizedProps=s.memoizedProps,l.memoizedState=s.memoizedState,l.updateQueue=s.updateQueue,i=s.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=s.sibling,l.index=s.index,l.ref=s.ref,l}function Kl(s,i,l,f,b,T){var D=2;if(f=s,typeof s=="function")Bf(s)&&(D=1);else if(typeof s=="string")D=5;else e:switch(s){case N:return Aa(l.children,b,T,i);case I:D=8,b|=8;break;case F:return s=br(12,l,i,b|2),s.elementType=F,s.lanes=T,s;case $:return s=br(13,l,i,b),s.elementType=$,s.lanes=T,s;case Q:return s=br(19,l,i,b),s.elementType=Q,s.lanes=T,s;case re:return Jl(l,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 G:D=16,f=null;break e}throw Error(n(130,s==null?s:typeof s,""))}return i=br(D,l,i,b),i.elementType=s,i.type=f,i.lanes=T,i}function Aa(s,i,l,f){return s=br(7,s,f,i),s.lanes=l,s}function Jl(s,i,l,f){return s=br(22,s,f,i),s.elementType=re,s.lanes=l,s.stateNode={isHidden:!1},s}function Hf(s,i,l){return s=br(6,s,null,i),s.lanes=l,s}function Uf(s,i,l){return i=br(4,s.children!==null?s.children:[],s.key,i),i.lanes=l,i.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},i}function Av(s,i,l,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=hd(0),this.expirationTimes=hd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hd(0),this.identifierPrefix=f,this.onRecoverableError=b,this.mutableSourceEagerHydrationData=null}function zf(s,i,l,f,b,T,D,Y,V){return s=new Av(s,i,l,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:l,cache:null,transitions:null,pendingSuspenseBoundaries:null},ef(T),s}function Iv(s,i,l){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:_,key:f==null?null:""+f,children:s,containerInfo:i,implementation:l}}function Hg(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 l=s.type;if(Yn(l))return pm(s,l,i)}return i}function Ug(s,i,l,f,b,T,D,Y,V){return s=zf(l,f,!0,s,b,T,D,Y,V),s.context=Hg(null),l=s.current,f=Fn(),b=qs(l),T=ps(f,b),T.callback=i??null,Us(l,T,b),s.current.lanes=b,To(s,b,f),Vn(s,f),s}function Zl(s,i,l,f){var b=i.current,T=Fn(),D=qs(b);return l=Hg(l),i.context===null?i.context=l:i.pendingContext=l,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 zg(s,i){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var l=s.retryLane;s.retryLane=l!==0&&l<i?l:i}}function Wf(s,i){zg(s,i),(s=s.alternate)&&zg(s,i)}function Rv(){return null}var Wg=typeof reportError=="function"?reportError:function(s){console.error(s)};function Yf(s){this._internalRoot=s}tc.prototype.render=Yf.prototype.render=function(s){var i=this._internalRoot;if(i===null)throw Error(n(409));Zl(s,i,null,null)},tc.prototype.unmount=Yf.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=kp();s={blockedOn:null,target:s,priority:i};for(var l=0;l<Rs.length&&i!==0&&i<Rs[l].priority;l++);Rs.splice(l,0,s),l===0&&Op(s)}};function qf(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 Yg(){}function Lv(s,i,l,f,b){if(b){if(typeof f=="function"){var T=f;f=function(){var se=ec(D);T.call(se)}}var D=Ug(i,f,s,0,null,!1,!1,"",Yg);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=zf(s,0,!1,null,null,!1,!1,"",Yg);return s._reactRootContainer=V,s[ls]=V.current,Mo(s.nodeType===8?s.parentNode:s),Na(function(){Zl(i,V,l,f)}),V}function rc(s,i,l,f,b){var T=l._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=Lv(l,i,s,b,f);return ec(D)}Sp=function(s){switch(s.tag){case 3:var i=s.stateNode;if(i.current.memoizedState.isDehydrated){var l=xo(i.pendingLanes);l!==0&&(pd(i,l|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)}}),Wf(s,1)}},md=function(s){if(s.tag===13){var i=hs(s,134217728);if(i!==null){var l=Fn();Ir(i,s,134217728,l)}Wf(s,134217728)}},_p=function(s){if(s.tag===13){var i=qs(s),l=hs(s,i);if(l!==null){var f=Fn();Ir(l,s,i,f)}Wf(s,i)}},kp=function(){return pt},Cp=function(s,i){var l=pt;try{return pt=s,i()}finally{pt=l}},Me=function(s,i,l){switch(i){case"input":if(mn(s,l),i=l.name,l.type==="radio"&&i!=null){for(l=s;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll("input[name="+JSON.stringify(""+i)+'][type="radio"]'),i=0;i<l.length;i++){var f=l[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,l);break;case"select":i=l.value,i!=null&&Et(s,!!l.multiple,i,!1)}},It=Pf,Wt=Na;var Mv={usingClientEntryPoint:!1,Events:[jo,gi,xl,Je,ke,Pf]},Jo={findFiberByHostInstance:xa,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Pv={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||Rv,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(Pv),zr=sc}catch{}}return Qn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Mv,Qn.createPortal=function(s,i){var l=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!qf(i))throw Error(n(200));return Iv(s,i,null,l)},Qn.createRoot=function(s,i){if(!qf(s))throw Error(n(299));var l=!1,f="",b=Wg;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(f=i.identifierPrefix),i.onRecoverableError!==void 0&&(b=i.onRecoverableError)),i=zf(s,1,!1,null,null,l,!1,f,b),s[ls]=i.current,Mo(s.nodeType===8?s.parentNode:s),new Yf(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,l){if(!nc(i))throw Error(n(200));return rc(null,s,i,!0,l)},Qn.hydrateRoot=function(s,i,l){if(!qf(s))throw Error(n(405));var f=l!=null&&l.hydratedSources||null,b=!1,T="",D=Wg;if(l!=null&&(l.unstable_strictMode===!0&&(b=!0),l.identifierPrefix!==void 0&&(T=l.identifierPrefix),l.onRecoverableError!==void 0&&(D=l.onRecoverableError)),i=Ug(i,null,s,1,l??null,b,!1,T,D),s[ls]=i.current,Mo(s),f)for(s=0;s<f.length;s++)l=f[s],b=l._getVersion,b=b(l._source),i.mutableSourceEagerHydrationData==null?i.mutableSourceEagerHydrationData=[l,b]:i.mutableSourceEagerHydrationData.push(l,b);return new tc(i)},Qn.render=function(s,i,l){if(!nc(i))throw Error(n(200));return rc(null,s,i,!1,l)},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=Pf,Qn.unstable_renderSubtreeIntoContainer=function(s,i,l,f){if(!nc(l))throw Error(n(200));if(s==null||s._reactInternals===void 0)throw Error(n(38));return rc(s,i,l,!1,f)},Qn.version="18.3.1-next-f1338f8080-20240426",Qn}var Kg;function Hc(){if(Kg)return Qf.exports;Kg=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(),Qf.exports=qv(),Qf.exports}var Jg;function $v(){if(Jg)return ic;Jg=1;var e=Hc();return ic.createRoot=e.createRoot,ic.hydrateRoot=e.hydrateRoot,ic}var Vv=$v(),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(){}},Qv={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},na,b0,hb,Gv=(hb=class{constructor(){we(this,na,Qv);we(this,b0,!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,b0=new WeakMap,hb),Ma=new Gv;function Xv(e){setTimeout(e,0)}var Xa=typeof window>"u"||"Deno"in globalThis;function In(){}function Kv(e,t){return typeof e=="function"?e(t):e}function Oh(e){return typeof e=="number"&&e>=0&&e!==1/0}function kb(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 Zg(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:o,queryKey:u,stale:c}=e;if(u){if(r){if(t.queryHash!==E0(u,t.options))return!1}else if(!Nu(t.queryKey,u))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 e1(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 E0(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ka)(e)}function Ka(e){return JSON.stringify(e,(t,n)=>Dh(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 Jv=Object.prototype.hasOwnProperty;function x0(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=t1(e)&&t1(t);if(!r&&!(Dh(e)&&Dh(t)))return t;const o=(r?e:Object.keys(e)).length,u=r?t:Object.keys(t),c=u.length,d=r?new Array(c):{};let h=0;for(let m=0;m<c;m++){const g=r?m:u[m],E=e[g],x=t[g];if(E===x){d[g]=E,(r?m<o:Jv.call(e,g))&&h++;continue}if(E===null||x===null||typeof E!="object"||typeof x!="object"){d[g]=x;continue}const k=x0(E,x,n+1);d[g]=k,k===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 t1(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Dh(e){if(!n1(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!n1(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function n1(e){return Object.prototype.toString.call(e)==="[object Object]"}function Zv(e){return new Promise(t=>{Ma.setTimeout(t,e)})}function Ah(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?x0(e,t):t}function ew(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function tw(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var T0=Symbol();function Cb(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===T0?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function v0(e,t){return typeof e=="function"?e(...t):!!e}function nw(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,pb,rw=(pb=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,pb),w0=new rw;function Ih(){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 sw=Xv;function aw(){let e=[],t=0,n=c=>{c()},r=c=>{c()},a=sw;const o=c=>{t?e.push(c):a(()=>{n(c)})},u=()=>{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||u()}return d},batchCalls:c=>(...d)=>{o(()=>{c(...d)})},schedule:o,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{a=c}}}var Ht=aw(),Hi,sa,Ui,mb,iw=(mb=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,mb),_c=new iw;function ow(e){return Math.min(1e3*2**e,3e4)}function Nb(e){return(e??"online")==="online"?_c.isOnline():!0}var Rh=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Ob(e){let t=!1,n=0,r;const a=Ih(),o=()=>a.status!=="pending",u=S=>{var w;if(!o()){const v=new Rh(S);E(v),(w=e.onCancel)==null||w.call(e,v)}},c=()=>{t=!0},d=()=>{t=!1},h=()=>w0.isFocused()&&(e.networkMode==="always"||_c.isOnline())&&e.canRun(),m=()=>Nb(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)}),k=()=>{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 C=e.retry??(Xa?0:3),O=e.retryDelay??ow,A=typeof O=="function"?O(n,v):O,P=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,v);if(t||!P){E(v);return}n++,(_=e.onFail)==null||_.call(e,n,v),Zv(A).then(()=>h()?void 0:x()).then(()=>{t?E(v):k()})})};return{promise:a,status:()=>a.status,cancel:u,continue:()=>(r==null||r(),a),cancelRetry:c,continueRetry:d,canStart:m,start:()=>(m()?k():x().then(k),a)}}var Ha,gb,Db=(gb=class{constructor(){we(this,Ha)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Oh(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,gb),Ua,zi,xr,za,xn,Lu,Wa,Mr,bs,yb,uw=(yb=class extends Db{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,s1(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=s1(this.options);n.data!==void 0&&(this.setState(r1(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=Ah(this.state.data,t,this.options);return Be(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){Be(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===T0||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:!kb(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||Be(this,Mr,bs).call(this,{type:"invalidate"})}async fetch(t,n){var d,h,m,g,E,x,k,S,w,v,C,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=Cb(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))&&Be(this,Mr,bs).call(this,{type:"fetch",meta:(g=c.fetchOptions)==null?void 0:g.meta}),ye(this,xn,Ob({initialPromise:n==null?void 0:n.initialPromise,fn:c.fetchFn,onCancel:A=>{A instanceof Rh&&A.revert&&this.setState({...W(this,zi),fetchStatus:"idle"}),r.abort()},onFail:(A,P)=>{Be(this,Mr,bs).call(this,{type:"failed",failureCount:A,error:P})},onPause:()=>{Be(this,Mr,bs).call(this,{type:"pause"})},onContinue:()=>{Be(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=(k=W(this,xr).config).onSettled)==null||S.call(k,A,this.state.error,this),A}catch(A){if(A instanceof Rh){if(A.silent)return W(this,xn).promise;if(A.revert){if(this.state.data===void 0)throw A;return this.state.data}}throw Be(this,Mr,bs).call(this,{type:"error",error:A}),(v=(w=W(this,xr).config).onError)==null||v.call(w,A,this),(O=(C=W(this,xr).config).onSettled)==null||O.call(C,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,...Ab(r.data,this.options),fetchMeta:t.meta??null};case"success":const a={...r,...r1(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})})},yb);function Ab(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Nb(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function r1(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function s1(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,Lh,Mh,Ph,Fh,jh,Bh,Hh,Ib,bb,S0=(bb=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,Ih()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(W(this,st).addObserver(this),a1(W(this,st),this.options)?Be(this,ft,yu).call(this):this.updateResult(),Be(this,ft,Fh).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Uh(W(this,st),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Uh(W(this,st),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Be(this,ft,jh).call(this),Be(this,ft,Bh).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");Be(this,ft,Hh).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&&i1(W(this,st),r,this.options,n)&&Be(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)))&&Be(this,ft,Lh).call(this);const o=Be(this,ft,Mh).call(this);a&&(W(this,st)!==r||vr(this.options.enabled,W(this,st))!==vr(n.enabled,W(this,st))||o!==W(this,ia))&&Be(this,ft,Ph).call(this,o)}getOptimisticResult(t){const n=W(this,Kn).getQueryCache().build(W(this,Kn),t),r=this.createResult(n,t);return cw(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 Be(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),u=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&&a1(t,n),H=j&&i1(t,r,n,a);(M||H)&&(g={...g,...Ab(m.data,t.options)}),n._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:k,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=Ah(o==null?void 0:o.data,j,n),E=!0)}if(n.select&&x!==void 0&&!v)if(o&&x===(u==null?void 0:u.data)&&n.select===W(this,Pu))x=W(this,Yi);else try{ye(this,Pu,n.select),x=n.select(x),x=Ah(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)&&(k=W(this,aa),x=W(this,Yi),S=Date.now(),w="error");const C=g.fetchStatus==="fetching",O=w==="pending",A=w==="error",P=O&&C,_=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:k,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:C,isRefetching:C&&!O,isLoadingError:A&&!_,isPaused:g.fetchStatus==="paused",isPlaceholderData:E,isRefetchError:A&&_,isStale:_0(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=Ih());H(J)},Q=W(this,Es);switch(Q.status){case"pending":t.queryHash===r.queryHash&&H(Q);break;case"fulfilled":(M||I.data!==Q.value)&&$();break;case"rejected":(!M||I.error!==Q.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 u=new Set(o??W(this,$i));return this.options.throwOnError&&u.add("error"),Object.keys(W(this,jn)).some(c=>{const d=c;return W(this,jn)[d]!==t[d]&&u.has(d)})};Be(this,ft,Ib).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Be(this,ft,Fh).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){Be(this,ft,Hh).call(this);let n=W(this,st).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(In)),n},Lh=function(){Be(this,ft,jh).call(this);const t=pa(this.options.staleTime,W(this,st));if(Xa||W(this,jn).isStale||!Oh(t))return;const r=kb(W(this,jn).dataUpdatedAt,t)+1;ye(this,qa,Ma.setTimeout(()=>{W(this,jn).isStale||this.updateResult()},r))},Mh=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(W(this,st)):this.options.refetchInterval)??!1},Ph=function(t){Be(this,ft,Bh).call(this),ye(this,ia,t),!(Xa||vr(this.options.enabled,W(this,st))===!1||!Oh(W(this,ia))||W(this,ia)===0)&&ye(this,$a,Ma.setInterval(()=>{(this.options.refetchIntervalInBackground||w0.isFocused())&&Be(this,ft,yu).call(this)},W(this,ia)))},Fh=function(){Be(this,ft,Lh).call(this),Be(this,ft,Ph).call(this,Be(this,ft,Mh).call(this))},jh=function(){W(this,qa)&&(Ma.clearTimeout(W(this,qa)),ye(this,qa,void 0))},Bh=function(){W(this,$a)&&(Ma.clearInterval(W(this,$a)),ye(this,$a,void 0))},Hh=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))},Ib=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"})})},bb);function lw(e,t){return vr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function a1(e,t){return lw(e,t)||e.state.data!==void 0&&Uh(e,t,t.refetchOnMount)}function Uh(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&&_0(e,t)}return!1}function i1(e,t,n,r){return(e!==t||vr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&_0(e,n)}function _0(e,t){return vr(t.enabled,e)!==!1&&e.isStaleByTime(pa(t.staleTime,e))}function cw(e,t){return!Ou(e.getCurrentResult(),t)}function o1(e){return{onFetch:(t,n)=>{var m,g,E,x,k;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)||[],u=((k=t.state.data)==null?void 0:k.pageParams)||[];let c={pages:[],pageParams:[]},d=0;const h=async()=>{let S=!1;const w=O=>{nw(O,()=>t.signal,()=>S=!0)},v=Cb(t.options,t.fetchOptions),C=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?tw:ew;return{pages:j(O.pages,I,F),pageParams:j(O.pageParams,A,F)}};if(a&&o.length){const O=a==="backward",A=O?dw:u1,P={pages:o,pageParams:u},_=A(r,P);c=await C(P,_,O)}else{const O=e??o.length;do{const A=d===0?u[0]??r.initialPageParam:u1(r,c);if(d>0&&A==null)break;c=await C(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 u1(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 dw(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,Eb,fw=(Eb=class extends Db{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||Rb(),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 u,c,d,h,m,g,E,x,k,S,w,v,C,O,A,P,_,N;const n=()=>{Be(this,Kr,Zs).call(this,{type:"continue"})},r={client:W(this,Fu),meta:this.options.meta,mutationKey:this.options.mutationKey};ye(this,Va,Ob({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(I,F)=>{Be(this,Kr,Zs).call(this,{type:"failed",failureCount:I,error:F})},onPause:()=>{Be(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{Be(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=(u=this.options).onMutate)==null?void 0:c.call(u,t,r));F!==this.state.context&&Be(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=(k=this.options).onSettled)==null?void 0:S.call(k,I,null,t,this.state.context,r)),Be(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=(C=this.options).onError)==null?void 0:O.call(C,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 Be(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})})},Eb);function Rb(){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,xb,hw=(xb=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 fw({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=>e1(n,r))}findAll(t={}){return this.getAll().filter(n=>e1(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,xb);function oc(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Ts,oa,Jn,vs,ks,Tc,zh,Tb,pw=(Tb=class extends ni{constructor(n,r){super();we(this,ks);we(this,Ts);we(this,oa);we(this,Jn);we(this,vs);ye(this,Ts,n),this.setOptions(r),this.bindMethods(),Be(this,ks,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){Be(this,ks,Tc).call(this),Be(this,ks,zh).call(this,n)}getCurrentResult(){return W(this,oa)}reset(){var n;(n=W(this,Jn))==null||n.removeObserver(this),ye(this,Jn,void 0),Be(this,ks,Tc).call(this),Be(this,ks,zh).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,ks=new WeakSet,Tc=function(){var r;const n=((r=W(this,Jn))==null?void 0:r.state)??Rb();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})},zh=function(n){Ht.batch(()=>{var r,a,o,u,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(k){Promise.reject(k)}try{(u=(o=W(this,vs)).onSettled)==null||u.call(o,n.data,null,g,E,x)}catch(k){Promise.reject(k)}}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(k){Promise.reject(k)}try{(m=(h=W(this,vs)).onSettled)==null||m.call(h,void 0,n.error,g,E,x)}catch(k){Promise.reject(k)}}}this.listeners.forEach(g=>{g(W(this,oa))})})},Tb);function l1(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function mw(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,Wh,Yh,qh,$h,Vh,vb,gw=(vb=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=>{Be(this,Sn,$h).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=Be(this,Sn,qh).call(this,W(this,Qi));a.forEach(g=>g.observer.setOptions(g.defaultedQueryOptions));const o=a.map(g=>g.observer),u=o.map(g=>g.getCurrentResult()),c=r.length!==o.length,d=o.some((g,E)=>g!==r[E]),h=c||d,m=h?!0:u.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,u),this.hasListeners()&&(h&&(l1(r,o).forEach(g=>{g.destroy()}),l1(o,r).forEach(g=>{g.subscribe(E=>{Be(this,Sn,$h).call(this,g,E)})})),Be(this,Sn,Vh).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=Be(this,Sn,qh).call(this,t),a=r.map(u=>u.observer.getOptimisticResult(u.defaultedQueryOptions)),o=r.map(u=>u.defaultedQueryOptions.queryHash);return[a,u=>Be(this,Sn,Yh).call(this,u??a,n,o),()=>Be(this,Sn,Wh).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,Wh=function(t,n){return n.map((r,a)=>{const o=t[a];return r.defaultedQueryOptions.notifyOnChangeProps?o:r.observer.trackResult(o,u=>{n.forEach(c=>{c.observer.trackProp(u)})})})},Yh=function(t,n,r){if(n){const a=W(this,Uu),o=r!==void 0&&a!==void 0&&(a.length!==r.length||r.some((u,c)=>u!==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,x0(W(this,ua),n(t)))),W(this,ua)}return t},qh=function(t){const n=new Map;W(this,Tr).forEach(a=>{const o=a.options.queryHash;if(!o)return;const u=n.get(o);u?u.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 S0(W(this,Vi),o);r.push({defaultedQueryOptions:o,observer:c})}),r},$h=function(t,n){const r=W(this,Tr).indexOf(t);r!==-1&&(ye(this,ur,mw(W(this,ur),r,n)),Be(this,Sn,Vh).call(this))},Vh=function(){var t;if(this.hasListeners()){const n=W(this,ua),r=Be(this,Sn,Wh).call(this,W(this,ur),W(this,zu)),a=Be(this,Sn,Yh).call(this,r,(t=W(this,Gi))==null?void 0:t.combine);n!==a&&Ht.batch(()=>{this.listeners.forEach(o=>{o(W(this,ur))})})}},vb),Jr,wb,yw=(wb=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??E0(a,n);let u=this.get(o);return u||(u=new uw({client:t,queryKey:a,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(a)}),this.add(u)),u}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=>Zg(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Zg(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,wb),Vt,la,ca,Xi,Ki,da,Ji,Zi,Sb,bw=(Sb=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 yw),ye(this,la,e.mutationCache||new hw),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,w0.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,u=Kv(t,o);if(u!==void 0)return W(this,Vt).build(this,r).setData(u,{...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=o1(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(In).catch(In)}ensureInfiniteQueryData(e){return e.behavior=o1(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=E0(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===T0&&(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,Sb),Lb=L.createContext(void 0),jr=e=>{const t=L.useContext(Lb);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Ew=({client:e,children:t})=>(L.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),p.jsx(Lb.Provider,{value:e,children:t})),Mb=L.createContext(!1),Pb=()=>L.useContext(Mb);Mb.Provider;function xw(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Tw=L.createContext(xw()),Fb=()=>L.useContext(Tw),jb=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?v0(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Bb=e=>{L.useEffect(()=>{e.clearReset()},[e])},Hb=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||v0(n,[e.error,r])),Ub=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))}},zb=(e,t)=>e.isLoading&&e.isFetching&&!t,Qh=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,kc=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function c1({queries:e,...t},n){const r=jr(),a=Pb(),o=Fb(),u=L.useMemo(()=>e.map(S=>{const w=r.defaultQueryOptions(S);return w._optimisticResults=a?"isRestoring":"optimistic",w}),[e,r,a]);u.forEach(S=>{Ub(S);const w=r.getQueryCache().get(S.queryHash);jb(S,o,w)}),Bb(o);const[c]=L.useState(()=>new gw(r,u,t)),[d,h,m]=c.getOptimisticResult(u,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(u,t)},[u,t,c]);const x=d.some((S,w)=>Qh(u[w],S))?d.flatMap((S,w)=>{const v=u[w];if(v){const C=new S0(r,v);if(Qh(v,S))return kc(v,C,o);zb(S,a)&&kc(v,C,o)}return[]}):[];if(x.length>0)throw Promise.all(x);const k=d.find((S,w)=>{const v=u[w];return v&&Hb({result:S,errorResetBoundary:o,throwOnError:v.throwOnError,query:r.getQueryCache().get(v.queryHash),suspense:v.suspense})});if(k!=null&&k.error)throw k.error;return h(m())}function vw(e,t,n){var E,x,k,S;const r=Pb(),a=Fb(),o=jr(),u=o.defaultQueryOptions(e);(x=(E=o.getDefaultOptions().queries)==null?void 0:E._experimental_beforeQuery)==null||x.call(E,u);const c=o.getQueryCache().get(u.queryHash);u._optimisticResults=r?"isRestoring":"optimistic",Ub(u),jb(u,a,c),Bb(a);const d=!o.getQueryCache().get(u.queryHash),[h]=L.useState(()=>new t(o,u)),m=h.getOptimisticResult(u),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(u)},[u,h]),Qh(u,m))throw kc(u,h,a);if(Hb({result:m,errorResetBoundary:a,throwOnError:u.throwOnError,query:c,suspense:u.suspense}))throw m.error;if((S=(k=o.getDefaultOptions().queries)==null?void 0:k._experimental_afterQuery)==null||S.call(k,u,m),u.experimental_prefetchInRender&&!Xa&&zb(m,r)){const w=d?kc(u,h,a):c==null?void 0:c.promise;w==null||w.catch(In).finally(()=>{h.updateResult()})}return u.notifyOnChangeProps?m:h.trackResult(m)}function is(e,t){return vw(e,S0)}function ww(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 Sw(e,t){const n=jr(),[r]=L.useState(()=>new pw(n,e));L.useEffect(()=>{r.setOptions(e)},[r,e]);const a=L.useSyncExternalStore(L.useCallback(u=>r.subscribe(Ht.batchCalls(u)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=L.useCallback((u,c)=>{r.mutate(u,c).catch(In)},[r]);if(a.error&&v0(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:o,mutateAsync:a.mutate}}function _w({children:e}){const[t]=L.useState(()=>new bw({defaultOptions:{queries:{staleTime:3e5,gcTime:18e5,refetchOnWindowFocus:!1,retry:1}}}));return p.jsx(Ew,{client:t,children:e})}const kw="modulepreload",Cw=function(e){return"/"+e},d1={},Cs=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let u=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=u(n.map(h=>{if(h=Cw(h),h in d1)return;d1[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":kw,m||(E.as="script"),E.crossOrigin="",E.href=h,d&&E.setAttribute("nonce",d),document.head.appendChild(E),m)return new Promise((x,k)=>{E.addEventListener("load",x),E.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${h}`)))})}))}function o(u){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=u,window.dispatchEvent(c),!c.defaultPrevented)throw u}return a.then(u=>{for(const c of u||[])c.status==="rejected"&&o(c.reason);return t().catch(o)})};function Wb(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=Wb(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=Wb(e))&&(r&&(r+=" "),r+=t);return r}const k0="/api";class Wu extends Error{constructor(t,n,r){super(n),this.status=t,this.errorType=r,this.name="ApiError"}}async function _t(e,t){const n=await fetch(`${k0}${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}`,r.errorType)}return n.json()}async function uc(e,t){const n=await fetch(`${k0}${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}`,r.errorType)}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(`${k0}/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 Nw(){return is({queryKey:["health"],queryFn:Pt.getHealth,refetchInterval:3e4})}const Yb=new Set(["system-ui","serif","sans-serif","monospace","ui-monospace","cursive"]),Ow={compact:"13px",default:"14px",comfortable:"16px"},Dw={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 Aw(e){const t=parseInt(e.replace("#",""),16),n=(t>>16)/255,r=(t>>8&255)/255,a=(t&255)/255,o=u=>u<=.03928?u/12.92:((u+.055)/1.055)**2.4;return .2126*o(n)+.7152*o(r)+.0722*o(a)}function f1(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 Kf(e){return Yb.has(e)?`${e}, sans-serif`:e.toLowerCase().includes("mono")?`'${e}', monospace`:`'${e}', system-ui, sans-serif`}function Iw(e){var A,P,_,N,I,F,j,M,H,$,Q,J;const t=e.base??"modern",n=Dw[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,u=((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=Ow[((H=e.fonts)==null?void 0:H.size)??n.fonts.size]??"14px",E=e.palette??n.palette,x=new Set;for(const G of[d,h,m])!Yb.has(G)&&G!=="ui-monospace"&&x.add(G);const k=x.size>0?`https://fonts.googleapis.com/css2?${[...x].map(G=>`family=${encodeURIComponent(G)}:wght@400;500;600;700`).join("&")}&display=swap`:null,S=Aw(u)<.2,w=S?"#f1f5f9":c,v=S?"#94a3b8":"#6b7280",C=S?"rgba(255,255,255,0.1)":"#e5e7eb",O={"--yc-color-primary":r,"--yc-color-primary-light":f1(r,20),"--yc-color-primary-dark":f1(r,-15),"--yc-color-background":a,"--yc-color-surface":o,"--yc-color-sidebar":u,"--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":C,"--yc-font-heading":Kf(d),"--yc-font-body":Kf(h),"--yc-font-mono":Kf(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:(Q=e.sidebar)==null?void 0:Q.links,sidebarSections:(J=e.sidebar)==null?void 0:J.sections,logo:e.logo,favicon:e.favicon,title:e.title,customCss:e.customCss,googleFontsUrl:k}}const qb=L.createContext(null);function Rw({children:e}){const{data:t}=io(),n=L.useMemo(()=>Iw((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(qb.Provider,{value:n,children:e})}function C0(){const e=L.useContext(qb);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const h1="yamchart-sidebar-folders";function Lw(e){return e?e.replace(/[-_]/g," ").replace(/\b\w/g,t=>t.toUpperCase()):"Ungrouped"}function p1(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,u)=>{const c=o.title||o.name,d=u.title||u.name;return c.localeCompare(d)}),n.push({folder:r,label:Lw(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 m1({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 g1({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 Mw({dashboards:e,charts:t,currentPath:n,onNavigate:r}){var A,P;const a=C0(),o=n.split("?")[0],u=_=>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(()=>p1(e),[e]),g=L.useMemo(()=>p1(t),[t]),E=L.useMemo(()=>{for(const _ of e)if(u(`/dashboards/${_.name}`))return _.folder??"";return null},[e,o]),x=L.useMemo(()=>{for(const _ of t)if(u(`/charts/${_.name}`))return _.folder??"";return null},[t,o]),[k,S]=L.useState(()=>{try{const _=localStorage.getItem(h1);return _?JSON.parse(_):{}}catch{return{}}});L.useEffect(()=>{try{localStorage.setItem(h1,JSON.stringify(k))}catch{}},[k]);const w=L.useCallback((_,N)=>{const I=`${_}:${N}`;return _==="dashboards"&&E===N||_==="charts"&&x===N?!0:k[I]??!1},[k,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]),C=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"}),C?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(g1,{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=u(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=u(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(g1,{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=u(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(m1,{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=u(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(m1,{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 $b(e){return is({queryKey:["chart",e],queryFn:()=>Pt.getChart(e),enabled:!!e,staleTime:1e3*60*10})}const y1=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},Pw=(e=>e?y1(e):y1),Fw=e=>e;function jw(e,t=Fw){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 b1=e=>{const t=Pw(e),n=r=>jw(t,r);return Object.assign(n,t),n},Vb=(e=>e?b1(e):b1),qe=Vb((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 u=o.crossFilters[n];if(u&&u.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(),u={};for(const c of Object.values(a))c.sourceChart!==n&&(u[c.field]=c.value);return{...r,...u,...o[n]}},resetFilters:()=>e({globalFilters:{},chartFilters:{},crossFilters:{}}),resetChartFilters:n=>e(r=>{const{[n]:a,...o}=r.chartFilters;return{chartFilters:o}})}));function Qb(e){const t=qe(u=>u.globalFilters),n=qe(u=>u.chartFilters),r=qe(u=>u.crossFilters),a=qe(u=>u.getEffectiveFilters),o=L.useMemo(()=>Object.fromEntries(Object.entries(a(e)).filter(([u,c])=>c!=null)),[t,n,r,e]);return is({queryKey:["chartData",e,o],queryFn:()=>Pt.queryChart(e,o),enabled:!!e})}function Bw(e){const t=qe(u=>u.globalFilters),n=qe(u=>u.chartFilters),r=qe(u=>u.crossFilters),a=qe(u=>u.getEffectiveFilters),o=L.useMemo(()=>Object.fromEntries(Object.entries(a(e)).filter(([u,c])=>c!=null)),[t,n,r,e]);return is({queryKey:["chartWithData",e,o],queryFn:()=>Pt.queryChart(e,o,{includeConfig:!0}),enabled:!!e})}function N0(){const e=jr();return t=>{e.invalidateQueries({queryKey:["chartData",t]}),e.invalidateQueries({queryKey:["chartWithData",t]})}}function Gb(){return is({queryKey:["dashboards"],queryFn:()=>Pt.getDashboards()})}function E1(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 Hw(e){return e.tabs?e.tabs[0]?E1(e.tabs[0].layout):[]:e.layout?E1(e.layout):[]}function Uw(e,t){var o,u,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=Hw(a.data);(E=(g=a.data.tabs)==null?void 0:g[0])==null||E.name;const k=Object.fromEntries(Object.entries(r).filter(([S,w])=>w!=null));x.forEach(S=>{n.prefetchQuery({queryKey:["chartWithData",S,k],queryFn:()=>Pt.queryChart(S,k,{includeConfig:!0}),staleTime:1e3*60*5})})}},[(o=a.data)==null?void 0:o.layout,(u=a.data)==null?void 0:u.tabs,(c=a.data)==null?void 0:c.name,r,n]),a}function zw(e){const t=jr();return Sw({mutationFn:({layout:n,message:r,tab:a})=>Pt.saveDashboard(e,n,r,a),onSuccess:()=>{t.invalidateQueries({queryKey:["dashboard",e]})}})}function Ww(){const e=jr();return()=>{e.invalidateQueries({queryKey:["chartData"]}),e.invalidateQueries({queryKey:["chartWithData"]})}}function Yw(){const e=jr();L.useRef(1e3),L.useEffect(()=>{},[e])}function qw({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 $w({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(qw,{connection:t})]})}const eo=Vb(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 Vw({onClose:e}){const[t,n]=L.useState(""),[r,a]=L.useState(""),[o,u]=L.useState(""),[c,d]=L.useState(""),[h,m]=L.useState(!1),[g,E]=L.useState(!1),x=async k=>{if(k.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:k=>k.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:k=>n(k.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:k=>a(k.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:k=>u(k.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 Qw({onNavigateToUsers:e,onNavigateToShares:t}){const n=eo(h=>h.auth),r=eo(h=>h.logout),[a,o]=L.useState(!1),[u,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"})]}),u&&p.jsx(Vw,{onClose:()=>c(!1)})]})}function Gw({onToggleSidebar:e,currentPath:t,onNavigateToUsers:n,onNavigateToShares:r}){const a=C0(),{data:o}=Nw(),u=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($w,{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]}),u.status==="authenticated"&&n&&p.jsx(Qw,{onNavigateToUsers:n,onNavigateToShares:r})]})]})}const x1="yamchart-sidebar-hidden";function Xw({children:e,currentPath:t,onNavigate:n,onNavigateToUsers:r,onNavigateToShares:a}){const{data:o}=io(),{data:u}=Gb(),c=C0(),d=(o==null?void 0:o.charts)||[],h=u||[],[m,g]=L.useState(()=>c.sidebarShow?localStorage.getItem(x1)==="true":!0),E=L.useCallback(()=>{g(x=>{const k=!x;return localStorage.setItem(x1,String(k)),k})},[]);return p.jsxs("div",{className:"flex h-screen",style:{backgroundColor:"var(--yc-color-background)"},children:[!m&&p.jsx(Mw,{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(Gw,{onToggleSidebar:E,currentPath:t,onNavigateToUsers:r,onNavigateToShares:a}),p.jsx("main",{className:"flex-1 overflow-auto",children:e})]})]})}function Kw(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 Jf={},bu={};function Pa(e,t){try{const r=(Jf[e]||(Jf[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return r in bu?bu[r]:T1(r,r.split(":"))}catch{if(e in bu)return bu[e];const n=e==null?void 0:e.match(Jw);return n?T1(e,n.slice(1)):NaN}}const Jw=/([+-]\d\d):?(\d\d)?/;function T1(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)),Xb(this),Gh(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),Gh(this),+this}[Symbol.for("constructDateFrom")](t){return new rs(+new Date(t),this.timeZone)}}const v1=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!v1.test(e))return;const t=e.replace(v1,"$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),Zw(this),+this},rs.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Gh(this),+this}))});function Gh(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-Pa(e.timeZone,e)*60))}function Zw(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()),Xb(e)}function Xb(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(),u=a-o,c=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();u&&c&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+u);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 C=Pa(e.timeZone,e),O=C>0?Math.floor(C):Math.ceil(C),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} (${Kw(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 Kb=6048e5,eS=864e5,O0=6e4,D0=36e5,tS=1e3,w1=Symbol.for("constructDateFrom");function ht(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&w1 in e?e[w1](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 u=o.getDate();return a>=u?o:(r.setFullYear(o.getFullYear(),o.getMonth(),a),r)}let nS={};function ri(){return nS}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(),u=(o<r?7:0)+o-r;return a.setDate(a.getDate()-u),a.setHours(0,0,0,0),a}function Za(e,t){return ss(e,{...t,weekStartsOn:1})}function Jb(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),u=ht(n,0);u.setFullYear(r,0,4),u.setHours(0,0,0,0);const c=Za(u);return n.getTime()>=o.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function Cc(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 A0(e,t,n){const[r,a]=oo(n==null?void 0:n.in,e,t),o=to(r),u=to(a),c=+o-Cc(o),d=+u-Cc(u);return Math.round((c-d)/eS)}function rS(e,t){const n=Jb(e,t),r=ht(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Za(r)}function Zb(e,t,n){return Yu(e,t*3,n)}function I0(e,t,n){return Ja(e,t*7,n)}function R0(e,t,n){return Yu(e,t*12,n)}function sS(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 aS(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 iS(e,t,n){const[r,a]=oo(n==null?void 0:n.in,e,t);return+to(r)==+to(a)}function eE(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function oS(e){return!(!eE(e)&&typeof e!="number"||isNaN(+Ke(e)))}function tE(e,t,n){const[r,a]=oo(n==null?void 0:n.in,e,t),o=r.getFullYear()-a.getFullYear(),u=r.getMonth()-a.getMonth();return o*12+u}function uS(e,t){const n=Ke(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function nE(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 rE(e,t){const[n,r]=oo(e,t.start,t.end);return{start:n,end:r}}function lS(e,t){const{start:n,end:r}=rE(t==null?void 0:t.in,e);let a=+n>+r;const o=a?+n:+r,u=a?r:n;u.setHours(0,0,0,0),u.setDate(1);let c=1;const d=[];for(;+u<=o;)d.push(ht(n,u)),u.setMonth(u.getMonth()+c);return a?d.reverse():d}function cS(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 sE(e,t){const n=Ke(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function aE(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 L0(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 dS(e,t){const{start:n,end:r}=rE(t==null?void 0:t.in,e);let a=+n>+r;const o=a?+n:+r,u=a?r:n;u.setHours(0,0,0,0),u.setMonth(0,1);let c=1;const d=[];for(;+u<=o;)d.push(ht(n,u)),u.setFullYear(u.getFullYear()+c);return a?d.reverse():d}function M0(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(),u=(o<r?-7:0)+6-(o-r);return a.setDate(a.getDate()+u),a.setHours(23,59,59,999),a}function fS(e,t){return M0(e,{...t,weekStartsOn:1})}function hS(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 pS={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"}},mS=(e,t,n)=>{let r;const a=pS[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 Zf(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const gS={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},yS={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},bS={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ES={date:Zf({formats:gS,defaultWidth:"full"}),time:Zf({formats:yS,defaultWidth:"full"}),dateTime:Zf({formats:bS,defaultWidth:"full"})},xS={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},TS=(e,t,n,r)=>xS[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 u=e.defaultFormattingWidth||e.defaultWidth,c=n!=null&&n.width?String(n.width):u;a=e.formattingValues[c]||e.formattingValues[u]}else{const u=e.defaultWidth,c=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[c]||e.values[u]}const o=e.argumentCallback?e.argumentCallback(t):t;return a[o]}}const vS={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},wS={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},SS={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"]},_S={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"]},kS={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"}},CS={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"}},NS=(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"},OS={ordinalNumber:NS,era:eu({values:vS,defaultWidth:"wide"}),quarter:eu({values:wS,defaultWidth:"wide",argumentCallback:e=>e-1}),month:eu({values:SS,defaultWidth:"wide"}),day:eu({values:_S,defaultWidth:"wide"}),dayPeriod:eu({values:kS,defaultWidth:"wide",formattingValues:CS,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 u=o[0],c=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(c)?AS(c,g=>g.test(u)):DS(c,g=>g.test(u));let h;h=e.valueCallback?e.valueCallback(d):d,h=n.valueCallback?n.valueCallback(h):h;const m=t.slice(u.length);return{value:h,rest:m}}}function DS(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function AS(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function IS(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 u=e.valueCallback?e.valueCallback(o[0]):o[0];u=n.valueCallback?n.valueCallback(u):u;const c=t.slice(a.length);return{value:u,rest:c}}}const RS=/^(\d+)(th|st|nd|rd)?/i,LS=/\d+/i,MS={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},PS={any:[/^b/i,/^(a|c)/i]},FS={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},jS={any:[/1/i,/2/i,/3/i,/4/i]},BS={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},HS={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]},US={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},zS={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]},WS={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},YS={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}},qS={ordinalNumber:IS({matchPattern:RS,parsePattern:LS,valueCallback:e=>parseInt(e,10)}),era:tu({matchPatterns:MS,defaultMatchWidth:"wide",parsePatterns:PS,defaultParseWidth:"any"}),quarter:tu({matchPatterns:FS,defaultMatchWidth:"wide",parsePatterns:jS,defaultParseWidth:"any",valueCallback:e=>e+1}),month:tu({matchPatterns:BS,defaultMatchWidth:"wide",parsePatterns:HS,defaultParseWidth:"any"}),day:tu({matchPatterns:US,defaultMatchWidth:"wide",parsePatterns:zS,defaultParseWidth:"any"}),dayPeriod:tu({matchPatterns:WS,defaultMatchWidth:"any",parsePatterns:YS,defaultParseWidth:"any"})},La={code:"en-US",formatDistance:mS,formatLong:ES,formatRelative:TS,localize:OS,match:qS,options:{weekStartsOn:0,firstWeekContainsDate:1}};function $S(e,t){const n=Ke(e,t==null?void 0:t.in);return A0(n,L0(n))+1}function Uc(e,t){const n=Ke(e,t==null?void 0:t.in),r=+Za(n)-+rS(n);return Math.round(r/Kb)+1}function P0(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,u=ht((t==null?void 0:t.in)||e,0);u.setFullYear(r+1,0,o),u.setHours(0,0,0,0);const c=ss(u,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 VS(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=P0(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 zc(e,t){const n=Ke(e,t==null?void 0:t.in),r=+ss(n,t)-+VS(n,t);return Math.round(r/Kb)+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"},S1={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=P0(e,r),o=a>0?a:1-a;if(t==="YY"){const u=o%100;return mt(u,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):mt(o,t.length)},R:function(e,t){const n=Jb(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=zc(e,r);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):mt(a,t.length)},I:function(e,t,n){const r=Uc(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=$S(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 k1(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 k1(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"+_1(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"+_1(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 _1(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 k1(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 C1=(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"})}},iE=(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"})}},QS=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return C1(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}}",C1(r,t)).replace("{{time}}",iE(a,t))},Xh={p:iE,P:QS},GS=/^D+$/,XS=/^Y+$/,KS=["D","DD","YY","YYYY"];function oE(e){return GS.test(e)}function uE(e){return XS.test(e)}function Kh(e,t,n){const r=JS(e,t,n);if(console.warn(r),KS.includes(e))throw new RangeError(r)}function JS(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 ZS=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,e_=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,t_=/^'([^]*?)'?$/,n_=/''/g,r_=/[a-zA-Z]/;function hn(e,t,n){var m,g,E,x,k,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,u=(n==null?void 0:n.weekStartsOn)??((S=(k=n==null?void 0:n.locale)==null?void 0:k.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(!oS(c))throw new RangeError("Invalid time value");let d=t.match(e_).map(C=>{const O=C[0];if(O==="p"||O==="P"){const A=Xh[O];return A(C,a.formatLong)}return C}).join("").match(ZS).map(C=>{if(C==="''")return{isToken:!1,value:"'"};const O=C[0];if(O==="'")return{isToken:!1,value:s_(C)};if(S1[O])return{isToken:!0,value:C};if(O.match(r_))throw new RangeError("Format string contains an unescaped latin alphabet character `"+O+"`");return{isToken:!1,value:C}});a.localize.preprocessor&&(d=a.localize.preprocessor(c,d));const h={firstWeekContainsDate:o,weekStartsOn:u,locale:a};return d.map(C=>{if(!C.isToken)return C.value;const O=C.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&uE(O)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&oE(O))&&Kh(O,t,String(e));const A=S1[O[0]];return A(c,O,a.localize,h)}).join("")}function s_(e){const t=e.match(t_);return t?t[1].replace(n_,"'"):e}function a_(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 i_(){return Object.assign({},ri())}function o_(e,t){const n=Ke(e,t==null?void 0:t.in).getDay();return n===0?7:n}function u_(e,t){return Ke(e,t==null?void 0:t.in).getMonth()}function l_(e,t){return Ke(e,t==null?void 0:t.in).getFullYear()}function c_(e,t){return+Ke(e)>+Ke(t)}function d_(e,t){return+Ke(e)<+Ke(t)}function f_(e,t){const n=h_(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 h_(e){var t;return typeof e=="function"&&((t=e.prototype)==null?void 0:t.constructor)===e}const p_=10;class lE{constructor(){ve(this,"subPriority",0)}validate(t,n){return!0}}class m_ extends lE{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 g_ extends lE{constructor(n,r){super();ve(this,"priority",p_);ve(this,"subPriority",-1);this.context=n||(a=>ht(r,a))}set(n,r){return r.timestampIsSet?n:ht(n,f_(n,this.context))}}let ct=class{run(t,n,r,a){const o=this.parse(t,n,r,a);return o?{setter:new m_(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(t,n,r){return!0}};class y_ 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,u=n[5]?parseInt(n[5],10):0;return{value:r*(a*D0+o*O0+u*tS),rest:t.slice(n[0].length)}}function cE(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 F0(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 dE(e,t){const n=t>0,r=n?t:1-t;let a;if(r<=50)a=e||100;else{const o=r+50,u=Math.trunc(o/100)*100,c=e>=o%100;a=e+u-(c?100:0)}return n?a:1-a}function fE(e){return e%400===0||e%4===0&&e%100!==0}class b_ 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=u=>({year:u,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=dE(a.year,o);return n.setFullYear(c,0,1),n.setHours(0,0,0,0),n}const u=!("era"in r)||r.era===1?a.year:1-a.year;return n.setFullYear(u,0,1),n.setHours(0,0,0,0),n}}class E_ 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=u=>({year:u,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 u=P0(n,o);if(a.isTwoDigitYear){const d=dE(a.year,u);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 x_ 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 T_ 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 v_ 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 w_ 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 S_ 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=u=>u-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 __ 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=u=>u-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 k_(e,t,n){const r=Ke(e,n==null?void 0:n.in),a=zc(r,n)-t;return r.setDate(r.getDate()-a*7),Ke(r,n==null?void 0:n.in)}class C_ 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(k_(n,a,o),o)}}function N_(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),r}class O_ 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(N_(n,a))}}const D_=[31,28,31,30,31,30,31,31,30,31,30,31],A_=[31,29,31,30,31,30,31,31,30,31,30,31];class I_ 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=fE(a),u=n.getMonth();return o?r>=1&&r<=A_[u]:r>=1&&r<=D_[u]}set(n,r,a){return n.setDate(a),n.setHours(0,0,0,0),n}}class R_ 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 fE(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 j0(e,t,n){var g,E,x,k;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??((k=(x=r.locale)==null?void 0:x.options)==null?void 0:k.weekStartsOn)??0,o=Ke(e,n==null?void 0:n.in),u=o.getDay(),d=(t%7+7)%7,h=7-a,m=t<0||t>6?t-(u+h)%7:(d+h)%7-(u+h)%7;return Ja(o,m,n)}class L_ 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=j0(n,a,o),n.setHours(0,0,0,0),n}}class M_ 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 u=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),u);case"eo":return en(a.ordinalNumber(n,{unit:"day"}),u);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=j0(n,a,o),n.setHours(0,0,0,0),n}}class P_ 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 u=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),u);case"co":return en(a.ordinalNumber(n,{unit:"day"}),u);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=j0(n,a,o),n.setHours(0,0,0,0),n}}function F_(e,t,n){const r=Ke(e,n==null?void 0:n.in),a=o_(r,n),o=t-a;return Ja(r,o,n)}class j_ 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=u=>u===0?7:u;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=F_(n,a),n.setHours(0,0,0,0),n}}class B_ 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(F0(a),0,0,0),n}}class H_ 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(F0(a),0,0,0),n}}class U_ 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(F0(a),0,0,0),n}}class z_ 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 W_ 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 Y_ 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 q_ 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 $_ 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 V_ 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 Q_ 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 G_ 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()-Cc(n)-a)}}class X_ 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()-Cc(n)-a)}}class K_ extends ct{constructor(){super(...arguments);ve(this,"priority",40);ve(this,"incompatibleTokens","*")}parse(n){return cE(n)}set(n,r,a){return[ht(n,a*1e3),{timestampIsSet:!0}]}}class J_ extends ct{constructor(){super(...arguments);ve(this,"priority",20);ve(this,"incompatibleTokens","*")}parse(n){return cE(n)}set(n,r,a){return[ht(n,a),{timestampIsSet:!0}]}}const Z_={G:new y_,y:new b_,Y:new E_,R:new x_,u:new T_,Q:new v_,q:new w_,M:new S_,L:new __,w:new C_,I:new O_,d:new I_,D:new R_,E:new L_,e:new M_,c:new P_,i:new j_,a:new B_,b:new H_,B:new U_,h:new z_,H:new W_,K:new Y_,k:new q_,m:new $_,s:new V_,S:new Q_,X:new G_,x:new X_,t:new K_,T:new J_},ek=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,tk=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,nk=/^'([^]*?)'?$/,rk=/''/g,sk=/\S/,ak=/[a-zA-Z]/;function eh(e,t,n,r){var w,v,C,O;const a=()=>ht(n,NaN),o=i_(),u=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=(C=o.locale)==null?void 0:C.options)==null?void 0:O.weekStartsOn)??0,h={firstWeekContainsDate:c,weekStartsOn:d,locale:u},m=[new g_(r==null?void 0:r.in,n)],g=t.match(tk).map(A=>{const P=A[0];if(P in Xh){const _=Xh[P];return _(A,u.formatLong)}return A}).join("").match(ek),E=[];for(let A of g){uE(A)&&Kh(A,t,e),oE(A)&&Kh(A,t,e);const P=A[0],_=Z_[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,u.match,h);if(!I)return a();m.push(I.setter),e=I.rest}else{if(P.match(ak))throw new RangeError("Format string contains an unescaped latin alphabet character `"+P+"`");if(A==="''"?A="'":P==="'"&&(A=ik(A)),e.indexOf(A)===0)e=e.slice(A.length);else return a()}}if(e.length>0&&sk.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 k=Ke(n,r==null?void 0:r.in);if(isNaN(+k))return a();const S={};for(const A of x){if(!A.validate(k,h))return a();const P=A.set(k,S,h);Array.isArray(P)?(k=P[0],Object.assign(S,P[1])):k=P}return k}function ik(e){return e.match(nk)[1].replace(rk,"'")}function ok(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 uk(e,t,n){const[r,a]=oo(n==null?void 0:n.in,e,t);return r.getFullYear()===a.getFullYear()}function N1(e,t,n){return Ja(e,-t,n)}function Oc(e,t){const n=()=>ht(t==null?void 0:t.in,NaN),a=fk(e);let o;if(a.date){const h=hk(a.date,2);o=pk(h.restDateString,h.year)}if(!o||isNaN(+o))return n();const u=+o;let c=0,d;if(a.time&&(c=mk(a.time),isNaN(c)))return n();if(a.timezone){if(d=gk(a.timezone),isNaN(d))return n()}else{const h=new Date(u+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(u+c+d,t==null?void 0:t.in)}const lc={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},lk=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ck=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,dk=/^([+-])(\d{2})(?::?(\d{2}))?$/;function fk(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 hk(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 pk(e,t){if(t===null)return new Date(NaN);const n=e.match(lk);if(!n)return new Date(NaN);const r=!!n[4],a=nu(n[1]),o=nu(n[2])-1,u=nu(n[3]),c=nu(n[4]),d=nu(n[5])-1;if(r)return Tk(t,c,d)?yk(t,c,d):new Date(NaN);{const h=new Date(0);return!Ek(t,o,u)||!xk(t,a)?new Date(NaN):(h.setUTCFullYear(t,o,Math.max(a,u)),h)}}function nu(e){return e?parseInt(e):1}function mk(e){const t=e.match(ck);if(!t)return NaN;const n=th(t[1]),r=th(t[2]),a=th(t[3]);return vk(n,r,a)?n*D0+r*O0+a*1e3:NaN}function th(e){return e&&parseFloat(e.replace(",","."))||0}function gk(e){if(e==="Z")return 0;const t=e.match(dk);if(!t)return 0;const n=t[1]==="+"?-1:1,r=parseInt(t[2]),a=t[3]&&parseInt(t[3])||0;return wk(r,a)?n*(r*D0+a*O0):NaN}function yk(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 bk=[31,null,31,30,31,30,31,31,30,31,30,31];function hE(e){return e%400===0||e%4===0&&e%100!==0}function Ek(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(bk[t]||(hE(e)?29:28))}function xk(e,t){return t>=1&&t<=(hE(e)?366:365)}function Tk(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function vk(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function wk(e,t){return t>=0&&t<=59}function Sk(e,t,n){const r=Ke(e,n==null?void 0:n.in),a=r.getFullYear(),o=r.getDate(),u=ht(e,0);u.setFullYear(a,t,15),u.setHours(0,0,0,0);const c=a_(u);return r.setMonth(t,Math.min(o,c)),r}function _k(e,t,n){const r=Ke(e,n==null?void 0:n.in);return isNaN(+r)?ht(e,NaN):(r.setFullYear(t),r)}function kk(e,t,n){return Yu(e,-t,n)}function Ck(e,t,n){return Zb(e,-t,n)}function Nk(e,t,n){return I0(e,-t,n)}function Ok(e,t,n){return R0(e,-t,n)}const O1=5,Dk=4;function Ak(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,a=t.addDays(e,-r+1),o=t.addDays(a,O1*7-1);return t.getMonth(e)===t.getMonth(o)?O1:Dk}function pE(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 Ik(e,t){const n=pE(e,t),r=Ak(e,t);return t.addDays(n,r*7-1)}const mE={...La,labels:{labelDayButton:(e,t,n,r)=>{let a;r&&typeof r.format=="function"?a=r.format.bind(r):a=(u,c)=>hn(u,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=(u,c)=>hn(u,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 u;return(u=this.overrides)!=null&&u.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):I0(r,a)},this.addYears=(r,a)=>{var o;return(o=this.overrides)!=null&&o.addYears?this.overrides.addYears(r,a):R0(r,a)},this.differenceInCalendarDays=(r,a)=>{var o;return(o=this.overrides)!=null&&o.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,a):A0(r,a)},this.differenceInCalendarMonths=(r,a)=>{var o;return(o=this.overrides)!=null&&o.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,a):tE(r,a)},this.eachMonthOfInterval=r=>{var a;return(a=this.overrides)!=null&&a.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):lS(r)},this.eachYearOfInterval=r=>{var c;const a=(c=this.overrides)!=null&&c.eachYearOfInterval?this.overrides.eachYearOfInterval(r):dS(r),o=new Set(a.map(d=>this.getYear(d)));if(o.size===a.length)return a;const u=[];return o.forEach(d=>{u.push(new Date(d,0,1))}),u},this.endOfBroadcastWeek=r=>{var a;return(a=this.overrides)!=null&&a.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):Ik(r,this)},this.endOfISOWeek=r=>{var a;return(a=this.overrides)!=null&&a.endOfISOWeek?this.overrides.endOfISOWeek(r):fS(r)},this.endOfMonth=r=>{var a;return(a=this.overrides)!=null&&a.endOfMonth?this.overrides.endOfMonth(r):nE(r)},this.endOfWeek=(r,a)=>{var o;return(o=this.overrides)!=null&&o.endOfWeek?this.overrides.endOfWeek(r,a):M0(r,this.options)},this.endOfYear=r=>{var a;return(a=this.overrides)!=null&&a.endOfYear?this.overrides.endOfYear(r):aE(r)},this.format=(r,a,o)=>{var c;const u=(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(u):u},this.getISOWeek=r=>{var a;return(a=this.overrides)!=null&&a.getISOWeek?this.overrides.getISOWeek(r):Uc(r)},this.getMonth=(r,a)=>{var o;return(o=this.overrides)!=null&&o.getMonth?this.overrides.getMonth(r,this.options):u_(r,this.options)},this.getYear=(r,a)=>{var o;return(o=this.overrides)!=null&&o.getYear?this.overrides.getYear(r,this.options):l_(r,this.options)},this.getWeek=(r,a)=>{var o;return(o=this.overrides)!=null&&o.getWeek?this.overrides.getWeek(r,this.options):zc(r,this.options)},this.isAfter=(r,a)=>{var o;return(o=this.overrides)!=null&&o.isAfter?this.overrides.isAfter(r,a):c_(r,a)},this.isBefore=(r,a)=>{var o;return(o=this.overrides)!=null&&o.isBefore?this.overrides.isBefore(r,a):d_(r,a)},this.isDate=r=>{var a;return(a=this.overrides)!=null&&a.isDate?this.overrides.isDate(r):eE(r)},this.isSameDay=(r,a)=>{var o;return(o=this.overrides)!=null&&o.isSameDay?this.overrides.isSameDay(r,a):iS(r,a)},this.isSameMonth=(r,a)=>{var o;return(o=this.overrides)!=null&&o.isSameMonth?this.overrides.isSameMonth(r,a):ok(r,a)},this.isSameYear=(r,a)=>{var o;return(o=this.overrides)!=null&&o.isSameYear?this.overrides.isSameYear(r,a):uk(r,a)},this.max=r=>{var a;return(a=this.overrides)!=null&&a.max?this.overrides.max(r):sS(r)},this.min=r=>{var a;return(a=this.overrides)!=null&&a.min?this.overrides.min(r):aS(r)},this.setMonth=(r,a)=>{var o;return(o=this.overrides)!=null&&o.setMonth?this.overrides.setMonth(r,a):Sk(r,a)},this.setYear=(r,a)=>{var o;return(o=this.overrides)!=null&&o.setYear?this.overrides.setYear(r,a):_k(r,a)},this.startOfBroadcastWeek=(r,a)=>{var o;return(o=this.overrides)!=null&&o.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):pE(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):sE(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):L0(r)},this.options={locale:mE,...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 u=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,u)}}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 gE{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 Rk{constructor(t,n){this.date=t,this.weeks=n}}class Lk{constructor(t,n){this.days=n,this.weekNumber=t}}function Mk(e){return Ee.createElement("button",{...e})}function Pk(e){return Ee.createElement("span",{...e})}function Fk(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 jk(e){const{day:t,modifiers:n,...r}=e;return Ee.createElement("td",{...r})}function Bk(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 Hk(e){const{options:t,className:n,components:r,classNames:a,...o}=e,u=[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:u,...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 Uk(e){return Ee.createElement("div",{...e})}function zk(e){return Ee.createElement("div",{...e})}function Wk(e){const{calendarMonth:t,displayIndex:n,...r}=e;return Ee.createElement("div",{...r},e.children)}function Yk(e){const{calendarMonth:t,displayIndex:n,...r}=e;return Ee.createElement("div",{...r})}function qk(e){return Ee.createElement("table",{...e})}function $k(e){return Ee.createElement("div",{...e})}const yE=L.createContext(void 0);function qu(){const e=L.useContext(yE);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function Vk(e){const{components:t}=qu();return Ee.createElement(t.Dropdown,{...e})}function Qk(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:a,...o}=e,{components:u,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(u.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(u.Chevron,{disabled:r?void 0:!0,className:c[Re.Chevron],orientation:"left"})),Ee.createElement(u.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(u.Chevron,{disabled:a?void 0:!0,orientation:"right",className:c[Re.Chevron]})))}function Gk(e){const{components:t}=qu();return Ee.createElement(t.Button,{...e})}function Xk(e){return Ee.createElement("option",{...e})}function Kk(e){const{components:t}=qu();return Ee.createElement(t.Button,{...e})}function Jk(e){const{rootRef:t,...n}=e;return Ee.createElement("div",{...n,ref:t})}function Zk(e){return Ee.createElement("select",{...e})}function eC(e){const{week:t,...n}=e;return Ee.createElement("tr",{...n})}function tC(e){return Ee.createElement("th",{...e})}function nC(e){return Ee.createElement("thead",{"aria-hidden":!0},Ee.createElement("tr",{...e}))}function rC(e){const{week:t,...n}=e;return Ee.createElement("th",{...n})}function sC(e){return Ee.createElement("th",{...e})}function aC(e){return Ee.createElement("tbody",{...e})}function iC(e){const{components:t}=qu();return Ee.createElement(t.Dropdown,{...e})}const oC=Object.freeze(Object.defineProperty({__proto__:null,Button:Mk,CaptionLabel:Pk,Chevron:Fk,Day:jk,DayButton:Bk,Dropdown:Hk,DropdownNav:Uk,Footer:zk,Month:Wk,MonthCaption:Yk,MonthGrid:qk,Months:$k,MonthsDropdown:Vk,Nav:Qk,NextMonthButton:Gk,Option:Xk,PreviousMonthButton:Kk,Root:Jk,Select:Zk,Week:eC,WeekNumber:rC,WeekNumberHeader:sC,Weekday:tC,Weekdays:nC,Weeks:aC,YearsDropdown:iC},Symbol.toStringTag,{value:"Module"}));function Ss(e,t,n=!1,r=os){let{from:a,to:o}=e;const{differenceInCalendarDays:u,isSameDay:c}=r;return a&&o?(u(o,a)<0&&([a,o]=[o,a]),u(t,a)>=(n?1:0)&&u(o,t)>=(n?1:0)):!n&&o?c(o,t):!n&&a?c(a,t):!1}function B0(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Wc(e){return!!(e&&typeof e=="object"&&"from"in e)}function H0(e){return!!(e&&typeof e=="object"&&"after"in e)}function U0(e){return!!(e&&typeof e=="object"&&"before"in e)}function bE(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function EE(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:u}=n;return r.some(c=>{if(typeof c=="boolean")return c;if(n.isDate(c))return a(e,c);if(EE(c,n))return c.some(d=>a(e,d));if(Wc(c))return Ss(c,e,!1,n);if(bE(c))return Array.isArray(c.dayOfWeek)?c.dayOfWeek.includes(e.getDay()):c.dayOfWeek===e.getDay();if(B0(c)){const d=o(c.before,e),h=o(c.after,e),m=d>0,g=h<0;return u(c.before,c.after)?g&&m:m||g}return H0(c)?o(e,c.after)>0:U0(c)?o(c.before,e)>0:typeof c=="function"?c(e):!1})}function uC(e,t,n,r,a){const{disabled:o,hidden:u,modifiers:c,showOutsideDays:d,broadcastCalendar:h,today:m=a.today()}=t,{isSameDay:g,isSameMonth:E,startOfMonth:x,isBefore:k,endOfMonth:S,isAfter:w}=a,v=n&&x(n),C=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&&k(_,v)),j=!!(C&&w(_,C)),M=!!(o&&_s(_,o,a)),H=!!(u&&_s(_,u,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(Q=>{const J=c==null?void 0:c[Q];J&&_s(_,J,a)&&(A[Q]?A[Q].push(P):A[Q]=[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 lC(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 cC(e){return{...oC,...e}}function dC(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 fC(){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 xE(e,t,n){return(n??new dr(t)).formatMonthYear(e)}const hC=xE;function pC(e,t,n){return(n??new dr(t)).format(e,"d")}function mC(e,t=os){return t.format(e,"LLLL")}function gC(e,t,n){return(n??new dr(t)).format(e,"cccccc")}function yC(e,t=os){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function bC(){return""}function TE(e,t=os){return t.format(e,"yyyy")}const EC=TE,xC=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:xE,formatDay:pC,formatMonthCaption:hC,formatMonthDropdown:mC,formatWeekNumber:yC,formatWeekNumberHeader:bC,formatWeekdayName:gC,formatYearCaption:EC,formatYearDropdown:TE},Symbol.toStringTag,{value:"Module"}));function TC(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...xC,...e}}function z0(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 vC=z0;function W0(e,t,n){return(n??new dr(t)).formatMonthYear(e)}const wC=W0;function vE(e,t,n,r){let a=(r??new dr(n)).format(e,"PPPP");return t!=null&&t.today&&(a=`Today, ${a}`),a}function wE(e){return"Choose the Month"}function SE(){return""}const SC="Go to the Next Month";function _E(e,t){return SC}function kE(e){return"Go to the Previous Month"}function CE(e,t,n){return(n??new dr(t)).format(e,"cccc")}function NE(e,t){return`Week ${e}`}function OE(e){return"Week Number"}function DE(e){return"Choose the Year"}const _C=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:wC,labelDay:vC,labelDayButton:z0,labelGrid:W0,labelGridcell:vE,labelMonthDropdown:wE,labelNav:SE,labelNext:_E,labelPrevious:kE,labelWeekNumber:NE,labelWeekNumberHeader:OE,labelWeekday:CE,labelYearDropdown:DE},Symbol.toStringTag,{value:"Module"})),Rr=(e,t,n)=>t||(n?typeof n=="function"?n:(...r)=>n:e);function kC(e,t){var r;const n=((r=t.locale)==null?void 0:r.labels)??{};return{..._C,...e??{},labelDayButton:Rr(z0,e==null?void 0:e.labelDayButton,n.labelDayButton),labelMonthDropdown:Rr(wE,e==null?void 0:e.labelMonthDropdown,n.labelMonthDropdown),labelNext:Rr(_E,e==null?void 0:e.labelNext,n.labelNext),labelPrevious:Rr(kE,e==null?void 0:e.labelPrevious,n.labelPrevious),labelWeekNumber:Rr(NE,e==null?void 0:e.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:Rr(DE,e==null?void 0:e.labelYearDropdown,n.labelYearDropdown),labelGrid:Rr(W0,e==null?void 0:e.labelGrid,n.labelGrid),labelGridcell:Rr(vE,e==null?void 0:e.labelGridcell,n.labelGridcell),labelNav:Rr(SE,e==null?void 0:e.labelNav,n.labelNav),labelWeekNumberHeader:Rr(OE,e==null?void 0:e.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:Rr(CE,e==null?void 0:e.labelWeekday,n.labelWeekday)}}function CC(e,t,n,r,a){const{startOfMonth:o,startOfYear:u,endOfYear:c,eachMonthOfInterval:d,getMonth:h}=a;return d({start:u(e),end:c(e)}).map(E=>{const x=r.formatMonthDropdown(E,a),k=h(E),S=t&&E<o(t)||n&&E>o(n)||!1;return{value:k,label:x,disabled:S}})}function NC(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 OC(e,t,n,r){const a=r??e.today(),o=n?e.startOfBroadcastWeek(a,e):t?e.startOfISOWeek(a):e.startOfWeek(a),u=[];for(let c=0;c<7;c++){const d=e.addDays(o,c);u.push(d)}return u}function DC(e,t,n,r,a=!1){if(!e||!t)return;const{startOfYear:o,endOfYear:u,eachYearOfInterval:c,getYear:d}=r,h=o(e),m=u(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 AC(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)},u=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=u(d);return zc(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=u(d);return Uc(h)},differenceInCalendarDays:(d,h)=>{const m=u(d),g=u(h);return A0(m,g)},differenceInCalendarMonths:(d,h)=>{const m=u(d),g=u(h);return tE(m,g)}}}const $u=e=>e instanceof HTMLElement?e:null,nh=e=>[...e.querySelectorAll("[data-animated-month]")??[]],IC=e=>$u(e.querySelector("[data-animated-month]")),rh=e=>$u(e.querySelector("[data-animated-caption]")),sh=e=>$u(e.querySelector("[data-animated-weeks]")),RC=e=>$u(e.querySelector("[data-animated-nav]")),LC=e=>$u(e.querySelector("[data-animated-weekdays]"));function MC(e,t,{classNames:n,months:r,focused:a,dateLib:o}){const u=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],k=u.current,S=e.current.cloneNode(!0);if(S instanceof HTMLElement?(nh(S).forEach(O=>{if(!(O instanceof HTMLElement))return;const A=IC(O);A&&O.contains(A)&&O.removeChild(A);const P=rh(O);P&&P.classList.remove(E);const _=sh(O);_&&_.classList.remove(x)}),u.current=S):u.current=null,d.current||m||a)return;const w=k instanceof HTMLElement?nh(k):[],v=nh(e.current);if(v!=null&&v.every(C=>C instanceof HTMLElement)&&w&&w.every(C=>C instanceof HTMLElement)){d.current=!0,e.current.style.isolation="isolate";const C=RC(e.current);C&&(C.style.zIndex="1"),v.forEach((O,A)=>{const P=w[A];if(!P)return;O.style.position="relative",O.style.overflow="hidden";const _=rh(O);_&&_.classList.add(E);const N=sh(O);N&&N.classList.add(x);const I=()=>{d.current=!1,e.current&&(e.current.style.isolation=""),C&&(C.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=LC(P);F&&(F.style.opacity="0");const j=rh(P);j&&(j.classList.add(g?n[lr.caption_before_exit]:n[lr.caption_after_exit]),j.addEventListener("animationend",I));const M=sh(P);M&&M.classList.add(g?n[lr.weeks_before_exit]:n[lr.weeks_after_exit]),O.insertBefore(P,O.firstChild)})}})}function PC(e,t,n,r){const a=e[0],o=e[e.length-1],{ISOWeek:u,fixedWeeks:c,broadcastCalendar:d}=n??{},{addDays:h,differenceInCalendarDays:m,differenceInCalendarMonths:g,endOfBroadcastWeek:E,endOfISOWeek:x,endOfMonth:k,endOfWeek:S,isAfter:w,startOfBroadcastWeek:v,startOfISOWeek:C,startOfWeek:O}=r,A=d?v(a,r):u?C(a):O(a),P=d?E(o):u?x(k(o)):S(k(o)),_=t&&(d?E(t):u?x(t):S(t)),N=_&&w(P,_)?_:P,I=m(N,A),F=g(o,a)+1,j=[];for(let $=0;$<=I;$++){const Q=h(A,$);j.push(Q)}const H=(d?35:42)*F;if(c&&j.length<H){const $=H-j.length;for(let Q=0;Q<$;Q++){const J=h(j[j.length-1],1);j.push(J)}}return j}function FC(e){const t=[];return e.reduce((n,r)=>{const a=r.weeks.reduce((o,u)=>o.concat(u.days.slice()),t.slice());return n.concat(a.slice())},t.slice())}function jC(e,t,n,r){const{numberOfMonths:a=1}=n,o=[];for(let u=0;u<a;u++){const c=r.addMonths(e,u);if(t&&c>t)break;o.push(c)}return o}function D1(e,t,n,r){const{month:a,defaultMonth:o,today:u=r.today(),numberOfMonths:c=1}=e;let d=a||o||u;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 BC(e,t,n,r){const{addDays:a,endOfBroadcastWeek:o,endOfISOWeek:u,endOfMonth:c,endOfWeek:d,getISOWeek:h,getWeek:m,startOfBroadcastWeek:g,startOfISOWeek:E,startOfWeek:x}=r,k=e.reduce((S,w)=>{const v=n.broadcastCalendar?g(w,r):n.ISOWeek?E(w):x(w),C=n.broadcastCalendar?o(w):n.ISOWeek?u(c(w)):d(c(w)),O=t.filter(N=>N>=v&&N<=C),A=n.broadcastCalendar?35:42;if(n.fixedWeeks&&O.length<A){const N=t.filter(I=>{const F=A-O.length;return I>C&&I<=a(C,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 gE(I,w,r);return j?j.days.push(M):N.push(new Lk(F,[M])),N},[]),_=new Rk(w,P);return S.push(_),S},[]);return n.reverseMonths?k.reverse():k}function HC(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:a,startOfDay:o,startOfMonth:u,endOfMonth:c,addYears:d,endOfYear:h,newDate:m,today:g}=t,{fromYear:E,toYear:x,fromMonth:k,toMonth:S}=e;!n&&k&&(n=k),!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=u(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 UC(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:o=1}=n,{startOfMonth:u,addMonths:c,differenceInCalendarMonths:d}=r,h=a?o:1,m=u(e);if(!t)return c(m,h);if(!(d(t,e)<o))return c(m,h)}function zC(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:o}=n,{startOfMonth:u,addMonths:c,differenceInCalendarMonths:d}=r,h=a?o??1:1,m=u(e);if(!t)return c(m,-h);if(!(d(m,t)<=0))return c(m,-h)}function WC(e){const t=[];return e.reduce((n,r)=>n.concat(r.weeks.slice()),t.slice())}function Yc(e,t){const[n,r]=L.useState(e);return[t===void 0?n:t,r]}function YC(e,t){var A;const[n,r]=HC(e,t),{startOfMonth:a,endOfMonth:o}=t,u=D1(e,n,r,t),[c,d]=Yc(u,e.month?u:void 0);L.useEffect(()=>{const P=D1(e,n,r,t);d(P)},[e.timeZone]);const{months:h,weeks:m,days:g,previousMonth:E,nextMonth:x}=L.useMemo(()=>{const P=jC(c,r,{numberOfMonths:e.numberOfMonths},t),_=PC(P,e.endMonth?o(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),N=BC(P,_,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t),I=WC(N),F=FC(N),j=zC(c,n,e,t),M=UC(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:k,onMonthChange:S}=e,w=P=>m.some(_=>_.days.some(N=>N.isEqualTo(P))),v=P=>{if(k)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 A1(e){return!e[Bt.disabled]&&!e[Bt.hidden]&&!e[Bt.outside]}function qC(e,t,n,r){let a,o=-1;for(const u of e){const c=t(u);A1(c)&&(c[Bt.focused]&&o<Qr.FocusedModifier?(a=u,o=Qr.FocusedModifier):r!=null&&r.isEqualTo(u)&&o<Qr.LastFocused?(a=u,o=Qr.LastFocused):n(u.date)&&o<Qr.Selected?(a=u,o=Qr.Selected):c[Bt.today]&&o<Qr.Today&&(a=u,o=Qr.Today))}return a||(a=e.find(u=>A1(t(u)))),a}function $C(e,t,n,r,a,o,u){const{ISOWeek:c,broadcastCalendar:d}=o,{addDays:h,addMonths:m,addWeeks:g,addYears:E,endOfBroadcastWeek:x,endOfISOWeek:k,endOfWeek:S,max:w,min:v,startOfBroadcastWeek:C,startOfISOWeek:O,startOfWeek:A}=u;let _={day:h,week:g,month:m,year:E,startOfWeek:N=>d?C(N,u):c?O(N):A(N),endOfWeek:N=>d?x(N):c?k(N):S(N)}[e](n,t==="after"?1:-1);return t==="before"&&r?_=w([r,_]):t==="after"&&a&&(_=v([a,_])),_}function AE(e,t,n,r,a,o,u,c=0){if(c>365)return;const d=$C(e,t,n.date,r,a,o,u),h=!!(o.disabled&&_s(d,o.disabled,u)),m=!!(o.hidden&&_s(d,o.hidden,u)),g=d,E=new gE(d,g,u);return!h&&!m?E:AE(e,t,E,r,a,o,u,c+1)}function VC(e,t,n,r,a){const{autoFocus:o}=e,[u,c]=L.useState(),d=qC(t.days,n,r||(()=>!1),u),[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=AE(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 QC(e,t){const{selected:n,required:r,onSelect:a}=e,[o,u]=Yc(n,a?n:void 0),c=a?n:o,{isSameDay:d}=t,h=x=>(c==null?void 0:c.some(k=>d(k,x)))??!1,{min:m,max:g}=e;return{selected:c,select:(x,k,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||u(w),a==null||a(w,x,k,S),w},isSelected:h}}function GC(e,t,n=0,r=0,a=!1,o=os){const{from:u,to:c}=t||{},{isSameDay:d,isAfter:h,isBefore:m}=o;let g;if(!u&&!c)g={from:e,to:n>0?void 0:e};else if(u&&!c)d(u,e)?n===0?g={from:u,to:e}:a?g={from:u,to:void 0}:g=void 0:m(e,u)?g={from:e,to:u}:g={from:u,to:e};else if(u&&c)if(d(u,e)&&d(c,e))a?g={from:u,to:c}:g=void 0;else if(d(u,e))g={from:u,to:n>0?void 0:e};else if(d(c,e))g={from:e,to:n>0?void 0:e};else if(m(e,u))g={from:e,to:c};else if(h(e,u))g={from:u,to:e};else if(h(e,c))g={from:u,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 XC(e,t,n=os){const r=Array.isArray(t)?t:[t];let a=e.from;const o=n.differenceInCalendarDays(e.to,e.from),u=Math.min(o,6);for(let c=0;c<=u;c++){if(r.includes(a.getDay()))return!0;a=n.addDays(a,1)}return!1}function I1(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 KC(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):EE(c,n)?c.some(d=>Ss(e,d,!1,n)):Wc(c)?c.from&&c.to?I1(e,{from:c.from,to:c.to},n):!1:bE(c)?XC(e,c.dayOfWeek,n):B0(c)?n.isAfter(c.before,c.after)?I1(e,{from:n.addDays(c.after,1),to:n.addDays(c.before,-1)},n):_s(e.from,c,n)||_s(e.to,c,n):H0(c)||U0(c)?_s(e.from,c,n)||_s(e.to,c,n):!1))return!0;const u=r.filter(c=>typeof c=="function");if(u.length){let c=e.from;const d=n.differenceInCalendarDays(e.to,e.from);for(let h=0;h<=d;h++){if(u.some(m=>m(c)))return!0;c=n.addDays(c,1)}}return!1}function JC(e,t){const{disabled:n,excludeDisabled:r,selected:a,required:o,onSelect:u}=e,[c,d]=Yc(a,u?a:void 0),h=u?a:c;return{selected:h,select:(E,x,k)=>{const{min:S,max:w}=e,v=E?GC(E,h,S,w,o,t):void 0;return r&&n&&(v!=null&&v.from)&&v.to&&KC({from:v.from,to:v.to},n,t)&&(v.from=E,v.to=void 0),u||d(v),u==null||u(v,E,x,k),v},isSelected:E=>h&&Ss(h,E,!1,t)}}function ZC(e,t){const{selected:n,required:r,onSelect:a}=e,[o,u]=Yc(n,a?n:void 0),c=a?n:o,{isSameDay:d}=t;return{selected:c,select:(g,E,x)=>{let k=g;return!r&&c&&c&&d(g,c)&&(k=void 0),a||u(k),a==null||a(k,g,E,x),k},isSelected:g=>c?d(c,g):!1}}function eN(e,t){const n=ZC(e,t),r=QC(e,t),a=JC(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 R1(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):Wc(e)?{...e,from:e.from?Er(e.from,t):e.from,to:e.to?Er(e.to,t):e.to}:B0(e)?{before:Ii(e.before,t),after:Ii(e.after,t)}:H0(e)?{after:Ii(e.after,t)}:U0(e)?{before:Ii(e.before,t)}:e}function ah(e,t,n){return e&&(Array.isArray(e)?e.map(r=>R1(r,t)):R1(e,t))}function L1(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(Me=>Er(Me,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=ah(t.disabled,n)),t.hidden!==void 0&&(t.hidden=ah(t.hidden,n)),t.modifiers)){const Me={};Object.keys(t.modifiers).forEach(Qe=>{var be;Me[Qe]=ah((be=t.modifiers)==null?void 0:be[Qe],n)}),t.modifiers=Me}const{components:r,formatters:a,labels:o,dateLib:u,locale:c,classNames:d}=L.useMemo(()=>{const Me={...mE,...t.locale},Qe=t.broadcastCalendar?1:t.weekStartsOn,be=t.noonSafe&&t.timeZone?AC(t.timeZone,{weekStartsOn:Qe,locale:Me}):void 0,_e=t.dateLib&&be?{...be,...t.dateLib}:t.dateLib??be,Je=new dr({locale:Me,weekStartsOn:Qe,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},_e);return{dateLib:Je,components:cC(t.components),formatters:TC(t.formatters),labels:kC(t.labels,Je.options),locale:Me,classNames:{...fC(),...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:u.today()});const{captionLayout:h,mode:m,navLayout:g,numberOfMonths:E=1,onDayBlur:x,onDayClick:k,onDayFocus:S,onDayKeyDown:w,onDayMouseEnter:v,onDayMouseLeave:C,onNextClick:O,onPrevClick:A,showWeekNumber:P,styles:_}=t,{formatCaption:N,formatDay:I,formatMonthDropdown:F,formatWeekNumber:j,formatWeekNumberHeader:M,formatWeekdayName:H,formatYearDropdown:$}=a,Q=YC(t,u),{days:J,months:G,navStart:re,navEnd:Z,previousMonth:K,nextMonth:R,goToMonth:ue}=Q,oe=uC(J,t,re,Z,u),{isSelected:U,select:Oe,selected:Le}=eN(t,u)??{},{blur:Te,focused:Ze,isFocusTarget:$e,moveFocus:Ge,setFocused:tt}=VC(t,Q,oe,U??(()=>!1),u),{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(()=>OC(u,t.ISOWeek,t.broadcastCalendar,t.today),[u,t.ISOWeek,t.broadcastCalendar,t.today]),on=m!==void 0||k!==void 0,nr=L.useCallback(()=>{K&&(ue(K),A==null||A(K))},[K,ue,A]),un=L.useCallback(()=>{R&&(ue(R),O==null||O(R))},[ue,R,O]),ie=L.useCallback((Me,Qe)=>be=>{be.preventDefault(),be.stopPropagation(),tt(Me),!Qe.disabled&&(Oe==null||Oe(Me.date,Qe,be),k==null||k(Me.date,Qe,be))},[Oe,k,tt]),pe=L.useCallback((Me,Qe)=>be=>{tt(Me),S==null||S(Me.date,Qe,be)},[S,tt]),De=L.useCallback((Me,Qe)=>be=>{Te(),x==null||x(Me.date,Qe,be)},[Te,x]),He=L.useCallback((Me,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,ke]=_e[be.key];Ge(Je,ke)}w==null||w(Me.date,Qe,be)},[Ge,w,t.dir]),Ve=L.useCallback((Me,Qe)=>be=>{v==null||v(Me.date,Qe,be)},[v]),gt=L.useCallback((Me,Qe)=>be=>{C==null||C(Me.date,Qe,be)},[C]),zt=L.useCallback(Me=>Qe=>{const be=Number(Qe.target.value),_e=u.setMonth(u.startOfMonth(Me),be);ue(_e)},[u,ue]),rn=L.useCallback(Me=>Qe=>{const be=Number(Qe.target.value),_e=u.setYear(u.startOfMonth(Me),be);ue(_e)},[u,ue]),{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=dC(t),yt=L.useRef(null);MC(yt,!!t.animate,{classNames:d,months:G,focused:Ze,dateLib:u});const ln={dayPickerProps:t,selected:Le,select:Oe,isSelected:U,months:G,nextMonth:R,previousMonth:K,goToMonth:ue,getModifiers:oe,components:r,classNames:d,styles:_,labels:o,formatters:a};return Ee.createElement(yE.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}),G.map((Me,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:Me},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:Me,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(Me.date),options:CC(Me.date,re,Z,a,u),style:_==null?void 0:_[Re.Dropdown],value:u.getMonth(Me.date)}):Ee.createElement("span",{key:"month"},F(Me.date,u)),_e=h==="dropdown"||h==="dropdown-years"?Ee.createElement(r.YearsDropdown,{key:"year",className:d[Re.YearsDropdown],"aria-label":Et(u.options),classNames:d,components:r,disabled:!!t.disableNavigation,onChange:rn(Me.date),options:DC(re,Z,a,u,!!t.reverseYears),style:_==null?void 0:_[Re.Dropdown],value:u.getYear(Me.date)}):Ee.createElement("span",{key:"year"},$(Me.date,u));return u.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(Me.date,u.options,u))):Ee.createElement(r.CaptionLabel,{className:d[Re.CaptionLabel],role:"status","aria-live":"polite"},N(Me.date,u.options,u))),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(Me.date,u.options,u)||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(u.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,u.options,u),className:d[Re.Weekday],key:String(be),style:_==null?void 0:_[Re.Weekday],scope:"col"},H(be,u.options,u)))),Ee.createElement(r.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:d[Re.Weeks],style:_==null?void 0:_[Re.Weeks]},Me.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,u)),be.days.map(_e=>{const{date:Je}=_e,ke=oe(_e);if(ke[Bt.focused]=!ke.hidden&&!!(Ze!=null&&Ze.isEqualTo(_e)),ke[Fr.selected]=(U==null?void 0:U(Je))||ke.selected,Wc(Le)){const{from:Rt,to:qt}=Le;ke[Fr.range_start]=!!(Rt&&qt&&u.isSameDay(Je,Rt)),ke[Fr.range_end]=!!(Rt&&qt&&u.isSameDay(Je,qt)),ke[Fr.range_middle]=Ss(Le,Je,!0,u)}const It=NC(ke,_,t.modifiersStyles),Wt=lC(ke,d,t.modifiersClassNames),Yt=!on&&!ke.hidden?pn(Je,ke,u.options,u):void 0;return Ee.createElement(r.Day,{key:`${_e.isoDate}_${_e.displayMonthId}`,day:_e,modifiers:ke,className:Wt.join(" "),style:It,role:"gridcell","aria-selected":ke.selected||void 0,"aria-label":Yt,"data-day":_e.isoDate,"data-month":_e.outside?_e.dateMonthId:void 0,"data-selected":ke.selected||void 0,"data-disabled":ke.disabled||void 0,"data-hidden":ke.hidden||void 0,"data-outside":_e.outside||void 0,"data-focused":ke.focused||void 0,"data-today":ke.today||void 0},!ke.hidden&&on?Ee.createElement(r.DayButton,{className:d[Re.DayButton],style:_==null?void 0:_[Re.DayButton],type:"button",day:_e,modifiers:ke,disabled:!ke.focused&&ke.disabled||void 0,"aria-disabled":ke.focused&&ke.disabled||void 0,tabIndex:$e(_e)?0:-1,"aria-label":We(Je,ke,u.options,u),onClick:ie(_e,ke),onBlur:De(_e,ke),onFocus:pe(_e,ke),onKeyDown:He(_e,ke),onMouseEnter:Ve(_e,ke),onMouseLeave:gt(_e,ke)},I(Je,u.options,u)):!ke.hidden&&I(_e.date,u.options,u))})))))))),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,u]=L.useState(!1),c=L.useRef(null),d=L.useRef(null),h=n!==void 0?n:o,m=L.useCallback(E=>{r?r(E):u(E)},[r]),g=L.useCallback(()=>m(!1),[m]);return L.useEffect(()=>{if(!h)return;function E(x){const k=x.target;c.current&&!c.current.contains(k)&&d.current&&!d.current.contains(k)&&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 IE=[{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"}],tN=`
|
|
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 Jh(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="custom"}function RE(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="relative"}function LE(e){const n=to(new Date);if(e.direction==="current")switch(e.unit){case"day":return{start:n,end:uS(n)};case"week":return{start:ss(n,{weekStartsOn:1}),end:M0(n,{weekStartsOn:1})};case"month":return{start:sE(n),end:nE(n)};case"quarter":return{start:cS(n),end:hS(n)};case"year":return{start:L0(n),end:aE(n)}}const r=e.value??1,a=e.direction==="previous",u=(a?{day:N1,week:Nk,month:kk,quarter:Ck,year:Ok}:{day:Ja,week:I0,month:Yu,quarter:Zb,year:R0})[e.unit];if(a){const c=e.includeToday?n:N1(n,1),d=u((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=u(c,r);return{start:c<d?c:d,end:c<d?d:c}}}function nN(e){if(Jh(e))return`${e.start} to ${e.end}`;if(RE(e)){const t=LE(e);return`${hn(t.start,"MMM d")} – ${hn(t.end,"MMM d, yyyy")}`}if(typeof e=="string"){const t=IE.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 rN=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 ME({name:e,label:t="Date",chartName:n,defaultValue:r="last_30_days"}){var x;const a=lo(),o=qe(k=>k.globalFilters),u=qe(k=>k.chartFilters),c=qe(k=>k.setGlobalFilter),d=qe(k=>k.setChartFilter),h=n?((x=u[n])==null?void 0:x[e])??o[e]??r:o[e]??r;L.useEffect(()=>{var S;(n?((S=u[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,u,c,d]);const m=k=>{const S=k;n?d(n,e,S):c(e,S),a.close()},g=typeof h=="string"?h!==r:!0,E=nN(h);return p.jsx(uo,{isOpen:a.isOpen,onOpenChange:a.onOpenChange,width:520,trigger:p.jsx(co,{label:t,value:E,active:g,icon:rN}),children:p.jsx(sN,{currentValue:h,onApply:m,onClose:a.close})})}function sN({currentValue:e,onApply:t,onClose:n}){const[r,a]=L.useState("presets");return p.jsxs("div",{children:[r==="presets"&&p.jsx(aN,{currentValue:e,onSelectPreset:o=>{t(o),n()},onNavigate:a}),r==="fixed"&&p.jsx(iN,{currentValue:e,onApply:t,onBack:()=>a("presets")}),r==="relative"&&p.jsx(oN,{currentValue:e,onApply:t,onBack:()=>a("presets")})]})}function aN({currentValue:e,onSelectPreset:t,onNavigate:n}){return p.jsxs("div",{className:"py-1",children:[IE.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 iN({currentValue:e,onApply:t,onBack:n}){const[r,a]=L.useState("between"),[o,u]=L.useState(()=>{if(Jh(e)){const E=eh(e.start,"yyyy-MM-dd",new Date),x=eh(e.end,"yyyy-MM-dd",new Date);return{from:E,to:x}}}),[c,d]=L.useState(()=>{if(Jh(e)&&r!=="between")return eh(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:tN}),r==="between"?p.jsx(L1,{mode:"range",selected:o,onSelect:u,numberOfMonths:2,defaultMonth:(o==null?void 0:o.from)||new Date}):p.jsx(L1,{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 oN({currentValue:e,onApply:t,onBack:n}){const r=RE(e)?e:{direction:"previous",value:30,unit:"day",includeToday:!1},[a,o]=L.useState(r.direction),[u,c]=L.useState(r.value??30),[d,h]=L.useState(r.unit),[m,g]=L.useState(r.includeToday??!1),E=L.useMemo(()=>{const C=LE({direction:a,value:a==="current"?void 0:u,unit:d,includeToday:m}),O=C.start.getFullYear(),A=C.end.getFullYear();return O===A?`${hn(C.start,"MMM d")} – ${hn(C.end,"MMM d, yyyy")}`:`${hn(C.start,"MMM d, yyyy")} – ${hn(C.end,"MMM d, yyyy")}`},[a,u,d,m]),x=()=>{t({type:"relative",direction:a,value:a==="current"?void 0:u,unit:d,includeToday:m})},k=[{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:k.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:u,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 u=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}),k=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),[C,O]=L.useState("");L.useEffect(()=>{u.isOpen&&(v(S),O(""))},[u.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),u.close()},P=C?k.filter(j=>j.label.toLowerCase().includes(C.toLowerCase())):k,_=S?((F=k.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:u.isOpen,onOpenChange:u.onOpenChange,trigger:p.jsx(co,{label:t,value:_||t,active:N}),children:[p.jsx(si,{title:t}),p.jsxs("div",{className:"p-3",children:[k.length>6&&p.jsx("div",{className:"mb-2",children:p.jsx("input",{type:"text",placeholder:"Search...",value:C,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 PE({name:e,label:t=e,options:n,chartName:r,defaultValue:a,source:o}){const u=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}),k=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),[C,O]=L.useState("");L.useEffect(()=>{u.isOpen&&(v(S),O(""))},[u.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===k.length?v([]):v(k.map(M=>M.value))},_=()=>{r?m(r,e,w):h(e,w),u.close()},N=C?k.filter(M=>M.label.toLowerCase().includes(C.toLowerCase())):k,I=S.length===0?void 0:S.length<=2?S.map(M=>{var H;return((H=k.find($=>$.value===M))==null?void 0:H.label)||M}).join(", "):`${S.length} selected`,F=S.length>0,j=w.length===k.length&&k.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:u.isOpen,onOpenChange:u.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:[k.length>6&&p.jsx("div",{className:"mb-2",children:p.jsx("input",{type:"text",placeholder:"Search...",value:C,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:[!C&&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 Zh=[{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"}],FE=["is_empty","is_not_empty"];function jE(e){return typeof e=="object"&&e!==null&&"operator"in e&&"value"in e}function uN(e){var t,n;if(jE(e))return FE.includes(e.operator)?(t=Zh.find(a=>a.value===e.operator))==null?void 0:t.label:`${((n=Zh.find(a=>a.value===e.operator))==null?void 0:n.label)||e.operator} "${e.value}"`;if(typeof e=="string"&&e)return e}function BE({name:e,label:t=e,chartName:n,defaultValue:r}){var O;const a=lo(),o=qe(A=>A.globalFilters),u=qe(A=>A.chartFilters),c=qe(A=>A.setGlobalFilter),d=qe(A=>A.setChartFilter),h=n?((O=u[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&&(jE(h)?(g(h.operator),x(h.value)):typeof h=="string"?(g("is"),x(h)):(g("contains"),x("")))},[a.isOpen]);const k=()=>{const A={operator:m,value:E};n?d(n,e,A):c(e,A),a.close()},S=!FE.includes(m),w=!S||E.trim().length>0,v=uN(h),C=!!v;return p.jsxs(uo,{isOpen:a.isOpen,onOpenChange:a.onOpenChange,trigger:p.jsx(co,{label:t,value:v||t,active:C}),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:Zh.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&&k()}})]}),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:k,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 e0=[{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"}],HE=["is_empty","is_not_empty"];function UE(e){return typeof e=="object"&&e!==null&&"operator"in e&&"value"in e&&typeof e.value=="number"}function lN(e){var t,n;if(UE(e)){if(HE.includes(e.operator))return(t=e0.find(a=>a.value===e.operator))==null?void 0:t.label;const r=((n=e0.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 zE({name:e,label:t=e,chartName:n,defaultValue:r}){var _;const a=lo(),o=qe(N=>N.globalFilters),u=qe(N=>N.chartFilters),c=qe(N=>N.setGlobalFilter),d=qe(N=>N.setChartFilter),h=n?((_=u[n])==null?void 0:_[e])??o[e]??r??null:o[e]??r??null,[m,g]=L.useState("equal"),[E,x]=L.useState(""),[k,S]=L.useState("");L.useEffect(()=>{a.isOpen&&(UE(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(k)||0}:{}};n?d(n,e,N):c(e,N),a.close()},v=!HE.includes(m),C=m==="between",O=!v||E!==""&&(!C||k!==""),A=lN(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:e0.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:C?"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()}}),C&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-sm text-gray-400 self-center",children:"and"}),p.jsx("input",{type:"number",value:k,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 WE({name:e,label:t=e,chartName:n}){var k;const r=lo(),a=qe(S=>S.globalFilters),o=qe(S=>S.chartFilters),u=qe(S=>S.setGlobalFilter),c=qe(S=>S.setChartFilter),d=n?((k=o[n])==null?void 0:k[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):u(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 YE({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(ME,{name:n.name,label:r,chartName:t,defaultValue:a},n.name);case"select":{const o=(n.options||[]).map(u=>typeof u=="string"?{value:u,label:u}:u);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(u=>typeof u=="string"?{value:u,label:u}:u);return p.jsx(PE,{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(BE,{name:n.name,label:r,chartName:t,defaultValue:a},n.name);case"number":return p.jsx(zE,{name:n.name,label:r,chartName:t,defaultValue:typeof n.default=="number"?n.default:void 0},n.name);case"boolean":return p.jsx(WE,{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 cN({resourceType:e,resourceName:t}){const n=eo(S=>S.auth),[r,a]=L.useState(!1),[o,u]=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)},k=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}`;u(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:k,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 dN({rowCount:e,durationMs:t,cached:n,view:r,onToggleView:a,onExportCSV:o,onExportPNG:u,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||u)&&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"}),u&&p.jsx("button",{onClick:()=>{u(),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 fN=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"]),hN=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 pN(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),u=o.toUpperCase(),c=e.slice(a);/^\s*\(/.test(c)&&hN.has(u)?t.push(`<span class="sql-function">${Lr(o)}</span>`):fN.has(u)?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 mN({isOpen:e,onClose:t,compiledSql:n,modelName:r,connection:a,durationMs:o,rowCount:u,cached:c}){const[d,h]=L.useState(!1),m=L.useMemo(()=>n?pN(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})]}),u!=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:u.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 gN(e,t,n="png"){const{default:r}=await Cs(async()=>{const{default:u}=await import("./html2canvas.esm-QH1iLAAe.js");return{default:u}},[]),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 yN(e,t,n){const[{default:r},{jsPDF:a}]=await Promise.all([Cs(()=>import("./html2canvas.esm-QH1iLAAe.js"),[]),Cs(()=>import("./jspdf.es.min-C6Vul2EZ.js").then(A=>A.j),[])]),o=await r(e,{backgroundColor:"#f9fafb",scale:2,useCORS:!0,logging:!1}),u=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 k=10;n&&(g.setFontSize(16),g.text(n,E/2,k,{align:"center"}),k=20);const S=E-20,w=x-k-10;let v=S,C=d/c*v;C>w&&(C=w,v=c/d*C);const O=(E-v)/2;g.addImage(u,"PNG",O,k,v,C),g.save(`${t}.pdf`)}async function bN(e,t,n){const{jsPDF:r}=await Cs(async()=>{const{jsPDF:w}=await import("./jspdf.es.min-C6Vul2EZ.js").then(v=>v.j);return{jsPDF:w}},[]),a=new Image;a.src=e,await new Promise(w=>{a.onload=w});const u=a.width/a.height>1.2,c=new r({orientation:u?"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,k=a.height/a.width*x;k>E&&(k=E,x=a.width/a.height*k);const S=(d-x)/2;c.addImage(e,"PNG",S,m,x,k),c.save(`${t}.pdf`)}function qc(e,t,n){if(e.length===0)return;const r=t.map(u=>u.name),a=e.map(u=>t.map(c=>{const d=u[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(u=>u.join(","))].join(`
|
|
68
|
-
`);qE(o,`${n}.csv`,"text/csv;charset=utf-8;")}function EN(e,t){const n=JSON.stringify(e,null,2);qE(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 qE(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 xN({data:e,columns:t,drillDownColumns:n,filterDisplay:r,chartName:a}){const[o,u]=L.useState(null),[c,d]=L.useState(0),h=L.useMemo(()=>n&&n.length>0?n.map(C=>({field:C.field,label:C.label??C.field,format:C.format})):t.map(C=>({field:C.name,label:C.name,format:void 0})),[n,t]),m=L.useMemo(()=>{if(!o)return e;const{field:C,direction:O}=o;return[...e].sort((A,P)=>{const _=A[C],N=P[C];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,k=Math.min((c+1)*ru,m.length),S=C=>{u(O=>!O||O.field!==C?{field:C,direction:"asc"}:O.direction==="asc"?{field:C,direction:"desc"}:null),d(0)},w=(C,O)=>C==null?"":O&&typeof C=="number"?O.includes("$")?`$${C.toLocaleString()}`:O.includes("%")?`${C.toFixed(1)}%`:C.toLocaleString():String(C),v=C=>!o||o.field!==C?"":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:()=>qc(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:()=>EN(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(C=>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(C.field),children:[C.label,v(C.field)]},C.field))})}),p.jsx("tbody",{children:E.map((C,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(C[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,"-",k," of ",m.length]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("button",{onClick:()=>d(C=>Math.max(0,C-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(C=>Math.min(g-1,C+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"})]})]})]})}class Y0 extends L.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}componentDidUpdate(t){this.state.error&&t.resetKey!==this.props.resetKey&&this.setState({error:null})}render(){return this.state.error?this.props.fallback(this.state.error,()=>this.setState({error:null})):this.props.children}}const Br=L.forwardRef(function({option:t,height:n=400,loading:r=!1,onEvents:a},o){const u=L.useRef(null);return L.useImperativeHandle(o,()=>({getDataURL:c=>{var h;const d=(h=u.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=u.current)==null?void 0:c.getEchartsInstance()}})),L.useEffect(()=>{const c=()=>{var d,h;(h=(d=u.current)==null?void 0:d.getEchartsInstance())==null||h.resize()};return window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[]),p.jsx(Hv,{ref:u,option:t,style:{height:n,width:"100%"},showLoading:r,onEvents:a,opts:{renderer:"canvas"}})}),TN=["#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)??TN;return r[e%r.length]}function vN(e,t,n,r){return n!=null&&n[e]?n[e]:no(t,void 0,r)}function wN(e){return"field"in e}function SN(e){return"columns"in e}function ih(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 $c(e,t,n){var a,o;const r=t.stacking?"total":void 0;if(!t.series){const u=((a=t.y)==null?void 0:a.field)??"",c=e.map(h=>{const m=h[u];return typeof m=="number"?m:parseFloat(String(m))||0}),d=[{name:u,data:c,color:no(0,void 0,n),stack:r}];return t.stacking==="percent"?ih(d):d}if(wN(t.series)){const u=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[u]??"");m.has(x)||(h.push(x),m.set(x,[]));const k=E[d];m.get(x).push(typeof k=="number"?k:parseFloat(String(k))||0)});const g=h.map((E,x)=>({name:E,data:m.get(E),color:vN(E,x,c,n),stack:r}));return t.stacking==="percent"?ih(g):g}if(SN(t.series)){const u=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"?ih(u):u}return[]}function _N(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 $E(e){const t=Math.floor(e.getMonth()/3)+1,n=e.getFullYear().toString().slice(-2);return`Q${t} '${n}`}function kN(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 CN(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 Vc(e,t){const n=new Set,r=e.filter(u=>{const c=u[t.field];return n.has(c)?!1:(n.add(c),!0)});if(t.type!=="temporal")return r.map(u=>String(u[t.field]??""));const a=[];for(const u of r){const c=u[t.field];if(typeof c=="string")try{a.push(Oc(c))}catch{}}const o=a.length>0?CN(a):"MMM dd, yyyy";return r.map(u=>{const c=u[t.field];if(typeof c=="string")try{const d=Oc(c);return t.format==="quarter"?$E(d):hn(d,o)}catch{return String(c??"")}return String(c??"")})}function Qc(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=kN(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 $E(o);const u=t.format?_N(t.format):n??"MMM yyyy";return hn(o,u)}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 NN(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 Gc(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=NN(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 VE=L.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:a,theme:o,height:u=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?Qc(t,n):Vu(t,n),x=n.type==="temporal"?Vc(t,n):E,k=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 G,re,Z,K,R,ue,oe;const H=j;if(H.componentType!=="series")return;const $=H.name;if($==null||$==="")return;(re=(G=H.event)==null?void 0:G.event)==null||re.preventDefault(),(Z=M==null?void 0:M.dispatchAction)==null||Z.call(M,{type:"hideTip"});const Q=((R=(K=H.event)==null?void 0:K.event)==null?void 0:R.clientX)??0,J=((oe=(ue=H.event)==null?void 0:ue.event)==null?void 0:oe.clientY)??0;h(n.field,String($),{x:Q,y:J})}),Object.keys(F).length>0?F:void 0},[d,h,n.field]);let S,w,v;if(a){const F=$c(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=Gc(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 C={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:C,height:u,loading:c,onEvents:k})}),QE=L.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:a,theme:o,height:u=400,loading:c=!1,horizontal:d=!1,onCrossFilter:h,activeCrossFilter:m,onDrillDown:g},E){var F,j,M,H,$,Q;const k=(a==null?void 0:a.series)&&"field"in a.series?Qc(t,n):Vu(t,n),S=n.type==="temporal"?Vc(t,n):k,w=(m==null?void 0:m.field)===n.field,v=d||(a==null?void 0:a.orientation)==="horizontal",C=L.useMemo(()=>{const J={};return h&&(J.click=G=>{const re=G;if(re.componentType!=="series")return;const Z=re.name;Z==null||Z===""||h(n.field,String(Z))}),g&&(J.contextmenu=(G,re)=>{var oe,U,Oe,Le,Te,Ze,$e;const Z=G;if(Z.componentType!=="series")return;const K=Z.name;if(K==null||K==="")return;(U=(oe=Z.event)==null?void 0:oe.event)==null||U.preventDefault(),(Oe=re==null?void 0:re.dispatchAction)==null||Oe.call(re,{type:"hideTip"});const R=((Te=(Le=Z.event)==null?void 0:Le.event)==null?void 0:Te.clientX)??0,ue=(($e=(Ze=Z.event)==null?void 0:Ze.event)==null?void 0:$e.clientY)??0;g(n.field,String(K),{x:R,y:ue})}),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=$c(t,{type:a.type,y:r?{field:r.field,type:r.type}:void 0,series:a.series,stacking:a.stacking},o),G=J.length>1,re=!!a.stacking;_=G;const Z=Ns(o);P=J.map(K=>{const R=Gc(K.color,K.gradient??a.gradient);return{type:"bar",name:K.name,data:w?K.data.map((ue,oe)=>({value:ue,itemStyle:{opacity:k[oe]===(m==null?void 0:m.value)?1:.3}})):K.data,barWidth:G&&!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)??"",G=t.map(Z=>{const K=Z[J];return typeof K=="number"?K:parseFloat(String(K))||0}),re=Ns(o);P=[{type:"bar",data:w?G.map((Z,K)=>({value:Z,itemStyle:{opacity:k[K]===(m==null?void 0:m.value)?1:.3}})):G,barWidth:"60%",itemStyle:{color:"#3B82F6",borderRadius:re.barBorderRadius},emphasis:{itemStyle:{color:"#2563EB"}}}]}const I={tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:J=>{const G=J;if(!Array.isArray(G)||G.length===0)return"";const re=S[G[0].dataIndex]??G[0].name;if(G.length===1){const K=G[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=G.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:k,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:k,axisLabel:{color:"#6B7280",fontSize:12},axisLine:{show:!1},axisTick:{show:!1}}:{type:((Q=a==null?void 0:a.y)==null?void 0:Q.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:u,loading:c,onEvents:C})}),GE=L.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:a,theme:o,height:u=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?Qc(t,n):Vu(t,n),x=n.type==="temporal"?Vc(t,n):E,k=(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,ue,oe,U;const $=M;if($.componentType!=="series")return;const Q=$.name;if(Q==null||Q==="")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=((ue=(R=$.event)==null?void 0:R.event)==null?void 0:ue.clientX)??0,G=((U=(oe=$.event)==null?void 0:oe.event)==null?void 0:U.clientY)??0;h(n.field,String(Q),{x:J,y:G})}),Object.keys(j).length>0?j:void 0},[d,h,n.field]);let w,v,C;if(a){const j=$c(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 $=Gc(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&&(C=[{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 Q of M){const J=k?`${Q.value.toFixed(1)}%`:ma(Q.value,r==null?void 0:r.format);$+=`<div>${Q.marker} ${Q.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},...k?{max:100}:{},axisLabel:{color:"#6B7280",fontSize:12,formatter:j=>k?`${j}%`:ma(j,r==null?void 0:r.format)},axisLine:{show:!1},splitLine:{lineStyle:{color:"#E5E7EB",type:"dashed"}}},series:w,...C?{dataZoom:C}:{},animation:!0,animationDuration:300};return p.jsx(Br,{ref:m,option:O,height:u,loading:c,onEvents:S})}),XE=L.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:a,theme:o,height:u=400,loading:c=!1,onCrossFilter:d,activeCrossFilter:h,onDrillDown:m},g){var v,C,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,$,Q,J,G,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(),(Q=N==null?void 0:N.dispatchAction)==null||Q.call(N,{type:"hideTip"});const j=((G=(J=I.event)==null?void 0:J.event)==null?void 0:G.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]),k=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,...((C=a==null?void 0:a.legend)==null?void 0:C.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:k.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:u,loading:c,onEvents:x})}),KE=L.forwardRef(function({data:t,xAxis:n,yAxis:r,centerValue:a,chartConfig:o,theme:u,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,k=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 G,re,Z,K,R,ue,oe;const H=j;if(H.componentType!=="series")return;const $=H.name;if($==null||$==="")return;(re=(G=H.event)==null?void 0:G.event)==null||re.preventDefault(),(Z=M==null?void 0:M.dispatchAction)==null||Z.call(M,{type:"hideTip"});const Q=((R=(K=H.event)==null?void 0:K.event)==null?void 0:R.clientX)??0,J=((oe=(ue=H.event)==null?void 0:ue.event)==null?void 0:oe.clientY)??0;g(n.field,String($),{x:Q,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,u)}}});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()},C=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(u).pieBorderRadius,borderColor:"#fff",borderWidth:2},label:{show:w!==null,position:"center",formatter:C,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:k})}),ON=5,DN=50;function oh(e){if(e==null)return null;const t=typeof e=="number"?e:parseFloat(String(e));return isNaN(t)?null:t}function AN(e,t,n,r,a){return n===t?(r+a)/2:r+(e-t)/(n-t)*(a-r)}function IN(e,t,n,r){const{size:a,group:o}=r,u=(a==null?void 0:a.min)??ON,c=(a==null?void 0:a.max)??DN,d=[];for(const x of e){const k=oh(x[t]),S=oh(x[n]);if(k===null||S===null)continue;let w=null;if(a&&(w=oh(x[a.field]),w===null))continue;const v=o?String(x[o.field]??"Other"):"data";d.push({x:k,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 k=g.get(x.groupVal);k?k.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,k]of g){const S=[],w=[];for(const v of k)a&&v.sizeVal!==null?(S.push([v.x,v.y,v.sizeVal]),w.push(AN(v.sizeVal,h,m,u,c))):S.push([v.x,v.y]);E.push({name:x,data:S,symbolSizes:a?w:void 0})}return{series:E}}function RN(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 u=t*o-n*n;if(u===0)return null;const c=(t*a-n*r)/u,d=(r-c*n)/t,h=r/t;let m=0,g=0;for(const[w,v]of e){const C=c*w+d;m+=(v-C)**2,g+=(v-h)**2}const E=g===0?1:1-m/g,x=e.map(([w])=>w),k=Math.min(...x),S=Math.max(...x);return{slope:c,intercept:d,rSquared:E,line:[[k,c*k+d],[S,c*S+d]]}}const JE=L.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:a,theme:o,height:u=400,loading:c=!1},d){const h=L.useMemo(()=>{var v,C,O;const m={size:a==null?void 0:a.size,group:a==null?void 0:a.group},{series:g}=IN(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=[],k=[];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=RN(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;k.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)??((C=a==null?void 0:a.size)==null?void 0:C.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:k.length>0?k:void 0,animation:!0,animationDuration:300}},[t,n,r,a,o]);return p.jsx(Br,{ref:d,option:h,height:u,loading:c})});function M1(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 t0({data:e,columns:t,chartConfig:n,height:r=400,loading:a=!1}){var N,I,F;const[o,u]=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]),k=L.useCallback(j=>M=>{g.current[j]=M},[]);L.useLayoutEffect(()=>{if(x===0){m([]);return}const j=()=>{var Q;const H=[];let $=0;for(let J=0;J<x;J++)H.push($),$+=((Q=g.current[J])==null?void 0:Q.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"?(u(null),d(null)):d("asc"):(u(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 Q=0;return typeof H=="number"&&typeof $=="number"?Q=H-$:Q=String(H).localeCompare(String($)),c==="asc"?Q:-Q}),[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(Q=>Q[H.field]).filter(Q=>typeof Q=="number");if(H.summary==="count"){M[H.field]=e.filter(Q=>Q[H.field]!=null).length;continue}if($.length===0){M[H.field]=null;continue}switch(H.summary){case"sum":M[H.field]=$.reduce((Q,J)=>Q+J,0);break;case"avg":M[H.field]=$.reduce((Q,J)=>Q+J,0)/$.length;break;case"min":M[H.field]=Math.min(...$);break;case"max":M[H.field]=Math.max(...$);break}}return M},[e,E]),C=((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?k(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:M1(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:$?C:H!=null?M1(H,j.format):""},j.field)})})})]}),w.length===0&&p.jsx("div",{className:"text-center py-8 text-gray-400",children:"No data"})]})}function LN(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 MN({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],u=typeof o=="number"?o:parseFloat(String(o))||0,c=LN(u,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 ZE=L.forwardRef(function({data:t,xAxis:n,chartConfig:r,theme:a,height:o=400,loading:u=!1,onCrossFilter:c,onDrillDown:d},h){var P,_,N,I,F,j;const g=(r==null?void 0:r.series)&&"field"in r.series?Qc(t,n):Vu(t,n),E=n.type==="temporal"?Vc(t,n):g,x=L.useMemo(()=>{const M={};return c&&(M.click=H=>{const $=H;if($.componentType!=="series")return;const Q=$.name;Q==null||Q===""||c(n.field,String(Q))}),d&&(M.contextmenu=(H,$)=>{var Z,K,R,ue,oe,U,Oe;const Q=H;if(Q.componentType!=="series")return;const J=Q.name;if(J==null||J==="")return;(K=(Z=Q.event)==null?void 0:Z.event)==null||K.preventDefault(),(R=$==null?void 0:$.dispatchAction)==null||R.call($,{type:"hideTip"});const G=((oe=(ue=Q.event)==null?void 0:ue.event)==null?void 0:oe.clientX)??0,re=((Oe=(U=Q.event)==null?void 0:U.event)==null?void 0:Oe.clientY)??0;d(n.field,String(J),{x:G,y:re})}),Object.keys(M).length>0?M:void 0},[c,d,n.field]),k=$c(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 C=Ns(a),O=k.map(M=>{const H=Gc(M.color,M.gradient??r.gradient),$=M.chartType??"bar",Q={name:M.name,data:M.data,yAxisIndex:M.yAxisIndex??0,itemStyle:{color:H??M.color},...M.opacity!==void 0?{opacity:M.opacity}:{}};return $==="line"?{...Q,type:"line",smooth:C.smooth,symbol:"circle",symbolSize:6,lineStyle:{width:2,color:M.color,type:M.style==="dashed"?"dashed":M.style==="dotted"?"dotted":"solid"}}:$==="area"?{...Q,type:"line",smooth:C.smooth,symbol:"none",lineStyle:{width:2,color:M.color},areaStyle:{color:H??M.color}}:{...Q,type:"bar",barWidth:"60%",itemStyle:{color:H??M.color,borderRadius:C.barBorderRadius}}}),A={tooltip:{trigger:"axis",axisPointer:{type:"cross"},formatter:M=>{const H=M;if(!Array.isArray(H)||H.length===0)return"";let Q=`<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 G=k.find(Z=>Z.name===J.seriesName),re=(G==null?void 0:G.yAxisIndex)===1?w:S;Q+=`<div>${J.marker} ${J.seriesName}: ${ma(J.value,re==null?void 0:re.format)}</div>`}return Q+="</div>",Q}},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:u,onEvents:x})}),ex=L.forwardRef(function({data:t,chartConfig:n,height:r=400,loading:a=!1},o){const u=L.useMemo(()=>{var C,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,k=-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>k&&(k=N))}x===1/0&&(x=0),k===-1/0&&(k=0);const S=((C=n.color_range)==null?void 0:C.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:k,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:u,height:r,loading:a})}),tx=L.forwardRef(function({data:t,chartConfig:n,theme:r,height:a=400,loading:o=!1},u){const c=L.useMemo(()=>{var k;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 C=(v.value/w.value*100).toFixed(1);E[v.name]=`${C}% of ${w.name}`}}const x=n.color??((k=r==null?void 0:r.palette)==null?void 0:k[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:u,option:c,height:a,loading:o})}),nx=L.forwardRef(function({data:t,chartConfig:n,height:r=400,loading:a=!1},o){const u=L.useMemo(()=>{var C,O,A;const c=n.category.field,d=n.value.field,h=n.total_field,m=((C=n.colors)==null?void 0:C.increase)??"#22C55E",g=((O=n.colors)==null?void 0:O.decrease)??"#EF4444",E=((A=n.colors)==null?void 0:A.total)??"#3B82F6",x=[],k=[],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?(k.push(Math.min(0,N)),S.push(Math.abs(N)),w.push(E),v=N):(N>=0?(k.push(v),S.push(N),w.push(m)):(k.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:k,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:u,height:r,loading:a})}),rx=L.forwardRef(function({data:t,chartConfig:n,theme:r,height:a=400,loading:o=!1},u){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 k;if(n.thresholds&&n.thresholds.length>0){const w=m-h||1;k=n.thresholds.map(v=>[(v.value-h)/w,v.color])}else k=[[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:k}},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:u,option:c,height:a,loading:o})});function sx({onRefresh:e,onExportCSV:t,onExportPNG:n,onExportSVG:r,onExportPDF:a,isRefreshing:o=!1,hideImageExport:u=!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"]}),!u&&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 ax({x:e,y:t,targetChartTitle:n,onDrillDown:r,onClose:a}){const o=L.useRef(null);return L.useEffect(()=>{const u=d=>{o.current&&!o.current.contains(d.target)&&a()},c=d=>{d.key==="Escape"&&a()};return document.addEventListener("mousedown",u),document.addEventListener("keydown",c),()=>{document.removeEventListener("mousedown",u),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 PN={connection_error:{title:"Database connection failed",hint:"Check your connection configuration"},timeout:{title:"Query timed out",hint:"Try adding filters or optimizing your SQL"},not_found:{title:"Not found",hint:"Check that the chart and model exist"},validation_error:{title:"Configuration error",hint:"Check your chart YAML configuration"}};function Ic({isLoading:e,error:t,data:n,hasActiveFilters:r,onRetry:a,children:o}){if(t){const u=t.errorType?PN[t.errorType]:void 0;return p.jsx("div",{className:"h-full flex items-center justify-center p-6",children:p.jsxs("div",{className:"text-center max-w-sm",children:[p.jsx("div",{className:"w-10 h-10 mx-auto mb-3 rounded-full bg-red-50 flex items-center justify-center",children:p.jsx("svg",{className:"w-5 h-5 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),p.jsx("p",{className:"text-sm font-medium text-gray-900",children:(u==null?void 0:u.title)??"Failed to load chart"}),p.jsx("p",{className:"text-xs text-gray-500 mt-1",children:t.message}),(u==null?void 0:u.hint)&&p.jsx("p",{className:"text-xs text-gray-400 mt-1",children:u.hint}),a&&p.jsx("button",{onClick:a,className:"mt-3 px-3 py-1.5 text-xs font-medium text-blue-600 hover:text-blue-700 hover:bg-blue-50 rounded transition-colors","aria-label":"Retry",children:"Retry"})]})})}return e&&!n?p.jsx("div",{className:"h-full animate-pulse bg-gray-100 rounded"}):n&&n.length===0?p.jsx("div",{className:"h-full flex items-center justify-center p-6",children:p.jsxs("div",{className:"text-center",children:[p.jsx("div",{className:"w-10 h-10 mx-auto mb-3 rounded-full bg-gray-100 flex items-center justify-center",children:p.jsx("svg",{className:"w-5 h-5 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"})})}),p.jsx("p",{className:"text-sm text-gray-500",children:"No data matches your filters"}),r&&p.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Try adjusting your filters"})]})}):p.jsx(p.Fragment,{children:o})}const FN={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 uh(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 jN(e,t){const n=e>=0?"+":"";return t==="percent_change"?`${n}${e.toFixed(1)}%`:`${n}${e.toLocaleString()}`}function BN({chartName:e,drillParams:t}){var G,re,Z,K;const{data:n,isLoading:r}=$b(e),{data:a,isLoading:o,error:u}=Qb(e),{data:c}=io(),d=N0(),h=qe(R=>R.getEffectiveFilters),m=L.useRef(null),[g,E]=L.useState("chart"),[x,k]=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("_"))):{},C=Object.keys(v).length>0,O=Object.entries(v).map(([R,ue])=>`${R}: ${ue}`).join(", "),P=h(e).granularity,_=P?FN[P]:void 0,[N,I]=L.useState(null),F=L.useCallback((R,ue,oe)=>{var U;(U=n==null?void 0:n.drillDown)!=null&&U.chart&&I({x:oe.x,y:oe.y,field:R,value:ue})},[(G=n==null?void 0:n.drillDown)==null?void 0:G.chart]),j=L.useCallback(()=>{var oe,U;if(!N||!((oe=n==null?void 0:n.drillDown)!=null&&oe.chart))return;const R=n.drillDown.field??((U=n.chart.x)==null?void 0:U.field)??N.field,ue=new URLSearchParams({[R]:N.value,_from:e});window.location.hash=`/charts/${n.drillDown.chart}?${ue.toString()}`,I(null)},[N,n,e]),M=()=>{!a||!n||qc(a.rows,a.columns,n.name||e)},H=()=>{var ue;const R=(ue=m.current)==null?void 0:ue.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,Q=_?{...n.chart.x,label:_.label,format:_.format}:n.chart.x,J=()=>{var R,ue;if(!a)return p.jsx("div",{className:"h-full animate-pulse",style:{background:"var(--yc-color-background)"}});if(g==="table"&&a)return p.jsx(t0,{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(VE,{ref:m,data:a.rows,columns:a.columns,xAxis:Q,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(QE,{ref:m,data:a.rows,xAxis:Q,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(GE,{ref:m,data:a.rows,xAxis:Q,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(XE,{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(KE,{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(JE,{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(ZE,{ref:m,data:a.rows,xAxis:Q,chartConfig:n.chart,theme:c==null?void 0:c.theme,loading:o,onDrillDown:$}):null;case"heatmap":return p.jsx(ex,{ref:m,data:a.rows,chartConfig:n.chart,theme:c==null?void 0:c.theme,loading:o});case"funnel":return p.jsx(tx,{ref:m,data:a.rows,chartConfig:n.chart,theme:c==null?void 0:c.theme,loading:o});case"waterfall":return p.jsx(nx,{ref:m,data:a.rows,chartConfig:n.chart,theme:c==null?void 0:c.theme,loading:o});case"gauge":return p.jsx(rx,{ref:m,data:a.rows,chartConfig:n.chart,theme:c==null?void 0:c.theme,loading:o});case"table":return p.jsx(t0,{data:a.rows,columns:a.columns,chartConfig:n.chart,height:"100%",loading:o});case"kpi":{const oe=n.chart;if(!((R=oe.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 U=a.rows[0],Oe=U[oe.value.field],Le=uh(Oe,oe.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=uh(a.comparison.previousValue,oe.format);else if((ue=oe.comparison)!=null&&ue.enabled&&oe.comparison.field){const We=U[oe.comparison.field];Ze=oe.comparison.type,We&&We!==0&&(Te=Ze==="percent_change"?(Oe-We)/We*100:Oe-We,tt=uh(We,oe.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:[Le,oe.unit&&p.jsx("span",{className:"text-3xl font-normal ml-2",style:{color:"var(--yc-color-text-secondary)"},children:oe.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:jN(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.jsx(Y0,{fallback:(R,ue)=>p.jsx("div",{className:"flex items-center justify-center h-full p-8",children:p.jsxs("div",{className:"text-center",children:[p.jsx("p",{className:"text-sm font-medium text-red-600",children:"Failed to render chart"}),p.jsx("p",{className:"text-xs text-gray-500 mt-1",children:R.message}),p.jsx("button",{onClick:ue,className:"mt-2 text-xs text-blue-600 hover:text-blue-700",children:"Retry"})]})}),resetKey:e,children: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(cN,{resourceType:"chart",resourceName:e})]})]}),n.parameters.length>0&&p.jsx(YE,{parameters:n.parameters,chartName:e}),C&&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,ue])=>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,": ",ue]},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:p.jsx(Ic,{isLoading:o,error:u,data:a==null?void 0:a.rows,onRetry:()=>d(e),children:J()})})}),p.jsx("div",{className:"px-6 pb-2",children:p.jsx(dN,{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:()=>k(!x)})}),C&&a&&p.jsx("div",{className:"px-6 pb-4",children:p.jsx(xN,{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(ax,{x:N.x,y:N.y,targetChartTitle:n.drillDown.chart,onDrillDown:j,onClose:()=>I(null)}),p.jsx(mN,{isOpen:x,onClose:()=>k(!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 HN(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 ix=L.createContext(null);function UN({children:e}){const[t,n]=L.useState(!1),[r,a]=L.useState(null),[o,u]=L.useState(null),[c,d]=L.useState(null),h=L.useRef(HN()),[m,g]=L.useState(!1),[E,x]=L.useState(!1),k=r!==null,S=L.useMemo(()=>r||o,[r,o]),w=L.useCallback(N=>{u(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]),C=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(),C()),F&&I.key==="z"&&I.shiftKey&&(I.preventDefault(),O())};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[t,C,O]);const A=L.useCallback(N=>{var Q;const I=r||o;if(!I)return;const j=N.type==="chart"&&((Q=N.ref)==null?void 0:Q.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 Q=H.widgets.filter((J,G)=>G!==I);return{...H,widgets:Q}}).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(($,Q)=>{if(Q!==N)return $;const J=$.widgets.map((G,re)=>re!==I?G:{...G,...F});return{...$,widgets:J}}),H={...j,rows:M};v(H)},[r,o,v]);return p.jsx(ix.Provider,{value:{isEditing:t,setIsEditing:n,pendingLayout:r,setPendingLayout:v,hasChanges:k,originalLayout:o,setOriginalLayout:w,currentLayout:S,addWidget:A,removeWidget:P,updateWidget:_,pendingFilters:c,setPendingFilters:d,undo:C,redo:O,canUndo:m,canRedo:E},children:e})}function fo(){const e=L.useContext(ix);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,u){const{margin:c,containerPadding:d,rowHeight:h}=e,m=ho(e);let g,E,x,k;if(u?(g=Math.round(u.width),E=Math.round(u.height)):(g=ro(r,m,c[0]),E=ro(a,h,c[1])),o?(x=Math.round(o.top),k=Math.round(o.left)):u?(x=Math.round(u.top),k=Math.round(u.left)):(x=Math.round((h+c[1])*n+d[1]),k=Math.round((m+c[0])*t+d[0])),!o&&!u){if(Number.isFinite(r)){const w=Math.round((m+c[0])*(t+r)+d[0])-k-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:k,width:g,height:E}}function zN(e,t,n,r,a){const{margin:o,containerPadding:u,cols:c,rowHeight:d,maxRows:h}=e,m=ho(e);let g=Math.round((n-u[0])/(m+o[0])),E=Math.round((t-u[1])/(d+o[1]));return g=Rc(g,0,c-r),E=Rc(E,0,h-a),{x:g,y:E}}function cc(e,t,n){const{margin:r,containerPadding:a,rowHeight:o}=e,u=ho(e),c=Math.round((n-a[0])/(u+r[0])),d=Math.round((t-a[1])/(o+r[1]));return{x:c,y:d}}function WN(e,t,n){const{margin:r,rowHeight:a}=e,o=ho(e),u=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:u,h:c}}function Rc(e,t,n){return Math.max(Math.min(e,n),t)}function q0(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&&q0(r,t))return r}}function ox(e,t){return e.filter(n=>q0(n,t))}function YN(e,t){return t==="horizontal"?ux(e):t==="vertical"||t==="wrap"?n0(e):[...e]}function n0(e){return[...e].sort((t,n)=>t.y!==n.y?t.y-n.y:t.x-n.x)}function ux(e){return[...e].sort((t,n)=>t.x!==n.x?t.x-n.x:t.y-n.y)}function $0(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 Xc(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 Kc(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 qN(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 $N(e,t,n){let r=Ra(e,t);return r?(r=n(ei(r)),[qN(e,r),r]):[[...e],null]}function VN(e,t){const n=Xc(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,u,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=YN(e,u);(u==="vertical"&&typeof r=="number"?m>=r:u==="horizontal"&&typeof n=="number"?h>=n:!1)&&(g=g.reverse());const x=ox(g,t),k=x.length>0;if(k&&d)return Kc(e);if(k&&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=P1(S,v,t,a,u):S=P1(S,t,v,a,u)))}return S}function P1(e,t,n,r,a,o){const u=a==="horizontal",c=a==="vertical",d=t.static;if(r){r=!1;const g={x:u?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,k=E!==void 0&&t.x+t.w>E.x;if(!E)return Fa(e,n,u?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(k&&u)return Fa(e,t,n.x,void 0,r,d,a)}const h=u?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 u=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,u)),h:fa(n,1,Math.max(1,c))}}},GN={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)}}},XN={name:"containerBounds",constrainPosition(e,t,n,{cols:r,maxRows:a,containerHeight:o,rowHeight:u,margin:c}){const d=o>0?Math.floor((o+c[1])/(u+c[1])):a;return{x:fa(t,0,Math.max(0,r-e.w)),y:fa(n,0,Math.max(0,d-e.h))}}},Lc=[QN,GN];function dc(e,t,n,r,a){let o={x:n,y:r};for(const u of e)u.constrainPosition&&(o=u.constrainPosition(t,o.x,o.y,a));if(t.constraints)for(const u of t.constraints)u.constrainPosition&&(o=u.constrainPosition(t,o.x,o.y,a));return o}function KN(e,t,n,r,a,o){let u={w:n,h:r};for(const c of e)c.constrainSize&&(u=c.constrainSize(t,u.w,u.h,a,o));if(t.constraints)for(const c of t.constraints)c.constrainSize&&(u=c.constrainSize(t,u.w,u.h,a,o));return u}function V0({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 lx({top:e,left:t,width:n,height:r}){return{top:`${e}px`,left:`${t}px`,width:`${n}px`,height:`${r}px`,position:"absolute"}}function F1(e){return e*100+"%"}function JN(e,t,n,r){return e+n>r?t:n}function cx(e,t,n){return e<0?t:n}function ZN(e){return Math.max(0,e)}function Mc(e){return Math.max(0,e)}var Q0=(e,t,n)=>{const{left:r,height:a,width:o}=t,u=e.top-(a-e.height);return{left:r,width:o,height:cx(u,e.height,a),top:Mc(u)}},G0=(e,t,n)=>{const{top:r,left:a,height:o,width:u}=t;return{top:r,height:o,width:JN(e.left,e.width,u,n),left:ZN(a)}},X0=(e,t,n)=>{const{top:r,height:a,width:o}=t,u=e.left+e.width-o;return u<0?{height:a,width:e.left+e.width,top:Mc(r),left:0}:{height:a,width:o,top:Mc(r),left:u}},K0=(e,t,n)=>{const{top:r,left:a,height:o,width:u}=t;return{width:u,left:a,height:cx(r,e.height,o),top:Mc(r)}},e3=(e,t,n)=>Q0(e,G0(e,t,n)),t3=(e,t,n)=>Q0(e,X0(e,t)),n3=(e,t,n)=>K0(e,G0(e,t,n)),r3=(e,t,n)=>K0(e,X0(e,t)),s3={n:Q0,ne:e3,e:G0,se:n3,s:K0,sw:r3,w:X0,nw:t3};function a3(e,t,n,r){const a=s3[e];return a?a(t,{...t,...n},r):n}var dx={type:"transform",scale:1,calcStyle(e){return V0(e)}},i3={type:"absolute",scale:1,calcStyle(e){return lx(e)}};function o3(e){return{type:"transform",scale:e,calcStyle(t){return V0(t)},calcDragPosition(t,n,r,a){return{left:(t-r)/e,top:(n-a)/e}}}}var u3=dx,l3={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},c3={enabled:!0,bounded:!1,threshold:3},d3={enabled:!0,handles:["se"]},f3={enabled:!1,defaultItem:{w:1,h:1}};function J0(e,t,n,r,a){const o=r==="x"?"w":"h";t[r]+=1;const u=e.findIndex(d=>d.i===t.i),c=a??Xc(e).length>0;for(let d=u+1;d<e.length;d++){const h=e[d];if(h!==void 0&&!h.static){if(!c&&h.y>t.y+t.h)break;q0(t,h)&&J0(e,h,n+t[o],r,c)}}t[r]=n}function h3(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;)J0(n,t,a.y+a.h,"y");return t.y=Math.max(t.y,0),t}function p3(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(J0(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 fx={type:"vertical",allowOverlap:!1,compact(e,t){const n=Xc(e);let r=$0(n);const a=n0(e),o=new Array(e.length);for(let u=0;u<a.length;u++){const c=a[u];if(c===void 0)continue;let d=ei(c);d.static||(d=h3(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}},hx={type:"horizontal",allowOverlap:!1,compact(e,t){const n=Xc(e),r=ux(e),a=new Array(e.length);for(let o=0;o<r.length;o++){const u=r[o];if(u===void 0)continue;let c=ei(u);c.static||(c=p3(n,c,t,r),n.push(c));const d=e.indexOf(u);a[d]=c,c.moved=!1}return a}},px={type:null,allowOverlap:!1,compact(e,t){return Kc(e)}},m3={...fx,allowOverlap:!0,compact(e,t){return Kc(e)}},g3={...hx,allowOverlap:!0,compact(e,t){return Kc(e)}},y3={...px,allowOverlap:!0};function mx(e,t=!1,n=!1){let r;return t?e==="vertical"?r=m3:e==="horizontal"?r=g3:r=y3:e==="vertical"?r=fx:e==="horizontal"?r=hx:r=px,n?{...r,preventCollision:n}:r}var au={exports:{}},lh={},ch={exports:{}},dh,j1;function b3(){if(j1)return dh;j1=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return dh=e,dh}var fh,B1;function E3(){if(B1)return fh;B1=1;var e=b3();function t(){}function n(){}return n.resetWarningCache=t,fh=function(){function r(u,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},fh}var H1;function Jc(){return H1||(H1=1,ch.exports=E3()()),ch.exports}var fc={exports:{}},U1;function x3(){if(U1)return fc.exports;U1=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 u=n.length;for(r=0;r<u;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="",u=arguments.length;a<u;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={},z1;function Zc(){if(z1)return Xs;z1=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,u){for(let c=0,d=o.length;c<d;c++)if(u.apply(u,[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,u,c){if(o[u])return new Error(`Invalid prop ${u} passed to ${c} - do not set this, set it on the child.`)}return Xs}var Ks={},W1;function T3(){if(W1)return Ks;W1=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 u=(d=(c=window.document)==null?void 0:c.documentElement)==null?void 0:d.style;if(!u||o in u)return"";for(let h=0;h<e.length;h++)if(n(o,e[h])in u)return e[h];return""}function n(o,u){return u?`${u}${a(o)}`:o}function r(o,u){return u?`-${u.toLowerCase()}-${o}`:o}function a(o){let u="",c=!0;for(let d=0;d<o.length;d++)c?(u+=o[d].toUpperCase(),c=!1):o[d]==="-"?c=!0:u+=o[d];return u}return Ks.default=t(),Ks}var Y1;function Z0(){if(Y1)return Kt;Y1=1,Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.addClassName=P,Kt.addEvent=u,Kt.addUserSelectStyles=C,Kt.createCSSTransform=x,Kt.createSVGTransform=k,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=Zc(),t=n(T3());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 $,Q,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 G in M)G!=="default"&&{}.hasOwnProperty.call(M,G)&&((Q=($=Object.defineProperty)&&Object.getOwnPropertyDescriptor(M,G))&&(Q.get||Q.set)?$(J,G,Q):J[G]=M[G]);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 u(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 k(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}`,Q=`${typeof I.y=="string"?I.y:I.y+F}`;H=`translate(${$}, ${Q})`+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 C(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={},q1;function gx(){if(q1)return Vr;q1=1,Object.defineProperty(Vr,"__esModule",{value:!0}),Vr.canDragX=a,Vr.canDragY=o,Vr.createCoreData=c,Vr.createDraggableData=d,Vr.getBoundPosition=n,Vr.getControlPosition=u,Vr.snapToGrid=r;var e=Zc(),t=Z0();function n(g,E,x){if(!g.props.bounds)return[E,x];let{bounds:k}=g.props;k=typeof k=="string"?k:h(k);const S=m(g);if(typeof k=="string"){const{ownerDocument:w}=S,v=w.defaultView;let C;if(k==="parent"?C=S.parentNode:C=S.getRootNode().querySelector(k),!(C instanceof v.HTMLElement))throw new Error('Bounds selector "'+k+'" could not find an element.');const O=C,A=v.getComputedStyle(S),P=v.getComputedStyle(O);k={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)(k.right)&&(E=Math.min(E,k.right)),(0,e.isNum)(k.bottom)&&(x=Math.min(x,k.bottom)),(0,e.isNum)(k.left)&&(E=Math.max(E,k.left)),(0,e.isNum)(k.top)&&(x=Math.max(x,k.top)),[E,x]}function r(g,E,x){const k=Math.round(E/g[0])*g[0],S=Math.round(x/g[1])*g[1];return[k,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 u(g,E,x){const k=typeof E=="number"?(0,t.getTouch)(g,E):null;if(typeof E=="number"&&!k)return null;const S=m(x),w=x.props.offsetParent||S.offsetParent||S.ownerDocument.body;return(0,t.offsetXYFromParent)(k||g,w,x.props.scale)}function c(g,E,x){const k=!(0,e.isNum)(g.lastX),S=m(g);return k?{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={},$1;function yx(){if($1)return hc;$1=1,Object.defineProperty(hc,"__esModule",{value:!0}),hc.default=e;function e(){}return hc}var V1;function v3(){if(V1)return iu;V1=1,Object.defineProperty(iu,"__esModule",{value:!0}),iu.default=void 0;var e=d(ti()),t=c(Jc()),n=c(Hc()),r=Z0(),a=gx(),o=Zc(),u=c(yx());function c(S){return S&&S.__esModule?S:{default:S}}function d(S,w){if(typeof WeakMap=="function")var v=new WeakMap,C=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?C: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 C=v.call(S,w);if(typeof C!="object")return C;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,k=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:C}=v;if(this.props.disabled||!(w.target instanceof C.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,u.default)("DraggableCore: handleDragStart: %j",N),(0,u.default)("calling",this.props.onStart),!(this.props.onStart(w,N)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,r.addUserSelectStyles)(C),this.dragging=!0,this.lastX=P,this.lastY=_,(0,r.addEvent)(C,x.move,this.handleDrag),(0,r.addEvent)(C,x.stop,this.handleDragStop))}),h(this,"handleDrag",w=>{const v=(0,a.getControlPosition)(w,this.touchIdentifier,this);if(v==null)return;let{x:C,y:O}=v;if(Array.isArray(this.props.grid)){let _=C-this.lastX,N=O-this.lastY;if([_,N]=(0,a.snapToGrid)(this.props.grid,_,N),!_&&!N)return;C=this.lastX+_,O=this.lastY+N}const A=(0,a.createCoreData)(this,C,O);if((0,u.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=C,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:C,y:O}=v;if(Array.isArray(this.props.grid)){let N=C-this.lastX||0,I=O-this.lastY||0;[N,I]=(0,a.snapToGrid)(this.props.grid,N,I),C=this.lastX+N,O=this.lastY+I}const A=(0,a.createCoreData)(this,C,O);if(this.props.onStop(w,A)===!1||this.mounted===!1)return!1;const _=this.findDOMNode();_&&this.props.enableUserSelectHack&&(0,r.scheduleRemoveUserSelectStyles)(_.ownerDocument),(0,u.default)("DraggableCore: handleDragStop: %j",A),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,_&&((0,u.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,C;return(w=this.props)!=null&&w.nodeRef?(C=(v=this.props)==null?void 0:v.nodeRef)==null?void 0:C.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=k,h(k,"displayName","DraggableCore"),h(k,"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(k,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),iu}var Q1;function w3(){return Q1||(Q1=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(Jc()),r=m(Hc()),a=x3(),o=Z0(),u=gx(),c=Zc(),d=m(v3()),h=m(yx());function m(v){return v&&v.__esModule?v:{default:v}}function g(v,C){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,C)}function E(){return E=Object.assign?Object.assign.bind():function(v){for(var C=1;C<arguments.length;C++){var O=arguments[C];for(var A in O)({}).hasOwnProperty.call(O,A)&&(v[A]=O[A])}return v},E.apply(null,arguments)}function x(v,C,O){return(C=k(C))in v?Object.defineProperty(v,C,{value:O,enumerable:!0,configurable:!0,writable:!0}):v[C]=O,v}function k(v){var C=S(v,"string");return typeof C=="symbol"?C:C+""}function S(v,C){if(typeof v!="object"||!v)return v;var O=v[Symbol.toPrimitive];if(O!==void 0){var A=O.call(v,C);if(typeof A!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(v)}class w extends t.Component{static getDerivedStateFromProps(C,O){let{position:A}=C,{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(C){super(C),x(this,"onDragStart",(O,A)=>{if((0,h.default)("Draggable: onDragStart: %j",A),this.props.onStart(O,(0,u.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,u.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,u.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,u.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:C.position?C.position.x:C.defaultPosition.x,y:C.position?C.position.y:C.defaultPosition.y,prevPropsPosition:{...C.position},slackX:0,slackY:0,isElementSVG:!1},C.position&&!(C.onDrag||C.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 C,O;return((O=(C=this.props)==null?void 0:C.nodeRef)==null?void 0:O.current)??r.default.findDOMNode(this)}render(){const{axis:C,bounds:O,children:A,defaultPosition:P,defaultClassName:_,defaultClassNameDragging:N,defaultClassNameDragged:I,position:F,positionOffset:j,scale:M,...H}=this.props;let $={},Q=null;const G=!!!F||this.state.dragging,re=F||P,Z={x:(0,u.canDragX)(this)&&G?this.state.x:re.x,y:(0,u.canDragY)(this)&&G?this.state.y:re.y};this.state.isElementSVG?Q=(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:Q}))}}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})})(lh)),lh}var G1;function ep(){if(G1)return au.exports;G1=1;const{default:e,DraggableCore:t}=w3();return au.exports=e,au.exports.default=e,au.exports.DraggableCore=t,au.exports}var S3=ep(),ou={exports:{}},uu={},pc={},X1;function _3(){if(X1)return pc;X1=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=u(d,"string");return typeof h=="symbol"?h:h+""}function u(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={},K1;function bx(){if(K1)return lu;K1=1,lu.__esModule=!0,lu.resizableProps=void 0;var e=t(Jc());ep();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 J1;function Ex(){if(J1)return uu;J1=1,uu.__esModule=!0,uu.default=void 0;var e=o(ti()),t=ep(),n=_3(),r=bx();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,C=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?C: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 u(){return u=Object.assign?Object.assign.bind():function(S){for(var w=1;w<arguments.length;w++){var v=arguments[w];for(var C in v)({}).hasOwnProperty.call(v,C)&&(S[C]=v[C])}return S},u.apply(null,arguments)}function c(S,w){if(S==null)return{};var v,C,O=d(S,w);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(S);for(C=0;C<A.length;C++)v=A[C],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 C in S)if({}.hasOwnProperty.call(S,C)){if(w.indexOf(C)!==-1)continue;v[C]=S[C]}return v}function h(S,w){var v=Object.keys(S);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(S);w&&(C=C.filter(function(O){return Object.getOwnPropertyDescriptor(S,O).enumerable})),v.push.apply(v,C)}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(C){g(S,C,v[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(S,Object.getOwnPropertyDescriptors(v)):h(Object(v)).forEach(function(C){Object.defineProperty(S,C,Object.getOwnPropertyDescriptor(v,C))})}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 C=v.call(S,w);if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(S)}let k=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:C,maxConstraints:O,lockAspectRatio:A}=this.props;if(!C&&!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,C&&(w=Math.max(C[0],w),v=Math.max(C[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(C,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 Q=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"&&!Q)&&((re=C.persist)==null||re.call(C),J(C,{node:A,size:{width:H,height:$},handle:v})),w==="onResizeStop"&&this.resetData()}}renderResizeHandle(w,v){const{handle:C}=this.props;if(!C)return e.createElement("span",{className:`react-resizable-handle react-resizable-handle-${w}`,ref:v});if(typeof C=="function")return C(w,v);const O=typeof C.type=="string",A=m({ref:v},O?{}:{handleAxis:w});return e.cloneElement(C,A)}render(){const w=this.props,{children:v,className:C,draggableOpts:O,width:A,height:P,handle:_,handleSize:N,lockAspectRatio:I,axis:F,minConstraints:j,maxConstraints:M,onResize:H,onResizeStop:$,onResizeStart:Q,resizeHandles:J,transformScale:G}=w,re=c(w,a);return(0,n.cloneElement)(v,m(m({},re),{},{className:`${C?`${C} `:""}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,u({},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=k,k.propTypes=r.resizableProps,k.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},uu}var cu={},Z1;function k3(){if(Z1)return cu;Z1=1,cu.__esModule=!0,cu.default=void 0;var e=u(ti()),t=o(Jc()),n=o(Ex()),r=bx();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 u(w,v){if(typeof WeakMap=="function")var C=new WeakMap,O=new WeakMap;return(u=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:C){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 C=arguments[v];for(var O in C)({}).hasOwnProperty.call(C,O)&&(w[O]=C[O])}return w},c.apply(null,arguments)}function d(w,v){var C=Object.keys(w);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(w);v&&(O=O.filter(function(A){return Object.getOwnPropertyDescriptor(w,A).enumerable})),C.push.apply(C,O)}return C}function h(w){for(var v=1;v<arguments.length;v++){var C=arguments[v]!=null?arguments[v]:{};v%2?d(Object(C),!0).forEach(function(O){m(w,O,C[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(C)):d(Object(C)).forEach(function(O){Object.defineProperty(w,O,Object.getOwnPropertyDescriptor(C,O))})}return w}function m(w,v,C){return(v=g(v))in w?Object.defineProperty(w,v,{value:C,enumerable:!0,configurable:!0,writable:!0}):w[v]=C,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 C=w[Symbol.toPrimitive];if(C!==void 0){var O=C.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 C,O,A=k(w,v);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(w);for(O=0;O<P.length;O++)C=P[O],v.indexOf(C)===-1&&{}.propertyIsEnumerable.call(w,C)&&(A[C]=w[C])}return A}function k(w,v){if(w==null)return{};var C={};for(var O in w)if({}.hasOwnProperty.call(w,O)){if(v.indexOf(O)!==-1)continue;C[O]=w[O]}return C}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,C)=>{var A;const{size:O}=C;this.props.onResize?((A=v.persist)==null||A.call(v),this.setState(O,()=>this.props.onResize&&this.props.onResize(v,C))):this.setState(O)}}static getDerivedStateFromProps(v,C){return C.propsWidth!==v.width||C.propsHeight!==v.height?{width:v.width,height:v.height,propsWidth:v.width,propsHeight:v.height}:null}render(){const v=this.props,{handle:C,handleSize:O,onResize:A,onResizeStart:P,onResizeStop:_,draggableOpts:N,minConstraints:I,maxConstraints:F,lockAspectRatio:j,axis:M,width:H,height:$,resizeHandles:Q,style:J,transformScale:G}=v,re=x(v,a);return e.createElement(n.default,{axis:M,draggableOpts:N,handle:C,handleSize:O,height:this.state.height,lockAspectRatio:j,maxConstraints:F,minConstraints:I,onResizeStart:P,onResize:this.onResize,onResizeStop:_,resizeHandles:Q,transformScale:G,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 ey;function C3(){return ey||(ey=1,ou.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},ou.exports.Resizable=Ex().default,ou.exports.ResizableBox=k3().default),ou.exports}var N3=C3();function xx(e){return function(n,r,a,o,u,c,d){return e(n,r,d)}}function ed(e){return function(n,r,a,o){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,a,o);var u=o.get(n),c=o.get(r);if(u&&c)return u===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 Tx(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 ty(e){return e.constructor===Object||e.constructor==null}function ny(e){return typeof e.then=="function"}function td(e,t){return e===t||e!==e&&t!==t}var O3="[object Arguments]",D3="[object Boolean]",A3="[object Date]",I3="[object RegExp]",R3="[object Map]",L3="[object Number]",M3="[object Object]",P3="[object Set]",F3="[object String]",ry=Object.prototype.toString;function nd(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,a=e.areObjectsEqual,o=e.areRegExpsEqual,u=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(ty(m)&&ty(g))return a(m,g,d,E);var x=Array.isArray(m),k=Array.isArray(g);if(x||k)return x===k&&t(m,g,d,E);var S=ry.call(m);return S!==ry.call(g)?!1:S===A3?n(m,g,d,E):S===I3?o(m,g,d,E):S===R3?r(m,g,d,E):S===P3?u(m,g,d,E):S===M3||S===O3?ny(m)||ny(g)?!1:a(m,g,d,E):S===D3||S===L3||S===F3?td(m.valueOf(),g.valueOf()):!1}return h}function vx(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 j3=ed(vx);function wx(e,t){return td(e.valueOf(),t.valueOf())}function Sx(e,t,n,r){var a=e.size===t.size;if(!a)return!1;if(!e.size)return!0;var o={},u=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,u,m,e,t,r)&&n(c,g,d,E,e,t,r))&&(o[m]=!0),m++}),u++,a=h}}),a}var B3=ed(Sx),H3="_owner",U3=Object.prototype.hasOwnProperty;function _x(e,t,n,r){var a=Object.keys(e),o=a.length;if(Object.keys(t).length!==o)return!1;for(var u;o-- >0;){if(u=a[o],u===H3){var c=!!e.$$typeof,d=!!t.$$typeof;if((c||d)&&c!==d)return!1}if(!U3.call(t,u)||!n(e[u],t[u],u,u,e,t,r))return!1}return!0}var z3=ed(_x);function kx(e,t){return e.source===t.source&&e.flags===t.flags}function Cx(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(u,c){if(a){var d=!1,h=0;t.forEach(function(m,g){!d&&!o[h]&&(d=n(u,m,c,g,e,t,r))&&(o[h]=!0),h++}),a=d}}),a}var W3=ed(Cx),Nx=Object.freeze({areArraysEqual:vx,areDatesEqual:wx,areMapsEqual:Sx,areObjectsEqual:_x,areRegExpsEqual:kx,areSetsEqual:Cx,createIsNestedEqual:xx}),Ox=Object.freeze({areArraysEqual:j3,areDatesEqual:wx,areMapsEqual:B3,areObjectsEqual:z3,areRegExpsEqual:kx,areSetsEqual:W3,createIsNestedEqual:xx}),Y3=nd(Nx);function Ri(e,t){return Y3(e,t,void 0)}nd(Tx(Nx,{createIsNestedEqual:function(){return td}}));nd(Ox);nd(Tx(Ox,{createIsNestedEqual:function(){return td}}));function sy(e){const{children:t,cols:n,containerWidth:r,margin:a,containerPadding:o,rowHeight:u,maxRows:c,isDraggable:d,isResizable:h,isBounded:m,static:g,useCSSTransforms:E=!0,usePercentages:x=!1,transformScale:k=1,positionStrategy:S,dragThreshold:w=0,droppingPosition:v,className:C="",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:Q,resizeHandles:J,resizeHandle:G,constraints:re=Lc,layoutItem:Z,layout:K=[],onDragStart:R,onDrag:ue,onDragStop:oe,onResizeStart:U,onResize:Oe,onResizeStop:Le}=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:u}),[n,o,r,a,c,u]),Et=L.useMemo(()=>({cols:n,maxRows:c,containerWidth:r,containerHeight:0,rowHeight:u,margin:a,layout:[]}),[n,c,r,u,a]),Nt=L.useCallback(()=>({...Et,layout:Hn.current}),[Et]),on=L.useMemo(()=>Z??{i:Q,x:_,y:N,w:I,h:F,minW:j,maxW:M,minH:H,maxH:$},[Z,Q,_,N,I,F,j,M,H,$]),nr=L.useCallback(be=>{if(S!=null&&S.calcStyle)return S.calcStyle(be);if(E)return V0(be);const _e=lx(be);return x?{..._e,left:F1(be.left/r),width:F1(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 ke=Je.getBoundingClientRect(),It=_e.getBoundingClientRect(),Wt=It.left/k,Yt=ke.left/k,Rt=It.top/k,qt=ke.top/k;let kn;if(S!=null&&S.calcDragPosition){const Ye=be;kn=S.calcDragPosition(Ye.clientX,Ye.clientY,Ye.clientX-It.left,Ye.clientY-It.top)}else kn={left:Wt-Yt+Je.scrollLeft,top:Rt-qt+Je.scrollTop};if(We.current=kn,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,kn.top,kn.left),{x:Ur,y:Ce}=dc(re,on,zn.x,zn.y,Nt());R(Q,Ur,Ce,{e:be,node:_e,newPosition:kn})},[R,k,nt,S,w,re,on,Nt,Q]),ie=L.useCallback((be,{node:_e,deltaX:Je,deltaY:ke})=>{if(!ue||!Te)return;const It=be;if(mn.current&&!it.current){const Ur=It.clientX-tr.current.x,Ce=It.clientY-tr.current.y;if(Math.hypot(Ur,Ce)<w)return;if(it.current=!0,mn.current=!1,R){const Pe=cc(nt,We.current.top,We.current.left),{x:rt,y:dt}=dc(re,on,Pe.x,Pe.y,Nt());R(Q,rt,dt,{e:be,node:_e,newPosition:We.current})}}let Wt=We.current.top+ke,Yt=We.current.left+Je;if(m){const{offsetParent:Ur}=_e;if(Ur){const Ce=Ur.clientHeight-ro(F,u,a[1]);Wt=Rc(Wt,0,Ce);const Ye=ho(nt),Pe=r-ro(I,Ye,a[0]);Yt=Rc(Yt,0,Pe)}}const Rt={top:Wt,left:Yt};We.current=Rt;const qt=cc(nt,Wt,Yt),{x:kn,y:zn}=dc(re,on,qt.x,qt.y,Nt());ue(Q,kn,zn,{e:be,node:_e,newPosition:Rt})},[ue,R,Te,w,m,F,u,a,nt,r,I,Q,re,on,Nt]),pe=L.useCallback((be,{node:_e})=>{if(!oe||!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:ke,top:It}=We.current,Wt={top:It,left:ke};Ze(!1),We.current={left:0,top:0};const Yt=cc(nt,It,ke),{x:Rt,y:qt}=dc(re,on,Yt.x,Yt.y,Nt());oe(Q,Rt,qt,{e:be,node:_e,newPosition:Wt})},[oe,Te,nt,re,on,Nt,Q]);tn.current=un,nn.current=ie;const De=L.useCallback((be,{node:_e,size:Je,handle:ke},It,Wt)=>{const Yt=Wt==="onResizeStart"?U:Wt==="onResize"?Oe:Le;if(!Yt)return;let Rt;_e?Rt=a3(ke,It,Je,r):Rt={...Je,top:It.top,left:It.left},pn.current=Rt;const qt=WN(nt,Rt.width,Rt.height),{w:kn,h:zn}=KN(re,on,qt.w,qt.h,ke,Nt());Yt(Q,kn,zn,{e:be.nativeEvent,node:_e,size:Rt,handle:ke})},[U,Oe,Le,r,nt,Q,re,on,Nt]),He=L.useCallback((be,_e)=>{Ge(!0);const Je=su(nt,_,N,I,F),ke={..._e,handle:_e.handle};De(be,ke,Je,"onResizeStart")},[De,nt,_,N,I,F]),Ve=L.useCallback((be,_e)=>{const Je=su(nt,_,N,I,F),ke={..._e,handle:_e.handle};De(be,ke,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),ke={..._e,handle:_e.handle};De(be,ke,Je,"onResizeStop")},[De,nt,_,N,I,F]);L.useEffect(()=>{var ke,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};(ke=tn.current)==null||ke.call(tn,v.e,Wt)}Gt.current=v},[v,Te,Q]);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 Me=Ee.cloneElement(rn,{ref:tt,className:Bn("react-grid-item",ln,C,{static:g,resizing:$e,"react-draggable":d,"react-draggable-dragging":Te,dropping:!!v,cssTransforms:E}),style:{...O,..._r,...nr(zt)}});const Qe=G;return Me=p.jsx(N3.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:k,resizeHandles:J,handle:Qe,children:Me}),Me=p.jsx(S3.DraggableCore,{disabled:!d,onStart:un,onDrag:ie,onStop:pe,handle:A,cancel:".react-resizable-handle"+(P?","+P:""),scale:k,nodeRef:tt,children:Me}),Me}var ys=()=>{},ay="react-grid-layout",Dx=!1;try{Dx=/firefox/i.test(navigator.userAgent)}catch{}function q3(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],u=r[a];if((o==null?void 0:o.key)!==(u==null?void 0:u.key))return!1}return!0}function iy(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:$0(a),w:1,h:1})}});const u=VN(a,{cols:n});return r.compact(u,n)}function $3(e){const{children:t,width:n,gridConfig:r,dragConfig:a,resizeConfig:o,dropConfig:u,positionStrategy:c=u3,compactor:d,constraints:h=Lc,layout:m=[],droppingItem:g,autoSize:E=!0,className:x="",style:k={},innerRef:S,onLayoutChange:w=ys,onDragStart:v=ys,onDrag:C=ys,onDragStop:O=ys,onResizeStart:A=ys,onResize:P=ys,onResizeStop:_=ys,onDrop:N=ys,onDropDragOver:I=ys}=e,F=L.useMemo(()=>({...l3,...r}),[r]),j=L.useMemo(()=>({...c3,...a}),[a]),M=L.useMemo(()=>({...d3,...o}),[o]),H=L.useMemo(()=>({...f3,...u}),[u]),{cols:$,rowHeight:Q,maxRows:J,margin:G,containerPadding:re}=F,{enabled:Z,bounded:K,handle:R,cancel:ue,threshold:oe}=j,{enabled:U,handles:Oe,handleComponent:Le}=M,{enabled:Te,defaultItem:Ze,onDragOver:$e}=H,Ge=d??mx("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??G,[mn,tr]=L.useState(!1),[it,nt]=L.useState(()=>iy(m,t,$,Ge)),[Et,Nt]=L.useState(null),[on,nr]=L.useState(!1),[un,ie]=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 Ce=!Ri(m,_n.current),Ye=!q3(t,Un.current),Pe=tt!==At.current;if(Ce||Ye||Pe){const dt=iy(Ce?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 Ce=it.filter(Ye=>Ye.i!==Gt.i);w(Ce)}},[it,Et,w,Gt.i]);const ln=L.useMemo(()=>{if(!E)return;const Ce=$0(it),Ye=nn[1];return Ce*Q+(Ce-1)*G[1]+Ye*2+"px"},[E,it,Q,G,nn]),_r=L.useCallback((Ce,Ye,Pe,rt)=>{const dt=yt.current,ot=Ra(dt,Ce);if(!ot)return;const xt={w:ot.w,h:ot.h,x:ot.x,y:ot.y,i:Ce};He.current=ei(ot),gt.current=dt,Nt(xt),v(dt,ot,ot,null,rt.e,rt.node)},[v]),Me=L.useCallback((Ce,Ye,Pe,rt)=>{const dt=yt.current,ot=He.current,xt=Ra(dt,Ce);if(!xt)return;const Tt={w:xt.w,h:xt.h,x:xt.x,y:xt.y,i:Ce},bt=Fa(dt,xt,Ye,Pe,!0,pn,tt,$,We);C(bt,ot,xt,Tt,rt.e,rt.node),nt(Ge.compact(bt,$)),Nt(Tt)},[pn,tt,$,We,Ge,C]),Qe=L.useCallback((Ce,Ye,Pe,rt)=>{if(!Et)return;const dt=yt.current,ot=He.current,xt=Ra(dt,Ce);if(!xt)return;const Tt=Fa(dt,xt,Ye,Pe,!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((Ce,Ye,Pe,rt)=>{const dt=yt.current,ot=Ra(dt,Ce);ot&&(Ve.current=ei(ot),gt.current=dt,nr(!0),A(dt,ot,ot,null,rt.e,rt.node))},[A]),_e=L.useCallback((Ce,Ye,Pe,rt)=>{const dt=yt.current,ot=Ve.current,{handle:xt}=rt;let Tt=!1,bt,cn;const[oi,fr]=$N(dt,Ce,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-Pe),Pe=vt.y!==cn&&cn<0?vt.h:Pe,cn=cn<0?0:cn),Tt=!0),pn&&!We&&ox(dt,{...vt,w:Ye,h:Pe,x:bt??vt.x,y:cn??vt.y}).filter(ui=>ui.i!==vt.i).length>0&&(cn=vt.y,Pe=vt.h,bt=vt.x,Ye=vt.w,Tt=!1),vt.w=Ye,vt.h=Pe,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:Ce,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((Ce,Ye,Pe,rt)=>{const dt=yt.current,ot=Ve.current,xt=Ra(dt,Ce),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]),ke=L.useCallback(()=>{const Ce=yt.current;if(!Ce.some(rt=>rt.i===Gt.i)){ie(null),Nt(null),De(void 0);return}const Pe=Ge.compact(Ce.filter(rt=>rt.i!==Gt.i),$);nt(Pe),ie(null),Nt(null),De(void 0)},[Gt.i,$,Ge]),It=L.useCallback(Ce=>{var Zu;if(Ce.preventDefault(),Ce.stopPropagation(),Dx&&!((Zu=Ce.nativeEvent.target)!=null&&Zu.classList.contains(ay)))return!1;const Ye=$e?$e(Ce.nativeEvent):I(Ce);if(Ye===!1)return un&&ke(),!1;const{dragOffsetX:Pe=0,dragOffsetY:rt=0,...dt}=Ye??{},ot={...Gt,...dt},xt=Ce.currentTarget.getBoundingClientRect(),Tt={cols:$,margin:G,maxRows:J,rowHeight:Q,containerWidth:n,containerPadding:nn},bt=ho(Tt),cn=ro(ot.w,bt,G[0]),oi=ro(ot.h,Q,G[1]),fr=cn/2,Os=oi/2,ba=Ce.clientX-xt.left+Pe-fr,vt=Ce.clientY-xt.top+rt-Os,Eo=Math.max(0,ba),ui=Math.max(0,vt),wt={left:Eo/tn,top:ui/tn,e:Ce.nativeEvent};if(un)pe&&(pe.left!==wt.left||pe.top!==wt.top)&&De(wt);else{const Ea=zN(Tt,ui,Eo,ot.w,ot.h);ie(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,ke,tn,$,G,J,Q,n,nn]),Wt=L.useCallback(Ce=>{Ce.preventDefault(),Ce.stopPropagation(),zt.current--,zt.current<0&&(zt.current=0),zt.current===0&&ke()},[ke]),Yt=L.useCallback(Ce=>{Ce.preventDefault(),Ce.stopPropagation(),zt.current++},[]),Rt=L.useCallback(Ce=>{Ce.preventDefault(),Ce.stopPropagation();const Ye=yt.current,Pe=Ye.find(rt=>rt.i===Gt.i);zt.current=0,ke(),N(Ye,Pe,Ce.nativeEvent)},[Gt.i,ke,N]),qt=L.useCallback((Ce,Ye)=>{if(!Ce||!Ce.key)return null;const Pe=Ra(it,String(Ce.key));if(!Pe)return null;const rt=typeof Pe.isDraggable=="boolean"?Pe.isDraggable:!Pe.static&&Z,dt=typeof Pe.isResizable=="boolean"?Pe.isResizable:!Pe.static&&U,ot=Pe.resizeHandles||[...Oe],xt=rt&&K&&Pe.isBounded!==!1,Tt=Le;return p.jsx(sy,{containerWidth:n,cols:$,margin:G,containerPadding:nn,maxRows:J,rowHeight:Q,cancel:ue,handle:R,onDragStart:_r,onDrag:Me,onDragStop:Qe,onResizeStart:be,onResize:_e,onResizeStop:Je,isDraggable:rt,isResizable:dt,isBounded:xt,useCSSTransforms:Hn&&mn,usePercentages:!mn,transformScale:tn,positionStrategy:c,dragThreshold:oe,w:Pe.w,h:Pe.h,x:Pe.x,y:Pe.y,i:Pe.i,minH:Pe.minH,minW:Pe.minW,maxH:Pe.maxH,maxW:Pe.maxW,static:Pe.static,droppingPosition:Ye?pe:void 0,resizeHandles:ot,resizeHandle:Tt,constraints:h,layoutItem:Pe,layout:it,children:Ce},Pe.i)},[it,n,$,G,nn,J,Q,ue,R,_r,Me,Qe,be,_e,Je,Z,U,K,Hn,mn,tn,c,oe,pe,Oe,Le,h]),kn=()=>Et?p.jsx(sy,{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:G,containerPadding:nn,maxRows:J,rowHeight:Q,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:Hn,transformScale:tn,constraints:h,layout:it,children:p.jsx("div",{})}):null,zn=Bn(ay,x),Ur={height:ln,...k};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,Ce=>Ee.isValidElement(Ce)?qt(Ce):null),Te&&un&&qt(un,!0),kn()]})}function Ax(e){const{children:t,width:n,cols:r=12,rowHeight:a=150,maxRows:o=1/0,margin:u=[10,10],containerPadding:c=null,layout:d,droppingItem:h,compactType:m,preventCollision:g=!1,allowOverlap:E=!1,verticalCompact:x,isDraggable:k=!0,isBounded:S=!1,draggableHandle:w,draggableCancel:v,isResizable:C=!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:Q,onDragStop:J,onResizeStart:G,onResize:re,onResizeStop:Z,onDrop:K,onDropDragOver:R}=e;let ue=m===void 0?"vertical":m;x===!1&&(ue=null);const oe={cols:r,rowHeight:a,maxRows:o,margin:u,containerPadding:c},U={enabled:k,bounded:S,handle:w,cancel:v,threshold:0},Oe={enabled:C,handles:O,handleComponent:A},Le={enabled:P};let Te;_?N!==1?Te=o3(N):Te=dx:Te=i3;const Ze=mx(ue,E,g),$e=S?[...Lc,XN]:Lc;return p.jsx($3,{width:n,gridConfig:oe,dragConfig:U,resizeConfig:Oe,dropConfig:Le,positionStrategy:Te,compactor:Ze,constraints:$e,layout:d,droppingItem:h,autoSize:I,className:F,style:j,innerRef:M,onLayoutChange:H,onDragStart:$,onDrag:Q,onDragStop:J,onResizeStart:G,onResize:re,onResizeStop:Z,onDrop:K,onDropDragOver:R,children:t})}Ax.displayName="ReactGridLayout";var oy=Ax;function hh(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 V3(e,t){const n=e>=0?"+":"";return t==="percent_change"?`${n}${e.toFixed(1)}%`:`${n}${e.toLocaleString()}`}function Q3({chartRef:e}){var C,O,A,P;const{data:t}=$b(e),{data:n,isLoading:r,error:a,isFetching:o}=Qb(e),u=N0(),c=()=>{u(e)},d=()=>{if(!n||!t)return;const _=t.name||e;qc(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)return p.jsx(Ic,{isLoading:!1,error:a,data:void 0,onRetry:c,children:p.jsx("div",{})});if(!((C=n==null?void 0:n.rows)!=null&&C[0]))return p.jsx("div",{className:"h-full flex items-center justify-center text-gray-400 text-sm",children:"No data available"});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=hh(g,m.format);let x=null,k="percent_change",S,w,v;if(n.comparison)x=n.comparison.change,k=n.comparison.changeType,S=n.comparison.currentPeriodLabel,w=n.comparison.previousPeriodLabel,v=hh(n.comparison.previousValue,m.format);else if((A=m.comparison)!=null&&A.enabled&&m.comparison.field){const _=h[m.comparison.field];k=m.comparison.type,_&&_!==0&&(k==="percent_change"?x=(g-_)/_*100:x=g-_,v=hh(_,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(sx,{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:V3(x,k)}),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 G3({chartRef:e}){var re,Z,K,R,ue;const{data:t,isLoading:n,isFetching:r,error:a}=Bw(e),{data:o}=io(),u=t==null?void 0:t.config,c=t,d=N0(),h=L.useRef(null),[m,g]=L.useState(!1),E=qe(oe=>oe.chartFilters),x=qe(oe=>oe.resetChartFilters),k=qe(oe=>oe.crossFilters),S=qe(oe=>oe.setCrossFilter),w=E[e]&&Object.keys(E[e]).length>0,v=L.useCallback((oe,U)=>{S(oe,U,e)},[S,e]),C=L.useMemo(()=>{for(const oe of Object.values(k))if(oe.sourceChart===e)return{field:oe.field,value:oe.value};return null},[k,e]),[O,A]=L.useState(null),P=L.useCallback((oe,U,Oe)=>{var Le;(Le=u==null?void 0:u.drillDown)!=null&&Le.chart&&A({x:Oe.x,y:Oe.y,field:oe,value:U})},[(re=u==null?void 0:u.drillDown)==null?void 0:re.chart]),_=L.useCallback(()=>{var Oe,Le;if(!O||!((Oe=u==null?void 0:u.drillDown)!=null&&Oe.chart))return;const oe=u.drillDown.field??((Le=u.chart.x)==null?void 0:Le.field)??O.field,U=new URLSearchParams({[oe]:O.value,_from:e});window.location.hash=`/charts/${u.drillDown.chart}?${U.toString()}`,A(null)},[O,u,e]),N=()=>{d(e)},I=()=>{x(e),g(!1)},F=()=>{if(!c||!u)return;const oe=u.name||e;qc(c.rows,c.columns,oe)},j=()=>{var U;const oe=(U=h.current)==null?void 0:U.getDataURL("png");oe&&u&&Ac(oe,`${u.name||e}.png`)},M=()=>{var U;const oe=(U=h.current)==null?void 0:U.getDataURL("svg");oe&&u&&Ac(oe,`${u.name||e}.svg`)},H=async()=>{var U;const oe=(U=h.current)==null?void 0:U.getDataURL("png");oe&&u&&await bN(oe,u.name||e,u.title)};if(!u&&a)return p.jsx(Ic,{isLoading:!1,error:a,data:void 0,onRetry:()=>d(e),children:p.jsx("div",{})});if(!u||!c)return n?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"})}):p.jsxs("div",{className:"h-full flex items-center justify-center text-gray-400 text-sm",children:["Chart not found: ",e]});if(((Z=u.chart)==null?void 0:Z.type)==="kpi")return p.jsx(Q3,{chartRef:e});const $=["line","bar","area","pie","donut","scatter","combo","heatmap","funnel","waterfall","gauge"].includes(u.chart.type),Q=(K=u==null?void 0:u.drillDown)!=null&&K.chart?P:void 0,J=()=>{switch(u.chart.type){case"line":return!u.chart.x||!u.chart.y&&!u.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:h,data:c.rows,columns:c.columns,xAxis:u.chart.x,yAxis:u.chart.y,chartConfig:u.chart,theme:o==null?void 0:o.theme,height:"100%",loading:r,onCrossFilter:v,activeCrossFilter:C,onDrillDown:Q});case"bar":return!u.chart.x||!u.chart.y&&!u.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:h,data:c.rows,xAxis:u.chart.x,yAxis:u.chart.y,chartConfig:u.chart,theme:o==null?void 0:o.theme,height:"100%",loading:r,onCrossFilter:v,activeCrossFilter:C,onDrillDown:Q});case"area":return!u.chart.x||!u.chart.y&&!u.chart.series?p.jsx("div",{className:"h-full flex items-center justify-center text-gray-400 text-sm",children:"Missing axis configuration"}):p.jsx(GE,{ref:h,data:c.rows,xAxis:u.chart.x,yAxis:u.chart.y,chartConfig:u.chart,theme:o==null?void 0:o.theme,height:"100%",loading:r,onCrossFilter:v,activeCrossFilter:C,onDrillDown:Q});case"pie":return!u.chart.x||!u.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:h,data:c.rows,xAxis:u.chart.x,yAxis:u.chart.y,chartConfig:u.chart,theme:o==null?void 0:o.theme,height:"100%",loading:r,onCrossFilter:v,activeCrossFilter:C,onDrillDown:Q});case"donut":return!u.chart.x||!u.chart.y?p.jsx("div",{className:"h-full flex items-center justify-center text-gray-400 text-sm",children:"Missing axis configuration"}):p.jsx(KE,{ref:h,data:c.rows,xAxis:u.chart.x,yAxis:u.chart.y,centerValue:u.chart.centerValue,chartConfig:u.chart,theme:o==null?void 0:o.theme,height:"100%",loading:r,onCrossFilter:v,activeCrossFilter:C,onDrillDown:Q});case"scatter":return!u.chart.x||!u.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:h,data:c.rows,xAxis:u.chart.x,yAxis:u.chart.y,chartConfig:u.chart,theme:o==null?void 0:o.theme,height:"100%",loading:r});case"table":return p.jsx(t0,{data:c.rows,columns:c.columns,chartConfig:u.chart,height:"100%",loading:r});case"metric":return u.chart.y?p.jsx(MN,{data:c.rows,yAxis:u.chart.y,title:u.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 u.chart.x?p.jsx(ZE,{ref:h,data:c.rows,xAxis:u.chart.x,chartConfig:u.chart,theme:o==null?void 0:o.theme,height:"100%",loading:r,onCrossFilter:v,activeCrossFilter:C,onDrillDown:Q}):p.jsx("div",{className:"h-full flex items-center justify-center text-gray-400 text-sm",children:"Missing axis configuration"});case"heatmap":return!u.chart.x||!u.chart.y?p.jsx("div",{className:"h-full flex items-center justify-center text-gray-400 text-sm",children:"Missing axis configuration"}):p.jsx(ex,{ref:h,data:c.rows,chartConfig:u.chart,height:"100%",loading:r});case"funnel":return p.jsx(tx,{ref:h,data:c.rows,chartConfig:u.chart,height:"100%",loading:r});case"waterfall":return p.jsx(nx,{ref:h,data:c.rows,chartConfig:u.chart,height:"100%",loading:r});case"gauge":return p.jsx(rx,{ref:h,data:c.rows,chartConfig:u.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 "',u.chart.type,'" not yet implemented']})}},G=u.parameters&&u.parameters.length>0;return p.jsx(Y0,{fallback:(oe,U)=>p.jsx("div",{className:"h-full flex items-center justify-center p-4",children:p.jsxs("div",{className:"text-center",children:[p.jsx("p",{className:"text-sm font-medium text-red-600",children:"Failed to render chart"}),p.jsx("p",{className:"text-xs text-gray-500 mt-1",children:oe.message}),p.jsx("button",{onClick:U,className:"mt-2 text-xs text-blue-600 hover:text-blue-700",children:"Retry"})]})}),resetKey:e,children: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:u.title}),((R=u==null?void 0:u.drillDown)==null?void 0:R.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"})]}),w&&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:[G&&p.jsx("button",{onClick:()=>g(!m),className:`p-1.5 rounded hover:bg-gray-100 ${m?"bg-gray-100":""}`,title:m?"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(sx,{onRefresh:N,onExportCSV:F,onExportPNG:$?j:F,onExportSVG:$?M:F,onExportPDF:$?H:void 0,isRefreshing:r})]})]}),m&&G&&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(YE,{parameters:u.parameters,chartName:e}),w&&p.jsx("button",{onClick:I,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:p.jsx(Ic,{isLoading:n,error:a,data:c==null?void 0:c.rows,onRetry:()=>d(e),children:J()})}),O&&((ue=u==null?void 0:u.drillDown)==null?void 0:ue.chart)&&p.jsx(ax,{x:O.x,y:O.y,targetChartTitle:u.drillDown.chart,onDrillDown:_,onClose:()=>A(null)})]})})}var Ix=Hc();function uy(e){const t=[],n=String(e||"");let r=n.indexOf(","),a=0,o=!1;for(;!o;){r===-1&&(r=n.length,o=!0);const u=n.slice(a,r).trim();(u||!o)&&t.push(u),a=r+1,r=n.indexOf(",",a)}return t}function Rx(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const X3=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,K3=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,J3={};function ly(e,t){return(J3.jsx?K3:X3).test(e)}const Z3=/[ \t\n\f\r]/g;function eO(e){return typeof e=="object"?e.type==="text"?cy(e.value):!1:cy(e)}function cy(e){return e.replace(Z3,"")===""}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 Lx(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 tO=0;const Xe=ai(),an=ai(),r0=ai(),me=ai(),kt=ai(),Fi=ai(),or=ai();function ai(){return 2**++tO}const s0=Object.freeze(Object.defineProperty({__proto__:null,boolean:Xe,booleanish:an,commaOrSpaceSeparated:or,commaSeparated:Fi,number:me,overloadedBoolean:r0,spaceSeparated:kt},Symbol.toStringTag,{value:"Module"})),ph=Object.keys(s0);class tp extends er{constructor(t,n,r,a){let o=-1;if(super(t,n),dy(this,"space",a),typeof r=="number")for(;++o<ph.length;){const u=ph[o];dy(this,ph[o],(r&s0[u])===s0[u])}}}tp.prototype.defined=!0;function dy(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 tp(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 Mx=po({properties:{ariaActiveDescendant:null,ariaAtomic:an,ariaAutoComplete:null,ariaBusy:an,ariaChecked:an,ariaColCount:me,ariaColIndex:me,ariaColSpan:me,ariaControls:kt,ariaCurrent:null,ariaDescribedBy:kt,ariaDetails:null,ariaDisabled:an,ariaDropEffect:kt,ariaErrorMessage:null,ariaExpanded:an,ariaFlowTo:kt,ariaGrabbed:an,ariaHasPopup:null,ariaHidden:an,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:kt,ariaLevel:me,ariaLive:null,ariaModal:an,ariaMultiLine:an,ariaMultiSelectable:an,ariaOrientation:null,ariaOwns:kt,ariaPlaceholder:null,ariaPosInSet:me,ariaPressed:an,ariaReadOnly:an,ariaRelevant:null,ariaRequired:an,ariaRoleDescription:kt,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 Px(e,t){return t in e?e[t]:t}function Fx(e,t){return Px(e,t.toLowerCase())}const nO=po({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Fi,acceptCharset:kt,accessKey:kt,action:null,allow:null,allowFullScreen:Xe,allowPaymentRequest:Xe,allowUserMedia:Xe,alt:null,as:null,async:Xe,autoCapitalize:null,autoComplete:kt,autoFocus:Xe,autoPlay:Xe,blocking:kt,capture:null,charSet:null,checked:Xe,cite:null,className:kt,cols:me,colSpan:null,content:null,contentEditable:an,controls:Xe,controlsList:kt,coords:me|Fi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Xe,defer:Xe,dir:null,dirName:null,disabled:Xe,download:r0,draggable:an,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Xe,formTarget:null,headers:kt,height:me,hidden:r0,high:me,href:null,hrefLang:null,htmlFor:kt,httpEquiv:kt,id:null,imageSizes:null,imageSrcSet:null,inert:Xe,inputMode:null,integrity:null,is:null,isMap:Xe,itemId:null,itemProp:kt,itemRef:kt,itemScope:Xe,itemType:kt,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:kt,placeholder:null,playsInline:Xe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Xe,referrerPolicy:null,rel:kt,required:Xe,reversed:Xe,rows:me,rowSpan:me,sandbox:kt,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:kt,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:Fx}),rO=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:kt,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:kt,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:Px}),jx=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()}}),Bx=po({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Fx}),Hx=po({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),sO={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"},aO=/[A-Z]/g,fy=/-[a-z]/g,iO=/^data[-\w.:]+$/i;function rd(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"&&iO.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(fy,uO);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!fy.test(o)){let u=o.replace(aO,oO);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}a=tp}return new a(r,t)}function oO(e){return"-"+e.toLowerCase()}function uO(e){return e.charAt(1).toUpperCase()}const Gu=Lx([Mx,nO,jx,Bx,Hx],"html"),ga=Lx([Mx,rO,jx,Bx,Hx],"svg");function hy(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Ux(e){return e.join(" ").trim()}var Li={},mh,py;function lO(){if(py)return mh;py=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
|
|
95
|
-
`,h="/",m="*",g="",E="comment",x="declaration";function k(w,v){if(typeof w!="string")throw new TypeError("First argument must be a string");if(!w)return[];v=v||{};var C=1,O=1;function A(Q){var J=Q.match(t);J&&(C+=J.length);var G=Q.lastIndexOf(d);O=~G?Q.length-G:O+Q.length}function P(){var Q={line:C,column:O};return function(J){return J.position=new _(Q),F(),J}}function _(Q){this.start=Q,this.end={line:C,column:O},this.source=v.source}_.prototype.content=w;function N(Q){var J=new Error(v.source+":"+C+":"+O+": "+Q);if(J.reason=Q,J.filename=v.source,J.line=C,J.column=O,J.source=w,!v.silent)throw J}function I(Q){var J=Q.exec(w);if(J){var G=J[0];return A(G),w=w.slice(G.length),J}}function F(){I(n)}function j(Q){var J;for(Q=Q||[];J=M();)J!==!1&&Q.push(J);return Q}function M(){var Q=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 G=w.slice(2,J-2);return O+=2,A(G),w=w.slice(J),O+=2,Q({type:E,comment:G})}}function H(){var Q=P(),J=I(r);if(J){if(M(),!I(a))return N("property missing ':'");var G=I(o),re=Q({type:x,property:S(J[0].replace(e,g)),value:G?S(G[0].replace(e,g)):g});return I(u),re}}function $(){var Q=[];j(Q);for(var J;J=H();)J!==!1&&(Q.push(J),j(Q));return Q}return F(),$()}function S(w){return w?w.replace(c,g):g}return mh=k,mh}var my;function cO(){if(my)return Li;my=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(lO());function n(r,a){let o=null;if(!r||typeof r!="string")return o;const u=(0,t.default)(r),c=typeof a=="function";return u.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={},gy;function dO(){if(gy)return du;gy=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)},u=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,u))};return du.camelCase=d,du}var fu,yy;function fO(){if(yy)return fu;yy=1;var e=fu&&fu.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(cO()),n=dO();function r(a,o){var u={};return!a||typeof a!="string"||(0,t.default)(a,function(c,d){c&&d&&(u[(0,n.camelCase)(c,o)]=d)}),u}return r.default=r,fu=r,fu}var hO=fO();const pO=_b(hO),sd=zx("end"),us=zx("start");function zx(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 mO(e){const t=us(e),n=sd(e);if(t&&n)return{start:t,end:n}}function xu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?by(e.position):"start"in e||"end"in e?by(e):"line"in e||"column"in e?a0(e):""}function a0(e){return Ey(e&&e.line)+":"+Ey(e&&e.column)}function by(e){return a0(e&&e.start)+"-"+a0(e&&e.end)}function Ey(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={},u=!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&&(u=!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=u&&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 np={}.hasOwnProperty,gO=new Map,yO=/[A-Z]/g,bO=new Set(["table","tbody","thead","tfoot","tr"]),EO=new Set(["td","th"]),Wx="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function xO(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=NO(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=CO(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=Yx(a,e,void 0);return o&&typeof o!="string"?o:a.create(e,a.Fragment,{children:o||void 0},void 0)}function Yx(e,t,n){if(t.type==="element")return TO(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return vO(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return SO(e,t,n);if(t.type==="mdxjsEsm")return wO(e,t);if(t.type==="root")return _O(e,t,n);if(t.type==="text")return kO(e,t)}function TO(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=$x(e,t.tagName,!1),u=OO(e,t);let c=sp(e,t);return bO.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!eO(d):!0})),qx(e,u,o,t),rp(u,c),e.ancestors.pop(),e.schema=r,e.create(t,o,u,n)}function vO(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 wO(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Iu(e,t.position)}function SO(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:$x(e,t.name,!0),u=DO(e,t),c=sp(e,t);return qx(e,u,o,t),rp(u,c),e.ancestors.pop(),e.schema=r,e.create(t,o,u,n)}function _O(e,t,n){const r={};return rp(r,sp(e,t)),e.create(t,e.Fragment,r,n)}function kO(e,t){return t.value}function qx(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function rp(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function CO(e,t,n){return r;function r(a,o,u,c){const h=Array.isArray(u.children)?n:t;return c?h(o,u,c):h(o,u)}}function NO(e,t){return n;function n(r,a,o,u){const c=Array.isArray(o.children),d=us(r);return t(a,o,u,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function OO(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&np.call(t.properties,a)){const o=AO(e,a,t.properties[a]);if(o){const[u,c]=o;e.tableCellAlignToStyle&&u==="align"&&typeof c=="string"&&EO.has(t.tagName)?r=c:n[u]=c}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function DO(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 u=o.expression;u.type;const c=u.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 sp(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:gO;for(;++r<t.children.length;){const o=t.children[r];let u;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;u=d+"-"+h,a.set(d,h+1)}}const c=Yx(e,o,u);c!==void 0&&n.push(c)}return n}function AO(e,t,n){const r=rd(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Rx(n):Ux(n)),r.property==="style"){let a=typeof n=="object"?n:IO(e,String(n));return e.stylePropertyNameCase==="css"&&(a=RO(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?sO[r.property]||r.property:r.attribute,n]}}function IO(e,t){try{return pO(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=Wx+"#cannot-parse-style-attribute",a}}function $x(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let o=-1,u;for(;++o<a.length;){const c=ly(a[o])?{type:"Identifier",name:a[o]}:{type:"Literal",value:a[o]};u=u?{type:"MemberExpression",object:u,property:c,computed:!!(o&&c.type==="Literal"),optional:!1}:c}r=u}else r=ly(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return np.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=Wx+"#cannot-handle-mdx-estrees-without-createevaluater",n}function RO(e){const t={};let n;for(n in e)np.call(e,n)&&(t[LO(n)]=e[n]);return t}function LO(e){let t=e.replace(yO,MO);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function MO(e){return"-"+e.toLowerCase()}const gh={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"]},PO={};function FO(e,t){const n=PO,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Vx(e,r,a)}function Vx(e,t,n){if(jO(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 xy(e.children,t,n)}return Array.isArray(e)?xy(e,t,n):""}function xy(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=Vx(e[a],t,n);return r.join("")}function jO(e){return!!(e&&typeof e=="object")}const Ty=document.createElement("i");function ap(e){const t="&"+e+";";Ty.innerHTML=t;const n=Ty.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,u;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)u=Array.from(r),u.unshift(t,n),e.splice(...u);else for(n&&e.splice(t,n);o<r.length;)u=r.slice(o,o+1e4),u.unshift(t,0),e.splice(...u),o+=1e4,t+=1e4}function wr(e,t){return e.length>0?(as(e,e.length,0,t),e):t}const vy={}.hasOwnProperty;function BO(e){const t={};let n=-1;for(;++n<e.length;)HO(t,e[n]);return t}function HO(e,t){let n;for(n in t){const a=(vy.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let u;if(o)for(u in o){vy.call(a,u)||(a[u]=[]);const c=o[u];UO(a[u],Array.isArray(c)?c:c?[c]:[])}}}function UO(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 Qx(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]/),zO=ya(/[#-'*+\--9=?A-Z^-~]/);function i0(e){return e!==null&&(e<32||e===127)}const o0=ya(/\d/),WO=ya(/[\dA-Fa-f]/),YO=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 qO=ya(new RegExp("\\p{P}|\\p{S}","u")),$O=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 u="";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))||(u=String.fromCharCode(o));else if(o>55295&&o<57344){const c=e.charCodeAt(n+1);o<56320&&c>56319&&c<57344?(u=String.fromCharCode(o,c),a=1):u="�"}else u=String.fromCharCode(o);u&&(t.push(e.slice(r,n),encodeURIComponent(u)),r=n+a+1,u=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function Ct(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let o=0;return u;function u(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 VO={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"),Ct(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,u(c)}function u(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),u)}}const GO={tokenize:XO},wy={tokenize:KO};function XO(e){const t=this,n=[];let r=0,a,o,u;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&&C();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 k(O);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(wy,m,g)(O)}function m(O){return a&&C(),v(r),E(O)}function g(O){return t.parser.lazy[t.now().line]=r!==n.length,u=t.now().offset,k(O)}function E(O){return t.containerState={},e.attempt(wy,x,k)(O)}function x(O){return r++,n.push([t.currentConstruct,t.containerState]),E(O)}function k(O){if(O===null){a&&C(),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<u&&(!a.events[_][1].end||a.events[_][1].end.offset>u))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 C(){a.write([null]),o=void 0,a=void 0,t.containerState._closeFlow=void 0}}function KO(e,t,n){return Ct(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Sy(e){if(e===null||Zn(e)||$O(e))return 1;if(qO(e))return 2}function ip(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 u0={name:"attention",resolveAll:JO,tokenize:ZO};function JO(e,t){let n=-1,r,a,o,u,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};_y(g,-d),_y(E,d),u={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:{...u.start},end:{...c.end}},e[r][1].end={...u.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",u,t],["exit",u,t],["enter",o,t]]),h=wr(h,ip(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 ZO(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=Sy(r);let o;return u;function u(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=Sy(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 _y(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const eD={name:"autolink",tokenize:tD};function tD(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),u):x===64?n(x):h(x)}function u(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||i0(x)?n(x):(e.consume(x),d)}function h(x){return x===64?(e.consume(x),m):zO(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 k=x===45?E:g;return e.consume(x),k}return n(x)}}const ad={partial:!0,tokenize:nD};function nD(e,t,n){return r;function r(o){return lt(o)?Ct(e,a,"linePrefix")(o):a(o)}function a(o){return o===null||ze(o)?t(o):n(o)}}const Gx={continuation:{tokenize:sD},exit:aD,name:"blockQuote",tokenize:rD};function rD(e,t,n){const r=this;return a;function a(u){if(u===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),o}return n(u)}function o(u){return lt(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function sD(e,t,n){const r=this;return a;function a(u){return lt(u)?Ct(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):o(u)}function o(u){return e.attempt(Gx,t,n)(u)}}function aD(e){e.exit("blockQuote")}const Xx={name:"characterEscape",tokenize:iD};function iD(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 YO(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Kx={name:"characterReference",tokenize:oD};function oD(e,t,n){const r=this;let a=0,o,u;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,u=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,u=WO,m):(e.enter("characterReferenceValue"),o=7,u=o0,m(g))}function m(g){if(g===59&&a){const E=e.exit("characterReferenceValue");return u===cr&&!ap(r.sliceSerialize(E))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(g)&&a++<o?(e.consume(g),m):n(g)}}const ky={partial:!0,tokenize:lD},Cy={concrete:!0,name:"codeFenced",tokenize:uD};function uD(e,t,n){const r=this,a={partial:!0,tokenize:P};let o=0,u=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?(u++,e.consume(_),m):u<3?n(_):(e.exit("codeFencedFenceSequence"),lt(_)?Ct(e,g,"whitespace")(_):g(_))}function g(_){return _===null||ze(_)?(e.exit("codeFencedFence"),r.interrupt?t(_):e.check(ky,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"),Ct(e,x,"whitespace")(_)):_===96&&_===c?n(_):(e.consume(_),E)}function x(_){return _===null||ze(_)?g(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(_))}function k(_){return _===null||ze(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(_)):_===96&&_===c?n(_):(e.consume(_),k)}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&<(_)?Ct(e,C,"linePrefix",o+1)(_):C(_)}function C(_){return _===null||ze(_)?e.check(ky,S,A)(_):(e.enter("codeFlowValue"),O(_))}function O(_){return _===null||ze(_)?(e.exit("codeFlowValue"),C(_)):(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)?Ct(_,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>=u?(_.exit("codeFencedFenceSequence"),lt(J)?Ct(_,Q,"whitespace")(J):Q(J)):I(J)}function Q(J){return J===null||ze(J)?(_.exit("codeFencedFence"),N(J)):I(J)}}}function lD(e,t,n){const r=this;return a;function a(u){return u===null?n(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o)}function o(u){return r.parser.lazy[r.now().line]?n(u):t(u)}}const yh={name:"codeIndented",tokenize:dD},cD={partial:!0,tokenize:fD};function dD(e,t,n){const r=this;return a;function a(h){return e.enter("codeIndented"),Ct(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?u(h):n(h)}function u(h){return h===null?d(h):ze(h)?e.attempt(cD,u,d)(h):(e.enter("codeFlowValue"),c(h))}function c(h){return h===null||ze(h)?(e.exit("codeFlowValue"),u(h)):(e.consume(h),c)}function d(h){return e.exit("codeIndented"),t(h)}}function fD(e,t,n){const r=this;return a;function a(u){return r.parser.lazy[r.now().line]?n(u):ze(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),a):Ct(e,o,"linePrefix",5)(u)}function o(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(u):ze(u)?a(u):n(u)}}const hD={name:"codeText",previous:mD,resolve:pD,tokenize:gD};function pD(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 mD(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function gD(e,t,n){let r=0,a,o;return u;function u(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 yD{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 Jx(e){const t={};let n=-1,r,a,o,u,c,d,h;const m=new yD(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,bD(m,n)),n=t[n],h=!0);else if(r[1]._container){for(o=n,a=void 0;o--;)if(u=m.get(o),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(a&&(m.get(a)[1].type="lineEndingBlank"),u[1].type="lineEnding",a=o);else if(!(u[1].type==="linePrefix"||u[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 bD(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const o=[];let u=n._tokenizer;u||(u=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const c=u.events,d=[],h={};let m,g,E=-1,x=n,k=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&&u.defineSkip(x.start),x._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(m),x._isInFirstContentOfListItem&&(u._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(u.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]),C=o.pop();d.push([C,C+v.length-1]),e.splice(C,2,v)}for(d.reverse(),E=-1;++E<d.length;)h[k+d[E][0]]=k+d[E][1],k+=d[E][1]-d[E][0]-1;return h}const ED={resolve:TD,tokenize:vD},xD={partial:!0,tokenize:wD};function TD(e){return Jx(e),e}function vD(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(xD,u,o)(c):(e.consume(c),a)}function o(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function u(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function wD(e,t,n){const r=this;return a;function a(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Ct(e,o,"linePrefix")}function o(u){if(u===null||ze(u))return n(u);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(u):e.interrupt(r.parser.constructs.flow,n,t)(u)}}function Zx(e,t,n,r,a,o,u,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||i0(v)?n(v):(e.enter(r),e.enter(u),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?k:x)}function k(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(u),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||i0(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 e2(e,t,n,r,a,o){const u=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 u.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 t2(e,t,n,r,a,o){let u;return c;function c(E){return E===34||E===39||E===40?(e.enter(r),e.enter(a),e.consume(E),e.exit(a),u=E===40?41:E,d):n(E)}function d(E){return E===u?(e.enter(a),e.consume(E),e.exit(a),e.exit(r),t):(e.enter(o),h(E))}function h(E){return E===u?(e.exit(o),d(u)):E===null?n(E):ze(E)?(e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),Ct(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(E))}function m(E){return E===u||E===null||ze(E)?(e.exit("chunkString"),h(E)):(e.consume(E),E===92?g:m)}function g(E){return E===u||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)?Ct(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const SD={name:"definition",tokenize:kD},_D={partial:!0,tokenize:CD};function kD(e,t,n){const r=this;let a;return o;function o(x){return e.enter("definition"),u(x)}function u(x){return e2.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 Zx(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function m(x){return e.attempt(_D,g,g)(x)}function g(x){return lt(x)?Ct(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 CD(e,t,n){return r;function r(c){return Zn(c)?Tu(e,a)(c):n(c)}function a(c){return t2(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function o(c){return lt(c)?Ct(e,u,"whitespace")(c):u(c)}function u(c){return c===null||ze(c)?t(c):n(c)}}const ND={name:"hardBreakEscape",tokenize:OD};function OD(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 DD={name:"headingAtx",resolve:AD,tokenize:ID};function AD(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 ID(e,t,n){let r=0;return a;function a(m){return e.enter("atxHeading"),o(m)}function o(m){return e.enter("atxHeadingSequence"),u(m)}function u(m){return m===35&&r++<6?(e.consume(m),u):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)?Ct(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 RD=["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"],Ny=["pre","script","style","textarea"],LD={concrete:!0,name:"htmlFlow",resolveTo:FD,tokenize:jD},MD={partial:!0,tokenize:HD},PD={partial:!0,tokenize:BD};function FD(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 jD(e,t,n){const r=this;let a,o,u,c,d;return h;function h(U){return m(U)}function m(U){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(U),g}function g(U){return U===33?(e.consume(U),E):U===47?(e.consume(U),o=!0,S):U===63?(e.consume(U),a=3,r.interrupt?t:R):ns(U)?(e.consume(U),u=String.fromCharCode(U),w):n(U)}function E(U){return U===45?(e.consume(U),a=2,x):U===91?(e.consume(U),a=5,c=0,k):ns(U)?(e.consume(U),a=4,r.interrupt?t:R):n(U)}function x(U){return U===45?(e.consume(U),r.interrupt?t:R):n(U)}function k(U){const Oe="CDATA[";return U===Oe.charCodeAt(c++)?(e.consume(U),c===Oe.length?r.interrupt?t:H:k):n(U)}function S(U){return ns(U)?(e.consume(U),u=String.fromCharCode(U),w):n(U)}function w(U){if(U===null||U===47||U===62||Zn(U)){const Oe=U===47,Le=u.toLowerCase();return!Oe&&!o&&Ny.includes(Le)?(a=1,r.interrupt?t(U):H(U)):RD.includes(u.toLowerCase())?(a=6,Oe?(e.consume(U),v):r.interrupt?t(U):H(U)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(U):o?C(U):O(U))}return U===45||cr(U)?(e.consume(U),u+=String.fromCharCode(U),w):n(U)}function v(U){return U===62?(e.consume(U),r.interrupt?t:H):n(U)}function C(U){return lt(U)?(e.consume(U),C):j(U)}function O(U){return U===47?(e.consume(U),j):U===58||U===95||ns(U)?(e.consume(U),A):lt(U)?(e.consume(U),O):j(U)}function A(U){return U===45||U===46||U===58||U===95||cr(U)?(e.consume(U),A):P(U)}function P(U){return U===61?(e.consume(U),_):lt(U)?(e.consume(U),P):O(U)}function _(U){return U===null||U===60||U===61||U===62||U===96?n(U):U===34||U===39?(e.consume(U),d=U,N):lt(U)?(e.consume(U),_):I(U)}function N(U){return U===d?(e.consume(U),d=null,F):U===null||ze(U)?n(U):(e.consume(U),N)}function I(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||Zn(U)?P(U):(e.consume(U),I)}function F(U){return U===47||U===62||lt(U)?O(U):n(U)}function j(U){return U===62?(e.consume(U),M):n(U)}function M(U){return U===null||ze(U)?H(U):lt(U)?(e.consume(U),M):n(U)}function H(U){return U===45&&a===2?(e.consume(U),G):U===60&&a===1?(e.consume(U),re):U===62&&a===4?(e.consume(U),ue):U===63&&a===3?(e.consume(U),R):U===93&&a===5?(e.consume(U),K):ze(U)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(MD,oe,$)(U)):U===null||ze(U)?(e.exit("htmlFlowData"),$(U)):(e.consume(U),H)}function $(U){return e.check(PD,Q,oe)(U)}function Q(U){return e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),J}function J(U){return U===null||ze(U)?$(U):(e.enter("htmlFlowData"),H(U))}function G(U){return U===45?(e.consume(U),R):H(U)}function re(U){return U===47?(e.consume(U),u="",Z):H(U)}function Z(U){if(U===62){const Oe=u.toLowerCase();return Ny.includes(Oe)?(e.consume(U),ue):H(U)}return ns(U)&&u.length<8?(e.consume(U),u+=String.fromCharCode(U),Z):H(U)}function K(U){return U===93?(e.consume(U),R):H(U)}function R(U){return U===62?(e.consume(U),ue):U===45&&a===2?(e.consume(U),R):H(U)}function ue(U){return U===null||ze(U)?(e.exit("htmlFlowData"),oe(U)):(e.consume(U),ue)}function oe(U){return e.exit("htmlFlow"),t(U)}}function BD(e,t,n){const r=this;return a;function a(u){return ze(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o):n(u)}function o(u){return r.parser.lazy[r.now().line]?n(u):t(u)}}function HD(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(ad,t,n)}}const UD={name:"htmlText",tokenize:zD};function zD(e,t,n){const r=this;let a,o,u;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,k):ns(R)?(e.consume(R),C):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)?(u=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?G(R):R===45?E(R):g(R)}function k(R){const ue="CDATA[";return R===ue.charCodeAt(o++)?(e.consume(R),o===ue.length?S:k):n(R)}function S(R){return R===null?n(R):R===93?(e.consume(R),w):ze(R)?(u=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?G(R):R===93?(e.consume(R),v):S(R)}function C(R){return R===null||R===62?G(R):ze(R)?(u=C,re(R)):(e.consume(R),C)}function O(R){return R===null?n(R):R===63?(e.consume(R),A):ze(R)?(u=O,re(R)):(e.consume(R),O)}function A(R){return R===62?G(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)?(u=N,re(R)):lt(R)?(e.consume(R),N):G(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),G):R===58||R===95||ns(R)?(e.consume(R),j):ze(R)?(u=F,re(R)):lt(R)?(e.consume(R),F):G(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)?(u=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)?(u=H,re(R)):lt(R)?(e.consume(R),H):(e.consume(R),Q)}function $(R){return R===a?(e.consume(R),a=void 0,J):R===null?n(R):ze(R)?(u=$,re(R)):(e.consume(R),$)}function Q(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),Q)}function J(R){return R===47||R===62||Zn(R)?F(R):n(R)}function G(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)?Ct(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):K(R)}function K(R){return e.enter("htmlTextData"),u(R)}}const op={name:"labelEnd",resolveAll:$D,resolveTo:VD,tokenize:QD},WD={tokenize:GD},YD={tokenize:XD},qD={tokenize:KD};function $D(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 VD(e,t){let n=e.length,r=0,a,o,u,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(u){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"&&(u=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[u][1].end}},m={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[u-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,ip(t.parser.constructs.insideSpan.null,e.slice(o+r+4,u-3),t)),c=wr(c,[["exit",m,t],e[u-2],e[u-1],["exit",h,t]]),c=wr(c,e.slice(u+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,u;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):(u=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(WD,m,u?m:g)(E):E===91?e.attempt(YD,m,u?h:g)(E):u?m(E):g(E)}function h(E){return e.attempt(qD,m,g)(E)}function m(E){return t(E)}function g(E){return o._balanced=!0,n(E)}}function GD(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):Zx(e,u,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function u(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?t2(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 XD(e,t,n){const r=this;return a;function a(c){return e2.call(r,e,o,u,"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 u(c){return n(c)}}function KD(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 JD={name:"labelStartImage",resolveAll:op.resolveAll,tokenize:ZD};function ZD(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"),u):n(c)}function u(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const e4={name:"labelStartLink",resolveAll:op.resolveAll,tokenize:t4};function t4(e,t,n){const r=this;return a;function a(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),o}function o(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const bh={name:"lineEnding",tokenize:n4};function n4(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ct(e,t,"linePrefix")}}const vc={name:"thematicBreak",tokenize:r4};function r4(e,t,n){let r=0,a;return o;function o(h){return e.enter("thematicBreak"),u(h)}function u(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)?Ct(e,c,"whitespace")(h):c(h))}}const Xn={continuation:{tokenize:o4},exit:l4,name:"list",tokenize:i4},s4={partial:!0,tokenize:c4},a4={partial:!0,tokenize:u4};function i4(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,u=0;return c;function c(x){const k=r.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!r.containerState.marker||x===r.containerState.marker:o0(x)){if(r.containerState.type||(r.containerState.type=k,e.enter(k,{_container:!0})),k==="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 o0(x)&&++u<10?(e.consume(x),d):(!r.interrupt||u<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(ad,r.interrupt?n:m,e.attempt(s4,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 o4(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ad,a,o);function a(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ct(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,u(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(a4,t,u)(c))}function u(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ct(e,e.attempt(Xn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function u4(e,t,n){const r=this;return Ct(e,a,"listItemIndent",r.containerState.size+1);function a(o){const u=r.events[r.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===r.containerState.size?t(o):n(o)}}function l4(e){e.exit(this.containerState.type)}function c4(e,t,n){const r=this;return Ct(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(o){const u=r.events[r.events.length-1];return!lt(o)&&u&&u[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Oy={name:"setextUnderline",resolveTo:d4,tokenize:f4};function d4(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 u={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",u,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=u,e.push(["exit",u,t]),e}function f4(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,u(h)):n(h)}function u(h){return e.enter("setextHeadingLineSequence"),c(h)}function c(h){return h===a?(e.consume(h),c):(e.exit("setextHeadingLineSequence"),lt(h)?Ct(e,d,"lineSuffix")(h):d(h))}function d(h){return h===null||ze(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const h4={tokenize:p4};function p4(e){const t=this,n=e.attempt(ad,r,e.attempt(this.parser.constructs.flowInitial,a,Ct(e,e.attempt(this.parser.constructs.flow,a,e.attempt(ED,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 m4={resolveAll:r2()},g4=n2("string"),y4=n2("text");function n2(e){return{resolveAll:r2(e==="text"?b4:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],o=n.attempt(a,u,c);return u;function u(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 r2(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 b4(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,u=-1,c=0,d;for(;o--;){const h=a[o];if(typeof h=="string"){for(u=h.length;h.charCodeAt(u-1)===32;)c++,u--;if(u)break;u=-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?u:r.start._bufferIndex+u,_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 E4={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:Gx},x4={91:SD},T4={[-2]:yh,[-1]:yh,32:yh},v4={35:DD,42:vc,45:[Oy,vc],60:LD,61:Oy,95:vc,96:Cy,126:Cy},w4={38:Kx,92:Xx},S4={[-5]:bh,[-4]:bh,[-3]:bh,33:JD,38:Kx,42:u0,60:[eD,UD],91:e4,92:[ND,Xx],93:op,95:u0,96:hD},_4={null:[u0,m4]},k4={null:[42,95]},C4={null:[]},N4=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:k4,contentInitial:x4,disable:C4,document:E4,flow:v4,flowInitial:T4,insideSpan:_4,string:w4,text:S4},Symbol.toStringTag,{value:"Module"}));function O4(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 u=[],c=[];const d={attempt:N(P),check:N(_),consume:C,enter:O,exit:A,interrupt:N(_,{interrupt:!0})},h={code:null,containerState:{},defineSkip:S,events:[],now:k,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 u=wr(u,M),w(),u[u.length-1]!==null?[]:(I(t,0),h.events=ip(o,h.events,h),h.events)}function E(M,H){return A4(x(M),H)}function x(M){return D4(u,M)}function k(){const{_bufferIndex:M,_index:H,line:$,column:Q,offset:J}=r;return{_bufferIndex:M,_index:H,line:$,column:Q,offset:J}}function S(M){a[M.line]=M.column,j()}function w(){let M;for(;r._index<u.length;){const H=u[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 C(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===u[r._index].length&&(r._bufferIndex=-1,r._index++)),h.previous=M}function O(M,H){const $=H||{};return $.type=M,$.start=k(),h.events.push(["enter",$,h]),c.push($),$}function A(M){const H=c.pop();return H.end=k(),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 $(Q,J,G){let re,Z,K,R;return Array.isArray(Q)?oe(Q):"tokenize"in Q?oe([Q]):ue(Q);function ue(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 oe(We)($e)}}function oe(Te){return re=Te,Z=0,Te.length===0?G:U(Te[Z])}function U(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)?Le():Te.tokenize.call(H?Object.assign(Object.create(h),H):h,d,Oe,Le)($e)}}function Oe(Te){return M(K,R),J}function Le(Te){return R.restore(),++Z<re.length?U(re[Z]):G}}}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=k(),H=h.previous,$=h.currentConstruct,Q=h.events.length,J=Array.from(c);return{from:Q,restore:G};function G(){r=M,h.previous=H,h.currentConstruct=$,h.events.length=Q,c=J,j()}}function j(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function D4(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,o=t.end._bufferIndex;let u;if(n===a)u=[e[n].slice(r,o)];else{if(u=e.slice(n,a),r>-1){const c=u[0];typeof c=="string"?u[0]=c.slice(r):u.shift()}o>0&&u.push(e[a].slice(0,o))}return u}function A4(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const o=e[n];let u;if(typeof o=="string")u=o;else switch(o){case-5:{u="\r";break}case-4:{u=`
|
|
96
|
-
`;break}case-3:{u=`\r
|
|
97
|
-
`;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&a)continue;u=" ";break}default:u=String.fromCharCode(o)}a=o===-2,r.push(u)}return r.join("")}function I4(e){const r={constructs:BO([N4,...(e||{}).extensions||[]]),content:a(VO),defined:[],document:a(GO),flow:a(h4),lazy:{},string:a(g4),text:a(y4)};return r;function a(o){return u;function u(c){return O4(r,o,c)}}}function R4(e){for(;!Jx(e););return e}const Dy=/[\0\t\n\r]/g;function L4(){let e=1,t="",n=!0,r;return a;function a(o,u,c){const d=[];let h,m,g,E,x;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(u||void 0).decode(o)),g=0,t="",n&&(o.charCodeAt(0)===65279&&g++,n=void 0);g<o.length;){if(Dy.lastIndex=g,h=Dy.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 M4=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function P4(e){return e.replace(M4,F4)}function F4(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),o=a===120||a===88;return Qx(n.slice(o?2:1),o?16:10)}return ap(n)||e}const s2={}.hasOwnProperty;function j4(e,t,n){return typeof t!="string"&&(n=t,t=void 0),B4(n)(R4(I4(n).document().write(L4()(e,t,!0))))}function B4(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:u,codeFencedFenceMeta:u,codeIndented:o(We,u),codeText:o(pn,u),codeTextData:F,data:F,codeFlowValue:F,definition:o(Gt),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:o(Hn),hardBreakEscape:o(nn),hardBreakTrailing:o(nn),htmlFlow:o(mn,u),htmlFlowData:F,htmlText:o(mn,u),htmlTextData:F,image:o(tr),label:u,link:o(it),listItem:o(Et),listItemValue:E,listOrdered:o(nt,g),listUnordered:o(nt),paragraph:o(Nt),reference:U,referenceString:u,resourceDestinationString:u,resourceTitleString:u,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:Le,characterReferenceMarkerNumeric:Le,characterReferenceValue:Te,characterReference:Ze,codeFenced:d(w),codeFencedFence:S,codeFencedFenceInfo:x,codeFencedFenceMeta:k,codeFlowValue:j,codeIndented:d(v),codeText:d(J),codeTextData:j,data:j,definition:d(),definitionDestinationString:A,definitionLabelString:C,definitionTitleString:O,emphasis:d(),hardBreakEscape:d(H),hardBreakTrailing:d(H),htmlFlow:d($),htmlFlowData:j,htmlText:d(Q),htmlTextData:j,image:d(re),label:K,labelText:Z,lineEnding:M,link:d(G),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:Oe,resourceDestinationString:R,resourceTitleString:ue,resource:oe,setextHeading:d(I),setextHeadingLineSequence:N,setextHeadingText:_,strong:d(),thematicBreak:d()}};a2(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ie){let pe={type:"root",children:[]};const De={stack:[pe],tokenStack:[],config:t,enter:c,exit:h,buffer:u,resume:m,data:n},He=[];let Ve=-1;for(;++Ve<ie.length;)if(ie[Ve][1].type==="listOrdered"||ie[Ve][1].type==="listUnordered")if(ie[Ve][0]==="enter")He.push(Ve);else{const gt=He.pop();Ve=a(ie,gt,Ve)}for(Ve=-1;++Ve<ie.length;){const gt=t[ie[Ve][0]];s2.call(gt,ie[Ve][1].type)&>[ie[Ve][1].type].call(Object.assign({sliceSerialize:ie[Ve][2].sliceSerialize},De),ie[Ve][1])}if(De.tokenStack.length>0){const gt=De.tokenStack[De.tokenStack.length-1];(gt[1]||Ay).call(De,void 0,gt[0])}for(pe.position={start:Js(ie.length>0?ie[0][1].start:{line:1,column:1,offset:0}),end:Js(ie.length>0?ie[ie.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(ie,pe,De){let He=pe-1,Ve=-1,gt=!1,zt,rn,_n,Un;for(;++He<=De;){const At=ie[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=ie[yt];if(ln[1].type==="lineEnding"||ln[1].type==="lineEndingBlank"){if(ln[0]==="exit")continue;rn&&(ie[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?ie[rn][1].start:At[1].end),ie.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,ie.splice(He,0,["enter",yt,At[2]]),He++,De++,_n=void 0,Un=!0}}}return ie[pe][1]._spread=gt,De}function o(ie,pe){return De;function De(He){c.call(this,ie(He),He),pe&&pe.call(this,He)}}function u(){this.stack.push({type:"fragment",children:[]})}function c(ie,pe,De){this.stack[this.stack.length-1].children.push(ie),this.stack.push(ie),this.tokenStack.push([pe,De||void 0]),ie.position={start:Js(pe.start),end:void 0}}function d(ie){return pe;function pe(De){ie&&ie.call(this,De),h.call(this,De)}}function h(ie,pe){const De=this.stack.pop(),He=this.tokenStack.pop();if(He)He[0].type!==ie.type&&(pe?pe.call(this,ie,He[0]):(He[1]||Ay).call(this,ie,He[0]));else throw new Error("Cannot close `"+ie.type+"` ("+xu({start:ie.start,end:ie.end})+"): it’s not open");De.position.end=Js(ie.end)}function m(){return FO(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function E(ie){if(this.data.expectingFirstListItemValue){const pe=this.stack[this.stack.length-2];pe.start=Number.parseInt(this.sliceSerialize(ie),10),this.data.expectingFirstListItemValue=void 0}}function x(){const ie=this.resume(),pe=this.stack[this.stack.length-1];pe.lang=ie}function k(){const ie=this.resume(),pe=this.stack[this.stack.length-1];pe.meta=ie}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const ie=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ie.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const ie=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ie.replace(/(\r?\n|\r)$/g,"")}function C(ie){const pe=this.resume(),De=this.stack[this.stack.length-1];De.label=pe,De.identifier=ji(this.sliceSerialize(ie)).toLowerCase()}function O(){const ie=this.resume(),pe=this.stack[this.stack.length-1];pe.title=ie}function A(){const ie=this.resume(),pe=this.stack[this.stack.length-1];pe.url=ie}function P(ie){const pe=this.stack[this.stack.length-1];if(!pe.depth){const De=this.sliceSerialize(ie).length;pe.depth=De}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function N(ie){const pe=this.stack[this.stack.length-1];pe.depth=this.sliceSerialize(ie).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function F(ie){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(ie.start),end:void 0},De.push(He)),this.stack.push(He)}function j(ie){const pe=this.stack.pop();pe.value+=this.sliceSerialize(ie),pe.position.end=Js(ie.end)}function M(ie){const pe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const De=pe.children[pe.children.length-1];De.position.end=Js(ie.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(pe.type)&&(F.call(this,ie),j.call(this,ie))}function H(){this.data.atHardBreak=!0}function $(){const ie=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ie}function Q(){const ie=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ie}function J(){const ie=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ie}function G(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=pe,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function re(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=pe,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function Z(ie){const pe=this.sliceSerialize(ie),De=this.stack[this.stack.length-2];De.label=P4(pe),De.identifier=ji(pe).toLowerCase()}function K(){const ie=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=ie.children;De.children=He}else De.alt=pe}function R(){const ie=this.resume(),pe=this.stack[this.stack.length-1];pe.url=ie}function ue(){const ie=this.resume(),pe=this.stack[this.stack.length-1];pe.title=ie}function oe(){this.data.inReference=void 0}function U(){this.data.referenceType="collapsed"}function Oe(ie){const pe=this.resume(),De=this.stack[this.stack.length-1];De.label=pe,De.identifier=ji(this.sliceSerialize(ie)).toLowerCase(),this.data.referenceType="full"}function Le(ie){this.data.characterReferenceType=ie.type}function Te(ie){const pe=this.sliceSerialize(ie),De=this.data.characterReferenceType;let He;De?(He=Qx(pe,De==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):He=ap(pe);const Ve=this.stack[this.stack.length-1];Ve.value+=He}function Ze(ie){const pe=this.stack.pop();pe.position.end=Js(ie.end)}function $e(ie){j.call(this,ie);const pe=this.stack[this.stack.length-1];pe.url=this.sliceSerialize(ie)}function Ge(ie){j.call(this,ie);const pe=this.stack[this.stack.length-1];pe.url="mailto:"+this.sliceSerialize(ie)}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(ie){return{type:"list",ordered:ie.type==="listOrdered",start:null,spread:ie._spread,children:[]}}function Et(ie){return{type:"listItem",spread:ie._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 a2(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?a2(e,r):H4(e,r)}}function H4(e,t){let n;for(n in t)if(s2.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 Ay(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 U4(e){const t=this;t.parser=n;function n(r){return j4(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function z4(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 W4(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
98
|
-
`}]}function Y4(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 q4(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $4(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function V4(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 u,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),u=e.footnoteOrder.length):u=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(u)}]};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 G4(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function i2(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 u=a[a.length-1];return u&&u.type==="text"?u.value+=r:a.push({type:"text",value:r}),a}function X4(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return i2(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 K4(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 J4(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 Z4(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return i2(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 e6(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 t6(e,t,n){const r=e.all(t),a=n?n6(n):o2(t),o={},u=[];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")&&u.push({type:"text",value:`
|
|
100
|
-
`}),m.type==="element"&&m.tagName==="p"&&!a?u.push(...m.children):u.push(m)}const d=r[r.length-1];d&&(a||d.type!=="element"||d.tagName!=="p")&&u.push({type:"text",value:`
|
|
101
|
-
`});const h={type:"element",tagName:"li",properties:o,children:u};return e.patch(t,h),e.applyData(t,h)}function n6(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=o2(n[r])}return t}function o2(e){const t=e.spread;return t??e.children.length>1}function r6(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 u=r[a];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.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 s6(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function a6(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function i6(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function o6(e,t){const n=e.all(t),r=n.shift(),a=[];if(r){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],u),a.push(u)}if(n.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=us(t.children[1]),d=sd(t.children[t.children.length-1]);c&&d&&(u.position={start:c,end:d}),a.push(u)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,o),e.applyData(t,o)}function u6(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",u=n&&n.type==="table"?n.align:void 0,c=u?u.length:t.children.length;let d=-1;const h=[];for(;++d<c;){const g=t.children[d],E={},x=u?u[d]:void 0;x&&(E.align=x);let k={type:"element",tagName:o,properties:E,children:[]};g&&(k.children=e.all(g),e.patch(g,k),k=e.applyData(g,k)),h.push(k)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,m),e.applyData(t,m)}function l6(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Iy=9,Ry=32;function c6(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),a=0;const o=[];for(;r;)o.push(Ly(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return o.push(Ly(t.slice(a),a>0,!1)),o.join("")}function Ly(e,t,n){let r=0,a=e.length;if(t){let o=e.codePointAt(r);for(;o===Iy||o===Ry;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(a-1);for(;o===Iy||o===Ry;)a--,o=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function d6(e,t){const n={type:"text",value:c6(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function f6(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const h6={blockquote:z4,break:W4,code:Y4,delete:q4,emphasis:$4,footnoteReference:V4,heading:Q4,html:G4,imageReference:X4,image:K4,inlineCode:J4,linkReference:Z4,link:e6,listItem:t6,list:r6,paragraph:s6,root:a6,strong:i6,table:o6,tableCell:l6,tableRow:u6,text:d6,thematicBreak:f6,toml:mc,yaml:mc,definition:mc,footnoteDefinition:mc};function mc(){}const u2=-1,id=0,vu=1,Pc=2,up=3,lp=4,cp=5,dp=6,l2=7,c2=8,My=typeof self=="object"?self:globalThis,p6=(e,t)=>{const n=(a,o)=>(e.set(o,a),a),r=a=>{if(e.has(a))return e.get(a);const[o,u]=t[a];switch(o){case id:case u2:return n(u,a);case vu:{const c=n([],a);for(const d of u)c.push(r(d));return c}case Pc:{const c=n({},a);for(const[d,h]of u)c[r(d)]=r(h);return c}case up:return n(new Date(u),a);case lp:{const{source:c,flags:d}=u;return n(new RegExp(c,d),a)}case cp:{const c=n(new Map,a);for(const[d,h]of u)c.set(r(d),r(h));return c}case dp:{const c=n(new Set,a);for(const d of u)c.add(r(d));return c}case l2:{const{name:c,message:d}=u;return n(new My[c](d),a)}case c2:return n(BigInt(u),a);case"BigInt":return n(Object(BigInt(u)),a);case"ArrayBuffer":return n(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:c}=new Uint8Array(u);return n(new DataView(c),u)}}return n(new My[o](u),a)};return r},Py=e=>p6(new Map,e)(0),Mi="",{toString:m6}={},{keys:g6}=Object,pu=e=>{const t=typeof e;if(t!=="object"||!e)return[id,t];const n=m6.call(e).slice(8,-1);switch(n){case"Array":return[vu,Mi];case"Object":return[Pc,Mi];case"Date":return[up,Mi];case"RegExp":return[lp,Mi];case"Map":return[cp,Mi];case"Set":return[dp,Mi];case"DataView":return[vu,n]}return n.includes("Array")?[vu,n]:n.includes("Error")?[l2,n]:[Pc,n]},gc=([e,t])=>e===id&&(t==="function"||t==="symbol"),y6=(e,t,n,r)=>{const a=(u,c)=>{const d=r.push(u)-1;return n.set(c,d),d},o=u=>{if(n.has(u))return n.get(u);let[c,d]=pu(u);switch(c){case id:{let m=u;switch(d){case"bigint":c=c2,m=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);m=null;break;case"undefined":return a([u2],u)}return a([c,m],u)}case vu:{if(d){let E=u;return d==="DataView"?E=new Uint8Array(u.buffer):d==="ArrayBuffer"&&(E=new Uint8Array(u)),a([d,[...E]],u)}const m=[],g=a([c,m],u);for(const E of u)m.push(o(E));return g}case Pc:{if(d)switch(d){case"BigInt":return a([d,u.toString()],u);case"Boolean":case"Number":case"String":return a([d,u.valueOf()],u)}if(t&&"toJSON"in u)return o(u.toJSON());const m=[],g=a([c,m],u);for(const E of g6(u))(e||!gc(pu(u[E])))&&m.push([o(E),o(u[E])]);return g}case up:return a([c,u.toISOString()],u);case lp:{const{source:m,flags:g}=u;return a([c,{source:m,flags:g}],u)}case cp:{const m=[],g=a([c,m],u);for(const[E,x]of u)(e||!(gc(pu(E))||gc(pu(x))))&&m.push([o(E),o(x)]);return g}case dp:{const m=[],g=a([c,m],u);for(const E of u)(e||!gc(pu(E)))&&m.push(o(E));return g}}const{message:h}=u;return a([c,{name:d,message:h}],u)};return o},Fy=(e,{json:t,lossy:n}={})=>{const r=[];return y6(!(t||n),!!t,new Map,r)(e),r},so=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Py(Fy(e,t)):structuredClone(e):(e,t)=>Py(Fy(e,t));function b6(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 E6(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function x6(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||b6,r=e.options.footnoteBackLabel||E6,a=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",u=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 k=[],S=e.footnoteCounts.get(g);for(;S!==void 0&&++x<=S;){k.length>0&&k.push({type:"text",value:" "});let C=typeof n=="string"?n:n(d,x);typeof C=="string"&&(C={type:"text",value:C}),k.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(C)?C:[C]})}const w=m[m.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const C=w.children[w.children.length-1];C&&C.type==="text"?C.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...k)}else m.push(...k);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(u),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 d2=(function(e){if(e==null)return S6;if(typeof e=="function")return od(e);if(typeof e=="object")return Array.isArray(e)?T6(e):v6(e);if(typeof e=="string")return w6(e);throw new Error("Expected function, string, or object as test")});function T6(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=d2(e[n]);return od(r);function r(...a){let o=-1;for(;++o<t.length;)if(t[o].apply(this,a))return!0;return!1}}function v6(e){const t=e;return od(n);function n(r){const a=r;let o;for(o in e)if(a[o]!==t[o])return!1;return!0}}function w6(e){return od(t);function t(n){return n&&n.type===e}}function od(e){return t;function t(n,r,a){return!!(_6(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function S6(){return!0}function _6(e){return e!==null&&typeof e=="object"&&"type"in e}const f2=[],k6=!0,jy=!1,C6="skip";function N6(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const o=d2(a),u=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=f2,k,S,w;if((!t||o(d,h,m[m.length-1]||void 0))&&(x=O6(n(d,m)),x[0]===jy))return x;if("children"in d&&d.children){const v=d;if(v.children&&x[0]!==C6)for(S=(r?v.children.length:-1)+u,w=m.concat(v);S>-1&&S<v.children.length;){const C=v.children[S];if(k=c(C,S,w)(),k[0]===jy)return k;S=typeof k[1]=="number"?k[1]:S+u}}return x}}}function O6(e){return Array.isArray(e)?e:typeof e=="number"?[k6,e]:e==null?f2:[e]}function fp(e,t,n,r){let a,o,u;typeof t=="function"&&typeof n!="function"?(o=void 0,u=t,a=n):(o=t,u=n,a=r),N6(e,o,c,a);function c(d,h){const m=h[h.length-1],g=m?m.children.indexOf(d):void 0;return u(d,g,m)}}const l0={}.hasOwnProperty,D6={};function A6(e,t){const n=t||D6,r=new Map,a=new Map,o=new Map,u={...h6,...n.handlers},c={all:h,applyData:R6,definitionById:r,footnoteById:a,footnoteCounts:o,footnoteOrder:[],handlers:u,one:d,options:n,patch:I6,wrap:M6};return fp(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(l0.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||L6)(c,m,g)}function h(m){const g=[];if("children"in m){const E=m.children;let x=-1;for(;++x<E.length;){const k=c.one(E[x],m);if(k){if(x&&E[x-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=By(k.value)),!Array.isArray(k)&&k.type==="element")){const S=k.children[0];S&&S.type==="text"&&(S.value=By(S.value))}Array.isArray(k)?g.push(...k):g.push(k)}}}return g}}function I6(e,t){e.position&&(t.position=mO(e))}function R6(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 u="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:u}}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 L6(e,t){const n=t.data||{},r="value"in t&&!(l0.call(n,"hProperties")||l0.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 M6(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 By(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Hy(e,t){const n=A6(e,t),r=n.one(e,void 0),a=x6(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 P6(e,t){return e&&"run"in e?async function(n,r){const a=Hy(n,{file:r,...t});await e.run(a,r)}:function(n,r){return Hy(n,{file:r,...e||t})}}function Uy(e){if(e)throw e}var Eh,zy;function F6(){if(zy)return Eh;zy=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)},u=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 Eh=function d(){var h,m,g,E,x,k,S=arguments[0],w=1,v=arguments.length,C=!1;for(typeof S=="boolean"&&(C=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&&(C&&E&&(o(E)||(x=a(E)))?(x?(x=!1,k=g&&a(g)?g:[]):k=g&&o(g)?g:{},u(S,{name:m,newValue:d(C,k,E)})):typeof E<"u"&&u(S,{name:m,newValue:E}));return S},Eh}var j6=F6();const xh=_b(j6);function c0(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 B6(){const e=[],t={run:n,use:r};return t;function n(...a){let o=-1;const u=a.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);c(null,...a);function c(d,...h){const m=e[++o];let g=-1;if(d){u(d);return}for(;++g<a.length;)(h[g]===null||h[g]===void 0)&&(h[g]=a[g]);a=h,m?H6(m,c)(...h):u(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 H6(e,t){let n;return r;function r(...u){const c=e.length>u.length;let d;c&&u.push(a);try{d=e.apply(this,u)}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(u,...c){n||(n=!0,t(u,...c))}function o(u){a(null,u)}}const Gr={basename:U6,dirname:z6,extname:W6,join:Y6,sep:"/"};function U6(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 u=-1,c=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(o){n=a+1;break}}else u<0&&(o=!0,u=a+1),c>-1&&(e.codePointAt(a)===t.codePointAt(c--)?c<0&&(r=a):(c=-1,r=u));return n===r?r=u:r<0&&(r=e.length),e.slice(n,r)}function z6(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 W6(e){Xu(e);let t=e.length,n=-1,r=0,a=-1,o=0,u;for(;t--;){const c=e.codePointAt(t);if(c===47){if(u){r=t+1;break}continue}n<0&&(u=!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 Y6(...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?".":q6(n)}function q6(e){Xu(e);const t=e.codePointAt(0)===47;let n=$6(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function $6(e,t){let n="",r=0,a=-1,o=0,u=-1,c,d;for(;++u<=e.length;){if(u<e.length)c=e.codePointAt(u);else{if(c===47)break;c=47}if(c===47){if(!(a===u-1||o===1))if(a!==u-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=u,o=0;continue}}else if(n.length>0){n="",r=0,a=u,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,u):n=e.slice(a+1,u),r=u-a-1;a=u,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 V6={cwd:Q6};function Q6(){return"/"}function d0(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function G6(e){if(typeof e=="string")e=new URL(e);else if(!d0(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 X6(e)}function X6(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 Th=["history","path","basename","stem","extname","dirname"];class h2{constructor(t){let n;t?d0(t)?n={path:t}:typeof t=="string"||K6(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":V6.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Th.length;){const o=Th[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)Th.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?Gr.basename(this.path):void 0}set basename(t){wh(t,"basename"),vh(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){Wy(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(vh(t,"extname"),Wy(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){d0(t)&&(t=G6(t)),wh(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){wh(t,"stem"),vh(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 vh(e,t){if(e&&e.includes(Gr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Gr.sep+"`")}function wh(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Wy(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function K6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const J6=(function(e){const r=this.constructor.prototype,a=r[e],o=function(){return a.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),Z6={}.hasOwnProperty;class hp extends J6{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=B6()}copy(){const t=new hp;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(xh(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(kh("data",this.frozen),this.namespace[t]=n,this):Z6.call(this.namespace,t)&&this.namespace[t]||void 0:t?(kh("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 Sh("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Sh("process",this.parser||this.Parser),_h("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(o,u){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,k=r.stringify(x,E);nA(k)?E.value=k:E.result=k,h(m,E)});function h(m,g){m||!g?u(m):o?o(g):n(void 0,g)}}}processSync(t){let n=!1,r;return this.freeze(),Sh("processSync",this.parser||this.Parser),_h("processSync",this.compiler||this.Compiler),this.process(t,a),qy("processSync","process",n),r;function a(o,u){n=!0,Uy(o),r=u}}run(t,n,r){Yy(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(u,c){const d=yc(n);a.run(t,d,h);function h(m,g,E){const x=g||t;m?c(m):u?u(x):r(void 0,x,E)}}}runSync(t,n){let r=!1,a;return this.run(t,n,o),qy("runSync","run",r),a;function o(u,c){Uy(u),a=c,r=!0}}stringify(t,n){this.freeze();const r=yc(n),a=this.compiler||this.Compiler;return _h("stringify",a),Yy(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(kh("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):u(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 u(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function u(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=xh(!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,...k]=m;const S=r[E][1];c0(S)&&c0(x)&&(x=xh(!0,S,x)),r[E]=[h,x,...k]}}}}const eA=new hp().freeze();function Sh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function _h(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function kh(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 Yy(e){if(!c0(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function qy(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function yc(e){return tA(e)?e:new h2(e)}function tA(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function nA(e){return typeof e=="string"||rA(e)}function rA(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const sA="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",$y=[],Vy={allowDangerousHtml:!0},aA=/^(https?|ircs?|mailto|xmpp)$/i,iA=[{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 oA(e){const t=uA(e),n=lA(e);return cA(t.runSync(t.parse(n),n),e)}function uA(e){const t=e.rehypePlugins||$y,n=e.remarkPlugins||$y,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Vy}:Vy;return eA().use(U4).use(n).use(P6,r).use(t)}function lA(e){const t=e.children||"",n=new h2;return typeof t=="string"&&(n.value=t),n}function cA(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,o=t.disallowedElements,u=t.skipHtml,c=t.unwrapDisallowed,d=t.urlTransform||dA;for(const m of iA)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+sA+m.id,void 0);return fp(e,h),xO(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 u?E.children.splice(g,1):E.children[g]={type:"text",value:m.value},g;if(m.type==="element"){let x;for(x in gh)if(Object.hasOwn(gh,x)&&Object.hasOwn(m.properties,x)){const k=m.properties[x],S=gh[x];(S===null||S.includes(m.tagName))&&(m.properties[x]=d(String(k||""),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 dA(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||aA.test(e.slice(0,t))?e:""}const Qy=/[#.]/g;function fA(e,t){const n=e||"",r={};let a=0,o,u;for(;a<n.length;){Qy.lastIndex=a;const c=Qy.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]:u=d,a+=d.length),c&&(o=c[0],a++)}return{type:"element",tagName:u||t||"div",properties:r,children:[]}}function p2(e,t,n){const r=n?gA(n):void 0;function a(o,u,...c){let d;if(o==null){d={type:"root",children:[]};const h=u;c.unshift(h)}else{d=fA(o,t);const h=d.tagName.toLowerCase(),m=r?r.get(h):void 0;if(d.tagName=m||h,hA(u))c.unshift(u);else for(const[g,E]of Object.entries(u))pA(e,d.properties,g,E)}for(const h of c)f0(d.children,h);return d.type==="element"&&d.tagName==="template"&&(d.content={type:"root",children:d.children},d.children=[]),d}return a}function hA(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 u of o)if(typeof u!="number"&&typeof u!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function pA(e,t,n,r){const a=rd(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=hy(r):a.commaSeparated?o=uy(r):a.commaOrSpaceSeparated?o=hy(uy(r).join(" ")):o=Gy(a,a.property,r):Array.isArray(r)?o=[...r]:o=a.property==="style"?mA(r):String(r);if(Array.isArray(o)){const u=[];for(const c of o)u.push(Gy(a,a.property,c));o=u}a.property==="className"&&Array.isArray(t.className)&&(o=t.className.concat(o)),t[a.property]=o}}function f0(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)f0(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?f0(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function Gy(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 mA(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function gA(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const yA=["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"],bA=p2(Gu,"div"),EA=p2(ga,"g",yA);function xA(e){const t=String(e),n=[];return{toOffset:a,toPoint:r};function r(o){if(typeof o=="number"&&o>-1&&o<=t.length){let u=0;for(;;){let c=n[u];if(c===void 0){const d=Xy(t,n[u-1]);c=d===-1?t.length+1:d+1,n[u]=c}if(c>o)return{line:u+1,column:o-(u>0?n[u-1]:0)+1,offset:o};u++}}}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=Xy(t,c),h=d===-1?t.length+1:d+1;if(c===h)break;n.push(h)}const u=(o.line>1?n[o.line-2]:0)+o.column-1;if(u<n[o.line-1])return u}}}function Xy(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/"},m2={}.hasOwnProperty,TA=Object.prototype;function vA(e,t){const n=t||{};return pp({file:n.file||void 0,location:!1,schema:n.space==="svg"?ga:Gu,verbose:n.verbose||!1},e)}function pp(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:g2(e,t.childNodes),data:{quirksMode:a}},e.file&&e.location){const o=String(e.file),u=xA(o),c=u.toPoint(0),d=u.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=wA(e,t),n}}function g2(e,t){let n=-1;const r=[];for(;++n<t.length;){const a=pp(e,t[n]);r.push(a)}return r}function wA(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;m2.call(TA,d)||(a[d]=c.value)}const u=(e.schema.space==="svg"?EA:bA)(t.tagName,a,g2(e,t.childNodes));if(wc(e,t,u),u.tagName==="template"){const c=t,d=c.sourceCodeLocation,h=d&&d.startTag&&Pi(d.startTag),m=d&&d.endTag&&Pi(d.endTag),g=pp(e,c.content);h&&m&&e.file&&(g.position={start:h.end,end:m.start}),u.content=g}return e.schema=n,u}function wc(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=SA(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function SA(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 u;if(n.attrs)for(u in n.attrs)m2.call(n.attrs,u)&&(o[rd(e.schema,u).property]=Pi(n.attrs[u]));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=Ky({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=Ky({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function Ky(e){return e.line&&e.column?e:void 0}const Jy={}.hasOwnProperty;function y2(e,t){const n=t||{};function r(a,...o){let u=r.invalid;const c=r.handlers;if(a&&Jy.call(a,e)){const d=String(a[e]);u=Jy.call(c,d)?c[d]:r.unknown}if(u)return u.call(this,a,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const _A={},kA={}.hasOwnProperty,b2=y2("type",{handlers:{root:NA,element:RA,text:AA,comment:IA,doctype:DA}});function CA(e,t){const r=(t||_A).space;return b2(e,r==="svg"?ga:Gu)}function NA(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=mp(e.children,n,t),go(e,n),n}function OA(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=mp(e.children,n,t),go(e,n),n}function DA(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return go(e,t),t}function AA(e){const t={nodeName:"#text",value:e.value,parentNode:null};return go(e,t),t}function IA(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return go(e,t),t}function RA(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"&&kA.call(e.properties,o)){const d=LA(r,o,e.properties[o]);d&&a.push(d)}}const u=r.space,c={nodeName:e.tagName,tagName:e.tagName,attrs:a,namespaceURI:ja[u],childNodes:[],parentNode:null};return c.childNodes=mp(e.children,c,r),go(e,c),e.tagName==="template"&&e.content&&(c.content=OA(e.content,r)),c}function LA(e,t,n){const r=rd(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?Rx(n):Ux(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 mp(e,t,n){let r=-1;const a=[];if(e)for(;++r<e.length;){const o=b2(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 MA=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],PA=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 E2(e){return e>=55296&&e<=57343}function FA(e){return e>=56320&&e<=57343}function jA(e,t){return(e-55296)*1024+9216+t}function x2(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function T2(e){return e>=64976&&e<=65007||PA.has(e)}var ae;(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"})(ae||(ae={}));const BA=65536;class HA{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=BA,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,u=a+n,c=o+n;return{code:t,startLine:r,endLine:r,startCol:u,endCol:u,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(FA(n))return this.pos++,this._addGap(),jA(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,B.EOF;return this._err(ae.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,E2(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){x2(t)?this._err(ae.controlCharacterInInputStream):T2(t)&&this._err(ae.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 v2(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 UA=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))),zA=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 WA(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=zA.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 YA=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 h0(e){return e>=Tn.ZERO&&e<=Tn.NINE}function qA(e){return e>=Tn.UPPER_A&&e<=Tn.UPPER_F||e>=Tn.LOWER_A&&e<=Tn.LOWER_F}function $A(e){return e>=Tn.UPPER_A&&e<=Tn.UPPER_Z||e>=Tn.LOWER_A&&e<=Tn.LOWER_Z||h0(e)}function VA(e){return e===Tn.EQUALS||$A(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)|YA)===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(h0(a)||qA(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(h0(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(WA(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 u=t.charCodeAt(n);if(this.treeIndex=GA(r,a,this.treeIndex+Math.max(1,o),u),this.treeIndex<0)return this.result===0||this.decodeMode===ws.Attribute&&(o===0||VA(u))?0:this.emitNotTerminatedNamedEntity();if(a=r[this.treeIndex],o=(a&ha.VALUE_LENGTH)>>14,o!==0){if(u===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 GA(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 u=n,c=u+a-1;for(;u<=c;){const d=u+c>>>1,h=e[d];if(h<r)u=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 XA=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=XA.get(e))!==null&&t!==void 0?t:y.UNKNOWN}const he=y,KA={[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},p0=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 z;(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"})(z||(z={}));const Jt={DATA:z.DATA,RCDATA:z.RCDATA,RAWTEXT:z.RAWTEXT,SCRIPT_DATA:z.SCRIPT_DATA,PLAINTEXT:z.PLAINTEXT,CDATA_SECTION:z.CDATA_SECTION};function JA(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 ZA(e){return e>=B.LATIN_SMALL_A&&e<=B.LATIN_SMALL_Z}function ea(e){return ZA(e)||Eu(e)}function Zy(e){return ea(e)||JA(e)}function bc(e){return e+32}function w2(e){return e===B.SPACE||e===B.LINE_FEED||e===B.TABULATION||e===B.FORM_FEED}function eb(e){return w2(e)||e===B.SOLIDUS||e===B.GREATER_THAN_SIGN}function eI(e){return e===B.NULL?ae.nullCharacterReference:e>1114111?ae.characterReferenceOutsideUnicodeRange:E2(e)?ae.surrogateCharacterReference:T2(e)?ae.noncharacterCharacterReference:x2(e)||e===B.CARRIAGE_RETURN?ae.controlCharacterReference:null}class tI{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=z.DATA,this.returnState=z.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new HA(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new QA(UA,(r,a)=>{this.preprocessor.pos=this.entityStartPos+a-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(ae.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(ae.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const a=eI(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(v2(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(ae.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(ae.endTagWithAttributes),t.selfClosing&&this._err(ae.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=w2(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=z.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?ws.Attribute:ws.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===z.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===z.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===z.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case z.DATA:{this._stateData(t);break}case z.RCDATA:{this._stateRcdata(t);break}case z.RAWTEXT:{this._stateRawtext(t);break}case z.SCRIPT_DATA:{this._stateScriptData(t);break}case z.PLAINTEXT:{this._statePlaintext(t);break}case z.TAG_OPEN:{this._stateTagOpen(t);break}case z.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case z.TAG_NAME:{this._stateTagName(t);break}case z.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case z.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case z.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case z.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case z.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case z.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case z.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case z.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case z.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case z.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case z.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case z.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case z.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case z.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case z.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case z.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case z.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case z.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case z.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case z.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case z.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case z.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case z.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case z.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case z.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case z.BOGUS_COMMENT:{this._stateBogusComment(t);break}case z.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case z.COMMENT_START:{this._stateCommentStart(t);break}case z.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case z.COMMENT:{this._stateComment(t);break}case z.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case z.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case z.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case z.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case z.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case z.COMMENT_END:{this._stateCommentEnd(t);break}case z.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case z.DOCTYPE:{this._stateDoctype(t);break}case z.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case z.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case z.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case z.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case z.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case z.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case z.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case z.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case z.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case z.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case z.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case z.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case z.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case z.CDATA_SECTION:{this._stateCdataSection(t);break}case z.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case z.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case z.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case z.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case B.LESS_THAN_SIGN:{this.state=z.TAG_OPEN;break}case B.AMPERSAND:{this._startCharacterReference();break}case B.NULL:{this._err(ae.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=z.RCDATA_LESS_THAN_SIGN;break}case B.NULL:{this._err(ae.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=z.RAWTEXT_LESS_THAN_SIGN;break}case B.NULL:{this._err(ae.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=z.SCRIPT_DATA_LESS_THAN_SIGN;break}case B.NULL:{this._err(ae.unexpectedNullCharacter),this._emitChars(Mt);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case B.NULL:{this._err(ae.unexpectedNullCharacter),this._emitChars(Mt);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(ea(t))this._createStartTagToken(),this.state=z.TAG_NAME,this._stateTagName(t);else switch(t){case B.EXCLAMATION_MARK:{this.state=z.MARKUP_DECLARATION_OPEN;break}case B.SOLIDUS:{this.state=z.END_TAG_OPEN;break}case B.QUESTION_MARK:{this._err(ae.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=z.BOGUS_COMMENT,this._stateBogusComment(t);break}case B.EOF:{this._err(ae.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(ae.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=z.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(ea(t))this._createEndTagToken(),this.state=z.TAG_NAME,this._stateTagName(t);else switch(t){case B.GREATER_THAN_SIGN:{this._err(ae.missingEndTagName),this.state=z.DATA;break}case B.EOF:{this._err(ae.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(ae.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=z.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=z.BEFORE_ATTRIBUTE_NAME;break}case B.SOLIDUS:{this.state=z.SELF_CLOSING_START_TAG;break}case B.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentTagToken();break}case B.NULL:{this._err(ae.unexpectedNullCharacter),n.tagName+=Mt;break}case B.EOF:{this._err(ae.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Eu(t)?bc(t):t)}}_stateRcdataLessThanSign(t){t===B.SOLIDUS?this.state=z.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=z.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){ea(t)?(this.state=z.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=z.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=z.BEFORE_ATTRIBUTE_NAME,!1;case B.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=z.SELF_CLOSING_START_TAG,!1;case B.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=z.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=z.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===B.SOLIDUS?this.state=z.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=z.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){ea(t)?(this.state=z.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=z.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=z.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case B.SOLIDUS:{this.state=z.SCRIPT_DATA_END_TAG_OPEN;break}case B.EXCLAMATION_MARK:{this.state=z.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=z.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){ea(t)?(this.state=z.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=z.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=z.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===B.HYPHEN_MINUS?(this.state=z.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=z.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===B.HYPHEN_MINUS?(this.state=z.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=z.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case B.HYPHEN_MINUS:{this.state=z.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case B.NULL:{this._err(ae.unexpectedNullCharacter),this._emitChars(Mt);break}case B.EOF:{this._err(ae.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case B.HYPHEN_MINUS:{this.state=z.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case B.NULL:{this._err(ae.unexpectedNullCharacter),this.state=z.SCRIPT_DATA_ESCAPED,this._emitChars(Mt);break}case B.EOF:{this._err(ae.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=z.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case B.HYPHEN_MINUS:{this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case B.GREATER_THAN_SIGN:{this.state=z.SCRIPT_DATA,this._emitChars(">");break}case B.NULL:{this._err(ae.unexpectedNullCharacter),this.state=z.SCRIPT_DATA_ESCAPED,this._emitChars(Mt);break}case B.EOF:{this._err(ae.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=z.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===B.SOLIDUS?this.state=z.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:ea(t)?(this._emitChars("<"),this.state=z.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){ea(t)?(this.state=z.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(Gn.SCRIPT,!1)&&eb(this.preprocessor.peek(Gn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Gn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case B.HYPHEN_MINUS:{this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case B.NULL:{this._err(ae.unexpectedNullCharacter),this._emitChars(Mt);break}case B.EOF:{this._err(ae.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case B.HYPHEN_MINUS:{this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case B.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case B.NULL:{this._err(ae.unexpectedNullCharacter),this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Mt);break}case B.EOF:{this._err(ae.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=z.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=z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case B.GREATER_THAN_SIGN:{this.state=z.SCRIPT_DATA,this._emitChars(">");break}case B.NULL:{this._err(ae.unexpectedNullCharacter),this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Mt);break}case B.EOF:{this._err(ae.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===B.SOLIDUS?(this.state=z.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Gn.SCRIPT,!1)&&eb(this.preprocessor.peek(Gn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Gn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=z.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=z.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=z.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case B.EQUALS_SIGN:{this._err(ae.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=z.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=z.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=z.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case B.EQUALS_SIGN:{this._leaveAttrName(),this.state=z.BEFORE_ATTRIBUTE_VALUE;break}case B.QUOTATION_MARK:case B.APOSTROPHE:case B.LESS_THAN_SIGN:{this._err(ae.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case B.NULL:{this._err(ae.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=z.SELF_CLOSING_START_TAG;break}case B.EQUALS_SIGN:{this.state=z.BEFORE_ATTRIBUTE_VALUE;break}case B.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentTagToken();break}case B.EOF:{this._err(ae.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=z.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=z.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case B.APOSTROPHE:{this.state=z.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case B.GREATER_THAN_SIGN:{this._err(ae.missingAttributeValue),this.state=z.DATA,this.emitCurrentTagToken();break}default:this.state=z.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case B.QUOTATION_MARK:{this.state=z.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case B.AMPERSAND:{this._startCharacterReference();break}case B.NULL:{this._err(ae.unexpectedNullCharacter),this.currentAttr.value+=Mt;break}case B.EOF:{this._err(ae.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case B.APOSTROPHE:{this.state=z.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case B.AMPERSAND:{this._startCharacterReference();break}case B.NULL:{this._err(ae.unexpectedNullCharacter),this.currentAttr.value+=Mt;break}case B.EOF:{this._err(ae.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=z.BEFORE_ATTRIBUTE_NAME;break}case B.AMPERSAND:{this._startCharacterReference();break}case B.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=z.DATA,this.emitCurrentTagToken();break}case B.NULL:{this._err(ae.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(ae.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case B.EOF:{this._err(ae.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=z.BEFORE_ATTRIBUTE_NAME;break}case B.SOLIDUS:{this._leaveAttrValue(),this.state=z.SELF_CLOSING_START_TAG;break}case B.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=z.DATA,this.emitCurrentTagToken();break}case B.EOF:{this._err(ae.eofInTag),this._emitEOFToken();break}default:this._err(ae.missingWhitespaceBetweenAttributes),this.state=z.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case B.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=z.DATA,this.emitCurrentTagToken();break}case B.EOF:{this._err(ae.eofInTag),this._emitEOFToken();break}default:this._err(ae.unexpectedSolidusInTag),this.state=z.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case B.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentComment(n);break}case B.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case B.NULL:{this._err(ae.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=z.COMMENT_START):this._consumeSequenceIfMatch(Gn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Gn.DOCTYPE.length+1),this.state=z.DOCTYPE):this._consumeSequenceIfMatch(Gn.CDATA_START,!0)?this.inForeignNode?this.state=z.CDATA_SECTION:(this._err(ae.cdataInHtmlContent),this._createCommentToken(Gn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=z.BOGUS_COMMENT):this._ensureHibernation()||(this._err(ae.incorrectlyOpenedComment),this._createCommentToken(2),this.state=z.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case B.HYPHEN_MINUS:{this.state=z.COMMENT_START_DASH;break}case B.GREATER_THAN_SIGN:{this._err(ae.abruptClosingOfEmptyComment),this.state=z.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=z.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case B.HYPHEN_MINUS:{this.state=z.COMMENT_END;break}case B.GREATER_THAN_SIGN:{this._err(ae.abruptClosingOfEmptyComment),this.state=z.DATA,this.emitCurrentComment(n);break}case B.EOF:{this._err(ae.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=z.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case B.HYPHEN_MINUS:{this.state=z.COMMENT_END_DASH;break}case B.LESS_THAN_SIGN:{n.data+="<",this.state=z.COMMENT_LESS_THAN_SIGN;break}case B.NULL:{this._err(ae.unexpectedNullCharacter),n.data+=Mt;break}case B.EOF:{this._err(ae.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=z.COMMENT_LESS_THAN_SIGN_BANG;break}case B.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=z.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===B.HYPHEN_MINUS?this.state=z.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=z.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===B.HYPHEN_MINUS?this.state=z.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=z.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==B.GREATER_THAN_SIGN&&t!==B.EOF&&this._err(ae.nestedComment),this.state=z.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case B.HYPHEN_MINUS:{this.state=z.COMMENT_END;break}case B.EOF:{this._err(ae.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=z.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case B.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentComment(n);break}case B.EXCLAMATION_MARK:{this.state=z.COMMENT_END_BANG;break}case B.HYPHEN_MINUS:{n.data+="-";break}case B.EOF:{this._err(ae.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=z.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case B.HYPHEN_MINUS:{n.data+="--!",this.state=z.COMMENT_END_DASH;break}case B.GREATER_THAN_SIGN:{this._err(ae.incorrectlyClosedComment),this.state=z.DATA,this.emitCurrentComment(n);break}case B.EOF:{this._err(ae.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=z.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:{this.state=z.BEFORE_DOCTYPE_NAME;break}case B.GREATER_THAN_SIGN:{this.state=z.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case B.EOF:{this._err(ae.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ae.missingWhitespaceBeforeDoctypeName),this.state=z.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(Eu(t))this._createDoctypeToken(String.fromCharCode(bc(t))),this.state=z.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(ae.unexpectedNullCharacter),this._createDoctypeToken(Mt),this.state=z.DOCTYPE_NAME;break}case B.GREATER_THAN_SIGN:{this._err(ae.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=z.DATA;break}case B.EOF:{this._err(ae.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=z.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=z.AFTER_DOCTYPE_NAME;break}case B.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentDoctype(n);break}case B.NULL:{this._err(ae.unexpectedNullCharacter),n.name+=Mt;break}case B.EOF:{this._err(ae.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=z.DATA,this.emitCurrentDoctype(n);break}case B.EOF:{this._err(ae.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Gn.PUBLIC,!1)?this.state=z.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Gn.SYSTEM,!1)?this.state=z.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(ae.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=z.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=z.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case B.QUOTATION_MARK:{this._err(ae.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=z.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{this._err(ae.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=z.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case B.GREATER_THAN_SIGN:{this._err(ae.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=z.DATA,this.emitCurrentDoctype(n);break}case B.EOF:{this._err(ae.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ae.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=z.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=z.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{n.publicId="",this.state=z.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case B.GREATER_THAN_SIGN:{this._err(ae.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=z.DATA,this.emitCurrentDoctype(n);break}case B.EOF:{this._err(ae.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ae.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case B.QUOTATION_MARK:{this.state=z.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case B.NULL:{this._err(ae.unexpectedNullCharacter),n.publicId+=Mt;break}case B.GREATER_THAN_SIGN:{this._err(ae.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=z.DATA;break}case B.EOF:{this._err(ae.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=z.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case B.NULL:{this._err(ae.unexpectedNullCharacter),n.publicId+=Mt;break}case B.GREATER_THAN_SIGN:{this._err(ae.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=z.DATA;break}case B.EOF:{this._err(ae.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=z.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case B.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentDoctype(n);break}case B.QUOTATION_MARK:{this._err(ae.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{this._err(ae.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case B.EOF:{this._err(ae.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ae.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=z.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=z.DATA;break}case B.QUOTATION_MARK:{n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case B.EOF:{this._err(ae.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ae.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=z.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=z.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case B.QUOTATION_MARK:{this._err(ae.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{this._err(ae.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case B.GREATER_THAN_SIGN:{this._err(ae.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=z.DATA,this.emitCurrentDoctype(n);break}case B.EOF:{this._err(ae.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ae.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=z.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=z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case B.APOSTROPHE:{n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case B.GREATER_THAN_SIGN:{this._err(ae.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=z.DATA,this.emitCurrentDoctype(n);break}case B.EOF:{this._err(ae.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ae.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case B.QUOTATION_MARK:{this.state=z.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case B.NULL:{this._err(ae.unexpectedNullCharacter),n.systemId+=Mt;break}case B.GREATER_THAN_SIGN:{this._err(ae.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=z.DATA;break}case B.EOF:{this._err(ae.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=z.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case B.NULL:{this._err(ae.unexpectedNullCharacter),n.systemId+=Mt;break}case B.GREATER_THAN_SIGN:{this._err(ae.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=z.DATA;break}case B.EOF:{this._err(ae.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=z.DATA;break}case B.EOF:{this._err(ae.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ae.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case B.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=z.DATA;break}case B.NULL:{this._err(ae.unexpectedNullCharacter);break}case B.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case B.RIGHT_SQUARE_BRACKET:{this.state=z.CDATA_SECTION_BRACKET;break}case B.EOF:{this._err(ae.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===B.RIGHT_SQUARE_BRACKET?this.state=z.CDATA_SECTION_END:(this._emitChars("]"),this.state=z.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case B.GREATER_THAN_SIGN:{this.state=z.DATA;break}case B.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=z.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()&&Zy(this.preprocessor.peek(1))?z.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){Zy(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===B.SEMICOLON&&this._err(ae.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const S2=new Set([y.DD,y.DT,y.LI,y.OPTGROUP,y.OPTION,y.P,y.RB,y.RP,y.RT,y.RTC]),tb=new Set([...S2,y.CAPTION,y.COLGROUP,y.TBODY,y.TD,y.TFOOT,y.TH,y.THEAD,y.TR]),Fc=new Set([y.APPLET,y.CAPTION,y.HTML,y.MARQUEE,y.OBJECT,y.TABLE,y.TD,y.TEMPLATE,y.TH]),nI=new Set([...Fc,y.OL,y.UL]),rI=new Set([...Fc,y.BUTTON]),nb=new Set([y.ANNOTATION_XML,y.MI,y.MN,y.MO,y.MS,y.MTEXT]),rb=new Set([y.DESC,y.FOREIGN_OBJECT,y.TITLE]),sI=new Set([y.TR,y.TEMPLATE,y.HTML]),aI=new Set([y.TBODY,y.TFOOT,y.THEAD,y.TEMPLATE,y.HTML]),iI=new Set([y.TABLE,y.TEMPLATE,y.HTML]),oI=new Set([y.TD,y.TH]);class uI{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(p0,ce.HTML)}popUntilTableCellPopped(){this.popUntilPopped(oI,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(iI,ce.HTML)}clearBackToTableBodyContext(){this.clearBackTo(aI,ce.HTML)}clearBackToTableRowContext(){this.clearBackTo(sI,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(rb.has(a))return!1;break}case ce.MATHML:{if(nb.has(a))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Fc)}hasInListItemScope(t){return this.hasInDynamicScope(t,nI)}hasInButtonScope(t){return this.hasInDynamicScope(t,rI)}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(p0.has(n))return!0;if(Fc.has(n))return!1;break}case ce.SVG:{if(rb.has(n))return!1;break}case ce.MATHML:{if(nb.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&&S2.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&tb.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&tb.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 sb={type:Zr.Marker};class lI{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],a=n.length,o=this.treeAdapter.getTagName(t),u=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)===u){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(u=>[u.name,u.value]));let o=0;for(let u=0;u<r.length;u++){const c=r[u];c.attrs.every(d=>a.get(d.name)===d.value)&&(o+=1,o>=Ch&&this.entries.splice(c.idx,1))}}insertMarker(){this.entries.unshift(sb)}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(sb);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}}},_2="html",cI="about:legacy-compat",dI="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",k2=["+//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//"],fI=[...k2,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],hI=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),C2=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],pI=[...C2,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function ab(e,t){return t.some(n=>e.startsWith(n))}function mI(e){return e.name===_2&&e.publicId===null&&(e.systemId===null||e.systemId===cI)}function gI(e){if(e.name!==_2)return Sr.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===dI)return Sr.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),hI.has(n))return Sr.QUIRKS;let r=t===null?fI:k2;if(ab(n,r))return Sr.QUIRKS;if(r=t===null?C2:pI,ab(n,r))return Sr.LIMITED_QUIRKS}return Sr.NO_QUIRKS}const ib={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},yI="definitionurl",bI="definitionURL",EI=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])),xI=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}]]),TI=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])),vI=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 wI(e){const t=e.tagID;return t===y.FONT&&e.attrs.some(({name:r})=>r===Ga.COLOR||r===Ga.SIZE||r===Ga.FACE)||vI.has(t)}function N2(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===yI){e.attrs[t].name=bI;break}}function O2(e){for(let t=0;t<e.attrs.length;t++){const n=EI.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function gp(e){for(let t=0;t<e.attrs.length;t++){const n=xI.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 SI(e){const t=TI.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=yo(e.tagName))}function _I(e,t){return t===ce.MATHML&&(e===y.MI||e===y.MO||e===y.MN||e===y.MS||e===y.MTEXT)}function kI(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===ib.TEXT_HTML||a===ib.APPLICATION_XML}}return t===ce.SVG&&(e===y.FOREIGN_OBJECT||e===y.DESC||e===y.TITLE)}function CI(e,t,n,r){return(!r||r===ce.HTML)&&kI(e,t,n)||(!r||r===ce.MATHML)&&_I(e,t)}const NI="hidden",OI=8,DI=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 AI={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},D2=new Set([y.TABLE,y.TBODY,y.TFOOT,y.THEAD,y.TR]),ob={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:ta,onParseError:null};class ub{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={...ob,...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 tI(this.options,this),this.activeFormattingElements=new lI(this.treeAdapter),this.fragmentContextID=r?yo(this.treeAdapter.getTagName(r)):y.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new uI(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={...ob,...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:AI,u={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(u)}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,u;this.openElements.stackTop===0&&this.fragmentContext?(o=this.fragmentContext,u=this.fragmentContextID):{current:o,currentTagId:u}=this.openElements,this._setContextModes(o,u)}}_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 u=this.treeAdapter.getChildNodes(this.document).find(c=>this.treeAdapter.isDocumentTypeNode(c));u&&this.treeAdapter.setNodeSourceCodeLocation(u,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,u=a[o-1];if(this.treeAdapter.getNodeSourceCodeLocation(u)){const{endLine:d,endCol:h,endOffset:m}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(u,{endLine:d,endCol:h,endOffset:m})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(u,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 CI(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 D2.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 KA[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){oL(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:{ku(this,t);break}case q.AFTER_HEAD:{Cu(this,t);break}case q.IN_BODY:case q.IN_CAPTION:case q.IN_CELL:case q.IN_TEMPLATE:{I2(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:{Nh(this,t);break}case q.IN_TABLE_TEXT:{j2(this,t);break}case q.IN_COLUMN_GROUP:{jc(this,t);break}case q.AFTER_BODY:{Bc(this,t);break}case q.AFTER_AFTER_BODY:{Sc(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){iL(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:{ku(this,t);break}case q.AFTER_HEAD:{Cu(this,t);break}case q.TEXT:{this._insertCharacters(t);break}case q.IN_TABLE:case q.IN_TABLE_BODY:case q.IN_ROW:{Nh(this,t);break}case q.IN_COLUMN_GROUP:{jc(this,t);break}case q.AFTER_BODY:{Bc(this,t);break}case q.AFTER_AFTER_BODY:{Sc(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){m0(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:{m0(this,t);break}case q.IN_TABLE_TEXT:{gu(this,t);break}case q.AFTER_BODY:{jI(this,t);break}case q.AFTER_AFTER_BODY:case q.AFTER_AFTER_FRAMESET:{BI(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case q.INITIAL:{HI(this,t);break}case q.BEFORE_HEAD:case q.IN_HEAD:case q.IN_HEAD_NO_SCRIPT:case q.AFTER_HEAD:{this._err(t,ae.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,ae.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?uL(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case q.INITIAL:{mu(this,t);break}case q.BEFORE_HTML:{UI(this,t);break}case q.BEFORE_HEAD:{WI(this,t);break}case q.IN_HEAD:{Hr(this,t);break}case q.IN_HEAD_NO_SCRIPT:{$I(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:{YR(this,t);break}case q.IN_COLUMN_GROUP:{Ep(this,t);break}case q.IN_TABLE_BODY:{cd(this,t);break}case q.IN_ROW:{dd(this,t);break}case q.IN_CELL:{VR(this,t);break}case q.IN_SELECT:{U2(this,t);break}case q.IN_SELECT_IN_TABLE:{GR(this,t);break}case q.IN_TEMPLATE:{KR(this,t);break}case q.AFTER_BODY:{ZR(this,t);break}case q.IN_FRAMESET:{eL(this,t);break}case q.AFTER_FRAMESET:{nL(this,t);break}case q.AFTER_AFTER_BODY:{sL(this,t);break}case q.AFTER_AFTER_FRAMESET:{aL(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?lL(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case q.INITIAL:{mu(this,t);break}case q.BEFORE_HTML:{zI(this,t);break}case q.BEFORE_HEAD:{YI(this,t);break}case q.IN_HEAD:{qI(this,t);break}case q.IN_HEAD_NO_SCRIPT:{VI(this,t);break}case q.AFTER_HEAD:{GI(this,t);break}case q.IN_BODY:{ld(this,t);break}case q.TEXT:{LR(this,t);break}case q.IN_TABLE:{Ru(this,t);break}case q.IN_TABLE_TEXT:{gu(this,t);break}case q.IN_CAPTION:{qR(this,t);break}case q.IN_COLUMN_GROUP:{$R(this,t);break}case q.IN_TABLE_BODY:{g0(this,t);break}case q.IN_ROW:{H2(this,t);break}case q.IN_CELL:{QR(this,t);break}case q.IN_SELECT:{z2(this,t);break}case q.IN_SELECT_IN_TABLE:{XR(this,t);break}case q.IN_TEMPLATE:{JR(this,t);break}case q.AFTER_BODY:{Y2(this,t);break}case q.IN_FRAMESET:{tL(this,t);break}case q.AFTER_FRAMESET:{rL(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:{ku(this,t);break}case q.AFTER_HEAD:{Cu(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:{P2(this,t);break}case q.TEXT:{MR(this,t);break}case q.IN_TABLE_TEXT:{gu(this,t);break}case q.IN_TEMPLATE:{W2(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:{bp(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:{A2(this,t);break}case q.IN_TABLE:case q.IN_TABLE_BODY:case q.IN_ROW:{Nh(this,t);break}case q.IN_TABLE_TEXT:{F2(this,t);break}}}}function II(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):M2(e,t),n}function RI(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 LI(e,t,n){let r=t,a=e.openElements.getCommonAncestor(t);for(let o=0,u=a;u!==n;o++,u=a){a=e.openElements.getCommonAncestor(u);const c=e.activeFormattingElements.getElementEntry(u),d=c&&o>=DI;!c||d?(d&&e.activeFormattingElements.removeEntry(c),e.openElements.remove(u)):(u=MI(e,c),r===t&&(e.activeFormattingElements.bookmark=c),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(u,r),r=u)}return r}function MI(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 PI(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 FI(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 yp(e,t){for(let n=0;n<OI;n++){const r=II(e,t);if(!r)break;const a=RI(e,r);if(!a)break;e.activeFormattingElements.bookmark=r;const o=LI(e,a,r.element),u=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(o),u&&PI(e,u,o),FI(e,a,r)}}function m0(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function jI(e,t){e._appendCommentNode(t,e.openElements.items[0])}function BI(e,t){e._appendCommentNode(t,e.document)}function bp(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],u=e.treeAdapter.getNodeSourceCodeLocation(o);u&&!u.endTag&&e._setEndLocation(o,t)}}}}function HI(e,t){e._setDocumentType(t);const n=t.forceQuirks?Sr.QUIRKS:gI(t);mI(t)||e._err(t,ae.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=q.BEFORE_HTML}function mu(e,t){e._err(t,ae.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Sr.QUIRKS),e.insertionMode=q.BEFORE_HTML,e._processToken(t)}function UI(e,t){t.tagID===y.HTML?(e._insertElement(t,ce.HTML),e.insertionMode=q.BEFORE_HEAD):wu(e,t)}function zI(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 WI(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 YI(e,t){const n=t.tagID;n===y.HEAD||n===y.BODY||n===y.HTML||n===y.BR?Su(e,t):e._err(t,ae.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,ae.misplacedStartTagForHeadElement);break}default:_u(e,t)}}function qI(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,ae.endTagWithoutMatchingOpenElement)}}function ii(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==y.TEMPLATE&&e._err(t,ae.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(y.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,ae.endTagWithoutMatchingOpenElement)}function _u(e,t){e.openElements.pop(),e.insertionMode=q.AFTER_HEAD,e._processToken(t)}function $I(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,ae.nestedNoscriptInHead);break}default:ku(e,t)}}function VI(e,t){switch(t.tagID){case y.NOSCRIPT:{e.openElements.pop(),e.insertionMode=q.IN_HEAD;break}case y.BR:{ku(e,t);break}default:e._err(t,ae.endTagWithoutMatchingOpenElement)}}function ku(e,t){const n=t.type===et.EOF?ae.openElementsLeftAfterEof:ae.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,ae.abandonedHeadElementChild),e.openElements.push(e.headElement,y.HEAD),Hr(e,t),e.openElements.remove(e.headElement);break}case y.HEAD:{e._err(t,ae.misplacedStartTagForHeadElement);break}default:Cu(e,t)}}function GI(e,t){switch(t.tagID){case y.BODY:case y.HTML:case y.BR:{Cu(e,t);break}case y.TEMPLATE:{ii(e,t);break}default:e._err(t,ae.endTagWithoutMatchingOpenElement)}}function Cu(e,t){e._insertFakeElement(te.BODY,y.BODY),e.insertionMode=q.IN_BODY,ud(e,t)}function ud(e,t){switch(t.type){case et.CHARACTER:{I2(e,t);break}case et.WHITESPACE_CHARACTER:{A2(e,t);break}case et.COMMENT:{m0(e,t);break}case et.START_TAG:{Mn(e,t);break}case et.END_TAG:{ld(e,t);break}case et.EOF:{P2(e,t);break}}}function A2(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function I2(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function XI(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function KI(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function JI(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 ZI(e,t){e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._insertElement(t,ce.HTML)}function eR(e,t){e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&p0.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,ce.HTML)}function tR(e,t){e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._insertElement(t,ce.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function nR(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 rR(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 sR(e,t){e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._insertElement(t,ce.HTML),e.tokenizer.state=Jt.PLAINTEXT}function aR(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 iR(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(te.A);n&&(yp(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 oR(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ce.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function uR(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(y.NOBR)&&(yp(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,ce.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function lR(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ce.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function cR(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 R2(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ce.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function L2(e){const t=v2(e,Ga.TYPE);return t!=null&&t.toLowerCase()===NI}function dR(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ce.HTML),L2(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function fR(e,t){e._appendElement(t,ce.HTML),t.ackSelfClosing=!0}function hR(e,t){e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._appendElement(t,ce.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function pR(e,t){t.tagName=te.IMG,t.tagID=y.IMG,R2(e,t)}function mR(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 gR(e,t){e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Jt.RAWTEXT)}function yR(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Jt.RAWTEXT)}function lb(e,t){e._switchToTextParsing(t,Jt.RAWTEXT)}function bR(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 ER(e,t){e.openElements.currentTagId===y.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,ce.HTML)}function xR(e,t){e.openElements.hasInScope(y.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,ce.HTML)}function TR(e,t){e.openElements.hasInScope(y.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(y.RTC),e._insertElement(t,ce.HTML)}function vR(e,t){e._reconstructActiveFormattingElements(),N2(t),gp(t),t.selfClosing?e._appendElement(t,ce.MATHML):e._insertElement(t,ce.MATHML),t.ackSelfClosing=!0}function wR(e,t){e._reconstructActiveFormattingElements(),O2(t),gp(t),t.selfClosing?e._appendElement(t,ce.SVG):e._insertElement(t,ce.SVG),t.ackSelfClosing=!0}function cb(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:{oR(e,t);break}case y.A:{iR(e,t);break}case y.H1:case y.H2:case y.H3:case y.H4:case y.H5:case y.H6:{eR(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:{ZI(e,t);break}case y.LI:case y.DD:case y.DT:{rR(e,t);break}case y.BR:case y.IMG:case y.WBR:case y.AREA:case y.EMBED:case y.KEYGEN:{R2(e,t);break}case y.HR:{hR(e,t);break}case y.RB:case y.RTC:{xR(e,t);break}case y.RT:case y.RP:{TR(e,t);break}case y.PRE:case y.LISTING:{tR(e,t);break}case y.XMP:{gR(e,t);break}case y.SVG:{wR(e,t);break}case y.HTML:{XI(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:{KI(e,t);break}case y.FORM:{nR(e,t);break}case y.NOBR:{uR(e,t);break}case y.MATH:{vR(e,t);break}case y.TABLE:{cR(e,t);break}case y.INPUT:{dR(e,t);break}case y.PARAM:case y.TRACK:case y.SOURCE:{fR(e,t);break}case y.IMAGE:{pR(e,t);break}case y.BUTTON:{aR(e,t);break}case y.APPLET:case y.OBJECT:case y.MARQUEE:{lR(e,t);break}case y.IFRAME:{yR(e,t);break}case y.SELECT:{bR(e,t);break}case y.OPTION:case y.OPTGROUP:{ER(e,t);break}case y.NOEMBED:case y.NOFRAMES:{lb(e,t);break}case y.FRAMESET:{JI(e,t);break}case y.TEXTAREA:{mR(e,t);break}case y.NOSCRIPT:{e.options.scriptingEnabled?lb(e,t):cb(e,t);break}case y.PLAINTEXT:{sR(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:cb(e,t)}}function SR(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 _R(e,t){e.openElements.hasInScope(y.BODY)&&(e.insertionMode=q.AFTER_BODY,Y2(e,t))}function kR(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function CR(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 NR(e){e.openElements.hasInButtonScope(y.P)||e._insertFakeElement(te.P,y.P),e._closePElement()}function OR(e){e.openElements.hasInListItemScope(y.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(y.LI),e.openElements.popUntilTagNamePopped(y.LI))}function DR(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function AR(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function IR(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function RR(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(te.BR,y.BR),e.openElements.pop(),e.framesetOk=!1}function M2(e,t){const n=t.tagName,r=t.tagID;for(let a=e.openElements.stackTop;a>0;a--){const o=e.openElements.items[a],u=e.openElements.tagIDs[a];if(r===u&&(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,u))break}}function ld(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:{yp(e,t);break}case y.P:{NR(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:{kR(e,t);break}case y.LI:{OR(e);break}case y.DD:case y.DT:{DR(e,t);break}case y.H1:case y.H2:case y.H3:case y.H4:case y.H5:case y.H6:{AR(e);break}case y.BR:{RR(e);break}case y.BODY:{SR(e,t);break}case y.HTML:{_R(e,t);break}case y.FORM:{CR(e);break}case y.APPLET:case y.OBJECT:case y.MARQUEE:{IR(e,t);break}case y.TEMPLATE:{ii(e,t);break}default:M2(e,t)}}function P2(e,t){e.tmplInsertionModeStack.length>0?W2(e,t):bp(e,t)}function LR(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 MR(e,t){e._err(t,ae.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Nh(e,t){if(e.openElements.currentTagId!==void 0&&D2.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:{j2(e,t);break}case et.WHITESPACE_CHARACTER:{F2(e,t);break}}else Ku(e,t)}function PR(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,ce.HTML),e.insertionMode=q.IN_CAPTION}function FR(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ce.HTML),e.insertionMode=q.IN_COLUMN_GROUP}function jR(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(te.COLGROUP,y.COLGROUP),e.insertionMode=q.IN_COLUMN_GROUP,Ep(e,t)}function BR(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ce.HTML),e.insertionMode=q.IN_TABLE_BODY}function HR(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(te.TBODY,y.TBODY),e.insertionMode=q.IN_TABLE_BODY,cd(e,t)}function UR(e,t){e.openElements.hasInTableScope(y.TABLE)&&(e.openElements.popUntilTagNamePopped(y.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function zR(e,t){L2(t)?e._appendElement(t,ce.HTML):Ku(e,t),t.ackSelfClosing=!0}function WR(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:{HR(e,t);break}case y.STYLE:case y.SCRIPT:case y.TEMPLATE:{Hr(e,t);break}case y.COL:{jR(e,t);break}case y.FORM:{WR(e,t);break}case y.TABLE:{UR(e,t);break}case y.TBODY:case y.TFOOT:case y.THEAD:{BR(e,t);break}case y.INPUT:{zR(e,t);break}case y.CAPTION:{PR(e,t);break}case y.COLGROUP:{FR(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,ud(e,t),e.fosterParentingEnabled=n}function F2(e,t){e.pendingCharacterTokens.push(t)}function j2(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 B2=new Set([y.CAPTION,y.COL,y.COLGROUP,y.TBODY,y.TD,y.TFOOT,y.TH,y.THEAD,y.TR]);function YR(e,t){const n=t.tagID;B2.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 qR(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:ld(e,t)}}function Ep(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:jc(e,t)}}function $R(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:jc(e,t)}}function jc(e,t){e.openElements.currentTagId===y.COLGROUP&&(e.openElements.pop(),e.insertionMode=q.IN_TABLE,e._processToken(t))}function cd(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,dd(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 g0(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 dd(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,cd(e,t));break}default:ao(e,t)}}function H2(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,g0(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,g0(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 VR(e,t){const n=t.tagID;B2.has(n)?(e.openElements.hasInTableScope(y.TD)||e.openElements.hasInTableScope(y.TH))&&(e._closeTableCell(),dd(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(),H2(e,t));break}case y.BODY:case y.CAPTION:case y.COL:case y.COLGROUP:case y.HTML:break;default:ld(e,t)}}function U2(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 z2(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 GR(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)):U2(e,t)}function XR(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)):z2(e,t)}function KR(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,Ep(e,t);break}case y.TR:{e.tmplInsertionModeStack[0]=q.IN_TABLE_BODY,e.insertionMode=q.IN_TABLE_BODY,cd(e,t);break}case y.TD:case y.TH:{e.tmplInsertionModeStack[0]=q.IN_ROW,e.insertionMode=q.IN_ROW,dd(e,t);break}default:e.tmplInsertionModeStack[0]=q.IN_BODY,e.insertionMode=q.IN_BODY,Mn(e,t)}}function JR(e,t){t.tagID===y.TEMPLATE&&ii(e,t)}function W2(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(y.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):bp(e,t)}function ZR(e,t){t.tagID===y.HTML?Mn(e,t):Bc(e,t)}function Y2(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 Bc(e,t)}function Bc(e,t){e.insertionMode=q.IN_BODY,ud(e,t)}function eL(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 tL(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 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.tagID===y.HTML&&(e.insertionMode=q.AFTER_AFTER_FRAMESET)}function sL(e,t){t.tagID===y.HTML?Mn(e,t):Sc(e,t)}function Sc(e,t){e.insertionMode=q.IN_BODY,ud(e,t)}function aL(e,t){switch(t.tagID){case y.HTML:{Mn(e,t);break}case y.NOFRAMES:{Hr(e,t);break}}}function iL(e,t){t.chars=Mt,e._insertCharacters(t)}function oL(e,t){e._insertCharacters(t),e.framesetOk=!1}function q2(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 uL(e,t){if(wI(t))q2(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===ce.MATHML?N2(t):r===ce.SVG&&(SI(t),O2(t)),gp(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function lL(e,t){if(t.tagID===y.P||t.tagID===y.BR){q2(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 cL=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,dL=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),db={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function $2(e,t){const n=TL(e),r=y2("type",{handlers:{root:fL,element:hL,text:pL,comment:Q2,doctype:mL,raw:yL},unknown:bL}),a={parser:n?new ub(db):ub.getFragmentParser(void 0,db),handle(c){r(c,a)},stitches:!1,options:t||{}};r(e,a),bo(a,us());const o=n?a.parser.document:a.parser.getFragment(),u=vA(o,{file:a.options.file});return a.stitches&&fp(u,"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}}),u.type==="root"&&u.children.length===1&&u.children[0].type===e.type?u.children[0]:u}function V2(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function fL(e,t){V2(e.children,t)}function hL(e,t){EL(e,t),V2(e.children,t),xL(e,t)}function pL(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 mL(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 gL(e,t){t.stitches=!0;const n=vL(e);if("children"in e&&"children"in n){const r=$2({type:"root",children:e.children},t.options);n.children=r.children}Q2({type:"comment",value:{stitch:n}},t)}function Q2(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 yL(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,G2(t,us(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(cL,"<$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 bL(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))gL(n,t);else{let r="";throw dL.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){G2(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 G2(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 EL(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=CA({...e,children:[]},{space:a===ja.svg?"svg":"html"}),u={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=u,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function xL(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&MA.includes(n)||t.parser.tokenizer.state===Jt.PLAINTEXT)return;bo(t,sd(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 TL(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=sd(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 vL(e){return"children"in e?so({...e,children:[]}):so(e)}function wL(e){return function(t,n){return $2(t,{...e,file:n})}}function SL({chartName:e,chartTitle:t,displayValue:n,field:r,change:a,previousValue:o,lockedPreset:u,lockedRange:c,format:d}){const[h,m]=L.useState(!1),[g,E]=L.useState({top:0,left:0,placement:"below"}),x=L.useRef(null),k=L.useRef(null);L.useEffect(()=>{if(!h||!k.current)return;const C=()=>{var $,Q;if(!k.current)return;const O=k.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=((Q=x.current)==null?void 0:Q.offsetWidth)||220;M+H>window.innerWidth-I&&(M=window.innerWidth-H-I),M<I&&(M=I),E({top:j,left:M,placement:F})};C(),requestAnimationFrame(C)},[h]),L.useEffect(()=>{if(!h)return;function C(O){x.current&&!x.current.contains(O.target)&&k.current&&!k.current.contains(O.target)&&m(!1)}return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[h]),L.useEffect(()=>{if(!h)return;function C(O){O.key==="Escape"&&m(!1)}return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[h]);const S=u?u.replace(/_/g," ").replace(/\b\w/g,C=>C.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:k,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&&Ix.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 _L(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],u=r[3];if(!a)continue;let c;if(u){const h=u.match(/^(\d{4}-\d{2}-\d{2})\.\.(\d{4}-\d{2}-\d{2})$/);h?c={startDate:h[1],endDate:h[2]}:c={preset:u}}const d=`${a}:${o||""}:${u||""}`;n.has(d)||n.set(d,{chartName:a,field:o,locked:c})}return Array.from(n.values())}function kL(e){return Array.from(new Set(e.map(t=>t.chartName)))}function CL(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 NL(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 y0(e){const t=e.locked?e.locked.preset||`${e.locked.startDate}..${e.locked.endDate}`:"current";return`${e.chartName}:${e.field||"value"}:${t}`}function OL(e,t){const n=kL(e),r=L.useMemo(()=>{const m=new Map;return e.forEach(g=>{const E=NL(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=c1({queries:r.map(m=>({queryKey:["chartData",m.chartName,m.params],queryFn:()=>Pt.queryChart(m.chartName,m.params),enabled:r.length>0}))}),o=c1({queries:n.map(m=>({queryKey:["chart",m],queryFn:()=>Pt.getChart(m),enabled:n.length>0}))}),u=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,C;const x=a[E],k=(w=u[g.chartName])==null?void 0:w.chart;if(!((C=(v=x==null?void 0:x.data)==null?void 0:v.rows)!=null&&C[0])||!k)return;const S=x.data.rows[0];g.refs.forEach(O=>{var P,_;const A=y0(O);if(k.type==="kpi"&&((P=k.value)!=null&&P.field)){const N=k.value.field,I=S[N]??0,F={value:I,formatted:CL(I,k.format),fields:{}};if(Object.entries(S).forEach(([j,M])=>{typeof M=="number"&&(F.fields[j]=M)}),(_=k.comparison)!=null&&_.enabled&&k.comparison.field){const j=S[k.comparison.field];j&&j!==0&&(k.comparison.type==="percent_change"?F.change=(I-j)/j*100:F.change=I-j)}m[A]=F}})}),m},[r,a,u]),d=a.some(m=>m.isLoading)||o.some(m=>m.isLoading),h=L.useMemo(()=>{const m={};return n.forEach((g,E)=>{var k;const x=o[E];(k=x==null?void 0:x.data)!=null&&k.title&&(m[g]=x.data.title)}),m},[n,o]);return{values:c,isLoading:d,getRefKey:y0,chartTitles:h}}function DL(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,(u,c,d,h)=>{let m,g,E;if(h){const C=h.match(/^(\d{4}-\d{2}-\d{2})\.\.(\d{4}-\d{2}-\d{2})$/);C?(m={startDate:C[1],endDate:C[2]},E=h):(m={preset:h},g=h)}const k=y0({chartName:c,field:d,locked:m}),S=t[k];if(!S)return u;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 u;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 AL({filter:e,kpiCharts:t,selectedIndex:n,position:r,onSelect:a,onClose:o}){const u=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){u.current&&!u.current.contains(h.target)&&o()}return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[o]),L.useEffect(()=>{var h;const d=(h=u.current)==null?void 0:h.querySelector('[data-selected="true"]');d==null||d.scrollIntoView({block:"nearest"})},[n]),c.length===0?null:Ix.createPortal(p.jsx("div",{ref:u,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 IL({content:e,onUpdate:t,isContentEditing:n,onEditStart:r,onEditEnd:a}){const{isEditing:o}=fo(),[u,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),k=qe(G=>G.globalFilters),{data:S}=is({queryKey:["config"],queryFn:()=>Pt.getConfig()}),w=L.useMemo(()=>(S==null?void 0:S.charts.filter(G=>G.type==="kpi"))||[],[S]),v=L.useMemo(()=>_L(e),[e]),{values:C,isLoading:O,chartTitles:A}=OL(v,k),{content:P,refData:_}=L.useMemo(()=>O||Object.keys(C).length===0?{content:e,refData:{}}:DL(e,C,A),[e,C,O,A]),N=L.useMemo(()=>({"kpi-ref":({children:G,...re})=>{const Z=re["data-ref-id"],K=Z?_[Z]:null;return K?p.jsx(SL,{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:G})}}),[_]);L.useEffect(()=>{n||c(e)},[e,n]),L.useEffect(()=>{n&&d.current&&d.current.focus()},[n]);const I=()=>{t==null||t(u),m(null),a==null||a()},F=()=>{c(e),m(null),a==null||a()},j=()=>{const G=d.current,re=x.current;if(!G||!re)return;const Z=G.selectionStart,K=G.value.substring(0,Z);re.textContent=K;const R=G.getBoundingClientRect(),ue=re.offsetWidth,oe=parseFloat(getComputedStyle(G).lineHeight)||18,U=G.clientWidth-16,Oe=K.split(`
|
|
109
|
-
`),Le=Oe[Oe.length-1]||"";re.textContent=Le;const Te=Math.min(re.offsetWidth,U),$e=(Oe.length-1+Math.floor(ue/U))*oe;E({top:R.top+$e+oe+4-G.scrollTop,left:R.left+Te+8})},M=L.useMemo(()=>{if(!(h!=null&&h.active))return[];const G=h.filter.toLowerCase();return w.filter(re=>re.name.toLowerCase().includes(G)||re.title.toLowerCase().includes(G))},[h,w]),H=G=>{if(!h||!d.current)return;const re=d.current,Z=u.substring(0,h.startPos),K=u.substring(re.selectionStart),R=`{{${G}}}`,ue=Z+R+K;c(ue),m(null);const oe=Z.length+R.length;setTimeout(()=>{re.selectionStart=re.selectionEnd=oe,re.focus()},0)},$=G=>{if(h!=null&&h.active){if(G.key==="ArrowDown"){G.preventDefault(),m(Le=>Le?{...Le,selectedIndex:Math.min(Le.selectedIndex+1,M.length-1)}:null);return}if(G.key==="ArrowUp"){G.preventDefault(),m(Le=>Le?{...Le,selectedIndex:Math.max(Le.selectedIndex-1,0)}:null);return}if(G.key==="Enter"||G.key==="Tab"){G.preventDefault();const Le=M[h.selectedIndex];Le&&H(Le.name);return}if(G.key==="Escape"){G.preventDefault(),m(null);return}}if(G.key==="Escape"){G.preventDefault(),F();return}if(G.key!=="Enter")return;const re=G.currentTarget,{selectionStart:Z,value:K}=re,R=K.substring(0,Z),ue=R.lastIndexOf(`
|
|
110
|
-
`)+1,oe=R.substring(ue),U=oe.match(/^(\s*)([-*])\s(.*)$/);if(U){const Le=U[1]??"",Te=U[2]??"-";if(!(U[3]??"").trim()){G.preventDefault();const tt=K.substring(0,ue)+K.substring(Z);c(tt),setTimeout(()=>{re.selectionStart=re.selectionEnd=ue},0);return}G.preventDefault();const $e=`
|
|
111
|
-
${Le}${Te} `,Ge=K.substring(0,Z)+$e+K.substring(Z);c(Ge),setTimeout(()=>{re.selectionStart=re.selectionEnd=Z+$e.length},0);return}const Oe=oe.match(/^(\s*)(\d+)\.\s(.*)$/);if(Oe){const Le=Oe[1]??"",Te=Oe[2]??"1";if(!(Oe[3]??"").trim()){G.preventDefault();const We=K.substring(0,ue)+K.substring(Z);c(We),setTimeout(()=>{re.selectionStart=re.selectionEnd=ue},0);return}G.preventDefault();const $e=parseInt(Te,10)+1,Ge=`
|
|
112
|
-
${Le}${$e}. `,tt=K.substring(0,Z)+Ge+K.substring(Z);c(tt),setTimeout(()=>{re.selectionStart=re.selectionEnd=Z+Ge.length},0);return}},Q=G=>{const re=G.target.value,Z=G.target.selectionStart;c(re);const K=re.substring(0,Z),R=K.lastIndexOf("{");if(R>=0){const ue=K.substring(R+1);if(!ue.includes("}")&&!ue.includes(`
|
|
113
|
-
`)){const oe=ue.replace(/^\{/,"");m({active:!0,startPos:R,filter:oe,selectedIndex:0}),setTimeout(j,0);return}}m(null)},J=G=>{const re=G.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:u,onChange:Q,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(AL,{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(oA,{rehypePlugins:[wL],components:N,children:P})}),o&&t&&!e&&p.jsx("div",{className:"text-gray-400 text-sm italic",children:"Double-click to edit"})]})}function RL({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:u=>u.preventDefault(),onDoubleClick:u=>{r&&(u.stopPropagation(),r())}}),t&&p.jsx("div",{className:"absolute top-1 right-1 z-10",children:p.jsx("button",{onClick:u=>{u.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,X2=12;function LL(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 ML=40;function PL(e){const t=[];for(let n=0;n<e;n++)for(let r=0;r<X2;r++)t.push({i:`bg-${n}-${r}`,x:r,y:n,w:1,h:1,static:!0});return t}const K2=PL(ML),FL=K2.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 jL({layout:e,onLayoutChange:t}){const{isEditing:n,setPendingLayout:r,setOriginalLayout:a,currentLayout:o,removeWidget:u,updateWidget:c}=fo(),d=L.useRef(""),h=L.useRef(""),m=L.useRef(null),[g,E]=L.useState(0),[x,k]=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||k(null)},[n]);const S=o||e,w=S.gap??16,{gridLayout:v,widgetMap:C,widgetList:O}=L.useMemo(()=>{const I=[],F=new Map,j=[];let M=0;const H=new Set;return S.rows.forEach(($,Q)=>{let J=0,G=0;$.widgets.forEach((re,Z)=>{let K=LL(re);if(H.has(K)){let U=2;for(;H.has(`${K}-${U}`);)U++;K=`${K}-${U}`}H.add(K);const R=re.height??$.height,ue=Math.ceil(R/Ec),oe={i:K,x:re.x??J,y:re.y??M,w:re.cols,h:ue,minW:1,minH:1,static:!n||x===K};I.push(oe),F.set(K,{widget:re,rowIndex:Q,widgetIndex:Z}),j.push({id:K,widget:re,rowIndex:Q,widgetIndex:Z}),J+=re.cols,G=Math.max(G,ue)}),M+=G}),{gridLayout:I,widgetMap:F,widgetList:j}},[S,n,x]),A=L.useCallback(I=>{if(!n)return;const j=[...I.filter(G=>C.has(G.i))].sort((G,re)=>G.y-re.y||G.x-re.x),M=j.map(G=>`${G.i}:${G.x},${G.y},${G.w},${G.h}`).join("|");if(M===h.current)return;h.current=M;const H=new Map;j.forEach(G=>{const re=C.get(G.i);if(!re)return;let Z=H.get(G.y);Z||(Z={items:[]},H.set(G.y,Z));const K=G.h*Ec;Z.items.push({item:G,widget:{...re.widget,cols:G.w,height:K,x:G.x,y:G.y}})});const $=[],Q=[...H.keys()].sort((G,re)=>G-re);for(const G of Q){const re=H.get(G),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,C,S.gap,r,t]),P=L.useCallback((I,F)=>{u(I,F)},[u]),_=L.useCallback((I,F,j)=>{c(I,F,{content:j})},[c]),N={cols:X2,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(oy,{className:"yc-bg-grid",layout:K2,...N,compactType:null,isDraggable:!1,isResizable:!1,autoSize:!1,children:FL}),g>0&&p.jsx(oy,{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(RL,{onRemove:()=>P(j,M),widgetType:F.type,isContentEditing:x===I,onDoubleClick:F.type==="text"?()=>k(I):void 0,children:[F.type==="chart"&&F.ref&&p.jsx(G3,{chartRef:F.ref}),F.type==="text"&&p.jsx(IL,{content:F.content||"",onUpdate:H=>_(j,M,H),isContentEditing:x===I,onEditStart:()=>k(I),onEditEnd:()=>k(null)})]})},I))})]})]})}function BL({isOpen:e,onClose:t,onAdd:n,existingCharts:r}){const{data:a}=io(),[o,u]=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=>u(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 HL(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 UL({dashboardId:e,title:t,description:n,contentRef:r,activeTab:a}){const{isEditing:o,setIsEditing:u,pendingLayout:c,setPendingLayout:d,setOriginalLayout:h,hasChanges:m,addWidget:g,currentLayout:E,undo:x,redo:k,canUndo:S,canRedo:w}=fo(),v=zw(e),C=Ww(),O=ww({queryKey:["chartData"]}),A=jr(),P=(()=>{const K=A.getQueryCache();let R=0;for(const ue of K.getAll()){const oe=ue.queryKey[0];(oe==="chartData"||oe==="chartWithData")&&ue.state.dataUpdatedAt>R&&(R=ue.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),Q=(E==null?void 0:E.rows.flatMap(K=>K.widgets.filter(R=>R.type==="chart"&&R.ref).map(R=>R.ref)))||[],J=()=>{C()},G=async K=>{if(r.current){$(!0),N(!1);try{K==="pdf"?await yN(r.current,`${e}-dashboard`,t):await gN(r.current,`${e}-dashboard`,K)}finally{$(!1)}}},re=async()=>{if(c)try{await v.mutateAsync({layout:c,tab:a}),h(c),d(null),u(!1)}catch(K){console.error("Failed to save:",K)}},Z=()=>{d(null),u(!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:k,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 ",HL(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:()=>G("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:()=>G("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:()=>G("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:()=>u(!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(BL,{isOpen:I,onClose:()=>F(!1),onAdd:g,existingCharts:Q})]})}function zL({filters:e,isEditing:t,onReorder:n,onRename:r}){const[a,o]=L.useState(null),[u,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 k=[...e],S=k.splice(a,1)[0];k.splice(x,0,S),n==null||n(k),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 k=E.label||Du(E.name),S=u===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(WL,{value:k,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),k=typeof E.default=="string"?E.default:void 0;switch(E.type){case"date_range":return p.jsx(ME,{name:E.name,label:x,defaultValue:k},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:k},E.name)}case"dynamic_select":return E.source?p.jsx(Dc,{name:E.name,label:x,source:E.source,defaultValue:k},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(PE,{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(BE,{name:E.name,label:x,defaultValue:k},E.name);case"number":return p.jsx(zE,{name:E.name,label:x,defaultValue:typeof E.default=="number"?E.default:void 0},E.name);case"boolean":return p.jsx(WE,{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 WL({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 u(){a.trim()&&a!==e&&t(a.trim()),r(!1)}return p.jsx("input",{autoFocus:!0,value:a,onChange:c=>o(c.target.value),onBlur:u,onKeyDown:c=>{c.key==="Enter"&&u(),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 YL({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 qL(){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 $L({dashboardId:e,title:t,description:n,contentRef:r,tabs:a,activeTab:o,onTabChange:u,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(UL,{dashboardId:e,title:t,description:n,contentRef:r,activeTab:a?o:void 0}),a&&o&&u&&p.jsx(YL,{tabs:a,activeTab:o,onTabChange:u}),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(zL,{filters:g,isEditing:d,onReorder:E=>m(E),onRename:(E,x)=>{const k=[...g];k[E]={...k[E],label:x},m(k)}}),!d&&p.jsx(qL,{})]})]})}function VL({dashboardId:e,branch:t,initialTab:n}){const{data:r,isLoading:a,error:o}=Uw(e,t),u=L.useRef(null),c=jr(),d=qe(k=>k.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 k=r.tabs.map(w=>w.name);if(h&&k.includes(h))return;const S=n&&k.includes(n)?n:k[0];S&&m(S)},[r==null?void 0:r.tabs,n]);const g=L.useCallback(k=>{var w;m(k);const S=`#/dashboards/${e}`;if(window.history.replaceState(null,"",`${S}?tab=${encodeURIComponent(k)}`),r!=null&&r.name){const v=Object.fromEntries(Object.entries(d).filter(([O,A])=>A!=null));Pt.warmDashboardCache(r.name,v,k).catch(()=>{});const C=(w=r.tabs)==null?void 0:w.find(O=>O.name===k);if(C)for(const O of C.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 k=r.tabs.find(S=>S.name===h);return k==null?void 0:k.layout}return r.layout}},[r,h]),x=L.useMemo(()=>{if(!r)return[];const k=r.filters||[];if(r.tabs){const S=r.tabs.find(v=>v.name===h),w=(S==null?void 0:S.filters)||[];return[...k,...w]}return k},[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(UN,{children:p.jsxs("div",{style:{backgroundColor:"var(--yc-color-background)"},children:[p.jsx($L,{dashboardId:e,title:r.title,description:r.description,contentRef:u,tabs:r.tabs,activeTab:h,onTabChange:r.tabs?g:void 0,filters:x}),p.jsx("div",{ref:u,className:"p-6",children:p.jsx(jL,{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(()=>Cs(()=>import("./LoginPage-OByqHc4n.js"),__vite__mapDeps([0,1])).then(e=>({default:e.LoginPage}))),GL=L.lazy(()=>Cs(()=>import("./SetupWizard-DG46QOHB.js"),__vite__mapDeps([2,1])).then(e=>({default:e.SetupWizard}))),XL=L.lazy(()=>Cs(()=>import("./UserManagement-DZfM0Ovz.js"),__vite__mapDeps([3,1])).then(e=>({default:e.UserManagement}))),KL=L.lazy(()=>Cs(()=>import("./ShareManagement-DAsSD-YD.js"),__vite__mapDeps([4,1])).then(e=>({default:e.ShareManagement}))),JL=L.lazy(()=>Cs(()=>import("./PublicViewer-DUhQW5m5.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 fb(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[u,c]=t.split("?"),d=u==null?void 0:u.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 ZL(e,t){return p.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:p.jsxs("div",{className:"text-center max-w-md p-8",children:[p.jsx("div",{className:"w-12 h-12 mx-auto mb-4 rounded-full bg-red-50 flex items-center justify-center",children:p.jsx("svg",{className:"w-6 h-6 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),p.jsx("h1",{className:"text-lg font-semibold text-gray-900",children:"Something went wrong"}),p.jsx("p",{className:"text-sm text-gray-500 mt-2",children:e.message}),p.jsx("button",{onClick:()=>window.location.reload(),className:"mt-4 px-4 py-2 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-lg transition-colors",children:"Reload page"})]})})}function eM(){Yw();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}=Gb(),u=qe(x=>x.clearAllCrossFilters),[c,d]=L.useState(()=>window.location.hash.replace(/^#/,"")||"");L.useEffect(()=>{const x=()=>{d(window.location.hash.replace(/^#/,"")||""),u()};return window.addEventListener("hashchange",x),()=>window.removeEventListener("hashchange",x)},[u]);const h=L.useCallback(x=>{window.location.hash=x,d(x),u()},[u]);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=fb(c);if(m&&(m.type==="public_chart"||m.type==="public_dashboard"))return p.jsx(L.Suspense,{fallback:p.jsx(xc,{}),children:p.jsx(JL,{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(GL,{})});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=fb(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(XL,{})}):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(KL,{})}):g.type==="dashboard"?p.jsx(VL,{dashboardId:g.name,initialTab:g.params.tab}):p.jsx(BN,{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(Y0,{fallback:ZL,children:p.jsx(Rw,{children:p.jsx(Xw,{currentPath:c,onNavigate:h,onNavigateToUsers:()=>h("/settings/users"),onNavigateToShares:()=>h("/settings/shares"),children:E()})})})}Vv.createRoot(document.getElementById("root")).render(p.jsx(L.StrictMode,{children:p.jsx(_w,{children:p.jsx(eM,{})})}));export{Wu as A,QE as B,Ic as C,xN as D,YE as F,rx as G,ex as H,VE as L,XE as P,cN as S,t0 as T,nx as W,Cs as _,Pt as a,$b as b,Bn as c,Qb as d,io as e,N0 as f,qe as g,ax as h,tx as i,p as j,ZE as k,JE as l,KE as m,GE as n,VL as o,eo as u};
|